var k=Object.defineProperty;var b=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var g=(i,t,s)=>t in i?k(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,m=(i,t)=>{for(var s in t||(t={}))y.call(t,s)&&g(i,s,t[s]);if(b)for(var s of b(t))w.call(t,s)&&g(i,s,t[s]);return i};import{_ as o,j as a}from"./main.2.8.10.js";import{u as G,e as _,b as n}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as I}from"./SnackMsg.7BjcJK1j.js";import{S as N}from"./Steps.B84Ui3GU.js";import{s as C}from"./GoogleIntegrationHelpers.CQstGYRP.js";import{I as q,s as D}from"./Integrations.BFhED4ck.js";import L from"./GoogleCalendarAuthorization.WJGcIy81.js";import{c as T}from"./GoogleCalendarCommonFunc.Cg1hv4Pe.js";import{G as E}from"./GoogleCalendarIntegLayout.Cgoxg0Ym.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./TitleModal.i_o1jzAL.js";import"./EditIcn.CsPP2qkf.js";function te({formFields:i,setFlow:t,flow:s,allIntegURL:x}){const h=G(),{flowID:c}=_(),[p,u]=n.useState(!1),[r,f]=n.useState(1),[v,l]=n.useState({show:!1}),j=[{key:"start",label:o("Start Date Time","bit-integrations"),required:!0},{key:"end",label:o("End Date Time","bit-integrations"),required:!0},{key:"summary",label:o("Title","bit-integrations"),required:!1},{key:"location",label:o("Location","bit-integrations"),required:!1},{key:"description",label:o("Description","bit-integrations"),required:!1}],[e,d]=n.useState({name:"Google Calendar",type:"Google Calendar",clientId:"",clientSecret:"",field_map:[{formField:"",googleCalendarFormField:""}],reminder_field_map:[{method:"popup",minutes:"30"}],default:j,calendarLists:[],actions:{}});n.useEffect(()=>{window.opener&&C("googleCalendar")},[]);const S=()=>{D({flow:s,setFlow:t,allIntegURL:x,conf:e,navigate:h,setIsLoading:u,setSnackbar:l})};return a.jsxs("div",{children:[a.jsx(I,{snack:v,setSnackbar:l}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(N,{step:3,active:r})}),a.jsx(L,{flowID:c,googleCalendarConf:e,setGoogleCalendarConf:d,step:r,setStep:f,isLoading:p,setIsLoading:u,setSnackbar:l}),a.jsx("div",{className:"btcd-stp-page",style:m({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:a.jsx(E,{flowID:c,formFields:i,googleCalendarConf:e,setGoogleCalendarConf:d})}),a.jsx(q,{step:r,saveConfig:()=>S(),isLoading:p,dataConf:e,setDataConf:d,formFields:i}),a.jsx("div",{className:"btcd-stp-page",style:m({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:a.jsxs("button",{onClick:()=>f(3),disabled:!(e!=null&&e.calendarId)||!(e!=null&&e.timeZone)||!T(e==null?void 0:e.field_map),className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",children:[o("Next","bit-integrations")," ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})})]})}export{te as default};
