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.9.0.js";import{u as G,e as _,b as n}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as I}from"./SnackMsg.DYSD96P4.js";import{S as N}from"./Steps.BYe8zHkm.js";import{s as C}from"./GoogleIntegrationHelpers.C5BmN2Z3.js";import{I as q,s as D}from"./Integrations.DL8wqGct.js";import L from"./GoogleCalendarAuthorization.BswD6lsp.js";import{c as T}from"./GoogleCalendarCommonFunc.DyyfhKs6.js";import{G as E}from"./GoogleCalendarIntegLayout.ChQOMFuJ.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./TitleModal.emRFbfw0.js";import"./EditIcn.ClgiZunh.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};
