import{u as w,k as j,r as n,j as t}from"./main-333.js";import{d as v,_ as b,I as S,s as I}from"./bi.636.93.js";import{B as C}from"./bi.429.767.js";import{S as _}from"./bi.563.969.js";import W from"./bi.482.276.js";import{h as q,c as h}from"./bi.994.808.js";import{Z as N}from"./bi.973.807.js";import"./bi.318.783.js";import"./bi.535.730.js";import"./bi.286.731.js";const Z=i=>{const r={},l=window.location.href.replace(`${window.opener.location.href}`,"").split("&");l&&l.forEach(d=>{const s=d.split("=");s[1]&&(r[s[0]]=s[1])}),localStorage.setItem(`__${i}`,JSON.stringify(r)),window.close()};function $({formFields:i,setFlow:r,flow:p,allIntegURL:l}){const d=w(),{formID:s}=j(),[c,u]=n.useState(!1),[a,f]=n.useState(1),[g,o]=n.useState({show:!1}),y=[{key:"first_name",label:"First Name",required:!0},{key:"last_name",label:"Last Name",required:!0},{key:"email",label:"Email",required:!0},{key:"city",label:"City",required:!1},{key:"country",label:"Country",required:!1},{key:"phone",label:"Phone",required:!1},{key:"job_title",label:"Job Title",required:!1},{key:"zip",label:"Zip",required:!1}],[e,m]=n.useState({name:"Zoom Webinar",type:"Zoom Webinar",clientId:"",clientSecret:"",zoomId:"",field_map:[{formField:"",zoomField:""}],zoomWebinarFields:y,allActions:[{value:"Create Attendee",key:1},{value:"Delete Attendee",key:2},{value:"Create User",key:3},{value:"Delete User",key:4}],selectedActions:null,actions:{}});n.useEffect(()=>{window.opener&&Z("zoom")},[]);const k=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!h(e)){o({show:!0,msg:b("Please map fields to continue.","bit-integrations")});return}e.field_map.length>0&&f(3)};return t.jsxs("div",{children:[t.jsx(v,{snack:g,setSnackbar:o}),t.jsx("div",{className:"txt-center w-9 mt-2",children:t.jsx(_,{step:3,active:a})}),t.jsx(W,{formID:s,zoomWebinarConf:e,setZoomWebinarConf:m,step:a,setStep:f,setSnackbar:o,isLoading:c,setIsLoading:u}),t.jsxs("div",{className:"btcd-stp-page",style:{width:a===2&&900,height:a===2&&"100%"},children:[t.jsx(N,{formID:s,formFields:i,handleInput:x=>q(x,e,m),zoomWebinarConf:e,setZoomWebinarConf:m,isLoading:c,setIsLoading:u,setSnackbar:o}),t.jsxs("button",{onClick:()=>k(),disabled:e.field_map.length<2||c||!e.id||!h(e)||e.selectedActions==null,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[b("Next","bit-integrations"),t.jsx(C,{className:"ml-1 rev-icn"})]})]}),t.jsx(S,{step:a,saveConfig:()=>I({flow:p,setFlow:r,allIntegURL:l,navigate:d,conf:e,setIsLoading:u,setSnackbar:o}),isLoading:c,dataConf:e,setDataConf:m,formFields:i})]})}export{$ as default};
