var y=Object.defineProperty;var x=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var j=(n,e,i)=>e in n?y(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,l=(n,e)=>{for(var i in e||(e={}))w.call(e,i)&&j(n,i,e[i]);if(x)for(var i of x(e))z.call(e,i)&&j(n,i,e[i]);return n};import{_ as s,j as t}from"./main.2.8.10.js";import{b as k}from"./react-router.DMwpH23k.js";import{y as $,a9 as S}from"./Note.DalStCGz.js";import{b as E,g as _}from"./DiscordCommonFunc.Dgxk7_Uh.js";import{T as B}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function R({formID:n,discordConf:e,setDiscordConf:i,step:c,setstep:N,isLoading:b,setIsLoading:m,setSnackbar:T,redirectLocation:I,isInfo:r}){const[a,f]=k.useState(!1),[d,p]=k.useState({accessToken:""}),v=()=>{_(e,i,m),setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),N(2)},h=o=>{const g=l({},e),u=l({},d);u[o.target.name]="",g[o.target.name]=o.target.value,p(u),i(g)},A=`
            <h4>${s("Get Access Token few step","bit-integrations")}</h4>
            <ul>
                <li>${s("First create app.","bit-integrations")}</li>
                <li>${s("Click on OAuth2.","bit-integrations")}</li>
                <li>${s("Select <b>bot</b> from scopes.","bit-integrations")}</li>
                <li>${s("Select permissions from <b>Bot Permissions</b>.","bit-integrations")}</li>
                <li>${s("Then copy the <b>generated url</b> and paste it in the browser and hit enter.","bit-integrations")}</li>
                <li>${s("Then click on <b>Bot</b>  from left navbar and copy the <b>Access token</b>.","bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:c===1&&900,height:c===1&&"auto"},children:[t.jsx(B,{linkKey:"discord"}),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:h,name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:r}),t.jsxs("small",{className:"d-blk mt-5",children:[s("To get access Token , Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://discord.com/developers/applications",target:"_blank",rel:"noreferrer",children:s("Discord Console","bit-integrations")})]}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Access Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:h,name:"accessToken",value:e.accessToken,type:"text",placeholder:s("Access Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red"},children:d.accessToken}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>E(e,i,p,f,m,T),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:a||b,children:[a?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),b&&t.jsx($,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:v,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!a,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(S,{note:A})]})}export{R as default};
