diff --git a/src/static/assets/AdminView-CREIty01.js b/src/static/assets/AdminView-p3memzOi.js similarity index 88% rename from src/static/assets/AdminView-CREIty01.js rename to src/static/assets/AdminView-p3memzOi.js index a0ee706..45b35ef 100644 --- a/src/static/assets/AdminView-CREIty01.js +++ b/src/static/assets/AdminView-p3memzOi.js @@ -1 +1 @@ -import{d as _,u as y,x as h,c as r,a as t,e as n,k as v,w as d,f as b,q as m,o as s,F as g,r as k,t as a,p as u,h as A}from"./index-CMUSrGrd.js";import{a as w}from"./admin-Do_x_iW1.js";import{_ as B,a as S}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{_ as f}from"./Badge.vue_vue_type_script_setup_true_lang-Dhaxut8t.js";import{_ as V}from"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";import{a as $}from"./utils-7WVCegLb.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"},q={class:"px-4 py-3 text-xs text-muted-foreground"},H=_({__name:"AdminView",setup(I){const x=y(),p=b(),i=m([]),l=m(!1);return h(async()=>{if(!x.isAdmin){p.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(f,{variant:e.role==="admin"?"default":"secondary",class:"text-xs"},{default:d(()=>[u(a(e.role),1)]),_:2},1032,["variant"])]),t("td",j,[n(f,{variant:e.is_active?"success":"outline",class:"text-xs"},{default:d(()=>[u(a(e.is_active?"Active":"Inactive"),1)]),_:2},1032,["variant"])]),t("td",q,a(A($)(e.created_at)),1)]))),128))])])]),_:1})]),_:1}))]))}});export{H as default}; +import{d as _,u as y,x as h,c as r,a as t,e as n,k as v,w as d,f as b,q as m,o as s,F as g,r as k,t as a,p as u,h as A}from"./index-BsVgmrYd.js";import{a as w}from"./admin-Ccc2J89T.js";import{_ as B,a as S}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{_ as f}from"./Badge.vue_vue_type_script_setup_true_lang-ctqZICyq.js";import{_ as V}from"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";import{a as $}from"./utils-7WVCegLb.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"},q={class:"px-4 py-3 text-xs text-muted-foreground"},H=_({__name:"AdminView",setup(I){const x=y(),p=b(),i=m([]),l=m(!1);return h(async()=>{if(!x.isAdmin){p.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(f,{variant:e.role==="admin"?"default":"secondary",class:"text-xs"},{default:d(()=>[u(a(e.role),1)]),_:2},1032,["variant"])]),t("td",j,[n(f,{variant:e.is_active?"success":"outline",class:"text-xs"},{default:d(()=>[u(a(e.is_active?"Active":"Inactive"),1)]),_:2},1032,["variant"])]),t("td",q,a(A($)(e.created_at)),1)]))),128))])])]),_:1})]),_:1}))]))}});export{H as default}; diff --git a/src/static/assets/AppLayout-CAE_yT_D.js b/src/static/assets/AppLayout-BwfSs1xS.js similarity index 98% rename from src/static/assets/AppLayout-CAE_yT_D.js rename to src/static/assets/AppLayout-BwfSs1xS.js index 2610796..77c9389 100644 --- a/src/static/assets/AppLayout-CAE_yT_D.js +++ b/src/static/assets/AppLayout-BwfSs1xS.js @@ -1 +1 @@ -import{d as M,u as j,c as n,b as V,a as e,F as $,r as A,t as v,h as p,j as b,o as s,k as H,w as _,i as C,n as d,l as B,g as z,m as S,p as D,K as T,f as L,e as f,T as R,q as O}from"./index-CMUSrGrd.js";const I={class:"flex flex-col h-full bg-[hsl(222_44%_7%)] border-r border-border"},P={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=M({__name:"Sidebar",emits:["close"],setup(w,{emit:k}){const a=z(),i=j(),x=k,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:"DevOps",path:"/devops",icon:"devops"},{name:"Settings",path:"/settings",icon:"settings"},{name:"Admin",path:"/admin",icon:"shield",adminOnly:!0}],m=b(()=>u.filter(h=>!h.adminOnly||i.isAdmin));function r(h){return h==="/"?a.path==="/":a.path.startsWith(h)}const l=b(()=>{var t,c;return(((t=i.user)==null?void 0:t.username)??((c=i.user)==null?void 0:c.email)??"?").slice(0,2).toUpperCase()});return(h,t)=>{var g,y;const c=B("RouterLink");return s(),n("aside",I,[t[12]||(t[12]=V('

CC Dashboard

Oliver Agency

',1)),e("nav",P,[(s(!0),n($,null,A(m.value,o=>(s(),H(c,{key:o.path,to:o.path,class:d(["relative flex items-center gap-3 px-3 h-10 rounded-lg text-sm font-medium transition-all duration-150 group",r(o.path)?"bg-primary/10 text-primary":"text-white/60 hover:bg-white/5 hover:text-white"]),onClick:t[0]||(t[0]=ne=>x("close"))},{default:_(()=>[r(o.path)?(s(),n("span",N)):C("",!0),o.icon==="grid"?(s(),n("svg",{key:1,class:d(["h-4 w-4 shrink-0 transition-colors",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[1]||(t[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"},null,-1)])],2)):o.icon==="calendar"?(s(),n("svg",{key:2,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[2]||(t[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2)):o.icon==="check-square"?(s(),n("svg",{key:3,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[3]||(t[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},null,-1)])],2)):o.icon==="folder"?(s(),n("svg",{key:4,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[4]||(t[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"},null,-1)])],2)):o.icon==="activity"?(s(),n("svg",{key:5,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[5]||(t[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"},null,-1)])],2)):o.icon==="file-text"?(s(),n("svg",{key:6,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[6]||(t[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 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"},null,-1)])],2)):o.icon==="key"?(s(),n("svg",{key:7,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[7]||(t[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])],2)):o.icon==="devops"?(s(),n("svg",{key:8,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[8]||(t[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},null,-1)])],2)):o.icon==="settings"?(s(),n("svg",{key:9,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"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.065 2.572c1.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.572 1.065c-.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.065-2.572c-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"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)):o.icon==="shield"?(s(),n("svg",{key:10,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)])],2)):C("",!0),e("span",F,v(o.name),1)]),_:2},1032,["to","class"]))),128))]),e("div",K,[e("div",q,[e("div",E,v(l.value),1),e("div",U,[e("p",W,v(((g=p(i).user)==null?void 0:g.username)??((y=p(i).user)==null?void 0:y.email)),1),t[11]||(t[11]=e("div",{class:"flex items-center gap-1 mt-0.5"},[e("div",{class:"h-1.5 w-1.5 rounded-full bg-[hsl(var(--success))]"}),e("span",{class:"text-[10px] text-white/45"},"Online")],-1))])])])])}}}),J={class:"h-14 border-b border-border bg-card/95 backdrop-blur-sm flex items-center px-4 gap-3 shrink-0 sticky top-0 z-10"},Q={class:"flex-1"},X={class:"text-sm font-semibold text-foreground"},Y={class:"flex items-center gap-2.5"},Z={class:"h-7 w-7 rounded-full bg-primary/15 ring-1 ring-primary/25 flex items-center justify-center text-[10px] font-bold text-primary shrink-0"},ee={class:"hidden sm:block text-xs font-medium text-foreground max-w-[120px] truncate"},te=M({__name:"TopBar",props:{title:{},sidebarOpen:{type:Boolean}},emits:["toggleSidebar","toggleDark"],setup(w,{emit:k}){const a=k,i=j(),x=L();async function u(){await i.logout(),T.success("Logged out"),x.push({name:"login"})}function m(){const r=document.documentElement.classList.toggle("dark");localStorage.setItem("theme",r?"dark":"light"),a("toggleDark")}return(r,l)=>{var h,t,c,g;return s(),n("header",J,[e("button",{class:"lg:hidden flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle sidebar",onClick:l[0]||(l[0]=y=>a("toggleSidebar"))},[...l[1]||(l[1]=[e("svg",{class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("div",Q,[e("h1",X,v(w.title??"CC Dashboard"),1)]),S(r.$slots,"actions"),e("button",{class:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle dark mode",onClick:m},[...l[2]||(l[2]=[e("svg",{class:"h-4 w-4 hidden dark:block",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})],-1),e("svg",{class:"h-4 w-4 dark:hidden",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})],-1)])]),l[4]||(l[4]=e("div",{class:"h-6 w-px bg-border"},null,-1)),e("div",Y,[e("div",Z,v((((h=p(i).user)==null?void 0:h.username)??((t=p(i).user)==null?void 0:t.email)??"?").slice(0,2).toUpperCase()),1),e("span",ee,v(((c=p(i).user)==null?void 0:c.username)??((g=p(i).user)==null?void 0:g.email)),1),e("button",{class:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",onClick:u},[...l[3]||(l[3]=[e("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),D(" Sign out ",-1)])])])])}}}),oe={class:"h-screen flex overflow-hidden bg-background"},re={class:"flex-1 flex flex-col overflow-hidden min-w-0"},se={class:"flex-1 overflow-y-auto"},ie=M({__name:"AppLayout",setup(w){const k=z(),a=O(!1),i=b(()=>({dashboard:"Dashboard",calendar:"Calendar",planner:"Planner",projects:"Projects","project-detail":"Project Details",live:"Live Feed",reports:"AI Reports",keys:"API Keys",settings:"Settings",admin:"Admin"})[k.name]??"CC Dashboard");return(x,u)=>{const m=B("RouterView");return s(),n("div",oe,[f(R,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:_(()=>[a.value?(s(),n("div",{key:0,class:"fixed inset-0 z-20 bg-black/60 lg:hidden",onClick:u[0]||(u[0]=r=>a.value=!1)})):C("",!0)]),_:1}),e("div",{class:d(["fixed inset-y-0 left-0 z-30 w-60 transform transition-transform duration-300 lg:relative lg:translate-x-0",a.value?"translate-x-0":"-translate-x-full"])},[f(G,{onClose:u[1]||(u[1]=r=>a.value=!1)})],2),e("div",re,[f(te,{title:i.value,"sidebar-open":a.value,onToggleSidebar:u[2]||(u[2]=r=>a.value=!a.value)},null,8,["title","sidebar-open"]),e("main",se,[f(m)])])])}}});export{ie as default}; +import{d as M,u as j,c as n,b as V,a as e,F as $,r as A,t as v,h as p,j as b,o as s,k as H,w as _,i as C,n as d,l as B,g as z,m as S,p as D,K as T,f as L,e as f,T as R,q as O}from"./index-BsVgmrYd.js";const I={class:"flex flex-col h-full bg-[hsl(222_44%_7%)] border-r border-border"},P={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=M({__name:"Sidebar",emits:["close"],setup(w,{emit:k}){const a=z(),i=j(),x=k,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:"DevOps",path:"/devops",icon:"devops"},{name:"Settings",path:"/settings",icon:"settings"},{name:"Admin",path:"/admin",icon:"shield",adminOnly:!0}],m=b(()=>u.filter(h=>!h.adminOnly||i.isAdmin));function r(h){return h==="/"?a.path==="/":a.path.startsWith(h)}const l=b(()=>{var t,c;return(((t=i.user)==null?void 0:t.username)??((c=i.user)==null?void 0:c.email)??"?").slice(0,2).toUpperCase()});return(h,t)=>{var g,y;const c=B("RouterLink");return s(),n("aside",I,[t[12]||(t[12]=V('

CC Dashboard

Oliver Agency

',1)),e("nav",P,[(s(!0),n($,null,A(m.value,o=>(s(),H(c,{key:o.path,to:o.path,class:d(["relative flex items-center gap-3 px-3 h-10 rounded-lg text-sm font-medium transition-all duration-150 group",r(o.path)?"bg-primary/10 text-primary":"text-white/60 hover:bg-white/5 hover:text-white"]),onClick:t[0]||(t[0]=ne=>x("close"))},{default:_(()=>[r(o.path)?(s(),n("span",N)):C("",!0),o.icon==="grid"?(s(),n("svg",{key:1,class:d(["h-4 w-4 shrink-0 transition-colors",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[1]||(t[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"},null,-1)])],2)):o.icon==="calendar"?(s(),n("svg",{key:2,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[2]||(t[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2)):o.icon==="check-square"?(s(),n("svg",{key:3,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[3]||(t[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},null,-1)])],2)):o.icon==="folder"?(s(),n("svg",{key:4,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[4]||(t[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"},null,-1)])],2)):o.icon==="activity"?(s(),n("svg",{key:5,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[5]||(t[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"},null,-1)])],2)):o.icon==="file-text"?(s(),n("svg",{key:6,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[6]||(t[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 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"},null,-1)])],2)):o.icon==="key"?(s(),n("svg",{key:7,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[7]||(t[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])],2)):o.icon==="devops"?(s(),n("svg",{key:8,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[8]||(t[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},null,-1)])],2)):o.icon==="settings"?(s(),n("svg",{key:9,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"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.065 2.572c1.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.572 1.065c-.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.065-2.572c-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"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)):o.icon==="shield"?(s(),n("svg",{key:10,class:d(["h-4 w-4 shrink-0",r(o.path)?"text-primary":"text-white/40 group-hover:text-white/70"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)])],2)):C("",!0),e("span",F,v(o.name),1)]),_:2},1032,["to","class"]))),128))]),e("div",K,[e("div",q,[e("div",E,v(l.value),1),e("div",U,[e("p",W,v(((g=p(i).user)==null?void 0:g.username)??((y=p(i).user)==null?void 0:y.email)),1),t[11]||(t[11]=e("div",{class:"flex items-center gap-1 mt-0.5"},[e("div",{class:"h-1.5 w-1.5 rounded-full bg-[hsl(var(--success))]"}),e("span",{class:"text-[10px] text-white/45"},"Online")],-1))])])])])}}}),J={class:"h-14 border-b border-border bg-card/95 backdrop-blur-sm flex items-center px-4 gap-3 shrink-0 sticky top-0 z-10"},Q={class:"flex-1"},X={class:"text-sm font-semibold text-foreground"},Y={class:"flex items-center gap-2.5"},Z={class:"h-7 w-7 rounded-full bg-primary/15 ring-1 ring-primary/25 flex items-center justify-center text-[10px] font-bold text-primary shrink-0"},ee={class:"hidden sm:block text-xs font-medium text-foreground max-w-[120px] truncate"},te=M({__name:"TopBar",props:{title:{},sidebarOpen:{type:Boolean}},emits:["toggleSidebar","toggleDark"],setup(w,{emit:k}){const a=k,i=j(),x=L();async function u(){await i.logout(),T.success("Logged out"),x.push({name:"login"})}function m(){const r=document.documentElement.classList.toggle("dark");localStorage.setItem("theme",r?"dark":"light"),a("toggleDark")}return(r,l)=>{var h,t,c,g;return s(),n("header",J,[e("button",{class:"lg:hidden flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle sidebar",onClick:l[0]||(l[0]=y=>a("toggleSidebar"))},[...l[1]||(l[1]=[e("svg",{class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("div",Q,[e("h1",X,v(w.title??"CC Dashboard"),1)]),S(r.$slots,"actions"),e("button",{class:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle dark mode",onClick:m},[...l[2]||(l[2]=[e("svg",{class:"h-4 w-4 hidden dark:block",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})],-1),e("svg",{class:"h-4 w-4 dark:hidden",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})],-1)])]),l[4]||(l[4]=e("div",{class:"h-6 w-px bg-border"},null,-1)),e("div",Y,[e("div",Z,v((((h=p(i).user)==null?void 0:h.username)??((t=p(i).user)==null?void 0:t.email)??"?").slice(0,2).toUpperCase()),1),e("span",ee,v(((c=p(i).user)==null?void 0:c.username)??((g=p(i).user)==null?void 0:g.email)),1),e("button",{class:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",onClick:u},[...l[3]||(l[3]=[e("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),D(" Sign out ",-1)])])])])}}}),oe={class:"h-screen flex overflow-hidden bg-background"},re={class:"flex-1 flex flex-col overflow-hidden min-w-0"},se={class:"flex-1 overflow-y-auto"},ie=M({__name:"AppLayout",setup(w){const k=z(),a=O(!1),i=b(()=>({dashboard:"Dashboard",calendar:"Calendar",planner:"Planner",projects:"Projects","project-detail":"Project Details",live:"Live Feed",reports:"AI Reports",keys:"API Keys",settings:"Settings",admin:"Admin"})[k.name]??"CC Dashboard");return(x,u)=>{const m=B("RouterView");return s(),n("div",oe,[f(R,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:_(()=>[a.value?(s(),n("div",{key:0,class:"fixed inset-0 z-20 bg-black/60 lg:hidden",onClick:u[0]||(u[0]=r=>a.value=!1)})):C("",!0)]),_:1}),e("div",{class:d(["fixed inset-y-0 left-0 z-30 w-60 transform transition-transform duration-300 lg:relative lg:translate-x-0",a.value?"translate-x-0":"-translate-x-full"])},[f(G,{onClose:u[1]||(u[1]=r=>a.value=!1)})],2),e("div",re,[f(te,{title:i.value,"sidebar-open":a.value,onToggleSidebar:u[2]||(u[2]=r=>a.value=!a.value)},null,8,["title","sidebar-open"]),e("main",se,[f(m)])])])}}});export{ie as default}; diff --git a/src/static/assets/Badge.vue_vue_type_script_setup_true_lang-Dhaxut8t.js b/src/static/assets/Badge.vue_vue_type_script_setup_true_lang-ctqZICyq.js similarity index 91% rename from src/static/assets/Badge.vue_vue_type_script_setup_true_lang-Dhaxut8t.js rename to src/static/assets/Badge.vue_vue_type_script_setup_true_lang-ctqZICyq.js index b79e961..28f494e 100644 --- a/src/static/assets/Badge.vue_vue_type_script_setup_true_lang-Dhaxut8t.js +++ b/src/static/assets/Badge.vue_vue_type_script_setup_true_lang-ctqZICyq.js @@ -1 +1 @@ -import{c as a}from"./utils-7WVCegLb.js";import{d as n,o,c as s,n as d,h as i,m as c}from"./index-CMUSrGrd.js";const f=n({__name:"Badge",props:{variant:{default:"default"},class:{}},setup(r){const e=r;return(t,l)=>(o(),s("span",{class:d(i(a)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",{"bg-primary text-primary-foreground":e.variant==="default","bg-secondary text-secondary-foreground":e.variant==="secondary","bg-destructive text-destructive-foreground":e.variant==="destructive","border border-border text-foreground":e.variant==="outline","bg-emerald-500/20 text-emerald-400":e.variant==="success","bg-amber-500/20 text-amber-400":e.variant==="warning"},e.class))},[c(t.$slots,"default")],2))}});export{f as _}; +import{c as a}from"./utils-7WVCegLb.js";import{d as n,o,c as s,n as d,h as i,m as c}from"./index-BsVgmrYd.js";const f=n({__name:"Badge",props:{variant:{default:"default"},class:{}},setup(r){const e=r;return(t,l)=>(o(),s("span",{class:d(i(a)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",{"bg-primary text-primary-foreground":e.variant==="default","bg-secondary text-secondary-foreground":e.variant==="secondary","bg-destructive text-destructive-foreground":e.variant==="destructive","border border-border text-foreground":e.variant==="outline","bg-emerald-500/20 text-emerald-400":e.variant==="success","bg-amber-500/20 text-amber-400":e.variant==="warning"},e.class))},[c(t.$slots,"default")],2))}});export{f as _}; diff --git a/src/static/assets/Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js b/src/static/assets/Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js similarity index 91% rename from src/static/assets/Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js rename to src/static/assets/Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js index 46302a4..1c1f604 100644 --- a/src/static/assets/Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js +++ b/src/static/assets/Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js @@ -1 +1 @@ -import{_ as c}from"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";import{c as l}from"./utils-7WVCegLb.js";import{d as u,c as m,n as f,k as b,i as v,m as g,j as p,o as n}from"./index-CMUSrGrd.js";const y=["type","disabled"],z=u({__name:"Button",props:{variant:{default:"default"},size:{default:"md"},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},type:{default:"button"},class:{}},emits:["click"],setup(t,{emit:s}){const e=t,a=s,r=p(()=>l("inline-flex items-center justify-center rounded-md font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",{"bg-primary text-primary-foreground hover:bg-primary/90":e.variant==="default","border border-input bg-background hover:bg-accent hover:text-accent-foreground":e.variant==="outline","hover:bg-accent hover:text-accent-foreground":e.variant==="ghost","bg-destructive text-destructive-foreground hover:bg-destructive/90":e.variant==="destructive","bg-secondary text-secondary-foreground hover:bg-secondary/80":e.variant==="secondary","underline-offset-4 hover:underline text-primary":e.variant==="link","h-8 px-3 text-xs":e.size==="sm","h-10 px-4 py-2 text-sm":e.size==="md","h-11 px-8 text-base":e.size==="lg","h-9 w-9 p-0":e.size==="icon"},e.class));return(i,o)=>(n(),m("button",{class:f(r.value),type:t.type,disabled:t.disabled||t.loading,onClick:o[0]||(o[0]=d=>a("click",d))},[t.loading?(n(),b(c,{key:0,size:"sm",class:"mr-2"})):v("",!0),g(i.$slots,"default")],10,y))}});export{z as _}; +import{_ as c}from"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";import{c as l}from"./utils-7WVCegLb.js";import{d as u,c as m,n as f,k as b,i as v,m as g,j as p,o as n}from"./index-BsVgmrYd.js";const y=["type","disabled"],z=u({__name:"Button",props:{variant:{default:"default"},size:{default:"md"},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},type:{default:"button"},class:{}},emits:["click"],setup(t,{emit:s}){const e=t,a=s,r=p(()=>l("inline-flex items-center justify-center rounded-md font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",{"bg-primary text-primary-foreground hover:bg-primary/90":e.variant==="default","border border-input bg-background hover:bg-accent hover:text-accent-foreground":e.variant==="outline","hover:bg-accent hover:text-accent-foreground":e.variant==="ghost","bg-destructive text-destructive-foreground hover:bg-destructive/90":e.variant==="destructive","bg-secondary text-secondary-foreground hover:bg-secondary/80":e.variant==="secondary","underline-offset-4 hover:underline text-primary":e.variant==="link","h-8 px-3 text-xs":e.size==="sm","h-10 px-4 py-2 text-sm":e.size==="md","h-11 px-8 text-base":e.size==="lg","h-9 w-9 p-0":e.size==="icon"},e.class));return(i,o)=>(n(),m("button",{class:f(r.value),type:t.type,disabled:t.disabled||t.loading,onClick:o[0]||(o[0]=d=>a("click",d))},[t.loading?(n(),b(c,{key:0,size:"sm",class:"mr-2"})):v("",!0),g(i.$slots,"default")],10,y))}});export{z as _}; diff --git a/src/static/assets/CalendarView-DewkDTAU.js b/src/static/assets/CalendarView-B1FdrWUb.js similarity index 97% rename from src/static/assets/CalendarView-DewkDTAU.js rename to src/static/assets/CalendarView-B1FdrWUb.js index 0ea364d..cb43154 100644 --- a/src/static/assets/CalendarView-DewkDTAU.js +++ b/src/static/assets/CalendarView-B1FdrWUb.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TaskForm.vue_vue_type_script_setup_true_lang-grpGvlfv.js","assets/index-CMUSrGrd.js","assets/index-DopqRgoW.css","assets/Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js","assets/Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js","assets/Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js","assets/utils-7WVCegLb.js","assets/Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js","assets/devops-DCMlzRTJ.js"])))=>i.map(i=>d[i]); -import{B as Ne,q as T,j as W,d as U,o as k,c as p,a as h,e as E,w as G,p as Te,t as M,h as x,i as O,n as Y,A as H,C as Pe,F as L,r as j,k as He,x as Oe,g as qe,_ as Re,K as V,f as ze}from"./index-CMUSrGrd.js";import{d as Ve}from"./dashboard-BcrvrRpF.js";import{i as P,f as ee}from"./utils-7WVCegLb.js";import{_ as te}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{u as le,_ as Ae}from"./TaskForm.vue_vue_type_script_setup_true_lang-grpGvlfv.js";import{_ as Ie}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as Qe}from"./Badge.vue_vue_type_script_setup_true_lang-Dhaxut8t.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";import"./Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js";import"./Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js";import"./devops-DCMlzRTJ.js";const ne=40/30;function Xe(t){if(t.length===0)return[];const e=[...t].sort((o,l)=>new Date(o.start_at).getTime()-new Date(l.start_at).getTime()),n=[],r=[];for(const o of e){const l=new Date(o.start_at).getTime(),c=new Date(o.end_at).getTime();let s=-1;for(let f=0;f{const c=new Date(o.start_at).getTime(),s=new Date(o.end_at).getTime();let f=l;for(const m of r){const g=new Date(m.block.start_at).getTime(),w=new Date(m.block.end_at).getTime();gc&&m.lane>f&&(f=m.lane)}return{block:o,lane:l,totalLanes:f+1}})}function Ge(t,e=7){return((t.getHours()-e)*60+t.getMinutes())*ne}function Je(t,e){const n=(e.getTime()-t.getTime())/6e4;return Math.max(n*ne,20)}function be(t,e=7){const n=t.getDay(),r=new Date(t);return r.setDate(t.getDate()-(n+6)%7),r.setHours(0,0,0,0),Array.from({length:e},(a,o)=>{const l=new Date(r);return l.setDate(r.getDate()+o),l})}function ke(t,e=15){return Math.round(t/e)*e}const K=Ne("calendar",()=>{const t=T([]),e=T(new Date),n=T("week"),r=T(7),a=T(!1),o=T(null),l=W(()=>be(e.value,r.value));async function c(u,v,_){a.value=!0,o.value=null;try{const C=await Ve.calendar({from:u,to:v,view:_});t.value=C.data}catch(C){const Z=C;o.value=Z.message??"Failed to fetch calendar"}finally{a.value=!1}}function s(u){r.value=u}async function f(){if(n.value==="week"){const u=be(e.value,r.value),v=P(u[0]),_=P(u[r.value-1]);await c(v,_,"week")}else{const u=P(e.value);await c(u,u,"day")}}function m(){const u=new Date(e.value);n.value==="week"?u.setDate(u.getDate()-7):u.setDate(u.getDate()-1),e.value=u}function g(){const u=new Date(e.value);n.value==="week"?u.setDate(u.getDate()+7):u.setDate(u.getDate()+1),e.value=u}function w(){e.value=new Date}function y(u){n.value=u}function b(u){t.value.push(u)}function d(u){const v=t.value.findIndex(_=>_.id===u.id);v!==-1&&(t.value[v]=u)}function i(u){t.value=t.value.filter(v=>v.id!==u)}function S(u){const v=P(u);return t.value.filter(_=>P(new Date(_.start_at))===v)}return{blocks:t,currentDate:e,view:n,weekLength:r,loading:a,error:o,weekDays:l,fetch:c,fetchCurrentView:f,navigatePrev:m,navigateNext:g,goToToday:w,setView:y,setWeekLength:s,addBlock:b,updateBlock:d,removeBlock:i,getBlocksForDay:S}});function $(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function R(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const Ce=6048e5,Ue=864e5;let Ke={};function ae(){return Ke}function J(t,e){var c,s,f,m;const n=ae(),r=(e==null?void 0:e.weekStartsOn)??((s=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:s.weekStartsOn)??n.weekStartsOn??((m=(f=n.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??0,a=$(t),o=a.getDay(),l=(o=a.getTime()?n+1:e.getTime()>=l.getTime()?n:n-1}function xe(t){const e=$(t);return e.setHours(0,0,0,0),e}function pe(t){const e=$(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Ze(t,e){const n=xe(t),r=xe(e),a=+n-pe(n),o=+r-pe(r);return Math.round((a-o)/Ue)}function et(t){const e=$e(t),n=R(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),re(n)}function tt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nt(t){if(!tt(t)&&typeof t!="number")return!1;const e=$(t);return!isNaN(Number(e))}function rt(t){const e=$(t),n=R(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const at={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ot=(t,e,n)=>{let r;const a=at[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ce(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const st={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ct={date:ce({formats:st,defaultWidth:"full"}),time:ce({formats:it,defaultWidth:"full"}),dateTime:ce({formats:ut,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lt=(t,e,n,r)=>dt[t];function Q(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,c=n!=null&&n.width?String(n.width):l;a=t.formattingValues[c]||t.formattingValues[l]}else{const l=t.defaultWidth,c=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[c]||t.values[l]}const o=t.argumentCallback?t.argumentCallback(e):e;return a[o]}}const ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ht={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},yt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},bt={ordinalNumber:yt,era:Q({values:ft,defaultWidth:"wide"}),quarter:Q({values:mt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:ht,defaultWidth:"wide"}),day:Q({values:gt,defaultWidth:"wide"}),dayPeriod:Q({values:wt,defaultWidth:"wide",formattingValues:vt,defaultFormattingWidth:"wide"})};function X(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const l=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(c)?xt(c,g=>g.test(l)):kt(c,g=>g.test(l));let f;f=t.valueCallback?t.valueCallback(s):s,f=n.valueCallback?n.valueCallback(f):f;const m=e.slice(l.length);return{value:f,rest:m}}}function kt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function xt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],o=e.match(t.parsePattern);if(!o)return null;let l=t.valueCallback?t.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const c=e.slice(a.length);return{value:l,rest:c}}}const Dt=/^(\d+)(th|st|nd|rd)?/i,_t=/\d+/i,Mt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},St={any:[/^b/i,/^(a|c)/i]},Tt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pt={any:[/1/i,/2/i,/3/i,/4/i]},Ot={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ct={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$t={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Wt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Et={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Bt={ordinalNumber:pt({matchPattern:Dt,parsePattern:_t,valueCallback:t=>parseInt(t,10)}),era:X({matchPatterns:Mt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),quarter:X({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:Pt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:X({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),day:X({matchPatterns:$t,defaultMatchWidth:"wide",parsePatterns:Wt,defaultParseWidth:"any"}),dayPeriod:X({matchPatterns:Et,defaultMatchWidth:"any",parsePatterns:Yt,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:ot,formatLong:ct,formatRelative:lt,localize:bt,match:Bt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lt(t){const e=$(t);return Ze(e,rt(e))+1}function jt(t){const e=$(t),n=+re(e)-+et(e);return Math.round(n/Ce)+1}function We(t,e){var m,g,w,y;const n=$(t),r=n.getFullYear(),a=ae(),o=(e==null?void 0:e.firstWeekContainsDate)??((g=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((y=(w=a.locale)==null?void 0:w.options)==null?void 0:y.firstWeekContainsDate)??1,l=R(t,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const c=J(l,e),s=R(t,0);s.setFullYear(r,0,o),s.setHours(0,0,0,0);const f=J(s,e);return n.getTime()>=c.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function Nt(t,e){var c,s,f,m;const n=ae(),r=(e==null?void 0:e.firstWeekContainsDate)??((s=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:s.firstWeekContainsDate)??n.firstWeekContainsDate??((m=(f=n.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=We(t,e),o=R(t,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),J(o,e)}function Ht(t,e){const n=$(t),r=+J(n,e)-+Nt(n,e);return Math.round(r/Ce)+1}function D(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const B={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return D(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):D(n+1,2)},d(t,e){return D(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return D(t.getHours()%12||12,e.length)},H(t,e){return D(t.getHours(),e.length)},m(t,e){return D(t.getMinutes(),e.length)},s(t,e){return D(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return D(a,e.length)}},A={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},De={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return B.y(t,e)},Y:function(t,e,n,r){const a=We(t,r),o=a>0?a:1-a;if(e==="YY"){const l=o%100;return D(l,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):D(o,e.length)},R:function(t,e){const n=$e(t);return D(n,e.length)},u:function(t,e){const n=t.getFullYear();return D(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return D(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return D(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return B.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return D(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ht(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):D(a,e.length)},I:function(t,e,n){const r=jt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):D(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):B.d(t,e)},D:function(t,e,n){const r=Lt(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):D(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return D(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return D(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return D(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=A.noon:r===0?a=A.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=A.evening:r>=12?a=A.afternoon:r>=4?a=A.morning:a=A.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return B.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):B.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):D(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):D(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):B.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):B.s(t,e)},S:function(t,e){return B.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Me(r);case"XXXX":case"XX":return N(r);case"XXXXX":case"XXX":default:return N(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Me(r);case"xxxx":case"xx":return N(r);case"xxxxx":case"xxx":default:return N(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+_e(r,":");case"OOOO":default:return"GMT"+N(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+_e(r,":");case"zzzz":default:return"GMT"+N(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return D(r,e.length)},T:function(t,e,n){const r=t.getTime();return D(r,e.length)}};function _e(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+e+D(o,2)}function Me(t,e){return t%60===0?(t>0?"-":"+")+D(Math.abs(t)/60,2):N(t,e)}function N(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=D(Math.trunc(r/60),2),o=D(r%60,2);return n+a+e+o}const Se=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ee=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},qt=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Se(t,e);let o;switch(r){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Se(r,e)).replace("{{time}}",Ee(a,e))},Rt={p:Ee,P:qt},zt=/^D+$/,Vt=/^Y+$/,At=["D","DD","YY","YYYY"];function It(t){return zt.test(t)}function Qt(t){return Vt.test(t)}function Xt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),At.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Jt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ut=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Kt=/^'([^]*?)'?$/,Zt=/''/g,en=/[a-zA-Z]/;function q(t,e,n){var m,g,w,y,b,d,i,S;const r=ae(),a=(n==null?void 0:n.locale)??r.locale??Ft,o=(n==null?void 0:n.firstWeekContainsDate)??((g=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??r.firstWeekContainsDate??((y=(w=r.locale)==null?void 0:w.options)==null?void 0:y.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((d=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:d.weekStartsOn)??r.weekStartsOn??((S=(i=r.locale)==null?void 0:i.options)==null?void 0:S.weekStartsOn)??0,c=$(t);if(!nt(c))throw new RangeError("Invalid time value");let s=e.match(Ut).map(u=>{const v=u[0];if(v==="p"||v==="P"){const _=Rt[v];return _(u,a.formatLong)}return u}).join("").match(Jt).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const v=u[0];if(v==="'")return{isToken:!1,value:tn(u)};if(De[v])return{isToken:!0,value:u};if(v.match(en))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(s=a.localize.preprocessor(c,s));const f={firstWeekContainsDate:o,weekStartsOn:l,locale:a};return s.map(u=>{if(!u.isToken)return u.value;const v=u.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Qt(v)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&It(v))&&Xt(v,e,String(t));const _=De[v[0]];return _(c,v,a.localize,f)}).join("")}function tn(t){const e=t.match(Kt);return e?e[1].replace(Zt,"'"):t}const nn={class:"flex items-center gap-2 flex-wrap"},rn={class:"flex items-center gap-1"},an={class:"text-sm font-medium text-foreground flex-1 min-w-0 truncate"},on={key:0,class:"text-xs text-muted-foreground"},sn={class:"flex items-center rounded-md border border-border overflow-hidden"},un={key:1,class:"flex items-center rounded-md border border-border overflow-hidden"},cn=U({__name:"CalendarToolbar",setup(t){const e=K(),n=W(()=>{if(e.view==="week"){const c=e.weekDays;if(!c.length)return"";const s=c[0],f=c[c.length-1];return s.getMonth()===f.getMonth()?`${q(s,"MMM d")} – ${q(f,"d, yyyy")}`:`${q(s,"MMM d")} – ${q(f,"MMM d, yyyy")}`}else return q(e.currentDate,"EEEE, MMMM d, yyyy")});async function r(c){c==="prev"?e.navigatePrev():e.navigateNext(),await e.fetchCurrentView()}async function a(){e.goToToday(),await e.fetchCurrentView()}async function o(c){e.setView(c),await e.fetchCurrentView()}async function l(c){e.setWeekLength(c),await e.fetchCurrentView()}return(c,s)=>(k(),p("div",nn,[h("div",rn,[E(te,{variant:"outline",size:"sm",onClick:s[0]||(s[0]=f=>r("prev"))},{default:G(()=>[...s[6]||(s[6]=[h("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),_:1}),E(te,{variant:"outline",size:"sm",onClick:a},{default:G(()=>[...s[7]||(s[7]=[Te("Today",-1)])]),_:1}),E(te,{variant:"outline",size:"sm",onClick:s[1]||(s[1]=f=>r("next"))},{default:G(()=>[...s[8]||(s[8]=[h("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])]),_:1})]),h("span",an,M(n.value),1),x(e).loading?(k(),p("div",on,"Loading...")):O("",!0),h("div",sn,[h("button",{class:Y(["px-3 py-1.5 text-xs font-medium transition-colors",x(e).view==="day"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s[2]||(s[2]=f=>o("day"))}," Day ",2),h("button",{class:Y(["px-3 py-1.5 text-xs font-medium transition-colors",x(e).view==="week"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s[3]||(s[3]=f=>o("week"))}," Week ",2)]),x(e).view==="week"?(k(),p("div",un,[h("button",{class:Y(["px-3 py-1.5 text-xs font-medium transition-colors",x(e).weekLength===5?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s[4]||(s[4]=f=>l(5))}," 5d ",2),h("button",{class:Y(["px-3 py-1.5 text-xs font-medium transition-colors",x(e).weekLength===7?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s[5]||(s[5]=f=>l(7))}," 7d ",2)])):O("",!0)]))}}),dn=7;function Ye(){const t=le(),e=K(),n=T(null),r=T(null),a=T(null),o=T(null);function l(d,i){var S,u;n.value=d.id,(S=i.dataTransfer)==null||S.setData("task_id",d.id),(u=i.dataTransfer)==null||u.setData("estimate_hours",String(d.estimate_hours??1))}function c(d,i){var u,v,_,C;const S=new Date(d.end_at).getTime()-new Date(d.start_at).getTime();(u=i.dataTransfer)==null||u.setData("block_id",d.id),(v=i.dataTransfer)==null||v.setData("block_duration_ms",String(S)),(_=i.dataTransfer)==null||_.setData("task_id",d.task_id??""),(C=i.dataTransfer)==null||C.setData("estimate_hours",String(S/36e5))}function s(d,i){i.preventDefault(),r.value=P(d)}function f(){r.value=null}async function m(d,i){var he,ge,we,ve;i.preventDefault(),r.value=null,n.value=null;const S=(he=i.dataTransfer)==null?void 0:he.getData("block_id"),u=(ge=i.dataTransfer)==null?void 0:ge.getData("task_id"),v=parseFloat(((we=i.dataTransfer)==null?void 0:we.getData("estimate_hours"))??"1")||1,_=parseFloat(((ve=i.dataTransfer)==null?void 0:ve.getData("block_duration_ms"))??"0"),Z=i.currentTarget.getBoundingClientRect(),oe=i.clientY-Z.top,se=ke(oe/ne,15),Be=Math.max(0,Math.min(se,12*60)),z=new Date(d);z.setHours(dn,0,0,0),z.setMinutes(z.getMinutes()+Be);const ie=z.toISOString();if(S&&_>0){const Le=new Date(z.getTime()+_).toISOString();try{await t.updateBlock(S,{start_at:ie,end_at:Le}),await e.fetchCurrentView()}catch(je){console.error("Failed to move block:",je)}return}if(!u)return;const ue=new Date(z);ue.setMinutes(ue.getMinutes()+Math.round(v*60));const fe=ue.toISOString(),me=`temp_${Date.now()}`,Fe={kind:"planned",id:me,project_id:null,job_number:"",display_name:"Loading...",start_at:ie,end_at:fe,title:"",color_hue:260,tags:[],task_id:u,session_id:null,manual_entry_id:null};e.addBlock(Fe);try{await t.createBlock(u,{start_at:ie,end_at:fe}),await e.fetchCurrentView()}catch(ye){e.removeBlock(me),console.error("Failed to create task block:",ye)}}let g=0,w="",y=null;function b(d,i){i.preventDefault(),i.stopPropagation(),a.value=d,y=d,g=i.clientY,w=d.end_at,o.value=d.end_at;const S=v=>{if(!y)return;const _=v.clientY-g,C=ke(_/ne,15),oe=new Date(w).getTime()+C*6e4,se=new Date(y.start_at).getTime()+15*6e4;o.value=new Date(Math.max(oe,se)).toISOString()},u=async()=>{if(document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",u),!y||!o.value){a.value=null;return}const v=y.id,_=o.value;if(_===w){a.value=null,o.value=null;return}try{y.task_id&&await t.updateBlock(v,{start_at:y.start_at,end_at:_}),e.updateBlock({...y,end_at:_})}catch(C){console.error("Failed to resize block:",C),e.updateBlock({...y,end_at:w})}a.value=null,o.value=null,y=null};document.addEventListener("mousemove",S),document.addEventListener("mouseup",u)}return{draggingTaskId:n,dragOverDay:r,resizingBlock:a,resizePreviewEnd:o,onDragStart:l,onBlockDragStart:c,onDragOver:s,onDragLeave:f,onDrop:m,onResizeStart:b}}function ln(t){return`hsla(${t}, 65%, 45%, 0.85)`}function fn(t){return`hsla(${t}, 65%, 55%, 1)`}const mn=["draggable"],hn={class:"px-1.5 py-1 h-full flex flex-col text-white overflow-hidden"},gn={class:"text-xs font-semibold leading-tight truncate"},wn={key:0,class:"text-xs opacity-75 truncate"},vn={key:1,class:"text-xs opacity-75 mt-auto"},yn=U({__name:"CalendarBlock",props:{block:{},lane:{},totalLanes:{},top:{},height:{},resizeEnd:{}},emits:["resizeStart","click","blockDragStart"],setup(t,{emit:e}){const n=t,r=e,a=W(()=>n.resizeEnd?new Date(n.resizeEnd):new Date(n.block.end_at)),o=W(()=>{if(!n.resizeEnd)return n.height;const m=(a.value.getTime()-new Date(n.block.start_at).getTime())/6e4;return Math.max(m*(40/30),20)}),l=W(()=>{const f=a.value.getTime()-new Date(n.block.start_at).getTime();return ee(f/36e5)}),c=W(()=>{const f=`calc(${100/n.totalLanes}% - 2px)`,m=`calc(${n.lane/n.totalLanes*100}% + 1px)`;return{top:`${n.top}px`,height:`${o.value}px`,width:f,left:m,backgroundColor:ln(n.block.color_hue),borderColor:fn(n.block.color_hue)}}),s=W(()=>o.value<40);return(f,m)=>(k(),p("div",{class:Y(["absolute rounded overflow-hidden cursor-pointer select-none group",{"border-2":t.block.kind==="session","border-2 border-dashed opacity-80":t.block.kind==="planned","border-2 calendar-block--manual":t.block.kind==="manual"}]),draggable:t.block.kind==="planned"&&!!t.block.task_id,style:H(c.value),onClick:m[1]||(m[1]=g=>r("click",t.block)),onDragstart:m[2]||(m[2]=g=>t.block.kind==="planned"&&t.block.task_id?r("blockDragStart",t.block,g):void 0)},[h("div",hn,[h("p",gn,M(t.block.display_name),1),!s.value&&t.block.job_number?(k(),p("p",wn,M(t.block.job_number),1)):O("",!0),s.value?O("",!0):(k(),p("p",vn,M(l.value),1))]),h("div",{class:"absolute bottom-0 left-0 right-0 h-2 cursor-s-resize opacity-0 group-hover:opacity-100 flex items-center justify-center",onMousedown:m[0]||(m[0]=Pe(g=>r("resizeStart",g),["stop"]))},[...m[3]||(m[3]=[h("div",{class:"w-8 h-0.5 bg-white/60 rounded"},null,-1)])],32)],46,mn))}}),bn=Ie(yn,[["__scopeId","data-v-978cfc69"]]),kn={class:"flex overflow-auto h-full"},xn={class:"flex flex-1 gap-px min-w-0"},pn=["onDragover","onDrop"],Dn={key:1,class:"absolute inset-0 bg-primary/10 pointer-events-none z-0"},F=7,de=19,I=40,_n=U({__name:"CalendarGrid",emits:["blockClick"],setup(t,{emit:e}){const n=Array.from({length:de-F+1},(y,b)=>F+b),r=K(),a=Ye(),o=e,l=W(()=>r.view==="week"?r.weekDays:[r.currentDate]),c=P(new Date);function s(y){const b=r.getBlocksForDay(y);return Xe(b)}function f(y){return Ge(new Date(y.start_at),F)}function m(y){return Je(new Date(y.start_at),new Date(y.end_at))}function g(y){var b;return((b=a.resizingBlock.value)==null?void 0:b.id)===y.id}function w(y){return y===12?"12 PM":y>12?`${y-12} PM`:`${y} AM`}return(y,b)=>(k(),p("div",kn,[h("div",{class:"w-12 shrink-0 relative",style:H({height:`${(de-F+1)*I*2}px`})},[(k(!0),p(L,null,j(x(n),d=>(k(),p("div",{key:d,class:"absolute right-2 text-xs text-muted-foreground",style:H({top:`${(d-F)*I*2-6}px`})},M(w(d)),5))),128))],4),h("div",xn,[(k(!0),p(L,null,j(l.value,d=>(k(),p("div",{key:x(P)(d),class:Y(["flex-1 relative border-l border-border",{"bg-primary/5":x(P)(d)===x(c)}]),style:H({height:`${(de-F)*I*2}px`}),onDragover:i=>x(a).onDragOver(d,i),onDragleave:b[1]||(b[1]=i=>x(a).onDragLeave()),onDrop:i=>x(a).onDrop(d,i)},[x(r).view==="week"?(k(),p("div",{key:0,class:Y(["sticky top-0 z-10 text-center py-1 text-xs font-medium border-b border-border bg-background",x(P)(d)===x(c)?"text-primary":"text-muted-foreground"])},[h("div",null,M(x(q)(d,"EEE")),1),h("div",{class:Y(["inline-flex h-6 w-6 mx-auto items-center justify-center rounded-full text-sm",x(P)(d)===x(c)?"bg-primary text-primary-foreground":""])},M(x(q)(d,"d")),3)],2)):O("",!0),(k(!0),p(L,null,j(x(n),i=>(k(),p("div",{key:i,class:"absolute left-0 right-0 border-t border-border/40",style:H({top:`${(i-F)*I*2}px`})},null,4))),128)),(k(!0),p(L,null,j(x(n).slice(0,-1),i=>(k(),p("div",{key:`half-${i}`,class:"absolute left-0 right-0 border-t border-border/20",style:H({top:`${(i-F)*I*2+I}px`})},null,4))),128)),x(a).dragOverDay.value===x(P)(d)?(k(),p("div",Dn)):O("",!0),(k(!0),p(L,null,j(s(d),({block:i,lane:S,totalLanes:u})=>(k(),He(bn,{key:i.id,block:i,lane:S,"total-lanes":u,top:f(i),height:m(i),"resize-end":g(i)?x(a).resizePreviewEnd.value:null,onClick:v=>o("blockClick",i),onResizeStart:v=>x(a).onResizeStart(i,v),onBlockDragStart:b[0]||(b[0]=(v,_)=>x(a).onBlockDragStart(v,_))},null,8,["block","lane","total-lanes","top","height","resize-end","onClick","onResizeStart"]))),128))],46,pn))),128))])]))}}),Mn={class:"flex flex-col h-full bg-card border-l border-border"},Sn={class:"p-3 border-b border-border flex items-center justify-between shrink-0"},Tn={class:"flex-1 overflow-y-auto p-2 space-y-1.5"},Pn={key:0,class:"text-xs text-muted-foreground p-2"},On={key:1,class:"text-xs text-muted-foreground p-2 text-center"},Cn=["onDragstart"],$n={class:"flex items-start gap-2"},Wn={class:"flex-1 min-w-0"},En={class:"text-xs font-medium text-foreground leading-tight truncate"},Yn={class:"flex items-center gap-1.5 mt-1 flex-wrap"},Bn={key:0,class:"text-xs text-muted-foreground"},Fn={key:0,class:"p-3 border-t border-border shrink-0"},Ln={class:"space-y-1"},jn={class:"text-muted-foreground truncate max-w-[100px]"},Nn={class:"text-foreground"},Hn=U({__name:"PlannerSidebar",emits:["createTask"],setup(t,{emit:e}){const n=le(),r=K(),a=Ye(),o=e,l=W(()=>P(r.currentDate));Oe(()=>{n.fetchForDate(l.value)});const c=m=>({todo:"outline",doing:"default",done:"success",cancelled:"secondary"})[m],s=m=>m>=4?"bg-red-500":m===3?"bg-amber-500":"bg-emerald-500",f=W(()=>{const m={};for(const g of n.tasks){const w=g.project_id??"_none";m[w]||(m[w]={name:g.project_id?w:"No Project",planned:0,actual:0}),m[w].planned+=g.estimate_hours??0,m[w].actual+=g.actual_hours??0}return Object.values(m)});return(m,g)=>(k(),p("div",Mn,[h("div",Sn,[g[2]||(g[2]=h("h3",{class:"text-sm font-semibold text-foreground"},"Planner",-1)),E(te,{size:"sm",variant:"ghost",onClick:g[0]||(g[0]=w=>o("createTask"))},{default:G(()=>[...g[1]||(g[1]=[h("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])]),_:1})]),h("div",Tn,[x(n).loading?(k(),p("div",Pn,"Loading...")):x(n).tasks.length===0?(k(),p("div",On," No tasks for today ")):O("",!0),(k(!0),p(L,null,j(x(n).tasks,w=>(k(),p("div",{key:w.id,class:"rounded-md border border-border bg-background p-2 cursor-grab active:cursor-grabbing hover:border-primary/50 transition-colors",draggable:"true",onDragstart:y=>x(a).onDragStart(w,y)},[h("div",$n,[h("div",{class:Y(["h-2 w-2 rounded-full mt-1.5 shrink-0",s(w.priority)])},null,2),h("div",Wn,[h("p",En,M(w.title),1),h("div",Yn,[E(Qe,{variant:c(w.status),class:"text-xs py-0"},{default:G(()=>[Te(M(w.status),1)]),_:2},1032,["variant"]),w.estimate_hours?(k(),p("span",Bn,M(x(ee)(w.estimate_hours)),1)):O("",!0)])])])],40,Cn))),128))]),f.value.length?(k(),p("div",Fn,[g[3]||(g[3]=h("p",{class:"text-xs font-medium text-muted-foreground mb-2"},"Plan vs Actual",-1)),h("div",Ln,[(k(!0),p(L,null,j(f.value,w=>(k(),p("div",{key:w.name,class:"flex items-center justify-between text-xs"},[h("span",jn,M(w.name),1),h("span",Nn,M(x(ee)(w.planned))+" / "+M(x(ee)(w.actual)),1)]))),128))])])):O("",!0)]))}}),qn={class:"h-full flex flex-col"},Rn={class:"p-4 border-b border-border flex items-center gap-3 flex-wrap"},zn={class:"flex items-center gap-2 ml-auto"},Vn={class:"flex-1 flex overflow-hidden"},An={class:"flex-1 overflow-auto"},In={key:0,class:"w-56 shrink-0 overflow-hidden"},Qn={class:"bg-card border border-border rounded-lg shadow-xl p-4 w-72"},Xn={class:"flex items-start justify-between gap-2 mb-3"},Gn={class:"font-semibold text-sm text-foreground"},Jn={key:0,class:"text-xs text-muted-foreground"},Un={class:"space-y-1 text-xs text-muted-foreground"},Kn={key:0,class:"mt-2 flex flex-wrap gap-1"},Zn={key:1,class:"mt-3 pt-3 border-t border-border flex items-center gap-2"},er=["disabled"],tr={key:2,class:"mt-3 pt-3 border-t border-border text-xs text-muted-foreground"},mr=U({__name:"CalendarView",setup(t){const e=K(),n=le(),r=ze(),a=qe(),o=T(!0),l=T(!1),c=T(null),s=T(null),f=T(!1);Oe(async()=>{const b=a.query.date;b&&(e.currentDate=new Date(b+"T12:00:00"),e.setView("day")),await e.fetchCurrentView()});function m(b){if(b.project_id&&b.kind==="session"){const d=b.start_at.substring(0,10);r.push({name:"project-detail",params:{id:b.project_id,date:d}})}else s.value=b}async function g(b){try{c.value?(await n.update(c.value.id,b),V.success("Task updated")):(await n.create(b),V.success("Task created")),l.value=!1,c.value=null,n.fetchForDate(P(e.currentDate))}catch{V.error("Failed to save task")}}async function w(b){if(b.task_id)try{const d=await Re(()=>import("./TaskForm.vue_vue_type_script_setup_true_lang-grpGvlfv.js").then(i=>i.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(i=>i.tasksApi.get(b.task_id));c.value=d.data,s.value=null,l.value=!0}catch{V.error("Failed to load task")}}async function y(b){if(confirm(`Delete "${b.display_name}"?`)){f.value=!0;try{await n.deleteBlock(b.id),e.removeBlock(b.id),s.value=null,V.success("Block deleted")}catch{V.error("Failed to delete block")}finally{f.value=!1}}}return(b,d)=>(k(),p("div",qn,[h("div",Rn,[E(cn),h("div",zn,[h("button",{class:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:d[0]||(d[0]=i=>o.value=!o.value)},M(o.value?"Hide Planner":"Show Planner"),1)])]),h("div",Vn,[h("div",An,[E(_n,{onBlockClick:m})]),o.value?(k(),p("div",In,[E(Hn,{onCreateTask:d[1]||(d[1]=i=>l.value=!0)})])):O("",!0)]),s.value?(k(),p("div",{key:0,class:"fixed inset-0 z-40 flex items-center justify-center p-4",onClick:d[5]||(d[5]=Pe(i=>s.value=null,["self"]))},[h("div",Qn,[h("div",Xn,[h("div",null,[h("p",Gn,M(s.value.display_name),1),s.value.job_number?(k(),p("p",Jn,M(s.value.job_number),1)):O("",!0)]),h("button",{class:"text-muted-foreground hover:text-foreground",onClick:d[2]||(d[2]=i=>s.value=null)},[...d[7]||(d[7]=[h("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),h("div",Un,[h("p",null,"Start: "+M(new Date(s.value.start_at).toLocaleString()),1),h("p",null,"End: "+M(new Date(s.value.end_at).toLocaleString()),1),h("p",null,"Type: "+M(s.value.kind),1)]),s.value.tags.length?(k(),p("div",Kn,[(k(!0),p(L,null,j(s.value.tags,i=>(k(),p("span",{key:i.id,class:"px-1.5 py-0.5 rounded text-xs",style:H({background:`${i.color_hex}22`,color:i.color_hex})},M(i.name),5))),128))])):O("",!0),s.value.kind==="planned"?(k(),p("div",Zn,[h("button",{class:"flex-1 text-xs px-2 py-1.5 rounded bg-muted hover:bg-muted/80 text-foreground transition-colors",onClick:d[3]||(d[3]=i=>w(s.value))},"Edit task"),h("button",{class:"flex-1 text-xs px-2 py-1.5 rounded bg-destructive/10 hover:bg-destructive/20 text-destructive transition-colors",disabled:f.value,onClick:d[4]||(d[4]=i=>y(s.value))},"Delete block",8,er)])):(k(),p("p",tr,M(s.value.kind==="session"?"Session from Claude Code — read-only":"Read-only entry"),1))])])):O("",!0),E(Ae,{open:l.value,task:c.value,"default-date":x(P)(x(e).currentDate),onClose:d[6]||(d[6]=i=>{l.value=!1,c.value=null}),onSave:g},null,8,["open","task","default-date"])]))}});export{mr as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TaskForm.vue_vue_type_script_setup_true_lang-CZhTyTsN.js","assets/index-BsVgmrYd.js","assets/index-DopqRgoW.css","assets/Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js","assets/Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js","assets/Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js","assets/utils-7WVCegLb.js","assets/Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js","assets/devops-Dr0K2zsR.js"])))=>i.map(i=>d[i]); +import{B as Ne,q as T,j as W,d as U,o as k,c as p,a as h,e as E,w as G,p as Te,t as M,h as x,i as O,n as Y,A as H,C as Pe,F as L,r as j,k as He,x as Oe,g as qe,_ as Re,K as V,f as ze}from"./index-BsVgmrYd.js";import{d as Ve}from"./dashboard-BQR_-Gvh.js";import{i as P,f as ee}from"./utils-7WVCegLb.js";import{_ as te}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{u as le,_ as Ae}from"./TaskForm.vue_vue_type_script_setup_true_lang-CZhTyTsN.js";import{_ as Ie}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as Qe}from"./Badge.vue_vue_type_script_setup_true_lang-ctqZICyq.js";import"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";import"./Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js";import"./Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js";import"./devops-Dr0K2zsR.js";const ne=40/30;function Xe(t){if(t.length===0)return[];const e=[...t].sort((o,l)=>new Date(o.start_at).getTime()-new Date(l.start_at).getTime()),n=[],r=[];for(const o of e){const l=new Date(o.start_at).getTime(),c=new Date(o.end_at).getTime();let s=-1;for(let f=0;f{const c=new Date(o.start_at).getTime(),s=new Date(o.end_at).getTime();let f=l;for(const m of r){const g=new Date(m.block.start_at).getTime(),w=new Date(m.block.end_at).getTime();gc&&m.lane>f&&(f=m.lane)}return{block:o,lane:l,totalLanes:f+1}})}function Ge(t,e=7){return((t.getHours()-e)*60+t.getMinutes())*ne}function Je(t,e){const n=(e.getTime()-t.getTime())/6e4;return Math.max(n*ne,20)}function be(t,e=7){const n=t.getDay(),r=new Date(t);return r.setDate(t.getDate()-(n+6)%7),r.setHours(0,0,0,0),Array.from({length:e},(a,o)=>{const l=new Date(r);return l.setDate(r.getDate()+o),l})}function ke(t,e=15){return Math.round(t/e)*e}const K=Ne("calendar",()=>{const t=T([]),e=T(new Date),n=T("week"),r=T(7),a=T(!1),o=T(null),l=W(()=>be(e.value,r.value));async function c(u,v,_){a.value=!0,o.value=null;try{const C=await Ve.calendar({from:u,to:v,view:_});t.value=C.data}catch(C){const Z=C;o.value=Z.message??"Failed to fetch calendar"}finally{a.value=!1}}function s(u){r.value=u}async function f(){if(n.value==="week"){const u=be(e.value,r.value),v=P(u[0]),_=P(u[r.value-1]);await c(v,_,"week")}else{const u=P(e.value);await c(u,u,"day")}}function m(){const u=new Date(e.value);n.value==="week"?u.setDate(u.getDate()-7):u.setDate(u.getDate()-1),e.value=u}function g(){const u=new Date(e.value);n.value==="week"?u.setDate(u.getDate()+7):u.setDate(u.getDate()+1),e.value=u}function w(){e.value=new Date}function y(u){n.value=u}function b(u){t.value.push(u)}function d(u){const v=t.value.findIndex(_=>_.id===u.id);v!==-1&&(t.value[v]=u)}function i(u){t.value=t.value.filter(v=>v.id!==u)}function S(u){const v=P(u);return t.value.filter(_=>P(new Date(_.start_at))===v)}return{blocks:t,currentDate:e,view:n,weekLength:r,loading:a,error:o,weekDays:l,fetch:c,fetchCurrentView:f,navigatePrev:m,navigateNext:g,goToToday:w,setView:y,setWeekLength:s,addBlock:b,updateBlock:d,removeBlock:i,getBlocksForDay:S}});function $(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function R(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const Ce=6048e5,Ue=864e5;let Ke={};function ae(){return Ke}function J(t,e){var c,s,f,m;const n=ae(),r=(e==null?void 0:e.weekStartsOn)??((s=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:s.weekStartsOn)??n.weekStartsOn??((m=(f=n.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??0,a=$(t),o=a.getDay(),l=(o=a.getTime()?n+1:e.getTime()>=l.getTime()?n:n-1}function xe(t){const e=$(t);return e.setHours(0,0,0,0),e}function pe(t){const e=$(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Ze(t,e){const n=xe(t),r=xe(e),a=+n-pe(n),o=+r-pe(r);return Math.round((a-o)/Ue)}function et(t){const e=$e(t),n=R(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),re(n)}function tt(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nt(t){if(!tt(t)&&typeof t!="number")return!1;const e=$(t);return!isNaN(Number(e))}function rt(t){const e=$(t),n=R(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const at={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ot=(t,e,n)=>{let r;const a=at[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ce(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const st={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ut={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ct={date:ce({formats:st,defaultWidth:"full"}),time:ce({formats:it,defaultWidth:"full"}),dateTime:ce({formats:ut,defaultWidth:"full"})},dt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lt=(t,e,n,r)=>dt[t];function Q(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,c=n!=null&&n.width?String(n.width):l;a=t.formattingValues[c]||t.formattingValues[l]}else{const l=t.defaultWidth,c=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[c]||t.values[l]}const o=t.argumentCallback?t.argumentCallback(e):e;return a[o]}}const ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ht={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},yt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},bt={ordinalNumber:yt,era:Q({values:ft,defaultWidth:"wide"}),quarter:Q({values:mt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:ht,defaultWidth:"wide"}),day:Q({values:gt,defaultWidth:"wide"}),dayPeriod:Q({values:wt,defaultWidth:"wide",formattingValues:vt,defaultFormattingWidth:"wide"})};function X(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const l=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(c)?xt(c,g=>g.test(l)):kt(c,g=>g.test(l));let f;f=t.valueCallback?t.valueCallback(s):s,f=n.valueCallback?n.valueCallback(f):f;const m=e.slice(l.length);return{value:f,rest:m}}}function kt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function xt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],o=e.match(t.parsePattern);if(!o)return null;let l=t.valueCallback?t.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const c=e.slice(a.length);return{value:l,rest:c}}}const Dt=/^(\d+)(th|st|nd|rd)?/i,_t=/\d+/i,Mt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},St={any:[/^b/i,/^(a|c)/i]},Tt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pt={any:[/1/i,/2/i,/3/i,/4/i]},Ot={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ct={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$t={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Wt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Et={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Bt={ordinalNumber:pt({matchPattern:Dt,parsePattern:_t,valueCallback:t=>parseInt(t,10)}),era:X({matchPatterns:Mt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),quarter:X({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:Pt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:X({matchPatterns:Ot,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any"}),day:X({matchPatterns:$t,defaultMatchWidth:"wide",parsePatterns:Wt,defaultParseWidth:"any"}),dayPeriod:X({matchPatterns:Et,defaultMatchWidth:"any",parsePatterns:Yt,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:ot,formatLong:ct,formatRelative:lt,localize:bt,match:Bt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lt(t){const e=$(t);return Ze(e,rt(e))+1}function jt(t){const e=$(t),n=+re(e)-+et(e);return Math.round(n/Ce)+1}function We(t,e){var m,g,w,y;const n=$(t),r=n.getFullYear(),a=ae(),o=(e==null?void 0:e.firstWeekContainsDate)??((g=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((y=(w=a.locale)==null?void 0:w.options)==null?void 0:y.firstWeekContainsDate)??1,l=R(t,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const c=J(l,e),s=R(t,0);s.setFullYear(r,0,o),s.setHours(0,0,0,0);const f=J(s,e);return n.getTime()>=c.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function Nt(t,e){var c,s,f,m;const n=ae(),r=(e==null?void 0:e.firstWeekContainsDate)??((s=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:s.firstWeekContainsDate)??n.firstWeekContainsDate??((m=(f=n.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=We(t,e),o=R(t,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),J(o,e)}function Ht(t,e){const n=$(t),r=+J(n,e)-+Nt(n,e);return Math.round(r/Ce)+1}function D(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const B={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return D(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):D(n+1,2)},d(t,e){return D(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return D(t.getHours()%12||12,e.length)},H(t,e){return D(t.getHours(),e.length)},m(t,e){return D(t.getMinutes(),e.length)},s(t,e){return D(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return D(a,e.length)}},A={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},De={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return B.y(t,e)},Y:function(t,e,n,r){const a=We(t,r),o=a>0?a:1-a;if(e==="YY"){const l=o%100;return D(l,2)}return e==="Yo"?n.ordinalNumber(o,{unit:"year"}):D(o,e.length)},R:function(t,e){const n=$e(t);return D(n,e.length)},u:function(t,e){const n=t.getFullYear();return D(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return D(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return D(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return B.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return D(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ht(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):D(a,e.length)},I:function(t,e,n){const r=jt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):D(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):B.d(t,e)},D:function(t,e,n){const r=Lt(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):D(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return D(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return D(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return D(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=A.noon:r===0?a=A.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=A.evening:r>=12?a=A.afternoon:r>=4?a=A.morning:a=A.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return B.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):B.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):D(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):D(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):B.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):B.s(t,e)},S:function(t,e){return B.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Me(r);case"XXXX":case"XX":return N(r);case"XXXXX":case"XXX":default:return N(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Me(r);case"xxxx":case"xx":return N(r);case"xxxxx":case"xxx":default:return N(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+_e(r,":");case"OOOO":default:return"GMT"+N(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+_e(r,":");case"zzzz":default:return"GMT"+N(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return D(r,e.length)},T:function(t,e,n){const r=t.getTime();return D(r,e.length)}};function _e(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+e+D(o,2)}function Me(t,e){return t%60===0?(t>0?"-":"+")+D(Math.abs(t)/60,2):N(t,e)}function N(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=D(Math.trunc(r/60),2),o=D(r%60,2);return n+a+e+o}const Se=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ee=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},qt=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Se(t,e);let o;switch(r){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Se(r,e)).replace("{{time}}",Ee(a,e))},Rt={p:Ee,P:qt},zt=/^D+$/,Vt=/^Y+$/,At=["D","DD","YY","YYYY"];function It(t){return zt.test(t)}function Qt(t){return Vt.test(t)}function Xt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),At.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Jt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ut=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Kt=/^'([^]*?)'?$/,Zt=/''/g,en=/[a-zA-Z]/;function q(t,e,n){var m,g,w,y,b,d,i,S;const r=ae(),a=(n==null?void 0:n.locale)??r.locale??Ft,o=(n==null?void 0:n.firstWeekContainsDate)??((g=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??r.firstWeekContainsDate??((y=(w=r.locale)==null?void 0:w.options)==null?void 0:y.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((d=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:d.weekStartsOn)??r.weekStartsOn??((S=(i=r.locale)==null?void 0:i.options)==null?void 0:S.weekStartsOn)??0,c=$(t);if(!nt(c))throw new RangeError("Invalid time value");let s=e.match(Ut).map(u=>{const v=u[0];if(v==="p"||v==="P"){const _=Rt[v];return _(u,a.formatLong)}return u}).join("").match(Jt).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const v=u[0];if(v==="'")return{isToken:!1,value:tn(u)};if(De[v])return{isToken:!0,value:u};if(v.match(en))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(s=a.localize.preprocessor(c,s));const f={firstWeekContainsDate:o,weekStartsOn:l,locale:a};return s.map(u=>{if(!u.isToken)return u.value;const v=u.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Qt(v)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&It(v))&&Xt(v,e,String(t));const _=De[v[0]];return _(c,v,a.localize,f)}).join("")}function tn(t){const e=t.match(Kt);return e?e[1].replace(Zt,"'"):t}const nn={class:"flex items-center gap-2 flex-wrap"},rn={class:"flex items-center gap-1"},an={class:"text-sm font-medium text-foreground flex-1 min-w-0 truncate"},on={key:0,class:"text-xs text-muted-foreground"},sn={class:"flex items-center rounded-md border border-border overflow-hidden"},un={key:1,class:"flex items-center rounded-md border border-border overflow-hidden"},cn=U({__name:"CalendarToolbar",setup(t){const e=K(),n=W(()=>{if(e.view==="week"){const c=e.weekDays;if(!c.length)return"";const s=c[0],f=c[c.length-1];return s.getMonth()===f.getMonth()?`${q(s,"MMM d")} – ${q(f,"d, yyyy")}`:`${q(s,"MMM d")} – ${q(f,"MMM d, yyyy")}`}else return q(e.currentDate,"EEEE, MMMM d, yyyy")});async function r(c){c==="prev"?e.navigatePrev():e.navigateNext(),await e.fetchCurrentView()}async function a(){e.goToToday(),await e.fetchCurrentView()}async function o(c){e.setView(c),await e.fetchCurrentView()}async function l(c){e.setWeekLength(c),await e.fetchCurrentView()}return(c,s)=>(k(),p("div",nn,[h("div",rn,[E(te,{variant:"outline",size:"sm",onClick:s[0]||(s[0]=f=>r("prev"))},{default:G(()=>[...s[6]||(s[6]=[h("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),_:1}),E(te,{variant:"outline",size:"sm",onClick:a},{default:G(()=>[...s[7]||(s[7]=[Te("Today",-1)])]),_:1}),E(te,{variant:"outline",size:"sm",onClick:s[1]||(s[1]=f=>r("next"))},{default:G(()=>[...s[8]||(s[8]=[h("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])]),_:1})]),h("span",an,M(n.value),1),x(e).loading?(k(),p("div",on,"Loading...")):O("",!0),h("div",sn,[h("button",{class:Y(["px-3 py-1.5 text-xs font-medium transition-colors",x(e).view==="day"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s[2]||(s[2]=f=>o("day"))}," Day ",2),h("button",{class:Y(["px-3 py-1.5 text-xs font-medium transition-colors",x(e).view==="week"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s[3]||(s[3]=f=>o("week"))}," Week ",2)]),x(e).view==="week"?(k(),p("div",un,[h("button",{class:Y(["px-3 py-1.5 text-xs font-medium transition-colors",x(e).weekLength===5?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s[4]||(s[4]=f=>l(5))}," 5d ",2),h("button",{class:Y(["px-3 py-1.5 text-xs font-medium transition-colors",x(e).weekLength===7?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s[5]||(s[5]=f=>l(7))}," 7d ",2)])):O("",!0)]))}}),dn=7;function Ye(){const t=le(),e=K(),n=T(null),r=T(null),a=T(null),o=T(null);function l(d,i){var S,u;n.value=d.id,(S=i.dataTransfer)==null||S.setData("task_id",d.id),(u=i.dataTransfer)==null||u.setData("estimate_hours",String(d.estimate_hours??1))}function c(d,i){var u,v,_,C;const S=new Date(d.end_at).getTime()-new Date(d.start_at).getTime();(u=i.dataTransfer)==null||u.setData("block_id",d.id),(v=i.dataTransfer)==null||v.setData("block_duration_ms",String(S)),(_=i.dataTransfer)==null||_.setData("task_id",d.task_id??""),(C=i.dataTransfer)==null||C.setData("estimate_hours",String(S/36e5))}function s(d,i){i.preventDefault(),r.value=P(d)}function f(){r.value=null}async function m(d,i){var he,ge,we,ve;i.preventDefault(),r.value=null,n.value=null;const S=(he=i.dataTransfer)==null?void 0:he.getData("block_id"),u=(ge=i.dataTransfer)==null?void 0:ge.getData("task_id"),v=parseFloat(((we=i.dataTransfer)==null?void 0:we.getData("estimate_hours"))??"1")||1,_=parseFloat(((ve=i.dataTransfer)==null?void 0:ve.getData("block_duration_ms"))??"0"),Z=i.currentTarget.getBoundingClientRect(),oe=i.clientY-Z.top,se=ke(oe/ne,15),Be=Math.max(0,Math.min(se,12*60)),z=new Date(d);z.setHours(dn,0,0,0),z.setMinutes(z.getMinutes()+Be);const ie=z.toISOString();if(S&&_>0){const Le=new Date(z.getTime()+_).toISOString();try{await t.updateBlock(S,{start_at:ie,end_at:Le}),await e.fetchCurrentView()}catch(je){console.error("Failed to move block:",je)}return}if(!u)return;const ue=new Date(z);ue.setMinutes(ue.getMinutes()+Math.round(v*60));const fe=ue.toISOString(),me=`temp_${Date.now()}`,Fe={kind:"planned",id:me,project_id:null,job_number:"",display_name:"Loading...",start_at:ie,end_at:fe,title:"",color_hue:260,tags:[],task_id:u,session_id:null,manual_entry_id:null};e.addBlock(Fe);try{await t.createBlock(u,{start_at:ie,end_at:fe}),await e.fetchCurrentView()}catch(ye){e.removeBlock(me),console.error("Failed to create task block:",ye)}}let g=0,w="",y=null;function b(d,i){i.preventDefault(),i.stopPropagation(),a.value=d,y=d,g=i.clientY,w=d.end_at,o.value=d.end_at;const S=v=>{if(!y)return;const _=v.clientY-g,C=ke(_/ne,15),oe=new Date(w).getTime()+C*6e4,se=new Date(y.start_at).getTime()+15*6e4;o.value=new Date(Math.max(oe,se)).toISOString()},u=async()=>{if(document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",u),!y||!o.value){a.value=null;return}const v=y.id,_=o.value;if(_===w){a.value=null,o.value=null;return}try{y.task_id&&await t.updateBlock(v,{start_at:y.start_at,end_at:_}),e.updateBlock({...y,end_at:_})}catch(C){console.error("Failed to resize block:",C),e.updateBlock({...y,end_at:w})}a.value=null,o.value=null,y=null};document.addEventListener("mousemove",S),document.addEventListener("mouseup",u)}return{draggingTaskId:n,dragOverDay:r,resizingBlock:a,resizePreviewEnd:o,onDragStart:l,onBlockDragStart:c,onDragOver:s,onDragLeave:f,onDrop:m,onResizeStart:b}}function ln(t){return`hsla(${t}, 65%, 45%, 0.85)`}function fn(t){return`hsla(${t}, 65%, 55%, 1)`}const mn=["draggable"],hn={class:"px-1.5 py-1 h-full flex flex-col text-white overflow-hidden"},gn={class:"text-xs font-semibold leading-tight truncate"},wn={key:0,class:"text-xs opacity-75 truncate"},vn={key:1,class:"text-xs opacity-75 mt-auto"},yn=U({__name:"CalendarBlock",props:{block:{},lane:{},totalLanes:{},top:{},height:{},resizeEnd:{}},emits:["resizeStart","click","blockDragStart"],setup(t,{emit:e}){const n=t,r=e,a=W(()=>n.resizeEnd?new Date(n.resizeEnd):new Date(n.block.end_at)),o=W(()=>{if(!n.resizeEnd)return n.height;const m=(a.value.getTime()-new Date(n.block.start_at).getTime())/6e4;return Math.max(m*(40/30),20)}),l=W(()=>{const f=a.value.getTime()-new Date(n.block.start_at).getTime();return ee(f/36e5)}),c=W(()=>{const f=`calc(${100/n.totalLanes}% - 2px)`,m=`calc(${n.lane/n.totalLanes*100}% + 1px)`;return{top:`${n.top}px`,height:`${o.value}px`,width:f,left:m,backgroundColor:ln(n.block.color_hue),borderColor:fn(n.block.color_hue)}}),s=W(()=>o.value<40);return(f,m)=>(k(),p("div",{class:Y(["absolute rounded overflow-hidden cursor-pointer select-none group",{"border-2":t.block.kind==="session","border-2 border-dashed opacity-80":t.block.kind==="planned","border-2 calendar-block--manual":t.block.kind==="manual"}]),draggable:t.block.kind==="planned"&&!!t.block.task_id,style:H(c.value),onClick:m[1]||(m[1]=g=>r("click",t.block)),onDragstart:m[2]||(m[2]=g=>t.block.kind==="planned"&&t.block.task_id?r("blockDragStart",t.block,g):void 0)},[h("div",hn,[h("p",gn,M(t.block.display_name),1),!s.value&&t.block.job_number?(k(),p("p",wn,M(t.block.job_number),1)):O("",!0),s.value?O("",!0):(k(),p("p",vn,M(l.value),1))]),h("div",{class:"absolute bottom-0 left-0 right-0 h-2 cursor-s-resize opacity-0 group-hover:opacity-100 flex items-center justify-center",onMousedown:m[0]||(m[0]=Pe(g=>r("resizeStart",g),["stop"]))},[...m[3]||(m[3]=[h("div",{class:"w-8 h-0.5 bg-white/60 rounded"},null,-1)])],32)],46,mn))}}),bn=Ie(yn,[["__scopeId","data-v-978cfc69"]]),kn={class:"flex overflow-auto h-full"},xn={class:"flex flex-1 gap-px min-w-0"},pn=["onDragover","onDrop"],Dn={key:1,class:"absolute inset-0 bg-primary/10 pointer-events-none z-0"},F=7,de=19,I=40,_n=U({__name:"CalendarGrid",emits:["blockClick"],setup(t,{emit:e}){const n=Array.from({length:de-F+1},(y,b)=>F+b),r=K(),a=Ye(),o=e,l=W(()=>r.view==="week"?r.weekDays:[r.currentDate]),c=P(new Date);function s(y){const b=r.getBlocksForDay(y);return Xe(b)}function f(y){return Ge(new Date(y.start_at),F)}function m(y){return Je(new Date(y.start_at),new Date(y.end_at))}function g(y){var b;return((b=a.resizingBlock.value)==null?void 0:b.id)===y.id}function w(y){return y===12?"12 PM":y>12?`${y-12} PM`:`${y} AM`}return(y,b)=>(k(),p("div",kn,[h("div",{class:"w-12 shrink-0 relative",style:H({height:`${(de-F+1)*I*2}px`})},[(k(!0),p(L,null,j(x(n),d=>(k(),p("div",{key:d,class:"absolute right-2 text-xs text-muted-foreground",style:H({top:`${(d-F)*I*2-6}px`})},M(w(d)),5))),128))],4),h("div",xn,[(k(!0),p(L,null,j(l.value,d=>(k(),p("div",{key:x(P)(d),class:Y(["flex-1 relative border-l border-border",{"bg-primary/5":x(P)(d)===x(c)}]),style:H({height:`${(de-F)*I*2}px`}),onDragover:i=>x(a).onDragOver(d,i),onDragleave:b[1]||(b[1]=i=>x(a).onDragLeave()),onDrop:i=>x(a).onDrop(d,i)},[x(r).view==="week"?(k(),p("div",{key:0,class:Y(["sticky top-0 z-10 text-center py-1 text-xs font-medium border-b border-border bg-background",x(P)(d)===x(c)?"text-primary":"text-muted-foreground"])},[h("div",null,M(x(q)(d,"EEE")),1),h("div",{class:Y(["inline-flex h-6 w-6 mx-auto items-center justify-center rounded-full text-sm",x(P)(d)===x(c)?"bg-primary text-primary-foreground":""])},M(x(q)(d,"d")),3)],2)):O("",!0),(k(!0),p(L,null,j(x(n),i=>(k(),p("div",{key:i,class:"absolute left-0 right-0 border-t border-border/40",style:H({top:`${(i-F)*I*2}px`})},null,4))),128)),(k(!0),p(L,null,j(x(n).slice(0,-1),i=>(k(),p("div",{key:`half-${i}`,class:"absolute left-0 right-0 border-t border-border/20",style:H({top:`${(i-F)*I*2+I}px`})},null,4))),128)),x(a).dragOverDay.value===x(P)(d)?(k(),p("div",Dn)):O("",!0),(k(!0),p(L,null,j(s(d),({block:i,lane:S,totalLanes:u})=>(k(),He(bn,{key:i.id,block:i,lane:S,"total-lanes":u,top:f(i),height:m(i),"resize-end":g(i)?x(a).resizePreviewEnd.value:null,onClick:v=>o("blockClick",i),onResizeStart:v=>x(a).onResizeStart(i,v),onBlockDragStart:b[0]||(b[0]=(v,_)=>x(a).onBlockDragStart(v,_))},null,8,["block","lane","total-lanes","top","height","resize-end","onClick","onResizeStart"]))),128))],46,pn))),128))])]))}}),Mn={class:"flex flex-col h-full bg-card border-l border-border"},Sn={class:"p-3 border-b border-border flex items-center justify-between shrink-0"},Tn={class:"flex-1 overflow-y-auto p-2 space-y-1.5"},Pn={key:0,class:"text-xs text-muted-foreground p-2"},On={key:1,class:"text-xs text-muted-foreground p-2 text-center"},Cn=["onDragstart"],$n={class:"flex items-start gap-2"},Wn={class:"flex-1 min-w-0"},En={class:"text-xs font-medium text-foreground leading-tight truncate"},Yn={class:"flex items-center gap-1.5 mt-1 flex-wrap"},Bn={key:0,class:"text-xs text-muted-foreground"},Fn={key:0,class:"p-3 border-t border-border shrink-0"},Ln={class:"space-y-1"},jn={class:"text-muted-foreground truncate max-w-[100px]"},Nn={class:"text-foreground"},Hn=U({__name:"PlannerSidebar",emits:["createTask"],setup(t,{emit:e}){const n=le(),r=K(),a=Ye(),o=e,l=W(()=>P(r.currentDate));Oe(()=>{n.fetchForDate(l.value)});const c=m=>({todo:"outline",doing:"default",done:"success",cancelled:"secondary"})[m],s=m=>m>=4?"bg-red-500":m===3?"bg-amber-500":"bg-emerald-500",f=W(()=>{const m={};for(const g of n.tasks){const w=g.project_id??"_none";m[w]||(m[w]={name:g.project_id?w:"No Project",planned:0,actual:0}),m[w].planned+=g.estimate_hours??0,m[w].actual+=g.actual_hours??0}return Object.values(m)});return(m,g)=>(k(),p("div",Mn,[h("div",Sn,[g[2]||(g[2]=h("h3",{class:"text-sm font-semibold text-foreground"},"Planner",-1)),E(te,{size:"sm",variant:"ghost",onClick:g[0]||(g[0]=w=>o("createTask"))},{default:G(()=>[...g[1]||(g[1]=[h("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])]),_:1})]),h("div",Tn,[x(n).loading?(k(),p("div",Pn,"Loading...")):x(n).tasks.length===0?(k(),p("div",On," No tasks for today ")):O("",!0),(k(!0),p(L,null,j(x(n).tasks,w=>(k(),p("div",{key:w.id,class:"rounded-md border border-border bg-background p-2 cursor-grab active:cursor-grabbing hover:border-primary/50 transition-colors",draggable:"true",onDragstart:y=>x(a).onDragStart(w,y)},[h("div",$n,[h("div",{class:Y(["h-2 w-2 rounded-full mt-1.5 shrink-0",s(w.priority)])},null,2),h("div",Wn,[h("p",En,M(w.title),1),h("div",Yn,[E(Qe,{variant:c(w.status),class:"text-xs py-0"},{default:G(()=>[Te(M(w.status),1)]),_:2},1032,["variant"]),w.estimate_hours?(k(),p("span",Bn,M(x(ee)(w.estimate_hours)),1)):O("",!0)])])])],40,Cn))),128))]),f.value.length?(k(),p("div",Fn,[g[3]||(g[3]=h("p",{class:"text-xs font-medium text-muted-foreground mb-2"},"Plan vs Actual",-1)),h("div",Ln,[(k(!0),p(L,null,j(f.value,w=>(k(),p("div",{key:w.name,class:"flex items-center justify-between text-xs"},[h("span",jn,M(w.name),1),h("span",Nn,M(x(ee)(w.planned))+" / "+M(x(ee)(w.actual)),1)]))),128))])])):O("",!0)]))}}),qn={class:"h-full flex flex-col"},Rn={class:"p-4 border-b border-border flex items-center gap-3 flex-wrap"},zn={class:"flex items-center gap-2 ml-auto"},Vn={class:"flex-1 flex overflow-hidden"},An={class:"flex-1 overflow-auto"},In={key:0,class:"w-56 shrink-0 overflow-hidden"},Qn={class:"bg-card border border-border rounded-lg shadow-xl p-4 w-72"},Xn={class:"flex items-start justify-between gap-2 mb-3"},Gn={class:"font-semibold text-sm text-foreground"},Jn={key:0,class:"text-xs text-muted-foreground"},Un={class:"space-y-1 text-xs text-muted-foreground"},Kn={key:0,class:"mt-2 flex flex-wrap gap-1"},Zn={key:1,class:"mt-3 pt-3 border-t border-border flex items-center gap-2"},er=["disabled"],tr={key:2,class:"mt-3 pt-3 border-t border-border text-xs text-muted-foreground"},mr=U({__name:"CalendarView",setup(t){const e=K(),n=le(),r=ze(),a=qe(),o=T(!0),l=T(!1),c=T(null),s=T(null),f=T(!1);Oe(async()=>{const b=a.query.date;b&&(e.currentDate=new Date(b+"T12:00:00"),e.setView("day")),await e.fetchCurrentView()});function m(b){if(b.project_id&&b.kind==="session"){const d=b.start_at.substring(0,10);r.push({name:"project-detail",params:{id:b.project_id,date:d}})}else s.value=b}async function g(b){try{c.value?(await n.update(c.value.id,b),V.success("Task updated")):(await n.create(b),V.success("Task created")),l.value=!1,c.value=null,n.fetchForDate(P(e.currentDate))}catch{V.error("Failed to save task")}}async function w(b){if(b.task_id)try{const d=await Re(()=>import("./TaskForm.vue_vue_type_script_setup_true_lang-CZhTyTsN.js").then(i=>i.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(i=>i.tasksApi.get(b.task_id));c.value=d.data,s.value=null,l.value=!0}catch{V.error("Failed to load task")}}async function y(b){if(confirm(`Delete "${b.display_name}"?`)){f.value=!0;try{await n.deleteBlock(b.id),e.removeBlock(b.id),s.value=null,V.success("Block deleted")}catch{V.error("Failed to delete block")}finally{f.value=!1}}}return(b,d)=>(k(),p("div",qn,[h("div",Rn,[E(cn),h("div",zn,[h("button",{class:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:d[0]||(d[0]=i=>o.value=!o.value)},M(o.value?"Hide Planner":"Show Planner"),1)])]),h("div",Vn,[h("div",An,[E(_n,{onBlockClick:m})]),o.value?(k(),p("div",In,[E(Hn,{onCreateTask:d[1]||(d[1]=i=>l.value=!0)})])):O("",!0)]),s.value?(k(),p("div",{key:0,class:"fixed inset-0 z-40 flex items-center justify-center p-4",onClick:d[5]||(d[5]=Pe(i=>s.value=null,["self"]))},[h("div",Qn,[h("div",Xn,[h("div",null,[h("p",Gn,M(s.value.display_name),1),s.value.job_number?(k(),p("p",Jn,M(s.value.job_number),1)):O("",!0)]),h("button",{class:"text-muted-foreground hover:text-foreground",onClick:d[2]||(d[2]=i=>s.value=null)},[...d[7]||(d[7]=[h("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),h("div",Un,[h("p",null,"Start: "+M(new Date(s.value.start_at).toLocaleString()),1),h("p",null,"End: "+M(new Date(s.value.end_at).toLocaleString()),1),h("p",null,"Type: "+M(s.value.kind),1)]),s.value.tags.length?(k(),p("div",Kn,[(k(!0),p(L,null,j(s.value.tags,i=>(k(),p("span",{key:i.id,class:"px-1.5 py-0.5 rounded text-xs",style:H({background:`${i.color_hex}22`,color:i.color_hex})},M(i.name),5))),128))])):O("",!0),s.value.kind==="planned"?(k(),p("div",Zn,[h("button",{class:"flex-1 text-xs px-2 py-1.5 rounded bg-muted hover:bg-muted/80 text-foreground transition-colors",onClick:d[3]||(d[3]=i=>w(s.value))},"Edit task"),h("button",{class:"flex-1 text-xs px-2 py-1.5 rounded bg-destructive/10 hover:bg-destructive/20 text-destructive transition-colors",disabled:f.value,onClick:d[4]||(d[4]=i=>y(s.value))},"Delete block",8,er)])):(k(),p("p",tr,M(s.value.kind==="session"?"Session from Claude Code — read-only":"Read-only entry"),1))])])):O("",!0),E(Ae,{open:l.value,task:c.value,"default-date":x(P)(x(e).currentDate),onClose:d[6]||(d[6]=i=>{l.value=!1,c.value=null}),onSave:g},null,8,["open","task","default-date"])]))}});export{mr as default}; diff --git a/src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js b/src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js similarity index 86% rename from src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js rename to src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js index 536cf78..185e5d9 100644 --- a/src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js +++ b/src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js @@ -1 +1 @@ -import{c as e}from"./utils-7WVCegLb.js";import{d as o,c as n,n as t,h as c,m as l,o as p}from"./index-CMUSrGrd.js";const _=o({__name:"Card",props:{class:{}},setup(s){const a=s;return(r,d)=>(p(),n("div",{class:t(c(e)("rounded-lg border bg-card text-card-foreground shadow-sm",a.class))},[l(r.$slots,"default")],2))}}),f=o({__name:"CardContent",props:{class:{}},setup(s){const a=s;return(r,d)=>(p(),n("div",{class:t(c(e)("p-6 pt-0",a.class))},[l(r.$slots,"default")],2))}});export{_,f as a}; +import{c as e}from"./utils-7WVCegLb.js";import{d as o,c as n,n as t,h as c,m as l,o as p}from"./index-BsVgmrYd.js";const _=o({__name:"Card",props:{class:{}},setup(s){const a=s;return(r,d)=>(p(),n("div",{class:t(c(e)("rounded-lg border bg-card text-card-foreground shadow-sm",a.class))},[l(r.$slots,"default")],2))}}),f=o({__name:"CardContent",props:{class:{}},setup(s){const a=s;return(r,d)=>(p(),n("div",{class:t(c(e)("p-6 pt-0",a.class))},[l(r.$slots,"default")],2))}});export{_,f as a}; diff --git a/src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-DKwAVa1N.js b/src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-BO3n7g7a.js similarity index 87% rename from src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-DKwAVa1N.js rename to src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-BO3n7g7a.js index f1a91d6..4090296 100644 --- a/src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-DKwAVa1N.js +++ b/src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-BO3n7g7a.js @@ -1 +1 @@ -import{c as t}from"./utils-7WVCegLb.js";import{d as n,o,c as r,n as c,h as l,m as p}from"./index-CMUSrGrd.js";const f=n({__name:"CardHeader",props:{class:{}},setup(s){const e=s;return(a,m)=>(o(),r("div",{class:c(l(t)("flex flex-col space-y-1.5 p-6",e.class))},[p(a.$slots,"default")],2))}}),_=n({__name:"CardTitle",props:{class:{}},setup(s){const e=s;return(a,m)=>(o(),r("h3",{class:c(l(t)("text-lg font-semibold leading-none tracking-tight",e.class))},[p(a.$slots,"default")],2))}});export{f as _,_ as a}; +import{c as t}from"./utils-7WVCegLb.js";import{d as n,o,c as r,n as c,h as l,m as p}from"./index-BsVgmrYd.js";const f=n({__name:"CardHeader",props:{class:{}},setup(s){const e=s;return(a,m)=>(o(),r("div",{class:c(l(t)("flex flex-col space-y-1.5 p-6",e.class))},[p(a.$slots,"default")],2))}}),_=n({__name:"CardTitle",props:{class:{}},setup(s){const e=s;return(a,m)=>(o(),r("h3",{class:c(l(t)("text-lg font-semibold leading-none tracking-tight",e.class))},[p(a.$slots,"default")],2))}});export{f as _,_ as a}; diff --git a/src/static/assets/DashboardView-m9gOgQuc.js b/src/static/assets/DashboardView-sKPaoFjB.js similarity index 96% rename from src/static/assets/DashboardView-m9gOgQuc.js rename to src/static/assets/DashboardView-sKPaoFjB.js index 7c040d4..ba815f5 100644 --- a/src/static/assets/DashboardView-m9gOgQuc.js +++ b/src/static/assets/DashboardView-sKPaoFjB.js @@ -1 +1 @@ -import{d as K,k as L,w as d,n as u,s as Z,h as y,R as O,o as l,e as a,a as e,t as g,c as s,i as B,p as b,j as C,v as ee,x as te,F as v,r as h,y as W,z as E,q as p,A as k,f as oe}from"./index-CMUSrGrd.js";import{d as j}from"./dashboard-BcrvrRpF.js";import{a as M,_ as D}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{_ as F,a as P}from"./CardTitle.vue_vue_type_script_setup_true_lang-DKwAVa1N.js";import{_ as le}from"./Progress.vue_vue_type_script_setup_true_lang-DnLPO6Lx.js";import{_ as se}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{f as _,i as q}from"./utils-7WVCegLb.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";const re={class:"flex items-start justify-between gap-2"},ae={class:"flex-1 min-w-0"},ne={class:"mt-2"},de={key:0,class:"h-7 w-20 bg-muted animate-pulse rounded"},ie={key:0,class:"text-xs text-muted-foreground mt-1.5 truncate"},ue={key:0,class:"mt-3 flex items-center gap-1.5 text-xs"},ce={class:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},me={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 10l7-7m0 0l7 7m-7-7v18"},ge={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M19 14l-7 7m0 0l-7-7m7 7V3"},fe={key:2,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 12h14"},w=K({__name:"KpiCard",props:{label:{},value:{},icon:{},trend:{},description:{},loading:{type:Boolean},hero:{type:Boolean},to:{}},setup(r){const R=r,m=C(()=>R.hero?"relative overflow-hidden transition-all duration-200 border-primary/20 bg-primary/5 ring-1 ring-primary/15 panel-glow-hover":"relative overflow-hidden transition-all duration-200 border-border/60 panel-glow-hover");return($,i)=>(l(),L(Z(r.to?y(O):"div"),{to:r.to,class:u(r.to?"block hover:opacity-90 transition-opacity":"")},{default:d(()=>[a(D,{class:u(m.value)},{default:d(()=>[e("span",{class:u(["pointer-events-none absolute -right-4 -top-4 h-14 w-14 rounded-full",r.hero?"bg-primary/10":"bg-primary/5"])},null,2),e("span",{class:u(["pointer-events-none absolute -right-1 -top-1 h-6 w-6 rounded-full",r.hero?"bg-primary/15":"bg-primary/8"])},null,2),a(M,{class:"p-5"},{default:d(()=>[e("div",re,[e("div",ae,[e("p",{class:u(["text-[10px] font-semibold uppercase tracking-[0.1em] truncate",r.hero?"text-primary/80":"text-muted-foreground"])},g(r.label),3),e("div",ne,[r.loading?(l(),s("div",de)):(l(),s("p",{key:1,class:u(["kpi-value font-bold tracking-tight leading-none",r.hero?"text-3xl text-primary":"text-2xl text-foreground"])},g(r.value),3))]),r.description?(l(),s("p",ie,g(r.description),1)):B("",!0)]),r.icon?(l(),s("div",{key:0,class:u(["rounded-xl flex items-center justify-center shrink-0",[r.hero?"h-11 w-11 bg-primary/15 ring-1 ring-primary/25":"h-9 w-9 bg-muted ring-1 ring-border"]])},[r.icon==="clock"?(l(),s("svg",{key:0,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[0]||(i[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])],2)):r.icon==="calendar"?(l(),s("svg",{key:1,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[1]||(i[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2)):r.icon==="folder"?(l(),s("svg",{key:2,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[2]||(i[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"},null,-1)])],2)):r.icon==="trending-up"?(l(),s("svg",{key:3,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[3]||(i[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},null,-1)])],2)):r.icon==="git"?(l(),s("svg",{key:4,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[4]||(i[4]=[e("circle",{cx:"12",cy:"12",r:"4",stroke:"currentColor","stroke-width":"2"},null,-1),e("path",{"stroke-linecap":"round","stroke-width":"2",d:"M2 12h6M16 12h6"},null,-1)])],2)):(l(),s("svg",{key:5,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[5]||(i[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)])],2))],2)):B("",!0)]),r.trend!==void 0?(l(),s("div",ue,[e("div",{class:u(["flex items-center gap-1 font-semibold tabular-nums",r.trend>0?"text-[hsl(var(--success))]":r.trend<0?"text-destructive":"text-muted-foreground"])},[(l(),s("svg",ce,[r.trend>0?(l(),s("path",me)):r.trend<0?(l(),s("path",ge)):(l(),s("path",fe))])),b(" "+g(r.trend>0?"+":"")+g(Math.abs(r.trend))+"% ",1)],2),i[6]||(i[6]=e("span",{class:"text-muted-foreground"},"vs last period",-1))])):B("",!0),e("div",{class:u(["mt-3 h-px rounded-full",r.hero?"w-full bg-primary/20":"w-10 bg-primary/20"])},null,2)]),_:1})]),_:1},8,["class"])]),_:1},8,["to","class"]))}}),ve={class:"p-6 space-y-6"},xe={class:"flex flex-wrap items-center gap-3"},he={class:"flex items-center rounded-lg border border-border overflow-hidden bg-muted/30"},pe=["onClick"],ye={class:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-6 gap-4"},ke={class:"grid grid-cols-1 lg:grid-cols-2 gap-4"},we={key:0,class:"h-40 flex items-end gap-px"},be={key:1,class:"h-40 flex flex-col items-center justify-center gap-2"},$e={key:2,class:"h-40 flex items-end gap-px overflow-hidden"},je=["title","onClick"],_e={key:0,class:"h-40 flex items-end gap-2"},Ce={key:1,class:"h-40 flex flex-col items-center justify-center gap-2"},Me={key:2,class:"flex items-end gap-2",style:{height:"160px"}},De=["title"],Be={class:"text-[10px] text-muted-foreground font-medium"},Ve={class:"grid grid-cols-1 lg:grid-cols-2 gap-4"},ze={key:0,class:"space-y-3"},He={key:1,class:"flex flex-col items-center justify-center py-8 gap-2"},Ne={key:2,class:"space-y-2.5"},Te={class:"text-xs text-foreground w-24 truncate shrink-0 tabular-nums"},Ae={class:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden"},Fe={class:"text-xs text-muted-foreground w-9 text-right shrink-0 tabular-nums"},Pe={key:0,class:"space-y-3"},Re={class:"flex justify-between"},Se={key:1,class:"flex flex-col items-center justify-center py-8 gap-2"},Ue={key:2,class:"space-y-2.5"},qe={class:"flex items-center justify-between text-xs mb-1"},Le={class:"text-foreground truncate max-w-[160px] font-medium group-hover:text-primary transition-colors"},We={class:"text-muted-foreground shrink-0 tabular-nums ml-2"},Ye=K({__name:"DashboardView",setup(r){const R=oe(),m=p("today"),$=p(""),i=p(""),x=p(null),S=p([]),V=p([]),z=p([]),H=p([]),c=p(!1),G=C(()=>{const n=new Date,o=q(n);if(m.value==="today")return{from:o,to:o};if(m.value==="7d"){const f=new Date(n);return f.setDate(n.getDate()-7),{from:q(f),to:o}}else if(m.value==="30d"){const f=new Date(n);return f.setDate(n.getDate()-30),{from:q(f),to:o}}else return{from:$.value||o,to:i.value||o}});async function U(){if(!(m.value==="custom"&&(!$.value||!i.value))){c.value=!0;try{const n=G.value,[o,f,N,T,A]=await Promise.all([j.summary(n),j.projects(n),j.timeline(n),j.dow(n),j.tools(n)]);x.value=o.data,S.value=f.data,V.value=N.data,z.value=T.data,H.value=A.data}catch(n){console.error("Failed to load dashboard data",n)}finally{c.value=!1}}}ee(m,()=>{m.value!=="custom"&&U()}),te(()=>U());const I=C(()=>Math.max(...V.value.map(n=>n.hours),1)),J=C(()=>Math.max(...z.value.map(n=>n.hours),1)),Q=C(()=>Math.max(...H.value.map(n=>n.pct),1)),X=n=>n?n>90?"danger":n>70?"warning":"success":"default";return(n,o)=>{var f,N,T,A;return l(),s("div",ve,[e("div",xe,[o[4]||(o[4]=e("h2",{class:"text-base font-semibold text-foreground flex-1 tracking-tight"},"Overview",-1)),e("div",he,[(l(),s(v,null,h(["today","7d","30d","custom"],t=>e("button",{key:t,class:u(["px-3 py-1.5 text-xs font-medium transition-colors",m.value===t?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),onClick:Y=>m.value=t},g(t==="today"?"Today":t==="7d"?"7 days":t==="30d"?"30 days":"Custom"),11,pe)),64))]),m.value==="custom"?(l(),s(v,{key:0},[W(e("input",{"onUpdate:modelValue":o[0]||(o[0]=t=>$.value=t),type:"date",class:"h-8 rounded-lg border border-input bg-muted/30 px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[E,$.value]]),o[3]||(o[3]=e("span",{class:"text-xs text-muted-foreground"},"to",-1)),W(e("input",{"onUpdate:modelValue":o[1]||(o[1]=t=>i.value=t),type:"date",class:"h-8 rounded-lg border border-input bg-muted/30 px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[E,i.value]]),a(se,{size:"sm",loading:c.value,onClick:U},{default:d(()=>[...o[2]||(o[2]=[b("Apply",-1)])]),_:1},8,["loading"])],64)):B("",!0)]),e("div",ye,[a(w,{label:"Total Hours",value:x.value?y(_)(x.value.total_hours):"—",icon:"clock",loading:c.value,hero:!0},null,8,["value","loading"]),a(w,{label:"Working Days",value:((f=x.value)==null?void 0:f.working_days)??"—",icon:"calendar",loading:c.value},null,8,["value","loading"]),a(w,{label:"Projects",value:((N=x.value)==null?void 0:N.total_projects)??"—",icon:"folder",loading:c.value,to:"/projects"},null,8,["value","loading"]),a(w,{label:"Avg / Day",value:x.value?y(_)(x.value.avg_hours_per_day):"—",icon:"trending-up",loading:c.value},null,8,["value","loading"]),a(w,{label:"Top Project",value:((T=x.value)==null?void 0:T.top_project)??"—",icon:"star",loading:c.value,to:"/projects"},null,8,["value","loading"]),a(w,{label:"Commits",value:((A=x.value)==null?void 0:A.total_commits)??"—",icon:"git",loading:c.value},null,8,["value","loading"])]),e("div",ke,[a(D,{class:"border-border/60 bg-card panel-glow"},{default:d(()=>[a(F,{class:"pb-2"},{default:d(()=>[a(P,{class:"text-xs font-semibold text-muted-foreground uppercase tracking-widest"},{default:d(()=>[...o[5]||(o[5]=[b("Hours by Day",-1)])]),_:1})]),_:1}),a(M,null,{default:d(()=>[c.value?(l(),s("div",we,[(l(),s(v,null,h(30,t=>e("div",{key:t,class:"flex-1 bg-muted animate-pulse rounded-t",style:k({height:`${20+Math.random()*60}%`})},null,4)),64))])):V.value.length===0?(l(),s("div",be,[...o[6]||(o[6]=[e("svg",{class:"h-8 w-8 text-muted-foreground/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})],-1),e("p",{class:"text-xs text-muted-foreground"},"No sessions in this period",-1)])])):(l(),s("div",$e,[(l(!0),s(v,null,h(V.value,t=>(l(),s("div",{key:t.date,class:"flex-1 bg-primary/70 hover:bg-primary rounded-t transition-colors duration-150 cursor-pointer",style:k({height:`${Math.max(t.hours/I.value*160,2)}px`}),title:`${t.date}: ${y(_)(t.hours)}`,onClick:Y=>y(R).push({path:"/calendar",query:{date:t.date}})},null,12,je))),128))]))]),_:1})]),_:1}),a(D,{class:"border-border/60 bg-card panel-glow"},{default:d(()=>[a(F,{class:"pb-2"},{default:d(()=>[a(P,{class:"text-xs font-semibold text-muted-foreground uppercase tracking-widest"},{default:d(()=>[...o[7]||(o[7]=[b("By Day of Week",-1)])]),_:1})]),_:1}),a(M,null,{default:d(()=>[c.value?(l(),s("div",_e,[(l(),s(v,null,h(7,t=>e("div",{key:t,class:"flex-1 flex flex-col items-center gap-1"},[e("div",{class:"w-full bg-muted animate-pulse rounded-t",style:k({height:`${30+t*8}%`})},null,4),o[8]||(o[8]=e("div",{class:"h-3 w-4 bg-muted animate-pulse rounded"},null,-1))])),64))])):z.value.length===0?(l(),s("div",Ce,[...o[9]||(o[9]=[e("svg",{class:"h-8 w-8 text-muted-foreground/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1),e("p",{class:"text-xs text-muted-foreground"},"No sessions in this period",-1)])])):(l(),s("div",Me,[(l(!0),s(v,null,h(z.value,t=>(l(),s("div",{key:t.dow,class:"flex-1 flex flex-col items-center gap-1 cursor-default",style:{height:"160px","justify-content":"flex-end"}},[e("div",{class:"w-full bg-primary/70 hover:bg-primary rounded-t transition-colors duration-150",style:k({height:`${Math.max(t.hours/J.value*128,2)}px`}),title:`${t.label}: ${y(_)(t.hours)}`},null,12,De),e("span",Be,g(t.label.slice(0,2)),1)]))),128))]))]),_:1})]),_:1})]),e("div",Ve,[a(D,{class:"border-border/60 bg-card panel-glow"},{default:d(()=>[a(F,{class:"pb-2"},{default:d(()=>[a(P,{class:"text-xs font-semibold text-muted-foreground uppercase tracking-widest"},{default:d(()=>[...o[10]||(o[10]=[b("Tool Usage",-1)])]),_:1})]),_:1}),a(M,null,{default:d(()=>[c.value?(l(),s("div",ze,[(l(),s(v,null,h(5,t=>e("div",{key:t,class:"flex items-center gap-2"},[e("div",{class:"h-3 rounded bg-muted animate-pulse",style:k({width:`${40+t*10}px`})},null,4),o[11]||(o[11]=e("div",{class:"flex-1 h-2 bg-muted animate-pulse rounded-full"},null,-1)),o[12]||(o[12]=e("div",{class:"h-3 w-8 bg-muted animate-pulse rounded"},null,-1))])),64))])):H.value.length===0?(l(),s("div",He,[...o[13]||(o[13]=[e("svg",{class:"h-8 w-8 text-muted-foreground/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",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.065 2.572c1.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.572 1.065c-.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.065-2.572c-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"})],-1),e("p",{class:"text-xs text-muted-foreground"},"No tool data yet",-1)])])):(l(),s("div",Ne,[(l(!0),s(v,null,h(H.value.slice(0,8),t=>(l(),s("div",{key:t.tool,class:"flex items-center gap-2.5"},[e("span",Te,g(t.tool),1),e("div",Ae,[e("div",{class:"h-full bg-primary/70 rounded-full transition-all duration-300",style:k({width:`${t.pct/Q.value*100}%`})},null,4)]),e("span",Fe,g((t.pct??0).toFixed(0))+"% ",1)]))),128))]))]),_:1})]),_:1}),a(D,{class:"border-border/60 bg-card panel-glow"},{default:d(()=>[a(F,{class:"pb-2"},{default:d(()=>[a(P,{class:"text-xs font-semibold text-muted-foreground uppercase tracking-widest"},{default:d(()=>[...o[14]||(o[14]=[b("Projects",-1)])]),_:1})]),_:1}),a(M,null,{default:d(()=>[c.value?(l(),s("div",Pe,[(l(),s(v,null,h(5,t=>e("div",{key:t,class:"space-y-1.5"},[e("div",Re,[e("div",{class:"h-3 rounded bg-muted animate-pulse",style:k({width:`${80+t*15}px`})},null,4),o[15]||(o[15]=e("div",{class:"h-3 w-12 bg-muted animate-pulse rounded"},null,-1))]),o[16]||(o[16]=e("div",{class:"h-1.5 bg-muted animate-pulse rounded-full"},null,-1))])),64))])):S.value.length===0?(l(),s("div",Se,[...o[17]||(o[17]=[e("svg",{class:"h-8 w-8 text-muted-foreground/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"})],-1),e("p",{class:"text-xs text-muted-foreground"},"No project data yet",-1)])])):(l(),s("div",Ue,[(l(!0),s(v,null,h(S.value.slice(0,8),t=>(l(),L(y(O),{key:t.project_id,to:`/projects/${t.project_id}`,class:"block group"},{default:d(()=>[e("div",qe,[e("span",Le,g(t.display_name),1),e("span",We,g(y(_)(t.total_hours)),1)]),t.progress_pct!==null?(l(),L(le,{key:0,value:t.progress_pct,color:X(t.progress_pct)},null,8,["value","color"])):B("",!0)]),_:2},1032,["to"]))),128))]))]),_:1})]),_:1})])])}}});export{Ye as default}; +import{d as K,k as L,w as d,n as u,s as Z,h as y,R as O,o as l,e as a,a as e,t as g,c as s,i as B,p as b,j as C,v as ee,x as te,F as v,r as h,y as W,z as E,q as p,A as k,f as oe}from"./index-BsVgmrYd.js";import{d as j}from"./dashboard-BQR_-Gvh.js";import{a as M,_ as D}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{_ as F,a as P}from"./CardTitle.vue_vue_type_script_setup_true_lang-BO3n7g7a.js";import{_ as le}from"./Progress.vue_vue_type_script_setup_true_lang-Bsk7zWW7.js";import{_ as se}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{f as _,i as q}from"./utils-7WVCegLb.js";import"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";const re={class:"flex items-start justify-between gap-2"},ae={class:"flex-1 min-w-0"},ne={class:"mt-2"},de={key:0,class:"h-7 w-20 bg-muted animate-pulse rounded"},ie={key:0,class:"text-xs text-muted-foreground mt-1.5 truncate"},ue={key:0,class:"mt-3 flex items-center gap-1.5 text-xs"},ce={class:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},me={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 10l7-7m0 0l7 7m-7-7v18"},ge={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M19 14l-7 7m0 0l-7-7m7 7V3"},fe={key:2,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 12h14"},w=K({__name:"KpiCard",props:{label:{},value:{},icon:{},trend:{},description:{},loading:{type:Boolean},hero:{type:Boolean},to:{}},setup(r){const R=r,m=C(()=>R.hero?"relative overflow-hidden transition-all duration-200 border-primary/20 bg-primary/5 ring-1 ring-primary/15 panel-glow-hover":"relative overflow-hidden transition-all duration-200 border-border/60 panel-glow-hover");return($,i)=>(l(),L(Z(r.to?y(O):"div"),{to:r.to,class:u(r.to?"block hover:opacity-90 transition-opacity":"")},{default:d(()=>[a(D,{class:u(m.value)},{default:d(()=>[e("span",{class:u(["pointer-events-none absolute -right-4 -top-4 h-14 w-14 rounded-full",r.hero?"bg-primary/10":"bg-primary/5"])},null,2),e("span",{class:u(["pointer-events-none absolute -right-1 -top-1 h-6 w-6 rounded-full",r.hero?"bg-primary/15":"bg-primary/8"])},null,2),a(M,{class:"p-5"},{default:d(()=>[e("div",re,[e("div",ae,[e("p",{class:u(["text-[10px] font-semibold uppercase tracking-[0.1em] truncate",r.hero?"text-primary/80":"text-muted-foreground"])},g(r.label),3),e("div",ne,[r.loading?(l(),s("div",de)):(l(),s("p",{key:1,class:u(["kpi-value font-bold tracking-tight leading-none",r.hero?"text-3xl text-primary":"text-2xl text-foreground"])},g(r.value),3))]),r.description?(l(),s("p",ie,g(r.description),1)):B("",!0)]),r.icon?(l(),s("div",{key:0,class:u(["rounded-xl flex items-center justify-center shrink-0",[r.hero?"h-11 w-11 bg-primary/15 ring-1 ring-primary/25":"h-9 w-9 bg-muted ring-1 ring-border"]])},[r.icon==="clock"?(l(),s("svg",{key:0,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[0]||(i[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])],2)):r.icon==="calendar"?(l(),s("svg",{key:1,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[1]||(i[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2)):r.icon==="folder"?(l(),s("svg",{key:2,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[2]||(i[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"},null,-1)])],2)):r.icon==="trending-up"?(l(),s("svg",{key:3,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[3]||(i[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},null,-1)])],2)):r.icon==="git"?(l(),s("svg",{key:4,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[4]||(i[4]=[e("circle",{cx:"12",cy:"12",r:"4",stroke:"currentColor","stroke-width":"2"},null,-1),e("path",{"stroke-linecap":"round","stroke-width":"2",d:"M2 12h6M16 12h6"},null,-1)])],2)):(l(),s("svg",{key:5,class:u(["shrink-0",r.hero?"h-5 w-5 text-primary":"h-4 w-4 text-muted-foreground"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...i[5]||(i[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)])],2))],2)):B("",!0)]),r.trend!==void 0?(l(),s("div",ue,[e("div",{class:u(["flex items-center gap-1 font-semibold tabular-nums",r.trend>0?"text-[hsl(var(--success))]":r.trend<0?"text-destructive":"text-muted-foreground"])},[(l(),s("svg",ce,[r.trend>0?(l(),s("path",me)):r.trend<0?(l(),s("path",ge)):(l(),s("path",fe))])),b(" "+g(r.trend>0?"+":"")+g(Math.abs(r.trend))+"% ",1)],2),i[6]||(i[6]=e("span",{class:"text-muted-foreground"},"vs last period",-1))])):B("",!0),e("div",{class:u(["mt-3 h-px rounded-full",r.hero?"w-full bg-primary/20":"w-10 bg-primary/20"])},null,2)]),_:1})]),_:1},8,["class"])]),_:1},8,["to","class"]))}}),ve={class:"p-6 space-y-6"},xe={class:"flex flex-wrap items-center gap-3"},he={class:"flex items-center rounded-lg border border-border overflow-hidden bg-muted/30"},pe=["onClick"],ye={class:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-6 gap-4"},ke={class:"grid grid-cols-1 lg:grid-cols-2 gap-4"},we={key:0,class:"h-40 flex items-end gap-px"},be={key:1,class:"h-40 flex flex-col items-center justify-center gap-2"},$e={key:2,class:"h-40 flex items-end gap-px overflow-hidden"},je=["title","onClick"],_e={key:0,class:"h-40 flex items-end gap-2"},Ce={key:1,class:"h-40 flex flex-col items-center justify-center gap-2"},Me={key:2,class:"flex items-end gap-2",style:{height:"160px"}},De=["title"],Be={class:"text-[10px] text-muted-foreground font-medium"},Ve={class:"grid grid-cols-1 lg:grid-cols-2 gap-4"},ze={key:0,class:"space-y-3"},He={key:1,class:"flex flex-col items-center justify-center py-8 gap-2"},Ne={key:2,class:"space-y-2.5"},Te={class:"text-xs text-foreground w-24 truncate shrink-0 tabular-nums"},Ae={class:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden"},Fe={class:"text-xs text-muted-foreground w-9 text-right shrink-0 tabular-nums"},Pe={key:0,class:"space-y-3"},Re={class:"flex justify-between"},Se={key:1,class:"flex flex-col items-center justify-center py-8 gap-2"},Ue={key:2,class:"space-y-2.5"},qe={class:"flex items-center justify-between text-xs mb-1"},Le={class:"text-foreground truncate max-w-[160px] font-medium group-hover:text-primary transition-colors"},We={class:"text-muted-foreground shrink-0 tabular-nums ml-2"},Ye=K({__name:"DashboardView",setup(r){const R=oe(),m=p("today"),$=p(""),i=p(""),x=p(null),S=p([]),V=p([]),z=p([]),H=p([]),c=p(!1),G=C(()=>{const n=new Date,o=q(n);if(m.value==="today")return{from:o,to:o};if(m.value==="7d"){const f=new Date(n);return f.setDate(n.getDate()-7),{from:q(f),to:o}}else if(m.value==="30d"){const f=new Date(n);return f.setDate(n.getDate()-30),{from:q(f),to:o}}else return{from:$.value||o,to:i.value||o}});async function U(){if(!(m.value==="custom"&&(!$.value||!i.value))){c.value=!0;try{const n=G.value,[o,f,N,T,A]=await Promise.all([j.summary(n),j.projects(n),j.timeline(n),j.dow(n),j.tools(n)]);x.value=o.data,S.value=f.data,V.value=N.data,z.value=T.data,H.value=A.data}catch(n){console.error("Failed to load dashboard data",n)}finally{c.value=!1}}}ee(m,()=>{m.value!=="custom"&&U()}),te(()=>U());const I=C(()=>Math.max(...V.value.map(n=>n.hours),1)),J=C(()=>Math.max(...z.value.map(n=>n.hours),1)),Q=C(()=>Math.max(...H.value.map(n=>n.pct),1)),X=n=>n?n>90?"danger":n>70?"warning":"success":"default";return(n,o)=>{var f,N,T,A;return l(),s("div",ve,[e("div",xe,[o[4]||(o[4]=e("h2",{class:"text-base font-semibold text-foreground flex-1 tracking-tight"},"Overview",-1)),e("div",he,[(l(),s(v,null,h(["today","7d","30d","custom"],t=>e("button",{key:t,class:u(["px-3 py-1.5 text-xs font-medium transition-colors",m.value===t?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),onClick:Y=>m.value=t},g(t==="today"?"Today":t==="7d"?"7 days":t==="30d"?"30 days":"Custom"),11,pe)),64))]),m.value==="custom"?(l(),s(v,{key:0},[W(e("input",{"onUpdate:modelValue":o[0]||(o[0]=t=>$.value=t),type:"date",class:"h-8 rounded-lg border border-input bg-muted/30 px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[E,$.value]]),o[3]||(o[3]=e("span",{class:"text-xs text-muted-foreground"},"to",-1)),W(e("input",{"onUpdate:modelValue":o[1]||(o[1]=t=>i.value=t),type:"date",class:"h-8 rounded-lg border border-input bg-muted/30 px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[E,i.value]]),a(se,{size:"sm",loading:c.value,onClick:U},{default:d(()=>[...o[2]||(o[2]=[b("Apply",-1)])]),_:1},8,["loading"])],64)):B("",!0)]),e("div",ye,[a(w,{label:"Total Hours",value:x.value?y(_)(x.value.total_hours):"—",icon:"clock",loading:c.value,hero:!0},null,8,["value","loading"]),a(w,{label:"Working Days",value:((f=x.value)==null?void 0:f.working_days)??"—",icon:"calendar",loading:c.value},null,8,["value","loading"]),a(w,{label:"Projects",value:((N=x.value)==null?void 0:N.total_projects)??"—",icon:"folder",loading:c.value,to:"/projects"},null,8,["value","loading"]),a(w,{label:"Avg / Day",value:x.value?y(_)(x.value.avg_hours_per_day):"—",icon:"trending-up",loading:c.value},null,8,["value","loading"]),a(w,{label:"Top Project",value:((T=x.value)==null?void 0:T.top_project)??"—",icon:"star",loading:c.value,to:"/projects"},null,8,["value","loading"]),a(w,{label:"Commits",value:((A=x.value)==null?void 0:A.total_commits)??"—",icon:"git",loading:c.value},null,8,["value","loading"])]),e("div",ke,[a(D,{class:"border-border/60 bg-card panel-glow"},{default:d(()=>[a(F,{class:"pb-2"},{default:d(()=>[a(P,{class:"text-xs font-semibold text-muted-foreground uppercase tracking-widest"},{default:d(()=>[...o[5]||(o[5]=[b("Hours by Day",-1)])]),_:1})]),_:1}),a(M,null,{default:d(()=>[c.value?(l(),s("div",we,[(l(),s(v,null,h(30,t=>e("div",{key:t,class:"flex-1 bg-muted animate-pulse rounded-t",style:k({height:`${20+Math.random()*60}%`})},null,4)),64))])):V.value.length===0?(l(),s("div",be,[...o[6]||(o[6]=[e("svg",{class:"h-8 w-8 text-muted-foreground/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})],-1),e("p",{class:"text-xs text-muted-foreground"},"No sessions in this period",-1)])])):(l(),s("div",$e,[(l(!0),s(v,null,h(V.value,t=>(l(),s("div",{key:t.date,class:"flex-1 bg-primary/70 hover:bg-primary rounded-t transition-colors duration-150 cursor-pointer",style:k({height:`${Math.max(t.hours/I.value*160,2)}px`}),title:`${t.date}: ${y(_)(t.hours)}`,onClick:Y=>y(R).push({path:"/calendar",query:{date:t.date}})},null,12,je))),128))]))]),_:1})]),_:1}),a(D,{class:"border-border/60 bg-card panel-glow"},{default:d(()=>[a(F,{class:"pb-2"},{default:d(()=>[a(P,{class:"text-xs font-semibold text-muted-foreground uppercase tracking-widest"},{default:d(()=>[...o[7]||(o[7]=[b("By Day of Week",-1)])]),_:1})]),_:1}),a(M,null,{default:d(()=>[c.value?(l(),s("div",_e,[(l(),s(v,null,h(7,t=>e("div",{key:t,class:"flex-1 flex flex-col items-center gap-1"},[e("div",{class:"w-full bg-muted animate-pulse rounded-t",style:k({height:`${30+t*8}%`})},null,4),o[8]||(o[8]=e("div",{class:"h-3 w-4 bg-muted animate-pulse rounded"},null,-1))])),64))])):z.value.length===0?(l(),s("div",Ce,[...o[9]||(o[9]=[e("svg",{class:"h-8 w-8 text-muted-foreground/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1),e("p",{class:"text-xs text-muted-foreground"},"No sessions in this period",-1)])])):(l(),s("div",Me,[(l(!0),s(v,null,h(z.value,t=>(l(),s("div",{key:t.dow,class:"flex-1 flex flex-col items-center gap-1 cursor-default",style:{height:"160px","justify-content":"flex-end"}},[e("div",{class:"w-full bg-primary/70 hover:bg-primary rounded-t transition-colors duration-150",style:k({height:`${Math.max(t.hours/J.value*128,2)}px`}),title:`${t.label}: ${y(_)(t.hours)}`},null,12,De),e("span",Be,g(t.label.slice(0,2)),1)]))),128))]))]),_:1})]),_:1})]),e("div",Ve,[a(D,{class:"border-border/60 bg-card panel-glow"},{default:d(()=>[a(F,{class:"pb-2"},{default:d(()=>[a(P,{class:"text-xs font-semibold text-muted-foreground uppercase tracking-widest"},{default:d(()=>[...o[10]||(o[10]=[b("Tool Usage",-1)])]),_:1})]),_:1}),a(M,null,{default:d(()=>[c.value?(l(),s("div",ze,[(l(),s(v,null,h(5,t=>e("div",{key:t,class:"flex items-center gap-2"},[e("div",{class:"h-3 rounded bg-muted animate-pulse",style:k({width:`${40+t*10}px`})},null,4),o[11]||(o[11]=e("div",{class:"flex-1 h-2 bg-muted animate-pulse rounded-full"},null,-1)),o[12]||(o[12]=e("div",{class:"h-3 w-8 bg-muted animate-pulse rounded"},null,-1))])),64))])):H.value.length===0?(l(),s("div",He,[...o[13]||(o[13]=[e("svg",{class:"h-8 w-8 text-muted-foreground/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",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.065 2.572c1.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.572 1.065c-.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.065-2.572c-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"})],-1),e("p",{class:"text-xs text-muted-foreground"},"No tool data yet",-1)])])):(l(),s("div",Ne,[(l(!0),s(v,null,h(H.value.slice(0,8),t=>(l(),s("div",{key:t.tool,class:"flex items-center gap-2.5"},[e("span",Te,g(t.tool),1),e("div",Ae,[e("div",{class:"h-full bg-primary/70 rounded-full transition-all duration-300",style:k({width:`${t.pct/Q.value*100}%`})},null,4)]),e("span",Fe,g((t.pct??0).toFixed(0))+"% ",1)]))),128))]))]),_:1})]),_:1}),a(D,{class:"border-border/60 bg-card panel-glow"},{default:d(()=>[a(F,{class:"pb-2"},{default:d(()=>[a(P,{class:"text-xs font-semibold text-muted-foreground uppercase tracking-widest"},{default:d(()=>[...o[14]||(o[14]=[b("Projects",-1)])]),_:1})]),_:1}),a(M,null,{default:d(()=>[c.value?(l(),s("div",Pe,[(l(),s(v,null,h(5,t=>e("div",{key:t,class:"space-y-1.5"},[e("div",Re,[e("div",{class:"h-3 rounded bg-muted animate-pulse",style:k({width:`${80+t*15}px`})},null,4),o[15]||(o[15]=e("div",{class:"h-3 w-12 bg-muted animate-pulse rounded"},null,-1))]),o[16]||(o[16]=e("div",{class:"h-1.5 bg-muted animate-pulse rounded-full"},null,-1))])),64))])):S.value.length===0?(l(),s("div",Se,[...o[17]||(o[17]=[e("svg",{class:"h-8 w-8 text-muted-foreground/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"})],-1),e("p",{class:"text-xs text-muted-foreground"},"No project data yet",-1)])])):(l(),s("div",Ue,[(l(!0),s(v,null,h(S.value.slice(0,8),t=>(l(),L(y(O),{key:t.project_id,to:`/projects/${t.project_id}`,class:"block group"},{default:d(()=>[e("div",qe,[e("span",Le,g(t.display_name),1),e("span",We,g(y(_)(t.total_hours)),1)]),t.progress_pct!==null?(l(),L(le,{key:0,value:t.progress_pct,color:X(t.progress_pct)},null,8,["value","color"])):B("",!0)]),_:2},1032,["to"]))),128))]))]),_:1})]),_:1})])])}}});export{Ye as default}; diff --git a/src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-C3QMf5bS.js b/src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-CTHVanFL.js similarity index 90% rename from src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-C3QMf5bS.js rename to src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-CTHVanFL.js index 7a41f5d..d6994fc 100644 --- a/src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-C3QMf5bS.js +++ b/src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-CTHVanFL.js @@ -1 +1 @@ -import{u as D}from"./devops-DCMlzRTJ.js";import{_}from"./Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js";import{_ as V}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{d as j,q as c,o as i,c as m,h as a,a as o,p as g,t as d,i as p,e as v,w as k,k as z,K as u}from"./index-CMUSrGrd.js";const B={class:"space-y-4"},I={key:0,class:"text-xs text-muted-foreground space-y-1"},N={class:"text-foreground"},P={class:"text-foreground"},S={key:0},U={key:1,class:"text-red-400"},b={class:"grid grid-cols-2 gap-3"},A={class:"space-y-1.5"},F={class:"space-y-1.5"},O={class:"space-y-1.5"},q={class:"flex items-center gap-2"},G=j({__name:"DevopsConnectForm",setup(E){var y,x;const t=D(),n=c(((y=t.integration)==null?void 0:y.organization)??""),r=c(((x=t.integration)==null?void 0:x.project)??""),s=c(""),f=c(!1);async function w(){if(!n.value||!r.value||!s.value){u.error("All fields are required");return}f.value=!0;try{await t.saveIntegration({organization:n.value,project:r.value,pat:s.value}),s.value="",u.success("Integration saved")}catch{u.error("Failed to save integration")}finally{f.value=!1}}async function C(){if(confirm("Delete ADO integration?"))try{await t.deleteIntegration(),n.value="",r.value="",s.value="",u.success("Integration deleted")}catch{u.error("Failed to delete integration")}}return(K,e)=>(i(),m("div",B,[a(t).integration?(i(),m("div",I,[o("p",null,[e[3]||(e[3]=g(" Connected to ",-1)),o("strong",N,d(a(t).integration.organization),1),e[4]||(e[4]=g(" / ",-1)),o("strong",P,d(a(t).integration.project),1)]),a(t).integration.last_synced_at?(i(),m("p",S," Last synced: "+d(new Date(a(t).integration.last_synced_at).toLocaleString()),1)):p("",!0),a(t).integration.last_sync_error?(i(),m("p",U," Error: "+d(a(t).integration.last_sync_error),1)):p("",!0)])):p("",!0),o("div",b,[o("div",A,[e[5]||(e[5]=o("label",{class:"text-sm font-medium text-foreground"},"Organization",-1)),v(_,{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=l=>n.value=l),placeholder:"myorg"},null,8,["modelValue"])]),o("div",F,[e[6]||(e[6]=o("label",{class:"text-sm font-medium text-foreground"},"Project",-1)),v(_,{modelValue:r.value,"onUpdate:modelValue":e[1]||(e[1]=l=>r.value=l),placeholder:"myproject"},null,8,["modelValue"])])]),o("div",O,[e[7]||(e[7]=o("label",{class:"text-sm font-medium text-foreground"}," Personal Access Token ",-1)),v(_,{modelValue:s.value,"onUpdate:modelValue":e[2]||(e[2]=l=>s.value=l),type:"password",placeholder:"••••••••",autocomplete:"new-password"},null,8,["modelValue"])]),o("div",q,[v(V,{loading:f.value,onClick:w},{default:k(()=>[g(d(a(t).integration?"Update":"Connect"),1)]),_:1},8,["loading"]),a(t).integration?(i(),z(V,{key:0,variant:"destructive",size:"sm",onClick:C},{default:k(()=>[...e[8]||(e[8]=[g(" Disconnect ",-1)])]),_:1})):p("",!0)])]))}});export{G as _}; +import{u as D}from"./devops-Dr0K2zsR.js";import{_}from"./Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js";import{_ as V}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{d as j,q as c,o as i,c as m,h as a,a as o,p as g,t as d,i as p,e as v,w as k,k as z,K as u}from"./index-BsVgmrYd.js";const B={class:"space-y-4"},I={key:0,class:"text-xs text-muted-foreground space-y-1"},N={class:"text-foreground"},P={class:"text-foreground"},S={key:0},U={key:1,class:"text-red-400"},b={class:"grid grid-cols-2 gap-3"},A={class:"space-y-1.5"},F={class:"space-y-1.5"},O={class:"space-y-1.5"},q={class:"flex items-center gap-2"},G=j({__name:"DevopsConnectForm",setup(E){var y,x;const t=D(),n=c(((y=t.integration)==null?void 0:y.organization)??""),r=c(((x=t.integration)==null?void 0:x.project)??""),s=c(""),f=c(!1);async function w(){if(!n.value||!r.value||!s.value){u.error("All fields are required");return}f.value=!0;try{await t.saveIntegration({organization:n.value,project:r.value,pat:s.value}),s.value="",u.success("Integration saved")}catch{u.error("Failed to save integration")}finally{f.value=!1}}async function C(){if(confirm("Delete ADO integration?"))try{await t.deleteIntegration(),n.value="",r.value="",s.value="",u.success("Integration deleted")}catch{u.error("Failed to delete integration")}}return(K,e)=>(i(),m("div",B,[a(t).integration?(i(),m("div",I,[o("p",null,[e[3]||(e[3]=g(" Connected to ",-1)),o("strong",N,d(a(t).integration.organization),1),e[4]||(e[4]=g(" / ",-1)),o("strong",P,d(a(t).integration.project),1)]),a(t).integration.last_synced_at?(i(),m("p",S," Last synced: "+d(new Date(a(t).integration.last_synced_at).toLocaleString()),1)):p("",!0),a(t).integration.last_sync_error?(i(),m("p",U," Error: "+d(a(t).integration.last_sync_error),1)):p("",!0)])):p("",!0),o("div",b,[o("div",A,[e[5]||(e[5]=o("label",{class:"text-sm font-medium text-foreground"},"Organization",-1)),v(_,{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=l=>n.value=l),placeholder:"myorg"},null,8,["modelValue"])]),o("div",F,[e[6]||(e[6]=o("label",{class:"text-sm font-medium text-foreground"},"Project",-1)),v(_,{modelValue:r.value,"onUpdate:modelValue":e[1]||(e[1]=l=>r.value=l),placeholder:"myproject"},null,8,["modelValue"])])]),o("div",O,[e[7]||(e[7]=o("label",{class:"text-sm font-medium text-foreground"}," Personal Access Token ",-1)),v(_,{modelValue:s.value,"onUpdate:modelValue":e[2]||(e[2]=l=>s.value=l),type:"password",placeholder:"••••••••",autocomplete:"new-password"},null,8,["modelValue"])]),o("div",q,[v(V,{loading:f.value,onClick:w},{default:k(()=>[g(d(a(t).integration?"Update":"Connect"),1)]),_:1},8,["loading"]),a(t).integration?(i(),z(V,{key:0,variant:"destructive",size:"sm",onClick:C},{default:k(()=>[...e[8]||(e[8]=[g(" Disconnect ",-1)])]),_:1})):p("",!0)])]))}});export{G as _}; diff --git a/src/static/assets/DevopsView-BYs6-sh9.js b/src/static/assets/DevopsView-BCFbLN9X.js similarity index 89% rename from src/static/assets/DevopsView-BYs6-sh9.js rename to src/static/assets/DevopsView-BCFbLN9X.js index 3f2677f..767e644 100644 --- a/src/static/assets/DevopsView-BYs6-sh9.js +++ b/src/static/assets/DevopsView-BCFbLN9X.js @@ -1 +1 @@ -import{u as $}from"./devops-DCMlzRTJ.js";import{_ as f,a as _}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{a as y,_ as v}from"./CardTitle.vue_vue_type_script_setup_true_lang-DKwAVa1N.js";import{_ as z}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{_ as k}from"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";import{_ as A}from"./DevopsConnectForm.vue_vue_type_script_setup_true_lang-C3QMf5bS.js";import{d as I,x as S,c as a,a as o,h as r,k as g,w as l,i as u,e as i,o as n,p as c,t as d,F as h,r as b,n as w,q as D,j,K as C}from"./index-CMUSrGrd.js";import"./utils-7WVCegLb.js";import"./Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js";const V={class:"p-6 space-y-6"},B={class:"flex items-center justify-between gap-4 flex-wrap"},L={class:"flex items-center gap-2"},W={key:0,class:"flex items-center gap-2 text-sm text-muted-foreground"},F={key:1,class:"flex items-center gap-3"},O={class:"text-sm text-foreground"},E={key:0,class:"text-xs text-muted-foreground ml-2"},K={key:2,class:"flex items-center gap-3"},R={key:3,class:"text-xs text-destructive mt-2"},q={class:"flex items-center justify-between gap-3 flex-wrap"},M={class:"flex items-center rounded-lg border border-border overflow-hidden bg-muted/30"},T=["onClick"],G={key:0,class:"flex items-center justify-center py-8"},H={key:1,class:"text-center py-8 text-sm text-muted-foreground"},J={key:2,class:"space-y-1"},P={class:"text-xs font-mono text-muted-foreground w-10 shrink-0"},Q={class:"flex-1 min-w-0"},U={class:"text-sm text-foreground truncate"},X={class:"text-xs text-muted-foreground"},Y=["href"],ue=I({__name:"DevopsView",setup(Z){const e=$(),m=D("All");S(async()=>{await e.fetchIntegration(),e.integration&&await e.fetchWorkItems()});const p=j(()=>m.value==="All"?e.workItems:e.workItems.filter(x=>x.state===m.value));async function N(){try{await e.sync(),C.success("Sync complete"),await e.fetchWorkItems()}catch{C.error(e.error??"Sync failed")}}return(x,t)=>(n(),a("div",V,[o("div",B,[t[1]||(t[1]=o("h2",{class:"text-lg font-semibold text-foreground"},"Azure DevOps",-1)),o("div",L,[r(e).integration?(n(),g(z,{key:0,variant:"outline",size:"sm",loading:r(e).syncing,onClick:N},{default:l(()=>[...t[0]||(t[0]=[c(" Sync Now ",-1)])]),_:1},8,["loading"])):u("",!0)])]),i(f,null,{default:l(()=>[i(_,{class:"pt-4"},{default:l(()=>{var s;return[r(e).loading&&!r(e).integration?(n(),a("div",W,[i(k,{size:"sm"}),t[2]||(t[2]=o("span",null,"Loading...",-1))])):r(e).integration?(n(),a("div",F,[t[5]||(t[5]=o("div",{class:"h-2 w-2 rounded-full bg-[hsl(var(--success))]"},null,-1)),o("span",O,[t[3]||(t[3]=c(" Connected to ",-1)),o("strong",null,d(r(e).integration.organization),1),t[4]||(t[4]=c(" / ",-1)),o("strong",null,d(r(e).integration.project),1)]),r(e).integration.last_synced_at?(n(),a("span",E," Last synced: "+d(new Date(r(e).integration.last_synced_at).toLocaleString()),1)):u("",!0)])):(n(),a("div",K,[...t[6]||(t[6]=[o("div",{class:"h-2 w-2 rounded-full bg-muted-foreground"},null,-1),o("span",{class:"text-sm text-muted-foreground"},"Not connected",-1)])])),(s=r(e).integration)!=null&&s.last_sync_error?(n(),a("p",R," Error: "+d(r(e).integration.last_sync_error),1)):u("",!0)]}),_:1})]),_:1}),!r(e).integration&&!r(e).loading?(n(),g(f,{key:0},{default:l(()=>[i(v,null,{default:l(()=>[i(y,{class:"text-sm"},{default:l(()=>[...t[7]||(t[7]=[c("Connect Azure DevOps",-1)])]),_:1})]),_:1}),i(_,null,{default:l(()=>[i(A)]),_:1})]),_:1})):u("",!0),r(e).integration?(n(),g(f,{key:1},{default:l(()=>[i(v,{class:"pb-2"},{default:l(()=>[o("div",q,[i(y,{class:"text-sm"},{default:l(()=>[...t[8]||(t[8]=[c("Work Items",-1)])]),_:1}),o("div",M,[(n(),a(h,null,b(["All","Active","Resolved","Closed"],s=>o("button",{key:s,class:w(["px-3 py-1 text-xs font-medium transition-colors",m.value===s?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),onClick:ee=>m.value=s},d(s),11,T)),64))])])]),_:1}),i(_,null,{default:l(()=>[r(e).loading?(n(),a("div",G,[i(k,{size:"md",class:"text-primary"})])):p.value.length===0?(n(),a("div",H," No work items found ")):(n(),a("div",J,[(n(!0),a(h,null,b(p.value,s=>(n(),a("div",{key:s.id,class:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-muted/30 transition-colors"},[o("span",P,"#"+d(s.ado_id),1),o("div",Q,[o("p",U,d(s.title),1),o("p",X,d(s.type),1)]),o("span",{class:w(["text-xs px-2 py-0.5 rounded-full shrink-0",s.state==="Active"?"bg-blue-500/10 text-blue-400":s.state==="Resolved"?"bg-green-500/10 text-green-400":(s.state==="Closed","bg-muted text-muted-foreground")])},d(s.state),3),s.url?(n(),a("a",{key:0,href:s.url,target:"_blank",class:"text-xs text-primary hover:underline shrink-0"}," Open → ",8,Y)):u("",!0)]))),128))]))]),_:1})]),_:1})):u("",!0)]))}});export{ue as default}; +import{u as $}from"./devops-Dr0K2zsR.js";import{_ as f,a as _}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{a as y,_ as v}from"./CardTitle.vue_vue_type_script_setup_true_lang-BO3n7g7a.js";import{_ as z}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{_ as k}from"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";import{_ as A}from"./DevopsConnectForm.vue_vue_type_script_setup_true_lang-CTHVanFL.js";import{d as I,x as S,c as a,a as o,h as r,k as g,w as l,i as u,e as i,o as n,p as c,t as d,F as h,r as b,n as w,q as D,j,K as C}from"./index-BsVgmrYd.js";import"./utils-7WVCegLb.js";import"./Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js";const V={class:"p-6 space-y-6"},B={class:"flex items-center justify-between gap-4 flex-wrap"},L={class:"flex items-center gap-2"},W={key:0,class:"flex items-center gap-2 text-sm text-muted-foreground"},F={key:1,class:"flex items-center gap-3"},O={class:"text-sm text-foreground"},E={key:0,class:"text-xs text-muted-foreground ml-2"},K={key:2,class:"flex items-center gap-3"},R={key:3,class:"text-xs text-destructive mt-2"},q={class:"flex items-center justify-between gap-3 flex-wrap"},M={class:"flex items-center rounded-lg border border-border overflow-hidden bg-muted/30"},T=["onClick"],G={key:0,class:"flex items-center justify-center py-8"},H={key:1,class:"text-center py-8 text-sm text-muted-foreground"},J={key:2,class:"space-y-1"},P={class:"text-xs font-mono text-muted-foreground w-10 shrink-0"},Q={class:"flex-1 min-w-0"},U={class:"text-sm text-foreground truncate"},X={class:"text-xs text-muted-foreground"},Y=["href"],ue=I({__name:"DevopsView",setup(Z){const e=$(),m=D("All");S(async()=>{await e.fetchIntegration(),e.integration&&await e.fetchWorkItems()});const p=j(()=>m.value==="All"?e.workItems:e.workItems.filter(x=>x.state===m.value));async function N(){try{await e.sync(),C.success("Sync complete"),await e.fetchWorkItems()}catch{C.error(e.error??"Sync failed")}}return(x,t)=>(n(),a("div",V,[o("div",B,[t[1]||(t[1]=o("h2",{class:"text-lg font-semibold text-foreground"},"Azure DevOps",-1)),o("div",L,[r(e).integration?(n(),g(z,{key:0,variant:"outline",size:"sm",loading:r(e).syncing,onClick:N},{default:l(()=>[...t[0]||(t[0]=[c(" Sync Now ",-1)])]),_:1},8,["loading"])):u("",!0)])]),i(f,null,{default:l(()=>[i(_,{class:"pt-4"},{default:l(()=>{var s;return[r(e).loading&&!r(e).integration?(n(),a("div",W,[i(k,{size:"sm"}),t[2]||(t[2]=o("span",null,"Loading...",-1))])):r(e).integration?(n(),a("div",F,[t[5]||(t[5]=o("div",{class:"h-2 w-2 rounded-full bg-[hsl(var(--success))]"},null,-1)),o("span",O,[t[3]||(t[3]=c(" Connected to ",-1)),o("strong",null,d(r(e).integration.organization),1),t[4]||(t[4]=c(" / ",-1)),o("strong",null,d(r(e).integration.project),1)]),r(e).integration.last_synced_at?(n(),a("span",E," Last synced: "+d(new Date(r(e).integration.last_synced_at).toLocaleString()),1)):u("",!0)])):(n(),a("div",K,[...t[6]||(t[6]=[o("div",{class:"h-2 w-2 rounded-full bg-muted-foreground"},null,-1),o("span",{class:"text-sm text-muted-foreground"},"Not connected",-1)])])),(s=r(e).integration)!=null&&s.last_sync_error?(n(),a("p",R," Error: "+d(r(e).integration.last_sync_error),1)):u("",!0)]}),_:1})]),_:1}),!r(e).integration&&!r(e).loading?(n(),g(f,{key:0},{default:l(()=>[i(v,null,{default:l(()=>[i(y,{class:"text-sm"},{default:l(()=>[...t[7]||(t[7]=[c("Connect Azure DevOps",-1)])]),_:1})]),_:1}),i(_,null,{default:l(()=>[i(A)]),_:1})]),_:1})):u("",!0),r(e).integration?(n(),g(f,{key:1},{default:l(()=>[i(v,{class:"pb-2"},{default:l(()=>[o("div",q,[i(y,{class:"text-sm"},{default:l(()=>[...t[8]||(t[8]=[c("Work Items",-1)])]),_:1}),o("div",M,[(n(),a(h,null,b(["All","Active","Resolved","Closed"],s=>o("button",{key:s,class:w(["px-3 py-1 text-xs font-medium transition-colors",m.value===s?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),onClick:ee=>m.value=s},d(s),11,T)),64))])])]),_:1}),i(_,null,{default:l(()=>[r(e).loading?(n(),a("div",G,[i(k,{size:"md",class:"text-primary"})])):p.value.length===0?(n(),a("div",H," No work items found ")):(n(),a("div",J,[(n(!0),a(h,null,b(p.value,s=>(n(),a("div",{key:s.id,class:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-muted/30 transition-colors"},[o("span",P,"#"+d(s.ado_id),1),o("div",Q,[o("p",U,d(s.title),1),o("p",X,d(s.type),1)]),o("span",{class:w(["text-xs px-2 py-0.5 rounded-full shrink-0",s.state==="Active"?"bg-blue-500/10 text-blue-400":s.state==="Resolved"?"bg-green-500/10 text-green-400":(s.state==="Closed","bg-muted text-muted-foreground")])},d(s.state),3),s.url?(n(),a("a",{key:0,href:s.url,target:"_blank",class:"text-xs text-primary hover:underline shrink-0"}," Open → ",8,Y)):u("",!0)]))),128))]))]),_:1})]),_:1})):u("",!0)]))}});export{ue as default}; diff --git a/src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js b/src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js similarity index 93% rename from src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js rename to src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js index 4a53d4b..ca06fc7 100644 --- a/src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js +++ b/src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js @@ -1 +1 @@ -import{d as k,x as y,G as b,k as h,H as x,e as c,T as g,w as m,o as a,c as n,a as o,m as r,t as u,i,n as w}from"./index-CMUSrGrd.js";import{_ as $}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";const C={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},B=["aria-label"],j={key:0,class:"flex items-center justify-between p-6 pb-4"},z={class:"text-lg font-semibold text-foreground"},E={key:0,class:"text-sm text-muted-foreground mt-1"},L={class:"px-6 pb-4"},M={key:1,class:"flex justify-end gap-2 px-6 pb-6"},V=k({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},maxWidth:{default:"max-w-lg"}},emits:["close"],setup(e,{emit:f}){const p=e,l=f;function d(t){t.key==="Escape"&&p.open&&l("close")}return y(()=>document.addEventListener("keydown",d)),b(()=>document.removeEventListener("keydown",d)),(t,s)=>(a(),h(x,{to:"body"},[c(g,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:m(()=>[e.open?(a(),n("div",C,[o("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:s[0]||(s[0]=v=>l("close"))}),o("div",{class:w(["relative w-full bg-card border border-border rounded-lg shadow-xl z-10",e.maxWidth]),role:"dialog","aria-modal":!0,"aria-label":e.title},[e.title||t.$slots.header?(a(),n("div",j,[o("div",null,[r(t.$slots,"header",{},()=>[o("h2",z,u(e.title),1),e.description?(a(),n("p",E,u(e.description),1)):i("",!0)])]),c($,{variant:"ghost",size:"icon",class:"shrink-0",onClick:s[1]||(s[1]=v=>l("close"))},{default:m(()=>[...s[2]||(s[2]=[o("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])]),_:1})])):i("",!0),o("div",L,[r(t.$slots,"default")]),t.$slots.footer?(a(),n("div",M,[r(t.$slots,"footer")])):i("",!0)],10,B)])):i("",!0)]),_:3})]))}});export{V as _}; +import{d as k,x as y,G as b,k as h,H as x,e as c,T as g,w as m,o as a,c as n,a as o,m as r,t as u,i,n as w}from"./index-BsVgmrYd.js";import{_ as $}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";const C={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},B=["aria-label"],j={key:0,class:"flex items-center justify-between p-6 pb-4"},z={class:"text-lg font-semibold text-foreground"},E={key:0,class:"text-sm text-muted-foreground mt-1"},L={class:"px-6 pb-4"},M={key:1,class:"flex justify-end gap-2 px-6 pb-6"},V=k({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},maxWidth:{default:"max-w-lg"}},emits:["close"],setup(e,{emit:f}){const p=e,l=f;function d(t){t.key==="Escape"&&p.open&&l("close")}return y(()=>document.addEventListener("keydown",d)),b(()=>document.removeEventListener("keydown",d)),(t,s)=>(a(),h(x,{to:"body"},[c(g,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:m(()=>[e.open?(a(),n("div",C,[o("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:s[0]||(s[0]=v=>l("close"))}),o("div",{class:w(["relative w-full bg-card border border-border rounded-lg shadow-xl z-10",e.maxWidth]),role:"dialog","aria-modal":!0,"aria-label":e.title},[e.title||t.$slots.header?(a(),n("div",j,[o("div",null,[r(t.$slots,"header",{},()=>[o("h2",z,u(e.title),1),e.description?(a(),n("p",E,u(e.description),1)):i("",!0)])]),c($,{variant:"ghost",size:"icon",class:"shrink-0",onClick:s[1]||(s[1]=v=>l("close"))},{default:m(()=>[...s[2]||(s[2]=[o("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])]),_:1})])):i("",!0),o("div",L,[r(t.$slots,"default")]),t.$slots.footer?(a(),n("div",M,[r(t.$slots,"footer")])):i("",!0)],10,B)])):i("",!0)]),_:3})]))}});export{V as _}; diff --git a/src/static/assets/Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js b/src/static/assets/Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js similarity index 94% rename from src/static/assets/Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js rename to src/static/assets/Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js index 6ff946a..92528ab 100644 --- a/src/static/assets/Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js +++ b/src/static/assets/Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js @@ -1 +1 @@ -import{c as i}from"./utils-7WVCegLb.js";import{d,c as s,n as u,h as m,o as r}from"./index-CMUSrGrd.js";const c=["id","name","type","value","placeholder","disabled","autocomplete","min","max","step"],g=d({__name:"Input",props:{modelValue:{},type:{},placeholder:{},disabled:{type:Boolean},class:{},id:{},name:{},autocomplete:{},min:{},max:{},step:{}},emits:["update:modelValue","change","blur","focus"],setup(e,{emit:n}){const a=e,o=n;return(f,t)=>(r(),s("input",{id:e.id,name:e.name,type:e.type??"text",value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,autocomplete:e.autocomplete,min:e.min,max:e.max,step:e.step,class:u(m(i)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a.class)),onInput:t[0]||(t[0]=l=>o("update:modelValue",l.target.value)),onChange:t[1]||(t[1]=l=>o("change",l.target.value)),onBlur:t[2]||(t[2]=l=>o("blur",l)),onFocus:t[3]||(t[3]=l=>o("focus",l))},null,42,c))}});export{g as _}; +import{c as i}from"./utils-7WVCegLb.js";import{d,c as s,n as u,h as m,o as r}from"./index-BsVgmrYd.js";const c=["id","name","type","value","placeholder","disabled","autocomplete","min","max","step"],g=d({__name:"Input",props:{modelValue:{},type:{},placeholder:{},disabled:{type:Boolean},class:{},id:{},name:{},autocomplete:{},min:{},max:{},step:{}},emits:["update:modelValue","change","blur","focus"],setup(e,{emit:n}){const a=e,o=n;return(f,t)=>(r(),s("input",{id:e.id,name:e.name,type:e.type??"text",value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,autocomplete:e.autocomplete,min:e.min,max:e.max,step:e.step,class:u(m(i)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a.class)),onInput:t[0]||(t[0]=l=>o("update:modelValue",l.target.value)),onChange:t[1]||(t[1]=l=>o("change",l.target.value)),onBlur:t[2]||(t[2]=l=>o("blur",l)),onFocus:t[3]||(t[3]=l=>o("focus",l))},null,42,c))}});export{g as _}; diff --git a/src/static/assets/KeysView-BshY45g6.js b/src/static/assets/KeysView-IKma-C2I.js similarity index 89% rename from src/static/assets/KeysView-BshY45g6.js rename to src/static/assets/KeysView-IKma-C2I.js index 54e7d87..564f71b 100644 --- a/src/static/assets/KeysView-BshY45g6.js +++ b/src/static/assets/KeysView-IKma-C2I.js @@ -1 +1 @@ -import{a as b}from"./admin-Do_x_iW1.js";import{_ as K,a as $}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{_ as p}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{_ as V}from"./Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js";import{_ as N}from"./Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js";import{_ as A}from"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";import{d as B,x as L,c as l,a as t,e as r,w as n,q as i,o as a,p as v,F as P,r as F,t as u,h as k,k as I,i as j,K as y}from"./index-CMUSrGrd.js";import{a as h}from"./utils-7WVCegLb.js";const D={class:"p-6"},R={class:"flex items-center justify-between mb-6"},z={key:0,class:"flex items-center justify-center h-20"},M={key:1,class:"text-center text-muted-foreground py-8 text-sm"},T={key:2,class:"w-full"},U={class:"px-4 py-3 text-sm text-foreground"},q={class:"px-4 py-3 text-sm font-mono text-muted-foreground"},E={class:"px-4 py-3 text-xs text-muted-foreground"},H={class:"px-4 py-3 text-xs text-muted-foreground"},S={class:"px-4 py-3 text-right"},G={class:"space-y-4"},J={key:0,class:"rounded-md bg-emerald-500/10 border border-emerald-500/30 p-3"},O={class:"text-xs font-mono text-foreground break-all"},Q={key:1,class:"space-y-1.5"},re=B({__name:"KeysView",setup(W){const f=i([]),_=i(!1),c=i(!1),m=i(""),x=i(!1),d=i(null);L(()=>g());async function g(){_.value=!0;try{const o=await b.keys();f.value=o.data}finally{_.value=!1}}async function w(){if(m.value.trim()){x.value=!0;try{const o=await b.createKey({label:m.value});d.value=o.data.key,y.success("API key created"),await g(),m.value=""}catch{y.error("Failed to create key")}finally{x.value=!1}}}async function C(o){if(confirm(`Revoke key "${o.label}"? This cannot be undone.`))try{await b.revokeKey(o.id),y.success("Key revoked"),f.value=f.value.filter(e=>e.id!==o.id)}catch{y.error("Failed to revoke key")}}return(o,e)=>(a(),l("div",D,[t("div",R,[e[5]||(e[5]=t("h2",{class:"text-lg font-semibold text-foreground"},"API Keys",-1)),r(p,{size:"sm",onClick:e[0]||(e[0]=s=>{c.value=!0,d.value=null})},{default:n(()=>[...e[4]||(e[4]=[t("svg",{class:"h-4 w-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),v(" New Key ",-1)])]),_:1})]),r(K,null,{default:n(()=>[r($,{class:"p-0"},{default:n(()=>[_.value?(a(),l("div",z,[r(A,{class:"text-primary"})])):f.value.length===0?(a(),l("div",M," No API keys ")):(a(),l("table",T,[e[7]||(e[7]=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"},"Label"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Prefix"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Created"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Last Used"),t("th",{class:"px-4 py-3"})])],-1)),t("tbody",null,[(a(!0),l(P,null,F(f.value,s=>(a(),l("tr",{key:s.id,class:"border-b border-border last:border-0 hover:bg-muted/30"},[t("td",U,u(s.label),1),t("td",q,u(s.prefix)+"...",1),t("td",E,u(k(h)(s.created_at)),1),t("td",H,u(s.last_used?k(h)(s.last_used):"Never"),1),t("td",S,[r(p,{variant:"ghost",size:"sm",class:"text-destructive",onClick:X=>C(s)},{default:n(()=>[...e[6]||(e[6]=[v(" Revoke ",-1)])]),_:1},8,["onClick"])])]))),128))])]))]),_:1})]),_:1}),r(V,{open:c.value,title:"Create API Key",onClose:e[3]||(e[3]=s=>c.value=!1)},{footer:n(()=>[r(p,{variant:"outline",onClick:e[2]||(e[2]=s=>c.value=!1)},{default:n(()=>[v(u(d.value?"Done":"Cancel"),1)]),_:1}),d.value?j("",!0):(a(),I(p,{key:0,loading:x.value,onClick:w},{default:n(()=>[...e[10]||(e[10]=[v(" Create ",-1)])]),_:1},8,["loading"]))]),default:n(()=>[t("div",G,[d.value?(a(),l("div",J,[e[8]||(e[8]=t("p",{class:"text-xs text-emerald-400 font-medium mb-1"},"Key created — save it now!",-1)),t("p",O,u(d.value),1)])):(a(),l("div",Q,[e[9]||(e[9]=t("label",{class:"text-sm font-medium text-foreground"},"Label",-1)),r(N,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=s=>m.value=s),placeholder:"e.g. claude-collector",disabled:x.value},null,8,["modelValue","disabled"])]))])]),_:1},8,["open"])]))}});export{re as default}; +import{a as b}from"./admin-Ccc2J89T.js";import{_ as K,a as $}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{_ as p}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{_ as V}from"./Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js";import{_ as N}from"./Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js";import{_ as A}from"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";import{d as B,x as L,c as l,a as t,e as r,w as n,q as i,o as a,p as v,F as P,r as F,t as u,h as k,k as I,i as j,K as y}from"./index-BsVgmrYd.js";import{a as h}from"./utils-7WVCegLb.js";const D={class:"p-6"},R={class:"flex items-center justify-between mb-6"},z={key:0,class:"flex items-center justify-center h-20"},M={key:1,class:"text-center text-muted-foreground py-8 text-sm"},T={key:2,class:"w-full"},U={class:"px-4 py-3 text-sm text-foreground"},q={class:"px-4 py-3 text-sm font-mono text-muted-foreground"},E={class:"px-4 py-3 text-xs text-muted-foreground"},H={class:"px-4 py-3 text-xs text-muted-foreground"},S={class:"px-4 py-3 text-right"},G={class:"space-y-4"},J={key:0,class:"rounded-md bg-emerald-500/10 border border-emerald-500/30 p-3"},O={class:"text-xs font-mono text-foreground break-all"},Q={key:1,class:"space-y-1.5"},re=B({__name:"KeysView",setup(W){const f=i([]),_=i(!1),c=i(!1),m=i(""),x=i(!1),d=i(null);L(()=>g());async function g(){_.value=!0;try{const o=await b.keys();f.value=o.data}finally{_.value=!1}}async function w(){if(m.value.trim()){x.value=!0;try{const o=await b.createKey({label:m.value});d.value=o.data.key,y.success("API key created"),await g(),m.value=""}catch{y.error("Failed to create key")}finally{x.value=!1}}}async function C(o){if(confirm(`Revoke key "${o.label}"? This cannot be undone.`))try{await b.revokeKey(o.id),y.success("Key revoked"),f.value=f.value.filter(e=>e.id!==o.id)}catch{y.error("Failed to revoke key")}}return(o,e)=>(a(),l("div",D,[t("div",R,[e[5]||(e[5]=t("h2",{class:"text-lg font-semibold text-foreground"},"API Keys",-1)),r(p,{size:"sm",onClick:e[0]||(e[0]=s=>{c.value=!0,d.value=null})},{default:n(()=>[...e[4]||(e[4]=[t("svg",{class:"h-4 w-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),v(" New Key ",-1)])]),_:1})]),r(K,null,{default:n(()=>[r($,{class:"p-0"},{default:n(()=>[_.value?(a(),l("div",z,[r(A,{class:"text-primary"})])):f.value.length===0?(a(),l("div",M," No API keys ")):(a(),l("table",T,[e[7]||(e[7]=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"},"Label"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Prefix"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Created"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Last Used"),t("th",{class:"px-4 py-3"})])],-1)),t("tbody",null,[(a(!0),l(P,null,F(f.value,s=>(a(),l("tr",{key:s.id,class:"border-b border-border last:border-0 hover:bg-muted/30"},[t("td",U,u(s.label),1),t("td",q,u(s.prefix)+"...",1),t("td",E,u(k(h)(s.created_at)),1),t("td",H,u(s.last_used?k(h)(s.last_used):"Never"),1),t("td",S,[r(p,{variant:"ghost",size:"sm",class:"text-destructive",onClick:X=>C(s)},{default:n(()=>[...e[6]||(e[6]=[v(" Revoke ",-1)])]),_:1},8,["onClick"])])]))),128))])]))]),_:1})]),_:1}),r(V,{open:c.value,title:"Create API Key",onClose:e[3]||(e[3]=s=>c.value=!1)},{footer:n(()=>[r(p,{variant:"outline",onClick:e[2]||(e[2]=s=>c.value=!1)},{default:n(()=>[v(u(d.value?"Done":"Cancel"),1)]),_:1}),d.value?j("",!0):(a(),I(p,{key:0,loading:x.value,onClick:w},{default:n(()=>[...e[10]||(e[10]=[v(" Create ",-1)])]),_:1},8,["loading"]))]),default:n(()=>[t("div",G,[d.value?(a(),l("div",J,[e[8]||(e[8]=t("p",{class:"text-xs text-emerald-400 font-medium mb-1"},"Key created — save it now!",-1)),t("p",O,u(d.value),1)])):(a(),l("div",Q,[e[9]||(e[9]=t("label",{class:"text-sm font-medium text-foreground"},"Label",-1)),r(N,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=s=>m.value=s),placeholder:"e.g. claude-collector",disabled:x.value},null,8,["modelValue","disabled"])]))])]),_:1},8,["open"])]))}});export{re as default}; diff --git a/src/static/assets/LiveView-CWjU7kXQ.js b/src/static/assets/LiveView-Upgit3GU.js similarity index 94% rename from src/static/assets/LiveView-CWjU7kXQ.js rename to src/static/assets/LiveView-Upgit3GU.js index 8dbc889..d30271e 100644 --- a/src/static/assets/LiveView-CWjU7kXQ.js +++ b/src/static/assets/LiveView-Upgit3GU.js @@ -1 +1 @@ -import{G as T,q as y,d as J,u as O,x as V,c as f,a as o,n as b,h as l,t as v,k as $,w as x,i as k,e as C,o as c,p as w,F as B,r as F,j as z}from"./index-CMUSrGrd.js";import{_ as A,a as D}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{_ as N}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import"./utils-7WVCegLb.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";function U(E){const e=y([]),i=y(!1),m=y(null);let s=null,r=null,u=!1;function p(){if(!u)try{s=new EventSource(E),s.onopen=()=>{i.value=!0,m.value=null},s.onmessage=n=>{try{const g=JSON.parse(n.data);e.value.push({type:"message",data:g}),e.value.length>200&&e.value.shift()}catch{e.value.push({type:"message",data:n.data})}},s.addEventListener("session_start",n=>{try{e.value.push({type:"session_start",data:JSON.parse(n.data)})}catch{e.value.push({type:"session_start",data:n.data})}e.value.length>200&&e.value.shift()}),s.addEventListener("session_end",n=>{try{e.value.push({type:"session_end",data:JSON.parse(n.data)})}catch{e.value.push({type:"session_end",data:n.data})}e.value.length>200&&e.value.shift()}),s.addEventListener("activity",n=>{try{e.value.push({type:"activity",data:JSON.parse(n.data)})}catch{e.value.push({type:"activity",data:n.data})}e.value.length>200&&e.value.shift()}),s.onerror=()=>{i.value=!1,m.value="Connection lost, reconnecting...",s==null||s.close(),s=null,u||(r=setTimeout(()=>p(),5e3))}}catch{m.value="Failed to connect to event stream",u||(r=setTimeout(()=>p(),5e3))}}function _(){u=!0,r&&clearTimeout(r),s==null||s.close(),s=null,i.value=!1}function h(){e.value=[]}return T(()=>{_()}),{events:e,connected:i,error:m,connect:p,disconnect:_,clearEvents:h}}const I={class:"p-6 h-full flex flex-col"},R={class:"flex items-center gap-3 mb-4"},q={class:"flex items-center gap-2"},G={class:"text-xs text-muted-foreground"},M={key:0,class:"mb-4 text-xs text-amber-400 bg-amber-500/10 border border-amber-500/30 rounded px-3 py-2"},P={key:0,class:"flex items-center justify-center h-full text-sm text-muted-foreground"},W={key:1,class:"overflow-y-auto h-full font-mono text-xs"},H={class:"flex-1 min-w-0"},K={class:"flex items-center gap-2 flex-wrap"},Q={key:0,class:"text-muted-foreground"},X={class:"text-muted-foreground truncate mt-0.5"},ne=J({__name:"LiveView",setup(E){const e=O(),i=e.getToken(),m=`/cc-dashboard/api/events${i?`?token=${encodeURIComponent(i)}`:""}`,{events:s,connected:r,error:u,connect:p,clearEvents:_}=U(m);V(()=>{e.isAuthenticated&&i&&p()});const h=z(()=>[...s.value].reverse().slice(0,100));function n(t){return t==="session_start"?"text-emerald-400":t==="session_end"?"text-amber-400":t==="activity"?"text-blue-400":"text-muted-foreground"}function g(t){return t==="session_start"?"▶":t==="session_end"?"■":t==="activity"?"●":"○"}function j(t){if(typeof t=="string")return t;if(t&&typeof t=="object"){const a=t;return a.message||a.summary||JSON.stringify(t)}return String(t)}function S(t){if(t&&typeof t=="object"){const a=t;return a.display_name||a.project_id||""}return""}return(t,a)=>(c(),f("div",I,[o("div",R,[a[2]||(a[2]=o("h2",{class:"text-lg font-semibold text-foreground flex-1"},"Live Feed",-1)),o("div",q,[o("div",{class:b(["h-2 w-2 rounded-full",l(r)?"bg-emerald-500 animate-pulse":"bg-red-500"])},null,2),o("span",G,v(l(r)?"Connected":"Disconnected"),1)]),l(r)?k("",!0):(c(),$(N,{key:0,variant:"outline",size:"sm",onClick:l(p)},{default:x(()=>[...a[0]||(a[0]=[w(" Reconnect ",-1)])]),_:1},8,["onClick"])),C(N,{variant:"ghost",size:"sm",onClick:l(_)},{default:x(()=>[...a[1]||(a[1]=[w(" Clear ",-1)])]),_:1},8,["onClick"])]),l(u)&&!l(r)?(c(),f("div",M,v(l(u)),1)):k("",!0),C(A,{class:"flex-1 overflow-hidden"},{default:x(()=>[C(D,{class:"p-0 h-full"},{default:x(()=>[h.value.length===0?(c(),f("div",P,[...a[3]||(a[3]=[o("div",{class:"text-center"},[o("div",{class:"text-2xl mb-2"},"📡"),o("p",null,"Waiting for events..."),o("p",{class:"text-xs mt-1"},"Activity will appear here in real-time")],-1)])])):(c(),f("div",W,[(c(!0),f(B,null,F(h.value,(d,L)=>(c(),f("div",{key:L,class:"flex items-start gap-2 px-4 py-1.5 hover:bg-muted/50 border-b border-border/30"},[o("span",{class:b([n(d.type),"shrink-0 mt-0.5"])},v(g(d.type)),3),o("div",H,[o("div",K,[o("span",{class:b([n(d.type),"font-medium"])},v(d.type),3),S(d.data)?(c(),f("span",Q,v(S(d.data)),1)):k("",!0)]),o("p",X,v(j(d.data)),1)])]))),128))]))]),_:1})]),_:1})]))}});export{ne as default}; +import{G as T,q as y,d as J,u as O,x as V,c as f,a as o,n as b,h as l,t as v,k as $,w as x,i as k,e as C,o as c,p as w,F as B,r as F,j as z}from"./index-BsVgmrYd.js";import{_ as A,a as D}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{_ as N}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import"./utils-7WVCegLb.js";import"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";function U(E){const e=y([]),i=y(!1),m=y(null);let s=null,r=null,u=!1;function p(){if(!u)try{s=new EventSource(E),s.onopen=()=>{i.value=!0,m.value=null},s.onmessage=n=>{try{const g=JSON.parse(n.data);e.value.push({type:"message",data:g}),e.value.length>200&&e.value.shift()}catch{e.value.push({type:"message",data:n.data})}},s.addEventListener("session_start",n=>{try{e.value.push({type:"session_start",data:JSON.parse(n.data)})}catch{e.value.push({type:"session_start",data:n.data})}e.value.length>200&&e.value.shift()}),s.addEventListener("session_end",n=>{try{e.value.push({type:"session_end",data:JSON.parse(n.data)})}catch{e.value.push({type:"session_end",data:n.data})}e.value.length>200&&e.value.shift()}),s.addEventListener("activity",n=>{try{e.value.push({type:"activity",data:JSON.parse(n.data)})}catch{e.value.push({type:"activity",data:n.data})}e.value.length>200&&e.value.shift()}),s.onerror=()=>{i.value=!1,m.value="Connection lost, reconnecting...",s==null||s.close(),s=null,u||(r=setTimeout(()=>p(),5e3))}}catch{m.value="Failed to connect to event stream",u||(r=setTimeout(()=>p(),5e3))}}function _(){u=!0,r&&clearTimeout(r),s==null||s.close(),s=null,i.value=!1}function h(){e.value=[]}return T(()=>{_()}),{events:e,connected:i,error:m,connect:p,disconnect:_,clearEvents:h}}const I={class:"p-6 h-full flex flex-col"},R={class:"flex items-center gap-3 mb-4"},q={class:"flex items-center gap-2"},G={class:"text-xs text-muted-foreground"},M={key:0,class:"mb-4 text-xs text-amber-400 bg-amber-500/10 border border-amber-500/30 rounded px-3 py-2"},P={key:0,class:"flex items-center justify-center h-full text-sm text-muted-foreground"},W={key:1,class:"overflow-y-auto h-full font-mono text-xs"},H={class:"flex-1 min-w-0"},K={class:"flex items-center gap-2 flex-wrap"},Q={key:0,class:"text-muted-foreground"},X={class:"text-muted-foreground truncate mt-0.5"},ne=J({__name:"LiveView",setup(E){const e=O(),i=e.getToken(),m=`/cc-dashboard/api/events${i?`?token=${encodeURIComponent(i)}`:""}`,{events:s,connected:r,error:u,connect:p,clearEvents:_}=U(m);V(()=>{e.isAuthenticated&&i&&p()});const h=z(()=>[...s.value].reverse().slice(0,100));function n(t){return t==="session_start"?"text-emerald-400":t==="session_end"?"text-amber-400":t==="activity"?"text-blue-400":"text-muted-foreground"}function g(t){return t==="session_start"?"▶":t==="session_end"?"■":t==="activity"?"●":"○"}function j(t){if(typeof t=="string")return t;if(t&&typeof t=="object"){const a=t;return a.message||a.summary||JSON.stringify(t)}return String(t)}function S(t){if(t&&typeof t=="object"){const a=t;return a.display_name||a.project_id||""}return""}return(t,a)=>(c(),f("div",I,[o("div",R,[a[2]||(a[2]=o("h2",{class:"text-lg font-semibold text-foreground flex-1"},"Live Feed",-1)),o("div",q,[o("div",{class:b(["h-2 w-2 rounded-full",l(r)?"bg-emerald-500 animate-pulse":"bg-red-500"])},null,2),o("span",G,v(l(r)?"Connected":"Disconnected"),1)]),l(r)?k("",!0):(c(),$(N,{key:0,variant:"outline",size:"sm",onClick:l(p)},{default:x(()=>[...a[0]||(a[0]=[w(" Reconnect ",-1)])]),_:1},8,["onClick"])),C(N,{variant:"ghost",size:"sm",onClick:l(_)},{default:x(()=>[...a[1]||(a[1]=[w(" Clear ",-1)])]),_:1},8,["onClick"])]),l(u)&&!l(r)?(c(),f("div",M,v(l(u)),1)):k("",!0),C(A,{class:"flex-1 overflow-hidden"},{default:x(()=>[C(D,{class:"p-0 h-full"},{default:x(()=>[h.value.length===0?(c(),f("div",P,[...a[3]||(a[3]=[o("div",{class:"text-center"},[o("div",{class:"text-2xl mb-2"},"📡"),o("p",null,"Waiting for events..."),o("p",{class:"text-xs mt-1"},"Activity will appear here in real-time")],-1)])])):(c(),f("div",W,[(c(!0),f(B,null,F(h.value,(d,L)=>(c(),f("div",{key:L,class:"flex items-start gap-2 px-4 py-1.5 hover:bg-muted/50 border-b border-border/30"},[o("span",{class:b([n(d.type),"shrink-0 mt-0.5"])},v(g(d.type)),3),o("div",H,[o("div",K,[o("span",{class:b([n(d.type),"font-medium"])},v(d.type),3),S(d.data)?(c(),f("span",Q,v(S(d.data)),1)):k("",!0)]),o("p",X,v(j(d.data)),1)])]))),128))]))]),_:1})]),_:1})]))}});export{ne as default}; diff --git a/src/static/assets/LoginView-CXJ9ossc.js b/src/static/assets/LoginView-CZczoEHN.js similarity index 94% rename from src/static/assets/LoginView-CXJ9ossc.js rename to src/static/assets/LoginView-CZczoEHN.js index 264a685..6925363 100644 --- a/src/static/assets/LoginView-CXJ9ossc.js +++ b/src/static/assets/LoginView-CZczoEHN.js @@ -1 +1 @@ -import{d as h,u as f,c as o,a as t,b as m,e as a,w as d,o as r,f as g,g as p,h as i,t as x,i as w}from"./index-CMUSrGrd.js";import{_ as y,a as b}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import"./utils-7WVCegLb.js";const v={class:"min-h-screen flex items-center justify-center bg-background p-4"},_={class:"w-full max-w-sm"},k={class:"space-y-4"},C={key:0,class:"rounded-md bg-destructive/10 border border-destructive/30 px-3 py-2 text-sm text-destructive"},B=["disabled"],V={key:0},S={key:1},M=h({__name:"LoginView",setup(F){const c=g(),l=p(),s=f();async function u(){try{await s.loginWithMicrosoft();const n=l.query.redirect;c.push(n??"/")}catch{}}return(n,e)=>(r(),o("div",v,[t("div",_,[e[2]||(e[2]=m('

CC Dashboard

Corporate Planning Hub

',1)),a(y,null,{default:d(()=>[a(b,{class:"pt-6"},{default:d(()=>[t("div",k,[i(s).error?(r(),o("div",C,x(i(s).error),1)):w("",!0),t("button",{type:"button",disabled:i(s).loading,class:"w-full flex items-center justify-center gap-3 rounded-md border border-border bg-white px-4 py-2.5 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onClick:u},[e[0]||(e[0]=t("svg",{class:"h-5 w-5 shrink-0",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{x:"1",y:"1",width:"9",height:"9",fill:"#F25022"}),t("rect",{x:"11",y:"1",width:"9",height:"9",fill:"#7FBA00"}),t("rect",{x:"1",y:"11",width:"9",height:"9",fill:"#00A4EF"}),t("rect",{x:"11",y:"11",width:"9",height:"9",fill:"#FFB900"})],-1)),i(s).loading?(r(),o("span",V,"Signing in…")):(r(),o("span",S,"Sign in with Microsoft"))],8,B),e[1]||(e[1]=t("p",{class:"text-center text-xs text-muted-foreground"}," Use your @oliver.agency account ",-1))])]),_:1})]),_:1})])]))}});export{M as default}; +import{d as h,u as f,c as o,a as t,b as m,e as a,w as d,o as r,f as g,g as p,h as i,t as x,i as w}from"./index-BsVgmrYd.js";import{_ as y,a as b}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import"./utils-7WVCegLb.js";const v={class:"min-h-screen flex items-center justify-center bg-background p-4"},_={class:"w-full max-w-sm"},k={class:"space-y-4"},C={key:0,class:"rounded-md bg-destructive/10 border border-destructive/30 px-3 py-2 text-sm text-destructive"},B=["disabled"],V={key:0},S={key:1},M=h({__name:"LoginView",setup(F){const c=g(),l=p(),s=f();async function u(){try{await s.loginWithMicrosoft();const n=l.query.redirect;c.push(n??"/")}catch{}}return(n,e)=>(r(),o("div",v,[t("div",_,[e[2]||(e[2]=m('

CC Dashboard

Corporate Planning Hub

',1)),a(y,null,{default:d(()=>[a(b,{class:"pt-6"},{default:d(()=>[t("div",k,[i(s).error?(r(),o("div",C,x(i(s).error),1)):w("",!0),t("button",{type:"button",disabled:i(s).loading,class:"w-full flex items-center justify-center gap-3 rounded-md border border-border bg-white px-4 py-2.5 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onClick:u},[e[0]||(e[0]=t("svg",{class:"h-5 w-5 shrink-0",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{x:"1",y:"1",width:"9",height:"9",fill:"#F25022"}),t("rect",{x:"11",y:"1",width:"9",height:"9",fill:"#7FBA00"}),t("rect",{x:"1",y:"11",width:"9",height:"9",fill:"#00A4EF"}),t("rect",{x:"11",y:"11",width:"9",height:"9",fill:"#FFB900"})],-1)),i(s).loading?(r(),o("span",V,"Signing in…")):(r(),o("span",S,"Sign in with Microsoft"))],8,B),e[1]||(e[1]=t("p",{class:"text-center text-xs text-muted-foreground"}," Use your @oliver.agency account ",-1))])]),_:1})]),_:1})])]))}});export{M as default}; diff --git a/src/static/assets/PlannerView-A-MLkrrq.js b/src/static/assets/PlannerView-A-MLkrrq.js new file mode 100644 index 0000000..b99946c --- /dev/null +++ b/src/static/assets/PlannerView-A-MLkrrq.js @@ -0,0 +1 @@ +import{u as N,_ as E}from"./TaskForm.vue_vue_type_script_setup_true_lang-CZhTyTsN.js";import{d as T,o as n,c as l,a as t,n as P,t as x,F as D,r as V,A,i as w,e as p,w as y,p as L,h as _,C as z,j,y as H,D as U,k as K,q as b,x as q,v as I,K as h}from"./index-BsVgmrYd.js";import{_ as O}from"./Badge.vue_vue_type_script_setup_true_lang-ctqZICyq.js";import{f as F,i as B}from"./utils-7WVCegLb.js";import{_ as $}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{_ as S}from"./Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js";import"./Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js";import"./devops-Dr0K2zsR.js";import"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";const G=["draggable"],J={class:"flex items-start gap-2"},Q=["title"],R={class:"flex-1 min-w-0"},W={class:"text-sm font-medium text-foreground leading-tight truncate"},X={key:0,class:"flex items-center gap-1 mt-1 flex-wrap"},Y={class:"flex items-center gap-2 mt-1.5 flex-wrap"},Z={key:0,class:"text-xs text-muted-foreground"},ee={key:1,class:"text-xs text-emerald-400"},te={key:2,class:"text-xs text-blue-400 ml-auto",title:"Azure DevOps"},se={class:"flex items-center gap-1 opacity-0 group-hover:opacity-100 shrink-0"},oe=T({__name:"TaskCard",props:{task:{},draggable:{type:Boolean}},emits:["edit","complete","delete"],setup(s,{emit:r}){const a=r,m=d=>({todo:"outline",doing:"default",done:"success",cancelled:"secondary"})[d],f=d=>["","Low","Medium","High","Critical","Blocker"][d]??"Unknown",v=d=>d>=4?"bg-red-500":d===3?"bg-amber-500":"bg-emerald-500";return(d,o)=>{var k;return n(),l("div",{draggable:s.draggable,class:"rounded-lg border border-border bg-card p-3 hover:border-primary/50 transition-colors cursor-pointer group",onClick:o[2]||(o[2]=u=>a("edit",s.task))},[t("div",J,[t("div",{class:P(["h-2 w-2 rounded-full mt-1.5 shrink-0",v(s.task.priority)]),title:f(s.task.priority)},null,10,Q),t("div",R,[t("p",W,x(s.task.title),1),(k=s.task.tags)!=null&&k.length?(n(),l("div",X,[(n(!0),l(D,null,V(s.task.tags,u=>(n(),l("span",{key:u.id,class:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",style:A({background:`${u.color_hex}22`,color:u.color_hex})},x(u.name),5))),128))])):w("",!0),t("div",Y,[p(O,{variant:m(s.task.status),class:"text-xs py-0"},{default:y(()=>[L(x(s.task.status),1)]),_:1},8,["variant"]),s.task.estimate_hours?(n(),l("span",Z," ~"+x(_(F)(s.task.estimate_hours)),1)):w("",!0),s.task.actual_hours?(n(),l("span",ee,x(_(F)(s.task.actual_hours))+" actual ",1)):w("",!0),s.task.azure_work_item_id?(n(),l("span",te," #"+x(s.task.azure_work_item_id),1)):w("",!0)])]),t("div",se,[s.task.status!=="done"?(n(),l("button",{key:0,class:"p-1 rounded hover:bg-emerald-500/20 text-emerald-400",title:"Mark done",onClick:o[0]||(o[0]=z(u=>a("complete",s.task),["stop"]))},[...o[3]||(o[3]=[t("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)])])):w("",!0),t("button",{class:"p-1 rounded hover:bg-red-500/20 text-red-400",title:"Delete",onClick:o[1]||(o[1]=z(u=>a("delete",s.task),["stop"]))},[...o[4]||(o[4]=[t("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",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)])])])])],8,G)}}}),ae={class:"space-y-6"},ne={key:0,class:"text-sm text-muted-foreground py-4 text-center"},le={class:"flex items-center gap-2 mb-2"},re={class:"text-xs font-semibold uppercase tracking-wide text-muted-foreground"},ie={class:"text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full"},de={class:"space-y-2"},ue={key:0,class:"text-sm text-muted-foreground text-center py-8"},ce=T({__name:"TaskList",props:{tasks:{},loading:{type:Boolean}},emits:["edit","complete","delete"],setup(s,{emit:r}){const a=s,m=r,f=j(()=>{var o;const d={doing:[],todo:[],done:[],cancelled:[]};for(const k of a.tasks)(o=d[k.status])==null||o.push(k);return d}),v={doing:"In Progress",todo:"To Do",done:"Done",cancelled:"Cancelled"};return(d,o)=>(n(),l("div",ae,[s.loading?(n(),l("div",ne,"Loading tasks...")):(n(),l(D,{key:1},[(n(!0),l(D,null,V(f.value,(k,u)=>H((n(),l("div",{key:u},[t("div",le,[t("h3",re,x(v[u]),1),t("span",ie,x(k.length),1)]),t("div",de,[(n(!0),l(D,null,V(k,g=>(n(),K(oe,{key:g.id,task:g,draggable:"",onEdit:C=>m("edit",g),onComplete:C=>m("complete",g),onDelete:C=>m("delete",g)},null,8,["task","onEdit","onComplete","onDelete"]))),128))])])),[[U,k.length>0]])),128)),a.tasks.length?w("",!0):(n(),l("div",ue," No tasks found "))],64))]))}}),me={class:"p-6"},ke={class:"flex items-center gap-3 mb-6 flex-wrap"},fe={class:"flex items-center gap-1"},$e=T({__name:"PlannerView",setup(s){const r=N(),a=b(B(new Date)),m=b(!1),f=b(null),v=b("");q(()=>{r.fetchForDate(a.value)}),I(a,()=>{r.fetchForDate(a.value)});const d=j(()=>v.value?r.tasks.filter(i=>{var e;return((e=i.project_id)==null?void 0:e.toLowerCase().includes(v.value.toLowerCase()))||i.title.toLowerCase().includes(v.value.toLowerCase())}):r.tasks);function o(){f.value=null,m.value=!0}function k(i){f.value=i,m.value=!0}async function u(i,e){try{if(f.value)await r.update(f.value.id,i),h.success("Task updated");else{const c=await r.create(i);e&&(c!=null&&c.id)&&await r.createBlock(c.id,e),h.success("Task created")}m.value=!1,r.fetchForDate(a.value)}catch{h.error("Failed to save task")}}async function g(i){try{await r.complete(i.id),h.success("Task completed")}catch{h.error("Failed to complete task")}}async function C(i){if(confirm(`Delete "${i.title}"?`))try{await r.remove(i.id),h.success("Task deleted")}catch{h.error("Failed to delete task")}}function M(i){const e=new Date(a.value);e.setDate(e.getDate()+i),a.value=B(e)}return(i,e)=>(n(),l("div",me,[t("div",ke,[e[10]||(e[10]=t("h2",{class:"text-lg font-semibold text-foreground flex-1"},"Planner",-1)),t("div",fe,[p($,{variant:"outline",size:"sm",onClick:e[0]||(e[0]=c=>M(-1))},{default:y(()=>[...e[6]||(e[6]=[t("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),_:1}),p(S,{modelValue:a.value,"onUpdate:modelValue":e[1]||(e[1]=c=>a.value=c),type:"date",class:"h-8 w-36 text-xs"},null,8,["modelValue"]),p($,{variant:"outline",size:"sm",onClick:e[2]||(e[2]=c=>M(1))},{default:y(()=>[...e[7]||(e[7]=[t("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])]),_:1}),p($,{variant:"outline",size:"sm",onClick:e[3]||(e[3]=c=>a.value=_(B)(new Date))},{default:y(()=>[...e[8]||(e[8]=[L("Today",-1)])]),_:1})]),p(S,{modelValue:v.value,"onUpdate:modelValue":e[4]||(e[4]=c=>v.value=c),placeholder:"Search tasks...",class:"h-8 w-40 text-xs"},null,8,["modelValue"]),p($,{size:"sm",onClick:o},{default:y(()=>[...e[9]||(e[9]=[t("svg",{class:"h-4 w-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),L(" New Task ",-1)])]),_:1})]),p(ce,{tasks:d.value,loading:_(r).loading,onEdit:k,onComplete:g,onDelete:C},null,8,["tasks","loading"]),p(E,{open:m.value,task:f.value,"default-date":a.value,onClose:e[5]||(e[5]=c=>m.value=!1),onSave:u},null,8,["open","task","default-date"])]))}});export{$e as default}; diff --git a/src/static/assets/PlannerView-BAUQxJ_s.js b/src/static/assets/PlannerView-BAUQxJ_s.js deleted file mode 100644 index 0a8ab2b..0000000 --- a/src/static/assets/PlannerView-BAUQxJ_s.js +++ /dev/null @@ -1 +0,0 @@ -import{u as N,_ as E}from"./TaskForm.vue_vue_type_script_setup_true_lang-grpGvlfv.js";import{d as T,o as n,c as r,a as t,n as P,t as p,F as D,r as V,A,i as h,e as v,w,p as L,h as _,C as z,j,y as H,D as U,k as K,q as b,x as q,v as I,K as g}from"./index-CMUSrGrd.js";import{_ as O}from"./Badge.vue_vue_type_script_setup_true_lang-Dhaxut8t.js";import{f as F,i as B}from"./utils-7WVCegLb.js";import{_ as $}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{_ as S}from"./Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js";import"./Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js";import"./devops-DCMlzRTJ.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";const G=["draggable"],J={class:"flex items-start gap-2"},Q=["title"],R={class:"flex-1 min-w-0"},W={class:"text-sm font-medium text-foreground leading-tight truncate"},X={key:0,class:"flex items-center gap-1 mt-1 flex-wrap"},Y={class:"flex items-center gap-2 mt-1.5 flex-wrap"},Z={key:0,class:"text-xs text-muted-foreground"},ee={key:1,class:"text-xs text-emerald-400"},te={key:2,class:"text-xs text-blue-400 ml-auto",title:"Azure DevOps"},se={class:"flex items-center gap-1 opacity-0 group-hover:opacity-100 shrink-0"},oe=T({__name:"TaskCard",props:{task:{},draggable:{type:Boolean}},emits:["edit","complete","delete"],setup(s,{emit:i}){const a=i,m=u=>({todo:"outline",doing:"default",done:"success",cancelled:"secondary"})[u],k=u=>["","Low","Medium","High","Critical","Blocker"][u]??"Unknown",f=u=>u>=4?"bg-red-500":u===3?"bg-amber-500":"bg-emerald-500";return(u,o)=>(n(),r("div",{draggable:s.draggable,class:"rounded-lg border border-border bg-card p-3 hover:border-primary/50 transition-colors cursor-pointer group",onClick:o[2]||(o[2]=l=>a("edit",s.task))},[t("div",J,[t("div",{class:P(["h-2 w-2 rounded-full mt-1.5 shrink-0",f(s.task.priority)]),title:k(s.task.priority)},null,10,Q),t("div",R,[t("p",W,p(s.task.title),1),s.task.tags.length?(n(),r("div",X,[(n(!0),r(D,null,V(s.task.tags,l=>(n(),r("span",{key:l.id,class:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",style:A({background:`${l.color_hex}22`,color:l.color_hex})},p(l.name),5))),128))])):h("",!0),t("div",Y,[v(O,{variant:m(s.task.status),class:"text-xs py-0"},{default:w(()=>[L(p(s.task.status),1)]),_:1},8,["variant"]),s.task.estimate_hours?(n(),r("span",Z," ~"+p(_(F)(s.task.estimate_hours)),1)):h("",!0),s.task.actual_hours?(n(),r("span",ee,p(_(F)(s.task.actual_hours))+" actual ",1)):h("",!0),s.task.azure_work_item_id?(n(),r("span",te," #"+p(s.task.azure_work_item_id),1)):h("",!0)])]),t("div",se,[s.task.status!=="done"?(n(),r("button",{key:0,class:"p-1 rounded hover:bg-emerald-500/20 text-emerald-400",title:"Mark done",onClick:o[0]||(o[0]=z(l=>a("complete",s.task),["stop"]))},[...o[3]||(o[3]=[t("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)])])):h("",!0),t("button",{class:"p-1 rounded hover:bg-red-500/20 text-red-400",title:"Delete",onClick:o[1]||(o[1]=z(l=>a("delete",s.task),["stop"]))},[...o[4]||(o[4]=[t("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",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)])])])])],8,G))}}),ae={class:"space-y-6"},ne={key:0,class:"text-sm text-muted-foreground py-4 text-center"},le={class:"flex items-center gap-2 mb-2"},re={class:"text-xs font-semibold uppercase tracking-wide text-muted-foreground"},ie={class:"text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full"},de={class:"space-y-2"},ue={key:0,class:"text-sm text-muted-foreground text-center py-8"},ce=T({__name:"TaskList",props:{tasks:{},loading:{type:Boolean}},emits:["edit","complete","delete"],setup(s,{emit:i}){const a=s,m=i,k=j(()=>{var o;const u={doing:[],todo:[],done:[],cancelled:[]};for(const l of a.tasks)(o=u[l.status])==null||o.push(l);return u}),f={doing:"In Progress",todo:"To Do",done:"Done",cancelled:"Cancelled"};return(u,o)=>(n(),r("div",ae,[s.loading?(n(),r("div",ne,"Loading tasks...")):(n(),r(D,{key:1},[(n(!0),r(D,null,V(k.value,(l,y)=>H((n(),r("div",{key:y},[t("div",le,[t("h3",re,p(f[y]),1),t("span",ie,p(l.length),1)]),t("div",de,[(n(!0),r(D,null,V(l,x=>(n(),K(oe,{key:x.id,task:x,draggable:"",onEdit:C=>m("edit",x),onComplete:C=>m("complete",x),onDelete:C=>m("delete",x)},null,8,["task","onEdit","onComplete","onDelete"]))),128))])])),[[U,l.length>0]])),128)),a.tasks.length?h("",!0):(n(),r("div",ue," No tasks found "))],64))]))}}),me={class:"p-6"},ke={class:"flex items-center gap-3 mb-6 flex-wrap"},fe={class:"flex items-center gap-1"},$e=T({__name:"PlannerView",setup(s){const i=N(),a=b(B(new Date)),m=b(!1),k=b(null),f=b("");q(()=>{i.fetchForDate(a.value)}),I(a,()=>{i.fetchForDate(a.value)});const u=j(()=>f.value?i.tasks.filter(d=>{var e;return((e=d.project_id)==null?void 0:e.toLowerCase().includes(f.value.toLowerCase()))||d.title.toLowerCase().includes(f.value.toLowerCase())}):i.tasks);function o(){k.value=null,m.value=!0}function l(d){k.value=d,m.value=!0}async function y(d,e){try{if(k.value)await i.update(k.value.id,d),g.success("Task updated");else{const c=await i.create(d);e&&(c!=null&&c.id)&&await i.createBlock(c.id,e),g.success("Task created")}m.value=!1,i.fetchForDate(a.value)}catch{g.error("Failed to save task")}}async function x(d){try{await i.complete(d.id),g.success("Task completed")}catch{g.error("Failed to complete task")}}async function C(d){if(confirm(`Delete "${d.title}"?`))try{await i.remove(d.id),g.success("Task deleted")}catch{g.error("Failed to delete task")}}function M(d){const e=new Date(a.value);e.setDate(e.getDate()+d),a.value=B(e)}return(d,e)=>(n(),r("div",me,[t("div",ke,[e[10]||(e[10]=t("h2",{class:"text-lg font-semibold text-foreground flex-1"},"Planner",-1)),t("div",fe,[v($,{variant:"outline",size:"sm",onClick:e[0]||(e[0]=c=>M(-1))},{default:w(()=>[...e[6]||(e[6]=[t("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),_:1}),v(S,{modelValue:a.value,"onUpdate:modelValue":e[1]||(e[1]=c=>a.value=c),type:"date",class:"h-8 w-36 text-xs"},null,8,["modelValue"]),v($,{variant:"outline",size:"sm",onClick:e[2]||(e[2]=c=>M(1))},{default:w(()=>[...e[7]||(e[7]=[t("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])]),_:1}),v($,{variant:"outline",size:"sm",onClick:e[3]||(e[3]=c=>a.value=_(B)(new Date))},{default:w(()=>[...e[8]||(e[8]=[L("Today",-1)])]),_:1})]),v(S,{modelValue:f.value,"onUpdate:modelValue":e[4]||(e[4]=c=>f.value=c),placeholder:"Search tasks...",class:"h-8 w-40 text-xs"},null,8,["modelValue"]),v($,{size:"sm",onClick:o},{default:w(()=>[...e[9]||(e[9]=[t("svg",{class:"h-4 w-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),L(" New Task ",-1)])]),_:1})]),v(ce,{tasks:u.value,loading:_(i).loading,onEdit:l,onComplete:x,onDelete:C},null,8,["tasks","loading"]),v(E,{open:m.value,task:k.value,"default-date":a.value,onClose:e[5]||(e[5]=c=>m.value=!1),onSave:y},null,8,["open","task","default-date"])]))}});export{$e as default}; diff --git a/src/static/assets/Progress.vue_vue_type_script_setup_true_lang-DnLPO6Lx.js b/src/static/assets/Progress.vue_vue_type_script_setup_true_lang-Bsk7zWW7.js similarity index 90% rename from src/static/assets/Progress.vue_vue_type_script_setup_true_lang-DnLPO6Lx.js rename to src/static/assets/Progress.vue_vue_type_script_setup_true_lang-Bsk7zWW7.js index 01b56be..0761860 100644 --- a/src/static/assets/Progress.vue_vue_type_script_setup_true_lang-DnLPO6Lx.js +++ b/src/static/assets/Progress.vue_vue_type_script_setup_true_lang-Bsk7zWW7.js @@ -1 +1 @@ -import{c as r}from"./utils-7WVCegLb.js";import{d as s,o as n,c as t,n as l,h as c,a as d,A as u}from"./index-CMUSrGrd.js";const h=s({__name:"Progress",props:{value:{},max:{default:100},class:{},color:{default:"default"}},setup(a){const e=a,o=()=>Math.min(100,Math.max(0,e.value/e.max*100));return(i,m)=>(n(),t("div",{class:l(c(r)("relative h-2 w-full overflow-hidden rounded-full bg-secondary",e.class))},[d("div",{class:l(["h-full rounded-full transition-all duration-300",{"bg-primary":a.color==="default","bg-emerald-500":a.color==="success","bg-amber-500":a.color==="warning","bg-red-500":a.color==="danger"}]),style:u({width:`${o()}%`})},null,6)],2))}});export{h as _}; +import{c as r}from"./utils-7WVCegLb.js";import{d as s,o as n,c as t,n as l,h as c,a as d,A as u}from"./index-BsVgmrYd.js";const h=s({__name:"Progress",props:{value:{},max:{default:100},class:{},color:{default:"default"}},setup(a){const e=a,o=()=>Math.min(100,Math.max(0,e.value/e.max*100));return(i,m)=>(n(),t("div",{class:l(c(r)("relative h-2 w-full overflow-hidden rounded-full bg-secondary",e.class))},[d("div",{class:l(["h-full rounded-full transition-all duration-300",{"bg-primary":a.color==="default","bg-emerald-500":a.color==="success","bg-amber-500":a.color==="warning","bg-red-500":a.color==="danger"}]),style:u({width:`${o()}%`})},null,6)],2))}});export{h as _}; diff --git a/src/static/assets/ProjectDetailView-KNzh4u90.js b/src/static/assets/ProjectDetailView-BsS6YxEL.js similarity index 95% rename from src/static/assets/ProjectDetailView-KNzh4u90.js rename to src/static/assets/ProjectDetailView-BsS6YxEL.js index 92c4b22..8a03141 100644 --- a/src/static/assets/ProjectDetailView-KNzh4u90.js +++ b/src/static/assets/ProjectDetailView-BsS6YxEL.js @@ -1 +1 @@ -import{d as T,u as F,x as M,c as o,e as r,F as f,a as e,t as i,h as d,i as _,w as n,k as P,g as R,f as q,q as $,o as s,p,r as h,A as C,n as z,j as E}from"./index-CMUSrGrd.js";import{d as G}from"./dashboard-BcrvrRpF.js";import{_ as v,a as y}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{_ as g,a as k}from"./CardTitle.vue_vue_type_script_setup_true_lang-DKwAVa1N.js";import{_ as H}from"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";import{f as b,b as N}from"./utils-7WVCegLb.js";const I={class:"p-6"},O={key:0,class:"flex items-center justify-center h-40"},U={class:"mb-6"},J={class:"flex items-start justify-between gap-4 flex-wrap"},K={class:"flex items-center gap-3 mb-1 flex-wrap"},Q={class:"text-xl font-bold text-foreground"},W={key:0,class:"text-sm text-primary font-medium"},X={class:"flex items-center gap-3 mt-1 flex-wrap"},Y={key:0,class:"text-sm text-muted-foreground"},Z={key:1,class:"text-xs bg-muted text-muted-foreground px-2 py-1 rounded"},tt=["href"],et={class:"text-right"},st={class:"text-2xl font-bold text-foreground"},ot={class:"h-32 flex items-end gap-px"},at=["title"],lt={class:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6"},rt={key:0,class:"text-sm text-muted-foreground"},nt={key:1,class:"space-y-1.5"},it=["title"],dt={class:"text-foreground shrink-0 ml-2"},ut={key:0,class:"text-sm text-muted-foreground"},ct={key:1,class:"space-y-2"},mt={class:"text-xs text-foreground w-24 truncate shrink-0"},_t={class:"flex-1 h-2 bg-secondary rounded-full overflow-hidden"},ft={class:"text-xs text-muted-foreground w-8 text-right shrink-0"},xt={class:"space-y-1"},pt=["onClick"],ht={class:"text-xs text-muted-foreground w-24 shrink-0"},vt={class:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden"},yt={class:"text-xs text-foreground w-16 text-right shrink-0 tabular-nums"},gt={class:"text-xs text-muted-foreground w-12 text-right shrink-0"},kt={key:0,class:"text-sm text-muted-foreground"},bt={key:1,class:"space-y-2"},wt={class:"flex-1 min-w-0"},jt={class:"text-xs font-medium text-foreground"},$t={class:"text-xs text-muted-foreground mt-0.5"},Ct={class:"flex items-start gap-2 shrink-0"},zt={class:"text-right"},St={class:"text-xs font-medium text-foreground"},Bt={class:"text-xs text-muted-foreground"},At=["onClick"],Dt={key:0,class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Nt={key:1,class:"h-3.5 w-3.5 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Vt={key:2,class:"text-center text-muted-foreground py-12"},Et=T({__name:"ProjectDetailView",setup(Lt){const S=R(),B=q(),w=S.params.id,u=S.params.date,V=F(),a=$(null),j=$(!1),x=$(null);M(async()=>{j.value=!0;try{const c=u?{from:u,to:u}:void 0,l=await G.project(w,c);a.value=l.data}finally{j.value=!1}});const A=E(()=>{var c;return Math.max(...((c=a.value)==null?void 0:c.daily.map(l=>l.hours))??[1],1)});async function L(c){if(!x.value){x.value=c;try{const l=await fetch(`/cc-dashboard/api/dashboard/sessions/${c}/summarize`,{method:"POST",headers:{Authorization:`Bearer ${V.token}`}});if(l.ok){const t=await l.json();if(a.value){const m=a.value.sessions.findIndex(D=>D.id===c);m!==-1&&(a.value.sessions[m]={...a.value.sessions[m],ai_title:t.title,ai_result:t.result})}}}catch{}finally{x.value=null}}}return(c,l)=>(s(),o("div",I,[j.value?(s(),o("div",O,[r(H,{size:"lg",class:"text-primary"})])):a.value?(s(),o(f,{key:1},[e("div",U,[e("div",J,[e("div",null,[e("div",K,[e("h2",Q,i(a.value.project.display_name),1),d(u)?(s(),o("span",W,i(d(u)),1)):_("",!0),d(u)?(s(),o("button",{key:1,class:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:l[0]||(l[0]=t=>d(B).push({name:"project-detail",params:{id:d(w)}}))}," ← All time ")):_("",!0)]),e("div",X,[a.value.project.client?(s(),o("span",Y,i(a.value.project.client),1)):_("",!0),a.value.project.job_number?(s(),o("span",Z,i(a.value.project.job_number),1)):_("",!0),a.value.project.repo_url?(s(),o("a",{key:2,href:a.value.project.repo_url,target:"_blank",class:"text-xs text-primary hover:underline"}," Repository → ",8,tt)):_("",!0)])]),e("div",et,[e("p",st,i(d(b)(a.value.daily.reduce((t,m)=>t+m.hours,0))),1),l[1]||(l[1]=e("p",{class:"text-xs text-muted-foreground"},"total hours",-1))])])]),r(v,{class:"mb-6"},{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[...l[2]||(l[2]=[p("Daily Activity",-1)])]),_:1})]),_:1}),r(y,null,{default:n(()=>[e("div",ot,[(s(!0),o(f,null,h(a.value.daily,t=>(s(),o("div",{key:t.date,class:"flex-1 bg-primary/70 hover:bg-primary rounded-t transition-colors",style:C({height:`${t.hours/A.value*100}%`}),title:`${t.date}: ${d(b)(t.hours)}`},null,12,at))),128))])]),_:1})]),_:1}),e("div",lt,[r(v,null,{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[...l[3]||(l[3]=[p("Top Files",-1)])]),_:1})]),_:1}),r(y,null,{default:n(()=>[a.value.top_files.length?(s(),o("div",nt,[(s(!0),o(f,null,h(a.value.top_files.slice(0,10),t=>(s(),o("div",{key:t.file,class:"flex items-center justify-between text-xs"},[e("span",{class:"text-muted-foreground truncate max-w-[200px]",title:t.file},i(t.file.split("/").pop()),9,it),e("span",dt,i(t.count)+"×",1)]))),128))])):(s(),o("div",rt,"No data"))]),_:1})]),_:1}),r(v,null,{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[...l[4]||(l[4]=[p("Tool Usage",-1)])]),_:1})]),_:1}),r(y,null,{default:n(()=>[a.value.top_tools.length?(s(),o("div",ct,[(s(!0),o(f,null,h(a.value.top_tools.slice(0,8),t=>(s(),o("div",{key:t.tool,class:"flex items-center gap-2"},[e("span",mt,i(t.tool),1),e("div",_t,[e("div",{class:"h-full bg-primary rounded-full",style:C({width:`${t.pct}%`})},null,4)]),e("span",ft,i((t.pct??0).toFixed(0))+"% ",1)]))),128))])):(s(),o("div",ut,"No data"))]),_:1})]),_:1})]),!d(u)&&a.value.daily.length>0?(s(),P(v,{key:0,class:"mb-6"},{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[...l[5]||(l[5]=[p("Daily Breakdown",-1)])]),_:1})]),_:1}),r(y,null,{default:n(()=>[e("div",xt,[(s(!0),o(f,null,h([...a.value.daily].reverse(),t=>(s(),o("div",{key:t.date,class:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-muted/30 transition-colors cursor-pointer",onClick:m=>d(B).push({name:"project-detail",params:{id:d(w),date:t.date}})},[e("span",ht,i(t.date),1),e("div",vt,[e("div",{class:"h-full bg-primary/70 rounded-full",style:C({width:`${t.hours/A.value*100}%`})},null,4)]),e("span",yt,i(d(b)(t.hours)),1),e("span",gt,i(t.sessions)+" sess.",1)],8,pt))),128))])]),_:1})]),_:1})):_("",!0),r(v,null,{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[p(i(d(u)?`Sessions — ${d(u)}`:"Recent Sessions"),1)]),_:1})]),_:1}),r(y,null,{default:n(()=>[a.value.sessions.length?(s(),o("div",bt,[(s(!0),o(f,null,h(a.value.sessions,t=>{var m;return s(),o("div",{key:t.id,class:"flex items-start gap-3 py-2 border-b border-border last:border-0"},[e("div",wt,[e("p",jt,i(t.ai_title||((m=t.work_summary)==null?void 0:m.substring(0,80))||d(N)(t.start_at)),1),e("p",$t,i(d(N)(t.start_at)),1),t.ai_result?(s(),o("p",{key:0,class:z(["text-xs text-muted-foreground mt-0.5",d(u)?"":"line-clamp-2"])},i(t.ai_result),3)):t.work_summary&&t.ai_title?(s(),o("p",{key:1,class:z(["text-xs text-muted-foreground mt-0.5",d(u)?"":"line-clamp-2"])},i(t.work_summary),3)):_("",!0)]),e("div",Ct,[e("div",zt,[e("p",St,i(d(b)(t.active_hours)),1),e("p",Bt,i(t.commits.length)+" commits",1)]),e("button",{class:z(["flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-primary transition-colors",{"opacity-50 cursor-not-allowed":x.value===t.id}]),title:"Generate AI summary",onClick:D=>L(t.id)},[x.value!==t.id?(s(),o("svg",Dt,[...l[6]||(l[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",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"},null,-1)])])):(s(),o("svg",Nt,[...l[7]||(l[7]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])]))],10,At)])])}),128))])):(s(),o("div",kt,"No sessions"))]),_:1})]),_:1})],64)):(s(),o("div",Vt," Project not found "))]))}});export{Et as default}; +import{d as T,u as F,x as M,c as o,e as r,F as f,a as e,t as i,h as d,i as _,w as n,k as P,g as R,f as q,q as $,o as s,p,r as h,A as C,n as z,j as E}from"./index-BsVgmrYd.js";import{d as G}from"./dashboard-BQR_-Gvh.js";import{_ as v,a as y}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{_ as g,a as k}from"./CardTitle.vue_vue_type_script_setup_true_lang-BO3n7g7a.js";import{_ as H}from"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";import{f as b,b as N}from"./utils-7WVCegLb.js";const I={class:"p-6"},O={key:0,class:"flex items-center justify-center h-40"},U={class:"mb-6"},J={class:"flex items-start justify-between gap-4 flex-wrap"},K={class:"flex items-center gap-3 mb-1 flex-wrap"},Q={class:"text-xl font-bold text-foreground"},W={key:0,class:"text-sm text-primary font-medium"},X={class:"flex items-center gap-3 mt-1 flex-wrap"},Y={key:0,class:"text-sm text-muted-foreground"},Z={key:1,class:"text-xs bg-muted text-muted-foreground px-2 py-1 rounded"},tt=["href"],et={class:"text-right"},st={class:"text-2xl font-bold text-foreground"},ot={class:"h-32 flex items-end gap-px"},at=["title"],lt={class:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6"},rt={key:0,class:"text-sm text-muted-foreground"},nt={key:1,class:"space-y-1.5"},it=["title"],dt={class:"text-foreground shrink-0 ml-2"},ut={key:0,class:"text-sm text-muted-foreground"},ct={key:1,class:"space-y-2"},mt={class:"text-xs text-foreground w-24 truncate shrink-0"},_t={class:"flex-1 h-2 bg-secondary rounded-full overflow-hidden"},ft={class:"text-xs text-muted-foreground w-8 text-right shrink-0"},xt={class:"space-y-1"},pt=["onClick"],ht={class:"text-xs text-muted-foreground w-24 shrink-0"},vt={class:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden"},yt={class:"text-xs text-foreground w-16 text-right shrink-0 tabular-nums"},gt={class:"text-xs text-muted-foreground w-12 text-right shrink-0"},kt={key:0,class:"text-sm text-muted-foreground"},bt={key:1,class:"space-y-2"},wt={class:"flex-1 min-w-0"},jt={class:"text-xs font-medium text-foreground"},$t={class:"text-xs text-muted-foreground mt-0.5"},Ct={class:"flex items-start gap-2 shrink-0"},zt={class:"text-right"},St={class:"text-xs font-medium text-foreground"},Bt={class:"text-xs text-muted-foreground"},At=["onClick"],Dt={key:0,class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Nt={key:1,class:"h-3.5 w-3.5 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Vt={key:2,class:"text-center text-muted-foreground py-12"},Et=T({__name:"ProjectDetailView",setup(Lt){const S=R(),B=q(),w=S.params.id,u=S.params.date,V=F(),a=$(null),j=$(!1),x=$(null);M(async()=>{j.value=!0;try{const c=u?{from:u,to:u}:void 0,l=await G.project(w,c);a.value=l.data}finally{j.value=!1}});const A=E(()=>{var c;return Math.max(...((c=a.value)==null?void 0:c.daily.map(l=>l.hours))??[1],1)});async function L(c){if(!x.value){x.value=c;try{const l=await fetch(`/cc-dashboard/api/dashboard/sessions/${c}/summarize`,{method:"POST",headers:{Authorization:`Bearer ${V.token}`}});if(l.ok){const t=await l.json();if(a.value){const m=a.value.sessions.findIndex(D=>D.id===c);m!==-1&&(a.value.sessions[m]={...a.value.sessions[m],ai_title:t.title,ai_result:t.result})}}}catch{}finally{x.value=null}}}return(c,l)=>(s(),o("div",I,[j.value?(s(),o("div",O,[r(H,{size:"lg",class:"text-primary"})])):a.value?(s(),o(f,{key:1},[e("div",U,[e("div",J,[e("div",null,[e("div",K,[e("h2",Q,i(a.value.project.display_name),1),d(u)?(s(),o("span",W,i(d(u)),1)):_("",!0),d(u)?(s(),o("button",{key:1,class:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:l[0]||(l[0]=t=>d(B).push({name:"project-detail",params:{id:d(w)}}))}," ← All time ")):_("",!0)]),e("div",X,[a.value.project.client?(s(),o("span",Y,i(a.value.project.client),1)):_("",!0),a.value.project.job_number?(s(),o("span",Z,i(a.value.project.job_number),1)):_("",!0),a.value.project.repo_url?(s(),o("a",{key:2,href:a.value.project.repo_url,target:"_blank",class:"text-xs text-primary hover:underline"}," Repository → ",8,tt)):_("",!0)])]),e("div",et,[e("p",st,i(d(b)(a.value.daily.reduce((t,m)=>t+m.hours,0))),1),l[1]||(l[1]=e("p",{class:"text-xs text-muted-foreground"},"total hours",-1))])])]),r(v,{class:"mb-6"},{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[...l[2]||(l[2]=[p("Daily Activity",-1)])]),_:1})]),_:1}),r(y,null,{default:n(()=>[e("div",ot,[(s(!0),o(f,null,h(a.value.daily,t=>(s(),o("div",{key:t.date,class:"flex-1 bg-primary/70 hover:bg-primary rounded-t transition-colors",style:C({height:`${t.hours/A.value*100}%`}),title:`${t.date}: ${d(b)(t.hours)}`},null,12,at))),128))])]),_:1})]),_:1}),e("div",lt,[r(v,null,{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[...l[3]||(l[3]=[p("Top Files",-1)])]),_:1})]),_:1}),r(y,null,{default:n(()=>[a.value.top_files.length?(s(),o("div",nt,[(s(!0),o(f,null,h(a.value.top_files.slice(0,10),t=>(s(),o("div",{key:t.file,class:"flex items-center justify-between text-xs"},[e("span",{class:"text-muted-foreground truncate max-w-[200px]",title:t.file},i(t.file.split("/").pop()),9,it),e("span",dt,i(t.count)+"×",1)]))),128))])):(s(),o("div",rt,"No data"))]),_:1})]),_:1}),r(v,null,{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[...l[4]||(l[4]=[p("Tool Usage",-1)])]),_:1})]),_:1}),r(y,null,{default:n(()=>[a.value.top_tools.length?(s(),o("div",ct,[(s(!0),o(f,null,h(a.value.top_tools.slice(0,8),t=>(s(),o("div",{key:t.tool,class:"flex items-center gap-2"},[e("span",mt,i(t.tool),1),e("div",_t,[e("div",{class:"h-full bg-primary rounded-full",style:C({width:`${t.pct}%`})},null,4)]),e("span",ft,i((t.pct??0).toFixed(0))+"% ",1)]))),128))])):(s(),o("div",ut,"No data"))]),_:1})]),_:1})]),!d(u)&&a.value.daily.length>0?(s(),P(v,{key:0,class:"mb-6"},{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[...l[5]||(l[5]=[p("Daily Breakdown",-1)])]),_:1})]),_:1}),r(y,null,{default:n(()=>[e("div",xt,[(s(!0),o(f,null,h([...a.value.daily].reverse(),t=>(s(),o("div",{key:t.date,class:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-muted/30 transition-colors cursor-pointer",onClick:m=>d(B).push({name:"project-detail",params:{id:d(w),date:t.date}})},[e("span",ht,i(t.date),1),e("div",vt,[e("div",{class:"h-full bg-primary/70 rounded-full",style:C({width:`${t.hours/A.value*100}%`})},null,4)]),e("span",yt,i(d(b)(t.hours)),1),e("span",gt,i(t.sessions)+" sess.",1)],8,pt))),128))])]),_:1})]),_:1})):_("",!0),r(v,null,{default:n(()=>[r(g,{class:"pb-2"},{default:n(()=>[r(k,{class:"text-sm"},{default:n(()=>[p(i(d(u)?`Sessions — ${d(u)}`:"Recent Sessions"),1)]),_:1})]),_:1}),r(y,null,{default:n(()=>[a.value.sessions.length?(s(),o("div",bt,[(s(!0),o(f,null,h(a.value.sessions,t=>{var m;return s(),o("div",{key:t.id,class:"flex items-start gap-3 py-2 border-b border-border last:border-0"},[e("div",wt,[e("p",jt,i(t.ai_title||((m=t.work_summary)==null?void 0:m.substring(0,80))||d(N)(t.start_at)),1),e("p",$t,i(d(N)(t.start_at)),1),t.ai_result?(s(),o("p",{key:0,class:z(["text-xs text-muted-foreground mt-0.5",d(u)?"":"line-clamp-2"])},i(t.ai_result),3)):t.work_summary&&t.ai_title?(s(),o("p",{key:1,class:z(["text-xs text-muted-foreground mt-0.5",d(u)?"":"line-clamp-2"])},i(t.work_summary),3)):_("",!0)]),e("div",Ct,[e("div",zt,[e("p",St,i(d(b)(t.active_hours)),1),e("p",Bt,i(t.commits.length)+" commits",1)]),e("button",{class:z(["flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-primary transition-colors",{"opacity-50 cursor-not-allowed":x.value===t.id}]),title:"Generate AI summary",onClick:D=>L(t.id)},[x.value!==t.id?(s(),o("svg",Dt,[...l[6]||(l[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",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"},null,-1)])])):(s(),o("svg",Nt,[...l[7]||(l[7]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])]))],10,At)])])}),128))])):(s(),o("div",kt,"No sessions"))]),_:1})]),_:1})],64)):(s(),o("div",Vt," Project not found "))]))}});export{Et as default}; diff --git a/src/static/assets/ProjectsView-C_naK5Iu.js b/src/static/assets/ProjectsView-B-1asG5a.js similarity index 95% rename from src/static/assets/ProjectsView-C_naK5Iu.js rename to src/static/assets/ProjectsView-B-1asG5a.js index e8a53fb..a04a734 100644 --- a/src/static/assets/ProjectsView-C_naK5Iu.js +++ b/src/static/assets/ProjectsView-B-1asG5a.js @@ -1 +1 @@ -import{d as M,x as $,c as r,a as e,n as c,e as m,F as p,r as v,b as V,q as g,o,k as B,w as h,t as n,i as d,h as i,f as z}from"./index-CMUSrGrd.js";import{d as S}from"./dashboard-BcrvrRpF.js";import{a as N,_ as F}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{_ as L}from"./Progress.vue_vue_type_script_setup_true_lang-DnLPO6Lx.js";import{_ as D}from"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";import{f as b,a as y}from"./utils-7WVCegLb.js";const H={class:"p-6"},P={class:"flex items-center gap-3 mb-6"},A={class:"flex items-center rounded-lg border border-border overflow-hidden bg-muted/30"},I={key:0,class:"flex items-center justify-center h-40"},q={key:1,class:"text-center text-muted-foreground py-12"},E={key:2,class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"},G={class:"flex items-start justify-between gap-2 mb-3"},R={class:"min-w-0"},T={class:"font-semibold text-sm text-foreground truncate"},J={key:0,class:"text-xs text-muted-foreground truncate"},K={key:0,class:"text-xs bg-muted text-muted-foreground px-1.5 py-0.5 rounded shrink-0"},O={class:"space-y-1.5"},Q={class:"flex items-center justify-between text-xs"},U={class:"font-medium text-foreground"},W={class:"flex items-center justify-between text-xs"},X={class:"text-foreground"},Y={key:0,class:"flex items-center justify-between text-xs"},Z={class:"text-foreground"},j={key:0,class:"mt-3"},tt={class:"flex items-center justify-between text-xs mb-1"},et={key:3,class:"border border-border rounded-lg overflow-hidden"},st=["onClick"],ot={class:"min-w-0"},rt={class:"text-sm font-medium text-foreground truncate"},nt={key:0,class:"text-xs text-muted-foreground truncate"},at={class:"text-sm text-foreground tabular-nums text-right w-20"},it={class:"text-sm text-muted-foreground tabular-nums text-right w-16"},dt={class:"text-xs text-muted-foreground text-right w-24"},lt={class:"w-20 flex items-center justify-end gap-1.5"},ut={key:1,class:"text-xs text-muted-foreground"},vt=M({__name:"ProjectsView",setup(ct){const x=z(),l=g([]),_=g(!1),w=localStorage.getItem("projects.view"),u=g(w==="list"?"list":"grid");function f(a){u.value=a,localStorage.setItem("projects.view",a)}$(async()=>{_.value=!0;try{const a=await S.projects({});l.value=a.data.sort((s,t)=>t.total_hours-s.total_hours)}finally{_.value=!1}});const k=a=>a?a>90?"danger":a>70?"warning":"success":"default";return(a,s)=>(o(),r("div",H,[e("div",P,[s[4]||(s[4]=e("h2",{class:"text-lg font-semibold text-foreground flex-1"},"Projects",-1)),e("div",A,[e("button",{class:c(["px-2.5 py-1.5 transition-colors",u.value==="grid"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),title:"Grid view",onClick:s[0]||(s[0]=t=>f("grid"))},[...s[2]||(s[2]=[e("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})],-1)])],2),e("button",{class:c(["px-2.5 py-1.5 transition-colors",u.value==="list"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),title:"List view",onClick:s[1]||(s[1]=t=>f("list"))},[...s[3]||(s[3]=[e("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})],-1)])],2)])]),_.value?(o(),r("div",I,[m(D,{size:"lg",class:"text-primary"})])):l.value.length===0?(o(),r("div",q," No projects found ")):u.value==="grid"?(o(),r("div",E,[(o(!0),r(p,null,v(l.value,t=>(o(),B(F,{key:t.project_id,class:"cursor-pointer hover:border-primary/50 transition-colors",onClick:C=>i(x).push(`/projects/${t.project_id}`)},{default:h(()=>[m(N,{class:"p-4"},{default:h(()=>[e("div",G,[e("div",R,[e("p",T,n(t.display_name),1),t.client?(o(),r("p",J,n(t.client),1)):d("",!0)]),t.job_number?(o(),r("span",K,n(t.job_number),1)):d("",!0)]),e("div",O,[e("div",Q,[s[5]||(s[5]=e("span",{class:"text-muted-foreground"},"Total hours",-1)),e("span",U,n(i(b)(t.total_hours)),1)]),e("div",W,[s[6]||(s[6]=e("span",{class:"text-muted-foreground"},"Sessions",-1)),e("span",X,n(t.session_count),1)]),t.last_active?(o(),r("div",Y,[s[7]||(s[7]=e("span",{class:"text-muted-foreground"},"Last active",-1)),e("span",Z,n(i(y)(t.last_active)),1)])):d("",!0)]),t.progress_pct!==null?(o(),r("div",j,[e("div",tt,[s[8]||(s[8]=e("span",{class:"text-muted-foreground"},"Budget",-1)),e("span",{class:c(t.progress_pct>90?"text-red-400":"text-muted-foreground")},n((t.progress_pct??0).toFixed(0))+"% ",3)]),m(L,{value:t.progress_pct,color:k(t.progress_pct)},null,8,["value","color"])])):d("",!0)]),_:2},1024)]),_:2},1032,["onClick"]))),128))])):(o(),r("div",et,[s[9]||(s[9]=V('
ProjectHoursSessionsLast ActiveBudget
',1)),(o(!0),r(p,null,v(l.value,t=>(o(),r("div",{key:t.project_id,class:"grid grid-cols-[1fr_auto_auto_auto_auto] gap-4 px-4 py-3 border-b border-border last:border-0 cursor-pointer hover:bg-muted/20 transition-colors items-center",onClick:C=>i(x).push(`/projects/${t.project_id}`)},[e("div",ot,[e("p",rt,n(t.display_name),1),t.client?(o(),r("p",nt,n(t.client),1)):d("",!0)]),e("span",at,n(i(b)(t.total_hours)),1),e("span",it,n(t.session_count),1),e("span",dt,n(t.last_active?i(y)(t.last_active):"—"),1),e("div",lt,[t.progress_pct!==null?(o(),r("span",{key:0,class:c(["text-xs tabular-nums",t.progress_pct>90?"text-red-400":"text-muted-foreground"])},n((t.progress_pct??0).toFixed(0))+"% ",3)):(o(),r("span",ut,"—"))])],8,st))),128))]))]))}});export{vt as default}; +import{d as M,x as $,c as r,a as e,n as c,e as m,F as p,r as v,b as V,q as g,o,k as B,w as h,t as n,i as d,h as i,f as z}from"./index-BsVgmrYd.js";import{d as S}from"./dashboard-BQR_-Gvh.js";import{a as N,_ as F}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{_ as L}from"./Progress.vue_vue_type_script_setup_true_lang-Bsk7zWW7.js";import{_ as D}from"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";import{f as b,a as y}from"./utils-7WVCegLb.js";const H={class:"p-6"},P={class:"flex items-center gap-3 mb-6"},A={class:"flex items-center rounded-lg border border-border overflow-hidden bg-muted/30"},I={key:0,class:"flex items-center justify-center h-40"},q={key:1,class:"text-center text-muted-foreground py-12"},E={key:2,class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"},G={class:"flex items-start justify-between gap-2 mb-3"},R={class:"min-w-0"},T={class:"font-semibold text-sm text-foreground truncate"},J={key:0,class:"text-xs text-muted-foreground truncate"},K={key:0,class:"text-xs bg-muted text-muted-foreground px-1.5 py-0.5 rounded shrink-0"},O={class:"space-y-1.5"},Q={class:"flex items-center justify-between text-xs"},U={class:"font-medium text-foreground"},W={class:"flex items-center justify-between text-xs"},X={class:"text-foreground"},Y={key:0,class:"flex items-center justify-between text-xs"},Z={class:"text-foreground"},j={key:0,class:"mt-3"},tt={class:"flex items-center justify-between text-xs mb-1"},et={key:3,class:"border border-border rounded-lg overflow-hidden"},st=["onClick"],ot={class:"min-w-0"},rt={class:"text-sm font-medium text-foreground truncate"},nt={key:0,class:"text-xs text-muted-foreground truncate"},at={class:"text-sm text-foreground tabular-nums text-right w-20"},it={class:"text-sm text-muted-foreground tabular-nums text-right w-16"},dt={class:"text-xs text-muted-foreground text-right w-24"},lt={class:"w-20 flex items-center justify-end gap-1.5"},ut={key:1,class:"text-xs text-muted-foreground"},vt=M({__name:"ProjectsView",setup(ct){const x=z(),l=g([]),_=g(!1),w=localStorage.getItem("projects.view"),u=g(w==="list"?"list":"grid");function f(a){u.value=a,localStorage.setItem("projects.view",a)}$(async()=>{_.value=!0;try{const a=await S.projects({});l.value=a.data.sort((s,t)=>t.total_hours-s.total_hours)}finally{_.value=!1}});const k=a=>a?a>90?"danger":a>70?"warning":"success":"default";return(a,s)=>(o(),r("div",H,[e("div",P,[s[4]||(s[4]=e("h2",{class:"text-lg font-semibold text-foreground flex-1"},"Projects",-1)),e("div",A,[e("button",{class:c(["px-2.5 py-1.5 transition-colors",u.value==="grid"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),title:"Grid view",onClick:s[0]||(s[0]=t=>f("grid"))},[...s[2]||(s[2]=[e("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})],-1)])],2),e("button",{class:c(["px-2.5 py-1.5 transition-colors",u.value==="list"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),title:"List view",onClick:s[1]||(s[1]=t=>f("list"))},[...s[3]||(s[3]=[e("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})],-1)])],2)])]),_.value?(o(),r("div",I,[m(D,{size:"lg",class:"text-primary"})])):l.value.length===0?(o(),r("div",q," No projects found ")):u.value==="grid"?(o(),r("div",E,[(o(!0),r(p,null,v(l.value,t=>(o(),B(F,{key:t.project_id,class:"cursor-pointer hover:border-primary/50 transition-colors",onClick:C=>i(x).push(`/projects/${t.project_id}`)},{default:h(()=>[m(N,{class:"p-4"},{default:h(()=>[e("div",G,[e("div",R,[e("p",T,n(t.display_name),1),t.client?(o(),r("p",J,n(t.client),1)):d("",!0)]),t.job_number?(o(),r("span",K,n(t.job_number),1)):d("",!0)]),e("div",O,[e("div",Q,[s[5]||(s[5]=e("span",{class:"text-muted-foreground"},"Total hours",-1)),e("span",U,n(i(b)(t.total_hours)),1)]),e("div",W,[s[6]||(s[6]=e("span",{class:"text-muted-foreground"},"Sessions",-1)),e("span",X,n(t.session_count),1)]),t.last_active?(o(),r("div",Y,[s[7]||(s[7]=e("span",{class:"text-muted-foreground"},"Last active",-1)),e("span",Z,n(i(y)(t.last_active)),1)])):d("",!0)]),t.progress_pct!==null?(o(),r("div",j,[e("div",tt,[s[8]||(s[8]=e("span",{class:"text-muted-foreground"},"Budget",-1)),e("span",{class:c(t.progress_pct>90?"text-red-400":"text-muted-foreground")},n((t.progress_pct??0).toFixed(0))+"% ",3)]),m(L,{value:t.progress_pct,color:k(t.progress_pct)},null,8,["value","color"])])):d("",!0)]),_:2},1024)]),_:2},1032,["onClick"]))),128))])):(o(),r("div",et,[s[9]||(s[9]=V('
ProjectHoursSessionsLast ActiveBudget
',1)),(o(!0),r(p,null,v(l.value,t=>(o(),r("div",{key:t.project_id,class:"grid grid-cols-[1fr_auto_auto_auto_auto] gap-4 px-4 py-3 border-b border-border last:border-0 cursor-pointer hover:bg-muted/20 transition-colors items-center",onClick:C=>i(x).push(`/projects/${t.project_id}`)},[e("div",ot,[e("p",rt,n(t.display_name),1),t.client?(o(),r("p",nt,n(t.client),1)):d("",!0)]),e("span",at,n(i(b)(t.total_hours)),1),e("span",it,n(t.session_count),1),e("span",dt,n(t.last_active?i(y)(t.last_active):"—"),1),e("div",lt,[t.progress_pct!==null?(o(),r("span",{key:0,class:c(["text-xs tabular-nums",t.progress_pct>90?"text-red-400":"text-muted-foreground"])},n((t.progress_pct??0).toFixed(0))+"% ",3)):(o(),r("span",ut,"—"))])],8,st))),128))]))]))}});export{vt as default}; diff --git a/src/static/assets/ReportsView-Y3rZHkOj.js b/src/static/assets/ReportsView-BKu3ZSb5.js similarity index 99% rename from src/static/assets/ReportsView-Y3rZHkOj.js rename to src/static/assets/ReportsView-BKu3ZSb5.js index 154f3b0..d1481d7 100644 --- a/src/static/assets/ReportsView-Y3rZHkOj.js +++ b/src/static/assets/ReportsView-BKu3ZSb5.js @@ -1,4 +1,4 @@ -var Ce=Object.defineProperty;var ae=a=>{throw TypeError(a)};var Ee=(a,t,e)=>t in a?Ce(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var k=(a,t,e)=>Ee(a,typeof t!="symbol"?t+"":t,e),Le=(a,t,e)=>t.has(a)||ae("Cannot "+e);var ce=(a,t,e)=>t.has(a)?ae("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e);var Z=(a,t,e)=>(Le(a,t,"access private method"),e);import{E as V,d as Be,x as qe,c as z,a as x,n as U,e as P,w as I,F as Ze,r as Pe,q as A,o as $,p as G,k as pe,t as W,h as Me,i as he,K as ue}from"./index-CMUSrGrd.js";import{a as De,_ as Qe}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{_ as fe}from"./Badge.vue_vue_type_script_setup_true_lang-Dhaxut8t.js";import{_ as Ne}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{_ as je}from"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";import{a as Oe,i as He}from"./utils-7WVCegLb.js";import{_ as Fe}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ge={list:()=>V.get("/api/reports"),get:a=>V.get(`/api/reports/${a}`),generate:a=>V.post("/api/reports/generate",a)};function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let S=J();function we(a){S=a}const ye=/[&<>"']/,Ve=new RegExp(ye.source,"g"),$e=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ue=new RegExp($e.source,"g"),Ge={"&":"&","<":"<",">":">",'"':""","'":"'"},de=a=>Ge[a];function m(a,t){if(t){if(ye.test(a))return a.replace(Ve,de)}else if($e.test(a))return a.replace(Ue,de);return a}const We=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xe(a){return a.replace(We,(t,e)=>(e=e.toLowerCase(),e==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const Ke=/(^|[^\[])\^/g;function d(a,t){let e=typeof a=="string"?a:a.source;t=t||"";const n={replace:(i,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(Ke,"$1"),e=e.replace(i,s),n},getRegex:()=>new RegExp(e,t)};return n}function ke(a){try{a=encodeURI(a).replace(/%25/g,"%")}catch{return null}return a}const E={exec:()=>null};function xe(a,t){const e=a.replace(/\|/g,(r,s,l)=>{let o=!1,u=s;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),n=e.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length{throw TypeError(a)};var Ee=(a,t,e)=>t in a?Ce(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var k=(a,t,e)=>Ee(a,typeof t!="symbol"?t+"":t,e),Le=(a,t,e)=>t.has(a)||ae("Cannot "+e);var ce=(a,t,e)=>t.has(a)?ae("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e);var Z=(a,t,e)=>(Le(a,t,"access private method"),e);import{E as V,d as Be,x as qe,c as z,a as x,n as U,e as P,w as I,F as Ze,r as Pe,q as A,o as $,p as G,k as pe,t as W,h as Me,i as he,K as ue}from"./index-BsVgmrYd.js";import{a as De,_ as Qe}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{_ as fe}from"./Badge.vue_vue_type_script_setup_true_lang-ctqZICyq.js";import{_ as Ne}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{_ as je}from"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";import{a as Oe,i as He}from"./utils-7WVCegLb.js";import{_ as Fe}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ge={list:()=>V.get("/api/reports"),get:a=>V.get(`/api/reports/${a}`),generate:a=>V.post("/api/reports/generate",a)};function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let S=J();function we(a){S=a}const ye=/[&<>"']/,Ve=new RegExp(ye.source,"g"),$e=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ue=new RegExp($e.source,"g"),Ge={"&":"&","<":"<",">":">",'"':""","'":"'"},de=a=>Ge[a];function m(a,t){if(t){if(ye.test(a))return a.replace(Ve,de)}else if($e.test(a))return a.replace(Ue,de);return a}const We=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xe(a){return a.replace(We,(t,e)=>(e=e.toLowerCase(),e==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const Ke=/(^|[^\[])\^/g;function d(a,t){let e=typeof a=="string"?a:a.source;t=t||"";const n={replace:(i,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(Ke,"$1"),e=e.replace(i,s),n},getRegex:()=>new RegExp(e,t)};return n}function ke(a){try{a=encodeURI(a).replace(/%25/g,"%")}catch{return null}return a}const E={exec:()=>null};function xe(a,t){const e=a.replace(/\|/g,(r,s,l)=>{let o=!1,u=s;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),n=e.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length{const r=i.match(/^\s+/);if(r===null)return i;const[s]=r;return s.length>=n.length?i.slice(n.length):i}).join(` `)}class Q{constructor(t){k(this,"options");k(this,"rules");k(this,"lexer");this.options=t||S}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:M(n,` `)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],i=Ye(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(/#$/.test(n)){const i=M(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=e[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` diff --git a/src/static/assets/SettingsView-BKfQ33Q8.js b/src/static/assets/SettingsView-el_4sG2N.js similarity index 85% rename from src/static/assets/SettingsView-BKfQ33Q8.js rename to src/static/assets/SettingsView-el_4sG2N.js index 4703af1..ee591f0 100644 --- a/src/static/assets/SettingsView-BKfQ33Q8.js +++ b/src/static/assets/SettingsView-el_4sG2N.js @@ -1 +1 @@ -import{d as N,u as E,x as P,c as U,a,e as t,w as s,q as f,o as k,p as u,h as c,k as z,i as B,E as I,K as x}from"./index-CMUSrGrd.js";import{u as F}from"./devops-DCMlzRTJ.js";import{_ as w,a as V}from"./CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js";import{_ as $,a as S}from"./CardTitle.vue_vue_type_script_setup_true_lang-DKwAVa1N.js";import{_ as y}from"./Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js";import{_}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{_ as O}from"./DevopsConnectForm.vue_vue_type_script_setup_true_lang-C3QMf5bS.js";import{i as C}from"./utils-7WVCegLb.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js";function T(i,l){const n=`/cc-dashboard/api/export/timesheet.csv?from=${i}&to=${l}`,o=document.createElement("a");o.href=n,o.download=`timesheet-${i}-${l}.csv`,o.click()}function A(i,l){const n=`/cc-dashboard/api/export/timesheet.ics?from=${i}&to=${l}`,o=document.createElement("a");o.href=n,o.download=`timesheet-${i}-${l}.ics`,o.click()}const H={class:"p-6 space-y-6 max-w-2xl"},K={class:"space-y-1.5"},M={class:"space-y-1.5"},j={class:"flex items-center justify-between"},q={class:"flex items-center gap-3 flex-wrap"},h={class:"space-y-1.5"},G={class:"space-y-1.5"},J={class:"flex items-center gap-2"},se=N({__name:"SettingsView",setup(i){const l=E(),n=F(),o=f(""),p=f(0),g=f(!1),d=f(""),m=f("");P(()=>{l.user&&(o.value=l.user.username,p.value=l.user.daily_overhead_hours??0),n.fetchIntegration();const v=new Date;m.value=C(v);const e=new Date(v);e.setDate(v.getDate()-30),d.value=C(e)});async function D(){g.value=!0;try{await I.patch("/api/auth/me",{username:o.value,daily_overhead_hours:p.value}),await l.fetchMe(),x.success("Profile saved")}catch{x.error("Failed to save profile")}finally{g.value=!1}}async function b(){try{await n.sync(),x.success("Sync complete")}catch{x.error(n.error??"Sync failed")}}return(v,e)=>(k(),U("div",H,[e[18]||(e[18]=a("h2",{class:"text-lg font-semibold text-foreground"},"Settings",-1)),t(w,null,{default:s(()=>[t($,null,{default:s(()=>[t(S,{class:"text-sm"},{default:s(()=>[...e[6]||(e[6]=[u("Profile",-1)])]),_:1})]),_:1}),t(V,{class:"space-y-4"},{default:s(()=>[a("div",K,[e[7]||(e[7]=a("label",{class:"text-sm font-medium text-foreground"},"Username",-1)),t(y,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=r=>o.value=r),placeholder:"username"},null,8,["modelValue"])]),a("div",M,[e[8]||(e[8]=a("label",{class:"text-sm font-medium text-foreground"},"Daily Overhead Hours",-1)),t(y,{modelValue:p.value,"onUpdate:modelValue":e[1]||(e[1]=r=>p.value=r),type:"number",min:"0",max:"8",step:"0.25",class:"w-32"},null,8,["modelValue"]),e[9]||(e[9]=a("p",{class:"text-xs text-muted-foreground"}," Hours per day to add for overhead / meetings ",-1))]),t(_,{loading:g.value,onClick:D},{default:s(()=>[...e[10]||(e[10]=[u("Save Profile",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),t(w,null,{default:s(()=>[t($,null,{default:s(()=>[a("div",j,[t(S,{class:"text-sm"},{default:s(()=>[...e[11]||(e[11]=[u("Azure DevOps Integration",-1)])]),_:1}),c(n).integration?(k(),z(_,{key:0,variant:"outline",size:"sm",loading:c(n).syncing,onClick:b},{default:s(()=>[...e[12]||(e[12]=[u(" Sync Now ",-1)])]),_:1},8,["loading"])):B("",!0)])]),_:1}),t(V,null,{default:s(()=>[t(O)]),_:1})]),_:1}),t(w,null,{default:s(()=>[t($,null,{default:s(()=>[t(S,{class:"text-sm"},{default:s(()=>[...e[13]||(e[13]=[u("Export",-1)])]),_:1})]),_:1}),t(V,{class:"space-y-4"},{default:s(()=>[a("div",q,[a("div",h,[e[14]||(e[14]=a("label",{class:"text-xs text-muted-foreground"},"From",-1)),t(y,{modelValue:d.value,"onUpdate:modelValue":e[2]||(e[2]=r=>d.value=r),type:"date",class:"h-8 text-xs"},null,8,["modelValue"])]),a("div",G,[e[15]||(e[15]=a("label",{class:"text-xs text-muted-foreground"},"To",-1)),t(y,{modelValue:m.value,"onUpdate:modelValue":e[3]||(e[3]=r=>m.value=r),type:"date",class:"h-8 text-xs"},null,8,["modelValue"])])]),a("div",J,[t(_,{variant:"outline",size:"sm",onClick:e[4]||(e[4]=r=>c(T)(d.value,m.value))},{default:s(()=>[...e[16]||(e[16]=[u(" Download CSV ",-1)])]),_:1}),t(_,{variant:"outline",size:"sm",onClick:e[5]||(e[5]=r=>c(A)(d.value,m.value))},{default:s(()=>[...e[17]||(e[17]=[u(" Download ICS ",-1)])]),_:1})])]),_:1})]),_:1})]))}});export{se as default}; +import{d as N,u as E,x as P,c as U,a,e as t,w as s,q as f,o as k,p as u,h as c,k as z,i as B,E as I,K as x}from"./index-BsVgmrYd.js";import{u as F}from"./devops-Dr0K2zsR.js";import{_ as w,a as V}from"./CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js";import{_ as $,a as S}from"./CardTitle.vue_vue_type_script_setup_true_lang-BO3n7g7a.js";import{_ as y}from"./Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js";import{_}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{_ as O}from"./DevopsConnectForm.vue_vue_type_script_setup_true_lang-CTHVanFL.js";import{i as C}from"./utils-7WVCegLb.js";import"./Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js";function T(i,l){const n=`/cc-dashboard/api/export/timesheet.csv?from=${i}&to=${l}`,o=document.createElement("a");o.href=n,o.download=`timesheet-${i}-${l}.csv`,o.click()}function A(i,l){const n=`/cc-dashboard/api/export/timesheet.ics?from=${i}&to=${l}`,o=document.createElement("a");o.href=n,o.download=`timesheet-${i}-${l}.ics`,o.click()}const H={class:"p-6 space-y-6 max-w-2xl"},K={class:"space-y-1.5"},M={class:"space-y-1.5"},j={class:"flex items-center justify-between"},q={class:"flex items-center gap-3 flex-wrap"},h={class:"space-y-1.5"},G={class:"space-y-1.5"},J={class:"flex items-center gap-2"},se=N({__name:"SettingsView",setup(i){const l=E(),n=F(),o=f(""),p=f(0),g=f(!1),d=f(""),m=f("");P(()=>{l.user&&(o.value=l.user.username,p.value=l.user.daily_overhead_hours??0),n.fetchIntegration();const v=new Date;m.value=C(v);const e=new Date(v);e.setDate(v.getDate()-30),d.value=C(e)});async function D(){g.value=!0;try{await I.patch("/api/auth/me",{username:o.value,daily_overhead_hours:p.value}),await l.fetchMe(),x.success("Profile saved")}catch{x.error("Failed to save profile")}finally{g.value=!1}}async function b(){try{await n.sync(),x.success("Sync complete")}catch{x.error(n.error??"Sync failed")}}return(v,e)=>(k(),U("div",H,[e[18]||(e[18]=a("h2",{class:"text-lg font-semibold text-foreground"},"Settings",-1)),t(w,null,{default:s(()=>[t($,null,{default:s(()=>[t(S,{class:"text-sm"},{default:s(()=>[...e[6]||(e[6]=[u("Profile",-1)])]),_:1})]),_:1}),t(V,{class:"space-y-4"},{default:s(()=>[a("div",K,[e[7]||(e[7]=a("label",{class:"text-sm font-medium text-foreground"},"Username",-1)),t(y,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=r=>o.value=r),placeholder:"username"},null,8,["modelValue"])]),a("div",M,[e[8]||(e[8]=a("label",{class:"text-sm font-medium text-foreground"},"Daily Overhead Hours",-1)),t(y,{modelValue:p.value,"onUpdate:modelValue":e[1]||(e[1]=r=>p.value=r),type:"number",min:"0",max:"8",step:"0.25",class:"w-32"},null,8,["modelValue"]),e[9]||(e[9]=a("p",{class:"text-xs text-muted-foreground"}," Hours per day to add for overhead / meetings ",-1))]),t(_,{loading:g.value,onClick:D},{default:s(()=>[...e[10]||(e[10]=[u("Save Profile",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),t(w,null,{default:s(()=>[t($,null,{default:s(()=>[a("div",j,[t(S,{class:"text-sm"},{default:s(()=>[...e[11]||(e[11]=[u("Azure DevOps Integration",-1)])]),_:1}),c(n).integration?(k(),z(_,{key:0,variant:"outline",size:"sm",loading:c(n).syncing,onClick:b},{default:s(()=>[...e[12]||(e[12]=[u(" Sync Now ",-1)])]),_:1},8,["loading"])):B("",!0)])]),_:1}),t(V,null,{default:s(()=>[t(O)]),_:1})]),_:1}),t(w,null,{default:s(()=>[t($,null,{default:s(()=>[t(S,{class:"text-sm"},{default:s(()=>[...e[13]||(e[13]=[u("Export",-1)])]),_:1})]),_:1}),t(V,{class:"space-y-4"},{default:s(()=>[a("div",q,[a("div",h,[e[14]||(e[14]=a("label",{class:"text-xs text-muted-foreground"},"From",-1)),t(y,{modelValue:d.value,"onUpdate:modelValue":e[2]||(e[2]=r=>d.value=r),type:"date",class:"h-8 text-xs"},null,8,["modelValue"])]),a("div",G,[e[15]||(e[15]=a("label",{class:"text-xs text-muted-foreground"},"To",-1)),t(y,{modelValue:m.value,"onUpdate:modelValue":e[3]||(e[3]=r=>m.value=r),type:"date",class:"h-8 text-xs"},null,8,["modelValue"])])]),a("div",J,[t(_,{variant:"outline",size:"sm",onClick:e[4]||(e[4]=r=>c(T)(d.value,m.value))},{default:s(()=>[...e[16]||(e[16]=[u(" Download CSV ",-1)])]),_:1}),t(_,{variant:"outline",size:"sm",onClick:e[5]||(e[5]=r=>c(A)(d.value,m.value))},{default:s(()=>[...e[17]||(e[17]=[u(" Download ICS ",-1)])]),_:1})])]),_:1})]),_:1})]))}});export{se as default}; diff --git a/src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js b/src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js similarity index 90% rename from src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js rename to src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js index 682a3fd..b3b2986 100644 --- a/src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js +++ b/src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js @@ -1 +1 @@ -import{d as l,o as n,c as o,n as t,a as r}from"./index-CMUSrGrd.js";const i=l({__name:"Spinner",props:{size:{},class:{}},setup(s){return(a,e)=>(n(),o("svg",{class:t(["animate-spin text-current",s.size==="sm"?"h-3 w-3":s.size==="lg"?"h-6 w-6":"h-4 w-4",a.$props.class]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...e[0]||(e[0]=[r("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),r("path",{class:"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"},null,-1)])],2))}});export{i as _}; +import{d as l,o as n,c as o,n as t,a as r}from"./index-BsVgmrYd.js";const i=l({__name:"Spinner",props:{size:{},class:{}},setup(s){return(a,e)=>(n(),o("svg",{class:t(["animate-spin text-current",s.size==="sm"?"h-3 w-3":s.size==="lg"?"h-6 w-6":"h-4 w-4",a.$props.class]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...e[0]||(e[0]=[r("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),r("path",{class:"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"},null,-1)])],2))}});export{i as _}; diff --git a/src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-grpGvlfv.js b/src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-CZhTyTsN.js similarity index 96% rename from src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-grpGvlfv.js rename to src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-CZhTyTsN.js index 3181c60..4ada570 100644 --- a/src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-grpGvlfv.js +++ b/src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-CZhTyTsN.js @@ -1 +1 @@ -import{E as v,B as I,q as y,d as z,o as b,c as g,n as N,h as w,t as V,i as h,m as A,x as E,v as O,k as M,w as _,a as s,e as r,p as C,F as T,r as D,C as L}from"./index-CMUSrGrd.js";import{_ as W}from"./Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js";import{_ as $}from"./Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js";import{c as P}from"./utils-7WVCegLb.js";import{_ as U}from"./Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js";import{u as q}from"./devops-DCMlzRTJ.js";const k={list:t=>v.get("/api/tasks",{params:t}),get:t=>v.get(`/api/tasks/${t}`),create:t=>v.post("/api/tasks",t),update:(t,d)=>v.patch(`/api/tasks/${t}`,d),remove:t=>v.delete(`/api/tasks/${t}`),complete:t=>v.post(`/api/tasks/${t}/complete`),blocks:t=>v.get(`/api/tasks/${t}/blocks`),createBlock:(t,d)=>v.post(`/api/tasks/${t}/blocks`,d),updateBlock:(t,d)=>v.patch(`/api/tasks/blocks/${t}`,d),deleteBlock:t=>v.delete(`/api/tasks/blocks/${t}`)},ge=Object.freeze(Object.defineProperty({__proto__:null,tasksApi:k},Symbol.toStringTag,{value:"Module"})),_e=I("tasks",()=>{const t=y([]),d=y(!1),o=y(null);async function m(i){d.value=!0,o.value=null;try{const n=await k.list({date:i});t.value=n.data}catch(n){const c=n;o.value=c.message??"Failed to fetch tasks"}finally{d.value=!1}}async function f(i){d.value=!0,o.value=null;try{const n=await k.list(i?{project_id:i}:void 0);t.value=n.data}catch(n){const c=n;o.value=c.message??"Failed to fetch tasks"}finally{d.value=!1}}async function p(i){const n=await k.create(i);return t.value.push(n.data),n.data}async function a(i,n){const c=await k.update(i,n),S=t.value.findIndex(F=>F.id===i);return S!==-1&&(t.value[S]=c.data),c.data}async function u(i){await k.remove(i),t.value=t.value.filter(n=>n.id!==i)}async function j(i){const n=await k.complete(i),c=t.value.findIndex(S=>S.id===i);return c!==-1&&(t.value[c]=n.data),n.data}async function x(i,n){return(await k.createBlock(i,n)).data}async function e(i,n){return(await k.updateBlock(i,n)).data}async function l(i){await k.deleteBlock(i)}return{tasks:t,loading:d,error:o,fetchForDate:m,fetchAll:f,create:p,update:a,remove:u,complete:j,createBlock:x,updateBlock:e,deleteBlock:l}}),H=["id","value","placeholder","disabled","rows"],G=z({__name:"Textarea",props:{modelValue:{},placeholder:{},disabled:{type:Boolean},rows:{},class:{},id:{}},emits:["update:modelValue"],setup(t,{emit:d}){const o=t,m=d;return(f,p)=>(b(),g("textarea",{id:t.id,value:t.modelValue,placeholder:t.placeholder,disabled:t.disabled,rows:t.rows??3,class:N(w(P)("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 resize-none",o.class)),onInput:p[0]||(p[0]=a=>m("update:modelValue",a.target.value))},null,42,H))}}),J=["id","value","disabled"],K=["selected"],B=z({__name:"Select",props:{modelValue:{},disabled:{type:Boolean},class:{},id:{},placeholder:{}},emits:["update:modelValue","change"],setup(t,{emit:d}){const o=t,m=d;return(f,p)=>(b(),g("select",{id:t.id,value:t.modelValue,disabled:t.disabled,class:N(w(P)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",o.class)),onChange:p[0]||(p[0]=a=>m("update:modelValue",a.target.value))},[t.placeholder?(b(),g("option",{key:0,value:"",disabled:"",selected:!t.modelValue},V(t.placeholder),9,K)):h("",!0),A(f.$slots,"default")],42,J))}}),Q={list:()=>v.get("/api/projects")},R=I("projects",()=>{const t=y([]),d=y(!1);async function o(){if(!(t.value.length>0)){d.value=!0;try{const m=await Q.list();t.value=m.data}catch{t.value=[]}finally{d.value=!1}}}return{projects:t,loading:d,fetchProjects:o}}),X={class:"space-y-1.5"},Y={class:"space-y-1.5"},Z={class:"grid grid-cols-2 gap-3"},ee={class:"space-y-1.5"},te={class:"space-y-1.5"},ae={class:"grid grid-cols-2 gap-3"},le={class:"space-y-1.5"},se={class:"space-y-1.5"},oe={class:"grid grid-cols-2 gap-3"},de={class:"space-y-1.5"},ie={class:"space-y-1.5"},ne={key:0,class:"space-y-1.5"},ue=["value"],re={key:1,class:"space-y-1.5"},me=["value"],ye=z({__name:"TaskForm",props:{open:{type:Boolean},task:{default:null},defaultDate:{}},emits:["close","save"],setup(t,{emit:d}){const o=t,m=d,f=q(),p=R();E(()=>{p.fetchProjects()});const a=y({title:"",notes:"",planned_date:"",start_time:"",end_time:"",estimate_hours:1,status:"todo",priority:3,project_id:void 0,azure_work_item_id:void 0});O(()=>o.open,x=>{x&&(o.task?a.value={title:o.task.title,notes:o.task.notes??"",planned_date:o.task.planned_date??"",start_time:"",end_time:"",estimate_hours:o.task.estimate_hours??1,status:o.task.status,priority:o.task.priority,project_id:o.task.project_id??void 0,azure_work_item_id:o.task.azure_work_item_id??void 0}:a.value={title:"",notes:"",planned_date:o.defaultDate??"",start_time:"",end_time:"",estimate_hours:1,status:"todo",priority:3,project_id:void 0,azure_work_item_id:void 0},f.integration&&!f.workItems.length&&f.fetchWorkItems("open"))},{immediate:!0});const u=y(!1);async function j(){if(a.value.title.trim()){u.value=!0;try{const x={title:a.value.title,notes:a.value.notes||void 0,planned_date:a.value.planned_date,estimate_hours:a.value.estimate_hours,status:a.value.status,priority:a.value.priority,project_id:a.value.project_id||null,azure_work_item_id:a.value.azure_work_item_id||null};let e;a.value.planned_date&&a.value.start_time&&a.value.end_time&&(e={start_at:new Date(`${a.value.planned_date}T${a.value.start_time}:00`).toISOString(),end_at:new Date(`${a.value.planned_date}T${a.value.end_time}:00`).toISOString()}),m("save",x,e)}finally{u.value=!1}}}return(x,e)=>(b(),M(W,{open:t.open,title:t.task?"Edit Task":"New Task","max-width":"max-w-md",onClose:e[11]||(e[11]=l=>m("close"))},{footer:_(()=>[r(U,{variant:"outline",disabled:u.value,onClick:e[10]||(e[10]=l=>m("close"))},{default:_(()=>[...e[25]||(e[25]=[C("Cancel",-1)])]),_:1},8,["disabled"]),r(U,{loading:u.value,onClick:j},{default:_(()=>[C(V(t.task?"Update":"Create"),1)]),_:1},8,["loading"])]),default:_(()=>[s("form",{class:"space-y-4",onSubmit:L(j,["prevent"])},[s("div",X,[e[12]||(e[12]=s("label",{class:"text-sm font-medium text-foreground"},"Title *",-1)),r($,{modelValue:a.value.title,"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.title=l),placeholder:"Task title...",disabled:u.value},null,8,["modelValue","disabled"])]),s("div",Y,[e[13]||(e[13]=s("label",{class:"text-sm font-medium text-foreground"},"Notes",-1)),r(G,{modelValue:a.value.notes,"onUpdate:modelValue":e[1]||(e[1]=l=>a.value.notes=l),placeholder:"Additional notes...",disabled:u.value},null,8,["modelValue","disabled"])]),s("div",Z,[s("div",ee,[e[14]||(e[14]=s("label",{class:"text-sm font-medium text-foreground"},"Planned Date",-1)),r($,{modelValue:a.value.planned_date,"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.planned_date=l),type:"date",disabled:u.value},null,8,["modelValue","disabled"])]),s("div",te,[e[15]||(e[15]=s("label",{class:"text-sm font-medium text-foreground"},"Estimate (h)",-1)),r($,{modelValue:a.value.estimate_hours,"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.estimate_hours=l),type:"number",min:"0.25",max:"24",step:"0.25",disabled:u.value},null,8,["modelValue","disabled"])])]),s("div",ae,[s("div",le,[e[16]||(e[16]=s("label",{class:"text-sm font-medium text-foreground"},[C("Start time "),s("span",{class:"text-muted-foreground font-normal"},"(optional)")],-1)),r($,{modelValue:a.value.start_time,"onUpdate:modelValue":e[4]||(e[4]=l=>a.value.start_time=l),type:"time",disabled:u.value},null,8,["modelValue","disabled"])]),s("div",se,[e[17]||(e[17]=s("label",{class:"text-sm font-medium text-foreground"},"End time",-1)),r($,{modelValue:a.value.end_time,"onUpdate:modelValue":e[5]||(e[5]=l=>a.value.end_time=l),type:"time",disabled:u.value},null,8,["modelValue","disabled"])])]),s("div",oe,[s("div",de,[e[19]||(e[19]=s("label",{class:"text-sm font-medium text-foreground"},"Status",-1)),r(B,{modelValue:a.value.status,"onUpdate:modelValue":e[6]||(e[6]=l=>a.value.status=l),disabled:u.value},{default:_(()=>[...e[18]||(e[18]=[s("option",{value:"todo"},"Todo",-1),s("option",{value:"doing"},"Doing",-1),s("option",{value:"done"},"Done",-1),s("option",{value:"cancelled"},"Cancelled",-1)])]),_:1},8,["modelValue","disabled"])]),s("div",ie,[e[21]||(e[21]=s("label",{class:"text-sm font-medium text-foreground"},"Priority",-1)),r(B,{modelValue:a.value.priority,"onUpdate:modelValue":e[7]||(e[7]=l=>a.value.priority=l),disabled:u.value},{default:_(()=>[...e[20]||(e[20]=[s("option",{value:"1"},"1 - Low",-1),s("option",{value:"2"},"2 - Normal",-1),s("option",{value:"3"},"3 - Medium",-1),s("option",{value:"4"},"4 - High",-1),s("option",{value:"5"},"5 - Critical",-1)])]),_:1},8,["modelValue","disabled"])])]),w(p).projects.length?(b(),g("div",ne,[e[23]||(e[23]=s("label",{class:"text-sm font-medium text-foreground"},"Project",-1)),r(B,{modelValue:a.value.project_id,"onUpdate:modelValue":e[8]||(e[8]=l=>a.value.project_id=l),disabled:u.value,placeholder:"Select project..."},{default:_(()=>[e[22]||(e[22]=s("option",{value:""},"None",-1)),(b(!0),g(T,null,D(w(p).projects,l=>(b(),g("option",{key:l.id,value:l.id},V(l.display_name)+V(l.job_number?` (${l.job_number})`:""),9,ue))),128))]),_:1},8,["modelValue","disabled"])])):h("",!0),w(f).workItems.length?(b(),g("div",re,[e[24]||(e[24]=s("label",{class:"text-sm font-medium text-foreground"},"Azure DevOps Work Item",-1)),r(B,{modelValue:a.value.azure_work_item_id,"onUpdate:modelValue":e[9]||(e[9]=l=>a.value.azure_work_item_id=l),disabled:u.value,placeholder:"Link work item..."},{default:_(()=>[(b(!0),g(T,null,D(w(f).workItems,l=>(b(),g("option",{key:l.id,value:l.id}," #"+V(l.ado_id)+" – "+V(l.title),9,me))),128))]),_:1},8,["modelValue","disabled"])])):h("",!0)],32)]),_:1},8,["open","title"]))}});export{ye as _,ge as t,_e as u}; +import{E as v,B as I,q as y,d as z,o as b,c as g,n as N,h as w,t as V,i as h,m as A,x as E,v as O,k as M,w as _,a as s,e as r,p as C,F as T,r as D,C as L}from"./index-BsVgmrYd.js";import{_ as W}from"./Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js";import{_ as $}from"./Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js";import{c as P}from"./utils-7WVCegLb.js";import{_ as U}from"./Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js";import{u as q}from"./devops-Dr0K2zsR.js";const k={list:t=>v.get("/api/tasks",{params:t}),get:t=>v.get(`/api/tasks/${t}`),create:t=>v.post("/api/tasks",t),update:(t,d)=>v.patch(`/api/tasks/${t}`,d),remove:t=>v.delete(`/api/tasks/${t}`),complete:t=>v.post(`/api/tasks/${t}/complete`),blocks:t=>v.get(`/api/tasks/${t}/blocks`),createBlock:(t,d)=>v.post(`/api/tasks/${t}/blocks`,d),updateBlock:(t,d)=>v.patch(`/api/tasks/blocks/${t}`,d),deleteBlock:t=>v.delete(`/api/tasks/blocks/${t}`)},ge=Object.freeze(Object.defineProperty({__proto__:null,tasksApi:k},Symbol.toStringTag,{value:"Module"})),_e=I("tasks",()=>{const t=y([]),d=y(!1),o=y(null);async function m(i){d.value=!0,o.value=null;try{const n=await k.list({date:i});t.value=n.data}catch(n){const c=n;o.value=c.message??"Failed to fetch tasks"}finally{d.value=!1}}async function f(i){d.value=!0,o.value=null;try{const n=await k.list(i?{project_id:i}:void 0);t.value=n.data}catch(n){const c=n;o.value=c.message??"Failed to fetch tasks"}finally{d.value=!1}}async function p(i){const n=await k.create(i);return t.value.push(n.data),n.data}async function a(i,n){const c=await k.update(i,n),S=t.value.findIndex(F=>F.id===i);return S!==-1&&(t.value[S]=c.data),c.data}async function u(i){await k.remove(i),t.value=t.value.filter(n=>n.id!==i)}async function j(i){const n=await k.complete(i),c=t.value.findIndex(S=>S.id===i);return c!==-1&&(t.value[c]=n.data),n.data}async function x(i,n){return(await k.createBlock(i,n)).data}async function e(i,n){return(await k.updateBlock(i,n)).data}async function l(i){await k.deleteBlock(i)}return{tasks:t,loading:d,error:o,fetchForDate:m,fetchAll:f,create:p,update:a,remove:u,complete:j,createBlock:x,updateBlock:e,deleteBlock:l}}),H=["id","value","placeholder","disabled","rows"],G=z({__name:"Textarea",props:{modelValue:{},placeholder:{},disabled:{type:Boolean},rows:{},class:{},id:{}},emits:["update:modelValue"],setup(t,{emit:d}){const o=t,m=d;return(f,p)=>(b(),g("textarea",{id:t.id,value:t.modelValue,placeholder:t.placeholder,disabled:t.disabled,rows:t.rows??3,class:N(w(P)("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 resize-none",o.class)),onInput:p[0]||(p[0]=a=>m("update:modelValue",a.target.value))},null,42,H))}}),J=["id","value","disabled"],K=["selected"],B=z({__name:"Select",props:{modelValue:{},disabled:{type:Boolean},class:{},id:{},placeholder:{}},emits:["update:modelValue","change"],setup(t,{emit:d}){const o=t,m=d;return(f,p)=>(b(),g("select",{id:t.id,value:t.modelValue,disabled:t.disabled,class:N(w(P)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",o.class)),onChange:p[0]||(p[0]=a=>m("update:modelValue",a.target.value))},[t.placeholder?(b(),g("option",{key:0,value:"",disabled:"",selected:!t.modelValue},V(t.placeholder),9,K)):h("",!0),A(f.$slots,"default")],42,J))}}),Q={list:()=>v.get("/api/projects")},R=I("projects",()=>{const t=y([]),d=y(!1);async function o(){if(!(t.value.length>0)){d.value=!0;try{const m=await Q.list();t.value=m.data}catch{t.value=[]}finally{d.value=!1}}}return{projects:t,loading:d,fetchProjects:o}}),X={class:"space-y-1.5"},Y={class:"space-y-1.5"},Z={class:"grid grid-cols-2 gap-3"},ee={class:"space-y-1.5"},te={class:"space-y-1.5"},ae={class:"grid grid-cols-2 gap-3"},le={class:"space-y-1.5"},se={class:"space-y-1.5"},oe={class:"grid grid-cols-2 gap-3"},de={class:"space-y-1.5"},ie={class:"space-y-1.5"},ne={key:0,class:"space-y-1.5"},ue=["value"],re={key:1,class:"space-y-1.5"},me=["value"],ye=z({__name:"TaskForm",props:{open:{type:Boolean},task:{default:null},defaultDate:{}},emits:["close","save"],setup(t,{emit:d}){const o=t,m=d,f=q(),p=R();E(()=>{p.fetchProjects()});const a=y({title:"",notes:"",planned_date:"",start_time:"",end_time:"",estimate_hours:1,status:"todo",priority:3,project_id:void 0,azure_work_item_id:void 0});O(()=>o.open,x=>{x&&(o.task?a.value={title:o.task.title,notes:o.task.notes??"",planned_date:o.task.planned_date??"",start_time:"",end_time:"",estimate_hours:o.task.estimate_hours??1,status:o.task.status,priority:o.task.priority,project_id:o.task.project_id??void 0,azure_work_item_id:o.task.azure_work_item_id??void 0}:a.value={title:"",notes:"",planned_date:o.defaultDate??"",start_time:"",end_time:"",estimate_hours:1,status:"todo",priority:3,project_id:void 0,azure_work_item_id:void 0},f.integration&&!f.workItems.length&&f.fetchWorkItems("open"))},{immediate:!0});const u=y(!1);async function j(){if(a.value.title.trim()){u.value=!0;try{const x={title:a.value.title,notes:a.value.notes||void 0,planned_date:a.value.planned_date,estimate_hours:a.value.estimate_hours,status:a.value.status,priority:a.value.priority,project_id:a.value.project_id||null,azure_work_item_id:a.value.azure_work_item_id||null};let e;a.value.planned_date&&a.value.start_time&&a.value.end_time&&(e={start_at:new Date(`${a.value.planned_date}T${a.value.start_time}:00`).toISOString(),end_at:new Date(`${a.value.planned_date}T${a.value.end_time}:00`).toISOString()}),m("save",x,e)}finally{u.value=!1}}}return(x,e)=>(b(),M(W,{open:t.open,title:t.task?"Edit Task":"New Task","max-width":"max-w-md",onClose:e[11]||(e[11]=l=>m("close"))},{footer:_(()=>[r(U,{variant:"outline",disabled:u.value,onClick:e[10]||(e[10]=l=>m("close"))},{default:_(()=>[...e[25]||(e[25]=[C("Cancel",-1)])]),_:1},8,["disabled"]),r(U,{loading:u.value,onClick:j},{default:_(()=>[C(V(t.task?"Update":"Create"),1)]),_:1},8,["loading"])]),default:_(()=>[s("form",{class:"space-y-4",onSubmit:L(j,["prevent"])},[s("div",X,[e[12]||(e[12]=s("label",{class:"text-sm font-medium text-foreground"},"Title *",-1)),r($,{modelValue:a.value.title,"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.title=l),placeholder:"Task title...",disabled:u.value},null,8,["modelValue","disabled"])]),s("div",Y,[e[13]||(e[13]=s("label",{class:"text-sm font-medium text-foreground"},"Notes",-1)),r(G,{modelValue:a.value.notes,"onUpdate:modelValue":e[1]||(e[1]=l=>a.value.notes=l),placeholder:"Additional notes...",disabled:u.value},null,8,["modelValue","disabled"])]),s("div",Z,[s("div",ee,[e[14]||(e[14]=s("label",{class:"text-sm font-medium text-foreground"},"Planned Date",-1)),r($,{modelValue:a.value.planned_date,"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.planned_date=l),type:"date",disabled:u.value},null,8,["modelValue","disabled"])]),s("div",te,[e[15]||(e[15]=s("label",{class:"text-sm font-medium text-foreground"},"Estimate (h)",-1)),r($,{modelValue:a.value.estimate_hours,"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.estimate_hours=l),type:"number",min:"0.25",max:"24",step:"0.25",disabled:u.value},null,8,["modelValue","disabled"])])]),s("div",ae,[s("div",le,[e[16]||(e[16]=s("label",{class:"text-sm font-medium text-foreground"},[C("Start time "),s("span",{class:"text-muted-foreground font-normal"},"(optional)")],-1)),r($,{modelValue:a.value.start_time,"onUpdate:modelValue":e[4]||(e[4]=l=>a.value.start_time=l),type:"time",disabled:u.value},null,8,["modelValue","disabled"])]),s("div",se,[e[17]||(e[17]=s("label",{class:"text-sm font-medium text-foreground"},"End time",-1)),r($,{modelValue:a.value.end_time,"onUpdate:modelValue":e[5]||(e[5]=l=>a.value.end_time=l),type:"time",disabled:u.value},null,8,["modelValue","disabled"])])]),s("div",oe,[s("div",de,[e[19]||(e[19]=s("label",{class:"text-sm font-medium text-foreground"},"Status",-1)),r(B,{modelValue:a.value.status,"onUpdate:modelValue":e[6]||(e[6]=l=>a.value.status=l),disabled:u.value},{default:_(()=>[...e[18]||(e[18]=[s("option",{value:"todo"},"Todo",-1),s("option",{value:"doing"},"Doing",-1),s("option",{value:"done"},"Done",-1),s("option",{value:"cancelled"},"Cancelled",-1)])]),_:1},8,["modelValue","disabled"])]),s("div",ie,[e[21]||(e[21]=s("label",{class:"text-sm font-medium text-foreground"},"Priority",-1)),r(B,{modelValue:a.value.priority,"onUpdate:modelValue":e[7]||(e[7]=l=>a.value.priority=l),disabled:u.value},{default:_(()=>[...e[20]||(e[20]=[s("option",{value:"1"},"1 - Low",-1),s("option",{value:"2"},"2 - Normal",-1),s("option",{value:"3"},"3 - Medium",-1),s("option",{value:"4"},"4 - High",-1),s("option",{value:"5"},"5 - Critical",-1)])]),_:1},8,["modelValue","disabled"])])]),w(p).projects.length?(b(),g("div",ne,[e[23]||(e[23]=s("label",{class:"text-sm font-medium text-foreground"},"Project",-1)),r(B,{modelValue:a.value.project_id,"onUpdate:modelValue":e[8]||(e[8]=l=>a.value.project_id=l),disabled:u.value,placeholder:"Select project..."},{default:_(()=>[e[22]||(e[22]=s("option",{value:""},"None",-1)),(b(!0),g(T,null,D(w(p).projects,l=>(b(),g("option",{key:l.id,value:l.id},V(l.display_name)+V(l.job_number?` (${l.job_number})`:""),9,ue))),128))]),_:1},8,["modelValue","disabled"])])):h("",!0),w(f).workItems.length?(b(),g("div",re,[e[24]||(e[24]=s("label",{class:"text-sm font-medium text-foreground"},"Azure DevOps Work Item",-1)),r(B,{modelValue:a.value.azure_work_item_id,"onUpdate:modelValue":e[9]||(e[9]=l=>a.value.azure_work_item_id=l),disabled:u.value,placeholder:"Link work item..."},{default:_(()=>[(b(!0),g(T,null,D(w(f).workItems,l=>(b(),g("option",{key:l.id,value:l.id}," #"+V(l.ado_id)+" – "+V(l.title),9,me))),128))]),_:1},8,["modelValue","disabled"])])):h("",!0)],32)]),_:1},8,["open","title"]))}});export{ye as _,ge as t,_e as u}; diff --git a/src/static/assets/admin-Do_x_iW1.js b/src/static/assets/admin-Ccc2J89T.js similarity index 68% rename from src/static/assets/admin-Do_x_iW1.js rename to src/static/assets/admin-Ccc2J89T.js index 0700c05..e0f8b93 100644 --- a/src/static/assets/admin-Do_x_iW1.js +++ b/src/static/assets/admin-Ccc2J89T.js @@ -1 +1 @@ -import{E as e}from"./index-CMUSrGrd.js";const i={users:()=>e.get("/api/admin/users"),keys:()=>e.get("/api/keys"),createKey:s=>e.post("/api/keys",s),revokeKey:s=>e.delete(`/api/keys/${s}`)};export{i as a}; +import{E as e}from"./index-BsVgmrYd.js";const i={users:()=>e.get("/api/admin/users"),keys:()=>e.get("/api/keys"),createKey:s=>e.post("/api/keys",s),revokeKey:s=>e.delete(`/api/keys/${s}`)};export{i as a}; diff --git a/src/static/assets/dashboard-BcrvrRpF.js b/src/static/assets/dashboard-BQR_-Gvh.js similarity index 88% rename from src/static/assets/dashboard-BcrvrRpF.js rename to src/static/assets/dashboard-BQR_-Gvh.js index 8a5006c..e35b874 100644 --- a/src/static/assets/dashboard-BcrvrRpF.js +++ b/src/static/assets/dashboard-BQR_-Gvh.js @@ -1 +1 @@ -import{E as t}from"./index-CMUSrGrd.js";const e={summary:a=>t.get("/api/dashboard/summary",{params:a}),projects:a=>t.get("/api/dashboard/projects",{params:a}),timeline:a=>t.get("/api/dashboard/timeline",{params:a}),monthly:a=>t.get("/api/dashboard/monthly",{params:a}),dow:a=>t.get("/api/dashboard/dow",{params:a}),tools:a=>t.get("/api/dashboard/tools",{params:a}),activity:a=>t.get("/api/dashboard/activity",{params:a}),calendar:a=>t.get("/api/dashboard/calendar",{params:a}),project:(a,o)=>t.get("/api/dashboard/project/"+a,{params:o})};export{e as d}; +import{E as t}from"./index-BsVgmrYd.js";const e={summary:a=>t.get("/api/dashboard/summary",{params:a}),projects:a=>t.get("/api/dashboard/projects",{params:a}),timeline:a=>t.get("/api/dashboard/timeline",{params:a}),monthly:a=>t.get("/api/dashboard/monthly",{params:a}),dow:a=>t.get("/api/dashboard/dow",{params:a}),tools:a=>t.get("/api/dashboard/tools",{params:a}),activity:a=>t.get("/api/dashboard/activity",{params:a}),calendar:a=>t.get("/api/dashboard/calendar",{params:a}),project:(a,o)=>t.get("/api/dashboard/project/"+a,{params:o})};export{e as d}; diff --git a/src/static/assets/devops-DCMlzRTJ.js b/src/static/assets/devops-Dr0K2zsR.js similarity index 94% rename from src/static/assets/devops-DCMlzRTJ.js rename to src/static/assets/devops-Dr0K2zsR.js index 070ceb2..935d3e8 100644 --- a/src/static/assets/devops-DCMlzRTJ.js +++ b/src/static/assets/devops-Dr0K2zsR.js @@ -1 +1 @@ -import{E as s,B as I,q as o}from"./index-CMUSrGrd.js";const i={getIntegration:()=>s.get("/api/devops/integration"),saveIntegration:e=>s.put("/api/devops/integration",e),deleteIntegration:()=>s.delete("/api/devops/integration"),sync:()=>s.post("/api/devops/sync"),workItems:e=>s.get("/api/devops/work-items",{params:e?{state:e}:void 0})},m=I("devops",()=>{const e=o(null),l=o([]),r=o(!1),n=o(!1),c=o(null);async function u(){n.value=!0;try{const t=await i.getIntegration();e.value=t.data}catch{e.value=null}finally{n.value=!1}}async function d(t){const a=await i.saveIntegration(t);e.value=a.data}async function g(){await i.deleteIntegration(),e.value=null}async function f(){var t,a;r.value=!0,c.value=null;try{await i.sync(),await u()}catch(v){const p=v;throw c.value=((a=(t=p.response)==null?void 0:t.data)==null?void 0:a.detail)??p.message??"Sync failed",v}finally{r.value=!1}}async function y(t){n.value=!0;try{const a=await i.workItems(t);l.value=a.data}catch{l.value=[]}finally{n.value=!1}}return{integration:e,workItems:l,syncing:r,loading:n,error:c,fetchIntegration:u,saveIntegration:d,deleteIntegration:g,sync:f,fetchWorkItems:y}});export{m as u}; +import{E as s,B as I,q as o}from"./index-BsVgmrYd.js";const i={getIntegration:()=>s.get("/api/devops/integration"),saveIntegration:e=>s.put("/api/devops/integration",e),deleteIntegration:()=>s.delete("/api/devops/integration"),sync:()=>s.post("/api/devops/sync"),workItems:e=>s.get("/api/devops/work-items",{params:e?{state:e}:void 0})},m=I("devops",()=>{const e=o(null),l=o([]),r=o(!1),n=o(!1),c=o(null);async function u(){n.value=!0;try{const t=await i.getIntegration();e.value=t.data}catch{e.value=null}finally{n.value=!1}}async function d(t){const a=await i.saveIntegration(t);e.value=a.data}async function g(){await i.deleteIntegration(),e.value=null}async function f(){var t,a;r.value=!0,c.value=null;try{await i.sync(),await u()}catch(v){const p=v;throw c.value=((a=(t=p.response)==null?void 0:t.data)==null?void 0:a.detail)??p.message??"Sync failed",v}finally{r.value=!1}}async function y(t){n.value=!0;try{const a=await i.workItems(t);l.value=a.data}catch{l.value=[]}finally{n.value=!1}}return{integration:e,workItems:l,syncing:r,loading:n,error:c,fetchIntegration:u,saveIntegration:d,deleteIntegration:g,sync:f,fetchWorkItems:y}});export{m as u}; diff --git a/src/static/assets/index-CMUSrGrd.js b/src/static/assets/index-BsVgmrYd.js similarity index 99% rename from src/static/assets/index-CMUSrGrd.js rename to src/static/assets/index-BsVgmrYd.js index 400bccc..2935a88 100644 --- a/src/static/assets/index-CMUSrGrd.js +++ b/src/static/assets/index-BsVgmrYd.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-CXJ9ossc.js","assets/CardContent.vue_vue_type_script_setup_true_lang-BbWKh528.js","assets/utils-7WVCegLb.js","assets/DashboardView-m9gOgQuc.js","assets/dashboard-BcrvrRpF.js","assets/CardTitle.vue_vue_type_script_setup_true_lang-DKwAVa1N.js","assets/Progress.vue_vue_type_script_setup_true_lang-DnLPO6Lx.js","assets/Button.vue_vue_type_script_setup_true_lang-C2Q_x3IQ.js","assets/Spinner.vue_vue_type_script_setup_true_lang-DGWFD4UA.js","assets/CalendarView-DewkDTAU.js","assets/TaskForm.vue_vue_type_script_setup_true_lang-grpGvlfv.js","assets/Dialog.vue_vue_type_script_setup_true_lang-eW9IuHG4.js","assets/Input.vue_vue_type_script_setup_true_lang-DA-K-Rrj.js","assets/devops-DCMlzRTJ.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/Badge.vue_vue_type_script_setup_true_lang-Dhaxut8t.js","assets/CalendarView-DRWiX2N8.css","assets/PlannerView-BAUQxJ_s.js","assets/ProjectsView-C_naK5Iu.js","assets/ProjectDetailView-KNzh4u90.js","assets/LiveView-CWjU7kXQ.js","assets/ReportsView-Y3rZHkOj.js","assets/ReportsView-B1hNlJuG.css","assets/KeysView-BshY45g6.js","assets/admin-Do_x_iW1.js","assets/DevopsView-BYs6-sh9.js","assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-C3QMf5bS.js","assets/SettingsView-BKfQ33Q8.js","assets/AdminView-CREIty01.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-CZczoEHN.js","assets/CardContent.vue_vue_type_script_setup_true_lang-B3rBmmXU.js","assets/utils-7WVCegLb.js","assets/DashboardView-sKPaoFjB.js","assets/dashboard-BQR_-Gvh.js","assets/CardTitle.vue_vue_type_script_setup_true_lang-BO3n7g7a.js","assets/Progress.vue_vue_type_script_setup_true_lang-Bsk7zWW7.js","assets/Button.vue_vue_type_script_setup_true_lang-CJHBIupl.js","assets/Spinner.vue_vue_type_script_setup_true_lang-BCputspr.js","assets/CalendarView-B1FdrWUb.js","assets/TaskForm.vue_vue_type_script_setup_true_lang-CZhTyTsN.js","assets/Dialog.vue_vue_type_script_setup_true_lang-D3o8WZbf.js","assets/Input.vue_vue_type_script_setup_true_lang-0Z6OrHEc.js","assets/devops-Dr0K2zsR.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/Badge.vue_vue_type_script_setup_true_lang-ctqZICyq.js","assets/CalendarView-DRWiX2N8.css","assets/PlannerView-A-MLkrrq.js","assets/ProjectsView-B-1asG5a.js","assets/ProjectDetailView-BsS6YxEL.js","assets/LiveView-Upgit3GU.js","assets/ReportsView-BKu3ZSb5.js","assets/ReportsView-B1hNlJuG.css","assets/KeysView-IKma-C2I.js","assets/admin-Ccc2J89T.js","assets/DevopsView-BCFbLN9X.js","assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-CTHVanFL.js","assets/SettingsView-el_4sG2N.js","assets/AdminView-p3memzOi.js"])))=>i.map(i=>d[i]); var Wl=n=>{throw TypeError(n)};var ca=(n,e,t)=>e.has(n)||Wl("Cannot "+t);var k=(n,e,t)=>(ca(n,e,"read from private field"),t?t.call(n):e.get(n)),ye=(n,e,t)=>e.has(n)?Wl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),se=(n,e,t,r)=>(ca(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),lt=(n,e,t)=>(ca(n,e,"access private method"),t);var Ni=(n,e,t,r)=>({set _(o){se(n,e,o,t)},get _(){return k(n,e,r)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=t(o);fetch(o.href,i)}})();/** * @vue/shared v3.5.34 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -41,4 +41,4 @@ Error Description: ${i.errorMessage}`);else{const s=i;this.logger.error(`A non-M Error: ${s.name} Error Description: ${s.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=pt.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>t&&ve.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==gl.None){const o=t.tenant?t.tenant:R.DEFAULT_COMMON_TENANT;r=`${t.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return R.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw H(Mn)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return up.has(e)}static isPublicCloudAuthority(e){return R.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const o=new ve(e);o.validateAsUri();const i=o.getUrlComponents();let s=`${t}.${i.HostNameAndPort}`;this.isPublicCloudAuthority(i.HostNameAndPort)&&(s=`${t}.${R.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=ve.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:s}).urlString;return r?`${a}?${r}`:a}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=pt.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=pt.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=pt.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const o=new ve(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(R.CIAM_AUTH_URL)){const i=o.HostNameAndPort.split(".")[0];t=`${t}${i}${R.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}pt.reservedTenantDomains=new Set(["{tenant}","{tenantid}",ur.COMMON,ur.CONSUMERS,ur.ORGANIZATIONS]);function eb(n){var o;const r=(o=new ve(n).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case ur.COMMON:case ur.ORGANIZATIONS:case ur.CONSUMERS:return;default:return r}}function gp(n){return n.endsWith(R.FORWARD_SLASH)?n:`${n}${R.FORWARD_SLASH}`}function tb(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw xe(Cl)}return{canonicalAuthority:n.authority?gp(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.16.1 2025-08-05 */async function pp(n,e,t,r,o,i,s){s==null||s.addQueueMeasurement(_.AuthorityFactoryCreateDiscoveredInstance,i);const a=pt.transformCIAMAuthority(gp(n)),c=new pt(a,e,t,r,o,i,s);try{return await q(c.resolveEndpointsAsync.bind(c),_.AuthorityResolveEndpointsAsync,o,s,i)(),c}catch{throw H(Mn)}}/*! @azure/msal-common v14.16.1 2025-08-05 */class fr extends Fe{constructor(e,t,r,o,i){super(e,t,r),this.name="ServerError",this.errorNo=o,this.status=i,Object.setPrototypeOf(this,fr.prototype)}}/*! @azure/msal-common v14.16.1 2025-08-05 */class Tn{static generateThrottlingStorageKey(e){return`${ti.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t,r){var s;const o=Tn.generateThrottlingStorageKey(t),i=e.getThrottlingCache(o);if(i){if(i.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(bt.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(t||ti.DEFAULT_THROTTLE_TIME_SECONDS),r+ti.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,r,o){const i={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:o,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},s=this.generateThrottlingStorageKey(i);e.removeItem(s,r.correlationId)}}/*! @azure/msal-common v14.16.1 2025-08-05 */class ta extends Fe{constructor(e,t,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,ta.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=r}}function qd(n,e,t){return new ta(n,e,t)}/*! @azure/msal-common v14.16.1 2025-08-05 */class Il{constructor(e,t){this.config=d_(e),this.logger=new hr(this.config.loggerOptions,jg,fl),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[bt.CONTENT_TYPE]=R.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case qt.HOME_ACCOUNT_ID:try{const r=no(e.credential);t[bt.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case qt.UPN:t[bt.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,r,o,i,s){var c;s&&((c=this.performanceClient)==null||c.addQueueMeasurement(s,i));const a=await this.sendPostRequest(o,e,{body:t,headers:r},i);return this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async sendPostRequest(e,t,r,o){var s,a,c;Tn.preProcess(this.cacheManager,e,o);let i;try{i=await q(this.networkClient.sendPostRequestAsync.bind(this.networkClient),_.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(t,r);const l=i.headers||{};(a=this.performanceClient)==null||a.addFields({refreshTokenSize:((s=i.body.refresh_token)==null?void 0:s.length)||0,httpVerToken:l[bt.X_MS_HTTP_VERSION]||"",requestId:l[bt.X_MS_REQUEST_ID]||""},o)}catch(l){if(l instanceof ta){const u=l.responseHeaders;throw u&&((c=this.performanceClient)==null||c.addFields({httpVerToken:u[bt.X_MS_HTTP_VERSION]||"",requestId:u[bt.X_MS_REQUEST_ID]||"",contentTypeHeader:u[bt.CONTENT_TYPE]||void 0,contentLengthHeader:u[bt.CONTENT_LENGTH]||void 0,httpStatus:l.httpStatus},o)),l.error}throw l instanceof Fe?l:H(Og)}return Tn.postProcess(this.cacheManager,e,i,o),i}async updateAuthority(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(_.UpdateTokenEndpointAuthority,t);const r=`https://${e}/${this.authority.tenant}/`,o=await pp(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const t=new ni(e.correlationId,this.performanceClient);return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.addCorrelationId(e.correlationId),t.createQueryString()}}/*! @azure/msal-common v14.16.1 2025-08-05 */const As="no_tokens_found",mp="native_account_unavailable",Sl="refresh_token_expired",nb="interaction_required",rb="consent_required",ob="login_required",na="bad_token";/*! @azure/msal-common v14.16.1 2025-08-05 */const $d=[nb,rb,ob,na],ib=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],sb={[As]:"No refresh token found in the cache. Please sign-in.",[mp]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[Sl]:"Refresh token has expired.",[na]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class cn extends Fe{constructor(e,t,r,o,i,s,a,c){super(e,t,r),Object.setPrototypeOf(this,cn.prototype),this.timestamp=o||R.EMPTY_STRING,this.traceId=i||R.EMPTY_STRING,this.correlationId=s||R.EMPTY_STRING,this.claims=a||R.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=c}}function jd(n,e,t){const r=!!n&&$d.indexOf(n)>-1,o=!!t&&ib.indexOf(t)>-1,i=!!e&&$d.some(s=>e.indexOf(s)>-1);return r||i||o}function Tc(n){return new cn(n,sb[n])}/*! @azure/msal-common v14.16.1 2025-08-05 */class nn{static setRequestState(e,t,r){const o=nn.generateLibraryState(e,r);return t?`${o}${R.RESOURCE_DELIM}${t}`:o}static generateLibraryState(e,t){if(!e)throw H(pc);const r={id:e.createNewGuid()};t&&(r.meta=t);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,t){if(!e)throw H(pc);if(!t)throw H(_o);try{const r=t.split(R.RESOURCE_DELIM),o=r[0],i=r.length>1?r.slice(1).join(R.RESOURCE_DELIM):R.EMPTY_STRING,s=e.base64Decode(o),a=JSON.parse(s);return{userRequestState:i||R.EMPTY_STRING,libraryState:a}}catch{throw H(_o)}}}/*! @azure/msal-common v14.16.1 2025-08-05 */const ab={SW:"sw"};class Io{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(_.PopTokenGenerateCnf,e.correlationId);const r=await q(this.generateKid.bind(this),_.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(_.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:ab.SW}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,o){const{resourceRequestMethod:i,resourceRequestUri:s,shrClaims:a,shrNonce:c,shrOptions:l}=r,u=s?new ve(s):void 0,d=u==null?void 0:u.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:bn(),m:i==null?void 0:i.toUpperCase(),u:d==null?void 0:d.HostNameAndPort,nonce:c||this.cryptoUtils.createNewGuid(),p:d==null?void 0:d.AbsolutePath,q:d!=null&&d.QueryString?[[],d.QueryString]:void 0,client_claims:a||void 0,...o},t,l,r.correlationId)}}/*! @azure/msal-common v14.16.1 2025-08-05 */class cb{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.16.1 2025-08-05 */function lb(n){var r,o;const e="code=",t=(r=n.error_uri)==null?void 0:r.lastIndexOf(e);return t&&t>=0?(o=n.error_uri)==null?void 0:o.substring(t+e.length):void 0}class Hr{constructor(e,t,r,o,i,s,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=o,this.serializableCache=i,this.persistencePlugin=s,this.performanceClient=a}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?H(ps,"Cached State"):H(ps,"Server State");let r,o;try{r=decodeURIComponent(e.state)}catch{throw H(_o,e.state)}try{o=decodeURIComponent(t)}catch{throw H(_o,e.state)}if(r!==o)throw H(Mg);if(e.error||e.error_description||e.suberror){const i=lb(e);throw jd(e.error,e.error_description,e.suberror)?new cn(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",i):new fr(e.error||"",e.error_description,e.suberror,i)}}validateTokenResponse(e,t){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||R.NOT_AVAILABLE} - Timestamp: ${e.timestamp||R.NOT_AVAILABLE} - Description: ${e.error_description||R.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||R.NOT_AVAILABLE} - Trace ID: ${e.trace_id||R.NOT_AVAILABLE}`,i=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,s=new fr(e.error,o,e.suberror,i,e.status);if(t&&e.status&&e.status>=Bi.SERVER_ERROR_RANGE_START&&e.status<=Bi.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. ${s}`);return}else if(t&&e.status&&e.status>=Bi.CLIENT_ERROR_RANGE_START&&e.status<=Bi.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${s}`);return}throw jd(e.error,e.error_description,e.suberror)?new cn(e.error,e.error_description,e.suberror,e.timestamp||R.EMPTY_STRING,e.trace_id||R.EMPTY_STRING,e.correlation_id||R.EMPTY_STRING,e.claims||R.EMPTY_STRING,i):s}}async handleServerTokenResponse(e,t,r,o,i,s,a,c,l){var C;(C=this.performanceClient)==null||C.addQueueMeasurement(_.HandleServerTokenResponse,e.correlation_id);let u;if(e.id_token){if(u=qr(e.id_token||R.EMPTY_STRING,this.cryptoObj.base64Decode),i&&i.nonce&&u.nonce!==i.nonce)throw H(xg);if(o.maxAge||o.maxAge===0){const p=u.auth_time;if(!p)throw H(ll);Gg(p,o.maxAge)}}this.homeAccountIdentifier=rt.generateHomeAccountId(e.client_info||R.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,u);let d;i&&i.state&&(d=nn.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0;const h=this.generateCacheRecord(e,t,r,o,u,s,i);let f;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),f=new cb(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(f)),a&&!c&&h.account){const p=h.account.generateAccountKey();if(!this.cacheStorage.getAccount(p,o.correlationId,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Hr.generateAuthenticationResult(this.cryptoObj,t,h,!1,o,u,d,void 0,l)}await this.cacheStorage.saveCacheRecord(h,o.correlationId,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&f&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(f))}return Hr.generateAuthenticationResult(this.cryptoObj,t,h,!1,o,u,d,e,l)}generateCacheRecord(e,t,r,o,i,s,a){const c=t.getPreferredCache();if(!c)throw H(dl);const l=ap(i);let u,d;e.id_token&&i&&(u=Js(this.homeAccountIdentifier,c,e.id_token,this.clientId,l||""),d=Rl(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,i,e.client_info,c,l,a,void 0,this.logger));let h=null;if(e.access_token){const p=e.scope?Ye.fromString(e.scope):new Ye(o.scopes||[]),v=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,E=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,b=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,y=r+v,T=y+E,N=b&&b>0?r+b:void 0;h=Xs(this.homeAccountIdentifier,c,e.access_token,this.clientId,l||t.tenant||"",p.printScopes(),y,T,this.cryptoObj.base64Decode,N,e.token_type,s,e.key_id,o.claims,o.requestedClaimsHash)}let f=null;if(e.refresh_token){let p;if(e.refresh_token_expires_in){const v=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;p=r+v}f=Vg(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,p)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:c,familyId:e.foci}),{account:d,idToken:u,accessToken:h,refreshToken:f,appMetadata:C}}static async generateAuthenticationResult(e,t,r,o,i,s,a,c,l){var y,T,N,z,B;let u=R.EMPTY_STRING,d=[],h=null,f,C,p=R.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===Ne.POP&&!i.popKid){const F=new Io(e),{secret:O,keyId:Q}=r.accessToken;if(!Q)throw H(hl);u=await F.signPopToken(O,Q,i)}else u=r.accessToken.secret;d=Ye.fromString(r.accessToken.target).asArray(),h=new Date(Number(r.accessToken.expiresOn)*1e3),f=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(C=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(p=r.appMetadata.familyId===ei?ei:"");const v=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",E=(s==null?void 0:s.tid)||"";c!=null&&c.spa_accountid&&r.account&&(r.account.nativeAccountId=c==null?void 0:c.spa_accountid);const b=r.account?Al(r.account.getAccountInfo(),void 0,s,(y=r.idToken)==null?void 0:y.secret):null;return{authority:t.canonicalAuthority,uniqueId:v,tenantId:E,scopes:d,account:b,idToken:((T=r==null?void 0:r.idToken)==null?void 0:T.secret)||"",idTokenClaims:s||{},accessToken:u,fromCache:o,expiresOn:h,extExpiresOn:f,refreshOn:C,correlationId:i.correlationId,requestId:l||R.EMPTY_STRING,familyId:p,tokenType:((N=r.accessToken)==null?void 0:N.tokenType)||R.EMPTY_STRING,state:a?a.userRequestState:R.EMPTY_STRING,cloudGraphHostName:((z=r.account)==null?void 0:z.cloudGraphHostName)||R.EMPTY_STRING,msGraphHost:((B=r.account)==null?void 0:B.msGraphHost)||R.EMPTY_STRING,code:c==null?void 0:c.spa_code,fromNativeBroker:!1}}}function Rl(n,e,t,r,o,i,s,a,c,l,u,d){d==null||d.verbose("setCachedAccount called");const f=n.getAccountKeys().find(b=>b.startsWith(t));let C=null;f&&(C=n.getAccount(f,o,d));const p=C||rt.createAccount({homeAccountId:t,idTokenClaims:i,clientInfo:s,environment:a,cloudGraphHostName:l==null?void 0:l.cloud_graph_host_name,msGraphHost:l==null?void 0:l.msgraph_host,nativeAccountId:u},e,r),v=p.tenantProfiles||[],E=c||p.realm;if(E&&!v.find(b=>b.tenantId===E)){const b=Tl(t,p.localAccountId,E,i);v.push(b)}return p.tenantProfiles=v,p}/*! @azure/msal-common v14.16.1 2025-08-05 */async function yp(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.1 2025-08-05 */class Cp extends Il{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(_.GetAuthCodeUrl,e.correlationId);const t=await q(this.createAuthCodeUrlQueryString.bind(this),_.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return ve.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var a,c;if((a=this.performanceClient)==null||a.addQueueMeasurement(_.AuthClientAcquireToken,e.correlationId),!e.code)throw H(Ug);const r=bn(),o=await q(this.executeTokenRequest.bind(this),_.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),i=(c=o.headers)==null?void 0:c[bt.X_MS_REQUEST_ID],s=new Hr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(o.body),q(s.handleServerTokenResponse.bind(s),_.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,i)}handleFragmentResponse(e,t){if(new Hr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw H(qg);return e}getLogoutUri(e){if(!e)throw xe(Zg);const t=this.createLogoutUrlQueryString(e);return ve.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var l,u;(l=this.performanceClient)==null||l.addQueueMeasurement(_.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=ve.appendQueryString(e.tokenEndpoint,r),i=await q(this.createTokenRequestBody.bind(this),_.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let s;if(t.clientInfo)try{const d=ys(t.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${d.uid}${yt.CLIENT_INFO_SEPARATOR}${d.utid}`,type:qt.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(s||t.ccsCredential),c={clientId:((u=t.tokenBodyParameters)==null?void 0:u.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return q(this.executePostToTokenEndpoint.bind(this),_.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,i,a,c,t.correlationId,_.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(_.AuthClientCreateTokenRequestBody,e.correlationId);const t=new ni(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Ur])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):Jr.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Cc(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await yp(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(s.assertionType)}if(t.addGrantType(Ig.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Ne.POP){const s=new Io(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await q(s.generateCnf.bind(s),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(a)}else if(e.authenticationScheme===Ne.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw xe(Zs);(!tn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const s=ys(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${yt.CLIENT_INFO_SEPARATOR}${s.utid}`,type:qt.HOME_ACCOUNT_ID}}catch(s){this.logger.verbose("Could not parse client info for CCS Header: "+s)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case qt.HOME_ACCOUNT_ID:try{const s=no(r.credential);t.addCcsOid(s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case qt.UPN:t.addCcsUpn(r.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Kd])&&t.addExtraQueryParameters({[Kd]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var i,s;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(i=this.performanceClient)==null||i.addQueueMeasurement(_.AuthClientCreateQueryString,t);const r=new ni(t,this.performanceClient);r.addClientId(e.embeddedClientId||((s=e.extraQueryParameters)==null?void 0:s[Ur])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(t),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),Cc(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==at.SELECT_ACCOUNT)if(e.sid&&e.prompt===at.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const a=this.extractAccountSid(e.account);let c=this.extractLoginHint(e.account);if(c&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),c=null),c){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(c);try{const l=no(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===at.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(a);try{const l=no(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const l=no(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Ne.POP)){const a=new Io(this.cryptoUtils);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await q(a.generateCnf.bind(a),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(c)}return r.createQueryString()}createLogoutUrlQueryString(e){const t=new ni(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.1 2025-08-05 */const ub=300;class Ac extends Il{constructor(e,t){super(e,t)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(_.RefreshTokenClientAcquireToken,e.correlationId);const t=bn(),r=await q(this.executeTokenRequest.bind(this),_.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(a=r.headers)==null?void 0:a[bt.X_MS_REQUEST_ID],i=new Hr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return i.validateTokenResponse(r.body),q(i.handleServerTokenResponse.bind(i),_.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw xe(Xg);if((r=this.performanceClient)==null||r.addQueueMeasurement(_.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw H(ul);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await q(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const i=o instanceof cn&&o.errorCode===As,s=o instanceof fr&&o.errorCode===Sd.INVALID_GRANT_ERROR&&o.subError===Sd.CLIENT_MISMATCH_ERROR;if(i||s)return q(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return q(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=$r(this.cacheManager.getRefreshToken.bind(this.cacheManager),_.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,e.correlationId,void 0,this.performanceClient);if(!r)throw Tc(As);if(r.expiresOn&&yc(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||ub))throw Tc(Sl);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||Ne.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:qt.HOME_ACCOUNT_ID}};try{return await q(this.acquireToken.bind(this),_.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(s){if(s instanceof cn&&s.subError===na){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const a=to(r);this.cacheManager.removeRefreshToken(a,e.correlationId)}throw s}}async executeTokenRequest(e,t){var c,l;(c=this.performanceClient)==null||c.addQueueMeasurement(_.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=ve.appendQueryString(t.tokenEndpoint,r),i=await q(this.createTokenRequestBody.bind(this),_.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:((l=e.tokenBodyParameters)==null?void 0:l.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return q(this.executePostToTokenEndpoint.bind(this),_.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,i,s,a,e.correlationId,_.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i,s;(o=this.performanceClient)==null||o.addQueueMeasurement(_.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new ni(t,this.performanceClient);if(r.addClientId(e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Ur])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(s=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:s.defaultScopes),r.addGrantType(Ig.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Cc(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await yp(a.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(a.assertionType)}if(e.authenticationScheme===Ne.POP){const a=new Io(this.cryptoUtils,this.performanceClient);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await q(a.generateCnf.bind(a),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(c)}else if(e.authenticationScheme===Ne.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw xe(Zs);if((!tn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case qt.HOME_ACCOUNT_ID:try{const a=no(e.ccsCredential.credential);r.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case qt.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.1 2025-08-05 */class db extends Il{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...Po]});return o===er.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Ac(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof Ys&&r.errorCode===Fn)return new Ac(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var c;(c=this.performanceClient)==null||c.addQueueMeasurement(_.SilentFlowClientAcquireCachedToken,e.correlationId);let t=er.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!tn.isEmptyObj(e.claims))throw this.setCacheOutcome(er.FORCE_REFRESH_OR_CLAIMS,e.correlationId),H(Fn);if(!e.account)throw H(ul);const r=e.account.tenantId||eb(e.authority),o=this.cacheManager.getTokenKeys(),i=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient);if(i){if(Bw(i.cachedAt)||yc(i.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(er.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),H(Fn);i.refreshOn&&yc(i.refreshOn,0)&&(t=er.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(er.NO_CACHED_ACCESS_TOKEN,e.correlationId),H(Fn);const s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account,e.correlationId),accessToken:i,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await q(this.generateResultFromCacheRecord.bind(this),_.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==er.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(_.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=qr(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw H(ll);Gg(i,t.maxAge)}return Hr.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v14.16.1 2025-08-05 */const hb={sendGetRequestAsync:()=>Promise.reject(H(ge)),sendPostRequestAsync:()=>Promise.reject(H(ge))};/*! @azure/msal-common v14.16.1 2025-08-05 */const Gd=",",vp="|";function fb(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:i}=n,s=new Map([[0,[t,r]],[2,[o,i]]]);let a=[];if(e!=null&&e.length){if(a=e.split(Gd),a.length<4)return e}else a=Array.from({length:4},()=>vp);return s.forEach((c,l)=>{var u,d;c.length===2&&((u=c[0])!=null&&u.length)&&((d=c[1])!=null&&d.length)&&gb({skuArr:a,index:l,skuName:c[0],skuVersion:c[1]})}),a.join(Gd)}function gb(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(vp))}class gi{constructor(e,t){this.cacheOutcome=er.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||R.EMPTY_STRING,this.wrapperVer=e.wrapperVer||R.EMPTY_STRING,this.telemetryCacheKey=ut.CACHE_KEY+yt.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${ut.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(ut.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),s=[e,i].join(ut.VALUE_SEPARATOR);return[ut.SCHEMA_VERSION,s,o].join(ut.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=gi.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(ut.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(ut.VALUE_SEPARATOR),i=e.errors.length,s=t=ut.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Fe?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(ut.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=gi.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let t,r=0,o=0;const i=e.errors.length;for(t=0;tnull,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:Z_.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new zd}}startPerformanceMeasurement(){return new zd}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Pl="pkce_not_created",Ec="crypto_nonexistent",ra="empty_navigate_uri",Ep="hash_empty_error",Nl="no_state_in_hash",wp="hash_does_not_contain_known_properties",_p="unable_to_parse_state",bp="state_interaction_type_mismatch",Ip="interaction_in_progress",Sp="popup_window_error",Rp="empty_window_error",Fr="user_cancelled",yb="monitor_popup_timeout",kp="monitor_window_timeout",Op="redirect_in_iframe",Pp="block_iframe_reload",Np="block_nested_popups",Cb="iframe_closed_prematurely",oa="silent_logout_unsupported",Mp="no_account_error",vb="silent_prompt_value_error",xp="no_token_request_cache_error",Dp="unable_to_parse_token_request_cache_error",Ml="no_cached_authority_error",Tb="auth_request_not_set_error",Ab="invalid_cache_type",ia="non_browser_environment",Xr="database_not_open",Es="no_network_connectivity",Lp="post_request_failed",Up="get_request_failed",wc="failed_to_parse_response",Hp="unable_to_load_token",xl="crypto_key_not_found",Fp="auth_code_required",Bp="auth_code_or_nativeAccountId_required",Kp="spa_code_and_nativeAccountId_present",Dl="database_unavailable",qp="unable_to_acquire_token_from_native_platform",$p="native_handshake_timeout",jp="native_extension_not_installed",Oi="native_connection_not_established",Gp="uninitialized_public_client_application",Vp="native_prompt_not_supported",zp="invalid_base64_string",Qp="invalid_pop_token_request",Wp="failed_to_build_headers",Yp="failed_to_parse_headers";/*! @azure/msal-browser v3.30.0 2025-08-05 */const On="For more visit: aka.ms/msaljs/browser-errors",Eb={[Pl]:"The PKCE code challenge and verifier could not be generated.",[Ec]:"The crypto object or function is not available.",[ra]:"Navigation URI is empty. Please check stack trace for more info.",[Ep]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${On}`,[Nl]:"Hash does not contain state. Please verify that the request originated from msal.",[wp]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${On}`,[_p]:"Unable to parse state. Please verify that the request originated from msal.",[bp]:"Hash contains state but the interaction type does not match the caller.",[Ip]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${On}`,[Sp]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Rp]:"window.open returned null or undefined window object.",[Fr]:"User cancelled the flow.",[yb]:`Token acquisition in popup failed due to timeout. ${On}`,[kp]:`Token acquisition in iframe failed due to timeout. ${On}`,[Op]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Pp]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${On}`,[Np]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[Cb]:"The iframe being monitored was closed prematurely.",[oa]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Mp]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[vb]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[xp]:"No token request found in cache.",[Dp]:"The cached token request could not be parsed.",[Ml]:"No cached authority found.",[Tb]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[Ab]:"Invalid cache type",[ia]:"Login and token requests are not supported in non-browser environments.",[Xr]:"Database is not open!",[Es]:"No network connectivity. Check your internet connection.",[Lp]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[Up]:"Network request failed. Please check the network trace to determine root cause.",[wc]:"Failed to parse network response. Check network trace.",[Hp]:"Error loading token to cache.",[xl]:"Cryptographic Key or Keypair not found in browser storage.",[Fp]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[Bp]:"An authorization code or nativeAccountId must be provided to this flow.",[Kp]:"Request cannot contain both spa code and native account id.",[Dl]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[qp]:`Unable to acquire token from native platform. ${On}`,[$p]:"Timed out while attempting to establish connection to browser extension",[jp]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Oi]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${On}`,[Gp]:`You must call and await the initialize function before attempting to call any other MSAL API. ${On}`,[Vp]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[zp]:"Invalid base64 encoded string.",[Qp]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[Wp]:"Failed to build request headers object.",[Yp]:"Failed to parse response headers"};class Pi extends Fe{constructor(e,t){super(e,Eb[e],t),Object.setPrototypeOf(this,Pi.prototype),this.name="BrowserAuthError"}}function Y(n,e){return new Pi(n,e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Bt={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ro={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},br={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Ot={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},Qd={GET:"GET",POST:"POST"},ke={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},zt={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys",VERSION:"msal.version"},Gi={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},He={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var ee;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(ee||(ee={}));const Wd={scopes:Po},Jp="jwk",_c="msal.db",wb=1,_b=`${_c}.keys`,Lt={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},bb=[Lt.Default,Lt.Skip,Lt.RefreshTokenAndNetwork],Ib="msal.browser.log.level",Sb="msal.browser.log.pii";/*! @azure/msal-browser v3.30.0 2025-08-05 */function Vi(n){return encodeURIComponent(Ll(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function sa(n){return Xp(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ll(n){return Xp(new TextEncoder().encode(n))}function Xp(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Rb="RSASSA-PKCS1-v1_5",Zp="SHA-256",kb=2048,Ob=new Uint8Array([1,0,1]),Yd="0123456789abcdef",Jd=new Uint32Array(1),Pb="crypto_subtle_undefined",Ul={name:Rb,hash:Zp,modulusLength:kb,publicExponent:Ob};function Nb(n){if(!window)throw Y(ia);if(!window.crypto)throw Y(Ec);if(!n&&!window.crypto.subtle)throw Y(Ec,Pb)}async function em(n,e,t){e==null||e.addQueueMeasurement(_.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(Zp,o)}function Mb(n){return window.crypto.getRandomValues(n)}function Ma(){return window.crypto.getRandomValues(Jd),Jd[0]}function In(){const n=Date.now(),e=Ma()*1024+(Ma()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,i=Ma();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=i>>>24,t[13]=i>>>16,t[14]=i>>>8,t[15]=i;let s="";for(let a=0;a>>4),s+=Yd.charAt(t[a]&15),(a===3||a===5||a===7||a===9)&&(s+="-");return s}async function xb(n,e){return window.crypto.subtle.generateKey(Ul,n,e)}async function xa(n){return window.crypto.subtle.exportKey(Jp,n)}async function Db(n,e,t){return window.crypto.subtle.importKey(Jp,n,Ul,e,t)}async function Lb(n,e){return window.crypto.subtle.sign(Ul,n,e)}async function tm(n){const e=await em(n),t=new Uint8Array(e);return sa(t)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Hl="storage_not_supported",Ub="stubbed_public_client_application_called",nm="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.30.0 2025-08-05 */const Hb={[Hl]:"Given storage configuration option was not supported.",[Ub]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[nm]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};class Fl extends Fe{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Fl.prototype)}}function Bl(n){return new Fl(n,Hb[n])}/*! @azure/msal-browser v3.30.0 2025-08-05 */function Fb(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function Bb(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Kl(){return window.parent!==window}function Kb(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Bt.POPUP_NAME_PREFIX}.`)===0}function Bn(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function qb(){const e=new ve(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function $b(){if(ve.hashContainsKnownProperties(window.location.hash)&&Kl())throw Y(Pp)}function jb(n){if(Kl()&&!n)throw Y(Op)}function Gb(){if(Kb())throw Y(Np)}function rm(){if(typeof window>"u")throw Y(ia)}function om(n){if(!n)throw Y(Gp)}function ql(n){rm(),$b(),Gb(),om(n)}function Xd(n,e){if(ql(n),jb(e.system.allowRedirectInIframe),e.cache.cacheLocation===Ot.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Bl(nm)}function im(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function Vb(){return In()}/*! @azure/msal-browser v3.30.0 2025-08-05 */class ws{navigateInternal(e,t){return ws.defaultNavigateWindow(e,t)}navigateExternal(e,t){return ws.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class zb{async sendGetRequestAsync(e,t){let r,o={},i=0;const s=Zd(t);try{r=await fetch(e,{method:Qd.GET,headers:s})}catch{throw Y(window.navigator.onLine?Up:Es)}o=eh(r.headers);try{return i=r.status,{headers:o,body:await r.json(),status:i}}catch{throw qd(Y(wc),i,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=Zd(t);let i,s=0,a={};try{i=await fetch(e,{method:Qd.POST,headers:o,body:r})}catch{throw Y(window.navigator.onLine?Lp:Es)}a=eh(i.headers);try{return s=i.status,{headers:a,body:await i.json(),status:s}}catch{throw qd(Y(wc),s,a)}}}function Zd(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw Y(Wp)}}function eh(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw Y(Yp)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Qb=6e4,bc=1e4,Wb=3e4,Yb=2e3;function Jb({auth:n,cache:e,system:t,telemetry:r},o){const i={clientId:R.EMPTY_STRING,authority:`${R.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:R.EMPTY_STRING,authorityMetadata:R.EMPTY_STRING,redirectUri:typeof window<"u"?Bn():"",postLogoutRedirectUri:R.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:qn.AAD,OIDCOptions:{serverResponseType:ki.FRAGMENT,defaultScopes:[R.OPENID_SCOPE,R.PROFILE_SCOPE,R.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:gl.None,tenant:R.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},s={cacheLocation:Ot.SessionStorage,temporaryCacheLocation:Ot.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Ot.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:Ke.Info,piiLoggingEnabled:!1},l={...{...hp,loggerOptions:a,networkClient:o?new zb:hb,navigationClient:new ws,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||Qb,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||bc,navigateFrameWait:0,redirectNavigationTimeout:Wb,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||Yb,pollIntervalMilliseconds:Bt.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||a},u={application:{appName:R.EMPTY_STRING,appVersion:R.EMPTY_STRING},client:new mb};if((n==null?void 0:n.protocolMode)!==qn.OIDC&&(n!=null&&n.OIDCOptions)&&new hr(l.loggerOptions).warning(JSON.stringify(xe(op))),n!=null&&n.protocolMode&&n.protocolMode!==qn.AAD&&(l!=null&&l.allowNativeBroker))throw xe(ip);return{auth:{...i,...n,OIDCOptions:{...i.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...s,...e},system:l,telemetry:{...u,...r}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Xb="@azure/msal-browser",So="3.30.0";/*! @azure/msal-browser v3.30.0 2025-08-05 */class $l{static loggerCallback(e,t){switch(e){case Ke.Error:console.error(t);return;case Ke.Info:console.info(t);return;case Ke.Verbose:console.debug(t);return;case Ke.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var c;this.browserEnvironment=typeof window<"u",this.config=Jb(e,this.browserEnvironment);let t;try{t=window[Ot.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(Ib),o=(c=t==null?void 0:t.getItem(Sb))==null?void 0:c.toLowerCase(),i=o==="true"?!0:o==="false"?!1:void 0,s={...this.config.system.loggerOptions},a=r&&Object.keys(Ke).includes(r)?Ke[r]:void 0;a&&(s.loggerCallback=$l.loggerCallback,s.logLevel=a),i!==void 0&&(s.piiLoggingEnabled=i),this.logger=new hr(s,Xb,So),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Br extends $l{getModuleName(){return Br.MODULE_NAME}getId(){return Br.ID}async initialize(){return this.available=typeof window<"u",this.available}}Br.MODULE_NAME="";Br.ID="StandardOperatingContext";/*! @azure/msal-browser v3.30.0 2025-08-05 */function _n(n){return new TextDecoder().decode(Zb(n))}function Zb(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Y(zp)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class eI{constructor(){this.dbName=_c,this.version=wb,this.tableName=_b,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const i=o;this.db=i.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(Y(Dl)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(Y(Xr));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),t(c.target.result)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(Y(Xr));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);a.addEventListener("success",()=>{this.closeConnection(),r()}),a.addEventListener("error",c=>{this.closeConnection(),o(c)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(Y(Xr));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),t()}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(Y(Xr));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",s=>{const a=s;this.closeConnection(),e(a.target.result)}),i.addEventListener("error",s=>{this.closeConnection(),t(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(Y(Xr));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),t(c.target.result===1)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(_c),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Ic{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class tI{constructor(e){this.inMemoryCache=new Ic,this.indexedDBCache=new eI,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Pi&&e.errorCode===Dl)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Ro{constructor(e,t,r){this.logger=e,Nb(r??!1),this.cache=new tI(this.logger),this.performanceClient=t}createNewGuid(){return In()}base64Encode(e){return Ll(e)}base64Decode(e){return _n(e)}base64UrlEncode(e){return Vi(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var u;const t=(u=this.performanceClient)==null?void 0:u.startMeasurement(_.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await xb(Ro.EXTRACTABLE,Ro.POP_KEY_USAGES),o=await xa(r.publicKey),i={e:o.e,kty:o.kty,n:o.n},s=th(i),a=await this.hashString(s),c=await xa(r.privateKey),l=await Db(c,!1,["sign"]);return await this.cache.setItem(a,{privateKey:l,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),a}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var y;const i=(y=this.performanceClient)==null?void 0:y.startMeasurement(_.CryptoOptsSignJwt,o),s=await this.cache.getItem(t);if(!s)throw Y(xl);const a=await xa(s.publicKey),c=th(a),l=Vi(JSON.stringify({kid:t})),u=Ol.getShrHeaderString({...r==null?void 0:r.header,alg:a.alg,kid:l}),d=Vi(u);e.cnf={jwk:JSON.parse(c)};const h=Vi(JSON.stringify(e)),f=`${d}.${h}`,p=new TextEncoder().encode(f),v=await Lb(s.privateKey,p),E=sa(new Uint8Array(v)),b=`${f}.${E}`;return i&&i.end({success:!0}),b}async hashString(e){return tm(e)}}Ro.POP_KEY_USAGES=["sign","verify"];Ro.EXTRACTABLE=!0;function th(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.30.0 2025-08-05 */class nI{constructor(){if(!window.localStorage)throw Bl(Hl)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class rI{constructor(){if(!window.sessionStorage)throw Bl(Hl)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function sm(n,e){if(!e)return null;try{return nn.parseRequestState(n,e).libraryState.meta}catch{throw H(_o)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const oI=24*60*60*1e3;class iI{getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function sI(n){const e=new Date;return new Date(e.getTime()+n*oI).toUTCString()}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Sc extends bo{constructor(e,t,r,o,i,s){super(e,r,o,i),this.cacheConfig=t,this.logger=o,this.internalStorage=new Ic,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new iI,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=s}setupBrowserStorage(e){try{switch(e){case Ot.LocalStorage:return new nI;case Ot.SessionStorage:return new rI;case Ot.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=Ot.MemoryStorage,new Ic}migrateCacheEntries(){const e=this.browserStorage.getItem(zt.VERSION);e&&this.logger.info(`MSAL.js was last initialized with version ${e}`),e!==So&&this.browserStorage.setItem(zt.VERSION,So);const t=`${R.CACHE_PREFIX}.${it.ID_TOKEN}`,r=`${R.CACHE_PREFIX}.${it.CLIENT_INFO}`,o=`${R.CACHE_PREFIX}.${it.ERROR}`,i=`${R.CACHE_PREFIX}.${it.ERROR_DESC}`,s=this.browserStorage.getItem(t),a=this.browserStorage.getItem(r),c=this.browserStorage.getItem(o),l=this.browserStorage.getItem(i),u=[s,a,c,l];[it.ID_TOKEN,it.CLIENT_INFO,it.ERROR,it.ERROR_DESC].forEach((h,f)=>{const C=u[f];C&&this.setTemporaryCache(h,C,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.cryptoImpl.createNewGuid(),t=this.getItem(zt.ACCOUNT_KEYS),r=this.getItem(`${zt.TOKEN_KEYS}.${this.clientId}`);if(t&&r){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(i=>{if(this.isCredentialKey(i)){const s=this.getItem(i);if(s){const a=this.validateAndParseJson(s);if(a&&a.hasOwnProperty("credentialType"))switch(a.credentialType){case ae.ID_TOKEN:if(Nd(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,ae.ID_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${i}`);break;case ae.ACCESS_TOKEN:case ae.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Pd(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,ae.ACCESS_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${i}`);break;case ae.REFRESH_TOKEN:if(Md(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,ae.REFRESH_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${i}`);break}}}if(this.isAccountKey(i)){const s=this.getItem(i);if(s){const a=this.validateAndParseJson(s);a&&rt.isAccountEntity(a)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${i} found, saving key to account key map`),this.addAccountKeyToMap(i,e))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t,r){let o=[];for(let s=0;s<=20;s++)try{this.browserStorage.setItem(e,t),s>0&&this.removeAccessTokenKeys(o.slice(0,s),r);break}catch(a){const c=dp(a);if(c.errorCode===wl&&s<20){if(o.length||(e===`${zt.TOKEN_KEYS}.${this.clientId}`?o=JSON.parse(t).accessToken:o=this.getTokenKeys().accessToken),o.length<=s)throw c;this.removeAccessToken(o[s],r,!1)}else throw c}}getAccount(e,t,r){this.logger.trace("BrowserCacheManager.getAccount called");const o=this.getCachedAccountEntity(e,t);return this.updateOutdatedCachedAccount(e,o,t,r)}getCachedAccountEntity(e,t){const r=this.getItem(e);if(!r)return this.removeAccountKeyFromMap(e,t),null;const o=this.validateAndParseJson(r);return!o||!rt.isAccountEntity(o)?null:bo.toObject(new rt,o)}setAccount(e,t){this.logger.trace("BrowserCacheManager.setAccount called");const r=e.generateAccountKey();e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),t),this.addAccountKeyToMap(r,t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(zt.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e,t){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const r=this.getAccountKeys();r.indexOf(e)===-1?(r.push(e),this.setItem(zt.ACCOUNT_KEYS,JSON.stringify(r),t),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e,t){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const r=this.getAccountKeys(),o=r.indexOf(e);if(o>-1){if(r.splice(o,1),r.length===0){this.removeItem(zt.ACCOUNT_KEYS);return}else this.setItem(zt.ACCOUNT_KEYS,JSON.stringify(r),t);this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e,t){super.removeAccount(e,t),this.removeAccountKeyFromMap(e,t)}removeOutdatedAccount(e,t){this.removeItem(e),this.removeAccountKeyFromMap(e,t)}removeIdToken(e,t){super.removeIdToken(e,t),this.removeTokenKey(e,ae.ID_TOKEN,t)}removeAccessToken(e,t,r=!0){var o;super.removeAccessToken(e,t),(o=this.performanceClient)==null||o.incrementFields({accessTokensRemoved:1},t),r&&this.removeTokenKey(e,ae.ACCESS_TOKEN,t)}removeAccessTokenKeys(e,t){this.logger.trace("removeAccessTokenKey called");const r=this.getTokenKeys();let o=0;if(e.forEach(i=>{const s=r.accessToken.indexOf(i);s>-1&&(r.accessToken.splice(s,1),o++)}),o>0){this.logger.info(`removed ${o} accessToken keys from tokenKeys map`),this.setTokenKeys(r,t);return}}removeRefreshToken(e,t){super.removeRefreshToken(e,t),this.removeTokenKey(e,ae.REFRESH_TOKEN,t)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${zt.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}setTokenKeys(e,t){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(`${zt.TOKEN_KEYS}.${this.clientId}`);return}else this.setItem(`${zt.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(e),t)}addTokenKey(e,t,r){this.logger.trace("BrowserCacheManager addTokenKey called");const o=this.getTokenKeys();switch(t){case ae.ID_TOKEN:o.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),o.idToken.push(e));break;case ae.ACCESS_TOKEN:const i=o.accessToken.indexOf(e);i!==-1&&o.accessToken.splice(i,1),this.logger.trace(`access token ${i===-1?"added to":"updated in"} map`),o.accessToken.push(e);break;case ae.REFRESH_TOKEN:o.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),o.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),H(mc)}this.setTokenKeys(o,r)}removeTokenKey(e,t,r,o=this.getTokenKeys()){switch(this.logger.trace("BrowserCacheManager removeTokenKey called"),t){case ae.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const i=o.idToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),o.idToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ae.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const s=o.accessToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),o.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ae.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const a=o.refreshToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),o.refreshToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),H(mc)}this.setTokenKeys(o,r)}getIdTokenCredential(e,t){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,t),null;const o=this.validateAndParseJson(r);return!o||!Nd(o)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),o)}setIdTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=to(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),t),this.addTokenKey(r,ae.ID_TOKEN,t)}getAccessTokenCredential(e,t){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ae.ACCESS_TOKEN,t),null;const o=this.validateAndParseJson(r);return!o||!Pd(o)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),o)}setAccessTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=to(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),t),this.addTokenKey(r,ae.ACCESS_TOKEN,t)}getRefreshTokenCredential(e,t){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ae.REFRESH_TOKEN,t),null;const o=this.validateAndParseJson(r);return!o||!Md(o)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),o)}setRefreshTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=to(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),t),this.addTokenKey(r,ae.REFRESH_TOKEN,t)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Ww(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,t){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=Qw(e);this.setItem(r,JSON.stringify(e),t)}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Vw(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t),r)}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&Yw(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Gi.WRAPPER_SKU,e),this.internalStorage.setItem(Gi.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Gi.WRAPPER_SKU)||R.EMPTY_STRING,t=this.internalStorage.getItem(Gi.WRAPPER_VER)||R.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(e){const t=this.generateCacheKey(it.ACTIVE_ACCOUNT_FILTERS),r=this.getItem(t);if(!r){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const i=this.generateCacheKey(it.ACTIVE_ACCOUNT),s=this.getItem(i);if(!s)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const a=this.getAccountInfoFilteredBy({localAccountId:s},e);return a?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(a,e),a):null}const o=this.validateAndParseJson(r);return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:o.homeAccountId,localAccountId:o.localAccountId,tenantId:o.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,t){const r=this.generateCacheKey(it.ACTIVE_ACCOUNT_FILTERS),o=this.generateCacheKey(it.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:Date.now().toString()};this.setItem(r,JSON.stringify(i),t),this.setItem(o,e.localAccountId,t)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r),this.browserStorage.removeItem(o)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!zw(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t),r)}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const i=this.cookieStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),i}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Ot.LocalStorage){const i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(e){await this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(t=>{(t.indexOf(R.CACHE_PREFIX)!==-1||t.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(t)}),this.browserStorage.getKeys().forEach(t=>{(t.indexOf(R.CACHE_PREFIX)!==-1||t.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(t)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(_.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys();let o=0;r.accessToken.forEach(i=>{const s=this.getAccessTokenCredential(i,t);s!=null&&s.requestedClaimsHash&&i.includes(s.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(i,t),o++)}),o>0&&this.logger.warning(`${o} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):tn.startsWith(e,R.CACHE_PREFIX)||tn.startsWith(e,it.ADAL_ID_TOKEN)?e:`${R.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=nn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=nn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=nn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,t,r,o,i){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const s=this.generateStateKey(e);this.setTemporaryCache(s,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);const c=this.generateAuthorityKey(e);if(this.setTemporaryCache(c,r,!1),i){const l={credential:i.homeAccountId,type:qt.HOME_ACCOUNT_ID};this.setTemporaryCache(ke.CCS_CREDENTIAL,JSON.stringify(l),!0)}else if(o){const l={credential:o,type:qt.UPN};this.setTemporaryCache(ke.CCS_CREDENTIAL,JSON.stringify(l),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(ke.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(ke.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(ke.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(ke.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(ke.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(ke.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||R.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(ke.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const o=sm(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=Ll(JSON.stringify(e));this.setTemporaryCache(ke.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(ke.REQUEST_PARAMS,!0);if(!t)throw Y(xp);let r;try{r=JSON.parse(_n(t))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),Y(Dp)}if(this.removeTemporaryItem(this.generateCacheKey(ke.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),i=this.getTemporaryCache(o);if(!i)throw Y(Ml);r.authority=i}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(ke.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${R.CACHE_PREFIX}.${ke.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${R.CACHE_PREFIX}.${ke.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw Y(Ip);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(it.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(it.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(it.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(it.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const o=qr(r,_n);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t,r){const o=to(t);if(e!==o){const i=this.getItem(e);if(i)return this.browserStorage.removeItem(e),this.setItem(o,i,r),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),o;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){var a,c,l;const r=Js((a=e.account)==null?void 0:a.homeAccountId,(c=e.account)==null?void 0:c.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const i=Xs((l=e.account)==null?void 0:l.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,_n,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),s={idToken:r,accessToken:i};return this.saveCacheRecord(s,e.correlationId)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof co&&this.performanceClient&&t)try{const i=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:i.refreshToken.length,cacheIdCount:i.idToken.length,cacheAtCount:i.accessToken.length},t)}catch{}throw o}}}const aI=(n,e)=>{const t={cacheLocation:Ot.MemoryStorage,temporaryCacheLocation:Ot.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new Sc(n,t,ms,e)};/*! @azure/msal-browser v3.30.0 2025-08-05 */function cI(n,e,t,r,o){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r,o):[]}function lI(n,e,t,r){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const o=t.getAccountInfoFilteredBy(n,r);return o?(e.verbose("getAccount: Account matching provided filter found, returning"),o):(e.verbose("getAccount: No matching account found, returning null"),null)}function uI(n,e,t,r){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const o=t.getAccountInfoFilteredBy({username:n},r);return o?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),o):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function dI(n,e,t,r){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const o=t.getAccountInfoFilteredBy({homeAccountId:n},r);return o?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),o):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function hI(n,e,t,r){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const o=t.getAccountInfoFilteredBy({localAccountId:n},r);return o?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),o):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function fI(n,e,t){e.setActiveAccount(n,t)}function gI(n,e){return n.getActiveAccount(e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const oe={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.30.0 2025-08-05 */class pI{constructor(e){this.eventCallbacks=new Map,this.logger=e||new hr({})}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||Vb();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){if(typeof window<"u"){const i={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([s,a],c)=>{(a.length===0||a.includes(e))&&(this.logger.verbose(`Emitting event to callback ${c}: ${e}`),s.apply(null,[i]))})}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class am{constructor(e,t,r,o,i,s,a,c,l){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=i,this.navigationClient=s,this.nativeMessageHandler=c,this.correlationId=l||In(),this.logger=o.clone(Bt.MSAL_SKU,So,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){rt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(this.correlationId),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null,this.correlationId));try{await this.browserStorage.removeAccount(rt.generateAccountCacheKey(e),this.correlationId),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(this.correlationId),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return ve.getAbsoluteUrl(t,Bn())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new gi(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(_.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e.requestAuthority||this.config.auth.authority,s=r!=null&&r.length?r==="true":this.config.auth.instanceAware,a=t&&s?this.config.auth.authority.replace(ve.getDomainFromUrl(i),t.environment):i,c=pt.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),l=await q(pp,_.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(c,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!l.isAlias(t.environment))throw xe(sp);return l}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const mI=32;async function yI(n,e,t){n.addQueueMeasurement(_.GeneratePkceCodes,t);const r=$r(CI,_.GenerateCodeVerifier,e,n,t)(n,e,t),o=await q(vI,_.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function CI(n,e,t){try{const r=new Uint8Array(mI);return $r(Mb,_.GetRandomValues,e,n,t)(r),sa(r)}catch{throw Y(Pl)}}async function vI(n,e,t,r){e.addQueueMeasurement(_.GenerateCodeChallengeFromVerifier,r);try{const o=await q(em,_.Sha256Digest,t,e,r)(n,e,r);return sa(new Uint8Array(o))}catch{throw Y(Pl)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function jl(n,e,t,r){t.addQueueMeasurement(_.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,i=[...n&&n.scopes||[]],s={...n,correlationId:n.correlationId,authority:o,scopes:i};if(!s.authenticationScheme)s.authenticationScheme=Ne.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(s.authenticationScheme===Ne.SSH){if(!n.sshJwk)throw xe(Zs);if(!n.sshKid)throw xe(rp)}r.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!tn.isEmptyObj(n.claims)&&(s.requestedClaimsHash=await tm(n.claims)),s}async function TI(n,e,t,r,o){r.addQueueMeasurement(_.InitializeSilentRequest,n.correlationId);const i=await q(jl,_.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...i,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class No extends am{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await q(yI,_.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:R.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=R.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||In(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=ve.getAbsoluteUrl(e.postLogoutRedirectUri,Bn())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=ve.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Bn())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=ve.getAbsoluteUrl(Bn(),Bn())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await q(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Cp(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}=e;this.performanceClient.addQueueMeasurement(_.StandardInteractionClientGetClientConfiguration,this.correlationId);const a=await q(this.getDiscoveredAuthority.bind(this),_.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}),c=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:c.loggerCallback,piiLoggingEnabled:c.piiLoggingEnabled,logLevel:c.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Bt.MSAL_SKU,version:So,cpu:R.EMPTY_STRING,os:R.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},i=nn.setRequestState(this.browserCrypto,e&&e.state||R.EMPTY_STRING,o),a={...await q(jl,_.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:i,nonce:e.nonce||In(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return a;const c=e.account||this.browserStorage.getActiveAccount(this.correlationId);if(c&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${c.homeAccountId}`,this.correlationId),a.account=c),!a.loginHint&&!c){const l=this.browserStorage.getLegacyLoginHint();l&&(a.loginHint=l)}return a}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const AI="ContentError",cm="user_switch";/*! @azure/msal-browser v3.30.0 2025-08-05 */const EI="USER_INTERACTION_REQUIRED",wI="USER_CANCEL",_I="NO_NETWORK",bI="PERSISTENT_ERROR",II="DISABLED",SI="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.30.0 2025-08-05 */const RI=-2147186943,kI={[cm]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class An extends Fe{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,An.prototype),this.name="NativeAuthError",this.ext=r}}function Zr(n){if(n.ext&&n.ext.status&&(n.ext.status===bI||n.ext.status===II)||n.ext&&n.ext.error&&n.ext.error===RI)return!0;switch(n.errorCode){case AI:return!0;default:return!1}}function Rc(n,e,t){if(t&&t.status)switch(t.status){case SI:return Tc(mp);case EI:return new cn(n,e);case wI:return Y(Fr);case _I:return Y(Es)}return new An(n,kI[n]||e,t)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class lm extends No{async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(He.acquireTokenSilent_silentFlow),r=await q(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new db(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const s=(await q(o.acquireCachedToken.bind(o),_.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),s}catch(i){throw i instanceof Pi&&i.errorCode===xl&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),i}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class lo extends am{constructor(e,t,r,o,i,s,a,c,l,u,d,h){var C;super(e,t,r,o,i,s,c,l,h),this.apiId=a,this.accountId=u,this.nativeMessageHandler=l,this.nativeStorageManager=d,this.silentCacheClient=new lm(e,this.nativeStorageManager,r,o,i,s,c,l,h),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const f=this.nativeMessageHandler.getExtensionId()===ro.PREFERRED_EXTENSION_ID?"chrome":(C=this.nativeMessageHandler.getExtensionId())!=null&&C.length?"unknown":void 0;this.skus=gi.makeExtraSkuString({libraryName:Bt.MSAL_SKU,libraryVersion:So,extensionName:f,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[Q_]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(_.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(_.NativeInteractionClientAcquireToken,e.correlationId),r=bn();try{const o=await this.initializeNativeRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,o);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...i}=o,s={method:br.GetToken,request:i},a=await this.nativeMessageHandler.sendMessage(s),c=this.validateNativeResponse(a);return await this.handleNativeResponse(c,o,r).then(l=>(t.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),l)).catch(l=>{throw t.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError,isNativeBroker:!0}),l})}catch(o){throw o instanceof An&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Ye.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),H(gc);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},t.correlationId);if(!r)throw H(gc);try{const o=this.createSilentCacheRequest(t,r),i=await this.silentCacheClient.acquireToken(o),s={...r,idTokenClaims:i==null?void 0:i.idTokenClaims,idToken:i==null?void 0:i.idToken};return{...i,account:s}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),i={method:br.GetToken,request:o};try{const c=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(c)}catch(c){if(c instanceof An&&(this.serverTelemetryManager.setNativeBrokerErrorCode(c.errorCode),Zr(c)))throw c}this.browserStorage.setTemporaryCache(ke.NATIVE_REQUEST,JSON.stringify(o),!0);const s={apiId:He.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(a,s)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...i}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ke.NATIVE_REQUEST));const s={method:br.GetToken,request:i},a=bn();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(c);const l=this.handleNativeResponse(c,i,a);this.browserStorage.setInteractionInProgress(!1);const u=await l;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),u}catch(c){throw this.browserStorage.setInteractionInProgress(!1),c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var u;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=qr(e.id_token,_n),i=this.createHomeAccountIdentifier(e,o),s=(u=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId},this.correlationId))==null?void 0:u.homeAccountId;if(i!==s&&e.account.id!==t.accountId)throw Rc(cm);const a=await this.getDiscoveredAuthority({requestAuthority:t.authority}),c=Rl(this.browserStorage,a,i,_n,this.correlationId,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),l=await this.generateAuthenticationResult(e,t,o,c,a.canonicalAuthority,r);return this.cacheAccount(c),this.cacheNativeTokens(e,t,i,o,e.access_token,l.tenantId,r),l}createHomeAccountIdentifier(e,t){return rt.generateHomeAccountId(e.client_info||R.EMPTY_STRING,Zt.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?Ye.fromString(e.scope):Ye.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Ne.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Io(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw H(hl);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,i,s){const a=this.addTelemetryFromNativeResponse(e),c=e.scope?Ye.fromString(e.scope):Ye.fromString(t.scope),l=e.account.properties||{},u=l.UID||r.oid||r.sub||R.EMPTY_STRING,d=l.TenantId||r.tid||R.EMPTY_STRING,h=Al(o.getAccountInfo(),void 0,r,e.id_token);h.nativeAccountId!==e.account.id&&(h.nativeAccountId=e.account.id);const f=await this.generatePopAccessToken(e,t),C=t.tokenType===Ne.POP?Ne.POP:Ne.BEARER;return{authority:i,uniqueId:u,tenantId:d,scopes:c.asArray(),account:h,idToken:e.id_token,idTokenClaims:r,accessToken:f,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:new Date(Number(s+e.expires_in)*1e3),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e,this.correlationId).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,i,s,a){const c=Js(r,t.authority,e.id_token||"",t.clientId,o.tid||""),l=t.tokenType===Ne.POP?R.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,u=a+l,d=this.generateScopes(e,t),h=Xs(r,t.authority,i,t.clientId,o.tid||s,d.printScopes(),u,0,_n,void 0,t.tokenType,void 0,t.keyId),f={idToken:c,accessToken:h};this.nativeStorageManager.saveCacheRecord(f,t.correlationId,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw Sg(sl,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new ve(t);r.validateAsUri();const{scopes:o,...i}=e,s=new Ye(o||[]);s.appendScopes(Po);const a=()=>{switch(this.apiId){case He.ssoSilent:case He.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),at.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case at.NONE:case at.CONSENT:case at.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),Y(Vp)}},c={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw Y(Qp);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=ro.MATS_TELEMETRY,e.authenticationScheme===Ne.POP){const l={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new Io(this.browserCrypto);let d;if(c.keyId)d=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const h=await q(u.generateCnf.bind(u),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(l,this.logger);d=h.reqCnfString,c.keyId=h.kid,c.signPopToken=!0}c.reqCnf=d}return this.addRequestSKUs(c),c}handleExtraBrokerParams(e){var i;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(bl)&&e.extraParameters.hasOwnProperty(vc)&&e.extraParameters.hasOwnProperty(Ur);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[vc],r=e.extraParameters[Ur]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(i=this.performanceClient)==null||i.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class En{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(_.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:ro.CHANNEL_ID,extensionId:this.extensionId,responseId:In(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new En(e,t,r,ro.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const i=new En(e,t,r);return await i.sendHandshakeRequest(),i}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ro.CHANNEL_ID,extensionId:this.extensionId,responseId:In(),body:{method:br.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(Y($p)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==ro.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===br.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(Y(jp))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const i=t.body.method;if(i===br.Response){if(!r)return;const s=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")r.reject(Rc(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?r.reject(Rc(s.result.code,s.result.description,s.result.ext)):r.resolve(s.result);else throw Sg(sl,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(i===br.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(i){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${i}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(i):o&&o.reject(i)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Ne.BEARER:case Ne.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Gl{constructor(e,t,r,o,i){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(_.HandleCodeResponse,t.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(o){throw o instanceof fr&&o.subError===Fr?Y(Fr):o}return q(this.handleCodeResponseFromServer.bind(this),_.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(_.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await q(this.authModule.updateAuthority.bind(this.authModule),_.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const i=this.createCcsCredentials(t);i&&(this.authCodeRequest.ccsCredential=i)}return await q(this.authModule.acquireToken.bind(this.authModule),_.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:qt.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:qt.UPN}:null}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function um(n,e,t){const r=vs(n);if(!r)throw cp(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),Y(wp)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),Y(Ep));return r}function OI(n,e,t){if(!n.state)throw Y(Nl);const r=sm(e,n.state);if(!r)throw Y(_p);if(r.interactionType!==t)throw Y(bp)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class PI extends No{constructor(e,t,r,o,i,s,a,c,l,u){super(e,t,r,o,i,s,a,l,u),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=c}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||Po,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,i=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,i)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,i))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var i;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(He.acquireTokenPopup),o=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ee.Popup);im(o.authority);try{const s=await q(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),a=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),c=En.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let l;c&&(l=this.performanceClient.startMeasurement(_.FetchAccountIdWithNativeBroker,e.correlationId));const u=await a.getAuthCodeUrl({...o,nativeBroker:c}),d=new Gl(a,this.browserStorage,s,this.logger,this.performanceClient),h=this.initiateAuthRequest(u,t);this.eventHandler.emitEvent(oe.POPUP_OPENED,ee.Popup,{popupWindow:h},null);const f=await this.monitorPopupForHash(h,t.popupWindowParent),C=$r(um,_.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(f,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Tn.removeThrottle(this.browserStorage,this.config.auth.clientId,s),C.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),l&&l.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw Y(Oi);const v=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,C.accountId,this.nativeStorage,o.correlationId),{userRequestState:E}=nn.parseRequestState(this.browserCrypto,o.state);return await v.acquireToken({...o,state:E,prompt:void 0})}return await d.handleCodeResponse(C,o)}catch(s){throw(i=t.popup)==null||i.close(),s instanceof Fe&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),s}}async logoutPopupAsync(e,t,r,o){var s,a,c,l;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(oe.LOGOUT_START,ee.Popup,e);const i=this.initializeServerTelemetryManager(He.logoutPopup);try{await this.clearCacheOnLogout(e.account);const u=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:r,account:e.account||void 0});try{u.authority.endSessionEndpoint}catch{if((s=e.account)!=null&&s.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===qn.OIDC){if(this.browserStorage.removeAccount((a=e.account)==null?void 0:a.homeAccountId,this.correlationId),this.eventHandler.emitEvent(oe.LOGOUT_SUCCESS,ee.Popup,e),o){const f={apiId:He.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=ve.getAbsoluteUrl(o,Bn());await this.navigationClient.navigateInternal(C,f)}(c=t.popup)==null||c.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(oe.LOGOUT_SUCCESS,ee.Popup,e);const h=this.openPopup(d,t);if(this.eventHandler.emitEvent(oe.POPUP_OPENED,ee.Popup,{popupWindow:h},null),await this.monitorPopupForHash(h,t.popupWindowParent).catch(()=>{}),o){const f={apiId:He.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=ve.getAbsoluteUrl(o,Bn());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${C}`),await this.navigationClient.navigateInternal(C,f)}else this.logger.verbose("No main window navigation requested")}catch(u){throw(l=t.popup)==null||l.close(),u instanceof Fe&&(u.setCorrelationId(this.correlationId),i.cacheFailedRequest(u)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(oe.LOGOUT_FAILURE,ee.Popup,null,u),this.eventHandler.emitEvent(oe.LOGOUT_END,ee.Popup),u}this.eventHandler.emitEvent(oe.LOGOUT_END,ee.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),Y(ra)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const i=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(i),o(Y(Fr));return}let s="";try{s=e.location.href}catch{}if(!s||s==="about:blank")return;clearInterval(i);let a="";const c=this.config.auth.OIDCOptions.serverResponseType;e&&(c===ki.QUERY?a=e.location.search:a=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(a)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw Y(Rp);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),Y(Sp)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var f,C,p,v;const i=o.screenLeft?o.screenLeft:o.screenX,s=o.screenTop?o.screenTop:o.screenY,a=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=(f=r.popupSize)==null?void 0:f.width,u=(C=r.popupSize)==null?void 0:C.height,d=(p=r.popupPosition)==null?void 0:p.top,h=(v=r.popupPosition)==null?void 0:v.left;return(!l||l<0||l>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=Bt.POPUP_WIDTH),(!u||u<0||u>c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),u=Bt.POPUP_HEIGHT),(!d||d<0||d>c)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),d=Math.max(0,c/2-Bt.POPUP_HEIGHT/2+s)),(!h||h<0||h>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),h=Math.max(0,a/2-Bt.POPUP_WIDTH/2+i)),o.open(e,t,`width=${l}, height=${u}, top=${d}, left=${h}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(ee.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Bt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Bt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class nh{constructor(e,t,r,o,i){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(ke.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(ke.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:He.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),Y(ra)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),o=this.browserStorage.getTemporaryCache(r);if(!o)throw H(ps,"Cached State");let i;try{i=this.authModule.handleFragmentResponse(e,o)}catch(l){throw l instanceof fr&&l.subError===Fr?Y(Fr):l}const s=this.browserStorage.generateNonceKey(o),a=this.browserStorage.getTemporaryCache(s);if(this.authCodeRequest.code=i.code,i.cloud_instance_host_name&&await q(this.authModule.updateAuthority.bind(this.authModule),_.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(i.cloud_instance_host_name,this.authCodeRequest.correlationId),i.nonce=a||void 0,i.state=o,i.client_info)this.authCodeRequest.clientInfo=i.client_info;else{const l=this.checkCcsCredentials();l&&(this.authCodeRequest.ccsCredential=l)}const c=await this.authModule.acquireToken(this.authCodeRequest,i);return this.browserStorage.cleanRequestByState(t),c}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(ke.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function NI(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class MI extends No{constructor(e,t,r,o,i,s,a,c,l,u){super(e,t,r,o,i,s,a,l,u),this.nativeStorage=c}async acquireToken(e){const t=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ee.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(He.acquireTokenRedirect),o=i=>{i.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(oe.RESTORE_FROM_BFCACHE,ee.Redirect))};try{const i=await q(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),s=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),a=new nh(s,this.browserStorage,i,this.logger,this.performanceClient),c=await s.getAuthCodeUrl({...t,nativeBroker:En.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),l=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${l}`),window.addEventListener("pageshow",o),await a.initiateAuthRequest(c,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:l,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(i){throw i instanceof Fe&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(t.state),i}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(He.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,i]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(ee.Redirect),NI()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const s=this.browserStorage.getTemporaryCache(ke.ORIGIN_URI,!0)||R.EMPTY_STRING,a=ve.removeHashFromUrl(s),c=ve.removeHashFromUrl(window.location.href);if(a===c&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),s.indexOf("#")>-1&&Bb(s),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Kl()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(ke.URL_HASH,i,!0);const l={apiId:He.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let u=!0;if(!s||s==="null"){const d=qb();this.browserStorage.setTemporaryCache(ke.ORIGIN_URI,d,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),u=await this.navigationClient.navigateInternal(d,l)}else this.logger.verbose(`Navigating to loginRequestUrl: ${s}`),u=await this.navigationClient.navigateInternal(s,l);if(!u)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof Fe&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(ee.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===ki.QUERY?t=window.location.search:t=window.location.hash);let r=vs(t);if(r){try{OI(r,this.browserCrypto,ee.Redirect)}catch(i){return i instanceof Fe&&this.logger.error(`Interaction type validation failed due to ${i.errorCode}: ${i.errorMessage}`),[null,""]}return Fb(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache(ke.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ke.URL_HASH)),o&&(r=vs(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw Y(Nl);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw Y(Oi);const c=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:l}=nn.parseRequestState(this.browserCrypto,r);return c.acquireToken({...o,state:l,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const i=this.browserStorage.getCachedAuthority(r);if(!i)throw Y(Ml);const s=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:i});return Tn.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new nh(s,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,i;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(He.logout);try{this.eventHandler.emitEvent(oe.LOGOUT_START,ee.Redirect,e),await this.clearCacheOnLogout(t.account);const s={apiId:He.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(a.authority.protocolMode===qn.OIDC)try{a.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((i=t.account)==null?void 0:i.homeAccountId,this.correlationId),this.eventHandler.emitEvent(oe.LOGOUT_SUCCESS,ee.Redirect,t);return}}const c=a.getLogoutUri(t);if(this.eventHandler.emitEvent(oe.LOGOUT_SUCCESS,ee.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}}catch(s){throw s instanceof Fe&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),this.eventHandler.emitEvent(oe.LOGOUT_FAILURE,ee.Redirect,null,s),this.eventHandler.emitEvent(oe.LOGOUT_END,ee.Redirect),s}this.eventHandler.emitEvent(oe.LOGOUT_END,ee.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return ve.getAbsoluteUrl(t,Bn())}}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function xI(n,e,t,r,o){if(e.addQueueMeasurement(_.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),Y(ra);return o?q(LI,_.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):$r(UI,_.SilentHandlerLoadFrameSync,t,e,r)(n)}async function DI(n,e,t,r,o,i,s){return r.addQueueMeasurement(_.SilentHandlerMonitorIframeForHash,i),new Promise((a,c)=>{e{window.clearInterval(u),c(Y(kp))},e),u=window.setInterval(()=>{let d="";const h=n.contentWindow;try{d=h?h.location.href:""}catch{}if(!d||d==="about:blank")return;let f="";h&&(s===ki.QUERY?f=h.location.search:f=h.location.hash),window.clearTimeout(l),window.clearInterval(u),a(f)},t)}).finally(()=>{$r(HI,_.RemoveHiddenIframe,o,r,i)(n)})}function LI(n,e,t,r){return t.addQueueMeasurement(_.SilentHandlerLoadFrame,r),new Promise((o,i)=>{const s=dm();window.setTimeout(()=>{if(!s){i("Unable to load iframe");return}s.src=n,o(s)},e)})}function UI(n){const e=dm();return e.src=n,e}function dm(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function HI(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class FI extends No{constructor(e,t,r,o,i,s,a,c,l,u,d){super(e,t,r,o,i,s,c,u,d),this.apiId=a,this.nativeStorage=l}async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==at.NONE&&t.prompt!==at.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${at.NONE}`),t.prompt=at.NONE):t.prompt=at.NONE;const r=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,ee.Silent);im(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let i;try{return i=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await q(this.silentTokenHelper.bind(this),_.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(i,r)}catch(s){if(s instanceof Fe&&(s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s)),!i||!(s instanceof Fe)||s.errorCode!==Bt.INVALID_GRANT_ERROR)throw s;this.performanceClient.addFields({retryError:s.errorCode},this.correlationId);const a=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,ee.Silent);return await q(this.silentTokenHelper.bind(this),_.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(i,a)}}logout(){return Promise.reject(Y(oa))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(_.SilentIframeClientTokenHelper,r);const o=await q(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),i=await q(e.getAuthCodeUrl.bind(e),_.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:En.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),s=new Gl(e,this.browserStorage,o,this.logger,this.performanceClient),a=await q(xI,_.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(i,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),c=this.config.auth.OIDCOptions.serverResponseType,l=await q(DI,_.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),u=$r(um,_.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(l,c,this.logger);if(u.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw Y(Oi);const d=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,u.accountId,this.browserStorage,r),{userRequestState:h}=nn.parseRequestState(this.browserCrypto,t.state);return q(d.acquireToken.bind(d),_.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:h,prompt:t.prompt||at.NONE})}return q(s.handleCodeResponse.bind(s),_.HandleCodeResponse,this.logger,this.performanceClient,r)(u,t)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class BI extends No{async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentRefreshClientAcquireToken,e.correlationId);const t=await q(jl,_.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(He.acquireTokenSilent_silentFlow),i=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return q(i.acquireTokenByRefreshToken.bind(i),_.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(s=>{throw s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),s})}logout(){return Promise.reject(Y(oa))}async createRefreshTokenClient(e){const t=await q(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Ac(t,this.performanceClient)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class KI{constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw Y(ia);const o=e.correlationId||In(),i=t.id_token?qr(t.id_token,_n):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.authority?new pt(pt.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||In()):void 0,c=this.loadAccount(e,r.clientInfo||t.client_info||"",o,i,a),l=this.loadIdToken(t,c.homeAccountId,c.environment,c.realm,o),u=this.loadAccessToken(e,t,c.homeAccountId,c.environment,c.realm,r,o),d=this.loadRefreshToken(t,c.homeAccountId,c.environment,o);return this.generateAuthenticationResult(e,{account:c,idToken:l,accessToken:u,refreshToken:d},i,a)}loadAccount(e,t,r,o,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const l=rt.createFromAccountInfo(e.account);return this.storage.setAccount(l,r),l}else if(!i||!t&&!o)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),Y(Hp);const s=rt.generateHomeAccountId(t,i.authorityType,this.logger,this.cryptoObj,o),a=o==null?void 0:o.tid,c=Rl(this.storage,i,s,_n,r,o,t,i.hostnameAndPort,a,void 0,void 0,this.logger);return this.storage.setAccount(c,r),c}loadIdToken(e,t,r,o,i){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=Js(t,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(s,i),s}loadAccessToken(e,t,r,o,i,s,a){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const c=t.scope?Ye.fromString(t.scope):new Ye(e.scopes),l=s.expiresOn||t.expires_in+new Date().getTime()/1e3,u=s.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,d=Xs(r,o,t.access_token,this.config.auth.clientId,i,c.printScopes(),l,u,_n);return this.storage.setAccessTokenCredential(d,a),d}loadRefreshToken(e,t,r,o){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const i=Vg(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(i,o),i}generateAuthenticationResult(e,t,r,o){var u,d,h;let i="",s=[],a=null,c;t!=null&&t.accessToken&&(i=t.accessToken.secret,s=Ye.fromString(t.accessToken.target).asArray(),a=new Date(Number(t.accessToken.expiresOn)*1e3),c=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const l=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:s,account:l.getAccountInfo(),idToken:((u=t.idToken)==null?void 0:u.secret)||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:c,familyId:((d=t.refreshToken)==null?void 0:d.familyId)||"",tokenType:((h=t==null?void 0:t.accessToken)==null?void 0:h.tokenType)||"",state:e.state||"",cloudGraphHostName:l.cloudGraphHostName||"",msGraphHost:l.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class qI extends Cp{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class $I extends No{constructor(e,t,r,o,i,s,a,c,l,u){super(e,t,r,o,i,s,c,l,u),this.apiId=a}async acquireToken(e){if(!e.code)throw Y(Fp);const t=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,ee.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},i=await q(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),s=new qI(i);this.logger.verbose("Auth code client created");const a=new Gl(s,this.browserStorage,o,this.logger,this.performanceClient);return await q(a.handleCodeResponseFromServer.bind(a),_.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof Fe&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(Y(oa))}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function dn(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function zi(n,e){try{ql(n)}catch(t){throw e.end({success:!1},t),t}}class aa{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ro(this.logger,this.performanceClient):ms,this.eventHandler=new pI(this.logger),this.browserStorage=this.isBrowserEnvironment?new Sc(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,tb(this.config.auth),this.performanceClient):aI(this.config.auth.clientId,this.logger);const t={cacheLocation:Ot.MemoryStorage,temporaryCacheLocation:Ot.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new Sc(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new KI(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new aa(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(oe.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(_.InitializeClientApplication,t);if(this.eventHandler.emitEvent(oe.INITIALIZE_START),r)try{this.nativeExtensionProvider=await En.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(i){this.logger.verbose(i)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await q(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),_.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(oe.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),om(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&En.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,i=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache(ke.CORRELATION_ID,!0)||"",s=this.performanceClient.startMeasurement(_.AcquireTokenRedirect,i);this.eventHandler.emitEvent(oe.HANDLE_REDIRECT_START,ee.Redirect);let a;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const c=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);a=q(c.handleRedirectPromise.bind(c),_.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(this.performanceClient,s.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const c=this.createRedirectClient(i);a=q(c.handleRedirectPromise.bind(c),_.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(e,s)}return a.then(c=>(c?(t.length{const l=c;throw t.length>0?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_FAILURE,ee.Redirect,null,l):this.eventHandler.emitEvent(oe.LOGIN_FAILURE,ee.Redirect,null,l),this.eventHandler.emitEvent(oe.HANDLE_REDIRECT_END,ee.Redirect),s.end({success:!1},l),c})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(_.AcquireTokenPreRedirect,t);r.add({accountType:dn(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=s=>{const a=typeof o=="function"?o(s):void 0;return a!==!1?r.end({success:!0}):r.discard(),a};else{const s=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=a=>{const c=typeof s=="function"?s(a):void 0;return c!==!1?r.end({success:!0}):r.discard(),c}}const i=this.getAllAccounts().length>0;try{Xd(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),i?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_START,ee.Redirect,e):this.eventHandler.emitEvent(oe.LOGIN_START,ee.Redirect,e);let s;return this.nativeExtensionProvider&&this.canUseNative(e)?s=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(c=>{if(c instanceof An&&Zr(c))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(c instanceof cn)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):s=this.createRedirectClient(t).acquireToken(e),await s}catch(s){throw r.end({success:!1},s),i?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_FAILURE,ee.Redirect,null,s):this.eventHandler.emitEvent(oe.LOGIN_FAILURE,ee.Redirect,null,s),s}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(_.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:dn(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),zi(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(s){return Promise.reject(s)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_START,ee.Popup,e):this.eventHandler.emitEvent(oe.LOGIN_START,ee.Popup,e);let i;return this.canUseNative(e)?i=this.acquireTokenNative({...e,correlationId:t},He.acquireTokenPopup).then(s=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:dn(s.account)}),s)).catch(s=>{if(s instanceof An&&Zr(s))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(s instanceof cn)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),s}):i=this.createPopupClient(t).acquireToken(e),i.then(s=>(o.length(o.length>0?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_FAILURE,ee.Popup,null,s):this.eventHandler.emitEvent(oe.LOGIN_FAILURE,ee.Popup,null,s),r.end({success:!1},s),Promise.reject(s)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var i,s;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(_.SsoSilent,t),(i=this.ssoSilentMeasurement)==null||i.add({scenarioId:e.scenarioId,accountType:dn(e.account)}),zi(this.initialized,this.ssoSilentMeasurement),(s=this.ssoSilentMeasurement)==null||s.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(oe.SSO_SILENT_START,ee.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,He.ssoSilent).catch(a=>{if(a instanceof An&&Zr(a))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw a}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(a=>{var c;return this.eventHandler.emitEvent(oe.SSO_SILENT_SUCCESS,ee.Silent,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!0,isNativeBroker:a.fromNativeBroker,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:dn(a.account)}),a}).catch(a=>{var c;throw this.eventHandler.emitEvent(oe.SSO_SILENT_FAILURE,ee.Silent,null,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(_.AcquireTokenByCode,t);zi(this.initialized,r),this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_BY_CODE_START,ee.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw Y(Kp);if(e.code){const o=e.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),i=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(s=>(this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_BY_CODE_SUCCESS,ee.Silent,s),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:s.fromNativeBroker,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length,accountType:dn(s.account)}),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_BY_CODE_FAILURE,ee.Silent,null,s),r.end({success:!1},s),s}),this.hybridAuthCodeResponses.set(o,i)),await i}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},He.acquireTokenByCode,e.nativeAccountId).catch(i=>{throw i instanceof An&&Zr(i)&&(this.nativeExtensionProvider=void 0),i});return r.end({accountType:dn(o.account),success:!0}),o}else throw Y(qp);else throw Y(Bp)}catch(o){throw this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_BY_CODE_FAILURE,ee.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(_.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(i=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:i.fromCache,isNativeBroker:i.fromNativeBroker}),i}).catch(i=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!1},i),i}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(_.AcquireTokenFromCache,e.correlationId),t){case Lt.Default:case Lt.AccessToken:case Lt.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return q(r.acquireToken.bind(r),_.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw H(Fn)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(_.AcquireTokenByRefreshToken,e.correlationId),t){case Lt.Default:case Lt.AccessTokenAndRefreshToken:case Lt.RefreshToken:case Lt.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return q(r.acquireToken.bind(r),_.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw H(Fn)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(_.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return q(t.acquireToken.bind(t),_.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return Xd(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return ql(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){const t=this.getRequestCorrelationId();return cI(this.logger,this.browserStorage,this.isBrowserEnvironment,t,e)}getAccount(e){const t=this.getRequestCorrelationId();return lI(e,this.logger,this.browserStorage,t)}getAccountByUsername(e){const t=this.getRequestCorrelationId();return uI(e,this.logger,this.browserStorage,t)}getAccountByHomeId(e){const t=this.getRequestCorrelationId();return dI(e,this.logger,this.browserStorage,t)}getAccountByLocalId(e){const t=this.getRequestCorrelationId();return hI(e,this.logger,this.browserStorage,t)}setActiveAccount(e){const t=this.getRequestCorrelationId();fI(e,this.browserStorage,t)}getActiveAccount(){const e=this.getRequestCorrelationId();return gI(this.browserStorage,e)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=rt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw Y(Oi);return new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!En.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case at.NONE:case at.CONSENT:case at.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new PI(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new MI(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new FI(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new lm(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new BI(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new $I(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return rm(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(it.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(oe.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!rt.isAccountEntity(o))return;const s=bo.toObject(new rt,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(oe.ACCOUNT_ADDED,void 0,s)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(oe.ACCOUNT_REMOVED,void 0,s))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?In():R.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Wd})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Wd})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(_.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),zi(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw Y(Mp);r.add({accountType:dn(o)});const i={clientId:this.config.auth.clientId,authority:e.authority||R.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},s=JSON.stringify(i),a=this.activeSilentTokenRequests.get(s);if(typeof a>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const c=q(this.acquireTokenSilentAsync.bind(this),_.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},o).then(l=>(this.activeSilentTokenRequests.delete(s),r.end({success:!0,fromCache:l.fromCache,isNativeBroker:l.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length}),l)).catch(l=>{throw this.activeSilentTokenRequests.delete(s),r.end({success:!1},l),l});return this.activeSilentTokenRequests.set(s,c),{...await c,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await a,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(_.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_START,ee.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await q(TI,_.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),i=e.cacheLookupPolicy||Lt.Default;return this.acquireTokenSilentNoIframe(o,i).catch(async a=>{if(jI(a,i))if(this.activeIframeRequest)if(i!==Lt.Skip){const[l,u]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${u}`,o.correlationId);const d=this.performanceClient.startMeasurement(_.AwaitConcurrentIframe,o.correlationId);d.add({awaitIframeCorrelationId:u});const h=await l;if(d.end({success:h}),h)return this.logger.verbose(`Parallel iframe request with correlationId: ${u} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: ${u} failed. Interaction is required.`),a}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),q(this.acquireTokenBySilentIframe.bind(this),_.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let l;return this.activeIframeRequest=[new Promise(u=>{l=u}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),q(this.acquireTokenBySilentIframe.bind(this),_.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(u=>(l(!0),u)).catch(u=>{throw l(!1),u}).finally(()=>{this.activeIframeRequest=void 0})}else throw a}).then(a=>(this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_SUCCESS,ee.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_FAILURE,ee.Silent,null,a),a}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return En.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,He.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof An&&Zr(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,H(Fn)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),q(this.acquireTokenFromCache.bind(this),_.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===Lt.AccessToken)throw r;return this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_NETWORK_START,ee.Silent,e),q(this.acquireTokenByRefreshToken.bind(this),_.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function jI(n,e){const t=!(n instanceof cn&&n.subError!==na),r=n.errorCode===Bt.INVALID_GRANT_ERROR||n.errorCode===Fn,o=t&&r||n.errorCode===As||n.errorCode===Sl,i=bb.includes(e);return o&&i}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function GI(n,e){const t=new Br(n);return await t.initialize(),aa.createController(t,e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Vl{static async createPublicClientApplication(e){const t=await GI(e);return new Vl(e,t)}constructor(e,t){this.controller=t||new aa(new Br(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const _s=new Vl({auth:{clientId:"9079054c-9620-4757-a256-23413042f1ef",authority:"https://login.microsoftonline.com/e519c2e6-bc6d-4fdf-8d9c-923c2f002385",redirectUri:"https://optical-dev.oliver.solutions/cc-dashboard/"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1}}),VI=["openid","profile","email"];async function zI(){await _s.initialize(),await _s.handleRedirectPromise()}const hm=YC("auth",()=>{const n=Oe(null),e=Oe(null),t=Oe(!1),r=Oe(null),o=Te(()=>n.value!==null),i=Te(()=>{var u;return((u=e.value)==null?void 0:u.role)==="admin"});async function s(){var u,d;t.value=!0,r.value=null;try{const f=(await _s.loginPopup({scopes:VI})).idToken,C=await fs.post("/api/auth/microsoft",{id_token:f});n.value=C.data.access_token,await c()}catch(h){const f=h;throw r.value=((d=(u=f.response)==null?void 0:u.data)==null?void 0:d.detail)??f.message??"Login failed",h}finally{t.value=!1}}async function a(){n.value=null,e.value=null;try{await _s.clearCache()}catch{}}async function c(){const u=await fs.get("/api/auth/me");e.value=u.data}function l(){return n.value}return{token:n,user:e,loading:t,error:r,isAuthenticated:o,isAdmin:i,loginWithMicrosoft:s,logout:a,fetchMe:c,getToken:l}}),QI=[{path:"/login",name:"login",component:()=>xt(()=>import("./LoginView-CXJ9ossc.js"),__vite__mapDeps([0,1,2])),meta:{public:!0}},{path:"/",component:()=>xt(()=>import("./AppLayout-CAE_yT_D.js"),[]),children:[{path:"",name:"dashboard",component:()=>xt(()=>import("./DashboardView-m9gOgQuc.js"),__vite__mapDeps([3,4,1,2,5,6,7,8]))},{path:"calendar",name:"calendar",component:()=>xt(()=>import("./CalendarView-DewkDTAU.js"),__vite__mapDeps([9,4,2,7,8,10,11,12,13,14,15,16]))},{path:"planner",name:"planner",component:()=>xt(()=>import("./PlannerView-BAUQxJ_s.js"),__vite__mapDeps([17,10,11,7,8,2,12,13,15]))},{path:"projects",name:"projects",component:()=>xt(()=>import("./ProjectsView-C_naK5Iu.js"),__vite__mapDeps([18,4,1,2,6,8]))},{path:"projects/:id/:date?",name:"project-detail",component:()=>xt(()=>import("./ProjectDetailView-KNzh4u90.js"),__vite__mapDeps([19,4,1,2,5,8]))},{path:"live",name:"live",component:()=>xt(()=>import("./LiveView-CWjU7kXQ.js"),__vite__mapDeps([20,1,2,7,8]))},{path:"reports",name:"reports",component:()=>xt(()=>import("./ReportsView-Y3rZHkOj.js"),__vite__mapDeps([21,1,2,15,7,8,14,22]))},{path:"keys",name:"keys",component:()=>xt(()=>import("./KeysView-BshY45g6.js"),__vite__mapDeps([23,24,1,2,7,8,11,12]))},{path:"devops",name:"devops",component:()=>xt(()=>import("./DevopsView-BYs6-sh9.js"),__vite__mapDeps([25,13,1,2,5,7,8,26,12]))},{path:"settings",name:"settings",component:()=>xt(()=>import("./SettingsView-BKfQ33Q8.js"),__vite__mapDeps([27,13,1,2,5,12,7,8,26]))},{path:"admin",name:"admin",component:()=>xt(()=>import("./AdminView-CREIty01.js"),__vite__mapDeps([28,24,1,2,15,8])),meta:{adminOnly:!0}}]},{path:"/:pathMatch(.*)*",redirect:"/"}],kc=NA({history:uA("/cc-dashboard/"),routes:QI});kc.beforeEach((n,e,t)=>{const r=hm();if(n.meta.public){t();return}if(!r.isAuthenticated){t({name:"login",query:{redirect:n.fullPath}});return}if(n.meta.adminOnly&&!r.isAdmin){t({name:"dashboard"});return}t()});zI().then(()=>{const n=KC(_T),e=jC();n.use(e),n.use(kc),n.use(Pv);const t=hm();Tw(()=>t.getToken(),()=>{t.logout(),kc.push({name:"login"})}),n.mount("#app")});export{lr as A,YC as B,nS as C,eS as D,fs as E,We as F,nf as G,JI as H,sS as K,SA as R,ZI as T,xt as _,sn as a,XI as b,je as c,ko as d,Ge as e,aS as f,cS as g,dt as h,Tr as i,Te as j,Hn as k,_y as l,Wt as m,Ht as n,Ee as o,za as p,Oe as q,qa as r,Do as s,Bo as t,hm as u,Mr as v,vr as w,ss as x,YI as y,tS as z}; +${s}`);return}throw jd(e.error,e.error_description,e.suberror)?new cn(e.error,e.error_description,e.suberror,e.timestamp||R.EMPTY_STRING,e.trace_id||R.EMPTY_STRING,e.correlation_id||R.EMPTY_STRING,e.claims||R.EMPTY_STRING,i):s}}async handleServerTokenResponse(e,t,r,o,i,s,a,c,l){var C;(C=this.performanceClient)==null||C.addQueueMeasurement(_.HandleServerTokenResponse,e.correlation_id);let u;if(e.id_token){if(u=qr(e.id_token||R.EMPTY_STRING,this.cryptoObj.base64Decode),i&&i.nonce&&u.nonce!==i.nonce)throw H(xg);if(o.maxAge||o.maxAge===0){const p=u.auth_time;if(!p)throw H(ll);Gg(p,o.maxAge)}}this.homeAccountIdentifier=rt.generateHomeAccountId(e.client_info||R.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,u);let d;i&&i.state&&(d=nn.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0;const h=this.generateCacheRecord(e,t,r,o,u,s,i);let f;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),f=new cb(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(f)),a&&!c&&h.account){const p=h.account.generateAccountKey();if(!this.cacheStorage.getAccount(p,o.correlationId,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Hr.generateAuthenticationResult(this.cryptoObj,t,h,!1,o,u,d,void 0,l)}await this.cacheStorage.saveCacheRecord(h,o.correlationId,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&f&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(f))}return Hr.generateAuthenticationResult(this.cryptoObj,t,h,!1,o,u,d,e,l)}generateCacheRecord(e,t,r,o,i,s,a){const c=t.getPreferredCache();if(!c)throw H(dl);const l=ap(i);let u,d;e.id_token&&i&&(u=Js(this.homeAccountIdentifier,c,e.id_token,this.clientId,l||""),d=Rl(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,i,e.client_info,c,l,a,void 0,this.logger));let h=null;if(e.access_token){const p=e.scope?Ye.fromString(e.scope):new Ye(o.scopes||[]),v=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,E=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,b=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,y=r+v,T=y+E,N=b&&b>0?r+b:void 0;h=Xs(this.homeAccountIdentifier,c,e.access_token,this.clientId,l||t.tenant||"",p.printScopes(),y,T,this.cryptoObj.base64Decode,N,e.token_type,s,e.key_id,o.claims,o.requestedClaimsHash)}let f=null;if(e.refresh_token){let p;if(e.refresh_token_expires_in){const v=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;p=r+v}f=Vg(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,p)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:c,familyId:e.foci}),{account:d,idToken:u,accessToken:h,refreshToken:f,appMetadata:C}}static async generateAuthenticationResult(e,t,r,o,i,s,a,c,l){var y,T,N,z,B;let u=R.EMPTY_STRING,d=[],h=null,f,C,p=R.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===Ne.POP&&!i.popKid){const F=new Io(e),{secret:O,keyId:Q}=r.accessToken;if(!Q)throw H(hl);u=await F.signPopToken(O,Q,i)}else u=r.accessToken.secret;d=Ye.fromString(r.accessToken.target).asArray(),h=new Date(Number(r.accessToken.expiresOn)*1e3),f=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(C=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(p=r.appMetadata.familyId===ei?ei:"");const v=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",E=(s==null?void 0:s.tid)||"";c!=null&&c.spa_accountid&&r.account&&(r.account.nativeAccountId=c==null?void 0:c.spa_accountid);const b=r.account?Al(r.account.getAccountInfo(),void 0,s,(y=r.idToken)==null?void 0:y.secret):null;return{authority:t.canonicalAuthority,uniqueId:v,tenantId:E,scopes:d,account:b,idToken:((T=r==null?void 0:r.idToken)==null?void 0:T.secret)||"",idTokenClaims:s||{},accessToken:u,fromCache:o,expiresOn:h,extExpiresOn:f,refreshOn:C,correlationId:i.correlationId,requestId:l||R.EMPTY_STRING,familyId:p,tokenType:((N=r.accessToken)==null?void 0:N.tokenType)||R.EMPTY_STRING,state:a?a.userRequestState:R.EMPTY_STRING,cloudGraphHostName:((z=r.account)==null?void 0:z.cloudGraphHostName)||R.EMPTY_STRING,msGraphHost:((B=r.account)==null?void 0:B.msGraphHost)||R.EMPTY_STRING,code:c==null?void 0:c.spa_code,fromNativeBroker:!1}}}function Rl(n,e,t,r,o,i,s,a,c,l,u,d){d==null||d.verbose("setCachedAccount called");const f=n.getAccountKeys().find(b=>b.startsWith(t));let C=null;f&&(C=n.getAccount(f,o,d));const p=C||rt.createAccount({homeAccountId:t,idTokenClaims:i,clientInfo:s,environment:a,cloudGraphHostName:l==null?void 0:l.cloud_graph_host_name,msGraphHost:l==null?void 0:l.msgraph_host,nativeAccountId:u},e,r),v=p.tenantProfiles||[],E=c||p.realm;if(E&&!v.find(b=>b.tenantId===E)){const b=Tl(t,p.localAccountId,E,i);v.push(b)}return p.tenantProfiles=v,p}/*! @azure/msal-common v14.16.1 2025-08-05 */async function yp(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.1 2025-08-05 */class Cp extends Il{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(_.GetAuthCodeUrl,e.correlationId);const t=await q(this.createAuthCodeUrlQueryString.bind(this),_.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return ve.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var a,c;if((a=this.performanceClient)==null||a.addQueueMeasurement(_.AuthClientAcquireToken,e.correlationId),!e.code)throw H(Ug);const r=bn(),o=await q(this.executeTokenRequest.bind(this),_.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),i=(c=o.headers)==null?void 0:c[bt.X_MS_REQUEST_ID],s=new Hr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(o.body),q(s.handleServerTokenResponse.bind(s),_.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,i)}handleFragmentResponse(e,t){if(new Hr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw H(qg);return e}getLogoutUri(e){if(!e)throw xe(Zg);const t=this.createLogoutUrlQueryString(e);return ve.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var l,u;(l=this.performanceClient)==null||l.addQueueMeasurement(_.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=ve.appendQueryString(e.tokenEndpoint,r),i=await q(this.createTokenRequestBody.bind(this),_.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let s;if(t.clientInfo)try{const d=ys(t.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${d.uid}${yt.CLIENT_INFO_SEPARATOR}${d.utid}`,type:qt.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(s||t.ccsCredential),c={clientId:((u=t.tokenBodyParameters)==null?void 0:u.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return q(this.executePostToTokenEndpoint.bind(this),_.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,i,a,c,t.correlationId,_.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(_.AuthClientCreateTokenRequestBody,e.correlationId);const t=new ni(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Ur])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):Jr.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Cc(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await yp(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(s.assertionType)}if(t.addGrantType(Ig.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Ne.POP){const s=new Io(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await q(s.generateCnf.bind(s),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(a)}else if(e.authenticationScheme===Ne.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw xe(Zs);(!tn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const s=ys(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${yt.CLIENT_INFO_SEPARATOR}${s.utid}`,type:qt.HOME_ACCOUNT_ID}}catch(s){this.logger.verbose("Could not parse client info for CCS Header: "+s)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case qt.HOME_ACCOUNT_ID:try{const s=no(r.credential);t.addCcsOid(s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case qt.UPN:t.addCcsUpn(r.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Kd])&&t.addExtraQueryParameters({[Kd]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var i,s;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(i=this.performanceClient)==null||i.addQueueMeasurement(_.AuthClientCreateQueryString,t);const r=new ni(t,this.performanceClient);r.addClientId(e.embeddedClientId||((s=e.extraQueryParameters)==null?void 0:s[Ur])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(t),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),Cc(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==at.SELECT_ACCOUNT)if(e.sid&&e.prompt===at.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const a=this.extractAccountSid(e.account);let c=this.extractLoginHint(e.account);if(c&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),c=null),c){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(c);try{const l=no(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===at.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(a);try{const l=no(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const l=no(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Ne.POP)){const a=new Io(this.cryptoUtils);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await q(a.generateCnf.bind(a),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(c)}return r.createQueryString()}createLogoutUrlQueryString(e){const t=new ni(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.1 2025-08-05 */const ub=300;class Ac extends Il{constructor(e,t){super(e,t)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(_.RefreshTokenClientAcquireToken,e.correlationId);const t=bn(),r=await q(this.executeTokenRequest.bind(this),_.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(a=r.headers)==null?void 0:a[bt.X_MS_REQUEST_ID],i=new Hr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return i.validateTokenResponse(r.body),q(i.handleServerTokenResponse.bind(i),_.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw xe(Xg);if((r=this.performanceClient)==null||r.addQueueMeasurement(_.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw H(ul);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await q(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const i=o instanceof cn&&o.errorCode===As,s=o instanceof fr&&o.errorCode===Sd.INVALID_GRANT_ERROR&&o.subError===Sd.CLIENT_MISMATCH_ERROR;if(i||s)return q(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return q(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=$r(this.cacheManager.getRefreshToken.bind(this.cacheManager),_.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,e.correlationId,void 0,this.performanceClient);if(!r)throw Tc(As);if(r.expiresOn&&yc(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||ub))throw Tc(Sl);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||Ne.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:qt.HOME_ACCOUNT_ID}};try{return await q(this.acquireToken.bind(this),_.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(s){if(s instanceof cn&&s.subError===na){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const a=to(r);this.cacheManager.removeRefreshToken(a,e.correlationId)}throw s}}async executeTokenRequest(e,t){var c,l;(c=this.performanceClient)==null||c.addQueueMeasurement(_.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=ve.appendQueryString(t.tokenEndpoint,r),i=await q(this.createTokenRequestBody.bind(this),_.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:((l=e.tokenBodyParameters)==null?void 0:l.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return q(this.executePostToTokenEndpoint.bind(this),_.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,i,s,a,e.correlationId,_.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i,s;(o=this.performanceClient)==null||o.addQueueMeasurement(_.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new ni(t,this.performanceClient);if(r.addClientId(e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Ur])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(s=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:s.defaultScopes),r.addGrantType(Ig.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Cc(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await yp(a.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(a.assertionType)}if(e.authenticationScheme===Ne.POP){const a=new Io(this.cryptoUtils,this.performanceClient);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await q(a.generateCnf.bind(a),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(c)}else if(e.authenticationScheme===Ne.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw xe(Zs);if((!tn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case qt.HOME_ACCOUNT_ID:try{const a=no(e.ccsCredential.credential);r.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case qt.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.1 2025-08-05 */class db extends Il{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...Po]});return o===er.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Ac(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof Ys&&r.errorCode===Fn)return new Ac(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var c;(c=this.performanceClient)==null||c.addQueueMeasurement(_.SilentFlowClientAcquireCachedToken,e.correlationId);let t=er.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!tn.isEmptyObj(e.claims))throw this.setCacheOutcome(er.FORCE_REFRESH_OR_CLAIMS,e.correlationId),H(Fn);if(!e.account)throw H(ul);const r=e.account.tenantId||eb(e.authority),o=this.cacheManager.getTokenKeys(),i=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient);if(i){if(Bw(i.cachedAt)||yc(i.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(er.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),H(Fn);i.refreshOn&&yc(i.refreshOn,0)&&(t=er.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(er.NO_CACHED_ACCESS_TOKEN,e.correlationId),H(Fn);const s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account,e.correlationId),accessToken:i,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await q(this.generateResultFromCacheRecord.bind(this),_.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==er.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(_.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=qr(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw H(ll);Gg(i,t.maxAge)}return Hr.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v14.16.1 2025-08-05 */const hb={sendGetRequestAsync:()=>Promise.reject(H(ge)),sendPostRequestAsync:()=>Promise.reject(H(ge))};/*! @azure/msal-common v14.16.1 2025-08-05 */const Gd=",",vp="|";function fb(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:i}=n,s=new Map([[0,[t,r]],[2,[o,i]]]);let a=[];if(e!=null&&e.length){if(a=e.split(Gd),a.length<4)return e}else a=Array.from({length:4},()=>vp);return s.forEach((c,l)=>{var u,d;c.length===2&&((u=c[0])!=null&&u.length)&&((d=c[1])!=null&&d.length)&&gb({skuArr:a,index:l,skuName:c[0],skuVersion:c[1]})}),a.join(Gd)}function gb(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(vp))}class gi{constructor(e,t){this.cacheOutcome=er.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||R.EMPTY_STRING,this.wrapperVer=e.wrapperVer||R.EMPTY_STRING,this.telemetryCacheKey=ut.CACHE_KEY+yt.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${ut.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(ut.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),s=[e,i].join(ut.VALUE_SEPARATOR);return[ut.SCHEMA_VERSION,s,o].join(ut.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=gi.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(ut.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(ut.VALUE_SEPARATOR),i=e.errors.length,s=t=ut.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Fe?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(ut.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=gi.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let t,r=0,o=0;const i=e.errors.length;for(t=0;tnull,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:Z_.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new zd}}startPerformanceMeasurement(){return new zd}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Pl="pkce_not_created",Ec="crypto_nonexistent",ra="empty_navigate_uri",Ep="hash_empty_error",Nl="no_state_in_hash",wp="hash_does_not_contain_known_properties",_p="unable_to_parse_state",bp="state_interaction_type_mismatch",Ip="interaction_in_progress",Sp="popup_window_error",Rp="empty_window_error",Fr="user_cancelled",yb="monitor_popup_timeout",kp="monitor_window_timeout",Op="redirect_in_iframe",Pp="block_iframe_reload",Np="block_nested_popups",Cb="iframe_closed_prematurely",oa="silent_logout_unsupported",Mp="no_account_error",vb="silent_prompt_value_error",xp="no_token_request_cache_error",Dp="unable_to_parse_token_request_cache_error",Ml="no_cached_authority_error",Tb="auth_request_not_set_error",Ab="invalid_cache_type",ia="non_browser_environment",Xr="database_not_open",Es="no_network_connectivity",Lp="post_request_failed",Up="get_request_failed",wc="failed_to_parse_response",Hp="unable_to_load_token",xl="crypto_key_not_found",Fp="auth_code_required",Bp="auth_code_or_nativeAccountId_required",Kp="spa_code_and_nativeAccountId_present",Dl="database_unavailable",qp="unable_to_acquire_token_from_native_platform",$p="native_handshake_timeout",jp="native_extension_not_installed",Oi="native_connection_not_established",Gp="uninitialized_public_client_application",Vp="native_prompt_not_supported",zp="invalid_base64_string",Qp="invalid_pop_token_request",Wp="failed_to_build_headers",Yp="failed_to_parse_headers";/*! @azure/msal-browser v3.30.0 2025-08-05 */const On="For more visit: aka.ms/msaljs/browser-errors",Eb={[Pl]:"The PKCE code challenge and verifier could not be generated.",[Ec]:"The crypto object or function is not available.",[ra]:"Navigation URI is empty. Please check stack trace for more info.",[Ep]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${On}`,[Nl]:"Hash does not contain state. Please verify that the request originated from msal.",[wp]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${On}`,[_p]:"Unable to parse state. Please verify that the request originated from msal.",[bp]:"Hash contains state but the interaction type does not match the caller.",[Ip]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${On}`,[Sp]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Rp]:"window.open returned null or undefined window object.",[Fr]:"User cancelled the flow.",[yb]:`Token acquisition in popup failed due to timeout. ${On}`,[kp]:`Token acquisition in iframe failed due to timeout. ${On}`,[Op]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Pp]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${On}`,[Np]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[Cb]:"The iframe being monitored was closed prematurely.",[oa]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Mp]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[vb]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[xp]:"No token request found in cache.",[Dp]:"The cached token request could not be parsed.",[Ml]:"No cached authority found.",[Tb]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[Ab]:"Invalid cache type",[ia]:"Login and token requests are not supported in non-browser environments.",[Xr]:"Database is not open!",[Es]:"No network connectivity. Check your internet connection.",[Lp]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[Up]:"Network request failed. Please check the network trace to determine root cause.",[wc]:"Failed to parse network response. Check network trace.",[Hp]:"Error loading token to cache.",[xl]:"Cryptographic Key or Keypair not found in browser storage.",[Fp]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[Bp]:"An authorization code or nativeAccountId must be provided to this flow.",[Kp]:"Request cannot contain both spa code and native account id.",[Dl]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[qp]:`Unable to acquire token from native platform. ${On}`,[$p]:"Timed out while attempting to establish connection to browser extension",[jp]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Oi]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${On}`,[Gp]:`You must call and await the initialize function before attempting to call any other MSAL API. ${On}`,[Vp]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[zp]:"Invalid base64 encoded string.",[Qp]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[Wp]:"Failed to build request headers object.",[Yp]:"Failed to parse response headers"};class Pi extends Fe{constructor(e,t){super(e,Eb[e],t),Object.setPrototypeOf(this,Pi.prototype),this.name="BrowserAuthError"}}function Y(n,e){return new Pi(n,e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Bt={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ro={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},br={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Ot={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},Qd={GET:"GET",POST:"POST"},ke={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},zt={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys",VERSION:"msal.version"},Gi={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},He={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var ee;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(ee||(ee={}));const Wd={scopes:Po},Jp="jwk",_c="msal.db",wb=1,_b=`${_c}.keys`,Lt={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},bb=[Lt.Default,Lt.Skip,Lt.RefreshTokenAndNetwork],Ib="msal.browser.log.level",Sb="msal.browser.log.pii";/*! @azure/msal-browser v3.30.0 2025-08-05 */function Vi(n){return encodeURIComponent(Ll(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function sa(n){return Xp(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ll(n){return Xp(new TextEncoder().encode(n))}function Xp(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Rb="RSASSA-PKCS1-v1_5",Zp="SHA-256",kb=2048,Ob=new Uint8Array([1,0,1]),Yd="0123456789abcdef",Jd=new Uint32Array(1),Pb="crypto_subtle_undefined",Ul={name:Rb,hash:Zp,modulusLength:kb,publicExponent:Ob};function Nb(n){if(!window)throw Y(ia);if(!window.crypto)throw Y(Ec);if(!n&&!window.crypto.subtle)throw Y(Ec,Pb)}async function em(n,e,t){e==null||e.addQueueMeasurement(_.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(Zp,o)}function Mb(n){return window.crypto.getRandomValues(n)}function Ma(){return window.crypto.getRandomValues(Jd),Jd[0]}function In(){const n=Date.now(),e=Ma()*1024+(Ma()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,i=Ma();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=i>>>24,t[13]=i>>>16,t[14]=i>>>8,t[15]=i;let s="";for(let a=0;a>>4),s+=Yd.charAt(t[a]&15),(a===3||a===5||a===7||a===9)&&(s+="-");return s}async function xb(n,e){return window.crypto.subtle.generateKey(Ul,n,e)}async function xa(n){return window.crypto.subtle.exportKey(Jp,n)}async function Db(n,e,t){return window.crypto.subtle.importKey(Jp,n,Ul,e,t)}async function Lb(n,e){return window.crypto.subtle.sign(Ul,n,e)}async function tm(n){const e=await em(n),t=new Uint8Array(e);return sa(t)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Hl="storage_not_supported",Ub="stubbed_public_client_application_called",nm="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.30.0 2025-08-05 */const Hb={[Hl]:"Given storage configuration option was not supported.",[Ub]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[nm]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};class Fl extends Fe{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Fl.prototype)}}function Bl(n){return new Fl(n,Hb[n])}/*! @azure/msal-browser v3.30.0 2025-08-05 */function Fb(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function Bb(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Kl(){return window.parent!==window}function Kb(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Bt.POPUP_NAME_PREFIX}.`)===0}function Bn(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function qb(){const e=new ve(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function $b(){if(ve.hashContainsKnownProperties(window.location.hash)&&Kl())throw Y(Pp)}function jb(n){if(Kl()&&!n)throw Y(Op)}function Gb(){if(Kb())throw Y(Np)}function rm(){if(typeof window>"u")throw Y(ia)}function om(n){if(!n)throw Y(Gp)}function ql(n){rm(),$b(),Gb(),om(n)}function Xd(n,e){if(ql(n),jb(e.system.allowRedirectInIframe),e.cache.cacheLocation===Ot.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Bl(nm)}function im(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function Vb(){return In()}/*! @azure/msal-browser v3.30.0 2025-08-05 */class ws{navigateInternal(e,t){return ws.defaultNavigateWindow(e,t)}navigateExternal(e,t){return ws.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class zb{async sendGetRequestAsync(e,t){let r,o={},i=0;const s=Zd(t);try{r=await fetch(e,{method:Qd.GET,headers:s})}catch{throw Y(window.navigator.onLine?Up:Es)}o=eh(r.headers);try{return i=r.status,{headers:o,body:await r.json(),status:i}}catch{throw qd(Y(wc),i,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=Zd(t);let i,s=0,a={};try{i=await fetch(e,{method:Qd.POST,headers:o,body:r})}catch{throw Y(window.navigator.onLine?Lp:Es)}a=eh(i.headers);try{return s=i.status,{headers:a,body:await i.json(),status:s}}catch{throw qd(Y(wc),s,a)}}}function Zd(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw Y(Wp)}}function eh(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw Y(Yp)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Qb=6e4,bc=1e4,Wb=3e4,Yb=2e3;function Jb({auth:n,cache:e,system:t,telemetry:r},o){const i={clientId:R.EMPTY_STRING,authority:`${R.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:R.EMPTY_STRING,authorityMetadata:R.EMPTY_STRING,redirectUri:typeof window<"u"?Bn():"",postLogoutRedirectUri:R.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:qn.AAD,OIDCOptions:{serverResponseType:ki.FRAGMENT,defaultScopes:[R.OPENID_SCOPE,R.PROFILE_SCOPE,R.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:gl.None,tenant:R.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},s={cacheLocation:Ot.SessionStorage,temporaryCacheLocation:Ot.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Ot.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:Ke.Info,piiLoggingEnabled:!1},l={...{...hp,loggerOptions:a,networkClient:o?new zb:hb,navigationClient:new ws,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||Qb,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||bc,navigateFrameWait:0,redirectNavigationTimeout:Wb,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||Yb,pollIntervalMilliseconds:Bt.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||a},u={application:{appName:R.EMPTY_STRING,appVersion:R.EMPTY_STRING},client:new mb};if((n==null?void 0:n.protocolMode)!==qn.OIDC&&(n!=null&&n.OIDCOptions)&&new hr(l.loggerOptions).warning(JSON.stringify(xe(op))),n!=null&&n.protocolMode&&n.protocolMode!==qn.AAD&&(l!=null&&l.allowNativeBroker))throw xe(ip);return{auth:{...i,...n,OIDCOptions:{...i.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...s,...e},system:l,telemetry:{...u,...r}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Xb="@azure/msal-browser",So="3.30.0";/*! @azure/msal-browser v3.30.0 2025-08-05 */class $l{static loggerCallback(e,t){switch(e){case Ke.Error:console.error(t);return;case Ke.Info:console.info(t);return;case Ke.Verbose:console.debug(t);return;case Ke.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var c;this.browserEnvironment=typeof window<"u",this.config=Jb(e,this.browserEnvironment);let t;try{t=window[Ot.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(Ib),o=(c=t==null?void 0:t.getItem(Sb))==null?void 0:c.toLowerCase(),i=o==="true"?!0:o==="false"?!1:void 0,s={...this.config.system.loggerOptions},a=r&&Object.keys(Ke).includes(r)?Ke[r]:void 0;a&&(s.loggerCallback=$l.loggerCallback,s.logLevel=a),i!==void 0&&(s.piiLoggingEnabled=i),this.logger=new hr(s,Xb,So),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Br extends $l{getModuleName(){return Br.MODULE_NAME}getId(){return Br.ID}async initialize(){return this.available=typeof window<"u",this.available}}Br.MODULE_NAME="";Br.ID="StandardOperatingContext";/*! @azure/msal-browser v3.30.0 2025-08-05 */function _n(n){return new TextDecoder().decode(Zb(n))}function Zb(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Y(zp)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class eI{constructor(){this.dbName=_c,this.version=wb,this.tableName=_b,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const i=o;this.db=i.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(Y(Dl)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(Y(Xr));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),t(c.target.result)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(Y(Xr));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);a.addEventListener("success",()=>{this.closeConnection(),r()}),a.addEventListener("error",c=>{this.closeConnection(),o(c)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(Y(Xr));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),t()}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(Y(Xr));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",s=>{const a=s;this.closeConnection(),e(a.target.result)}),i.addEventListener("error",s=>{this.closeConnection(),t(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(Y(Xr));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),t(c.target.result===1)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(_c),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Ic{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class tI{constructor(e){this.inMemoryCache=new Ic,this.indexedDBCache=new eI,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Pi&&e.errorCode===Dl)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Ro{constructor(e,t,r){this.logger=e,Nb(r??!1),this.cache=new tI(this.logger),this.performanceClient=t}createNewGuid(){return In()}base64Encode(e){return Ll(e)}base64Decode(e){return _n(e)}base64UrlEncode(e){return Vi(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var u;const t=(u=this.performanceClient)==null?void 0:u.startMeasurement(_.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await xb(Ro.EXTRACTABLE,Ro.POP_KEY_USAGES),o=await xa(r.publicKey),i={e:o.e,kty:o.kty,n:o.n},s=th(i),a=await this.hashString(s),c=await xa(r.privateKey),l=await Db(c,!1,["sign"]);return await this.cache.setItem(a,{privateKey:l,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),a}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var y;const i=(y=this.performanceClient)==null?void 0:y.startMeasurement(_.CryptoOptsSignJwt,o),s=await this.cache.getItem(t);if(!s)throw Y(xl);const a=await xa(s.publicKey),c=th(a),l=Vi(JSON.stringify({kid:t})),u=Ol.getShrHeaderString({...r==null?void 0:r.header,alg:a.alg,kid:l}),d=Vi(u);e.cnf={jwk:JSON.parse(c)};const h=Vi(JSON.stringify(e)),f=`${d}.${h}`,p=new TextEncoder().encode(f),v=await Lb(s.privateKey,p),E=sa(new Uint8Array(v)),b=`${f}.${E}`;return i&&i.end({success:!0}),b}async hashString(e){return tm(e)}}Ro.POP_KEY_USAGES=["sign","verify"];Ro.EXTRACTABLE=!0;function th(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.30.0 2025-08-05 */class nI{constructor(){if(!window.localStorage)throw Bl(Hl)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class rI{constructor(){if(!window.sessionStorage)throw Bl(Hl)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function sm(n,e){if(!e)return null;try{return nn.parseRequestState(n,e).libraryState.meta}catch{throw H(_o)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const oI=24*60*60*1e3;class iI{getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function sI(n){const e=new Date;return new Date(e.getTime()+n*oI).toUTCString()}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Sc extends bo{constructor(e,t,r,o,i,s){super(e,r,o,i),this.cacheConfig=t,this.logger=o,this.internalStorage=new Ic,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new iI,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=s}setupBrowserStorage(e){try{switch(e){case Ot.LocalStorage:return new nI;case Ot.SessionStorage:return new rI;case Ot.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=Ot.MemoryStorage,new Ic}migrateCacheEntries(){const e=this.browserStorage.getItem(zt.VERSION);e&&this.logger.info(`MSAL.js was last initialized with version ${e}`),e!==So&&this.browserStorage.setItem(zt.VERSION,So);const t=`${R.CACHE_PREFIX}.${it.ID_TOKEN}`,r=`${R.CACHE_PREFIX}.${it.CLIENT_INFO}`,o=`${R.CACHE_PREFIX}.${it.ERROR}`,i=`${R.CACHE_PREFIX}.${it.ERROR_DESC}`,s=this.browserStorage.getItem(t),a=this.browserStorage.getItem(r),c=this.browserStorage.getItem(o),l=this.browserStorage.getItem(i),u=[s,a,c,l];[it.ID_TOKEN,it.CLIENT_INFO,it.ERROR,it.ERROR_DESC].forEach((h,f)=>{const C=u[f];C&&this.setTemporaryCache(h,C,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.cryptoImpl.createNewGuid(),t=this.getItem(zt.ACCOUNT_KEYS),r=this.getItem(`${zt.TOKEN_KEYS}.${this.clientId}`);if(t&&r){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(i=>{if(this.isCredentialKey(i)){const s=this.getItem(i);if(s){const a=this.validateAndParseJson(s);if(a&&a.hasOwnProperty("credentialType"))switch(a.credentialType){case ae.ID_TOKEN:if(Nd(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,ae.ID_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${i}`);break;case ae.ACCESS_TOKEN:case ae.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Pd(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,ae.ACCESS_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${i}`);break;case ae.REFRESH_TOKEN:if(Md(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,ae.REFRESH_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${i}`);break}}}if(this.isAccountKey(i)){const s=this.getItem(i);if(s){const a=this.validateAndParseJson(s);a&&rt.isAccountEntity(a)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${i} found, saving key to account key map`),this.addAccountKeyToMap(i,e))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t,r){let o=[];for(let s=0;s<=20;s++)try{this.browserStorage.setItem(e,t),s>0&&this.removeAccessTokenKeys(o.slice(0,s),r);break}catch(a){const c=dp(a);if(c.errorCode===wl&&s<20){if(o.length||(e===`${zt.TOKEN_KEYS}.${this.clientId}`?o=JSON.parse(t).accessToken:o=this.getTokenKeys().accessToken),o.length<=s)throw c;this.removeAccessToken(o[s],r,!1)}else throw c}}getAccount(e,t,r){this.logger.trace("BrowserCacheManager.getAccount called");const o=this.getCachedAccountEntity(e,t);return this.updateOutdatedCachedAccount(e,o,t,r)}getCachedAccountEntity(e,t){const r=this.getItem(e);if(!r)return this.removeAccountKeyFromMap(e,t),null;const o=this.validateAndParseJson(r);return!o||!rt.isAccountEntity(o)?null:bo.toObject(new rt,o)}setAccount(e,t){this.logger.trace("BrowserCacheManager.setAccount called");const r=e.generateAccountKey();e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),t),this.addAccountKeyToMap(r,t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(zt.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e,t){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const r=this.getAccountKeys();r.indexOf(e)===-1?(r.push(e),this.setItem(zt.ACCOUNT_KEYS,JSON.stringify(r),t),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e,t){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const r=this.getAccountKeys(),o=r.indexOf(e);if(o>-1){if(r.splice(o,1),r.length===0){this.removeItem(zt.ACCOUNT_KEYS);return}else this.setItem(zt.ACCOUNT_KEYS,JSON.stringify(r),t);this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e,t){super.removeAccount(e,t),this.removeAccountKeyFromMap(e,t)}removeOutdatedAccount(e,t){this.removeItem(e),this.removeAccountKeyFromMap(e,t)}removeIdToken(e,t){super.removeIdToken(e,t),this.removeTokenKey(e,ae.ID_TOKEN,t)}removeAccessToken(e,t,r=!0){var o;super.removeAccessToken(e,t),(o=this.performanceClient)==null||o.incrementFields({accessTokensRemoved:1},t),r&&this.removeTokenKey(e,ae.ACCESS_TOKEN,t)}removeAccessTokenKeys(e,t){this.logger.trace("removeAccessTokenKey called");const r=this.getTokenKeys();let o=0;if(e.forEach(i=>{const s=r.accessToken.indexOf(i);s>-1&&(r.accessToken.splice(s,1),o++)}),o>0){this.logger.info(`removed ${o} accessToken keys from tokenKeys map`),this.setTokenKeys(r,t);return}}removeRefreshToken(e,t){super.removeRefreshToken(e,t),this.removeTokenKey(e,ae.REFRESH_TOKEN,t)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${zt.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}setTokenKeys(e,t){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(`${zt.TOKEN_KEYS}.${this.clientId}`);return}else this.setItem(`${zt.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(e),t)}addTokenKey(e,t,r){this.logger.trace("BrowserCacheManager addTokenKey called");const o=this.getTokenKeys();switch(t){case ae.ID_TOKEN:o.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),o.idToken.push(e));break;case ae.ACCESS_TOKEN:const i=o.accessToken.indexOf(e);i!==-1&&o.accessToken.splice(i,1),this.logger.trace(`access token ${i===-1?"added to":"updated in"} map`),o.accessToken.push(e);break;case ae.REFRESH_TOKEN:o.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),o.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),H(mc)}this.setTokenKeys(o,r)}removeTokenKey(e,t,r,o=this.getTokenKeys()){switch(this.logger.trace("BrowserCacheManager removeTokenKey called"),t){case ae.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const i=o.idToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),o.idToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ae.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const s=o.accessToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),o.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ae.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const a=o.refreshToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),o.refreshToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),H(mc)}this.setTokenKeys(o,r)}getIdTokenCredential(e,t){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,t),null;const o=this.validateAndParseJson(r);return!o||!Nd(o)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),o)}setIdTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=to(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),t),this.addTokenKey(r,ae.ID_TOKEN,t)}getAccessTokenCredential(e,t){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ae.ACCESS_TOKEN,t),null;const o=this.validateAndParseJson(r);return!o||!Pd(o)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),o)}setAccessTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=to(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),t),this.addTokenKey(r,ae.ACCESS_TOKEN,t)}getRefreshTokenCredential(e,t){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ae.REFRESH_TOKEN,t),null;const o=this.validateAndParseJson(r);return!o||!Md(o)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),o)}setRefreshTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=to(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),t),this.addTokenKey(r,ae.REFRESH_TOKEN,t)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Ww(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,t){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=Qw(e);this.setItem(r,JSON.stringify(e),t)}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Vw(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t),r)}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&Yw(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Gi.WRAPPER_SKU,e),this.internalStorage.setItem(Gi.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Gi.WRAPPER_SKU)||R.EMPTY_STRING,t=this.internalStorage.getItem(Gi.WRAPPER_VER)||R.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(e){const t=this.generateCacheKey(it.ACTIVE_ACCOUNT_FILTERS),r=this.getItem(t);if(!r){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const i=this.generateCacheKey(it.ACTIVE_ACCOUNT),s=this.getItem(i);if(!s)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const a=this.getAccountInfoFilteredBy({localAccountId:s},e);return a?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(a,e),a):null}const o=this.validateAndParseJson(r);return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:o.homeAccountId,localAccountId:o.localAccountId,tenantId:o.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,t){const r=this.generateCacheKey(it.ACTIVE_ACCOUNT_FILTERS),o=this.generateCacheKey(it.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:Date.now().toString()};this.setItem(r,JSON.stringify(i),t),this.setItem(o,e.localAccountId,t)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r),this.browserStorage.removeItem(o)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!zw(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t),r)}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const i=this.cookieStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),i}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Ot.LocalStorage){const i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(e){await this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(t=>{(t.indexOf(R.CACHE_PREFIX)!==-1||t.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(t)}),this.browserStorage.getKeys().forEach(t=>{(t.indexOf(R.CACHE_PREFIX)!==-1||t.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(t)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(_.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys();let o=0;r.accessToken.forEach(i=>{const s=this.getAccessTokenCredential(i,t);s!=null&&s.requestedClaimsHash&&i.includes(s.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(i,t),o++)}),o>0&&this.logger.warning(`${o} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):tn.startsWith(e,R.CACHE_PREFIX)||tn.startsWith(e,it.ADAL_ID_TOKEN)?e:`${R.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=nn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=nn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=nn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,t,r,o,i){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const s=this.generateStateKey(e);this.setTemporaryCache(s,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);const c=this.generateAuthorityKey(e);if(this.setTemporaryCache(c,r,!1),i){const l={credential:i.homeAccountId,type:qt.HOME_ACCOUNT_ID};this.setTemporaryCache(ke.CCS_CREDENTIAL,JSON.stringify(l),!0)}else if(o){const l={credential:o,type:qt.UPN};this.setTemporaryCache(ke.CCS_CREDENTIAL,JSON.stringify(l),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(ke.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(ke.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(ke.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(ke.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(ke.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(ke.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||R.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(ke.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const o=sm(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=Ll(JSON.stringify(e));this.setTemporaryCache(ke.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(ke.REQUEST_PARAMS,!0);if(!t)throw Y(xp);let r;try{r=JSON.parse(_n(t))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),Y(Dp)}if(this.removeTemporaryItem(this.generateCacheKey(ke.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),i=this.getTemporaryCache(o);if(!i)throw Y(Ml);r.authority=i}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(ke.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${R.CACHE_PREFIX}.${ke.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${R.CACHE_PREFIX}.${ke.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw Y(Ip);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(it.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(it.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(it.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(it.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const o=qr(r,_n);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t,r){const o=to(t);if(e!==o){const i=this.getItem(e);if(i)return this.browserStorage.removeItem(e),this.setItem(o,i,r),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),o;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){var a,c,l;const r=Js((a=e.account)==null?void 0:a.homeAccountId,(c=e.account)==null?void 0:c.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const i=Xs((l=e.account)==null?void 0:l.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,_n,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),s={idToken:r,accessToken:i};return this.saveCacheRecord(s,e.correlationId)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof co&&this.performanceClient&&t)try{const i=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:i.refreshToken.length,cacheIdCount:i.idToken.length,cacheAtCount:i.accessToken.length},t)}catch{}throw o}}}const aI=(n,e)=>{const t={cacheLocation:Ot.MemoryStorage,temporaryCacheLocation:Ot.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new Sc(n,t,ms,e)};/*! @azure/msal-browser v3.30.0 2025-08-05 */function cI(n,e,t,r,o){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r,o):[]}function lI(n,e,t,r){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const o=t.getAccountInfoFilteredBy(n,r);return o?(e.verbose("getAccount: Account matching provided filter found, returning"),o):(e.verbose("getAccount: No matching account found, returning null"),null)}function uI(n,e,t,r){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const o=t.getAccountInfoFilteredBy({username:n},r);return o?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),o):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function dI(n,e,t,r){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const o=t.getAccountInfoFilteredBy({homeAccountId:n},r);return o?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),o):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function hI(n,e,t,r){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const o=t.getAccountInfoFilteredBy({localAccountId:n},r);return o?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),o):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function fI(n,e,t){e.setActiveAccount(n,t)}function gI(n,e){return n.getActiveAccount(e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const oe={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.30.0 2025-08-05 */class pI{constructor(e){this.eventCallbacks=new Map,this.logger=e||new hr({})}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||Vb();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){if(typeof window<"u"){const i={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([s,a],c)=>{(a.length===0||a.includes(e))&&(this.logger.verbose(`Emitting event to callback ${c}: ${e}`),s.apply(null,[i]))})}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class am{constructor(e,t,r,o,i,s,a,c,l){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=i,this.navigationClient=s,this.nativeMessageHandler=c,this.correlationId=l||In(),this.logger=o.clone(Bt.MSAL_SKU,So,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){rt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(this.correlationId),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null,this.correlationId));try{await this.browserStorage.removeAccount(rt.generateAccountCacheKey(e),this.correlationId),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(this.correlationId),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return ve.getAbsoluteUrl(t,Bn())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new gi(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(_.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e.requestAuthority||this.config.auth.authority,s=r!=null&&r.length?r==="true":this.config.auth.instanceAware,a=t&&s?this.config.auth.authority.replace(ve.getDomainFromUrl(i),t.environment):i,c=pt.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),l=await q(pp,_.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(c,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!l.isAlias(t.environment))throw xe(sp);return l}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const mI=32;async function yI(n,e,t){n.addQueueMeasurement(_.GeneratePkceCodes,t);const r=$r(CI,_.GenerateCodeVerifier,e,n,t)(n,e,t),o=await q(vI,_.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function CI(n,e,t){try{const r=new Uint8Array(mI);return $r(Mb,_.GetRandomValues,e,n,t)(r),sa(r)}catch{throw Y(Pl)}}async function vI(n,e,t,r){e.addQueueMeasurement(_.GenerateCodeChallengeFromVerifier,r);try{const o=await q(em,_.Sha256Digest,t,e,r)(n,e,r);return sa(new Uint8Array(o))}catch{throw Y(Pl)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function jl(n,e,t,r){t.addQueueMeasurement(_.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,i=[...n&&n.scopes||[]],s={...n,correlationId:n.correlationId,authority:o,scopes:i};if(!s.authenticationScheme)s.authenticationScheme=Ne.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(s.authenticationScheme===Ne.SSH){if(!n.sshJwk)throw xe(Zs);if(!n.sshKid)throw xe(rp)}r.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!tn.isEmptyObj(n.claims)&&(s.requestedClaimsHash=await tm(n.claims)),s}async function TI(n,e,t,r,o){r.addQueueMeasurement(_.InitializeSilentRequest,n.correlationId);const i=await q(jl,_.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...i,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class No extends am{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await q(yI,_.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:R.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=R.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||In(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=ve.getAbsoluteUrl(e.postLogoutRedirectUri,Bn())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=ve.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Bn())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=ve.getAbsoluteUrl(Bn(),Bn())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await q(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Cp(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}=e;this.performanceClient.addQueueMeasurement(_.StandardInteractionClientGetClientConfiguration,this.correlationId);const a=await q(this.getDiscoveredAuthority.bind(this),_.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}),c=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:c.loggerCallback,piiLoggingEnabled:c.piiLoggingEnabled,logLevel:c.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Bt.MSAL_SKU,version:So,cpu:R.EMPTY_STRING,os:R.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},i=nn.setRequestState(this.browserCrypto,e&&e.state||R.EMPTY_STRING,o),a={...await q(jl,_.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:i,nonce:e.nonce||In(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return a;const c=e.account||this.browserStorage.getActiveAccount(this.correlationId);if(c&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${c.homeAccountId}`,this.correlationId),a.account=c),!a.loginHint&&!c){const l=this.browserStorage.getLegacyLoginHint();l&&(a.loginHint=l)}return a}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const AI="ContentError",cm="user_switch";/*! @azure/msal-browser v3.30.0 2025-08-05 */const EI="USER_INTERACTION_REQUIRED",wI="USER_CANCEL",_I="NO_NETWORK",bI="PERSISTENT_ERROR",II="DISABLED",SI="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.30.0 2025-08-05 */const RI=-2147186943,kI={[cm]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class An extends Fe{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,An.prototype),this.name="NativeAuthError",this.ext=r}}function Zr(n){if(n.ext&&n.ext.status&&(n.ext.status===bI||n.ext.status===II)||n.ext&&n.ext.error&&n.ext.error===RI)return!0;switch(n.errorCode){case AI:return!0;default:return!1}}function Rc(n,e,t){if(t&&t.status)switch(t.status){case SI:return Tc(mp);case EI:return new cn(n,e);case wI:return Y(Fr);case _I:return Y(Es)}return new An(n,kI[n]||e,t)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class lm extends No{async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(He.acquireTokenSilent_silentFlow),r=await q(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new db(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const s=(await q(o.acquireCachedToken.bind(o),_.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),s}catch(i){throw i instanceof Pi&&i.errorCode===xl&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),i}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class lo extends am{constructor(e,t,r,o,i,s,a,c,l,u,d,h){var C;super(e,t,r,o,i,s,c,l,h),this.apiId=a,this.accountId=u,this.nativeMessageHandler=l,this.nativeStorageManager=d,this.silentCacheClient=new lm(e,this.nativeStorageManager,r,o,i,s,c,l,h),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const f=this.nativeMessageHandler.getExtensionId()===ro.PREFERRED_EXTENSION_ID?"chrome":(C=this.nativeMessageHandler.getExtensionId())!=null&&C.length?"unknown":void 0;this.skus=gi.makeExtraSkuString({libraryName:Bt.MSAL_SKU,libraryVersion:So,extensionName:f,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[Q_]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(_.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(_.NativeInteractionClientAcquireToken,e.correlationId),r=bn();try{const o=await this.initializeNativeRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,o);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...i}=o,s={method:br.GetToken,request:i},a=await this.nativeMessageHandler.sendMessage(s),c=this.validateNativeResponse(a);return await this.handleNativeResponse(c,o,r).then(l=>(t.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),l)).catch(l=>{throw t.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError,isNativeBroker:!0}),l})}catch(o){throw o instanceof An&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Ye.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),H(gc);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},t.correlationId);if(!r)throw H(gc);try{const o=this.createSilentCacheRequest(t,r),i=await this.silentCacheClient.acquireToken(o),s={...r,idTokenClaims:i==null?void 0:i.idTokenClaims,idToken:i==null?void 0:i.idToken};return{...i,account:s}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),i={method:br.GetToken,request:o};try{const c=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(c)}catch(c){if(c instanceof An&&(this.serverTelemetryManager.setNativeBrokerErrorCode(c.errorCode),Zr(c)))throw c}this.browserStorage.setTemporaryCache(ke.NATIVE_REQUEST,JSON.stringify(o),!0);const s={apiId:He.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(a,s)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...i}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ke.NATIVE_REQUEST));const s={method:br.GetToken,request:i},a=bn();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(c);const l=this.handleNativeResponse(c,i,a);this.browserStorage.setInteractionInProgress(!1);const u=await l;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),u}catch(c){throw this.browserStorage.setInteractionInProgress(!1),c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var u;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=qr(e.id_token,_n),i=this.createHomeAccountIdentifier(e,o),s=(u=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId},this.correlationId))==null?void 0:u.homeAccountId;if(i!==s&&e.account.id!==t.accountId)throw Rc(cm);const a=await this.getDiscoveredAuthority({requestAuthority:t.authority}),c=Rl(this.browserStorage,a,i,_n,this.correlationId,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),l=await this.generateAuthenticationResult(e,t,o,c,a.canonicalAuthority,r);return this.cacheAccount(c),this.cacheNativeTokens(e,t,i,o,e.access_token,l.tenantId,r),l}createHomeAccountIdentifier(e,t){return rt.generateHomeAccountId(e.client_info||R.EMPTY_STRING,Zt.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?Ye.fromString(e.scope):Ye.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Ne.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Io(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw H(hl);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,i,s){const a=this.addTelemetryFromNativeResponse(e),c=e.scope?Ye.fromString(e.scope):Ye.fromString(t.scope),l=e.account.properties||{},u=l.UID||r.oid||r.sub||R.EMPTY_STRING,d=l.TenantId||r.tid||R.EMPTY_STRING,h=Al(o.getAccountInfo(),void 0,r,e.id_token);h.nativeAccountId!==e.account.id&&(h.nativeAccountId=e.account.id);const f=await this.generatePopAccessToken(e,t),C=t.tokenType===Ne.POP?Ne.POP:Ne.BEARER;return{authority:i,uniqueId:u,tenantId:d,scopes:c.asArray(),account:h,idToken:e.id_token,idTokenClaims:r,accessToken:f,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:new Date(Number(s+e.expires_in)*1e3),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e,this.correlationId).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,i,s,a){const c=Js(r,t.authority,e.id_token||"",t.clientId,o.tid||""),l=t.tokenType===Ne.POP?R.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,u=a+l,d=this.generateScopes(e,t),h=Xs(r,t.authority,i,t.clientId,o.tid||s,d.printScopes(),u,0,_n,void 0,t.tokenType,void 0,t.keyId),f={idToken:c,accessToken:h};this.nativeStorageManager.saveCacheRecord(f,t.correlationId,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw Sg(sl,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new ve(t);r.validateAsUri();const{scopes:o,...i}=e,s=new Ye(o||[]);s.appendScopes(Po);const a=()=>{switch(this.apiId){case He.ssoSilent:case He.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),at.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case at.NONE:case at.CONSENT:case at.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),Y(Vp)}},c={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw Y(Qp);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=ro.MATS_TELEMETRY,e.authenticationScheme===Ne.POP){const l={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new Io(this.browserCrypto);let d;if(c.keyId)d=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const h=await q(u.generateCnf.bind(u),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(l,this.logger);d=h.reqCnfString,c.keyId=h.kid,c.signPopToken=!0}c.reqCnf=d}return this.addRequestSKUs(c),c}handleExtraBrokerParams(e){var i;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(bl)&&e.extraParameters.hasOwnProperty(vc)&&e.extraParameters.hasOwnProperty(Ur);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[vc],r=e.extraParameters[Ur]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(i=this.performanceClient)==null||i.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class En{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(_.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:ro.CHANNEL_ID,extensionId:this.extensionId,responseId:In(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new En(e,t,r,ro.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const i=new En(e,t,r);return await i.sendHandshakeRequest(),i}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ro.CHANNEL_ID,extensionId:this.extensionId,responseId:In(),body:{method:br.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(Y($p)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==ro.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===br.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(Y(jp))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const i=t.body.method;if(i===br.Response){if(!r)return;const s=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")r.reject(Rc(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?r.reject(Rc(s.result.code,s.result.description,s.result.ext)):r.resolve(s.result);else throw Sg(sl,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(i===br.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(i){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${i}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(i):o&&o.reject(i)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Ne.BEARER:case Ne.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Gl{constructor(e,t,r,o,i){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(_.HandleCodeResponse,t.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(o){throw o instanceof fr&&o.subError===Fr?Y(Fr):o}return q(this.handleCodeResponseFromServer.bind(this),_.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(_.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await q(this.authModule.updateAuthority.bind(this.authModule),_.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const i=this.createCcsCredentials(t);i&&(this.authCodeRequest.ccsCredential=i)}return await q(this.authModule.acquireToken.bind(this.authModule),_.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:qt.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:qt.UPN}:null}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function um(n,e,t){const r=vs(n);if(!r)throw cp(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),Y(wp)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),Y(Ep));return r}function OI(n,e,t){if(!n.state)throw Y(Nl);const r=sm(e,n.state);if(!r)throw Y(_p);if(r.interactionType!==t)throw Y(bp)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class PI extends No{constructor(e,t,r,o,i,s,a,c,l,u){super(e,t,r,o,i,s,a,l,u),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=c}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||Po,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,i=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,i)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,i))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var i;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(He.acquireTokenPopup),o=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ee.Popup);im(o.authority);try{const s=await q(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),a=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),c=En.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let l;c&&(l=this.performanceClient.startMeasurement(_.FetchAccountIdWithNativeBroker,e.correlationId));const u=await a.getAuthCodeUrl({...o,nativeBroker:c}),d=new Gl(a,this.browserStorage,s,this.logger,this.performanceClient),h=this.initiateAuthRequest(u,t);this.eventHandler.emitEvent(oe.POPUP_OPENED,ee.Popup,{popupWindow:h},null);const f=await this.monitorPopupForHash(h,t.popupWindowParent),C=$r(um,_.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(f,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Tn.removeThrottle(this.browserStorage,this.config.auth.clientId,s),C.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),l&&l.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw Y(Oi);const v=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,C.accountId,this.nativeStorage,o.correlationId),{userRequestState:E}=nn.parseRequestState(this.browserCrypto,o.state);return await v.acquireToken({...o,state:E,prompt:void 0})}return await d.handleCodeResponse(C,o)}catch(s){throw(i=t.popup)==null||i.close(),s instanceof Fe&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),s}}async logoutPopupAsync(e,t,r,o){var s,a,c,l;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(oe.LOGOUT_START,ee.Popup,e);const i=this.initializeServerTelemetryManager(He.logoutPopup);try{await this.clearCacheOnLogout(e.account);const u=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:r,account:e.account||void 0});try{u.authority.endSessionEndpoint}catch{if((s=e.account)!=null&&s.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===qn.OIDC){if(this.browserStorage.removeAccount((a=e.account)==null?void 0:a.homeAccountId,this.correlationId),this.eventHandler.emitEvent(oe.LOGOUT_SUCCESS,ee.Popup,e),o){const f={apiId:He.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=ve.getAbsoluteUrl(o,Bn());await this.navigationClient.navigateInternal(C,f)}(c=t.popup)==null||c.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(oe.LOGOUT_SUCCESS,ee.Popup,e);const h=this.openPopup(d,t);if(this.eventHandler.emitEvent(oe.POPUP_OPENED,ee.Popup,{popupWindow:h},null),await this.monitorPopupForHash(h,t.popupWindowParent).catch(()=>{}),o){const f={apiId:He.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=ve.getAbsoluteUrl(o,Bn());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${C}`),await this.navigationClient.navigateInternal(C,f)}else this.logger.verbose("No main window navigation requested")}catch(u){throw(l=t.popup)==null||l.close(),u instanceof Fe&&(u.setCorrelationId(this.correlationId),i.cacheFailedRequest(u)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(oe.LOGOUT_FAILURE,ee.Popup,null,u),this.eventHandler.emitEvent(oe.LOGOUT_END,ee.Popup),u}this.eventHandler.emitEvent(oe.LOGOUT_END,ee.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),Y(ra)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const i=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(i),o(Y(Fr));return}let s="";try{s=e.location.href}catch{}if(!s||s==="about:blank")return;clearInterval(i);let a="";const c=this.config.auth.OIDCOptions.serverResponseType;e&&(c===ki.QUERY?a=e.location.search:a=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(a)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw Y(Rp);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),Y(Sp)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var f,C,p,v;const i=o.screenLeft?o.screenLeft:o.screenX,s=o.screenTop?o.screenTop:o.screenY,a=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=(f=r.popupSize)==null?void 0:f.width,u=(C=r.popupSize)==null?void 0:C.height,d=(p=r.popupPosition)==null?void 0:p.top,h=(v=r.popupPosition)==null?void 0:v.left;return(!l||l<0||l>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=Bt.POPUP_WIDTH),(!u||u<0||u>c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),u=Bt.POPUP_HEIGHT),(!d||d<0||d>c)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),d=Math.max(0,c/2-Bt.POPUP_HEIGHT/2+s)),(!h||h<0||h>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),h=Math.max(0,a/2-Bt.POPUP_WIDTH/2+i)),o.open(e,t,`width=${l}, height=${u}, top=${d}, left=${h}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(ee.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Bt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Bt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class nh{constructor(e,t,r,o,i){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(ke.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(ke.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:He.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),Y(ra)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),o=this.browserStorage.getTemporaryCache(r);if(!o)throw H(ps,"Cached State");let i;try{i=this.authModule.handleFragmentResponse(e,o)}catch(l){throw l instanceof fr&&l.subError===Fr?Y(Fr):l}const s=this.browserStorage.generateNonceKey(o),a=this.browserStorage.getTemporaryCache(s);if(this.authCodeRequest.code=i.code,i.cloud_instance_host_name&&await q(this.authModule.updateAuthority.bind(this.authModule),_.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(i.cloud_instance_host_name,this.authCodeRequest.correlationId),i.nonce=a||void 0,i.state=o,i.client_info)this.authCodeRequest.clientInfo=i.client_info;else{const l=this.checkCcsCredentials();l&&(this.authCodeRequest.ccsCredential=l)}const c=await this.authModule.acquireToken(this.authCodeRequest,i);return this.browserStorage.cleanRequestByState(t),c}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(ke.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function NI(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class MI extends No{constructor(e,t,r,o,i,s,a,c,l,u){super(e,t,r,o,i,s,a,l,u),this.nativeStorage=c}async acquireToken(e){const t=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ee.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(He.acquireTokenRedirect),o=i=>{i.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(oe.RESTORE_FROM_BFCACHE,ee.Redirect))};try{const i=await q(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),s=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),a=new nh(s,this.browserStorage,i,this.logger,this.performanceClient),c=await s.getAuthCodeUrl({...t,nativeBroker:En.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),l=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${l}`),window.addEventListener("pageshow",o),await a.initiateAuthRequest(c,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:l,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(i){throw i instanceof Fe&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(t.state),i}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(He.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,i]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(ee.Redirect),NI()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const s=this.browserStorage.getTemporaryCache(ke.ORIGIN_URI,!0)||R.EMPTY_STRING,a=ve.removeHashFromUrl(s),c=ve.removeHashFromUrl(window.location.href);if(a===c&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),s.indexOf("#")>-1&&Bb(s),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Kl()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(ke.URL_HASH,i,!0);const l={apiId:He.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let u=!0;if(!s||s==="null"){const d=qb();this.browserStorage.setTemporaryCache(ke.ORIGIN_URI,d,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),u=await this.navigationClient.navigateInternal(d,l)}else this.logger.verbose(`Navigating to loginRequestUrl: ${s}`),u=await this.navigationClient.navigateInternal(s,l);if(!u)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof Fe&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(ee.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===ki.QUERY?t=window.location.search:t=window.location.hash);let r=vs(t);if(r){try{OI(r,this.browserCrypto,ee.Redirect)}catch(i){return i instanceof Fe&&this.logger.error(`Interaction type validation failed due to ${i.errorCode}: ${i.errorMessage}`),[null,""]}return Fb(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache(ke.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ke.URL_HASH)),o&&(r=vs(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw Y(Nl);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw Y(Oi);const c=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:l}=nn.parseRequestState(this.browserCrypto,r);return c.acquireToken({...o,state:l,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const i=this.browserStorage.getCachedAuthority(r);if(!i)throw Y(Ml);const s=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:i});return Tn.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new nh(s,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,i;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(He.logout);try{this.eventHandler.emitEvent(oe.LOGOUT_START,ee.Redirect,e),await this.clearCacheOnLogout(t.account);const s={apiId:He.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(a.authority.protocolMode===qn.OIDC)try{a.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((i=t.account)==null?void 0:i.homeAccountId,this.correlationId),this.eventHandler.emitEvent(oe.LOGOUT_SUCCESS,ee.Redirect,t);return}}const c=a.getLogoutUri(t);if(this.eventHandler.emitEvent(oe.LOGOUT_SUCCESS,ee.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}}catch(s){throw s instanceof Fe&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),this.eventHandler.emitEvent(oe.LOGOUT_FAILURE,ee.Redirect,null,s),this.eventHandler.emitEvent(oe.LOGOUT_END,ee.Redirect),s}this.eventHandler.emitEvent(oe.LOGOUT_END,ee.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return ve.getAbsoluteUrl(t,Bn())}}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function xI(n,e,t,r,o){if(e.addQueueMeasurement(_.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),Y(ra);return o?q(LI,_.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):$r(UI,_.SilentHandlerLoadFrameSync,t,e,r)(n)}async function DI(n,e,t,r,o,i,s){return r.addQueueMeasurement(_.SilentHandlerMonitorIframeForHash,i),new Promise((a,c)=>{e{window.clearInterval(u),c(Y(kp))},e),u=window.setInterval(()=>{let d="";const h=n.contentWindow;try{d=h?h.location.href:""}catch{}if(!d||d==="about:blank")return;let f="";h&&(s===ki.QUERY?f=h.location.search:f=h.location.hash),window.clearTimeout(l),window.clearInterval(u),a(f)},t)}).finally(()=>{$r(HI,_.RemoveHiddenIframe,o,r,i)(n)})}function LI(n,e,t,r){return t.addQueueMeasurement(_.SilentHandlerLoadFrame,r),new Promise((o,i)=>{const s=dm();window.setTimeout(()=>{if(!s){i("Unable to load iframe");return}s.src=n,o(s)},e)})}function UI(n){const e=dm();return e.src=n,e}function dm(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function HI(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class FI extends No{constructor(e,t,r,o,i,s,a,c,l,u,d){super(e,t,r,o,i,s,c,u,d),this.apiId=a,this.nativeStorage=l}async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==at.NONE&&t.prompt!==at.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${at.NONE}`),t.prompt=at.NONE):t.prompt=at.NONE;const r=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,ee.Silent);im(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let i;try{return i=await q(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await q(this.silentTokenHelper.bind(this),_.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(i,r)}catch(s){if(s instanceof Fe&&(s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s)),!i||!(s instanceof Fe)||s.errorCode!==Bt.INVALID_GRANT_ERROR)throw s;this.performanceClient.addFields({retryError:s.errorCode},this.correlationId);const a=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,ee.Silent);return await q(this.silentTokenHelper.bind(this),_.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(i,a)}}logout(){return Promise.reject(Y(oa))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(_.SilentIframeClientTokenHelper,r);const o=await q(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),i=await q(e.getAuthCodeUrl.bind(e),_.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:En.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),s=new Gl(e,this.browserStorage,o,this.logger,this.performanceClient),a=await q(xI,_.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(i,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),c=this.config.auth.OIDCOptions.serverResponseType,l=await q(DI,_.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),u=$r(um,_.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(l,c,this.logger);if(u.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw Y(Oi);const d=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,u.accountId,this.browserStorage,r),{userRequestState:h}=nn.parseRequestState(this.browserCrypto,t.state);return q(d.acquireToken.bind(d),_.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:h,prompt:t.prompt||at.NONE})}return q(s.handleCodeResponse.bind(s),_.HandleCodeResponse,this.logger,this.performanceClient,r)(u,t)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class BI extends No{async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentRefreshClientAcquireToken,e.correlationId);const t=await q(jl,_.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(He.acquireTokenSilent_silentFlow),i=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return q(i.acquireTokenByRefreshToken.bind(i),_.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(s=>{throw s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),s})}logout(){return Promise.reject(Y(oa))}async createRefreshTokenClient(e){const t=await q(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Ac(t,this.performanceClient)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class KI{constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw Y(ia);const o=e.correlationId||In(),i=t.id_token?qr(t.id_token,_n):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.authority?new pt(pt.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||In()):void 0,c=this.loadAccount(e,r.clientInfo||t.client_info||"",o,i,a),l=this.loadIdToken(t,c.homeAccountId,c.environment,c.realm,o),u=this.loadAccessToken(e,t,c.homeAccountId,c.environment,c.realm,r,o),d=this.loadRefreshToken(t,c.homeAccountId,c.environment,o);return this.generateAuthenticationResult(e,{account:c,idToken:l,accessToken:u,refreshToken:d},i,a)}loadAccount(e,t,r,o,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const l=rt.createFromAccountInfo(e.account);return this.storage.setAccount(l,r),l}else if(!i||!t&&!o)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),Y(Hp);const s=rt.generateHomeAccountId(t,i.authorityType,this.logger,this.cryptoObj,o),a=o==null?void 0:o.tid,c=Rl(this.storage,i,s,_n,r,o,t,i.hostnameAndPort,a,void 0,void 0,this.logger);return this.storage.setAccount(c,r),c}loadIdToken(e,t,r,o,i){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=Js(t,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(s,i),s}loadAccessToken(e,t,r,o,i,s,a){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const c=t.scope?Ye.fromString(t.scope):new Ye(e.scopes),l=s.expiresOn||t.expires_in+new Date().getTime()/1e3,u=s.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,d=Xs(r,o,t.access_token,this.config.auth.clientId,i,c.printScopes(),l,u,_n);return this.storage.setAccessTokenCredential(d,a),d}loadRefreshToken(e,t,r,o){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const i=Vg(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(i,o),i}generateAuthenticationResult(e,t,r,o){var u,d,h;let i="",s=[],a=null,c;t!=null&&t.accessToken&&(i=t.accessToken.secret,s=Ye.fromString(t.accessToken.target).asArray(),a=new Date(Number(t.accessToken.expiresOn)*1e3),c=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const l=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:s,account:l.getAccountInfo(),idToken:((u=t.idToken)==null?void 0:u.secret)||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:c,familyId:((d=t.refreshToken)==null?void 0:d.familyId)||"",tokenType:((h=t==null?void 0:t.accessToken)==null?void 0:h.tokenType)||"",state:e.state||"",cloudGraphHostName:l.cloudGraphHostName||"",msGraphHost:l.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class qI extends Cp{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class $I extends No{constructor(e,t,r,o,i,s,a,c,l,u){super(e,t,r,o,i,s,c,l,u),this.apiId=a}async acquireToken(e){if(!e.code)throw Y(Fp);const t=await q(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,ee.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},i=await q(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),s=new qI(i);this.logger.verbose("Auth code client created");const a=new Gl(s,this.browserStorage,o,this.logger,this.performanceClient);return await q(a.handleCodeResponseFromServer.bind(a),_.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof Fe&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(Y(oa))}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function dn(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function zi(n,e){try{ql(n)}catch(t){throw e.end({success:!1},t),t}}class aa{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ro(this.logger,this.performanceClient):ms,this.eventHandler=new pI(this.logger),this.browserStorage=this.isBrowserEnvironment?new Sc(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,tb(this.config.auth),this.performanceClient):aI(this.config.auth.clientId,this.logger);const t={cacheLocation:Ot.MemoryStorage,temporaryCacheLocation:Ot.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new Sc(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new KI(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new aa(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(oe.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(_.InitializeClientApplication,t);if(this.eventHandler.emitEvent(oe.INITIALIZE_START),r)try{this.nativeExtensionProvider=await En.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(i){this.logger.verbose(i)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await q(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),_.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(oe.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),om(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&En.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,i=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache(ke.CORRELATION_ID,!0)||"",s=this.performanceClient.startMeasurement(_.AcquireTokenRedirect,i);this.eventHandler.emitEvent(oe.HANDLE_REDIRECT_START,ee.Redirect);let a;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const c=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);a=q(c.handleRedirectPromise.bind(c),_.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(this.performanceClient,s.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const c=this.createRedirectClient(i);a=q(c.handleRedirectPromise.bind(c),_.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(e,s)}return a.then(c=>(c?(t.length{const l=c;throw t.length>0?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_FAILURE,ee.Redirect,null,l):this.eventHandler.emitEvent(oe.LOGIN_FAILURE,ee.Redirect,null,l),this.eventHandler.emitEvent(oe.HANDLE_REDIRECT_END,ee.Redirect),s.end({success:!1},l),c})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(_.AcquireTokenPreRedirect,t);r.add({accountType:dn(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=s=>{const a=typeof o=="function"?o(s):void 0;return a!==!1?r.end({success:!0}):r.discard(),a};else{const s=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=a=>{const c=typeof s=="function"?s(a):void 0;return c!==!1?r.end({success:!0}):r.discard(),c}}const i=this.getAllAccounts().length>0;try{Xd(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),i?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_START,ee.Redirect,e):this.eventHandler.emitEvent(oe.LOGIN_START,ee.Redirect,e);let s;return this.nativeExtensionProvider&&this.canUseNative(e)?s=new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(c=>{if(c instanceof An&&Zr(c))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(c instanceof cn)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):s=this.createRedirectClient(t).acquireToken(e),await s}catch(s){throw r.end({success:!1},s),i?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_FAILURE,ee.Redirect,null,s):this.eventHandler.emitEvent(oe.LOGIN_FAILURE,ee.Redirect,null,s),s}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(_.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:dn(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),zi(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(s){return Promise.reject(s)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_START,ee.Popup,e):this.eventHandler.emitEvent(oe.LOGIN_START,ee.Popup,e);let i;return this.canUseNative(e)?i=this.acquireTokenNative({...e,correlationId:t},He.acquireTokenPopup).then(s=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:dn(s.account)}),s)).catch(s=>{if(s instanceof An&&Zr(s))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(s instanceof cn)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),s}):i=this.createPopupClient(t).acquireToken(e),i.then(s=>(o.length(o.length>0?this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_FAILURE,ee.Popup,null,s):this.eventHandler.emitEvent(oe.LOGIN_FAILURE,ee.Popup,null,s),r.end({success:!1},s),Promise.reject(s)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var i,s;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(_.SsoSilent,t),(i=this.ssoSilentMeasurement)==null||i.add({scenarioId:e.scenarioId,accountType:dn(e.account)}),zi(this.initialized,this.ssoSilentMeasurement),(s=this.ssoSilentMeasurement)==null||s.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(oe.SSO_SILENT_START,ee.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,He.ssoSilent).catch(a=>{if(a instanceof An&&Zr(a))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw a}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(a=>{var c;return this.eventHandler.emitEvent(oe.SSO_SILENT_SUCCESS,ee.Silent,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!0,isNativeBroker:a.fromNativeBroker,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:dn(a.account)}),a}).catch(a=>{var c;throw this.eventHandler.emitEvent(oe.SSO_SILENT_FAILURE,ee.Silent,null,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(_.AcquireTokenByCode,t);zi(this.initialized,r),this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_BY_CODE_START,ee.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw Y(Kp);if(e.code){const o=e.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),i=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(s=>(this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_BY_CODE_SUCCESS,ee.Silent,s),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:s.fromNativeBroker,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length,accountType:dn(s.account)}),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_BY_CODE_FAILURE,ee.Silent,null,s),r.end({success:!1},s),s}),this.hybridAuthCodeResponses.set(o,i)),await i}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},He.acquireTokenByCode,e.nativeAccountId).catch(i=>{throw i instanceof An&&Zr(i)&&(this.nativeExtensionProvider=void 0),i});return r.end({accountType:dn(o.account),success:!0}),o}else throw Y(qp);else throw Y(Bp)}catch(o){throw this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_BY_CODE_FAILURE,ee.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(_.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(i=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:i.fromCache,isNativeBroker:i.fromNativeBroker}),i}).catch(i=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!1},i),i}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(_.AcquireTokenFromCache,e.correlationId),t){case Lt.Default:case Lt.AccessToken:case Lt.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return q(r.acquireToken.bind(r),_.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw H(Fn)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(_.AcquireTokenByRefreshToken,e.correlationId),t){case Lt.Default:case Lt.AccessTokenAndRefreshToken:case Lt.RefreshToken:case Lt.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return q(r.acquireToken.bind(r),_.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw H(Fn)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(_.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return q(t.acquireToken.bind(t),_.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return Xd(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return ql(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){const t=this.getRequestCorrelationId();return cI(this.logger,this.browserStorage,this.isBrowserEnvironment,t,e)}getAccount(e){const t=this.getRequestCorrelationId();return lI(e,this.logger,this.browserStorage,t)}getAccountByUsername(e){const t=this.getRequestCorrelationId();return uI(e,this.logger,this.browserStorage,t)}getAccountByHomeId(e){const t=this.getRequestCorrelationId();return dI(e,this.logger,this.browserStorage,t)}getAccountByLocalId(e){const t=this.getRequestCorrelationId();return hI(e,this.logger,this.browserStorage,t)}setActiveAccount(e){const t=this.getRequestCorrelationId();fI(e,this.browserStorage,t)}getActiveAccount(){const e=this.getRequestCorrelationId();return gI(this.browserStorage,e)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=rt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw Y(Oi);return new lo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!En.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case at.NONE:case at.CONSENT:case at.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new PI(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new MI(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new FI(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new lm(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new BI(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new $I(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,He.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return rm(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(it.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(oe.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!rt.isAccountEntity(o))return;const s=bo.toObject(new rt,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(oe.ACCOUNT_ADDED,void 0,s)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(oe.ACCOUNT_REMOVED,void 0,s))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?In():R.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Wd})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Wd})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(_.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),zi(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw Y(Mp);r.add({accountType:dn(o)});const i={clientId:this.config.auth.clientId,authority:e.authority||R.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},s=JSON.stringify(i),a=this.activeSilentTokenRequests.get(s);if(typeof a>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const c=q(this.acquireTokenSilentAsync.bind(this),_.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},o).then(l=>(this.activeSilentTokenRequests.delete(s),r.end({success:!0,fromCache:l.fromCache,isNativeBroker:l.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length}),l)).catch(l=>{throw this.activeSilentTokenRequests.delete(s),r.end({success:!1},l),l});return this.activeSilentTokenRequests.set(s,c),{...await c,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await a,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(_.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_START,ee.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await q(TI,_.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),i=e.cacheLookupPolicy||Lt.Default;return this.acquireTokenSilentNoIframe(o,i).catch(async a=>{if(jI(a,i))if(this.activeIframeRequest)if(i!==Lt.Skip){const[l,u]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${u}`,o.correlationId);const d=this.performanceClient.startMeasurement(_.AwaitConcurrentIframe,o.correlationId);d.add({awaitIframeCorrelationId:u});const h=await l;if(d.end({success:h}),h)return this.logger.verbose(`Parallel iframe request with correlationId: ${u} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: ${u} failed. Interaction is required.`),a}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),q(this.acquireTokenBySilentIframe.bind(this),_.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let l;return this.activeIframeRequest=[new Promise(u=>{l=u}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),q(this.acquireTokenBySilentIframe.bind(this),_.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(u=>(l(!0),u)).catch(u=>{throw l(!1),u}).finally(()=>{this.activeIframeRequest=void 0})}else throw a}).then(a=>(this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_SUCCESS,ee.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_FAILURE,ee.Silent,null,a),a}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return En.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,He.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof An&&Zr(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,H(Fn)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),q(this.acquireTokenFromCache.bind(this),_.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===Lt.AccessToken)throw r;return this.eventHandler.emitEvent(oe.ACQUIRE_TOKEN_NETWORK_START,ee.Silent,e),q(this.acquireTokenByRefreshToken.bind(this),_.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function jI(n,e){const t=!(n instanceof cn&&n.subError!==na),r=n.errorCode===Bt.INVALID_GRANT_ERROR||n.errorCode===Fn,o=t&&r||n.errorCode===As||n.errorCode===Sl,i=bb.includes(e);return o&&i}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function GI(n,e){const t=new Br(n);return await t.initialize(),aa.createController(t,e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Vl{static async createPublicClientApplication(e){const t=await GI(e);return new Vl(e,t)}constructor(e,t){this.controller=t||new aa(new Br(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const _s=new Vl({auth:{clientId:"9079054c-9620-4757-a256-23413042f1ef",authority:"https://login.microsoftonline.com/e519c2e6-bc6d-4fdf-8d9c-923c2f002385",redirectUri:"https://optical-dev.oliver.solutions/cc-dashboard/"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1}}),VI=["openid","profile","email"];async function zI(){await _s.initialize(),await _s.handleRedirectPromise()}const hm=YC("auth",()=>{const n=Oe(null),e=Oe(null),t=Oe(!1),r=Oe(null),o=Te(()=>n.value!==null),i=Te(()=>{var u;return((u=e.value)==null?void 0:u.role)==="admin"});async function s(){var u,d;t.value=!0,r.value=null;try{const f=(await _s.loginPopup({scopes:VI})).idToken,C=await fs.post("/api/auth/microsoft",{id_token:f});n.value=C.data.access_token,await c()}catch(h){const f=h;throw r.value=((d=(u=f.response)==null?void 0:u.data)==null?void 0:d.detail)??f.message??"Login failed",h}finally{t.value=!1}}async function a(){n.value=null,e.value=null;try{await _s.clearCache()}catch{}}async function c(){const u=await fs.get("/api/auth/me");e.value=u.data}function l(){return n.value}return{token:n,user:e,loading:t,error:r,isAuthenticated:o,isAdmin:i,loginWithMicrosoft:s,logout:a,fetchMe:c,getToken:l}}),QI=[{path:"/login",name:"login",component:()=>xt(()=>import("./LoginView-CZczoEHN.js"),__vite__mapDeps([0,1,2])),meta:{public:!0}},{path:"/",component:()=>xt(()=>import("./AppLayout-BwfSs1xS.js"),[]),children:[{path:"",name:"dashboard",component:()=>xt(()=>import("./DashboardView-sKPaoFjB.js"),__vite__mapDeps([3,4,1,2,5,6,7,8]))},{path:"calendar",name:"calendar",component:()=>xt(()=>import("./CalendarView-B1FdrWUb.js"),__vite__mapDeps([9,4,2,7,8,10,11,12,13,14,15,16]))},{path:"planner",name:"planner",component:()=>xt(()=>import("./PlannerView-A-MLkrrq.js"),__vite__mapDeps([17,10,11,7,8,2,12,13,15]))},{path:"projects",name:"projects",component:()=>xt(()=>import("./ProjectsView-B-1asG5a.js"),__vite__mapDeps([18,4,1,2,6,8]))},{path:"projects/:id/:date?",name:"project-detail",component:()=>xt(()=>import("./ProjectDetailView-BsS6YxEL.js"),__vite__mapDeps([19,4,1,2,5,8]))},{path:"live",name:"live",component:()=>xt(()=>import("./LiveView-Upgit3GU.js"),__vite__mapDeps([20,1,2,7,8]))},{path:"reports",name:"reports",component:()=>xt(()=>import("./ReportsView-BKu3ZSb5.js"),__vite__mapDeps([21,1,2,15,7,8,14,22]))},{path:"keys",name:"keys",component:()=>xt(()=>import("./KeysView-IKma-C2I.js"),__vite__mapDeps([23,24,1,2,7,8,11,12]))},{path:"devops",name:"devops",component:()=>xt(()=>import("./DevopsView-BCFbLN9X.js"),__vite__mapDeps([25,13,1,2,5,7,8,26,12]))},{path:"settings",name:"settings",component:()=>xt(()=>import("./SettingsView-el_4sG2N.js"),__vite__mapDeps([27,13,1,2,5,12,7,8,26]))},{path:"admin",name:"admin",component:()=>xt(()=>import("./AdminView-p3memzOi.js"),__vite__mapDeps([28,24,1,2,15,8])),meta:{adminOnly:!0}}]},{path:"/:pathMatch(.*)*",redirect:"/"}],kc=NA({history:uA("/cc-dashboard/"),routes:QI});kc.beforeEach((n,e,t)=>{const r=hm();if(n.meta.public){t();return}if(!r.isAuthenticated){t({name:"login",query:{redirect:n.fullPath}});return}if(n.meta.adminOnly&&!r.isAdmin){t({name:"dashboard"});return}t()});zI().then(()=>{const n=KC(_T),e=jC();n.use(e),n.use(kc),n.use(Pv);const t=hm();Tw(()=>t.getToken(),()=>{t.logout(),kc.push({name:"login"})}),n.mount("#app")});export{lr as A,YC as B,nS as C,eS as D,fs as E,We as F,nf as G,JI as H,sS as K,SA as R,ZI as T,xt as _,sn as a,XI as b,je as c,ko as d,Ge as e,aS as f,cS as g,dt as h,Tr as i,Te as j,Hn as k,_y as l,Wt as m,Ht as n,Ee as o,za as p,Oe as q,qa as r,Do as s,Bo as t,hm as u,Mr as v,vr as w,ss as x,YI as y,tS as z}; diff --git a/src/static/index.html b/src/static/index.html index 5b1fd7a..f4d1a7b 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -14,7 +14,7 @@ else { document.documentElement.classList.remove('dark'); } })(); - + diff --git a/web/src/components/tasks/TaskCard.vue b/web/src/components/tasks/TaskCard.vue index 5c4e5da..c70745c 100644 --- a/web/src/components/tasks/TaskCard.vue +++ b/web/src/components/tasks/TaskCard.vue @@ -54,7 +54,7 @@ const priorityColor = (p: number) => {

{{ task.title }}

-
+