@arcgis/core 4.33.0-next.20250304 → 4.33.0-next.20250306

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/arcade/arcadeCompiler.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{e99d7ecb80a9df9ead6d.js → 1e7a70a1871fea29169e.js} +3 -3
  4. package/assets/esri/core/workers/chunks/{618016fc1165bcfc2b0d.js → 42b862550c96cc1be956.js} +7 -9
  5. package/assets/esri/core/workers/chunks/4403b3f08907e88d0d91.js +1 -0
  6. package/assets/esri/core/workers/chunks/{0e2d9cd4e8ee5a62b05c.js → 45eee326f7a649c5a15b.js} +7 -9
  7. package/assets/esri/core/workers/chunks/7975ada96e4540a37c83.js +1 -0
  8. package/assets/esri/core/workers/chunks/e3e049311bced533c853.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b464b7800a2ddd92b9a7.js → e8a19f9144df8f155e30.js} +1 -1
  10. package/assets/esri/core/workers/chunks/f4111bb5e5a4910b684a.js +1 -0
  11. package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
  12. package/chunks/Clouds.glsl.js +19 -23
  13. package/chunks/ImageMaterial.glsl.js +1 -1
  14. package/core/Accessor.js +1 -1
  15. package/core/accessorSupport/decorators/subclass.js +1 -1
  16. package/core/accessorSupport/interfaces.js +1 -1
  17. package/interfaces.d.ts +8 -4
  18. package/layers/mixins/ArcGISImageService.js +1 -1
  19. package/layers/support/featureLayerUtils.js +1 -1
  20. package/libs/parquet/parquet.js +1 -1
  21. package/package.json +1 -1
  22. package/request.js +1 -1
  23. package/rest/support/IdentifyParameters.js +1 -1
  24. package/support/revision.js +1 -1
  25. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  26. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  27. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  28. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  29. package/views/3d/environment/Clouds.glsl.js +1 -1
  30. package/views/3d/environment/CloudsParameters.js +1 -1
  31. package/views/3d/environment/CloudsRenderer.js +1 -1
  32. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  33. package/views/3d/layers/MediaLayerView3D.js +1 -1
  34. package/views/3d/layers/support/FeatureTile.js +1 -1
  35. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  36. package/views/3d/support/StreamTextureCollection.js +1 -1
  37. package/views/3d/support/TextureCollection.js +1 -1
  38. package/views/3d/terrain/TerrainRenderer.js +1 -1
  39. package/views/3d/terrain/TerrainSurface.js +1 -1
  40. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +7 -7
  41. package/views/3d/webgl-engine/core/shaderLibrary/util/DoublePrecision.glsl.js +5 -7
  42. package/views/3d/webgl-engine/core/shaderLibrary/util/LookupCloudsFromTextureArray.glsl.js +51 -0
  43. package/views/3d/webgl-engine/lib/GLMaterialParameters.js +5 -0
  44. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  45. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  46. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  47. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  48. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  49. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  50. package/views/animation/pointToPoint/apex/planning.js +1 -1
  51. package/views/webgl/FramebufferObject.js +1 -1
  52. package/views/webgl/TextureDescriptor.js +1 -1
  53. package/widgets/FeatureForm/FieldInput.js +1 -1
  54. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  55. package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
  56. package/assets/esri/core/workers/chunks/04341d50082f864025aa.js +0 -1
  57. package/assets/esri/core/workers/chunks/10118666a5a5b141ece6.js +0 -1
  58. package/assets/esri/core/workers/chunks/64d3e683872791eb6ae9.js +0 -1
  59. package/assets/esri/core/workers/chunks/8b057b5a606ac3669a78.js +0 -1
  60. package/views/3d/webgl-engine/core/shaderLibrary/util/LookupCubemapFromTextureArray.glsl.js +0 -39
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../../kernel.js";import{resultOrAbort as t}from"../../core/asyncUtils.js";import r from"../../core/Error.js";import{JSONMap as n}from"../../core/jsonMap.js";import{parseWhereClause as o}from"../../core/sql.js";import{normalizeGlobalID as i}from"../../core/uuid.js";import{createTypeReader as s}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{CodedValue as a}from"./CodedValue.js";import u from"./CodedValueDomain.js";import{queryAllJSON as c}from"./featureQueryAll.js";import{isStringField as l,isIntegerField as p}from"./fieldUtils.js";import{getOwningPortalUrl as d,isLayerWithFeatureCapabilities as f}from"./layerUtils.js";import y from"../../renderers/SimpleRenderer.js";import m from"../../renderers/UniqueValueRenderer.js";import h from"../../rest/support/AttachmentQuery.js";import{normalizationTypeJsonMap as w}from"../../rest/support/NormalizationBinParametersMixin.js";import b from"../../rest/support/Query.js";import g from"../../rest/support/RelationshipQuery.js";import{symbolTypesRenderer as I}from"../../symbols/support/typeUtils.js";const j=new n({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function F(e,t,n,o){const i=await $(e);if(await x(e,t,o),!i.addAttachment)throw new r(o,"Layer source does not support addAttachment capability");return i.addAttachment(t,n)}function x(e,t,n){const{attributes:o}=t,{objectIdField:i}=e;return e.capabilities?.data?.supportsAttachment?t?o?i&&o[i]?Promise.resolve():Promise.reject(new r(n,`feature is missing the identifying attribute ${i}`)):Promise.reject(new r(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new r(n,"A feature is required to add/delete/update attachments")):Promise.reject(new r(n,"this layer doesn't support attachments"))}async function P(e,t,n,o,i){const s=await $(e);if(await x(e,t,i),!s.updateAttachment)throw new r(i,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,n,o)}async function q(e,t,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await e.load();let i=r;return"feature"===o.type&&o.infoFor3D&&null!=t.deleteFeatures&&null!=o.globalIdField&&(i={...i,globalIdToObjectId:await ne(o,t.deleteFeatures,o.globalIdField)}),n(o,o.source,t,r)}async function S(e,t,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await e.load();return n(o,o.source,t,r)}async function v(e,t,n,o){const i=await $(e);if(await x(e,t,o),!i.deleteAttachments)throw new r(o,"Layer source does not support deleteAttachments capability");return i.deleteAttachments(t,n)}async function O(e,t,n){const o=(await e.load({signal:t?.signal})).source;if(!o.fetchRecomputedExtents)throw new r(n,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(t)}async function A(e,t,n,o){t=h.from(t),await e.load();const i=e.source,s=e.capabilities;if(!s?.data?.supportsAttachment)throw new r(o,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:u,globalIds:c,num:l,size:p,start:d,where:f}=t;if(!s?.operations?.supportsQueryAttachments){if(a?.length>0||c?.length>0||p?.length>0||l||d||f)throw new r(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t)}if(!(u?.length||c?.length||f))throw new r(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!i.queryAttachments)throw new r(o,"Layer source does not support queryAttachments capability",t);return!s?.attachment?.supportsOrderByFields&&t.orderByFields?.length&&((t=t.clone()).orderByFields=null),i.queryAttachments(t)}async function L(e,t,n,o){const i=await $(e);if(!i.queryObjectIds)throw new r(o,"Layer source does not support queryObjectIds capability");return i.queryObjectIds(b.from(t)??e.createQuery(),n)}async function E(e,t,n,o){const i=await $(e);if(!i.queryFeatureCount)throw new r(o,"Layer source does not support queryFeatureCount capability");return i.queryFeatureCount(b.from(t)??e.createQuery(),n)}async function D(e,t,n,o){const i=await $(e);if(!i.queryExtent)throw new r(o,"Layer source does not support queryExtent capability");return i.queryExtent(b.from(t)??e.createQuery(),n)}async function T(e,t,n,o){const i=await $(e);if(!i.queryRelatedFeatures)throw new r(o,"Layer source does not support queryRelatedFeatures capability");return i.queryRelatedFeatures(g.from(t),n)}async function C(e,t,n,o){const i=await $(e);if(!i.queryRelatedFeaturesCount)throw new r(o,"Layer source does not support queryRelatedFeaturesCount capability");return i.queryRelatedFeaturesCount(g.from(t),n)}async function B(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await o(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function R(e){const t=new b;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,t.outFields=["*"],t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null;const r=e.capabilities?.query;t.compactGeometryEnabled=!!r?.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=!!r?.supportsDefaultSpatialReference;const n=e.capabilities?.data;n?.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),n?.supportsM&&null!=e.returnM&&(t.returnM=e.returnM);const{timeOffset:o,timeExtent:i}=e;return t.timeExtent=null!=o&&null!=i?i.offset(-o.value,o.unit):i||null,t}function M(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function k(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function z(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}function N(e,t,r,n){const o=r?.feature,i=!!e.subtypes?.length;if(i&&!r?.excludeImpliedDomains){const r=V(e,t);if(r)return r}const s=i&&U(e,o);if(s){const e=s?.domains?.[t];return"inherited"===e?.type?n:e}const a=oe(e.types,e.typeIdField,o);if(a){const e=a.domains&&a.domains[t];if(e&&"inherited"!==e?.type)return e}if(n)return n;if(!r?.excludeImpliedDomains){const r=G(e,t);if(r)return r}return null}function U(e,t){const{subtypes:r,subtypeField:n}=e;if(!t?.attributes||!r?.length||!n)return null;const o=t.attributes[n];return null==o?null:r.find((e=>e.code===o))}function V(e,t){const{fieldsIndex:r,subtypeField:n}=e,{name:o,type:i}=r.get(t)??{};if(!o)return null;if((n&&r.get(n)?.name)===o&&e.subtypes?.length){const t=e.subtypes.map((e=>new a({code:Q(e.code,i),name:e.name})));if(t?.length)return new u({codedValues:t})}return null}function G(e,t){const{fieldsIndex:r}=e,{name:n,type:o}=r.get(t)??{};if(!n)return null;if(("typeIdField"in e?r.get(e.typeIdField)?.name:null)===n&&"types"in e&&e.types?.length){const t=e.types.map((e=>new a({code:Q(e.id,o),name:e.name})));return new u({codedValues:t})}return null}function Q(e,t){return t?l({type:t})&&"number"==typeof e?`${e}`:p({type:t})&&"string"==typeof e?Number.parseInt(e,10):e:e}async function $(e){return(await e.load()).source}async function J(t,r){if(!e)return;const n=e.findCredential(t);if(n)return n.userId;let o;try{const n=await d(t,r);n&&(o=await e.checkSignInStatus(`${n}/sharing`))}catch(i){}return o?o.userId:null}async function Z(t,r){if(!e)return;if(e.findCredential(t))return;let n;try{const o=await d(t,r);o&&(n=await e.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await e.getCredential(t,{signal:n})}catch(o){}}async function H(e,t,r){const n=e.parsedUrl?.path;n&&e.authenticationTriggerEvent===t&&await Z(n,r)}async function W(e){const t=e.parsedUrl?.path;t&&_(e)&&await Z(t)}function _(e){return K(e)&&("serviceDefinitionExpression"in e&&X(e.serviceDefinitionExpression)||"definitionExpression"in e&&X(e.definitionExpression))}function K(e){return!(!f(e)||!e.capabilities?.query.supportsCurrentUser)}function X(e){return!!e?.toLowerCase().includes("current_user")}function Y(e){return!ie(e)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const ee=s({types:I});function te(e,t){if(e.defaultSymbol)return e.types?.length?new m({defaultSymbol:ee(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:ee(e.symbol,e,t)})))}):new y({symbol:ee(e.defaultSymbol,e,t)})}function re(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function ne(e,r,n){if(null==r)return null;const o=[],{objectIdField:s}=e;if(r.forEach((e=>{let t=null;if("attributes"in e){const{attributes:r}=e;t={globalId:r[n],objectId:null!=r[s]&&-1!==r[s]?r[s]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||o.push(t.globalId))})),0===o.length)return null;const a=e.createQuery();a.where=o.map((e=>`${n}='${e}'`)).join(" OR "),a.returnGeometry=!1,a.outFields=[s,n],a.cacheHint=!1;const u=await t(c(e,a));if(!u.ok)return null;const l=new Map,p=u.value.features;for(const t of p){const e=t.attributes[n],r=t.attributes[s];null!=e&&null!=r&&-1!==r&&l.set(i(e),r)}return l}function oe(e,t,r){if(!t||!r||!e)return null;const n=r.getAttribute(t);return null==n?null:e.find((e=>{const{id:t}=e;return null!=t&&t.toString()===n.toString()}))??null}function ie(e){return e.sourceJSON?.isMultiServicesView||se(e)}function se(e){return!!e.sourceJSON?.capabilities?.toLowerCase().split(",").map((e=>e.trim())).includes("map")}function ae(e,t,n){const o=t?.queryAttributeBins;if(!o)throw new r(n,"Layer source does not support binning");switch(e.binParameters.type){case"auto-interval":if(!o.supportsAutoInterval)throw new r(n,"Layer source does not support auto-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!ue(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning");break;case"date":if(!o.supportsDate)throw new r(n,"Layer source does not support date binning");if(e.binParameters.snapToData&&!o.supportsSnapToData)throw new r(n,"Layer source does not support snapToData binning");if(e.binParameters.returnFullIntervalBin&&!o.supportsReturnFullIntervalBin)throw new r(n,"Layer source does not support returnFullIntervalBin binning");break;case"fixed-boundaries":if(!o.supportsFixedBoundaries)throw new r(n,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!o.supportsFixedInterval)throw new r(n,"Layer source does not support fixed-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!ue(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning")}if(e.binParameters.stackBy&&!o.supportsStackBy)throw new r(n,"Layer source does not support stackBy binning");if(e.binParameters.splitBy&&!o.supportsSplitBy)throw new r(n,"Layer source does not support splitBy binning");if(e.binParameters.firstDayOfWeek&&!o.supportsFirstDayOfWeek)throw new r(n,"Layer source does not support firstDayOfWeek binning");const i=o?.supportedStatistics;if(e.outStatistics&&i){const t=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:o}of e.outStatistics){const e=t.get(o);if(e&&!i[e])throw new r(n,`Layer source does not support ${o} statistic type`)}}}function ue(e,t){return null!=e&&!!t?.[w.toJSON(e)]}export{F as addAttachment,q as applyEdits,W as checkServiceCurrentUserSupport,V as computeDomainFromSubtypes,G as computeDomainFromTypes,Y as computeEffectiveEditingEnabled,te as createDefaultRenderer,R as createQuery,v as deleteAttachments,Z as ensureCredentialIfSignedIn,H as ensureLayerCredential,O as fetchRecomputedExtents,j as geometryTypeKebabDict,U as getFeatureSubtype,oe as getFeatureType,N as getFieldDomain,ne as getGlobalIdToObjectIdMap,J as getSignedInUser,X as hasCurrentUser,B as hasDataChanged,re as isLayerCacheStale,A as queryAttachments,D as queryExtent,E as queryFeatureCount,L as queryObjectIds,T as queryRelatedFeatures,C as queryRelatedFeaturesCount,M as readGlobalIdField,k as readObjectIdField,z as readVersion,ie as supportsQueryOnly,P as updateAttachment,S as uploadAssets,ae as validateBinsQuery};
5
+ import{id as e}from"../../kernel.js";import{resultOrAbort as t}from"../../core/asyncUtils.js";import r from"../../core/Error.js";import{JSONMap as n}from"../../core/jsonMap.js";import{parseWhereClause as o}from"../../core/sql.js";import{normalizeGlobalID as i}from"../../core/uuid.js";import{createTypeReader as s}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{CodedValue as a}from"./CodedValue.js";import u from"./CodedValueDomain.js";import{queryAllJSON as c}from"./featureQueryAll.js";import{isStringField as l,isIntegerField as p}from"./fieldUtils.js";import{getOwningPortalUrl as d,isLayerWithFeatureCapabilities as f}from"./layerUtils.js";import y from"../../renderers/SimpleRenderer.js";import m from"../../renderers/UniqueValueRenderer.js";import h from"../../rest/support/AttachmentQuery.js";import{normalizationTypeJsonMap as w}from"../../rest/support/NormalizationBinParametersMixin.js";import b from"../../rest/support/Query.js";import g from"../../rest/support/RelationshipQuery.js";import{symbolTypesRenderer as I}from"../../symbols/support/typeUtils.js";const j=new n({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function F(e,t,n,o){const i=await $(e);if(await x(e,t,o),!i.addAttachment)throw new r(o,"Layer source does not support addAttachment capability");return i.addAttachment(t,n)}function x(e,t,n){const{attributes:o}=t,{objectIdField:i}=e;return e.capabilities?.data?.supportsAttachment?t?o?i&&o[i]?Promise.resolve():Promise.reject(new r(n,`feature is missing the identifying attribute ${i}`)):Promise.reject(new r(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new r(n,"A feature is required to add/delete/update attachments")):Promise.reject(new r(n,"this layer doesn't support attachments"))}async function P(e,t,n,o,i){const s=await $(e);if(await x(e,t,i),!s.updateAttachment)throw new r(i,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,n,o)}async function q(e,t,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await e.load();let i=r;return"feature"===o.type&&o.infoFor3D&&null!=t.deleteFeatures&&null!=o.globalIdField&&(i={...i,globalIdToObjectId:await ne(o,t.deleteFeatures,o.globalIdField)}),n(o,o.source,t,r)}async function S(e,t,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await e.load();return n(o,o.source,t,r)}async function v(e,t,n,o){const i=await $(e);if(await x(e,t,o),!i.deleteAttachments)throw new r(o,"Layer source does not support deleteAttachments capability");return i.deleteAttachments(t,n)}async function O(e,t,n){const o=(await e.load({signal:t?.signal})).source;if(!o.fetchRecomputedExtents)throw new r(n,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(t)}async function A(e,t,n,o){t=h.from(t),await e.load();const i=e.source,s=e.capabilities;if(!s?.data?.supportsAttachment)throw new r(o,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:u,globalIds:c,num:l,size:p,start:d,where:f}=t;if(!s?.operations?.supportsQueryAttachments){if(a?.length>0||c?.length>0||p?.length>0||l||d||f)throw new r(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t)}if(!(u?.length||c?.length||f))throw new r(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!i.queryAttachments)throw new r(o,"Layer source does not support queryAttachments capability",t);return!s?.attachment?.supportsOrderByFields&&t.orderByFields?.length&&((t=t.clone()).orderByFields=null),i.queryAttachments(t)}async function L(e,t,n,o){const i=await $(e);if(!i.queryObjectIds)throw new r(o,"Layer source does not support queryObjectIds capability");return i.queryObjectIds(b.from(t)??e.createQuery(),n)}async function E(e,t,n,o){const i=await $(e);if(!i.queryFeatureCount)throw new r(o,"Layer source does not support queryFeatureCount capability");return i.queryFeatureCount(b.from(t)??e.createQuery(),n)}async function D(e,t,n,o){const i=await $(e);if(!i.queryExtent)throw new r(o,"Layer source does not support queryExtent capability");return i.queryExtent(b.from(t)??e.createQuery(),n)}async function T(e,t,n,o){const i=await $(e);if(!i.queryRelatedFeatures)throw new r(o,"Layer source does not support queryRelatedFeatures capability");return i.queryRelatedFeatures(g.from(t),n)}async function C(e,t,n,o){const i=await $(e);if(!i.queryRelatedFeaturesCount)throw new r(o,"Layer source does not support queryRelatedFeaturesCount capability");return i.queryRelatedFeaturesCount(g.from(t),n)}async function B(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await o(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function R(e){const t=new b;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,t.outFields=["*"],t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null;const r=e.capabilities?.query;r&&(t.compactGeometryEnabled=r.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference);const n=e.capabilities?.data;n?.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),n?.supportsM&&null!=e.returnM&&(t.returnM=e.returnM);const{timeOffset:o,timeExtent:i}=e;return t.timeExtent=null!=o&&null!=i?i.offset(-o.value,o.unit):i||null,t}function M(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function k(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function z(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}function N(e,t,r,n){const o=r?.feature,i=!!e.subtypes?.length;if(i&&!r?.excludeImpliedDomains){const r=V(e,t);if(r)return r}const s=i&&U(e,o);if(s){const e=s?.domains?.[t];return"inherited"===e?.type?n:e}const a=oe(e.types,e.typeIdField,o);if(a){const e=a.domains&&a.domains[t];if(e&&"inherited"!==e?.type)return e}if(n)return n;if(!r?.excludeImpliedDomains){const r=G(e,t);if(r)return r}return null}function U(e,t){const{subtypes:r,subtypeField:n}=e;if(!t?.attributes||!r?.length||!n)return null;const o=t.attributes[n];return null==o?null:r.find((e=>e.code===o))}function V(e,t){const{fieldsIndex:r,subtypeField:n}=e,{name:o,type:i}=r.get(t)??{};if(!o)return null;if((n&&r.get(n)?.name)===o&&e.subtypes?.length){const t=e.subtypes.map((e=>new a({code:Q(e.code,i),name:e.name})));if(t?.length)return new u({codedValues:t})}return null}function G(e,t){const{fieldsIndex:r}=e,{name:n,type:o}=r.get(t)??{};if(!n)return null;if(("typeIdField"in e?r.get(e.typeIdField)?.name:null)===n&&"types"in e&&e.types?.length){const t=e.types.map((e=>new a({code:Q(e.id,o),name:e.name})));return new u({codedValues:t})}return null}function Q(e,t){return t?l({type:t})&&"number"==typeof e?`${e}`:p({type:t})&&"string"==typeof e?Number.parseInt(e,10):e:e}async function $(e){return(await e.load()).source}async function J(t,r){if(!e)return;const n=e.findCredential(t);if(n)return n.userId;let o;try{const n=await d(t,r);n&&(o=await e.checkSignInStatus(`${n}/sharing`))}catch(i){}return o?o.userId:null}async function Z(t,r){if(!e)return;if(e.findCredential(t))return;let n;try{const o=await d(t,r);o&&(n=await e.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await e.getCredential(t,{signal:n})}catch(o){}}async function H(e,t,r){const n=e.parsedUrl?.path;n&&e.authenticationTriggerEvent===t&&await Z(n,r)}async function W(e){const t=e.parsedUrl?.path;t&&_(e)&&await Z(t)}function _(e){return K(e)&&("serviceDefinitionExpression"in e&&X(e.serviceDefinitionExpression)||"definitionExpression"in e&&X(e.definitionExpression))}function K(e){return!(!f(e)||!e.capabilities?.query.supportsCurrentUser)}function X(e){return!!e?.toLowerCase().includes("current_user")}function Y(e){return!ie(e)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const ee=s({types:I});function te(e,t){if(e.defaultSymbol)return e.types?.length?new m({defaultSymbol:ee(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:ee(e.symbol,e,t)})))}):new y({symbol:ee(e.defaultSymbol,e,t)})}function re(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function ne(e,r,n){if(null==r)return null;const o=[],{objectIdField:s}=e;if(r.forEach((e=>{let t=null;if("attributes"in e){const{attributes:r}=e;t={globalId:r[n],objectId:null!=r[s]&&-1!==r[s]?r[s]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||o.push(t.globalId))})),0===o.length)return null;const a=e.createQuery();a.where=o.map((e=>`${n}='${e}'`)).join(" OR "),a.returnGeometry=!1,a.outFields=[s,n],a.cacheHint=!1;const u=await t(c(e,a));if(!u.ok)return null;const l=new Map,p=u.value.features;for(const t of p){const e=t.attributes[n],r=t.attributes[s];null!=e&&null!=r&&-1!==r&&l.set(i(e),r)}return l}function oe(e,t,r){if(!t||!r||!e)return null;const n=r.getAttribute(t);return null==n?null:e.find((e=>{const{id:t}=e;return null!=t&&t.toString()===n.toString()}))??null}function ie(e){return e.sourceJSON?.isMultiServicesView||se(e)}function se(e){return!!e.sourceJSON?.capabilities?.toLowerCase().split(",").map((e=>e.trim())).includes("map")}function ae(e,t,n){const o=t?.queryAttributeBins;if(!o)throw new r(n,"Layer source does not support binning");switch(e.binParameters.type){case"auto-interval":if(!o.supportsAutoInterval)throw new r(n,"Layer source does not support auto-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!ue(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning");break;case"date":if(!o.supportsDate)throw new r(n,"Layer source does not support date binning");if(e.binParameters.snapToData&&!o.supportsSnapToData)throw new r(n,"Layer source does not support snapToData binning");if(e.binParameters.returnFullIntervalBin&&!o.supportsReturnFullIntervalBin)throw new r(n,"Layer source does not support returnFullIntervalBin binning");break;case"fixed-boundaries":if(!o.supportsFixedBoundaries)throw new r(n,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!o.supportsFixedInterval)throw new r(n,"Layer source does not support fixed-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!ue(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning")}if(e.binParameters.stackBy&&!o.supportsStackBy)throw new r(n,"Layer source does not support stackBy binning");if(e.binParameters.splitBy&&!o.supportsSplitBy)throw new r(n,"Layer source does not support splitBy binning");if(e.binParameters.firstDayOfWeek&&!o.supportsFirstDayOfWeek)throw new r(n,"Layer source does not support firstDayOfWeek binning");const i=o?.supportedStatistics;if(e.outStatistics&&i){const t=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:o}of e.outStatistics){const e=t.get(o);if(e&&!i[e])throw new r(n,`Layer source does not support ${o} statistic type`)}}}function ue(e,t){return null!=e&&!!t?.[w.toJSON(e)]}export{F as addAttachment,q as applyEdits,W as checkServiceCurrentUserSupport,V as computeDomainFromSubtypes,G as computeDomainFromTypes,Y as computeEffectiveEditingEnabled,te as createDefaultRenderer,R as createQuery,v as deleteAttachments,Z as ensureCredentialIfSignedIn,H as ensureLayerCredential,O as fetchRecomputedExtents,j as geometryTypeKebabDict,U as getFeatureSubtype,oe as getFeatureType,N as getFieldDomain,ne as getGlobalIdToObjectIdMap,J as getSignedInUser,X as hasCurrentUser,B as hasDataChanged,re as isLayerCacheStale,A as queryAttachments,D as queryExtent,E as queryFeatureCount,L as queryObjectIds,T as queryRelatedFeatures,C as queryRelatedFeaturesCount,M as readGlobalIdField,k as readObjectIdField,z as readVersion,ie as supportsQueryOnly,P as updateAttachment,S as uploadAssets,ae as validateBinsQuery};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{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};
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 Q{static __wrap(t){t>>>=0;const e=Object.create(Q.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 K="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,K.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,K.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(Q.__wrap(t))},t.wbg.__wbg_pageencodingdescriptor_new=function(t){return s(kt.__wrap(t))},t.wbg.__wbindgen_closure_wrapper1832=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:Q,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}`},useRequestQueue:!0});return o},Nt=t=>async function(_){const n=t(),{data:r}=await e(_,{responseType:"native",method:"head",query:n,useRequestQueue:!0}),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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250304",
3
+ "version": "4.33.0-next.20250306",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
package/request.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"./config.js";import{id as r}from"./kernel.js";import t from"./core/Error.js";import has from"./core/has.js";import{clone as s}from"./core/lang.js";import{getOrCreateMapValue as o}from"./core/MapUtils.js";import{onAbort as n,isAbortError as a,createAbortError as i,isAborted as l}from"./core/promiseUtils.js";import{queryToObject as u,isDataProtocol as c,isBlobProtocol as d,normalize as p,getInterceptor as m,isTrustedServer as h,getOrigin as f,toHTTPS as y,objectToQuery as w,getProxyRule as g,getProxyUrl as q,addQueryParameters as b,hasSameOrigin as S,getAppUrl as T,addProxyRule as k}from"./core/urlUtils.js";import{isHostedAgolService as O}from"./layers/support/arcgisLayerUrl.js";import{isSecureProxyService as v}from"./portal/support/urlUtils.js";import{isApiKeyApplicable as C}from"./support/apiKeyUtils.js";import{registerNoCorsDomains as x,isNoCorsRequestRequired as L,sendNoCorsRequest as E,createTimeoutError as U,loadImageAsync as j}from"./support/requestUtils.js";async function P(e,r){e instanceof URL&&(e=e.toString()),r?.query instanceof URLSearchParams&&(r.query=u(r.query.toString().replaceAll("+"," ")));const t=c(e),s=d(e);s||t||(e=p(e));const o={url:e,requestOptions:{...r}},a=e=>({data:e,getAllHeaders:I,getHeader:I,httpStatus:200,requestOptions:o.requestOptions,url:o.url}),i=m(e,H.internalInterceptors);if(i){const e=await K(i,o);if(null!=e)return a(e)}let l=m(e);if(l){const e=await K(l,o);if(null!=e)return a(e);l.after||l.error||(l=null)}if(e=o.url,"image"===(r=o.requestOptions).responseType&&(has("host-webworker")||has("host-node")))throw $("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),o);if("head"===r.method){if(r.body)throw $("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),o);if(t||s)throw $("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),o)}if(await z(),A)return A.execute(e,r);const h=new AbortController,f=n(r,(()=>h.abort())),y={controller:h,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:l,params:o,redoRequest:!1,useIdentity:H.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},w=r.useRequestQueue?Z(y):ee(y),g=await w.finally((()=>f?.remove()));return l?.after?.(g),g}let A;const H=e.request,R="FormData"in globalThis,_=new Set([499,498,403,401]),D=new Set(["COM_0056","COM_0057","SB_0008"]),F=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],I=()=>null,M=Symbol();function N(e){const r=f(e);r&&!P._corsServers.includes(r)&&P._corsServers.push(r)}function B(e){const r=f(e);return!r||r.endsWith(".arcgis.com")||P._corsServers.includes(r)||h(r)}function $(e,r,o,n){let l="Error";const u={url:o.url,requestOptions:o.requestOptions,getAllHeaders:I,getHeader:I,ssl:!1};if(r instanceof t)return r.details?(r.details=s(r.details),r.details.url=o.url,r.details.requestOptions=o.requestOptions):r.details=u,r;if(r){const e=n&&(()=>Array.from(n.headers)),t=n&&(e=>n.headers.get(e)),s=n?.status,o=r.message;o&&(l=o),e&&t&&(u.getAllHeaders=e,u.getHeader=t),u.httpStatus=(null!=r.httpCode?r.httpCode:r.code)||s||0,u.subCode=r.subcode,u.messageCode=r.messageCode,"string"==typeof r.details?u.messages=[r.details]:u.messages=r.details,u.raw=M in r?r[M]:r}return a(r)?i():new t(e,l,u)}async function z(){has("host-webworker")&&!A&&(A=await import("./core/workers/request.js"))}async function Q(){r||await import("./identity/IdentityManager.js")}async function W(t){const s=t.params.url,o=t.params.requestOptions,n=t.controller.signal,a=o.body;let i=null,u=null;if(R&&"HTMLFormElement"in globalThis&&(a instanceof FormData?i=a:a instanceof HTMLFormElement&&(i=new FormData(a))),"string"==typeof a&&(u=a),t.fetchOptions={cache:o.cacheBust?"no-cache":"default",credentials:"same-origin",headers:o.headers||{},method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:H.priority,redirect:"follow",signal:n},(i||u)&&(t.fetchOptions.body=i||u),"anonymous"===o.authMode&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(s)||o.query?.token||i?.get("token")),!t.hasToken&&C(s)&&(o.query||(o.query={}),o.query.token=e.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!G(s)&&!l(n)){let e;"immediate"===o.authMode?(await Q(),e=await r.getCredential(s,{signal:n}),t.credential=e):"no-prompt"===o.authMode?(await Q(),e=await r.getCredential(s,{prompt:!1,signal:n}).catch((()=>{})),t.credential=e):r&&(e=r.findCredential(s)),e&&(t.credentialToken=e.token,t.useSSL=!!e.ssl)}}function G(e){return F.some((r=>r.test(e)))}async function J(e){let t=e.params.url;const s=e.params.requestOptions,o=e.fetchOptions??{},n=d(t)||c(t),a=s.responseType||"json",l=n?0:null!=s.timeout?s.timeout:H.timeout;let u=!1;if(!n){e.useSSL&&(t=y(t));let n={...s.query};e.credentialToken&&(n.token=e.credentialToken);let a=w(n);has("esri-url-encodes-apostrophe")&&(a=a.replaceAll("'","%27"));const i=t.length+1+a.length;let l;u="delete"===s.method||"post"===s.method||"put"===s.method||!!s.body||i>H.maxUrlLength;const c=s.useProxy||!!g(t);if(c){const e=q(t);l=e.path,!u&&l.length+1+i>H.maxUrlLength&&(u=!0),e.query&&(n={...e.query,...n})}if("HEAD"===o.method&&(u||c)){if(u){if(i>H.maxUrlLength)throw $("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw $("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(c)throw $("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(u?(o.method="delete"===s.method?"DELETE":"put"===s.method?"PUT":"POST",s.body?t=b(t,n):(o.body=w(n),o.headers||(o.headers={}),o.headers["Content-Type"]="application/x-www-form-urlencoded")):t=b(t,n),c&&(e.useProxy=!0,t=`${l}?${t}`),n.token&&R&&o.body instanceof FormData&&!v(t)&&o.body.set("token",n.token),s.hasOwnProperty("withCredentials"))e.withCredentials=s.withCredentials;else if(!S(t,T()))if(h(t))e.withCredentials=!0;else if(r){const s=r.findServerInfo(t);s?.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(o.credentials="include",L(t)&&await E(u?b(t,n):t))}let p,m,O=0,C=!1;l>0&&(O=setTimeout((()=>{C=!0,e.controller.abort()}),l));try{if("native-request-init"===s.responseType)m=o,m.url=t,s.signal?m.signal=s.signal:delete m.signal;else if("image"!==s.responseType||"default"!==o.cache||"GET"!==o.method||u||X(s.headers)||!n&&!e.useProxy&&H.proxyUrl&&!B(t)){if(P._beforeFetch&&await P._beforeFetch(t,o),p=await fetch(t,o),P._afterFetch&&await P._afterFetch(p),e.useProxy||N(t),"native"===s.responseType)m=p;else if("HEAD"!==o.method)if(p.ok){switch(a){case"array-buffer":m=await p.arrayBuffer();break;case"blob":case"image":m=await p.blob();break;default:m=await p.text()}if(O&&(clearTimeout(O),O=0),"json"===a||"xml"===a||"document"===a)if(m)switch(a){case"json":m=JSON.parse(m);break;case"xml":m=V(m,"application/xml");break;case"document":m=V(m,"text/html")}else m=null;if(m){if("array-buffer"===a||"blob"===a){const e=p.headers.get("Content-Type");if(e&&/application\/json|text\/plain/i.test(e)&&m["blob"===a?"size":"byteLength"]<=750)try{const e=await new Response(m).json();e.error&&(m=e)}catch{}}"image"===a&&m instanceof Blob&&(m=await te(URL.createObjectURL(m),e,!0))}}else{m=await p.text();try{m=JSON.parse(m)}catch{}}}else m=await te(t,e)}catch(x){if("AbortError"===x.name){if(C)throw U();throw i("Request canceled")}if(!(!p&&x instanceof TypeError&&H.proxyUrl)||s.body||"delete"===s.method||"head"===s.method||"post"===s.method||"put"===s.method||e.useProxy||B(t))throw x;e.redoRequest=!0,k({proxyUrl:H.proxyUrl,urlPrefix:f(t)??""})}finally{O&&clearTimeout(O)}return[p,m]}async function K(e,r){if(null!=e.responseData)return e.responseData;if(e.headers&&(r.requestOptions.headers={...r.requestOptions.headers,...e.headers}),e.query&&(r.requestOptions.query={...r.requestOptions.query,...e.query}),e.before){let o,n;try{n=await e.before(r)}catch(s){o=$("request:interceptor",s,r)}if((n instanceof Error||n instanceof t)&&(o=$("request:interceptor",n,r)),o)throw e.error&&e.error(o),o;return n}}function X(e){if(e)for(const r of Object.getOwnPropertyNames(e))if(e[r])return!0;return!1}function V(e,r){let t;try{t=(new DOMParser).parseFromString(e,r)}catch{}if(!t||t.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return t}P._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"],P._beforeFetch=void 0,P._afterFetch=void 0;const Y=new Map;async function Z(e){const r=se(e.params.url);if(!r)return ee(e);const{QueueProcessor:t}=await import("./core/QueueProcessor.js"),s=o(Y,r.origin,(()=>{const e=r.isHosted?has("request-queue-concurrency-hosted"):has("request-queue-concurrency-non-hosted");return new t({concurrency:e,process:e=>{if(l(e.params.requestOptions))throw $("",i("Request canceled"),e.params);return ee(e)}})}));return s.push(e)}async function ee(e){let t,s;await W(e);try{do{[t,s]=await J(e)}while(!await re(e,t,s))}catch(a){const r=$("request:server",a,e.params,t);throw r.details.ssl=e.useSSL,e.interceptor?.error&&e.interceptor.error(r),r}const o=e.params.url;if(s&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(o)){if(!e.hasToken&&!e.credentialToken&&s.user?.username&&!h(o)){const e=f(o,!0);e&&H.trustedServers.push(e)}Array.isArray(s.authorizedCrossOriginNoCorsDomains)&&x(s.authorizedCrossOriginNoCorsDomains)}const n=e.credential;if(n&&r){const e=r.findServerInfo(n.server);let t=e?.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=r.findCredential(t,n.userId);e&&-1===r._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:s,getAllHeaders:t?()=>Array.from(t.headers):I,getHeader:t?e=>t.headers.get(e):I,httpStatus:t?.status??200,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function re(e,t,s){if(e.redoRequest)return e.redoRequest=!1,!1;const o=e.params.requestOptions;if(!t||"native"===o.responseType||"native-request-init"===o.responseType)return!0;let n,a;if(s&&(s.error&&"object"==typeof s.error?n=s.error:"error"===s.status&&Array.isArray(s.messages)&&(n={...s},n[M]=s,n.details=s.messages)),!n&&!t.ok)throw n=new Error(`Unable to load ${t.url} status: ${t.status}`),n[M]=s,n;let i,l=null;n&&(a=Number(n.code),l=n.hasOwnProperty("subcode")?Number(n.subcode):null,i=n.messageCode,i=i?.toUpperCase());const u=o.authMode;if(403===a&&(4===l||n.message?.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===a)&&void 0!==a&&_.has(a)&&!G(e.params.url)&&(403!==a||(!i||!D.has(i))&&(null==l||2===l&&e.credentialToken))){await Q();try{const t=await r.getCredential(e.params.url,{error:$("request:server",n,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(c){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;n=c}}if(n)throw n;return!0}function te(e,r,t=!1){const s=r.controller.signal,o=new Image;return r.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.fetchPriority=H.priority,o.src=e,j(o,e,t,s)}function se(e){let r,t;return"string"==typeof e?(r=f(e,!0),t=O(e)):(r=e.origin,t=O(e.toString())),null==r?null:{origin:r,isHosted:t}}export{P as default};
5
+ import e from"./config.js";import{id as r}from"./kernel.js";import t from"./core/Error.js";import has from"./core/has.js";import{clone as s}from"./core/lang.js";import{getOrCreateMapValue as o}from"./core/MapUtils.js";import{onAbort as n,isAbortError as a,createAbortError as i,isAborted as l}from"./core/promiseUtils.js";import{queryToObject as u,isDataProtocol as c,isBlobProtocol as d,normalize as p,getInterceptor as m,isTrustedServer as h,getOrigin as f,toHTTPS as y,objectToQuery as w,getProxyRule as g,getProxyUrl as q,addQueryParameters as b,hasSameOrigin as S,getAppUrl as T,addProxyRule as k}from"./core/urlUtils.js";import{isHostedAgolService as O}from"./layers/support/arcgisLayerUrl.js";import{isSecureProxyService as v}from"./portal/support/urlUtils.js";import{isApiKeyApplicable as C}from"./support/apiKeyUtils.js";import{registerNoCorsDomains as x,isNoCorsRequestRequired as L,sendNoCorsRequest as E,createTimeoutError as U,loadImageAsync as j}from"./support/requestUtils.js";async function P(e,r){e instanceof URL&&(e=e.toString()),r?.query instanceof URLSearchParams&&(r.query=u(r.query.toString().replaceAll("+"," ")));const t=c(e),s=d(e);s||t||(e=p(e));const o={url:e,requestOptions:{...r}},a=e=>({data:e,getAllHeaders:I,getHeader:I,httpStatus:200,requestOptions:o.requestOptions,url:o.url}),i=m(e,H.internalInterceptors);if(i){const e=await K(i,o);if(null!=e)return a(e)}let l=m(e);if(l){const e=await K(l,o);if(null!=e)return a(e);l.after||l.error||(l=null)}if(e=o.url,"image"===(r=o.requestOptions).responseType&&(has("host-webworker")||has("host-node")))throw $("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),o);if("head"===r.method){if(r.body)throw $("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),o);if(t||s)throw $("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),o)}if(await z(),A)return A.execute(e,r);const h=new AbortController,f=n(r,(()=>h.abort())),y={controller:h,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:l,params:o,redoRequest:!1,useIdentity:H.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},w=r.useRequestQueue?Z(y):ee(y),g=await w.finally((()=>f?.remove()));return l?.after?.(g),g}let A;const H=e.request,R="FormData"in globalThis,_=new Set([499,498,403,401]),D=new Set(["COM_0056","COM_0057","SB_0008"]),F=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],I=()=>null,M=Symbol();function N(e){const r=f(e);r&&!P._corsServers.includes(r)&&P._corsServers.push(r)}function B(e){const r=f(e);return!r||r.endsWith(".arcgis.com")||P._corsServers.includes(r)||h(r)}function $(e,r,o,n){let l;const u={url:o.url,requestOptions:o.requestOptions,getAllHeaders:I,getHeader:I,ssl:!1};if(r instanceof t)return r.details?(r.details=s(r.details),r.details.url=o.url,r.details.requestOptions=o.requestOptions):r.details=u,r;if(r){const e=n&&(()=>Array.from(n.headers)),t=n&&(e=>n.headers.get(e)),s=n?.status,o=r.message;o&&(l=o),e&&t&&(u.getAllHeaders=e,u.getHeader=t),u.httpStatus=(null!=r.httpCode?r.httpCode:r.code)||s||0,u.subCode=r.subcode,u.messageCode=r.messageCode,"string"==typeof r.details?(u.messages=[r.details],l??=r.details):(u.messages=r.details,l??=u.messages?.[0]),u.raw=M in r?r[M]:r}return l??="Error",a(r)?i():new t(e,l,u)}async function z(){has("host-webworker")&&!A&&(A=await import("./core/workers/request.js"))}async function Q(){r||await import("./identity/IdentityManager.js")}async function W(t){const s=t.params.url,o=t.params.requestOptions,n=t.controller.signal,a=o.body;let i=null,u=null;if(R&&"HTMLFormElement"in globalThis&&(a instanceof FormData?i=a:a instanceof HTMLFormElement&&(i=new FormData(a))),"string"==typeof a&&(u=a),t.fetchOptions={cache:o.cacheBust?"no-cache":"default",credentials:"same-origin",headers:o.headers||{},method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:H.priority,redirect:"follow",signal:n},(i||u)&&(t.fetchOptions.body=i||u),"anonymous"===o.authMode&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(s)||o.query?.token||i?.get("token")),!t.hasToken&&C(s)&&(o.query||(o.query={}),o.query.token=e.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!G(s)&&!l(n)){let e;"immediate"===o.authMode?(await Q(),e=await r.getCredential(s,{signal:n}),t.credential=e):"no-prompt"===o.authMode?(await Q(),e=await r.getCredential(s,{prompt:!1,signal:n}).catch((()=>{})),t.credential=e):r&&(e=r.findCredential(s)),e&&(t.credentialToken=e.token,t.useSSL=!!e.ssl)}}function G(e){return F.some((r=>r.test(e)))}async function J(e){let t=e.params.url;const s=e.params.requestOptions,o=e.fetchOptions??{},n=d(t)||c(t),a=s.responseType||"json",l=n?0:null!=s.timeout?s.timeout:H.timeout;let u=!1;if(!n){e.useSSL&&(t=y(t));let n={...s.query};e.credentialToken&&(n.token=e.credentialToken);let a=w(n);has("esri-url-encodes-apostrophe")&&(a=a.replaceAll("'","%27"));const i=t.length+1+a.length;let l;u="delete"===s.method||"post"===s.method||"put"===s.method||!!s.body||i>H.maxUrlLength;const c=s.useProxy||!!g(t);if(c){const e=q(t);l=e.path,!u&&l.length+1+i>H.maxUrlLength&&(u=!0),e.query&&(n={...e.query,...n})}if("HEAD"===o.method&&(u||c)){if(u){if(i>H.maxUrlLength)throw $("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw $("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(c)throw $("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(u?(o.method="delete"===s.method?"DELETE":"put"===s.method?"PUT":"POST",s.body?t=b(t,n):(o.body=w(n),o.headers||(o.headers={}),o.headers["Content-Type"]="application/x-www-form-urlencoded")):t=b(t,n),c&&(e.useProxy=!0,t=`${l}?${t}`),n.token&&R&&o.body instanceof FormData&&!v(t)&&o.body.set("token",n.token),s.hasOwnProperty("withCredentials"))e.withCredentials=s.withCredentials;else if(!S(t,T()))if(h(t))e.withCredentials=!0;else if(r){const s=r.findServerInfo(t);s?.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(o.credentials="include",L(t)&&await E(u?b(t,n):t))}let p,m,O=0,C=!1;l>0&&(O=setTimeout((()=>{C=!0,e.controller.abort()}),l));try{if("native-request-init"===s.responseType)m=o,m.url=t,s.signal?m.signal=s.signal:delete m.signal;else if("image"!==s.responseType||"default"!==o.cache||"GET"!==o.method||u||X(s.headers)||!n&&!e.useProxy&&H.proxyUrl&&!B(t)){if(P._beforeFetch&&await P._beforeFetch(t,o),p=await fetch(t,o),P._afterFetch&&await P._afterFetch(p),e.useProxy||N(t),"native"===s.responseType)m=p;else if("HEAD"!==o.method)if(p.ok){switch(a){case"array-buffer":m=await p.arrayBuffer();break;case"blob":case"image":m=await p.blob();break;default:m=await p.text()}if(O&&(clearTimeout(O),O=0),"json"===a||"xml"===a||"document"===a)if(m)switch(a){case"json":m=JSON.parse(m);break;case"xml":m=V(m,"application/xml");break;case"document":m=V(m,"text/html")}else m=null;if(m){if("array-buffer"===a||"blob"===a){const e=p.headers.get("Content-Type");if(e&&/application\/json|text\/plain/i.test(e)&&m["blob"===a?"size":"byteLength"]<=750)try{const e=await new Response(m).json();e.error&&(m=e)}catch{}}"image"===a&&m instanceof Blob&&(m=await te(URL.createObjectURL(m),e,!0))}}else{m=await p.text();try{m=JSON.parse(m)}catch{}}}else m=await te(t,e)}catch(x){if("AbortError"===x.name){if(C)throw U();throw i("Request canceled")}if(!(!p&&x instanceof TypeError&&H.proxyUrl)||s.body||"delete"===s.method||"head"===s.method||"post"===s.method||"put"===s.method||e.useProxy||B(t))throw x;e.redoRequest=!0,k({proxyUrl:H.proxyUrl,urlPrefix:f(t)??""})}finally{O&&clearTimeout(O)}return[p,m]}async function K(e,r){if(null!=e.responseData)return e.responseData;if(e.headers&&(r.requestOptions.headers={...r.requestOptions.headers,...e.headers}),e.query&&(r.requestOptions.query={...r.requestOptions.query,...e.query}),e.before){let o,n;try{n=await e.before(r)}catch(s){o=$("request:interceptor",s,r)}if((n instanceof Error||n instanceof t)&&(o=$("request:interceptor",n,r)),o)throw e.error&&e.error(o),o;return n}}function X(e){if(e)for(const r of Object.getOwnPropertyNames(e))if(e[r])return!0;return!1}function V(e,r){let t;try{t=(new DOMParser).parseFromString(e,r)}catch{}if(!t||t.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return t}P._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"],P._beforeFetch=void 0,P._afterFetch=void 0;const Y=new Map;async function Z(e){const r=se(e.params.url);if(!r)return ee(e);const{QueueProcessor:t}=await import("./core/QueueProcessor.js"),s=o(Y,r.origin,(()=>{const e=r.isHosted?has("request-queue-concurrency-hosted"):has("request-queue-concurrency-non-hosted");return new t({concurrency:e,process:e=>{if(l(e.params.requestOptions))throw $("",i("Request canceled"),e.params);return ee(e)}})}));return s.push(e)}async function ee(e){let t,s;await W(e);try{do{[t,s]=await J(e)}while(!await re(e,t,s))}catch(a){const r=$("request:server",a,e.params,t);throw r.details.ssl=e.useSSL,e.interceptor?.error&&e.interceptor.error(r),r}const o=e.params.url;if(s&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(o)){if(!e.hasToken&&!e.credentialToken&&s.user?.username&&!h(o)){const e=f(o,!0);e&&H.trustedServers.push(e)}Array.isArray(s.authorizedCrossOriginNoCorsDomains)&&x(s.authorizedCrossOriginNoCorsDomains)}const n=e.credential;if(n&&r){const e=r.findServerInfo(n.server);let t=e?.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=r.findCredential(t,n.userId);e&&-1===r._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:s,getAllHeaders:t?()=>Array.from(t.headers):I,getHeader:t?e=>t.headers.get(e):I,httpStatus:t?.status??200,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function re(e,t,s){if(e.redoRequest)return e.redoRequest=!1,!1;const o=e.params.requestOptions;if(!t||"native"===o.responseType||"native-request-init"===o.responseType)return!0;let n,a;if(s&&(s.error&&"object"==typeof s.error?n=s.error:"error"===s.status&&Array.isArray(s.messages)&&(n={...s},n[M]=s,n.details=s.messages)),!n&&!t.ok)throw n=new Error(`Unable to load ${t.url} status: ${t.status}`),n[M]=s,n;let i,l=null;n&&(a=Number(n.code),l=n.hasOwnProperty("subcode")?Number(n.subcode):null,i=n.messageCode,i=i?.toUpperCase());const u=o.authMode;if(403===a&&(4===l||n.message?.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===a)&&void 0!==a&&_.has(a)&&!G(e.params.url)&&(403!==a||(!i||!D.has(i))&&(null==l||2===l&&e.credentialToken))){await Q();try{const t=await r.getCredential(e.params.url,{error:$("request:server",n,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(c){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;n=c}}if(n)throw n;return!0}function te(e,r,t=!1){const s=r.controller.signal,o=new Image;return r.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.fetchPriority=H.priority,o.src=e,j(o,e,t,s)}function se(e){let r,t;return"string"==typeof e?(r=f(e,!0),t=O(e)):(r=e.origin,t=O(e.toString())),null==r?null:{origin:r,isHosted:t}}export{P as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import o from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{ensureClass as i}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import n from"../../geometry/Extent.js";import l from"../../geometry/SpatialReference.js";import{fromJSON as m}from"../../geometry/support/jsonUtils.js";import{geometryTypes as y}from"../../geometry/support/typeUtils.js";import a from"../../layers/support/Sublayer.js";import u from"../../time/TimeExtent.js";var d;let c=d=class extends o{static from(t){return i(d,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};t([r({type:Number,json:{write:!0}})],c.prototype,"dpi",void 0),t([r()],c.prototype,"floors",void 0),t([r({type:String,json:{write:!0}})],c.prototype,"gdbVersion",void 0),t([r({types:y,json:{read:m,write:!0}})],c.prototype,"geometry",void 0),t([r({type:Number,json:{write:!0}})],c.prototype,"geometryPrecision",void 0),t([r({type:Number,json:{write:!0}})],c.prototype,"height",void 0),t([r({type:Date})],c.prototype,"historicMoment",void 0),t([p("historicMoment")],c.prototype,"writeHistoricMoment",null),t([r({type:[Number],json:{write:!0}})],c.prototype,"layerIds",void 0),t([r({type:["top","visible","all","popup"],json:{write:!0}})],c.prototype,"layerOption",void 0),t([r({type:n,json:{write:!0}})],c.prototype,"mapExtent",void 0),t([r({type:Number,json:{write:!0}})],c.prototype,"maxAllowableOffset",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"returnFieldName",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"returnGeometry",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"returnM",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"returnUnformattedValues",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"returnZ",void 0),t([r({type:l,json:{write:!0}})],c.prototype,"spatialReference",void 0),t([r({type:e.ofType(a)})],c.prototype,"sublayers",void 0),t([r({type:u,json:{write:!0}})],c.prototype,"timeExtent",void 0),t([r({type:Number,json:{write:!0}})],c.prototype,"tolerance",void 0),t([r({type:Number,json:{write:!0}})],c.prototype,"width",void 0),c=d=t([s("esri.rest.support.IdentifyParameters")],c);const j=c;export{j as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import o from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{ensureClass as i}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import n from"../../geometry/Extent.js";import l from"../../geometry/SpatialReference.js";import{fromJSON as m}from"../../geometry/support/jsonUtils.js";import{geometryTypes as y}from"../../geometry/support/typeUtils.js";import a from"../../time/TimeExtent.js";var u;let d=u=class extends o{static from(t){return i(u,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};t([r({type:Number,json:{write:!0}})],d.prototype,"dpi",void 0),t([r()],d.prototype,"floors",void 0),t([r({type:String,json:{write:!0}})],d.prototype,"gdbVersion",void 0),t([r({types:y,json:{read:m,write:!0}})],d.prototype,"geometry",void 0),t([r({type:Number,json:{write:!0}})],d.prototype,"geometryPrecision",void 0),t([r({type:Number,json:{write:!0}})],d.prototype,"height",void 0),t([r({type:Date})],d.prototype,"historicMoment",void 0),t([p("historicMoment")],d.prototype,"writeHistoricMoment",null),t([r({type:[Number],json:{write:!0}})],d.prototype,"layerIds",void 0),t([r({type:["top","visible","all","popup"],json:{write:!0}})],d.prototype,"layerOption",void 0),t([r({type:n,json:{write:!0}})],d.prototype,"mapExtent",void 0),t([r({type:Number,json:{write:!0}})],d.prototype,"maxAllowableOffset",void 0),t([r({type:Boolean,json:{write:!0}})],d.prototype,"returnFieldName",void 0),t([r({type:Boolean,json:{write:!0}})],d.prototype,"returnGeometry",void 0),t([r({type:Boolean,json:{write:!0}})],d.prototype,"returnM",void 0),t([r({type:Boolean,json:{write:!0}})],d.prototype,"returnUnformattedValues",void 0),t([r({type:Boolean,json:{write:!0}})],d.prototype,"returnZ",void 0),t([r({type:l,json:{write:!0}})],d.prototype,"spatialReference",void 0),t([r({type:e})],d.prototype,"sublayers",void 0),t([r({type:a,json:{write:!0}})],d.prototype,"timeExtent",void 0),t([r({type:Number,json:{write:!0}})],d.prototype,"tolerance",void 0),t([r({type:Number,json:{write:!0}})],d.prototype,"width",void 0),d=u=t([s("esri.rest.support.IdentifyParameters")],d);const c=d;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const e="20250304",c="db1c9ce6d2dc028242dde56e5ee351ca34f0beb8";export{e as buildDate,c as commitHash};
5
+ const c="20250306",b="75980713c010199542dcbf16f3b2597275b7e01c";export{c as buildDate,b 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{clock as t}from"../../../../core/clock.js";import{destroyHandle as i,makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,syncAndInitial as r,when as a}from"../../../../core/reactiveUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import u from"../../../../geometry/Point.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{DidPointerMoveRecentlyFlag as p}from"./lengthDimensionManipulatorUtils.js";import{LengthDimensionSubTool as h}from"./LengthDimensionSubTool.js";import{pointerMoveTimeoutMs as d}from"./settings.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{newToolIntersector as y}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as T}from"../../../support/screenUtils.js";var g;!function(e){e.Ready="ready",e.Creating="creating",e.Created="created"}(g||(g={}));let S=class extends v{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this._pointerMoveTimerMs=d,this._prevPointerMoveTimeout=null}initialize(){this._intersector=y(this.view.state.viewingMode),this._lengthDimensionSubTool=new h({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([i(this._lengthDimensionSubTool),o((()=>this._clearPointerMoveTimeout())),n((()=>this.state),(e=>{e===g.Created&&this.finishToolCreation()}),r),a((()=>this.firstGrabbedManipulator),(e=>{this.selectedDimension=e.metadata}),r),n((()=>this.selectedDimension),(()=>this._resetPointerMoveTimeout()),r)])}get state(){return this.analysis.dimensions.some((e=>"length"===e.type))?null!=this._activeSubTool?g.Creating:g.Created:g.Ready}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":if(_.cancel===e.key){if(null!=this._activeSubTool&&this._activeSubTool.removeStaged())return void e.stopPropagation();this.active||(this.selectedDimension=null)}else _.delete.includes(e.key)&&this._deleteKeyHandler()}}onActivate(){this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){null!=this._activeSubTool&&(this._activeSubTool.onDeactivate(),this._activeSubTool=null)}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(null==this._activeSubTool)return;const t=this._intersectScreen(e);null!=t&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),null==this._activeSubTool)return;if(this.hasFocusedManipulators)return;const t=this._intersectScreen(e);null!=t&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_deleteKeyHandler(){null!=this._activeSubTool&&this._activeSubTool.removeStaged(),this._removeSelected()}_intersectScreen(e){const t=T(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,o=m.get();return i.getIntersectionPoint(o)?this.view.renderCoordsHelper.fromRenderCoords(o,new u({spatialReference:this.view.spatialReference})):null}_removeSelected(){null!=this.selectedDimension&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach((e=>e.manipulator.state|=p)),this._prevPointerMoveTimeout=t.setTimeout((()=>{this.manipulators.forEach((e=>e.manipulator.state&=~p))}),this._pointerMoveTimerMs)}get testInfo(){}};e([l({constructOnly:!0})],S.prototype,"view",void 0),e([l({constructOnly:!0})],S.prototype,"analysis",void 0),e([l({readOnly:!0})],S.prototype,"state",null),e([l({readOnly:!0})],S.prototype,"updating",null),e([l({readOnly:!0})],S.prototype,"cursor",null),e([l({constructOnly:!0})],S.prototype,"analysisViewData",void 0),e([l()],S.prototype,"selectedDimension",null),e([l()],S.prototype,"automaticManipulatorSelection",void 0),e([l()],S.prototype,"_activeSubTool",void 0),e([l()],S.prototype,"_lengthDimensionSubTool",void 0),S=e([c("esri.views.3d.analysis.Dimension.DimensionTool")],S);export{S as DimensionTool};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{clock as t}from"../../../../core/clock.js";import{destroyHandle as i,makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,syncAndInitial as r,when as a}from"../../../../core/reactiveUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import u from"../../../../geometry/Point.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{DidPointerMoveRecentlyFlag as p}from"./lengthDimensionManipulatorUtils.js";import{LengthDimensionSubTool as h}from"./LengthDimensionSubTool.js";import{pointerMoveTimeoutMs as d}from"./settings.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{newToolIntersector as y}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as T}from"../../../support/screenUtils.js";var g;!function(e){e.Ready="ready",e.Creating="creating",e.Created="created"}(g||(g={}));let S=class extends v{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this._pointerMoveTimerMs=d,this._prevPointerMoveTimeout=null}initialize(){this._intersector=y(this.view.state.viewingMode),this._lengthDimensionSubTool=new h({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([i(this._lengthDimensionSubTool),o((()=>this._clearPointerMoveTimeout())),n((()=>this.state),(e=>{e===g.Created&&this.finishToolCreation()}),r),a((()=>this.firstGrabbedManipulator),(e=>{this.selectedDimension=e.metadata}),r),n((()=>this.selectedDimension),(()=>this._resetPointerMoveTimeout()),r)])}get state(){return this.analysis.dimensions.some((e=>"length"===e.type))?null!=this._activeSubTool?g.Creating:g.Created:g.Ready}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":if(_.cancel===e.key){if(null!=this._activeSubTool&&this._activeSubTool.removeStaged())return void e.stopPropagation();this.active||(this.selectedDimension=null)}else _.delete.includes(e.key)&&this._deleteKeyHandler()}}onActivate(){this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){null!=this._activeSubTool&&(this._activeSubTool.onDeactivate(),this._activeSubTool=null)}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(null==this._activeSubTool)return;const t=this._intersectScreen(e);null!=t&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),null==this._activeSubTool)return;if(this.hasFocusedManipulators)return;const t=this._intersectScreen(e);null!=t&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_deleteKeyHandler(){null!=this._activeSubTool&&this._activeSubTool.removeStaged(),this._removeSelected()}_intersectScreen(e){const t=T(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,o=m.get();return i.getIntersectionPoint(o)?this.view.renderCoordsHelper.fromRenderCoords(o,new u({spatialReference:this.view.spatialReference})):null}_removeSelected(){null!=this.selectedDimension&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach((e=>e.manipulator.state|=p)),this._prevPointerMoveTimeout=t.setTimeout((()=>{this.manipulators.forEach((e=>e.manipulator.state&=~p))}),this._pointerMoveTimerMs)}get test(){}};e([l({constructOnly:!0})],S.prototype,"view",void 0),e([l({constructOnly:!0})],S.prototype,"analysis",void 0),e([l({readOnly:!0})],S.prototype,"state",null),e([l({readOnly:!0})],S.prototype,"updating",null),e([l({readOnly:!0})],S.prototype,"cursor",null),e([l({constructOnly:!0})],S.prototype,"analysisViewData",void 0),e([l()],S.prototype,"selectedDimension",null),e([l()],S.prototype,"automaticManipulatorSelection",void 0),e([l()],S.prototype,"_activeSubTool",void 0),e([l()],S.prototype,"_lengthDimensionSubTool",void 0),S=e([c("esri.views.3d.analysis.Dimension.DimensionTool")],S);export{S as DimensionTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Color.js";import{LengthDimensionMeasureType as i}from"../../../../analysis/dimensionUtils.js";import a from"../../../../analysis/LengthDimension.js";import n from"../../../../core/Accessor.js";import s from"../../../../core/Handles.js";import{destroyHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{memoize as u}from"../../../../core/memoize.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{watch as c,initial as m,sync as h,syncAndInitial as g,when as f}from"../../../../core/reactiveUtils.js";import{property as _}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as M}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import C from"../../../../geometry/Point.js";import{clonePoint as S}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as w,LengthDimensionConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as j,LengthDimensionPointManipulator as H,pointManipulatorHandles as T,createOffsetManipulator as G,offsetManipulatorHandles as x,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as I,createMeasureTypeManipulator as V,measureTypeManipulatorHandles as R,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as k,updateRotationManipulatorTransform as E,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computeGeometryFromDimension as J,computationToGeometryDependencies as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{RenderOccludedFlag as at}from"../../webgl-engine/lib/Material.js";import{ImageMaterial as nt}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as st}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as ot}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as rt}from"../../../interactive/coordinateHelper.js";import{EditGeometry as pt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as lt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as ut}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as dt}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as ct}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as mt}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as ht}from"../../../interactive/snapping/snappingUtils.js";let gt=class extends n{constructor(t){super(t),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new s,this._orientationManipulatorTexture=null,this._updatingHandles=new y,this._getSnappingContext=u((t=>new ut({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new lt(new pt("point",rt(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt})));const{view:i}=t;this._snappingManagerResult=ct(i),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:st(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:at.OccludeAndTransparent,stipplePattern:st(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:at.OccludeAndTransparent,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new mt({view:t});const i=!t._stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._orientationManipulatorMaterial=new nt({writeDepth:!1,renderOccluded:at.Opaque,isDecoration:!0}),this.addHandles(c((()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)})),(({accentColor:a,contrastColor:n})=>{const s=this._orientationManipulatorTexture,o=$(t.textures,{accentColor:a,contrastColor:n,preMultiplyAlpha:i});this._orientationManipulatorMaterial.setParameters({textureId:o.texture.id}),this._orientationManipulatorTexture=o,s?.release();const r=e.toUnitRGBA(a);this._unfocusedOffsetManipulatorMaterial.setParameters({color:r}),this._focusedOffsetManipulatorMaterial.setParameters({color:r}),this._thinOffsetManipulatorMaterial.setParameters({color:r}),this._constraintSnappingIndicator.color=r}),m));const a=p((()=>this.analysisViewData.computations),(({computation:t})=>this._createManipulators(t)));this.addHandles(o(a)),this.addHandles([c((()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation})),(({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=S(t,new C);this._applyPointUpdate(e,{endPoint:i})}),h),c((()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator})),((t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)}),g),c((()=>this.analysis.style.lineSize),(t=>{this._updateManipulatorStyle(t)}),m),c((()=>this.view.state.camera),(()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)})),c((()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=v();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null}),(t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1}))]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),ht(this,(()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(d(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);w(t,i,{constraint:a,view:this.view})}}}))}destroy(){this._snappingOperation=l(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorTexture?.release()}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager.options}get _snappingManager(){return this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[f((()=>this.analysisViewData.selectedComputation),(t=>{t.previousConstraint=this._computeConstraint(t)}),{...g,equals:r}),c((()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}}),((t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:a,computation:n}=t;switch(n.previousConstraint){case b.Horizontal:n.preConstraintProperties={measureType:i.Horizontal,orientation:0};break;case b.Vertical:n.preConstraintProperties={measureType:i.Vertical,orientation:0};break;case b.Direct:n.preConstraintProperties={measureType:i.Direct,orientation:a};break;default:n.preConstraintProperties={measureType:e,orientation:a}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)}),h)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[c((()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation})),(({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1})),c((()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}}),(({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&e!==b.Direct?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1}))]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(d(this._snappingOperation.snap({point:t},this._snappingManager,i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let n=t;if("mouse"===e){const i=this._getSnappingContext(e);n=this._snappingManager.update({point:t,context:i})}const s=new a({startPoint:S(n,new C),endPoint:null,measureType:i.Horizontal});return this._stagedDimension=s,this._resetSnappingState(),s}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=S(a,new C);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),a=this._setupPointManipulator(t,{isStart:!1}),n=this._setupOffsetManipulator(t),s=this._setupHeadingManipulator(t),o=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,i.Direct),p=this._setupMeasureTypeManipulator(t,i.Horizontal),l=this._setupMeasureTypeManipulator(t,i.Vertical),u=new j({start:e,end:a,offset:n,heading:s,rotation:o,direct:r,horizontal:p,vertical:l});return this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values()),{manipulators:u,remove:()=>{this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([c((()=>t.geometry),(()=>this._updateManipulators(t,e)),{...g,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new H(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>dt({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=G(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=x(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=I(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=V(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=R(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,a={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:n,selectedComputation:s,firstGrabbedManipulator:o}=a,{start:r,end:p,offset:l,heading:u,rotation:d}=e,c=s===t,m=B(t),{dimension:h}=t;for(const i of e.values()){const t=m&&null==n&&(null==o||i===o);i===l?(i.available=t,i.selected=c):i.available=t&&c}if(!m)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator((t=>t.available=!1)):e.manipulatorForMeasureType(h.measureType).available=!1;for(const _ of[u,d])h.measureType===i.Direct&&0!==h.offset||(_.available=!1);N(t)?d.available=!1:u.available=!1;const{geometry:g}=t;r.renderLocation=g.directSegment.startRenderSpace,p.renderLocation=g.directSegment.endRenderSpace;const{renderCoordsHelper:f}=this.view;A(l,g,f),u.available&&k(u,t,f),d.available&&E(d,t,f),e.forEachMeasureTypeManipulator(((e,i)=>{e.available&&L(e,t,i,f)}))}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=K(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=J(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,ft);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(ft);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._snappingManager.options),this.view)}_createOffsetManipulatorMaterial(){return new ot({width:1,renderOccluded:at.OccludeAndTransparent,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0})}get testInfo(){}};t([_({constructOnly:!0})],gt.prototype,"analysis",void 0),t([_({constructOnly:!0})],gt.prototype,"analysisViewData",void 0),t([_({constructOnly:!0})],gt.prototype,"manipulators",void 0),t([_({constructOnly:!0})],gt.prototype,"parentTool",void 0),t([_({constructOnly:!0,nonNullable:!0})],gt.prototype,"view",void 0),t([_({readOnly:!0})],gt.prototype,"updating",null),t([_()],gt.prototype,"firstGrabbedManipulator",null),t([_()],gt.prototype,"hasGrabbedManipulators",null),t([_()],gt.prototype,"snappingOptions",null),t([_()],gt.prototype,"_stagedDimension",void 0),t([_()],gt.prototype,"_activeComputation",null),t([_()],gt.prototype,"_stagedComputation",null),gt=t([M("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],gt);const ft=v();export{gt as LengthDimensionSubTool};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Color.js";import{LengthDimensionMeasureType as i}from"../../../../analysis/dimensionUtils.js";import a from"../../../../analysis/LengthDimension.js";import n from"../../../../core/Accessor.js";import s from"../../../../core/Handles.js";import{destroyHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,LengthDimensionConstraint as P,applyConstraint as O,computeConstraint as D,constraintDependencies as H}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as j,LengthDimensionPointManipulator as T,pointManipulatorHandles as x,createOffsetManipulator as G,offsetManipulatorHandles as z,LineOfSightOrientationManipulator as U,headingManipulatorHandles as V,rotationManipulatorHandles as I,createMeasureTypeManipulator as A,measureTypeManipulatorHandles as R,updateOffsetManipulatorTransform as k,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as L,updateMeasureTypeManipulatorTransform as F,unfocusedOffsetWidth as q,focusedOffsetWidth as B}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as N,arePointsVerticallyAligned as J,computeGeometryFromDimension as K,computationToGeometryDependencies as Q}from"./lengthDimensionUtils.js";import{disabledPointColor as W,pointRadius as X,getTransparentAccentColor as Y,getContrastColor as Z,initialOffsetPx as $}from"./settings.js";import{getRotateHeadingTexture as tt}from"../images/Factory.js";import{SnappingVisualizer3D as et}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as it}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as at}from"../../interactive/visualElements/VerticesVisualElement.js";import{RenderOccludedFlag as nt}from"../../webgl-engine/lib/Material.js";import{ImageMaterial as st}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as ot}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as rt}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as pt}from"../../../interactive/coordinateHelper.js";import{EditGeometry as lt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as ut}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as dt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ct}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as mt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ht}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as gt}from"../../../interactive/snapping/snappingUtils.js";let ft=class extends n{constructor(t){super(t),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new s,this._updatingHandles=new C,this._getSnappingContext=d((t=>new dt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new ut(new lt("point",pt(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new et})));const{view:i}=t;this._snappingManagerResult=mt(i),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:ot(2)}),this._constraintSnappingIndicator=new it({view:i,attached:!0,width:1,renderOccluded:nt.OccludeAndTransparent,stipplePattern:ot(5),isDecoration:!0});const a=e.toUnitRGBA(W);this._stagedStartIndicator=new at({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*X,outlineSize:0,renderOccluded:nt.OccludeAndTransparent,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ht({view:t});const i=Y(t.effectiveTheme),a=Z(t.effectiveTheme),n=!t._stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=tt(t.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new st({texture:this._textureHandle.texture,writeDepth:!1,renderOccluded:nt.Opaque,isDecoration:!0});const s=p((()=>this.analysisViewData.computations),(({computation:t})=>this._createManipulators(t)));this.addHandles([m((()=>({accentColor:Y(t.effectiveTheme),contrastColor:Z(t.effectiveTheme)})),(({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=tt(t.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({texture:this._textureHandle.texture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o}),h),o(s),m((()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation})),(({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new S);this._applyPointUpdate(e,{endPoint:i})}),g),m((()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator})),((t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)}),f),m((()=>this.analysis.style.lineSize),(t=>this._updateManipulatorStyle(t)),h),m((()=>this.view.state.camera),(()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)})),m((()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null}),(t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1}))]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),gt(this,(()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}}))}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager.options}get _snappingManager(){return this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_((()=>this.analysisViewData.selectedComputation),(t=>{t.previousConstraint=this._computeConstraint(t)}),{...f,equals:r}),m((()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}}),((t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:a,computation:n}=t;switch(n.previousConstraint){case P.Horizontal:n.preConstraintProperties={measureType:i.Horizontal,orientation:0};break;case P.Vertical:n.preConstraintProperties={measureType:i.Vertical,orientation:0};break;case P.Direct:n.preConstraintProperties={measureType:i.Direct,orientation:a};break;default:n.preConstraintProperties={measureType:e,orientation:a}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)}),g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m((()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation})),(({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1})),m((()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}}),(({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&e!==P.Direct?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1}))]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._snappingManager,i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let n=t;if("mouse"===e){const i=this._getSnappingContext(e);n=this._snappingManager.update({point:t,context:i})}const s=new a({startPoint:w(n,new S),endPoint:null,measureType:i.Horizontal});return this._stagedDimension=s,this._resetSnappingState(),s}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=w(a,new S);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),a=this._setupPointManipulator(t,{isStart:!1}),n=this._setupOffsetManipulator(t),s=this._setupHeadingManipulator(t),o=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,i.Direct),p=this._setupMeasureTypeManipulator(t,i.Horizontal),l=this._setupMeasureTypeManipulator(t,i.Vertical),u=new j({start:e,end:a,offset:n,heading:s,rotation:o,direct:r,horizontal:p,vertical:l});return this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values()),{manipulators:u,remove:()=>{this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m((()=>t.geometry),(()=>this._updateManipulators(t,e)),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new T(i,{metadata:a}),s=x(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ct({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=G(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=z(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new U(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=V(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new U(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=I(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=A(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=R(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,a={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:n,selectedComputation:s,firstGrabbedManipulator:o}=a,{start:r,end:p,offset:l,heading:u,rotation:d}=e,c=s===t,m=N(t),{dimension:h}=t;for(const i of e.values()){const t=m&&null==n&&(null==o||i===o);i===l?(i.available=t,i.selected=c):i.available=t&&c}if(!m)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator((t=>t.available=!1)):e.manipulatorForMeasureType(h.measureType).available=!1;for(const _ of[u,d])h.measureType===i.Direct&&0!==h.offset||(_.available=!1);J(t)?d.available=!1:u.available=!1;const{geometry:g}=t;r.renderLocation=g.directSegment.startRenderSpace,p.renderLocation=g.directSegment.endRenderSpace;const{renderCoordsHelper:f}=this.view;k(l,g,f),u.available&&E(u,t,f),d.available&&L(d,t,f),e.forEachMeasureTypeManipulator(((e,i)=>{e.available&&F(e,t,i,f)}))}_updateManipulatorStyle(t){const e=q(t),i=B(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=Q(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});O(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,_t);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(_t);t.dimension.offset=$*a*i.unitInMeters}_computeConstraint(t){return D(H(t,this._snappingManager.options),this.view)}_createOffsetManipulatorMaterial(){return new rt({width:1,renderOccluded:nt.OccludeAndTransparent,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0})}get test(){}};t([M({constructOnly:!0})],ft.prototype,"analysis",void 0),t([M({constructOnly:!0})],ft.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ft.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ft.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ft.prototype,"view",void 0),t([M({readOnly:!0})],ft.prototype,"updating",null),t([M()],ft.prototype,"firstGrabbedManipulator",null),t([M()],ft.prototype,"hasGrabbedManipulators",null),t([M()],ft.prototype,"snappingOptions",null),t([M()],ft.prototype,"_stagedDimension",void 0),t([M()],ft.prototype,"_activeComputation",null),t([M()],ft.prototype,"_stagedComputation",null),ft=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ft);const _t=y();export{ft as LengthDimensionSubTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{lengthDimensionMeasureType as t,LengthDimensionMeasureType as r}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as n}from"../../../../core/Cyclical.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{watch as o,initial as a}from"../../../../core/reactiveUtils.js";import{pt2px as s}from"../../../../core/screenUtils.js";import{identity as c,scale as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{h as d,c as u,d as p,e as f,f as g,p as h,l as v,i as y,a as w}from"../../../../chunks/vec32.js";import{create as S,ZEROS as j,fromValues as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import H from"../../../../geometry/Point.js";import{fromPositionAndNormal as M,create as P,signedDistance as C,getNormal as T}from"../../../../geometry/support/plane.js";import{sv3d as O}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as U}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as R,computeGeometryFromDimension as z,computationToGeometryDependencies as A,headingFromGeometry as D,computeOffsetForPoint as _,computeSegmentForMeasureType as F,computeOffsetAxis as L,directUp as k,directStartToEnd as E,dimensionStartToEnd as I}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as G,pointRadius as B,lengthFraction as N,markerLineSizeFraction as V,orientationCalloutOffsetPx as W,orientationCalloutWidth as q,orientationDiscScale as J,orientationFocusMultiplier as K,orientationSnapThresholdDegrees as Q,minLengthMeters as X,linePaddingPx as Y,focusedLinePaddingPx as Z}from"./settings.js";import{Manipulator3D as $}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as ee,worldScaledManipulatorSettings as te,calculateInputRotationTransform as re,calculateTranslateRotateFromBases as ne,rotateManipulatorDefaults as ie}from"../../interactive/manipulatorUtils.js";import{RenderObject as oe}from"../../interactive/RenderObject.js";import{screenToMap3D as ae,screenToRenderPlane as se,hideManipulatorWhileDragging as ce}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as le}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as me}from"../../support/engineContent/marker.js";import{Attribute as de}from"../../webgl-engine/lib/Attribute.js";import{Geometry as ue}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as pe,createPolylineGeometry as fe}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as ge}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as he}from"../../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as ve}from"../../webgl-engine/materials/ImageMaterial.js";import{RibbonLineMaterial as ye}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as we,resetProperties as Se,EventPipeline as je}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as xe,ManipulatorStateFlags as be}from"../../../interactive/interfaces.js";class He{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find((t=>this.hasOwnProperty(t)&&e===this[t]))}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(e){for(const r of t)e(this.manipulatorForMeasureType(r),r)}manipulatorForMeasureType(e){switch(e){case r.Direct:return this.direct;case r.Horizontal:return this.horizontal;case r.Vertical:return this.vertical}}}class Me extends ${constructor(t,r){const n=ee(e.toUnitRGBA(G(t.effectiveTheme))),i=[new oe(pe(n,1,32,32),tt)];super({view:t,renderObjects:i,metadata:r.metadata,available:!1,grabCursor:"crosshair",radius:B,collisionPriority:1}),this._themeHandle=o((()=>({color:e.toUnitRGBA(G(t.effectiveTheme))})),(e=>n.setParameters(e)))}destroy(){this._themeHandle.remove(),super.destroy()}}function Pe(e,t){const r=[x(-.5,0,0),x(.5,0,0)],n=fe(t.unfocusedMaterial,r.map((e=>d(S(),e,N)))),i=n.instantiate({material:t.focusedMaterial});return new $({view:e,renderObjects:[new oe(n,be.Unfocused|be.Selected|tt),new oe(i,be.Focused|tt)],collisionType:{type:"line",paths:[r]},radius:$e(t.lineSizePt)/2,metadata:t.metadata,available:!1,...te})}class Ce extends ${constructor(t,{lineSizePt:r,material:n,metadata:i}){super({view:t,autoScaleRenderObjects:!1,collisionPriority:1,metadata:i}),this._options={calloutColor:b(),lineSizePt:r,material:n},this._themeHandle=o((()=>e.toUnitRGBA(G(t.effectiveTheme))),(e=>{this._options.calloutColor=e,et(this,Te({...this._options,metadata:this.metadata}))}),a)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,et(this,Te({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function Te({calloutColor:e,lineSizePt:t,material:r,metadata:n}){return{calloutLength:.25*me*V*s(t)+W,calloutColor:e,calloutWidth:q,customStateMask:tt,discScale:J,focusMultiplier:K,material:r,metadata:n}}function Oe(e,t){const r=[x(-.5,0,0),x(.5,0,0)],n=fe(t.thinOffsetManipulatorMaterial,r),i=fe(t.unfocusedMaterial,r.map((e=>d(S(),e,N)))),o=i.instantiate({material:t.focusedMaterial});return new $({view:e,renderObjects:[new oe(i,be.Unfocused|tt),new oe(o,be.Focused|tt),new oe(n,tt)],collisionType:{type:"line",paths:[r]},radius:$e(t.lineSizePt)/2,available:!1,metadata:t.metadata,...te})}function Ue(e,{isStart:t,createSnappingPipelineStep:r,dimension:n,onUpdate:i,view:o}){const a=t?"startPoint":"endPoint",s=we(e,((e,t,s,c)=>{const l=ce(e),{snappingStep:m,cancelSnapping:d}=r(c);s=s.next(l).next(Se(n,[a,"measureType","orientation"])).next(d),t.next(l).next(ae(o)).next(...m).next((e=>{const t=U(e.mapEnd,new H);i("startPoint"===a?{startPoint:t}:{endPoint:t})}))}));return[s]}function Re(e,{computation:t,view:r}){return[we(e,((e,n,i)=>{if(!R(t)||!e.selected)return;const{geometry:o,dimension:a}=t,s=ce(e);n.next(s).next(ke(r,a,o.dimensionSegment,o.primaryOffsetAxis)),i.next(s).next(Se(a,["offset"]))}))]}function ze(e,{computation:t,view:r}){return[we(e,((e,n,i)=>{_e({cancel:i,computation:t,settingHeading:!0,steps:n,view:r})}))]}function Ae(e,{computation:t,view:r}){return[we(e,((e,n,i)=>{_e({cancel:i,computation:t,settingHeading:!1,steps:n,view:r})})),e.events.on("immediate-click",(e=>{De(e,t,r)}))]}function De(e,t,r){const{dimension:i,geometry:o}=t;if(90===i.orientation||270===i.orientation)return i.orientation=0,void e.stopPropagation();if(null==o)return;const{renderCoordsHelper:a}=r,s=z({...A(t),orientation:90},a),c=z({...A(t),orientation:270},a);if(null==s||null==c)return;const l=D(s,a),m=D(c,a),d=Ee(o,r),u=n.shortestSignedDiff(d,l),p=n.shortestSignedDiff(d,m);i.orientation=Math.abs(u)<Math.abs(p)?90:270,e.stopPropagation()}function _e(e){const{cancel:t,computation:r,settingHeading:n,steps:o,view:a}=e;if(!R(r))return;const{renderCoordsHelper:s}=a,{dimension:c,geometry:l}=r,m=S(),d=Je(S(),l,l.directSegment,s),p=Ke(O.get(),{forHeading:n,geometry:l,renderCoordsHelper:s}),f=M(d,p,P()),g=n?c.orientation??D(l,a.renderCoordsHelper):c.orientation??0;o.next(se(a,f)).next((e=>{"start"===e.action&&u(m,e.renderStart);const t=T(f),r=re(m,e.renderEnd,d,t);let o=g-i(r);n||(o=Fe(o)),c.orientation=o})),t.next(Se(c,["orientation"]))}function Fe(e){const t=n.normalize(e)%90;return t<Q?e-t:90-t<Q?e+(90-t):e}function Le(e,{computation:t,manipulatorMeasureType:n,view:i}){let o=r.Direct,a=0,s=0;return[e.events.on("grab-changed",(r=>{if("start"!==r.action||!R(t))return;const{dimension:c,geometry:l}=t;o=c.measureType,a=c.offset,s=c.orientation;const m=u(O.get(),e.renderLocation);c.measureType=n,c.offset=_(m,n,l,i.renderCoordsHelper),c.orientation=0})),we(e,((e,r,c)=>{if(!R(t))return;const{geometry:l,dimension:m}=t,{renderCoordsHelper:d}=i,u=F(ot,n,t,d),p=L(O.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),f=ce(e);r.next(f).next(ke(i,m,u,p)),c.next(f).next((e=>(m.measureType=o,m.offset=a,m.orientation=s,e)))}))]}function ke(e,t,r,n){const i=p(O.get(),r.endRenderSpace,r.startRenderSpace);f(i,i,n);const o=M(r.startRenderSpace,i,P()),a=M(r.startRenderSpace,n,P()),s=t.offset;let c,l=0;const m=new je;return m.next(se(e,o)).next((r=>{"start"===r.action&&(l=C(a,r.renderStart));const n=(C(a,r.renderEnd)-l)*e.renderCoordsHelper.unitInMeters;t.offset=s+n,c=r})),e=>(m.execute(e),c)}function Ee(e,t){const{directSegment:r}=e,{renderCoordsHelper:n}=t,i=k(O.get(),e,n),o=E(O.get(),e),a=f(O.get(),o,i),{viewForward:s}=t.state.camera;g(a,s)>0&&d(a,a,-1);const c=r.eval(.5,O.get());return n.headingAtPosition(c,a)}function Ie(e,t,r){const{dimensionSegment:n,primaryOffsetAxis:i}=t,o=I(rt,t),a=h(o,j)?c(it):ne(o,i,j,it),s=Math.max(v(o),X/r.unitInMeters);l(a,a,y(rt,s,s,s)),e.modelTransform=a,e.renderLocation=n.eval(.5,rt)}function Ge(e,t,r){Ne(e,t,r,{forHeading:!0})}function Be(e,t,r){Ne(e,t,r,{forHeading:!1})}function Ne(e,t,r,{forHeading:n}){const{dimension:i,geometry:o}=t,{primaryOffsetAxis:a}=o,s=d(Ve,a,i.offset>=0?1:-1),c=Ke(We,{forHeading:n,geometry:o,renderCoordsHelper:r});f(c,c,s);const l=ne(s,c,j,it);e.modelTransform=l,e.renderLocation=Je(rt,o,o.dimensionSegment,r)}const Ve=S(),We=S();function qe(e,t,r,n){const{geometry:i}=t,o=F(ot,r,t,n),a=L(rt,{measureType:r,directSegment:i.directSegment,renderCoordsHelper:n}),s=w(nt,o.endRenderSpace,o.startRenderSpace),c=ne(s,a,j,it),m=v(s);l(c,c,y(nt,m,m,m)),e.modelTransform=c,e.renderLocation=o.eval(.5,nt)}function Je(e,t,r,n){const{startRenderSpace:i,endRenderSpace:o}=r,a=Qe(t,n)?i:o;return u(e,a)}function Ke(e,{forHeading:t,geometry:r,renderCoordsHelper:n}){return t?k(e,r,n):I(e,r,{invert:!0})}function Qe(e,t){const r=E(Xe,e),n=k(Ye,e,t);return g(r,n)>0}const Xe=S(),Ye=S();function Ze(e){return s(e)+Y}function $e(e){return s(e)+Z}function et(e,t){const r=t.material??new ve({writeDepth:!1,textureId:t.texture?.id,renderOccluded:ge.Opaque,isDecoration:!0}),n=t.focusMultiplier??ie.focusMultiplier,i=t.calloutLength??ie.calloutLength,o=ie.discRadius*(t.discScale??1),a=o*n,s=(e,t)=>{const r=[0,1,2,2,3,0];return new ue(t,[[he.POSITION,new de([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],[he.UV0,new de([0,0,1,0,1,1,0,1],r,2,!0)]])},c=t.calloutWidth??ie.calloutWidth,l=new ye({width:c,color:t.calloutColor,renderOccluded:ge.OccludeAndTransparent,isDecoration:!0}),m=fe(l,[[0,0,0],[i-o,0,0]]),d=fe(l,[[0,0,0],[i-a,0,0]]),u=t.customStateMask??xe.None;e.collisionType={type:"disc",direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=n,e.metadata=t.metadata,e.radius=o,e.renderObjects=[new oe(s(o,r),be.Unfocused|u),new oe(m,be.Unfocused|u),new oe(s(a,r),be.Focused|u),new oe(d,be.Focused|u)]}const tt=xe.Custom1,rt=S(),nt=S(),it=m(),ot=new le;export{tt as DidPointerMoveRecentlyFlag,He as LengthDimensionManipulators,Me as LengthDimensionPointManipulator,Ce as LineOfSightOrientationManipulator,Ee as automaticHeadingFromCamera,Oe as createMeasureTypeManipulator,Pe as createOffsetManipulator,$e as focusedOffsetWidth,ze as headingManipulatorHandles,Le as measureTypeManipulatorHandles,Re as offsetManipulatorHandles,Ue as pointManipulatorHandles,Ae as rotationManipulatorHandles,Fe as snapOrientationToNearestRightAngle,Ze as unfocusedOffsetWidth,Ge as updateHeadingManipulatorTransform,qe as updateMeasureTypeManipulatorTransform,Ie as updateOffsetManipulatorTransform,Be as updateRotationManipulatorTransform};
5
+ import e from"../../../../Color.js";import{lengthDimensionMeasureType as t,LengthDimensionMeasureType as r}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as n}from"../../../../core/Cyclical.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{watch as o,initial as a}from"../../../../core/reactiveUtils.js";import{pt2px as s}from"../../../../core/screenUtils.js";import{identity as c,scale as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{h as d,c as u,d as p,e as f,f as g,p as h,l as v,i as y,a as w}from"../../../../chunks/vec32.js";import{create as S,ZEROS as j,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import H from"../../../../geometry/Point.js";import{fromPositionAndNormal as M,create as P,signedDistance as C,getNormal as T}from"../../../../geometry/support/plane.js";import{sv3d as O}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as U}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as R,computeGeometryFromDimension as z,computationToGeometryDependencies as A,headingFromGeometry as _,computeOffsetForPoint as D,computeSegmentForMeasureType as F,computeOffsetAxis as L,directUp as k,directStartToEnd as E,dimensionStartToEnd as G}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as I,pointRadius as B,lengthFraction as N,markerLineSizeFraction as V,orientationCalloutOffsetPx as W,orientationCalloutWidth as q,orientationDiscScale as J,orientationFocusMultiplier as K,orientationSnapThresholdDegrees as Q,minLengthMeters as X,linePaddingPx as Y,focusedLinePaddingPx as Z}from"./settings.js";import{Manipulator3D as $}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as ee,worldScaledManipulatorSettings as te,calculateInputRotationTransform as re,calculateTranslateRotateFromBases as ne,rotateManipulatorDefaults as ie}from"../../interactive/manipulatorUtils.js";import{RenderObject as oe}from"../../interactive/RenderObject.js";import{screenToMap3D as ae,screenToRenderPlane as se,hideManipulatorWhileDragging as ce}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as le}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as me}from"../../support/engineContent/marker.js";import{Attribute as de}from"../../webgl-engine/lib/Attribute.js";import{Geometry as ue}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as pe,createPolylineGeometry as fe}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as ge}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as he}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as ve}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as ye,resetProperties as we,EventPipeline as Se}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as je,ManipulatorStateFlags as be}from"../../../interactive/interfaces.js";class xe{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find((t=>this.hasOwnProperty(t)&&e===this[t]))}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(e){for(const r of t)e(this.manipulatorForMeasureType(r),r)}manipulatorForMeasureType(e){switch(e){case r.Direct:return this.direct;case r.Horizontal:return this.horizontal;case r.Vertical:return this.vertical}}}class He extends ${constructor(t,r){const n=ee(e.toUnitRGBA(I(t.effectiveTheme))),i=[new oe(pe(n,1,32,32),et)];super({view:t,renderObjects:i,metadata:r.metadata,available:!1,grabCursor:"crosshair",radius:B,collisionPriority:1}),this._themeHandle=o((()=>({color:e.toUnitRGBA(I(t.effectiveTheme))})),(e=>n.setParameters(e)))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){const r=[b(-.5,0,0),b(.5,0,0)],n=fe(t.unfocusedMaterial,r.map((e=>d(S(),e,N)))),i=n.instantiate({material:t.focusedMaterial});return new $({view:e,renderObjects:[new oe(n,be.Unfocused|be.Selected|et),new oe(i,be.Focused|et)],collisionType:{type:"line",paths:[r]},radius:Ze(t.lineSizePt)/2,metadata:t.metadata,available:!1,...te})}class Pe extends ${constructor(t,{lineSizePt:r,material:n,metadata:i}){super({view:t,autoScaleRenderObjects:!1,collisionPriority:1,metadata:i}),this._options={calloutColor:x(),lineSizePt:r,material:n},this._themeHandle=o((()=>e.toUnitRGBA(I(t.effectiveTheme))),(e=>{this._options.calloutColor=e,$e(this,Ce({...this._options,metadata:this.metadata}))}),a)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,$e(this,Ce({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function Ce({calloutColor:e,lineSizePt:t,material:r,metadata:n}){return{calloutLength:.25*me*V*s(t)+W,calloutColor:e,calloutWidth:q,customStateMask:et,discScale:J,focusMultiplier:K,material:r,metadata:n}}function Te(e,t){const r=[b(-.5,0,0),b(.5,0,0)],n=fe(t.thinOffsetManipulatorMaterial,r),i=fe(t.unfocusedMaterial,r.map((e=>d(S(),e,N)))),o=i.instantiate({material:t.focusedMaterial});return new $({view:e,renderObjects:[new oe(i,be.Unfocused|et),new oe(o,be.Focused|et),new oe(n,et)],collisionType:{type:"line",paths:[r]},radius:Ze(t.lineSizePt)/2,available:!1,metadata:t.metadata,...te})}function Oe(e,{isStart:t,createSnappingPipelineStep:r,dimension:n,onUpdate:i,view:o}){const a=t?"startPoint":"endPoint",s=ye(e,((e,t,s,c)=>{const l=ce(e),{snappingStep:m,cancelSnapping:d}=r(c);s=s.next(l).next(we(n,[a,"measureType","orientation"])).next(d),t.next(l).next(ae(o)).next(...m).next((e=>{const t=U(e.mapEnd,new H);i("startPoint"===a?{startPoint:t}:{endPoint:t})}))}));return[s]}function Ue(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{if(!R(t)||!e.selected)return;const{geometry:o,dimension:a}=t,s=ce(e);n.next(s).next(Le(r,a,o.dimensionSegment,o.primaryOffsetAxis)),i.next(s).next(we(a,["offset"]))}))]}function Re(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{_e({cancel:i,computation:t,settingHeading:!0,steps:n,view:r})}))]}function ze(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{_e({cancel:i,computation:t,settingHeading:!1,steps:n,view:r})})),e.events.on("immediate-click",(e=>{Ae(e,t,r)}))]}function Ae(e,t,r){const{dimension:i,geometry:o}=t;if(90===i.orientation||270===i.orientation)return i.orientation=0,void e.stopPropagation();if(null==o)return;const{renderCoordsHelper:a}=r,s=z({...A(t),orientation:90},a),c=z({...A(t),orientation:270},a);if(null==s||null==c)return;const l=_(s,a),m=_(c,a),d=ke(o,r),u=n.shortestSignedDiff(d,l),p=n.shortestSignedDiff(d,m);i.orientation=Math.abs(u)<Math.abs(p)?90:270,e.stopPropagation()}function _e(e){const{cancel:t,computation:r,settingHeading:n,steps:o,view:a}=e;if(!R(r))return;const{renderCoordsHelper:s}=a,{dimension:c,geometry:l}=r,m=S(),d=qe(S(),l,l.directSegment,s),p=Je(O.get(),{forHeading:n,geometry:l,renderCoordsHelper:s}),f=M(d,p,P()),g=n?c.orientation??_(l,a.renderCoordsHelper):c.orientation??0;o.next(se(a,f)).next((e=>{"start"===e.action&&u(m,e.renderStart);const t=T(f),r=re(m,e.renderEnd,d,t);let o=g-i(r);n||(o=De(o)),c.orientation=o})),t.next(we(c,["orientation"]))}function De(e){const t=n.normalize(e)%90;return t<Q?e-t:90-t<Q?e+(90-t):e}function Fe(e,{computation:t,manipulatorMeasureType:n,view:i}){let o=r.Direct,a=0,s=0;return[e.events.on("grab-changed",(r=>{if("start"!==r.action||!R(t))return;const{dimension:c,geometry:l}=t;o=c.measureType,a=c.offset,s=c.orientation;const m=u(O.get(),e.renderLocation);c.measureType=n,c.offset=D(m,n,l,i.renderCoordsHelper),c.orientation=0})),ye(e,((e,r,c)=>{if(!R(t))return;const{geometry:l,dimension:m}=t,{renderCoordsHelper:d}=i,u=F(it,n,t,d),p=L(O.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),f=ce(e);r.next(f).next(Le(i,m,u,p)),c.next(f).next((e=>(m.measureType=o,m.offset=a,m.orientation=s,e)))}))]}function Le(e,t,r,n){const i=p(O.get(),r.endRenderSpace,r.startRenderSpace);f(i,i,n);const o=M(r.startRenderSpace,i,P()),a=M(r.startRenderSpace,n,P()),s=t.offset;let c,l=0;const m=new Se;return m.next(se(e,o)).next((r=>{"start"===r.action&&(l=C(a,r.renderStart));const n=(C(a,r.renderEnd)-l)*e.renderCoordsHelper.unitInMeters;t.offset=s+n,c=r})),e=>(m.execute(e),c)}function ke(e,t){const{directSegment:r}=e,{renderCoordsHelper:n}=t,i=k(O.get(),e,n),o=E(O.get(),e),a=f(O.get(),o,i),{viewForward:s}=t.state.camera;g(a,s)>0&&d(a,a,-1);const c=r.eval(.5,O.get());return n.headingAtPosition(c,a)}function Ee(e,t,r){const{dimensionSegment:n,primaryOffsetAxis:i}=t,o=G(tt,t),a=h(o,j)?c(nt):ne(o,i,j,nt),s=Math.max(v(o),X/r.unitInMeters);l(a,a,y(tt,s,s,s)),e.modelTransform=a,e.renderLocation=n.eval(.5,tt)}function Ge(e,t,r){Be(e,t,r,{forHeading:!0})}function Ie(e,t,r){Be(e,t,r,{forHeading:!1})}function Be(e,t,r,{forHeading:n}){const{dimension:i,geometry:o}=t,{primaryOffsetAxis:a}=o,s=d(Ne,a,i.offset>=0?1:-1),c=Je(Ve,{forHeading:n,geometry:o,renderCoordsHelper:r});f(c,c,s);const l=ne(s,c,j,nt);e.modelTransform=l,e.renderLocation=qe(tt,o,o.dimensionSegment,r)}const Ne=S(),Ve=S();function We(e,t,r,n){const{geometry:i}=t,o=F(it,r,t,n),a=L(tt,{measureType:r,directSegment:i.directSegment,renderCoordsHelper:n}),s=w(rt,o.endRenderSpace,o.startRenderSpace),c=ne(s,a,j,nt),m=v(s);l(c,c,y(rt,m,m,m)),e.modelTransform=c,e.renderLocation=o.eval(.5,rt)}function qe(e,t,r,n){const{startRenderSpace:i,endRenderSpace:o}=r,a=Ke(t,n)?i:o;return u(e,a)}function Je(e,{forHeading:t,geometry:r,renderCoordsHelper:n}){return t?k(e,r,n):G(e,r,{invert:!0})}function Ke(e,t){const r=E(Qe,e),n=k(Xe,e,t);return g(r,n)>0}const Qe=S(),Xe=S();function Ye(e){return s(e)+Y}function Ze(e){return s(e)+Z}function $e(e,t){const r=t.material,n=t.focusMultiplier??ie.focusMultiplier,i=t.calloutLength??ie.calloutLength,o=ie.discRadius*(t.discScale??1),a=o*n,s=(e,t)=>{const r=[0,1,2,2,3,0];return new ue(t,[[he.POSITION,new de([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],[he.UV0,new de([0,0,1,0,1,1,0,1],r,2,!0)]])},c=t.calloutWidth??ie.calloutWidth,l=new ve({width:c,color:t.calloutColor,renderOccluded:ge.OccludeAndTransparent,isDecoration:!0}),m=fe(l,[[0,0,0],[i-o,0,0]]),d=fe(l,[[0,0,0],[i-a,0,0]]),u=t.customStateMask??je.None;e.collisionType={type:"disc",direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=n,e.metadata=t.metadata,e.radius=o,e.renderObjects=[new oe(s(o,r),be.Unfocused|u),new oe(m,be.Unfocused|u),new oe(s(a,r),be.Focused|u),new oe(d,be.Focused|u)]}const et=je.Custom1,tt=S(),rt=S(),nt=m(),it=new le;export{et as DidPointerMoveRecentlyFlag,xe as LengthDimensionManipulators,He as LengthDimensionPointManipulator,Pe as LineOfSightOrientationManipulator,ke as automaticHeadingFromCamera,Te as createMeasureTypeManipulator,Me as createOffsetManipulator,Ze as focusedOffsetWidth,Re as headingManipulatorHandles,Fe as measureTypeManipulatorHandles,Ue as offsetManipulatorHandles,Oe as pointManipulatorHandles,ze as rotationManipulatorHandles,De as snapOrientationToNearestRightAngle,Ye as unfocusedOffsetWidth,Ge as updateHeadingManipulatorTransform,We as updateMeasureTypeManipulatorTransform,Ee as updateOffsetManipulatorTransform,Ie as updateRotationManipulatorTransform};