import{u as r,j as i}from"./fields-wnm5Jtc6.js";import{s as l}from"./index-pmrLY__j.js";import{B as m}from"./Layout-CFk9FOHT.js";import"./vendor-D21mNUGX.js";const e={EMAIL:"EMAIL",PHP:"PHP",AJAX:"AJAX",CUSTOM:"CUSTOM",FILL_META:"FILL_META"},u=[{label:r("Select"),value:null},{label:r("Ajax"),value:e.AJAX},{label:r("Custom"),value:e.CUSTOM},{label:r("Post management"),value:e.FILL_META},{label:r("PHP"),value:e.PHP}],P=(t,a,n=null)=>{var s;if(t&&((s=t.meta)===null||s===void 0?void 0:s.length)>0){const o=t.meta.filter(A=>A.key===a);return o.length>0?o[0].value:n}return n},E=t=>{let a=l.SECONDARY;switch(t){case e.EMAIL:a=l.DANGER;break;case e.CUSTOM:a=l.WARNING;break;case e.PHP:a=l.INFO;break;case e.AJAX:a=l.SUCCESS;break;case e.FILL_META:a=l.PRIMARY;break}const n=u.filter(s=>s.value===t)[0].label;return i.jsx(m,{style:a,children:n})};export{u as a,e as f,P as g,E as r};
