var A=Object.defineProperty;var g=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var u=(e,n,a)=>n in e?A(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a,d=(e,n)=>{for(var a in n||(n={}))S.call(n,a)&&u(e,a,n[a]);if(g)for(var a of g(n))T.call(n,a)&&u(e,a,n[a]);return e};import{_ as i,j as t,q as z}from"./main.2.8.10.js";import{b as x}from"./react-router.DMwpH23k.js";import{y as I,a9 as P}from"./Note.DalStCGz.js";import{n as $}from"./FlowluCommonFunc.y89Y8zI_.js";import{T as E}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function G({flowluConf:e,setFlowluConf:n,step:a,setStep:j,loading:r,setLoading:y,isInfo:s}){const[o,N]=x.useState(!1),[c,p]=x.useState({api_key:"",company_name:""}),k=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},l=m=>{const b=d({},e),h=d({},c);h[m.target.name]="",b[m.target.name]=m.target.value,p(h),n(b)},v=()=>{e.company_name?window.open(`https://${e.company_name}.flowlu.com/cabinet/all_settings?section=api`,"_blank","noreferrer"):z.error(i("Company Name is required!","bit-integrations"))},_=`
            <h4>${i("Get the API Key","bit-integrations")}</h4>
            <ul>
                <li>${i("First go to your Flowlu dashboard.","bit-integrations")}</li>
                <li>${i('Click go to your "Profile" from Right top corner',"bit-integrations")}</li>
                <li>${i('Then Click "Portal Settings"',"bit-integrations")}</li>
                <li>${i('Click go to "API Settings" from "Main Settings"',"bit-integrations")}</li>
                <li>${i('Then click "create", Then Copy',"bit-integrations")}</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(E,{linkKey:"flowlu"}),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:l,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:l,name:"api_key",value:e.api_key,type:"text",placeholder:i("Session Token...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.api_key}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Company 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:l,name:"company_name",value:e.company_name,type:"text",placeholder:i("Link Name...","bit-integrations"),disabled:s})}),t.jsx("div",{className:"btcd-input-group-icon",children:".flowlu.com"})]}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.company_name}),t.jsxs("small",{className:"d-blk mt-3",children:[i("To get API key, please visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",onClick:v,children:i("Flowlu API Key","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!s&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>$(e,n,p,N,r,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||r.auth,children:[o?i("Authorized ✔","bit-integrations"):i("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:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(P,{note:_})]})}export{G as default};
