import{g as N,i as $,aH as C,a as H,r as w,j as s,_ as L,M as G,f as x,bG as B}from"./main-634.js";import{F as j}from"./bf-767-388.js";import{O as I,a as P}from"./bf-178-233.js";import"./bf-692-111.js";import"./bf-400-72.js";import"./bf-25-81.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 jt({className:b="",showOptionIcon:M=!1}){var O,v,f,h;const{fieldKey:o}=N(),[l,c]=$(C),{css:a}=H(),[d,u]=w.useState(!1);if(!o)return null;const t=l[o],g=(t==null?void 0:t.optionsList)||[],e=(v=(O=t==null?void 0:t.config)==null?void 0:O.activeList)!=null?v:0,T=(f=t==null?void 0:t.adminLbl)!=null?f:"",p=g[e],K=p?Object.keys(p)[0]:"",y=(p==null?void 0:p[K])||[],F=()=>{u(!0)},E=()=>{u(!1)},S=n=>{const r=x(l,i=>{const k=Object.keys(i[o].optionsList[e])[0];i[o].optionsList[e][k]=n;const m=n.find(A=>A.check);i[o].config.defaultValue=m?m.val||m.lbl:""});c(r),B({event:`Modify Active Options: ${t.lbl||T||o}`,type:"modify_active_options",state:{fields:r,fldKey:o}})},_=n=>{c(r=>x(r,i=>{i[o].customTypeList||(i[o].customTypeList=[]),i[o].customTypeList[e]=n}))};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`${a(j.fieldSection)} ${b}`,children:[s.jsx("div",{className:a(j.fieldSectionTitle),children:L("Active Options")}),s.jsx(I,{options:y,onClick:F})]}),s.jsx(G,{md:!0,autoHeight:!0,show:d,setModal:E,className:"o-v",title:L("Edit Options"),width:"730px",children:s.jsx("div",{className:"pos-rel",children:s.jsx(P,{optionMdl:d,options:y,setOptions:S,lblKey:"lbl",valKey:"val",imgKey:"img",type:"radio",hasGroup:!0,showUpload:M,customType:(h=t==null?void 0:t.customTypeList)==null?void 0:h[e],setCustomType:_})})})]})}export{jt as default};
