/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t}from"tslib";import{watch as i}from"../../core/reactiveUtils.js";import{generateUID as e}from"../../core/uid.js";import{property as s,subclass as r}from"../../core/accessorSupport/decorators.js";import{isFieldInput as o}from"./featureFormUtils.js";import n from"./InputBase.js";let p=class extends n{constructor(t){super(t),this._expressionTrackingHandles=new Map,this.id=e().toString(),this.type="group"}initialize(){this.addHandles([i(()=>[this.visible,this.inputs],([t])=>{const{inputs:i}=this,e=!!t&&void 0;for(const s of i)o(s)&&(s.required=e)},{initial:!0,equals:(t,i)=>i[0]===t[0]&&i[1]===t[1]})])}destroy(){for(const t of this._expressionTrackingHandles.values())t.remove()}get initialState(){return this.element.initialState||"expanded"}get inputs(){return this._get("inputs")}set inputs(t){this.removeAllHandles(),t&&this.addHandles(t.map(t=>i(()=>t.visible,()=>this._dirtyEvaluatedVisibilityExpression()))),this._set("inputs",t)}get label(){return super.label}get open(){return"expanded"===this.initialState}set open(t){this._override("open",t)}get visible(){return!1!==this.evaluatedVisibilityExpression&&this.inputs&&this.inputs.some(t=>t.visible)}_dirtyEvaluatedVisibilityExpression(){const{element:t}=this;t.visibilityExpression&&this.notifyChange("evaluatedVisibilityExpression")}};t([s()],p.prototype,"id",void 0),t([s()],p.prototype,"initialState",null),t([s()],p.prototype,"inputs",null),t([s()],p.prototype,"open",null),t([s()],p.prototype,"type",void 0),t([s()],p.prototype,"visible",null),p=t([r("esri.widgets.FeatureForm.GroupInput")],p);const l=p;export{l as default};
