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