var L=Object.defineProperty;var j=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var k=(s,i,a)=>i in s?L(s,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[i]=a,p=(s,i)=>{for(var a in i||(i={}))T.call(i,a)&&k(s,a,i[a]);if(j)for(var a of j(i))w.call(i,a)&&k(s,a,i[a]);return s};import{r as x,j as t}from"./main-406.js";import{_ as n,L as z,N as I}from"./bi.394.85.js";import{m as S}from"./bi.458.922.js";import{T as y,t as E}from"./bi.150.760.js";function G({moxiecrmConf:s,setMoxieCRMConf:i,step:a,setStep:m,loading:r,setLoading:N,isInfo:l}){const[o,v]=x.useState(!1),[d,b]=x.useState({api_key:"",api_url:""}),{moxiecrm:e}=E,_=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),s!=null&&s.default,m(2)},c=u=>{const h=p({},s),g=p({},d);g[u.target.name]="",h[u.target.name]=u.target.value,b(g),i(h)},A=`
  <h4>Get api secret key</h4>
  <ul>
      <li>First go to your Moxie dashboard.</li>
      <li>Then click Workspace Settings from bottom left corner.</li>
      <li>Click "Connneted Apps", Then click "Integrations"</li>
      <li>Select "Custom Integrations"</li>
  </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[(e==null?void 0:e.youTubeLink)&&t.jsx(y,{title:e==null?void 0:e.title,youTubeLink:e==null?void 0:e.youTubeLink}),(e==null?void 0:e.docLink)&&t.jsx(y,{title:e==null?void 0:e.title,docLink:e==null?void 0:e.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:s.name,type:"text",placeholder:n("Integration Name...","bit-integrations"),disabled:l}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Your API Url:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"api_url",value:s.api_url,type:"text",placeholder:n("Your Client...","bit-integrations"),disabled:l}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.api_url}),t.jsx("small",{className:"d-blk mt-3",children:n("Example: {name}.withmoxie.com","bit-integrations")}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"api_key",value:s.api_key,type:"text",placeholder:n("API Token...","bit-integrations"),disabled:l}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.api_key}),t.jsx("br",{}),t.jsx("br",{}),!l&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>S(s,i,b,v,r,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||r.auth,children:[o?n("Authorized ✔","bit-integrations"):n("Authorize","bit-integrations"),r.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:_,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[n("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(I,{note:A})]})}export{G as default};
