var L=Object.defineProperty;var x=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var g=(e,n,s)=>n in e?L(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,b=(e,n)=>{for(var s in n||(n={}))w.call(n,s)&&g(e,s,n[s]);if(x)for(var s of x(n))z.call(n,s)&&g(e,s,n[s]);return e};import{_ as i,j as t,q as A}from"./main.2.8.1.js";import{d as k}from"./react-router-dom.9mCuUg3q.js";import{z as $,a9 as E}from"./Note.BeM7sN-p.js";import{s as R}from"./SalesmateCommonFunc.B0_IVjr9.js";import{t as f}from"./tutorialLinks.kMkIDzcD.js";import{T as j}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function V({salesmateConf:e,setSalesmateConf:n,step:s,setStep:N,loading:a,setLoading:v,isInfo:r}){const[l,S]=k.useState(!1),[c,p]=k.useState({session_token:""}),{salesmate:o}=f,T=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,N(2)},d=m=>{const u=b({},e),h=b({},c);h[m.target.name]="",u[m.target.name]=m.target.value,p(h),n(u)},y=()=>{e.link_name?window.open(`https://${e.link_name}.salesmate.io/#/app/user/accesskey`,"_blank","noreferrer"):A.error(i("Link Name is required!","bit-integrations"))},_=`
            <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(j,{title:"Salesmate CRM",youTubeLink:o==null?void 0:o.youTubeLink}),t.jsx(j,{title:"Salesmate CRM",docLink:o==null?void 0:o.docLink}),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:d,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:d,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:c.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:d,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:c.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:()=>R(e,n,p,S,a,v),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||a.auth,children:[l?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),a.auth&&t.jsx($,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:T,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(E,{note:_})]})}export{V as default};
