var v=Object.defineProperty;var b=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var F=(e,n,s)=>n in e?v(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,m=(e,n)=>{for(var s in n||(n={}))_.call(n,s)&&F(e,s,n[s]);if(b)for(var s of b(n))k.call(n,s)&&F(e,s,n[s]);return e};import{u as y,j as l,_ as d,Q as M,$}from"./main-634.js";import{n as w}from"./bf-25-81.js";import{B as P}from"./bf-913-201.js";const j=(e,n,s,t)=>{const r=m({},s);r[e].splice(n,0,{}),t(m({},r))},q=(e,n,s,t)=>{const r=m({},s);r[e].length>1&&r[e].splice(n,1),t(m({},r))},f=(e,n,s,t,r)=>{const i=m({},t);i[e][s][n.target.name]=n.target.value,r(m({},i))},B=e=>!((e!=null&&e.post_map?e.post_map.filter(s=>!s.formField&&s.postFormField&&s.required):[]).length>0),C=e=>!((e!=null&&e.pod_map?e.pod_map.filter(s=>!s.formField&&s.podFormField&&s.required):[]).length>0);function E({i:e,type:n,formFields:s,field:t,dataConf:r,setDataConf:i,podFields:p}){var x;const g={pod:{propName:"pod_map",fldName:"podFormField"},post:{propName:"post_map",fldName:"postFormField"}},N=y($),{isPro:u}=N,{propName:c,fldName:a}=g[n],h=!!p.find(o=>o.key===t[a]&&o.required);return l.jsxs("div",{className:"flx mt-2 mr-1",children:[l.jsxs("div",{className:"flx integ-fld-wrp",children:[l.jsxs("select",{className:"btcd-paper-inp mr-2",name:"formField",value:t.formField||"",onChange:o=>f(c,o,e,r,i),children:[l.jsx("option",{value:"",children:d("Select Field")}),l.jsx(P,{formFields:s,notAllowFieldType:["repeater","section"]}),l.jsx("option",{value:"custom",children:d("Custom...")}),l.jsx("optgroup",{label:`General Smart Codes ${u?"":"(PRO)"}`,children:u&&((x=w)==null?void 0:x.map(o=>l.jsx("option",{value:o.name,children:o.label},`ff-rm-${o.name}`)))})]}),l.jsxs("select",{className:"btcd-paper-inp",name:a,value:t[a]||"",onChange:o=>f(c,o,e,r,i),disabled:h,children:[l.jsx("option",{value:"",children:d("Select Field")}),p==null?void 0:p.map(o=>l.jsx("option",{value:o.key,children:`${o.name}`},`${o.key}-1`))]})]}),h?l.jsx("button",{onClick:()=>j(c,e,r,i),className:"icn-btn sh-sm ml-2 mr-1",type:"button",children:"+"}):l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>j(c,e,r,i),className:"icn-btn sh-sm ml-2 mr-1",type:"button",children:"+"}),l.jsx("button",{onClick:()=>q(c,e,r,i),className:"icn-btn sh-sm ml-1",type:"button","aria-label":"btn",children:l.jsx(M,{})})]})]})}export{E as P,j as a,C as b,B as c};
