import{b as p,h as w,$ as I,k as S,i as v,j as t,_ as o}from"./main.2.8.1.js";import{u as _,h as N,d as m}from"./react-router-dom.9mCuUg3q.js";import{S as k}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as y,I as F,s as E}from"./Integrations.D2bgBas2.js";import{M as $}from"./MailMintIntegLayout.BQajMD9Q.js";import{h as l,c as L}from"./MailMintCommonFunc.CI78okJ9.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function K({allIntegURL:u}){const g=_(),{formID:x}=N(),[e,a]=p(w),[d,P]=p(I),c=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:d,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:d.triggered_entity,setSnackbar:s}),t.jsx($,{formID:x,formFields:c,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:c}),t.jsx("br",{})]})}export{K as default};
