@arcgis/core 4.33.0-next.20250414 → 4.33.0-next.20250415
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/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/geometry/functions.js +1 -1
- package/arcade/geometry/operatorsWorker.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0252d853419adc203f04.js +1 -0
- package/assets/esri/core/workers/chunks/{fe1ad9ed0d32f557e5a3.js → 029705c229ccf2e6b78d.js} +28 -28
- package/assets/esri/core/workers/chunks/030f5b9a9757eead436b.js +1 -0
- package/assets/esri/core/workers/chunks/{4403b3f08907e88d0d91.js → 0b34c8356b8492ce7b16.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb65796296b0422cf266.js → 272a309760dacb13dee3.js} +1 -1
- package/assets/esri/core/workers/chunks/2bdbf678d4f013543dbb.js +1 -0
- package/assets/esri/core/workers/chunks/321f6f6d268755482c27.js +1 -0
- package/assets/esri/core/workers/chunks/{b7a1185ac49480fc1410.js → 35a59f0df087e3c588a9.js} +1 -1
- package/assets/esri/core/workers/chunks/{083548c5eea5aca6404c.js → 45d64b72b7e93e9c64d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{626e33ece2c49d40f6cd.js → 4e711f4fa1cbedf4dae5.js} +1 -1
- package/assets/esri/core/workers/chunks/56fdbe61ac84b036a1a2.js +1 -0
- package/assets/esri/core/workers/chunks/57fd5a52be41ddd6a11b.js +1 -0
- package/assets/esri/core/workers/chunks/5fb9bb3ac2f60dbd59c4.js +1 -0
- package/assets/esri/core/workers/chunks/{0a675f9f69b8b13b7443.js → 601fc99426f0213b0769.js} +1 -1
- package/assets/esri/core/workers/chunks/68d7babbe7e0d934e056.js +1 -0
- package/assets/esri/core/workers/chunks/6fc39a58f3011291c602.js +1 -0
- package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +1 -0
- package/assets/esri/core/workers/chunks/83e13baab4b90a88d967.js +1 -0
- package/assets/esri/core/workers/chunks/851baab753d9c8e967bd.js +1 -0
- package/assets/esri/core/workers/chunks/8ba7d44eff348004f084.js +1 -0
- package/assets/esri/core/workers/chunks/{9050dad7e4f093568026.js → 97267911d03c2426d319.js} +1 -1
- package/assets/esri/core/workers/chunks/984c5047ab1fa632ca09.js +1 -0
- package/assets/esri/core/workers/chunks/{5aae4e127e888f69435a.js → 9a1c058d3ecd1db0e996.js} +1 -1
- package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +1 -0
- package/assets/esri/core/workers/chunks/{ff62b813fff4a015a8a6.js → a4239e301728d594afa5.js} +1 -1
- package/assets/esri/core/workers/chunks/aca3ccb9599bcc444617.js +1 -0
- package/assets/esri/core/workers/chunks/{a3421383e48379012c9c.js → b6dd25bccb9f6e19c18e.js} +1 -1
- package/assets/esri/core/workers/chunks/bf4947fe446dcb477031.js +1 -0
- package/assets/esri/core/workers/chunks/d053c23fce77fb77cc00.js +1 -0
- package/assets/esri/core/workers/chunks/e31bb256921807464715.js +1 -0
- package/assets/esri/core/workers/chunks/{8aae03e347ab18ae6ee2.js → e3d25d027885eb1a415f.js} +1 -1
- package/assets/esri/core/workers/chunks/ed517687b3728fd2eb64.js +1 -0
- package/assets/esri/themes/base/widgets/_Expand.scss +6 -1
- package/assets/esri/themes/base/widgets/_TimeSlider.scss +97 -107
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ar.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bg.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bs.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ca.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_cs.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_da.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_de.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_el.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_en.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_es.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_et.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fi.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fr.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_he.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hr.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hu.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_id.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_it.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ja.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ko.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lt.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lv.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_nl.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_no.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pl.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-BR.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-PT.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ro.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ru.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sk.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sl.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sr.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sv.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_th.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_tr.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_uk.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_vi.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-CN.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-HK.json +1 -1
- package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-TW.json +1 -1
- package/chunks/BloomComposition.glsl.js +4 -13
- package/chunks/Theme.js +1 -1
- package/chunks/Tick.js +1 -1
- package/geometry/support/HalfFloatArray.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/float16.js +1 -1
- package/interfaces.d.ts +222 -139
- package/layers/FeatureLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +5 -0
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/widgets/Search/types.d.ts +10 -0
- package/widgets/Search/types.js +5 -0
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/TimeSlider/css.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.js +5 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +5 -0
- package/widgets/support/SelectionList/{SelectionListItemBase.js → ItemBase.js} +1 -1
- package/widgets/support/SelectionList/LayerItem.js +5 -0
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/selectionListUtils.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/0db4c0071282dd94f3b2.js +0 -1
- package/assets/esri/core/workers/chunks/10631680abe7607616ca.js +0 -1
- package/assets/esri/core/workers/chunks/277b61af8982092a4c81.js +0 -1
- package/assets/esri/core/workers/chunks/290aed587aa647226b46.js +0 -1
- package/assets/esri/core/workers/chunks/345f428dfcaa594ee617.js +0 -1
- package/assets/esri/core/workers/chunks/358a3a9326615d5e6d3b.js +0 -1
- package/assets/esri/core/workers/chunks/39fbac918ebd1b0e3a18.js +0 -1
- package/assets/esri/core/workers/chunks/544771f64a86b541d5bb.js +0 -1
- package/assets/esri/core/workers/chunks/6275114e8ed9dd31465d.js +0 -1
- package/assets/esri/core/workers/chunks/72b5e43741ce3a0da8f7.js +0 -1
- package/assets/esri/core/workers/chunks/7e63e3d759c874077b52.js +0 -1
- package/assets/esri/core/workers/chunks/7f8c7e3e41e51ab4d612.js +0 -1
- package/assets/esri/core/workers/chunks/80a5fd4fb79e90086538.js +0 -1
- package/assets/esri/core/workers/chunks/80aaf31c8eec3cff2add.js +0 -1
- package/assets/esri/core/workers/chunks/b6361cec92003997bfe5.js +0 -1
- package/assets/esri/core/workers/chunks/bbbb1aa2569ebf01ad8b.js +0 -1
- package/assets/esri/core/workers/chunks/d59aeb46bf2fb0931a9b.js +0 -1
- package/assets/esri/core/workers/chunks/ee277dd58aa69281163f.js +0 -1
- package/assets/esri/core/workers/chunks/f718d41f665d5df25f79.js +0 -1
- package/assets/esri/core/workers/chunks/fa9ef9e8eae505371965.js +0 -1
- package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +0 -1
- package/assets/esri/core/workers/chunks/fb603edd374e24f366ff.js +0 -1
- package/widgets/support/SelectionList/SelectionListFeatureItem.js +0 -5
- package/widgets/support/SelectionList/SelectionListGroupLayerItem.js +0 -5
- package/widgets/support/SelectionList/SelectionListLayerItem.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{d as e,l as t,h as f}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasIdentityRotation as o,isOrthoNormal as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as s,BufferViewVec3f16 as n,BufferViewVec3f as c,BufferViewVec4f16 as l,BufferViewVec4f as d,BufferViewFloat16 as u,BufferViewFloat as a,BufferViewVec2i16 as p,BufferViewVec2f16 as g,BufferViewVec2f as B}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as y}from"../../lib/Util.js";import{VertexAttribute as b}from"../../lib/VertexAttribute.js";function m(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function O(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function h(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function F(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function I(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function T(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function N(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function R(e,t,f,r,i=1){if(!t)return void h(e,f,r,i);const{data:s,indices:n}=e,c=f.typedBuffer,l=f.typedBufferStride,d=n.length,u=t[0],a=t[1],p=t[2],g=t[4],B=t[5],y=t[6],b=t[8],m=t[9],O=t[10],F=t[12],I=t[13],T=t[14];r*=l;let N=0,R=0,S=0;const E=o(t)?e=>{N=s[e]+F,R=s[e+1]+I,S=s[e+2]+T}:e=>{const t=s[e],f=s[e+1],r=s[e+2];N=u*t+g*f+b*r+F,R=a*t+B*f+m*r+I,S=p*t+y*f+O*r+T};if(1===i)for(let o=0;o<d;++o)E(3*n[o]),c[r]=N,c[r+1]=R,c[r+2]=S,r+=l;else for(let o=0;o<d;++o){E(3*n[o]);for(let e=0;e<i;++e)c[r]=N,c[r+1]=R,c[r+2]=S,r+=l}}function S(e,t,f,r,s=1){if(!t)return void h(e,f,r,s);const{data:n,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],B=l[2],y=l[4],b=l[5],m=l[6],O=l[8],F=l[9],I=l[10],T=!i(l),N=1e-6,R=1-N;r*=u;let S=0,E=0,A=0;const v=o(l)?e=>{S=n[e],E=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];S=p*t+y*f+O*r,E=g*t+b*f+F*r,A=B*t+m*f+I*r};if(1===s)if(T)for(let o=0;o<a;++o){v(3*c[o]);const e=S*S+E*E+A*A;if(e<R&&e>N){const t=1/Math.sqrt(e);d[r]=S*t,d[r+1]=E*t,d[r+2]=A*t}else d[r]=S,d[r+1]=E,d[r+2]=A;r+=u}else for(let o=0;o<a;++o)v(3*c[o]),d[r]=S,d[r+1]=E,d[r+2]=A,r+=u;else for(let o=0;o<a;++o){if(v(3*c[o]),T){const e=S*S+E*E+A*A;if(e<R&&e>N){const t=1/Math.sqrt(e);S*=t,E*=t,A*=t}}for(let e=0;e<s;++e)d[r]=S,d[r+1]=E,d[r+2]=A,r+=u}}function E(e,t,f,r,o=1){if(!t)return void F(e,f,r,o);const{data:s,indices:n}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=n.length,a=c[0],p=c[1],g=c[2],B=c[4],y=c[5],b=c[6],m=c[8],O=c[9],h=c[10],I=!i(c),T=1e-6,N=1-T;if(r*=d,1===o)for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],o=s[e+2],c=s[e+3];let u=a*t+B*f+m*o,F=p*t+y*f+O*o,R=g*t+b*f+h*o;if(I){const e=u*u+F*F+R*R;if(e<N&&e>T){const t=1/Math.sqrt(e);u*=t,F*=t,R*=t}}l[r]=u,l[r+1]=F,l[r+2]=R,l[r+3]=c,r+=d}else for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],c=s[e+2],u=s[e+3];let F=a*t+B*f+m*c,R=p*t+y*f+O*c,S=g*t+b*f+h*c;if(I){const e=F*F+R*R+S*S;if(e<N&&e>T){const t=1/Math.sqrt(e);F*=t,R*=t,S*=t}}for(let i=0;i<o;++i)l[r]=F,l[r+1]=R,l[r+2]=S,l[r+3]=u,r+=d}}function A(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function v(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function w(r,o,i,s){e(k,r,o);const n=Math.max(Math.sqrt(t(k)),1e-4);f(k,k,1/n),i[s++]=k[0],i[s++]=k[1],i[s++]=k[2],i[s++]=n}const k=r();function z(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function L(e,t,f,r,o,i,n){let c={numItems:0,numVerticesPerItem:0};for(const l of f.fields.keys()){const f=e.get(l),d=f?.indices;if(f&&d)l===b.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),P(l,f,r,o,i,n);else if(l===b.OLIDCOLOR&&null!=t){const f=e.get(b.POSITION)?.indices;if(f){const e=f.length;z(t,i.getField(l,s),e,n)}}}return c}function P(e,t,f,r,o,i){switch(e){case b.POSITION:{y(3===t.size);const r=o.getField(e,c);y(!!r,`No buffer view for ${e}`),R(t,f,r,i);break}case b.NORMAL:{y(3===t.size);const f=o.getField(e,c);y(!!f,`No buffer view for ${e}`),S(t,r,f,i);break}case b.NORMALCOMPRESSED:case b.PROFILERIGHT:case b.PROFILEUP:{y(2===t.size);const f=o.getField(e,p);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.UV0:{y(2===t.size);const f=o.getField(e,g)??o.getField(e,B);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.UVI:{y(2===t.size);const f=o.getField(e,p);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.COLOR:case b.SYMBOLCOLOR:{const f=o.getField(e,s);y(!!f,`No buffer view for ${e}`),y(3===t.size||4===t.size),A(t,t.size,f,i);break}case b.SIZEFEATUREATTRIBUTE:{const f=o.getField(e,a);y(!!f,`No buffer view for ${e}`),y(1===t.size),v(t,f,i);break}case b.COLORFEATUREATTRIBUTE:case b.OPACITYFEATUREATTRIBUTE:{const f=o.getField(e,u)??o.getField(e,a);y(!!f,`No buffer view for ${e}`),y(1===t.size),v(t,f,i);break}case b.TANGENT:{y(4===t.size);const r=o.getField(e,d);y(!!r,`No buffer view for ${e}`),E(t,f,r,i);break}case b.PROFILEVERTEXANDNORMAL:{y(4===t.size);const f=o.getField(e,l)??o.getField(e,d);y(!!f,`No buffer view for ${e}`),F(t,f,i);break}case b.PROFILEAUXDATA:{y(3===t.size);const f=o.getField(e,n)??o.getField(e,c);y(!!f,`No buffer view for ${e}`),h(t,f,i);break}}}export{m as writeBufferFloat,T as writeBufferMat3f,N as writeBufferMat4f,O as writeBufferVec2,h as writeBufferVec3,F as writeBufferVec4,I as writeBufferVec4Zeros,A as writeColor,v as writeColorFeatureAttribute,P as writeDefaultAttribute,L as writeDefaultAttributes,w as writeDeltaF16Vector,S as writeNormal,z as writeOlidColor,R as writePosition,E as writeTangent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import a from"../../../../../core/PooledArray.js";import{addMany as n}from"../../../../../core/SetUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as f,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as m}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{DirtyState as _}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as b}from"../../lib/RenderSlot.js";import{assert as w}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as C,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as A}from"./Instance.js";import{PerBufferData as E,hasVao as B}from"./PerBufferData.js";import{PerOriginData as M}from"./PerOriginData.js";import{defaultHighlightName as x}from"../../../../support/HighlightDefaults.js";let D=class extends p{get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new v,this._highlightNames=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this._updateProduces()}_updateProduces(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==g.Highlight&&t!==g.ShadowHighlight||this._hasHighlights))&&e(t)))}))}initializeRenderContext(e,t){q??=e.renderContext.rctx.isAssumedMetalDriver,this._glMaterials=new y(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,m(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.cachedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}get canCompact(){for(const e of this._dataByOrigin.values())if(e.buffers.some((e=>e.holes.length>1)))return!0;return!1}compact(e){if(!this.canCompact)return!1;let t=!1;for(const r of this._dataByOrigin.values()){const i=new Array;for(let t=0;t<r.buffers.length&&!e.done;){const s=r.buffers[t];s.holes.length<=1?++t:(s.instances.forEach((({geometry:e})=>i.push(e))),this._vaoCache.deleteVao(s.vao),r.buffers[t]=r.buffers[r.buffers.length-1],--r.buffers.length,e.madeProgress())}if(i.length>0){for(r.buffers.forEach((e=>this._applyAdds(e,i)));i.length>0;)r.buffers.push(this._applyAndRebuild(new E,i,null));t=!0}}return t}updateHighlights(e){this.highlightOrderMap=e,this._highlightNames.clear(),this._dataByOrigin.forEach((t=>{t.buffers.forEach((t=>{t.updateHighlights(e),t.highlightNames.forEach((e=>this._highlightNames.add(e)))}))})),this._updateProduces()}_applyUpdates(e,t){const r=this._bufferWriter;if(null==r)return void e.clearUpdates();const i=r.vertexBufferLayout.stride/4;for(const s of e.updates){if(t.done)return;const{renderGeometry:o,updateType:a}=s;e.pending.updates.removeUnordered(s),t.madeProgress();const n=this._dataByOrigin.get(o.localOrigin.id),l=n?.findBuffer(o.id);if(null==l)return;const h=l.instances.get(o.id);if(a&(_.GEOMETRY|_.TRANSFORMATION)){const e=U(r.elementCount(h.geometry.geometry.attributes)*i),t=r.vertexBufferLayout.createView(e.buffer);this._writeGeometry(o,t,0),l.vao.vertexBuffers.get("geometry").setSubData(e,h.from*i,0,h.numElements*i)}a&(_.HIGHLIGHT|_.OCCLUDEE|_.VISIBILITY)&&(l.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new R(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let o=r.get(e.id,s);null==o&&(o=new R(e.vec3),r.set(e.id,s,o)),o.changes.push(i)}return r}_applyAddsAndRemoves(e){const{_bufferWriter:r,_dataByOrigin:i,_vaoCache:s}=this;if(null==r||null==s)return void e.clearAddsAndRemoves();const o=r.vertexBufferLayout.stride/4,a=this._computeDeltas(e.adds,e.removes);a.forEach(((e,n)=>{const l=e.get(null),h=l?.changes??[];a.delete(n,null);let u=i.get(n);if(e.forEach(((e,l)=>{if(a.delete(n,l),null==l)return void w(!1,"No VAO for removed geometries");if(l.instances.size===e.changes.length)return s.deleteVao(l.vao),t(u.buffers,l),void(0===u.buffers.length&&0===h.length&&i.delete(n));const f=l.numElements,c=l.vao.getByteLength("geometry")/4,d=h.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),m=e.changes.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),g=Math.min((f+d-m)*o,W),p=g>c;g>N&&g<c/2?(e.changes.forEach((({id:e})=>l.deleteInstance(e))),l.instances.forEach((({geometry:e})=>h.push(e))),this._vaoCache.deleteVao(l.vao),t(u.buffers,l)):p?this._applyAndRebuild(l,h,e):this._applyRemoves(l,e)})),h.length>0)for(null==u&&(u=new M(l.origin),i.set(n,u)),u.buffers.forEach((e=>this._applyAdds(e,h)));h.length>0;)u.buffers.push(this._applyAndRebuild(new E,h,null))})),e.clearAddsAndRemoves()}_updateDrawCommands(){this._highlightNames.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.updateIfDrawCommandsDirty(this.highlightOrderMap,this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&n(this._highlightNames,e.highlightNames),this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(r)for(const d of r.changes)e.deleteInstance(d.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,o=s/4,a=Math.floor(W/o);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(n+s>a&&n>0){t.push(r);break}n+=s;const o=new A(r,0,0,this.highlightOrderMap);w(null==e.instances.get(r.id)),e.addInstance(r.id,o)}const l=n*o,h=U(l),u=i.vertexBufferLayout.createView(h.buffer);let f=0;e.resetInstanceSummary(),e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,u,f);const s=f;f+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,f),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(V(l)),e.vao.vertexBuffers.get("geometry").setSubData(h,0,0,f*o),e.holes.clear();const c=e.holes.pushNew();return c.from=f,c.to=Math.floor(e.vao.getByteLength("geometry")/s),e.updateDrawCommands(this.highlightOrderMap,s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;let r=1/0,i=-1/0;for(const a of t.changes){const t=a.id,s=e.instances.get(t);if(!s)continue;e.deleteInstance(t),q&&(r=Math.min(r,s.from),i=Math.max(i,s.to));const o=j.back();if(o){if(o.to===s.from){o.to=s.to;continue}if(o.from===s.to){o.from=s.from;continue}}const n=j.pushNew();n.from=s.from,n.to=s.to}O(j);const s=this._bufferWriter.vertexBufferLayout.stride/4,o=e.vao.vertexBuffers.get("geometry");if(q){const t=(i-r)*s,a=U(t),n=this._bufferWriter.vertexBufferLayout.createView(a.buffer);a.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=r&&e.to<=i))return;const t=e.from-r;this._writeGeometry(e.geometry,n,t)})),o.setSubData(a,r*s,0,t)}else{const e=j.reduce(((e,t)=>Math.max(e,t.numElements)),0)*s,t=U(e);t.fill(0,0,e),j.forAll((e=>o.setSubData(t,e.from*s,0,e.numElements*s)))}e.holes.pushArray(j.data,j.length),j.forAll(((e,t)=>j.data[t]=null)),j.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!B(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,o=e.numElements,a=t.reduce(((e,t)=>e+i.elementCount(t.geometry.attributes)),0),n=Math.min((o+a)*s,W),l=4*n;if(e.vao.getByteLength("geometry")<V(W-N)&&l>e.vao.getByteLength("geometry"))return void this._applyAndRebuild(e,t,null);O(e.holes);const h=new Array;let u=1/0,f=-1/0;for(const r of t){const t=i.elementCount(r.geometry.attributes),s=H(e.holes,t);h.push(s),q&&null!=s&&(u=Math.min(s,u),f=Math.max(s+t,f))}const c=e.vao.vertexBuffers.get("geometry");let d=0,m=0,g=0;const p=U(q?(f-u)*s:n),y=i.vertexBufferLayout.createView(p.buffer);if(t.forEach(((t,r)=>{const o=h[r];if(null==o)return;const a=i.elementCount(t.geometry.attributes);if(!q){if(!(g===o)){const e=g-m;e>0&&c.setSubData(p,m*s,0,e*s),m=o,d=0}this._writeGeometry(t,y,d),d+=a,g=o+a}const n=new A(t,o,o+a,this.highlightOrderMap);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0})),q){const t=(f-u)*s;p.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=u&&e.to<=f))return;const t=e.from-u;this._writeGeometry(e.geometry,y,t)})),m=u,g=f}const _=g-m;_>0&&c.setSubData(p,m*s,0,_*s),r(t,((e,t)=>null==h[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(S,e.transformation),S[12]-=e.localOrigin.vec3[0],S[13]-=e.localOrigin.vec3[1],S[14]-=e.localOrigin.vec3[2],f(L,S),c(L,L),this._bufferWriter.write(S,L,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(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{highlight:s,slot:o}=r,a=t===g.ShadowHighlight,n=t===g.Highlight,l=n||a,h=s?.name;if(l&&(0===this._highlightNames.size||n&&h&&!this._highlightNames.has(h)))return null;const u=e=>n&&!!h&&!e.has(h),f=t===g.ShadowExcludeHighlight,c=!(l||f);for(const{buffers:d}of this._dataByOrigin.values())for(const i of d){if(u(i.highlightNames))continue;const s=a?i.drawCommandsHighlights.get(x):l?h?i.drawCommandsHighlights.get(h):i.drawCommandsHighlights.size>0:((f&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null)?.length??!1,n=c&&i.drawCommandsOccludees||null;if(s||n?.length){const i=this._glMaterials.load(e.rctx,o,t),s=i?.beginSlot(r);if(s)return s}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlight:o}=i,n=r===g.Highlight,l=o?.name??"";if(n&&!o)return;const h=r===g.ShadowHighlight,u=n||h,f=r===g.ShadowExcludeHighlight,c=!(u||f),d=s===b.OCCLUDER_MATERIAL||s===b.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:m}=e;m.runAppleAmdDriverHelper();const p=m.bindTechnique(t,i,this.material.parameters);for(const g of this._dataByOrigin.values())for(const e of g.buffers){if(n&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;if(h&&(!e.hasHighlights||!e.drawCommandsHighlights.has(x)))continue;const r=()=>{const t=[],r=e.drawCommandsHighlights.get(x)??new a;return r&&t.push(r),t},s=u&&!h?e.drawCommandsHighlights.get(l)??null:null,o=h?r():u?s?[s]:z:f&&e.needsMultipleCommands()?[e.drawCommandsShadowHighlightRest]:[e.drawCommandsDefault],y=o.some((e=>e.length>0)),_=c&&e.drawCommandsOccludees||null;if(y||_?.length){if(this._drawParameters.origin=g.origin,p.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e.vao),m.bindVAO(e.vao),y)for(const e of o)m.setPipelineState(t.getPipeline(!1,d)),e.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count)));_?.length&&(m.setPipelineState(t.getPipeline(!0,d)),_.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count))))}}}static prune(){G=new Float32Array(N)}get test(){}};e([l({constructOnly:!0})],D.prototype,"material",void 0),e([l({})],D.prototype,"highlightOrderMap",void 0),D=e([h("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],D);class R{constructor(e){this.origin=e,this.changes=new Array}}function H(e,t){const r=e.find((e=>e.numElements>=t));if(null==r)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const S=d(),L=d(),j=new a({allocator:e=>e||new C,deallocator:null}),N=65536,I=4*N,P=1024,T=16777216,W=T/4;let G=new Float32Array(N);function U(e){return G.length<e&&(G=new Float32Array(e)),G}function V(e){const t=4*e;return t<=P?P:t<I?i(t):Math.max(Math.min(Math.ceil(1.5*t/I)*I,T),t)}const z=[];let q;export{D as MergedRenderer,V as sizeForVao};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import a from"../../../../../core/PooledArray.js";import{addMany as n}from"../../../../../core/SetUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as f,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as m}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{DirtyState as _}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as b}from"../../lib/RenderSlot.js";import{assert as w}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as C,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as A}from"./Instance.js";import{PerBufferData as E,hasVao as B}from"./PerBufferData.js";import{PerOriginData as M}from"./PerOriginData.js";import{defaultHighlightName as x}from"../../../../support/HighlightDefaults.js";let D=class extends p{get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new v,this._highlightNames=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this._updateProduces()}_updateProduces(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==g.Highlight&&t!==g.ShadowHighlight||this._hasHighlights))&&e(t)))}))}initializeRenderContext(e,t){q??=e.renderContext.rctx.isAssumedMetalDriver,this._glMaterials=new y(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,m(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.cachedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}get canCompact(){for(const e of this._dataByOrigin.values())if(e.buffers.some((e=>e.holes.length>1)))return!0;return!1}compact(e){if(!this.canCompact)return!1;let t=!1;for(const r of this._dataByOrigin.values()){const i=new Array;for(let t=0;t<r.buffers.length&&!e.done;){const s=r.buffers[t];s.holes.length<=1?++t:(s.instances.forEach((({geometry:e})=>i.push(e))),this._vaoCache.deleteVao(s.vao),r.buffers[t]=r.buffers[r.buffers.length-1],--r.buffers.length,e.madeProgress())}if(i.length>0){for(r.buffers.forEach((e=>this._applyAdds(e,i)));i.length>0;)r.buffers.push(this._applyAndRebuild(new E,i,null));t=!0}}return t}updateHighlights(e){this.highlightOrderMap=e,this._highlightNames.clear(),this._dataByOrigin.forEach((t=>{t.buffers.forEach((t=>{t.updateHighlights(e),t.highlightNames.forEach((e=>this._highlightNames.add(e)))}))})),this._updateProduces()}_applyUpdates(e,t){const r=this._bufferWriter;if(null==r)return void e.clearUpdates();const i=r.vertexBufferLayout.stride/4;for(const s of e.updates){if(t.done)return;const{renderGeometry:o,updateType:a}=s;e.pending.updates.removeUnordered(s),t.madeProgress();const n=this._dataByOrigin.get(o.localOrigin.id),l=n?.findBuffer(o.id);if(null==l)return;const h=l.instances.get(o.id);if(a&(_.GEOMETRY|_.TRANSFORMATION)){const e=U(r.elementCount(h.geometry.geometry.attributes)*i),t=r.vertexBufferLayout.createView(e.buffer);this._writeGeometry(o,t,0),l.vao.vertexBuffers.get("geometry").setSubData(e,h.from*i,0,h.numElements*i)}a&(_.HIGHLIGHT|_.OCCLUDEE|_.VISIBILITY)&&(l.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new R(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let o=r.get(e.id,s);null==o&&(o=new R(e.vec3),r.set(e.id,s,o)),o.changes.push(i)}return r}_applyAddsAndRemoves(e){const{_bufferWriter:r,_dataByOrigin:i,_vaoCache:s}=this;if(null==r||null==s)return void e.clearAddsAndRemoves();const o=r.vertexBufferLayout.stride/4,a=this._computeDeltas(e.adds,e.removes);a.forEach(((e,n)=>{const l=e.get(null),h=l?.changes??[];a.delete(n,null);let u=i.get(n);if(e.forEach(((e,l)=>{if(a.delete(n,l),null==l&&w(!1,"No VAO for removed geometries"),l.instances.size===e.changes.length)return s.deleteVao(l.vao),t(u.buffers,l),void(0===u.buffers.length&&0===h.length&&i.delete(n));const f=l.numElements,c=l.vao.getByteLength("geometry")/4,d=h.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),m=e.changes.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),g=Math.min((f+d-m)*o,W),p=g>c;g>N&&g<c/2?(e.changes.forEach((({id:e})=>l.deleteInstance(e))),l.instances.forEach((({geometry:e})=>h.push(e))),this._vaoCache.deleteVao(l.vao),t(u.buffers,l)):p?this._applyAndRebuild(l,h,e):this._applyRemoves(l,e)})),h.length>0)for(null==u&&(u=new M(l.origin),i.set(n,u)),u.buffers.forEach((e=>this._applyAdds(e,h)));h.length>0;)u.buffers.push(this._applyAndRebuild(new E,h,null))})),e.clearAddsAndRemoves()}_updateDrawCommands(){this._highlightNames.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.updateIfDrawCommandsDirty(this.highlightOrderMap,this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&n(this._highlightNames,e.highlightNames),this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(r)for(const d of r.changes)e.deleteInstance(d.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,o=s/4,a=Math.floor(W/o);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(n+s>a&&n>0){t.push(r);break}n+=s;const o=new A(r,0,0,this.highlightOrderMap);w(null==e.instances.get(r.id)),e.addInstance(r.id,o)}const l=n*o,h=U(l),u=i.vertexBufferLayout.createView(h.buffer);let f=0;e.resetInstanceSummary(),e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,u,f);const s=f;f+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,f),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(V(l)),e.vao.vertexBuffers.get("geometry").setSubData(h,0,0,f*o),e.holes.clear();const c=e.holes.pushNew();return c.from=f,c.to=Math.floor(e.vao.getByteLength("geometry")/s),e.updateDrawCommands(this.highlightOrderMap,s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;let r=1/0,i=-1/0;for(const a of t.changes){const t=a.id,s=e.instances.get(t);if(!s)continue;e.deleteInstance(t),q&&(r=Math.min(r,s.from),i=Math.max(i,s.to));const o=j.back();if(o){if(o.to===s.from){o.to=s.to;continue}if(o.from===s.to){o.from=s.from;continue}}const n=j.pushNew();n.from=s.from,n.to=s.to}O(j);const s=this._bufferWriter.vertexBufferLayout.stride/4,o=e.vao.vertexBuffers.get("geometry");if(q){const t=(i-r)*s,a=U(t),n=this._bufferWriter.vertexBufferLayout.createView(a.buffer);a.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=r&&e.to<=i))return;const t=e.from-r;this._writeGeometry(e.geometry,n,t)})),o.setSubData(a,r*s,0,t)}else{const e=j.reduce(((e,t)=>Math.max(e,t.numElements)),0)*s,t=U(e);t.fill(0,0,e),j.forAll((e=>o.setSubData(t,e.from*s,0,e.numElements*s)))}e.holes.pushArray(j.data,j.length),j.forAll(((e,t)=>j.data[t]=null)),j.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!B(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,o=e.numElements,a=t.reduce(((e,t)=>e+i.elementCount(t.geometry.attributes)),0),n=Math.min((o+a)*s,W),l=4*n;if(e.vao.getByteLength("geometry")<V(W-N)&&l>e.vao.getByteLength("geometry"))return void this._applyAndRebuild(e,t,null);O(e.holes);const h=new Array;let u=1/0,f=-1/0;for(const r of t){const t=i.elementCount(r.geometry.attributes),s=H(e.holes,t);h.push(s),q&&null!=s&&(u=Math.min(s,u),f=Math.max(s+t,f))}const c=e.vao.vertexBuffers.get("geometry");let d=0,m=0,g=0;const p=U(q?(f-u)*s:n),y=i.vertexBufferLayout.createView(p.buffer);if(t.forEach(((t,r)=>{const o=h[r];if(null==o)return;const a=i.elementCount(t.geometry.attributes);if(!q){if(!(g===o)){const e=g-m;e>0&&c.setSubData(p,m*s,0,e*s),m=o,d=0}this._writeGeometry(t,y,d),d+=a,g=o+a}const n=new A(t,o,o+a,this.highlightOrderMap);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0})),q){const t=(f-u)*s;p.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=u&&e.to<=f))return;const t=e.from-u;this._writeGeometry(e.geometry,y,t)})),m=u,g=f}const _=g-m;_>0&&c.setSubData(p,m*s,0,_*s),r(t,((e,t)=>null==h[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(S,e.transformation),S[12]-=e.localOrigin.vec3[0],S[13]-=e.localOrigin.vec3[1],S[14]-=e.localOrigin.vec3[2],f(L,S),c(L,L),this._bufferWriter.write(S,L,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(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{highlight:s,slot:o}=r,a=t===g.ShadowHighlight,n=t===g.Highlight,l=n||a,h=s?.name;if(l&&(0===this._highlightNames.size||n&&h&&!this._highlightNames.has(h)))return null;const u=e=>n&&!!h&&!e.has(h),f=t===g.ShadowExcludeHighlight,c=!(l||f);for(const{buffers:d}of this._dataByOrigin.values())for(const i of d){if(u(i.highlightNames))continue;const s=a?i.drawCommandsHighlights.get(x):l?h?i.drawCommandsHighlights.get(h):i.drawCommandsHighlights.size>0:((f&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null)?.length??!1,n=c&&i.drawCommandsOccludees||null;if(s||n?.length){const i=this._glMaterials.load(e.rctx,o,t),s=i?.beginSlot(r);if(s)return s}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlight:o}=i,n=r===g.Highlight,l=o?.name??"";if(n&&!o)return;const h=r===g.ShadowHighlight,u=n||h,f=r===g.ShadowExcludeHighlight,c=!(u||f),d=s===b.OCCLUDER_MATERIAL||s===b.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:m}=e;m.runAppleAmdDriverHelper();const p=m.bindTechnique(t,i,this.material.parameters);for(const g of this._dataByOrigin.values())for(const e of g.buffers){if(n&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;if(h&&(!e.hasHighlights||!e.drawCommandsHighlights.has(x)))continue;const r=()=>{const t=[],r=e.drawCommandsHighlights.get(x)??new a;return r&&t.push(r),t},s=u&&!h?e.drawCommandsHighlights.get(l)??null:null,o=h?r():u?s?[s]:z:f&&e.needsMultipleCommands()?[e.drawCommandsShadowHighlightRest]:[e.drawCommandsDefault],y=o.some((e=>e.length>0)),_=c&&e.drawCommandsOccludees||null;if(y||_?.length){if(this._drawParameters.origin=g.origin,p.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e.vao),m.bindVAO(e.vao),y)for(const e of o)m.setPipelineState(t.getPipeline(!1,d)),e.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count)));_?.length&&(m.setPipelineState(t.getPipeline(!0,d)),_.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count))))}}}static prune(){G=new Float32Array(N)}get test(){}};e([l({constructOnly:!0})],D.prototype,"material",void 0),e([l({})],D.prototype,"highlightOrderMap",void 0),D=e([h("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],D);class R{constructor(e){this.origin=e,this.changes=new Array}}function H(e,t){const r=e.find((e=>e.numElements>=t));if(null==r)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const S=d(),L=d(),j=new a({allocator:e=>e||new C,deallocator:null}),N=65536,I=4*N,P=1024,T=16777216,W=T/4;let G=new Float32Array(N);function U(e){return G.length<e&&(G=new Float32Array(e)),G}function V(e){const t=4*e;return t<=P?P:t<I?i(t):Math.max(Math.min(Math.ceil(1.5*t/I)*I,T),t)}const z=[];let q;export{D as MergedRenderer,V as sizeForVao};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{commonRasterFieldNames as a,addMultidimensionalFieldValues as o,rasterFieldPrefix as n}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as l}from"../../layers/support/timeSupport.js";import{isFunctionRaster as u}from"../../layers/support/rasterDatasets/datasetUtils.js";import{getDefaultDatumTransformationForDataset as p,projectDatasetExtent as c,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as y}from"./support/popupUtils.js";const f=f=>{let d=class extends f{constructor(){super(...arguments),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return l(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?p(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(e){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,e)}catch{return!1}}async fetchPopupFeaturesAtLocation(e,s){const{layer:i}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:l}=i,p=y(i,s);if(!l||null==p)return[];const c=[],{value:m,magdirValue:f,processedValue:d}=await i.identify(e,{timeExtent:this.timeExtent,signal:s?.signal});let h="";if(m?.length){h="imagery-tile"===i.type&&i.hasStandardTime()&&null!=m[0]?m.map((e=>i.getStandardTimeValue(e))).join(", "):m.join(", ");const e={ObjectId:0};e[a.servicePixelValue]="imagery-tile"===i.type&&u(i.raster)?d?.join(", "):h,e[a.rawServicePixelValue]=h;const r=i.raster?.rasterInfo??i.serviceRasterInfo,s=r?.attributeTable;if(null!=s){const{fields:t,features:r}=s,i=t.find((({name:e})=>"value"===e.toLowerCase())),o=e[a.servicePixelValue],l=i?r.find((e=>String(e.attributes[i.name])===o)):null;if(l)for(const s in l.attributes)if(l.attributes.hasOwnProperty(s)){e[n+s]=l.attributes[s]}}const l=r?.dataType;"vector-magdir"!==l&&"vector-uv"!==l||(e[a.magnitude]=f?.[0],e[a.direction]=f?.[1]);const{multidimensionalDefinition:p}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});o(i.rasterFields,e,p);const y=new t({geometry:this.fullExtent?.clone(),attributes:e,layer:i,sourceLayer:i});c.push(y)}return c}async getSourceScale(){return await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([s()],d.prototype,"fullExtent",null),e([s()],d.prototype,"layer",void 0),e([s({readOnly:!0})],d.prototype,"timeExtent",null),e([s()],d.prototype,"tileInfo",void 0),e([s({readOnly:!0})],d.prototype,"hasTilingEffects",null),e([s()],d.prototype,"datumTransformation",null),d=e([i("esri.views.layers.ImageryTileLayerView")],d),d};export{f as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "../../interfaces";
|
|
2
|
+
|
|
3
|
+
export type SearchResult = __esri.SearchTypes.SearchResult;
|
|
4
|
+
export type SuggestResult = __esri.SearchTypes.SuggestResult;
|
|
5
|
+
export type BaseSearchResults = __esri.SearchTypes.BaseSearchResults;
|
|
6
|
+
export type SearchResults = __esri.SearchTypes.SearchResults;
|
|
7
|
+
export type SuggestResults = __esri.SearchTypes.SuggestResults;
|
|
8
|
+
export type BaseSearchResponse = __esri.SearchTypes.BaseSearchResponse;
|
|
9
|
+
export type SuggestResponse = __esri.SearchTypes.SuggestResponse;
|
|
10
|
+
export type SearchResponse = __esri.SearchTypes.SearchResponse;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import i from"../../core/Evented.js";import n from"../../core/Logger.js";import{after as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import i from"../../core/Evented.js";import n from"../../core/Logger.js";import{after as s,isAbortError as r}from"../../core/promiseUtils.js";import{watch as o,whenOnce as l,initial as a,syncAndInitial as m}from"../../core/reactiveUtils.js";import{offsetDate as u}from"../../core/timeUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{ensureType as d}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import c from"../../time/TimeExtent.js";import f from"../../time/TimeInterval.js";import w from"../../webdoc/Widgets.js";import g from"../../webdoc/widgets/TimeSlider.js";const v=1e4;function T(t){return null!=t&&void 0!==t.count}function x(t){return null!=t&&void 0!==t.interval}function E(t){return null!=t&&void 0!==t.dates}let _=class extends i.EventedAccessor{constructor(t){super(t),this._animationController=null,this._isViewTimeExtentInitialized=!1,this._timerId=null,this.actions=new e,this.fullTimeExtent=null,this.loop=!1,this.mode="time-window",this.stops={count:10},this.timeExtent=null,this.view=null}initialize(){this.addHandles([o((()=>this.effectiveStops),(()=>{this.timeExtent??=this._getDefaultTimeExtent()}),a),o((()=>this.view),((t,e)=>{this._unregisterWidget(e),this._registerWidget(t)}),m),o((()=>this.timeExtent),(t=>{if(!this.view)return;const e=this.view.timeExtent;(t&&!t.isAllTime||e&&!e.isAllTime)&&(t&&e&&t.equals(e)||(this.view.timeExtent=t))}),a),o((()=>this.view?.timeExtent),(t=>{this._isViewTimeExtentInitialized?(t&&!t.isAllTime||this.timeExtent&&!this.timeExtent.isAllTime)&&(t&&this.timeExtent&&t.equals(this.timeExtent)||(this.timeExtent=t)):this._isViewTimeExtentInitialized=!0}))])}destroy(){null!=this._timerId&&(clearInterval(this._timerId),this._timerId=null),this._unregisterWidget(this.view),this.view=null,this._animationController&&(this._animationController.abort(),this._animationController=null)}get effectiveStops(){const{fullTimeExtent:t,stops:e}=this;if(E(e)){const{dates:i}=e;if(!i?.length)return null;const n=i.sort(((t,e)=>t.getTime()-e.getTime()));if(!t)return n;const{start:s,end:r}=t;if(!s||!r)return n;return n.filter((t=>!(t.getTime()<s.getTime()||t.getTime()>r.getTime())))}if(T(e)){const i=e.timeExtent??t;return this._divideTimeExtentByCount(i,e.count)}if(x(e)){const i=e.timeExtent??t;return this._divideTimeExtentByInterval(i,e.interval)}return[]}set playRate(t){t<=0||t>36e5||("playing"===this.state&&this._startAnimation(),this._set("playRate",t))}get state(){return this.fullTimeExtent?this._animationController?"playing":"ready":"disabled"}get timeExtentValues(){const{mode:t,timeExtent:e}=this;if(!e||e.isAllTime||e.isEmpty)return null;const{start:i,end:n}=e;switch(t){case"cumulative-from-end":case"instant":return i?[i.getTime()]:null;case"cumulative-from-start":return n?[n.getTime()]:null;case"time-window":return i&&n?[i.getTime(),n.getTime()]:null}}next(){this._step({forward:!0,allowRestart:!1})}play(){this._startAnimation()}previous(){this._step({forward:!1,allowRestart:!1})}stop(){this._stopAnimation()}triggerAction(t){this.emit("trigger-action",{action:t})}updateWebDocument(t){const e=new g({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:T(this.stops)?this.stops.count:null,numThumbs:"time-window"===this.mode?2:1,stopDelay:this.playRate,stopInterval:x(this.stops)?this.stops.interval:null,stops:E(this.stops)?this.stops.dates:null});t.widgets?t.widgets.timeSlider=e:t.widgets=new w({timeSlider:e})}valuesToTimeExtent(t){if(!t)return null;const e=t.sort(((t,e)=>t-e)).map((t=>new Date(t))),i=e.length>0?e[0]:null,n=e.length>1?e[1]:null;switch(this.mode){case"time-window":return new c({start:i,end:n});case"instant":return new c({start:i,end:i});case"cumulative-from-start":return new c({start:null,end:i});case"cumulative-from-end":return new c({start:i,end:null});default:return c.allTime}}async _animate(){try{const t=this.view,e=this._animationController?.signal;await Promise.all([s(this.playRate,null,e),t&&l((()=>!t.updating),e)])}catch(t){return r(t)||n.getLogger(this).error(t),void(this._animationController=null)}this._step({forward:!0,allowRestart:!1}),this._animationController&&this._animate()}_divideTimeExtentByCount(t,e=10){if(!t||!e)return[];const{start:i,end:n}=t;if(!i||!n)return[];if(e>v)return this._divideTimeExtentByCount(t);const s=[],r=i.getTime(),o=n.getTime()-r;for(let l=0;l<=e;l++)s.push(new Date(r+l/e*o));return s}_divideTimeExtentByInterval(t,e,i=v){if(!t||!e)return[];const{start:n,end:s}=t;if(!n||!s)return[];const r=s.getTime()-n.getTime(),o=e.toMilliseconds();if(o<=0||r/o>i)return this._divideTimeExtentByCount(t);const l=[],{value:a,unit:m}=e;let p=n;for(;p.getTime()<=s.getTime();)l.push(new Date(p.getTime())),p=u(p,a,m);return l}_getDefaultTimeExtent(){const{effectiveStops:t,mode:e}=this;if(!t||!e)return null;switch(e){case"time-window":return t.length>1?new c({start:t[0],end:t[1]}):null;case"cumulative-from-start":return t.length>0?new c({start:null,end:t[0]}):null;case"cumulative-from-end":return t.length>0?new c({start:t[0],end:null}):null;case"instant":return t.length>0?new c({start:t[0],end:t[0]}):null;default:return null}}_registerWidget(t){if(t){t.persistableViewModels.includes(this)||t.persistableViewModels.add(this)}}_startAnimation(){this._stopAnimation(),this._animationController=new AbortController,this._step({forward:!0,allowRestart:!0}),this._animate()}_step(t){const{forward:e,allowRestart:i}=t,{effectiveStops:n}=this;if(!this.timeExtentValues||!n)return;const s=n.map((t=>t.getTime())),r=this.timeExtentValues.map((t=>{const e=s.indexOf(t);if(-1!==e)return e;const i=s.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e));return s.indexOf(i)})),o=r.map((t=>t+(e?1:-1))),l=o.some((t=>t<0||t>s.length-1)),{loop:a,state:m}=this;if(l)if(a||i){const t=Math.min(...r),i=Math.max(...r),n=(e?r.map((e=>e-t)):r.map((t=>t+(s.length-1-i)))).map((t=>s[t]));this.timeExtent=this.valuesToTimeExtent(n)}else"playing"===m&&this.stop();else{const t=o.map((t=>s[t]));this.timeExtent=this.valuesToTimeExtent(t)}}_stopAnimation(){null!=this._animationController&&(this._animationController.abort(),this._animationController=null)}_unregisterWidget(t){null!=t&&t.persistableViewModels.remove(this)}};t([p()],_.prototype,"_animationController",void 0),t([p({type:e})],_.prototype,"actions",void 0),t([p({readOnly:!0})],_.prototype,"effectiveStops",null),t([p({type:c})],_.prototype,"fullTimeExtent",void 0),t([p({nonNullable:!0})],_.prototype,"loop",void 0),t([p({nonNullable:!0})],_.prototype,"mode",void 0),t([p({nonNullable:!0,value:1e3})],_.prototype,"playRate",null),t([p({readOnly:!0})],_.prototype,"state",null),t([p({cast:t=>t?(x(t)&&(t.interval=d(f,t.interval)),(x(t)||T(t))&&(t.timeExtent=d(c,t.timeExtent)),t):null})],_.prototype,"stops",void 0),t([p({type:c})],_.prototype,"timeExtent",void 0),t([p({readOnly:!0})],_.prototype,"timeExtentValues",null),t([p()],_.prototype,"view",void 0),t([p()],_.prototype,"next",null),t([p()],_.prototype,"play",null),t([p()],_.prototype,"previous",null),t([p()],_.prototype,"stop",null),t([p()],_.prototype,"updateWebDocument",null),_=t([h("esri.widgets.TimeSlider.TimeSliderViewModel")],_);const y=_;export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t="esri-time-slider",e={timeSlider:`${t}`,
|
|
5
|
+
const t="esri-time-slider",e={timeSlider:`${t}`,actions:`${t}__actions`,hasActions:`${t}--has-actions`,max:`${t}__max`,maxDate:`${t}__max-date`,maxTime:`${t}__max-time`,min:`${t}__min`,minDate:`${t}__min-date`,minTime:`${t}__min-time`,next:`${t}__next`,play:`${t}__play`,playbackControls:`${t}__playback-controls`,previous:`${t}__previous`,slider:`${t}__slider`,sliderMajorTick:"majorTick",sliderMinorTick:"minorTick",timeExtent:`${t}__time-extent`,timeExtentEndDate:`${t}__time-extent-end-date`,timeExtentEndGroup:`${t}__time-extent-end-group`,timeExtentEndTime:`${t}__time-extent-end-time`,timeExtentSeparator:`${t}__time-extent-separator`,timeExtentStartDate:`${t}__time-extent-start-date`,timeExtentStartGroup:`${t}__time-extent-start-group`,timeExtentStartTime:`${t}__time-extent-start-time`,timeSliderDisabled:`${t}--disabled`,timeSliderLayout:`${t}__layout--`,timeSliderMode:`${t}__mode--`,timeSliderOutOfBounds:`${t}--out-of-bounds`,timeSliderRow:`${t}__row`,warning:`${t}__warning`,warningIcon:`${t}__warning-icon`,warningLabel:`${t}__warning-label`};export{e as css};
|
package/widgets/TimeSlider.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{equals as e}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{watch as s,initial as o}from"../core/reactiveUtils.js";import{truncateDate as a,offsetDate as n}from"../core/timeUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as m,convertDateFormatToIntlOptions as u}from"../intl/date.js";import{unknown as d,system as c}from"../time/constants.js";import p from"../time/TimeInterval.js";import h from"./Slider.js";import v from"./Widget.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{globalCss as y}from"./support/globalCss.js";import{legacyIcon as g}from"./support/legacyIcon.js";import{accessibleHandler as b}from"./support/decorators/accessibleHandler.js";import{messageBundle as x}from"./support/decorators/messageBundle.js";import{vmEvent as w}from"./support/decorators/vmEvent.js";import{tsx as k}from"./support/jsxFactory.js";import{onResize as j}from"./support/widgetUtils.js";import{getCalciteThemeClass as _}from"../support/themeUtils.js";import{css as T}from"./TimeSlider/css.js";import E from"./TimeSlider/TimeSliderViewModel.js";const M=3,S=858,F=[{minor:{value:100,unit:"milliseconds"},major:{value:1,unit:"seconds"},format:{second:"numeric"}},{minor:{value:500,unit:"milliseconds"},major:{value:5,unit:"seconds"},format:{second:"numeric"}},{minor:{value:1,unit:"seconds"},major:{value:20,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:2,unit:"seconds"},major:{value:30,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:10,unit:"seconds"},major:{value:1,unit:"minutes"},format:{minute:"numeric"}},{minor:{value:15,unit:"seconds"},major:{value:5,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"minutes"},major:{value:20,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:5,unit:"minutes"},major:{value:2,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:15,unit:"minutes"},major:{value:6,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"hours"},major:{value:1,unit:"days"},format:{day:"numeric",month:"short"}},{minor:{value:6,unit:"hours"},major:{value:1,unit:"weeks"},format:{day:"numeric",month:"short"}},{minor:{value:1,unit:"days"},major:{value:1,unit:"months"},format:{month:"long"}},{minor:{value:2,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:3,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:4,unit:"days"},major:{value:3,unit:"months"},format:{month:"short",year:"numeric"}},{minor:{value:1,unit:"weeks"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"months"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:2,unit:"months"},major:{value:2,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"years"},major:{value:1,unit:"decades"},format:{year:"numeric"}},{minor:{value:2,unit:"years"},major:{value:5,unit:"decades"},format:{year:"numeric"}},{minor:{value:5,unit:"decades"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1,unit:"centuries"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:2,unit:"centuries"},major:{value:20,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:5,unit:"centuries"},major:{value:50,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:10,unit:"centuries"},major:{value:100,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:20,unit:"centuries"},major:{value:200,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:50,unit:"centuries"},major:{value:500,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:100,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:200,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:500,unit:"centuries"},major:{value:5e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1e3,unit:"centuries"},major:{value:1e4,unit:"centuries"},format:{era:"short",year:"numeric"}}];let C=class extends v{constructor(t,e){super(t,e),this._ignoreNextSliderUpdate=!1,this._slider=new h({precision:0,visibleElements:{rangeLabels:!1},rangeLabelInputsEnabled:!1,thumbsConstrained:!1}),this._tickFormat=null,this.disabled=!1,this.labelFormatFunction=null,this.messages=null,this.messagesCommon=null,this.tickConfigs=null,this.timeVisible=!1,this.viewModel=new E}initialize(){this.addHandles([s((()=>this._slider.values),(t=>{if(this._ignoreNextSliderUpdate)return void(this._ignoreNextSliderUpdate=!1);const e=this.viewModel.valuesToTimeExtent(t);null!=this.timeExtent?null!=e?this.timeExtent.equals(e)||(this.timeExtent=e):this.timeExtent=null:null!=e&&(this.timeExtent=e)})),s((()=>this.effectiveStops),(()=>this._updateSliderSteps()),o)])}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu")})}destroy(){this._slider.destroy(),this._tickFormat=null}get _dateFormat(){return this._getIntlOptions("short-date")}get _timeFormat(){return this._getIntlOptions("long-time")}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get effectiveStops(){return this.viewModel.effectiveStops}get fullTimeExtent(){return this.viewModel.fullTimeExtent}set fullTimeExtent(t){this.viewModel.fullTimeExtent=t}get icon(){return"clock"}set icon(t){this._overrideIfSome("icon",t)}get interactive(){return!(this.disabled||"disabled"===this.viewModel.state||this.timeZone===d)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){["auto","compact","wide"].includes(t)||(t="auto"),this._set("layout",t)}get loop(){return this.viewModel.loop}set loop(t){this.viewModel.loop=t}get mode(){return this.viewModel.mode}set mode(t){this.viewModel.mode=t}get playRate(){return this.viewModel.playRate}set playRate(t){this.viewModel.playRate=t}get stops(){return this.viewModel.stops}set stops(t){this.viewModel.stops=t}get tickFormats(){const{timeZone:t}=this;return F.map((({minor:e,major:i,format:s})=>({minor:new p(e),major:new p(i),format:{...s,timeZone:t}})))}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(t){this.viewModel.timeExtent=t}get timeZone(){return this.viewModel.view?.timeZone??c}set timeZone(t){this._overrideIfSome("timeZone",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}next(){return this.viewModel.next()}play(){return this.viewModel.play()}previous(){return this.viewModel.previous()}stop(){return this.viewModel.stop()}render(){const{_slider:t,actions:i,domNode:s,effectiveStops:o,fullTimeExtent:a,interactive:n,messages:r,messagesCommon:l,mode:u,tickConfigs:d,timeExtent:c,timeVisible:p,viewModel:{state:h,timeExtentValues:v}}=this;if(null!=a){const{start:e,end:i}=a;if(null!=e&&null!=i){const s=e.getTime(),o=i.getTime(),a=t.min!==s||t.max!==o;if(a&&(t.min=s,t.max=o),null!=d)t.tickConfigs!==d&&(t.tickConfigs=d);else{const e=(o-s)/(t.trackElement?.offsetWidth||400),i=this.tickFormats.find((t=>t.minor.toMilliseconds()>M*e))??this.tickFormats.at(-1),n=this._tickFormat!==i&&null!=i;if(n&&(this._tickFormat=i),a||n){const e={mode:"position",values:this._getTickPositions(i.minor),labelsVisible:!1,tickCreatedFunction:(t,e)=>{e?.classList.add(T.sliderMinorTick)}},s={mode:"position",values:this._getTickPositions(i.major),labelsVisible:!0,tickCreatedFunction:(t,e)=>{e?.classList.add(T.sliderMajorTick)},labelFormatFunction:t=>m(t,i.format)};t.tickConfigs=[e,s]}}}}const f=null==this.fullTimeExtent?.start||null==this.fullTimeExtent.end||null==this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||null!=this.timeExtent.start&&(this.timeExtent.start<this.fullTimeExtent.start||this.timeExtent.start>this.fullTimeExtent.end)||null!=this.timeExtent.end&&(this.timeExtent.end>this.fullTimeExtent.end||this.timeExtent.end<this.fullTimeExtent.start);if(f)switch(this._ignoreNextSliderUpdate=!0,u){case"time-window":t.values=[t.min,t.max];break;case"instant":case"cumulative-from-end":t.values=[t.min];break;case"cumulative-from-start":t.values=[t.max]}else null!=v?e(t.values,v)||(t.values=v):t.values=null;t.disabled=!n;const b="ready"===h,x="playing"===h,w=f||!n||null==o||0===o.length,E="auto"===this.layout?s.clientWidth<S?"compact":"wide":this.layout,F=k("div",{class:T.animation},k("button",{"aria-disabled":w?"true":"false","aria-label":x?l.control.stop:l.control.play,bind:this,class:this.classes(y.widgetButton,T.animationButton,w&&y.buttonDisabled),disabled:w,onclick:this._playOrStopClick,title:x?l.control.stop:l.control.play,type:"button"},k("div",{class:this.classes((b||w)&&g.play,x&&g.pause)}))),C=null!=this.labelFormatFunction?k("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:T.timeExtentDate,"data-date":c?[c.start,c.end]:null,"data-layout":E,"data-type":"extent",key:"extent"}):null==c||null!=c&&c.isAllTime?[k("div",{class:this.classes(T.warning,g.noticeTriangle)}),k("div",{class:T.warningText,key:"warning-text"},r.noTimeExtent)]:c.isEmpty?[k("div",{class:this.classes(T.warning,g.noticeTriangle)}),k("div",{class:T.warningText,key:"warning-text"},r.emptyTimeExtent)]:[null!=c.start&&k("div",{class:T.timeExtentGroup,key:"start-date-group"},k("div",{class:T.timeExtentDate,key:"start-date"},this._formatDate(c.start)),p?k("div",{class:T.timeExtentTime,key:"start-time"},this._formatTime(c.start)):null),null!=c.start&&null!=c.end&&c.start.getTime()!==c.end.getTime()&&k("div",{class:T.timeExtentSeparator,key:"separator"},"–"),null!=c.end&&(null==c.start||c.start.getTime()!==c.end.getTime())&&k("div",{class:T.timeExtentGroup,key:"end-date-group"},k("div",{class:T.timeExtentDate,key:"end-date"},this._formatDate(c.end)),p?k("div",{class:T.timeExtentTime,key:"end-time"},this._formatTime(c.end)):null)],D=k("div",{class:this.classes(T.timeExtent,!n&&y.buttonDisabled)},[C]),L=null!=this.labelFormatFunction?k("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:T.minDate,"data-date":a?.start,"data-layout":E,"data-type":"min",key:"min-date"}):null!=a?.start&&[k("div",{class:T.minDate,key:"min-date"},this._formatDate(a.start)),p&&k("div",{class:T.minTime,key:"min-time"},this._formatTime(a.start))],U=k("div",{class:this.classes(T.min,!n&&y.buttonDisabled)},[L]),Z=k("div",{class:T.slider},t.render()),R=null!=this.labelFormatFunction?k("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:T.maxDate,"data-date":a?.end,"data-layout":E,"data-type":"max",key:"max-date"}):null!=a?.end&&[k("div",{class:T.maxDate,key:"max-date"},this._formatDate(a.end)),p&&k("div",{class:T.maxTime,key:"max-time"},this._formatTime(a.end))],B=k("div",{class:this.classes(T.max,!n&&y.buttonDisabled)},[R]),I=k("div",{class:T.previous},k("button",{"aria-disabled":w?"true":"false","aria-label":l.pagination.previous,bind:this,class:this.classes(y.widgetButton,T.previousButton,(x||w)&&y.buttonDisabled),disabled:w,onclick:this._previousClick,title:l.pagination.previous,type:"button"},k("div",{class:g.reverse}))),O=k("div",{class:T.next},k("button",{"aria-disabled":w?"true":"false","aria-label":l.pagination.next,bind:this,class:this.classes(y.widgetButton,T.nextButton,(x||w)&&y.buttonDisabled),disabled:w,onclick:this._nextClick,title:l.pagination.next,type:"button"},k("div",{class:g.forward}))),A=i?.length>0,V=A&&k("div",{class:T.actions,title:l.options},k("calcite-action-menu",{class:T.actionsButton,label:l.options},i.toArray().map((t=>k("calcite-action",{bind:this,icon:t.icon,id:t.id,onclick:()=>this.viewModel.triggerAction(t),text:t.title,textEnabled:!0,title:t.title})))));return k("div",{afterCreate:t=>{this.addHandles(j(t,(()=>this.scheduleRender())))},"aria-label":r.widgetLabel,class:this.classes(T.timeSlider,y.widget,`${T.timeSliderMode}${u}`,`${T.timeSliderLayout}${E}`,!n&&y.disabled,f&&T.timeSliderOutOfBounds,A&&T.hasActions,_())},"wide"===E&&k("div",{class:T.timeSliderRow},k("div",{class:T.playbackControls},[F,D,U,Z,B,I,O]),V),"compact"===E&&[k("div",{class:T.timeSliderRow,key:"time-slider-row-1"},[D,V]),k("div",{class:T.timeSliderRow,key:"time-slider-row-2"},[Z]),k("div",{class:T.timeSliderRow,key:"time-slider-row-3"},[U,I,F,O,B])])}updateWebDocument(t){this.viewModel?.updateWebDocument(t)}_createLabel(t){if(null==this.labelFormatFunction)return;const e=t.getAttribute("data-type"),i=t.getAttribute("data-layout"),s=t["data-date"];this.labelFormatFunction(s,e,t,i)}_formatDate(t){return m(t,this._dateFormat)}_formatTime(t){return m(t,this._timeFormat)}_getIntlOptions(t){const{timeZone:e}=this;return{...u(t),timeZone:e}}_getTickPositions(t){const{fullTimeExtent:e}=this;if(null==e?.start||null==e.end)return[];const{start:i,end:s}=e,o=[],{value:r,unit:l}=t;let m=a(i,l,this.timeZone);for(;m.getTime()<=s.getTime();)m.getTime()>=i.getTime()&&o.push(m.getTime()),m=n(m,r,l,this.timeZone);return o}_updateSliderSteps(){this._slider.steps=null!=this.effectiveStops&&this.effectiveStops.length>0?this.effectiveStops.map((t=>t.getTime())):null}_playOrStopClick(){switch(this.viewModel.state){case"ready":this.viewModel.play();break;case"playing":this.viewModel.stop();break;case"disabled":break;default:i(this.viewModel.state)}}_previousClick(){this.viewModel.previous()}_nextClick(){this.viewModel.next()}};t([r()],C.prototype,"_dateFormat",null),t([r()],C.prototype,"_timeFormat",null),t([r()],C.prototype,"actions",null),t([r()],C.prototype,"disabled",void 0),t([r()],C.prototype,"effectiveStops",null),t([r()],C.prototype,"fullTimeExtent",null),t([r()],C.prototype,"icon",null),t([r({readOnly:!0})],C.prototype,"interactive",null),t([r()],C.prototype,"label",null),t([r()],C.prototype,"labelFormatFunction",void 0),t([r({value:"auto"})],C.prototype,"layout",null),t([r()],C.prototype,"loop",null),t([r(),x("esri/widgets/TimeSlider/t9n/TimeSlider")],C.prototype,"messages",void 0),t([r(),x("esri/t9n/common")],C.prototype,"messagesCommon",void 0),t([r()],C.prototype,"mode",null),t([r()],C.prototype,"playRate",null),t([r()],C.prototype,"stops",null),t([r()],C.prototype,"tickConfigs",void 0),t([r()],C.prototype,"tickFormats",null),t([r()],C.prototype,"timeExtent",null),t([r({nonNullable:!0})],C.prototype,"timeVisible",void 0),t([r()],C.prototype,"timeZone",null),t([r()],C.prototype,"view",null),t([r({type:E}),w("trigger-action")],C.prototype,"viewModel",void 0),t([b()],C.prototype,"_playOrStopClick",null),t([b()],C.prototype,"_previousClick",null),t([b()],C.prototype,"_nextClick",null),C=t([l("esri.widgets.TimeSlider")],C);const D=C;export{D as default};
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{equals as e}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{watch as a,initial as s}from"../core/reactiveUtils.js";import{truncateDate as n,offsetDate as r}from"../core/timeUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as m,convertDateFormatToIntlOptions as u}from"../intl/date.js";import{unknown as c,system as d}from"../time/constants.js";import p from"../time/TimeInterval.js";import h from"./Slider.js";import v from"./Widget.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{globalCss as y}from"./support/globalCss.js";import{onResize as g}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as x}from"./support/decorators/vmEvent.js";import{tsx as w}from"./support/jsxFactory.js";import{getCalciteThemeClass as E}from"../support/themeUtils.js";import{css as k}from"./TimeSlider/css.js";import j from"./TimeSlider/TimeSliderViewModel.js";const _=3,T=858,S=[{minor:{value:100,unit:"milliseconds"},major:{value:1,unit:"seconds"},format:{second:"numeric"}},{minor:{value:500,unit:"milliseconds"},major:{value:5,unit:"seconds"},format:{second:"numeric"}},{minor:{value:1,unit:"seconds"},major:{value:20,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:2,unit:"seconds"},major:{value:30,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:10,unit:"seconds"},major:{value:1,unit:"minutes"},format:{minute:"numeric"}},{minor:{value:15,unit:"seconds"},major:{value:5,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"minutes"},major:{value:20,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:5,unit:"minutes"},major:{value:2,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:15,unit:"minutes"},major:{value:6,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"hours"},major:{value:1,unit:"days"},format:{day:"numeric",month:"short"}},{minor:{value:6,unit:"hours"},major:{value:1,unit:"weeks"},format:{day:"numeric",month:"short"}},{minor:{value:1,unit:"days"},major:{value:1,unit:"months"},format:{month:"long"}},{minor:{value:2,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:3,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:4,unit:"days"},major:{value:3,unit:"months"},format:{month:"short",year:"numeric"}},{minor:{value:1,unit:"weeks"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"months"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:2,unit:"months"},major:{value:2,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"years"},major:{value:1,unit:"decades"},format:{year:"numeric"}},{minor:{value:2,unit:"years"},major:{value:5,unit:"decades"},format:{year:"numeric"}},{minor:{value:5,unit:"decades"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1,unit:"centuries"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:2,unit:"centuries"},major:{value:20,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:5,unit:"centuries"},major:{value:50,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:10,unit:"centuries"},major:{value:100,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:20,unit:"centuries"},major:{value:200,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:50,unit:"centuries"},major:{value:500,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:100,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:200,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:500,unit:"centuries"},major:{value:5e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1e3,unit:"centuries"},major:{value:1e4,unit:"centuries"},format:{era:"short",year:"numeric"}}];function M(t){return w("div",{class:k.warning},w("calcite-icon",{class:k.warningIcon,icon:"exclamation-mark-triangle"}),w("calcite-label",{alignment:"center",class:k.warningLabel,scale:"s"},t))}let F=class extends v{constructor(t,e){super(t,e),this._allLayouts=["auto","compact","wide"],this._ignoreNextSliderUpdate=!1,this._slider=new h({precision:0,visibleElements:{rangeLabels:!1},rangeLabelInputsEnabled:!1,thumbsConstrained:!1}),this._tickFormat=null,this.disabled=!1,this.labelFormatFunction=null,this.messages=null,this.tickConfigs=null,this.timeVisible=!1,this.viewModel=new j}initialize(){this.addHandles([a((()=>this._slider.values),(t=>{if(this._ignoreNextSliderUpdate)return void(this._ignoreNextSliderUpdate=!1);const e=this.viewModel.valuesToTimeExtent(t);this.timeExtent?e?this.timeExtent.equals(e)||(this.timeExtent=e):this.timeExtent=null:e&&(this.timeExtent=e)})),a((()=>this.effectiveStops),(()=>this._updateSliderSteps()),s)])}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}destroy(){this._slider.destroy(),this._tickFormat=null}get _dateFormat(){return this._getIntlOptions("short-date")}get _timeFormat(){return this._getIntlOptions("long-time")}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get effectiveStops(){return this.viewModel.effectiveStops}get fullTimeExtent(){return this.viewModel.fullTimeExtent}set fullTimeExtent(t){this.viewModel.fullTimeExtent=t}get icon(){return"clock"}set icon(t){this._overrideIfSome("icon",t)}get interactive(){return!(this.disabled||"disabled"===this.viewModel.state||this.timeZone===c)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){this._set("layout",this._allLayouts.includes(t)?t:"auto")}get loop(){return this.viewModel.loop}set loop(t){this.viewModel.loop=t}get mode(){return this.viewModel.mode}set mode(t){this.viewModel.mode=t}get playRate(){return this.viewModel.playRate}set playRate(t){this.viewModel.playRate=t}get stops(){return this.viewModel.stops}set stops(t){this.viewModel.stops=t}get tickFormats(){const{timeZone:t}=this;return S.map((({minor:e,major:i,format:a})=>({minor:new p(e),major:new p(i),format:{...a,timeZone:t}})))}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(t){this.viewModel.timeExtent=t}get timeZone(){return this.viewModel.view?.timeZone??d}set timeZone(t){this._overrideIfSome("timeZone",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}next(){return this.viewModel.next()}play(){return this.viewModel.play()}previous(){return this.viewModel.previous()}stop(){return this.viewModel.stop()}render(){const{_slider:t,actions:i,domNode:a,effectiveStops:s,fullTimeExtent:n,interactive:r,messages:o,mode:l,tickConfigs:u,timeExtent:c,timeVisible:d,viewModel:{state:p,timeExtentValues:h}}=this;if(n){const{start:e,end:i}=n;if(e&&i){const a=e.getTime(),s=i.getTime(),n=t.min!==a||t.max!==s;if(n&&(t.min=a,t.max=s),u)t.tickConfigs!==u&&(t.tickConfigs=u);else{const e=(s-a)/(t.trackElement?.offsetWidth||400),i=this.tickFormats.find((({minor:t})=>t.toMilliseconds()>_*e))??this.tickFormats.at(-1),r=i&&this._tickFormat!==i;if(r&&(this._tickFormat=i),n||r){const e={mode:"position",values:this._getTickPositions(i.minor),labelsVisible:!1,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMinorTick)}},a={mode:"position",values:this._getTickPositions(i.major),labelsVisible:!0,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMajorTick)},labelFormatFunction:t=>m(t,i.format)};t.tickConfigs=[e,a]}}}}const v=!this.fullTimeExtent?.start||!this.fullTimeExtent.end||!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||this.timeExtent.start&&(this.timeExtent.start<this.fullTimeExtent.start||this.timeExtent.start>this.fullTimeExtent.end)||this.timeExtent.end&&(this.timeExtent.end>this.fullTimeExtent.end||this.timeExtent.end<this.fullTimeExtent.start);if(v)switch(this._ignoreNextSliderUpdate=!0,l){case"time-window":t.values=[t.min,t.max];break;case"instant":case"cumulative-from-end":t.values=[t.min];break;case"cumulative-from-start":t.values=[t.max]}else h?e(t.values,h)||(t.values=h):t.values=null;t.disabled=!r;const f=v||!r||!s?.length,b="auto"===this.layout?a.clientWidth<T?"compact":"wide":this.layout,x=w("calcite-button",{appearance:"transparent",bind:this,class:k.play,disabled:f,iconStart:"playing"===p?"pause":"play",kind:"neutral",label:"playing"===p?o.control.stop:o.control.play,onclick:this._playOrStopClick,scale:"wide"===b?"l":"m",width:"full"}),j=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.timeExtentStartDate,"data-date":c?[c.start,c.end]:null,"data-layout":b,"data-type":"extent",key:k.timeExtentStartDate}):!c||c.isAllTime?M(o.noTimeExtent):c.isEmpty?M(o.emptyTimeExtent):[c?.start&&w("div",{class:k.timeExtentStartGroup,key:k.timeExtentStartGroup},w("calcite-label",{alignment:"center",class:k.timeExtentStartDate,key:k.timeExtentStartDate,scale:"s"},this._formatDate(c.start)),d?w("calcite-label",{alignment:"center",class:k.timeExtentStartTime,key:k.timeExtentStartTime,scale:"s"},this._formatTime(c.start)):null),c.start&&c.end&&c.start.getTime()!==c.end.getTime()&&w("div",{class:k.timeExtentSeparator,key:k.timeExtentSeparator}),c?.end&&(!c.start||c.start.getTime()!==c.end.getTime())&&w("div",{class:k.timeExtentEndGroup,key:k.timeExtentEndGroup},w("calcite-label",{alignment:"center",class:k.timeExtentEndDate,key:k.timeExtentEndDate,scale:"s"},this._formatDate(c.end)),d?w("calcite-label",{alignment:"center",class:k.timeExtentEndTime,key:k.timeExtentEndTime,scale:"s"},this._formatTime(c.end)):null)],S=w("div",{class:k.timeExtent},j),F=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.minDate,"data-date":n?.start,"data-layout":b,"data-type":"min",key:k.minDate}):n?.start&&[w("calcite-label",{alignment:"center",class:k.minDate,key:k.minDate,scale:"s"},this._formatDate(n.start)),d&&w("calcite-label",{alignment:"center",class:k.minTime,key:k.minTime,scale:"s"},this._formatTime(n.start))],D=w("div",{class:k.min},F),C=w("div",{class:k.slider},t.render()),L=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.maxDate,"data-date":n?.end,"data-layout":b,"data-type":"max",key:k.maxDate}):n?.end&&[w("calcite-label",{alignment:"center",class:k.maxDate,key:k.maxDate,scale:"s"},this._formatDate(n.end)),d&&w("calcite-label",{alignment:"center",class:k.maxTime,key:k.maxTime,scale:"s"},this._formatTime(n.end))],U=w("div",{class:k.max},L),Z=w("calcite-button",{appearance:"transparent",bind:this,class:k.previous,disabled:f||"playing"===p,iconStart:"reverse",kind:"neutral",label:o.pagination.previous,onclick:this._previousClick,scale:"wide"===b?"l":"m",width:"full"}),R=w("calcite-button",{appearance:"transparent",bind:this,class:k.next,disabled:f||"playing"===p,iconStart:"forward",kind:"neutral",label:o.pagination.next,onclick:this._nextClick,scale:"wide"===b?"l":"m",width:"full"}),I=i?.length>0,O=I&&w("calcite-action-menu",{class:k.actions,label:o.options},i.toArray().map((t=>w("calcite-action",{bind:this,icon:t.icon,id:t.id,onclick:()=>this.viewModel.triggerAction(t),text:t.title,textEnabled:!0}))));return w("div",{afterCreate:t=>{this.addHandles(g(t,(()=>this.scheduleRender())))},"aria-label":o.widgetLabel,class:this.classes(k.timeSlider,y.widget,`${k.timeSliderMode}${l}`,`${k.timeSliderLayout}${b}`,!r&&k.timeSliderDisabled,v&&k.timeSliderOutOfBounds,I&&k.hasActions,E())},"wide"===b&&w("div",{class:k.timeSliderRow},w("div",{class:k.playbackControls},[x,S,D,C,U,Z,R]),O),"compact"===b&&[w("div",{class:k.timeSliderRow,key:"time-slider-row-1"},[S,O]),w("div",{class:k.timeSliderRow,key:"time-slider-row-2"},[C]),w("div",{class:k.timeSliderRow,key:"time-slider-row-3"},[D,Z,x,R,U])])}updateWebDocument(t){this.viewModel?.updateWebDocument(t)}_createLabel(t){if(!this.labelFormatFunction)return;const e=t.getAttribute("data-type"),i=t.getAttribute("data-layout"),a=t["data-date"];this.labelFormatFunction(a,e,t,i)}_formatDate(t){return m(t,this._dateFormat)}_formatTime(t){return m(t,this._timeFormat)}_getIntlOptions(t){const{timeZone:e}=this;return{...u(t),timeZone:e}}_getTickPositions(t){const{fullTimeExtent:e}=this;if(!e?.start||!e.end)return[];const{start:i,end:a}=e,s=[],{value:o,unit:l}=t;let m=n(i,l,this.timeZone);for(;m.getTime()<=a.getTime();)m.getTime()>=i.getTime()&&s.push(m.getTime()),m=r(m,o,l,this.timeZone);return s}_updateSliderSteps(){this._slider.steps=this.effectiveStops&&this.effectiveStops.length>0?this.effectiveStops.map((t=>t.getTime())):null}_playOrStopClick(){switch(this.viewModel.state){case"ready":this.viewModel.play();break;case"playing":this.viewModel.stop();break;case"disabled":break;default:i(this.viewModel.state)}}_previousClick(){this.viewModel.previous()}_nextClick(){this.viewModel.next()}};t([o()],F.prototype,"_dateFormat",null),t([o()],F.prototype,"_timeFormat",null),t([o()],F.prototype,"actions",null),t([o()],F.prototype,"disabled",void 0),t([o()],F.prototype,"effectiveStops",null),t([o()],F.prototype,"fullTimeExtent",null),t([o()],F.prototype,"icon",null),t([o({readOnly:!0})],F.prototype,"interactive",null),t([o()],F.prototype,"label",null),t([o()],F.prototype,"labelFormatFunction",void 0),t([o({value:"auto"})],F.prototype,"layout",null),t([o()],F.prototype,"loop",null),t([o(),b("esri/widgets/TimeSlider/t9n/TimeSlider")],F.prototype,"messages",void 0),t([o()],F.prototype,"mode",null),t([o()],F.prototype,"playRate",null),t([o()],F.prototype,"stops",null),t([o()],F.prototype,"tickConfigs",void 0),t([o()],F.prototype,"tickFormats",null),t([o()],F.prototype,"timeExtent",null),t([o({nonNullable:!0})],F.prototype,"timeVisible",void 0),t([o()],F.prototype,"timeZone",null),t([o()],F.prototype,"view",null),t([o({type:j}),x("trigger-action")],F.prototype,"viewModel",void 0),F=t([l("esri.widgets.TimeSlider")],F);const D=F;export{D as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{fetchThumbnail as i}from"../symbolPreviewUtils.js";import s from"./ItemBase.js";let o=class extends s{constructor(t){super(t),this._title=null,this._thumbnail=null,this.graphic=null,this.layer=null}get key(){return`${this.layer.id}:${this.objectId??this.graphic.uid}`}get objectId(){return this.graphic.getObjectId()}get title(){return this._title??this.objectId?.toString()}get thumbnail(){return this._thumbnail??void 0}async fetchThumbnail(){return this._thumbnail=await i(this.graphic,this.layer)}async sync(t){t.push(this._setFeatureTitle())}async _setFeatureTitle(){const{graphic:t,key:e,layer:r,viewModel:i}=this,s=i.featureTitleMap.get(e)||(r?.getFeatureTitle?await r.getFeatureTitle(t,{fetchMissingFields:!1}):null);s&&i.featureTitleMap.set(e,s),this._title=s}};t([e()],o.prototype,"_title",void 0),t([e()],o.prototype,"_thumbnail",void 0),t([e()],o.prototype,"graphic",void 0),t([e()],o.prototype,"key",null),t([e()],o.prototype,"layer",void 0),t([e()],o.prototype,"objectId",null),t([e()],o.prototype,"title",null),t([e()],o.prototype,"thumbnail",null),o=t([r("esri.widgets.support.SelectionList.FeatureItem")],o);const l=o;export{l as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import o from"./ItemBase.js";let s=class extends o{constructor(e){super(e),this.children=[],this.layer=null}get layers(){const{layer:e}=this;return"group"===e.type?e.layers.toArray().reverse():"subtype-group"===e.type?e.sublayers.toArray().reverse():[]}get maxVisibleFeatureCountExceeded(){return this.children.some((e=>e.maxVisibleFeatureCountExceeded))}get total(){return this.children.reduce(((e,r)=>e+r.total),0)}async sync({controller:e,promises:r}){const{layers:t,viewModel:o}=this;this.children=o.layersToItems({controller:e,layers:t,promises:r})}};e([r()],s.prototype,"children",void 0),e([r()],s.prototype,"layer",void 0),e([r()],s.prototype,"layers",null),e([r()],s.prototype,"maxVisibleFeatureCountExceeded",null),e([r()],s.prototype,"total",null),s=e([t("esri.widgets.support.SelectionList.GroupLayerItem")],s);const l=s;export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getIconForLayer as s}from"../iconUtils.js";let i=class extends t{constructor(e){super(e),this.layer=null,this.viewModel=null}get iconName(){return s(this.layer)}get key(){return this.layer.id}get layerView(){return this.viewModel.layerViewMap.get(this.layer.id)}get title(){return this.layer.title}get view(){return this.viewModel.view}};e([r()],i.prototype,"iconName",null),e([r()],i.prototype,"key",null),e([r()],i.prototype,"layer",void 0),e([r()],i.prototype,"layerView",null),e([r()],i.prototype,"title",null),e([r()],i.prototype,"view",null),e([r()],i.prototype,"viewModel",void 0),i=e([o("esri.widgets.support.SelectionList.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getIconForLayer as s}from"../iconUtils.js";let i=class extends t{constructor(e){super(e),this.layer=null,this.viewModel=null}get iconName(){return s(this.layer)}get key(){return this.layer.id}get layerView(){return this.viewModel.layerViewMap.get(this.layer.id)}get title(){return this.layer.title}get view(){return this.viewModel.view}};e([r()],i.prototype,"iconName",null),e([r()],i.prototype,"key",null),e([r()],i.prototype,"layer",void 0),e([r()],i.prototype,"layerView",null),e([r()],i.prototype,"title",null),e([r()],i.prototype,"view",null),e([r()],i.prototype,"viewModel",void 0),i=e([o("esri.widgets.support.SelectionList.ItemBase")],i);const l=i;export{l as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"./FeatureItem.js";import s from"./ItemBase.js";let i=class extends s{constructor(e){super(e),this._onChangeController=null,this.layer=null,this.selection=[]}get effectiveObjectIds(){return this.objectIds.slice(0,this.maxVisibleFeatureCountPerLayer)}get maxVisibleFeatureCountExceeded(){return this.objectIds.length>this.viewModel.maxVisibleFeatureCountPerLayer}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}get objectIds(){return this.viewModel.selectionsByLayerMap.get(this.layer)??[]}get total(){return this.objectIds.length}cancel(){this._onChangeController?.abort()}async sync({controller:e,promises:t}){this.cancel();const r=this.selection.slice(),o=new Map(r.map((e=>[e.objectId,e]))),s=this.effectiveObjectIds.slice(),i=[],a=[];for(const n of s){const e=o.get(n);e?(i.push(e),t.push(e.sync(t))):a.push(n)}if(this._onChangeController=e,a.length>0){const r=await this._createFeatureItems(a,e);for(const e of r)i.push(e),t.push(e.sync(t))}e.signal.aborted||(this.selection=i)}async _createFeatureItems(e,t){const{layer:r,layerView:s,viewModel:i}=this,a=new Map;if(s){const o=s.createQuery();o.objectIds=e,o.outFields=["*"],o.returnGeometry=!0;const i=await s.queryFeatures(o,t),{objectIdField:n}=r;for(const e of i?.features??[])a.set(e.attributes[n],e)}if(t.signal.aborted)return[];const n=e.filter((e=>!a.has(e)));if(n.length){const e=r.createQuery();e.objectIds=n,e.outSpatialReference=this.view?.spatialReference,e.outFields=["*"],e.returnGeometry=!0;const o=await r.queryFeatures(e,t);for(const t of o.features??[])a.set(t.attributes[r.objectIdField],t)}return Array.from(a.values()).map((e=>new o({layer:r,graphic:e,viewModel:i})))}};e([t()],i.prototype,"_onChangeController",void 0),e([t()],i.prototype,"effectiveObjectIds",null),e([t()],i.prototype,"layer",void 0),e([t()],i.prototype,"maxVisibleFeatureCountExceeded",null),e([t()],i.prototype,"maxVisibleFeatureCountPerLayer",null),e([t()],i.prototype,"objectIds",null),e([t()],i.prototype,"selection",void 0),e([t()],i.prototype,"total",null),i=e([r("esri.widgets.support.SelectionList.LayerItem")],i);const a=i;export{a as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as o}from"../../../core/arrayUtils.js";import r from"../../../core/Logger.js";import{removeMaybe as i}from"../../../core/maybe.js";import{ignoreAbortErrors as s,debounce as n}from"../../../core/promiseUtils.js";import{watch as a,on as l}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as g,isSubtypeSublayer as m}from"../../../layers/support/layerUtils.js";import{isSelectableLayer as u}from"../../../views/support/selectionUtils.js";import{goTo as y}from"../goToUtils.js";import f from"./
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as o}from"../../../core/arrayUtils.js";import r from"../../../core/Logger.js";import{removeMaybe as i}from"../../../core/maybe.js";import{ignoreAbortErrors as s,debounce as n}from"../../../core/promiseUtils.js";import{watch as a,on as l}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as g,isSubtypeSublayer as m}from"../../../layers/support/layerUtils.js";import{isSelectableLayer as u}from"../../../views/support/selectionUtils.js";import{goTo as y}from"../goToUtils.js";import f from"./GroupLayerItem.js";import d from"./LayerItem.js";import{computeEffectiveCount as v,getNestedFeatureItems as S,isGroupLayerItem as C,isLayerItem as _}from"./selectionListUtils.js";const I=100;let M=class extends t{constructor(e){super(e),this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerItemCache=new Map,this._layerItems=null,this._onChangeAbortController=null,this._updatingHandles=new p,this.featureTitleMap=new Map,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();const e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(s(this._onSelectionChange(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=n(this._onSelectionChangeController,I)}initialize(){this.addHandles([a((()=>[this.view,this.effectiveSelectionManager]),(()=>this._onSelectionChangeDebounced())),l((()=>this.effectiveSelectionManager?.sources),"change",(()=>this._onSelectionChangeDebounced())),l((()=>this.effectiveSelectionManager),"selection-change",(()=>this._onSelectionChangeDebounced()))])}destroy(){this.removeTemporaryHighlight(),this._updatingHandles.destroy()}get effectiveCount(){return v(this.layerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!(!this._onChangeAbortController&&!this._updatingHandles.updating)}get layerItems(){return this._layerItems??[]}get layerViewMap(){const e=new Map,{view:t}=this;if(!t)return e;for(const o of t.allLayerViews)if(e.set(o.layer.id,o),g(o.layer))for(const t of o.layer.sublayers)e.set(t.id,o);return e}get maxVisibleFeatureCountExceeded(){return this.layerItems.some((e=>e.maxVisibleFeatureCountExceeded))}get selectionSources(){const e=this.effectiveSelectionManager,t=new Set;if(e?.sources)for(const o of e.sources)t.add(o);return t}get selectionsByLayerMap(){const e=this.effectiveSelectionManager,t=new Map;if(!e||"ready"!==this.state)return t;for(const{layer:o,selection:r}of e.selections)t.set(o,r);return t}get state(){const{view:e}=this;return e?e.ready?this.effectiveSelectionManager?"ready":"error":"loading":"disabled"}get totalCount(){return this.effectiveSelectionManager?.count??0}get viewLayersAndTables(){const{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}addTemporaryHighlight({graphic:e,layerView:t}){this.removeTemporaryHighlight(),t&&e&&(this._hoverHighlightHandle=t.highlight(e,{name:"temporary"}))}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){const t=e.graphic.getObjectId();null!=t&&this.effectiveSelectionManager?.removeFromSelection(e.layer,[t])}deselectGroupItem(e){const t=S([e]).map((e=>e.graphic)).filter(o);t?.length&&this.effectiveSelectionManager?.updateSelection({added:[],current:[],removed:t})}deselectLayerItem(e){this.effectiveSelectionManager?.setSelection(e.layer,[])}deselectItem(e){C(e)?this.deselectGroupItem(e):_(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}goToItem(e){_(e)||C(e)?this._goTo(S([e]).map((e=>e.graphic))):this._goTo(e.graphic)}layersToItems(e){const{controller:t,layers:o,promises:r}=e,{_groupItemCache:i,_layerItemCache:s,effectiveSelectionManager:n,viewLayersAndTables:a}=this,l=o??a;if(!n)return[];const c=[];for(const h of l)switch(h.type){case"subtype-group":case"group":{const e=i.get(h),o=e??new f({layer:h,viewModel:this});e||i.set(h,o),r.push(o.sync({controller:t,promises:r})),c.push(o)}break;default:if(u(h)||m(h)){const e=h,o=n.getSelection(e);if(!o?.length)continue;const i=s.get(e),a=i??new d({layer:e,viewModel:this});i||s.set(e,a),r.push(a.sync({controller:t,promises:r})),c.push(a)}}return c}removeFromSelection(e){this.effectiveSelectionManager?.removeFromSelection(e.layer,e.objectIds)}removeTemporaryHighlight(){this._hoverHighlightHandle=i(this._hoverHighlightHandle)}selectSingleFeatureItem(e){const t=e.objectId;if(null!=t&&this.effectiveSelectionManager)for(const{layer:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:o,objectIds:o===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t.parent===e.layer?o:[]})}selectSingleItem(e){C(e)?this.selectSingleGroupItem(e):_(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t===e.layer?o:[]})}setSelection(e){this.effectiveSelectionManager?.setSelection(e.layer,e.objectIds)}async _goTo(e){const{view:t}=this;if(t)try{await y(t,e)}catch(o){"AbortError"!==o.name&&r.getLogger(this).warn("Failed to go to feature(s)",o)}}async _onSelectionChange(e){try{this.removeTemporaryHighlight();const t=[],o=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._layerItems=o)}catch(t){r.getLogger(this).warn("Failed updating selection",t)}}};e([c()],M.prototype,"_groupItemCache",void 0),e([c()],M.prototype,"_hoverHighlightHandle",void 0),e([c()],M.prototype,"_layerItemCache",void 0),e([c()],M.prototype,"_layerItems",void 0),e([c()],M.prototype,"_onChangeAbortController",void 0),e([c()],M.prototype,"effectiveCount",null),e([c()],M.prototype,"effectiveSelectionManager",null),e([c()],M.prototype,"featureTitleMap",void 0),e([c()],M.prototype,"isUpdating",null),e([c()],M.prototype,"layerItems",null),e([c()],M.prototype,"layerViewMap",null),e([c()],M.prototype,"maxVisibleFeatureCountExceeded",null),e([c()],M.prototype,"maxVisibleFeatureCountPerLayer",void 0),e([c()],M.prototype,"selectionManager",void 0),e([c()],M.prototype,"selectionSources",null),e([c()],M.prototype,"selectionsByLayerMap",null),e([c()],M.prototype,"state",null),e([c()],M.prototype,"totalCount",null),e([c()],M.prototype,"view",void 0),e([c()],M.prototype,"viewLayersAndTables",null),M=e([h("esri.widgets.support.SelectionList.SelectionListViewModel")],M);const b=M;export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as n}from"../../../core/arrayUtils.js";function t(e){return e.flatMap((n=>i(n)?n.selection:l(n)?n.children.flatMap((n=>t([n]))):n)).filter(n)}function e(t){return t.flatMap((n=>l(n)?n.children.filter((n=>"selection"in n)):i(n)?n:null)).filter(n)}function r(n){let t=0;for(const e of n)i(e)&&(t+=e.total),l(e)&&(t+=r(e.children));return t}function l(n){return null!=n&&"object"==typeof n&&"children"in n}function i(n){return null!=n&&"object"==typeof n&&"selection"in n}function o(n){return null!=n&&"object"==typeof n&&"graphic"in n}export{r as computeEffectiveCount,t as getNestedFeatureItems,e as getNestedLayerItems,o as
|
|
5
|
+
import{isSome as n}from"../../../core/arrayUtils.js";function t(e){return e.flatMap((n=>i(n)?n.selection:l(n)?n.children.flatMap((n=>t([n]))):n)).filter(n)}function e(t){return t.flatMap((n=>l(n)?n.children.filter((n=>"selection"in n)):i(n)?n:null)).filter(n)}function r(n){let t=0;for(const e of n)i(e)&&(t+=e.total),l(e)&&(t+=r(e.children));return t}function l(n){return null!=n&&"object"==typeof n&&"children"in n}function i(n){return null!=n&&"object"==typeof n&&"selection"in n}function o(n){return null!=n&&"object"==typeof n&&"graphic"in n}export{r as computeEffectiveCount,t as getNestedFeatureItems,e as getNestedLayerItems,o as isFeatureItem,l as isGroupLayerItem,i as isLayerItem};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import{loadCalciteComponents as l}from"./componentsUtils.js";import{globalCss as n}from"./globalCss.js";import{storeNode as r}from"./widgetUtils.js";import{messageBundle as a}from"./decorators/messageBundle.js";import{tsx as c}from"./jsxFactory.js";import{isSelectionListGroupLayerItem as m,isSelectionListLayerItem as d,isSelectionListFeatureItem as p}from"./SelectionList/selectionListUtils.js";import h from"./SelectionList/SelectionListViewModel.js";import u from"./SelectionList/VisibleElements.js";import{formatNumber as g}from"../../intl/number.js";import{substitute as v}from"../../intl/substitute.js";const I="esri-selection-list",y=`${I}__list-item`,f={base:I,baseSmall:`${I}--small`,baseMedium:`${I}--medium`,baseLarge:`${I}--large`,container:`${I}__container`,notice:`${I}__notice`,listItemFeature:`${y}__feature`,listItemFeatureIcon:`${y}__feature-icon`,listItemIcon:`${y}__icon`,totalCountChip:`${I}__total-count`};let b=class extends o{constructor(e,t){super(e,t),this._list=null,this._iconIntersectionObserver=new IntersectionObserver(((e,t)=>{e.forEach((async e=>{if(e.isIntersecting){const i=e.target;if(this._hasIcon(i))return void t.unobserve(i);const s=this._getListItem(i);if(!s)return;this._setHasIcon(i,!0);const o=await s.fetchThumbnail().catch((()=>(this._setHasIcon(i,!1),null)));if(null==o)return;i.appendChild(o)}}))})),this.displayMode="nested",this.menuScale="m",this.messages=null,this.messagesCommon=null,this.scale="s",this.viewModel=new h,this.visibleElements=new u,this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return l({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get featureTitleMap(){return this.viewModel.featureTitleMap}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSources(){return this.viewModel.selectionSources}get selectionsByLayerMap(){return this.viewModel.selectionsByLayerMap}get state(){return this.viewModel.state}get totalCount(){return this.viewModel.totalCount}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach((e=>e.open=!1))}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return c("div",{class:this.classes(f.base,n.widget,n.panel,this._getBaseCssClass())},c("calcite-panel",{class:f.container,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale},this._renderList(),this._renderMenuActions(),this._renderTotalChip()))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCountChip||!e.header)return;const{effectiveCount:t}=this,i=g(t),s=v(this.messages.selectionCount,{count:i});return c("calcite-chip",{appearance:"outline",class:f.totalCountChip,closable:t>0,closed:0===t,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:i,scale:this.scale,slot:"header-actions-end",title:s,onCalciteChipClose:this.clear},i)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.totalCount;return[c("calcite-action",{disabled:i,icon:"reset",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),c("calcite-action",{disabled:i,icon:"folders",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderList(){const e=this.layerItems??[],t=!!(this.visibleElements.filter&&this.effectiveCount>0);return c("calcite-list",{afterCreate:r,bind:this,"data-node-ref":"_list",displayMode:"nested",filterEnabled:t,filterPlaceholder:this.messages.filter,filterPredicate:({value:e})=>null==this._list?.filterText||new RegExp(this._list.filterText,"iu").test(e),interactionMode:"static",label:this.messages.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(e))}_renderListContent(e){return e.map((e=>m(e)?this._renderGroupItem(e):d(e)?this._renderLayerItem(e):null)).filter(t)}_renderItemCountChip(e){if(!this.visibleElements.itemCountChip)return;const{messages:t}=this,{maxVisibleFeatureCountExceeded:i,total:s}=e,o=g(s),l=i?t.tooManyFeatures:v(t.selectionCount,{count:o});return c("calcite-chip",{appearance:"outline",icon:i?"exclamation-mark-triangle":void 0,label:o,scale:"s",slot:"content-end",title:l},o)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=p(e),o=s?t.deselectFeature:d(e)?t.deselectLayer:t.deselectGroup;return[c("calcite-dropdown",{overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m"},c("calcite-action",{icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),c("calcite-dropdown-group",{selectionMode:"none"},c("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo),c("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},s?t.onlySelectFeature:t.onlySelectThis),c("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},o)))]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.total)return;if("flat"===this.displayMode)return this._renderListContent(e.children);const{visibleElements:i}=this;return c("calcite-list-item",{closable:!!i.itemCloseActions,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:t,open:!0,title:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemCountChip(e),this._renderItemActions(e),this._renderListContent(e.children))}_renderLayerItem(e){const{messages:t}=this,i=e.title||t.untitledLayer;if(0===e.total)return;if("flat"===this.displayMode)return this._renderItems(e.selection);const{visibleElements:s}=this;return c("calcite-list-item",{closable:!!s.itemCloseActions,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:i,open:!0,scale:this.scale,title:i,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemCountChip(e),this._renderItemActions(e),this._renderItems(e.selection),e.maxVisibleFeatureCountExceeded?c("calcite-notice",{class:f.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},c("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map((e=>this._renderItem(e)))}_renderItem(e){const{messages:t,visibleElements:i}=this,s=e.title||t.untitledFeature;return c("calcite-list-item",{class:i.itemIcons?f.listItemFeatureIcon:f.listItemFeature,closable:!!i.itemCloseActions,"data-item":e,key:e.key,label:s,name:s,onblur:this.removeTemporaryHighlight,onfocus:()=>this.addTemporaryHighlight(e),onpointerenter:()=>this.addTemporaryHighlight(e),onpointerleave:this.removeTemporaryHighlight,scale:this.scale,title:s,value:s,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return c("div",{class:f.listItemIcon,key:"content-start",slot:"content-start"},c("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_getBaseCssClass(){switch(this.scale){case"s":return f.baseSmall;case"m":return f.baseMedium;default:return f.baseLarge}}};e([i()],b.prototype,"_list",void 0),e([i()],b.prototype,"displayMode",void 0),e([i()],b.prototype,"effectiveCount",null),e([i()],b.prototype,"effectiveSelectionManager",null),e([i()],b.prototype,"featureTitleMap",null),e([i()],b.prototype,"icon",null),e([i()],b.prototype,"isUpdating",null),e([i()],b.prototype,"label",null),e([i()],b.prototype,"layerItems",null),e([i()],b.prototype,"layerViewMap",null),e([i()],b.prototype,"maxVisibleFeatureCountExceeded",null),e([i()],b.prototype,"maxVisibleFeatureCountPerLayer",null),e([i()],b.prototype,"menuScale",void 0),e([i(),a("esri/widgets/support/SelectionList/t9n/SelectionList")],b.prototype,"messages",void 0),e([i(),a("esri/t9n/common")],b.prototype,"messagesCommon",void 0),e([i()],b.prototype,"scale",void 0),e([i()],b.prototype,"selectionManager",null),e([i()],b.prototype,"selectionSources",null),e([i()],b.prototype,"selectionsByLayerMap",null),e([i()],b.prototype,"state",null),e([i()],b.prototype,"totalCount",null),e([i()],b.prototype,"view",null),e([i()],b.prototype,"viewLayersAndTables",null),e([i()],b.prototype,"viewModel",void 0),e([i({type:u,nonNullable:!0})],b.prototype,"visibleElements",void 0),b=e([s("esri.widgets.support.SelectionList")],b);const w=b;export{w as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import{loadCalciteComponents as l}from"./componentsUtils.js";import{globalCss as n}from"./globalCss.js";import{storeNode as r}from"./widgetUtils.js";import{messageBundle as a}from"./decorators/messageBundle.js";import{tsx as c}from"./jsxFactory.js";import{isGroupLayerItem as m,isLayerItem as d,isFeatureItem as p}from"./SelectionList/selectionListUtils.js";import h from"./SelectionList/SelectionListViewModel.js";import u from"./SelectionList/VisibleElements.js";import{formatNumber as g}from"../../intl/number.js";import{substitute as v}from"../../intl/substitute.js";const I="esri-selection-list",y=`${I}__list-item`,f={base:I,baseSmall:`${I}--small`,baseMedium:`${I}--medium`,baseLarge:`${I}--large`,container:`${I}__container`,notice:`${I}__notice`,listItemFeature:`${y}__feature`,listItemFeatureIcon:`${y}__feature-icon`,listItemIcon:`${y}__icon`,totalCountChip:`${I}__total-count`};let b=class extends o{constructor(e,t){super(e,t),this._list=null,this._iconIntersectionObserver=new IntersectionObserver(((e,t)=>{e.forEach((async e=>{if(e.isIntersecting){const i=e.target;if(this._hasIcon(i))return void t.unobserve(i);const s=this._getListItem(i);if(!s)return;this._setHasIcon(i,!0);const o=await s.fetchThumbnail().catch((()=>(this._setHasIcon(i,!1),null)));if(null==o)return;i.appendChild(o)}}))})),this.displayMode="nested",this.menuScale="m",this.messages=null,this.messagesCommon=null,this.scale="s",this.viewModel=new h,this.visibleElements=new u,this._afterItemCreateOrUpdate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return l({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get featureTitleMap(){return this.viewModel.featureTitleMap}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSources(){return this.viewModel.selectionSources}get selectionsByLayerMap(){return this.viewModel.selectionsByLayerMap}get state(){return this.viewModel.state}get totalCount(){return this.viewModel.totalCount}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach((e=>e.open=!1))}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return c("div",{class:this.classes(f.base,n.widget,n.panel,this._getBaseCssClass())},c("calcite-panel",{class:f.container,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale},this._renderList(),this._renderMenuActions(),this._renderTotalChip()))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCountChip||!e.header)return;const{effectiveCount:t}=this,i=g(t),s=v(this.messages.selectionCount,{count:i});return c("calcite-chip",{appearance:"outline",class:f.totalCountChip,closable:t>0,closed:0===t,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:i,scale:this.scale,slot:"header-actions-end",title:s,onCalciteChipClose:this.clear},i)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.totalCount;return[c("calcite-action",{disabled:i,icon:"reset",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),c("calcite-action",{disabled:i,icon:"folders",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderList(){const e=this.layerItems??[],t=!!(this.visibleElements.filter&&this.effectiveCount>0);return c("calcite-list",{afterCreate:r,bind:this,"data-node-ref":"_list",displayMode:"nested",filterEnabled:t,filterPlaceholder:this.messages.filter,filterPredicate:({value:e})=>null==this._list?.filterText||new RegExp(this._list.filterText,"iu").test(e),interactionMode:"static",label:this.messages.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(e))}_renderListContent(e){return e.map((e=>m(e)?this._renderGroupItem(e):d(e)?this._renderLayerItem(e):null)).filter(t)}_renderItemCountChip(e){if(!this.visibleElements.itemCountChip)return;const{messages:t}=this,{maxVisibleFeatureCountExceeded:i,total:s}=e,o=g(s),l=i?t.tooManyFeatures:v(t.selectionCount,{count:o});return c("calcite-chip",{appearance:"outline",icon:i?"exclamation-mark-triangle":void 0,label:o,scale:"s",slot:"content-end",title:l},o)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=p(e),o=s?t.deselectFeature:d(e)?t.deselectLayer:t.deselectGroup;return[c("calcite-dropdown",{overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m"},c("calcite-action",{icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),c("calcite-dropdown-group",{selectionMode:"none"},c("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo),c("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},s?t.onlySelectFeature:t.onlySelectThis),c("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},o)))]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.total)return;if("flat"===this.displayMode)return this._renderListContent(e.children);const{visibleElements:i}=this;return c("calcite-list-item",{closable:!!i.itemCloseActions,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:t,open:!0,title:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemCountChip(e),this._renderItemActions(e),this._renderListContent(e.children))}_renderLayerItem(e){const{messages:t}=this,i=e.title||t.untitledLayer;if(0===e.total)return;if("flat"===this.displayMode)return this._renderItems(e.selection);const{visibleElements:s}=this;return c("calcite-list-item",{closable:!!s.itemCloseActions,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:i,open:!0,scale:this.scale,title:i,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemCountChip(e),this._renderItemActions(e),this._renderItems(e.selection),e.maxVisibleFeatureCountExceeded?c("calcite-notice",{class:f.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},c("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map((e=>this._renderItem(e)))}_renderItem(e){const{messages:t,visibleElements:i}=this,s=e.title||t.untitledFeature;return c("calcite-list-item",{class:i.itemIcons?f.listItemFeatureIcon:f.listItemFeature,closable:!!i.itemCloseActions,"data-item":e,key:e.key,label:s,name:s,onblur:this.removeTemporaryHighlight,onfocus:()=>this.addTemporaryHighlight(e),onpointerenter:()=>this.addTemporaryHighlight(e),onpointerleave:this.removeTemporaryHighlight,scale:this.scale,title:s,value:s,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)}},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return c("div",{class:f.listItemIcon,key:"content-start",slot:"content-start"},c("span",{afterCreate:this._afterItemCreateOrUpdate,afterRemoved:this._afterItemRemoved,afterUpdate:this._afterItemCreateOrUpdate,"data-has-icon":!1,"data-item":e,key:"icon"}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_getBaseCssClass(){switch(this.scale){case"s":return f.baseSmall;case"m":return f.baseMedium;default:return f.baseLarge}}};e([i()],b.prototype,"_list",void 0),e([i()],b.prototype,"displayMode",void 0),e([i()],b.prototype,"effectiveCount",null),e([i()],b.prototype,"effectiveSelectionManager",null),e([i()],b.prototype,"featureTitleMap",null),e([i()],b.prototype,"icon",null),e([i()],b.prototype,"isUpdating",null),e([i()],b.prototype,"label",null),e([i()],b.prototype,"layerItems",null),e([i()],b.prototype,"layerViewMap",null),e([i()],b.prototype,"maxVisibleFeatureCountExceeded",null),e([i()],b.prototype,"maxVisibleFeatureCountPerLayer",null),e([i()],b.prototype,"menuScale",void 0),e([i(),a("esri/widgets/support/SelectionList/t9n/SelectionList")],b.prototype,"messages",void 0),e([i(),a("esri/t9n/common")],b.prototype,"messagesCommon",void 0),e([i()],b.prototype,"scale",void 0),e([i()],b.prototype,"selectionManager",null),e([i()],b.prototype,"selectionSources",null),e([i()],b.prototype,"selectionsByLayerMap",null),e([i()],b.prototype,"state",null),e([i()],b.prototype,"totalCount",null),e([i()],b.prototype,"view",null),e([i()],b.prototype,"viewLayersAndTables",null),e([i()],b.prototype,"viewModel",void 0),e([i({type:u,nonNullable:!0})],b.prototype,"visibleElements",void 0),b=e([s("esri.widgets.support.SelectionList")],b);const w=b;export{w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4587],{4341:(t,e,n)=>{n.d(e,{I:()=>o});var i=n(26390);class o{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*r);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,r));t++)this._items.push(this._allocator())}}const r=1024},11964:(t,e,n)=>{n.d(e,{Cr:()=>h,H6:()=>l,_I:()=>d,kb:()=>u,vt:()=>a});var i=n(34727),o=n(4341),r=n(38954),s=n(51850),c=n(32114);function a(t){return t?{origin:(0,s.o8)(t.origin),vector:(0,s.o8)(t.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function h(t,e,n=a()){return(0,r.c)(n.origin,t),(0,r.d)(n.vector,e,t),n}function u(t,e){const n=(0,r.d)(c.rq.get(),e,t.origin),o=(0,r.f)(t.vector,n),s=(0,r.f)(t.vector,t.vector),a=(0,i.qE)(o/s,0,1),h=(0,r.d)(c.rq.get(),(0,r.h)(c.rq.get(),t.vector,a),n);return(0,r.f)(h,h)}function d(t,e,n){return l(t,e,0,1,n)}function l(t,e,n,o,s){const{vector:a,origin:h}=t,u=(0,r.d)(c.rq.get(),e,h),d=(0,r.f)(a,u)/(0,r.k)(a);return(0,r.h)(s,a,(0,i.qE)(d,n,o)),(0,r.g)(s,s,t.origin)}(0,s.vt)(),(0,s.vt)(),new o.I((()=>a()))},24587:(t,e,n)=>{n.r(e),n.d(e,{default:()=>it});var i,o,r,s=n(90237),c=n(74887),a=(n(53966),n(44208),n(87811),n(49186),n(40608)),h=n(38954),u=n(51850),d=n(11964),l=n(97937),f=n(93687),_=n(3694),m=n(4341),g=(n(58083),n(87317),n(91829)),T=n(71351);function p(t){return t?{ray:(0,T.vt)(t.ray),c0:t.c0,c1:t.c1}:{ray:(0,T.vt)(),c0:0,c1:Number.MAX_VALUE}}function O(t,e){for(let n=0;n<b;n++){const i=t[n];if(i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]>=e[3])return!1}return!0}new m.I((()=>p())),n(240),n(32114),(r=i||(i={}))[r.LEFT=0]="LEFT",r[r.RIGHT=1]="RIGHT",r[r.BOTTOM=2]="BOTTOM",r[r.TOP=3]="TOP",r[r.NEAR=4]="NEAR",r[r.FAR=5]="FAR",function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(o||(o={})),o.FAR_BOTTOM_RIGHT,o.NEAR_BOTTOM_RIGHT,o.NEAR_BOTTOM_LEFT,o.FAR_BOTTOM_LEFT,o.NEAR_BOTTOM_LEFT,o.NEAR_BOTTOM_RIGHT,o.NEAR_TOP_RIGHT,o.NEAR_TOP_LEFT,o.FAR_BOTTOM_RIGHT,o.FAR_BOTTOM_LEFT,o.FAR_TOP_LEFT,o.FAR_TOP_RIGHT,o.NEAR_BOTTOM_RIGHT,o.FAR_BOTTOM_RIGHT,o.FAR_TOP_RIGHT,o.NEAR_TOP_RIGHT,o.FAR_BOTTOM_LEFT,o.NEAR_BOTTOM_LEFT,o.NEAR_TOP_LEFT,o.FAR_TOP_LEFT,o.FAR_TOP_LEFT,o.NEAR_TOP_LEFT,o.NEAR_TOP_RIGHT,o.FAR_TOP_RIGHT;const b=6;(0,g.fA)(-1,-1,-1,1),(0,g.fA)(1,-1,-1,1),(0,g.fA)(1,1,-1,1),(0,g.fA)(-1,1,-1,1),(0,g.fA)(-1,-1,1,1),(0,g.fA)(1,-1,1,1),(0,g.fA)(1,1,1,1),(0,g.fA)(-1,1,1,1),new m.I(p),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)();var A,R,v=n(620);class M{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new E,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),E.clearPool(),D[0]=null,J.prune(),$.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=E.acquire();for(let i=0;i<e;i++){const e=t[i];this._isDegenerate(e)?this._degenerateObjects.add(e):(n.init(this._root),this._add(e,n))}E.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=E.acquire();for(const i of t){const t=e??(0,l.e)(this.objectToBoundingSphere(i),W);w(t[3])?(n.init(this._root),x(i,t,n)):this._degenerateObjects.delete(i)}E.release(n),this._shrink()}update(t,e){if(!w(e[3])&&this._isDegenerate(t))return;const n=function(t){return D[0]=t,D}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const i=(0,T.LV)(t,e);S(this._root,(t=>{if(!function(t,e){return I((0,l.a)(e.bounds),2*-e.halfSize,V),I((0,l.a)(e.bounds),2*e.halfSize,K),(0,v.O_)(t.origin,t.direction,V,K)}(i,t))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObject(i,t)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObject(i,t)&&n(t)})),!0}))}forEachAlongRayWithVerticalOffset(t,e,n,i){const o=(0,T.LV)(t,e);S(this._root,(t=>{if(!function(t,e,n){return I((0,l.a)(e.bounds),2*-e.halfSize,V),I((0,l.a)(e.bounds),2*e.halfSize,K),n.applyToMinMax(V,K),(0,v.O_)(t.origin,t.direction,V,K)}(o,t,i))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObjectWithOffset(o,t,i)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObjectWithOffset(o,t,i)&&n(t)})),!0}))}forEach(t){S(this._root,(e=>{const n=e.node;return n.terminals.forAll(t),null!==n.residents&&n.residents.forAll(t),!0})),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,i=()=>!0,o=1/0){let r=1/0,s=1/0,c=null;const a=C(t,e),u=a=>{if(--o,!i(a))return;const h=this.objectToBoundingSphere(a);if(!O(n,h))return;const u=z(t,e,(0,l.a)(h)),d=u-h[3],f=u+h[3];d<r&&(r=d,s=f,c=a)};return F(this._root,(i=>{if(o<=0||!O(n,i.bounds))return!1;if((0,h.h)(k,a,i.halfSize),(0,h.g)(k,k,(0,l.a)(i.bounds)),z(t,e,k)>s)return!1;const r=i.node;return r.terminals.forAll((t=>u(t))),null!==r.residents&&r.residents.forAll((t=>u(t))),!0}),t,e),c}forEachInDepthRange(t,e,n,i,o,r,s){let c=-1/0,a=1/0;const u={setRange:t=>{n===M.DepthOrder.FRONT_TO_BACK?(c=Math.max(c,t.near),a=Math.min(a,t.far)):(c=Math.max(c,-t.far),a=Math.min(a,-t.near))}};u.setRange(i);const d=z(e,n,t),f=C(e,n),_=C(e,-n),m=t=>{if(!s(t))return;const i=this.objectToBoundingSphere(t),h=(0,l.a)(i),f=z(e,n,h)-d,_=f-i[3],m=f+i[3];_>a||m<c||!O(r,i)||o(t,u)};F(this._root,(t=>{if(!O(r,t.bounds))return!1;if((0,h.h)(k,f,t.halfSize),(0,h.g)(k,k,(0,l.a)(t.bounds)),z(e,n,k)-d>a)return!1;if((0,h.h)(k,_,t.halfSize),(0,h.g)(k,k,(0,l.a)(t.bounds)),z(e,n,k)-d<c)return!1;const i=t.node;return i.terminals.forAll((t=>m(t))),null!==i.residents&&i.residents.forAll((t=>m(t))),!0}),e,n)}forEachNode(t){S(this._root,(e=>t(e.node,e.bounds,e.halfSize,e.depth)))}forEachNeighbor(t,e){const n=(0,l.g)(e),i=(0,l.a)(e),o=e=>{const o=this.objectToBoundingSphere(e),r=(0,l.g)(o),s=n+r;return!((0,h.s)((0,l.a)(o),i)-s*s<=0)||t(e)};let r=!0;const s=t=>{r&&(r=o(t))};S(this._root,(t=>{const e=(0,l.g)(t.bounds),o=n+e;if((0,h.s)((0,l.a)(t.bounds),i)-o*o>0)return!1;const c=t.node;return c.terminals.forAll(s),r&&null!==c.residents&&c.residents.forAll(s),r})),r&&this.forEachDegenerateObject(s)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||(0,l.i)(n,t)}_intersectsObjectWithOffset(t,e,n){const i=this.objectToBoundingSphere(e);return!(i[3]>0)||(0,l.i)(n.applyToBoundingSphere(i),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){const e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){const i=E.acquire().init(t);this._add(e.at(n),i),E.release(i)}}_grow(t,e){if(0!==e&&(L(t,e,(t=>this.objectToBoundingSphere(t)),X),w(X[3])&&!this._fitsInsideTree(X)))if(j(this._root.node))(0,l.e)(X,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(X);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(X,t):this._growRootAsSubNode(t),E.release(t)}}_rebuildTree(t,e){(0,h.c)((0,l.a)(Y),(0,l.a)(e.bounds)),Y[3]=e.halfSize,L([t,Y],2,(t=>t),Z);const n=E.acquire().init(this._root);this._root.initFrom(null,Z,Z[3]),this._root.increaseHalfSize(1.25),S(n,(t=>(this.add(t.node.terminals.data,t.node.terminals.length),null!==t.node.residents&&this.add(t.node.residents.data,t.node.residents.length),!0))),E.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return S(this._root,(t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth))),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let i=-1/0;const o=this._root.bounds,r=this._root.halfSize;for(let t=0;t<3;t++){const s=o[t]-r-(n[t]-e),c=n[t]+e-(o[t]+r),a=Math.max(0,Math.ceil(s/(2*r))),h=Math.max(0,Math.ceil(c/(2*r)))+1,u=2**Math.ceil(Math.log(a+h)*Math.LOG2E);i=Math.max(i,u),U[t].min=a,U[t].max=h}for(let t=0;t<3;t++){let e=U[t].min,n=U[t].max;const s=(i-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);const c=o[t]-r-e*r*2;G[t]=c+(n+e)*r}const s=i*r;return G[3]=s*y,E.acquire().initFrom(null,G,s,0)}_growRootAsSubNode(t){const e=this._root.node;(0,h.c)((0,l.a)(X),(0,l.a)(this._root.bounds)),X[3]=this._root.halfSize,this._root.init(t),t.advanceTo(X,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,i=0;for(;i<e.length&&null==t;)n=i++,t=e[n];for(;i<e.length;)if(e[i++])return-1;return n}_isDegenerate(t){return!w(this.objectToBoundingSphere(t)[3])}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t[3]<=n&&t[0]>=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,i=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:i}}}_nodeToJSON(t){const e=t.children.map((t=>t?this._nodeToJSON(t):null)),n=t.residents?.map((t=>this.objectToBoundingSphere(t))),i=t.terminals?.map((t=>this.objectToBoundingSphere(t)));return{children:e,residents:n,terminals:i}}static fromJSON(t){const e=new M((t=>t),{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class E{constructor(){this.bounds=(0,l.c)(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,i=this.depth){return this.node=null!=t?t:E.createEmptyNode(),e&&(0,l.e)(e,this.bounds),this.halfSize=n,this.depth=i,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*y}advance(t){let e=this.node.children[t];e||(e=E.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=q[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const i=this._childIndex(t);e&&e(this,i),this.advance(i)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]<t[0]?1:0)+(e[1]<t[1]?2:0)+(e[2]<t[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new _.A({shrink:!0}),residents:new _.A({shrink:!0})}}static{this._pool=new f.A(E)}static acquire(){return E._pool.acquire()}static release(t){E._pool.release(t)}static clearPool(){E._pool.prune()}}function S(t,e){let n=E.acquire().init(t);const i=[n];for(;0!==i.length;){if(n=i.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++)n.node.children[t]&&i.push(E.acquire().init(n).advance(t));E.release(n)}}function F(t,e,n,i=M.DepthOrder.FRONT_TO_BACK){let o=E.acquire().init(t);const r=[o];for(function(t,e,n){if(!$.length)for(let t=0;t<8;++t)$.push({index:0,distance:0});for(let n=0;n<8;++n){const i=q[n];$.data[n].index=n,$.data[n].distance=z(t,e,i)}$.sort(((t,e)=>t.distance-e.distance));for(let t=0;t<8;++t)n[t]=$.data[t].index}(n,i,Q);0!==r.length;){if(o=r.pop(),e(o)&&!o.isLeaf())for(let t=7;t>=0;--t){const e=Q[t];o.node.children[e]&&r.push(E.acquire().init(o).advance(e))}E.release(o)}}function x(t,e,n){J.clear();const i=n.advanceTo(e,((t,e)=>{J.push(t.node),J.push(e)}))?n.node.terminals:n.node.residents;if(i.removeUnordered(t),0===i.length)for(let t=J.length-2;t>=0&&N(J.data[t],J.data[t+1]);t-=2);}function N(t,e){return e>=0&&(t.children[e]=null),!!j(t)&&(null===t.residents&&(t.residents=new _.A({shrink:!0})),!0)}function j(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}function P(t,e){t[0]=Math.min(t[0],e[0]-e[3]),t[1]=Math.min(t[1],e[1]-e[3]),t[2]=Math.min(t[2],e[2]-e[3])}function B(t,e){t[0]=Math.max(t[0],e[0]+e[3]),t[1]=Math.max(t[1],e[1]+e[3]),t[2]=Math.max(t[2],e[2]+e[3])}function I(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function L(t,e,n,i){if(1===e){const e=n(t[0]);(0,l.e)(e,i)}else{V[0]=1/0,V[1]=1/0,V[2]=1/0,K[0]=-1/0,K[1]=-1/0,K[2]=-1/0;for(let i=0;i<e;i++){const e=n(t[i]);w(e[3])&&(P(V,e),B(K,e))}(0,h.m)((0,l.a)(i),V,K,.5),i[3]=Math.max(K[0]-V[0],K[1]-V[1],K[2]-V[2])/2}}function C(t,e){let n,i=1/0;for(let o=0;o<8;++o){const r=z(t,e,H[o]);r<i&&(i=r,n=H[o])}return n}function z(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function w(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}(R=(A=M).DepthOrder||(A.DepthOrder={}))[R.FRONT_TO_BACK=1]="FRONT_TO_BACK",R[R.BACK_TO_FRONT=-1]="BACK_TO_FRONT";const q=[(0,u.fA)(-1,-1,-1),(0,u.fA)(1,-1,-1),(0,u.fA)(-1,1,-1),(0,u.fA)(1,1,-1),(0,u.fA)(-1,-1,1),(0,u.fA)(1,-1,1),(0,u.fA)(-1,1,1),(0,u.fA)(1,1,1)],H=[(0,u.fA)(-1,-1,-1),(0,u.fA)(-1,-1,1),(0,u.fA)(-1,1,-1),(0,u.fA)(-1,1,1),(0,u.fA)(1,-1,-1),(0,u.fA)(1,-1,1),(0,u.fA)(1,1,-1),(0,u.fA)(1,1,1)],y=Math.sqrt(3),D=[null],G=(0,l.c)(),k=(0,u.vt)(),V=(0,u.vt)(),K=(0,u.vt)(),J=new _.A,W=(0,l.c)(),X=(0,l.c)(),Y=(0,l.c)(),Z=(0,l.c)(),U=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],$=new _.A,Q=[0,0,0,0,0,0,0,0];var tt=n(431);function et(t,e,n){const i=(0,l.c)(),o=(0,l.a)(i);return(0,h.b)(o,o,t,.5),(0,h.b)(o,o,e,.5),i[3]=(0,h.j)(o,t),(0,h.g)(o,o,n),i}let nt=class{constructor(){this._idToComponent=new Map,this._components=new M((t=>t.bounds)),this._edges=new M((t=>t.bounds)),this._tmpLineSegment=(0,d.vt)(),this._tmpP1=(0,u.vt)(),this._tmpP2=(0,u.vt)(),this._tmpP3=(0,u.vt)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,c.Te)(e),await this._ensureEdgeLocations(t,e);const n=[];return this._edges.forEachNeighbor((e=>(this._addCandidates(t,e,n),n.length<1e3)),t.bounds),{result:{candidates:n}}}async _ensureEdgeLocations(t,e){const n=[];if(this._components.forEachNeighbor((t=>{if(null==t.info){const{id:e,uid:i}=t;n.push({id:e,uid:i})}return!0}),t.bounds),!n.length)return;const i={components:n},o=await this.remoteClient.invoke("fetchAllEdgeLocations",i,e??{});for(const t of o.components)this._setFetchEdgeLocations(t)}async add(t){const e=new rt(t.id,t.bounds);return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){const e=this._idToComponent.get(t.id);if(e){const t=[];this._edges.forEachNeighbor((n=>(n.component===e&&t.push(n),!0)),e.bounds),this._edges.remove(t),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){const e=this._idToComponent.get(t.id);if(null==e||t.uid!==e.uid)return;const n=tt.HY.createView(t.locations),i=new Array(n.count),o=(0,u.vt)(),r=(0,u.vt)();for(let s=0;s<n.count;s++){n.position0.getVec(s,o),n.position1.getVec(s,r);const c=et(o,r,t.origin),a=new st(e,s,c);i[s]=a}this._edges.add(i);const{objectIds:s,origin:c}=t;e.info={locations:n,objectIds:s,origin:c}}_addCandidates(t,e,n){const{info:i}=e.component,{origin:o,objectIds:r}=i,s=i.locations,c=s.position0.getVec(e.index,this._tmpP1),a=s.position1.getVec(e.index,this._tmpP2);(0,h.g)(c,c,o),(0,h.g)(a,a,o);const u=r[s.componentIndex.get(e.index)];this._addEdgeCandidate(t,u,c,a,n),ot(t,u,c,n),ot(t,u,a,n)}_addEdgeCandidate(t,e,n,i,o){if(!t.returnEdge)return;const r=(0,l.a)(t.bounds),s=(0,d.Cr)(n,i,this._tmpLineSegment),c=(0,d._I)(s,r,this._tmpP3);(0,l.o)(t.bounds,c)&&o.push({type:"edge",objectId:e,target:(0,u.o8)(c),distance:(0,h.j)(r,c),start:(0,u.o8)(n),end:(0,u.o8)(i)})}};nt=(0,s._)([(0,a.$)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],nt);const it=nt;function ot(t,e,n,i){if(!t.returnVertex||!(0,l.o)(t.bounds,n))return;const o=(0,l.a)(t.bounds);i.push({type:"vertex",objectId:e,target:(0,u.o8)(n),distance:(0,h.j)(o,n)})}class rt{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=++rt.uid}static{this.uid=0}}class st{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}},71351:(t,e,n)=>{n.d(e,{Cr:()=>d,LV:()=>u,kb:()=>l,oC:()=>f,vt:()=>a}),n(4576);var i=n(4341),o=(n(77690),n(29242)),r=n(38954),s=n(51850),c=n(32114);function a(t){return t?h((0,s.o8)(t.origin),(0,s.o8)(t.direction)):h((0,s.vt)(),(0,s.vt)())}function h(t,e){return{origin:t,direction:e}}function u(t,e){const n=_.get();return n.origin=t,n.direction=e,n}function d(t,e,n=a()){return(0,r.c)(n.origin,t),(0,r.d)(n.direction,e,t),n}function l(t,e){const n=(0,r.e)(c.rq.get(),(0,r.n)(c.rq.get(),t.direction),(0,r.d)(c.rq.get(),e,t.origin));return(0,r.f)(n,n)}function f(t,e,n){const i=(0,r.f)(t.direction,(0,r.d)(n,e,t.origin));return(0,r.g)(n,t.origin,(0,r.h)(n,t.direction,i)),n}const _=new i.I((()=>a()));(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,o.vt)()},88582:(t,e,n)=>{var i;n.d(e,{_:()=>i}),function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"}(i||(i={}))},97937:(t,e,n)=>{n.d(e,{a:()=>A,c:()=>g,e:()=>O,f:()=>R,g:()=>b,i:()=>F,o:()=>L,s:()=>w}),n(44208),n(53966);var i=n(34727),o=n(58083),r=n(38954),s=n(51850),c=n(87317),a=n(91829),h=n(34304),u=n(88582),d=n(71351);function l(t,e){const n=(0,r.l)(t),o=(0,i.YN)(t[2]/n),s=Math.atan2(t[1]/n,t[0]/n);return(0,r.i)(e,n,o,s),e}var f=n(44280),_=n(32114);const m=g();function g(){return(0,a.vt)()}const T=c.e,p=c.e;function O(t,e){return(0,c.c)(e,t)}function b(t){return t[3]}function A(t){return t}function R(t,e,n,i){return(0,a.fA)(t,e,n,i)}function v(t,e,n){if(null==e)return!1;if(!E(t,e,M))return!1;let{t0:i,t1:o}=M;if((i<0||o<i&&o>0)&&(i=o),i<0)return!1;if(n){const{origin:t,direction:o}=e;n[0]=t[0]+o[0]*i,n[1]=t[1]+o[1]*i,n[2]=t[2]+o[2]*i}return!0}const M={t0:0,t1:0};function E(t,e,n){const{origin:i,direction:o}=e,r=S;r[0]=i[0]-t[0],r[1]=i[1]-t[1],r[2]=i[2]-t[2];const s=o[0]*o[0]+o[1]*o[1]+o[2]*o[2];if(0===s)return!1;const c=2*(o[0]*r[0]+o[1]*r[1]+o[2]*r[2]),a=c*c-4*s*(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]-t[3]*t[3]);if(a<0)return!1;const h=Math.sqrt(a);return n.t0=(-c-h)/(2*s),n.t1=(-c+h)/(2*s),!0}const S=(0,s.vt)();function F(t,e){return v(t,e,null)}function x(t,e,n){const i=_.rq.get(),s=_.Rc.get();(0,r.e)(i,e.origin,e.direction);const c=b(t);(0,r.e)(n,i,e.origin),(0,r.h)(n,n,1/(0,r.l)(n)*c);const a=j(t,e.origin),h=(0,f.g7)(e.origin,n);return(0,o.$0)(s,h+a,i),(0,r.t)(n,n,s),n}function N(t,e,n){const i=(0,r.d)(_.rq.get(),e,t),o=(0,r.h)(_.rq.get(),i,t[3]/(0,r.l)(i));return(0,r.g)(n,o,t)}function j(t,e){const n=(0,r.d)(_.rq.get(),e,t),o=(0,r.l)(n),s=b(t),c=s+Math.abs(s-o);return(0,i.XM)(s/c)}const P=(0,s.vt)();function B(t,e,n,i){const o=(0,r.d)(P,e,t);switch(n){case u._.X:{const t=l(o,P)[2];return(0,r.i)(i,-Math.sin(t),Math.cos(t),0)}case u._.Y:{const t=l(o,P),e=t[1],n=t[2],s=Math.sin(e);return(0,r.i)(i,-s*Math.cos(n),-s*Math.sin(n),Math.cos(e))}case u._.Z:return(0,r.n)(i,o);default:return}}function I(t,e){const n=(0,r.d)(C,e,t);return(0,r.l)(n)-t[3]}function L(t,e){const n=(0,r.s)(t,e),i=b(t);return n<=i*i}const C=(0,s.vt)(),z=g(),w=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:m,altitudeAt:I,angleToSilhouette:j,axisAt:B,cameraFrustumCoverage:function(t,e,n,i){const o=b(t),r=o*o,s=e+.5*Math.PI,c=n*n+r-2*Math.cos(s)*n*o,a=Math.sqrt(c),h=c-r;if(h<=0)return.5;const u=Math.sqrt(h),d=Math.acos(u/a)-Math.asin(o/(a/Math.sin(s)));return Math.min(1,(d+.5*i)/i)},clear:function(t){t[0]=t[1]=t[2]=t[3]=0},closestPoint:function(t,e,n){return v(t,e,n)?n:((0,d.oC)(e,t,n),N(t,n,n))},closestPointOnSilhouette:x,containsPoint:L,copy:O,create:g,distanceToSilhouette:function(t,e){const n=(0,r.d)(_.rq.get(),e,t),i=(0,r.k)(n),o=t[3]*t[3];return Math.sqrt(Math.abs(i-o))},elevate:function(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n},equals:p,exactEquals:T,fromCenterAndRadius:function(t,e){return(0,a.fA)(t[0],t[1],t[2],e)},fromRadius:function(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t},fromValues:R,getCenter:A,getExtent:function(t,e){return e},getRadius:b,intersectLine:function(t,e,n){const i=(0,d.Cr)(e,n);if(!E(t,i,M))return[];const{origin:o,direction:c}=i,{t0:a,t1:u}=M,l=e=>{const n=(0,s.vt)();return(0,r.b)(n,o,c,e),N(t,n,n)};return Math.abs(a-u)<(0,h.FD)()?[l(a)]:[l(a),l(u)]},intersectRay:v,intersectRayClosestSilhouette:function(t,e,n){if(v(t,e,n))return n;const i=x(t,e,_.rq.get());return(0,r.g)(n,e.origin,(0,r.h)(_.rq.get(),e.direction,(0,r.j)(e.origin,i)/(0,r.l)(e.direction))),n},intersectsRay:F,projectPoint:N,setAltitudeAt:function(t,e,n,i){const o=I(t,e),s=B(t,e,u._.Z,C),c=(0,r.h)(C,s,n-o);return(0,r.g)(i,e,c)},setExtent:function(t,e,n){return t!==n&&O(t,n),n},tmpSphere:z,union:function(t,e,n=(0,a.vt)()){const i=(0,r.j)(t,e),o=t[3],s=e[3];return i+s<o?((0,c.c)(n,t),n):i+o<s?((0,c.c)(n,e),n):((0,r.m)(n,t,e,(i+s-o)/(2*i)),n[3]=(i+o+s)/2,n)},wrap:function(t){return t}},Symbol.toStringTag,{value:"Module"}))}}]);
|