@arcgis/core 5.1.0-next.89 → 5.1.0-next.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/arcade/arcadeAsyncRuntime.js +1 -1
  2. package/arcade/arcadeCompiler.js +1 -1
  3. package/arcade/arcadeRuntime.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/014a5fad55f97b9b5166.js +1 -0
  6. package/assets/esri/core/workers/chunks/{9d10db72e342fe63c981.js → 36f6673b23579b88d8f7.js} +1 -1
  7. package/assets/esri/core/workers/chunks/53ef72edc3ed80bf558c.js +1 -0
  8. package/assets/esri/core/workers/chunks/{456d269e3982c437010a.js → 71cfab6305f275cfb04e.js} +1 -1
  9. package/assets/esri/core/workers/chunks/740588250eaffb7301fd.js +1 -0
  10. package/assets/esri/core/workers/chunks/{7160e3e7340beb7fdb42.js → bea170f08f5261e22d29.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{d5ad036d282df54b9ddc.js → f971dcfd04af1fd652b4.js} +1 -1
  12. package/chunks/array.js +1 -1
  13. package/config.js +1 -1
  14. package/core/workers/workerFactory.js +1 -1
  15. package/kernel.js +1 -1
  16. package/layers/graphics/featureConversionUtils.js +1 -1
  17. package/package.json +1 -1
  18. package/support/revision.js +1 -1
  19. package/symbols/cim/placements/PlacementAtMeasuredUnits.js +1 -1
  20. package/views/2d/FrameTask.js +1 -1
  21. package/views/2d/LabelManager.js +1 -1
  22. package/views/2d/engine/DisplayObject.js +1 -1
  23. package/views/2d/engine/Stage.js +1 -1
  24. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  25. package/views/2d/input/MapViewInputManager.js +1 -1
  26. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  27. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  28. package/views/2d/layers/LayerView2D.js +1 -1
  29. package/views/2d/layers/MediaLayerView2D.js +1 -1
  30. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  31. package/views/2d/layers/features/FeatureContainer.js +1 -1
  32. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  33. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  34. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  35. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  36. package/views/2d/layers/support/UpdateTracking2D.js +1 -1
  37. package/views/VideoView.js +1 -1
  38. package/views/View2D.js +1 -1
  39. package/views/support/waitForResources.js +1 -1
  40. package/assets/esri/core/workers/chunks/0e3dcf99382478181366.js +0 -1
  41. package/assets/esri/core/workers/chunks/48acd146bf0241d87647.js +0 -1
  42. package/assets/esri/core/workers/chunks/e0fcb5fa0e9f21fde2b6.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../core/Error.js";import e from"../../core/Logger.js";import{assertIsSome as n}from"../../core/maybe.js";import{is as r,fromRectValues as o}from"../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../geometry/support/aaBoundingRect.js";import{isPoint as u,isPolygon as c,isPolyline as i,isMultipoint as l,isGeometryWithZ as a,isGeometryWithM as f}from"../../geometry/support/jsonTypeUtils.js";import{OptimizedFeature as h}from"./OptimizedFeature.js";import d from"./OptimizedFeatureSet.js";import m from"./OptimizedGeometry.js";import{createFeatureId as g}from"./data/createFeatureId.js";const y=()=>e.getLogger("esri.layers.graphics.featureConversionUtils"),p={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0};function I({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function M({scale:t,translate:e},n){return Math.round((e[1]-n)/t[1])}function b({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function w({scale:t,translate:e},n){return Math.round((n-e[1])/t[1])}function G(t,e){return T(t,e,0)}function N(t,e){return T(t,-e,1)}function T({scale:t,translate:e},n,r){return n*t[r]+e[r]}function P(t,e,n){return e&&(t.hasZ=!0),n&&(t.hasM=!0),t}function Z(t,e,n,r){if(e&&r&&t!==n)return(e,n,r,o)=>{r[o++]=e[n++],r[o++]=e[n++],t?n++:r[o++]=0,r[o++]=e[n++]??0};const o=2+(n?1:0)+(r?1:0),s=o-((!t&&n?1:0)+(!e&&r?1:0));return(t,e,n,r)=>{for(let u=0;u<o;++u)n[r++]=u<s?t[e++]??0:0}}function F(t,e,n){if(!t)return null;const{coords:r,hasZ:o,hasM:s}=t,[u,c]=r,i=o?r[2]:0,l=s?r[2+(o?1:0)]:0;return{x:u,y:c,z:e?i:void 0,m:n?l:void 0}}function x(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:F(o,n,r)});return t}function E(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,i=a(e),l=f(e);t.push(new h(e?j(e,n&&i,r&&l):null,u,c?j(c,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function j(t,e=a(t),n=f(t)){const{x:r,y:o,z:s,m:u}=t,c=[r,o];return e&&c.push(s??0),n&&c.push(u??0),new m([],c,e,n)}function v(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&k(o,n,r),attributes:s});return t}function k(t,e,n){if(null==t)return null;const{coords:r,stride:o,hasZ:s,hasM:u}=t,c=Z(s,u,e,n),i=[];for(let l=0;l<r.length;l+=o){const t=[];c(r,l,t,0),i.push(t)}return P({points:i},e,n)}function V(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u}=s,c=a(e),i=f(e);t.push(new h(e?Y(e,n&&c,r&&i):null,u,null,g(s,o),s.displayId,s.distance))}return t}function Y(t,e=a(t),n=f(t)){const{points:r,hasZ:o,hasM:s}=t,u=new m([r.length],[],e,n),{coords:c,stride:i}=u;let l=0;const h=Z(o??!1,s??!1,e,n);for(const a of r)h(a,0,c,l),l+=i;return u}function _(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&L(o,n,r),attributes:s});return t}function L(t,e,n){if(!t)return null;const{coords:r,lengths:o,stride:s,hasZ:u,hasM:c}=t;let i=0;const l=Z(u,c,e,n),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(r,i,e,0),i+=s,t.push(e)}a.push(t)}return P({paths:a},e,n)}function O(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,i=a(e),l=f(e);t.push(new h(e?S(e,n&&i,r&&l):null,u,c?j(c,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function S(t,e=a(t),n=f(t)){const{paths:r,hasZ:o,hasM:s}=t,u=Z(o??!1,s??!1,e,n),c=new m([],[],e,n),{lengths:i,coords:l,stride:h}=c;let d=0;for(const a of r){for(const t of a)u(t,0,l,d),d+=h;i.push(a.length)}return c}function U(t,e,n,r){for(const{geometry:o,attributes:s,centroid:u}of e){const e=z(o,n,r),c=F(u,!1,!1);t.push(u?{geometry:e,attributes:s,centroid:c}:{geometry:e,attributes:s})}return t}function z(t,e,n){if(!t)return null;const{coords:r,lengths:o,stride:s,hasZ:u,hasM:c}=t;let i=0;const l=Z(u,c,e,n),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(r,i,e,0),i+=s,t.push(e)}a.push(t)}return P({rings:a},e,n)}function R(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:c}=s,i=a(e),l=f(e);t.push(new h(e?A(e,n&&i,r&&l):null,u,c?j(c,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function A(t,e=a(t),n=f(t)){const{rings:r,hasZ:o,hasM:s}=t,u=new m([],[],e,n),{lengths:c,coords:i,stride:l}=u;let h=0;const d=Z(o??!1,s??!1,e,n);for(const a of r){for(const t of a)d(t,0,i,h),h+=l;c.push(a.length)}return u}const $=[],q=[];function B(t,e,n,r,o){$[0]=t;const[s]=C(q,$,e,n,r,o);return mt($),mt(q),s}function C(e,n,r,o,s,u){if(mt(e),!r){for(const t of n){const n=g(t,u);e.push(new h(null,t.attributes,null,n))}return e}switch(r){case"esriGeometryPoint":return E(e,n,o,s,u);case"esriGeometryMultipoint":return V(e,n,o,s,u);case"esriGeometryPolyline":return O(e,n,o,s,u);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return R(e,n,o,s,u);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`)),mt(e)}return e}function D(t,e,n,r){q[0]=t,Q($,q,e,n,r);const o=$[0];return mt($),mt(q),o}function H(e,n=a(e),r=f(e)){return null==e?null:u(e)?j(e,n,r):c(e)?A(e,n,r):i(e)?S(e,n,r):l(e)?Y(e,n,r):void y().error("convertFromGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${e}'`))}function J(e,n,r,o){if(null==e)return null;const s="coords"in e?e:e.geometry;if(null==s)return null;switch(n){case"esriGeometryPoint":return F(s,r,o);case"esriGeometryMultipoint":return k(s,r,o);case"esriGeometryPolyline":return L(s,r,o);case"esriGeometryPolygon":return z(s,r,o);default:return y().error("convertToGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`)),null}}function K(t,e){for(const n of e)t.push({attributes:n.attributes});return t}function Q(e,n,r,o,s){if(mt(e),null==r)return K(e,n);switch(r){case"esriGeometryPoint":return x(e,n,o,s);case"esriGeometryMultipoint":return v(e,n,o,s);case"esriGeometryPolyline":return _(e,n,o,s);case"esriGeometryPolygon":return U(e,n,o,s);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`))}return e}function W(t){const{spatialReference:e,transform:n,fields:r,hasM:o,hasZ:s,features:u,geometryType:c,exceededTransferLimit:i,queryGeometry:l,queryGeometryType:a}=t,f={features:Q([],u,c,s,o),fields:r,geometryType:c,spatialReference:e,queryGeometry:J(l,a,s,o)};return n&&(f.transform=n),i&&(f.exceededTransferLimit=i),o&&(f.hasM=o),s&&(f.hasZ=s),f}function X(t,e){const n=new d,{hasM:r,hasZ:o,features:s,spatialReference:u,geometryType:c,exceededTransferLimit:i,transform:l,fields:a,globalIdFieldName:f}=t;return a&&(n.fields=a),n.geometryType=c??null,n.spatialReference=u??null,s&&C(n.features,s,c,o,r,e),i&&(n.exceededTransferLimit=i),r&&(n.hasM=r),o&&(n.hasZ=o),l&&(n.transform=l),f&&(n.globalIdFieldName=f),n}function tt(t){const{transform:e,features:n}=t;if(!e)return t;for(const r of n)null!=r.geometry&&it(r.geometry,e),null!=r.centroid&&it(r.centroid,e);return t.transform=null,t}function et(t,e){const{geometryType:n,features:r}=e;if(!t)return e;for(let o=0;o<r.length;o++){const e=r[o],s=e.weakClone();s.geometry=nt(e.geometry,n,t),s.centroid=nt(e.centroid,"esriGeometryPoint",t),r[o]=s}return e.transform=t,e}function nt(t,e,n,r,o){if(null==t)return null;if(!t?.coords.length)return null;const s=p[e],{coords:u,lengths:c,stride:i,hasZ:l,hasM:a}=t;r??=l,o??=a;const f=new m([],[],r,o),h=f.stride,d=Z(l,a,r,o);let g=0;const y=[0,0,0,0].slice(h);function b(){d(u,g,y,0),g+=i,y[0]=I(n,y[0]),y[1]=M(n,y[1])}if(t.isPoint)return b(),f.coords.push(...y),f;let w=0;for(const m of c){if(m<s)continue;let t=1;b(),f.coords.push(...y);let[e,n]=y;for(let r=1;r<m;r++){b();const[r,o]=y;e===r&&n===o||(y[0]-=e,y[1]-=n,f.coords.push(...y),e=r,n=o,t++)}t>=s?(f.lengths.push(t),w=f.coords.length):mt(f.coords,w)}return mt(f.coords,w),f.coords.length?f:null}function rt(t,e,n,r=t.hasZ,o=t.hasM){if(!t.coords.length)return null;const s=p[e],{coords:u,lengths:c,stride:i,hasZ:l,hasM:a}=t,f=new m([],[],r,o),h=f.stride,d=Z(l,a,r,o);if(t.isPoint)return d(u,0,f.coords,0),f;let g=0;const y=n*n;for(const m of c){if(m<s){g+=m*i;continue}const t=f.coords.length/h,e=g,n=g+(m-1)*i;d(u,e,f.coords,f.coords.length),st(f.coords,u,i,y,d,e,n),d(u,n,f.coords,f.coords.length);const r=f.coords.length/h-t;r>=s?f.lengths.push(r):mt(f.coords,t*h),g+=m*i}return f.coords.length?f:null}function ot(t,e,n,r){const o=t[e],s=t[e+1],u=t[n],c=t[n+1],i=t[r],l=t[r+1];let a=u,f=c,h=i-a,d=l-f;if(0!==h||0!==d){const t=((o-a)*h+(s-f)*d)/(h*h+d*d);t>1?(a=i,f=l):t>0&&(a+=h*t,f+=d*t)}return h=o-a,d=s-f,h*h+d*d}function st(t,e,n,r,o,s,u){let c,i=r,l=0;for(let a=s+n;a<u;a+=n)c=ot(e,a,s,u),c>i&&(l=a,i=c);i>r&&(l-s>n&&st(t,e,n,r,o,s,l),o(e,l,t,t.length),u-l>n&&st(t,e,n,r,o,l,u))}function ut(t,e){if(!e?.coords?.length)return null;let n=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const{coords:l,stride:a}=e;for(let r=0;r<l.length;r+=a){const t=l[r],e=l[r+1];n=Math.min(n,t),c=Math.max(c,t),u=Math.min(u,e),i=Math.max(i,e)}return r(t)?o(t,n,u,c,i):s(n,u,c,i,t),t}function ct(t,e){const{lengths:n,coords:r,stride:o}=e;let s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY,l=0;for(const a of n){let t=r[l],e=r[l+1];s=Math.min(t,s),u=Math.min(e,u),c=Math.max(t,c),i=Math.max(e,i),l+=o;for(let n=1;n<a;n++,l+=o){const n=r[l],o=r[l+1];t+=n,e+=o,n<0&&(s=Math.min(s,t)),n>0&&(c=Math.max(c,t)),o<0?u=Math.min(u,e):o>0&&(i=Math.max(i,e))}}return t[0]=s,t[1]=u,t[2]=c,t[3]=i,t}function it(t,e){const{coords:r,lengths:o,stride:s,hasZ:u,hasM:c}=t;if(!r.length)return void(o.length=0);n(e);const{originPosition:i,scale:l,translate:a}=e,f=gt;f.originPosition=i;const h=f.scale;h[0]=l[0]??1,h[1]=-(l[1]??1),h[2]=l[2]??1,h[3]=l[3]??1;const d=f.translate;if(d[0]=a[0]??0,d[1]=a[1]??0,d[2]=a[2]??0,d[3]=a[3]??0,c&&!u&&(h[2]=h[3],d[2]=d[3]),!o.length){for(let t=0;t<s;++t)r[t]=T(f,r[t],t);return void(o.length=0)}let m=0;for(let n=0;n<o.length;n++){const t=o[n];o[n]=t;for(let n=0;n<s;++n)r[m+n]=T(f,r[m+n],n);let e=r[m],u=r[m+1];m+=s;for(let n=1;n<t;n++,m+=s){e+=r[m]*h[0],u+=r[m+1]*h[1],r[m]=e,r[m+1]=u;for(let t=2;t<s;++t)r[m+t]=T(f,r[m+t],t)}}}function lt(t,e){if(!t?.coords?.length)return null;const n=p[e],{coords:r,lengths:o,stride:s,hasZ:u,hasM:c}=t,i=Z(u,c,u,c),l=new m([],[],u,c);let a=0,f=0,h=0,d=0;for(const m of o){f=d,i(r,a,l.coords,f),a+=s,f+=s;let t=r[a],e=r[a+1];for(let n=1;n<m;n++){const o=r[a+s],u=r[a+s+1];t*u-e*o===0&&n!==m-1||(i(r,a,l.coords,f),l.coords[f]=t,l.coords[f+1]=e,f+=s,t=e=0),t+=o,e+=u,a+=s}const o=(f-d)/s;o>=n&&(l.lengths[h]=o,d=f,h++)}return l.coords.length>d&&(l.coords.length=d),l.lengths.length>h&&(l.lengths.length=h),l.coords.length&&l.lengths.length?l:null}function at(t,e,n,r){let o=0,s=t[r*e],u=t[r*(e+1)];for(let c=1;c<n;c++){const n=s+t[r*(e+c)],i=u+t[r*(e+c)+1],l=(n-s)*(i+u);s=n,u=i,o+=l}return.5*o}function ft(t,e){const{coords:n,lengths:r}=t;let o=0,s=0;for(let u=0;u<r.length;u++){const t=r[u];s+=at(n,o,t,e),o+=t}return Math.abs(s)}function ht(t,e,n,r){return 0===t*r-n*e&&t*n+e*r>0}function dt(t,e,n){const{stride:r}=t;if(t.isPoint){if(t.coords.length<2)return null;const[n,r]=t.coords,o=b(e,n),s=w(e,r);return new m([],[o,s])}const o=new m([],[0,0]),s=p[n],u="esriGeometryPolygon"===n||"esriGeometryPolyline"===n;let c=0,i=0;for(let l=0;l<t.lengths.length;l++){const n=t.lengths[l],a=i;let f=b(e,t.coords[r*c]),h=w(e,t.coords[r*c+1]);o.coords[i++]=f,o.coords[i++]=h;let d=0,m=0,g=1;for(let s=1;s<n;s++){const n=b(e,t.coords[r*(s+c)]),l=w(e,t.coords[r*(s+c)+1]);if(n!==f||l!==h){const t=n-f,e=l-h;u&&ht(d,m,t,e)?(o.coords[i-2]+=t,o.coords[i-1]+=e,f+=t,h+=e):(o.coords[i++]=n,o.coords[i++]=l,f=n,h=l,d=t,m=e,g+=1)}}g<s?i=a:o.lengths.push(g),c+=n}return 0===o.lengths.length?null:o}function mt(t,e=0){t.length!==e&&(t.length=e)}const gt={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]};export{B as convertFromFeature,X as convertFromFeatureSet,C as convertFromFeatures,H as convertFromGeometry,Y as convertFromMultipoint,V as convertFromMultipointFeatures,j as convertFromPoint,E as convertFromPointFeatures,A as convertFromPolygon,S as convertFromPolyline,O as convertFromPolylineFeatures,D as convertToFeature,W as convertToFeatureSet,Q as convertToFeatures,J as convertToGeometry,k as convertToMultipoint,v as convertToMultipointFeatures,F as convertToPoint,z as convertToPolygon,L as convertToPolyline,rt as generalizeOptimizedGeometry,ut as getBoundsOptimizedGeometry,ft as getQuantizedArea,ct as getQuantizedBoundsOptimizedGeometry,at as getSignedQuantizedRingArea,dt as quantizeForDisplay,et as quantizeOptimizedFeatureSet,nt as quantizeOptimizedGeometry,I as quantizeX,M as quantizeY,lt as removeCollinearVertices,tt as unquantizeOptimizedFeatureSetInPlace,it as unquantizeOptimizedGeometryInPlace,T as unquantizeValue,G as unquantizeX,N as unquantizeY};
2
+ import t from"../../core/Error.js";import e from"../../core/Logger.js";import{assertIsSome as r}from"../../core/maybe.js";import{is as n,fromRectValues as o}from"../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../geometry/support/aaBoundingRect.js";import{isPoint as u,isPolygon as i,isPolyline as c,isMultipoint as l,isGeometryWithZ as a,isGeometryWithM as f}from"../../geometry/support/jsonTypeUtils.js";import{OptimizedFeature as h}from"./OptimizedFeature.js";import m from"./OptimizedFeatureSet.js";import d from"./OptimizedGeometry.js";import{createFeatureId as g}from"./data/createFeatureId.js";const y=()=>e.getLogger("esri.layers.graphics.featureConversionUtils"),p={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0};function I({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function M({scale:t,translate:e},r){return Math.round((e[1]-r)/t[1])}function b({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function w({scale:t,translate:e},r){return Math.round((r-e[1])/t[1])}function G(t,e){return T(t,e,0)}function N(t,e){return T(t,-e,1)}function T({scale:t,translate:e},r,n){return r*t[n]+e[n]}function P(t,e,r){return e&&(t.hasZ=!0),r&&(t.hasM=!0),t}function Z(t,e,r,n){if(e&&n&&t!==r)return(e,r,n,o)=>{n[o++]=e[r++],n[o++]=e[r++],t?r++:n[o++]=0,n[o++]=e[r++]??0};const o=2+(r?1:0)+(n?1:0),s=o-((!t&&r?1:0)+(!e&&n?1:0));return(t,e,r,n)=>{for(let u=0;u<o;++u)r[n++]=u<s?t[e++]??0:0}}function F(t,e,r){if(!t)return null;const{coords:n,hasZ:o,hasM:s}=t,[u,i]=n,c=o?n[2]:0,l=s?n[2+(o?1:0)]:0;return{x:u,y:i,z:e?c:void 0,m:r?l:void 0}}function x(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:F(o,r,n)});return t}function E(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?j(e,r&&c,n&&l):null,u,i?j(i,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function j(t,e=a(t),r=f(t)){const{x:n,y:o,z:s,m:u}=t,i=[n,o];return e&&i.push(s??0),r&&i.push(u??0),new d([],i,e,r)}function v(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&k(o,r,n),attributes:s});return t}function k(t,e,r){if(null==t)return null;const{coords:n,stride:o,hasZ:s,hasM:u}=t,i=Z(s,u,e,r),c=[];for(let l=0;l<n.length;l+=o){const t=[];i(n,l,t,0),c.push(t)}return P({points:c},e,r)}function V(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u}=s,i=a(e),c=f(e);t.push(new h(e?Y(e,r&&i,n&&c):null,u,null,g(s,o),s.displayId,s.distance))}return t}function Y(t,e=a(t),r=f(t)){const{points:n,hasZ:o,hasM:s}=t,u=new d([n.length],[],e,r),{coords:i,stride:c}=u;let l=0;const h=Z(o??!1,s??!1,e,r);for(const a of n)h(a,0,i,l),l+=c;return u}function _(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&L(o,r,n),attributes:s});return t}function L(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:u,hasM:i}=t;let c=0;const l=Z(u,i,e,r),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(n,c,e,0),c+=s,t.push(e)}a.push(t)}return P({paths:a},e,r)}function O(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?S(e,r&&c,n&&l):null,u,i?j(i,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function S(t,e=a(t),r=f(t)){const{paths:n,hasZ:o,hasM:s}=t,u=Z(o??!1,s??!1,e,r),i=new d([],[],e,r),{lengths:c,coords:l,stride:h}=i;let m=0;for(const a of n){for(const t of a)u(t,0,l,m),m+=h;c.push(a.length)}return i}function U(t,e,r,n){for(const{geometry:o,attributes:s,centroid:u}of e){const e=z(o,r,n),i=F(u,!1,!1);t.push(u?{geometry:e,attributes:s,centroid:i}:{geometry:e,attributes:s})}return t}function z(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:u,hasM:i}=t;let c=0;const l=Z(u,i,e,r),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(n,c,e,0),c+=s,t.push(e)}a.push(t)}return P({rings:a},e,r)}function R(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?A(e,r&&c,n&&l):null,u,i?j(i,!1,!1):null,g(s,o),s.displayId,s.distance))}return t}function A(t,e=a(t),r=f(t)){const{rings:n,hasZ:o,hasM:s}=t,u=new d([],[],e,r),{lengths:i,coords:c,stride:l}=u;let h=0;const m=Z(o??!1,s??!1,e,r);for(const a of n){for(const t of a)m(t,0,c,h),h+=l;i.push(a.length)}return u}const $=[],q=[];function B(t,e,r,n,o){$[0]=t;const[s]=C(q,$,e,r,n,o);return ht($),ht(q),s}function C(e,r,n,o,s,u){if(ht(e),!n){for(const t of r){const r=g(t,u);e.push(new h(null,t.attributes,null,r))}return e}switch(n){case"esriGeometryPoint":return E(e,r,o,s,u);case"esriGeometryMultipoint":return V(e,r,o,s,u);case"esriGeometryPolyline":return O(e,r,o,s,u);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return R(e,r,o,s,u);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`)),ht(e)}return e}function D(t,e,r,n){q[0]=t,Q($,q,e,r,n);const o=$[0];return ht($),ht(q),o}function H(e,r=a(e),n=f(e)){return null==e?null:u(e)?j(e,r,n):i(e)?A(e,r,n):c(e)?S(e,r,n):l(e)?Y(e,r,n):void y().error("convertFromGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${e}'`))}function J(e,r,n,o){if(null==e)return null;const s="coords"in e?e:e.geometry;if(null==s)return null;switch(r){case"esriGeometryPoint":return F(s,n,o);case"esriGeometryMultipoint":return k(s,n,o);case"esriGeometryPolyline":return L(s,n,o);case"esriGeometryPolygon":return z(s,n,o);default:return y().error("convertToGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`)),null}}function K(t,e){for(const r of e)t.push({attributes:r.attributes});return t}function Q(e,r,n,o,s){if(ht(e),null==n)return K(e,r);switch(n){case"esriGeometryPoint":return x(e,r,o,s);case"esriGeometryMultipoint":return v(e,r,o,s);case"esriGeometryPolyline":return _(e,r,o,s);case"esriGeometryPolygon":return U(e,r,o,s);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`))}return e}function W(t){const{spatialReference:e,transform:r,fields:n,hasM:o,hasZ:s,features:u,geometryType:i,exceededTransferLimit:c,queryGeometry:l,queryGeometryType:a}=t,f={features:Q([],u,i,s,o),fields:n,geometryType:i,spatialReference:e,queryGeometry:J(l,a,s,o)};return r&&(f.transform=r),c&&(f.exceededTransferLimit=c),o&&(f.hasM=o),s&&(f.hasZ=s),f}function X(t,e){const r=new m,{hasM:n,hasZ:o,features:s,spatialReference:u,geometryType:i,exceededTransferLimit:c,transform:l,fields:a,globalIdFieldName:f}=t;return a&&(r.fields=a),r.geometryType=i??null,r.spatialReference=u??null,s&&C(r.features,s,i,o,n,e),c&&(r.exceededTransferLimit=c),n&&(r.hasM=n),o&&(r.hasZ=o),l&&(r.transform=l),f&&(r.globalIdFieldName=f),r}function tt(t){const{transform:e,features:r}=t;if(!e)return t;for(const n of r)null!=n.geometry&&ct(n.geometry,e),null!=n.centroid&&ct(n.centroid,e);return t.transform=null,t}function et(t,e){const{geometryType:r,features:n}=e;if(!t)return e;for(let o=0;o<n.length;o++){const e=n[o],s=e.weakClone();s.geometry=rt(e.geometry,r,t),s.centroid=rt(e.centroid,"esriGeometryPoint",t),n[o]=s}return e.transform=t,e}function rt(t,e,r,n,o,s=!1){if(null==t)return null;if(!t?.coords.length)return null;const u=p[e],{coords:i,lengths:c,stride:l,hasZ:a,hasM:f}=t;n??=a,o??=f;const h=new d([],[],n,o),m=h.stride,g=Z(a,f,n,o);let y=0;const G=[0,0,0,0].slice(m),N=s?b:I,T=s?w:M;function P(){g(i,y,G,0),y+=l,G[0]=N(r,G[0]),G[1]=T(r,G[1])}if(t.isPoint)return P(),h.coords.push(...G),h;let F=0;for(const d of c){if(d<u)continue;let t=1;P(),h.coords.push(...G);let[e,r]=G;for(let n=1;n<d;n++){P();const[n,o]=G;e===n&&r===o||(s||(G[0]-=e,G[1]-=r),h.coords.push(...G),e=n,r=o,t++)}t>=u?(h.lengths.push(t),F=h.coords.length):ht(h.coords,F)}return ht(h.coords,F),h.coords.length?h:null}function nt(t,e,r,n=t.hasZ,o=t.hasM){if(!t.coords.length)return null;const s=p[e],{coords:u,lengths:i,stride:c,hasZ:l,hasM:a}=t,f=new d([],[],n,o),h=f.stride,m=Z(l,a,n,o);if(t.isPoint)return m(u,0,f.coords,0),f;let g=0;const y=r*r;for(const d of i){if(d<s){g+=d*c;continue}const t=f.coords.length/h,e=g,r=g+(d-1)*c;m(u,e,f.coords,f.coords.length),st(f.coords,u,c,y,m,e,r),m(u,r,f.coords,f.coords.length);const n=f.coords.length/h-t;n>=s?f.lengths.push(n):ht(f.coords,t*h),g+=d*c}return f.coords.length?f:null}function ot(t,e,r,n){const o=t[e],s=t[e+1],u=t[r],i=t[r+1],c=t[n],l=t[n+1];let a=u,f=i,h=c-a,m=l-f;if(0!==h||0!==m){const t=((o-a)*h+(s-f)*m)/(h*h+m*m);t>1?(a=c,f=l):t>0&&(a+=h*t,f+=m*t)}return h=o-a,m=s-f,h*h+m*m}function st(t,e,r,n,o,s,u){let i,c=n,l=0;for(let a=s+r;a<u;a+=r)i=ot(e,a,s,u),i>c&&(l=a,c=i);c>n&&(l-s>r&&st(t,e,r,n,o,s,l),o(e,l,t,t.length),u-l>r&&st(t,e,r,n,o,l,u))}function ut(t,e){if(!e?.coords?.length)return null;let r=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const{coords:l,stride:a}=e;for(let n=0;n<l.length;n+=a){const t=l[n],e=l[n+1];r=Math.min(r,t),i=Math.max(i,t),u=Math.min(u,e),c=Math.max(c,e)}return n(t)?o(t,r,u,i,c):s(r,u,i,c,t),t}function it(t,e){const{lengths:r,coords:n,stride:o}=e;let s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=0;for(const a of r){let t=n[l],e=n[l+1];s=Math.min(t,s),u=Math.min(e,u),i=Math.max(t,i),c=Math.max(e,c),l+=o;for(let r=1;r<a;r++,l+=o){const r=n[l],o=n[l+1];t+=r,e+=o,r<0&&(s=Math.min(s,t)),r>0&&(i=Math.max(i,t)),o<0?u=Math.min(u,e):o>0&&(c=Math.max(c,e))}}return t[0]=s,t[1]=u,t[2]=i,t[3]=c,t}function ct(t,e){const{coords:n,lengths:o,stride:s,hasZ:u,hasM:i}=t;if(!n.length)return void(o.length=0);r(e);const{originPosition:c,scale:l,translate:a}=e,f=mt;f.originPosition=c;const h=f.scale;h[0]=l[0]??1,h[1]=-(l[1]??1),h[2]=l[2]??1,h[3]=l[3]??1;const m=f.translate;if(m[0]=a[0]??0,m[1]=a[1]??0,m[2]=a[2]??0,m[3]=a[3]??0,i&&!u&&(h[2]=h[3],m[2]=m[3]),!o.length){for(let t=0;t<s;++t)n[t]=T(f,n[t],t);return void(o.length=0)}let d=0;for(let r=0;r<o.length;r++){const t=o[r];o[r]=t;for(let r=0;r<s;++r)n[d+r]=T(f,n[d+r],r);let e=n[d],u=n[d+1];d+=s;for(let r=1;r<t;r++,d+=s){e+=n[d]*h[0],u+=n[d+1]*h[1],n[d]=e,n[d+1]=u;for(let t=2;t<s;++t)n[d+t]=T(f,n[d+t],t)}}}function lt(t,e){if(!t?.coords?.length)return null;const r=p[e],{coords:n,lengths:o,stride:s,hasZ:u,hasM:i}=t,c=Z(u,i,u,i),l=new d([],[],u,i);let a=0,f=0,h=0,m=0;for(const d of o){f=m,c(n,a,l.coords,f),a+=s,f+=s;let t=n[a],e=n[a+1];for(let r=1;r<d;r++){const o=n[a+s],u=n[a+s+1];t*u-e*o===0&&r!==d-1||(c(n,a,l.coords,f),l.coords[f]=t,l.coords[f+1]=e,f+=s,t=e=0),t+=o,e+=u,a+=s}const o=(f-m)/s;o>=r&&(l.lengths[h]=o,m=f,h++)}return l.coords.length>m&&(l.coords.length=m),l.lengths.length>h&&(l.lengths.length=h),l.coords.length&&l.lengths.length?l:null}function at(t,e,r,n){let o=0,s=t[n*e],u=t[n*(e+1)];for(let i=1;i<r;i++){const r=s+t[n*(e+i)],c=u+t[n*(e+i)+1],l=(r-s)*(c+u);s=r,u=c,o+=l}return.5*o}function ft(t,e){const{coords:r,lengths:n}=t;let o=0,s=0;for(let u=0;u<n.length;u++){const t=n[u];s+=at(r,o,t,e),o+=t}return Math.abs(s)}function ht(t,e=0){t.length!==e&&(t.length=e)}const mt={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]};export{B as convertFromFeature,X as convertFromFeatureSet,C as convertFromFeatures,H as convertFromGeometry,Y as convertFromMultipoint,V as convertFromMultipointFeatures,j as convertFromPoint,E as convertFromPointFeatures,A as convertFromPolygon,S as convertFromPolyline,O as convertFromPolylineFeatures,D as convertToFeature,W as convertToFeatureSet,Q as convertToFeatures,J as convertToGeometry,k as convertToMultipoint,v as convertToMultipointFeatures,F as convertToPoint,z as convertToPolygon,L as convertToPolyline,nt as generalizeOptimizedGeometry,ut as getBoundsOptimizedGeometry,ft as getQuantizedArea,it as getQuantizedBoundsOptimizedGeometry,at as getSignedQuantizedRingArea,et as quantizeOptimizedFeatureSet,rt as quantizeOptimizedGeometry,I as quantizeX,M as quantizeY,lt as removeCollinearVertices,tt as unquantizeOptimizedFeatureSetInPlace,ct as unquantizeOptimizedGeometryInPlace,T as unquantizeValue,G as unquantizeX,N as unquantizeY};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.89",
3
+ "version": "5.1.0-next.90",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const c="20260501",e="953ffe7a6665912cc6de0820a64c7a5e03d29b73";export{c as buildDate,e as commitHash};
2
+ const a="20260502",c="0b3c3ea306c35915a9ba10d48fa21e315dc55a65";export{a as buildDate,c as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{PathTransformationCursor as t}from"../CIMCursor.js";import{lazyJsonConversion as s}from"../CIMEffects.js";import{GeometryWalker as i}from"../GeometryWalker.js";const e=2,h=.001;class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,s,i){return new a(t,s,i)}}class a extends t{constructor(t,s,e){super(t),this._segmentIterator=null,this._segCount=0,this._firstSeg=!0,this._seg=null,this._ms=[],this._from=0,this._to=0,this._pt=null,this._walker=new i,this._walker.updateTolerance(e),this._placePerPart=s.placePerPart??!1,this._angleToLine=s.angleToLine??!1,this._keepUpright=s.keepUpright??!1,this._offset=(s.offset??0)*e,this._interval=(s.interval??0)*e,this._interval<=0&&(this._interval=10*h),this._skipRate=s.skipMarkerRate??0,this._skipRate<=1&&(this._skipRate=0),this._placeAtExtremities=s.placeAtExtremities??!1}processPath(t){if(!this.iteratePath){const{fromGeometry:i}=s.module,e=i(t.getCurrentPath().asJSON()).getGeometry(),h=e.getPathStart(0);this._segmentIterator=e.querySegmentIteratorAtVertex(h),this._segCount=e.getSegmentCountPath(0),this._firstSeg=!0,this.iteratePath=!0,this._pt=e.getXY(0).clone()}for(;0===this._ms.length&&this._segmentIterator?.hasNextSegment();){--this._segCount,this._seg=this._segmentIterator.nextSegment(),this._from=this._seg.getStartAttributeAsDbl(e,0),this._to=this._seg.getEndAttributeAsDbl(e,0);const s=!isNaN(this._from),i=!isNaN(this._to);s&&(this._from=Math.round(this._from/h)*h,Math.abs(this._from)<h&&(this._from=0)),i&&(this._to=Math.round(this._to/h)*h,Math.abs(this._to)<h&&(this._to=0));let r=s?Math.floor(this._from/this._interval):0,a=i?Math.floor(this._to/this._interval):0;if(s&&(this._placeAtExtremities||!this._firstSeg||!this._placePerPart&&t.pathIndex>0)&&Math.abs(r*this._interval-this._from)<h&&(!this._skipRate||r%this._skipRate)&&this._ms.push(this._from),this._firstSeg=!1,s&&i&&!(Math.abs(this._from-this._to)<h))if(this._from<=this._to){r*this._interval<this._from+h&&++r,a*this._interval>this._to-h&&--a;for(let t=r;t<=a;++t)(!this._skipRate||t%this._skipRate)&&this._ms.push(t*this._interval)}else{r*this._interval>this._from-h&&--r,a*this._interval<this._to+h&&++a;for(let t=a;t<=r;++t)(!this._skipRate||t%this._skipRate)&&this._ms.push(t*this._interval)}}let i=0;if(0===this._ms.length){if(this.iteratePath=!1,!this._segCount&&this._placeAtExtremities&&!isNaN(this._to)&&(this._placePerPart||t.pathIndex===t.totalSize-1)){const t=Math.floor(this._to/this._interval);Math.abs(t*this._interval-this._to)<h&&(!this._skipRate||t%this._skipRate)&&(this._ms.push(this._to),i=1)}if(0===this._ms.length)return null}const r=this._ms.pop(),a=isNaN(this._from)||isNaN(this._to)||Math.abs(this._from-this._to)<h?i:(r-this._from)/(this._to-this._from);this._seg.queryCoord2D(a,this._pt);const _=this._seg.getTangent(a),{x:o,y:n}=_.normalize();return this.internalPlacement.setTranslate(this._pt.x-this._offset*n,this._pt.y+this._offset*o),this._angleToLine&&this.internalPlacement.setRotateCS(o,n),this.internalPlacement.setMeasure(r),this.internalPlacement}}export{r as PlacementAtMeasuredUnits};
2
+ import{PathTransformationCursor as t}from"../CIMCursor.js";import{lazyJsonConversion as s}from"../CIMEffects.js";import{GeometryWalker as i}from"../GeometryWalker.js";const e=2,h=.001;class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,s,i){return new a(t,s,i)}}class a extends t{constructor(t,s,e){super(t),this._segmentIterator=null,this._segCount=0,this._firstSeg=!0,this._seg=null,this._ms=[],this._from=0,this._to=0,this._pt=null,this._walker=new i,this._walker.updateTolerance(e),this._placePerPart=s.placePerPart??!1,this._angleToLine=s.angleToLine??!1,this._keepUpright=s.keepUpright??!1,this._offset=(s.offset??0)*e,this._interval=s.interval??0,this._interval<=0&&(this._interval=10*h),this._skipRate=s.skipMarkerRate??0,this._skipRate<=1&&(this._skipRate=0),this._placeAtExtremities=s.placeAtExtremities??!1}processPath(t){if(!this.iteratePath){const{fromGeometry:i}=s.module,e=i(t.getCurrentPath().asJSON()).getGeometry(),h=e.getPathStart(0);this._segmentIterator=e.querySegmentIteratorAtVertex(h),this._segCount=e.getSegmentCountPath(0),this._firstSeg=!0,this.iteratePath=!0,this._pt=e.getXY(0).clone()}for(;0===this._ms.length&&this._segmentIterator?.hasNextSegment();){--this._segCount,this._seg=this._segmentIterator.nextSegment(),this._from=this._seg.getStartAttributeAsDbl(e,0),this._to=this._seg.getEndAttributeAsDbl(e,0);const s=!isNaN(this._from),i=!isNaN(this._to);s&&(this._from=Math.round(this._from/h)*h,Math.abs(this._from)<h&&(this._from=0)),i&&(this._to=Math.round(this._to/h)*h,Math.abs(this._to)<h&&(this._to=0));let r=s?Math.floor(this._from/this._interval):0,a=i?Math.floor(this._to/this._interval):0;if(s&&(this._placeAtExtremities||!this._firstSeg||!this._placePerPart&&t.pathIndex>0)&&Math.abs(r*this._interval-this._from)<h&&(!this._skipRate||r%this._skipRate)&&this._ms.push(this._from),this._firstSeg=!1,s&&i&&!(Math.abs(this._from-this._to)<h))if(this._from<=this._to){r*this._interval<this._from+h&&++r,a*this._interval>this._to-h&&--a;for(let t=r;t<=a;++t)(!this._skipRate||t%this._skipRate)&&this._ms.push(t*this._interval)}else{r*this._interval>this._from-h&&--r,a*this._interval<this._to+h&&++a;for(let t=a;t<=r;++t)(!this._skipRate||t%this._skipRate)&&this._ms.push(t*this._interval)}}let i=0;if(0===this._ms.length){if(this.iteratePath=!1,!this._segCount&&this._placeAtExtremities&&!isNaN(this._to)&&(this._placePerPart||t.pathIndex===t.totalSize-1)){const t=Math.floor(this._to/this._interval);Math.abs(t*this._interval-this._to)<h&&(!this._skipRate||t%this._skipRate)&&(this._ms.push(this._to),i=1)}if(0===this._ms.length)return null}const r=this._ms.pop(),a=isNaN(this._from)||isNaN(this._to)||Math.abs(this._from-this._to)<h?i:(r-this._from)/(this._to-this._from);this._seg.queryCoord2D(a,this._pt);const _=this._seg.getTangent(a);let{x:o,y:n}=_.normalize();return this.internalPlacement.setTranslate(this._pt.x-this._offset*n,this._pt.y+this._offset*o),this._angleToLine&&(this._keepUpright&&o<0&&(o=-o,n=-n),this.internalPlacement.setRotateCS(o,n)),this.internalPlacement.setMeasure(r),this.internalPlacement}}export{r as PlacementAtMeasuredUnits};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isPromiseLike as t}from"../../core/promiseUtils.js";import{when as e,watch as s}from"../../core/reactiveUtils.js";import{addFrameTask as a}from"../../core/scheduling.js";import i from"./PaddedViewState.js";import{newScheduler as r}from"../support/Scheduler.js";class h{constructor(s){this.view=s,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=r(),this._schedulerHandle=e(()=>this._scheduler.updating,()=>this.requestFrame()),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),null==this.view.animation?.target||t(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=t=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:e,graphicsView:s,state:{id:a}}=this.view;e?.forEach(this._updateLayerView,this),null!=s&&(s.lastUpdateId!==a&&(s.viewChange(),s.lastUpdateId=a),s.updateRequested&&s.processUpdate(this._updateParameters)),this.view.graphicsTileStore?.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=0:this.view.interacting?this._scheduler.state=1:this._scheduler.state=2;this._scheduler.frame(t)||this._updateRequested||2!==this._scheduler.state||this._frameTaskHandle?.pause()}}destroy(){this.stop(),this._schedulerHandle.remove(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new i,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=s(()=>t.stationary,t=>{this.stationary=t,this.requestFrame()}),this._frameTaskHandle=a(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,s=t.lastUpdateId;null!=s&&(this.stationary||t.moving)||(t.moving=!0),s!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}}export{h as default};
2
+ import{isPromiseLike as t}from"../../core/promiseUtils.js";import{when as e,watch as s}from"../../core/reactiveUtils.js";import{addFrameTask as a}from"../../core/scheduling.js";import{signal as i}from"../../core/signal.js";import r from"./PaddedViewState.js";import{newScheduler as d}from"../support/Scheduler.js";class h{constructor(s){this.view=s,this._updating=i(!1),this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=d(),this._schedulerHandle=e(()=>this._scheduler.updating,()=>this.requestFrame()),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),null==this.view.animation?.target||t(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=t=>{if(this._updateRequested=!1,this.view?.destroyed)return void(this._updating.value=!1);const{allLayerViews:e,graphicsView:s,state:{id:a}}=this.view;e?.forEach(this._updateLayerView,this),null!=s&&(s.lastUpdateId!==a&&(s.viewChange(),s.lastUpdateId=a),s.updateRequested&&s.processUpdate(this._updateParameters)),this.view.graphicsTileStore?.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=0:this.view.interacting?this._scheduler.state=1:this._scheduler.state=2;const i=this._scheduler.frame(t);this._updating.value=this._updateRequested,i||this._updateRequested||2!==this._scheduler.state||this._frameTaskHandle?.pause()}}destroy(){this.stop(),this._schedulerHandle.remove(),this._scheduler.destroy()}get scheduler(){return this._scheduler}get updating(){return this._updating.value}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new r,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=s(()=>t.stationary,t=>{this.stationary=t,this.requestUpdate()}),this._frameTaskHandle=a(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this._updating.value=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void(t.spatialReferenceSupported&&this.requestUpdate());const e=this.view.state,s=t.lastUpdateId;null!=s&&(this.stationary||t.moving)||(t.moving=!0),s!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}}export{h as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import has from"../../core/has.js";import{property as s,subclass as r}from"../../core/accessorSupport/decorators.js";import{SymbolFader as l}from"./engine/vectorTiles/decluttering/SymbolFader.js";import{tileSize as o}from"./engine/webgl/definitions.js";const i=8;class n{constructor(){this.styles=new Map,this.layerContexts=new Map}get cachedStyles(){return this.styles}setLabelClassStyle(e,t,s){this.layerContexts.set(e,t),this.styles.set(e,s)}clear(){this.layerContexts.clear(),this.styles.clear()}}let a=class extends t{constructor(e){super(e),this._styleRepository=new n,this.decluttering=!1,this.declutterRequested=!1,this.featuresTilingScheme=null;const t=(e,t)=>{};this.symbolFader=new l("feature-tile",this._styleRepository,t,[],o,i,()=>this.requestDeclutter())}get updating(){const e=this.decluttering||this.declutterRequested;return has("esri-2d-log-updating")&&console.log(`Updating LabelManager ${e}:\n-> declutterRequested: ${this.declutterRequested}\n-> decluttering: ${this.decluttering}`),e}requestDeclutter(){this.declutterRequested=!0}declutter(e,t){if(this.declutterRequested&&!this.decluttering&&(this._updateRepository(e),this.symbolFader.restartDeclutter(),this.decluttering=!0,this.declutterRequested=!1),this.decluttering){for(const s of this.symbolFader.tiles)s.setTransform(t);const e=this.symbolFader.update(this.featuresTilingScheme.scaleToZoom(t.scale),t);this.decluttering=!e}return this.decluttering}_updateRepository(e){this._styleRepository.clear(),this.symbolFader.tiles.length=0,this.symbolFader.symbolRepository?.flushFeatureTileUpdateMessages();for(const t of e)if(t.labelSchema){const e=this._getLabelSchemaStyles(t);if(!e.length)continue;for(const s of e){const e=c(s);this._styleRepository.setLabelClassStyle(s.labelClassId,t,e)}for(const s of t.tiles||[])s.decluttering&&this.symbolFader.tiles.push(s)}}_getLabelSchemaStyles(e){const t=e.labelSchema;if(!t)return[];switch(t.type){case"label":return t.classes;case"subtype":return Array.from(Object.values(t.renderers).flatMap(e=>e.classes));case"cluster":return[...t.cluster.classes,...t.feature.classes];case"track":return[...t.latestObservation.classes,...t.previousObservation.classes,...t.trackLine.classes]}}};function c(e){const t="esriGeometryPolyline"===e.geometryType?0:1,s="esriGeometryPolyline"===e.geometryType?0:1;return{geometryType:e.geometryType,iconAllowOverlap:!e.deconflictionEnabled,iconIgnorePlacement:!1,textAllowOverlap:!e.deconflictionEnabled,textIgnorePlacement:!1,iconRotationAlignment:t,textRotationAlignment:t,iconTranslateAnchor:s,iconTranslate:[0,0],textTranslateAnchor:s,textTranslate:[0,0]}}e([s()],a.prototype,"decluttering",void 0),e([s()],a.prototype,"declutterRequested",void 0),e([s()],a.prototype,"updating",null),e([s()],a.prototype,"featuresTilingScheme",void 0),a=e([r("esri.views.2d.LabelManager")],a);export{n as LabelClassStyleRepository,a as LabelManager};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import"../../core/has.js";import{property as s,subclass as r}from"../../core/accessorSupport/decorators.js";import{SymbolFader as l}from"./engine/vectorTiles/decluttering/SymbolFader.js";import{tileSize as o}from"./engine/webgl/definitions.js";const i=8;class n{constructor(){this.styles=new Map,this.layerContexts=new Map}get cachedStyles(){return this.styles}setLabelClassStyle(e,t,s){this.layerContexts.set(e,t),this.styles.set(e,s)}clear(){this.layerContexts.clear(),this.styles.clear()}}let a=class extends t{constructor(e){super(e),this._styleRepository=new n,this.decluttering=!1,this.declutterRequested=!1,this.featuresTilingScheme=null;const t=(e,t)=>{};this.symbolFader=new l("feature-tile",this._styleRepository,t,[],o,i,()=>this.requestDeclutter())}get updating(){return this.decluttering||this.declutterRequested}requestDeclutter(){this.declutterRequested=!0}declutter(e,t){if(this.declutterRequested&&!this.decluttering&&(this._updateRepository(e),this.symbolFader.restartDeclutter(),this.decluttering=!0,this.declutterRequested=!1),this.decluttering&&null!=this.featuresTilingScheme){for(const s of this.symbolFader.tiles)s.setTransform(t);const e=this.symbolFader.update(this.featuresTilingScheme.scaleToZoom(t.scale),t);this.decluttering=!e}return this.decluttering}_updateRepository(e){this._styleRepository.clear(),this.symbolFader.tiles.length=0,this.symbolFader.symbolRepository?.flushFeatureTileUpdateMessages();for(const t of e)if(t.labelSchema){const e=this._getLabelSchemaStyles(t);if(!e.length)continue;for(const s of e){const e=c(s);this._styleRepository.setLabelClassStyle(s.labelClassId,t,e)}for(const s of t.tiles||[])s.decluttering&&this.symbolFader.tiles.push(s)}}_getLabelSchemaStyles(e){const t=e.labelSchema;if(!t)return[];switch(t.type){case"label":return t.classes;case"subtype":return Array.from(Object.values(t.renderers).flatMap(e=>e.classes));case"cluster":return[...t.cluster.classes,...t.feature.classes];case"track":return[...t.latestObservation.classes,...t.previousObservation.classes,...t.trackLine.classes]}}};function c(e){const t="esriGeometryPolyline"===e.geometryType?0:1,s="esriGeometryPolyline"===e.geometryType?0:1;return{geometryType:e.geometryType,iconAllowOverlap:!e.deconflictionEnabled,iconIgnorePlacement:!1,textAllowOverlap:!e.deconflictionEnabled,textIgnorePlacement:!1,iconRotationAlignment:t,textRotationAlignment:t,iconTranslateAnchor:s,iconTranslate:[0,0],textTranslateAnchor:s,textTranslate:[0,0]}}e([s()],a.prototype,"decluttering",void 0),e([s()],a.prototype,"declutterRequested",void 0),e([s()],a.prototype,"updating",null),e([s()],a.prototype,"featuresTilingScheme",void 0),a=e([r("esri.views.2d.LabelManager")],a);export{n as LabelClassStyleRepository,a as LabelManager};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{remove as t}from"../../../core/arrayUtils.js";import{Evented as i}from"../../../core/Evented.js";import{FadeTransition as s}from"./transitions/FadeTransition.js";class e extends i{constructor(){super(...arguments),this._transitionables=null,this._clips=[],this._fadeTransition=null,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get computedOpacity(){return this._fadeTransition?.computedOpacity??this.opacity}get clips(){return this._clips}set clips(t){this._clips=t,this.requestRender()}get effectiveVisible(){return this.visible&&!0===this.parent?.effectiveVisible}get fadeTransitionEnabled(){return null!==this._fadeTransition}set fadeTransitionEnabled(t){!this._fadeTransition&&t?(this._fadeTransition=new s({opacity:this.opacity,visible:this.visible}),this.addTransitionable(this._fadeTransition)):this._fadeTransition&&!t&&(this.removeTransitionable(this._fadeTransition),this._fadeTransition=null)}get inFadeTransition(){return this._fadeTransition?.transitioning??!1}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(t){this._opacity!==t&&(this._opacity=Math.min(1,Math.max(t,0)),this._fadeTransition&&(this._fadeTransition.opacity=this._opacity),this.requestRender())}get stage(){return this._stage}set stage(t){if(this._stage===t)return;const i=this._stage;this._stage=t,t?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i?.trashDisplayObject(this)}get transforms(){return null==this._transforms&&(this._transforms=this._createTransforms()),this._transforms}get transitioning(){return this.isTransitioning()}get usedMemory(){return 0}get visible(){return this._visible}set visible(t){this._visible!==t&&(this._visible=t,this._fadeTransition&&(this._fadeTransition.visible=this._visible),this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}addTransitionable(t){this._transitionables??=[],this._transitionables.push(t),this.requestRender()}removeTransitionable(i){i.endTransition(),this._transitionables&&t(this._transitionables,i),this.requestRender()}fadeIn(){this.fadeTransitionEnabled=!0;const t=this._fadeTransition.fadeIn();return this.opacity=1,this.requestRender(),t}fadeOut(){this.fadeTransitionEnabled=!0;const t=this._fadeTransition.fadeOut();return this.opacity=0,this.requestRender(),t}endTransitions(){if(this._transitionables){for(const t of this._transitionables)t.endTransition();this.requestRender()}}beforeRender(t){this.transitionStep(t.deltaTime,t.state.scale),this.setTransform(t.state)}afterRender(t){this.transitioning&&this.requestRender()}remove(){this.parent?.removeChild(this)}setTransform(t){}processRender(t){this.stage&&(this._fadeTransition?.computedVisible??this.visible)&&this.doRender(t)}requestRender(){this.stage&&this.stage.requestRender()}requestDeclutter(){this.stage&&this.stage.requestDeclutter()}processDetach(){this.endTransitions(),this.onDetach(),this.emit("detach")}isTransitioning(){return this._transitionables?.some(t=>t.transitioning)??!1}transitionStep(t,i){if(this._transitionables)for(const s of this._transitionables)s.transitionStep(t,i)}onAttach(){}onDetach(){}doRender(t){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}export{e as DisplayObject};
2
+ import{remove as t}from"../../../core/arrayUtils.js";import{Evented as i}from"../../../core/Evented.js";import{signal as s}from"../../../core/signal.js";import{FadeTransition as e}from"./transitions/FadeTransition.js";class n extends i{constructor(){super(...arguments),this._transitionables=null,this._clips=[],this._fadeTransition=null,this._isReady=s(!1),this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get computedOpacity(){return this._fadeTransition?.computedOpacity??this.opacity}get clips(){return this._clips}set clips(t){this._clips=t,this.requestRender()}get effectiveVisible(){return this.visible&&!0===this.parent?.effectiveVisible}get fadeTransitionEnabled(){return null!==this._fadeTransition}set fadeTransitionEnabled(t){!this._fadeTransition&&t?(this._fadeTransition=new e({opacity:this.opacity,visible:this.visible}),this.addTransitionable(this._fadeTransition)):this._fadeTransition&&!t&&(this.removeTransitionable(this._fadeTransition),this._fadeTransition=null)}get inFadeTransition(){return this._fadeTransition?.transitioning??!1}get isReady(){return this._isReady.value}get opacity(){return this._opacity}set opacity(t){this._opacity!==t&&(this._opacity=Math.min(1,Math.max(t,0)),this._fadeTransition&&(this._fadeTransition.opacity=this._opacity),this.requestRender())}get stage(){return this._stage}set stage(t){if(this._stage===t)return;const i=this._stage;this._stage=t,t?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i?.trashDisplayObject(this)}get transforms(){return null==this._transforms&&(this._transforms=this._createTransforms()),this._transforms}get transitioning(){return this.isTransitioning()}get usedMemory(){return 0}get visible(){return this._visible}set visible(t){this._visible!==t&&(this._visible=t,this._fadeTransition&&(this._fadeTransition.visible=this._visible),this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}addTransitionable(t){this._transitionables??=[],this._transitionables.push(t),this.requestRender()}removeTransitionable(i){i.endTransition(),this._transitionables&&t(this._transitionables,i),this.requestRender()}fadeIn(){this.fadeTransitionEnabled=!0;const t=this._fadeTransition.fadeIn();return this.opacity=1,this.requestRender(),t}fadeOut(){this.fadeTransitionEnabled=!0;const t=this._fadeTransition.fadeOut();return this.opacity=0,this.requestRender(),t}endTransitions(){if(this._transitionables){for(const t of this._transitionables)t.endTransition();this.requestRender()}}beforeRender(t){this.transitionStep(t.deltaTime,t.state.scale),this.setTransform(t.state)}afterRender(t){this.transitioning&&this.requestRender()}remove(){this.parent?.removeChild(this)}setTransform(t){}processRender(t){this.stage&&(this._fadeTransition?.computedVisible??this.visible)&&this.doRender(t)}requestRender(){this.stage&&this.stage.requestRender()}requestDeclutter(){this.stage&&this.stage.requestDeclutter()}processDetach(){this.endTransitions(),this.onDetach(),this.emit("detach")}isTransitioning(){return this._transitionables?.some(t=>t.transitioning)??!1}transitionStep(t,i){if(this._transitionables)for(const s of this._transitionables)s.transitionStep(t,i)}onAttach(){}onDetach(){}doRender(t){}ready(){this._isReady.value||(this._isReady.value=!0,this.emit("isReady"),this.requestRender())}}export{n as DisplayObject};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as r}from"../../../core/maybe.js";import{addFrameTask as s}from"../../../core/scheduling.js";import{signal as i}from"../../../core/signal.js";import{property as a}from"../../../core/accessorSupport/decorators.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as o}from"../../../symbols/cim/cimAnalyzer.js";import{LabelManager as h}from"../LabelManager.js";import{Container as d}from"./Container.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as l}from"./webgl/definitions.js";import m from"./webgl/Painter.js";import{Profiler as u}from"./webgl/Profiler.js";import{TileReshuffleManager as c}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as g}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as f}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{FeatureContainer as _}from"../layers/features/FeatureContainer.js";import{Timeline as b}from"../support/Timeline.js";import{SizedPixelFormat as w,SizedDepthStencilFormat as R,PixelType as y}from"../../webgl/enums.js";import{DisposableFramebufferObject as x}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as C}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as j}from"../../webgl/RenderingContext.js";import{RenderingContextOptions as M}from"../../webgl/RenderingContextOptions.js";import{TextureDescriptor as P}from"../../webgl/TextureDescriptor.js";const T=2e3;class q extends d{constructor(e,r,a){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._stationary=!0,this._animationsEnabled=!0,this._renderRequested=i(!1),this._reshuffleManager=new c,this.stage=this,this.meshWriterRegistry=new f,this.labelManager=new h({featuresTilingScheme:r.featuresTilingScheme}),this._managedCanvas=a,this.context=new j(this._managedCanvas.gl,r.contextOptions??new M),this.painter=new m(this.context,this),this._cimAnalyzer=new o(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&null!=e&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),e.appendChild(this._debugOutput));const n=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:r.timeline||new b,renderingOptions:r.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new u(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return n()},reshuffleManager:this._reshuffleManager,backgroundColor:r.backgroundColor,animationsEnabled:!0};let d=e=>this.renderFrame(e);null!=r.renderFrame&&(d=r.renderFrame),this._taskHandle=s({render:e=>d(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._managedCanvas.events.on("webgl-context-lost",e=>this.emit("webgl-error",{error:new t("webgl-context-lost",e.statusMessage||"WebGL context lost")})),p()}destroy(){super.destroy(),g(this.context),this.labelManager.destroy(),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=r(this._taskHandle),this._lostWebGLContextHandle=r(this._lostWebGLContextHandle),this._managedCanvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this.painter.dispose(),this.context.dispose(),this._managedCanvas=null}get updating(){const e=this.labelManager.updating;return has("esri-2d-log-updating")&&console.log(`Updating Stage: ${e}\n-> labelManager.updating: ${this.labelManager.updating}\n`),e}get textureManager(){return this.painter.textureManager}get profiler(){return this._renderParameters.profiler}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get canvas(){return this._managedCanvas.canvas}get cimAnalyzer(){return this._cimAnalyzer}get effectiveVisible(){return this.visible}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestDeclutter(),this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}get animationsEnabled(){return this._animationsEnabled}set animationsEnabled(e){this._animationsEnabled!==e&&(this._animationsEnabled=e,this._animationsEnabled&&this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=T,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}requestDeclutter(){this.labelManager.requestDeclutter(),this.requestRender()}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this._renderParameters.animationsEnabled=this._animationsEnabled,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:n()}}renderChildren(e){this._reshuffleManager.reshuffle(l);const t=[];this._prepareFeatureContainers(t,this);const r=this.labelManager.declutter(t,e.state);r&&this.requestRender(),this._managedCanvas.render(e,()=>this._renderChildren(this.children,e,r))}_renderChildren(e,t,r=!1){t.decluttering=r;for(const i of e)i.beforeRender(t);const s=this.context;this.painter.textureUploadManager.upload(),s.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=1;for(const i of e)i.processRender(t);if(this.children.some(e=>e.hasHighlight)){t.drawPhase=16;for(const r of e)r.processRender(t)}if(this.children.some(e=>e.hasLabels)){t.drawPhase=2;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=64;for(const r of e)r.processRender(t)}t.drawPhase=128;for(const i of e)i.processRender(t);this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),s.logInfo();for(const i of e)i.afterRender(t)}_prepareFeatureContainers(e,t){for(const r of t.children)r instanceof _?e.push(r):r instanceof d&&this._prepareFeatureContainers(e,r)}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._managedCanvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),a=Math.round(this.state.size[1]*e.resolutionScale),n=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new P(i,a);l.wrapMode=33071,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new x(o,l,new C(R.DEPTH24_STENCIL8,i,a)),u=o.boundFramebuffer,c=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,a),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:a-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(u),o.setViewport(c.x,c.y,c.width,c.height),this.requestRender();const g=await p;let f;return 1===e.outputScale?f=g:(f=new ImageData(Math.round(g.width*e.outputScale),Math.round(g.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(g,f,!0)),m.dispose(),f}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,6408,y.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}e([a()],q.prototype,"updating",null);export{q as Stage,T as extraRenderTime};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as r}from"../../../core/maybe.js";import{addFrameTask as s}from"../../../core/scheduling.js";import{signal as i}from"../../../core/signal.js";import{property as a}from"../../../core/accessorSupport/decorators.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as o}from"../../../symbols/cim/cimAnalyzer.js";import{LabelManager as h}from"../LabelManager.js";import{Container as d}from"./Container.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as l}from"./webgl/definitions.js";import m from"./webgl/Painter.js";import{Profiler as u}from"./webgl/Profiler.js";import{TileReshuffleManager as c}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as g}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as f}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{FeatureContainer as _}from"../layers/features/FeatureContainer.js";import{Timeline as b}from"../support/Timeline.js";import{SizedPixelFormat as w,SizedDepthStencilFormat as R,PixelType as y}from"../../webgl/enums.js";import{DisposableFramebufferObject as x}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as C}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as j}from"../../webgl/RenderingContext.js";import{RenderingContextOptions as P}from"../../webgl/RenderingContextOptions.js";import{TextureDescriptor as M}from"../../webgl/TextureDescriptor.js";const T=2e3;class q extends d{constructor(e,r,a){super(),this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._stationary=!0,this._animationsEnabled=!0,this._renderRequested=i(!1),this._reshuffleManager=new c,this.stage=this,this.meshWriterRegistry=new f,this.labelManager=new h({featuresTilingScheme:r.featuresTilingScheme}),this._managedCanvas=a,this.context=new j(this._managedCanvas.gl,r.contextOptions??new P),this.painter=new m(this.context,this),this._cimAnalyzer=new o(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&null!=e&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),e.appendChild(this._debugOutput));const n=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:r.timeline||new b,renderingOptions:r.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new u(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return n()},reshuffleManager:this._reshuffleManager,backgroundColor:r.backgroundColor,animationsEnabled:!0};let d=e=>this.renderFrame(e);null!=r.renderFrame&&(d=r.renderFrame),this._taskHandle=s({render:e=>d(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._managedCanvas.events.on("webgl-context-lost",e=>this.emit("webgl-error",{error:new t("webgl-context-lost",e.statusMessage||"WebGL context lost")})),p()}destroy(){super.destroy(),g(this.context),this.labelManager.destroy(),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=r(this._taskHandle),this._lostWebGLContextHandle=r(this._lostWebGLContextHandle),this._managedCanvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this.painter.dispose(),this.context.dispose(),this._managedCanvas=null}get updating(){return this.labelManager.updating}get textureManager(){return this.painter.textureManager}get profiler(){return this._renderParameters.profiler}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get canvas(){return this._managedCanvas.canvas}get cimAnalyzer(){return this._cimAnalyzer}get effectiveVisible(){return this.visible}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestDeclutter(),this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}get animationsEnabled(){return this._animationsEnabled}set animationsEnabled(e){this._animationsEnabled!==e&&(this._animationsEnabled=e,this._animationsEnabled&&this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=T,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}requestDeclutter(){this.labelManager.requestDeclutter(),this.requestRender()}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this._renderParameters.animationsEnabled=this._animationsEnabled,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:n()}}renderChildren(e){this._reshuffleManager.reshuffle(l);const t=[];this._prepareFeatureContainers(t,this);const r=this.labelManager.declutter(t,e.state);r&&this.requestRender(),this._managedCanvas.render(e,()=>this._renderChildren(this.children,e,r))}_renderChildren(e,t,r=!1){t.decluttering=r;for(const i of e)i.beforeRender(t);const s=this.context;this.painter.textureUploadManager.upload(),s.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=1;for(const i of e)i.processRender(t);if(this.children.some(e=>e.hasHighlight)){t.drawPhase=16;for(const r of e)r.processRender(t)}if(this.children.some(e=>e.hasLabels)){t.drawPhase=2;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=64;for(const r of e)r.processRender(t)}t.drawPhase=128;for(const i of e)i.processRender(t);this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),s.logInfo();for(const i of e)i.afterRender(t)}_prepareFeatureContainers(e,t){for(const r of t.children)r instanceof _?e.push(r):r instanceof d&&this._prepareFeatureContainers(e,r)}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._managedCanvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),a=Math.round(this.state.size[1]*e.resolutionScale),n=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new M(i,a);l.wrapMode=33071,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new x(o,l,new C(R.DEPTH24_STENCIL8,i,a)),u=o.boundFramebuffer,c=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,a),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:a-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(u),o.setViewport(c.x,c.y,c.width,c.height),this.requestRender();const g=await p;let f;return 1===e.outputScale?f=g:(f=new ImageData(Math.round(g.width*e.outputScale),Math.round(g.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(g,f,!0)),m.dispose(),f}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,6408,y.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}e([a()],q.prototype,"updating",null);export{q as Stage,T as extraRenderTime};