PageSourceSearch

https://navwise.ai/assets/NavWisePage-BIbQJfCt.js

js navwise.ai collected 2026-10-05 15:40:22 UTC 62,369 bytes, 16 lines download raw bytes

1import{c as U,r as n,j as e,L as ce,a as N,J,u as Q,F as de,G as xe,I as me,K as ue}from"./index-VQyblfL3.js";import{u as _,a as T,b as O,h as he,s as ge,c as fe,N as pe,d as ve,e as je}from"./chatWidget-DtSCljQ8.js";import{d as $,C as be}from"./index-B2GKa-oJ.js";import{B as Z}from"./bookmarklet-C0VmH_rv.js";import{A as ye}from"./arrow-right-BeO8WRq_.js";import"./client-npS58i0S.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ne=U("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const we=U("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const ke=U("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]),Ce=30*60*1e3,G="https://bs.navwise.ai",ee=n.createContext(null),Se=()=>{const s=n.useContext(ee);if(!s)throw new Error("useNavWiseAPI must be used within a NavWiseAPIProvider");return s},Le=({children:s})=>{const{userId:t,collectionInProgress:a,taskToken:r,setCollectionProgress:i,completeCollection:u,failCollection:y,startCollection:o,clearCollectionState:m}=_(),x=n.useRef(null),b=n.useRef(!1),f=n.useRef(null),p=n.useRef(new Set),w=n.useCallback(()=>{x.current&&(clearTimeout(x.current),x.current=null),b.current=!1,f.current=null},[]),v=n.useCallback(d=>{w(),b.current=!0,f.current=d;const h=async()=>{if(!(!b.current||d!==f.current))try{const l=await fetch(`${G}/task/${d}/status`);if(!l.ok){if(console.error("Status polling failed:",l.status),l.status===404){p.current.has(d)||(p.current.add(d),b.current=!1,y("Export not found — please start a new export",d));return}b.current&&d===f.current&&(x.current=setTimeout(h,1e3));return}const g=await l.json(),{status:L,progress:M,stepProgress:W,downloadUrl:E,errorMessage:P}=g;if(i(L,M,W||0,E||null),L==="DONE"&&E){p.current.has(d)||(p.current.add(d),b.current=!1,u(E,d));return}if(L==="ERROR"){p.current.has(d)||(p.current.add(d),b.current=!1,y(P||"Unknown error",d));return}b.current&&d===f.current&&(x.current=setTimeout(h,500))}catch(l){console.error("Error polling status:",l),b.current&&d===f.current&&(x.current=setTimeout(h,2e3))}};h()},[w,i,u,y]),C=n.useRef(!1);n.useEffect(()=>{if(!C.current&&a&&r&&!b.current){C.current=!0;const d=localStorage.getItem("navwise_collectionData");if(d)try{const h=JSON.parse(d);if(h.startTime&&Date.now()-h.startTime>Ce){console.warn("Clearing stale collection state — task started over 30 minutes ago",{taskToken:r}),m();return}}catch{}v(r)}return()=>{x.current&&(clearTimeout(x.current),x.current=null),b.current=!1}},[a,r,v,m]);const c={startExport:n.useCallback(async(d,h,l,g,L)=>{w();const M=Intl.DateTimeFormat().resolvedOptions().timeZone,W=-new Date().getTimezoneOffset()/60,E={userAgent:navigator.userAgent,timezone:M,timezoneOffset:W,languages:navigator.languages},P={userId:t,url:d,profileCount:h,includeEmails:l,fileFormat:g,userProperties:E,featureFlags:L},A=await fetch(`${G}/export`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)});if(!A.ok)throw new Error(`Server request failed: ${A.status}`);const B=await A.json(),{token:R,status:z}=B;return o(R,d,h,l,g),v(R),{token:R,status:z}},[t,o,v,w]),stopPolling:w};return e.jsx(ee.Provider,{value:c,children:s})},Ee="https://bs.navwise.ai",se=n.createContext(null),Ie=()=>{const s=n.useContext(se);if(!s)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvi
16der");return s},_e=({children:s})=>{const[t,a]=n.useState({}),[r,i]=n.useState(!1);n.useEffect(()=>{(async()=>{try{const m=await fetch(`${Ee}/feature-flags`);if(m.ok){const x=await m.json();a(x)}}catch(m){console.error("Error fetching feature flags:",m)}finally{i(!0)}})()},[]);const u=n.useCallback(o=>t[o]===!0,[t]),y={featureFlags:t,featureFlagsLoaded:r,hasFlag:u};return e.jsx(se.Provider,{value:y,children:s})},We=[{id:"home",label:"Home",icon:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})})},{id:"exports",label:"Exports",icon:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})},{id:"settings",label:"Settings",icon:e.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}],Re=()=>{const{activeView:s,setView:t,collectionInProgress:a,taskStatus:r}=_(),{user:i,signOut:u,signInWithProvider:y}=T(),o=()=>r==="ERROR"?"error":r==="DONE"?"completed":a&&["STARTING","COLLECTING","ENRICHING","EXPORTING"].includes(r||"")?"running":"unavailable";return e.jsx("header",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:e.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex items-center justify-between h-16",children:[e.jsxs(ce,{to:"/","aria-label":"Go to NavWise homepage",className:"flex items-center space-x-3 transition-opacity hover:opacity-80 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-[#0077b5] focus-visible:ring-offset-2",children:[e.jsx("div",{className:"w-9 h-9 bg-[#0077b5] rounded-lg flex items-center justify-center shadow-sm",children:e.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),e.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"NavWise"})]}),e.jsxs("nav",{className:"flex items-center space-x-1",children:[We.map(m=>{const x=s===m.id||m.id==="home"&&s==="collection";return e.jsxs("button",{onClick:()=>{N("tab_switched",{from_view:s,to_view:m.id,collection_status:o()}),t(m.id)},className:`inline-flex items-center space-x-2 px-4 py-2 text-sm font-medium rounded-lg transition-colors ${x?"bg-blue-50 text-[#0077b5]":"text-gray-600 hover:text-gray-900 hover:bg-gray-100"}`,children:[m.icon,e.jsx("span",{children:m.label})]},m.id)}),e.jsx("div",{className:"ml-2 pl-2 border-l border-gray-200",children:e.jsx("button",{onClick:()=>{N("help_icon_clicked",{from_view:s}),t("help")},className:"inline-flex items-center justify-center w-9 h-9 rounded-lg text-gray-500 hover:text-[#0077b5] hover:bg-gray-100 transition-colors",title:"Help","aria-label":"Help",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})}),e.jsx("div",{className:"ml-2 pl-2 border-l border-gray-200",children:i?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"hidden sm:inline text-sm text-gray-600 max-w-[180px] truncate",title:i.email??void 0,children:i.email}),e.jsx("button",{onClick:()=>u(),className:"inline-flex items-center px-3 py-2 text-sm font-medium rounded-lg text-gray-600 hover:text-gray-900 hover:bg-gray-100 transition-colors",children:"Sign out"})]}):e.jsx("button",{onClick:()=>y("google"),className:"inline-flex items-center px-3 py-2 text-sm font-medium rounded-lg text-[#0077b5] hover:bg-blue-50 transition-colors",children:"Sign in"})})]})]})})})},Me=()=>{const{connectAccount:s,connecting:t,awaitingLogin:a,error:r}=O();n.useEffect(()=>{if(t||a)return he(),()=>ge()},[t,a]);const i=t||a;return e.jsxs("section",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-6 sm:p-8",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded-full bg-[#0077b5] text-white text-sm font-semibold flex items-center justify-center",children:"1"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Connect your LinkedIn account"}),e.jsx("p",{className:"mt-1.5 text-sm text-gray-600 leading-relaxed",children:"NavWise needs access to the LinkedIn account you use with Sales Navigator so it can process the searches you choose to export."})]})]}),i?e.jsx("div",{className:"mt-6 rounded-lg bg-blue-50 ring-1 ring-blue-200 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 text-[#0077b5] flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-blue-900",children:"Connecting your LinkedIn account…"}),e.jsx("p",{className:"mt-1 text-sm text-blue-800",children:"Complete the sign-in in the window that just opened."}),e.jsxs("div",{className:"mt-3 rounded-md bg-white/70 ring-1 ring-blue-100 p-3",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:"LinkedIn needs to verify this sign-in"}),e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Check the email address associated with your LinkedIn account for a verification code, then enter it in the connection window."})]})]})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"What happens next"}),e.jsx("ul",{className:"mt-2 space-y-2",children:["A secure sign-in window will open so you can connect the LinkedIn account you use for Sales Navigator.","LinkedIn may ask you to confirm the sign-in with a security or email verification code.","Once your account is connected, you'll come straight back here and can paste your first Sales Navigator search."].map(u=>e.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-gray-600",children:[e.jsx($,{className:"w-4 h-4 text-[#0077b5] flex-shrink-0 mt-0.5",strokeWidth:2.5}),e.jsx("span",{className:"leading-relaxed",children:u})]},u))})]}),e.jsxs("div",{className:"mt-5 rounded-lg bg-gray-50 ring-1 ring-gray-200 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Why do I need to connect?"}),e.jsx("p",{className:"mt-1 text-sm text-gray-600 leading-relaxed",children:"NavWise needs an authenticated Sales Navigator session to access the search results you ask it to export. Connecting your account lets NavWise process those searches without you manually copying profiles one by one."})]})]}),r&&e.jsxs("div",{className:"mt-5 rounded-lg bg-red-50 ring-1 ring-red-200 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:"We couldn't connect your LinkedIn account."}),e.jsx("p",{className:"mt-1 text-sm text-red-700",children:"Please try again. If LinkedIn asks you to verify the sign-in, c
16omplete that step before retrying."})]}),e.jsxs("div",{className:"mt-6",children:[e.jsx("button",{type:"button",onClick:()=>s(),disabled:t,className:"w-full sm:w-auto bg-[#0077b5] text-white rounded-lg py-2.5 px-6 text-sm font-semibold shadow-sm hover:bg-[#005f8d] focus:outline-none focus:ring-2 focus:ring-[#0077b5] focus:ring-offset-2 transition-colors disabled:bg-gray-300 disabled:cursor-not-allowed",children:t?"Connecting…":r||a?"Try again":"Connect LinkedIn"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Usually takes a couple of minutes. LinkedIn may ask you to verify a new sign-in."})]})]})},Y=()=>{const[s,t]=n.useState(!1),a=()=>{t(r=>(r||N("How To Opened",{location:"dashboard"}),!r))};return e.jsxs("section",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-5 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:"New to NavWise?"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 leading-relaxed",children:"Watch the 60-second walkthrough to see how to find your Sales Navigator search U
16RL and run your first export."})]}),e.jsxs("button",{type:"button",onClick:a,"aria-expanded":s,"aria-controls":"navwise-how-to",className:"inline-flex flex-shrink-0 items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium text-[#0077b5] ring-1 ring-inset ring-gray-200 hover:bg-blue-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#0077b5] transition-colors",children:[e.jsx(Ne,{className:"w-4 h-4"}),"Watch how it works",e.jsx(be,{className:`w-4 h-4 transition-transform ${s?"rotate-180":""}`})]})]}),s&&e.jsx("div",{id:"navwise-how-to",className:"mt-4 aspect-video w-full rounded-lg overflow-hidden bg-gray-100 animate-in fade-in duration-200",children:e.jsx("iframe",{src:"https://navwise.ai/onboarding-vid",className:"w-full h-full",title:"How NavWise works",loading:"lazy"})})]})},Pe=()=>e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24","aria-hidden":"true",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.76h3.56c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.56-2.76c-.98.66-2.23 1.06-3.72 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.11a6.6 6.6 0 0 1 0-4.22V7.05H2.18a11 11 0 0 0 0 9.9l3.66-2.84z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.05l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"})]}),te=({location:s,onDismiss:t})=>{const{user:a,signInWithProvider:r}=T(),[i,u]=n.useState(!1);if(n.useEffect(()=>{a||N("Save Progress Prompt Shown",{location:s})},[a,s]),a)return null;const y=async()=>{if(!i){u(!0),N("Save Progress Clicked",{location:s});try{await r("google")}catch(m){const x=m instanceof Error?m.message:"Sign in failed. Please try again.";J.error(x),u(!1)}}},o=s==="export_success";return e.jsx("div",{className:o?"mt-8 w-full rounded-xl bg-gray-50 ring-1 ring-gray-200 p-5 text-left":"rounded-xl bg-white ring-1 ring-gray-900/5 shadow-sm p-4 sm:p-5",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-900",children:o?"Keep your work for next time":"Save your progress"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 leading-relaxed",children:o?"Create a free NavWise account to keep your connection and access your export history when you come back.":"Create a free account to keep your connection and exports for next time."})]}),e.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:y,disabled:i,className:"inline-flex items-center justify-center gap-2 rounded-lg bg-white px-4 py-2 text-sm font-medium text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#0077b5] transition-colors disabled:opacity-60 disabled:cursor-not-allowed",children:[e.jsx(Pe,{}),i?"Redirecting…":o?"Continue with Google":"Save my progress"]}),t&&e.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-gray-500 hover:text-gray-700 transition-colors",children:"Not now"})]})]})})};function Ae(s){try{const t=new URL(s);return t.hostname.includes("linkedin.com")&&t.pathname.includes("/sales/")&&(t.pathname.includes("/search/")||t.pathname.includes("/leads/"))}catch{return!1}}const Te=()=>{const{setView:s,updateStorage:t,clearCollectionState:a,userId:r}=_(),{isConnected:i,loading:u}=O(),{user:y}=T();fe(!i);const[o,m]=Q(),[x,b]=n.useState(()=>o.get("url")??""),[f,p]=n.useState(""),[w,v]=n.useState(()=>o.get("connected")==="1"),C=n.useRef(null),k=n.useRef(i),c=Ae(x.trim());n.useEffect(()=>{N("Dashboard Reached",{authenticated:!!y})},[]),n.useEffect(()=>{if(o.get("connected")==="1"){const l=new URLSearchParams(o);l.delete("connected"),m(l,{replace:!0})}},[o,m]),n.useEffect(()=>{if(!k.current&&i){v(!0);const l=window.setTimeout(()=>{var g;(g=C.current)==null||g.focus({preventScroll:!0})},300);return k.current=i,()=>window.clearTimeout(l)}k.current=i},[i]);const d=()=>
16{if(!x.trim()){p("Please paste a Sales Navigator search URL");return}if(!c){p("Please enter a valid Sales Navigator search URL (e.g. https://www.linkedin.com/sales/search/people?...)");return}p(""),a(),t("searchUrl",x.trim()),N("start_collection_clicked",{source:"home_view",is_search_page:c,search_url:x.trim()}),s("collection")};if(u)return e.jsx("div",{className:"flex justify-center py-16",children:e.jsx("div",{className:"w-8 h-8 border-2 border-gray-200 border-t-[#0077b5] rounded-full animate-spin"})});const h=!!r||!!y;return i?e.jsxs("div",{className:"space-y-6",children:[w&&e.jsxs("div",{className:"rounded-xl bg-green-50 ring-1 ring-green-200 px-5 py-4 flex items-start justify-between gap-4",role:"status",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-semibold text-green-800",children:[e.jsx($,{className:"w-4 h-4",strokeWidth:3,"aria-hidden":"true"}),"LinkedIn connected"]}),e.jsx("button",{type:"button",onClick:()=>v(!1),className:"text-sm font-medium text-green-700 hover:text-green-900 transition-colors",children:"Dismiss"})]}),e.jsxs("section",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-6 sm:p-8",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"Export Sales Navigator leads"}),e.jsx("p",{className:"mt-2 text-sm text-gray-600 leading-relaxed max-w-2xl",children:"Paste the URL of the Sales Navigator search you want to export."}),e.jsxs("div",{className:"mt-6",children:[e.jsx("label",{htmlFor:"search-url",className:"block text-sm font-medium text-gray-700 mb-1.5",children:"Sales Navigator search U
16RL"}),e.jsx("input",{id:"search-url",ref:C,type:"url",value:x,onChange:l=>{b(l.target.value),f&&p("")},onKeyDown:l=>{l.key==="Enter"&&d()},"aria-invalid":!!f,"aria-describedby":f?"search-url-error":void 0,placeholder:"https://www.linkedin.com/sales/search/people?query=...",className:"block w-full rounded-lg border-0 py-3 px-4 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-[#0077b5] sm:text-sm sm:leading-6"}),f&&e.jsx("p",{id:"search-url-error",className:"mt-1.5 text-sm text-red-600",children:f}),e.jsxs("p",{className:"mt-2 text-sm text-gray-500",children:["Don't have a search ready?"," ",e.jsx("a",{href:"https://www.linkedin.com/sales/",target:"_blank",rel:"noopener noreferrer",onClick:()=>N("go_to_sales_nav_clicked",{source:"home_view",from_page:"home_view"}),className:"font-medium text-[#0077b5] hover:text-[#005f8d] underline underline-offset-2",children:"Open Sales Navigator"})]})]}),e.jsx("button",{onClick:d,disabled:!c,className:"mt-6 w-full sm:w-auto bg-[#0077b5] text-white rounded-lg py-3 px-8 text-sm font-semibold shadow-sm hover:bg-[#005f8d] focus:outline-none focus-visible:ring-2 focus-visible:ring-[#0077b5] focus-visible:ring-offset-2 transition-colors disabled:bg-gray-300 disabled:cursor-not-allowed",children:"Continue to export"})]}),e.jsx(Y,{}),e.jsx(te,{location:"dashboard"})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-6 sm:p-8",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:h?"Reconnect LinkedIn":"Get your first export"}),e.jsx("p",{className:"mt-2 text-sm text-gray-600 leading-relaxed max-w-2xl",children:h?"Your LinkedIn connection needs to be refreshed before you can run another export.":"Connect the LinkedIn account you use with Sales Navigator, then paste a search to export."})]}),e.jsx(Me,{}),e.jsx(Y,{})]})};function Be(s){if(s<60)return`<strong>${s}</strong> seconds`;const t=Math.floor(s/60),a=s%60;return a===0?`<strong>${t}m</strong>`:`<strong>${t}m${a}s</strong>`}const De=()=>{const{collectionInProgress:s,collectionResult:t,taskStatus:a,taskProgress:r,taskStepProgress:i,downloadUrl:u,clearCollectionState:y,searchUrl:o,setView:m}=_(),{startExport:x,stopPolling:b}=Se(),{featureFlags:f,featureFlagsLoaded:p,hasFlag:w}=Ie(),[v,C]=n.useState(100),[k,c]=n.useState(!1),[d,h]=n.useState(!1),[l,g]=n.useState(""),[L,M]=n.useState("csv"),[W,E]=n.useState(null),[P,A]=n.useState(!1),B=n.useRef(null),R=n.useRef(!1),z=n.useCallback(()=>{E(null),b(),y()},[y,b]),F=j=>!j||j<=0?(g("Please enter a valid number of profiles (minimum 1)"),!1):j>2500?(g("Maximum number of profiles is 2,500 for Lead searches"),!1):(g(""),!0),ne=j=>{C(j),F(j),N("profile_count_changed",{profile_count:j,source:"collection_view"})},ae=async()=>{if(!(s||d)){if(!o){g("Please go back and enter a Sales Navigator search U
16RL");return}if(F(v)){h(!0),E(null),B.current=Date.now();try{await x(o,v,k,L,f)}catch(j){const S=j instanceof Error?j.message:"Failed to start collection",I=Date.now();E(S),N("collection_failed",{profile_count:v,include_emails:k,file_format:L,error_message:S.slice(0,120),search_url:o||"unknown",duration_ms:I-(B.current||I),source:"collection_view"})}finally{h(!1)}}}},V=()=>{z(),m("home")},ie=j=>{const S=i||0,I=2*Math.PI*12,D=I-I*S/100,K=e.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4",children:e.jsx("svg",{className:"w-8 h-8 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})});if(W)return K;switch(j){case"STARTING":return e.jsxs("div",{className:"w-16 h-16 bg-blue-50 rounded-full flex items-center justify-center mb-4 relative",children:[e.jsxs("svg",{className:"absolute w-16 h-16 transform -rotate-90",viewBox:"0 0 32 32",children:[e.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:"#e5e7eb",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:"#0077b5",strokeWidth:"2",fill:"none",strokeDasharray:I,strokeDashoffset:D,className:"transition-all duration-300"})]}),e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#0077b5]"})]});case"COLLECTING":return e.jsxs("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4 relative",children:[e.jsxs("svg",{className:"absolute w-16 h-16 transform -rotate-90",viewBox:"0 0 32 32",children:[e.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:"#e5e7eb",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:"#0077b5",strokeWidth:"2",fill:"none",strokeDasharray:I,strokeDashoffset:D,className:"transition-all duration-300"})]}),e.jsx("svg",{className:"w-8 h-8 text-[#0077b5]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"})})]});case"ENRICHING":return e.jsxs("div",{className:"w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4 relative",children:[e.jsxs("svg",{className:"absolute w-16 h-16 transform -rotate-90",viewBox:"0 0 32 32",children:[e.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:"#e5e7eb",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:"#9333ea",strokeWidth:"2",fill:"none",strokeDasharray:I,strokeDashoffset:D,className:"transition-all duration-300"})]}),e.jsx("svg",{className:"w-8 h-8 text-purple-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]});case"EXPORTING":return e.jsxs("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4 relative",children:[e.jsxs("svg",{className:"absolute w-16 h-16 transform -rotate-90",viewBox:"0 0 32 32",children:[e.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:"#e5e7eb",strokeWidth:"2",fill:"none"}),e.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:"#16a34a",strokeWidth:"2",fill:"none",strokeDasharray:I,strokeDashoffset:D,className:"transition-all duration-300"})]}),e.jsx("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})]});case"ERROR":return K;default:return e.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mb-4",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-400"})})}},oe=j=>{switch(j){case"STARTING":return"Initializing Collection";case"COLLECTING":return"Collecting Profiles";case"ENRICHING":return t!=null&&t.includeEmails&&p&&w("navwise.email_enrichment")?"Enriching with Emails":"Enriching Profiles";case"EXPORTING":return"Preparing Export";default:return"Processing..."}},le=j=>{switch(j){case"STARTING":return"Setting up the collection process...";case"COLLECTING":return"Extracting profile data from LinkedIn Sales Navigator...";case"ENRICHING":return t!=null&&t.includeEmails&&p&&w("navwise.email_enrichment")?"Finding and verifying email addresses...":"Enriching the leads for more information from across the internet...";case"EXPORTING":return"Generating your downloadable file...";default:return"Working on your request..."}};return a==="DONE"&&u?e.jsx("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-8 sm:p-12",children:e.jsxs("div",{className:"flex flex-col items-center text-center max-w-md mx-auto",children:[e.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-5",children:e.jsx("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Collection Complete!"}),e.jsxs("p",{className:"text-sm text-gray-500 mb-8",children:["Successfully processed ",(t==null?void 0:t.profileCount)||"your"," profiles",(t==null?void 0:t.includeEmails)&&p&&w("navwise.email_enrichment")&&" with email enrichment","."]}),e.jsxs("div",{className:"space-y-3 w-full",children:[e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",onClick:()=>{R.current||(R.current=!0,N("export_downloaded",{profile_count:(t==null?void 0:t.profileCount)??v,include_emails:(t==null?void 0:t.includeEmails)??k,file_format:L,source:"collection_view"},{send_immediately:!0}),setTimeout(()=>{R.current=!1},1e3))},className:"w-full bg-[#0077b5] text-white rounded-lg py-2.5 px-5 text-sm font-semibold shadow-sm hover:bg-[#005f8d] transition-colors inline-block text-center",children:"Download Results"}),e.jsx("button",{onClick:V,className:"w-full bg-gray-100 text-gray-700 rounded-lg py-2.5 px-5 text-sm font-medium hover:bg-gray-200 transition-colors",children:"Start New Collection"})]}),!P&&e.jsx(te,{location:"export_success",onDismiss:()=>A(!0)})]})}):s&&a?e.jsx("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-8 sm:p-12",children:e.jsxs("div",{className:"flex flex-col items-center text-center max-w-md mx-auto",children:[ie(a),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:oe(a)}),e.jsx("p",{className:"text-sm text-gray-500 mb-6",children:le(a)}),e.jsxs("div",{className:"w-full mb-6",children:[e.jsxs("div",{className:"flex justify-between text-sm text-gray-600 mb-2",children:[e.jsx("span",{className:"font-medium",children:a}),e.jsxs("span",{children:[r,"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:e.jsx("div",{className:"bg-[#0077b5] h-2 rounded-full transition-all duration-300 ease-out",style:{width:`${r}%`}})})]}),e.jsx("div",{className:"flex items-center space-x-2 text-sm text-gray-500",children:e.jsx("div",{className:"w-2 h-2 bg-[#0077b5] rounded-full animate-pulse"})}),e.jsx("button",{onClick:V,className:"mt-6 text-sm text-gray-500 hover:text-red-600 transition-colors",children:"Cancel Collection"})]})}):a==="ERROR"||W?e.jsx("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-8 sm:p-12",children:e.jsxs("div",{className:"flex flex-col items-center text-center max-w-md mx-auto",children:[e.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-5",children:e.jsx("svg",{className:"w-8 h-8 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Collection Failed"}),e.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"An error occurred during the collection process. Please try again."}),e.jsx("p",{className:"text-sm text-red-600 mb-8 bg-red-50 rounded-lg px-4 py-2 ring-1 ring-red-100 w-full",children:(t==null?void 0:t.errorMessage)||W}),e.jsx("div",{className:"w-full",children:e.jsx("button",{onClick:V,className:"w-full bg-gray-100 text-gray-700 rounded-lg py-2.5 px-5 text-sm font-medium hover:bg-gray-200 transition-colors",children:"Start New Collection"})})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Collection"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Configure and start your lead extraction."})]}),e.jsxs("button",{onClick:()=>m("home"),className:"inline-flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 transition-colors",children:[e.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),"Back"]})]}),o&&e.jsx("div",{className:"bg-blue-50 rounded-lg p-3 ring-1 ring-blue-200",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("svg",{className:"w-4 h-4 text-[#0077b5] flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),e.jsx("p",{className:"text-xs text-gray-700 truncate flex-1",title:o,children:o})]})}),e.jsx("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-6 sm:p-8",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"profile-count",className:"block text-sm font-medium leading-6 text-gray-900",children:"Number of Profiles to Export"}),e.jsxs("div",{className:"mt-2 space-y-3",children:[e.jsx("input",{type:"number",id:"profile-count",value:v,onCh
16ange:j=>{const S=parseInt(j.target.value)||0;C(S),F(S)},min:"1",max:"2500",className:"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-[#0077b5] sm:text-sm sm:leading-6 px-3",placeholder:"Enter number of profiles (max 2,500)"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-xs text-gray-600",children:[e.jsx("span",{children:"25"}),e.jsx("span",{children:"1,250"}),e.jsx("span",{children:"2,500"})]}),e.jsx("input",{type:"range",min:"25",max:"2500",step:"25",value:Math.round(v/25)*25,onChange:j=>ne(parseInt(j.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #0077b5 0%, #0077b5 ${(Math.round(v/25)*25-25)/2475*100}%, #e5e7eb ${(Math.round(v/25)*25-25)/2475*100}%, #e5e7eb 100%)`}}),e.jsxs("div",{className:"text-xs text-gray-500 text-center",children:["Drag to adjust in increments of ",e.jsx("strong",{children:"25"})," profiles"]})]})]}),e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Each page contains ~",e.jsx("strong",{children:"25"})," profiles. Processing time: ~",e.jsx("span",{dangerouslySetInnerHTML:{__html:Be(Math.ceil(3*(v/25)+2.5*(v/25)+(k?3*(v/25):0)))}})]})]}),l&&e.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("svg",{className:"w-5 h-5 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:"Invalid Input"}),e.jsx("p",{className:"text-xs text-red-600",children:l})]})]})}),p&&w("navwise.email_enrichment")&&e.jsx("div",{children:e.jsxs("label",{className:"flex items-start space-x-3",children:[e.jsx("input",{type:"checkbox",checked:k,onChange:j=>{const S=j.target.checked;c(S),N("email_enrichment_toggled",{include_emails:S,source:"collection_view"})},className:"mt-1 w-4 h-4 text-[#0077b5] border-gray-300 rounded focus:ring-2 focus:ring-[#0077b5] focus:ring-offset-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium leading-6 text-gray-900",children:"Include Email Enrichment"}),e.jsx("p",{className:"text-sm leading-6 text-gray-600 mt-1",children:"Enhance profiles with verified email addresses using the NavWise Email Finder"})]})]})}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"file-format",className:"block text-sm font-medium leading-6 text-gray-900",children:"Export File Format"}),e.jsx("div",{className:"mt-2",children:e.jsxs("select",{id:"file-format",value:L,onChange:j=>{const S=j.target.value;M(S),N("file_format_changed",{file_format:S,source:"collection_view"})},className:"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-[#0077b5] sm:text-sm sm:leading-6 px-3",children:[e.jsx("option",{value:"csv",children:"CSV (.csv)"}),e.jsx("option",{value:"xlsx",children:"Excel (.xlsx)"})]})}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Choose the format for your exported data"})]}),e.jsx("div",{className:"pt-4",children:e.jsx("button",{onClick:ae,disabled:d||!!l,className:"w-full sm:w-auto bg-[#0077b5] text-white rounded-lg py-2.5 px-6 text-sm font-semibold shadow-sm hover:bg-[#005f8d] focus:outline-none focus:ring-2 focus:ring-[#0077b5] focus:ring-offset-2 transition-colors disabled:bg-gray-300 disabled:cursor-not-allowed",children:d?e.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),e.jsx("span",{children:"Starting..."})]}):`Start Collection (${v} profiles)`})})]})})]})};function q(s){const t=Math.floor((Date.now()-s)/1e3);if(t<60)return"just now";const a=Math.floor(t/60);if(a<60)return`${a}m ago`;const r=Math.floor(a/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Oe(s){switch(s){case"DONE":return"inline-flex items-center rounded-full bg-green-50 px-2 py-1 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20";case"ERROR":return"inline-flex items-center rounded-full bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20";default:return"inline-flex items-center rounded-full bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20"}}const ze=()=>{const{taskHistory:s,removeTaskFromHistory:t}=_(),a=n.useRef(new Map);return n.useEffect(()=>{N("Export History Viewed",{exports_count:s.length})},[]),s.length===0?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Exports"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Your past lead extraction tasks"})]}),e.jsx("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-12",children:e.jsxs("div",{className:"flex flex-col items-center text-center",children:[e.jsx("svg",{className:"w-12 h-12 text-gray-300 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:"No exp
16orts yet"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Start a collection to see your exports here"})]})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Exports"}),e.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:[s.length," export",s.length!==1?"s":""]})]}),e.jsx("div",{className:"space-y-3",children:s.map(r=>{var i;return e.jsxs("div",{className:"relative bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-5",children:[e.jsx("button",{onClick:()=>{r.status==="ERROR"&&N("errored_task_cleared",{source:"exports_view"}),t(r.token)},className:"absolute top-4 right-4 text-gray-400 hover:text-red-500 transition-colors",title:"Remove","aria-label":"Remove export",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),e.jsx("div",{className:"flex items-start space-x-4",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:Oe(r.status),children:r.status})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-sm text-gray-900",children:[e.jsx("span",{className:"font-medium",children:r.profileCount})," profiles",r.includeEmails&&" + emails",e.jsxs("span",{className:"text-gray-400 ml-2",children:["(",((i=r.fileFormat)==null?void 0:i.toUpperCase())||"CSV",")"]})]}),r.searchUrl&&e.jsx("p",{className:"text-xs text-gray-500 truncate",title:r.searchUrl,children:r.searchUrl}),e.jsx("p",{className:"text-xs text-gray-400",children:r.completedAt?q(r.completedAt):r.startTime?q(r.startTime):""}),r.errorMessage&&e.jsx("p",{className:"text-xs text-red-500 mt-1",children:r.errorMessage})]}),r.status==="DONE"&&r.downloadUrl&&e.jsx("div",{className:"mt-3",children:e.jsxs("a",{href:r.downloadUrl,target:"_blank",rel:"noopener noreferrer",onClick:()=>{const u=Date.now(),y=a.current.get(r.token)||0;u-y<1e3||(a.current.set(r.token,u),N("export_downloaded",{profile_count:r.profileCount,include_emails:r.includeEmails,file_format:r.fileFormat||"csv",source:"exports_view"},{send_immediately:!0}))},className:"inline-flex items-center space-x-1.5 bg-[#0077b5] text-white rounded-lg py-2 px-4 text-xs font-medium shadow-sm hover:bg-[#005f8d] transition-colors",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),e.jsx("span",{children:"Download Results"})]})})]})})]},r.token)})})]})},Fe=()=>{const{accounts:s,accountsLoading:t,loading:a,connecting:r,error:i,awaitingLogin:u,connectAccount:y,disconnectAccount:o,refreshAccounts:m,cancelLogin:x}=O(),{getValidAccessToken:b,user:f}=T(),{userId:p}=_();n.useEffect(()=>{let c=!1;return(async()=>{try{const h=await b(),l={};h&&(l.Authorization=`Bearer ${h}`);const g=await fetch(`${G}/account/whoami`,{headers:l});if(c)return;if(!g.ok){console.error("Supabase auth check failed:",g.status,await g.text());return}const L=await g.json();console.log("Supabase auth check:",L)}catch(h){console.error("Supabase auth check error:",h)}})(),()=>{c=!0}},[b]);const w=s.length>0,v=s.some(c=>c.status==="connected"&&c.linkedInReady!==!1),C=n.useCallback(async()=>{try{await y()}catch{}},[y]),k=n.useCallback(async()=>{try{await o()}catch{}},[o]);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Settings"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage your NavWise account and preferences"})]}),e.jsxs("div",{className:"bg-white shadow-sm ring-1 ring-gray-900/5 rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-5 sm:px-8 sm:py-6",children:[e.jsx("h3",{className:"text-base font-semibold leading-7 text-gray-900",children:"Account Status"}),e.jsx("p",{className:"mt-1 text-sm leading-6 text-gray-500",children:"Connect your LinkedIn account to extract leads from Sales Navigator"})]}),e.jsx("div",{className:"border-t border-gray-100 px-6 py-5 sm:px-8 sm:py-6",children:a||t?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 text-[#0077b5]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("span",{className:"ml-3 text-sm text-gray-500",children:"Loading account status..."})]}):w?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-gray-500",children:s.length===1?"1 LinkedIn account connected":`${s.length} LinkedIn accounts connected`}),e.jsx("button",{type:"button",className:"text-sm font-medium text-[#0077b5] hover:text-[#005f8d] transition-colors",onClick:()=>m(),children:"Refresh"})]}),e.jsx("ul",{className:"space-y-4",children:s.map((c,d)=>{const h=c.linkedinProfileUrl||(c.liId?`https://www.linkedin.com/in/${c.liId}`:void 0),l=c.status==="connected"&&c.linkedInReady!==!1,g=c.status==="connected"&&c.linkedInReady===!1;return e.jsxs("li",{className:"rounded-lg ring-1 ring-gray-200 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[h?e.jsxs("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center space-x-1.5 text-sm font-medium text-[#0077b5] hover:text-[#005f8d] transition-colors",children:[e.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})}),e.jsx("span",{className:"truncate",children:c.liId||h})]}):e.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:c.linkedinEmail||"LinkedIn account"}),c.linkedinEmail&&e.jsx("p",{className:"mt-0.5 text-xs text-gray-500 truncate",children:c.linkedinEmail}),c.connectedAt&&e.jsxs("p",{className:"mt-0.5 text-xs text-gray-400",children:["Connected ",new Date(c.connectedAt).toLocaleDateString()]})]}),e.jsx("span",{className:`inline-flex flex-shrink-0 items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${l?"bg-green-50 text-green-700 ring-1 ring-green-200":g?"bg-red-50 text-red-700 ring-1 ring-red-200":"bg-gray-50 text-gray-600 ring-1 ring-gray-200"}`,children:l?"Connected":g?"Disconnected":c.status})]}),e.jsx("div",{children:l?c.hasValidSalesNavToken?e.jsxs("span",{className:"inline-flex items-center rounded-full bg-green-50 px-2.5 py-0.5 text-xs font-medium text-green-700 ring-1 ring-green-200",children:[e.jsx("svg",{className:"mr-1 h-3.5 w-3.5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})}),"Sales Navigator active"]}):e.jsxs("span",{className:"inline-flex items-center rounded-full bg-amber-50 px-2.5 py-0.5 text-xs font-medium text-amber-700 ring-1 ring-amber-200",children:[e.jsx("svg",{className:"mr-1 h-3.5 w-3.5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.16
167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),"No valid Sales Navigator plan"]}):g?e.jsxs("span",{className:"inline-flex items-center rounded-full bg-amber-50 px-2.5 py-0.5 text-xs font-medium text-amber-700 ring-1 ring-amber-200",children:[e.jsx("svg",{className:"mr-1 h-3.5 w-3.5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),"LinkedIn session expired — reconnect to continue"]}):null})]},c.liId||c.linkedinEmail||d)})}),e.jsx("div",{className:"pt-2",children:v?e.jsx("button",{type:"button",className:"rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-red-600 shadow-sm ring-1 ring-inset ring-red-300 hover:bg-red-50 transition-colors",onClick:k,children:"Disconnect Account"}):e.jsx("button",{type:"button",className:"rounded-lg px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 bg-[#0077b5] hover:bg-[#005f8d] focus-visible:outline-[#0077b5]",onClick:C,children:"Connect LinkedIn Account"})})]}):e.jsxs("div",{className:"space-y-4",children:[u?e.jsx("div",{className:"rounded-lg bg-blue-50 p-4 ring-1 ring-blue-200",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 text-blue-500 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("span",{className:"ml-3 text-sm text-blue-700",children:"Waiting for login to complete..."})]}),e.jsx("button",{type:"button",className:"ml-3 text-sm font-medium text-blue-700 hover:text-blue-900 underline",onClick:x,children:"Cancel"})]})}):e.jsx("div",{className:"rounded-lg bg-gray-50 p-4 ring-1 ring-gray-200",children:e.jsx("p",{className:"text-sm text-gray-500",children:"No LinkedIn account connected"})}),i&&e.jsx("div",{className:"rounded-lg bg-red-50 p-4 ring-1 ring-red-200",children:e.jsx("p",{className:"text-sm text-red-700",children:i})}),e.jsx("button",{type:"button",className:`rounded-lg px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 ${r?"bg-gray-300 cursor-not-allowed":"bg-[#0077b5] hover:bg-[#005f8d] focus-visible:outline-[#0077b5]"}`,onClick:C,disabled:r,children:r?"Connecting...":u?"Restart Login":"Connect LinkedIn Account"})]})})]}),e.jsx("div",{className:"bg-white shadow-sm ring-1 ring-gray-900/5 rounded-xl overflow-hidden",children:e.jsxs("div",{className:"px-6 py-5 sm:px-8 sm:py-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold leading-7 text-gray-900",children:"Your NavWise account"}),e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:f!=null&&f.email?`Signed in as ${f.email}`:"You are using NavWise as a guest on this device."})]}),e.jsxs("details",{className:"group rounded-lg bg-gray-50 ring-1 ring-gray-200 px-4 py-3",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 hover:text-gray-800 select-none",children:"Technical details"}),e.jsxs("dl",{className:"mt-3 space-y-3",children:[(f==null?void 0:f.id)&&e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs font-medium text-gray-500",children:"Account ID"}),e.jsx("dd",{className:"mt-1 text-xs text-gray-500 font-mono break-all",children:f.id})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs font-medium text-gray-500",children:"LinkedIn user ID"}),e.jsx("dd",{className:"mt-1 text-xs text-gray-500 font-mono break-all",children:p||"No LinkedIn account connected yet."})]})]}),e.jsx("p",{className:"mt-3 text-xs text-gray-400",children:"Only needed if our support team asks for it."})]})]})})]})},Ve=()=>{const{setView:s}=_();return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:e.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex items-center justify-between h-16",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-9 h-9 bg-[#0077b5] rounded-lg flex items-center justify-center shadow-sm",children:e.jsx("svg",{className:"w-5 h-5 text-white",f
16ill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),e.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"NavWise"})]}),e.jsxs("button",{onClick:()=>s("home"),className:"inline-flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 transition-colors",title:"Back","aria-label":"Back",children:[e.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Close"]})]})})}),e.jsx("main",{className:"flex-1",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Help & Resources"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Learn how to get the most out of NavWise"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-6 lg:col-span-2",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-4",children:"Getting Started"}),e.jsx("div",{className:"aspect-video w-full mb-4 rounded-lg overflow-hidden bg-gray-100",children:e.jsx("iframe",{src:"https://navwise.ai/onboarding-vid",className:"w-full h-full",title:"Getting Started with NavWise"})}),e.jsx("p",{className:"text-sm text-gray-500",children:"Watch this quick video to learn how NavWise can help you extract and enrich Sales Navigator leads efficiently."})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-6",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-4",children:"Quick Export Bookmarklet"}),e.jsx("p",{className:"text-sm text-gray-500 mb-5",children:"Drag this button to your bookmarks bar. When you're on a Sales Navigator search page, click it to instantly open NavWise with your search prefilled."}),e.jsx("div",{className:"flex justify-center mb-4",children:e.jsxs("a",{href:Z,onClick:t=>t.preventDefault(),className:"inline-flex items-center space-x-2 px-5 py-2.5 bg-[#0077b5] text-white rounded-lg font-semibold text-sm shadow-sm hover:bg-[#005f8d] transition-colors cursor-grab active:cursor-grabbing",title:"Drag this to your bookmarks bar",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})}),e.jsx("span",{children:"Export with NavWise"})]})}),e.jsx("p",{className:"text-xs text-gray-400 text-center",children:"Drag the button above to your bookmarks bar to install it."})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-6",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-4",children:"Guides"}),e.jsxs("a",{href:"https://navwise.ai/export-leads-list",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors text-left group ring-1 ring-gray-100",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"flex-shrink-0 w-9 h-9 bg-[#0077b5] rounded-lg flex items-center justify-center",children:e.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 group-hover:text-[#0077b5] transition-colors",children:"How to export a Leads List"}),e.jsx("div",{className:"text-xs text-gray-500",children:"Learn how to export your Sales Navigator leads"})]})]}),e.jsx("svg",{className:"w-5 h-5 text-gray-400 group-hover:text-[#0077b5] transition-colors flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})]})})]})},He=({onContinue:s})=>{const{downloadUrl:t,collectionResult:a}=_();return e.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[e.jsxs("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-8 sm:p-10 text-center",children:[e.jsx("div",{className:"w-14 h-14 mx-auto bg-green-100 rounded-full flex items-center justify-center mb-5",children:e.jsx(ke,{className:"w-7 h-7 text-green-600"})}),e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-gray-900 mb-2",children:"Nice, that's your first export"}),e.jsxs("p",{className:"text-base text-gray-600 mb-6",children:[a!=null&&a.profileCount?`${a.profileCount} leads ready to go.`:"Your leads are ready to go."," ","Want to make the next one even faster?"]}),t&&e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 bg-gray-100 text-gray-700 rounded-lg py-2 px-4 text-sm font-medium hover:bg-gray-200 transition-colors",children:"Download again"})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm ring-1 ring-gray-900/5 p-6 sm:p-8",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"One-click exports from Sales Navigator"}),e.jsx("p",{className:"text-sm text-gray-600 mb-5",children:"Drag the button below to your bookmarks bar. Next time you're on a Sales Navigator search, just click it and we'll pull the leads automatically. No copy-
16paste needed."}),e.jsx("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 rounded-lg p-6 ring-1 ring-blue-100",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxs("a",{href:Z,draggable:!0,onClick:r=>r.preventDefault(),className:"inline-flex items-center gap-2 bg-[#0077b5] text-white rounded-lg py-2.5 px-5 text-sm font-semibold shadow-md hover:shadow-lg hover:bg-[#005f8d] transition-all cursor-grab active:cursor-grabbing select-none",title:"Drag me to your bookmarks bar",children:[e.jsx(we,{className:"w-4 h-4 opacity-70"}),"Export with NavWise"]}),e.jsx("p",{className:"text-xs text-gray-500 text-center",children:"↑ Drag this button to your bookmarks bar"})]})}),e.jsxs("details",{className:"mt-4 text-sm",children:[e.jsx("summary",{className:"cursor-pointer text-gray-500 hover:text-gray-700",children:"Don't see your bookmarks bar?"}),e.jsxs("p",{className:"mt-2 text-gray-600 leading-relaxed pl-1",children:["Press ",e.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 rounded text-xs font-mono",children:"Ctrl+Shift+B"})," ","(Windows) or ",e.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 rounded text-xs font-mono",children:"⌘+Shift+B"})," ","(Mac) to show your bookmarks bar in Chrome."]})]})]}),e.jsx("div",{className:"flex justify-center",children:e.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-2 text-sm font-medium text-[#0077b5] hover:text-[#005f8d] transition-colors",children:["Or extract another search",e.jsx(ye,{className:"w-4 h-4"})]})})]})},H="/navwise/connected",re="navwise_linkedin_connected_pending",Ge=()=>{try{return sessionStorage.getItem(re)==="true"}catch{return!1}},Ue=()=>{try{sessionStorage.removeItem(re)}catch{}},$e=()=>{const s=de(),t=xe(),a=n.useRef(!1);n.useEffect(()=>{const r=s.pathname===H,i=Ge();if(!r){i&&s.pathname.startsWith("/navwise")&&t(H+s.search,{replace:!0});return}if(!i&&!a.current){t("/navwise"+s.search,{replace:!0});return}if(a.current)return;a.current=!0,Ue(),me(H),ue();const u=window.setTimeout(()=>{t("/navwise"+s.search,{replace:!0})},2e3);return()=>window.clearTimeout(u)},[s.pathname,s.search,t])},Ke="navwise_onboarding_active",X="navwise_first_export_seen",Ye=()=>{const{activeView:s,collectionInProgress:t,taskStatus:a,setView:r,updateStorage:i,hasCompletedOnboarding:u,clearCollectionState:y}=_(),{isConnected:o,connectAccount:m,accountStatus:x}=O(),[b,f]=Q();$e();const[p,w]=n.useState(()=>{try{return localStorage.getItem(Ke)==="true"}catch{return!1}}),[v,C]=n.useState(()=>{try{return localStorage.getItem(X)==="true"}catch{return!0}}),k=n.useRef(o),c=n.useRef(!1);n.useEffect(()=>{const l="navwise_ads_conversion_fired";let g=!1;try{g=sessionStorage.getItem(l)==="true"}catch{}if(!g){try{sessionStorage.setItem(l,"true")}catch{}N("Onboarding Step Completed",{step_name:"app_page_reached",step_number:5})}},[]),n.useEffect(()=>{u||i("hasCompletedOnboarding",!0)},[u,i]),n.useEffect(()=>{if(b.get("step")==="connect"&&p&&!o&&!c.current){c.current=!0,m();const g=new URLSearchParams(b);g.delete("step"),f(g,{replace:!0})}},[b,p,o,m,f]),n.useEffect(()=>{if(p&&!k.current&&o){const l=(x==null?void 0:x.linkedinEmail)||"your LinkedIn account";J.success(`Connected as ${l}`,{icon:e.jsx($,{className:"w-4 h-4"}),duration:3e3}),r("home")}k.current=o},[o,p,x,r]);const d=p&&!v&&a==="DONE"&&s!=="exports"&&s!=="settings"&&s!=="help",h=()=>{try{localStorage.setItem(X,"true")}catch{}C(!0),y(),r("home")};return s==="help"?e.jsx(Ve,{}):e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(Re,{}),e.jsx("main",{className:"flex-1",children:e.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:d?e.jsx(He,{onContinue:h}):s==="exports"?e.jsx(ze,{}):s==="settings"?e.jsx(Fe,{}):s==="collection"||t?e.jsx(De,{}):e.jsx(Te,{})})})]})},qe=({children:s})=>{const{ready:t}=T();return t?e.jsx(e.Fragment,{children:s}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:e.jsx("div",{className:"w-8 h-8 border-2 border-gray-200 border-t-[#0077b5] rounded-full animate-spin"})})},ts=()=>e.jsx(pe,{children:e.jsx(ve,{children:e.jsx(qe,{children:e.jsx(je,{children:e.jsx(_e,{children:e.jsx(Le,{children:e.jsx("div",{className:"min-h-screen bg-gray-50",children:e.jsx(Ye,{})})})})})})})});export{ts 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.