diff --git a/src/static/assets/AdminView-BMl1f4sR.js b/src/static/assets/AdminView-RIHIJDev.js similarity index 88% rename from src/static/assets/AdminView-BMl1f4sR.js rename to src/static/assets/AdminView-RIHIJDev.js index f8220dd..fd9495b 100644 --- a/src/static/assets/AdminView-BMl1f4sR.js +++ b/src/static/assets/AdminView-RIHIJDev.js @@ -1 +1 @@ -import{d as p,u as y,x as h,c as r,a as t,e as n,n as v,w as d,f as b,r as u,o as s,F as g,l as k,t as a,k as m,i as A}from"./index-B9hhyP-T.js";import{a as w}from"./admin-CT_XX4Td.js";import{_ as B,a as S}from"./CardContent.vue_vue_type_script_setup_true_lang-B1uPgvNK.js";import{_ as x}from"./Badge.vue_vue_type_script_setup_true_lang-BV0smx_q.js";import{_ as V,a as $}from"./utils-DuVQys2y.js";const N={class:"p-6"},C={key:0,class:"flex items-center justify-center h-20"},D={class:"w-full"},E={class:"px-4 py-3"},F={class:"text-sm font-medium text-foreground"},R={class:"px-4 py-3 text-sm text-muted-foreground"},U={class:"px-4 py-3"},j={class:"px-4 py-3"},I={class:"px-4 py-3 text-xs text-muted-foreground"},G=p({__name:"AdminView",setup(J){const f=y(),_=b(),i=u([]),l=u(!1);return h(async()=>{if(!f.isAdmin){_.push("/");return}l.value=!0;try{const c=await w.users();i.value=c.data}finally{l.value=!1}}),(c,o)=>(s(),r("div",N,[o[1]||(o[1]=t("h2",{class:"text-lg font-semibold text-foreground mb-6"},"Admin — Users",-1)),l.value?(s(),r("div",C,[n(V,{class:"text-primary"})])):(s(),v(B,{key:1},{default:d(()=>[n(S,{class:"p-0"},{default:d(()=>[t("table",D,[o[0]||(o[0]=t("thead",null,[t("tr",{class:"border-b border-border"},[t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"User"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Email"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Role"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Status"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Joined")])],-1)),t("tbody",null,[(s(!0),r(g,null,k(i.value,e=>(s(),r("tr",{key:e.id,class:"border-b border-border last:border-0 hover:bg-muted/30"},[t("td",E,[t("p",F,a(e.username),1)]),t("td",R,a(e.email),1),t("td",U,[n(x,{variant:e.role==="admin"?"default":"secondary",class:"text-xs"},{default:d(()=>[m(a(e.role),1)]),_:2},1032,["variant"])]),t("td",j,[n(x,{variant:e.is_active?"success":"outline",class:"text-xs"},{default:d(()=>[m(a(e.is_active?"Active":"Inactive"),1)]),_:2},1032,["variant"])]),t("td",I,a(A($)(e.created_at)),1)]))),128))])])]),_:1})]),_:1}))]))}});export{G as default}; +import{d as p,u as y,x as h,c as r,a as t,e as n,n as v,w as d,f as b,r as u,o as s,F as g,l as k,t as a,k as m,i as A}from"./index-DBJT1cIA.js";import{a as w}from"./admin-BK3S_0nn.js";import{_ as B,a as S}from"./CardContent.vue_vue_type_script_setup_true_lang-C1186bj-.js";import{_ as x}from"./Badge.vue_vue_type_script_setup_true_lang-DWhAdLQt.js";import{_ as V,a as $}from"./utils-1boGOziL.js";const N={class:"p-6"},C={key:0,class:"flex items-center justify-center h-20"},D={class:"w-full"},E={class:"px-4 py-3"},F={class:"text-sm font-medium text-foreground"},R={class:"px-4 py-3 text-sm text-muted-foreground"},U={class:"px-4 py-3"},j={class:"px-4 py-3"},I={class:"px-4 py-3 text-xs text-muted-foreground"},G=p({__name:"AdminView",setup(J){const f=y(),_=b(),i=u([]),l=u(!1);return h(async()=>{if(!f.isAdmin){_.push("/");return}l.value=!0;try{const c=await w.users();i.value=c.data}finally{l.value=!1}}),(c,o)=>(s(),r("div",N,[o[1]||(o[1]=t("h2",{class:"text-lg font-semibold text-foreground mb-6"},"Admin — Users",-1)),l.value?(s(),r("div",C,[n(V,{class:"text-primary"})])):(s(),v(B,{key:1},{default:d(()=>[n(S,{class:"p-0"},{default:d(()=>[t("table",D,[o[0]||(o[0]=t("thead",null,[t("tr",{class:"border-b border-border"},[t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"User"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Email"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Role"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Status"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Joined")])],-1)),t("tbody",null,[(s(!0),r(g,null,k(i.value,e=>(s(),r("tr",{key:e.id,class:"border-b border-border last:border-0 hover:bg-muted/30"},[t("td",E,[t("p",F,a(e.username),1)]),t("td",R,a(e.email),1),t("td",U,[n(x,{variant:e.role==="admin"?"default":"secondary",class:"text-xs"},{default:d(()=>[m(a(e.role),1)]),_:2},1032,["variant"])]),t("td",j,[n(x,{variant:e.is_active?"success":"outline",class:"text-xs"},{default:d(()=>[m(a(e.is_active?"Active":"Inactive"),1)]),_:2},1032,["variant"])]),t("td",I,a(A($)(e.created_at)),1)]))),128))])])]),_:1})]),_:1}))]))}});export{G as default}; diff --git a/src/static/assets/AppLayout-BrbiIY_d.js b/src/static/assets/AppLayout-BrbiIY_d.js deleted file mode 100644 index 916764a..0000000 --- a/src/static/assets/AppLayout-BrbiIY_d.js +++ /dev/null @@ -1 +0,0 @@ -import{d as j,u as M,c as s,b as V,a as e,F as $,l as A,t as m,i as h,m as b,o as n,n as H,w as _,j as C,p as d,q as z,g as B,s as S,k as T,K as L,f as D,e as k,T as R,r as O}from"./index-B9hhyP-T.js";const P={class:"flex flex-col h-full bg-[hsl(220_44%_8%)] border-r border-border"},I={class:"flex-1 px-2 py-3 space-y-0.5 overflow-y-auto"},N={key:0,class:"absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-4 bg-primary rounded-r-full"},F={class:"text-sm"},K={class:"p-3 border-t border-border shrink-0"},q={class:"flex items-center gap-3 px-2 py-2 rounded-lg"},E={class:"h-7 w-7 rounded-full bg-primary/15 ring-1 ring-primary/20 flex items-center justify-center text-[10px] font-bold text-primary shrink-0"},U={class:"flex-1 min-w-0"},W={class:"text-xs font-medium text-foreground truncate"},G=j({__name:"Sidebar",emits:["close"],setup(y,{emit:g}){const a=B(),i=M(),v=g,u=[{name:"Dashboard",path:"/",icon:"grid"},{name:"Calendar",path:"/calendar",icon:"calendar"},{name:"Planner",path:"/planner",icon:"check-square"},{name:"Projects",path:"/projects",icon:"folder"},{name:"Live Feed",path:"/live",icon:"activity"},{name:"Reports",path:"/reports",icon:"file-text"},{name:"Keys",path:"/keys",icon:"key"},{name:"Settings",path:"/settings",icon:"settings"},{name:"Admin",path:"/admin",icon:"shield",adminOnly:!0}],f=b(()=>u.filter(c=>!c.adminOnly||i.isAdmin));function r(c){return c==="/"?a.path==="/":a.path.startsWith(c)}const l=b(()=>{var t,p;return(((t=i.user)==null?void 0:t.username)??((p=i.user)==null?void 0:p.email)??"?").slice(0,2).toUpperCase()});return(c,t)=>{var x,w;const p=z("RouterLink");return n(),s("aside",P,[t[11]||(t[11]=V('
CC Dashboard
Oliver Agency
CC Dashboard
Oliver Agency
Corporate Planning Hub
Corporate Planning Hub
$1');/^###? (.+)/.test(de)?(W&&(F.push(""),W=!1),F.push(`${de.replace(/^###? /,"")}
`)):/^# (.+)/.test(de)?(W&&(F.push(""),W=!1),F.push(`${de.replace(/^# /,"")}
`)):/^- (.+)/.test(de)?(W||(F.push('${de}
`))}return W&&F.push(""),F.join("")}async function x(){try{const S=await fetch("/cc-dashboard/api/assistant/history?limit=30",{headers:{Authorization:`Bearer ${t.token}`}});if(!S.ok)return;s.value=await S.json()}catch{}}async function g(){try{const S=await fetch("/cc-dashboard/api/assistant/flags?days_back=7&resolved=false",{headers:{Authorization:`Bearer ${t.token}`}});if(!S.ok)return;const I=await S.json();l.value=I.length}catch{}}async function w(){await fetch("/cc-dashboard/api/assistant/history",{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}}),s.value=[]}function E(){A("Show me all unresolved time-tracking issues from the last 7 days")}function A(S){r.value=S,y()}async function y(){const S=r.value.trim();if(!S||o.value)return;r.value="",K();const I={id:crypto.randomUUID(),role:"user",content:S,created_at:new Date().toISOString()};s.value.push(I),v(),o.value=!0,i.value="",a.value=[];try{const q=await fetch("/cc-dashboard/api/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.token}`},body:JSON.stringify({message:S})});if(!q.ok||!q.body)throw new Error(`HTTP ${q.status}`);const F=q.body.getReader(),W=new TextDecoder;let se="";for(;;){const{done:de,value:le}=await F.read();if(de)break;se+=W.decode(le,{stream:!0});const X=se.split(` -`);se=X.pop()??"";for(const ie of X){if(!ie.startsWith("data: "))continue;const ve=ie.slice(6).trim();if(ve!=="[DONE]")try{const ue=JSON.parse(ve);ue.type==="text"?(i.value+=ue.text,v()):ue.type==="tool_start"?a.value.includes(ue.tool)||a.value.push(ue.tool):ue.type==="tool_result"?a.value=a.value.filter(De=>De!==ue.tool):ue.type==="error"&&(i.value=ue.text)}catch{}}}i.value&&s.value.push({id:crypto.randomUUID(),role:"assistant",content:i.value,created_at:new Date().toISOString()}),await g()}catch{s.value.push({id:crypto.randomUUID(),role:"assistant",content:"Failed to get response. Please try again.",created_at:new Date().toISOString()})}finally{o.value=!1,i.value="",a.value=[],v()}}function v(){Hn(()=>{u.value&&(u.value.scrollTop=u.value.scrollHeight)})}function D(S){const I=S.target;I.style.height="auto",I.style.height=`${Math.min(I.scrollHeight,96)}px`}function K(){c.value&&(c.value.style.height="auto")}async function j(){n.value=!0,await x(),Hn(()=>{var S;return(S=c.value)==null?void 0:S.focus()}),v()}let B;return Us(()=>{g(),B=setInterval(g,5*60*1e3)}),_i(()=>{B!==void 0&&clearInterval(B)}),wn(n,S=>{S&&g()}),(S,I)=>(ee(),ce(Ae,null,[n.value?st("",!0):(ee(),ce("button",{key:0,class:"fixed bottom-6 right-6 z-50 flex h-14 w-14 items-center justify-center rounded-full bg-amber-400 text-gray-900 shadow-lg hover:bg-amber-300 transition-all duration-200 hover:scale-105 active:scale-95",title:"AI Assistant","aria-label":"Open AI Assistant",onClick:j},[I[2]||(I[2]=J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})],-1)),l.value>0?(ee(),ce("span",Vg,Ct(l.value>9?"9+":l.value),1)):st("",!0)])),Te($d,{name:"slide-up"},{default:fn(()=>[n.value?(ee(),ce("div",$g,[J("div",Kg,[I[6]||(I[6]=J("div",{class:"flex items-center gap-2"},[J("div",{class:"flex h-8 w-8 items-center justify-center rounded-full bg-amber-400"},[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-900",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})])]),J("div",null,[J("p",{class:"text-sm font-semibold text-white"},"Time Analyst"),J("p",{class:"text-xs text-gray-400"},"AI assistant")])],-1)),J("div",Qg,[l.value>0?(ee(),ce("button",{key:0,class:"flex items-center gap-1 rounded-full bg-red-900/40 px-2 py-0.5 text-xs text-red-400 hover:bg-red-900/60 transition-colors",title:"View anomalies",onClick:E},[I[3]||(I[3]=J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3 w-3",viewBox:"0 0 20 20",fill:"currentColor"},[J("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)),Vs(" "+Ct(l.value)+" issue"+Ct(l.value>1?"s":""),1)])):st("",!0),J("button",{class:"p-1.5 text-gray-400 hover:text-white transition-colors",title:"Clear history","aria-label":"Clear chat history",onClick:w},[...I[4]||(I[4]=[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])]),J("button",{class:"p-1.5 text-gray-400 hover:text-white transition-colors","aria-label":"Close assistant",onClick:I[0]||(I[0]=q=>n.value=!1)},[...I[5]||(I[5]=[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),J("div",{ref_key:"messagesEl",ref:u,class:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0"},[s.value.length===0&&!o.value?(ee(),ce("div",zg,[I[7]||(I[7]=J("div",{class:"h-12 w-12 rounded-full bg-amber-400/10 flex items-center justify-center mb-3"},[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})])],-1)),I[8]||(I[8]=J("p",{class:"text-sm font-medium text-gray-300"},"Time Analyst",-1)),I[9]||(I[9]=J("p",{class:"text-xs text-gray-500 mt-1"},"Ask me about your hours, gaps, or missing time entries.",-1)),J("div",Wg,[(ee(),ce(Ae,null,ts(f,q=>J("button",{key:q,class:"rounded-full border border-gray-600 px-3 py-1.5 text-xs text-gray-400 hover:border-amber-400 hover:text-amber-400 transition-colors",onClick:F=>A(q)},Ct(q),9,Gg)),64))])])):st("",!0),(ee(!0),ce(Ae,null,ts(s.value,q=>(ee(),ce(Ae,{key:q.id},[q.role==="user"?(ee(),ce("div",Jg,[J("div",Yg,[J("p",Xg,Ct(q.content),1)])])):(ee(),ce("div",Zg,[J("div",ey,[J("div",{class:"text-sm text-gray-200 prose prose-sm prose-invert max-w-none",innerHTML:p(q.content)},null,8,ty)])]))],64))),128)),o.value||i.value?(ee(),ce("div",ny,[J("div",sy,[a.value.length>0?(ee(),ce("div",ry,[(ee(!0),ce(Ae,null,ts(a.value,q=>(ee(),ce("div",{key:q,class:"flex items-center gap-1.5 text-xs text-amber-400"},[I[10]||(I[10]=J("svg",{class:"h-3 w-3 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[J("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),J("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),Vs(" "+Ct(h(q)),1)]))),128))])):st("",!0),i.value?(ee(),ce("div",{key:1,class:"text-sm text-gray-200 prose prose-sm prose-invert max-w-none",innerHTML:p(i.value)},null,8,oy)):(ee(),ce("div",iy,[...I[11]||(I[11]=[J("span",{class:"h-1.5 w-1.5 rounded-full bg-gray-500 animate-bounce",style:{"animation-delay":"0ms"}},null,-1),J("span",{class:"h-1.5 w-1.5 rounded-full bg-gray-500 animate-bounce",style:{"animation-delay":"150ms"}},null,-1),J("span",{class:"h-1.5 w-1.5 rounded-full bg-gray-500 animate-bounce",style:{"animation-delay":"300ms"}},null,-1)])]))])])):st("",!0)],512),J("div",ay,[J("div",ly,[Df(J("textarea",{ref_key:"inputEl",ref:c,"onUpdate:modelValue":I[1]||(I[1]=q=>r.value=q),rows:"1",placeholder:"Ask about your time...",class:"flex-1 resize-none rounded-xl bg-gray-700 border border-gray-600 px-3 py-2 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-amber-400 transition-colors max-h-24 overflow-y-auto",disabled:o.value,onKeydown:[Oa(Ra(y,["exact","prevent"]),["enter"]),Oa(Ra(()=>{},["shift","exact"]),["enter"])],onInput:D},null,40,cy),[[dh,r.value]]),J("button",{disabled:!r.value.trim()||o.value,class:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-xl bg-amber-400 text-gray-900 transition-all hover:bg-amber-300 disabled:opacity-40 disabled:cursor-not-allowed",onClick:y},[...I[12]||(I[12]=[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[J("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})],-1)])],8,uy)]),I[13]||(I[13]=J("p",{class:"mt-1.5 text-center text-xs text-gray-600"},"Enter to send · Shift+Enter for newline",-1))])])):st("",!0)]),_:1})],64))}}),dy=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},hy=dy(fy,[["__scopeId","data-v-ccefe5eb"]]),py=Vn({__name:"App",setup(e){const t=so(),n=ge(()=>t.isAuthenticated);return(s,r)=>{const o=Xf("RouterView");return ee(),ce(Ae,null,[Te(o),n.value?(ee(),Ut(hy,{key:0})):st("",!0),Te(Ke(em),{position:"top-right","toast-options":{style:{background:"hsl(var(--card))",color:"hsl(var(--card-foreground))",border:"1px solid hsl(var(--border))"}}})],64)}}}),my="modulepreload",gy=function(e){return"/cc-dashboard/static/"+e},el={},bt=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.allSettled(n.map(l=>{if(l=gy(l),l in el)return;el[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":my,u||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return r.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};/*! +`+o)}}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=qn(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&xr.assertOptions(s,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean),legacyInterceptorReqResOrdering:bt.transitional(bt.boolean)},!1),r!=null&&(_.isFunction(r)?n.paramsSerializer={serialize:r}:xr.assertOptions(r,{encode:bt.function,serialize:bt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),xr.assertOptions(n,{baseUrl:bt.spelling("baseURL"),withXsrfToken:bt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&_.merge(o.common,o[n.method]);o&&_.forEach(["delete","get","head","post","put","patch","query","common"],x=>{delete o[x]}),n.headers=at.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach(function(m){if(typeof m.runWhen=="function"&&m.runWhen(n)===!1)return;l=l&&m.synchronous;const w=n.transitional||Pi;w&&w.legacyInterceptorReqResOrdering?a.unshift(m.fulfilled,m.rejected):a.push(m.fulfilled,m.rejected)});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let c,f=0,h;if(!l){const x=[Xa.bind(this),void 0];for(x.unshift(...a),x.push(...u),h=x.length,c=Promise.resolve(n);f$1');/^###? (.+)/.test(de)?(W&&(k.push(""),W=!1),k.push(`${de.replace(/^###? /,"")}
`)):/^# (.+)/.test(de)?(W&&(k.push(""),W=!1),k.push(`${de.replace(/^# /,"")}
`)):/^- (.+)/.test(de)?(W||(k.push('${de}
`))}return W&&k.push(""),k.join("")}async function x(){try{const S=await fetch("/cc-dashboard/api/assistant/history?limit=30",{headers:{Authorization:`Bearer ${t.token}`}});if(!S.ok)return;s.value=await S.json()}catch{}}async function m(){try{const S=await fetch("/cc-dashboard/api/assistant/flags?days_back=7&resolved=false",{headers:{Authorization:`Bearer ${t.token}`}});if(!S.ok)return;const I=await S.json();l.value=I.length}catch{}}async function w(){await fetch("/cc-dashboard/api/assistant/history",{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`}}),s.value=[]}function E(){A("Show me all unresolved time-tracking issues from the last 7 days")}function A(S){r.value=S,y()}async function y(){const S=r.value.trim();if(!S||o.value)return;r.value="",K();const I={id:crypto.randomUUID(),role:"user",content:S,created_at:new Date().toISOString()};s.value.push(I),v(),o.value=!0,i.value="",a.value=[];try{const q=await fetch("/cc-dashboard/api/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.token}`},body:JSON.stringify({message:S})});if(!q.ok||!q.body)throw new Error(`HTTP ${q.status}`);const k=q.body.getReader(),W=new TextDecoder;let se="";for(;;){const{done:de,value:le}=await k.read();if(de)break;se+=W.decode(le,{stream:!0});const X=se.split(` +`);se=X.pop()??"";for(const ie of X){if(!ie.startsWith("data: "))continue;const ve=ie.slice(6).trim();if(ve!=="[DONE]")try{const ue=JSON.parse(ve);ue.type==="text"?(i.value+=ue.text,v()):ue.type==="tool_start"?a.value.includes(ue.tool)||a.value.push(ue.tool):ue.type==="tool_result"?a.value=a.value.filter(De=>De!==ue.tool):ue.type==="error"&&(i.value=ue.text)}catch{}}}i.value&&s.value.push({id:crypto.randomUUID(),role:"assistant",content:i.value,created_at:new Date().toISOString()}),await m()}catch{s.value.push({id:crypto.randomUUID(),role:"assistant",content:"Failed to get response. Please try again.",created_at:new Date().toISOString()})}finally{o.value=!1,i.value="",a.value=[],v()}}function v(){Hn(()=>{u.value&&(u.value.scrollTop=u.value.scrollHeight)})}function D(S){const I=S.target;I.style.height="auto",I.style.height=`${Math.min(I.scrollHeight,96)}px`}function K(){c.value&&(c.value.style.height="auto")}async function j(){n.value=!0,await x(),Hn(()=>{var S;return(S=c.value)==null?void 0:S.focus()}),v()}let B;return Us(()=>{m(),B=setInterval(m,5*60*1e3)}),_i(()=>{B!==void 0&&clearInterval(B)}),wn(n,S=>{S&&m()}),(S,I)=>(ee(),ce(Ae,null,[n.value?st("",!0):(ee(),ce("button",{key:0,class:"fixed bottom-6 right-6 z-50 flex h-14 w-14 items-center justify-center rounded-full bg-amber-400 text-gray-900 shadow-lg hover:bg-amber-300 transition-all duration-200 hover:scale-105 active:scale-95",title:"AI Assistant","aria-label":"Open AI Assistant",onClick:j},[I[2]||(I[2]=J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})],-1)),l.value>0?(ee(),ce("span",Vm,Ct(l.value>9?"9+":l.value),1)):st("",!0)])),Te($d,{name:"slide-up"},{default:fn(()=>[n.value?(ee(),ce("div",$m,[J("div",Km,[I[6]||(I[6]=J("div",{class:"flex items-center gap-2"},[J("div",{class:"flex h-8 w-8 items-center justify-center rounded-full bg-amber-400"},[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 text-gray-900",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})])]),J("div",null,[J("p",{class:"text-sm font-semibold text-white"},"Time Analyst"),J("p",{class:"text-xs text-gray-400"},"AI assistant")])],-1)),J("div",Qm,[l.value>0?(ee(),ce("button",{key:0,class:"flex items-center gap-1 rounded-full bg-red-900/40 px-2 py-0.5 text-xs text-red-400 hover:bg-red-900/60 transition-colors",title:"View anomalies",onClick:E},[I[3]||(I[3]=J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3 w-3",viewBox:"0 0 20 20",fill:"currentColor"},[J("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)),Vs(" "+Ct(l.value)+" issue"+Ct(l.value>1?"s":""),1)])):st("",!0),J("button",{class:"p-1.5 text-gray-400 hover:text-white transition-colors",title:"Clear history","aria-label":"Clear chat history",onClick:w},[...I[4]||(I[4]=[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])]),J("button",{class:"p-1.5 text-gray-400 hover:text-white transition-colors","aria-label":"Close assistant",onClick:I[0]||(I[0]=q=>n.value=!1)},[...I[5]||(I[5]=[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),J("div",{ref_key:"messagesEl",ref:u,class:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0"},[s.value.length===0&&!o.value?(ee(),ce("div",zm,[I[7]||(I[7]=J("div",{class:"h-12 w-12 rounded-full bg-amber-400/10 flex items-center justify-center mb-3"},[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[J("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})])],-1)),I[8]||(I[8]=J("p",{class:"text-sm font-medium text-gray-300"},"Time Analyst",-1)),I[9]||(I[9]=J("p",{class:"text-xs text-gray-500 mt-1"},"Ask me about your hours, gaps, or missing time entries.",-1)),J("div",Wm,[(ee(),ce(Ae,null,ts(f,q=>J("button",{key:q,class:"rounded-full border border-gray-600 px-3 py-1.5 text-xs text-gray-400 hover:border-amber-400 hover:text-amber-400 transition-colors",onClick:k=>A(q)},Ct(q),9,Gm)),64))])])):st("",!0),(ee(!0),ce(Ae,null,ts(s.value,q=>(ee(),ce(Ae,{key:q.id},[q.role==="user"?(ee(),ce("div",Jm,[J("div",Ym,[J("p",Xm,Ct(q.content),1)])])):(ee(),ce("div",Zm,[J("div",ey,[J("div",{class:"text-sm text-gray-200 prose prose-sm prose-invert max-w-none",innerHTML:p(q.content)},null,8,ty)])]))],64))),128)),o.value||i.value?(ee(),ce("div",ny,[J("div",sy,[a.value.length>0?(ee(),ce("div",ry,[(ee(!0),ce(Ae,null,ts(a.value,q=>(ee(),ce("div",{key:q,class:"flex items-center gap-1.5 text-xs text-amber-400"},[I[10]||(I[10]=J("svg",{class:"h-3 w-3 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[J("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),J("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),Vs(" "+Ct(h(q)),1)]))),128))])):st("",!0),i.value?(ee(),ce("div",{key:1,class:"text-sm text-gray-200 prose prose-sm prose-invert max-w-none",innerHTML:p(i.value)},null,8,oy)):(ee(),ce("div",iy,[...I[11]||(I[11]=[J("span",{class:"h-1.5 w-1.5 rounded-full bg-gray-500 animate-bounce",style:{"animation-delay":"0ms"}},null,-1),J("span",{class:"h-1.5 w-1.5 rounded-full bg-gray-500 animate-bounce",style:{"animation-delay":"150ms"}},null,-1),J("span",{class:"h-1.5 w-1.5 rounded-full bg-gray-500 animate-bounce",style:{"animation-delay":"300ms"}},null,-1)])]))])])):st("",!0)],512),J("div",ay,[J("div",ly,[Df(J("textarea",{ref_key:"inputEl",ref:c,"onUpdate:modelValue":I[1]||(I[1]=q=>r.value=q),rows:"1",placeholder:"Ask about your time...",class:"flex-1 resize-none rounded-xl bg-gray-700 border border-gray-600 px-3 py-2 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-amber-400 transition-colors max-h-24 overflow-y-auto",disabled:o.value,onKeydown:[Oa(Ra(y,["exact","prevent"]),["enter"]),Oa(Ra(()=>{},["shift","exact"]),["enter"])],onInput:D},null,40,cy),[[dh,r.value]]),J("button",{disabled:!r.value.trim()||o.value,class:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-xl bg-amber-400 text-gray-900 transition-all hover:bg-amber-300 disabled:opacity-40 disabled:cursor-not-allowed",onClick:y},[...I[12]||(I[12]=[J("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[J("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})],-1)])],8,uy)]),I[13]||(I[13]=J("p",{class:"mt-1.5 text-center text-xs text-gray-600"},"Enter to send · Shift+Enter for newline",-1))])])):st("",!0)]),_:1})],64))}}),dy=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},hy=dy(fy,[["__scopeId","data-v-5b6580b3"]]),py=Vn({__name:"App",setup(e){const t=so(),n=me(()=>t.isAuthenticated);return(s,r)=>{const o=Xf("RouterView");return ee(),ce(Ae,null,[Te(o),n.value?(ee(),Ut(hy,{key:0})):st("",!0),Te(Ke(eg),{position:"top-right","toast-options":{style:{background:"hsl(var(--card))",color:"hsl(var(--card-foreground))",border:"1px solid hsl(var(--border))"}}})],64)}}}),gy="modulepreload",my=function(e){return"/cc-dashboard/static/"+e},el={},ft=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.allSettled(n.map(l=>{if(l=my(l),l in el)return;el[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":gy,u||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return r.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const Gn=typeof document<"u";function Ru(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function yy(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ru(e.default)}const we=Object.assign;function Ao(e,t){const n={};for(const s in t){const r=t[s];n[s]=Tt(r)?r.map(e):e(r)}return n}const Fs=()=>{},Tt=Array.isArray;function tl(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Ou=/#/g,vy=/&/g,by=/\//g,wy=/=/g,_y=/\?/g,Tu=/\+/g,xy=/%5B/g,Ey=/%5D/g,Pu=/%5E/g,Sy=/%60/g,Du=/%7B/g,Cy=/%7C/g,Nu=/%7D/g,Ay=/%20/g;function Li(e){return e==null?"":encodeURI(""+e).replace(Cy,"|").replace(xy,"[").replace(Ey,"]")}function Ry(e){return Li(e).replace(Du,"{").replace(Nu,"}").replace(Pu,"^")}function ni(e){return Li(e).replace(Tu,"%2B").replace(Ay,"+").replace(Ou,"%23").replace(vy,"%26").replace(Sy,"`").replace(Du,"{").replace(Nu,"}").replace(Pu,"^")}function Oy(e){return ni(e).replace(wy,"%3D")}function Ty(e){return Li(e).replace(Ou,"%23").replace(_y,"%3F")}function Py(e){return Ty(e).replace(by,"%2F")}function Ws(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Dy=/\/$/,Ny=e=>e.replace(Dy,"");function Ro(e,t,n="/"){let s,r={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(s=t.slice(0,l),o=t.slice(l,a>0?a:t.length),r=e(o.slice(1))),a>=0&&(s=s||t.slice(0,a),i=t.slice(a,t.length)),s=My(s??t,n),{fullPath:s+o+i,path:s,query:r,hash:Ws(i)}}function Iy(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function nl(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Ly(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&hs(t.matched[s],n.matched[r])&&Iu(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function hs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Iu(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Fy(e[n],t[n]))return!1;return!0}function Fy(e,t){return Tt(e)?sl(e,t):Tt(t)?sl(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function sl(e,t){return Tt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function My(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let o=n.length-1,i,a;for(i=0;i