import{g,a as E,i as k,aH as B,H as D,r as c,j as e,M as F,_ as d,b as f,f as u,ba as h,bG as j,cv as y,E as $,h as v}from"./main-634.js";import{b as w}from"./bf-178-233.js";import{F as C}from"./bf-767-388.js";import{d as H,C as K}from"./bf-25-81.js";import"./bf-692-111.js";import"./bf-400-72.js";import"./bf-438-114.js";import"./bf-982-242.js";import"./bf-497-246.js";import"./bf-641-107.js";import"./bf-486-243.js";import"./bf-723-244.js";import"./bf-299-245.js";import"./bf-534-247.js";import"./bf-962-248.js";import"./bf-343-249.js";import"./bf-791-250.js";import"./bf-570-251.js";import"./bf-838-80.js";import"./bf-297-103.js";import"./bf-284-252.js";import"./bf-17-106.js";import"./bf-671-253.js";import"./bf-334-254.js";import"./bf-710-385.js";import"./bf-676-386.js";import"./bf-638-271.js";import"./bf-247-269.js";import"./bf-423-273.js";import"./bf-457-387.js";import"./bf-577-275.js";import"./bf-288-389.js";import"./bf-939-390.js";function I({labelModal:o,setLabelModal:l,title:s}){var x;const{fieldKey:t}=g(),{css:m}=E(),[N,p]=k(B),i=D(N[t]),a=i.lbl||((x=i==null?void 0:i.info)==null?void 0:x.lbl),[L,_]=c.useState(a);c.useEffect(()=>{o&&_(a)},[o]);const M=n=>{p(r=>u(r,S=>{S[t].lbl=n})),h(t),j({event:"Modify Decision Box Label",type:"change_decision_label",state:{fields:y("fields"),fldKey:t}})},b=()=>{i.lbl=L,p(n=>u(n,r=>{r[t]=i})),h(t),j({event:"Cancel Decision Box Label Editing",type:"cancel_decision_label_edit",state:{fields:y("fields"),fldKey:t}}),l(!1)};return e.jsxs(F,{md:!0,show:o,setModal:b,title:s||d("Edit Decision Box Label"),children:[e.jsx(H,{id:t,value:a,onChangeHandler:M}),e.jsxs("div",{className:"mt-2 f-right",children:[e.jsx("button",{type:"button",className:`${m(f.btn)} mr-2`,onClick:b,children:"Cancel"}),e.jsx("button",{type:"button",className:`${m(f.btn)} blue`,onClick:()=>l(!1),children:"Save"})]})]})}function he(){g();const[o,l]=c.useState(!1),{css:s}=E(),t=()=>{l(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:s(C.fieldSection),children:[e.jsxs("div",{className:`flx flx-between ${C.hover_tip}`,children:[e.jsxs("div",{className:"flx",children:[e.jsx("b",{children:"Label "}),e.jsx(K,{width:250,icnSize:17,className:"hover-tip",children:e.jsx("div",{className:"txt-body",children:d("Edit your decision box label by clicking on edit icon")})})]}),e.jsx("span",{"data-testid":"lbl-edt-btn",role:"button",tabIndex:-1,className:"mr-2 cp",onClick:t,onKeyDown:t,children:e.jsx($,{size:19})})]}),e.jsx("div",{className:`${s(w.errMsgBox)} ${s(v.mt2)}`,tabIndex:0,role:"button",onClick:t,onKeyDown:t,children:e.jsx("p",{className:s(v.m0),children:"Click to edit decision box label"})})]}),e.jsx(I,{labelModal:o,setLabelModal:l,title:d("Edit Decision Box Label")})]})}export{he as default};
