@arcgis/core 4.31.0-next.20240901 → 4.31.0-next.20240902
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{7441f70b9a31420374c7.js → 3e3b4cf55834297c4a06.js} +1 -1
- package/assets/esri/core/workers/chunks/{27aa4c43546afa95b7b3.js → 7652ea322401bc32d004.js} +5 -5
- package/assets/esri/core/workers/chunks/8352cac2a5a63e414ca4.js +1 -0
- package/assets/esri/core/workers/chunks/{d307929b3e7339f29321.js → 96ae71415ff5dff69758.js} +1 -1
- package/assets/esri/core/workers/chunks/{81d532a72ada3bf5bc56.js → cca619846c3b5375879c.js} +1 -1
- package/assets/esri/core/workers/chunks/dbf24dc999b882bbcbcf.js +250 -0
- package/core/NestedMap.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/analysis/Viewshed/ArrowManipulator.js +1 -1
- package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolConfig.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/environment/StarsTechnique.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfigurationKey.js +5 -0
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/widget.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/04aa98e7f73b00a7ad7a.js +0 -1
- package/assets/esri/core/workers/chunks/73a8e17e8e9292705057.js +0 -250
|
@@ -142,7 +142,7 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
|
|
|
142
142
|
${H}
|
|
143
143
|
outputObjectAndLayerIdColor();`);break;case o.V.Highlight:t.include(f.Q,e),T.main.add(S.H`
|
|
144
144
|
${H}
|
|
145
|
-
outputHighlightNet(voccluded == 1.0);`)}return t}function z(e){return e.outlineColor[3]>0&&e.outlineSize>0}function R(e,t=M){return e.textureIsSignedDistanceField?function(e,t,r){null!=t?(0,i.hZ)(r,e[0]*(t[2]-t[0])+t[0],e[1]*(t[3]-t[1])+t[1]):(0,i.hZ)(r,0,0)}(e.anchorPosition,e.distanceFieldBoundingBox,t):(0,i.C)(t,e.anchorPosition),t}const M=(0,s.vt)(),P=Object.freeze(Object.defineProperty({__proto__:null,build:T,calculateAnchorPosForRendering:R},Symbol.toStringTag,{value:"Module"}))},69540:(e,t,r)=>{r.d(t,{O:()=>h,P:()=>u});var i=r(90237),s=r(69622),n=(r(44208),r(4718)),o=(r(53966),r(97768)),a=r(35666),l=r(88620),c=r(40608);const h=e=>{let t=class extends e{clone(){const e=(0,l.oY)(this);(0,o.Lw)(e,"unable to clone instance of non-accessor class");const t=e.metadata,r=e.store,i={},s=new Map;for(const e in t){const o=t[e],l=r?.originOf(e),c=o.clonable;if(o.readOnly||!1===c||l!==a.Gr.USER&&l!==a.Gr.DEFAULTS&&l!==a.Gr.WEB_MAP&&l!==a.Gr.WEB_SCENE)continue;const h=this[e];let u=null;u="function"==typeof c?c(h):"reference"===c?h:(0,n.TU)(h),null!=h&&null==u||(l===a.Gr.DEFAULTS?s.set(e,u):i[e]=u)}const c=new(0,Object.getPrototypeOf(this).constructor)(i);if(s.size){const e=(0,l.oY)(c)?.store;if(e)for(const[t,r]of s)e.set(t,r,a.Gr.DEFAULTS)}return c}};return t=(0,i._)([(0,c.$)("esri.core.Clonable")],t),t};let u=class extends(h(s.A)){};u=(0,i._)([(0,c.$)("esri.core.Clonable")],u)},55359:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(57219);class s{constructor(e,t){this._storage=new i.F,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},57219:(e,t,r)=>{r.d(t,{F:()=>a,Mn:()=>o});var i,s,n=r(3694);(s=i||(i={}))[s.ALL=0]="ALL",s[s.SOME=1]="SOME";class o{constructor(e,t,r){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,r,i=0){this._storage.put(this,e,t,r,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,r){this._storage.updateSize(this,e,t,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new n.A,this._users=new n.A}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const r=this._db.get(e.id+t);return r?.size??0}put(e,t,r,s,n){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,i.ALL)),s>this._maxSize)return void this._notifyRemove(t,r,s,i.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,r,0,i.ALL);const a=1+Math.max(n,-4)- -3;this._db.set(t,new c(r,s,a)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t,r,s){t=e.id+t;const n=this._db.get(t);if(n&&n.entry===r){for(this._size-=n.size,e.size-=n.size;s>this._maxSize;){const e=this._notifyRemove(t,r,s,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}n.size=s,this._size+=s,e.size+=s,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},r=new Array;this._db.forEach(((e,i)=>{const s=e.lifetime;r[s]=(r[s]||0)+e.size,this._users.forAll((r=>{const{id:s,name:n}=r;if(i.startsWith(s)){const r=t[n]||0;t[n]=r+e.size}}))}));const i={};this._users.forAll((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[r]||0;t[r]=s,i[r]=Math.round(100*e.hitRate)+"%"}else i[r]="0%"}));const s=Object.keys(t);s.sort(((e,r)=>t[r]-t[e])),s.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+i[r]));for(let t=r.length-1;t>=0;--t){const i=r[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,i){let s;return this._removeFuncs.some((n=>{if(e.startsWith(n[0])){const e=n[1](t,i,r);return"number"==typeof e&&(s=e),!0}return!1})),s}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const r=e?.id;let i=!0;for(;i;){i=!1;for(const[s,n]of this._db)if(0===n.lifetime&&(!r||s.startsWith(r))){if(this._purgeItem(s,n,e),t.size<=.9*t.maxSize)return;i||=this._db.has(s)}}for(const[i,s]of this._db)if((!r||i.startsWith(r))&&(this._purgeItem(i,s,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,r=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=s&&s>0&&(this._size+=s,r&&(r.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class c{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}}},32587:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(62788),s=r(95488);class n{constructor(e){this._observable=new s.I,this._map=new Map(e)}get size(){return(0,i.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,i.gc)(this._observable),this._map.entries()}forEach(e,t){(0,i.gc)(this._observable),this._map.forEach(((r,i)=>e.call(t,r,i,this)),t)}get(e){return(0,i.gc)(this._observable),this._map.get(e)}has(e){return(0,i.gc)(this._observable),this._map.has(e)}keys(){return(0,i.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,i.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,i.gc)(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},21818:(e,t,r)=>{function i(e){}r.d(t,{Xb:()=>i}),r(44208)},75503:(e,t,r)=>{r.d(t,{E:()=>A,w:()=>o});var i=r(4576),s=(r(44208),r(3694)),n=r(11006);class o{constructor(e=9,t){this._compareMinX=u,this._compareMinY=d,this._toBBox=e=>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(),w.prune(),b.prune(),x.prune(),S.prune()}all(e){a(this._data,e)}search(e,t){let r=this._data;const i=this._toBBox;if(v(e,r))for(w.clear();r;){for(let s=0,n=r.children.length;s<n;s++){const n=r.children[s],o=r.leaf?i(n):n;v(e,o)&&(r.leaf?t(n):_(e,o)?a(n,t):w.push(n))}r=w.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!v(e,t))return!1;for(w.clear();t;){for(let i=0,s=t.children.length;i<s;i++){const s=t.children[i],n=t.leaf?r(s):s;if(v(e,n)){if(t.leaf||_(e,n))return!0;w.push(s)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),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 C([]),this}remove(e){if(!e)return this;let t,r=this._data,s=null,n=0,o=!1;const a=this._toBBox(e);for(x.clear(),S.clear();r||x.length>0;){if(r||(r=x.pop(),s=x.data[x.length-1],n=S.pop()??0,o=!0),r.leaf&&(t=(0,i.qh)(r.children,e,r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),x.push(r),this._condense(x),this;o||r.leaf||!_(r,a)?s?(n++,r=s.children[n],o=!1):r=null:(x.push(r),S.push(n),n=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,i){const s=r-t+1;let n=this._maxEntries;if(s<=n){const i=new C(e.slice(t,r+1));return l(i,this._toBBox),i}i||(i=Math.ceil(Math.log(s)/Math.log(n)),n=Math.ceil(s/n**(i-1)));const o=new E([]);o.height=i;const a=Math.ceil(s/n),c=a*Math.ceil(Math.sqrt(n));y(e,t,r,c,this._compareMinX);for(let s=t;s<=r;s+=c){const t=Math.min(s+c-1,r);y(e,s,t,a,this._compareMinY);for(let r=s;r<=t;r+=a){const s=Math.min(r+a-1,t);o.children.push(this._build(e,r,s,i-1))}}return l(o,this._toBBox),o}_insert(e,t,r){const i=this._toBBox,s=r?e:i(e);x.clear();const n=function(e,t,r,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==r;){let r,i=1/0,s=1/0;for(let n=0,o=t.children.length;n<o;n++){const o=t.children[n],a=f(o),l=p(e,o)-a;l<s?(s=l,i=a<i?a:i,r=o):l===s&&a<i&&(i=a,r=o)}t=r||t.children[0]}return t}(s,this._data,t,x);for(n.children.push(e),h(n,s);t>=0&&x.data[t].children.length>this._maxEntries;)this._split(x,t),t--;!function(e,t,r){for(let i=r;i>=0;i--)h(t.data[i],e)}(s,x,t)}_split(e,t){const r=e.data[t],i=r.children.length,s=this._minEntries;this._chooseSplitAxis(r,s,i);const n=this._chooseSplitIndex(r,s,i);if(!n)return;const o=r.children.splice(n,r.children.length-n),a=r.leaf?new C(o):new E(o);a.height=r.height,l(r,this._toBBox),l(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,t){this._data=new E([e,t]),this._data.height=e.height+1,l(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let i,s,n;i=s=1/0;for(let o=t;o<=r-t;o++){const t=c(e,0,o,this._toBBox),a=c(e,o,r,this._toBBox),l=g(t,a),h=f(t)+f(a);l<i?(i=l,n=o,s=h<s?h:s):l===i&&h<s&&(s=h,n=o)}return n}_chooseSplitAxis(e,t,r){const i=e.leaf?this._compareMinX:u,s=e.leaf?this._compareMinY:d;this._allDistMargin(e,t,r,i)<this._allDistMargin(e,t,r,s)&&e.children.sort(i)}_allDistMargin(e,t,r,i){e.children.sort(i);const s=this._toBBox,n=c(e,0,t,s),o=c(e,r-t,r,s);let a=m(n)+m(o);for(let i=t;i<r-t;i++){const t=e.children[i];h(n,e.leaf?s(t):t),a+=m(n)}for(let i=r-t-1;i>=t;i--){const t=e.children[i];h(o,e.leaf?s(t):t),a+=m(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const s=e.data[t-1],n=s.children;n.splice((0,i.qh)(n,r,n.length,s.indexHint),1)}else this.clear();else l(r,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 a(e,t){let r=e;for(b.clear();r;){if(!0===r.leaf)for(const e of r.children)t(e);else b.pushArray(r.children);r=b.pop()??null}}function l(e,t){c(e,0,e.children.length,t,e)}function c(e,t,r,i,s){s||(s=new C([])),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let n,o=t;o<r;o++)n=e.children[o],h(s,e.leaf?i(n):n);return s}function h(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 u(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function f(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(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 r=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,s-r)*Math.max(0,n-i)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function v(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,r,i,s){const o=[t,r];for(;o.length;){const t=o.pop(),r=o.pop();if(t-r<=i)continue;const a=r+Math.ceil((t-r)/i/2)*i;(0,n.q)(e,a,r,t,s),o.push(r,a,a,t)}}const w=new s.A,b=new s.A,x=new s.A,S=new s.A({deallocator:void 0});class A{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class O extends A{constructor(){super(...arguments),this.height=1,this.indexHint=new i.vW}}class C extends O{constructor(e){super(),this.children=e,this.leaf=!0}}class E extends O{constructor(e){super(),this.children=e,this.leaf=!1}}},36708:(e,t,r)=>{r.d(t,{C_:()=>d,OH:()=>p,Vh:()=>g,on:()=>u,pc:()=>_,wB:()=>l,z7:()=>c}),r(60999),r(5503);var i=r(37955),s=r(36563),n=r(97768),o=r(74887),a=r(14012);function l(e,t,r={}){return h(e,t,r,f)}function c(e,t,r={}){return h(e,t,r,m)}function h(e,t,r={},i){let s=null;const o=r.once?(e,r)=>{i(e)&&((0,n.xt)(s),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(s=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return s}function u(e,t,r,o={}){let a=null,c=null,h=null;function u(){a&&c&&(c.remove(),o.onListenerRemove?.(a),a=null,c=null)}function d(e){o.once&&o.once&&(0,n.xt)(h),r(e)}const f=l(e,((e,r)=>{u(),(0,i.wb)(e)&&(a=e,c=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,s.hA)((()=>{f.remove(),u()})),h}function d(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,n.xt)(a)}return new Promise(((i,n)=>{a=(0,s.vE)([(0,o.u7)(r,(()=>{l(),n((0,o.NK)())})),h(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,m,t)}function f(e){return!0}function m(e){return!!e}r(80559);const p={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},31756:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(83047),s=r(79258);const n={unknown:1,inches:(0,i.oU)(1,"meters","inches"),feet:(0,i.oU)(1,"meters","feet"),"us-feet":(0,i.oU)(1,"meters","us-feet"),yards:(0,i.oU)(1,"meters","yards"),miles:(0,i.oU)(1,"meters","miles"),"nautical-miles":(0,i.oU)(1,"meters","nautical-miles"),millimeters:(0,i.oU)(1,"meters","millimeters"),centimeters:(0,i.oU)(1,"meters","centimeters"),decimeters:(0,i.oU)(1,"meters","decimeters"),meters:(0,i.oU)(1,"meters","meters"),kilometers:(0,i.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.vl)(1,"meters",s.$O.radius)}},58501:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(62815);function s(e,t,r){if(!r?.features||!r.hasZ)return;const s=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of r.features)s(e.geometry)}},79677:(e,t,r)=>{r.d(t,{A:()=>f});var i,s=r(90237),n=r(25482),o=r(88930),a=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),c=r(40608),h=r(43937),u=r(56400);let d=i=class extends n.oY{static get allTime(){return m}static get empty(){return p}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===i&&r===s}expandTo(e,t=u.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.lL)(r,e,t));let s=this.end;if(s){const r=(0,o.lL)(s,e,t);s=s.getTime()===r.getTime()?r:(0,o.S1)(r,1,e,t)}return new i({start:r,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,a;return s>=t&&s<=r?o=s:t>=s&&t<=n&&(o=t),r>=s&&r<=n?a=r:n>=t&&n<=r&&(a=n),null==o||null==a||isNaN(o)||isNaN(a)?i.empty:new i({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(e,t,r=u.qU){if(this.isEmpty||this.isAllTime)return this.clone();const s=new i,{start:n,end:a}=this;return null!=n&&(s.start=(0,o.S1)(n,e,t,r)),null!=a&&(s.end=(0,o.S1)(a,e,t,r)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return m.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,s._)([(0,a.M)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,s._)([(0,l.w)("end")],d.prototype,"readEnd",null),(0,s._)([(0,h.K)("end")],d.prototype,"writeEnd",null),(0,s._)([(0,a.M)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,s._)([(0,a.M)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,s._)([(0,a.M)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,s._)([(0,l.w)("start")],d.prototype,"readStart",null),(0,s._)([(0,h.K)("start")],d.prototype,"writeStart",null),d=i=(0,s._)([(0,c.$)("esri.time.TimeExtent")],d);const f=d,m=new d,p=new d({start:void 0,end:void 0})},18341:(e,t,r)=>{r.r(t),r.d(t,{default:()=>gr});var i=r(90237),s=r(65529),n=r(74887),o=r(36708),a=r(10107),l=r(44208),c=(r(53966),r(87811),r(40608)),h=r(16930),u=r(17970),d=r(61956),f=r(69622),m=r(60999),p=r(32587);let g=class extends f.A{constructor(e){super(e),this._removing=0,this._tiles=new p.A}destroy(){for(const e of this._tiles.values())e.remove();this._tiles.clear()}get updating(){if(this._removing>0)return!0;for(const e of this._tiles.values())if(!e.finished)return!0;return!1}async onTileTreeChange(e){const{added:t,removed:r}=e,i=this._tiles;for(const e of r){const t=i.get(e);null!=t&&(t.abort(),i.delete(e))}for(const e of t)i.has(e.id)||i.set(e.id,(0,m.UT)((t=>this._addTile(e,t))));await this._removeTiles(r)}async _addTile(e,t){const r=await this.addTile(e,t);return(0,n.Te)(t),r}async _removeTiles(e){this._removing++,await this.removeTiles(e),this._removing--}};(0,i._)([(0,a.M)()],g.prototype,"updating",null),(0,i._)([(0,a.M)({constructOnly:!0})],g.prototype,"addTile",void 0),(0,i._)([(0,a.M)({constructOnly:!0})],g.prototype,"removeTiles",void 0),(0,i._)([(0,a.M)()],g.prototype,"_removing",void 0),g=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],g);var _=r(75503),v=r(27647),y=r(92722);class w{constructor(e,t){this._index=e,this._view=t}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new b(this._index,this._view,e)}}class b extends w{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,v.Q)(new y.A,this._geometryOverride,e.hasZ,e.hasM)}}class x{constructor(){this._storedTiles=new Map,this._pageBounds=new Map,this.events=new s.A,this.featureAdapter=S.shared}addTile(e){this._storedTiles.set(e.descriptor.id,e);for(const t of e.pages)this._addPage(t)}removeTile(e){const t=this._storedTiles,r=t.get(e);if(null!=r){t.delete(e);for(const e of r.pages)this._removePage(e)}}_addPage(e){const{featureCount:t}=e;if(0===t)return;const r=new _.w(9,(t=>e.getBounds(t))),i=new Array;for(let e=0;e<t;++e)i[e]=e;r.load(i),this._pageBounds.set(e,r),this.events.emit("changed")}_removePage(e){this._pageBounds.delete(e),this.events.emit("changed")}clear(){this._storedTiles.clear(),this._pageBounds.clear(),this.events.emit("changed")}forEach(e){for(const[t,r]of this._pageBounds)r.all((r=>e(new w(r,t))))}forEachInBounds(e,t){A.minX=e[0],A.minY=e[1],A.maxX=e[2],A.maxY=e[3];for(const[e,r]of this._pageBounds)r.search(A,(r=>t(new w(r,e))))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,s=-1/0;for(const e of this._pageBounds.values()){const{minX:n,minY:o,maxX:a,maxY:l}=e.toJSON();t=Math.min(t,n),r=Math.min(r,o),i=Math.min(i,a),s=Math.min(s,l)}return{xmin:t,ymin:r,xmax:i,ymax:s,spatialReference:e}}}class S{getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}S.shared=new S;const A=new _.E;var O=r(19419),C=r(80893);class E{constructor(e,t){this.descriptor=e,this.pages=t}}var T=r(49186),z=r(51624),R=r(51850),M=r(70328),P=r(62577),I=r(95466),D=r(53655);class B{constructor(e){const t=new z.A(new Uint8Array(e),new DataView(e));this._reader=t,this._index=function(e){for(;e.next();){if(2===e.tag())return H(e.getMessage());e.skip()}G()}(t)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,s=r.get(t)?.index;if(null==s)return;const n=i[e*r.fields.length+s],o=this._reader;return o.move(n),L(o)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,s=this._reader,n={};for(const e of t.fields){const t=r[i+e.index];s.move(t),n[e.name]=L(s)}return n}getCoordinates(e,t,r=0){const i=this._reader,{transform:s,featureIndices:n}=this._index,{scale:o,translate:a}=s;i.move(n[e]),this._readCoordinates(o,a,t,r)}getOptimizedGeometry(e){const t=(0,R.vt)();return this.getCoordinates(e,t),new y.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,N);const[i,s,n]=N,o=[i,s];return t&&(o[3]=n),r&&(o[t?4:3]=0),new y.A([],o)}getBounds(e){this.getCoordinates(e,N);const[t,r]=N,i=new _.E;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,N);const[t,r,i]=N;return(0,M.fA)(t,r,i,t,r,i)}readAllObjectIds(e,t=0){const r=this._reader,{_index:i,featureCount:s}=this,{objectIdFieldName:n,attributeIndices:o,fieldsIndex:a}=i,l=a.get(n).index,c=a.fields.length;for(let i=0;i<s;++i){const s=o[i*c+l];r.move(s),e[t++]=L(r)}return t}readAllCoordinates(e,t=0){const r=this._reader,{transform:i,featureIndices:s}=this._index,{scale:n,translate:o}=i;for(const i of s)r.move(i),t=this._readCoordinates(n,o,e,t);return t}_readCoordinates([e,t,r],[i,s,n],o,a){const l=this._reader,c=l.getLength(),h=l.pos()+c;for(;l.pos()<h&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),h=l.pos()+c;for(;l.pos()<h&&l.next();)3===l.tag()?(l.getUInt32(),o[a++]=i+e*l.getSInt64(),o[a++]=s+t*l.getSInt64(),o[a++]=n+r*l.getSInt64()):l.skip();break}default:l.skip()}return a}}function H(e){for(;e.next();){if(1===e.tag())return F(e.getMessage());e.skip()}G()}function F(e){let t,r,i=!1,s=!1,n=0;const o=new Array,a=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&G();break;case 9:i=e.getBool()??!1;break;case 12:t=(0,P.Q1)(e.processMessage(D.ae));break;case 13:{const t=e.processMessage(D.cn);t.index=n++,o.push(t);break}case 15:{a.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:s=e.getBool()??!1;break;default:e.skip()}const c=new I.A(o);return null!=t&&s&&null!=r&&c.has(r)||G(),{transform:t,exceededTransferLimit:i,fieldsIndex:c,objectIdFieldName:r,featureIndices:a,attributeIndices:l}}function G(){const e=new T.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function L(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const N=(0,R.vt)();class V{constructor(e,t,r,i,s){this.spatialReference=e,this.url=r,this.objectIdField=i,this.capabilities=s;const{supportsMaxRecordCountFactor:n,maxRecordCount:o}=this.capabilities.query,a=o??8e3,l=(n?4:null)??1,c=a*l;this._pageSize=Math.min(8e3,c);const h=t.clone();h.cacheHint=!0,h.resultType="tile",h.outSpatialReference=e,h.returnGeometry=!0,h.returnZ=!0,h.maxRecordCountFactor=l,h.num=a,h.outFields=[i],this._baseQuery=h}async fetch(e,t){const{spatialReference:r}=this,i=(0,O.w1)(e.extent,r),s=this._baseQuery.clone();s.geometry=i;const o=new Array;let a=0,l=!1,c=1;for(;!l;){const e=[];for(let r=0;r<c;++r)e.push(this._fetchPage(s,a++,t));const r=await Promise.all(e);(0,n.Te)(t);for(const e of r){const t=0!==e.featureCount;l||=!e.exceededTransferLimit||!t,t&&o.push(e)}c=Math.min(c+1,4)}return new E(e,o)}async _fetchPage(e,t,r){const i=e.clone();i.start=t*this._pageSize;const s=(await(0,C.kS)(this.url,i,{signal:r})).data;return(0,n.Te)(r),new B(s)}}var j=r(9762),U=r(27993);class W{constructor(e,t,r){this.objectIdField=e,this.spatialReference=t,this.renderSpatialReference=r}process(e){const{pages:t}=e;if(0===t.length)return null;const r=t.reduce(((e,{featureCount:t})=>e+t),0);if(0===r)return null;const i=this.spatialReference,s=this.renderSpatialReference,n=new Float64Array(3*r),o=new Uint32Array(r);let a=0,l=0;for(const e of t)a=e.readAllCoordinates(n,a),l=e.readAllObjectIds(o,l);const c=new Float64Array(n.length);if(!(0,j.projectBuffer)(n,i,0,c,s,0,r))throw new Error("Failed to project coordinates");const h=e.descriptor.extent,u=(0,O.gX)(h),d=(0,R.vt)();return(0,U.F)([u[0],u[1],0],i,d,s),{numFeatures:r,coordinates:c,objectIds:o,tileId:e.descriptor.id,localOrigin:d}}}var Y=r(36563),$=r(97768),k=r(24151),X=(r(37585),r(48163)),q=r(34727),Q=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const Z=[];{const e=16;for(let t=0;t<360;t+=360/e)Z.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}var J,K;(K=J||(J={}))[K.Left=0]="Left",K[K.Center=1]="Center",K[K.Right=2]="Right",Object.freeze({left:0,center:.5,right:1});const ee=Object.freeze({"bottom-left":(0,X.fA)(0,0),bottom:(0,X.fA)(.5,0),"bottom-right":(0,X.fA)(1,0),left:(0,X.fA)(0,.5),center:(0,X.fA)(.5,.5),right:(0,X.fA)(1,.5),"top-left":(0,X.fA)(0,1),top:(0,X.fA)(.5,1),"top-right":(0,X.fA)(1,1)});var te=r(4431),re=r(49255);const ie={required:[]};re.V.Depth;class se extends f.A{consumes(){return ie}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}modify(e){}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return!1}forEachGeometry(e){}queryRenderOccludedState(e){return!1}}class ne extends se{constructor(){super(...arguments),this.drapedPriority=0}}var oe=r(89192);class ae{constructor(e,t){this._material=e,this._repository=t,this._map=new Map}dispose(){this._map.forEach(((e,t)=>{null!=e&&this._repository.release(this._material,t)}))}load(e,t,r){const i=this._material.produces.get(t);if(!i?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,t,r));const s=this._map.get(r);if(null!=s){if(s.ensureResources(e)===oe.Am.LOADED)return s;this._repository.requestRender()}return null}}var le=r(13464),ce=r(72824);class he extends ce.gy{constructor(e=(0,R.vt)()){super(),this.origin=e}get slicePlaneLocalOrigin(){return this.origin}}var ue,de,fe=r(4576),me=r(81139),pe=r(3694),ge=r(3483),_e=r(58083),ve=r(9093);!function(e){e[e.ADD=0]="ADD",e[e.UPDATE=1]="UPDATE",e[e.REMOVE=2]="REMOVE"}(ue||(ue={})),function(e){e[e.NONE=0]="NONE",e[e.VISIBILITY=1]="VISIBILITY",e[e.GEOMETRY=2]="GEOMETRY",e[e.TRANSFORMATION=4]="TRANSFORMATION",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.OCCLUDEE=16]="OCCLUDEE"}(de||(de={}));var ye=r(620);class we{constructor(e=0,t=0){this.from=e,this.to=t}get numElements(){return this.to-this.from}}function be(e){const t=new Map;e.forAll((e=>t.set(e.from,e)));let r=!0;for(;r;){r=!1;for(let i=0;i<e.length;++i){const s=e.data[i],n=t.get(s.to);if(!n)return;s.to=n.to,t.delete(n.from),e.removeUnordered(n),r=!0}}}class xe extends we{constructor(e,t,r){super(t,r),this.geometry=e}get isVisible(){return this.geometry.visible}get hasHighlights(){return this.isVisible&&this.geometry.hasHighlights}foreachHighlightGroup(e){this.isVisible&&this.geometry.foreachHighlightGroup(e)}get hasOccludees(){return null!=this.geometry.occludees}}class Se{constructor(){this.first=0,this.count=0}}class Ae{constructor(){this._numElements=0,this._instances=new Map,this.holes=new pe.A({allocator:e=>e||new we,deallocator:null}),this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightGroups=new Set,this.drawCommandsDefault=Oe(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=Oe(),this.drawCommandsShadowHighlightRest=Oe()}get numElements(){return this._numElements}get instances(){return this._instances}get hasHighlights(){return this.highlightGroups.size>0}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightGroups.clear()}updateIfDrawCommandsDirty(e){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const e of this.instances.values())this.updateDrawState(e);this.updateDrawCommands(e)}}addInstance(e,t){this.deleteInstance(e),this._instances.set(e,t),this._numElements+=t.numElements}deleteInstance(e){const t=this._instances.get(e);t&&(this._numElements-=t.numElements,this._instances.delete(e))}updateInstance(e,t,r){const i=this._instances.get(e);i&&(this._numElements-=i.numElements,i.from=t,i.to=r,this._numElements+=i.numElements)}updateDrawState(e){e.isVisible?(e.foreachHighlightGroup((e=>this.highlightGroups.add(e))),e.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(e){if(this.drawCommandsDefault.clear(),this.drawCommandsHighlights.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsShadowHighlightRest.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;if(!this.needsMultipleCommands()){const t=this.drawCommandsDefault.pushNew(),r=this.holes.front();return null!=this.vao&&1===this.holes.length&&r.to===Math.floor(this.vao.byteSize/e)?(t.first=0,void(t.count=r.from)):(t.first=1/0,t.count=0,this._instances.forEach((e=>{t.first=Math.min(t.first,e.from),t.count=Math.max(t.count,e.to)})),void(t.count-=t.first))}const t=Array.from(this._instances.values()).sort(((e,t)=>e.from===t.from?e.to-t.to:e.from-t.from)),{drawCommandsHighlights:r}=this;for(const e of t)e.isVisible&&(Ce(e.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,e),e.hasHighlights?e.foreachHighlightGroup((t=>{let i=r.get(t);i||(i=Oe(),r.set(t,i)),Ce(i,e)})):Ce(this.drawCommandsShadowHighlightRest,e))}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}}function Oe(){return new pe.A({allocator:e=>e||new Se,deallocator:e=>e})}function Ce(e,t){const r=e.back();if(null==r){const r=e.pushNew();return r.first=t.from,void(r.count=t.numElements)}if(function(e,t){return e.first+e.count>=t.from}(r,t)){const e=t.from-r.first+t.numElements;r.count=e}else{const r=e.pushNew();r.first=t.from,r.count=t.numElements}}class Ee{constructor(e){this.origin=e,this.buffers=new Array}dispose(){this.buffers.forEach((e=>e.vao.dispose())),this.buffers.length=0}findBuffer(e){return this.buffers.find((t=>t.instances.has(e)))}}let Te=class extends ne{get _hasAnyHighlight(){return this._highlightGroups.size>0}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new he,this._highlightGroups=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=(0,$.WD)(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==re.V.Highlight&&t!==re.V.ShadowHighlight||this._hasAnyHighlight))&&e(t)))}))}initializeRenderContext(e,t){this._glMaterials=new ae(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,(0,te.U)(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.usedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(null==t)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const e=i.renderGeometry,s=this._dataByOrigin.get(e.localOrigin.id),n=s?.findBuffer(e.id);if(null==n)return;const o=n.instances.get(e.id);if(i.updateType&(de.GEOMETRY|de.TRANSFORMATION)){const i=Ne(t.elementCount(o.geometry.geometry.attributes)*r),s=t.vertexBufferLayout.createView(i.buffer);this._writeGeometry(e,s,0),n.vao.vertexBuffers.get("geometry").setSubData(i,o.from*r,0,o.numElements*r)}i.updateType&(de.HIGHLIGHT|de.OCCLUDEE|de.VISIBILITY)&&(n.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new me.O;for(const t of e){const e=t.localOrigin;if(null==e)continue;let i=r.get(e.id,null);null==i&&(i=new ze(e.vec3),r.set(e.id,null,i)),i.changes.push(t)}for(const e of t){const t=e.localOrigin;if(null==t)continue;const i=this._dataByOrigin.get(t.id),s=i?.findBuffer(e.id);if(null==s)continue;let n=r.get(t.id,s);null==n&&(n=new ze(t.vec3),r.set(t.id,s,n)),n.changes.push(e)}return r}_addAndRemoveGeometries(e,t){if(null==this._bufferWriter||null==this._vaoCache)return;const{_bufferWriter:r,_dataByOrigin:i}=this,s=r.vertexBufferLayout.stride/4,n=this._computeDeltas(e,t);n.forEach(((e,t)=>{const o=e.get(null),a=null!=o?o.changes:[];n.delete(t,null);let l=i.get(t);if(e.forEach(((e,o)=>{if(n.delete(t,o),null==o)return void(0,ye.vA)(!1,"No VAO for removed geometries");if(o.instances.size===e.changes.length)return this._vaoCache.deleteVao(o.vao),(0,fe.Xy)(l.buffers,o),void(0===l.buffers.length&&0===a.length&&i.delete(t));const c=o.numElements,h=o.vao.byteSize/4,u=a.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),d=e.changes.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),f=Math.min((c+u-d)*s,Ge),m=f>h;f>De&&f<h/2?(e.changes.forEach((({id:e})=>o.deleteInstance(e))),o.instances.forEach((({geometry:e})=>a.push(e))),this._vaoCache.deleteVao(o.vao),(0,fe.Xy)(l.buffers,o)):m?this._applyAndRebuild(o,a,e):this._applyRemoves(o,e)})),a.length>0)for(null==l&&(l=new Ee(o.origin),i.set(t,l)),l.buffers.forEach((e=>this._applyAdds(e,a)));a.length>0;)l.buffers.push(this._applyAndRebuild(new Ae,a,null))}))}_updateDrawCommands(){this._highlightGroups.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.updateIfDrawCommandsDirty(this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&(0,ge.FB)(this._highlightGroups,e.highlightGroups),this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(null!=r)for(const t of r.changes)e.deleteInstance(t.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,n=s/4,o=Math.floor(Ge/n);let a=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(a+s>o&&a>0){t.push(r);break}a+=s;const n=new xe(r,0,0);(0,ye.vA)(null==e.instances.get(r.id)),e.addInstance(r.id,n)}const l=a*n,c=Ne(l),h=i.vertexBufferLayout.createView(c.buffer);let u=0;e.resetInstanceSummary(),e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,h,u);const s=u;u+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,u),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(Ve(l)),e.vao.vertexBuffers.get("geometry").setSubData(c,0,0,u*n),e.holes.clear();const d=e.holes.pushNew();return d.from=u,d.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;for(const r of t.changes){const t=r.id,i=e.instances.get(t);if(!i)continue;e.deleteInstance(t);const s=Ie.back();if(s){if(s.to===i.from){s.to=i.to;continue}if(s.from===i.to){s.from=i.from;continue}}const n=Ie.pushNew();n.from=i.from,n.to=i.to}be(Ie);const r=this._bufferWriter.vertexBufferLayout.stride/4,i=Ie.reduce(((e,t)=>Math.max(e,t.numElements)),0)*r,s=Ne(i);s.fill(0,0,i);const n=e.vao.vertexBuffers.get("geometry");Ie.forAll((e=>n.setSubData(s,e.from*r,0,e.numElements*r))),e.holes.pushArray(Ie.data,Ie.length),Ie.forAll(((e,t)=>Ie.data[t]=null)),Ie.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!function(e){return null!=e.vao}(e))return void this._applyAndRebuild(e,t,null);const r=this._bufferWriter,i=r.vertexBufferLayout.stride/4,s=e.numElements,n=t.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),o=Math.min((s+n)*i,Ge),a=4*o;if(e.vao.byteSize<Ve(Ge-De)&&a>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);be(e.holes);const l=new Array;for(const i of t){const t=r.elementCount(i.geometry.attributes),s=Re(e.holes,t);l.push(s)}const c=e.vao.vertexBuffers.get("geometry");let h=0,u=0,d=0;const f=Ne(o),m=r.vertexBufferLayout.createView(f.buffer);t.forEach(((t,s)=>{const n=l[s];if(null==n)return;if(d!==n){const e=d-u;e>0&&c.setSubData(f,u*i,0,e*i),u=n,h=0}const o=r.elementCount(t.geometry.attributes);this._writeGeometry(t,m,h),h+=o,d=n+o;const a=new xe(t,n,n+o);(0,ye.vA)(null==e.instances.get(t.id)),e.addInstance(t.id,a),e.drawCommandsDirty=!0}));const p=d-u;p>0&&c.setSubData(f,u*i,0,p*i),(0,fe.$i)(t,((e,t)=>null==l[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&((0,_e.C)(Me,e.transformation),Me[12]-=e.localOrigin.vec3[0],Me[13]-=e.localOrigin.vec3[1],Me[14]-=e.localOrigin.vec3[2],(0,_e.B8)(Pe,Me),(0,_e.mg)(Pe,Pe),this._bufferWriter.write(Me,Pe,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}prepareTechnique(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const{highlightGroup:s}=r,n=t===re.V.ShadowHighlight,o=t===re.V.Highlight,a=o||n;if(a&&(0===this._highlightGroups.size||o&&s&&!this._highlightGroups.has(s)))return null;const l=t===re.V.ShadowExcludeHighlight,c=!(a||l);for(const i of this._dataByOrigin.values())for(const o of i.buffers){if(a&&(0===o.highlightGroups.size||s&&!o.highlightGroups.has(s)))continue;const i=n?o.drawCommandsHighlights.size>0:a?s?o.drawCommandsHighlights.get(s):o.drawCommandsHighlights.size>0:((l&&o.needsMultipleCommands()?o.drawCommandsShadowHighlightRest:o.drawCommandsDefault)||null)?.length??!1,h=c&&o.drawCommandsOccludees||null;if(i||h?.length){const i=this._glMaterials.load(e.rctx,r.slot,t),s=null!=i?i.beginSlot(r):null;if(null!=s)return s}}return null}render(e,t){const{output:r,bind:i}=e,s=r===re.V.Highlight,n=r===re.V.ShadowHighlight,o=s||n,a=r===re.V.ShadowExcludeHighlight,l=!(o||a),c=i.slot===le.N.OCCLUDER_MATERIAL||i.slot===le.N.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,{rctx:h}=e;h.runAppleAmdDriverHelper(),h.bindTechnique(t,i,this.material.parameters);const{highlightGroup:u}=i;if(r!==re.V.Highlight||u)for(const e of this._dataByOrigin.values())for(const r of e.buffers){if(s&&(!r.hasHighlights||!r.drawCommandsHighlights.has(u)))continue;if(n&&!r.hasHighlights)continue;const d=()=>{const e=[];for(const t of r.drawCommandsHighlights.values())e.push(t);return e},f=o&&!n?r.drawCommandsHighlights.get(u)??null:null,m=n?d():o?f?[f]:je:(a&&r.needsMultipleCommands()?[r.drawCommandsShadowHighlightRest]:[r.drawCommandsDefault])||je,p=m.some((e=>e.length>0)),g=l&&r.drawCommandsOccludees||null;if(p||g?.length){const s=t.program;if(this._drawParameters.origin=e.origin,s.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(r.vao),h.bindVAO(r.vao),p)for(const e of m)h.setPipelineState(t.getPipeline(!1,c)),e.forAll((e=>h.drawArrays(t.primitiveType,e.first,e.count)));g?.length&&(h.setPipelineState(t.getPipeline(!0,c)),g.forAll((e=>h.drawArrays(t.primitiveType,e.first,e.count))))}}}get test(){}};(0,i._)([(0,a.M)({constructOnly:!0})],Te.prototype,"material",void 0),Te=(0,i._)([(0,c.$)("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],Te);class ze{constructor(e){this.origin=e,this.changes=new Array}}function Re(e,t){let r;if(!e.some((e=>!(e.numElements<t||(r=e,0)))))return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const Me=(0,ve.vt)(),Pe=(0,ve.vt)(),Ie=new pe.A({allocator:e=>e||new we,deallocator:null}),De=65536,Be=4*De,He=1024,Fe=16777216,Ge=Fe/4;let Le=new Float32Array(De);function Ne(e){return Le.length<e&&(Le=new Float32Array(e)),Le}function Ve(e){const t=4*e;return t<=He?He:t<Be?(0,q.cU)(t):Math.max(Math.min(Math.ceil(1.5*t/Be)*Be,Fe),t)}const je=[];let Ue=class extends ne{constructor(e){super(e),this._hasHighlights=!1,this._glMaterials=null,this._produces=new Map,this._renderGeometries=new Map,this._vaoCache=null,this._drawParameters=new he,this._bufferWriter=null}get produces(){return this._produces}initialize(){this._bufferWriter=this.material.createBufferWriter(),this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!!(t!==re.V.Highlight&&t!==re.V.ShadowHighlight||this._hasHighlights)&&e(t)))}))}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.destroyRenderGeometry(t)}prepareTechnique(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e,s=t.produces.get(i.slot);if(!s?.(r))return null;if((r===re.V.Highlight||r===re.V.ShadowHighlight)&&!this._hasHighlights)return null;const n=this._glMaterials.load(e.rctx,i.slot,r);return n?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(0===r.size)return;const{bind:i}=e,s=i.slot===le.N.OCCLUDER_MATERIAL||i.slot===le.N.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const o=t.program;for(const[e,a]of r)this._drawParameters.origin=a.localOrigin,o.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(a.vao),n.bindVAO(a.vao),n.setPipelineState(t.getPipeline(!1,s)),n.drawArrays(t.primitiveType,0,a.numElements)}initializeRenderContext(e,t){this._glMaterials=new ae(this.material,e.materials);const r=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,(0,te.U)(this._bufferWriter.vertexBufferLayout));this._vaoCache=r}uninitializeRenderContext(){}createRenderGeometry(e,t,r){this.destroyRenderGeometry(e);const i=this._bufferWriter.vertexBufferLayout.stride/4,s=this._vaoCache.newVao(Ve(t.data.length));s.vertexBuffers.get("geometry").setSubData(t.data,0,0,t.numElements*i);const n={localOrigin:r,vao:s,numElements:t.numElements};return this._renderGeometries.set(e,n),n}destroyRenderGeometry(e){const t=this._renderGeometries.get(e);null!=t&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}};(0,i._)([(0,a.M)({constructOnly:!0})],Ue.prototype,"material",void 0),Ue=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.rendering.SimpleMaterialRenderer")],Ue);var We=r(40804),Ye=r(76844),$e=r(63907);const ke=128,Xe=.5;function qe(e,t,r){return r&&(t/=Math.SQRT2),Ke(e,((i,s)=>{let n=i-.5*e+.25,o=.5*e-s-.75;if(r){const e=(n+o)/Math.SQRT2;o=(o-n)/Math.SQRT2,n=e}return Math.max(Math.abs(n),Math.abs(o))-.5*t}))}function Qe(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const s=.5*t;return Ke(e,((t,n)=>{let o,a=t-.5*e,l=.5*e-n-1;if(r){const e=(a+l)/Math.SQRT2;l=(l-a)/Math.SQRT2,a=e}return a=Math.abs(a),l=Math.abs(l),o=a>l?a>s?Math.sqrt((a-s)*(a-s)+l*l):l:l>s?Math.sqrt(a*a+(l-s)*(l-s)):a,o-=i/2,o}))}function Ze(e,t,r){return(i,s)=>{const n=i-e,o=s-t;return Math.sqrt(n*n+o*o)-r}}function Je(e,t,r){const i=Math.sqrt(t*t+r*r);return(s,n)=>{const o=Math.abs(s-e)-r,a=n-e+t/2+.75,l=(t*o+r*a)/i,c=-a;return Math.max(l,c)}}function Ke(e,t){const r=new Uint8Array(4*e*e);for(let i=0;i<e;i++)for(let s=0;s<e;s++){const n=s+e*i;let o=t(s,i);o=o/e+.5,(0,We.U)(o,r,4*n)}return r}var et=r(77690),tt=r(29242),rt=r(38954),it=r(91829);var st=r(13030),nt=r(78662),ot=r(1843),at=r(40268),lt=r(35093),ct=r(25634),ht=r(14903),ut=r(30669),dt=r(46540);class ft{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}}var mt=r(59907),pt=r(43616),gt=r(13259),_t=r(97220),vt=r(84867),yt=r(39341),wt=r(59643),bt=r(33524),xt=r(34886),St=r(90644);class At extends vt.w{constructor(e,t,r){super(e,t,r),this.primitiveType=t.occlusionPass?$e.WR.POINTS:$e.WR.TRIANGLES}initializeProgram(e,t){return new xt.B(e.rctx,At.shader.get().build(t),yt.D)}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:i,output:s,depthEnabled:n,occlusionPass:o}=e,a=t===wt.Y.NONE,l=t===wt.Y.FrontFace,c=r?Ot:null,h=i?null:(a||l)&&s!==re.V.Highlight&&(n||o)?St.Uy:null;return(0,St.Ey)({blending:s===re.V.Color?a?St.dH:(0,bt.ez)(t):null,depthTest:i?null:{func:$e.MT.LEQUAL},depthWrite:h,drawBuffers:(0,bt.m6)(t,s),colorWrite:St.kn,polygonOffset:c})}}At.shader=new _t.$(gt.H,(()=>r.e(8241).then(r.bind(r,48241))));const Ot={factor:0,units:-4};var Ct=r(53466),Et=r(22911),Tt=r(99769),zt=r(35256);class Rt extends zt.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1,this.textureCoordinateType=Ct.I.None,this.emissionSource=Et.ZX.None,this.discardInvisibleFragments=!0,this.hasSliceInVertexProgram=!0,this.hasVvInstancing=!1}}(0,i._)([(0,Tt.W)()],Rt.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"occlusionTestEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"signedDistanceFieldEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"vvSize",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"vvColor",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasVerticalOffset",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasScreenSizePerspective",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasRotation",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"debugDrawLabelBorder",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasSlicePlane",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasPolygonOffset",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"depthEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"pixelSnappingEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"draped",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"multipassEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"cullAboveGround",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"occlusionPass",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"objectAndLayerIdColorInstanced",void 0);class Mt extends ht.im{constructor(e,t){super(e,Jt),this.produces=new Map([[le.N.HUD_MATERIAL,e=>(0,re.dX)(e)&&!this.parameters.drawInSecondSlot],[le.N.LABEL_MATERIAL,e=>(0,re.dX)(e)&&this.parameters.drawInSecondSlot],[le.N.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[le.N.DRAPED_MATERIAL,e=>(0,re.dX)(e)]]),this._visible=!0,this._configuration=new Rt(t)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===le.N.OCCLUSION_PIXELS&&this.parameters.occlusionTest,e===re.V.Color&&(this._configuration.debugDrawLabelBorder=!!Q.b.LABELS_SHOW_BORDER),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.oitPass=t.oitPass,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,t,r,i,s,n){const{options:{selectionMode:o,hud:a,excludeLabels:l},point:c,camera:h}=r,{parameters:u}=this;if(!o||!a||l&&u.isLabel||!e.visible||!c)return;const{scaleX:d,scaleY:f}=this._getScreenScale(e,h.pixelRatio);(0,et.z0)(Vt,t),e.attributes.has(dt.r.FEATUREATTRIBUTE)&&function(e){const t=e[0],r=e[1],i=e[2],s=e[3],n=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=1/Math.sqrt(t*t+r*r+i*i),u=1/Math.sqrt(s*s+n*n+o*o),d=1/Math.sqrt(a*a+l*l+c*c);e[0]=t*h,e[1]=r*h,e[2]=i*h,e[3]=s*u,e[4]=n*u,e[5]=o*u,e[6]=a*d,e[7]=l*d,e[8]=c*d}(Vt);const m=e.attributes.get(dt.r.POSITION),p=e.attributes.get(dt.r.SIZE),g=e.attributes.get(dt.r.NORMAL),_=e.attributes.get(dt.r.CENTEROFFSETANDDISTANCE);(0,ye.vA)(m.size>=3);const v=(0,gt.c)(u),y="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<m.data.length/m.size;e++){const i=e*m.size;(0,rt.a)(Ht,m.data[i],m.data[i+1],m.data[i+2]),(0,rt.h)(Ht,Ht,t),(0,rt.h)(Ht,Ht,h.viewMatrix);const s=e*_.size;if((0,rt.a)(Wt,_.data[s],_.data[s+1],_.data[s+2]),!y&&(Ht[0]+=Wt[0],Ht[1]+=Wt[1],0!==Wt[2])){const e=Wt[2];(0,rt.n)(Wt,Ht),(0,rt.f)(Ht,Ht,(0,rt.j)(Wt,Wt,e))}const o=e*g.size;if((0,rt.a)(Ft,g.data[o],g.data[o+1],g.data[o+2]),It(Ft,Vt,h,kt),this._applyVerticalOffsetTransformationView(Ht,kt,h,Bt),h.applyProjection(Ht,Gt),Gt[0]>-1){y&&(Wt[0]||Wt[1])&&(Gt[0]+=Wt[0]*h.pixelRatio,0!==Wt[1]&&(Gt[1]+=(0,ut.m0)(Wt[1],Bt.factorAlignment)*h.pixelRatio),h.unapplyProjection(Gt,Ht)),Gt[0]+=this.parameters.screenOffset[0]*h.pixelRatio,Gt[1]+=this.parameters.screenOffset[1]*h.pixelRatio,Gt[0]=Math.floor(Gt[0]),Gt[1]=Math.floor(Gt[1]);const t=e*p.size;Qt[0]=p.data[t]*d,Qt[1]=p.data[t+1]*f,(0,ut.MD)(Qt,Bt.factor,Qt);const i=Xt*h.pixelRatio;let s=0;if(u.textureIsSignedDistanceField&&(s=u.outlineSize*h.pixelRatio/2),Dt(c,Gt[0],Gt[1],Qt,i,s,u,v)){const e=r.ray;if((0,rt.h)(Nt,Ht,(0,_e.B8)(Ut,h.viewMatrix)),Gt[0]=c[0],Gt[1]=c[1],h.unprojectFromRenderScreen(Gt,Ht)){const t=(0,R.vt)();(0,rt.c)(t,e.direction);const r=1/(0,rt.m)(t);(0,rt.j)(t,t,r),n((0,rt.p)(e.origin,Ht)*r,t,-1,!0,1,Nt)}}}}}intersectDraped(e,t,r,i,s,n){const o=e.attributes.get(dt.r.POSITION),a=e.attributes.get(dt.r.SIZE),l=this.parameters,c=(0,gt.c)(l),{scaleX:h,scaleY:u}=this._getScreenScale(e,e.screenToWorldRatio),d=qt*e.screenToWorldRatio;for(let t=0;t<o.data.length/o.size;t++){const r=t*o.size,f=o.data[r],m=o.data[r+1],p=t*a.size;Qt[0]=a.data[p]*h,Qt[1]=a.data[p+1]*u;let g=0;l.textureIsSignedDistanceField&&(g=l.outlineSize*e.screenToWorldRatio/2),Dt(i,f,m,Qt,d,g,l,c)&&s(n.dist,n.normal,-1,!1)}}createBufferWriter(){return new tr}_updateScaleInfo(e,t,r){const i=this.parameters;null!=i.screenSizePerspective?(0,ut.cJ)(r,t,i.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=i.screenSizePerspectiveAlignment?(0,ut.cJ)(r,t,i.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,r,i,s,n,o){const a=It(t,r,s,kt);return this._applyVerticalGroundOffsetView(e,a,s,o),this._applyVerticalOffsetTransformationView(o,a,s,n),this._applyPolygonOffsetView(o,a,i[3],s,o),this._applyCenterOffsetView(o,i,o),o}applyShaderOffsetsNDC(e,t,r,i,s){return this._applyCenterOffsetNDC(e,t,r,i),null!=s&&(0,rt.c)(s,i),this._applyPolygonOffsetNDC(i,t,r,i),i}_applyPolygonOffsetView(e,t,r,i,s){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const a=n*o;if(this.parameters.shaderPolygonOffset<=0)return(0,rt.c)(s,e);const l=(0,q.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/i.viewport[2];return(0,rt.j)(s,e,a>0?c:1/c),s}_applyVerticalGroundOffsetView(e,t,r,i){const s=(0,rt.m)(e),n=r.aboveGround?1:-1,o=r.computeRenderPixelSizeAtDist(s)*at.R,a=(0,rt.j)(Ht,t.normal,n*o);return(0,rt.g)(i,e,a),i}_applyVerticalOffsetTransformationView(e,t,r,i){const s=this.parameters;if(!s.verticalOffset?.screenLength){if(s.screenSizePerspective||s.screenSizePerspectiveAlignment){const r=(0,rt.m)(e);this._updateScaleInfo(i,r,t.cosAngle)}else i.factor.scale=1,i.factorAlignment.scale=1;return e}const n=(0,rt.m)(e),o=s.screenSizePerspectiveAlignment??s.screenSizePerspective,a=(0,pt.kE)(r,n,s.verticalOffset,t.cosAngle,o);return this._updateScaleInfo(i,n,t.cosAngle),(0,rt.j)(t.normal,t.normal,a),(0,rt.g)(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,rt.c)(r,e),i&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,rt.n)(Ft,r),(0,rt.g)(r,r,(0,rt.j)(Ft,Ft,t[2])))),r}_applyCenterOffsetNDC(e,t,r,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&(0,rt.c)(i,e),s||(i[0]+=t[0]/r.fullWidth*2,i[1]+=t[1]/r.fullHeight*2),i}_applyPolygonOffsetNDC(e,t,r,i){const s=this.parameters.shaderPolygonOffset;if(e!==i&&(0,rt.c)(i,e),s){const e=r.aboveGround?1:-1,n=e*Math.sign(t[3]);i[2]-=(n||e)*s}return i}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,i=e[3]>=lt.Q||t>=lt.Q&&r[3]>=lt.Q;return this._visible&&i}createGLMaterial(e){return new Pt(e)}calculateRelativeScreenBounds(e,t,r=(0,O.vt)()){return function(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}_getScreenScale(e,t){const r=e.attributes.get(dt.r.FEATUREATTRIBUTE);if(null==r)return{scaleX:t,scaleY:t};const i=(0,it.ci)(r.data,$t);return(0,nt.VC)(Yt,this.parameters,i),{scaleX:Yt[0]*t,scaleY:Yt[1]*t}}}class Pt extends ct.m8{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(At,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function It(e,t,r,i){return function(e){return(t=e)instanceof Float32Array&&t.length>=16||function(e){return Array.isArray(e)&&e.length>=16}(e);var t}(t)&&(t=(0,et.z0)(jt,t)),(0,rt.t)(i.normal,e,t),(0,rt.h)(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=(0,rt.l)(Lt,Zt),i}function Dt(e,t,r,i,s,n,o,a){let l=t-s-i[0]*a[0],c=l+i[0]+2*s,h=r-s-i[1]*a[1],u=h+i[1]+2*s;const d=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&null!=d&&(l+=i[0]*d[0],h+=i[1]*d[1],c-=i[0]*(1-d[2]),u-=i[1]*(1-d[3]),l-=n,c+=n,h-=n,u+=n),e[0]>l&&e[0]<c&&e[1]>h&&e[1]<u}const Bt=new class{constructor(){this.factor=new ft,this.factorAlignment=new ft}},Ht=(0,R.vt)(),Ft=(0,R.vt)(),Gt=(0,it.vt)(),Lt=(0,R.vt)(),Nt=(0,R.vt)(),Vt=(0,tt.vt)(),jt=(0,tt.vt)(),Ut=(0,ve.vt)(),Wt=(0,R.vt)(),Yt=(0,R.vt)(),$t=(0,it.vt)(),kt={normal:Lt,cosAngle:0},Xt=1,qt=2,Qt=[0,0],Zt=(0,R.fA)(0,0,1);class Jt extends ct.NV{constructor(){super(...arguments),this.renderOccluded=ht.m$.Occlude,this.isDecoration=!1,this.color=(0,it.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,X.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,it.CN)(1,1,1,1),this.outlineSize=0,this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.draped=!1,this.isLabel=!1}}const Kt=(0,ot.BP)().vec3f(dt.r.POSITION).vec3f(dt.r.NORMAL).vec2f(dt.r.UV0).vec4u8(dt.r.COLOR).vec2f(dt.r.SIZE).f32(dt.r.ROTATION).vec4f(dt.r.CENTEROFFSETANDDISTANCE).vec4f(dt.r.FEATUREATTRIBUTE),er=Kt.clone().vec4u8(dt.r.OBJECTANDLAYERIDCOLOR);class tr{constructor(){this.vertexBufferLayout=(0,l.A)("enable-feature:objectAndLayerId-rendering")?er:Kt}elementCount(e){return 6*e.get(dt.r.POSITION).indices.length}write(e,t,r,i,s,n){(0,mt.Hk)(r.get(dt.r.POSITION),e,s.position,n,6),(0,mt.p1)(r.get(dt.r.NORMAL),t,s.normal,n,6);const o=r.get(dt.r.UV0)?.data;let a=0,l=0,c=1,h=1;o&&o.length>=4&&(a=o[0],l=o[1],c=o[2],h=o[3]),c=Math.min(1.99999,c+1),h=Math.min(1.99999,h+1);let u=r.get(dt.r.POSITION).indices.length,d=n;const f=s.uv0;for(let e=0;e<u;++e)f.set(d,0,a),f.set(d,1,l),d++,f.set(d,0,c),f.set(d,1,l),d++,f.set(d,0,c),f.set(d,1,h),d++,f.set(d,0,c),f.set(d,1,h),d++,f.set(d,0,a),f.set(d,1,h),d++,f.set(d,0,a),f.set(d,1,l),d++;(0,mt.tb)(r.get(dt.r.COLOR),4,s.color,n,6);const{data:m,indices:p}=r.get(dt.r.SIZE);u=p.length;const g=s.size;d=n;for(let e=0;e<u;++e){const t=m[2*p[e]],r=m[2*p[e]+1];for(let e=0;e<6;++e)g.set(d,0,t),g.set(d,1,r),d++}if((0,mt.uO)(r.get(dt.r.ROTATION),s.rotation,n,6),r.get(dt.r.CENTEROFFSETANDDISTANCE)?(0,mt.Ut)(r.get(dt.r.CENTEROFFSETANDDISTANCE),s.centerOffsetAndDistance,n,6):(0,mt.Pq)(s.centerOffsetAndDistance,n,6*u),r.get(dt.r.FEATUREATTRIBUTE)?(0,mt.Ut)(r.get(dt.r.FEATUREATTRIBUTE),s.featureAttribute,n,6):(0,mt.Pq)(s.featureAttribute,n,6*u),null!=i){const e=r.get(dt.r.POSITION)?.indices;if(e){const t=e.length,r=s.getField(dt.r.OBJECTANDLAYERIDCOLOR,st.XP);(0,mt.tH)(i,r,t,n,6)}}}}let rr=class extends f.A{constructor(e){super(),this.view=null,this._renderGeometries=new Map,this._materials=new Map,this._renderers=new Map,this.view=e.view}initialize(){}destroy(){}async executeRenderCommands(e){for(const t of e)switch(t.id){case"create-rendergeometry":await this._createRenderGeometry(t);break;case"destroy-rendergeometry":await this._destroyRenderGeometry(t);break;case"create-material":await this._createMaterial(t)}}async _createMaterial(e){const{view:t}=this,{sharedSymbolResources:r}=t;if(null==r)throw new Error("No shared symbol resources found!");const{textures:i}=r,s=e.materialId,[n,o]=ir(i,t.state.viewingMode===k.RT.Global);this._materials.set(s,n);const a=new Ue({material:n});this._renderers.set(n,a),t._stage.addRenderPlugin(a),t._stage.renderView.renderer.updateHasFlags(),this.addHandles([(0,Y.hA)((()=>(0,$.Gz)(o)))])}async _createRenderGeometry(e){const t=e.renderGeometryId,r=e.materialId;null!=this._renderGeometries.get(t)&&await this._destroyRenderGeometry({renderGeometryId:t});const i=this._materials.get(r);if(null==i)return void console.error(`material ${e.materialId} not found`);const s=this._renderers.get(i);if(null==s)return void console.error("no renderer assigned to provided material");const n=s.createRenderGeometry(t,e.renderGeometryBuffer,e.localOrigin);this._renderGeometries.set(t,{renderGeometry:n,materialId:r}),this.view._stage.renderView.requestRender()}async _destroyRenderGeometry(e){const t=e.renderGeometryId,r=this._renderGeometries.get(t);if(null==r)return;const i=r.materialId,s=this._materials.get(i);if(null==s)return void console.error(`material ${i} not found`);const n=this._renderers.get(s);null!=n?n.destroyRenderGeometry(e.renderGeometryId):console.error("no renderer assigned to provided material")}};function ir(e,t){const r={anchorPosition:ee.center,occlusionTest:!0,hasSlicePlane:!1},i=r;if(i.color=[1,0,0,1],i.outlineColor=[0,0,0,1],i.outlineSize=1,null!=e){const t=e.fromData("circle-icon",(()=>function(e,t=ke,r=t*Xe,i=0){const s=function(e,t=ke,r=t*Xe,i=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return Ke(e,Ze(r,r,t/2))}(t,r);case"square":return function(e,t){return qe(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return Qe(e,t,!1,r)}(t,r,i);case"x":return function(e,t,r=0){return Qe(e,t,!0,r)}(t,r,i);case"kite":return function(e,t){return qe(e,t,!0)}(t,r);case"triangle":return function(e,t){return Ke(e,Je(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,i=t/2,s=e/2,n=.8*r,o=Ze(s,(e-t)/2-n,Math.sqrt(n*n+i*i)),a=Je(s,r,i);return Ke(e,((e,t)=>Math.max(a(e,t),-o(e,t))))}(t,r)}}(e,t,r,i);return new Ye.g(s,{mipmap:!1,wrap:{s:$e.pF.CLAMP_TO_EDGE,t:$e.pF.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0})}("circle")));i.textureId=t.texture.id,i.textureIsSignedDistanceField=!0,i.sampleSignedDistanceFieldTexelCenter=!1}return i.distanceFieldBoundingBox=sr,[new Mt(r,t),null]}rr=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderer")],rr);const sr=[Xe/2,Xe/2,1-Xe/2,1-Xe/2];var nr=r(97146);class or{constructor(e){this._bufferWriter=null,this._bufferWriter=e.createBufferWriter()}createBuffer(e){const t=this._bufferWriter;(0,_e.C)(ar,e.transformation),ar[12]-=e.localOrigin[0],ar[13]-=e.localOrigin[1],ar[14]-=e.localOrigin[2],(0,_e.B8)(lr,ar),(0,_e.mg)(lr,lr);const r=new Map;for(const[t,i]of e.attributes)r.set(t,{...i,indices:(0,nr.Dg)(i.indices)});const i=t.elementCount(r),s=t.vertexBufferLayout.stride/4;i>Math.floor(cr/s)&&console.warn("geometry with very large number of elements encountered");const n=new Float32Array(i*s),o=t.vertexBufferLayout.createView(n.buffer);return t.write(ar,lr,r,e.objectAndLayerIdColor,o,0),{data:n,numElements:i}}}const ar=(0,ve.vt)(),lr=(0,ve.vt)(),cr=4194304;class hr{constructor(e){this._context=e,this._commands=[],this._transferables=new Set}createMaterial(){const e=this._context,t=e.generateId("material"),r=ir(null,!0)[0],i=new or(r);return e.registerRenderGeometryBufferWriter(t,i),this._commands.push({id:"create-material",materialId:t}),t}createRenderGeometry(e,t){const r=t.materialId,i=this._context.getRenderGeometryBufferWriter(r);if(null==i)throw new Error(`no bufferwriter found for material ${r}`);const s=i.createBuffer(t);this._transferables.add(s.data.buffer),this._commands.push({id:"create-rendergeometry",renderGeometryId:e,materialId:r,renderGeometryBuffer:s,localOrigin:t.localOrigin})}destroyRenderGeometry(e){this._commands.push({id:"destroy-rendergeometry",renderGeometryId:e})}dispatch(){const e={commands:this._commands,transferList:Array.from(this._transferables)};return this._clearCommandBuffer(),e}_clearCommandBuffer(){this._commands=[],this._transferables.clear()}}class ur{constructor(){this._idCounter=0,this._bufferWriters=new Map}generateId(e=""){return`${e}${this._idCounter++}`}createEncoder(){return new hr(this)}registerRenderGeometryBufferWriter(e,t){this._bufferWriters.set(e,t)}getRenderGeometryBufferWriter(e){return this._bufferWriters.get(e)}}var dr=r(46610);let fr=class extends f.A{constructor(){super(),this.materialId=null}async remove(e,t){t.destroyRenderGeometry(e)}async render(e,t){null==this.materialId&&(this.materialId=t.createMaterial());const r=e.numFeatures,i=new Float64Array([0,0,1]),s=new Float64Array([255,255,255,255]),n=new Float64Array([24,24]),o=new Float64Array([0,0,0,1]),a=new Float64Array([0,0]),l=new Float64Array([0]),c=new Uint32Array(r);for(let e=0;e<r;++e)c[e]=e;const h=new Uint32Array(r);for(let e=0;e<r;++e)h[e]=0;const u=new dr.n(e.coordinates,c,3,!0),d=new dr.n(i,h,3,!0),f=new dr.n(a,h,2,!0),m=new dr.n(s,h,4,!0),p=new dr.n(l,h,1,!0),g=new dr.n(n,h,2,!0),_=new dr.n(o,h,4,!0),v={attributes:[[dt.r.POSITION,u],[dt.r.NORMAL,d],[dt.r.UV0,f],[dt.r.COLOR,m],[dt.r.ROTATION,p],[dt.r.SIZE,g],[dt.r.CENTEROFFSETANDDISTANCE,_]],objectAndLayerIdColor:void 0,transformation:(0,ve.vt)(),localOrigin:e.localOrigin,materialId:this.materialId};t.createRenderGeometry(e.tileId,v)}};fr=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.symbolization.TestSymbol")],fr);class mr{constructor(){this._testSymbol=new fr}async remove(e,t){this._testSymbol.remove(e,t)}async symbolize(e,t){this._testSymbol.render(e,t)}}let pr=class extends s.A.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._renderCommandContext=new ur,this._featureStore=new x,this._tileManager=new g({addTile:(e,t)=>this._addTile(e,t),removeTiles:e=>this._removeTiles(e)}),this._fetcher=null,this._processor=null,this._symbolizer=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager.destroy()}async setup({spatialReference:e,renderSpatialReference:t,baseQuery:r,url:i,objectIdField:s,capabilities:n,fieldsIndex:a,timeInfo:l}){const c=h.A.fromJSON(e);return this._fetcher=new V(c,d.A.fromJSON(r),i,s,n),this._processor=new W(s,c,h.A.fromJSON(t)),this._symbolizer=new mr,this._queryEngine=new u.d({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:s,fieldsIndex:a,availableFields:[s],spatialReference:e,featureStore:this._featureStore,timeInfo:l}),this._defaultQueryJSON=new d.A({outSpatialReference:c}).toJSON(),this.addHandles((0,o.wB)((()=>this.updating),(async e=>{this.emit("notify-updating",{updating:e})})),o.Vh),_r}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),_r}async _addTile(e,t){const r=await this._fetcher.fetch(e,t);(0,n.Te)(t);const i=this._processor.process(r);if(null==i)return r;const s=this._renderCommandContext.createEncoder();await this._symbolizer.symbolize(i,s),this._featureStore.addTile(r);const{commands:o,transferList:a}=s.dispatch();return await this.remoteClient.invoke("dispatchRenderCommands",o,{signal:t,transferList:a}),r}async _removeTiles(e){const t=this._renderCommandContext.createEncoder(),r=this._featureStore,i=this._symbolizer;for(const s of e)r.removeTile(s),await i.remove(s,t);const{commands:s,transferList:n}=t.dispatch();await this.remoteClient.invoke("dispatchRenderCommands",s,{transferList:n})}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,i._)([(0,a.M)()],pr.prototype,"updating",null),pr=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],pr);const gr=pr,_r={result:void 0}},4431:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(63907),s=r(74038);function n(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map((i=>{const n=e.fields.get(i),a=n.constructor.ElementCount,l=o(n.constructor.ElementType),c=n.offset,h=n.optional?.glNormalized??!1;return new s._(i,a,l,c,r,h,t)}))}function o(e){const t=a[e];if(t)return t;throw new Error("BufferType not supported in WebGL")}const a={u8:i.pe.UNSIGNED_BYTE,u16:i.pe.UNSIGNED_SHORT,u32:i.pe.UNSIGNED_INT,i8:i.pe.BYTE,i16:i.pe.SHORT,i32:i.pe.INT,f32:i.pe.FLOAT}},47522:(e,t,r)=>{r.d(t,{K:()=>n});var i=r(95250),s=r(2597);function n(e){e.uniforms.add(new i.e("alignPixelEnabled",((e,t)=>t.alignPixelEnabled))),e.code.add(s.H`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) {
|
|
145
|
+
outputHighlightNet(voccluded == 1.0);`)}return t}function z(e){return e.outlineColor[3]>0&&e.outlineSize>0}function R(e,t=M){return e.textureIsSignedDistanceField?function(e,t,r){null!=t?(0,i.hZ)(r,e[0]*(t[2]-t[0])+t[0],e[1]*(t[3]-t[1])+t[1]):(0,i.hZ)(r,0,0)}(e.anchorPosition,e.distanceFieldBoundingBox,t):(0,i.C)(t,e.anchorPosition),t}const M=(0,s.vt)(),P=Object.freeze(Object.defineProperty({__proto__:null,build:T,calculateAnchorPosForRendering:R},Symbol.toStringTag,{value:"Module"}))},69540:(e,t,r)=>{r.d(t,{O:()=>h,P:()=>u});var i=r(90237),s=r(69622),n=(r(44208),r(4718)),o=(r(53966),r(97768)),a=r(35666),l=r(88620),c=r(40608);const h=e=>{let t=class extends e{clone(){const e=(0,l.oY)(this);(0,o.Lw)(e,"unable to clone instance of non-accessor class");const t=e.metadata,r=e.store,i={},s=new Map;for(const e in t){const o=t[e],l=r?.originOf(e),c=o.clonable;if(o.readOnly||!1===c||l!==a.Gr.USER&&l!==a.Gr.DEFAULTS&&l!==a.Gr.WEB_MAP&&l!==a.Gr.WEB_SCENE)continue;const h=this[e];let u=null;u="function"==typeof c?c(h):"reference"===c?h:(0,n.TU)(h),null!=h&&null==u||(l===a.Gr.DEFAULTS?s.set(e,u):i[e]=u)}const c=new(0,Object.getPrototypeOf(this).constructor)(i);if(s.size){const e=(0,l.oY)(c)?.store;if(e)for(const[t,r]of s)e.set(t,r,a.Gr.DEFAULTS)}return c}};return t=(0,i._)([(0,c.$)("esri.core.Clonable")],t),t};let u=class extends(h(s.A)){};u=(0,i._)([(0,c.$)("esri.core.Clonable")],u)},55359:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(57219);class s{constructor(e,t){this._storage=new i.F,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},57219:(e,t,r)=>{r.d(t,{F:()=>a,Mn:()=>o});var i,s,n=r(3694);(s=i||(i={}))[s.ALL=0]="ALL",s[s.SOME=1]="SOME";class o{constructor(e,t,r){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,r,i=0){this._storage.put(this,e,t,r,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,r){this._storage.updateSize(this,e,t,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new n.A,this._users=new n.A}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const r=this._db.get(e.id+t);return r?.size??0}put(e,t,r,s,n){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,i.ALL)),s>this._maxSize)return void this._notifyRemove(t,r,s,i.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,r,0,i.ALL);const a=1+Math.max(n,-4)- -3;this._db.set(t,new c(r,s,a)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t,r,s){t=e.id+t;const n=this._db.get(t);if(n&&n.entry===r){for(this._size-=n.size,e.size-=n.size;s>this._maxSize;){const e=this._notifyRemove(t,r,s,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}n.size=s,this._size+=s,e.size+=s,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},r=new Array;this._db.forEach(((e,i)=>{const s=e.lifetime;r[s]=(r[s]||0)+e.size,this._users.forAll((r=>{const{id:s,name:n}=r;if(i.startsWith(s)){const r=t[n]||0;t[n]=r+e.size}}))}));const i={};this._users.forAll((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[r]||0;t[r]=s,i[r]=Math.round(100*e.hitRate)+"%"}else i[r]="0%"}));const s=Object.keys(t);s.sort(((e,r)=>t[r]-t[e])),s.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+i[r]));for(let t=r.length-1;t>=0;--t){const i=r[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,i){let s;return this._removeFuncs.some((n=>{if(e.startsWith(n[0])){const e=n[1](t,i,r);return"number"==typeof e&&(s=e),!0}return!1})),s}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const r=e?.id;let i=!0;for(;i;){i=!1;for(const[s,n]of this._db)if(0===n.lifetime&&(!r||s.startsWith(r))){if(this._purgeItem(s,n,e),t.size<=.9*t.maxSize)return;i||=this._db.has(s)}}for(const[i,s]of this._db)if((!r||i.startsWith(r))&&(this._purgeItem(i,s,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,r=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=s&&s>0&&(this._size+=s,r&&(r.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class c{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}}},32587:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(62788),s=r(95488);class n{constructor(e){this._observable=new s.I,this._map=new Map(e)}get size(){return(0,i.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,i.gc)(this._observable),this._map.entries()}forEach(e,t){(0,i.gc)(this._observable),this._map.forEach(((r,i)=>e.call(t,r,i,this)),t)}get(e){return(0,i.gc)(this._observable),this._map.get(e)}has(e){return(0,i.gc)(this._observable),this._map.has(e)}keys(){return(0,i.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,i.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,i.gc)(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},21818:(e,t,r)=>{function i(e){}r.d(t,{Xb:()=>i}),r(44208)},75503:(e,t,r)=>{r.d(t,{E:()=>A,w:()=>o});var i=r(4576),s=(r(44208),r(3694)),n=r(11006);class o{constructor(e=9,t){this._compareMinX=u,this._compareMinY=d,this._toBBox=e=>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(),w.prune(),b.prune(),x.prune(),S.prune()}all(e){a(this._data,e)}search(e,t){let r=this._data;const i=this._toBBox;if(v(e,r))for(w.clear();r;){for(let s=0,n=r.children.length;s<n;s++){const n=r.children[s],o=r.leaf?i(n):n;v(e,o)&&(r.leaf?t(n):_(e,o)?a(n,t):w.push(n))}r=w.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!v(e,t))return!1;for(w.clear();t;){for(let i=0,s=t.children.length;i<s;i++){const s=t.children[i],n=t.leaf?r(s):s;if(v(e,n)){if(t.leaf||_(e,n))return!0;w.push(s)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),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 C([]),this}remove(e){if(!e)return this;let t,r=this._data,s=null,n=0,o=!1;const a=this._toBBox(e);for(x.clear(),S.clear();r||x.length>0;){if(r||(r=x.pop(),s=x.data[x.length-1],n=S.pop()??0,o=!0),r.leaf&&(t=(0,i.qh)(r.children,e,r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),x.push(r),this._condense(x),this;o||r.leaf||!_(r,a)?s?(n++,r=s.children[n],o=!1):r=null:(x.push(r),S.push(n),n=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,i){const s=r-t+1;let n=this._maxEntries;if(s<=n){const i=new C(e.slice(t,r+1));return l(i,this._toBBox),i}i||(i=Math.ceil(Math.log(s)/Math.log(n)),n=Math.ceil(s/n**(i-1)));const o=new E([]);o.height=i;const a=Math.ceil(s/n),c=a*Math.ceil(Math.sqrt(n));y(e,t,r,c,this._compareMinX);for(let s=t;s<=r;s+=c){const t=Math.min(s+c-1,r);y(e,s,t,a,this._compareMinY);for(let r=s;r<=t;r+=a){const s=Math.min(r+a-1,t);o.children.push(this._build(e,r,s,i-1))}}return l(o,this._toBBox),o}_insert(e,t,r){const i=this._toBBox,s=r?e:i(e);x.clear();const n=function(e,t,r,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==r;){let r,i=1/0,s=1/0;for(let n=0,o=t.children.length;n<o;n++){const o=t.children[n],a=f(o),l=p(e,o)-a;l<s?(s=l,i=a<i?a:i,r=o):l===s&&a<i&&(i=a,r=o)}t=r||t.children[0]}return t}(s,this._data,t,x);for(n.children.push(e),h(n,s);t>=0&&x.data[t].children.length>this._maxEntries;)this._split(x,t),t--;!function(e,t,r){for(let i=r;i>=0;i--)h(t.data[i],e)}(s,x,t)}_split(e,t){const r=e.data[t],i=r.children.length,s=this._minEntries;this._chooseSplitAxis(r,s,i);const n=this._chooseSplitIndex(r,s,i);if(!n)return;const o=r.children.splice(n,r.children.length-n),a=r.leaf?new C(o):new E(o);a.height=r.height,l(r,this._toBBox),l(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,t){this._data=new E([e,t]),this._data.height=e.height+1,l(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let i,s,n;i=s=1/0;for(let o=t;o<=r-t;o++){const t=c(e,0,o,this._toBBox),a=c(e,o,r,this._toBBox),l=g(t,a),h=f(t)+f(a);l<i?(i=l,n=o,s=h<s?h:s):l===i&&h<s&&(s=h,n=o)}return n}_chooseSplitAxis(e,t,r){const i=e.leaf?this._compareMinX:u,s=e.leaf?this._compareMinY:d;this._allDistMargin(e,t,r,i)<this._allDistMargin(e,t,r,s)&&e.children.sort(i)}_allDistMargin(e,t,r,i){e.children.sort(i);const s=this._toBBox,n=c(e,0,t,s),o=c(e,r-t,r,s);let a=m(n)+m(o);for(let i=t;i<r-t;i++){const t=e.children[i];h(n,e.leaf?s(t):t),a+=m(n)}for(let i=r-t-1;i>=t;i--){const t=e.children[i];h(o,e.leaf?s(t):t),a+=m(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const s=e.data[t-1],n=s.children;n.splice((0,i.qh)(n,r,n.length,s.indexHint),1)}else this.clear();else l(r,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 a(e,t){let r=e;for(b.clear();r;){if(!0===r.leaf)for(const e of r.children)t(e);else b.pushArray(r.children);r=b.pop()??null}}function l(e,t){c(e,0,e.children.length,t,e)}function c(e,t,r,i,s){s||(s=new C([])),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let n,o=t;o<r;o++)n=e.children[o],h(s,e.leaf?i(n):n);return s}function h(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 u(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function f(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(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 r=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,s-r)*Math.max(0,n-i)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function v(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,r,i,s){const o=[t,r];for(;o.length;){const t=o.pop(),r=o.pop();if(t-r<=i)continue;const a=r+Math.ceil((t-r)/i/2)*i;(0,n.q)(e,a,r,t,s),o.push(r,a,a,t)}}const w=new s.A,b=new s.A,x=new s.A,S=new s.A({deallocator:void 0});class A{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class O extends A{constructor(){super(...arguments),this.height=1,this.indexHint=new i.vW}}class C extends O{constructor(e){super(),this.children=e,this.leaf=!0}}class E extends O{constructor(e){super(),this.children=e,this.leaf=!1}}},36708:(e,t,r)=>{r.d(t,{C_:()=>d,OH:()=>p,Vh:()=>g,on:()=>u,pc:()=>_,wB:()=>l,z7:()=>c}),r(60999),r(5503);var i=r(37955),s=r(36563),n=r(97768),o=r(74887),a=r(14012);function l(e,t,r={}){return h(e,t,r,f)}function c(e,t,r={}){return h(e,t,r,m)}function h(e,t,r={},i){let s=null;const o=r.once?(e,r)=>{i(e)&&((0,n.xt)(s),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(s=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return s}function u(e,t,r,o={}){let a=null,c=null,h=null;function u(){a&&c&&(c.remove(),o.onListenerRemove?.(a),a=null,c=null)}function d(e){o.once&&o.once&&(0,n.xt)(h),r(e)}const f=l(e,((e,r)=>{u(),(0,i.wb)(e)&&(a=e,c=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,s.hA)((()=>{f.remove(),u()})),h}function d(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,n.xt)(a)}return new Promise(((i,n)=>{a=(0,s.vE)([(0,o.u7)(r,(()=>{l(),n((0,o.NK)())})),h(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,m,t)}function f(e){return!0}function m(e){return!!e}r(80559);const p={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},31756:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(83047),s=r(79258);const n={unknown:1,inches:(0,i.oU)(1,"meters","inches"),feet:(0,i.oU)(1,"meters","feet"),"us-feet":(0,i.oU)(1,"meters","us-feet"),yards:(0,i.oU)(1,"meters","yards"),miles:(0,i.oU)(1,"meters","miles"),"nautical-miles":(0,i.oU)(1,"meters","nautical-miles"),millimeters:(0,i.oU)(1,"meters","millimeters"),centimeters:(0,i.oU)(1,"meters","centimeters"),decimeters:(0,i.oU)(1,"meters","decimeters"),meters:(0,i.oU)(1,"meters","meters"),kilometers:(0,i.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.vl)(1,"meters",s.$O.radius)}},58501:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(62815);function s(e,t,r){if(!r?.features||!r.hasZ)return;const s=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of r.features)s(e.geometry)}},79677:(e,t,r)=>{r.d(t,{A:()=>f});var i,s=r(90237),n=r(25482),o=r(88930),a=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),c=r(40608),h=r(43937),u=r(56400);let d=i=class extends n.oY{static get allTime(){return m}static get empty(){return p}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===i&&r===s}expandTo(e,t=u.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.lL)(r,e,t));let s=this.end;if(s){const r=(0,o.lL)(s,e,t);s=s.getTime()===r.getTime()?r:(0,o.S1)(r,1,e,t)}return new i({start:r,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,a;return s>=t&&s<=r?o=s:t>=s&&t<=n&&(o=t),r>=s&&r<=n?a=r:n>=t&&n<=r&&(a=n),null==o||null==a||isNaN(o)||isNaN(a)?i.empty:new i({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(e,t,r=u.qU){if(this.isEmpty||this.isAllTime)return this.clone();const s=new i,{start:n,end:a}=this;return null!=n&&(s.start=(0,o.S1)(n,e,t,r)),null!=a&&(s.end=(0,o.S1)(a,e,t,r)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return m.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,s._)([(0,a.M)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,s._)([(0,l.w)("end")],d.prototype,"readEnd",null),(0,s._)([(0,h.K)("end")],d.prototype,"writeEnd",null),(0,s._)([(0,a.M)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,s._)([(0,a.M)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,s._)([(0,a.M)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,s._)([(0,l.w)("start")],d.prototype,"readStart",null),(0,s._)([(0,h.K)("start")],d.prototype,"writeStart",null),d=i=(0,s._)([(0,c.$)("esri.time.TimeExtent")],d);const f=d,m=new d,p=new d({start:void 0,end:void 0})},18341:(e,t,r)=>{r.r(t),r.d(t,{default:()=>gr});var i=r(90237),s=r(65529),n=r(74887),o=r(36708),a=r(10107),l=r(44208),c=(r(53966),r(87811),r(40608)),h=r(16930),u=r(17970),d=r(61956),f=r(69622),m=r(60999),p=r(32587);let g=class extends f.A{constructor(e){super(e),this._removing=0,this._tiles=new p.A}destroy(){for(const e of this._tiles.values())e.remove();this._tiles.clear()}get updating(){if(this._removing>0)return!0;for(const e of this._tiles.values())if(!e.finished)return!0;return!1}async onTileTreeChange(e){const{added:t,removed:r}=e,i=this._tiles;for(const e of r){const t=i.get(e);null!=t&&(t.abort(),i.delete(e))}for(const e of t)i.has(e.id)||i.set(e.id,(0,m.UT)((t=>this._addTile(e,t))));await this._removeTiles(r)}async _addTile(e,t){const r=await this.addTile(e,t);return(0,n.Te)(t),r}async _removeTiles(e){this._removing++,await this.removeTiles(e),this._removing--}};(0,i._)([(0,a.M)()],g.prototype,"updating",null),(0,i._)([(0,a.M)({constructOnly:!0})],g.prototype,"addTile",void 0),(0,i._)([(0,a.M)({constructOnly:!0})],g.prototype,"removeTiles",void 0),(0,i._)([(0,a.M)()],g.prototype,"_removing",void 0),g=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],g);var _=r(75503),v=r(27647),y=r(92722);class w{constructor(e,t){this._index=e,this._view=t}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new b(this._index,this._view,e)}}class b extends w{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,v.Q)(new y.A,this._geometryOverride,e.hasZ,e.hasM)}}class x{constructor(){this._storedTiles=new Map,this._pageBounds=new Map,this.events=new s.A,this.featureAdapter=S.shared}addTile(e){this._storedTiles.set(e.descriptor.id,e);for(const t of e.pages)this._addPage(t)}removeTile(e){const t=this._storedTiles,r=t.get(e);if(null!=r){t.delete(e);for(const e of r.pages)this._removePage(e)}}_addPage(e){const{featureCount:t}=e;if(0===t)return;const r=new _.w(9,(t=>e.getBounds(t))),i=new Array;for(let e=0;e<t;++e)i[e]=e;r.load(i),this._pageBounds.set(e,r),this.events.emit("changed")}_removePage(e){this._pageBounds.delete(e),this.events.emit("changed")}clear(){this._storedTiles.clear(),this._pageBounds.clear(),this.events.emit("changed")}forEach(e){for(const[t,r]of this._pageBounds)r.all((r=>e(new w(r,t))))}forEachInBounds(e,t){A.minX=e[0],A.minY=e[1],A.maxX=e[2],A.maxY=e[3];for(const[e,r]of this._pageBounds)r.search(A,(r=>t(new w(r,e))))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,s=-1/0;for(const e of this._pageBounds.values()){const{minX:n,minY:o,maxX:a,maxY:l}=e.toJSON();t=Math.min(t,n),r=Math.min(r,o),i=Math.min(i,a),s=Math.min(s,l)}return{xmin:t,ymin:r,xmax:i,ymax:s,spatialReference:e}}}class S{getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}S.shared=new S;const A=new _.E;var O=r(19419),C=r(80893);class E{constructor(e,t){this.descriptor=e,this.pages=t}}var T=r(49186),z=r(51624),R=r(51850),M=r(70328),P=r(62577),I=r(95466),D=r(53655);class B{constructor(e){const t=new z.A(new Uint8Array(e),new DataView(e));this._reader=t,this._index=function(e){for(;e.next();){if(2===e.tag())return H(e.getMessage());e.skip()}G()}(t)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,s=r.get(t)?.index;if(null==s)return;const n=i[e*r.fields.length+s],o=this._reader;return o.move(n),L(o)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,s=this._reader,n={};for(const e of t.fields){const t=r[i+e.index];s.move(t),n[e.name]=L(s)}return n}getCoordinates(e,t,r=0){const i=this._reader,{transform:s,featureIndices:n}=this._index,{scale:o,translate:a}=s;i.move(n[e]),this._readCoordinates(o,a,t,r)}getOptimizedGeometry(e){const t=(0,R.vt)();return this.getCoordinates(e,t),new y.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,N);const[i,s,n]=N,o=[i,s];return t&&(o[3]=n),r&&(o[t?4:3]=0),new y.A([],o)}getBounds(e){this.getCoordinates(e,N);const[t,r]=N,i=new _.E;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,N);const[t,r,i]=N;return(0,M.fA)(t,r,i,t,r,i)}readAllObjectIds(e,t=0){const r=this._reader,{_index:i,featureCount:s}=this,{objectIdFieldName:n,attributeIndices:o,fieldsIndex:a}=i,l=a.get(n).index,c=a.fields.length;for(let i=0;i<s;++i){const s=o[i*c+l];r.move(s),e[t++]=L(r)}return t}readAllCoordinates(e,t=0){const r=this._reader,{transform:i,featureIndices:s}=this._index,{scale:n,translate:o}=i;for(const i of s)r.move(i),t=this._readCoordinates(n,o,e,t);return t}_readCoordinates([e,t,r],[i,s,n],o,a){const l=this._reader,c=l.getLength(),h=l.pos()+c;for(;l.pos()<h&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),h=l.pos()+c;for(;l.pos()<h&&l.next();)3===l.tag()?(l.getUInt32(),o[a++]=i+e*l.getSInt64(),o[a++]=s+t*l.getSInt64(),o[a++]=n+r*l.getSInt64()):l.skip();break}default:l.skip()}return a}}function H(e){for(;e.next();){if(1===e.tag())return F(e.getMessage());e.skip()}G()}function F(e){let t,r,i=!1,s=!1,n=0;const o=new Array,a=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&G();break;case 9:i=e.getBool()??!1;break;case 12:t=(0,P.Q1)(e.processMessage(D.ae));break;case 13:{const t=e.processMessage(D.cn);t.index=n++,o.push(t);break}case 15:{a.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:s=e.getBool()??!1;break;default:e.skip()}const c=new I.A(o);return null!=t&&s&&null!=r&&c.has(r)||G(),{transform:t,exceededTransferLimit:i,fieldsIndex:c,objectIdFieldName:r,featureIndices:a,attributeIndices:l}}function G(){const e=new T.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function L(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const N=(0,R.vt)();class V{constructor(e,t,r,i,s){this.spatialReference=e,this.url=r,this.objectIdField=i,this.capabilities=s;const{supportsMaxRecordCountFactor:n,maxRecordCount:o}=this.capabilities.query,a=o??8e3,l=(n?4:null)??1,c=a*l;this._pageSize=Math.min(8e3,c);const h=t.clone();h.cacheHint=!0,h.resultType="tile",h.outSpatialReference=e,h.returnGeometry=!0,h.returnZ=!0,h.maxRecordCountFactor=l,h.num=a,h.outFields=[i],this._baseQuery=h}async fetch(e,t){const{spatialReference:r}=this,i=(0,O.w1)(e.extent,r),s=this._baseQuery.clone();s.geometry=i;const o=new Array;let a=0,l=!1,c=1;for(;!l;){const e=[];for(let r=0;r<c;++r)e.push(this._fetchPage(s,a++,t));const r=await Promise.all(e);(0,n.Te)(t);for(const e of r){const t=0!==e.featureCount;l||=!e.exceededTransferLimit||!t,t&&o.push(e)}c=Math.min(c+1,4)}return new E(e,o)}async _fetchPage(e,t,r){const i=e.clone();i.start=t*this._pageSize;const s=(await(0,C.kS)(this.url,i,{signal:r})).data;return(0,n.Te)(r),new B(s)}}var j=r(9762),U=r(27993);class W{constructor(e,t,r){this.objectIdField=e,this.spatialReference=t,this.renderSpatialReference=r}process(e){const{pages:t}=e;if(0===t.length)return null;const r=t.reduce(((e,{featureCount:t})=>e+t),0);if(0===r)return null;const i=this.spatialReference,s=this.renderSpatialReference,n=new Float64Array(3*r),o=new Uint32Array(r);let a=0,l=0;for(const e of t)a=e.readAllCoordinates(n,a),l=e.readAllObjectIds(o,l);const c=new Float64Array(n.length);if(!(0,j.projectBuffer)(n,i,0,c,s,0,r))throw new Error("Failed to project coordinates");const h=e.descriptor.extent,u=(0,O.gX)(h),d=(0,R.vt)();return(0,U.F)([u[0],u[1],0],i,d,s),{numFeatures:r,coordinates:c,objectIds:o,tileId:e.descriptor.id,localOrigin:d}}}var Y=r(36563),$=r(97768),k=r(24151),X=(r(37585),r(48163)),q=r(34727),Q=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const Z=[];{const e=16;for(let t=0;t<360;t+=360/e)Z.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}var J,K;(K=J||(J={}))[K.Left=0]="Left",K[K.Center=1]="Center",K[K.Right=2]="Right",Object.freeze({left:0,center:.5,right:1});const ee=Object.freeze({"bottom-left":(0,X.fA)(0,0),bottom:(0,X.fA)(.5,0),"bottom-right":(0,X.fA)(1,0),left:(0,X.fA)(0,.5),center:(0,X.fA)(.5,.5),right:(0,X.fA)(1,.5),"top-left":(0,X.fA)(0,1),top:(0,X.fA)(.5,1),"top-right":(0,X.fA)(1,1)});var te=r(4431),re=r(49255);const ie={required:[]};re.V.Depth;class se extends f.A{consumes(){return ie}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}modify(e){}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return!1}forEachGeometry(e){}queryRenderOccludedState(e){return!1}}class ne extends se{constructor(){super(...arguments),this.drapedPriority=0}}var oe=r(89192);class ae{constructor(e,t){this._material=e,this._repository=t,this._map=new Map}dispose(){this._map.forEach(((e,t)=>{null!=e&&this._repository.release(this._material,t)}))}load(e,t,r){const i=this._material.produces.get(t);if(!i?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,t,r));const s=this._map.get(r);if(null!=s){if(s.ensureResources(e)===oe.Am.LOADED)return s;this._repository.requestRender()}return null}}var le=r(13464),ce=r(72824);class he extends ce.gy{constructor(e=(0,R.vt)()){super(),this.origin=e}get slicePlaneLocalOrigin(){return this.origin}}var ue,de,fe=r(4576),me=r(81139),pe=r(3694),ge=r(3483),_e=r(58083),ve=r(9093);!function(e){e[e.ADD=0]="ADD",e[e.UPDATE=1]="UPDATE",e[e.REMOVE=2]="REMOVE"}(ue||(ue={})),function(e){e[e.NONE=0]="NONE",e[e.VISIBILITY=1]="VISIBILITY",e[e.GEOMETRY=2]="GEOMETRY",e[e.TRANSFORMATION=4]="TRANSFORMATION",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.OCCLUDEE=16]="OCCLUDEE"}(de||(de={}));var ye=r(620);class we{constructor(e=0,t=0){this.from=e,this.to=t}get numElements(){return this.to-this.from}}function be(e){const t=new Map;e.forAll((e=>t.set(e.from,e)));let r=!0;for(;r;){r=!1;for(let i=0;i<e.length;++i){const s=e.data[i],n=t.get(s.to);if(!n)return;s.to=n.to,t.delete(n.from),e.removeUnordered(n),r=!0}}}class xe extends we{constructor(e,t,r){super(t,r),this.geometry=e}get isVisible(){return this.geometry.visible}get hasHighlights(){return this.isVisible&&this.geometry.hasHighlights}foreachHighlightGroup(e){this.isVisible&&this.geometry.foreachHighlightGroup(e)}get hasOccludees(){return null!=this.geometry.occludees}}class Se{constructor(){this.first=0,this.count=0}}class Ae{constructor(){this._numElements=0,this._instances=new Map,this.holes=new pe.A({allocator:e=>e||new we,deallocator:null}),this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightGroups=new Set,this.drawCommandsDefault=Oe(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=Oe(),this.drawCommandsShadowHighlightRest=Oe()}get numElements(){return this._numElements}get instances(){return this._instances}get hasHighlights(){return this.highlightGroups.size>0}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightGroups.clear()}updateIfDrawCommandsDirty(e){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const e of this.instances.values())this.updateDrawState(e);this.updateDrawCommands(e)}}addInstance(e,t){this.deleteInstance(e),this._instances.set(e,t),this._numElements+=t.numElements}deleteInstance(e){const t=this._instances.get(e);t&&(this._numElements-=t.numElements,this._instances.delete(e))}updateInstance(e,t,r){const i=this._instances.get(e);i&&(this._numElements-=i.numElements,i.from=t,i.to=r,this._numElements+=i.numElements)}updateDrawState(e){e.isVisible?(e.foreachHighlightGroup((e=>this.highlightGroups.add(e))),e.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(e){if(this.drawCommandsDefault.clear(),this.drawCommandsHighlights.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsShadowHighlightRest.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;if(!this.needsMultipleCommands()){const t=this.drawCommandsDefault.pushNew(),r=this.holes.front();return null!=this.vao&&1===this.holes.length&&r.to===Math.floor(this.vao.byteSize/e)?(t.first=0,void(t.count=r.from)):(t.first=1/0,t.count=0,this._instances.forEach((e=>{t.first=Math.min(t.first,e.from),t.count=Math.max(t.count,e.to)})),void(t.count-=t.first))}const t=Array.from(this._instances.values()).sort(((e,t)=>e.from===t.from?e.to-t.to:e.from-t.from)),{drawCommandsHighlights:r}=this;for(const e of t)e.isVisible&&(Ce(e.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,e),e.hasHighlights?e.foreachHighlightGroup((t=>{let i=r.get(t);i||(i=Oe(),r.set(t,i)),Ce(i,e)})):Ce(this.drawCommandsShadowHighlightRest,e))}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}}function Oe(){return new pe.A({allocator:e=>e||new Se,deallocator:e=>e})}function Ce(e,t){const r=e.back();if(null==r){const r=e.pushNew();return r.first=t.from,void(r.count=t.numElements)}if(function(e,t){return e.first+e.count>=t.from}(r,t)){const e=t.from-r.first+t.numElements;r.count=e}else{const r=e.pushNew();r.first=t.from,r.count=t.numElements}}class Ee{constructor(e){this.origin=e,this.buffers=new Array}dispose(){this.buffers.forEach((e=>e.vao.dispose())),this.buffers.length=0}findBuffer(e){return this.buffers.find((t=>t.instances.has(e)))}}let Te=class extends ne{get _hasAnyHighlight(){return this._highlightGroups.size>0}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new he,this._highlightGroups=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=(0,$.WD)(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==re.V.Highlight&&t!==re.V.ShadowHighlight||this._hasAnyHighlight))&&e(t)))}))}initializeRenderContext(e,t){this._glMaterials=new ae(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,(0,te.U)(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.usedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(null==t)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const e=i.renderGeometry,s=this._dataByOrigin.get(e.localOrigin.id),n=s?.findBuffer(e.id);if(null==n)return;const o=n.instances.get(e.id);if(i.updateType&(de.GEOMETRY|de.TRANSFORMATION)){const i=Ne(t.elementCount(o.geometry.geometry.attributes)*r),s=t.vertexBufferLayout.createView(i.buffer);this._writeGeometry(e,s,0),n.vao.vertexBuffers.get("geometry").setSubData(i,o.from*r,0,o.numElements*r)}i.updateType&(de.HIGHLIGHT|de.OCCLUDEE|de.VISIBILITY)&&(n.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new me.O;for(const t of e){const e=t.localOrigin;if(null==e)continue;let i=r.get(e.id,null);null==i&&(i=new ze(e.vec3),r.set(e.id,null,i)),i.changes.push(t)}for(const e of t){const t=e.localOrigin;if(null==t)continue;const i=this._dataByOrigin.get(t.id),s=i?.findBuffer(e.id);if(null==s)continue;let n=r.get(t.id,s);null==n&&(n=new ze(t.vec3),r.set(t.id,s,n)),n.changes.push(e)}return r}_addAndRemoveGeometries(e,t){if(null==this._bufferWriter||null==this._vaoCache)return;const{_bufferWriter:r,_dataByOrigin:i}=this,s=r.vertexBufferLayout.stride/4,n=this._computeDeltas(e,t);n.forEach(((e,t)=>{const o=e.get(null),a=null!=o?o.changes:[];n.delete(t,null);let l=i.get(t);if(e.forEach(((e,o)=>{if(n.delete(t,o),null==o)return void(0,ye.vA)(!1,"No VAO for removed geometries");if(o.instances.size===e.changes.length)return this._vaoCache.deleteVao(o.vao),(0,fe.Xy)(l.buffers,o),void(0===l.buffers.length&&0===a.length&&i.delete(t));const c=o.numElements,h=o.vao.byteSize/4,u=a.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),d=e.changes.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),f=Math.min((c+u-d)*s,Ge),m=f>h;f>De&&f<h/2?(e.changes.forEach((({id:e})=>o.deleteInstance(e))),o.instances.forEach((({geometry:e})=>a.push(e))),this._vaoCache.deleteVao(o.vao),(0,fe.Xy)(l.buffers,o)):m?this._applyAndRebuild(o,a,e):this._applyRemoves(o,e)})),a.length>0)for(null==l&&(l=new Ee(o.origin),i.set(t,l)),l.buffers.forEach((e=>this._applyAdds(e,a)));a.length>0;)l.buffers.push(this._applyAndRebuild(new Ae,a,null))}))}_updateDrawCommands(){this._highlightGroups.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.updateIfDrawCommandsDirty(this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&(0,ge.FB)(this._highlightGroups,e.highlightGroups),this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(null!=r)for(const t of r.changes)e.deleteInstance(t.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,n=s/4,o=Math.floor(Ge/n);let a=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(a+s>o&&a>0){t.push(r);break}a+=s;const n=new xe(r,0,0);(0,ye.vA)(null==e.instances.get(r.id)),e.addInstance(r.id,n)}const l=a*n,c=Ne(l),h=i.vertexBufferLayout.createView(c.buffer);let u=0;e.resetInstanceSummary(),e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,h,u);const s=u;u+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,u),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(Ve(l)),e.vao.vertexBuffers.get("geometry").setSubData(c,0,0,u*n),e.holes.clear();const d=e.holes.pushNew();return d.from=u,d.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;for(const r of t.changes){const t=r.id,i=e.instances.get(t);if(!i)continue;e.deleteInstance(t);const s=Ie.back();if(s){if(s.to===i.from){s.to=i.to;continue}if(s.from===i.to){s.from=i.from;continue}}const n=Ie.pushNew();n.from=i.from,n.to=i.to}be(Ie);const r=this._bufferWriter.vertexBufferLayout.stride/4,i=Ie.reduce(((e,t)=>Math.max(e,t.numElements)),0)*r,s=Ne(i);s.fill(0,0,i);const n=e.vao.vertexBuffers.get("geometry");Ie.forAll((e=>n.setSubData(s,e.from*r,0,e.numElements*r))),e.holes.pushArray(Ie.data,Ie.length),Ie.forAll(((e,t)=>Ie.data[t]=null)),Ie.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!function(e){return null!=e.vao}(e))return void this._applyAndRebuild(e,t,null);const r=this._bufferWriter,i=r.vertexBufferLayout.stride/4,s=e.numElements,n=t.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),o=Math.min((s+n)*i,Ge),a=4*o;if(e.vao.byteSize<Ve(Ge-De)&&a>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);be(e.holes);const l=new Array;for(const i of t){const t=r.elementCount(i.geometry.attributes),s=Re(e.holes,t);l.push(s)}const c=e.vao.vertexBuffers.get("geometry");let h=0,u=0,d=0;const f=Ne(o),m=r.vertexBufferLayout.createView(f.buffer);t.forEach(((t,s)=>{const n=l[s];if(null==n)return;if(d!==n){const e=d-u;e>0&&c.setSubData(f,u*i,0,e*i),u=n,h=0}const o=r.elementCount(t.geometry.attributes);this._writeGeometry(t,m,h),h+=o,d=n+o;const a=new xe(t,n,n+o);(0,ye.vA)(null==e.instances.get(t.id)),e.addInstance(t.id,a),e.drawCommandsDirty=!0}));const p=d-u;p>0&&c.setSubData(f,u*i,0,p*i),(0,fe.$i)(t,((e,t)=>null==l[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&((0,_e.C)(Me,e.transformation),Me[12]-=e.localOrigin.vec3[0],Me[13]-=e.localOrigin.vec3[1],Me[14]-=e.localOrigin.vec3[2],(0,_e.B8)(Pe,Me),(0,_e.mg)(Pe,Pe),this._bufferWriter.write(Me,Pe,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}prepareTechnique(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const{highlightGroup:s}=r,n=t===re.V.ShadowHighlight,o=t===re.V.Highlight,a=o||n;if(a&&(0===this._highlightGroups.size||o&&s&&!this._highlightGroups.has(s)))return null;const l=t===re.V.ShadowExcludeHighlight,c=!(a||l);for(const i of this._dataByOrigin.values())for(const o of i.buffers){if(a&&(0===o.highlightGroups.size||s&&!o.highlightGroups.has(s)))continue;const i=n?o.drawCommandsHighlights.size>0:a?s?o.drawCommandsHighlights.get(s):o.drawCommandsHighlights.size>0:((l&&o.needsMultipleCommands()?o.drawCommandsShadowHighlightRest:o.drawCommandsDefault)||null)?.length??!1,h=c&&o.drawCommandsOccludees||null;if(i||h?.length){const i=this._glMaterials.load(e.rctx,r.slot,t),s=null!=i?i.beginSlot(r):null;if(null!=s)return s}}return null}render(e,t){const{output:r,bind:i}=e,s=r===re.V.Highlight,n=r===re.V.ShadowHighlight,o=s||n,a=r===re.V.ShadowExcludeHighlight,l=!(o||a),c=i.slot===le.N.OCCLUDER_MATERIAL||i.slot===le.N.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,{rctx:h}=e;h.runAppleAmdDriverHelper(),h.bindTechnique(t,i,this.material.parameters);const{highlightGroup:u}=i;if(r!==re.V.Highlight||u)for(const e of this._dataByOrigin.values())for(const r of e.buffers){if(s&&(!r.hasHighlights||!r.drawCommandsHighlights.has(u)))continue;if(n&&!r.hasHighlights)continue;const d=()=>{const e=[];for(const t of r.drawCommandsHighlights.values())e.push(t);return e},f=o&&!n?r.drawCommandsHighlights.get(u)??null:null,m=n?d():o?f?[f]:je:(a&&r.needsMultipleCommands()?[r.drawCommandsShadowHighlightRest]:[r.drawCommandsDefault])||je,p=m.some((e=>e.length>0)),g=l&&r.drawCommandsOccludees||null;if(p||g?.length){const s=t.program;if(this._drawParameters.origin=e.origin,s.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(r.vao),h.bindVAO(r.vao),p)for(const e of m)h.setPipelineState(t.getPipeline(!1,c)),e.forAll((e=>h.drawArrays(t.primitiveType,e.first,e.count)));g?.length&&(h.setPipelineState(t.getPipeline(!0,c)),g.forAll((e=>h.drawArrays(t.primitiveType,e.first,e.count))))}}}get test(){}};(0,i._)([(0,a.M)({constructOnly:!0})],Te.prototype,"material",void 0),Te=(0,i._)([(0,c.$)("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],Te);class ze{constructor(e){this.origin=e,this.changes=new Array}}function Re(e,t){let r;if(!e.some((e=>!(e.numElements<t||(r=e,0)))))return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const Me=(0,ve.vt)(),Pe=(0,ve.vt)(),Ie=new pe.A({allocator:e=>e||new we,deallocator:null}),De=65536,Be=4*De,He=1024,Fe=16777216,Ge=Fe/4;let Le=new Float32Array(De);function Ne(e){return Le.length<e&&(Le=new Float32Array(e)),Le}function Ve(e){const t=4*e;return t<=He?He:t<Be?(0,q.cU)(t):Math.max(Math.min(Math.ceil(1.5*t/Be)*Be,Fe),t)}const je=[];let Ue=class extends ne{constructor(e){super(e),this._hasHighlights=!1,this._glMaterials=null,this._produces=new Map,this._renderGeometries=new Map,this._vaoCache=null,this._drawParameters=new he,this._bufferWriter=null}get produces(){return this._produces}initialize(){this._bufferWriter=this.material.createBufferWriter(),this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!!(t!==re.V.Highlight&&t!==re.V.ShadowHighlight||this._hasHighlights)&&e(t)))}))}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.destroyRenderGeometry(t)}prepareTechnique(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e,s=t.produces.get(i.slot);if(!s?.(r))return null;if((r===re.V.Highlight||r===re.V.ShadowHighlight)&&!this._hasHighlights)return null;const n=this._glMaterials.load(e.rctx,i.slot,r);return n?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(0===r.size)return;const{bind:i}=e,s=i.slot===le.N.OCCLUDER_MATERIAL||i.slot===le.N.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const o=t.program;for(const[e,a]of r)this._drawParameters.origin=a.localOrigin,o.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(a.vao),n.bindVAO(a.vao),n.setPipelineState(t.getPipeline(!1,s)),n.drawArrays(t.primitiveType,0,a.numElements)}initializeRenderContext(e,t){this._glMaterials=new ae(this.material,e.materials);const r=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,(0,te.U)(this._bufferWriter.vertexBufferLayout));this._vaoCache=r}uninitializeRenderContext(){}createRenderGeometry(e,t,r){this.destroyRenderGeometry(e);const i=this._bufferWriter.vertexBufferLayout.stride/4,s=this._vaoCache.newVao(Ve(t.data.length));s.vertexBuffers.get("geometry").setSubData(t.data,0,0,t.numElements*i);const n={localOrigin:r,vao:s,numElements:t.numElements};return this._renderGeometries.set(e,n),n}destroyRenderGeometry(e){const t=this._renderGeometries.get(e);null!=t&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}};(0,i._)([(0,a.M)({constructOnly:!0})],Ue.prototype,"material",void 0),Ue=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.rendering.SimpleMaterialRenderer")],Ue);var We=r(40804),Ye=r(76844),$e=r(63907);const ke=128,Xe=.5;function qe(e,t,r){return r&&(t/=Math.SQRT2),Ke(e,((i,s)=>{let n=i-.5*e+.25,o=.5*e-s-.75;if(r){const e=(n+o)/Math.SQRT2;o=(o-n)/Math.SQRT2,n=e}return Math.max(Math.abs(n),Math.abs(o))-.5*t}))}function Qe(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const s=.5*t;return Ke(e,((t,n)=>{let o,a=t-.5*e,l=.5*e-n-1;if(r){const e=(a+l)/Math.SQRT2;l=(l-a)/Math.SQRT2,a=e}return a=Math.abs(a),l=Math.abs(l),o=a>l?a>s?Math.sqrt((a-s)*(a-s)+l*l):l:l>s?Math.sqrt(a*a+(l-s)*(l-s)):a,o-=i/2,o}))}function Ze(e,t,r){return(i,s)=>{const n=i-e,o=s-t;return Math.sqrt(n*n+o*o)-r}}function Je(e,t,r){const i=Math.sqrt(t*t+r*r);return(s,n)=>{const o=Math.abs(s-e)-r,a=n-e+t/2+.75,l=(t*o+r*a)/i,c=-a;return Math.max(l,c)}}function Ke(e,t){const r=new Uint8Array(4*e*e);for(let i=0;i<e;i++)for(let s=0;s<e;s++){const n=s+e*i;let o=t(s,i);o=o/e+.5,(0,We.U)(o,r,4*n)}return r}var et=r(77690),tt=r(29242),rt=r(38954),it=r(91829);var st=r(13030),nt=r(78662),ot=r(1843),at=r(40268),lt=r(35093),ct=r(25634),ht=r(14903),ut=r(30669),dt=r(46540);class ft{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}}var mt=r(59907),pt=r(43616),gt=r(13259),_t=r(97220),vt=r(84867),yt=r(39341),wt=r(59643),bt=r(33524),xt=r(34886),St=r(90644);class At extends vt.w{constructor(e,t,r){super(e,t,r),this.primitiveType=t.occlusionPass?$e.WR.POINTS:$e.WR.TRIANGLES}initializeProgram(e,t){return new xt.B(e.rctx,At.shader.get().build(t),yt.D)}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:i,output:s,depthEnabled:n,occlusionPass:o}=e,a=t===wt.Y.NONE,l=t===wt.Y.FrontFace,c=r?Ot:null,h=i?null:(a||l)&&s!==re.V.Highlight&&(n||o)?St.Uy:null;return(0,St.Ey)({blending:s===re.V.Color?a?St.dH:(0,bt.ez)(t):null,depthTest:i?null:{func:$e.MT.LEQUAL},depthWrite:h,drawBuffers:(0,bt.m6)(t,s),colorWrite:St.kn,polygonOffset:c})}}At.shader=new _t.$(gt.H,(()=>r.e(8241).then(r.bind(r,48241))));const Ot={factor:0,units:-4};var Ct=r(53466),Et=r(22911),Tt=r(51976),zt=r(35256);class Rt extends zt.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1,this.textureCoordinateType=Ct.I.None,this.emissionSource=Et.ZX.None,this.discardInvisibleFragments=!0,this.hasSliceInVertexProgram=!0,this.hasVvInstancing=!1}}(0,i._)([(0,Tt.W)()],Rt.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"occlusionTestEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"signedDistanceFieldEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"vvSize",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"vvColor",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasVerticalOffset",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasScreenSizePerspective",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasRotation",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"debugDrawLabelBorder",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasSlicePlane",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"hasPolygonOffset",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"depthEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"pixelSnappingEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"draped",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"multipassEnabled",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"cullAboveGround",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"occlusionPass",void 0),(0,i._)([(0,Tt.W)()],Rt.prototype,"objectAndLayerIdColorInstanced",void 0);class Mt extends ht.im{constructor(e,t){super(e,Jt),this.produces=new Map([[le.N.HUD_MATERIAL,e=>(0,re.dX)(e)&&!this.parameters.drawInSecondSlot],[le.N.LABEL_MATERIAL,e=>(0,re.dX)(e)&&this.parameters.drawInSecondSlot],[le.N.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[le.N.DRAPED_MATERIAL,e=>(0,re.dX)(e)]]),this._visible=!0,this._configuration=new Rt(t)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===le.N.OCCLUSION_PIXELS&&this.parameters.occlusionTest,e===re.V.Color&&(this._configuration.debugDrawLabelBorder=!!Q.b.LABELS_SHOW_BORDER),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.oitPass=t.oitPass,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,t,r,i,s,n){const{options:{selectionMode:o,hud:a,excludeLabels:l},point:c,camera:h}=r,{parameters:u}=this;if(!o||!a||l&&u.isLabel||!e.visible||!c)return;const{scaleX:d,scaleY:f}=this._getScreenScale(e,h.pixelRatio);(0,et.z0)(Vt,t),e.attributes.has(dt.r.FEATUREATTRIBUTE)&&function(e){const t=e[0],r=e[1],i=e[2],s=e[3],n=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=1/Math.sqrt(t*t+r*r+i*i),u=1/Math.sqrt(s*s+n*n+o*o),d=1/Math.sqrt(a*a+l*l+c*c);e[0]=t*h,e[1]=r*h,e[2]=i*h,e[3]=s*u,e[4]=n*u,e[5]=o*u,e[6]=a*d,e[7]=l*d,e[8]=c*d}(Vt);const m=e.attributes.get(dt.r.POSITION),p=e.attributes.get(dt.r.SIZE),g=e.attributes.get(dt.r.NORMAL),_=e.attributes.get(dt.r.CENTEROFFSETANDDISTANCE);(0,ye.vA)(m.size>=3);const v=(0,gt.c)(u),y="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<m.data.length/m.size;e++){const i=e*m.size;(0,rt.a)(Ht,m.data[i],m.data[i+1],m.data[i+2]),(0,rt.h)(Ht,Ht,t),(0,rt.h)(Ht,Ht,h.viewMatrix);const s=e*_.size;if((0,rt.a)(Wt,_.data[s],_.data[s+1],_.data[s+2]),!y&&(Ht[0]+=Wt[0],Ht[1]+=Wt[1],0!==Wt[2])){const e=Wt[2];(0,rt.n)(Wt,Ht),(0,rt.f)(Ht,Ht,(0,rt.j)(Wt,Wt,e))}const o=e*g.size;if((0,rt.a)(Ft,g.data[o],g.data[o+1],g.data[o+2]),It(Ft,Vt,h,kt),this._applyVerticalOffsetTransformationView(Ht,kt,h,Bt),h.applyProjection(Ht,Gt),Gt[0]>-1){y&&(Wt[0]||Wt[1])&&(Gt[0]+=Wt[0]*h.pixelRatio,0!==Wt[1]&&(Gt[1]+=(0,ut.m0)(Wt[1],Bt.factorAlignment)*h.pixelRatio),h.unapplyProjection(Gt,Ht)),Gt[0]+=this.parameters.screenOffset[0]*h.pixelRatio,Gt[1]+=this.parameters.screenOffset[1]*h.pixelRatio,Gt[0]=Math.floor(Gt[0]),Gt[1]=Math.floor(Gt[1]);const t=e*p.size;Qt[0]=p.data[t]*d,Qt[1]=p.data[t+1]*f,(0,ut.MD)(Qt,Bt.factor,Qt);const i=Xt*h.pixelRatio;let s=0;if(u.textureIsSignedDistanceField&&(s=u.outlineSize*h.pixelRatio/2),Dt(c,Gt[0],Gt[1],Qt,i,s,u,v)){const e=r.ray;if((0,rt.h)(Nt,Ht,(0,_e.B8)(Ut,h.viewMatrix)),Gt[0]=c[0],Gt[1]=c[1],h.unprojectFromRenderScreen(Gt,Ht)){const t=(0,R.vt)();(0,rt.c)(t,e.direction);const r=1/(0,rt.m)(t);(0,rt.j)(t,t,r),n((0,rt.p)(e.origin,Ht)*r,t,-1,!0,1,Nt)}}}}}intersectDraped(e,t,r,i,s,n){const o=e.attributes.get(dt.r.POSITION),a=e.attributes.get(dt.r.SIZE),l=this.parameters,c=(0,gt.c)(l),{scaleX:h,scaleY:u}=this._getScreenScale(e,e.screenToWorldRatio),d=qt*e.screenToWorldRatio;for(let t=0;t<o.data.length/o.size;t++){const r=t*o.size,f=o.data[r],m=o.data[r+1],p=t*a.size;Qt[0]=a.data[p]*h,Qt[1]=a.data[p+1]*u;let g=0;l.textureIsSignedDistanceField&&(g=l.outlineSize*e.screenToWorldRatio/2),Dt(i,f,m,Qt,d,g,l,c)&&s(n.dist,n.normal,-1,!1)}}createBufferWriter(){return new tr}_updateScaleInfo(e,t,r){const i=this.parameters;null!=i.screenSizePerspective?(0,ut.cJ)(r,t,i.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=i.screenSizePerspectiveAlignment?(0,ut.cJ)(r,t,i.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,r,i,s,n,o){const a=It(t,r,s,kt);return this._applyVerticalGroundOffsetView(e,a,s,o),this._applyVerticalOffsetTransformationView(o,a,s,n),this._applyPolygonOffsetView(o,a,i[3],s,o),this._applyCenterOffsetView(o,i,o),o}applyShaderOffsetsNDC(e,t,r,i,s){return this._applyCenterOffsetNDC(e,t,r,i),null!=s&&(0,rt.c)(s,i),this._applyPolygonOffsetNDC(i,t,r,i),i}_applyPolygonOffsetView(e,t,r,i,s){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const a=n*o;if(this.parameters.shaderPolygonOffset<=0)return(0,rt.c)(s,e);const l=(0,q.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/i.viewport[2];return(0,rt.j)(s,e,a>0?c:1/c),s}_applyVerticalGroundOffsetView(e,t,r,i){const s=(0,rt.m)(e),n=r.aboveGround?1:-1,o=r.computeRenderPixelSizeAtDist(s)*at.R,a=(0,rt.j)(Ht,t.normal,n*o);return(0,rt.g)(i,e,a),i}_applyVerticalOffsetTransformationView(e,t,r,i){const s=this.parameters;if(!s.verticalOffset?.screenLength){if(s.screenSizePerspective||s.screenSizePerspectiveAlignment){const r=(0,rt.m)(e);this._updateScaleInfo(i,r,t.cosAngle)}else i.factor.scale=1,i.factorAlignment.scale=1;return e}const n=(0,rt.m)(e),o=s.screenSizePerspectiveAlignment??s.screenSizePerspective,a=(0,pt.kE)(r,n,s.verticalOffset,t.cosAngle,o);return this._updateScaleInfo(i,n,t.cosAngle),(0,rt.j)(t.normal,t.normal,a),(0,rt.g)(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,rt.c)(r,e),i&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,rt.n)(Ft,r),(0,rt.g)(r,r,(0,rt.j)(Ft,Ft,t[2])))),r}_applyCenterOffsetNDC(e,t,r,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&(0,rt.c)(i,e),s||(i[0]+=t[0]/r.fullWidth*2,i[1]+=t[1]/r.fullHeight*2),i}_applyPolygonOffsetNDC(e,t,r,i){const s=this.parameters.shaderPolygonOffset;if(e!==i&&(0,rt.c)(i,e),s){const e=r.aboveGround?1:-1,n=e*Math.sign(t[3]);i[2]-=(n||e)*s}return i}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,i=e[3]>=lt.Q||t>=lt.Q&&r[3]>=lt.Q;return this._visible&&i}createGLMaterial(e){return new Pt(e)}calculateRelativeScreenBounds(e,t,r=(0,O.vt)()){return function(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}_getScreenScale(e,t){const r=e.attributes.get(dt.r.FEATUREATTRIBUTE);if(null==r)return{scaleX:t,scaleY:t};const i=(0,it.ci)(r.data,$t);return(0,nt.VC)(Yt,this.parameters,i),{scaleX:Yt[0]*t,scaleY:Yt[1]*t}}}class Pt extends ct.m8{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(At,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function It(e,t,r,i){return function(e){return(t=e)instanceof Float32Array&&t.length>=16||function(e){return Array.isArray(e)&&e.length>=16}(e);var t}(t)&&(t=(0,et.z0)(jt,t)),(0,rt.t)(i.normal,e,t),(0,rt.h)(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=(0,rt.l)(Lt,Zt),i}function Dt(e,t,r,i,s,n,o,a){let l=t-s-i[0]*a[0],c=l+i[0]+2*s,h=r-s-i[1]*a[1],u=h+i[1]+2*s;const d=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&null!=d&&(l+=i[0]*d[0],h+=i[1]*d[1],c-=i[0]*(1-d[2]),u-=i[1]*(1-d[3]),l-=n,c+=n,h-=n,u+=n),e[0]>l&&e[0]<c&&e[1]>h&&e[1]<u}const Bt=new class{constructor(){this.factor=new ft,this.factorAlignment=new ft}},Ht=(0,R.vt)(),Ft=(0,R.vt)(),Gt=(0,it.vt)(),Lt=(0,R.vt)(),Nt=(0,R.vt)(),Vt=(0,tt.vt)(),jt=(0,tt.vt)(),Ut=(0,ve.vt)(),Wt=(0,R.vt)(),Yt=(0,R.vt)(),$t=(0,it.vt)(),kt={normal:Lt,cosAngle:0},Xt=1,qt=2,Qt=[0,0],Zt=(0,R.fA)(0,0,1);class Jt extends ct.NV{constructor(){super(...arguments),this.renderOccluded=ht.m$.Occlude,this.isDecoration=!1,this.color=(0,it.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,X.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,it.CN)(1,1,1,1),this.outlineSize=0,this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.draped=!1,this.isLabel=!1}}const Kt=(0,ot.BP)().vec3f(dt.r.POSITION).vec3f(dt.r.NORMAL).vec2f(dt.r.UV0).vec4u8(dt.r.COLOR).vec2f(dt.r.SIZE).f32(dt.r.ROTATION).vec4f(dt.r.CENTEROFFSETANDDISTANCE).vec4f(dt.r.FEATUREATTRIBUTE),er=Kt.clone().vec4u8(dt.r.OBJECTANDLAYERIDCOLOR);class tr{constructor(){this.vertexBufferLayout=(0,l.A)("enable-feature:objectAndLayerId-rendering")?er:Kt}elementCount(e){return 6*e.get(dt.r.POSITION).indices.length}write(e,t,r,i,s,n){(0,mt.Hk)(r.get(dt.r.POSITION),e,s.position,n,6),(0,mt.p1)(r.get(dt.r.NORMAL),t,s.normal,n,6);const o=r.get(dt.r.UV0)?.data;let a=0,l=0,c=1,h=1;o&&o.length>=4&&(a=o[0],l=o[1],c=o[2],h=o[3]),c=Math.min(1.99999,c+1),h=Math.min(1.99999,h+1);let u=r.get(dt.r.POSITION).indices.length,d=n;const f=s.uv0;for(let e=0;e<u;++e)f.set(d,0,a),f.set(d,1,l),d++,f.set(d,0,c),f.set(d,1,l),d++,f.set(d,0,c),f.set(d,1,h),d++,f.set(d,0,c),f.set(d,1,h),d++,f.set(d,0,a),f.set(d,1,h),d++,f.set(d,0,a),f.set(d,1,l),d++;(0,mt.tb)(r.get(dt.r.COLOR),4,s.color,n,6);const{data:m,indices:p}=r.get(dt.r.SIZE);u=p.length;const g=s.size;d=n;for(let e=0;e<u;++e){const t=m[2*p[e]],r=m[2*p[e]+1];for(let e=0;e<6;++e)g.set(d,0,t),g.set(d,1,r),d++}if((0,mt.uO)(r.get(dt.r.ROTATION),s.rotation,n,6),r.get(dt.r.CENTEROFFSETANDDISTANCE)?(0,mt.Ut)(r.get(dt.r.CENTEROFFSETANDDISTANCE),s.centerOffsetAndDistance,n,6):(0,mt.Pq)(s.centerOffsetAndDistance,n,6*u),r.get(dt.r.FEATUREATTRIBUTE)?(0,mt.Ut)(r.get(dt.r.FEATUREATTRIBUTE),s.featureAttribute,n,6):(0,mt.Pq)(s.featureAttribute,n,6*u),null!=i){const e=r.get(dt.r.POSITION)?.indices;if(e){const t=e.length,r=s.getField(dt.r.OBJECTANDLAYERIDCOLOR,st.XP);(0,mt.tH)(i,r,t,n,6)}}}}let rr=class extends f.A{constructor(e){super(),this.view=null,this._renderGeometries=new Map,this._materials=new Map,this._renderers=new Map,this.view=e.view}initialize(){}destroy(){}async executeRenderCommands(e){for(const t of e)switch(t.id){case"create-rendergeometry":await this._createRenderGeometry(t);break;case"destroy-rendergeometry":await this._destroyRenderGeometry(t);break;case"create-material":await this._createMaterial(t)}}async _createMaterial(e){const{view:t}=this,{sharedSymbolResources:r}=t;if(null==r)throw new Error("No shared symbol resources found!");const{textures:i}=r,s=e.materialId,[n,o]=ir(i,t.state.viewingMode===k.RT.Global);this._materials.set(s,n);const a=new Ue({material:n});this._renderers.set(n,a),t._stage.addRenderPlugin(a),t._stage.renderView.renderer.updateHasFlags(),this.addHandles([(0,Y.hA)((()=>(0,$.Gz)(o)))])}async _createRenderGeometry(e){const t=e.renderGeometryId,r=e.materialId;null!=this._renderGeometries.get(t)&&await this._destroyRenderGeometry({renderGeometryId:t});const i=this._materials.get(r);if(null==i)return void console.error(`material ${e.materialId} not found`);const s=this._renderers.get(i);if(null==s)return void console.error("no renderer assigned to provided material");const n=s.createRenderGeometry(t,e.renderGeometryBuffer,e.localOrigin);this._renderGeometries.set(t,{renderGeometry:n,materialId:r}),this.view._stage.renderView.requestRender()}async _destroyRenderGeometry(e){const t=e.renderGeometryId,r=this._renderGeometries.get(t);if(null==r)return;const i=r.materialId,s=this._materials.get(i);if(null==s)return void console.error(`material ${i} not found`);const n=this._renderers.get(s);null!=n?n.destroyRenderGeometry(e.renderGeometryId):console.error("no renderer assigned to provided material")}};function ir(e,t){const r={anchorPosition:ee.center,occlusionTest:!0,hasSlicePlane:!1},i=r;if(i.color=[1,0,0,1],i.outlineColor=[0,0,0,1],i.outlineSize=1,null!=e){const t=e.fromData("circle-icon",(()=>function(e,t=ke,r=t*Xe,i=0){const s=function(e,t=ke,r=t*Xe,i=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return Ke(e,Ze(r,r,t/2))}(t,r);case"square":return function(e,t){return qe(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return Qe(e,t,!1,r)}(t,r,i);case"x":return function(e,t,r=0){return Qe(e,t,!0,r)}(t,r,i);case"kite":return function(e,t){return qe(e,t,!0)}(t,r);case"triangle":return function(e,t){return Ke(e,Je(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,i=t/2,s=e/2,n=.8*r,o=Ze(s,(e-t)/2-n,Math.sqrt(n*n+i*i)),a=Je(s,r,i);return Ke(e,((e,t)=>Math.max(a(e,t),-o(e,t))))}(t,r)}}(e,t,r,i);return new Ye.g(s,{mipmap:!1,wrap:{s:$e.pF.CLAMP_TO_EDGE,t:$e.pF.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0})}("circle")));i.textureId=t.texture.id,i.textureIsSignedDistanceField=!0,i.sampleSignedDistanceFieldTexelCenter=!1}return i.distanceFieldBoundingBox=sr,[new Mt(r,t),null]}rr=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderer")],rr);const sr=[Xe/2,Xe/2,1-Xe/2,1-Xe/2];var nr=r(97146);class or{constructor(e){this._bufferWriter=null,this._bufferWriter=e.createBufferWriter()}createBuffer(e){const t=this._bufferWriter;(0,_e.C)(ar,e.transformation),ar[12]-=e.localOrigin[0],ar[13]-=e.localOrigin[1],ar[14]-=e.localOrigin[2],(0,_e.B8)(lr,ar),(0,_e.mg)(lr,lr);const r=new Map;for(const[t,i]of e.attributes)r.set(t,{...i,indices:(0,nr.Dg)(i.indices)});const i=t.elementCount(r),s=t.vertexBufferLayout.stride/4;i>Math.floor(cr/s)&&console.warn("geometry with very large number of elements encountered");const n=new Float32Array(i*s),o=t.vertexBufferLayout.createView(n.buffer);return t.write(ar,lr,r,e.objectAndLayerIdColor,o,0),{data:n,numElements:i}}}const ar=(0,ve.vt)(),lr=(0,ve.vt)(),cr=4194304;class hr{constructor(e){this._context=e,this._commands=[],this._transferables=new Set}createMaterial(){const e=this._context,t=e.generateId("material"),r=ir(null,!0)[0],i=new or(r);return e.registerRenderGeometryBufferWriter(t,i),this._commands.push({id:"create-material",materialId:t}),t}createRenderGeometry(e,t){const r=t.materialId,i=this._context.getRenderGeometryBufferWriter(r);if(null==i)throw new Error(`no bufferwriter found for material ${r}`);const s=i.createBuffer(t);this._transferables.add(s.data.buffer),this._commands.push({id:"create-rendergeometry",renderGeometryId:e,materialId:r,renderGeometryBuffer:s,localOrigin:t.localOrigin})}destroyRenderGeometry(e){this._commands.push({id:"destroy-rendergeometry",renderGeometryId:e})}dispatch(){const e={commands:this._commands,transferList:Array.from(this._transferables)};return this._clearCommandBuffer(),e}_clearCommandBuffer(){this._commands=[],this._transferables.clear()}}class ur{constructor(){this._idCounter=0,this._bufferWriters=new Map}generateId(e=""){return`${e}${this._idCounter++}`}createEncoder(){return new hr(this)}registerRenderGeometryBufferWriter(e,t){this._bufferWriters.set(e,t)}getRenderGeometryBufferWriter(e){return this._bufferWriters.get(e)}}var dr=r(46610);let fr=class extends f.A{constructor(){super(),this.materialId=null}async remove(e,t){t.destroyRenderGeometry(e)}async render(e,t){null==this.materialId&&(this.materialId=t.createMaterial());const r=e.numFeatures,i=new Float64Array([0,0,1]),s=new Float64Array([255,255,255,255]),n=new Float64Array([24,24]),o=new Float64Array([0,0,0,1]),a=new Float64Array([0,0]),l=new Float64Array([0]),c=new Uint32Array(r);for(let e=0;e<r;++e)c[e]=e;const h=new Uint32Array(r);for(let e=0;e<r;++e)h[e]=0;const u=new dr.n(e.coordinates,c,3,!0),d=new dr.n(i,h,3,!0),f=new dr.n(a,h,2,!0),m=new dr.n(s,h,4,!0),p=new dr.n(l,h,1,!0),g=new dr.n(n,h,2,!0),_=new dr.n(o,h,4,!0),v={attributes:[[dt.r.POSITION,u],[dt.r.NORMAL,d],[dt.r.UV0,f],[dt.r.COLOR,m],[dt.r.ROTATION,p],[dt.r.SIZE,g],[dt.r.CENTEROFFSETANDDISTANCE,_]],objectAndLayerIdColor:void 0,transformation:(0,ve.vt)(),localOrigin:e.localOrigin,materialId:this.materialId};t.createRenderGeometry(e.tileId,v)}};fr=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.symbolization.TestSymbol")],fr);class mr{constructor(){this._testSymbol=new fr}async remove(e,t){this._testSymbol.remove(e,t)}async symbolize(e,t){this._testSymbol.render(e,t)}}let pr=class extends s.A.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._renderCommandContext=new ur,this._featureStore=new x,this._tileManager=new g({addTile:(e,t)=>this._addTile(e,t),removeTiles:e=>this._removeTiles(e)}),this._fetcher=null,this._processor=null,this._symbolizer=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager.destroy()}async setup({spatialReference:e,renderSpatialReference:t,baseQuery:r,url:i,objectIdField:s,capabilities:n,fieldsIndex:a,timeInfo:l}){const c=h.A.fromJSON(e);return this._fetcher=new V(c,d.A.fromJSON(r),i,s,n),this._processor=new W(s,c,h.A.fromJSON(t)),this._symbolizer=new mr,this._queryEngine=new u.d({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:s,fieldsIndex:a,availableFields:[s],spatialReference:e,featureStore:this._featureStore,timeInfo:l}),this._defaultQueryJSON=new d.A({outSpatialReference:c}).toJSON(),this.addHandles((0,o.wB)((()=>this.updating),(async e=>{this.emit("notify-updating",{updating:e})})),o.Vh),_r}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),_r}async _addTile(e,t){const r=await this._fetcher.fetch(e,t);(0,n.Te)(t);const i=this._processor.process(r);if(null==i)return r;const s=this._renderCommandContext.createEncoder();await this._symbolizer.symbolize(i,s),this._featureStore.addTile(r);const{commands:o,transferList:a}=s.dispatch();return await this.remoteClient.invoke("dispatchRenderCommands",o,{signal:t,transferList:a}),r}async _removeTiles(e){const t=this._renderCommandContext.createEncoder(),r=this._featureStore,i=this._symbolizer;for(const s of e)r.removeTile(s),await i.remove(s,t);const{commands:s,transferList:n}=t.dispatch();await this.remoteClient.invoke("dispatchRenderCommands",s,{transferList:n})}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,i._)([(0,a.M)()],pr.prototype,"updating",null),pr=(0,i._)([(0,c.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],pr);const gr=pr,_r={result:void 0}},4431:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(63907),s=r(74038);function n(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map((i=>{const n=e.fields.get(i),a=n.constructor.ElementCount,l=o(n.constructor.ElementType),c=n.offset,h=n.optional?.glNormalized??!1;return new s._(i,a,l,c,r,h,t)}))}function o(e){const t=a[e];if(t)return t;throw new Error("BufferType not supported in WebGL")}const a={u8:i.pe.UNSIGNED_BYTE,u16:i.pe.UNSIGNED_SHORT,u32:i.pe.UNSIGNED_INT,i8:i.pe.BYTE,i16:i.pe.SHORT,i32:i.pe.INT,f32:i.pe.FLOAT}},47522:(e,t,r)=>{r.d(t,{K:()=>n});var i=r(95250),s=r(2597);function n(e){e.uniforms.add(new i.e("alignPixelEnabled",((e,t)=>t.alignPixelEnabled))),e.code.add(s.H`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) {
|
|
146
146
|
if (!alignPixelEnabled)
|
|
147
147
|
return clipCoord;
|
|
148
148
|
vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w;
|