var M=Object.defineProperty;var u=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var x=(a,s,e)=>s in a?M(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e,b=(a,s)=>{for(var e in s||(s={}))W.call(s,e)&&x(a,e,s[e]);if(u)for(var e of u(s))w.call(s,e)&&x(a,e,s[e]);return a};import{j as t,_ as i,b as y}from"./main.2.9.0.js";import{b as p}from"./react-router.DMwpH23k.js";import{B as z}from"./BackIcn._8Wofmn2.js";import{y as S}from"./Note.NSUdvR3c.js";import{T as C}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function D({formID:a,wsmsConf:s,setWsmsConf:e,step:o,nextPage:j,isLoading:c,setIsLoading:l,setSnackbar:f}){const[r,N]=p.useState(!1),[m,d]=p.useState(!1),g=()=>{l("auth"),y({},"wsms_authorize").then(n=>{n!=null&&n.success&&(N(!0),f({show:!0,msg:i("Connected with WSMS (WP SMS) Successfully","bit-integrations")})),l(!1),d(!0)}).catch(()=>{l(!1),d(!0)})},v=n=>{const h=b({},s);h[n.target.name]=n.target.value,e(h)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:o===1&&900,height:o===1&&"auto"},children:[t.jsx(C,{linkKey:"wsms"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:v,name:"name",value:s.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),c==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(S,{size:25,clr:"#022217",className:"mr-2"}),i("Checking if WSMS (WP SMS) is authorized!!!","bit-integrations")]}),m&&!r&&!c&&t.jsx("div",{className:"flx mt-5",style:{width:900,justifyContent:"center"},children:t.jsxs("div",{className:"txt-center",children:[t.jsx("div",{className:"btcd-icn btcd-icn-err",children:t.jsx("span",{children:"✕"})}),t.jsx("div",{className:"mt-2",children:i("WSMS (WP SMS) is not activated or not installed","bit-integrations")})]})}),m&&r&&!c&&t.jsxs("div",{className:"flx mt-5",style:{width:900},children:[t.jsx("div",{className:"btcd-icn btcd-icn-success",children:t.jsx("span",{children:"✓"})}),t.jsx("div",{className:"mt-2",children:i("WSMS (WP SMS) is activated","bit-integrations")})]}),t.jsxs("button",{onClick:g,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||c==="auth",children:[r?i("Connected","bit-integrations"):i("Connect to WSMS (WP SMS)","bit-integrations"),c==="auth"&&t.jsx(S,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>j(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[i("Next","bit-integrations"),t.jsx(z,{className:"ml-1 rev-icn"})]})]})}export{D as default};
