@vertigis/arcgis-extensions 38.0.5 → 38.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AccessDeniedError.js +1 -1
- package/AppConfig.schema.json +35 -39
- package/ArgumentMissingError.js +1 -1
- package/ArgumentOutOfRangeError.js +1 -1
- package/Entity.js +1 -1
- package/FailureMode.d.ts +1 -1
- package/Hyperlink.js +1 -1
- package/LanguageResources.d.ts +1 -3
- package/LanguageResources.js +1 -1
- package/NotFoundError.js +1 -1
- package/PortalUri.js +1 -1
- package/data/ArcGISServiceTableExtension.js +1 -1
- package/data/Attachment.js +1 -1
- package/data/Feature.js +1 -1
- package/data/FeatureList.d.ts +3 -3
- package/data/FeatureList.js +1 -1
- package/data/FeatureSaveError.js +1 -1
- package/data/FeatureSet.js +1 -1
- package/data/FeatureSettings.js +1 -1
- package/data/FeatureSourceBase.js +1 -1
- package/data/FeatureStream.js +1 -1
- package/data/FieldExtension.js +1 -1
- package/data/PopupContentExtension.js +1 -1
- package/data/Relationship.js +1 -1
- package/data/RelationshipBase.js +1 -1
- package/data/Schema.js +1 -1
- package/data/Table.js +1 -1
- package/data/TableExtension.js +1 -1
- package/data/TaskSettings.js +1 -1
- package/data/_Relationship.d.ts +3 -3
- package/data/_Relationship.js +1 -1
- package/data/_TableExtension.js +1 -1
- package/data/convert.js +1 -1
- package/data/support/DefaultRelationshipFactory.js +1 -1
- package/data/support/DefaultTableExtensionFactory.js +1 -1
- package/data/support/attachments.js +1 -1
- package/docs/html/assets/main.js +56 -52
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +23 -0
- package/docs/html/classes/data_FeatureSet.FeatureSet.html +2 -2
- package/docs/html/classes/data_FeatureStream.FeatureStream.html +1 -1
- package/docs/html/classes/utilities_ObservableMap.ObservableMap.html +2 -2
- package/docs/html/classes/utilities_ObservableSet.ObservableSet.html +2 -2
- package/docs/html/classes/utilities_ObservableWeakSet.ObservableWeakSet.html +1 -1
- package/docs/html/classes/utilities_asyncIterable.AsyncQueue.html +1 -1
- package/docs/html/classes/utilities_date.DateFormatter.html +1 -1
- package/docs/html/classes/utilities_string.StringFormatter.html +6 -24
- package/docs/html/functions/utilities_string.format.html +2 -18
- package/docs/html/interfaces/LanguageResources.LanguageResourcesProperties.html +2 -7
- package/docs/html/interfaces/data_support_attachments.AttachmentEnabledLayer.html +4 -6
- package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerProperties.html +1 -1
- package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerProperties.html +1 -1
- package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerBaseProperties.html +1 -1
- package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerProperties.html +1 -1
- package/docs/html/interfaces/portal_ApplicationProperties.ApplicationProperties.html +15 -12
- package/docs/html/interfaces/portal_Background.ColorBackground.html +3 -2
- package/docs/html/interfaces/portal_BaseMap.BaseMap-1.html +2 -1
- package/docs/html/interfaces/portal_BaseMapLayer.BaseMapLayerBase.html +2 -1
- package/docs/html/interfaces/portal_BingLayer.BingLayer.html +2 -1
- package/docs/html/interfaces/portal_Bookmark.Bookmark.html +2 -1
- package/docs/html/interfaces/portal_BuildingSceneLayer.BuildingSceneLayer-1.html +1 -1
- package/docs/html/interfaces/portal_CIMSymbol.CIMSymbol.html +2 -1
- package/docs/html/interfaces/portal_CSVLayer.CSVLayer-1.html +3 -2
- package/docs/html/interfaces/portal_Camera.Camera-1.html +2 -1
- package/docs/html/interfaces/portal_ClassBreaksRenderer.ClassBreakInfo.html +2 -1
- package/docs/html/interfaces/portal_ClassBreaksRenderer.ClassBreaksRenderer.html +2 -1
- package/docs/html/interfaces/portal_CodedValueDomain.CodedValue.html +1 -1
- package/docs/html/interfaces/portal_CodedValueDomain.CodedValueDomain-1.html +1 -1
- package/docs/html/interfaces/portal_ColorClassBreakInfo.ColorClassBreakInfo.html +2 -1
- package/docs/html/interfaces/portal_ColorUniqueValueInfos.ColorUniqueValueInfos.html +2 -1
- package/docs/html/interfaces/portal_DataSource.DataSourceBase.html +2 -2
- package/docs/html/interfaces/portal_DefinitionEditor.DefinitionEditor.html +2 -1
- package/docs/html/interfaces/portal_DefinitionEditor.Input.html +1 -1
- package/docs/html/interfaces/portal_DefinitionEditor.Parameter.html +1 -1
- package/docs/html/interfaces/portal_DrawingInfo.DrawingInfo-1.html +2 -1
- package/docs/html/interfaces/portal_DynamicDataLayer.DynamicDataLayer.html +2 -2
- package/docs/html/interfaces/portal_DynamicMapLayer.DynamicMapLayer.html +1 -1
- package/docs/html/interfaces/portal_ElevationInfo.ElevationInfo-1.html +1 -1
- package/docs/html/interfaces/portal_ElevationLayer.ElevationLayer-1.html +3 -2
- package/docs/html/interfaces/portal_Environment.Environment-1.html +2 -1
- package/docs/html/interfaces/portal_Extent.Extent.html +1 -1
- package/docs/html/interfaces/portal_ExtrudeSymbol3DLayer.ExtrudeSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_Feature.Feature-1.html +2 -1
- package/docs/html/interfaces/portal_FeatureCollection.FeatureCollection.html +2 -1
- package/docs/html/interfaces/portal_FeatureLayer.FeatureLayer-1.html +3 -2
- package/docs/html/interfaces/portal_FeatureSet.FeatureSet.html +2 -1
- package/docs/html/interfaces/portal_Field.Field-1.html +1 -1
- package/docs/html/interfaces/portal_FieldInfo.FieldInfo.html +2 -1
- package/docs/html/interfaces/portal_FillSymbol3DLayer.FillSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_FormInfo.FormAttachmentElement.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormBarcodeScannerInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormComboBoxInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormDateTimePickerInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormExpressionInfo.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormFieldElement.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormGroupElement.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormInfo-1.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormRadioButtonsInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormRelationshipElement.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormSwitchInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormTextAreaInput.html +1 -1
- package/docs/html/interfaces/portal_FormInfo.FormTextBoxInput.html +1 -1
- package/docs/html/interfaces/portal_Format.Format.html +2 -1
- package/docs/html/interfaces/portal_GeoRSSLayer.GeoRSSLayer-1.html +3 -2
- package/docs/html/interfaces/portal_GroupLayer.GroupLayer-1.html +3 -2
- package/docs/html/interfaces/portal_HeatmapRenderer.ColorStop.html +2 -1
- package/docs/html/interfaces/portal_HeatmapRenderer.HeatmapRenderer.html +2 -1
- package/docs/html/interfaces/portal_IconSymbol3DLayer.IconSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_ImageServiceLayer.ImageServiceLayer-1.html +3 -2
- package/docs/html/interfaces/portal_ImageServiceVectorLayer.ImageServiceVectorLayer.html +3 -2
- package/docs/html/interfaces/portal_InheritedDomain.InheritedDomain-1.html +1 -1
- package/docs/html/interfaces/portal_InitialState.InitialState-1.html +2 -1
- package/docs/html/interfaces/portal_IntegratedMeshLayer.IntegratedMeshLayer-1.html +3 -2
- package/docs/html/interfaces/portal_Item.Item-1.html +3 -2
- package/docs/html/interfaces/portal_JoinTableDataSource.JoinTableDataSource.html +2 -2
- package/docs/html/interfaces/portal_KMLLayer.KMLLayer-1.html +3 -2
- package/docs/html/interfaces/portal_LabelSymbol3D.LabelSymbol3D.html +2 -1
- package/docs/html/interfaces/portal_LabelingInfo.LabelingInfo-1.html +3 -2
- package/docs/html/interfaces/portal_Layer.Layer-1.html +1 -1
- package/docs/html/interfaces/portal_LayerDefinition.FieldOverride.html +1 -1
- package/docs/html/interfaces/portal_LayerDefinition.LayerDefinition-1.html +4 -3
- package/docs/html/interfaces/portal_LayerDefinition.LayerTimeInfo.html +2 -2
- package/docs/html/interfaces/portal_Lighting.SunLighting.html +2 -1
- package/docs/html/interfaces/portal_Lighting.VirtualLighting.html +2 -1
- package/docs/html/interfaces/portal_LineSymbol3D.LineSymbol3D.html +2 -1
- package/docs/html/interfaces/portal_LineSymbol3DLayer.LineSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_LocationInfo.LocationInfo.html +2 -1
- package/docs/html/interfaces/portal_MapFloorInfo.FacilityLayerInfo.html +1 -1
- package/docs/html/interfaces/portal_MapFloorInfo.LevelLayerInfo.html +1 -1
- package/docs/html/interfaces/portal_MapFloorInfo.MapFloorInfo-1.html +1 -1
- package/docs/html/interfaces/portal_MapFloorInfo.SiteLayerInfo.html +1 -1
- package/docs/html/interfaces/portal_MapRangeInfo.MapRangeInfo.html +2 -1
- package/docs/html/interfaces/portal_MapServiceLayer.MapServiceLayer-1.html +3 -2
- package/docs/html/interfaces/portal_MeshSymbol3D.MeshSymbol3D.html +2 -1
- package/docs/html/interfaces/portal_MosaicRule.MosaicRule-1.html +2 -1
- package/docs/html/interfaces/portal_Multipoint.Multipoint.html +1 -1
- package/docs/html/interfaces/portal_ObjectSymbol3DLayer.ObjectSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_OpenStreetMapLayer.OpenStreetMapLayer-1.html +2 -1
- package/docs/html/interfaces/portal_OperationalLayer.OperationalLayerBase.html +1 -1
- package/docs/html/interfaces/portal_PathSymbol3DLayer.PathSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_PictureFillSymbol.PictureFillSymbol.html +2 -1
- package/docs/html/interfaces/portal_PictureMarkerSymbol.PictureMarkerSymbol.html +2 -1
- package/docs/html/interfaces/portal_Point.Point.html +2 -1
- package/docs/html/interfaces/portal_PointCloudBitfieldFilter.PointCloudBitfieldFilter.html +2 -1
- package/docs/html/interfaces/portal_PointCloudClassBreaksRenderer.PointCloudClassBreaksRenderer.html +4 -2
- package/docs/html/interfaces/portal_PointCloudFixedSizeAlgorithm.PointCloudFixedSizeAlgorithm.html +2 -1
- package/docs/html/interfaces/portal_PointCloudLayer.PointCloudLayer-1.html +3 -2
- package/docs/html/interfaces/portal_PointCloudRGBRenderer.PointCloudRGBRenderer.html +4 -2
- package/docs/html/interfaces/portal_PointCloudRenderer.PointCloudRendererBase.html +4 -2
- package/docs/html/interfaces/portal_PointCloudReturnFilter.PointCloudReturnFilter.html +2 -1
- package/docs/html/interfaces/portal_PointCloudSplatAlgorithm.PointCloudSplatAlgorithm.html +2 -1
- package/docs/html/interfaces/portal_PointCloudStretchRenderer.PointCloudStretchRenderer.html +4 -2
- package/docs/html/interfaces/portal_PointCloudUniqueValueRenderer.PointCloudUniqueValueRenderer.html +4 -2
- package/docs/html/interfaces/portal_PointCloudValueFilter.PointCloudValueFilter.html +2 -1
- package/docs/html/interfaces/portal_PointSymbol3D.PointSymbol3D.html +3 -2
- package/docs/html/interfaces/portal_Polygon.Polygon.html +1 -1
- package/docs/html/interfaces/portal_PolygonSymbol3D.PolygonSymbol3D.html +2 -1
- package/docs/html/interfaces/portal_Polyline.Polyline.html +1 -1
- package/docs/html/interfaces/portal_PopupExpressionInfo.PopupExpressionInfo.html +2 -1
- package/docs/html/interfaces/portal_PopupInfo.OrderByFields.html +2 -1
- package/docs/html/interfaces/portal_PopupInfo.RelatedRecordsInfo.html +2 -1
- package/docs/html/interfaces/portal_PredominanceRenderer.PredominanceRenderer.html +2 -1
- package/docs/html/interfaces/portal_Presentation.Presentation-1.html +2 -1
- package/docs/html/interfaces/portal_QueryTableDataSource.QueryTableDataSource.html +2 -2
- package/docs/html/interfaces/portal_RangeDomain.RangeDomain-1.html +1 -1
- package/docs/html/interfaces/portal_RangeInfo.RangeInfo.html +2 -1
- package/docs/html/interfaces/portal_RasterDataSource.RasterDataSource.html +2 -2
- package/docs/html/interfaces/portal_Renderer.AuthoringInfo.html +2 -1
- package/docs/html/interfaces/portal_Renderer.ColorRamp.html +1 -1
- package/docs/html/interfaces/portal_Renderer.RendererBase.html +2 -1
- package/docs/html/interfaces/portal_RenderingRule.RenderingRule-1.html +3 -2
- package/docs/html/interfaces/portal_SceneLayer.SceneLayer-1.html +3 -2
- package/docs/html/interfaces/portal_SimpleFillSymbol.SimpleFillSymbol.html +2 -1
- package/docs/html/interfaces/portal_SimpleLineSymbol.SimpleLineSymbol.html +2 -1
- package/docs/html/interfaces/portal_SimpleMarkerSymbol.SimpleMarkerSymbol.html +2 -1
- package/docs/html/interfaces/portal_SimpleRenderer.SimpleRenderer.html +2 -1
- package/docs/html/interfaces/portal_Slide.Slide-1.html +4 -4
- package/docs/html/interfaces/portal_SpatialReference.SpatialReference-1.html +2 -1
- package/docs/html/interfaces/portal_StreamLayer.StreamLayer-1.html +2 -2
- package/docs/html/interfaces/portal_StyleSymbolReference.StyleSymbolReference.html +2 -1
- package/docs/html/interfaces/portal_SubtypeGroupLayer.SubtypeGroupLayer-1.html +3 -2
- package/docs/html/interfaces/portal_SubtypeGroupLayer.SubtypeSubtypeGroupLayer.html +2 -2
- package/docs/html/interfaces/portal_SubtypeSublayer.SubtypeSublayer-1.html +3 -2
- package/docs/html/interfaces/portal_Symbol.Font.html +1 -1
- package/docs/html/interfaces/portal_Symbol3D.Material.html +2 -1
- package/docs/html/interfaces/portal_Symbol3D.Outline.html +2 -1
- package/docs/html/interfaces/portal_Symbol3D.ResourceIconSymbol.html +2 -1
- package/docs/html/interfaces/portal_Symbol3D.ResourceObjectSymbol.html +2 -1
- package/docs/html/interfaces/portal_Table.Table.html +1 -1
- package/docs/html/interfaces/portal_TableDataSource.TableDataSource.html +2 -2
- package/docs/html/interfaces/portal_Template.Template-1.html +2 -1
- package/docs/html/interfaces/portal_TemporalRenderer.TemporalRenderer.html +2 -1
- package/docs/html/interfaces/portal_TextSymbol.TextSymbol.html +2 -1
- package/docs/html/interfaces/portal_TextSymbol3DLayer.TextSymbol3DLayer.html +2 -1
- package/docs/html/interfaces/portal_TileInfo.TileInfo-1.html +3 -2
- package/docs/html/interfaces/portal_TiledImageServiceLayer.TiledImageServiceLayer-1.html +3 -2
- package/docs/html/interfaces/portal_TiledMapServiceLayer.TiledMapServiceLayer-1.html +4 -3
- package/docs/html/interfaces/portal_Type.Type-1.html +3 -8
- package/docs/html/interfaces/portal_UniqueValueFromStyle.UniqueValueFromStyle.html +2 -1
- package/docs/html/interfaces/portal_UniqueValueRenderer.UniqueValueInfo.html +2 -1
- package/docs/html/interfaces/portal_UniqueValueRenderer.UniqueValueRenderer.html +2 -1
- package/docs/html/interfaces/portal_UtilityNetwork.TraceConfiguration.html +1 -1
- package/docs/html/interfaces/portal_UtilityNetwork.UtilityNetwork-1.html +1 -1
- package/docs/html/interfaces/portal_Value.Value.html +1 -1
- package/docs/html/interfaces/portal_VectorTileLayer.VectorTileLayer-1.html +3 -2
- package/docs/html/interfaces/portal_VerticalOffset.VerticalOffset.html +1 -1
- package/docs/html/interfaces/portal_Viewpoint.Viewpoint-1.html +2 -1
- package/docs/html/interfaces/portal_VisualVariable.ColorInfo.html +3 -2
- package/docs/html/interfaces/portal_VisualVariable.RotationInfo.html +3 -2
- package/docs/html/interfaces/portal_VisualVariable.Size.html +2 -1
- package/docs/html/interfaces/portal_VisualVariable.SizeInfo.html +3 -2
- package/docs/html/interfaces/portal_VisualVariable.TransparencyInfo.html +2 -1
- package/docs/html/interfaces/portal_VisualVariable.VisualVariableBase.html +1 -1
- package/docs/html/interfaces/portal_WMSLayer.WMSLayer-1.html +3 -2
- package/docs/html/interfaces/portal_WMSSublayer.WMSSublayer-1.html +2 -1
- package/docs/html/interfaces/portal_WMTSInfo.WMTSInfo-1.html +1 -1
- package/docs/html/interfaces/portal_Weather.CloudyWeather.html +2 -1
- package/docs/html/interfaces/portal_Weather.FoggyWeather.html +2 -1
- package/docs/html/interfaces/portal_Weather.RainyWeather.html +2 -1
- package/docs/html/interfaces/portal_Weather.SnowyWeather.html +2 -1
- package/docs/html/interfaces/portal_Weather.SunnyWeather.html +2 -1
- package/docs/html/interfaces/portal_WebMap.WebMap-1.html +3 -3
- package/docs/html/interfaces/portal_WebScene.WebScene-1.html +5 -3
- package/docs/html/interfaces/portal_WebSceneBaseMap.WebSceneBaseMap-1.html +2 -1
- package/docs/html/interfaces/portal_WebTileLayer.WebTileLayer-1.html +3 -2
- package/docs/html/interfaces/portal_Widgets.FloorFilter.html +1 -1
- package/docs/html/interfaces/portal_Widgets.Range.html +1 -1
- package/docs/html/interfaces/portal_Widgets.TimeSlider.html +3 -2
- package/docs/html/interfaces/portal_Widgets.Widgets.html +2 -1
- package/docs/html/interfaces/support_Serializable.PropertyDef.html +2 -2
- package/docs/html/interfaces/tasks_identify_IdentifyOptions.IdentifyOptions-1.html +2 -2
- package/docs/html/interfaces/tasks_search_SearchOptions.SearchOptions-1.html +2 -2
- package/docs/html/interfaces/utilities_array.CompareOptions.html +8 -8
- package/docs/html/interfaces/utilities_geometry.GeographicTransformationJson.html +1 -1
- package/docs/html/types/portal_DataSource.DataSource.html +1 -0
- package/docs/html/types/portal_Domain.Domain-1.html +2 -1
- package/docs/html/types/portal_Geometry.Geometry.html +1 -1
- package/docs/html/types/portal_PointCloudFilter.PointCloudFilter.html +2 -1
- package/docs/html/types/portal_Symbol.Color.html +1 -1
- package/docs/html/types/portal_Symbol.Symbol.html +1 -1
- package/docs/html/types/portal_Symbol3D.Symbol3D.html +2 -1
- package/docs/html/types/portal_VisualVariable.VisualVariable.html +2 -1
- package/docs/html/variables/mapping_BasemapExtension.defaultBasemapExtensionFactory.html +2 -2
- package/docs/html/variables/version.version.html +1 -1
- package/forked-libs/dbf/src/fields.js +1 -1
- package/forked-libs/dbf/src/structure.js +1 -1
- package/forked-libs/shp-write/src/download.js +1 -1
- package/forked-libs/shp-write/src/fields.js +1 -1
- package/forked-libs/shp-write/src/geojson.js +1 -1
- package/forked-libs/shp-write/src/multipoint.js +1 -1
- package/forked-libs/shp-write/src/points.js +1 -1
- package/forked-libs/shp-write/src/poly.js +1 -1
- package/forked-libs/shp-write/src/write.js +1 -1
- package/forked-libs/shp-write/src/zip.js +1 -1
- package/layer-preset/LayerPreset.d.ts +1 -1
- package/layer-preset/LayerPreset.js +1 -1
- package/layer-preset/LayerPresetSettings.d.ts +1 -1
- package/layer-preset/LayerPresetSettings.js +1 -1
- package/locale/_registry.js +1 -1
- package/locale/af.js +1 -1
- package/locale/ar-MA.js +1 -1
- package/locale/ar-SA.js +1 -1
- package/locale/ar-TN.js +1 -1
- package/locale/ar.js +1 -1
- package/locale/az.js +1 -1
- package/locale/be.js +1 -1
- package/locale/bg.js +1 -1
- package/locale/bn.js +1 -1
- package/locale/bs.js +1 -1
- package/locale/ca.js +1 -1
- package/locale/cs.js +1 -1
- package/locale/cv.js +1 -1
- package/locale/cy.js +1 -1
- package/locale/da.js +1 -1
- package/locale/de-AT.js +1 -1
- package/locale/de.js +1 -1
- package/locale/el.js +1 -1
- package/locale/en-AU.js +1 -1
- package/locale/en-CA.js +1 -1
- package/locale/en-GB.js +1 -1
- package/locale/en.js +1 -1
- package/locale/es.js +1 -1
- package/locale/et.js +1 -1
- package/locale/eu.js +1 -1
- package/locale/fa.js +1 -1
- package/locale/fi.js +1 -1
- package/locale/fo.js +1 -1
- package/locale/fr-CA.js +1 -1
- package/locale/fr.js +1 -1
- package/locale/gl.js +1 -1
- package/locale/he.js +1 -1
- package/locale/hi.js +1 -1
- package/locale/hr.js +1 -1
- package/locale/hu.js +1 -1
- package/locale/hy.js +1 -1
- package/locale/id.js +1 -1
- package/locale/inv.js +1 -1
- package/locale/is.js +1 -1
- package/locale/it.js +1 -1
- package/locale/ja.js +1 -1
- package/locale/ka.js +1 -1
- package/locale/km.js +1 -1
- package/locale/ko.js +1 -1
- package/locale/language.js +1 -1
- package/locale/lt.js +1 -1
- package/locale/lv.js +1 -1
- package/locale/mk.js +1 -1
- package/locale/ml.js +1 -1
- package/locale/mr.js +1 -1
- package/locale/ms-MY.js +1 -1
- package/locale/ms.js +1 -1
- package/locale/my.js +1 -1
- package/locale/nb.js +1 -1
- package/locale/ne.js +1 -1
- package/locale/nl.js +1 -1
- package/locale/nn.js +1 -1
- package/locale/no.js +1 -1
- package/locale/pl.js +1 -1
- package/locale/pt-BR.js +1 -1
- package/locale/pt.js +1 -1
- package/locale/ro.js +1 -1
- package/locale/ru.js +1 -1
- package/locale/si.js +1 -1
- package/locale/sk.js +1 -1
- package/locale/sl.js +1 -1
- package/locale/sq.js +1 -1
- package/locale/sr-Cyrl.js +1 -1
- package/locale/sr-ME.js +1 -1
- package/locale/sr.js +1 -1
- package/locale/sv.js +1 -1
- package/locale/ta.js +1 -1
- package/locale/th.js +1 -1
- package/locale/tl.js +1 -1
- package/locale/tr.js +1 -1
- package/locale/tzm-Latn.js +1 -1
- package/locale/tzm.js +1 -1
- package/locale/uk.js +1 -1
- package/locale/uz.js +1 -1
- package/locale/vi.js +1 -1
- package/locale/zh-TW.js +1 -1
- package/locale/zh.js +1 -1
- package/locale.js +1 -1
- package/mapping/ArcGISSublayerExtension.js +1 -1
- package/mapping/BasemapExtension.js +1 -1
- package/mapping/Bookmark.d.ts +1 -1
- package/mapping/Bookmark.js +1 -1
- package/mapping/BuildingComponentSublayerExtension.js +1 -1
- package/mapping/BuildingGroupSublayerExtension.js +1 -1
- package/mapping/BuildingSceneLayerExtension.js +1 -1
- package/mapping/BuildingSublayerExtension.js +1 -1
- package/mapping/CSVLayerExtension.js +1 -1
- package/mapping/ElevationLayerExtension.js +1 -1
- package/mapping/FeatureCollectionLayerExtension.js +1 -1
- package/mapping/FeatureLayerExtension.js +1 -1
- package/mapping/FeatureLayerExtensionBase.js +1 -1
- package/mapping/GeoRSSLayerExtension.js +1 -1
- package/mapping/GraphicsLayerExtension.js +1 -1
- package/mapping/GroundExtension.d.ts +1 -1
- package/mapping/GroundExtension.js +1 -1
- package/mapping/GroupLayerExtension.js +1 -1
- package/mapping/ImageryLayerExtension.js +1 -1
- package/mapping/ImageryTileLayerExtension.js +1 -1
- package/mapping/IntegratedMeshLayerExtension.js +1 -1
- package/mapping/KMLLayerExtension.js +1 -1
- package/mapping/KMLSublayerExtension.js +1 -1
- package/mapping/LayerExtension.js +1 -1
- package/mapping/MapConstraints.js +1 -1
- package/mapping/MapExtension.d.ts +5 -5
- package/mapping/MapExtension.js +1 -1
- package/mapping/MapImageLayerExtension.d.ts +1 -1
- package/mapping/MapImageLayerExtension.js +1 -1
- package/mapping/MapImageSublayerExtension.js +1 -1
- package/mapping/OpenStreetMapLayerExtension.js +1 -1
- package/mapping/PointCloudLayerExtension.js +1 -1
- package/mapping/SceneLayerExtension.js +1 -1
- package/mapping/StreamLayerExtension.js +1 -1
- package/mapping/SublayerExtension.js +1 -1
- package/mapping/SubtypeGroupLayerExtension.js +1 -1
- package/mapping/SubtypeSublayerExtension.js +1 -1
- package/mapping/TileLayerExtension.js +1 -1
- package/mapping/TileSublayerExtension.js +1 -1
- package/mapping/UnsupportedLayerExtension.js +1 -1
- package/mapping/VectorTileLayerExtension.js +1 -1
- package/mapping/WMSLayerExtension.js +1 -1
- package/mapping/WMSSublayerExtension.js +1 -1
- package/mapping/WMTSLayerExtension.js +1 -1
- package/mapping/WMTSSublayerExtension.js +1 -1
- package/mapping/WebTileLayerExtension.js +1 -1
- package/mapping/_LayerExtension.d.ts +1 -1
- package/mapping/_LayerExtension.js +1 -1
- package/mapping/_SublayerExtension.d.ts +1 -1
- package/mapping/_SublayerExtension.js +1 -1
- package/mapping/convert.js +1 -1
- package/mapping/support/ArrayWrappedCollection.js +1 -1
- package/mapping/support/DefaultLayerExtensionFactory.js +1 -1
- package/mapping/support/DefaultSublayerExtensionFactory.js +1 -1
- package/mapping/support/LayerListSettings.js +1 -1
- package/mapping/support/PopupTemplateFeatureSettings.js +1 -1
- package/mapping/support/WfsCapabilities.js +1 -1
- package/mapping/support/WfsFeatureType.js +1 -1
- package/mapping/support/_LayerExtensionCollection.js +1 -1
- package/mapping/support/_SublayerExtensionCollection.js +1 -1
- package/mapping/support/_kml.js +1 -1
- package/mapping/support/ogc.js +1 -1
- package/menus/Menu.js +1 -1
- package/menus/MenuItem.js +1 -1
- package/package.json +36 -35
- package/portal/ApplicationProperties.d.ts +16 -13
- package/portal/Background.d.ts +3 -2
- package/portal/Background.js +1 -1
- package/portal/BaseMap.d.ts +1 -0
- package/portal/BaseMap.js +1 -1
- package/portal/BaseMapLayer.d.ts +3 -2
- package/portal/BingLayer.d.ts +1 -0
- package/portal/Bookmark.d.ts +1 -0
- package/portal/BuildingSceneLayer.d.ts +1 -1
- package/portal/BuildingSceneLayer.js +1 -1
- package/portal/BuildingSceneSublayer.js +1 -1
- package/portal/CIMSymbol.d.ts +1 -0
- package/portal/CSVLayer.d.ts +1 -0
- package/portal/CSVLayer.js +1 -1
- package/portal/Camera.d.ts +1 -0
- package/portal/Camera.js +1 -1
- package/portal/ClassBreaksRenderer.d.ts +4 -2
- package/portal/CodedValueDomain.d.ts +2 -2
- package/portal/CodedValueDomain.js +1 -1
- package/portal/ColorClassBreakInfo.d.ts +1 -0
- package/portal/ColorUniqueValueInfos.d.ts +1 -0
- package/portal/DataSource.d.ts +5 -4
- package/portal/DefinitionEditor.d.ts +3 -2
- package/portal/Domain.d.ts +3 -2
- package/portal/Domain.js +1 -1
- package/portal/DrawingInfo.d.ts +1 -0
- package/portal/DrawingInfo.js +1 -1
- package/portal/DynamicDataLayer.d.ts +2 -2
- package/portal/DynamicMapLayer.d.ts +1 -1
- package/portal/Edges.d.ts +1 -1
- package/portal/Edges.js +1 -1
- package/portal/Effect.d.ts +2 -2
- package/portal/ElevationInfo.d.ts +2 -2
- package/portal/ElevationInfo.js +1 -1
- package/portal/ElevationLayer.d.ts +1 -0
- package/portal/ElevationLayer.js +1 -1
- package/portal/Environment.d.ts +1 -0
- package/portal/Environment.js +1 -1
- package/portal/Extent.d.ts +1 -1
- package/portal/ExtrudeSymbol3DLayer.d.ts +1 -0
- package/portal/Feature.d.ts +1 -0
- package/portal/Feature.js +1 -1
- package/portal/FeatureCollection.d.ts +1 -0
- package/portal/FeatureLayer.d.ts +2 -1
- package/portal/FeatureLayer.js +1 -1
- package/portal/FeatureReduction.d.ts +1 -1
- package/portal/FeatureReduction.js +1 -1
- package/portal/FeatureSet.d.ts +1 -0
- package/portal/Field.d.ts +2 -2
- package/portal/Field.js +1 -1
- package/portal/FieldInfo.d.ts +2 -1
- package/portal/FillSymbol3DLayer.d.ts +1 -0
- package/portal/FormInfo.d.ts +13 -13
- package/portal/FormInfo.js +1 -1
- package/portal/Format.d.ts +2 -1
- package/portal/GeoRSSLayer.d.ts +1 -0
- package/portal/GeoRSSLayer.js +1 -1
- package/portal/Geometry.d.ts +3 -3
- package/portal/Geometry.js +1 -1
- package/portal/Ground.d.ts +1 -1
- package/portal/Ground.js +1 -1
- package/portal/GroupLayer.d.ts +2 -1
- package/portal/GroupLayer.js +1 -1
- package/portal/HeatmapRenderer.d.ts +2 -0
- package/portal/IconSymbol3DLayer.d.ts +1 -0
- package/portal/ImageServiceLayer.d.ts +1 -0
- package/portal/ImageServiceLayer.js +1 -1
- package/portal/ImageServiceVectorLayer.d.ts +1 -0
- package/portal/InheritedDomain.d.ts +1 -1
- package/portal/InheritedDomain.js +1 -1
- package/portal/InitialState.d.ts +1 -0
- package/portal/InitialState.js +1 -1
- package/portal/IntegratedMeshLayer.d.ts +1 -0
- package/portal/IntegratedMeshLayer.js +1 -1
- package/portal/Item.d.ts +2 -1
- package/portal/Item.js +1 -1
- package/portal/JoinTableDataSource.d.ts +2 -2
- package/portal/KMLLayer.d.ts +1 -0
- package/portal/KMLLayer.js +1 -1
- package/portal/LabelSymbol3D.d.ts +1 -0
- package/portal/LabelingInfo.d.ts +3 -2
- package/portal/LabelingInfo.js +1 -1
- package/portal/Layer.d.ts +1 -1
- package/portal/Layer.js +1 -1
- package/portal/LayerBase.js +1 -1
- package/portal/LayerDefinition.d.ts +8 -7
- package/portal/LayerDefinition.js +1 -1
- package/portal/Lighting.d.ts +3 -1
- package/portal/Lighting.js +1 -1
- package/portal/LineSymbol3D.d.ts +1 -0
- package/portal/LineSymbol3DLayer.d.ts +1 -0
- package/portal/LocationInfo.d.ts +1 -0
- package/portal/MapFloorInfo.d.ts +4 -4
- package/portal/MapFloorInfo.js +1 -1
- package/portal/MapRangeInfo.d.ts +1 -0
- package/portal/MapServiceLayer.d.ts +1 -0
- package/portal/MapServiceLayer.js +1 -1
- package/portal/MediaInfo.d.ts +1 -1
- package/portal/MediaInfo.js +1 -1
- package/portal/MeshSymbol3D.d.ts +1 -0
- package/portal/MosaicRule.d.ts +3 -2
- package/portal/MosaicRule.js +1 -1
- package/portal/Multipoint.d.ts +1 -1
- package/portal/ObjectSymbol3DLayer.d.ts +1 -0
- package/portal/OpenStreetMapLayer.d.ts +1 -0
- package/portal/OpenStreetMapLayer.js +1 -1
- package/portal/OperationalLayer.d.ts +3 -3
- package/portal/PathSymbol3DLayer.d.ts +1 -0
- package/portal/PictureFillSymbol.d.ts +1 -0
- package/portal/PictureMarkerSymbol.d.ts +1 -0
- package/portal/Point.d.ts +2 -1
- package/portal/PointCloudBitfieldFilter.d.ts +1 -0
- package/portal/PointCloudClassBreaksRenderer.d.ts +1 -0
- package/portal/PointCloudFilter.d.ts +2 -1
- package/portal/PointCloudFixedSizeAlgorithm.d.ts +1 -0
- package/portal/PointCloudLayer.d.ts +1 -0
- package/portal/PointCloudLayer.js +1 -1
- package/portal/PointCloudRGBRenderer.d.ts +1 -0
- package/portal/PointCloudRenderer.d.ts +3 -1
- package/portal/PointCloudRenderer.js +1 -1
- package/portal/PointCloudReturnFilter.d.ts +1 -0
- package/portal/PointCloudSplatAlgorithm.d.ts +1 -0
- package/portal/PointCloudStretchRenderer.d.ts +1 -0
- package/portal/PointCloudUniqueValueRenderer.d.ts +1 -0
- package/portal/PointCloudValueFilter.d.ts +1 -0
- package/portal/PointSymbol3D.d.ts +2 -1
- package/portal/Polygon.d.ts +1 -1
- package/portal/PolygonSymbol3D.d.ts +1 -0
- package/portal/Polyline.d.ts +1 -1
- package/portal/PopupExpressionInfo.d.ts +2 -1
- package/portal/PopupInfo.d.ts +3 -1
- package/portal/PopupInfo.js +1 -1
- package/portal/PredominanceRenderer.d.ts +1 -0
- package/portal/Presentation.d.ts +1 -0
- package/portal/Presentation.js +1 -1
- package/portal/QueryTableDataSource.d.ts +1 -1
- package/portal/RangeDomain.d.ts +1 -1
- package/portal/RangeDomain.js +1 -1
- package/portal/RangeInfo.d.ts +1 -0
- package/portal/RasterDataSource.d.ts +1 -1
- package/portal/Renderer.d.ts +8 -6
- package/portal/Renderer.js +1 -1
- package/portal/RenderingRule.d.ts +3 -2
- package/portal/RenderingRule.js +1 -1
- package/portal/SceneLayer.d.ts +1 -0
- package/portal/SceneLayer.js +1 -1
- package/portal/SimpleFillSymbol.d.ts +2 -1
- package/portal/SimpleLineSymbol.d.ts +2 -1
- package/portal/SimpleMarkerSymbol.d.ts +2 -1
- package/portal/SimpleRenderer.d.ts +1 -0
- package/portal/Slide.d.ts +4 -4
- package/portal/Slide.js +1 -1
- package/portal/SpatialReference.d.ts +1 -0
- package/portal/SpatialReference.js +1 -1
- package/portal/StreamLayer.d.ts +1 -1
- package/portal/StreamLayer.js +1 -1
- package/portal/StyleSymbolReference.d.ts +1 -0
- package/portal/SubtypeGroupLayer.d.ts +3 -2
- package/portal/SubtypeGroupLayer.js +1 -1
- package/portal/SubtypeSublayer.d.ts +1 -0
- package/portal/SubtypeSublayer.js +1 -1
- package/portal/Symbol.d.ts +11 -11
- package/portal/Symbol.js +1 -1
- package/portal/Symbol3D.d.ts +7 -2
- package/portal/Table.d.ts +3 -3
- package/portal/Table.js +1 -1
- package/portal/TableDataSource.d.ts +1 -1
- package/portal/Template.d.ts +2 -1
- package/portal/Template.js +1 -1
- package/portal/TemporalRenderer.d.ts +1 -0
- package/portal/TextSymbol.d.ts +1 -0
- package/portal/TextSymbol3DLayer.d.ts +1 -0
- package/portal/TileInfo.d.ts +2 -1
- package/portal/TileInfo.js +1 -1
- package/portal/TiledImageServiceLayer.d.ts +1 -0
- package/portal/TiledImageServiceLayer.js +1 -1
- package/portal/TiledMapServiceLayer.d.ts +2 -1
- package/portal/TiledMapServiceLayer.js +1 -1
- package/portal/Type.d.ts +2 -4
- package/portal/Type.js +1 -1
- package/portal/UniqueValueFromStyle.d.ts +1 -0
- package/portal/UniqueValueRenderer.d.ts +2 -0
- package/portal/UtilityNetwork.d.ts +2 -2
- package/portal/UtilityNetwork.js +1 -1
- package/portal/Value.d.ts +1 -1
- package/portal/VectorFieldRenderer.d.ts +1 -1
- package/portal/VectorTileLayer.d.ts +1 -0
- package/portal/VectorTileLayer.js +1 -1
- package/portal/VerticalOffset.d.ts +1 -1
- package/portal/Viewpoint.d.ts +1 -0
- package/portal/Viewpoint.js +1 -1
- package/portal/VisualVariable.d.ts +10 -4
- package/portal/WMSLayer.d.ts +1 -0
- package/portal/WMSLayer.js +1 -1
- package/portal/WMSSublayer.d.ts +1 -0
- package/portal/WMSSublayer.js +1 -1
- package/portal/WMTSInfo.d.ts +1 -1
- package/portal/WMTSInfo.js +1 -1
- package/portal/Weather.d.ts +6 -1
- package/portal/Weather.js +1 -1
- package/portal/WebMap.d.ts +3 -3
- package/portal/WebMap.js +1 -1
- package/portal/WebScene.d.ts +3 -1
- package/portal/WebScene.js +1 -1
- package/portal/WebSceneBaseMap.d.ts +1 -0
- package/portal/WebSceneBaseMap.js +1 -1
- package/portal/WebTileLayer.d.ts +1 -0
- package/portal/WebTileLayer.js +1 -1
- package/portal/Widgets.d.ts +6 -4
- package/portal/Widgets.js +1 -1
- package/portal/_LayerBase.d.ts +2 -2
- package/portal/_layerHelper.js +1 -1
- package/portal/_utils.js +1 -1
- package/support/Action.d.ts +4 -4
- package/support/ArcGISRequestHelper.js +1 -1
- package/support/Cancellable.d.ts +1 -1
- package/support/Cancellable.js +1 -1
- package/support/FormatSettings.js +1 -1
- package/support/InitializableBase.d.ts +1 -1
- package/support/InitializableBase.js +1 -1
- package/support/InitializableCollectionProxy.js +1 -1
- package/support/InitializeError.js +1 -1
- package/support/Observable.js +1 -1
- package/support/ReadOnlyInitializableCollection.js +1 -1
- package/support/Serializable.d.ts +4 -4
- package/support/Serializable.js +1 -1
- package/support/Settings.js +1 -1
- package/support/_ArcGISRelationshipCollection.js +1 -1
- package/support/_esriInternal.js +1 -1
- package/support/_graphicsQuery.js +1 -1
- package/support/_query.js +1 -1
- package/support/_requestCache.js +1 -1
- package/support/_restApiJson.d.ts +1 -1
- package/support/esri.d.ts +76 -76
- package/support/esri.js +1 -1
- package/tasks/geocoding/ArcGISGeocoder.js +1 -1
- package/tasks/geocoding/Geocoder.d.ts +1 -1
- package/tasks/geocoding/Geocoder.js +1 -1
- package/tasks/geocoding/utilities.js +1 -1
- package/tasks/identify/ArcGISSublayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/BuildingComponentSublayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/BuildingComponentSublayerHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/CSVLayer3DHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/CSVLayerClientSideQueryIdentifyProvider.js +1 -1
- package/tasks/identify/ClientSideIdentifyProvider.d.ts +2 -2
- package/tasks/identify/ClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayer3DHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/FeatureLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/GeoRSSLayerIdentifyProvider.js +1 -1
- package/tasks/identify/GraphicsLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/HitTestIdentifyProvider.d.ts +2 -2
- package/tasks/identify/HitTestIdentifyProvider.js +1 -1
- package/tasks/identify/IdentifyError.js +1 -1
- package/tasks/identify/IdentifyProviderBase.js +1 -1
- package/tasks/identify/IdentifyService.js +1 -1
- package/tasks/identify/ImageryLayerIdentifyProvider.js +1 -1
- package/tasks/identify/KMLLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/PointCloudLayerHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/SceneLayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/SceneLayerHitTestIdentifyProvider.js +1 -1
- package/tasks/identify/SceneLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/StreamLayerClientSideQueryIdentifyProvider.js +1 -1
- package/tasks/identify/StreamLayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/SubtypeSublayerClientSideIdentifyProvider.js +1 -1
- package/tasks/identify/SubtypeSublayerQueryIdentifyProvider.js +1 -1
- package/tasks/identify/WMSSublayerIdentifyProvider.js +1 -1
- package/tasks/query/ArcGISRelationship.js +1 -1
- package/tasks/query/ArcGISServiceTableQueryProvider.js +1 -1
- package/tasks/query/ArcGISSublayerQueryProvider.js +1 -1
- package/tasks/query/BuildingComponentSublayerClientSideQueryProvider.js +1 -1
- package/tasks/query/CSVLayerClientSideQueryProvider.js +1 -1
- package/tasks/query/CSVLayerQueryProvider.js +1 -1
- package/tasks/query/ClientSideQueryProvider.d.ts +2 -2
- package/tasks/query/ClientSideQueryProvider.js +1 -1
- package/tasks/query/FeatureLayerQueryProvider.js +1 -1
- package/tasks/query/GeoRSSLayerQueryProvider.js +1 -1
- package/tasks/query/GraphicsLayerQueryProvider.js +1 -1
- package/tasks/query/ImageryLayerQueryProvider.js +1 -1
- package/tasks/query/KMLLayerQueryProvider.js +1 -1
- package/tasks/query/QueryBasedRelationship.js +1 -1
- package/tasks/query/QueryError.js +1 -1
- package/tasks/query/QueryProviderBase.js +1 -1
- package/tasks/query/QueryService.js +1 -1
- package/tasks/query/SceneLayerClientSideQueryProvider.js +1 -1
- package/tasks/query/SceneLayerQueryProvider.js +1 -1
- package/tasks/query/StreamLayerClientSideQueryProvider.js +1 -1
- package/tasks/query/StreamLayerQueryProvider.js +1 -1
- package/tasks/query/SubtypeSublayerQueryProvider.js +1 -1
- package/tasks/search/ArcGISGeocoderSearchProvider.js +1 -1
- package/tasks/search/GeocoderSearchProvider.js +1 -1
- package/tasks/search/QuerySearchProvider.js +1 -1
- package/tasks/search/SearchError.js +1 -1
- package/tasks/search/SearchProviderBase.js +1 -1
- package/tasks/search/SearchService.js +1 -1
- package/tasks/search/_utilities.js +1 -1
- package/utilities/CollectionProxy.js +1 -1
- package/utilities/CopyOnWriteCollection.js +1 -1
- package/utilities/GeometryServiceError.js +1 -1
- package/utilities/MapTransformCollection.js +1 -1
- package/utilities/ObservableMap.js +1 -1
- package/utilities/ObservableSet.js +1 -1
- package/utilities/ObservableWeakSet.js +1 -1
- package/utilities/ReadOnlyCollection.js +1 -1
- package/utilities/ReadOnlyMap.js +1 -1
- package/utilities/_layers.js +1 -1
- package/utilities/_ogc.js +1 -1
- package/utilities/arcade.js +1 -1
- package/utilities/array.js +1 -1
- package/utilities/asyncIterable.d.ts +1 -1
- package/utilities/asyncIterable.js +1 -1
- package/utilities/basemaps.js +1 -1
- package/utilities/checkArg.js +1 -1
- package/utilities/collection.js +1 -1
- package/utilities/date.js +1 -1
- package/utilities/esri.js +1 -1
- package/utilities/extensions.js +1 -1
- package/utilities/geometry.d.ts +2 -2
- package/utilities/geometry.js +1 -1
- package/utilities/iterable.js +1 -1
- package/utilities/log.d.ts +1 -1
- package/utilities/log.js +1 -1
- package/utilities/mapping.js +1 -1
- package/utilities/math.js +1 -1
- package/utilities/number.js +1 -1
- package/utilities/object.js +1 -1
- package/utilities/portal.d.ts +3 -3
- package/utilities/portal.js +1 -1
- package/utilities/promise.d.ts +1 -1
- package/utilities/promise.js +1 -1
- package/utilities/query.js +1 -1
- package/utilities/relationships.js +1 -1
- package/utilities/scaleRanges.d.ts +1 -1
- package/utilities/set.js +1 -1
- package/utilities/string.d.ts +6 -21
- package/utilities/string.js +1 -1
- package/utilities/symbol.js +1 -1
- package/utilities/uri.js +1 -1
- package/utilities/watch.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/data/FeatureSettings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import
|
|
1
|
+
import{__decorate as t}from"tslib";import e from"@arcgis/core/PopupTemplate";import{Hyperlink as i}from"../Hyperlink.js";import{isPopupContentExtension as n}from"../ItemType.js";import{ArrayWrappedCollection as o}from"../mapping/support/ArrayWrappedCollection.js";import{PopupInfo as s}from"../portal/PopupInfo.js";import{FormatSettings as r}from"../support/FormatSettings.js";import{InitializableCollectionProxy as p}from"../support/InitializableCollectionProxy.js";import{filterJSONProperties as a,isDefault as u,serializable as l,shouldExcludeDefaults as h}from"../support/Serializable.js";import{Settings as f}from"../support/Settings.js";import{compare as m}from"../utilities/array.js";import{checkArg as c}from"../utilities/checkArg.js";import{getAllFieldInfos as d,getAllReferencedFieldNames as _,isPopupTemplate as g}from"../utilities/esri.js";import{isQueryBasedRelationship as S}from"../utilities/relationships.js";import{onCollectionPropertyChange as C}from"../utilities/watch.js";import{PopupContentExtension as y,_popupContentExtensionMap as T}from"./PopupContentExtension.js";import{fieldWithArcadeXRegex as x,fieldWithRelationshipRegex as z}from"./Schema.js";let E=class extends f{get _popupContent(){return this._popupContentCollection}get hyperlinkTemplates(){return this._getCollectionSetting("hyperlinkTemplates")}get popupTemplate(){return this._getSetting("popupTemplate")}set popupTemplate(t){let e;e=t instanceof Object&&!g(t)?s.toEsriApiPopupTemplate(t):t;const i=this?._feature?.schema?.createPopupTemplate()??this?._featureSource?.schema?.createPopupTemplate();e&&i&&(e.content=e.content??i.content,e.fieldInfos=e.fieldInfos??i.fieldInfos),this._setSetting("popupTemplate",e),this._isDefaultPopupTemplate=!1}get formatSettings(){return this._getNestedSettings("formatSettings",(()=>new r))}get returnGeometry(){return this._getSetting("returnGeometry",!0)}set returnGeometry(t){this._setSetting("returnGeometry",t)}get outFields(){return this._getSetting("outFields",this._defaultOutFields)}set outFields(t){this._setSetting("outFields",t)}get outSpatialReference(){return this._getSetting("outSpatialReference")}set outSpatialReference(t){this._setSetting("outSpatialReference",t)}get maxAllowableOffset(){return this._getSetting("maxAllowableOffset")}set maxAllowableOffset(t){this._setSetting("maxAllowableOffset",t)}get zoomScale(){return this._getSetting("zoomScale")}set zoomScale(t){this._setSetting("zoomScale",t)}get zoomFactor(){const t=this._feature?this._feature.schema:this._featureSource?.schema,e=t&&"point"===t.geometryType?void 0:1.5;return this._getSetting("zoomFactor",e)}set zoomFactor(t){this._setSetting("zoomFactor",t)}get featureSource(){return this._featureSource}get feature(){return this._feature}constructor(t){super(t),this._isDefaultPopupTemplate=!1,this._popupContentCollection=this._createPopupContentCollection(),this.popupContentExtensions=new v(this)}get _defaultOutFields(){const t=d(this.popupTemplate),e=this.featureSource?.schema?.primaryKeyField;if(t&&e){const i=new Set;i.add(e);const n=this.featureSource.schema.fields.toArray().map((t=>t.name)),o=_(this.popupTemplate),s=t.filter((t=>t.visible||t.isEditable&&this.featureSource.capabilities.supportsEditing)).map((t=>t.fieldName)).concat(...o).filter((t=>n.includes(t)));return this._featureSource.relationships.forEach((t=>{S(t)&&s.push(t.keyField)})),s.filter((t=>!(t.match(x)||t.match(z)))).forEach((t=>i.add(t))),Array.from(i.values())}return["*"]}_setFeatureSource(t){this._featureSource=t,this.notifyChange("featureSource")}_setFeature(t){this._feature=t,this.notifyChange("feature")}toJSON(t="all"){const e=a(this._getSerializableProperties(),this,t)||{},i=e.popupContentExtensions?.filter((t=>!this.parent?.popupContentExtensions?.some((e=>e.id===t.id))));if(e)for(const t of Object.keys(e))this.isModified(t)||delete e[t];if(i?.length&&(e.popupContentExtensions=i),!h(t)||!u(e))return e}_createPopupContentCollection(){return new o({parent:this,targetProperty:"popupTemplate",arrayProperty:"content"})}_getSerializableProperties(){return{hyperlinkTemplates:{serializeModes:["initial"],deserialize:t=>{t.forEach((t=>{this.hyperlinkTemplates.find((e=>this._hyperlinksAreEquivalent(e,t)))||this.hyperlinkTemplates.add(t instanceof i?t:new i(t))})),this.hyperlinkTemplates.toArray().forEach((e=>{const i=this.hyperlinkTemplates.indexOf(e),n=t.findIndex((t=>this._hyperlinksAreEquivalent(t,e)));n<0?this.hyperlinkTemplates.removeAt(i):n!==i&&this.hyperlinkTemplates.reorder(e,n)}))}},popupTemplate:{serialize:!1},formatSettings:"initial",outFields:{serializeModes:["initial"],serialize:()=>this.isModified("outFields")?this.outFields:void 0},returnGeometry:{serializeModes:["initial"],default:!0},outSpatialReference:"initial",maxAllowableOffset:"initial",zoomScale:"initial",zoomFactor:{serializeModes:["initial"],isDefault:t=>{const e=this._feature?this._feature.schema:this._featureSource?.schema;return t===(e&&"point"===e.geometryType?void 0:1.5)}},popupContentExtensions:{serializeModes:["initial"],serialize:t=>this.popupContentExtensions.map((e=>e.toJSON(t))).filter((t=>!(t&&2===Object.keys(t).length&&t.id&&t.content))).toArray(),deserialize:t=>{t&&m(this.popupContentExtensions,t,{onNew:(t,e)=>{this.popupContentExtensions.add(n(t)?t:new y(t),e)},onMatch:(t,e,i,o)=>{n(e)||t.assignProperties(e),i!==o&&this.popupContentExtensions.reorder(t,o)},onMissing:t=>{this.popupContentExtensions.remove(t)},equals:(t,e)=>n(e)?e===t||e.id===t.id:!(!e?.content||!y.matchesRef(this.popupContentExtensions.toArray(),this.popupContentExtensions.indexOf(t),e.content))||t.id===e.id})}}}}_hyperlinksAreEquivalent(t,e){if(t===e)return!0;const i=t=>t||"";return i(t.text)===i(e.text)&&i(t.url)===i(e.url)&&i(t.iconUrl)===i(e.iconUrl)&&i(t.target)===i(e.target)&&i(t.tooltip)===i(e.tooltip)}};E=t([l],E);export{E as FeatureSettings};class v extends p{get _collection(){return this._featureSettings._popupContent.map((t=>this._forContent(t))).concat(Array.from(this._uninitializedPopupContentExtensions))}get _popupTemplateIsInherited(){return this._featureSettings.parent&&this._featureSettings.popupTemplate===this._featureSettings.parent.popupTemplate}constructor(t){super(),this._uninitializedPopupContentExtensions=new Set,this._featureSettings=t,C(this._featureSettings,"_popupContent",(t=>{const e={added:(t.added||[]).map((t=>this._forContent(t))),moved:(t.moved||[]).map((t=>this._forContent(t))),removed:(t.removed||[]).map((t=>this._forContent(t))),target:this};this.emit("change",e)})),t.watch("_popupContent.length",(()=>this.notifyChange("length")))}forContent(t){if(c("content",t).isNotMissing(),this._featureSettings._popupContent.includes(t))return this._forContent(t)}add(t,i){if(c("contentX",t).isNotMissing(),this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),t.featureSettings&&t.featureSettings.popupContentExtensions.remove(t),t._setFeatureSettings(this._featureSettings),t.content){const e=T.get(t.content);if(T.set(t.content,t),e&&e!==t&&this._onRemoved(e),this._featureSettings._popupContent.includes(t.content))if(void 0===i){const i={added:[t],moved:[],removed:e?[e]:[],target:this};this.emit("change",i)}else this._featureSettings._popupContent.reorder(t.content,i);else this._featureSettings._popupContent.add(t.content,i)}else{this._uninitializedPopupContentExtensions.add(t);const e={added:[t],moved:[],removed:[],target:this};this.emit("change",e)}return this._onAdded(t),this}removeAt(t){const i=this.getItemAt(t);if(void 0!==i){if(this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._uninitializedPopupContentExtensions.has(i)){this._uninitializedPopupContentExtensions.delete(i);const t={added:[],moved:[],removed:[i],target:this};this.emit("change",t)}else this._featureSettings._popupContent.remove(i.content);return this._onRemoved(i),i}}reorder(t,i){if(t&&this._featureSettings._popupContent.includes(t.content))return this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._featureSettings._popupContent.reorder(t.content,i),t}sort(t){return this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._featureSettings._popupContent.sort(((e,i)=>t(this._forContent(e),this._forContent(i)))),this}_itemIsInitialized(t){return super._itemIsInitialized(t)&&!!t.content}_onAdded(t){}_onRemoved(t){t.featureSettings===this._featureSettings&&t._setFeatureSettings(void 0)}_forContent(t){if(this._uninitializedPopupContentExtensions.size)for(const t of this._uninitializedPopupContentExtensions)t._resolveContent(),t.content&&(T.set(t.content,t),this._uninitializedPopupContentExtensions.delete(t));if(!T.has(t)){const e=new y({content:t});T.set(t,e),e._setFeatureSettings(this._featureSettings),this._onAdded(e)}return T.get(t)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"@arcgis/core/popup/content/TextContent.js";import{ArgumentError as e}from"../ArgumentError.js";import{EntityBase as i}from"../Entity.js";import{Hyperlink as s}from"../Hyperlink.js";import{InvalidOperationError as a}from"../InvalidOperationError.js";import{isMenu as r,isRelationship as n}from"../ItemType.js";import{NotFoundError as o}from"../NotFoundError.js";import{FeatureReadOptions as u}from"../data/FeatureSource.js";import{Menu as c}from"../menus/Menu.js";import{initializeCollection as h}from"../support/InitializableBase.js";import{CollectionProxy as p}from"../utilities/CollectionProxy.js";import{first as l}from"../utilities/asyncIterable.js";import{checkArg as d}from"../utilities/checkArg.js";import{Collection as f,compare as m}from"../utilities/collection.js";import{getLogger as g}from"../utilities/log.js";import{FeatureSettings as w}from"./FeatureSettings.js";import{Schema as y}from"./Schema.js";import{TaskSettings as _}from"./TaskSettings.js";import{Relationship as S}from"./_Relationship.js";const A="Adding features is not supported.",F="Updating features is not supported.",z="Deleting features is not supported.",j=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsAttachmentEditing:!1}),M=g("FeatureSourceBase");export class FeatureSourceBase extends i{get featureActions(){return this._featureActions}set featureActions(t){this._featureActions=t,t&&this.isInitialized&&!t.isInitialized&&(async()=>{try{await t.initialize()}catch(t){t instanceof Error&&M.error({message:"An error occurred while initializing feature action menu.",error:t})}})()}get capabilities(){return this._capabilities()}constructor(t){super(t),this.featureSettings=this._createAndSetupFeatureSettings(),this.taskSettings=this._createTaskSettings(),this.schema=this._createAndSetupSchema(),this.relationships=this._createRelationships(),this.hyperlinks=this._createHyperlinks()}getFullExtent(){}async getAttachments(t){return d("feature",t).isNotMissing(),await this.initialize(),this._getAttachments(t)}async addAttachment(t,i){if(d("feature",t).isNotMissing(),d("attachment",i).isNotMissing(),t.source&&t.source!==this)throw new e("feature",`Cannot add an attachment to a feature not of this source (${this.title??this.id})`);return await this.initialize(),this._addAttachment(t,i)}async deleteAttachments(t,i){if(d("feature",t).isNotMissing(),d("attachmentIds",i).isNotMissing(),t.source&&t.source!==this)throw new e("feature",`Cannot delete attachments from a feature not of this source (${this.title??this.id})`);await this.initialize(),await this._deleteAttachments(t,i)}async getFeature(t,e){d("id",t).isNotMissing();const i=this.getFeatures([t],e),s=await l(i);if(!s)throw new o("No feature exists with ID '{0}'.",t);return s}getFeatures(t,e){d("ids",t).isNotMissing();const i=this;return async function*(){await i.initialize(),yield*i._getFeatures(t,{...u.DEFAULTS,...u.fromFeatureSource(i),...e})}()}async addFeature(t,e){d("feature",t).isNotMissing(),await this.addFeatures([t])}async addFeatures(t,e){if(d("features",t).isNotMissing(),await this.initialize(),!this.capabilities.supportsAdd)throw new a(A);await this._addFeatures(t,e)}async updateFeature(t,e){d("feature",t).isNotMissing(),await this.updateFeatures([t])}async updateFeatures(t,e){if(d("features",t).isNotMissing(),await this.initialize(),!this.capabilities.supportsUpdate)throw new a(F);await this._updateFeatures(t,e)}async deleteFeature(t,e){d("feature",t).isNotMissing(),await this.deleteFeatures([t])}async deleteFeatures(t,e){if(d("features",t).isNotMissing(),await this.initialize(),!this.capabilities.supportsDelete)throw new a(z);const i=[];for(const e of t)i.push("string"==typeof e?e:e.primaryKey);await this._deleteFeatures(i,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),featureSettings:{serializeModes:["initial"],isDefault:t=>{if(!t)return!0;if(t.constructor===Object){if(!Object.keys(t).length)return!0}return!1}},taskSettings:"initial",onAddFeature:"initial",onEditFeature:"initial",schema:"initial",relationships:{serializeModes:["initial"],serialize:t=>this.relationships?this.relationships.filter((t=>"ArcGISRelationship"!==t.relationshipType)).toArray():[],deserialize:t=>{m(this.relationships,t,{onNew:t=>{n(t)?this.relationships.add(t):this.relationships.add(S.create(t))},onMatch:(t,e)=>{n(t)&&t.assignProperties({title:e.title})},onMissing:t=>{"ArcGISRelationship"!==t.relationshipType&&this.relationships.remove(t)},equals:(t,e)=>t.id===e.id})},default:[]},hyperlinks:{serialize:!1,deserialize:t=>{this.hyperlinks.removeAll(),this.hyperlinks.addMany(t.map((t=>t instanceof s?t:new s(t))))}},featureActions:{serializeModes:["initial"],deserialize:t=>{t?r(t)?this.featureActions=t:this.featureActions?this.featureActions.assignProperties(t):this.featureActions=c.create(t):this.featureActions=void 0}}}}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.schema.fieldExtensions}async _onInitialize(){await super._onInitialize(),this.featureActions&&await this.featureActions.initialize()}async _postInitialize(){await super._postInitialize(),this.featureSettings.popupTemplate||(this.featureSettings.popupTemplate=this.schema.createPopupTemplate(),this.featureSettings._isDefaultPopupTemplate=!0);const{popupTemplate:e}=this.featureSettings;"function"==typeof e.content&&(e.content=e.content()),e.content=await e.content,"string"==typeof e.content&&(e.content=[new t({text:e.content})]),!e.title&&this.schema.displayField&&(e.title=`{${this.schema.displayField}}`),await h(this.featureSettings.popupContentExtensions,{target:this,onInitializeWarning:t=>this.emit("initializeWarning",t)}),await Promise.all(this.relationships.toArray().map((t=>t.relatedSource?.initialize())))}_createSchema(){return new y}_createFeatureSettings(){return new w}_createTaskSettings(){return new _}_createRelationships(){return new RelationshipCollection(this)}_createHyperlinks(){return new f}async _getAttachments(t){return[]}async _addAttachment(t,e){throw new a("Adding attachments is not supported.")}async _deleteAttachments(t,e){throw new a("Deleting attachments is not supported.")}_getFeatures(t,e){const{primaryKeyField:i}=this.schema;if(this.queryService&&i){const s=t.map((t=>`${i} = ${t}`)).join(" OR ");return this.queryService.query(this,s,e)}throw new a("Querying features is not supported.")}_addFeatures(t,e){throw new a(A)}_updateFeatures(t,e){throw new a(F)}_deleteFeatures(t,e){throw new a(z)}_capabilities(){return j}_isRelationship(t){return"function"==typeof t.getRelatedFeatures}_createAndSetupSchema(){const t=this._createSchema();return t._featureSettings=this.featureSettings,t}_createAndSetupFeatureSettings(){const t=this._createFeatureSettings();return t._setFeatureSource(this),t}}export class RelationshipCollection extends p{constructor(t){super(new f),this._source=t}add(t,e){return d("relationship",t).isNotMissing(),t.source&&t.source.relationships.remove(t),n(t)&&t._setSource(this._source),super.add(t,e)}removeAt(t){const e=super.removeAt(t);return n(e)&&e._setSource(void 0),e}}
|
package/data/FeatureStream.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{EntityBase}from"../Entity.js";import{serializable}from"../support/Serializable.js";import{from,toArray}from"../utilities/asyncIterable.js";import{FeatureSet}from"./FeatureSet.js";let
|
|
1
|
+
import{__decorate as t}from"tslib";import{EntityBase as e}from"../Entity.js";import{serializable as r}from"../support/Serializable.js";import{from as s,toArray as i}from"../utilities/asyncIterable.js";import{FeatureSet as a}from"./FeatureSet.js";let o=class extends e{constructor(t){var e;if(super(!(e=t)||e[Symbol.iterator]||e[Symbol.asyncIterator]?void 0:e),this._itemType="feature-stream",t)if(t[Symbol.asyncIterator])this._features=t;else if(t[Symbol.iterator])this._features=s(t);else{const{features:e}=t;e?.[Symbol.asyncIterator]?this._features=e:e?.[Symbol.iterator]&&(this._features=s(e))}this._features=this._features||s([])}[Symbol.asyncIterator](){return this._features[Symbol.asyncIterator]()}toArray(){return i(this)}async toFeatureSet(){return new a({title:this.title,features:await i(this)})}_getSerializableProperties(){return{...super._getSerializableProperties(),title:"initial"}}};o=t([r],o);export{o as FeatureStream};
|
package/data/FieldExtension.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e;import{__decorate as i}from"tslib";import t from"@arcgis/core/layers/support/Field";import{EntityBase as s}from"../Entity.js";import{InvalidOperationError as r}from"../InvalidOperationError.js";import{isFieldExtension as o,ItemType as a}from"../ItemType.js";import{Field as f}from"../portal/Field.js";import{FormatSettings as d}from"../support/FormatSettings.js";import{serializable as n}from"../support/Serializable.js";import{esriFormatToGeocortexFormat as l}from"../utilities/date.js";import{isField as h}from"../utilities/esri.js";import{NumberFormat as m}from"../utilities/number.js";import{deepClone as p}from"../utilities/object.js";import{fieldWithArcadeXRegex as _}from"./Schema.js";export const _fieldExtensionMap=new WeakMap;let c=e=class extends s{get field(){return this._field}get schema(){return this._schema}get fieldInfo(){if(this._fieldInfo)return this._fieldInfo;if(!this.field?.name)return;const e=this._schema?._featureSettings?.popupTemplate,i=e?.fieldInfos||[];return this._fieldInfo=i.find((e=>e.fieldName===this.field.name)),this._fieldInfo}constructor(e){super(e),this.format="{0}",this.formatSettings=new F(this),this.searchable=!0,this._itemType=a.FIELD_EXTENSION;const{field:i}=e??{};h(i)?this._setField(i):"string"==typeof i?this._deferredFieldProperties={$ref:i}:i?i.$ref?this._deferredFieldProperties=i:this._setField(f.toEsriApiField(i)):this._setField(new t),this.watch("_schema.featureSource",(()=>this.notifyChange("fieldInfo"))),this.watch("_schema._featureSettings",(e=>{this.formatSettings.parent=e?e.formatSettings:void 0}),!0)}static matchesRef(e,i){return o(e)?(e.field?.name??e._deferredFieldProperties?.$ref)===i.$ref:e.name===i.$ref}_setSchema(e){this._schema=e,this._resolveField(),this.notifyChange("schema"),this.notifyChange("fieldInfo")}_resolveField(){if(this._field||!this._deferredFieldProperties||!this._schema)return;const i=this._schema.fields.find((i=>e.matchesRef(i,this._deferredFieldProperties)));i&&(this._setField(i),this.assignProperties({field:this._deferredFieldProperties}),this._originalRef=this._deferredFieldProperties.$ref,delete this._deferredFieldProperties,_fieldExtensionMap.set(i,this))}_getSerializableProperties(){return{...super._getSerializableProperties(),field:{serializeModes:["initial"],serialize:()=>this.field?this._originalRef?{$ref:this._originalRef}:this._schema?.fields.includes(this._field)&&this.field.name?{$ref:this.field.name}:f.fromEsriApiField(this.field):this._deferredFieldProperties?p(this._deferredFieldProperties):void 0,deserialize:e=>{if(h(e)){if(e!==this.field)throw new Error("Property 'field' is read-only.")}else e&&this.field&&f.applyToEsriApiField(e,this.field)}},searchable:{serializeModes:["initial"],isDefault:e=>e!==this._isArcadeExpressionField},format:{serializeModes:["initial"],default:"{0}"},formatSettings:"initial"}}async _onInitialize(){if(this._resolveField(),!this._field){const e=this._deferredFieldProperties.$ref;throw this._schema?new r(`Field not found with name: ${e}. Field does not exist.`):new r(`Field not found with name: ${e}. Field does not have a parent schema.`)}}_setField(e){this._field=e,this._isArcadeExpressionField&&(this.searchable=!1),this.notifyChange("field"),this.notifyChange("fieldInfo")}get _isArcadeExpressionField(){return!!this._field&&!!this._field.name&&!!this._field.name.match(_)}};c=e=i([n],c);export{c as FieldExtension};let F=class extends d{constructor(e,i){super(i),this.fieldExtension=e,e.watch("fieldInfo.format.places",(()=>this.notifyChange("fractionalDigits"))),e.watch("fieldInfo.format.digitSeparator",(()=>this.notifyChange("numberFormat"))),e.watch("fieldInfo.format.dateFormat",(()=>this.notifyChange("dateFormat")))}get fractionalDigits(){const e=this.fieldExtension.fieldInfo?.format?.places;return!this.isModified("fractionalDigits")&&this.useFieldInfo&&e?e:this._getSetting("fractionalDigits")}set fractionalDigits(e){this._setSetting("fractionalDigits",e)}get numberFormat(){const e=this.fieldExtension.fieldInfo?.format?.digitSeparator;return!this.isModified("numberFormat")&&this.useFieldInfo&&e?e?m.NUMBER:m.FIXED_POINT:this._getSetting("numberFormat")}set numberFormat(e){this._setSetting("numberFormat",e)}get dateFormat(){const e=this.fieldExtension.fieldInfo?.format?.dateFormat;return!this.isModified("dateFormat")&&this.useFieldInfo&&e?l(e):this._getSetting("dateFormat")}set dateFormat(e){this._setSetting("dateFormat",e)}};F=i([n],F);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var t;import{__decorate as e}from"tslib";import i from"@arcgis/core/popup/content/Content.js";import{EntityBase as n}from"../Entity.js";import{InvalidOperationError as r}from"../InvalidOperationError.js";import{ItemType as s}from"../ItemType.js";import{PopupContent as o}from"../portal/PopupInfo.js";import{serializable as p}from"../support/Serializable.js";import{Collection as a}from"../support/esri.js";import{compare as f}from"../utilities/array.js";import{isCustomContent as d,isExpressionContent as u,isPopupContent as h,isTextContent as l}from"../utilities/esri.js";import{deepClone as m}from"../utilities/object.js";export const _popupContentExtensionMap=new WeakMap;let _=t=class extends n{get content(){return this._content}get featureSettings(){return this._featureSettings}get _index(){return Array.isArray(this.featureSettings.popupTemplate?.content)?this.featureSettings.popupTemplate.content.indexOf(this.content):-1}constructor(t){super(t),this.summaryHiddenFields=new a,this._itemType=s.POPUP_CONTENT_EXTENSION;const{content:e,visibleInSummary:n}=t??{};h(e)?this._setContent(e):"string"==typeof e?this._deferredContentProperties={$ref:e}:e?e.$ref?this._deferredContentProperties=e:this._setContent(o.toEsriApiPopupContent(e)):this._setContent(new i),this.visibleInSummary=n??this._getDefaultSummaryVisibility()}static matchesRef(e,i,n){const r=e.map(((e,i)=>c(e,e instanceof t?e._index:i))),s=r[i],{type:o,index:p,title:a,text:f}=n.$ref;if(o!==s.type)return!1;if("text"===o&&f===s.text)return!0;if(a&&a===s.title)return!0;if("number"==typeof p&&p===s.index)return!0;return 1===r.map(((t,e)=>t.type===o?t.index:void 0)).filter((t=>"number"==typeof t)).length}_setFeatureSettings(t){this._featureSettings=t,this._resolveContent(),this.notifyChange("featureSettings")}_resolveContent(){if(this._content||!this._deferredContentProperties||!this._featureSettings)return;const e=this._featureSettings._popupContent.find(((e,i)=>t.matchesRef(this.featureSettings._popupContent.toArray(),i,this._deferredContentProperties)));e&&(this._setContent(e),this.assignProperties({content:this._deferredContentProperties}),this._originalRef={...this._deferredContentProperties.$ref},delete this._deferredContentProperties,_popupContentExtensionMap.set(e,this))}_getSerializableProperties(){return{...super._getSerializableProperties(),content:{serializeModes:["initial"],serialize:()=>this.content?this._originalRef?{$ref:this._originalRef}:this._featureSettings?._popupContent.includes(this._content)?{$ref:c(this.content,this._index)}:o.fromEsriApiPopupContent(this.content):this._deferredContentProperties?m(this._deferredContentProperties):void 0,deserialize:t=>{if(h(t)){if(t!==this.content)throw new Error("Property 'popupContent' is read-only.")}else t&&this.content&&o.applyToEsriApiPopupContent(t,this.content)}},visibleInSummary:{serializeModes:["initial"],isDefault:(t,e)=>t===this._getDefaultSummaryVisibility()},summaryHiddenFields:{serializeModes:["initial"],serialize:()=>this.summaryHiddenFields.toArray(),deserialize:t=>{f(this.summaryHiddenFields,t,{onMatch:(t,e,i,n)=>{this.summaryHiddenFields.reorder(t,n)},onMissing:t=>this.summaryHiddenFields.remove(t),onNew:t=>{this.summaryHiddenFields.add(t)}})}}}}async _onInitialize(){if(this._resolveContent(),!this._content){const t=this._deferredContentProperties.$ref;throw this._featureSettings?new r(`PopupContent not found with reference: ${JSON.stringify(t)}. PopupContent does not exist.`):new r(`PopupContent not found with reference: ${JSON.stringify(t)}. PopupContent does not have a parent featureSettings.`)}}_setContent(t){this._content=t,this.notifyChange("content")}_getDefaultSummaryVisibility(){return"text"===(this.content?.type??this._deferredContentProperties?.type??this._deferredContentProperties?.$ref?.type)}};_=t=e([p],_);export{_ as PopupContentExtension};function c(t,e){const i=t instanceof _?t.content:t;if(!i)return t._deferredContentProperties?.$ref;const n={type:i.type};return e>=0&&(n.index=e),u(i)?n.title=i.expressionInfo.title:l(i)?n.text=i.text:d(i)||(n.title=i.title),n}
|
package/data/Relationship.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Relationship}from"./_Relationship.js";import{DefaultRelationshipFactory}from"./support/DefaultRelationshipFactory.js";export{Relationship}from"./_Relationship.js";
|
|
1
|
+
import{Relationship as o}from"./_Relationship.js";import{DefaultRelationshipFactory as t}from"./support/DefaultRelationshipFactory.js";export{Relationship}from"./_Relationship.js";o.factory=t.instance;
|
package/data/RelationshipBase.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e;import{__classPrivateFieldGet as t}from"tslib";import{EntityBase as r}from"../Entity.js";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{isFeatureSet as i,ItemType as a}from"../ItemType.js";import{cancelify as o}from"../support/Cancellable.js";import{checkArg as n}from"../utilities/checkArg.js";const l="Cannot get related features without feature source.";export class RelationshipBase extends r{constructor(){super(...arguments),e.set(this,new WeakMap),this._itemType=a.RELATIONSHIP}get source(){return this._source}async getRelatedFeatures(r,i){if(n("feature",r).isNotMissing(),!this.source)throw new s(l);t(this,e,"f").has(r)||t(this,e,"f").set(r,(async()=>{try{return await this._getRelatedFeatures(r,i)}finally{t(this,e,"f").delete(r)}})());const a=t(this,e,"f").get(r);return o(a,i?.cancelToken)}async getAllRelatedFeatures(r,a){if(n("feature",r).isNotMissing(),!this.source)throw new s(l);let u;u=Array.isArray(r)?r:i(r)?[...r]:await r.toArray();const c=o(this._getAllRelatedFeatures(u,a),a?.cancelToken);for(const r of u)t(this,e,"f").has(r)||t(this,e,"f").set(r,(async()=>{try{return(await c).get(r)}finally{t(this,e,"f").delete(r)}})());return c}_setSource(e){this._source=e}_getSerializableProperties(){return{...super._getSerializableProperties(),title:"initial"}}}e=new WeakMap;
|
package/data/Schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Schema_1;import{__decorate}from"tslib";import PopupTemplate from"@arcgis/core/PopupTemplate";import Field from"@arcgis/core/layers/support/Field";import FieldInfo from"@arcgis/core/popup/FieldInfo";import{InvalidOperationError}from"../InvalidOperationError.js";import{isFieldExtension}from"../ItemType.js";import{Field as PortalField}from"../portal/Field.js";import{GeometryType as PortalGeometryType}from"../portal/Geometry.js";import{Type as PortalType}from"../portal/Type.js";import{InitializableCollectionProxy}from"../support/InitializableCollectionProxy.js";import{filterJSONProperties,isDefault,serializable,shouldExcludeDefaults}from"../support/Serializable.js";import{Settings}from"../support/Settings.js";import{CollectionProxy}from"../utilities/CollectionProxy.js";import{checkArg}from"../utilities/checkArg.js";import{Collection,compare}from"../utilities/collection.js";import{isValidTimeZone,ERR_TIME_ZONE_INVALID}from"../utilities/date.js";import{isFeatureType,isField}from"../utilities/esri.js";import{onCollectionPropertyChange}from"../utilities/watch.js";import{_fieldExtensionMap,FieldExtension}from"./FieldExtension.js";const esriFields=new Map;esriFields.set("objectid","oid"),esriFields.set("oid","oid"),esriFields.set("fid","oid"),esriFields.set("shape","geometry"),esriFields.set("shape__length","double"),esriFields.set("shape_length","double"),esriFields.set("shape__area","double"),esriFields.set("shape_area","double"),esriFields.set("area","double"),esriFields.set("perimeter","double"),esriFields.set("length","double"),esriFields.set("fnode_","double"),esriFields.set("tnode_","double"),esriFields.set("lpoly_","double"),esriFields.set("rpoly_","double"),esriFields.set("cover_","integer"),esriFields.set("cover_id","integer"),esriFields.set("idtic","integer"),esriFields.set("xtic","double"),esriFields.set("ytic","double"),esriFields.set("xmin","double"),esriFields.set("ymin","double"),esriFields.set("xmax","double"),esriFields.set("ymax","double"),esriFields.set("arc_","double"),esriFields.set("subclass_","integer"),esriFields.set("subclass_id","integer"),esriFields.set("routelink","integer"),esriFields.set("arclink","integer"),esriFields.set("f_meas","double"),esriFields.set("t_meas","double"),esriFields.set("f_pos","double"),esriFields.set("t_pos","double"),esriFields.set("f_meas","double"),esriFields.set("globalid","global-id"),esriFields.set("guid","guid");export const fieldWithArcadeXRegex=/expression\/((\w|-)*)/;export const fieldWithRelationshipRegex=/relationships\/(\d*)\/(\w*)/;const FIELD_INFO_MAP=new WeakMap;let Schema=Schema_1=class extends Settings{constructor(e){super(e),this.fieldExtensions=new FieldExtensionCollectionImpl(this),this.fields=new FieldCollectionImpl(this)}get spatialReference(){return this._getSetting("spatialReference")}set spatialReference(e){this._setSetting("spatialReference",e)}get primaryKeyField(){const e=this._getSetting("primaryKeyField");if(!e){const e=this.fields.filter((e=>"oid"===e.type));if(1===e.length)return e.getItemAt(0).name}return e}set primaryKeyField(e){this._setSetting("primaryKeyField",e)}get displayField(){return this._getSetting("displayField",this.primaryKeyField)}set displayField(e){!this._featureSettings?.popupTemplate||this._featureSettings.popupTemplate.title&&this._featureSettings.popupTemplate.title!==`{${this.displayField}}`||(this._featureSettings.popupTemplate.title=`{${e}}`),this._setSetting("displayField",e)}get geometryType(){return this._getSetting("geometryType")}set geometryType(e){this._setSetting("geometryType",e)}get hasGeometry(){return void 0!==this.geometryType&&null!==this.geometryType}get timeZone(){return this._getSetting("timeZone","UTC")}set timeZone(e){checkArg("timeZone",e).satisfies((e=>isValidTimeZone(e)),ERR_TIME_ZONE_INVALID(e)),this._setSetting("timeZone",e)}get typeIdField(){return this._getSetting("typeIdField")}set typeIdField(e){this._setSetting("typeIdField",e)}get types(){return this._getCollectionSetting("types")}get _fields(){return this._getCollectionSetting("_fields")}static createFieldInfoFromField(e){let i=!0;const t=e.name.toLowerCase();return("oid"===e.type||"geometry"===e.type||esriFields.has(t)&&esriFields.get(t)===e.type)&&(i=!1),new FieldInfo({visible:i,fieldName:e.name,format:void 0,label:e.alias,stringFieldOption:void 0,tooltip:void 0,isEditable:e.editable})}findFieldByName(e){return this.fields.find((i=>i.name===e))}toJSON(e="all"){const i=filterJSONProperties(this._getSerializableProperties(),this,e)||{};let t=i.fieldExtensions;this.parent&&(t=t?.filter((e=>!this.parent?.fieldExtensions?.some((i=>i.id===e.id)))));const{fields:s}=i;if(i)for(const e of Object.keys(i))this.isModified(e)||delete i[e];if(s&&(i.fields=s),t?.length&&(i.fieldExtensions=t),!shouldExcludeDefaults(e)||!isDefault(i))return i}createPopupTemplate(){const e=this.createAllFieldInfos();return new PopupTemplate({fieldInfos:e,content:[{type:"fields"},{type:"attachments"}]})}createAllFieldInfos(){return this.fields.toArray().filter((e=>!!e.name)).map((e=>Schema_1.createFieldInfoFromField(e)))}_getSerializableProperties(){return{geometryType:{serialize:!1,deserialize:e=>{this.geometryType=PortalGeometryType.toEsriApiGeometryType(e)}},spatialReference:{serialize:!1},primaryKeyField:{serialize:!1},displayField:{serialize:!1},typeIdField:{serialize:!1},fields:{serializeModes:["initial"],serialize:()=>this.isModified("_fields")?this.fields.toArray().map((e=>PortalField.fromEsriApiField(e))):void 0,deserialize:e=>{if(!e)return;const i=e.map((e=>isField(e)?e:PortalField.toEsriApiField(e)));compare(this.fields,i,{onNew:(e,i)=>{this.fields.add(e,i)},onMatch:(e,i,t,s)=>{e!==i&&(e.alias=i.alias,e.editable=i.editable,e.length=i.length,e.nullable=i.nullable,e.type=i.type),t!==s&&this.fields.reorder(e,s)},onMissing:e=>{this.fields.remove(e)},equals:(e,i)=>e.name===i.name})}},fieldExtensions:{serializeModes:["initial"],serialize:e=>this.fieldExtensions.toArray().map((i=>i.toJSON(e))).filter((e=>this._alwaysSerializeFieldExtensions||!(e&&2===Object.keys(e).length&&e.id&&e.field))),deserialize:e=>{e&&compare(this.fieldExtensions,e,{onNew:(e,i)=>{this.fieldExtensions.add(isFieldExtension(e)?e:new FieldExtension(e),i)},onMatch:(e,i,t,s)=>{isFieldExtension(i)||e.assignProperties(i),t!==s&&this.fieldExtensions.reorder(e,s)},onMissing:e=>{this._alwaysSerializeFieldExtensions&&this.fieldExtensions.remove(e)},equals:(e,i)=>isFieldExtension(i)?i===e:!(!i?.field||!FieldExtension.matchesRef(e,i.field))||e.id===i.id})}},types:{serialize:!1,deserialize:e=>{if(!e)return;const i=e.map((e=>isFeatureType(e)?e:PortalType.toEsriApiFeatureType(e)));compare(this.types,i,{onNew:(e,i)=>{this.types.add(e,i)},onMatch:(e,i,t,s)=>{e!==i&&(e.name=i.name,e.templates=i.templates?[...i.templates]:[],e.domains=i.domains),t!==s&&this.types.reorder(e,s)},onMissing:e=>{this.types.remove(e)},equals:(e,i)=>e.id===i.id})}},timeZone:{serialize:!1,deserialize:e=>{e&&(this.timeZone=e)}}}}};Schema=Schema_1=__decorate([serializable],Schema);export{Schema};class FieldCollectionImpl extends CollectionProxy{constructor(e){super(),this._schema=e,onCollectionPropertyChange(this._schema,"_fields",(e=>{this.emit("change",e),this._fieldLookup=void 0})),e.watch("_fields.length",(()=>this.notifyChange("length")))}get _createFieldLookup(){return this._collection.reduce(((e,i)=>(e.add(i),e)),new WeakSet)}get _expressionFieldsLength(){return this.expressionFields.length}get expressionFields(){if(!this._popupTemplate||!this._popupTemplate.fieldInfos||!this._popupTemplate.expressionInfos)return new Collection;const e=new Collection;for(const i of this._popupTemplate.fieldInfos){const t=i.fieldName.match(fieldWithArcadeXRegex);if(t){const s=this._popupTemplate.expressionInfos.find((e=>e.name===t[1]));if(s){if(!FIELD_INFO_MAP.has(i)){const e=new Field({name:i.fieldName,alias:i.label||s.title||i.fieldName,type:"number"===s.returnType?"double":"string",editable:!1});FIELD_INFO_MAP.set(i,e)}e.add(FIELD_INFO_MAP.get(i))}}}return e}get _collection(){return this._schema._fields.concat(this.expressionFields)}get _popupTemplate(){return this._schema._featureSettings?this._schema._featureSettings.popupTemplate:void 0}includes(e){return this._fieldLookup=this._fieldLookup??this._createFieldLookup,this._fieldLookup.has(e)}clone(){return new FieldCollectionImpl(this._schema)}add(e,i){checkArg("field",e).isNotMissing(),this._fieldLookup=void 0;const t=e.name?e.name.match(fieldWithArcadeXRegex):void 0;if(t){if(!this._popupTemplate)throw new InvalidOperationError("Cannot create a field that references an arcade expression without a feature source and popup template.");const i=this._popupTemplate.expressionInfos.find((e=>e.name===t[1]));if(!i)throw new InvalidOperationError("Cannot create a field that references a non-existent arcade expression.");this._popupTemplate.fieldInfos||(this._popupTemplate.fieldInfos=[]);let s=this._popupTemplate.fieldInfos.find((i=>i.fieldName===e.name));s||(s=new FieldInfo({fieldName:e.name,label:i.title}),this._popupTemplate.fieldInfos.push(s));const l=FIELD_INFO_MAP.get(s);FIELD_INFO_MAP.set(s,e);const o={added:[e],moved:[],removed:l?[l]:[],target:this};this.emit("change",o),this.notifyChange("length"),this.notifyChange("_expressionFieldsLength")}else this._schema._fields.add(e,i);return this}removeAt(e){checkArg("index",e).isNotMissing();const i=this.getItemAt(e);if(!i)return;this._fieldLookup=void 0;if(i.name?i.name.match(fieldWithArcadeXRegex):void 0){const e=this._popupTemplate.fieldInfos.findIndex((e=>e.fieldName===i.name));this._popupTemplate.fieldInfos.splice(e,1);const t={added:[],moved:[],removed:[i],target:this};this.emit("change",t),this.notifyChange("length"),this.notifyChange("_expressionFieldsLength")}else this._schema._fields.remove(i);return i}reorder(e,i){if(e&&this._schema._fields.includes(e))return this._schema._fields.reorder(e,i),e}sort(e){return this._schema._fields.sort(e),this}}class FieldExtensionCollectionImpl extends InitializableCollectionProxy{constructor(e){super(),this._uninitializedFieldExtensions=new Set,this._schema=e,onCollectionPropertyChange(this._schema,"fields",(e=>{const i={added:(e.added||[]).map((e=>this._forField(e))),moved:(e.moved||[]).map((e=>this._forField(e))),removed:(e.removed||[]).map((e=>this._forField(e))),target:this};this.emit("change",i)})),e.watch("fields.length",(()=>this.notifyChange("length")))}get _collection(){return this._schema.fields.map((e=>this._forField(e))).concat(Array.from(this._uninitializedFieldExtensions))}forField(e){if(checkArg("field",e).isNotMissing(),this._schema.fields.includes(e))return this._forField(e)}add(e,i){if(checkArg("fieldX",e).isNotMissing(),e.schema&&e.schema.fieldExtensions.remove(e),e._setSchema(this._schema),e.field){const t=_fieldExtensionMap.get(e.field);if(_fieldExtensionMap.set(e.field,e),t&&t!==e&&this._onRemoved(t),this._schema.fields.includes(e.field))if(void 0===i){const i={added:[e],moved:[],removed:t?[t]:[],target:this};this.emit("change",i)}else this._schema.fields.reorder(e.field,i);else this._schema.fields.add(e.field,i)}else{this._uninitializedFieldExtensions.add(e);const i={added:[e],moved:[],removed:[],target:this};this.emit("change",i)}return this._onAdded(e),this}removeAt(e){const i=this.getItemAt(e);if(void 0!==i){if(this._uninitializedFieldExtensions.has(i)){this._uninitializedFieldExtensions.delete(i);const e={added:[],moved:[],removed:[i],target:this};this.emit("change",e)}else this._schema.fields.remove(i.field);return this._onRemoved(i),i}}reorder(e,i){if(e&&this._schema.fields.includes(e.field))return this._schema.fields.reorder(e.field,i),e}sort(e){return this._schema.fields.sort(((i,t)=>e(this._forField(i),this._forField(t)))),this}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.field}_onAdded(e){}_onRemoved(e){e.schema===this._schema&&e._setSchema(void 0)}_forField(e){if(this._uninitializedFieldExtensions.size)for(const e of this._uninitializedFieldExtensions)e._resolveField(),e.field&&(_fieldExtensionMap.set(e.field,e),this._uninitializedFieldExtensions.delete(e));if(!_fieldExtensionMap.has(e)){const i=new FieldExtension({field:e});_fieldExtensionMap.set(e,i),i._setSchema(this._schema),this._onAdded(i)}return _fieldExtensionMap.get(e)}}
|
|
1
|
+
var e;import{__decorate as t}from"tslib";import i from"@arcgis/core/PopupTemplate";import s from"@arcgis/core/layers/support/Field";import o from"@arcgis/core/popup/FieldInfo";import{InvalidOperationError as l}from"../InvalidOperationError.js";import{isFieldExtension as n}from"../ItemType.js";import{Field as r}from"../portal/Field.js";import{GeometryType as d}from"../portal/Geometry.js";import{Type as a}from"../portal/Type.js";import{InitializableCollectionProxy as h}from"../support/InitializableCollectionProxy.js";import{filterJSONProperties as p,isDefault as m,serializable as f,shouldExcludeDefaults as c}from"../support/Serializable.js";import{Settings as u}from"../support/Settings.js";import{CollectionProxy as _}from"../utilities/CollectionProxy.js";import{checkArg as g}from"../utilities/checkArg.js";import{Collection as y,compare as F}from"../utilities/collection.js";import{isValidTimeZone as x,ERR_TIME_ZONE_INVALID as b}from"../utilities/date.js";import{isFeatureType as v,isField as T}from"../utilities/esri.js";import{onCollectionPropertyChange as z}from"../utilities/watch.js";import{_fieldExtensionMap as I,FieldExtension as S}from"./FieldExtension.js";const w=new Map;w.set("objectid","oid"),w.set("oid","oid"),w.set("fid","oid"),w.set("shape","geometry"),w.set("shape__length","double"),w.set("shape_length","double"),w.set("shape__area","double"),w.set("shape_area","double"),w.set("area","double"),w.set("perimeter","double"),w.set("length","double"),w.set("fnode_","double"),w.set("tnode_","double"),w.set("lpoly_","double"),w.set("rpoly_","double"),w.set("cover_","integer"),w.set("cover_id","integer"),w.set("idtic","integer"),w.set("xtic","double"),w.set("ytic","double"),w.set("xmin","double"),w.set("ymin","double"),w.set("xmax","double"),w.set("ymax","double"),w.set("arc_","double"),w.set("subclass_","integer"),w.set("subclass_id","integer"),w.set("routelink","integer"),w.set("arclink","integer"),w.set("f_meas","double"),w.set("t_meas","double"),w.set("f_pos","double"),w.set("t_pos","double"),w.set("f_meas","double"),w.set("globalid","global-id"),w.set("guid","guid");export const fieldWithArcadeXRegex=/expression\/((\w|-)*)/;export const fieldWithRelationshipRegex=/relationships\/(\d*)\/(\w*)/;const E=new WeakMap;let A=e=class extends u{get spatialReference(){return this._getSetting("spatialReference")}set spatialReference(e){this._setSetting("spatialReference",e)}get primaryKeyField(){const e=this._getSetting("primaryKeyField");if(!e){const e=this.fields.filter((e=>"oid"===e.type));if(1===e.length)return e.getItemAt(0).name}return e}set primaryKeyField(e){this._setSetting("primaryKeyField",e)}get displayField(){return this._getSetting("displayField",this.primaryKeyField)}set displayField(e){!this._featureSettings?.popupTemplate||this._featureSettings.popupTemplate.title&&this._featureSettings.popupTemplate.title!==`{${this.displayField}}`||(this._featureSettings.popupTemplate.title=`{${e}}`),this._setSetting("displayField",e)}get geometryType(){return this._getSetting("geometryType")}set geometryType(e){this._setSetting("geometryType",e)}get hasGeometry(){return void 0!==this.geometryType&&null!==this.geometryType}get timeZone(){return this._getSetting("timeZone","UTC")}set timeZone(e){g("timeZone",e).satisfies((e=>x(e)),b(e)),this._setSetting("timeZone",e)}get typeIdField(){return this._getSetting("typeIdField")}set typeIdField(e){this._setSetting("typeIdField",e)}get types(){return this._getCollectionSetting("types")}get _fields(){return this._getCollectionSetting("_fields")}constructor(e){super(e),this.fieldExtensions=new N(this),this.fields=new j(this)}static createFieldInfoFromField(e){let t=!0;const i=e.name.toLowerCase();return("oid"===e.type||"geometry"===e.type||w.has(i)&&w.get(i)===e.type)&&(t=!1),new o({visible:t,fieldName:e.name,format:void 0,label:e.alias,stringFieldOption:void 0,tooltip:void 0,isEditable:e.editable})}findFieldByName(e){return this.fields.find((t=>t.name===e))}toJSON(e="all"){const t=p(this._getSerializableProperties(),this,e)||{};let i=t.fieldExtensions;this.parent&&(i=i?.filter((e=>!this.parent?.fieldExtensions?.some((t=>t.id===e.id)))));const{fields:s}=t;if(t)for(const e of Object.keys(t))this.isModified(e)||delete t[e];if(s&&(t.fields=s),i?.length&&(t.fieldExtensions=i),!c(e)||!m(t))return t}createPopupTemplate(){const e=this.createAllFieldInfos();return new i({fieldInfos:e,content:[{type:"fields"},{type:"attachments"}]})}createAllFieldInfos(){return this.fields.toArray().filter((e=>!!e.name)).map((t=>e.createFieldInfoFromField(t)))}_getSerializableProperties(){return{geometryType:{serialize:!1,deserialize:e=>{this.geometryType=d.toEsriApiGeometryType(e)}},spatialReference:{serialize:!1},primaryKeyField:{serialize:!1},displayField:{serialize:!1},typeIdField:{serialize:!1},fields:{serializeModes:["initial"],serialize:()=>this.isModified("_fields")?this.fields.toArray().map((e=>r.fromEsriApiField(e))):void 0,deserialize:e=>{if(!e)return;const t=e.map((e=>T(e)?e:r.toEsriApiField(e)));F(this.fields,t,{onNew:(e,t)=>{this.fields.add(e,t)},onMatch:(e,t,i,s)=>{e!==t&&(e.alias=t.alias,e.editable=t.editable,e.length=t.length,e.nullable=t.nullable,e.type=t.type),i!==s&&this.fields.reorder(e,s)},onMissing:e=>{this.fields.remove(e)},equals:(e,t)=>e.name===t.name})}},fieldExtensions:{serializeModes:["initial"],serialize:e=>this.fieldExtensions.toArray().map((t=>t.toJSON(e))).filter((e=>this._alwaysSerializeFieldExtensions||!(e&&2===Object.keys(e).length&&e.id&&e.field))),deserialize:e=>{e&&F(this.fieldExtensions,e,{onNew:(e,t)=>{this.fieldExtensions.add(n(e)?e:new S(e),t)},onMatch:(e,t,i,s)=>{n(t)||e.assignProperties(t),i!==s&&this.fieldExtensions.reorder(e,s)},onMissing:e=>{this._alwaysSerializeFieldExtensions&&this.fieldExtensions.remove(e)},equals:(e,t)=>n(t)?t===e:!(!t?.field||!S.matchesRef(e,t.field))||e.id===t.id})}},types:{serialize:!1,deserialize:e=>{if(!e)return;const t=e.map((e=>v(e)?e:a.toEsriApiFeatureType(e)));F(this.types,t,{onNew:(e,t)=>{this.types.add(e,t)},onMatch:(e,t,i,s)=>{e!==t&&(e.name=t.name,e.templates=t.templates?[...t.templates]:[],e.domains=t.domains),i!==s&&this.types.reorder(e,s)},onMissing:e=>{this.types.remove(e)},equals:(e,t)=>e.id===t.id})}},timeZone:{serialize:!1,deserialize:e=>{e&&(this.timeZone=e)}}}}};A=e=t([f],A);export{A as Schema};class j extends _{get _createFieldLookup(){return this._collection.reduce(((e,t)=>(e.add(t),e)),new WeakSet)}get _expressionFieldsLength(){return this.expressionFields.length}get expressionFields(){if(!this._popupTemplate?.fieldInfos||!this._popupTemplate?.expressionInfos)return new y;const e=new y;for(const t of this._popupTemplate.fieldInfos){const i=t.fieldName.match(fieldWithArcadeXRegex);if(i){const o=this._popupTemplate.expressionInfos.find((e=>e.name===i[1]));if(o){if(!E.has(t)){const e=new s({name:t.fieldName,alias:t.label||o.title||t.fieldName,type:"number"===o.returnType?"double":"string",editable:!1});E.set(t,e)}e.add(E.get(t))}}}return e}get _collection(){return this._schema._fields.concat(this.expressionFields)}get _popupTemplate(){return this._schema._featureSettings?this._schema._featureSettings.popupTemplate:void 0}constructor(e){super(),this._schema=e,z(this._schema,"_fields",(e=>{this.emit("change",e),this._fieldLookup=void 0})),e.watch("_fields.length",(()=>this.notifyChange("length")))}includes(e){return this._fieldLookup=this._fieldLookup??this._createFieldLookup,this._fieldLookup.has(e)}clone(){return new j(this._schema)}add(e,t){g("field",e).isNotMissing(),this._fieldLookup=void 0;const i=e.name?e.name.match(fieldWithArcadeXRegex):void 0;if(i){if(!this._popupTemplate)throw new l("Cannot create a field that references an arcade expression without a feature source and popup template.");const t=this._popupTemplate.expressionInfos.find((e=>e.name===i[1]));if(!t)throw new l("Cannot create a field that references a non-existent arcade expression.");this._popupTemplate.fieldInfos||(this._popupTemplate.fieldInfos=[]);let s=this._popupTemplate.fieldInfos.find((t=>t.fieldName===e.name));s||(s=new o({fieldName:e.name,label:t.title}),this._popupTemplate.fieldInfos.push(s));const n=E.get(s);E.set(s,e);const r={added:[e],moved:[],removed:n?[n]:[],target:this};this.emit("change",r),this.notifyChange("length"),this.notifyChange("_expressionFieldsLength")}else this._schema._fields.add(e,t);return this}removeAt(e){g("index",e).isNotMissing();const t=this.getItemAt(e);if(!t)return;this._fieldLookup=void 0;if(t.name?t.name.match(fieldWithArcadeXRegex):void 0){const e=this._popupTemplate.fieldInfos.findIndex((e=>e.fieldName===t.name));this._popupTemplate.fieldInfos.splice(e,1);const i={added:[],moved:[],removed:[t],target:this};this.emit("change",i),this.notifyChange("length"),this.notifyChange("_expressionFieldsLength")}else this._schema._fields.remove(t);return t}reorder(e,t){if(e&&this._schema._fields.includes(e))return this._schema._fields.reorder(e,t),e}sort(e){return this._schema._fields.sort(e),this}}class N extends h{get _collection(){return this._schema.fields.map((e=>this._forField(e))).concat(Array.from(this._uninitializedFieldExtensions))}constructor(e){super(),this._uninitializedFieldExtensions=new Set,this._schema=e,z(this._schema,"fields",(e=>{const t={added:(e.added||[]).map((e=>this._forField(e))),moved:(e.moved||[]).map((e=>this._forField(e))),removed:(e.removed||[]).map((e=>this._forField(e))),target:this};this.emit("change",t)})),e.watch("fields.length",(()=>this.notifyChange("length")))}forField(e){if(g("field",e).isNotMissing(),this._schema.fields.includes(e))return this._forField(e)}add(e,t){if(g("fieldX",e).isNotMissing(),e.schema&&e.schema.fieldExtensions.remove(e),e._setSchema(this._schema),e.field){const i=I.get(e.field);if(I.set(e.field,e),i&&i!==e&&this._onRemoved(i),this._schema.fields.includes(e.field))if(void 0===t){const t={added:[e],moved:[],removed:i?[i]:[],target:this};this.emit("change",t)}else this._schema.fields.reorder(e.field,t);else this._schema.fields.add(e.field,t)}else{this._uninitializedFieldExtensions.add(e);const t={added:[e],moved:[],removed:[],target:this};this.emit("change",t)}return this._onAdded(e),this}removeAt(e){const t=this.getItemAt(e);if(void 0!==t){if(this._uninitializedFieldExtensions.has(t)){this._uninitializedFieldExtensions.delete(t);const e={added:[],moved:[],removed:[t],target:this};this.emit("change",e)}else this._schema.fields.remove(t.field);return this._onRemoved(t),t}}reorder(e,t){if(e&&this._schema.fields.includes(e.field))return this._schema.fields.reorder(e.field,t),e}sort(e){return this._schema.fields.sort(((t,i)=>e(this._forField(t),this._forField(i)))),this}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.field}_onAdded(e){}_onRemoved(e){e.schema===this._schema&&e._setSchema(void 0)}_forField(e){if(this._uninitializedFieldExtensions.size)for(const e of this._uninitializedFieldExtensions)e._resolveField(),e.field&&(I.set(e.field,e),this._uninitializedFieldExtensions.delete(e));if(!I.has(e)){const t=new S({field:e});I.set(e,t),t._setSchema(this._schema),this._onAdded(t)}return I.get(e)}}
|
package/data/Table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@arcgis/core/portal/PortalItem";import{LayerDefinition as t}from"../portal/LayerDefinition.js";import{PopupInfo as i}from"../portal/PopupInfo.js";import{checkArg as r}from"../utilities/checkArg.js";export async function toEsriApiTable(e){const t=new((await import("@arcgis/core/layers/FeatureLayer")).default);return await applyToEsriTable(e,t),t}export async function applyToEsriTable(o,p){r("tableJson",o).isNotMissing(),r("table",p).isNotMissing(),r("tableJson.$tableType",o.$tableType).satisfies((e=>"ArcGISServiceTable"===e||void 0===e)),o.hasOwnProperty("id")&&(p.id=o.id),o.hasOwnProperty("title")&&(p.title=o.title),o.hasOwnProperty("url")&&(p.url=o.url),o.hasOwnProperty("itemId")&&(p.portalItem=new e({id:o.itemId})),o.hasOwnProperty("popupInfo")&&(p.popupTemplate=i.toEsriApiPopupTemplate(o.popupInfo)),o.hasOwnProperty("layerDefinition")&&await t.applyToEsriApiLayer(o.layerDefinition,p)}export function fromEsriTable(e){r("table",e).isNotMissing();const o={layerDefinition:t.fromEsriApiLayer(e)};return o.id=e.id,o.$tableType="ArcGISServiceTable",e.title&&(o.title=e.title),e.url&&(o.url=e.url),e.portalItem?.id&&(o.itemId=e.portalItem.id),e.popupTemplate&&(o.popupInfo=i.fromEsriApiPopupTemplate(e.popupTemplate)),e.objectIdField&&(o.layerDefinition.objectIdField=e.objectIdField),o}
|
package/data/TableExtension.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TableExtension}from"./_TableExtension.js";import{DefaultTableExtensionFactory}from"./support/DefaultTableExtensionFactory.js";export{TableExtension}from"./_TableExtension.js";
|
|
1
|
+
import{TableExtension as o}from"./_TableExtension.js";import{DefaultTableExtensionFactory as t}from"./support/DefaultTableExtensionFactory.js";export{TableExtension}from"./_TableExtension.js";o.factory=t.instance;
|
package/data/TaskSettings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{serializable}from"../support/Serializable.js";import{Settings}from"../support/Settings.js";let
|
|
1
|
+
import{__decorate as e}from"tslib";import{serializable as t}from"../support/Serializable.js";import{Settings as n}from"../support/Settings.js";let i=class extends n{get enableExport(){return this._getSetting("enableExport",!0)}set enableExport(e){this._setSetting("enableExport",e)}get enableIdentify(){return this._getSetting("enableIdentify",!0)}set enableIdentify(e){this._setSetting("enableIdentify",e)}get enableQuery(){return this._getSetting("enableQuery",!0)}set enableQuery(e){this._setSetting("enableQuery",e)}get enableSearch(){return this._getSetting("enableSearch",!0)}set enableSearch(e){this._setSetting("enableSearch",e)}get enableAdd(){return this._getSetting("enableAdd",!0)}set enableAdd(e){this._setSetting("enableAdd",e)}get enableUpdate(){return this._getSetting("enableUpdate",!0)}set enableUpdate(e){this._setSetting("enableUpdate",e)}get enableDelete(){return this._getSetting("enableDelete",!0)}set enableDelete(e){this._setSetting("enableDelete",e)}get enableEditing(){return this._getSetting("enableEditing",!0)}set enableEditing(e){this._setSetting("enableEditing",e)}_getSerializableProperties(){return{enableAdd:"initial",enableDelete:"initial",enableEditing:"initial",enableExport:"initial",enableIdentify:"initial",enableQuery:"initial",enableSearch:"initial",enableUpdate:"initial"}}};i=e([t],i);export{i as TaskSettings};
|
package/data/_Relationship.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export declare namespace Relationship {
|
|
|
71
71
|
/**
|
|
72
72
|
* The cardinality of the Relationship.
|
|
73
73
|
*/
|
|
74
|
-
export
|
|
74
|
+
export type Cardinality = "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many";
|
|
75
75
|
/**
|
|
76
76
|
* Converts Geodatabase Relationship Cardinality type to the ESRI JS API
|
|
77
77
|
* Cardinality type.
|
|
@@ -89,8 +89,8 @@ export declare function fromEsriApiCardinality(type: string): GeodatabaseCardina
|
|
|
89
89
|
/**
|
|
90
90
|
* Relationship cardinality type values for Geodatabase tables.
|
|
91
91
|
*/
|
|
92
|
-
export
|
|
92
|
+
export type GeodatabaseCardinality = "esriRelCardinalityOneToOne" | "esriRelCardinalityOneToMany" | "esriRelCardinalityManyToOne" | "esriRelCardinalityManyToMany";
|
|
93
93
|
/**
|
|
94
94
|
* The type of the Relationship.
|
|
95
95
|
*/
|
|
96
|
-
export
|
|
96
|
+
export type RelationshipType = "QueryBasedRelationship" | "ArcGISRelationship" | string;
|
package/data/_Relationship.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{InvalidOperationError}from"../InvalidOperationError.js";import{assertNever}from"../utilities/checkArg.js";export var Relationship;!function(e){e.create=function(r){if(!e.factory)throw new
|
|
1
|
+
import{InvalidOperationError as n}from"../InvalidOperationError.js";import{assertNever as e}from"../utilities/checkArg.js";export var Relationship;!function(e){e.create=function(r){if(!e.factory)throw new n("Cannot create relationship: no relationship factory has been registered.");return e.factory.create(r)}}(Relationship||(Relationship={}));export function toEsriApiCardinality(n){if(!n)return;return!!t(n)?n:r(n,new Error("Unknown relationship cardinality type."))}export function fromEsriApiCardinality(n){if(!n)return;return!!r(n)?n:t(n,new Error("Unknown relationship cardinality type."))}function r(n,r){const t=n;switch(t){case"esriRelCardinalityOneToOne":return"one-to-one";case"esriRelCardinalityOneToMany":return"one-to-many";case"esriRelCardinalityManyToOne":return"many-to-one";case"esriRelCardinalityManyToMany":return"many-to-many";default:return e(t,r)}}function t(n,r){const t=n;switch(t){case"one-to-one":return"esriRelCardinalityOneToOne";case"one-to-many":return"esriRelCardinalityOneToMany";case"many-to-one":return"esriRelCardinalityManyToOne";case"many-to-many":return"esriRelCardinalityManyToMany";default:return e(t,r)}}
|
package/data/_TableExtension.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import
|
|
1
|
+
import{__decorate as e}from"tslib";import t from"@arcgis/core/core/Collection";import{InvalidOperationError as i}from"../InvalidOperationError.js";import{ItemType as s}from"../ItemType.js";import{applyToEsriTable as r,fromEsriTable as a,toEsriApiTable as o}from"../portal/Table.js";import{serializable as l}from"../support/Serializable.js";import{CollectionProxy as n}from"../utilities/CollectionProxy.js";import{isFeatureLayer as h,isLayer as b}from"../utilities/_layers.js";import{checkArg as p}from"../utilities/checkArg.js";import{deepClone as d}from"../utilities/object.js";import{FeatureSettings as f}from"./FeatureSettings.js";import{FeatureSourceBase as _}from"./FeatureSourceBase.js";import{Schema as c}from"./Schema.js";const g="Invalid type of table for this type of table extension.",m="Spatial settings are not supported for tables.",T=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsQuery:!1,supportsAttachmentEditing:!1});export class TableExtension extends _{get mapExtension(){return this._mapExtension}get table(){return this._table}get capabilities(){return T}get title(){return this.table?.title??this._deferredTableProperties?.title??("string"==typeof this._deferredTableProperties?.$ref?this._deferredTableProperties?.$ref:this._deferredTableProperties?.$ref?.title??this._deferredTableProperties?.$ref?.id)??"Table"}constructor(e){super(e),this._itemType=s.TABLE_EXTENSION;const{table:t}={...this.getDefaults(),...e};if(b(t))p("properties.table",t).satisfies((e=>h(e)),g),this._setTable(t);else{if(!t)throw new Error("Missing 'table' property.");this._deferredTableProperties=t}}static create(e){if(!TableExtension.factory)throw new i("Cannot create table extension: no table extension factory has been registered.");return TableExtension.factory.create(e)}static _matchesRef(e,t){if(!e||!t)return!1;const i=e.table?.id??e._deferredTableProperties.id,s=e.table?.title??e._deferredTableProperties.title,r=t.$ref;return"string"==typeof r?i===r||s===r:!!r&&(i===r.id||s===r.title)}async _createBackingTable(){this.table||this._deferredTableProperties?.$ref||(this._setTable(await o(this._deferredTableProperties)),await this.table.load(),p("properties.table",this.table).satisfies((e=>this._isSupportedTable(e)),g),this._deferredTableProperties=void 0)}_setMapExtension(e){const t=this.mapExtension;this._mapExtension=e,t&&this.featureSettings.formatSettings.parent===t.formatSettings&&(this.featureSettings.formatSettings.parent=void 0),e&&(this.featureSettings.formatSettings.parent||(this.featureSettings.formatSettings.parent=e.formatSettings)),this._resolveTable(),this.notifyChange("mapExtension")}_resolveTable(){if(this._table||!this._deferredTableProperties||!this.mapExtension)return;let e;e="string"==typeof this._deferredTableProperties.$ref?{id:this._deferredTableProperties.$ref,title:this._deferredTableProperties.$ref}:this._deferredTableProperties.$ref;let t=this._mapExtension.map?.tables.find((t=>t.id===e.id));if(t||(t=this._mapExtension.map?.tables.find((t=>t.title===e.title))),t&&this._isSupportedTable(t)){this._setTable(t);const e={table:this._deferredTableProperties};this.assignProperties(e),this._originalRef=this._deferredTableProperties.$ref,this._deferredTableProperties=void 0}}_getSerializableProperties(){return{...super._getSerializableProperties(),table:{serializeModes:["initial","project"],serialize:()=>this.table?this._mapExtension&&(this.table.id||this.table.title)?this._originalRef?{$ref:this._originalRef}:{$ref:{id:this.table.id,title:this.table.title}}:a(this.table):this._deferredTableProperties?d(this._deferredTableProperties):void 0,deserialize:e=>{if(b(e)){if(e!==this.table)throw new Error("Property 'table' is read-only.")}else this.table?r(e,this.table):this._deferredTableProperties&&(this._deferredTableProperties={...this._deferredTableProperties,...e})}}}}async _onInitialize(){if(await super._onInitialize(),await this._createBackingTable(),this._resolveTable(),!this.table){const e=this._deferredTableProperties.$ref;throw this._mapExtension?new i(`No table found matching reference "${e?.toString()}".`):new i("Cannot resolve table reference: missing parent map extension.")}await this.table.load()}_createSchema(){return new u(this)}_createFeatureSettings(){return new y}_setTable(e){this._table=e,this.notifyChange("table"),this.notifyChange("title"),this.notifyChange("capabilities")}}let u=class extends c{constructor(e){if(super(),this._tableBindings=new Map,this._tableExtension=e,this._bindSettingToTableProperty("primaryKeyField","objectIdField"),this._fieldCollection=this._createFieldCollection(),e.table)this._onTableResolved(e.table);else{const t=e.watch("table",(()=>{this._onTableResolved(e.table),t.remove()}),!0)}}get _fields(){return this._fieldCollection}get geometryType(){}set geometryType(e){throw new i("Tables do not support a geometry type.")}get spatialReference(){}set spatialReference(e){throw new i("Tables do not support a spatial reference.")}_getSetting(e,t){return this._tableBindings.has(e)&&this._tableExtension.table?this._tableExtension.table[this._tableBindings.get(e)]:super._getSetting(e,t)}_setSetting(e,t){this._tableBindings.has(e)&&this._tableExtension.table?this._tableExtension.table[this._tableBindings.get(e)]=t:super._setSetting(e,t)}_bindSettingToTableProperty(e,t){const i=t??e;this._tableBindings.set(e,i),this._tableExtension.watch(`table.${i}`,(()=>this.notifyChange(e)),!0)}_onTableResolved(e){for(const t of this._tableBindings.keys())this.isModified(t)&&(e[t]=this[t],this.reset(t))}_createFieldCollection(){return new w(this._tableExtension)}};u=e([l],u);export{u as TableSchema};class w extends n{constructor(e){super(),this._tableResolved=!1;if(e.table?.fields)this._onTableResolved(e.table);else{this._collection=new t;const i=e.watch(["table","table.loaded"],(()=>{e.table?.fields&&(this._onTableResolved(e.table),i.remove())}),!0)}}_onTableResolved(e){if(!this._tableResolved){this._tableResolved=!0;const i=e;this.length&&(i.fields.length=0,i.fields.push(...this.toArray())),i.fields||(i.fields=[]),this._collection=function(e){const i=new t;return Object.defineProperty(i,"_items",{get:()=>e}),Object.defineProperty(i,"length",{get:()=>e.length,set:t=>e.length=t}),i}(i.fields)}}}let y=class extends f{get returnGeometry(){}set returnGeometry(e){throw new i(m)}get outSpatialReference(){}set outSpatialReference(e){throw new i(m)}get maxAllowableOffset(){}set maxAllowableOffset(e){throw new i(m)}get zoomScale(){}set zoomScale(e){throw new i(m)}get zoomFactor(){}set zoomFactor(e){throw new i(m)}};y=e([l],y);export{y as TableFeatureSettings};
|
package/data/convert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Point from"@arcgis/core/geometry/Point";import SpatialReference from"@arcgis/core/geometry/SpatialReference";import{translate}from"../locale/language.js";import{toEsriApiGeometry,toPortalGeometry}from"../portal/Geometry.js";import{checkArg,assertNever}from"../utilities/checkArg.js";import{parse as parseDate,format as formatDate,DEFAULT_PARSING_FORMATS,DateFormat,INVALID_DATE}from"../utilities/date.js";import{esriToWKT,esriToGeoJSON,geoJSONToEsri,wktToEsri,esriWkidToWkt,esriWktToWkid,project,isPoint,isMultipoint,isPolyline,isPolygon,isExtent}from"../utilities/geometry.js";import{getLogger}from"../utilities/log.js";import{parse as parseNumber,format as formatNumber,NumberFormat,isNumeric}from"../utilities/number.js";import{Feature}from"./Feature.js";import{FeatureSet}from"./FeatureSet.js";const FORMULA_TRIGGER_CHARS=["=","-","+","@"],QUOTE='"',FIELD_NAME_REGEX=/[^a-zA-Z\d_]/g,DEFAULT_WINDOWS_ROW_DELIMITER="\r\n",DEFAULT_UNIX_ROW_DELIMITER="\n",DEFAULT_SHEET_NAME="sheet1",DEFAULT_EXCEL_DATE_FORMATS=[...DEFAULT_PARSING_FORMATS.map(_convertToExcelDateFormatString),"M/d/yy"],shapefileNameRegex=/(\w+)_(point|multipoint|polyline|polygon)z?/;var DBaseTypes;function _getConvertLogger(){return getLogger("geocortex.api.data.convert")}!function(e){e.DATE="D",e.NUMBER="N",e.STRING="C",e.BOOLEAN="L"}(DBaseTypes||(DBaseTypes={}));export var GeometryFormat;!function(e){e.NONE="NONE",e.WKT="WKT",e.XY="XY",e.XYZ="XYZ",e.LAT_LON="LAT_LONG",e.GEO_JSON="GEO_JSON",e.ARCGIS_JSON="ARCGIS_JSON"}(GeometryFormat||(GeometryFormat={}));export async function toCsv(e,t){checkArg("featureSet",e).isNotMissing();const r=Array.from(e),o={...{useFormattedValues:!1,alwaysQuote:!1,escapeFormulaChars:!0,delimiter:",",dateFormat:DateFormat.ROUND_TRIP,geometryFormat:r.some((e=>void 0!==e.geometry&&null!==e.geometry))?GeometryFormat.WKT:GeometryFormat.NONE,includeByteOrderMark:!0,outSpatialReference:SpatialReference.WGS84,includeHeaderRow:!0,outFields:_getDefaultOutFields(e.source),rowDelimiter:navigator.platform.startsWith("Win")?"\r\n":"\n"},...t},{includeByteOrderMark:a,includeHeaderRow:n,delimiter:s,outFields:i,rowDelimiter:m}=o,u=[];a&&u.push("\ufeff");const l=_getGeometryColumns(r,o),c=_getAttributeColumns(r,i,e.schema,!0),f=_getAttributeColumns(r,i,e.schema,!1);if(n){const e=[];for(const t of l)e.push(_quotify(t,o));for(const t of c)e.push(_quotify(t,o));for(const t of f)e.push(_quotify(t,o));const t=e.join(s)+m;u.push(t)}await Promise.all(r.map((async e=>{const t=[],r=(t,r)=>_quotify(_stringify(_getAttributeValue(e,t,r),r),r);t.push(...await _getCSVGeometry(e.geometry,o)),t.push(...c.map((e=>r(e,o)))),t.push(...f.map((e=>r(e,o))));const a=`${t.join(s)}${m}`;u.push(a)})));return new Blob(u,{type:"text/plain",endings:"\n"===m||"\r\n"===m?"transparent":"native"})}export async function csvToFeatureSet(e,t){let r;if(checkArg("csvData",e).isNotMissing(),e instanceof Blob){const t=new Promise(((t,r)=>{const o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{r(o.error)},o.readAsText(e)}));r=await t}else r=e;const o={...{delimiter:",",escapeFormulaChars:!0,includeHeaderRow:!0,outFields:["*"],inSpatialReference:SpatialReference.WGS84,generatePrimaryKey:!0,primaryKeyField:"OBJECTID"},...t,detectOid:!t?.primaryKeyField},a=_parseCSV(r,o.rowDelimiter||_parseRowDelimiter(r),o.delimiter),n=_parseGeometries(a,o),s=_parseSchema(a,n,o),i=await _parseFeatures(a,n,s,o);return new FeatureSet({features:i,schema:s})}export async function toXLSX(e,t){checkArg("featureSet",e).isNotMissing();const r=Array.from(e),o={...{useFormattedValues:!1,includeHeaderRow:!0,escapeFormulaChars:!0,geometryFormat:r.some((e=>void 0!==e.geometry&&null!==e.geometry))?GeometryFormat.WKT:GeometryFormat.NONE,outFields:_getDefaultOutFields(e.source),outSpatialReference:SpatialReference.WGS84,dateFormat:DateFormat.DEFAULT,numberFormat:NumberFormat.DEFAULT,sheetName:"sheet1"},...t},{outFields:a,includeHeaderRow:n,numberFormat:s}=o,i=[],m=_getGeometryColumns(r,o),u=_getAttributeColumns(r,a,e.schema,!0),l=_getAttributeColumns(r,a,e.schema,!1);if(n){const t=m.concat(u).concat(_getXlsxColumnName(l,e.source));i.push(t)}await Promise.all(r.map((async e=>{const t=[];t.push(...await _getGeometry(e.geometry,o));for(const r of u){const a=_toXLSXValue(e.attributes.get(r),o);t.push(a)}for(const r of l){const a=_toXLSXValue(_getAttributeValue(e,r,o),o);t.push(a)}t.every((e=>"string"!=typeof e||e.length<=32767))?i.push(t):_getConvertLogger().warn(`toXLSX cell limit exceeded, feature (${e.primaryKey??e.id}) omitted.`)})));const c=await import("xlsx"),f={SheetNames:[],Sheets:{}},p=c.utils.aoa_to_sheet(i,{cellDates:!0});for(const e of Object.keys(p).filter((e=>!e.startsWith("!")))){const t=p[e];"d"===t.t?t.z=_convertToExcelDateFormatString(o.dateFormat??DateFormat.ROUND_TRIP):"n"===t.t&&(t.z=_convertToExcelNumberFormatString(s))}f.SheetNames.push(o.sheetName),f.Sheets[o.sheetName]=p;const y=c.write(f,{type:"binary",bookType:"xlsx",compression:!0,bookSST:!0,cellDates:!0}),d=new Uint8Array(y.length);for(let e=0;e<y.length;e++)d[e]=y.charCodeAt(e);return new Blob([d.buffer],{type:"text/plain"})}export async function xlsxToFeatureSet(e,t){checkArg("xlsxData",e).isNotMissing();const r={...{includeHeaderRow:!0,escapeFormulaChars:!0,outFields:["*"],inSpatialReference:SpatialReference.WGS84,generatePrimaryKey:!0,primaryKeyField:"OBJECTID"},...t,detectOid:!t?.primaryKeyField},o=await _parseXLSX(e,r),a=_parseGeometries(o,r),n=_parseSchema(o,a,r),s=await _parseFeatures(o,a,n,r);return new FeatureSet({features:s,schema:n})}export async function toShapefile(e,t){checkArg("featureSet",e).isNotMissing();const[{default:r},o]=await Promise.all([import("jszip"),import("../forked-libs/shp-write/index.js")]),a=Array.from(e),n={...{useFormattedValues:!1,outFields:_getDefaultOutFields(e.source),fileName:e.title||"export"},...t},{outFields:s,outSpatialReference:i,fileName:m}=n,u=e=>e.geometry.hasZ||e.geometry.hasM,l=new Map,c=a.filter((e=>isPoint(e.geometry)));l.set("POINTZ",c.filter(u)),l.set("POINT",c.filter((e=>!u(e))));const f=a.filter((e=>isMultipoint(e.geometry)));l.set("MULTIPOINTZ",f.filter(u)),l.set("MULTIPOINT",f.filter((e=>!u(e))));const p=a.filter((e=>isPolyline(e.geometry)));l.set("POLYLINEZ",p.filter(u)),l.set("POLYLINE",p.filter((e=>!u(e))));const y=a.filter((e=>isPolygon(e.geometry)||isExtent(e.geometry)));l.set("POLYGONZ",y.filter(u)),l.set("POLYGON",y.filter((e=>!u(e))));const d=_getAttributeColumns(a,s,e.schema,!0);let g=_getAttributeColumns(a,s,e.schema,!1);g=d.concat(g);const h=new r,F=Array.from(l.keys()).filter((e=>l.get(e).length>0));await Promise.all(F.map((async t=>{const r=l.get(t),a=await Promise.all(r.map((e=>_projectGeometry(e.geometry,i)))),s=await _getDBaseSpatialReferenceWKT(a),u=n.useFormattedValues?Object.assign({},...g.map((e=>({[e]:DBaseTypes.STRING})))):_getDBaseColumnTypes(r,g,e.schema,"timestamp"===n.dateFormat),c=_getDBaseGeometries(a),f=_getDbaseValues(r,g,u,n);o.write(f,t,c,((e,r)=>{const o=F.length>1?`${m}_${t.toLowerCase()}`:m;h.file(`${o}.shp`,r.shp.buffer,{binary:!0}),h.file(`${o}.shx`,r.shx.buffer,{binary:!0}),h.file(`${o}.dbf`,r.dbf.buffer,{binary:!0}),h.file(`${o}.prj`,s)}))})));const _=await h.generateAsync({type:"uint8array"});return new Blob([_.buffer],{type:"text/plain"})}export async function shapefileToFeatureSet(e,t){checkArg("shapefileData",e).isNotMissing();const r={outFields:["*"],includeHeaderRow:!0,generatePrimaryKey:!0,primaryKeyField:"OBJECTID",...t,detectOid:!t?.primaryKeyField},o=new Promise(((t,r)=>{const o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{r(o.error)},o.readAsArrayBuffer(e)})),[{default:a},{default:n}]=await Promise.all([import("jszip"),import("shpjs")]),s=await o,i=await a.loadAsync(new Uint8Array(s)),m=i.filter((()=>!0)).map((e=>e.name));let u,l=m.filter((e=>e.endsWith(".shp"))).map((e=>e.substring(0,e.length-4)));if(l=_parseShapefileNames(l),m.some((e=>e.endsWith(".prj")))&&!l.every((e=>m.includes(`${e}.prj`))))throw new Error("Shapefile zip must contain the same prj file for each separate shapefile");await Promise.all(m.filter((e=>e.endsWith(".prj"))).map((async e=>{const t=await i.file(e).async("string");if(u){if(t!==u)throw new Error("Shapefile zip must contain the same prj file for each separate shapefile")}else u=t})));const c={geometries:[],columnCount:0,columnIndex:0};let f=[];for(const e of l){if(!m.includes(`${e}.shx`)||!m.includes(`${e}.dbf`))throw new Error("Shapefile must contain shp, shx, and dbf files.");const t=await i.file(`${e}.shp`).async("uint8array"),r=n.parseShp(t),o=await i.file(`${e}.dbf`).async("uint8array"),a=n.parseDbf(o);if(a.length!==r.length)throw new Error("Shapefile must contain shp, shx, and dbf files.");const s=await Promise.all(r.map((e=>_parseShpGeometry(e,u))));c.geometries=c.geometries.concat(s),f=f.concat(a)}const p=_parseDBaseData(f),y=_parseSchema(p,c,r),d=await _parseFeatures(p,c,y,r);return new FeatureSet({features:d,schema:y})}function _getGeometryColumns(e,t){return t.geometryFormat===GeometryFormat.XYZ?["x","y","z"]:t.geometryFormat===GeometryFormat.XY?["x","y"]:t.geometryFormat===GeometryFormat.LAT_LON?["latitude","longitude"]:t.geometryFormat===GeometryFormat.NONE?[]:["geometry"]}function _getAttributeColumns(e,t,r,o){const a=r.fields.filter((e=>"oid"===e.type)).map((e=>e.name)).toArray();if(o)return a;if(t&&!t.includes("*"))return t.filter((e=>!a.includes(e)));{const t=r.fields.filter((e=>"oid"!==e.type)).map((e=>e.name)).toArray();let o=[];for(const r of e)for(const e of r.attributes.keys())t.includes(e)||a.includes(e)||o.includes(e)||o.push(e);return o=o.sort(),t.concat(o)}}function _getXlsxColumnName(e,t){const r=t?.schema?.fieldExtensions.initializedItems.map((e=>e.field));return e.map((e=>r?.find((t=>t.name===e))?.alias??e))}function _getDefaultOutFields(e){if(!e)return["*"];const t=e.featureSettings.popupTemplate?.content;return(Array.isArray(t)?t.find((e=>"fields"===e.type))?.fieldInfos?.filter((e=>e.visible))?.map((e=>e.fieldName)):void 0)??e.featureSettings.popupTemplate?.fieldInfos?.filter((e=>e.visible))?.map((e=>e.fieldName))??["*"]}async function _getCSVGeometry(e,t){let r=await _getGeometry(e,t);return t.geometryFormat!==GeometryFormat.XYZ&&t.geometryFormat!==GeometryFormat.XY&&t.geometryFormat!==GeometryFormat.LAT_LON||(r=r.map((e=>void 0===e?"":_stringify(e,t)))),r.map((e=>""===e?"":_quotify(e,t)))}async function _getGeometry(e,t){const r=await _projectGeometry(e,t.outSpatialReference);if(t.geometryFormat===GeometryFormat.XYZ){if(!r)return["","",""];if(!isPoint(r))throw new Error("Cannot use geometry format XYZ with non-point geometry");return[r.x,r.y,r.z]}if(t.geometryFormat===GeometryFormat.XY){if(!r)return["",""];if(!isPoint(r))throw new Error("Cannot use geometry format XY with non-point geometry");return[r.x,r.y]}if(t.geometryFormat===GeometryFormat.LAT_LON){if(!r)return["",""];if(!isPoint(r))throw new Error("Cannot use geometry format LAT_LONG with non-point geometry");return[r.y,r.x]}return t.geometryFormat===GeometryFormat.ARCGIS_JSON?r?[JSON.stringify(toPortalGeometry(r))]:[""]:t.geometryFormat===GeometryFormat.WKT?r?[esriToWKT(r)]:[""]:t.geometryFormat===GeometryFormat.GEO_JSON?r?[JSON.stringify(esriToGeoJSON(r))]:[""]:[]}async function _projectGeometry(e,t){return e?.spatialReference&&!e.spatialReference.equals(t)&&t?(await project([e],t))[0]:e}function _quotify(e,t){const r=[t.delimiter,'"',"\r","\n",t.rowDelimiter];if(t.alwaysQuote||r.some((t=>e.includes(t)))){return`"${e.replace(new RegExp('"',"g"),'""')}"`}return e}function _stringify(e,t){if(null==e)return"";if(!t.useFormattedValues){if("number"==typeof e){const r=t.numberFormat||NumberFormat.ROUND_TRIP;return formatNumber(r,e)}if(e instanceof Date)return"timestamp"===t.dateFormat?e.getTime().toString():formatDate({format:t.dateFormat,timeZone:"UTC"},e)}let r=e.toString();return t.escapeFormulaChars&&(r=escapeFormulaChars(r)),r}function _getAttributeValue(e,t,r){if(r.useFormattedValues||_hasCodedDomain(e,t))return e.presentableAttributes.get(t)??e.attributes.get(t);if("date"===e.schema.findFieldByName(t)?.type){const r=parseDate(e.attributes.get(t));if(!isNaN(r.getTime()))return r}return e.attributes.get(t)??e.presentableAttributes.get(t)}function _hasCodedDomain(e,t){return t===e.schema.typeIdField||("coded-value"===e.type?.domains?.[t]?.type||"coded-value"===e.schema.findFieldByName(t)?.domain?.type)}function escapeFormulaChars(e){for(const t of FORMULA_TRIGGER_CHARS)if(e.startsWith(t))return`\t${e}`;return e}function _parseRowDelimiter(e){let t="\n";return _forDelimiter(e,"\r\n",((r,o)=>(0===r&&o===e.length||(t="\r\n"),!1))),t}function _parseCSV(e,t,r){const o=[];if(_forDelimiter(e,t,((t,a)=>{const n=e.substring(t,a);return n.length>0&&o.push(((e,t)=>{const o=[];return _forDelimiter(e,r,((r,a)=>{const n=e.substring(r,a);return o.push({raw:_parseQuotes(n,t,o.length)}),!0})),o})(n,o.length)),!0})),o.length){const e=o[0].length;o.forEach(((t,r)=>{if(t.length!==e)throw new Error(`Detected invalid CSV: Row ${r} does not have expected number of columns: ${e}`)}))}return o}function _parseQuotes(e,t,r){const o=e.startsWith('"'),a=e.endsWith('"');if(o&&!a||!o&&a)throw new Error(`Detected invalid CSV: Missing opening or closing quote for value at row:${t} column:${r}`);const n=o?e.substring('"'.length,e.length-'"'.length):e;let s=-1;return _forDelimiter(n,'"',((e,o)=>{if(o===n.length)return!0;if(s<0){if(o!==n.length)return s=o,!0}else if(o===s+'"'.length)return s=-1,!0;throw new Error(`Detected invalid CSV: Non-escaped quote for value at row:${t} column:${r}`)})),n.replace(new RegExp('""',"g"),'"')}function _forDelimiter(e,t,r){let o,a=!1,n=0,s=0;for(;o=e.indexOf(t,n),!(o<0);){for(let t=n;t<o;)e.substring(t).startsWith('"')?(a=!a,t+='"'.length):t++;const i=o+t.length;if(!a){const e=r(s,o);if(s=i,!e)break}n=i}r(s,e.length)}const geometryTypeHeaders={[GeometryFormat.XYZ]:[["x","y","z"]],[GeometryFormat.XY]:[["x","y"]],[GeometryFormat.LAT_LON]:[["lat","lon"],["lat","long"],["latitude","longitude"]],[GeometryFormat.ARCGIS_JSON]:[["geometry"]],[GeometryFormat.GEO_JSON]:[["geometry"]],[GeometryFormat.WKT]:[["geometry"]]};function _parseArcGisJson(e,t){const r=JSON.parse(e),o=toEsriApiGeometry(r);return r.spatialReference||(o.spatialReference=t),o}function _parseGeoJson(e,t){const r=geoJSONToEsri(JSON.parse(e));return r.spatialReference=t,r}function _parseWkt(e,t){const r=wktToEsri(e);return r.spatialReference=t,r}function _findGeometryFormatIndex(e,t){const r=geometryTypeHeaders[t];for(const t of r){const r=e.findIndex(((r,o)=>!(o+t.length>e.length)&&t.every(((t,r)=>e[o+r].raw.toString().toLowerCase()===t))));if(-1!==r)return r}}function _detectGeometry(e,t){return e.map(((e,r)=>{const o=e?.raw;if("string"==typeof o&&""!==o)try{return t(o,void 0),r}catch{return}})).find((e=>void 0!==e))}function _parseGeometries(e,t){const r=t.includeHeaderRow?e.slice(1):e;if(t.geometryFormat===GeometryFormat.NONE)return{columnCount:0,columnIndex:0};const o=(e,o)=>{const a=o===GeometryFormat.XYZ,n=o===GeometryFormat.LAT_LON,s=a?3:2;return{columnCount:s,columnIndex:e,geometries:r.map((r=>{if(r.length>=e+s&&isNumeric(r[e+0].raw)&&isNumeric(r[e+1].raw)&&(!a||isNumeric(r[e+2].raw)))return new Point({x:parseNumber(n?r[e+1].raw:r[e+0].raw),y:parseNumber(n?r[e+0].raw:r[e+1].raw),z:a?parseNumber(r[e+2].raw):0,spatialReference:t.inSpatialReference})}))}},a=(e,o)=>({columnCount:1,columnIndex:e,geometries:r.map((t=>t[e])).map((e=>{if(""!==e.raw)return o(e.raw.toString(),t.inSpatialReference)}))});if(t.geometryFormat){const r=_findGeometryFormatIndex(e[0],t.geometryFormat);if(t.includeHeaderRow&&void 0===r)throw new Error(`Error parsing CSV: Expected geometry columns ${geometryTypeHeaders[t.geometryFormat][0].join(",")} are missing for GeometryType.${t.geometryFormat}`);return((e,t)=>{switch(t){case GeometryFormat.NONE:return{columnCount:0,columnIndex:0};case GeometryFormat.LAT_LON:case GeometryFormat.XYZ:case GeometryFormat.XY:return o(e,t);case GeometryFormat.ARCGIS_JSON:return a(e,_parseArcGisJson);case GeometryFormat.GEO_JSON:return a(e,_parseGeoJson);case GeometryFormat.WKT:return a(e,_parseWkt);default:return assertNever(t,new Error(`Unknown geometry format "${t}".`))}})(r??0,t.geometryFormat)}if(t.includeHeaderRow){const t=_findGeometryFormatIndex(e[0],GeometryFormat.ARCGIS_JSON);if(void 0!==t)for(const e of[_parseArcGisJson,_parseGeoJson,_parseWkt])try{return a(t,e)}catch(e){}const r=[GeometryFormat.XYZ,GeometryFormat.XY,GeometryFormat.LAT_LON];for(const t of r){const r=_findGeometryFormatIndex(e[0],t);if(void 0!==r)return o(r,t)}}for(const e of[_parseArcGisJson,_parseGeoJson,_parseWkt])try{const t=_detectGeometry(r[0],e);return a(t,e)}catch(e){}return{columnCount:0,columnIndex:0}}function _parseSchema(e,t,r){const o={fields:[]};let a=0;for(let s=0;s<e[0].length;s++){if(n=s,0!==t.columnCount&&n>=t.columnIndex&&n<t.columnIndex+t.columnCount)continue;const i=_parseFieldType(e,s,r);let m=e[0][s].raw.toString(),u=m.replace(FIELD_NAME_REGEX,"_");if(r.includeHeaderRow||(u="field"+ ++a,m=translate("gcx.api.data.convert.import-field-alias",a)),!u)throw new Error("Error parsing CSV or XLSX: Header cannot contain blank values");o.fields.push({alias:m,name:u,type:i})}var n;if(o.spatialReference=r.outSpatialReference,t.geometries?.length){const e=t.geometries.filter((e=>void 0!==e)).map((e=>e.type)),r=e[0];o.geometryType=e.every((e=>e===r))?r:void 0}if(r.generatePrimaryKey&&!o.fields.find((e=>"esriFieldTypeOID"===e.type))){const e=o.fields.length+1,t=!!o.fields.find((e=>"id"===e.name.toLowerCase()));o.fields.push({name:t?`field${e}`:"id",alias:t?translate("gcx.api.data.convert.import-field-alias",e):"id",type:"esriFieldTypeOID"})}return o}function _parseFieldType(e,t,r){let o=!1,a=!0,n=!0,s=!0;const i=new Set,m=r.includeHeaderRow?e[0]:[],u=r.includeHeaderRow?e.slice(1):e;for(const e of u){const m=e[t];""!==m.raw&&(i.add(m.raw),o=!0,a&&(a=isNumeric(m.raw)||Number.isNaN(m.raw)),n&&(n=m.raw instanceof Date||parseDate(r.dateFormat||DEFAULT_PARSING_FORMATS,m.raw)!==INVALID_DATE),s&&(s=parseDate(r.dateFormat||DEFAULT_EXCEL_DATE_FORMATS,m.formatted)!==INVALID_DATE))}const l=i.size===u.length;return r.primaryKeyField&&m[t]?.raw===r.primaryKeyField||r.detectOid&&o&&l&&a?(r.detectOid=!1,"esriFieldTypeOID"):o&&s?"esriFieldTypeDate":o&&a?"esriFieldTypeDouble":o&&n?"esriFieldTypeDate":"esriFieldTypeString"}async function _parseFeatures(e,t,r,o){const a=[],n=o.includeHeaderRow?e.slice(1):e,s=(e,r)=>0===t.columnCount||(r<t.columnIndex||r>=t.columnIndex+t.columnCount);return await Promise.all(n.map((async(e,n)=>{const i=new Feature;for(let t=0;t<r.fields.length;t++){const a=r.fields[t],m=e.filter(s);if(o.outFields.includes("*")||o.outFields.includes(a.name)){let e=await _parseValue(m[t]?.raw,a,o);"esriFieldTypeOID"===a.type&&null===e&&(e=n),i.attributes.set(a.name,e)}}t.geometries&&(i.geometry=await _projectGeometry(t.geometries[n],o.outSpatialReference)),a.push(i)}))),a}async function _parseValue(e,t,r){if("esriFieldTypeDouble"===t.type||"esriFieldTypeOID"===t.type)return"number"==typeof e?e:e?parseNumber(e):null;if("esriFieldTypeDate"===t.type){if(e instanceof Date)return e.getTime();if("number"==typeof e){const t=(await import("xlsx")).SSF.parse_date_code(e);return t?new Date(t.y,t.m-1,t.d,t.H,t.M,t.S).getTime():void 0}return""===e?null:parseDate(e).getTime()}const o=e.toString();if(r.escapeFormulaChars&&o.startsWith("\t"))for(const e of FORMULA_TRIGGER_CHARS)if(o.length>1&&o.charAt(1)===e)return o.substring(1);return o}function _convertToExcelDateFormatString(e){switch(e){case DateFormat.DATE_SHORT:return"dd/MM/yyyy";case DateFormat.DATE_LONG:return"MMMM d, yyyy";case DateFormat.TIME_SHORT:return"h:mm AM/PM";case DateFormat.TIME_LONG:return"h:mm:ss AM/PM";case DateFormat.DATE_TIME_SHORT:case DateFormat.DEFAULT:return"MMM d yyyy h:mm AM/PM";case DateFormat.DATE_TIME_LONG:return"MMMM d yyyy h:mm AM/PM";case DateFormat.FULL:return"dddd, MMMM d yyyy h:mm AM/PM";case DateFormat.ISO_8601:case DateFormat.ROUND_TRIP:return'yyyy-MM-dd"T"HH:mm:ss';default:{const t=e.replace(/tt/g,"AM/PM");return t.includes("z")&&_getConvertLogger().warn("Warning: Excel will not recognize timezone format 'z', 'zz', or 'zzz'"),t.includes("h")&&!t.includes("AM/PM")&&_getConvertLogger().warn("Warning: Excel will interpret 'h' as 'H' if the format does not have an AM/PM designator"),t}}}function _convertToExcelNumberFormatString(e){switch(e){case NumberFormat.ACCOUNTING:return'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)';case NumberFormat.CURRENCY:return'"$"#,##0.00';case NumberFormat.FIXED_POINT:case NumberFormat.DEFAULT:return"0.0000";case NumberFormat.NUMBER:return"#,##0.0000";case NumberFormat.PERCENT:return"0%";case NumberFormat.ROUND_TRIP:return"0.00000";default:return e}}function _toXLSXValue(e,t){if(null==e)return"";if(!t.useFormattedValues){if("number"==typeof e)return e;if(e instanceof Date)return"timestamp"===t.dateFormat?e.getTime():e}let r=e.toString();return t.escapeFormulaChars&&(r=escapeFormulaChars(r)),r}async function _parseXLSX(e,t){const r=await import("xlsx"),o=new Promise(((o,a)=>{const n=new FileReader;n.onload=()=>{const e=new Uint8Array(n.result);let a="";for(const t of e)a+=String.fromCharCode(t);const s=r.read(a,{type:"binary",cellDates:!0}),i=t.sheetName||s.SheetNames[0],m=s.Sheets[i];o(m)},n.onerror=()=>{a(n.error)},n.readAsArrayBuffer(e)})),a=await o,n=r.utils.decode_range(a["!ref"]),s=[];for(let e=n.s.r;e<=n.e.r;e++){const t=[];for(let o=n.s.c;o<=n.e.c;o++){const n=a[`${r.utils.encode_cell({r:e,c:o})}`];t.push(n?{raw:n.v,formatted:"s"===n.t?void 0:n.w}:{raw:""})}s.push(t)}return s}async function _getDBaseSpatialReferenceWKT(e){const{wkid:t,wkt:r}=e[0].spatialReference;if(!e.every((e=>e.spatialReference.wkid===t&&e.spatialReference.wkt===r)))throw new Error("Cannot create shapefile that contains geometries with different spatial references.");return r??esriWkidToWkt(t??SpatialReference.WGS84.wkid)}function _getDBaseColumnTypes(e,t,r,o){const a={};for(const n of t){if(e.some((e=>_hasCodedDomain(e,n)))){a[n]=DBaseTypes.STRING;continue}const t=r?r.fields.find((e=>e.name===n)):void 0;if(t){switch(t.type){case"oid":case"double":case"integer":case"single":case"small-integer":a[n]=DBaseTypes.NUMBER;break;case"date":a[n]=o?DBaseTypes.NUMBER:DBaseTypes.DATE;break;default:a[n]=DBaseTypes.STRING}continue}const s=(e,t)=>e.attributes.get(t)??e.presentableAttributes.get(t);e.every((e=>s(e,n)instanceof Date||void 0===s(e,n)))&&e.some((e=>s(e,n)instanceof Date))?a[n]=o?DBaseTypes.NUMBER:DBaseTypes.DATE:e.every((e=>"number"==typeof s(e,n)||void 0===s(e,n)))&&e.some((e=>"number"==typeof s(e,n)))?a[n]=DBaseTypes.NUMBER:e.every((e=>"boolean"==typeof s(e,n)||void 0===s(e,n)))&&e.some((e=>"boolean"==typeof s(e,n)))?a[n]=DBaseTypes.BOOLEAN:a[n]=DBaseTypes.STRING}return a}function _getDBaseGeometries(e){return e.map((e=>{if(isPoint(e)){const{x:t,y:r,z:o,m:a}=e,n=[t,r];return e.hasZ&&n.push(o),e.hasM&&n.push(a),_padZValues(n,e)}if(isMultipoint(e))return _padZValuesArray(e.points,e);if(isPolyline(e))return _padZValues2DArray(e.paths,e);if(isPolygon(e))return _padZValues2DArray(e.rings,e);if(isExtent(e)){const t=[e.xmin,e.ymax];return[[t,[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin],t]]}throw new Error("Unsupported geometry type.")}))}function _padZValues(e,t){return 3===e.length&&!t.hasZ&&t.hasM?[e[0],e[1],void 0,e[2]]:e}function _padZValuesArray(e,t){return e.map((e=>_padZValues(e,t)))}function _padZValues2DArray(e,t){return e.map((e=>_padZValuesArray(e,t)))}function _getDbaseValues(e,t,r,o){const a=[];for(const n of e){const e={};for(const a of t){let t=_getAttributeValue(n,a,o);if(null==t&&(t=""),o.useFormattedValues)t=t.toString();else{t=getDbaseValue(t,r[a],o)}e[a]=t}a.push(e)}return a}function getDbaseValue(e,t,r){switch(t){case DBaseTypes.NUMBER:return e instanceof Date?e.getTime():parseNumber(e);case DBaseTypes.STRING:return e instanceof Date?formatDate({format:r.dateFormat??DateFormat.ROUND_TRIP,timeZone:"UTC"},e):"number"==typeof e?formatNumber(r.numberFormat??NumberFormat.DEFAULT,e):e.toString();case DBaseTypes.BOOLEAN:return!!e;case DBaseTypes.DATE:return parseDate(e);default:return e.toString()}}function _parseShapefileNames(e){if(!e.length)return[];let t=e[0];const r=t.match(shapefileNameRegex);return r?(t=r[1],e.filter((e=>{const r=e.match(shapefileNameRegex);return r&&r[1]===t}))):[t]}function _parseDBaseData(e){const t=e.map((e=>Object.keys(e))).reduce(((e,t)=>e.concat(t.filter((t=>!e.includes(t))))),[]);return[t.map((e=>({raw:e}))),...e.map((e=>t.map((t=>({raw:e[t]})))))]}function _parseShpPointGeometry(e){checkArg("geometry.coordinates",e.type).matches("Point"),checkArg("geometry.coordinates",e.coordinates).satisfies((e=>"number"==typeof e||Array.isArray(e)));const[t,r,o]=e.coordinates,a=new Point({x:t,y:r,spatialReference:SpatialReference.WGS84});if(Array.isArray(o)){const[e,t]=o;!e&&!t||e?a.z=e:a.m=t}return a}async function _parseShpGeometry(e,t){const r=isPoint(e)?_parseShpPointGeometry(e):geoJSONToEsri(e);if(t){let e;try{const r=await esriWktToWkid(t);e=new SpatialReference({wkid:parseNumber(r)})}catch{}e||(e=new SpatialReference({wkt:t})),r.spatialReference=e}return r}
|
|
1
|
+
import e from"@arcgis/core/geometry/Point";import t from"@arcgis/core/geometry/SpatialReference";import{translate as r}from"../locale/language.js";import{toEsriApiGeometry as o,toPortalGeometry as n}from"../portal/Geometry.js";import{checkArg as a,assertNever as i}from"../utilities/checkArg.js";import{parse as s,format as m,DEFAULT_PARSING_FORMATS as c,DateFormat as l,INVALID_DATE as u}from"../utilities/date.js";import{esriToWKT as f,esriToGeoJSON as y,geoJSONToEsri as d,wktToEsri as p,esriWkidToWkt as g,esriWktToWkid as h,project as w,isPoint as F,isMultipoint as N,isPolyline as S,isPolygon as T,isExtent as O}from"../utilities/geometry.js";import{getLogger as R}from"../utilities/log.js";import{parse as G,format as b,NumberFormat as E,isNumeric as x}from"../utilities/number.js";import{Feature as A}from"./Feature.js";import{FeatureSet as M}from"./FeatureSet.js";const D=["=","-","+","@"],I='"',_=/[^a-zA-Z\d_]/g,v="\r\n",C="\n",L="sheet1",P=[...c.map(le),"M/d/yy"],$=/(\w+)_(point|multipoint|polyline|polygon)z?/;var U;function W(){return R("geocortex.api.data.convert")}!function(e){e.DATE="D",e.NUMBER="N",e.STRING="C",e.BOOLEAN="L"}(U||(U={}));export var GeometryFormat;!function(e){e.NONE="NONE",e.WKT="WKT",e.XY="XY",e.XYZ="XYZ",e.LAT_LON="LAT_LONG",e.GEO_JSON="GEO_JSON",e.ARCGIS_JSON="ARCGIS_JSON"}(GeometryFormat||(GeometryFormat={}));export async function toCsv(e,r){a("featureSet",e).isNotMissing();const o=Array.from(e),n={...{useFormattedValues:!1,alwaysQuote:!1,escapeFormulaChars:!0,delimiter:",",dateFormat:l.ROUND_TRIP,geometryFormat:o.some((e=>void 0!==e.geometry&&null!==e.geometry))?GeometryFormat.WKT:GeometryFormat.NONE,includeByteOrderMark:!0,outSpatialReference:t.WGS84,includeHeaderRow:!0,outFields:z(e.source),rowDelimiter:navigator.platform.startsWith("Win")?v:C},...r},{includeByteOrderMark:i,includeHeaderRow:s,delimiter:m,outFields:c,rowDelimiter:u}=n,f=[];i&&f.push("\ufeff");const y=X(o,n),d=j(o,c,e.schema,!0),p=j(o,c,e.schema,!1);if(s){const e=[];for(const t of y)e.push(k(t,n));for(const t of d)e.push(k(t,n));for(const t of p)e.push(k(t,n));const t=e.join(m)+u;f.push(t)}await Promise.all(o.map((async e=>{const t=[],r=(t,r)=>k(H(K(e,t,r),r),r);t.push(...await async function(e,t){let r=await Y(e,t);t.geometryFormat!==GeometryFormat.XYZ&&t.geometryFormat!==GeometryFormat.XY&&t.geometryFormat!==GeometryFormat.LAT_LON||(r=r.map((e=>void 0===e?"":H(e,t))));return r.map((e=>""===e?"":k(e,t)))}(e.geometry,n)),t.push(...d.map((e=>r(e,n)))),t.push(...p.map((e=>r(e,n))));const o=`${t.join(m)}${u}`;f.push(o)})));return new Blob(f,{type:"text/plain",endings:u===C||u===v?"transparent":"native"})}export async function csvToFeatureSet(e,r){let o;if(a("csvData",e).isNotMissing(),e instanceof Blob){const t=new Promise(((t,r)=>{const o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{r(o.error)},o.readAsText(e)}));o=await t}else o=e;const n={...{delimiter:",",escapeFormulaChars:!0,includeHeaderRow:!0,outFields:["*"],inSpatialReference:t.WGS84,generatePrimaryKey:!0,primaryKeyField:"OBJECTID"},...r,detectOid:!r?.primaryKeyField},i=function(e,t,r){const o=[],n=(e,t)=>{const o=[];return q(e,r,((r,n)=>{const a=e.substring(r,n);return o.push({raw:V(a,t,o.length)}),!0})),o};if(q(e,t,((t,r)=>{const a=e.substring(t,r);return a.length>0&&o.push(n(a,o.length)),!0})),o.length){const e=o[0].length;o.forEach(((t,r)=>{if(t.length!==e)throw new Error(`Detected invalid CSV: Row ${r} does not have expected number of columns: ${e}`)}))}return o}(o,n.rowDelimiter||function(e){let t=C;return q(e,v,((r,o)=>(0===r&&o===e.length||(t=v),!1))),t}(o),n.delimiter),s=ae(i,n),m=ie(i,s,n),c=await me(i,s,m,n);return new M({features:c,schema:m})}export async function toXLSX(e,r){a("featureSet",e).isNotMissing();const o=Array.from(e),n={...{useFormattedValues:!1,includeHeaderRow:!0,escapeFormulaChars:!0,geometryFormat:o.some((e=>void 0!==e.geometry&&null!==e.geometry))?GeometryFormat.WKT:GeometryFormat.NONE,outFields:z(e.source),outSpatialReference:t.WGS84,dateFormat:l.DEFAULT,numberFormat:E.DEFAULT,sheetName:L},...r},{outFields:i,includeHeaderRow:s,numberFormat:m}=n,c=[],u=X(o,n),f=j(o,i,e.schema,!0),y=j(o,i,e.schema,!1);if(s){const t=u.concat(f).concat(function(e,t){const r=t?.schema?.fieldExtensions.initializedItems.map((e=>e.field));return e.map((e=>r?.find((t=>t.name===e))?.alias??e))}(y,e.source));c.push(t)}await Promise.all(o.map((async e=>{const t=[];t.push(...await Y(e.geometry,n));for(const r of f){const o=fe(e.attributes.get(r),n);t.push(o)}for(const r of y){const o=fe(K(e,r,n),n);t.push(o)}t.every((e=>"string"!=typeof e||e.length<=32767))?c.push(t):W().warn(`toXLSX cell limit exceeded, feature (${e.primaryKey??e.id}) omitted.`)})));const d=await import("xlsx"),p={SheetNames:[],Sheets:{}},g=d.utils.aoa_to_sheet(c,{cellDates:!0});for(const e of Object.keys(g).filter((e=>!e.startsWith("!")))){const t=g[e];"d"===t.t?t.z=le(n.dateFormat??l.ROUND_TRIP):"n"===t.t&&(t.z=ue(m))}p.SheetNames.push(n.sheetName),p.Sheets[n.sheetName]=g;const h=d.write(p,{type:"binary",bookType:"xlsx",compression:!0,bookSST:!0,cellDates:!0}),w=new Uint8Array(h.length);for(let e=0;e<h.length;e++)w[e]=h.charCodeAt(e);return new Blob([w.buffer],{type:"text/plain"})}export async function xlsxToFeatureSet(e,r){a("xlsxData",e).isNotMissing();const o={...{includeHeaderRow:!0,escapeFormulaChars:!0,outFields:["*"],inSpatialReference:t.WGS84,generatePrimaryKey:!0,primaryKeyField:"OBJECTID"},...r,detectOid:!r?.primaryKeyField},n=await async function(e,t){const r=await import("xlsx"),o=new Promise(((o,n)=>{const a=new FileReader;a.onload=()=>{const e=new Uint8Array(a.result);let n="";for(const t of e)n+=String.fromCharCode(t);const i=r.read(n,{type:"binary",cellDates:!0}),s=t.sheetName||i.SheetNames[0],m=i.Sheets[s];o(m)},a.onerror=()=>{n(a.error)},a.readAsArrayBuffer(e)})),n=await o,a=r.utils.decode_range(n["!ref"]),i=[];for(let e=a.s.r;e<=a.e.r;e++){const t=[];for(let o=a.s.c;o<=a.e.c;o++){const a=n[`${r.utils.encode_cell({r:e,c:o})}`];t.push(a?{raw:a.v,formatted:"s"===a.t?void 0:a.w}:{raw:""})}i.push(t)}return i}(e,o),i=ae(n,o),s=ie(n,i,o),m=await me(n,i,s,o);return new M({features:m,schema:s})}export async function toShapefile(e,r){a("featureSet",e).isNotMissing();const[{default:o},n]=await Promise.all([import("jszip"),import("../forked-libs/shp-write/index.js")]),i=Array.from(e),s={...{useFormattedValues:!1,outFields:z(e.source),fileName:e.title||"export"},...r},{outFields:m,outSpatialReference:c,fileName:l}=s,u=e=>e.geometry.hasZ||e.geometry.hasM,f=new Map,y=i.filter((e=>F(e.geometry)));f.set("POINTZ",y.filter(u)),f.set("POINT",y.filter((e=>!u(e))));const d=i.filter((e=>N(e.geometry)));f.set("MULTIPOINTZ",d.filter(u)),f.set("MULTIPOINT",d.filter((e=>!u(e))));const p=i.filter((e=>S(e.geometry)));f.set("POLYLINEZ",p.filter(u)),f.set("POLYLINE",p.filter((e=>!u(e))));const h=i.filter((e=>T(e.geometry)||O(e.geometry)));f.set("POLYGONZ",h.filter(u)),f.set("POLYGON",h.filter((e=>!u(e))));const w=j(i,m,e.schema,!0);let R=j(i,m,e.schema,!1);R=w.concat(R);const G=new o,b=Array.from(f.keys()).filter((e=>f.get(e).length>0));await Promise.all(b.map((async r=>{const o=f.get(r),a=await Promise.all(o.map((e=>B(e.geometry,c)))),i=await async function(e){const{wkid:r,wkt:o}=e[0].spatialReference;if(!e.every((e=>e.spatialReference.wkid===r&&e.spatialReference.wkt===o)))throw new Error("Cannot create shapefile that contains geometries with different spatial references.");return o??g(r??t.WGS84.wkid)}(a),m=s.useFormattedValues?Object.assign({},...R.map((e=>({[e]:U.STRING})))):function(e,t,r,o){const n={};for(const a of t){if(e.some((e=>Z(e,a)))){n[a]=U.STRING;continue}const t=r?r.fields.find((e=>e.name===a)):void 0;if(t){switch(t.type){case"oid":case"double":case"integer":case"single":case"small-integer":n[a]=U.NUMBER;break;case"date":n[a]=o?U.NUMBER:U.DATE;break;default:n[a]=U.STRING}continue}const i=(e,t)=>e.attributes.get(t)??e.presentableAttributes.get(t);e.every((e=>i(e,a)instanceof Date||void 0===i(e,a)))&&e.some((e=>i(e,a)instanceof Date))?n[a]=o?U.NUMBER:U.DATE:e.every((e=>"number"==typeof i(e,a)||void 0===i(e,a)))&&e.some((e=>"number"==typeof i(e,a)))?n[a]=U.NUMBER:e.every((e=>"boolean"==typeof i(e,a)||void 0===i(e,a)))&&e.some((e=>"boolean"==typeof i(e,a)))?n[a]=U.BOOLEAN:n[a]=U.STRING}return n}(o,R,e.schema,"timestamp"===s.dateFormat),u=function(e){return e.map((e=>{if(F(e)){const{x:t,y:r,z:o,m:n}=e,a=[t,r];return e.hasZ&&a.push(o),e.hasM&&a.push(n),ye(a,e)}if(N(e))return de(e.points,e);if(S(e))return pe(e.paths,e);if(T(e))return pe(e.rings,e);if(O(e)){const t=[e.xmin,e.ymax];return[[t,[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin],t]]}throw new Error("Unsupported geometry type.")}))}(a),y=function(e,t,r,o){const n=[];for(const a of e){const e={};for(const n of t){let t=K(a,n,o);if(null==t&&(t=""),o.useFormattedValues)t=t.toString();else{t=ge(t,r[n],o)}e[n]=t}n.push(e)}return n}(o,R,m,s);n.write(y,r,u,((e,t)=>{const o=b.length>1?`${l}_${r.toLowerCase()}`:l;G.file(`${o}.shp`,t.shp.buffer,{binary:!0}),G.file(`${o}.shx`,t.shx.buffer,{binary:!0}),G.file(`${o}.dbf`,t.dbf.buffer,{binary:!0}),G.file(`${o}.prj`,i)}))})));const E=await G.generateAsync({type:"uint8array"});return new Blob([E.buffer],{type:"text/plain"})}export async function shapefileToFeatureSet(e,t){a("shapefileData",e).isNotMissing();const r={outFields:["*"],includeHeaderRow:!0,generatePrimaryKey:!0,primaryKeyField:"OBJECTID",...t,detectOid:!t?.primaryKeyField},o=new Promise(((t,r)=>{const o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{r(o.error)},o.readAsArrayBuffer(e)})),[{default:n},{default:i}]=await Promise.all([import("jszip"),import("shpjs")]),s=await o,m=await n.loadAsync(new Uint8Array(s)),c=m.filter((()=>!0)).map((e=>e.name));let l,u=c.filter((e=>e.endsWith(".shp"))).map((e=>e.substring(0,e.length-4)));if(u=function(e){if(!e.length)return[];let t=e[0];const r=t.match($);return r?(t=r[1],e.filter((e=>{const r=e.match($);return r&&r[1]===t}))):[t]}(u),c.some((e=>e.endsWith(".prj")))&&!u.every((e=>c.includes(`${e}.prj`))))throw new Error("Shapefile zip must contain the same prj file for each separate shapefile");await Promise.all(c.filter((e=>e.endsWith(".prj"))).map((async e=>{const t=await m.file(e).async("string");if(l){if(t!==l)throw new Error("Shapefile zip must contain the same prj file for each separate shapefile")}else l=t})));const f={geometries:[],columnCount:0,columnIndex:0};let y=[];for(const e of u){if(!c.includes(`${e}.shx`)||!c.includes(`${e}.dbf`))throw new Error("Shapefile must contain shp, shx, and dbf files.");const t=await m.file(`${e}.shp`).async("uint8array"),r=i.parseShp(t),o=await m.file(`${e}.dbf`).async("uint8array"),n=i.parseDbf(o);if(n.length!==r.length)throw new Error("Shapefile must contain shp, shx, and dbf files.");const a=await Promise.all(r.map((e=>he(e,l))));f.geometries=f.geometries.concat(a),y=y.concat(n)}const d=function(e){const t=e.map((e=>Object.keys(e))).reduce(((e,t)=>e.concat(t.filter((t=>!e.includes(t))))),[]);return[t.map((e=>({raw:e}))),...e.map((e=>t.map((t=>({raw:e[t]})))))]}(y),p=ie(d,f,r),g=await me(d,f,p,r);return new M({features:g,schema:p})}function X(e,t){return t.geometryFormat===GeometryFormat.XYZ?["x","y","z"]:t.geometryFormat===GeometryFormat.XY?["x","y"]:t.geometryFormat===GeometryFormat.LAT_LON?["latitude","longitude"]:t.geometryFormat===GeometryFormat.NONE?[]:["geometry"]}function j(e,t,r,o){const n=r.fields.filter((e=>"oid"===e.type)).map((e=>e.name)).toArray();if(o)return n;if(t&&!t.includes("*"))return t.filter((e=>!n.includes(e)));{const t=r.fields.filter((e=>"oid"!==e.type)).map((e=>e.name)).toArray();let o=[];for(const r of e)for(const e of r.attributes.keys())t.includes(e)||n.includes(e)||o.includes(e)||o.push(e);return o=o.sort(),t.concat(o)}}function z(e){if(!e)return["*"];const t=e.featureSettings.popupTemplate?.content;return(Array.isArray(t)?t.find((e=>"fields"===e.type))?.fieldInfos?.filter((e=>e.visible))?.map((e=>e.fieldName)):void 0)??e.featureSettings.popupTemplate?.fieldInfos?.filter((e=>e.visible))?.map((e=>e.fieldName))??["*"]}async function Y(e,t){const r=await B(e,t.outSpatialReference);if(t.geometryFormat===GeometryFormat.XYZ){if(!r)return["","",""];if(!F(r))throw new Error("Cannot use geometry format XYZ with non-point geometry");return[r.x,r.y,r.z]}if(t.geometryFormat===GeometryFormat.XY){if(!r)return["",""];if(!F(r))throw new Error("Cannot use geometry format XY with non-point geometry");return[r.x,r.y]}if(t.geometryFormat===GeometryFormat.LAT_LON){if(!r)return["",""];if(!F(r))throw new Error("Cannot use geometry format LAT_LONG with non-point geometry");return[r.y,r.x]}return t.geometryFormat===GeometryFormat.ARCGIS_JSON?r?[JSON.stringify(n(r))]:[""]:t.geometryFormat===GeometryFormat.WKT?r?[f(r)]:[""]:t.geometryFormat===GeometryFormat.GEO_JSON?r?[JSON.stringify(y(r))]:[""]:[]}async function B(e,t){return e?.spatialReference&&!e.spatialReference.equals(t)&&t?(await w([e],t))[0]:e}function k(e,t){const r=[t.delimiter,I,"\r","\n",t.rowDelimiter];if(t.alwaysQuote||r.some((t=>e.includes(t)))){const t=e.replace(new RegExp(I,"g"),`${I}${I}`);return`${I}${t}${I}`}return e}function H(e,t){if(null==e)return"";if(!t.useFormattedValues){if("number"==typeof e){const r=t.numberFormat||E.ROUND_TRIP;return b(r,e)}if(e instanceof Date)return"timestamp"===t.dateFormat?e.getTime().toString():m({format:t.dateFormat,timeZone:"UTC"},e)}let r=e.toString();return t.escapeFormulaChars&&(r=J(r)),r}function K(e,t,r){if(r.useFormattedValues||Z(e,t))return e.presentableAttributes.get(t)??e.attributes.get(t);if("date"===e.schema.findFieldByName(t)?.type){const r=s(e.attributes.get(t));if(!isNaN(r.getTime()))return r}return e.attributes.get(t)??e.presentableAttributes.get(t)}function Z(e,t){return t===e.schema.typeIdField||("coded-value"===e.type?.domains?.[t]?.type||"coded-value"===e.schema.findFieldByName(t)?.domain?.type)}function J(e){for(const t of D)if(e.startsWith(t))return`\t${e}`;return e}function V(e,t,r){const o=e.startsWith(I),n=e.endsWith(I);if(o&&!n||!o&&n)throw new Error(`Detected invalid CSV: Missing opening or closing quote for value at row:${t} column:${r}`);const a=o?e.substring(I.length,e.length-I.length):e;let i=-1;return q(a,I,((e,o)=>{if(o===a.length)return!0;if(i<0){if(o!==a.length)return i=o,!0}else if(o===i+I.length)return i=-1,!0;throw new Error(`Detected invalid CSV: Non-escaped quote for value at row:${t} column:${r}`)})),a.replace(new RegExp(`${I}${I}`,"g"),I)}function q(e,t,r){let o,n=!1,a=0,i=0;for(;o=e.indexOf(t,a),!(o<0);){for(let t=a;t<o;)e.substring(t).startsWith(I)?(n=!n,t+=I.length):t++;const s=o+t.length;if(!n){const e=r(i,o);if(i=s,!e)break}a=s}r(i,e.length)}const Q={[GeometryFormat.XYZ]:[["x","y","z"]],[GeometryFormat.XY]:[["x","y"]],[GeometryFormat.LAT_LON]:[["lat","lon"],["lat","long"],["latitude","longitude"]],[GeometryFormat.ARCGIS_JSON]:[["geometry"]],[GeometryFormat.GEO_JSON]:[["geometry"]],[GeometryFormat.WKT]:[["geometry"]]};function ee(e,t){const r=JSON.parse(e),n=o(r);return r.spatialReference||(n.spatialReference=t),n}function te(e,t){const r=d(JSON.parse(e));return r.spatialReference=t,r}function re(e,t){const r=p(e);return r.spatialReference=t,r}function oe(e,t){const r=Q[t];for(const t of r){const r=e.findIndex(((r,o)=>!(o+t.length>e.length)&&t.every(((t,r)=>e[o+r].raw.toString().toLowerCase()===t))));if(-1!==r)return r}}function ne(e,t){return e.map(((e,r)=>{const o=e?.raw;if("string"==typeof o&&""!==o)try{return t(o,void 0),r}catch{return}})).find((e=>void 0!==e))}function ae(t,r){const o=r.includeHeaderRow?t.slice(1):t;if(r.geometryFormat===GeometryFormat.NONE)return{columnCount:0,columnIndex:0};const n=(t,n)=>{const a=n===GeometryFormat.XYZ,i=n===GeometryFormat.LAT_LON,s=a?3:2;return{columnCount:s,columnIndex:t,geometries:o.map((o=>{if(o.length>=t+s&&x(o[t+0].raw)&&x(o[t+1].raw)&&(!a||x(o[t+2].raw)))return new e({x:G(i?o[t+1].raw:o[t+0].raw),y:G(i?o[t+0].raw:o[t+1].raw),z:a?G(o[t+2].raw):0,spatialReference:r.inSpatialReference})}))}},a=(e,t)=>({columnCount:1,columnIndex:e,geometries:o.map((t=>t[e])).map((e=>{if(""!==e.raw)return t(e.raw.toString(),r.inSpatialReference)}))});if(r.geometryFormat){const e=oe(t[0],r.geometryFormat);if(r.includeHeaderRow&&void 0===e)throw new Error(`Error parsing CSV: Expected geometry columns ${Q[r.geometryFormat][0].join(",")} are missing for GeometryType.${r.geometryFormat}`);return((e,t)=>{switch(t){case GeometryFormat.NONE:return{columnCount:0,columnIndex:0};case GeometryFormat.LAT_LON:case GeometryFormat.XYZ:case GeometryFormat.XY:return n(e,t);case GeometryFormat.ARCGIS_JSON:return a(e,ee);case GeometryFormat.GEO_JSON:return a(e,te);case GeometryFormat.WKT:return a(e,re);default:return i(t,new Error(`Unknown geometry format "${t}".`))}})(e??0,r.geometryFormat)}if(r.includeHeaderRow){const e=oe(t[0],GeometryFormat.ARCGIS_JSON);if(void 0!==e)for(const t of[ee,te,re])try{return a(e,t)}catch(e){}const r=[GeometryFormat.XYZ,GeometryFormat.XY,GeometryFormat.LAT_LON];for(const e of r){const r=oe(t[0],e);if(void 0!==r)return n(r,e)}}for(const e of[ee,te,re])try{const t=ne(o[0],e);return a(t,e)}catch(e){}return{columnCount:0,columnIndex:0}}function ie(e,t,o){const n={fields:[]};let a=0;for(let s=0;s<e[0].length;s++){if(i=s,0!==t.columnCount&&i>=t.columnIndex&&i<t.columnIndex+t.columnCount)continue;const m=se(e,s,o);let c=e[0][s].raw.toString(),l=c.replace(_,"_");if(o.includeHeaderRow||(l="field"+ ++a,c=r("gcx.api.data.convert.import-field-alias",a)),!l)throw new Error("Error parsing CSV or XLSX: Header cannot contain blank values");n.fields.push({alias:c,name:l,type:m})}var i;if(n.spatialReference=o.outSpatialReference,t.geometries?.length){const e=t.geometries.filter((e=>void 0!==e)).map((e=>e.type)),r=e[0];n.geometryType=e.every((e=>e===r))?r:void 0}if(o.generatePrimaryKey&&!n.fields.find((e=>"esriFieldTypeOID"===e.type))){const e=n.fields.length+1,t=!!n.fields.find((e=>"id"===e.name.toLowerCase()));n.fields.push({name:t?`field${e}`:"id",alias:t?r("gcx.api.data.convert.import-field-alias",e):"id",type:"esriFieldTypeOID"})}return n}function se(e,t,r){let o=!1,n=!0,a=!0,i=!0;const m=new Set,l=r.includeHeaderRow?e[0]:[],f=r.includeHeaderRow?e.slice(1):e;for(const e of f){const l=e[t];""!==l.raw&&(m.add(l.raw),o=!0,n&&(n=x(l.raw)||Number.isNaN(l.raw)),a&&(a=l.raw instanceof Date||s(r.dateFormat||c,l.raw)!==u),i&&(i=s(r.dateFormat||P,l.formatted)!==u))}const y=m.size===f.length;return r.primaryKeyField&&l[t]?.raw===r.primaryKeyField||r.detectOid&&o&&y&&n?(r.detectOid=!1,"esriFieldTypeOID"):o&&i?"esriFieldTypeDate":o&&n?"esriFieldTypeDouble":o&&a?"esriFieldTypeDate":"esriFieldTypeString"}async function me(e,t,r,o){const n=[],a=o.includeHeaderRow?e.slice(1):e,i=(e,r)=>0===t.columnCount||(r<t.columnIndex||r>=t.columnIndex+t.columnCount);return await Promise.all(a.map((async(e,a)=>{const s=new A;for(let t=0;t<r.fields.length;t++){const n=r.fields[t],m=e.filter(i);if(o.outFields.includes("*")||o.outFields.includes(n.name)){let e=await ce(m[t]?.raw,n,o);"esriFieldTypeOID"===n.type&&null===e&&(e=a),s.attributes.set(n.name,e)}}t.geometries&&(s.geometry=await B(t.geometries[a],o.outSpatialReference)),n.push(s)}))),n}async function ce(e,t,r){if("esriFieldTypeDouble"===t.type||"esriFieldTypeOID"===t.type)return"number"==typeof e?e:e?G(e):null;if("esriFieldTypeDate"===t.type){if(e instanceof Date)return e.getTime();if("number"==typeof e){const t=(await import("xlsx")).SSF.parse_date_code(e);return t?new Date(t.y,t.m-1,t.d,t.H,t.M,t.S).getTime():void 0}return""===e?null:s(e).getTime()}const o=e.toString();if(r.escapeFormulaChars&&o.startsWith("\t"))for(const e of D)if(o.length>1&&o.charAt(1)===e)return o.substring(1);return o}function le(e){switch(e){case l.DATE_SHORT:return"dd/MM/yyyy";case l.DATE_LONG:return"MMMM d, yyyy";case l.TIME_SHORT:return"h:mm AM/PM";case l.TIME_LONG:return"h:mm:ss AM/PM";case l.DATE_TIME_SHORT:case l.DEFAULT:return"MMM d yyyy h:mm AM/PM";case l.DATE_TIME_LONG:return"MMMM d yyyy h:mm AM/PM";case l.FULL:return"dddd, MMMM d yyyy h:mm AM/PM";case l.ISO_8601:case l.ROUND_TRIP:return'yyyy-MM-dd"T"HH:mm:ss';default:{const t=e.replace(/tt/g,"AM/PM");return t.includes("z")&&W().warn("Warning: Excel will not recognize timezone format 'z', 'zz', or 'zzz'"),t.includes("h")&&!t.includes("AM/PM")&&W().warn("Warning: Excel will interpret 'h' as 'H' if the format does not have an AM/PM designator"),t}}}function ue(e){switch(e){case E.ACCOUNTING:return'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)';case E.CURRENCY:return'"$"#,##0.00';case E.FIXED_POINT:case E.DEFAULT:return"0.0000";case E.NUMBER:return"#,##0.0000";case E.PERCENT:return"0%";case E.ROUND_TRIP:return"0.00000";default:return e}}function fe(e,t){if(null==e)return"";if(!t.useFormattedValues){if("number"==typeof e)return e;if(e instanceof Date)return"timestamp"===t.dateFormat?e.getTime():e}let r=e.toString();return t.escapeFormulaChars&&(r=J(r)),r}function ye(e,t){return 3===e.length&&!t.hasZ&&t.hasM?[e[0],e[1],void 0,e[2]]:e}function de(e,t){return e.map((e=>ye(e,t)))}function pe(e,t){return e.map((e=>de(e,t)))}function ge(e,t,r){switch(t){case U.NUMBER:return e instanceof Date?e.getTime():G(e);case U.STRING:return e instanceof Date?m({format:r.dateFormat??l.ROUND_TRIP,timeZone:"UTC"},e):"number"==typeof e?b(r.numberFormat??E.DEFAULT,e):e.toString();case U.BOOLEAN:return!!e;case U.DATE:return s(e);default:return e.toString()}}async function he(r,o){const n=F(r)?function(r){a("geometry.coordinates",r.type).matches("Point"),a("geometry.coordinates",r.coordinates).satisfies((e=>"number"==typeof e||Array.isArray(e)));const[o,n,i]=r.coordinates,s=new e({x:o,y:n,spatialReference:t.WGS84});if(Array.isArray(i)){const[e,t]=i;!e&&!t||e?s.z=e:s.m=t}return s}(r):d(r);if(o){let e;try{const r=await h(o);e=new t({wkid:G(r)})}catch{}e||(e=new t({wkt:o})),n.spatialReference=e}return n}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError}from"../../ArgumentError.js";import{ArcGISRelationship}from"../../tasks/query/ArcGISRelationship.js";import{QueryBasedRelationship}from"../../tasks/query/QueryBasedRelationship.js";import{checkArg}from"../../utilities/checkArg.js";export class DefaultRelationshipFactory{create(
|
|
1
|
+
import{ArgumentError as e}from"../../ArgumentError.js";import{ArcGISRelationship as i}from"../../tasks/query/ArcGISRelationship.js";import{QueryBasedRelationship as r}from"../../tasks/query/QueryBasedRelationship.js";import{checkArg as t}from"../../utilities/checkArg.js";export class DefaultRelationshipFactory{create(s){switch(t("properties",s).isNotMissing(),t("properties.$relationshipType",s.$relationshipType).isNotMissing(),s.$relationshipType){case"QueryBasedRelationship":return new r(s);case"ArcGISRelationship":return new i(s)}throw new e("properties.$relationshipType","Unsupported relationship type.")}}DefaultRelationshipFactory.instance=new DefaultRelationshipFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError}from"../../ArgumentError.js";import{checkArg}from"../../utilities/checkArg.js";import{isFeatureLayer}from"../../utilities/layers.js";import{ArcGISServiceTableExtension}from"../ArcGISServiceTableExtension.js";export class DefaultTableExtensionFactory{create(
|
|
1
|
+
import{ArgumentError as e}from"../../ArgumentError.js";import{checkArg as t}from"../../utilities/checkArg.js";import{isFeatureLayer as r}from"../../utilities/layers.js";import{ArcGISServiceTableExtension as i}from"../ArcGISServiceTableExtension.js";export class DefaultTableExtensionFactory{create(o){if(t("properties",o).isNotMissing(),t("properties.table",o.table).isNotMissing(),r(o.table))return new i(o);if(o.table.$tableType&&"ArcGISServiceTable"===o.table.$tableType)return new i(o);throw new e("properties.table","Unable to determine correct type of table extension to create.")}}DefaultTableExtensionFactory.instance=new DefaultTableExtensionFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ArgumentError}from"../../ArgumentError.js";import{InvalidOperationError}from"../../InvalidOperationError.js";import{isLayerExtension,isTableExtension}from"../../ItemType.js";import{DefaultArcGISRequestHelper}from"../../support/ArcGISRequestHelper.js";import{checkArg}from"../../utilities/checkArg.js";import{isFeatureLayerExtension,isSubtypeGroupLayerExtension,isSubtypeSublayerExtension}from"../../utilities/extensions.js";import{isFeatureLayer,isSubtypeGroupLayer,isSubtypeSublayer}from"../../utilities/layers.js";import{toGraphic}from"../Feature.js";const
|
|
1
|
+
import{ArgumentError as t}from"../../ArgumentError.js";import{InvalidOperationError as e}from"../../InvalidOperationError.js";import{isLayerExtension as r,isTableExtension as a}from"../../ItemType.js";import{DefaultArcGISRequestHelper as o}from"../../support/ArcGISRequestHelper.js";import{checkArg as s}from"../../utilities/checkArg.js";import{isFeatureLayerExtension as n,isSubtypeGroupLayerExtension as i,isSubtypeSublayerExtension as c}from"../../utilities/extensions.js";import{isFeatureLayer as p,isSubtypeGroupLayer as m,isSubtypeSublayer as h}from"../../utilities/layers.js";import{toGraphic as l}from"../Feature.js";const u=new o;export async function toAttachmentFile(t,e){let r;if(t instanceof File)r=t;else if(t?.url)try{const e=await u.request(t.url,{responseType:"blob"});r=new File([e.data],t.title,{type:t.contentType})}catch(t){throw new Error(`${`${e} `??""}Failed to fetch attachment from url.`,{cause:t})}if(!r)throw new Error(`${`${e} `??""}No attachment data found.`);return r}export function supportsAttachments(t){if(c(t)){const e=t.sublayer?.layer;return m(e)&&e.capabilities?.data?.supportsAttachment}return(n(t)||i(t))&&(p(t.layer)||m(t.layer))&&!!t.layer.capabilities?.data?.supportsAttachment}export function supportsAttachmentEditing(t){const e=h(t)?t.layer:t;return(p(e)||m(e))&&!!e.capabilities?.data?.supportsAttachment&&(e.capabilities.operations?.supportsUpdate||e.capabilities.operations?.supportsAdd)}export async function addAttachment(o,n,i,c){if(s("feature",o).isDefined(),s("layer",n).isDefined(),s("attachment",i).isDefined(),r(o.source)&&o.source.layer!==n||a(o.source)&&o.source.table!==n)throw new t("layer","The feature's source layer/table does not match the layer.");if(!supportsAttachmentEditing(n))throw new e("Cannot add attachment; the Table does not support attachments.");const p=`Failed to add attachment to ${o.primaryKey??o.id} of source ${o.source?.title??o.source?.id}.`,m=await toAttachmentFile(i,p),h=m.name?.split(".").pop()?.toLowerCase();if(c?.attachmentTypes&&!function(t,e){if(!e.map((t=>t.toLowerCase())).includes(t.type.toLowerCase())){const r=e.filter((t=>!t.includes("/"))).map((t=>t.toLowerCase())),a=t.name?.split(".").pop()?.toLowerCase();return r.includes(a)}return!0}(m,c.attachmentTypes))throw new t("attachment",`The attachment type '${h}' does not exist in the set of accepted attachment types: ${c.attachmentTypes}.`);let u;const d=new FormData;d.append("attachment",m,m.name);try{const t=await n.addAttachment(l(o),d);if(t.error)throw new Error(t.error.message);u=`${t.objectId}`}catch(t){throw new Error(p,{cause:t})}return await o.fetchAttachments(),o.attachments.find((t=>t.id===u))}export function isAttachmentTypeError(t){return ATTACHMENT_TYPE_ERROR_REGEX.test(t.message)}export const ATTACHMENT_TYPE_ERROR_REGEX=/^The attachment type .+ does not exist in the set of accepted attachment types: .+.$/;export async function deleteAttachments(o,n,i){if(s("feature",o).isDefined(),s("layer",n).isDefined(),s("attachments",i).isDefined(),r(o.source)&&o.source.layer!==n||a(o.source)&&o.source.table!==n)throw new t("layer","The feature's source layer/table does not match the layer.");if(!supportsAttachmentEditing(n))throw new e("Cannot delete attachments; the layer/table does not support attachments.");const c=`Failed to delete attachment(s) from ${o.primaryKey??o.id} of source ${o.source?.title??o.source?.id}.`;try{const t=await n.deleteAttachments(l(o),i.map((t=>"string"==typeof t?+t:+t.id)));if(t?.length>1){const e=t.filter((t=>t.error));if(e.length>0)throw new AggregateError(e.map((t=>new Error(t.error.message))))}else if(t?.[0].error)throw new Error(t?.[0].error.message)}catch(t){throw new Error(c,{cause:t})}await o.fetchAttachments()}
|