import{g as E,a as B,i as D,A as L,r as f,j as t,M as F,_ as M,b as u,f as m,b5 as p,bD as x,cs as y,aF as H}from"./main-343.js";import{d as N}from"./bf-649-79.js";function k({labelModal:a,setLabelModal:o,title:h}){var b;const{fieldKey:e}=E(),{css:c}=B(),[C,d]=D(H),s=L(C[e]),l=s.lbl||((b=s==null?void 0:s.info)==null?void 0:b.lbl),[_,g]=f.useState(l);f.useEffect(()=>{a&&g(l)},[a]);const j=i=>{d(n=>m(n,v=>{v[e].lbl=i})),p(e),x({event:"Modify Decision Box Label",type:"change_decision_label",state:{fields:y("fields"),fldKey:e}})},r=()=>{s.lbl=_,d(i=>m(i,n=>{n[e]=s})),p(e),x({event:"Cancel Decision Box Label Editing",type:"cancel_decision_label_edit",state:{fields:y("fields"),fldKey:e}}),o(!1)};return t.jsxs(F,{md:!0,show:a,setModal:r,title:h||M("Edit Decision Box Label"),children:[t.jsx(N,{id:e,value:l,onChangeHandler:j}),t.jsxs("div",{className:"mt-2 f-right",children:[t.jsx("button",{type:"button",className:`${c(u.btn)} mr-2`,onClick:r,children:"Cancel"}),t.jsx("button",{type:"button",className:`${c(u.btn)} blue`,onClick:()=>o(!1),children:"Save"})]})]})}export{k as D};
