@arcgis/core 4.32.0-next.20250103 → 4.32.0-next.20250105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/13720b1d97fb7d80e972.js +1 -0
- package/assets/esri/core/workers/chunks/{38d03fe352057fb375b5.js → 44cc3ea8cec8ddd1e3ab.js} +1 -1
- package/assets/esri/core/workers/chunks/{6d218fb5e0f0a04d72c5.js → f4e3db71d1adae717535.js} +2 -2
- package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
- package/interfaces.d.ts +56 -0
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/support/parquetLayerUtils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
- package/views/2d/engine/webgl/meshing/SimpleMesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList/support/layerListUtils.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/648d7d8fa19a2e772c89.js +0 -1
- /package/assets/esri/core/workers/chunks/{6d218fb5e0f0a04d72c5.js.LICENSE.txt → f4e3db71d1adae717535.js.LICENSE.txt} +0 -0
package/libs/parquet/parquet.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getAssetUrl as e}from"../../assets.js";import t from"../../request.js";let n;const r=new Array(128).fill(void 0);function _(e){return r[e]}r.push(void 0,null,!0,!1);let i=r.length;function o(e){e<132||(r[e]=i,i=e)}function a(e){const t=_(e);return o(e),t}function s(e){i===r.length&&r.push(r.length+1);const t=i;return i=r[t],r[t]=e,t}const d="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&d.decode();let g=null;function c(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(n.memory.buffer)),g}function u(e,t){return e>>>=0,d.decode(c().subarray(e,e+t))}function l(e,t){return e>>>=0,c().subarray(e/1,e/1+t)}const w="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>{n.__wbindgen_export_1.get(e.dtor)(e.a,e.b)}));function b(e,t,r,_){const i={a:e,b:t,cnt:1,dtor:r},o=(...e)=>{i.cnt++;const t=i.a;i.a=0;try{return _(t,i.b,...e)}finally{0==--i.cnt?(n.__wbindgen_export_1.get(i.dtor)(t,i.b),w.unregister(i)):i.a=t}};return o.original=i,w.register(o,i,i),o}function p(e,t,r){n._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h976f7baa817b77e0(e,t,s(r))}function f(){n.enable_tracing()}let y=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},m="function"==typeof h.encodeInto?function(e,t){return h.encodeInto(e,t)}:function(e,t){const n=h.encode(e);return t.set(n),{read:e.length,written:n.length}};function k(e,t,n){if(void 0===n){const n=h.encode(e),r=t(n.length,1)>>>0;return c().subarray(r,r+n.length).set(n),y=n.length,r}let r=e.length,_=t(r,1)>>>0;const i=c();let o=0;for(;o<r;o++){const t=e.charCodeAt(o);if(t>127)break;i[_+o]=t}if(o!==r){0!==o&&(e=e.slice(o)),_=n(_,r,r=o+3*e.length,1)>>>0;const t=c().subarray(_+o,_+r);o+=m(e,t).written,_=n(_,r,o,1)>>>0}return y=o,_}let I=null;function F(){return(null===I||!0===I.buffer.detached||void 0===I.buffer.detached&&I.buffer!==n.memory.buffer)&&(I=new DataView(n.memory.buffer)),I}function v(e,t){try{return e.apply(this,t)}catch(r){n.__wbindgen_exn_store(s(r))}}function T(e,t,r,_){n.wasm_bindgen__convert__closures__invoke2_mut__h942ec15236fcac1d(e,t,s(r),s(_))}let x=null;function q(){return null!==x&&0!==x.byteLength||(x=new Float64Array(n.memory.buffer)),x}function M(e,t){return e>>>=0,q().subarray(e/8,e/8+t)}let R=null;function z(){return null!==R&&0!==R.byteLength||(R=new Uint32Array(n.memory.buffer)),R}function O(e,t){return e>>>=0,z().subarray(e/4,e/4+t)}function j(e,t){e>>>=0;const n=F(),r=[];for(let _=e;_<e+4*t;_+=4)r.push(a(n.getUint32(_,!0)));return r}let C=null;function A(){return null!==C&&0!==C.byteLength||(C=new Uint16Array(n.memory.buffer)),C}function P(e,t){const n=t(2*e.length,2)>>>0;return A().set(e,n/2),y=e.length,n}function W(e,t,r){const _=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),i=y;return a(n.readMetadata(_,i,s(t),s(r)))}function S(e,t){const n=t(1*e.length,1)>>>0;return c().set(e,n/1),y=e.length,n}function G(e){const t=S(e,n.__wbindgen_malloc),r=y;return a(n.readMetadataFromFile(t,r))}function E(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`);return e.ptr}function B(e){return null==e}function D(e,t,r,_,i){const o=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),d=y;E(_,Q);var g=_.__destroy_into_raw();let c=0;B(i)||(E(i,K),c=i.__destroy_into_raw());return a(n.readFile(o,d,s(t),s(r),g,c))}function U(e,t){let r=0;B(e)||(E(e,K),r=e.__destroy_into_raw());const _=S(t,n.__wbindgen_malloc),i=y;return a(n.readFileFromBinary(r,_,i))}const L=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),V=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],X="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_columndescriptor_free(e>>>0,1)));class Y{static __wrap(e){e>>>=0;const t=Object.create(Y.prototype);return t.__wbg_ptr=e,X.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_columndescriptor_free(e,0)}name(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_name(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}physicalType(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_physicalType(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}logicalType(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_logicalType(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_encodings(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0),r=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_pageEncodings(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=j(e,t).slice(),n.__wbindgen_free(e,4*t,4)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}numValues(){return n.columndescriptor_numValues(this.__wbg_ptr)}compression(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_compression(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}compressedSize(){return n.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return n.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_nullCount(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getBigInt64(r+8,!0);return 0===e?void 0:t}finally{n.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_distinctCount(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getBigInt64(r+8,!0);return 0===e?void 0:t}finally{n.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_minValue(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=l(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_maxValue(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=l(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const N="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_fieldmetadata_free(e>>>0,1)));class ${static __wrap(e){e>>>=0;const t=Object.create($.prototype);return t.__wbg_ptr=e,N.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_name(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}get index(){return n.fieldmetadata_index(this.__wbg_ptr)}get type(){const e=n.fieldmetadata_esri_type(this.__wbg_ptr);return V[e]}get physicalType(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_physical_type(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_logical_type(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const J="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_filemetadata_free(e>>>0,1)));class Q{static __wrap(e){e>>>=0;const t=Object.create(Q.prototype);return t.__wbg_ptr=e,J.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_filemetadata_free(e,0)}version(){return n.filemetadata_version(this.__wbg_ptr)}numRows(){return n.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return n.filemetadata_numFields(this.__wbg_ptr)>>>0}createdBy(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_createdBy(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(e){try{const _=n.__wbindgen_add_to_stack_pointer(-16),i=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),o=y;n.filemetadata_keyValueMetadata(_,this.__wbg_ptr,i,o);var t=F().getInt32(_+0,!0),r=F().getInt32(_+4,!0);let a;return 0!==t&&(a=u(t,r).slice(),n.__wbindgen_free(t,1*r,1)),a}finally{n.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_keys(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=j(e,t).slice(),n.__wbindgen_free(e,4*t,4)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),r=y,_=n.filemetadata_getFieldIndex(this.__wbg_ptr,t,r);return 16777215===_?void 0:_}getFieldByIndex(e){const t=n.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return 0===t?void 0:$.__wrap(t)}getFields(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_getFields(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0),r=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const H="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_geometryinfodescriptor_free(e>>>0,1)));class K{static __wrap(e){e>>>=0;const t=Object.create(K.prototype);return t.__wbg_ptr=e,H.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_geometryinfodescriptor_free(e,0)}get geometryType(){const e=n.__wbg_get_geometryinfodescriptor_geometryType(this.__wbg_ptr);return 4===e?void 0:e}set geometryType(e){n.__wbg_set_geometryinfodescriptor_geometryType(this.__wbg_ptr,B(e)?4:e)}get wkbIndex(){const e=n.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set wkbIndex(e){n.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,B(e)?16777215:e)}get lngIndex(){const e=n.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set lngIndex(e){n.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,B(e)?16777215:e)}get latIndex(){const e=n.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set latIndex(e){n.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,B(e)?16777215:e)}get inWkid(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.__wbg_get_geometryinfodescriptor_inWkid(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);return 0===e?void 0:t>>>0}finally{n.__wbindgen_add_to_stack_pointer(16)}}set inWkid(e){n.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,!B(e),B(e)?0:e)}get outWkid(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.__wbg_get_geometryinfodescriptor_outWkid(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);return 0===e?void 0:t>>>0}finally{n.__wbindgen_add_to_stack_pointer(16)}}set outWkid(e){n.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,!B(e),B(e)?0:e)}static new(){const e=n.geometryinfodescriptor_new();return K.__wrap(e)}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_pageencodingdescriptor_free(e>>>0,1)));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Z.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_pageencodingdescriptor_free(e,0)}pageType(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.pageencodingdescriptor_pageType(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}encoding(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.pageencodingdescriptor_encoding(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}count(){return n.pageencodingdescriptor_count(this.__wbg_ptr)}}const te="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_parquetchunk_free(e>>>0,1)));class ne{static __wrap(e){e>>>=0;const t=Object.create(ne.prototype);return t.__wbg_ptr=e,te.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,te.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_parquetchunk_free(e,0)}size(){return n.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return 0!==n.parquetchunk_hasField(this.__wbg_ptr,e)}readX(e){return n.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return n.parquetchunk_readY(this.__wbg_ptr,e)}readCoords(e){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.parquetchunk_readCoords(_,this.__wbg_ptr,e);var t=F().getInt32(_+0,!0),r=F().getInt32(_+4,!0);let i;return 0!==t&&(i=M(t,r).slice(),n.__wbindgen_free(t,8*r,8)),i}finally{n.__wbindgen_add_to_stack_pointer(16)}}readLengths(e){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.parquetchunk_readLengths(_,this.__wbg_ptr,e);var t=F().getInt32(_+0,!0),r=F().getInt32(_+4,!0);let i;return 0!==t&&(i=O(t,r).slice(),n.__wbindgen_free(t,4*r,4)),i}finally{n.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(e,t,r,_,i){const o=n.parquetchunk_readGeometryTransformed(this.__wbg_ptr,e,t,r,_,i);return 0===o?void 0:oe.__wrap(o)}boundsXMin(e){return n.parquetchunk_boundsXMin(this.__wbg_ptr,e)}boundsYMin(e){return n.parquetchunk_boundsYMin(this.__wbg_ptr,e)}boundsXMax(e){return n.parquetchunk_boundsXMax(this.__wbg_ptr,e)}boundsYMax(e){return n.parquetchunk_boundsYMax(this.__wbg_ptr,e)}readAttribute(e,t){return a(n.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const re="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_parquetfile_free(e>>>0,1)));let _e=class e{static __wrap(t){t>>>=0;const n=Object.create(e.prototype);return n.__wbg_ptr=t,re.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,re.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_parquetfile_free(e,0)}metadata(){const e=n.parquetfile_metadata(this.__wbg_ptr);return Q.__wrap(e)}rowGroups(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.parquetfile_rowGroups(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0),r=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(e,t){const r=P(e,n.__wbindgen_malloc),_=y;return a(n.parquetfile_readChunksWithCallback(this.__wbg_ptr,r,_,s(t)))}readFirstChunk(e){const t=P(e,n.__wbindgen_malloc),r=y;return a(n.parquetfile_readFirstChunk(this.__wbg_ptr,t,r))}readAllChunks(e){const t=P(e,n.__wbindgen_malloc),r=y;return a(n.parquetfile_readAllChunks(this.__wbg_ptr,t,r))}updateChunks(e){const t=P(e,n.__wbindgen_malloc),r=y;return a(n.parquetfile_updateChunks(this.__wbg_ptr,t,r))}};const ie="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_quantizedgeometry_free(e>>>0,1)));class oe{static __wrap(e){e>>>=0;const t=Object.create(oe.prototype);return t.__wbg_ptr=e,ie.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ie.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_quantizedgeometry_free(e,0)}readCoordsUnsafe(){return a(n.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return a(n.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const ae="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_rangeproviderjs_free(e>>>0,1)));class se{static __wrap(e){e>>>=0;const t=Object.create(se.prototype);return t.__wbg_ptr=e,ae.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ae.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const r=n.rangeproviderjs_new(s(e),s(t));return se.__wrap(r)}static withFetch(){const e=n.rangeproviderjs_withFetch();return se.__wrap(e)}}const de="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_rowgroup_free(e>>>0,1)));class ge{static __wrap(e){e>>>=0;const t=Object.create(ge.prototype);return t.__wbg_ptr=e,de.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,de.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_rowgroup_free(e,0)}columns(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.rowgroup_columns(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0),r=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}}async function ce(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(n){if("application/wasm"==e.headers.get("Content-Type"))throw n;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n)}const r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function ue(){const e={wbg:{}};return e.wbg.__wbg_new_abda76e883ba8a5f=function(){return s(new Error)},e.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const r=k(_(t).stack,n.__wbindgen_malloc,n.__wbindgen_realloc),i=y;F().setInt32(e+4,i,!0),F().setInt32(e+0,r,!0)},e.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let r,_;try{r=e,_=t,console.error(u(e,t))}finally{n.__wbindgen_free(r,_,1)}},e.wbg.__wbindgen_object_drop_ref=function(e){a(e)},e.wbg.__wbindgen_is_function=function(e){return"function"==typeof _(e)},e.wbg.__wbg_self_3093d5d1f7bcb682=function(){return v((function(){return s(self.self)}),arguments)},e.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return v((function(){return s(window.window)}),arguments)},e.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return v((function(){return s(globalThis.globalThis)}),arguments)},e.wbg.__wbg_global_e5a3fe56f8be9485=function(){return v((function(){return s(global.global)}),arguments)},e.wbg.__wbindgen_is_undefined=function(e){return void 0===_(e)},e.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return s(new Function(u(e,t)))},e.wbg.__wbindgen_object_clone_ref=function(e){return s(_(e))},e.wbg.__wbindgen_number_new=function(e){return s(e)},e.wbg.__wbindgen_string_new=function(e,t){return s(u(e,t))},e.wbg.__wbg_call_1084a111329e68ce=function(){return v((function(e,t){return s(_(e).call(_(t)))}),arguments)},e.wbg.__wbg_call_89af060b4e1523f2=function(){return v((function(e,t,n){return s(_(e).call(_(t),_(n)))}),arguments)},e.wbg.__wbg_call_7de908392845a9a5=function(){return v((function(e,t,n,r,i){return s(_(e).call(_(t),_(n),_(r),_(i)))}),arguments)},e.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return _(e).valueOf()},e.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return s(_(e).buffer)},e.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var n={a:e,b:t},r=(e,t)=>{const r=n.a;n.a=0;try{return T(r,n.b,e,t)}finally{n.a=r}};return s(new Promise(r))}finally{n.a=n.b=0}},e.wbg.__wbg_resolve_570458cb99d56a43=function(e){return s(Promise.resolve(_(e)))},e.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return s(_(e).then(_(t)))},e.wbg.__wbg_then_876bb3c633745cc6=function(e,t,n){return s(_(e).then(_(t),_(n)))},e.wbg.__wbg_newwithbyteoffsetandlength_b5293b0eedbac651=function(e,t,n){return s(new Int16Array(_(e),t>>>0,n>>>0))},e.wbg.__wbg_new_ea1883e1e5e86686=function(e){return s(new Uint8Array(_(e)))},e.wbg.__wbg_newwithbyteoffsetandlength_874df3e29cb555f9=function(e,t,n){return s(new Uint32Array(_(e),t>>>0,n>>>0))},e.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return _(e).length},e.wbg.__wbg_set_d1e79e2388520f18=function(e,t,n){_(e).set(_(t),n>>>0)},e.wbg.__wbindgen_throw=function(e,t){throw new Error(u(e,t))},e.wbg.__wbindgen_memory=function(){return s(n.memory)},e.wbg.__wbindgen_array_new=function(){return s([])},e.wbg.__wbindgen_array_push=function(e,t){_(e).push(a(t))},e.wbg.__wbindgen_uint8_array_new=function(e,t){var r=l(e,t).slice();n.__wbindgen_free(e,1*t,1);return s(r)},e.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return s(_(e).queueMicrotask)},e.wbg.__wbindgen_cb_drop=function(e){const t=a(e).original;if(1==t.cnt--)return t.a=0,!0;return!1},e.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(_(e))},e.wbg.__wbg_parquetchunk_new=function(e){return s(ne.__wrap(e))},e.wbg.__wbg_parquetfile_new=function(e){return s(_e.__wrap(e))},e.wbg.__wbg_filemetadata_new=function(e){return s(Q.__wrap(e))},e.wbg.__wbg_fieldmetadata_new=function(e){return s($.__wrap(e))},e.wbg.__wbg_rowgroup_new=function(e){return s(ge.__wrap(e))},e.wbg.__wbg_columndescriptor_new=function(e){return s(Y.__wrap(e))},e.wbg.__wbg_pageencodingdescriptor_new=function(e){return s(ee.__wrap(e))},e.wbg.__wbindgen_closure_wrapper1461=function(e,t,n){return s(b(e,t,75,p))},e}function le(e,t){return n=e.exports,be.__wbindgen_wasm_module=t,I=null,x=null,C=null,R=null,g=null,n.__wbindgen_start(),n}function we(e){if(void 0!==n)return n;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module:e}=e):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const t=ue();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));return le(new WebAssembly.Instance(e,t),e)}async function be(e){if(void 0!==n)return n;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module_or_path:e}=e):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const t=ue();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:r,module:_}=await ce(await e,t);return le(r,_)}const pe=Object.freeze(Object.defineProperty({__proto__:null,ColumnDescriptor:Y,FieldMetadata:$,FileMetadata:Q,GeometryInfoDescriptor:K,GeometryType:L,PageEncodingDescriptor:ee,ParquetChunk:ne,ParquetFile:_e,QuantizedGeometry:oe,RangeProviderJs:se,RowGroup:ge,default:be,enable_tracing:f,initSync:we,readFile:D,readFileFromBinary:U,readMetadata:W,readMetadataFromFile:G},Symbol.toStringTag,{value:"Module"}));let fe=null;async function ye(){return fe||(fe=he()),fe}async function he(){const t=await Promise.resolve().then((()=>pe));return await t.default({module_or_path:e("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),t}const me=e=>async function(n,r,_){const i=e(),{data:o}=await t(n,{responseType:"array-buffer",query:i,headers:{range:`bytes=${r}-${_}`}});return o},ke=e=>async function(n){const r=e(),{data:_}=await t(n,{responseType:"native",method:"head",query:r}),i=_.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class Ie{static async create(e,t){const n=await ye(),r=await n.readMetadata(e,me(t),ke(t));return Ie.fromFileMetadata(r)}static fromFileMetadata(e){const t=[];for(let n=0;n<e.numFields();n++){const r=e.getFieldByIndex(n);t.push({name:r.name,type:r.type,alias:r.name,index:r.index}),r.free()}return new Ie(e,t)}constructor(e,t){this._inner=e,this.fields=t}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(e){return this._inner.getFieldIndex(e)}tryReadGeoMetadata(){const e=this._inner.keyValueMetadata("geo");return null==e?null:JSON.parse(e)}}function Fe(e){switch(e){case"esriGeometryPoint":return L.Point;case"esriGeometryPolygon":return L.Polygon;case"esriGeometryPolyline":return L.Polyline;case"esriGeometryMultipoint":return L.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${e}`)}}function ve(e,t,n){const r=K.new();return r.geometryType=Fe(e.geometryType),"location"===e.type?(r.latIndex=t.getFieldIndex(e.latitudeFieldName),r.lngIndex=t.getFieldIndex(e.longitudeFieldName)):r.wkbIndex=t.getFieldIndex(e.primaryFieldName),r.inWkid=e.spatialReference.wkid,n&&(r.outWkid=n.wkid),r}class Te{static async create(e,t){const n=await ye(),r=me(t.getCustomParameters),_=ke(t.getCustomParameters),i=await W(e,r,_),o=ve(t.geometryInfo,i,t.outSpatialReference),a=await n.readFile(e,r,_,i,o);return new Te(a,Ie.fromFileMetadata(a.metadata()))}static async fromFile(e,t,n){const r=await ye(),_=await r.readMetadataFromFile(e),i=t?ve(t,_,n):void 0,o=await r.readFileFromBinary(i,e);return new Te(o,Ie.fromFileMetadata(o.metadata()))}constructor(e,t){this.inner=e,this.metadata=t}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{Te as ParquetFile,Ie as ParquetMetadata};
|
|
5
|
+
import{getAssetUrl as t}from"../../assets.js";import e from"../../request.js";let _;const n=new Array(128).fill(void 0);function r(t){return n[t]}n.push(void 0,null,!0,!1);let i=n.length;function o(t){t<132||(n[t]=i,i=t)}function a(t){const e=r(t);return o(t),e}function s(t){i===n.length&&n.push(n.length+1);const e=i;return i=n[e],n[e]=t,e}const g="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&g.decode();let d=null;function c(){return null!==d&&0!==d.byteLength||(d=new Uint8Array(_.memory.buffer)),d}function w(t,e){return t>>>=0,g.decode(c().subarray(t,t+e))}function l(t,e){return t>>>=0,c().subarray(t/1,t/1+e)}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>{_.__wbindgen_export_1.get(t.dtor)(t.a,t.b)}));function b(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...t)=>{i.cnt++;const e=i.a;i.a=0;try{return r(e,i.b,...t)}finally{0==--i.cnt?(_.__wbindgen_export_1.get(i.dtor)(e,i.b),u.unregister(i)):i.a=e}};return o.original=i,u.register(o,i,i),o}function p(t,e,n){_._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6f3c6e2a403d1e3d(t,e,s(n))}function f(){_.enable_tracing()}let y=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},m="function"==typeof h.encodeInto?function(t,e){return h.encodeInto(t,e)}:function(t,e){const _=h.encode(t);return e.set(_),{read:t.length,written:_.length}};function I(t,e,_){if(void 0===_){const _=h.encode(t),n=e(_.length,1)>>>0;return c().subarray(n,n+_.length).set(_),y=_.length,n}let n=t.length,r=e(n,1)>>>0;const i=c();let o=0;for(;o<n;o++){const e=t.charCodeAt(o);if(e>127)break;i[r+o]=e}if(o!==n){0!==o&&(t=t.slice(o)),r=_(r,n,n=o+3*t.length,1)>>>0;const e=c().subarray(r+o,r+n);o+=m(t,e).written,r=_(r,n,o,1)>>>0}return y=o,r}let k=null;function F(){return(null===k||!0===k.buffer.detached||void 0===k.buffer.detached&&k.buffer!==_.memory.buffer)&&(k=new DataView(_.memory.buffer)),k}function v(t,e){try{return t.apply(this,e)}catch(n){_.__wbindgen_exn_store(s(n))}}function R(t,e,n,r){_.wasm_bindgen__convert__closures__invoke2_mut__h367b7e3d952c2b06(t,e,s(n),s(r))}let x=null;function z(){return null!==x&&0!==x.byteLength||(x=new Float64Array(_.memory.buffer)),x}function T(t,e){return t>>>=0,z().subarray(t/8,t/8+e)}let P=null;function M(){return null!==P&&0!==P.byteLength||(P=new Uint32Array(_.memory.buffer)),P}function q(t,e){return t>>>=0,M().subarray(t/4,t/4+e)}function O(t,e){t>>>=0;const _=F(),n=[];for(let r=t;r<t+4*e;r+=4)n.push(a(_.getUint32(r,!0)));return n}let j=null;function C(){return null!==j&&0!==j.byteLength||(j=new Uint16Array(_.memory.buffer)),j}function B(t,e){const _=e(2*t.length,2)>>>0;return C().set(t,_/2),y=t.length,_}function A(t,e){const _=e(4*t.length,4)>>>0,n=F();for(let r=0;r<t.length;r++)n.setUint32(_+4*r,s(t[r]),!0);return y=t.length,_}function S(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}function W(t,e){const _=e(8*t.length,8)>>>0;return z().set(t,_/8),y=t.length,_}function G(t,e){const _=e(4*t.length,4)>>>0;return M().set(t,_/4),y=t.length,_}function E(t){return null==t}function U(t,e){const _=e(1*t.length,1)>>>0;return c().set(t,_/1),y=t.length,_}function D(t,e,n){const r=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),i=y;return a(_.readMetadata(r,i,s(e),s(n)))}function L(t){const e=U(t,_.__wbindgen_malloc),n=y;return a(_.readMetadataFromFile(e,n))}function V(t,e,n,r,i){const o=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),g=y;S(r,tt);var d=r.__destroy_into_raw();let c=0;E(i)||(S(i,rt),c=i.__destroy_into_raw());return a(_.readFile(o,g,s(e),s(n),d,c))}function N(t,e){let n=0;E(t)||(S(t,rt),n=t.__destroy_into_raw());const r=U(e,_.__wbindgen_malloc),i=y;return a(_.readFileFromBinary(n,r,i))}const X=Object.freeze({None:0,0:"None",Snappy:1,1:"Snappy"}),Y=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),$=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],J="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_columndescriptor_free(t>>>0,1)));class K{static __wrap(t){t>>>=0;const e=Object.create(K.prototype);return e.__wbg_ptr=t,J.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_columndescriptor_free(t,0)}name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}physicalType(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_physicalType(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}logicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_logicalType(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_encodings(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_pageEncodings(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=O(t,e).slice(),_.__wbindgen_free(t,4*e,4)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}numValues(){return _.columndescriptor_numValues(this.__wbg_ptr)}compression(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_compression(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}compressedSize(){return _.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return _.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_nullCount(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getBigInt64(n+8,!0);return 0===t?void 0:e}finally{_.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_distinctCount(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getBigInt64(n+8,!0);return 0===t?void 0:e}finally{_.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_minValue(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=l(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_maxValue(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=l(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const Q="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_fieldmetadata_free(t>>>0,1)));class H{static __wrap(t){t>>>=0;const e=Object.create(H.prototype);return e.__wbg_ptr=t,Q.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_fieldmetadata_free(t,0)}get name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}get index(){return _.fieldmetadata_index(this.__wbg_ptr)}get type(){const t=_.fieldmetadata_esri_type(this.__wbg_ptr);return $[t]}get physicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_physical_type(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_logical_type(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_filemetadata_free(t>>>0,1)));class tt{static __wrap(t){t>>>=0;const e=Object.create(tt.prototype);return e.__wbg_ptr=t,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_filemetadata_free(t,0)}version(){return _.filemetadata_version(this.__wbg_ptr)}numRows(){return _.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return _.filemetadata_numFields(this.__wbg_ptr)>>>0}numColumns(){return _.filemetadata_numColumns(this.__wbg_ptr)>>>0}createdBy(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_createdBy(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),o=y;_.filemetadata_keyValueMetadata(r,this.__wbg_ptr,i,o);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let a;return 0!==e&&(a=w(e,n).slice(),_.__wbindgen_free(e,1*n,1)),a}finally{_.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_keys(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=O(t,e).slice(),_.__wbindgen_free(t,4*e,4)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(t){const e=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=y,r=_.filemetadata_getFieldIndex(this.__wbg_ptr,e,n);return 16777215===r?void 0:r}getFieldByIndex(t){const e=_.filemetadata_getFieldByIndex(this.__wbg_ptr,t);return 0===e?void 0:H.__wrap(e)}getFields(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_getFields(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const et="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_filewriter_free(t>>>0,1)));class _t{static __wrap(t){t>>>=0;const e=Object.create(_t.prototype);return e.__wbg_ptr=t,et.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,et.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_filewriter_free(t,0)}static new(t,e){const n=A(t,_.__wbindgen_malloc),r=y,i=_.filewriter_new(n,r,e);return _t.__wrap(i)}writeKeyValue(t,e){const n=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),r=y,i=I(e,_.__wbindgen_malloc,_.__wbindgen_realloc),o=y;_.filewriter_writeKeyValue(this.__wbg_ptr,n,r,i,o)}writeI32Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,pt);var n=e.__destroy_into_raw();_.filewriter_writeI32Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeI64Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,yt);var n=e.__destroy_into_raw();_.filewriter_writeI64Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeF32Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,dt);var n=e.__destroy_into_raw();_.filewriter_writeF32Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeF64Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,wt);var n=e.__destroy_into_raw();_.filewriter_writeF64Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeGeometryPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,ut);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeStringPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,mt);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeBytesPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,st);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}finish(){try{const i=this.__destroy_into_raw(),o=_.__wbindgen_add_to_stack_pointer(-16);_.filewriter_finish(o,i);var t=F().getInt32(o+0,!0),e=F().getInt32(o+4,!0),n=F().getInt32(o+8,!0);if(F().getInt32(o+12,!0))throw a(n);var r=l(t,e).slice();return _.__wbindgen_free(t,1*e,1),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const nt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_geometryinfodescriptor_free(t>>>0,1)));class rt{static __wrap(t){t>>>=0;const e=Object.create(rt.prototype);return e.__wbg_ptr=t,nt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,nt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_geometryinfodescriptor_free(t,0)}get geometryType(){const t=_.__wbg_get_geometryinfodescriptor_geometryType(this.__wbg_ptr);return 4===t?void 0:t}set geometryType(t){_.__wbg_set_geometryinfodescriptor_geometryType(this.__wbg_ptr,E(t)?4:t)}get wkbIndex(){const t=_.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set wkbIndex(t){_.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,E(t)?16777215:t)}get lngIndex(){const t=_.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set lngIndex(t){_.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,E(t)?16777215:t)}get latIndex(){const t=_.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set latIndex(t){_.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,E(t)?16777215:t)}get xIndex(){const t=_.__wbg_get_geometryinfodescriptor_xIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set xIndex(t){_.__wbg_set_geometryinfodescriptor_xIndex(this.__wbg_ptr,E(t)?16777215:t)}get inWkid(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.__wbg_get_geometryinfodescriptor_inWkid(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);return 0===t?void 0:e>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}set inWkid(t){_.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,!E(t),E(t)?0:t)}get outWkid(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.__wbg_get_geometryinfodescriptor_outWkid(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);return 0===t?void 0:e>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}set outWkid(t){_.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,!E(t),E(t)?0:t)}static new(){const t=_.geometryinfodescriptor_new();return rt.__wrap(t)}setMultiscaleInfo(t){S(t,ot);var e=t.__destroy_into_raw();_.geometryinfodescriptor_setMultiscaleInfo(this.__wbg_ptr,e)}}const it="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_multiscaleinfo_free(t>>>0,1)));class ot{static __wrap(t){t>>>=0;const e=Object.create(ot.prototype);return e.__wbg_ptr=t,it.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,it.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_multiscaleinfo_free(t,0)}static new(){const t=_.multiscaleinfo_new();return ot.__wrap(t)}push(t,e,n,r,i){_.multiscaleinfo_push(this.__wbg_ptr,t,e,n,r,i)}}const at="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderbytes_free(t>>>0,1)));class st{static __wrap(t){t>>>=0;const e=Object.create(st.prototype);return e.__wbg_ptr=t,at.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,at.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderbytes_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return st.__wrap(t)}push(t){var e=E(t)?0:U(t,_.__wbindgen_malloc),n=y;_.pagebuilderbytes_push(this.__wbg_ptr,e,n)}}const gt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderf32_free(t>>>0,1)));class dt{static __wrap(t){t>>>=0;const e=Object.create(dt.prototype);return e.__wbg_ptr=t,gt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,gt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderf32_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return dt.__wrap(t)}push(t){_.pagebuilderf32_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ct="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderf64_free(t>>>0,1)));class wt{static __wrap(t){t>>>=0;const e=Object.create(wt.prototype);return e.__wbg_ptr=t,ct.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ct.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderf64_free(t,0)}static new(){const t=_.multiscaleinfo_new();return wt.__wrap(t)}push(t){_.pagebuilderf64_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const lt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuildergeometry_free(t>>>0,1)));class ut{static __wrap(t){t>>>=0;const e=Object.create(ut.prototype);return e.__wbg_ptr=t,lt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,lt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuildergeometry_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return ut.__wrap(t)}writeXY(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.pagebuildergeometry_writeXY(r,this.__wbg_ptr,t,e);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePBF(t,e,n,r){try{const o=_.__wbindgen_add_to_stack_pointer(-16),s=W(t,_.__wbindgen_malloc),g=y,d=G(e,_.__wbindgen_malloc),c=y;_.pagebuildergeometry_writePBF(o,this.__wbg_ptr,s,g,d,c,n,r);var i=F().getInt32(o+0,!0);if(F().getInt32(o+4,!0))throw a(i)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePolygon(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writePolygon(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePolyline(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writePolyline(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeMultipoint(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writeMultipoint(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeNone(){_.pagebuildergeometry_writeNone(this.__wbg_ptr)}}const bt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderi32_free(t>>>0,1)));class pt{static __wrap(t){t>>>=0;const e=Object.create(pt.prototype);return e.__wbg_ptr=t,bt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,bt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderi32_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return pt.__wrap(t)}push(t){_.pagebuilderi32_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ft="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderi64_free(t>>>0,1)));class yt{static __wrap(t){t>>>=0;const e=Object.create(yt.prototype);return e.__wbg_ptr=t,ft.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ft.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderi64_free(t,0)}static new(){const t=_.multiscaleinfo_new();return yt.__wrap(t)}push(t){_.pagebuilderi64_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ht="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderstring_free(t>>>0,1)));class mt{static __wrap(t){t>>>=0;const e=Object.create(mt.prototype);return e.__wbg_ptr=t,ht.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ht.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderstring_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return mt.__wrap(t)}push(t){var e=E(t)?0:I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=y;_.pagebuilderstring_push(this.__wbg_ptr,e,n)}}const It="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pageencodingdescriptor_free(t>>>0,1)));class kt{static __wrap(t){t>>>=0;const e=Object.create(kt.prototype);return e.__wbg_ptr=t,It.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,It.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pageencodingdescriptor_free(t,0)}pageType(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.pageencodingdescriptor_pageType(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}encoding(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.pageencodingdescriptor_encoding(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}count(){return _.pageencodingdescriptor_count(this.__wbg_ptr)}}const Ft="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_parquetchunk_free(t>>>0,1)));class vt{static __wrap(t){t>>>=0;const e=Object.create(vt.prototype);return e.__wbg_ptr=t,Ft.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ft.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_parquetchunk_free(t,0)}size(){return _.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(t){return 0!==_.parquetchunk_hasField(this.__wbg_ptr,t)}readX(t){return _.parquetchunk_readX(this.__wbg_ptr,t)}readY(t){return _.parquetchunk_readY(this.__wbg_ptr,t)}readCoords(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetchunk_readCoords(r,this.__wbg_ptr,t);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let i;return 0!==e&&(i=T(e,n).slice(),_.__wbindgen_free(e,8*n,8)),i}finally{_.__wbindgen_add_to_stack_pointer(16)}}readLengths(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetchunk_readLengths(r,this.__wbg_ptr,t);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let i;return 0!==e&&(i=q(e,n).slice(),_.__wbindgen_free(e,4*n,4)),i}finally{_.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(t,e,n,r,i){const o=_.parquetchunk_readGeometryTransformed(this.__wbg_ptr,t,e,n,r,i);return 0===o?void 0:Tt.__wrap(o)}boundsXMin(t){return _.parquetchunk_boundsXMin(this.__wbg_ptr,t)}boundsYMin(t){return _.parquetchunk_boundsYMin(this.__wbg_ptr,t)}boundsXMax(t){return _.parquetchunk_boundsXMax(this.__wbg_ptr,t)}boundsYMax(t){return _.parquetchunk_boundsYMax(this.__wbg_ptr,t)}readAttribute(t,e){return a(_.parquetchunk_readAttribute(this.__wbg_ptr,t,e))}}const Rt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_parquetfile_free(t>>>0,1)));let xt=class t{static __wrap(e){e>>>=0;const _=Object.create(t.prototype);return _.__wbg_ptr=e,Rt.register(_,_.__wbg_ptr,_),_}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Rt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_parquetfile_free(t,0)}metadata(){const t=_.parquetfile_metadata(this.__wbg_ptr);return tt.__wrap(t)}rowGroups(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetfile_rowGroups(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(t,e){const n=B(t,_.__wbindgen_malloc),r=y;return a(_.parquetfile_readChunksWithCallback(this.__wbg_ptr,n,r,s(e)))}readFirstChunk(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_readFirstChunk(this.__wbg_ptr,e,n))}readAllChunks(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_readAllChunks(this.__wbg_ptr,e,n))}updateChunks(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_updateChunks(this.__wbg_ptr,e,n))}};const zt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_quantizedgeometry_free(t>>>0,1)));class Tt{static __wrap(t){t>>>=0;const e=Object.create(Tt.prototype);return e.__wbg_ptr=t,zt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,zt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_quantizedgeometry_free(t,0)}readCoordsUnsafe(){return a(_.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return a(_.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const Pt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_rangeproviderjs_free(t>>>0,1)));class Mt{static __wrap(t){t>>>=0;const e=Object.create(Mt.prototype);return e.__wbg_ptr=t,Pt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Pt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_rangeproviderjs_free(t,0)}static new(t,e){const n=_.rangeproviderjs_new(s(t),s(e));return Mt.__wrap(n)}static withFetch(){const t=_.rangeproviderjs_withFetch();return Mt.__wrap(t)}}const qt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_rowgroup_free(t>>>0,1)));class Ot{static __wrap(t){t>>>=0;const e=Object.create(Ot.prototype);return e.__wbg_ptr=t,qt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,qt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_rowgroup_free(t,0)}columns(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.rowgroup_columns(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const jt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_schemafield_free(t>>>0,1)));class Ct{static __wrap(t){t>>>=0;const e=Object.create(Ct.prototype);return e.__wbg_ptr=t,jt.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof Ct?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,jt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_schemafield_free(t,0)}static tryNew(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16),o=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),s=y,g=I(e,_.__wbindgen_malloc,_.__wbindgen_realloc),d=y;_.schemafield_tryNew(i,o,s,g,d);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);if(F().getInt32(i+8,!0))throw a(r);return Ct.__wrap(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.schemafield_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}}async function Bt(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(_){if("application/wasm"==t.headers.get("Content-Type"))throw _;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",_)}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}{const _=await WebAssembly.instantiate(t,e);return _ instanceof WebAssembly.Instance?{instance:_,module:t}:_}}function At(){const t={wbg:{}};return t.wbg.__wbg_new_abda76e883ba8a5f=function(){return s(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const n=I(r(e).stack,_.__wbindgen_malloc,_.__wbindgen_realloc),i=y;F().setInt32(t+4,i,!0),F().setInt32(t+0,n,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let n,r;try{n=t,r=e,console.error(w(t,e))}finally{_.__wbindgen_free(n,r,1)}},t.wbg.__wbindgen_object_drop_ref=function(t){a(t)},t.wbg.__wbindgen_is_function=function(t){return"function"==typeof r(t)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return v((function(){return s(self.self)}),arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return v((function(){return s(window.window)}),arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return v((function(){return s(globalThis.globalThis)}),arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return v((function(){return s(global.global)}),arguments)},t.wbg.__wbindgen_is_undefined=function(t){return void 0===r(t)},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(t,e){return s(new Function(w(t,e)))},t.wbg.__wbindgen_object_clone_ref=function(t){return s(r(t))},t.wbg.__wbindgen_number_new=function(t){return s(t)},t.wbg.__wbindgen_string_new=function(t,e){return s(w(t,e))},t.wbg.__wbg_call_1084a111329e68ce=function(){return v((function(t,e){return s(r(t).call(r(e)))}),arguments)},t.wbg.__wbg_call_89af060b4e1523f2=function(){return v((function(t,e,_){return s(r(t).call(r(e),r(_)))}),arguments)},t.wbg.__wbg_call_7de908392845a9a5=function(){return v((function(t,e,_,n,i){return s(r(t).call(r(e),r(_),r(n),r(i)))}),arguments)},t.wbg.__wbg_valueOf_563b3487b1b116aa=function(t){return r(t).valueOf()},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(t){return s(r(t).buffer)},t.wbg.__wbg_new_b85e72ed1bfd57f9=function(t,e){try{var _={a:t,b:e},n=(t,e)=>{const n=_.a;_.a=0;try{return R(n,_.b,t,e)}finally{_.a=n}};return s(new Promise(n))}finally{_.a=_.b=0}},t.wbg.__wbg_resolve_570458cb99d56a43=function(t){return s(Promise.resolve(r(t)))},t.wbg.__wbg_then_95e6edc0f89b73b1=function(t,e){return s(r(t).then(r(e)))},t.wbg.__wbg_then_876bb3c633745cc6=function(t,e,_){return s(r(t).then(r(e),r(_)))},t.wbg.__wbg_newwithbyteoffsetandlength_b5293b0eedbac651=function(t,e,_){return s(new Int16Array(r(t),e>>>0,_>>>0))},t.wbg.__wbg_new_ea1883e1e5e86686=function(t){return s(new Uint8Array(r(t)))},t.wbg.__wbg_newwithbyteoffsetandlength_874df3e29cb555f9=function(t,e,_){return s(new Uint32Array(r(t),e>>>0,_>>>0))},t.wbg.__wbg_length_8339fcf5d8ecd12e=function(t){return r(t).length},t.wbg.__wbg_set_d1e79e2388520f18=function(t,e,_){r(t).set(r(e),_>>>0)},t.wbg.__wbindgen_throw=function(t,e){throw new Error(w(t,e))},t.wbg.__wbindgen_memory=function(){return s(_.memory)},t.wbg.__wbindgen_array_new=function(){return s([])},t.wbg.__wbindgen_array_push=function(t,e){r(t).push(a(e))},t.wbg.__wbindgen_uint8_array_new=function(t,e){var n=l(t,e).slice();_.__wbindgen_free(t,1*e,1);return s(n)},t.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(t){return s(r(t).queueMicrotask)},t.wbg.__wbindgen_cb_drop=function(t){const e=a(t).original;if(1==e.cnt--)return e.a=0,!0;return!1},t.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(t){queueMicrotask(r(t))},t.wbg.__wbg_parquetchunk_new=function(t){return s(vt.__wrap(t))},t.wbg.__wbg_parquetfile_new=function(t){return s(xt.__wrap(t))},t.wbg.__wbg_filemetadata_new=function(t){return s(tt.__wrap(t))},t.wbg.__wbg_fieldmetadata_new=function(t){return s(H.__wrap(t))},t.wbg.__wbg_rowgroup_new=function(t){return s(Ot.__wrap(t))},t.wbg.__wbg_schemafield_unwrap=function(t){return Ct.__unwrap(a(t))},t.wbg.__wbg_columndescriptor_new=function(t){return s(K.__wrap(t))},t.wbg.__wbg_pageencodingdescriptor_new=function(t){return s(kt.__wrap(t))},t.wbg.__wbindgen_closure_wrapper1827=function(t,e,_){return s(b(t,e,163,p))},t}function St(t,e){return _=t.exports,Gt.__wbindgen_wasm_module=e,k=null,x=null,j=null,P=null,d=null,_.__wbindgen_start(),_}function Wt(t){if(void 0!==_)return _;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module:t}=t):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=At();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));return St(new WebAssembly.Instance(t,e),t)}async function Gt(t){if(void 0!==_)return _;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const e=At();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await Bt(await t,e);return St(n,r)}const Et=Object.freeze(Object.defineProperty({__proto__:null,ColumnDescriptor:K,CompressMode:X,FieldMetadata:H,FileMetadata:tt,FileWriter:_t,GeometryInfoDescriptor:rt,GeometryType:Y,MultiScaleInfo:ot,PageBuilderBytes:st,PageBuilderF32:dt,PageBuilderF64:wt,PageBuilderGeometry:ut,PageBuilderI32:pt,PageBuilderI64:yt,PageBuilderString:mt,PageEncodingDescriptor:kt,ParquetChunk:vt,ParquetFile:xt,QuantizedGeometry:Tt,RangeProviderJs:Mt,RowGroup:Ot,SchemaField:Ct,default:Gt,enable_tracing:f,initSync:Wt,readFile:V,readFileFromBinary:N,readMetadata:D,readMetadataFromFile:L},Symbol.toStringTag,{value:"Module"}));let Ut=null;async function Dt(){return Ut||(Ut=Lt()),Ut}async function Lt(){const e=await Promise.resolve().then((()=>Et));return await e.default({module_or_path:t("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),e}const Vt=t=>async function(_,n,r){const i=t(),{data:o}=await e(_,{responseType:"array-buffer",query:i,headers:{range:`bytes=${n}-${r}`}});return o},Nt=t=>async function(_){const n=t(),{data:r}=await e(_,{responseType:"native",method:"head",query:n}),i=r.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class Xt{static async create(t,e){const _=await Dt(),n=await _.readMetadata(t,Vt(e),Nt(e));return Xt.fromFileMetadata(n)}static fromFileMetadata(t){const e=[];for(let _=0;_<t.numFields();_++){const n=t.getFieldByIndex(_);e.push({name:n.name,type:n.type,alias:n.name,index:n.index}),n.free()}return new Xt(t,e)}constructor(t,e){this._inner=t,this.fields=e}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(t){return this._inner.getFieldIndex(t)}tryReadGeoMetadata(){const t=this._inner.keyValueMetadata("geo");return null==t?null:JSON.parse(t)}tryReadEsriMetadata(){const t=this._inner.keyValueMetadata("esri");return null==t?null:JSON.parse(t)}}function Yt(t){switch(t){case"esriGeometryPoint":return Y.Point;case"esriGeometryPolygon":return Y.Polygon;case"esriGeometryPolyline":return Y.Polyline;case"esriGeometryMultipoint":return Y.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${t}`)}}function $t(t,e,_){const n=rt.new();if(n.geometryType=Yt(t.geometryType),"location"===t.type)n.latIndex=e.getFieldIndex(t.latitudeFieldName),n.lngIndex=e.getFieldIndex(t.longitudeFieldName);else{if(null==t.primaryFieldName)throw new Error("InternalError: A primary field name or set of location fields must be defined");if(n.wkbIndex=e.getFieldIndex(t.primaryFieldName),t.multiscale){const _=ot.new();for(const n of t.multiscale.levels){const[t,r]=n.transform.translate,[i,o]=n.transform.scale,a=e.getFieldIndex(n.column);_.push(a,t,r,i,o)}n.setMultiscaleInfo(_)}}return n.inWkid=t.spatialReference.wkid,_&&(n.outWkid=_.wkid),n}class Jt{static async create(t,e){const _=await Dt(),n=Vt(e.getCustomParameters),r=Nt(e.getCustomParameters),i=await D(t,n,r),o=$t(e.geometryInfo,i,e.outSpatialReference),a=await _.readFile(t,n,r,i,o);return new Jt(a,Xt.fromFileMetadata(a.metadata()))}static async fromFile(t,e,_){const n=await Dt(),r=await n.readMetadataFromFile(t),i=e?$t(e,r,_):void 0,o=await n.readFileFromBinary(i,t);return new Jt(o,Xt.fromFileMetadata(o.metadata()))}constructor(t,e){this.inner=t,this.metadata=e}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{Jt as ParquetFile,Xt as ParquetMetadata};
|
package/package.json
CHANGED
package/support/revision.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const b="20250105",c="a480f06068bfb28c396d26a2ebebc4c922c4afb3";export{b as buildDate,c as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import l from"./TextureManager.js";import{TextureUploadManager as h}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,CompareFunction as w,BlendFactor as M,RenderbufferFormat as P,BlendOperation as B,Face as C}from"../../../webgl/enums.js";import{FramebufferObject as F}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as T}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as N}from"../../../webgl/TextureDescriptor.js";class O{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new l(t),this.textureUploadManager=new h(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new N(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new F(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(w.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||A(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(r.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||A(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const l=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,l,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new N(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new T(P.DEPTH_STENCIL,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new F(this.context,s,this._stencilBuf),effect0:new F(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(s,o,r,i??{},n??{});return l.setUniforms(r),l.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,l=this._programCache.getProgram(i,{},n,a??{},o??{});if(l.setUniforms(n),l.bind(e),this.updatePipelineState(e),r)for(const h of r)s.bind(e,h),s.draw(e);else for(let h=0;h<s.parts.length;h++)s.bind(e,h),s.draw(e);s.unbind(e),l.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(M.ONE,M.ONE,M.ONE,M.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA)}}if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(C.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(C.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(C.FRONT_AND_BACK,s,r,i)}}}}}function A(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{O as default};
|
|
5
|
+
import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import l from"./TextureManager.js";import{TextureUploadManager as h}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,CompareFunction as w,BlendFactor as M,RenderbufferFormat as P,BlendOperation as B,Face as C}from"../../../webgl/enums.js";import{FramebufferObject as F}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as T}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as N}from"../../../webgl/TextureDescriptor.js";class O{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new l(t),this.textureUploadManager=new h(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new N(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new F(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(w.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||A(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(r.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||A(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const l=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,l,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new N(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new T(P.DEPTH_STENCIL,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new F(this.context,s,this._stencilBuf),effect0:new F(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(s,o,r,i??{},n??{});return l.setUniforms(r),l.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,l=this._programCache.getProgram(i,{},n,a??{},o??{});if(l.setUniforms(n),l.bind(e),this.updatePipelineState(e),r)for(const h of r)s.bind(e,t.shader.locationInfo,h),s.draw(e);else for(let h=0;h<s.parts.length;h++)s.bind(e,t.shader.locationInfo,h),s.draw(e);s.unbind(e),l.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(M.ONE,M.ONE,M.ONE,M.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA)}}if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(C.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(C.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(C.FRONT_AND_BACK,s,r,i)}}}}}function A(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{O 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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{BufferObject as e}from"../../../../webgl/BufferObject.js";import"../../../../webgl/FramebufferObject.js";import"../../../../../core/has.js";import"../../../../webgl/checkWebGLError.js";import{Usage as r}from"../../../../webgl/enums.js";import"../../../../webgl/GLObjectType.js";import"../../../../webgl/Texture.js";import{VertexArrayObject as t}from"../../../../webgl/VertexArrayObject.js";import{dataSizeInBytes as s}from"./definitions.js";class o{constructor(t,s){this._boundPart=null,this.vertexBuffers=new Map,this.indexBuffers=new Map,this.groups=[];for(const o in s.vertex){const{data:i,attributes:n}=s.vertex[o],f=e.createVertex(t,r.STATIC_DRAW,i);this.vertexBuffers.set(o,{buffer:f,attributes:n})}for(const[o,i]of Object.entries(s.index??{})){const s=e.createIndex(t,r.STATIC_DRAW,i);this.indexBuffers.set(o,{buffer:s})}for(const e of s.groups)this.groups.push({...e,vertexArrays:new Map});this.parts=s.parts}bind(e,r,s){this._boundPart=s;const{group:o}=this.parts[this._boundPart],i=this.groups[o];if(!i)throw new Error(`Missing group ${o}.`);let n=i.vertexArrays.get(r.stringHash);if(!n){const s=new Set(r.locations.keys()),o=i.index?this.indexBuffers.get(i.index)?.buffer:null,f=new Map,u=new Map;for(const[e,{buffer:r,attributes:t}]of this.vertexBuffers){const o=t.filter((e=>s.has(e.name)));o.length>0&&(f.set(e,o),u.set(e,r))}n=new t(e,r.locations,f,u,o),i.vertexArrays.set(r.stringHash,n)}e.bindVAO(n)}draw(e){if(null==this._boundPart)throw new Error("Mesh.bind() has not been called.");const{start:r,count:t}=this.parts[this._boundPart],{group:o}=this.parts[this._boundPart],{primitive:i,index:n}=this.groups[o];if(n){const o=this.indexBuffers.get(n);if(!o)throw new Error(`Missing index buffer "${n}".`);const{indexType:f}=o.buffer;if(!f)throw new Error("Buffer type error.");e.drawElements(i,t,f,r*s[f])}else e.drawArrays(i,r,t)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArrays:e}of this.groups)for(const[r,t]of e)t.disposeVAOOnly();for(const{buffer:e}of this.vertexBuffers.values())e.dispose();for(const{buffer:e}of this.indexBuffers.values())e.dispose()}}export{o as Mesh};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{dataSizeInBytes as t}from"./definitions.js";import{Mesh as e}from"./Mesh.js";import{DataType as
|
|
5
|
+
import{dataSizeInBytes as t}from"./definitions.js";import{Mesh as e}from"./Mesh.js";import{DataType as r,PrimitiveType as i}from"../../../../webgl/enums.js";import{VertexElementDescriptor as n}from"../../../../webgl/VertexElementDescriptor.js";const o={position:{type:r.SHORT,count:2}};class s extends e{static create(e,r){const i=[];let{stride:o}=r;if(null==o){o=0;for(const[e,{count:i,type:n,offset:s}]of Object.entries(r.layout)){if(null!=s)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");o+=i*t[n]}}let a=0;for(const[s,{count:d,offset:f,type:m,normalized:x}]of Object.entries(r.layout)){null!=f&&(a=f);const e=new n(s,d,m,a,o,null!=x&&x,0);i.push(e),a+=d*t[m]}const l={primitive:r.primitive};null!=r.index&&(l.index="indexData");let{count:u}=r;if(null==u&&(u=r.index?r.index.length:r.vertex.byteLength/o,Math.floor(u)!==u))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${o}.`);const c={start:0,count:u,group:0,primitive:r.primitive},p={vertex:{vertexData:{data:r.vertex,attributes:i}},parts:[c],groups:[l]};return null!=r.index&&(p.index={indexData:{data:r.index}}),new s(e,p,r.layout)}static fromVertexStream(t,e){return s.create(t,{primitive:i.TRIANGLE_STRIP,vertex:new Uint16Array(e),layout:o})}constructor(t,e,r){super(t,e),this._spec=r}bind(t,e,r=0){super.bind(t,e,r)}}export{s as SimpleMesh};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{numericHash as t}from"../../../../../core/string.js";import{TypedShaderProgram as e}from"./typed/TypedShaderProgram.js";class o{constructor(){this.computeAttributes={}}get locationsMap(){const t=new Map;for(const e in this.locations)t.set(e,this.locations[e].index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set(Object.keys(this.options));this._optionPropertyKeys=t}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,o=Array.from(e.entries()).map((([t,e])=>`${t}.${e}`)).join("."),n=t(o);this._locationInfo={hash:n,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const[e,o]of this.locationsMap.entries())t.set("a_"+e,o);return t}getShaderKey(t,e,o){return`${Object.keys(t).map((e=>`${e}.${t[e]}`)).join(".")}.${Object.keys(o).filter((t=>o[t])).map((t=>`${t}_${o[t].toString()}`)).join(".")}.${Object.keys(e).filter((t=>this.optionPropertyKeys.has(t))).join(".")}`}getProgram(t,o,n,r){let i="",s="";for(const e in n)if(n[e]){const t="boolean"==typeof n[e]?`#define ${e}\n`:`#define ${e} ${n[e]}\n`;i+=t,s+=t}return i+=this.vertexShader,s+=this.fragmentShader,new e(i,s,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(o),this._transformFeedbackBindings)}_getUniformBindings(t){const e=[];for(const o in this.required){const t=this.required[o];e.push({uniformHydrated:null,shaderModulePath:o,uniformName:o,uniformType:t.type,uniformArrayElementType:n(t),uniformArrayLength:r(t)})}for(const o in t){const i=this.options[o];if(t[o])for(const t in i){const s=i[t];e.push({uniformHydrated:null,shaderModulePath:`${o}.${t}`,uniformName:t,uniformType:s.type,uniformArrayElementType:n(s),uniformArrayLength:r(s)})}}return e}}const n=t=>"array"===t.type?t.elementType?.type:void 0,r=t=>"array"===t.type?t.size:void 0;export{o as GLSLShaderModule};
|
|
5
|
+
import{numericHash as t}from"../../../../../core/string.js";import{TypedShaderProgram as e}from"./typed/TypedShaderProgram.js";class o{constructor(){this.computeAttributes={}}get locationsMap(){const t=new Map;for(const e in this.locations)t.set(e,this.locations[e].index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set(Object.keys(this.options));this._optionPropertyKeys=t}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,o=Array.from(e.entries()).map((([t,e])=>`${t}.${e}`)).join("."),n=t(o);this._locationInfo={hash:n,stringHash:o,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const[e,o]of this.locationsMap.entries())t.set("a_"+e,o);return t}getShaderKey(t,e,o){return`${Object.keys(t).map((e=>`${e}.${t[e]}`)).join(".")}.${Object.keys(o).filter((t=>o[t])).map((t=>`${t}_${o[t].toString()}`)).join(".")}.${Object.keys(e).filter((t=>this.optionPropertyKeys.has(t))).join(".")}`}getProgram(t,o,n,r){let i="",s="";for(const e in n)if(n[e]){const t="boolean"==typeof n[e]?`#define ${e}\n`:`#define ${e} ${n[e]}\n`;i+=t,s+=t}return i+=this.vertexShader,s+=this.fragmentShader,new e(i,s,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(o),this._transformFeedbackBindings)}_getUniformBindings(t){const e=[];for(const o in this.required){const t=this.required[o];e.push({uniformHydrated:null,shaderModulePath:o,uniformName:o,uniformType:t.type,uniformArrayElementType:n(t),uniformArrayLength:r(t)})}for(const o in t){const i=this.options[o];if(t[o])for(const t in i){const s=i[t];e.push({uniformHydrated:null,shaderModulePath:`${o}.${t}`,uniformName:t,uniformType:s.type,uniformArrayElementType:n(s),uniformArrayLength:r(s)})}}return e}}const n=t=>"array"===t.type?t.elementType?.type:void 0,r=t=>"array"===t.type?t.size:void 0;export{o as GLSLShaderModule};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{ShaderBuilder2D as o}from"./ShaderBuilder2D.js";import{Float as n,Int as s,Vec4 as i,Vec2 as p}from"./graph/glsl.js";import{GlslShaderWriter as a}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as u}from"./graph/ShaderGraphContext.js";import{setReachableUids as c}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as y}from"./typed/TypedShaderProgram.js";function d(t){return new t}function f(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function h(t,e){return(r,o)=>{f(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{f(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{f(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{f(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{f(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{f(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{f(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const C=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class b{}b.builtins=[],t([C("gl_VertexID",s)],b.prototype,"glVertexID",void 0);class I{}class v{}v.builtins=[],t([C("gl_FragCoord",i)],v.prototype,"glFragCoord",void 0),t([C("gl_PointCoord",p)],v.prototype,"glPointCoord",void 0);class w{}class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new y(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new y("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.constructor.name}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),p=this._hydrateComputeInput(),y=p&&this._injectComputePackPrecisionFactor(p,t),d=this.vertex(i,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const a in h){const t=h[a];c(l,t)}const m=this._getVertexInputBuiltins(),g=u.createVertex({...s,...p},d,m,n,this.transformFeedbackBindings,l);(new a).write(g);const _=this._getFragmentInputBuiltins(h);_.set("glPointCoord","gl_PointCoord");const K=u.createFragment(f,h,_,n,g,this.transformFeedbackBindings);(new a).write(K);const x=this._createShaderBuilder(g,K),C=x.generate("vertex",!0),b=x.generate("fragment",!0);return this.logShader&&(console.log(C),console.log(b)),{vertex:C,fragment:b,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const o in t){const s=t[o],i=e[o];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[o]=s.divide(new n(i))}else r[o]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},o=new Map;for(const n in this.computeAttributes)for(const t of this.computeAttributes[n]??[])o.set(t,n);for(const s in t){const i=t[s],p=o.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new n(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new o;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,b as VertexInput,l as builtin,K as define,m as input,h as location,_ as option,x as transformFeedback,g as uniform};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{ShaderBuilder2D as o}from"./ShaderBuilder2D.js";import{Float as n,Int as s,Vec4 as i,Vec2 as p}from"./graph/glsl.js";import{GlslShaderWriter as a}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as u}from"./graph/ShaderGraphContext.js";import{setReachableUids as c}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as y}from"./typed/TypedShaderProgram.js";function d(t){return new t}function f(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function h(t,e){return(r,o)=>{f(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{f(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{f(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{f(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{f(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{f(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{f(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const C=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class b{}b.builtins=[],t([C("gl_VertexID",s)],b.prototype,"glVertexID",void 0);class I{}class v{}v.builtins=[],t([C("gl_FragCoord",i)],v.prototype,"glFragCoord",void 0),t([C("gl_PointCoord",p)],v.prototype,"glPointCoord",void 0);class w{}class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,stringHash:e,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new y(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new y("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.constructor.name}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),p=this._hydrateComputeInput(),y=p&&this._injectComputePackPrecisionFactor(p,t),d=this.vertex(i,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const a in h){const t=h[a];c(l,t)}const m=this._getVertexInputBuiltins(),g=u.createVertex({...s,...p},d,m,n,this.transformFeedbackBindings,l);(new a).write(g);const _=this._getFragmentInputBuiltins(h);_.set("glPointCoord","gl_PointCoord");const K=u.createFragment(f,h,_,n,g,this.transformFeedbackBindings);(new a).write(K);const x=this._createShaderBuilder(g,K),C=x.generate("vertex",!0),b=x.generate("fragment",!0);return this.logShader&&(console.log(C),console.log(b)),{vertex:C,fragment:b,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const o in t){const s=t[o],i=e[o];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[o]=s.divide(new n(i))}else r[o]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},o=new Map;for(const n in this.computeAttributes)for(const t of this.computeAttributes[n]??[])o.set(t,n);for(const s in t){const i=t[s],p=o.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new n(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new o;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,b as VertexInput,l as builtin,K as define,m as input,h as location,_ as option,x as transformFeedback,g as uniform};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{DataType as o,TextureSamplingMode as r,TextureWrapMode as i,RenderbufferFormat as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:o.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,o=e,h=new m(s,o);h.samplingMode=r.NEAREST,h.wrapMode=i.CLAMP_TO_EDGE;const d=new l(t,new _(n.DEPTH_STENCIL,s,o));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t
|
|
5
|
+
import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{DataType as o,TextureSamplingMode as r,TextureWrapMode as i,RenderbufferFormat as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:o.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,o=e,h=new m(s,o);h.samplingMode=r.NEAREST,h.wrapMode=i.CLAMP_TO_EDGE;const d=new l(t,new _(n.DEPTH_STENCIL,s,o));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,i=2,n=new Int16Array(r*i);for(let t=0;t<o;t++)for(let e=0;e<o;e++)n[i*(e+t*o)]=e,n[i*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:h.POINTS,vertex:n,count:r,layout:p})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let r=0;r<o.length;r++)o[r]=s.getFloat();const i=new m;return i.dataType=d.FLOAT,i.samplingMode=r.NEAREST,i.width=e,i.height=e,new T(t,i,o)}}export{f as DotDensityResources};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{tileSize as e,textureBindingRenderer0 as t,textureBindingRenderer1 as i}from"../../../definitions.js";import{
|
|
5
|
+
import{tileSize as e,textureBindingRenderer0 as t,textureBindingRenderer1 as i}from"../../../definitions.js";import{FeatureTechnique as o}from"../FeatureTechnique.js";import{isHighlight as r,isHittest as s,getFeatureUniforms as n,getSelectionDefines as a,getFeaturePipelineState as l,getViewUniforms as d}from"../featureTechniqueUtils.js";import{TechniqueType as u}from"../TechniqueType.js";import{DotDensityPointShader as c}from"./DotDensityPointShader.js";import{DotDensityPolygonShader as p}from"./DotDensityPolygonShader.js";import{DotDensityResources as h}from"./DotDensityResources.js";import{FillShader as m}from"../shaders/FillShader.js";import{FramebufferBit as f}from"../../../../../../webgl/enums.js";class w extends o{constructor(){super(...arguments),this.type=u.DotDensity,this.shaders={polygon:new p,point:new c,fill:new m},this._resources=new Map}render(e,t){r(e)||s(e)?this._renderPolygons(e,t):this._renderDotDensity(e,t)}_renderPolygons(e,t){const{painter:i}=e;i.setShader({shader:this.shaders.fill,uniforms:{...n(e,t.target),visualVariableColor:null,visualVariableOpacity:null},defines:{...a(e)},optionalAttributes:{zoomRange:!1},useComputeBuffer:s(e)}),i.setPipelineState(l(e)),i.submitDraw(e,t)}_renderDotDensity(o,r){const{context:s,painter:u,requiredLevel:c}=o,p=r.instance.getInput().uniforms,h=this._getOrCreateResourcesRecord(s),m=h.getDotDensityTextures(s,e,p.seed),w=1/2**(c-r.target.key.level),g=e,x=g*window.devicePixelRatio*g*window.devicePixelRatio,D=1/w*(1/w),y=p.dotScale?o.state.scale/p.dotScale:1,b=p.dotValue*y*D;u.setShader({shader:this.shaders.polygon,uniforms:{...n(o,r.target),instance:{isActive:p.isActive,colors:p.colors,dotValue:Math.max(1,b)},draw:{dotTexture0:{unit:t,texture:m[0]},dotTexture1:{unit:i,texture:m[1]},tileZoomFactor:w,pixelRatio:window.devicePixelRatio,tileDotsOverArea:x/(e*window.devicePixelRatio*e*window.devicePixelRatio)}},defines:{...a(o),blending:p.blending},optionalAttributes:{},useComputeBuffer:!1});const R=s.getViewport();s.setViewport(0,0,e,e);const v=s.getBoundFramebufferObject(),P=h.getFBO(s);s.bindFramebuffer(P),s.setClearColor(0,0,0,0),s.clear(f.COLOR),u.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1}),u.updatePipelineState(s),u.submitDraw(o,r),s.bindFramebuffer(v),s.setViewport(R.x,R.y,R.width,R.height);const S=h.getFBO(s).colorTexture,_={shader:this.shaders.point,uniforms:{view:d(o,r.target),instance:{dotSize:p.dotSize},draw:{locations:{unit:t,texture:S},tileZoomFactor:1,pixelRatio:window.devicePixelRatio}},defines:{...a(o)},optionalAttributes:{},useComputeBuffer:!1};u.setPipelineState(l(o)),u.submitDrawMesh(s,_,h.getDotDensityMesh(s))}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e)}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return null==t&&(t=new h,this._resources.set(e,t)),t}}export{w as DotDensityTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as
|
|
5
|
+
import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as r}from"../Technique.js";import{TechniqueType as i}from"../TechniqueType.js";import{OverlayShader as o}from"../shaders/OverlayShader.js";import{CompareFunction as n,StencilOperation as a,DataType as h,PrimitiveType as p}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as m}from"../../../../../../webgl/VertexElementDescriptor.js";class u extends r{constructor(){super(...arguments),this.type=i.Overlay,this._mesh=null,this.shaders={overlay:new o}}render(e,t){const{context:r,painter:i}=e,o=this._getMesh(e,t);i.setPipelineState(s);const{isWrapAround:h,wrapAroundShift:p}=t.config,m={...t.config,wrapAroundShift:0},u={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:m},defines:null,optionalAttributes:null,useComputeBuffer:!1};i.setPipelineState({...s,stencil:{write:!1,test:{compare:n.EQUAL,op:{fail:a.KEEP,zFail:a.KEEP,zPass:a.REPLACE},ref:0,mask:255}}}),i.submitDrawMeshUntyped(r,u,o),h&&(m.wrapAroundShift=p,i.submitDrawMeshUntyped(r,u,o))}shutdown(){e(this._mesh)}_getMesh(e,s){const{context:r}=e;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.buffer.setData(s.position)}else{const e=null!=s.index?s.index.length:s.position.length/2;this._mesh=new t(r,{vertex:{positions:{data:s.position,attributes:[new m("pos",2,h.FLOAT,0,8)]},uvs:{data:s.tex,attributes:[new m("tex",2,h.UNSIGNED_SHORT,0,4)]}},index:null!=s.index?{index:{data:s.index}}:void 0,groups:[{index:null!=s.index?"index":void 0,primitive:p.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}}export{u as OverlayTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as i,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as h}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{TechniqueType as d}from"../../engine/webgl/shaderGraph/techniques/TechniqueType.js";import{RenderState as l}from"./RenderState.js";import{renderHighlight as u}from"../support/util.js";class c{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class
|
|
5
|
+
import has from"../../../../core/has.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as i,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as h}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{TechniqueType as d}from"../../engine/webgl/shaderGraph/techniques/TechniqueType.js";import{RenderState as l}from"./RenderState.js";import{renderHighlight as u}from"../support/util.js";class c{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class _ extends r{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case i.MAP:return this._renderMapPhase(e);case i.HIGHLIGHT:return this._renderHighlightPhase(e);case i.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&h.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(p(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new c(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new l((()=>this._stage),(e=>this._subscriptions.get(e)?.version),e,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState?.flush(),this.requestRender()}swapRenderState(){this._renderStateNext&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(t,s){e(s);const r=t.inner;if(!this._subscriptions.has(r.id))return;const i=this._subscriptions.get(r.id);if(i.version!==r.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${r.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${r.id}] FeatureContainer - Dropping message, outdated version]`,r)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==r.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${r.version}]`),n.enqueueUpdate(t),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const r=t();return s?s.resolvers.push(r):(s={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(s)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=h.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&u(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),a=t.getViewport(),o=e.passOptions,h=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=i.HITTEST;const{distance:d,smallSymbolDistance:l}=e.passOptions,u=Math.max(d,l);for(const i of this.children)i.visible&&i.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(i,e,n.All);s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(a),e.passOptions=o,e.drawPhase=h}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,d.Heatmap);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){const i=has("featurelayer-strict-draw-order")?a.STRICT_ORDER:has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,n=e.getDisplayList(this._instanceStore,i);t.selection=s,n?.render(t,r)}}function p(e){return e.techniqueRef.type===d.Heatmap}export{_ as FeatureContainer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import p from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{tileSize as
|
|
5
|
+
import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import p from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{tileSize as h}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as l}from"./PipelineConnectionHandlers.js";import g from"./Processor.js";import{FeatureSource as _}from"./sources/FeatureSource.js";import{FeatureTileSubscription as b}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class q{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new p(i),this._source=new _(e.service,this._aggregateAdapter,this._subscriptions,s),this._processor=new g(s,this._source),this._handles=t([this._source.store.events.on("changed",(()=>this._requestUpdate())),this._source.store.events.on("refresh",(()=>this._requestRefresh())),u((()=>this._source.updateTracking.updating),(()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))}))])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new l(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),p=2*t,l=Math.ceil(h/p);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/p,i=u.readYForDisplay()/p,a=Math.floor(s),h=Math.floor(i);if(a<0||h<0||a>=l||h>=l)continue;const g=((.5+a-s)*p)**2+((.5+h-i)*p)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[h+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce(((e,t)=>e+t.size()),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe((t=>e.push(t.readLegacyFeatureWorldSpace()))),e}return null}const s=new Set,i=[],r=t.map((e=>e.reader.getCursor())),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s((()=>this._scheduleNextUpdate())))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally((()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()})),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new b(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}const e=this._updateSchemaRequest;if(this._updateSchemaRequest=null,null!=e){const{schema:t,version:s}=e.inner;await this._doUpdateSchema(t,s)}this._didSourceRefresh&&(this._processor.requestInvalidateMesh(),this._didSourceRefresh=!1);const t=this._processor.invalidateRequested;t&&await this._connection.container.updateRenderState(this._processor.version);const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner);const e=await this._source.normalizeOverrides(s.inner);null!=e.historicMoment&&this._source.unsafeSetQueryHistoricMoment(e.historicMoment),this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();null!=e&&this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._processor.applyOverrideUpdate(e),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")),this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),t&&await this._connection.container.swapRenderState(),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),r=Array.from(this._subscriptions.values());await this._processor.update(e,t,s,i,r),has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{q 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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import o from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as u}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as
|
|
5
|
+
import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import o from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as u}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as d}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as g}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as p}from"./processor/BinningStrategy.js";import{ClusterStrategy as y}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as _}from"./processor/FeatureUpdateStrategy.js";import{AttributeStore as l}from"./support/AttributeStore.js";import{ComputedAttributeStorage as m}from"./support/ComputedAttributeStorage.js";class f{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new u,this._invalidateRequested=!1,this._proxy=new h({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new l({isLocal:!1,update:e=>a(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get invalidateRequested(){return this._invalidateRequested}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,(e=>e),((e,s,r)=>{t[r]=e})),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}async update(e,s,r,a,n){const h=e.processor,u=t(this._schema?.storage,h.storage),g=t(this._schema?.mesh.properties,h.mesh.properties),p=t(this._schema?.mesh.factory,h.mesh.factory),y=t(this._schema?.mesh.strategy,h.mesh.strategy),_=b(this._schema?.expressionProperties,h.expressionProperties),l=_.some((e=>this._attributeStore.hasArcadeDependency(e))),f=_.some((e=>this._factory?.hasArcadeDependency(e)??!1)),S=_.some((e=>this._strategy?.hasArcadeDependency(e)))||this._strategy?.isAggregate&&l,I=f||S,j=g||p||y;if(!(u||j||(f||l||S))&&!a)return;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:i(this._schema,h),schema:h}),this._schema=h;const v=o.fromJSON(this._source.service.outSpatialReference),x=new m({fields:this._source.metadata.fieldsIndex,spatialReference:v});if((u||j||l)&&(await this._attributeStore.update(h.storage,x,this._source.metadata,v,s),this._strategy?.invalidateAttributeData(w(h))),!a&&!j&&!I)return;(y||g||I)&&await this._updateStrategy(h.mesh.strategy,v,n,w(h)),this._updateSortKey(x,"sortKey"in h.mesh.properties?h.mesh.properties.sortKey:null);const R=new d(x,this._proxy,r,this._registry);(p||"dictionary"===h.mesh.factory.symbology.type)&&(this._factory=await c.create(R,h.mesh.factory)),this.requestInvalidateMesh(),this._version=s}requestInvalidateMesh(){this._invalidateRequested=!0}async applyOverrideUpdate(e){if(!this._strategy)return;const t=this._strategy.applyOverrideUpdate(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){this._invalidateRequested&&(this._invalidate(),this._invalidateRequested=!1),await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy)return void this._attributeStore.setHighlight(e.map((({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1}))),e);const t=this._strategy.displayMap(e,(({objectId:e})=>e),((e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t})));this._attributeStore.setHighlight(t,e)}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new g({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch((e=>s(e)));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new _(this._source,this._attributeStore,r);break;case"binning":this._strategy=await p.create(e,t,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await y.create(this._connection,e,t,this._source,this._attributeStore,r)}for(const i of s)this._strategy.onSubscribe(i)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}await this._fetchResources(e),r(t.signal);const s=await this._write(e,t.tile.createArcadeEvaluationOptions(w(this._schema))),i=t.tile.tileInfoView.getLODInfoAt(t.tile.key),{message:a,transferList:o}=s.serialize(i),n={objectIdMap:null,inner:e.createMessage(a,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){n.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)n.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(n,{signal:t.signal,transferList:o}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e){await this._fetchMatcherResources(e),await this._fetchWriterResources(e)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e){if(!e.reader)return;const t=e.reader.getCursor(),s=e.subscription.tile.createArcadeEvaluationOptions(w(this._schema));for(;t.next();)this._factory.enqueueWriterRequests(this._proxy,t,s);await this._proxy.fetchEnqueuedResources()}async _write(e,t){const s=e.subscription.tile,r=e.reader?.getCursor(),i=r?.getSize()??0,a=s.tileInfoView.tileInfo.isWrappable,o=s.tileInfoView.tileInfo.spatialReference.isWGS84,c=new n(s.key,this._strategy.enablePixelBuffering,a,o,i);if(!r)return c;const h=s.createArcadeEvaluationOptions(w(this._schema));for(;r.next();){const e=this._getSortKeyValue(r,t);c.entityStart(r.getDisplayId(),e),this._factory.write(c,this._proxy,r,h,s.level),c.entityEnd()}return c}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function b(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function w(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}export{f as default};
|