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