var v=Object.defineProperty;var u=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var f=(o,s,t)=>s in o?v(o,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[s]=t,x=(o,s)=>{for(var t in s||(s={}))j.call(s,t)&&f(o,t,s[t]);if(u)for(var t of u(s))S.call(s,t)&&f(o,t,s[t]);return o};import{u as k,k as P,r as a,j as e}from"./main-406.js";import{d as w,_ as I,I as N,s as _}from"./bi.394.85.js";import{S as y}from"./bi.68.941.js";import{s as F}from"./bi.93.731.js";import L from"./bi.490.292.js";import{c as E}from"./bi.646.844.js";import{P as A}from"./bi.230.845.js";import"./bi.150.760.js";function J({formFields:o,setFlow:s,flow:t,allIntegURL:C}){const g=k(),{flowID:c}=P(),[d,l]=a.useState(!1),[i,p]=a.useState(1),[b,r]=a.useState({show:!1}),[n,m]=a.useState({name:"PCloud",type:"PCloud",clientId:"",clientSecret:"",field_map:[{formField:"",pCloudFormField:""}],foldersList:[],actions:{}});a.useEffect(()=>{window.opener&&F("pCloud")},[]);const h=()=>{_({flow:t,setFlow:s,allIntegURL:C,conf:n,navigate:g,setIsLoading:l,setSnackbar:r})};return e.jsxs("div",{children:[e.jsx(w,{snack:b,setSnackbar:r}),e.jsx("div",{className:"txt-center mt-2",children:e.jsx(y,{step:3,active:i})}),e.jsx(L,{flowID:c,pCloudConf:n,setPCloudConf:m,step:i,setStep:p,isLoading:d,setIsLoading:l,setSnackbar:r}),e.jsxs("div",{className:"btcd-stp-page",style:x({},i===2&&{width:900,height:"auto",overflow:"visible"}),children:[e.jsx(A,{flowID:c,formFields:o,pCloudConf:n,setPCloudConf:m}),e.jsxs("button",{onClick:()=>p(3),disabled:!E(n),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[I("Next","bit-integrations")," ",e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),e.jsx(N,{step:i,saveConfig:()=>h(),isLoading:d})]})}export{J as default};
