import{u as k,k as v,r as a,j as t}from"./main-406.js";import{d as S,_ as j,I as y,s as I}from"./bi.394.85.js";import{B as b}from"./bi.46.744.js";import{S as C}from"./bi.68.941.js";import _ from"./bi.227.263.js";import{h as A,c as h}from"./bi.2.783.js";import{Z as N}from"./bi.790.782.js";import"./bi.150.760.js";import"./bi.704.707.js";import"./bi.701.708.js";const Z=i=>{const r={},c=window.location.href.replace(`${window.opener.location.href}`,"").split("&");c&&c.forEach(p=>{const o=p.split("=");o[1]&&(r[o[0]]=o[1])}),localStorage.setItem(`__${i}`,JSON.stringify(r)),window.close()};function M({formFields:i,setFlow:r,flow:f,allIntegURL:c}){const p=k(),{formID:o}=v(),[l,m]=a.useState(!1),[n,u]=a.useState(1),[g,s]=a.useState({show:!1}),[e,d]=a.useState({name:"Zoom",type:"Zoom",clientId:"",clientSecret:"",zoomId:"",field_map:[{formField:"",zoomField:""}],zoomFields:[],allActions:[{value:"Create Attendee",key:1},{value:"Delete Attendee",key:2},{value:"Create User",key:3},{value:"Delete User",key:4}],selectedActions:null,actions:{}});a.useEffect(()=>{window.opener&&Z("zoom")},[]);const x=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!h(e)){s({show:!0,msg:"Please map fields to continue."});return}e.field_map.length>0&&u(3)};return t.jsxs("div",{children:[t.jsx(S,{snack:g,setSnackbar:s}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(C,{step:3,active:n})}),t.jsx(_,{formID:o,zoomConf:e,setZoomConf:d,step:n,setStep:u,setSnackbar:s,isLoading:l,setIsLoading:m}),t.jsxs("div",{className:"btcd-stp-page",style:{width:n===2&&900,height:n===2&&"100%"},children:[t.jsx(N,{formID:o,formFields:i,handleInput:w=>A(w,e,d,o,m,s),zoomConf:e,setZoomConf:d,isLoading:l,setIsLoading:m,setSnackbar:s}),t.jsxs("button",{onClick:()=>x(),disabled:e.field_map.length<2||l||!e.id||!h(e)||e.selectedActions==null,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[j("Next","bit-integrations"),t.jsx(b,{className:"ml-1 rev-icn"})]})]}),t.jsx(y,{step:n,saveConfig:()=>I({flow:f,setFlow:r,allIntegURL:c,navigate:p,conf:e,setIsLoading:m,setSnackbar:s}),isLoading:l,dataConf:e,setDataConf:d,formFields:i})]})}export{M as default};
