import{__decorate as e}from"tslib";import{layerToJson as r}from"../json/LayerJson.js";import{serializable as t}from"../support/Serializable.js";import{notifyChange as i}from"../support/observableUtils.js";import{ReadOnlyCollection as n}from"../utilities/ReadOnlyCollection.js";import{isCSVLayer as s}from"../utilities/_layers.js";import{LayerExtension as a,LayerExtensionSchema as o}from"./_LayerExtension.js";import{ArrayWrappedCollection as l}from"./support/ArrayWrappedCollection.js";import{PopupTemplateFeatureSettings as p}from"./support/PopupTemplateFeatureSettings.js";let y=class extends a{get renderer(){return this.layer?.renderer}get hasFeatures(){return!0}get layer(){return super.layer}get canChangeLabels(){return!0}get canChangeRenderer(){return!0}get canChangeDefinitionExpression(){return!0}get _layerView(){return this.layer&&this.mapExtension?._allLayerViews.find((e=>e.layer===this.layer))}_getProjectWebmapJSON(){const e=super._getProjectWebmapJSON();if(!e||this.dynamicallyAddedLayer)return e;const{layerDefinition:t}=r(this.layer),{definitionExpression:i,drawingInfo:n}=t??{};return i&&(e.layerDefinition={...e.layerDefinition,definitionExpression:i}),n&&(e.layerDefinition={...e.layerDefinition,drawingInfo:n}),e}_capabilities(){return{...super._capabilities(),supportsStandardizedQueries:!0}}_getSerializableProperties(){const e=super._getSerializableProperties();return{...e,layer:{...this._toPropertyDef(e.layer),default:{layerType:"CSV"}}}}_isSupportedLayer(e){return s(e)}_createFeatureSettings(){return new p(this)}_createSchema(){return new u(this)}};y=e([t],y);export{y as CSVLayerExtension};let u=class extends o{_fieldsCollection;constructor(e){super(e),this._fieldsCollection=new n(new l({parent:e,targetProperty:"layer",arrayProperty:"fields"})),i(this,"_fields")}get _fields(){return this._fieldsCollection}_getPropertyBindings(){return{displayField:"displayField",spatialReference:"spatialReference",geometryType:"geometryType"}}};u=e([t],u);