var j=Object.defineProperty;var d=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var v=(s,e,t)=>e in s?j(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,u=(s,e)=>{for(var t in e||(e={}))S.call(e,t)&&v(s,t,e[t]);if(d)for(var t of d(e))D.call(e,t)&&v(s,t,e[t]);return s};import{j as o,_ as C}from"./main.2.9.0.js";import{u as O,e as w,b as n}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as k}from"./SnackMsg.DYSD96P4.js";import{S as I}from"./Steps.BYe8zHkm.js";import{s as N}from"./GoogleIntegrationHelpers.C5BmN2Z3.js";import{I as _,s as y}from"./Integrations.DL8wqGct.js";import L from"./OneDriveAuthorization.Dmuvi5vo.js";import{O as E}from"./OneDriveIntegLayout.DDU6u138.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./OneDriveCommonFunc.BBNhC02r.js";import"./TutorialLink.CFG7bS5c.js";function W({formFields:s,setFlow:e,flow:t,allIntegURL:x}){const b=O(),{flowID:f}=w(),[c,m]=n.useState(!1),[a,l]=n.useState(1),[g,r]=n.useState({show:!1}),[i,p]=n.useState({name:"OneDrive",type:"OneDrive",clientId:"",clientSecret:"",field_map:[{formField:"",OneDriveFormField:""}],folder:"",folderMap:[],foldersList:[],actions:{}});n.useEffect(()=>{window.opener&&N("oneDrive")},[]);const h=()=>{y({flow:t,setFlow:e,allIntegURL:x,conf:i,navigate:b,setIsLoading:m,setSnackbar:r})};return o.jsxs("div",{children:[o.jsx(k,{snack:g,setSnackbar:r}),o.jsx("div",{className:"txt-center mt-2",children:o.jsx(I,{step:3,active:a})}),o.jsx(L,{flowID:f,oneDriveConf:i,setOneDriveConf:p,step:a,setStep:l,isLoading:c,setIsLoading:m,setSnackbar:r}),o.jsxs("div",{className:"btcd-stp-page",style:u({},a===2&&{width:900,height:"auto",overflow:"visible"}),children:[o.jsx(E,{flowID:f,formFields:s,oneDriveConf:i,setOneDriveConf:p,isLoading:c,setIsLoading:m,setSnackbar:r}),o.jsxs("button",{onClick:()=>l(3),disabled:!i.actions.attachments||!i.folder,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[C("Next","bit-integrations")," ",o.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),o.jsx(_,{step:a,saveConfig:()=>h(),isLoading:c,dataConf:i,setDataConf:p,formFields:s})]})}export{W as default};
