import{__decorate as e}from"tslib";import{InvalidOperationError as r}from"../InvalidOperationError.js";import{serializable as t}from"../support/Serializable.js";import{isKMLSublayer as s}from"../utilities/_layers.js";import{checkArg as n}from"../utilities/checkArg.js";import{SublayerExtension as a,SubSublayerExtensionCollection as o}from"./_SublayerExtension.js";const i="KML sublayers cannot be created or configured from JSON. They must be created with an ESRI KMLSublayer object.",u="SublayerExtension collection for KMLLayerExtension is readonly";let l=class extends a{get sublayer(){return super.sublayer}get layerExtension(){return super.layerExtension}get sublayerExtensions(){return super.sublayerExtensions}get supportsSublayers(){return!0}get hasFeatures(){return!1}get canChangeScale(){return!1}constructor(e){super(e);const t=e?.sublayer;if(!this.sublayer&&!t?.$ref)throw new r(i)}_capabilities(){return{...super._capabilities(),supportsStandardizedQueries:!0}}_isSupportedSublayer(e){return s(e)}_createSublayerExtension(e){return a.factory.create(e,"KMLSublayer")}_createSublayer(e){throw new r(i)}async _applySublayerProperties(e,r){}_createSublayerExtensionCollection(){return new y(this)}_serializeSublayer(e){return this._createSublayerRef()}};l=e([t],l);export{l as KMLSublayerExtension};class y extends o{get _layerExtension(){return super._layerExtension}add(e,t){if(n("sublayerX",e).isNotMissing(),e.sublayer&&this._parent.sublayer.sublayers&&!this._parent.sublayer.sublayers.includes(e.sublayer))throw new r(u);return super.add(e,t)}removeAt(e){throw new r(u)}reorder(e,t){throw new r(u)}reverse(){throw new r(u)}sort(e){throw new r(u)}splice(e,t,...s){throw new r(u)}_createClone(){return new y(this._parent)}_createSublayerExtension(e){return this._layerExtension._createSublayerExtension(e)}}