var T=Object.defineProperty;var h=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var x=(e,n,s)=>n in e?T(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,m=(e,n)=>{for(var s in n||(n={}))_.call(n,s)&&x(e,s,n[s]);if(h)for(var s of h(n))w.call(n,s)&&x(e,s,n[s]);return e};import{_ as i,j as t,q as z}from"./main.2.9.0.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as A,a9 as L}from"./Note.NSUdvR3c.js";import{s as $}from"./SalesmateCommonFunc.lOUBo07r.js";import{T as E}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function F({salesmateConf:e,setSalesmateConf:n,step:s,setStep:k,loading:a,setLoading:j,isInfo:r}){const[o,N]=g.useState(!1),[l,b]=g.useState({session_token:""}),v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,k(2)},c=d=>{const p=m({},e),u=m({},l);u[d.target.name]="",p[d.target.name]=d.target.value,b(u),n(p)},y=()=>{e.link_name?window.open(`https://${e.link_name}.salesmate.io/#/app/user/accesskey`,"_blank","noreferrer"):z.error(i("Link Name is required!","bit-integrations"))},S=`
            <h4>${i("Get Session Token","bit-integrations")}</h4>
            <ul>
                <li>${i("First go to your Salesmate dashboard.","bit-integrations")}</li>
                <li>${i('Click go to your "Profile" from Right top corner',"bit-integrations")}</li>
                <li>${i('Then Click "Access Key"',"bit-integrations")}</li>
                <li>${i('Then click "Session Key / Session Token", Then Copied',"bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[t.jsx(E,{linkKey:"salesmate"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Session Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"session_token",value:e.session_token,type:"text",placeholder:i("Session Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.session_token}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Link Name:","bit-integrations")})}),t.jsxs("div",{className:"btcd-input-group w-6 mt-1",children:[t.jsx("div",{className:"btcd-input-group-icon",children:"https://"}),t.jsx("div",{className:"btcd-input-group-area",children:t.jsx("input",{className:"btcd-paper-inp",onChange:c,name:"link_name",value:e.link_name,type:"text",placeholder:i("Link Name...","bit-integrations"),disabled:r})}),t.jsx("div",{className:"btcd-input-group-icon",children:".salesmate.io"})]}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.link_name}),t.jsxs("small",{className:"d-blk mt-3",children:[i("To Get Session Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",onClick:y,children:i("Salesmate Session Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>$(e,n,b,N,a,j),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||a.auth,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),a.auth&&t.jsx(A,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:v,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(L,{note:S})]})}export{F as default};
