import{a as p,u as S,n as V}from"./fieldsStore-CQRN0FvQ.js";import{u as F}from"./pageBreakerStore-BevSHYnU.js";import{u as k}from"./settingsStore-8bwiLMEn.js";import{t as y}from"./vendor-vue-reactivity-CheHbvBM.js";import{e as l}from"./vendor-vue-runtime-core-DwK6Ry68.js";function w(r){const{field:t}=y(r),n=p(),o=F(),s=S(),c=V(),i=l(()=>t.value.selectedOption),d=l(()=>i.value),g=l(()=>s.checkFieldRequired(t.value)),v=l(()=>{var e;return((e=i.value)==null?void 0:e.optionValue)||99999}),f=e=>{var a;if((e==null?void 0:e.optionValue)!==((a=i.value)==null?void 0:a.optionValue)){let u=0;e!=null&&e.optionValue&&t.value.summaryView!=="show_label_not_calculable"&&(u=+(e==null?void 0:e.optionValue).split("_")[0]||0),t.value.selectedOption=e,t.value.value=u,t.value.displayValue=c.getMultipleOptionsFieldDisplayView(t.value),s.updateField(t.value.alias,t.value),n.applyConditionForField(t.value.alias),s.getPageBreakEnabled&&s.getActivePage.action==="not_skip"&&o.checkPageFieldsConditions()}},m=l(()=>{var a;return((a=k().getWarningTexts)==null?void 0:a.requiredMsg)||""});return{field:t,selectValue:f,fieldValue:d,isRequired:g,getKey:v,requiredWarningText:m}}export{w as u};
//# sourceMappingURL=useSingleOptionFieldShared-BVLBb8KI.js.map
