import{j as t,_ as s,s as j,b as N}from"./main.2.8.10.js";import{b as o}from"./react-router.DMwpH23k.js";import{B as v}from"./BackIcn.BFDZx8No.js";import{y,x as C}from"./Note.DalStCGz.js";import{g as w}from"./RestrictContentCommonFunc.pQlV4nWE.js";import{T as z}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function E({formID:I,restrictConf:i,setRestrictConf:r,step:c,setStep:d,setSnackbar:h}){const[n,u]=o.useState(!1),[l,a]=o.useState(!1),[p,g]=o.useState(!1),b=()=>{a("auth"),N({},"restrict_authorize").then(e=>{e!=null&&e.success&&(u(!0),h({show:!0,msg:s("Connected with Restrict Content Successfully","bit-integrations")})),a(!1),g(!0)})},x=e=>{const m=C(i);m[e.target.name]=e.target.value,r(m)},f=()=>{w(i,r,a),d(2)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:c===1&&900,height:c===1&&"auto"},children:[t.jsx(z,{linkKey:"restrictContent"}),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:x,name:"name",value:i.name,type:"text",placeholder:s("Integration Name...","bit-integrations")}),l==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(y,{size:25,clr:"#022217",className:"mr-2"}),"Checking if restrict content is active!!!"]}),p&&!n&&!l&&t.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[t.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),j(s("%s plugin must be activated to integrate with Bit Integrations","bit-integrations"),"RestrictContent")]}),!n&&t.jsx("button",{onClick:b,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:s("Connect","bit-integrations")}),n&&t.jsxs("button",{onClick:()=>f(),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!n,children:[s("Next","bit-integrations"),t.jsx(v,{className:"ml-1 rev-icn"})]})]})}export{E as default};
