var w=Object.defineProperty;var k=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var j=(a,e,i)=>e in a?w(a,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[e]=i,c=(a,e)=>{for(var i in e||(e={}))z.call(e,i)&&j(a,i,e[i]);if(k)for(var i of k(e))$.call(e,i)&&j(a,i,e[i]);return a};import{r as T,j as t}from"./main-333.js";import{_ as s,L as S,N as E}from"./bi.636.93.js";import{b as _,g as B}from"./bi.403.954.js";import{T as N,t as D}from"./bi.318.783.js";function R({formID:a,discordConf:e,setDiscordConf:i,step:b,setstep:v,isLoading:m,setIsLoading:p,setSnackbar:y,redirectLocation:I,isInfo:r}){const[o,A]=T.useState(!1),[h,u]=T.useState({accessToken:""}),{discord:n}=D,f=()=>{B(e,i,p),setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),v(2)},d=l=>{const g=c({},e),x=c({},h);x[l.target.name]="",g[l.target.name]=l.target.value,u(x),i(g)},L=`
            <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:b===1&&900,height:b===1&&"auto"},children:[(n==null?void 0:n.youTubeLink)&&t.jsx(N,{title:"Discord",youTubeLink:n==null?void 0:n.youTubeLink}),(n==null?void 0:n.docLink)&&t.jsx(N,{title:"Discord",docLink:n==null?void 0:n.docLink}),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:d,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:d,name:"accessToken",value:e.accessToken,type:"text",placeholder:s("Access Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red"},children:h.accessToken}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>_(e,i,u,A,p,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||m,children:[o?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),m&&t.jsx(S,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:f,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(E,{note:L})]})}export{R as default};
