/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../chunks/_rollupPluginBabelHelpers","../../../chunks/tslib.es6","../../../core/Collection","../../../core/maybe","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../../LayerList/ListItem","../../LayerList/support/layerListUtils","./snappingLayerListUtils"],(function(e,t,r,i,n,o,p,a,s,c,u,l,y){"use strict";var S;e.SnappingListItem=S=function(e){function r(t){var r;return(r=e.call(this,t)||this).children=new i,r}t._inheritsLoose(r,e);var o=r.prototype;return o._initializeChildLayers=function(t){const r=t.filter(y.isValidSnappingLayer);e.prototype._initializeChildLayers.call(this,r)},o._makeChildren=function(e){return e.map((e=>l.canDisplayLayer(e)?new S({layer:e,parent:this,view:this.view,getFeatureSnappingSources:this.getFeatureSnappingSources}):null)).reverse()},t._createClass(r,[{key:"enabled",get:function(){return!!n.isSome(this.featureSource)&&this.featureSource.enabled}},{key:"featureSource",get:function(){const{layer:e,getFeatureSnappingSources:t}=this;return t().find((t=>t.layer===e))}}]),r}(u),r.__decorate([o.property()],e.SnappingListItem.prototype,"children",void 0),r.__decorate([o.property()],e.SnappingListItem.prototype,"enabled",null),r.__decorate([o.property({constructOnly:!0})],e.SnappingListItem.prototype,"getFeatureSnappingSources",void 0),r.__decorate([o.property()],e.SnappingListItem.prototype,"featureSource",null),r.__decorate([o.property()],e.SnappingListItem.prototype,"parent",void 0),e.SnappingListItem=S=r.__decorate([c.subclass("esri.widgets.support.SnappingControls.SnappingListItem")],e.SnappingListItem),Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
