var A=Object.defineProperty;var u=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var g=(i,s,a)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[s]=a,m=(i,s)=>{for(var a in s||(s={}))_.call(s,a)&&g(i,a,s[a]);if(u)for(var a of u(s))S.call(s,a)&&g(i,a,s[a]);return i};import{_ as e,j as t}from"./main.2.9.0.js";import{b as x}from"./react-router.DMwpH23k.js";import{y as I,a9 as z}from"./Note.NSUdvR3c.js";import{d as T}from"./CompanyHubCommonFunc.CEzGUMIe.js";import{T as P}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function B({companyHubConf:i,setCompanyHubConf:s,step:a,setStep:j,loading:r,setLoading:y,isInfo:n}){const[o,N]=x.useState(!1),[l,b]=x.useState({sub_domain:"",api_key:""}),k=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),i!=null&&i.default,j(2)},d=c=>{const p=m({},i),h=m({},l);h[c.target.name]="",p[c.target.name]=c.target.value,b(h),s(p)},v=`
            <h4>${e("To Get Public Id & Secret Key","bit-integrations")}</h4>
            <ul>
                <li>${e("First go to your CompanyHub dashboard.","bit-integrations")}</li>
                <li>${e('Click go to "Settings" from Left Bottom corner',"bit-integrations")}</li>
                <li>${e('Then Click "Integrations"',"bit-integrations")}</li>
                <li>${e('Then Click "Generate Api key"',"bit-integrations")}</li>
                <li>${e('Then copy "API Authorization Credentials"',"bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(P,{linkKey:"companyHub"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:i.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:n}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Sub Domain:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"sub_domain",value:i.sub_domain,type:"text",placeholder:e("Sub Domain...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.sub_domain}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"api_key",value:i.api_key,type:"text",placeholder:e("API Key...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.api_key}),t.jsxs("small",{className:"d-blk mt-3",children:[e("To Get Sub Domain & API Key, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.companyhub.com/settings/integration",target:"_blank",children:e("CompanyHub Sub Domain & API Key","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!n&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>T(i,s,b,N,r,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||r.auth,children:[o?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),r.auth&&t.jsx(I,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:k,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[e("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(z,{note:v})]})}export{B as default};
