var C=Object.defineProperty;var f=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var u=(o,t,e)=>t in o?C(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,r=(o,t)=>{for(var e in t||(t={}))_.call(t,e)&&u(o,e,t[e]);if(f)for(var e of f(t))k.call(t,e)&&u(o,e,t[e]);return o};import{b as p,h as E,$ as F,k as V,i as y,j as a,_ as x}from"./main.2.8.1.js";import{u as N,h as L,d as n}from"./react-router-dom.9mCuUg3q.js";import{S as $}from"./SnackMsg.S8DrwLlT.js";import{z as I}from"./Note.BeM7sN-p.js";import{S as R,s as z}from"./Integrations.D2bgBas2.js";import{c as A,C as D}from"./CustomFunctionHelper.Bj3p7Rid.js";import M from"./CustomFuncEditor.BR9L61Su.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function X({allIntegURL:o}){const t=N(),{formID:e}=L(),[s,c]=p(E),[l,b]=p(F),h=V(y),[i,v]=n.useState({}),[j,S]=n.useState(!1),[g,d]=n.useState({show:!1}),[w,P]=n.useState(1);return n.useEffect(()=>{const m=r({},s);delete m.isValid,c(r({},m))},[s==null?void 0:s.value]),a.jsxs("div",{children:[a.jsx($,{snack:g,setSnackbar:d}),a.jsx(R,{entity:l.triggered_entity,setSnackbar:d}),a.jsx("div",{className:"mt-3",children:a.jsxs("div",{className:"btcd-stp-page",style:r({},w===1&&{width:"91%",height:"auto",overflow:"visible"}),children:[a.jsx("h1",{children:"custom action"}),a.jsx(M,{customActionConf:s,setCustomActionConf:c,formFields:h}),a.jsxs("button",{onClick:()=>A(s,c,i,v),disabled:!s.value||(i==null?void 0:i.validate),className:"btn f-left btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:[s!=null&&s.isValid&&!(i!=null&&i.validate)?x("Validated ✔","bit-integrations"):x("Validated","bit-integrations"),(i==null?void 0:i.validate)&&a.jsx(I,{size:"20",clr:"#022217",className:"ml-2"})]})]})}),a.jsx(D,{edit:!0,saveConfig:()=>z({flow:l,setFlow:b,allIntegURL:o,conf:s,navigate:t,edit:1,setIsLoading:S,setSnackbar:d}),isLoading:j,disabled:!s.isValid}),a.jsx("br",{})]})}export{X as default};
