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