import{h as p,g as w,$ as I,k as S,i as v,j as t,_ as o}from"./main.2.9.0.js";import{u as _,e as N,b as m}from"./react-router.DMwpH23k.js";import{S as k}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as y,I as F,s as E}from"./Integrations.DL8wqGct.js";import{M as $}from"./MailMintIntegLayout.IBkHzToi.js";import{h as l,c as L}from"./MailMintCommonFunc.DiDjTfAt.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function O({allIntegURL:u}){const g=_(),{formID:x}=N(),[e,a]=p(w),[c,P]=p(I),d=S(v),[r,n]=m.useState(!1),[f,s]=m.useState({show:!1}),[h,b]=m.useState((e==null?void 0:e.name)||""),j=()=>{if(!L(e)){s({show:!0,msg:o("Please map all required fields to continue.","bit-integrations")});return}if(!(e!=null&&e.name)){s({show:!0,msg:o("Please integrations name is required.","bit-integrations")});return}E({flow:c,allIntegURL:u,conf:e,navigate:g,edit:1,setIsLoading:n,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(k,{snack:f,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:i=>{b(i.target.value),l(i,e,a,n)},name:"name",value:h,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),t.jsx(y,{entity:c.triggered_entity,setSnackbar:s}),t.jsx($,{formID:x,formFields:d,handleInput:i=>l(i,e,a,n),mailMintConf:e,setMailMintConf:a,isLoading:r,setIsLoading:n,setSnackbar:s}),t.jsx(F,{edit:!0,saveConfig:j,disabled:!(e!=null&&e.mainAction)||!(e!=null&&e.name)||r,isLoading:r,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{O as default};
