var T=Object.defineProperty;var g=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var j=(i,e,n)=>e in i?T(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n,m=(i,e)=>{for(var n in e||(e={}))f.call(e,n)&&j(i,n,e[n]);if(g)for(var n of g(e))A.call(e,n)&&j(i,n,e[n]);return i};import{j as t,_ as s}from"./main.2.8.1.js";import{d as N}from"./react-router-dom.9mCuUg3q.js";import{B as L}from"./BackIcn._kGL_vVw.js";import{z as S}from"./Note.BeM7sN-p.js";import{i as B}from"./WhatsAppCommonFunc.cJ_EoVHR.js";import{t as E}from"./tutorialLinks.kMkIDzcD.js";import{T as k}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function K({formID:i,whatsAppConf:e,setWhatsAppConf:n,step:u,setstep:v,isLoading:b,setIsLoading:I,setSnackbar:y,redirectLocation:W,isInfo:a}){const[c,z]=N.useState(!1),[l,p]=N.useState({dataCenter:"",clientId:""}),{whatsApp:r}=E,D=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),v(2)},o=d=>{const x=m({},e),h=m({},l);h[d.target.name]="",x[d.target.name]=d.target.value,p(h),n(x)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:u===1&&900,height:u===1&&"auto"},children:[t.jsx(k,{title:"WhatsApp",youTubeLink:r==null?void 0:r.youTubeLink}),t.jsx(k,{title:"WhatsApp",docLink:r==null?void 0:r.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:a}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Phone number ID:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"numberID",value:e.numberID,type:"text",placeholder:s("Number ID...","bit-integrations"),disabled:a}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("WhatsApp Business Account ID:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"businessAccountID",value:e.businessAccountID,type:"text",placeholder:s("Business Account ID...","bit-integrations"),disabled:a}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Access Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"token",value:e.token,type:"text",placeholder:s("Access Token...","bit-integrations"),disabled:a}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.clientId}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.clientSecret}),!a&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>B(e,n,p,z,I,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||b,children:[c?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),b&&t.jsx(S,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:D,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[s("Next","bit-integrations"),t.jsx(L,{className:"ml-1 rev-icn"})]})]})]})}export{K as default};
