import{InvalidOperationError as e}from"../../InvalidOperationError.js";import{ItemType as t}from"../../ItemType.js";import{FeatureSourceBase as s}from"../../data/FeatureSourceBase.js";import{Schema as r}from"../../data/Schema.js";const a="This class does not support retrieving features by ID.",i="This class does not support editing features.";export const ADDRESS_FIELD="_address";export class Geocoder extends s{title;addressSchema;defaultAddressValues;get capabilities(){return this._capabilities()}_itemType=t.GEOCODER;_capabilitiesInternal=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsBatch:!1,supportsReverse:!1,supportsSuggest:!1,maxResults:void 0,supportsAttachmentEditing:!1});constructor(e){super(e),this.addressSchema=this._createAddressSchema(),this.defaultAddressValues=new Map}getFeature(t,s){throw new e(a)}getFeatures(t,s){throw new e(a)}addFeature(t,s){throw new e(i)}addFeatures(t,s){throw new e(i)}updateFeature(t,s){throw new e(i)}updateFeatures(t,s){throw new e(i)}deleteFeature(t,s){throw new e(i)}deleteFeatures(t,s){throw new e(i)}_getSerializableProperties(){return{...super._getSerializableProperties(),title:"initial",addressSchema:"initial",defaultAddressValues:{serializeModes:["initial"],serialize:()=>{const e={};if(this.defaultAddressValues.size)for(const[t,s]of this.defaultAddressValues)e[t]=s;return e},deserialize:e=>{for(const t of Object.keys(e))this.defaultAddressValues.set(t,e[t])}}}}_createAddressSchema(){return new r}_capabilities(){return this._capabilitiesInternal}}export var GeocodeOptions;!function(e){e.DEFAULTS={outFields:["*"]},e.fromFeatureSource=function(e){return{outFields:e.featureSettings.outFields}}}(GeocodeOptions||(GeocodeOptions={}));