import{Ci as e,Ja as t,Qa as n,Ra as r,io as i,lt as a}from"./index.dkY5s53S.js";import{n as o}from"./useBasicWidgetState.C674_qFj.js";var s=i(n(),1),c=(e,t)=>e.getStringValue(t),l=e=>e.options.length===0||r(e.default)?null:e.options[e.default],u=e=>e.rawValue??null,d=(e,t,n,r)=>{t.setStringValue(e,n.value,{fromUi:n.fromUi},r)},f=(0,s.memo)(({disabled:n,element:i,widgetMgr:f,fragmentId:p})=>{let{options:m,help:h,label:g,labelVisibility:_,placeholder:v,acceptNewOptions:y,filterMode:b}=i,[x,S]=o({getStateFromWidgetMgr:c,getDefaultStateFromProto:l,getCurrStateFromProto:u,updateWidgetMgrState:d,element:i,widgetMgr:f,fragmentId:p,formClearBehavior:`resetValueOnly`,queryParamBinding:i.queryParamKey?{paramKey:i.queryParamKey,valueType:`string_value`,clearable:r(i.default)}:void 0}),C=(0,s.useCallback)(e=>{S({value:e,fromUi:!0})},[S]),w=r(i.default)&&!n;return t(a,{label:g,labelVisibility:e(_?.value),options:m,disabled:n,onChange:C,value:x,help:h,placeholder:v,clearable:w,acceptNewOptions:y??!1,filterMode:b})});export{f as default};