1import{j as e}from"./vendor-ui-x7D0iLe8.js";import{j as E,r as n,L as Q}from"./vendor-react-aMKJrssV.js";import{b as I,l as S,B as r,C as T,s as L}from"./index-CgmaCIwJ.js";import{C as p,a as u,b as f,d as g,c as j}from"./card-BlkWbF-q.js";import{I as z}from"./input-DqgkKQ22.js";import{u as G}from"./use-toast-DpvHwgEt.js";import{copyToClipboard as D}from"./copy-to-clipboard-DmNaz9C9.js";import{L as b}from"./loader-circle-BqgSt_yg.js";import{C}from"./chrome-SoLIbVfK.js";import{S as F}from"./shield-check-B84u0K7R.js";import{C as P}from"./copy-CA-Ve0ej.js";import"./vendor-data-LOeL2b27.js";function K(){const{user:a,loading:o}=I(),i=E(),{toast:y}=G(),[s,l]=n.useState(null),[c,d]=n.useState(!1),[N,m]=n.useState(!1),[h,k]=n.useState("Chrome Extension");n.useEffect(()=>{!o&&!a&&i(`/login?redirect=${encodeURIComponent("/extension-connect")}`)},[o,a,i]);const v=async()=>{d(!0);try{const{data:t,error:x}=await L.functions.invoke("extension-pair",{body:{label:h.trim()||"Chrome Extension"}});if(x)throw x;if(!t?.token)throw new Error("No token returned");l(t.token)}catch(t){y({title:"Could not generate pairing code",description:t.message,variant:"destructive"})}finally{d(!1)}},w=async()=>{s&&(await D(s),m(!0),setTimeout(()=>m(!1),2500))};return o?e.jsx("div",{className:"min-h-dvh flex items-center justify-center bg-background",children:e.jsx(b,{className:"h-6 w-6 animate-spin text-primary"})}):e.jsxs(e.Fragment,{children:[e.jsx(S,{title:"Connect Chrome Extension â EQIQs",description:"Pair the EQIQs Chrome extension with your workspace to save LinkedIn profiles in one click.",path:"/extension-connect",noindex:!0}),e.jsx("div",{className:"min-h-dvh bg-background py-12 px-4",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(C,{className:"h-8 w-8 text-primary"}),e.jsx("h1",{className:"text-3xl font-display font-semibold",children:"Connect your Chrome Extension"})]}),e.jsx("p",{className:"text-muted-foreground mb-4 font-body",children:"Generate a one-time pairing code, then paste it into the EQIQs extension popup. From then on, you can save any LinkedIn profile to your workspace with a single click."}),e.jsx("div",{className:"mb-8",children:e.jsxs("a",{href:"https://chromewebstore.google.com/detail/eqiqs-relationship-intell/joclnccfflbelmgmnbklajojfakdnibb",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary hover:underline font-body",children:[e.jsx(C,{className:"h-4 w-4"}),"Don't have it yet? Add to Chrome â"]})}),!s&&e.jsxs(p,{children:[e.jsxs(u,{children:[e.jsx(f,{children:"Step 1 â Generate pairing code"}),e.jsx(g,{children:"This code is tied to your account. Treat it like a password."})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Device label"}),e.jsx(z,{"aria-label":"Device label",value:h,onChange:t=>k(t.target.value),placeholder:"e.g. Work laptop",maxLength:100})]}),e.jsx(r,{onClick:v,disabled:c,size:"lg",className:"w-full",children:c?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-4 w-4 mr-2 animate-spin"})," Generatingâ¦"]}):"Generate pairing code"})]})]}),s&&e.jsxs(p,{className:"border-primary/50",children:[e.jsxs(u,{children:[e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-5 w-5 text-primary"}),"Step 2 â Paste this into the extension"]}),e.jsx(g,{children:"Shown once. Copy it now â you won't see it again."})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsx("div",{className:"bg-muted/40 border rounded-lg p-4 font-mono text-sm break-all",children:s}),e.jsx(r,{onClick:w,variant:"default",size:"lg",className:"w-full",children:N?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 mr-2"})," Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"h-4 w-4 mr-2"})," Copy code"]})}),e.jsxs("ol",{className:"text-sm text-muted-foreground font-body space-y-2 pt-3 border-t",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"1. Open the EQIQs popup."})," Click the"," ",e.jsx("span",{className:"inline-block px-1.5 py-0.5 bg-muted rounded text-xs",children:"ð§© puzzle-piece"}
1)," ","icon at the top-right of Chrome, then click ",e.jsx("strong",{children:"EQIQs Relationship Intelligence"}),". (Tip: pin it so the EQIQs icon stays visible in your toolbar.)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"2. Paste the code"})," into the"," ",e.jsx("em",{children:'"Paste pairing code (eqx_â¦)"'})," field in the popup."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"3. Click Connect."})," The red dot turns green and says ",e.jsx("em",{children:'"Connected to EQIQs"'}),". You're done â visit any LinkedIn profile to start saving."]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground font-body bg-muted/40 border border-border rounded-md p-3 mt-2",children:[e.jsx("strong",{className:"text-foreground",children:"Don't see the popup?"})," The extension popup opens from the Chrome toolbar â not from this page. If you don't see the EQIQs icon, click the puzzle-piece (ð§©) at the top-right of Chrome and pin EQIQs."]}),e.jsx(r,{variant:"outline",className:"w-full",onClick:()=>{l(null)},children:"Generate another"})]})]}),e.jsx("div",{className:"mt-8 text-center",children:e.jsx(Q,{to:"/dashboard",className:"text-sm text-muted-foreground hover:text-foreground underline",children:"â Back to dashboard"})})]})})]})}export{K as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.