import{j as e}from"./vendor-radix-DNp60FuA.js";import{u as h,r}from"./vendor-react-DL0tRKZA.js";import{p as o,B as x,X as b}from"./index-CzsKMdZJ.js";import{u as v,a as g}from"./use-mobile-DG-UVPpq.js";import{L as w}from"./loader-circle-B4NwimxE.js";import"./vendor-supabase-B4f4CcZD.js";import"./vendor-query-CKQAY9LX.js";import"./vendor-charts-CPng-d0O.js";const y="/assets/avatar-preview-oV6ym-u9.png",j=["/","/home-v2","/for-employers","/for-candidates","/pricing","/services","/aboutus","/contact","/job-list","/job-detail-one","/employer-list","/employer-detail","/free-cv-analysis","/helpcenter-overview","/helpcenter-guides","/ireland-2026-salary-guide","/transform-your-hiring","/candidate-experience-roi","/cvs-to-skills-recruitment","/ireland-wage-paradox","/blogs","/blog-detail","/privacy","/terms","/thankyou","/job-categories"],E=["/candidate","/employer-dashboard","/admin","/auth","/interview","/verify-reference","/unsubscribe","/maintenance","/error","/access-denied","/prototype","/resume-builder"];function I(){const a=h().pathname;for(const s of E)if(a===s||a.startsWith(s+"/"))return!1;if(a==="/")return!0;for(const s of j)if(s!=="/"&&(a===s||a.startsWith(s+"/")||a.startsWith(s)))return!0;return!1}const L="https://embed.liveavatar.com/v1/ea308f06-5186-4e31-8150-9e8c215999b2";function _(){const[t,a]=r.useState(!1),[s,i]=r.useState(!1),d=I(),l=v(),u=g(),n=r.useCallback(f=>{f.key==="Escape"&&t&&a(!1)},[t]);if(r.useEffect(()=>{if(t)return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,n]),!d)return null;const m=()=>{i(!0),a(!0)},c=()=>{a(!1),i(!1)},p=()=>{i(!1)};return e.jsxs(e.Fragment,{children:[t&&e.jsxs("div",{className:o("fixed z-[45] bg-card rounded-xl shadow-2xl border border-border overflow-hidden","transition-all duration-300 ease-out",l?"bottom-4 left-4 right-4 w-auto max-w-[320px]":u?"bottom-24 right-4 w-[320px]":"bottom-24 right-4 w-[400px]"),role:"dialog","aria-label":"Talent Hunter AI Assistant",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-primary text-primary-foreground",children:[e.jsx("span",{className:"text-sm font-medium",children:"Talent Hunter Assistant"}),e.jsx(x,{variant:"ghost",size:"sm",onClick:c,className:"h-8 w-8 p-0 text-primary-foreground hover:bg-primary-foreground/20","aria-label":"Close assistant",children:e.jsx(b,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"relative bg-muted",children:[s&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted",children:e.jsx(w,{className:"h-8 w-8 animate-spin text-primary"})}),e.jsx("iframe",{src:L,allow:"microphone",title:"Talent Hunter AI Assistant",onLoad:p,className:"w-full border-0",style:{aspectRatio:"16/9"},loading:"lazy"})]})]}),e.jsxs("div",{onClick:t?c:m,className:o("fixed z-[44] cursor-pointer transition-all duration-200","bottom-4 right-4","hover:scale-105 active:scale-95",t&&"scale-0 opacity-0 pointer-events-none"),role:"button","aria-label":t?"Close AI assistant":"Open AI assistant","aria-expanded":t,children:[e.jsx("div",{className:o("relative rounded-full overflow-hidden shadow-2xl","border-4 border-white","ring-2 ring-primary/30",l?"w-16 h-16":"w-20 h-20"),children:e.jsx("img",{src:y,alt:"AI Assistant",className:"w-full h-full object-cover"})}),e.jsx("div",{className:o("absolute -bottom-1 left-1/2 -translate-x-1/2","bg-primary text-primary-foreground","px-2 py-0.5 rounded-full text-xs font-medium","shadow-md whitespace-nowrap"),children:"Chat now"})]})]})}export{_ as LiveAvatarWidget,_ as default};