var m=Object.defineProperty;var l=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var c=(t,r,e)=>r in t?m(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,o=(t,r)=>{for(var e in r||(r={}))u.call(r,e)&&c(t,e,r[e]);if(l)for(var e of l(r))v.call(r,e)&&c(t,e,r[e]);return t};import{b as h,j as n}from"./bi.394.85.js";const w=(t,r,e)=>{const i=o({},r);i.name=t.target.value,e(o({},i))},F=(t,r,e,i)=>{const f={api_secret:t.api_secret};h(f,"convertKit_forms").then(a=>{if(a&&a.success){const s=o({},t);a.data.convertKitForms?(s.default||(s.default={}),s.default.convertKitForms=a.data.convertKitForms,i({show:!0,msg:n("Convert Kit forms refreshed","bit-integrations")})):i({show:!0,msg:n("No Convert Kit forms found. Try changing the header row number or try again","bit-integrations")}),r(o({},s))}else i({show:!0,msg:n("Convert Kit forms refresh failed. please try again","bit-integrations")});e(!1)}).catch(()=>e(!1))},_=(t,r,e,i)=>{const f={api_secret:t.api_secret};h(f,"convertKit_tags").then(a=>{if(a&&a.success){const s=o({},t);a.data.convertKitTags?(s.default||(s.default={}),s.default.convertKitTags=a.data.convertKitTags,i({show:!0,msg:n("Convert Kit tags refreshed","bit-integrations")})):i({show:!0,msg:n("No Convert Kit tags found. Try changing the header row number or try again","bit-integrations")}),r(o({},s))}else i({show:!0,msg:n("Convert Kit tags refresh failed. please try again","bit-integrations")});e(!1)}).catch(()=>e(!1))},b=(t,r,e,i)=>{const f={api_secret:t.api_secret};h(f,"convertKit_headers").then(a=>{if(a&&a.success){const s=o({},t);if(a.data.convertKitField){s.default||(s.default={}),s.default.fields=a.data.convertKitField;const{fields:g}=s.default;s.field_map=Object.values(g).filter(d=>d.required).map(d=>({formField:"",convertKitField:d.fieldId,required:!0})),i({show:!0,msg:n("Convert Kit fields refreshed","bit-integrations")})}else i({show:!0,msg:n("No Convert Kit fields found. Try changing the header row number or try again","bit-integrations")});r(o({},s))}else i({show:!0,msg:n("Convert Kit fields refresh failed. please try again","bit-integrations")});e(!1)}).catch(()=>e(!1))},y=t=>!((t!=null&&t.field_map?t.field_map.filter(e=>!e.formField&&e.convertKitField&&e.required):[]).length>0);export{F as a,b,y as c,w as h,_ as r};
