@aracreate/arm-ui 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{a as pa,b as D,c as Ot}from"./chunk-LGJWNA6J.mjs";import{Box as Ml,Flex as zl,Grid as Fl,Container as Ll,Section as Hl,Inset as Ol,AspectRatio as _l,ScrollArea as Wl,Separator as Vl,Text as $l,Heading as Gl,Blockquote as Ul,Code as jl,Em as Kl,Kbd as Yl,Link as ql,Quote as Xl,Strong as Zl,Button as Jl,IconButton as Ql,TextField as ec,TextArea as rc,Checkbox as tc,CheckboxGroup as oc,CheckboxCards as ac,Radio as nc,RadioGroup as ic,RadioCards as sc,Select as lc,Slider as cc,Switch as dc,SegmentedControl as pc,Dialog as gc,AlertDialog as uc,DropdownMenu as mc,ContextMenu as fc,Popover as vc,HoverCard as yc,Tooltip as hc,Portal as bc,Avatar as xc,Badge as Cc,Callout as wc,Card as Tc,DataList as Sc,Progress as Rc,Spinner as kc,Table as Dc,Tabs as Ic,TabNav as Ac,AccessibleIcon as Pc,Slot as Ec,Slottable as Nc,VisuallyHidden as Bc}from"@radix-ui/themes";import{jsx as ua}from"react/jsx-runtime";function ga({width:e="100%",height:r="var(--space-4)",radius:t="var(--radius-2)",circle:o=!1,mb:a,className:n,style:i}){return ua("div",{className:["skeleton",n].filter(Boolean).join(" "),"aria-hidden":"true",style:{width:e,height:r,borderRadius:o?"50%":t,marginBottom:a,...i}})}import*as We from"react";import*as ie from"@radix-ui/react-accordion";import{ChevronDownIcon as ma}from"@radix-ui/react-icons";import{jsx as Ee,jsxs as fa}from"react/jsx-runtime";var _t=We.forwardRef(({className:e="",...r},t)=>Ee(ie.Root,{ref:t,className:`arm-accordion ${e}`,...r}));_t.displayName="Accordion";var Wt=We.forwardRef(({className:e="",...r},t)=>Ee(ie.Item,{ref:t,className:`arm-accordion__item ${e}`,...r}));Wt.displayName="AccordionItem";var Vt=We.forwardRef(({className:e="",children:r,...t},o)=>Ee(ie.Header,{className:"arm-accordion__header",children:fa(ie.Trigger,{ref:o,className:`arm-accordion__trigger ${e}`,...t,children:[r,Ee(ma,{"aria-hidden":!0,className:"arm-accordion__chevron"})]})}));Vt.displayName="AccordionTrigger";var $t=We.forwardRef(({className:e="",children:r,...t},o)=>Ee(ie.Content,{ref:o,className:`arm-accordion__content ${e}`,...t,children:Ee("div",{className:"arm-accordion__body",children:r})}));$t.displayName="AccordionContent";import*as cr from"react";import*as N from"@radix-ui/react-dialog";import{Cross2Icon as va}from"@radix-ui/react-icons";import{jsx as xe,jsxs as wa}from"react/jsx-runtime";var ya=N.Root,ha=N.Trigger,ba=N.Close,Gt=cr.forwardRef(({className:e="",side:r="right",size:t="md",children:o,...a},n)=>wa(N.Portal,{children:[xe(N.Overlay,{className:"arm-drawer__overlay"}),xe(N.Content,{ref:n,"data-side":r,"data-size":t,className:`arm-drawer ${e}`,...a,children:o})]}));Gt.displayName="DrawerContent";var xa=({className:e="",children:r,...t})=>xe("div",{className:`arm-drawer__header ${e}`,...t,children:r}),Ut=cr.forwardRef(({className:e="",...r},t)=>xe(N.Title,{ref:t,className:`arm-drawer__title ${e}`,...r}));Ut.displayName="DrawerTitle";var jt=cr.forwardRef(({className:e="",...r},t)=>xe(N.Description,{ref:t,className:`arm-drawer__description ${e}`,...r}));jt.displayName="DrawerDescription";var Ca=()=>xe(N.Close,{"aria-label":"Close",className:"arm-drawer__close",children:xe(va,{"aria-hidden":!0,className:"arm-drawer__close-icon"})});import{Box as Kt,Flex as Ta,Text as Sa}from"@radix-ui/themes";import{jsx as Fr,jsxs as qt}from"react/jsx-runtime";function Yt({title:e,trailing:r,style:t}){let o=typeof e=="string"||typeof e=="number"?Fr(Sa,{size:"3",weight:"medium",style:{color:"var(--accent-contrast)"},children:e}):e;return qt(Ta,{align:"center",justify:"between",gap:"3",px:"4",style:{background:"var(--accent-9)",minHeight:"var(--space-7)",...t},children:[o,r]})}function Ra({title:e,trailing:r,children:t,bodyPadding:o="4",style:a}){return qt(Kt,{style:{background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",overflow:"hidden",boxShadow:"var(--shadow-card)",...a},children:[Fr(Yt,{title:e,trailing:r}),Fr(Kt,{p:o,children:t})]})}import{AlertDialog as Ce,Button as Xt}from"@radix-ui/themes";var x={contentMax:"calc(15 * var(--space-9) + var(--space-5))",accountCardW:"calc(3 * var(--space-9) + var(--space-8))",accountCardMinH:"calc(2 * var(--space-9) - var(--space-2))",monthTitleMinW:"calc(3 * var(--space-9) - var(--space-1))",bigCalendarH:"calc(10 * var(--space-9))",sidebarColBasis:"calc(4 * var(--space-9) - var(--space-2))",sidebarColMin:"calc(3 * var(--space-9) + var(--space-6))",syncColMin:"calc(5 * var(--space-9))",syncColWide:"calc(7 * var(--space-9) + var(--space-6))",dialogSm:"calc(6 * var(--space-9) - var(--space-2))",dialogBody:"calc(5 * var(--space-9) + var(--space-7))",authFormMax:"calc(6 * var(--space-9) + var(--space-8))",brandLogoMax:"calc(6 * var(--space-9) + var(--space-8) - var(--space-1))",connectedAccountCardH:"calc(var(--space-9) - var(--space-1))",dialogMd:"calc(6 * var(--space-9) + var(--space-6))",dialogLg:"calc(7 * var(--space-9) - var(--space-1))",emptyStateMax:"calc(10 * var(--space-9))",emptyStateCopyMax:"calc(6 * var(--space-9))",providerChooserMax:"calc(6 * var(--space-9) + var(--space-6))",auditColTime:"calc(var(--space-9) + var(--space-2))",auditColAction:"calc(var(--space-9) + var(--space-5) + var(--space-1))",searchFieldW:"calc(3 * var(--space-9) + var(--space-5) + var(--space-1))",settingsGridMin:"calc(5 * var(--space-9) + var(--space-5))",placeholderMd:"calc(6 * var(--space-9) + var(--space-4))"};import{Flex as ka}from"@radix-ui/themes";import{jsx as Da}from"react/jsx-runtime";function J({children:e,justify:r="end",noTopMargin:t,pad:o="var(--space-5)",radius:a="var(--radius-5)"}){return Da(ka,{justify:r,style:{margin:`${t?"0":"var(--space-5)"} calc(-1 * ${o}) calc(-1 * ${o})`,padding:`var(--space-4) ${o}`,alignItems:"center",background:"var(--gray-2)",borderTop:"1px solid var(--gray-5)",borderRadius:`0 0 ${a} ${a}`},children:e})}import{jsx as we,jsxs as Lr}from"react/jsx-runtime";function Hr({title:e,description:r,confirmLabel:t="Yes",cancelLabel:o="Cancel",onConfirm:a,trigger:n,open:i,onOpenChange:l}){return Lr(Ce.Root,{open:i,onOpenChange:l,children:[n?we(Ce.Trigger,{children:n}):null,Lr(Ce.Content,{maxWidth:x.dialogSm,children:[we(Ce.Title,{size:"5",mb:"1",style:{fontFamily:"var(--heading-font-family)",fontWeight:"var(--font-weight-medium)"},children:e}),we(Ce.Description,{size:"2",color:"gray",mb:"5",children:r}),Lr(J,{justify:"between",noTopMargin:!0,children:[we(Ce.Cancel,{children:we(Xt,{size:"2",variant:"outline",color:"gray",children:o})}),we(Ce.Action,{children:we(Xt,{size:"2",className:"btn-amber-primary",onClick:a,children:t})})]})]})]})}import{PauseIcon as Ia}from"@radix-ui/react-icons";function y(e){return{width:`var(${e})`,height:`var(${e})`}}import{jsx as Zt,jsxs as Aa}from"react/jsx-runtime";function Or({label:e="Paused",style:r}){return Aa("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--space-1)",height:"calc(var(--space-4) + var(--space-1))",padding:"var(--space-1) var(--space-2)",border:"1px solid var(--color-paused)",borderRadius:999,background:"var(--color-panel-solid)",color:"var(--color-paused)",fontSize:"var(--font-size-1)",fontWeight:600,lineHeight:1,whiteSpace:"nowrap",...r},children:[Zt("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-3)",height:"var(--space-3)",flexShrink:0,borderRadius:"50%",border:"1px solid var(--color-paused)"},children:Zt(Ia,{style:y("--space-2")})}),e]})}import{Avatar as Pa,Box as Jt,DropdownMenu as Ne,Flex as Qt,IconButton as Ea,Text as eo}from"@radix-ui/themes";import{DotsVerticalIcon as Na,PauseIcon as Ba,PlayIcon as Ma,TrashIcon as za}from"@radix-ui/react-icons";import{jsx as U,jsxs as se}from"react/jsx-runtime";function Fa({name:e,email:r,avatarSrc:t,paused:o=!1,onPause:a,onResume:n,onDelete:i,onClick:l,badge:s,accentColor:c,style:g}){let p=U(eo,{as:l?"span":"p",size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)",minWidth:0},children:e});return se(Jt,{onClick:l,style:{width:x.accountCardW,minHeight:x.accountCardMinH,padding:"var(--space-3)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-4)",boxShadow:"var(--shadow-card)",cursor:l?"pointer":void 0,...g},children:[se(Qt,{align:"center",justify:"between",gap:"2",mb:"3",children:[se(Qt,{align:"center",gap:"2",style:{minWidth:0},children:[se("div",{style:{position:"relative",flexShrink:0},children:[U(Pa,{size:"3",radius:"full",src:t,fallback:e.charAt(0).toUpperCase()||"?",style:c?{background:c,color:"white"}:void 0}),s&&U("span",{style:{position:"absolute",right:"calc(-1 * var(--space-1))",bottom:"calc(-1 * var(--space-1))",width:"var(--space-4)",height:"var(--space-4)",borderRadius:"50%",background:"var(--color-panel-solid)",border:"1px solid var(--gray-4)",display:"inline-flex",alignItems:"center",justifyContent:"center",transform:"scale(0.72)"},children:s})]}),o&&U(Or,{})]}),se(Ne.Root,{children:[U(Ne.Trigger,{children:U(Ea,{variant:"ghost",color:"gray","aria-label":"Account actions",style:{flexShrink:0},onClick:u=>u.stopPropagation(),children:U(Na,{})})}),se(Ne.Content,{align:"end",onClick:u=>u.stopPropagation(),children:[o?se(Ne.Item,{onSelect:n,children:[U(Ma,{})," Resume"]}):se(Ne.Item,{onSelect:a,children:[U(Ba,{})," Pause"]}),se(Ne.Item,{color:"red",onSelect:i,children:[U(za,{})," Delete"]})]})]})]}),se(Jt,{style:{minWidth:0},children:[l?U("button",{type:"button",className:"card-title-button",onClick:u=>{u.stopPropagation(),l()},children:p}):p,U(eo,{as:"p",size:"1",color:"gray",truncate:!0,children:r})]})]})}import{Box as ro,Flex as to,Heading as La,IconButton as oo,Text as ao}from"@radix-ui/themes";import{ChevronLeftIcon as Ha,ChevronRightIcon as Oa}from"@radix-ui/react-icons";var _={h1:"6",h2:"5",h3:"4",h4:"3"};import{Fragment as Ka,jsx as O,jsxs as Wr}from"react/jsx-runtime";var _a=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],_r="var(--space-9)",Wa="var(--space-8)",no="var(--space-2)",Va=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"}),$a=new Intl.DateTimeFormat("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"});function Ga(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function io(e){return(e+6)%7}function Ua(e){let r=e.getMonth(),t=e.getFullYear(),o=new Date(t,r,1),a=new Date(t,r+1,0),n=io(o.getDay()),i=6-io(a.getDay()),l=new Date(t,r,1-n),s=n+a.getDate()+i;return Array.from({length:s},(c,g)=>{let p=new Date(l.getFullYear(),l.getMonth(),l.getDate()+g);return{date:p,inCurrentMonth:p.getMonth()===r}})}function so(e,r){return new Date(e.getFullYear(),e.getMonth()+r,1)}function ja({month:e,onMonthChange:r,events:t=[],dayDots:o,today:a,onSelectDay:n,style:i}){let l=a??new Date,s=Ua(e),c=new Set(t.map(g=>g.toDateString()));return Wr(to,{direction:"column",align:"center",gap:"4",style:i,children:[Wr(to,{align:"center",gap:"2",children:[O(oo,{type:"button",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r?.(so(e,-1)),children:O(Ha,{style:y("--space-4")})}),O(La,{as:"h2",size:_.h2,weight:"medium",style:{minWidth:x.monthTitleMinW,textAlign:"center"},children:Va.format(e)}),O(oo,{type:"button",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r?.(so(e,1)),children:O(Oa,{style:y("--space-4")})})]}),O(ro,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${_r})`,gap:no},children:_a.map(g=>O(ao,{size:"2",align:"center",style:{color:"var(--gray-11)"},children:g},g))}),O(ro,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${_r})`,gap:no},children:s.map(({date:g,inCurrentMonth:p})=>{let u=Ga(g,l),h=o?.get(g.toDateString()),v=c.has(g.toDateString()),f={position:"relative",width:_r,height:Wa,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:p?u?"var(--color-panel-solid)":"transparent":"var(--gray-2)",border:u?"1.5px solid var(--accent-9)":"none",borderRadius:u?"var(--radius-3)":p?void 0:"var(--radius-2)",padding:0,font:"inherit",cursor:n?"pointer":void 0},S=Wr(Ka,{children:[h&&h.length>0?O("span",{"aria-hidden":"true",style:{position:"absolute",bottom:"var(--space-1)",left:0,right:0,display:"flex",justifyContent:"center",gap:"2px"},children:h.slice(0,3).map((X,ne)=>O("span",{style:{width:"var(--space-1)",height:"var(--space-1)",borderRadius:"50%",background:X}},ne))}):v&&O("span",{"aria-hidden":"true",style:{position:"absolute",top:"var(--space-1)",right:"var(--space-2)",width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:"var(--accent-9)"}}),O(ao,{size:"3",style:{color:p?"var(--gray-12)":"var(--gray-11)",fontWeight:u?600:400},children:g.getDate()})]}),E=g.toISOString();return n?O("button",{type:"button",onClick:()=>n(g),"aria-label":$a.format(g),style:f,children:S},E):O("div",{style:f,children:S},E)})})]})}import{useEffect as Ya}from"react";import{Callout as Vr}from"@radix-ui/themes";import{CheckCircledIcon as qa,ExclamationTriangleIcon as Xa}from"@radix-ui/react-icons";import{jsx as Ve,jsxs as Za}from"react/jsx-runtime";function $r({msg:e,color:r="green",onDone:t,durationMs:o=3e3}){return Ya(()=>{let a=setTimeout(t,o);return()=>clearTimeout(a)},[t,o]),Ve("div",{style:{position:"fixed",bottom:"var(--space-5)",right:"var(--space-5)",zIndex:1e4,maxWidth:x.dialogBody,pointerEvents:"none"},children:Za(Vr.Root,{color:r,variant:"soft",size:"1",children:[Ve(Vr.Icon,{children:r==="red"?Ve(Xa,{}):Ve(qa,{})}),Ve(Vr.Text,{children:e})]})})}import{jsx as Ja}from"react/jsx-runtime";function B({children:e,size:r="var(--space-7)"}){return Ja("div",{style:{width:r,height:r,borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e})}import{Box as Qa,Flex as en,Text as lo}from"@radix-ui/themes";import{LockClosedIcon as rn}from"@radix-ui/react-icons";import{jsx as co,jsxs as Gr}from"react/jsx-runtime";function tn({title:e,time:r,detail:t,color:o,locked:a}){return Gr(en,{align:"center",justify:"between",style:{background:o,borderRadius:"var(--radius-3)",padding:"var(--space-3)",color:"white"},children:[Gr(Qa,{style:{minWidth:0},children:[co(lo,{as:"p",size:"2",weight:"medium",style:{color:"white"},truncate:!0,children:e}),Gr(lo,{as:"p",size:"1",style:{color:"rgba(255,255,255,0.85)"},truncate:!0,children:[r,t?` \xB7 ${t}`:""]})]}),a&&co(rn,{style:{flexShrink:0,color:"rgba(255,255,255,0.85)"}})]})}import{Box as on}from"@radix-ui/themes";import{jsx as an}from"react/jsx-runtime";function Ur({children:e,style:r,showBorder:t=!1,onActivate:o,selected:a=!1,className:n,"aria-label":i}){let l=!!o;function s(c){o&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())}return an(on,{role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":i,onClick:o,onKeyDown:l?s:void 0,className:["data-table-row",l&&"data-table-row--interactive",l&&a&&"data-table-row--selected",n].filter(Boolean).join(" "),style:{borderTop:t?"1px solid var(--gray-3)":void 0,...r},children:e})}import{useId as nn}from"react";import{Card as sn,Flex as jr,Text as Kr}from"@radix-ui/themes";import{jsx as le,jsxs as Be}from"react/jsx-runtime";function ln({label:e,value:r,delta:t,deltaDir:o,goodDirection:a,statusColor:n,sparkline:i}){return le(sn,{className:"metric-card",children:Be(jr,{direction:"column",p:"1",children:[Be(jr,{align:"center",justify:"between",mb:"3",children:[le(Kr,{as:"span",className:"ds-section-label",children:e}),le("div",{style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:n,flexShrink:0}})]}),le(Kr,{as:"p",className:"metric-card-value",children:r}),Be(jr,{align:"end",justify:"between",children:[Be(Kr,{size:"1",style:{color:o==="flat"?"var(--gray-11)":o===a?"var(--green-11)":"var(--red-11)",lineHeight:1.4},children:[o==="up"?"\u2191 ":o==="down"?"\u2193 ":"",t]}),le(cn,{data:i,color:n})]})]})})}function cn({data:e,color:r}){let a=Math.min(...e),i=Math.max(...e)-a||1,l=e.map((u,h)=>({x:h/(e.length-1)*72,y:28-(u-a)/i*28*.75-28*.1})),s=l.map((u,h)=>`${h===0?"M":"L"} ${u.x.toFixed(1)} ${u.y.toFixed(1)}`).join(" "),c=["M 0 28",...l.map(u=>`L ${u.x.toFixed(1)} ${u.y.toFixed(1)}`),"L 72 28 Z"].join(" "),p=`spk${nn().replace(/[^a-zA-Z0-9_-]/g,"")}`;return Be("svg",{width:72,height:28,viewBox:"0 0 72 28","aria-hidden":!0,style:{overflow:"visible",flexShrink:0},children:[le("defs",{children:Be("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[le("stop",{offset:"0%",stopColor:r,stopOpacity:"0.18"}),le("stop",{offset:"100%",stopColor:r,stopOpacity:"0"})]})}),le("path",{d:c,fill:`url(#${p})`}),le("path",{d:s,fill:"none",stroke:r,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})}import{Link as dn}from"react-router-dom";import{Button as pn,Card as gn,Flex as po,Text as go}from"@radix-ui/themes";import{ArrowRightIcon as un}from"@radix-ui/react-icons";import{jsx as Me,jsxs as dr}from"react/jsx-runtime";function mn({href:e,icon:r,name:t,description:o}){return dr(gn,{style:{height:"100%",display:"flex",flexDirection:"column"},children:[dr(po,{direction:"column",gap:"3",p:"1",flexGrow:"1",children:[dr(po,{align:"center",gap:"3",minWidth:"0",children:[Me(B,{children:r}),Me(go,{size:"4",weight:"medium",style:{color:"var(--gray-12)",fontFamily:"var(--font-poppins)"},truncate:!0,children:t})]}),Me(go,{size:"2",style:{color:"var(--gray-11)",fontFamily:"var(--font-poppins)",lineHeight:1.5},children:o})]}),Me(J,{pad:"var(--space-3)",radius:"var(--radius-4)",children:Me(pn,{size:"2",className:"btn-amber-primary",asChild:!0,children:dr(dn,{to:e,children:["Open",Me(un,{style:y("--space-3")})]})})})]})}import{Text as $e}from"@radix-ui/themes";import{jsx as Yr,jsxs as qr}from"react/jsx-runtime";function fn({tag:e,tagColor:r,msg:t,actor:o,timeAgo:a,timestamp:n,showBorder:i}){return qr(Ur,{showBorder:i,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",paddingBlock:"var(--space-2)",paddingInline:"var(--space-4)"},children:[Yr($e,{as:"span",size:"1",weight:"medium",className:"data-mono",style:{color:r,minWidth:"var(--space-6)",letterSpacing:"0.06em",flexShrink:0},children:e}),qr($e,{as:"span",size:"2",style:{flex:1,color:"var(--gray-11)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,o&&qr($e,{as:"span",size:"1",style:{color:"var(--gray-11)",marginLeft:"var(--space-2)"},children:["by ",o]})]}),a&&Yr($e,{as:"span",size:"1",color:"gray",style:{whiteSpace:"nowrap",flexShrink:0},children:a}),Yr($e,{as:"span",size:"1",className:"data-mono",style:{color:"var(--gray-11)",whiteSpace:"nowrap",flexShrink:0,minWidth:"var(--space-7)",textAlign:"right"},children:n})]})}import{Button as vn,Card as yn,Flex as hn,Text as bn}from"@radix-ui/themes";import{ExclamationTriangleIcon as xn}from"@radix-ui/react-icons";import{jsx as Ge,jsxs as wn}from"react/jsx-runtime";function Cn({onRetry:e,message:r="Couldn't load your dashboard."}){return Ge(yn,{children:wn(hn,{direction:"column",align:"center",justify:"center",py:"9",gap:"3",children:[Ge(B,{children:Ge(xn,{style:{...y("--space-5"),color:"var(--gray-7)"}})}),Ge(bn,{size:"2",color:"gray",children:r}),Ge(vn,{size:"2",color:"amber",variant:"solid",className:"btn-amber-primary",onClick:e,children:"Retry"})]})})}import{useMemo as Tn}from"react";import{Button as Sn,Flex as Rn,IconButton as pr,Text as kn}from"@radix-ui/themes";import{ChevronLeftIcon as Dn,ChevronRightIcon as In,DoubleArrowLeftIcon as An,DoubleArrowRightIcon as Pn}from"@radix-ui/react-icons";import{jsx as Q,jsxs as Bn}from"react/jsx-runtime";var ze="\u2026";function En(e,r,t){let o=t*2+5;if(r<=o)return Array.from({length:r},(c,g)=>g+1);let a=Math.max(e-t,1),n=Math.min(e+t,r),i=a>2,l=n<r-1;if(!i&&l)return[...Array.from({length:3+t*2},(g,p)=>p+1),ze,r];if(i&&!l){let c=3+t*2,g=Array.from({length:c},(p,u)=>r-c+u+1);return[1,ze,...g]}let s=Array.from({length:n-a+1},(c,g)=>a+g);return[1,ze,...s,ze,r]}function Nn({currentPage:e,totalPages:r,onPageChange:t,siblingCount:o=1,showFirstLast:a=!1,size:n="2"}){let i=Tn(()=>En(e,r,o),[e,r,o]),l=e<=1,s=e>=r;return Q(Rn,{asChild:!0,align:"center",gap:"1",children:Bn("nav",{"aria-label":"Pagination",children:[a&&Q(pr,{size:n,variant:"soft",color:"gray","aria-label":"First page",disabled:l,onClick:()=>t(1),children:Q(An,{})}),Q(pr,{size:n,variant:"soft",color:"gray","aria-label":"Previous page",disabled:l,onClick:()=>t(e-1),children:Q(Dn,{})}),i.map((c,g)=>c===ze?Q(kn,{size:n,color:"gray","aria-hidden":!0,style:{paddingInline:"var(--space-1)"},children:ze},`ellipsis-${g}`):Q(Sn,{size:n,"aria-label":`Page ${c}`,"aria-current":c===e?"page":void 0,variant:c===e?"solid":"soft",color:c===e?void 0:"gray",className:c===e?"btn-amber-primary":void 0,onClick:()=>c!==e&&t(c),children:c},c)),Q(pr,{size:n,variant:"soft",color:"gray","aria-label":"Next page",disabled:s,onClick:()=>t(e+1),children:Q(In,{})}),a&&Q(pr,{size:n,variant:"soft",color:"gray","aria-label":"Last page",disabled:s,onClick:()=>t(r),children:Q(Pn,{})})]})})}var gr={admin:{label:"Admin",color:"amber"},operator:{label:"Operator",color:"blue"},user:{label:"Platform User",color:"gray"}},Mn={admin:gr.admin.label,operator:gr.operator.label,user:gr.user.label},zn={active:{label:"Active",color:"var(--color-success)"},inactive:{label:"Inactive",color:"var(--gray-11)"},suspended:{label:"Suspended",color:"var(--color-danger)"}},Fn={ok:"var(--green-9)",warn:"var(--orange-9)",error:"var(--red-9)"},Ln={auth:{tag:"AUTH",color:"var(--gray-11)"},sync:{tag:"SYNC",color:"var(--blue-11)"},role:{tag:"ROLE",color:"var(--violet-11)"},provision:{tag:"PROV",color:"var(--green-11)"},health:{tag:"HLTH",color:"var(--teal-11)"},error:{tag:"ERR!",color:"var(--red-11)"}},uo={USER_UPDATED:{label:"User updated",tag:"UPD",badge:"amber",color:"var(--amber-11)"},USER_DISABLED:{label:"User disabled",tag:"DIS",badge:"red",color:"var(--red-11)"},USER_ENABLED:{label:"User enabled",tag:"ENA",badge:"green",color:"var(--teal-11)"},USER_APPROVED:{label:"User approved",tag:"APPR",badge:"green",color:"var(--green-11)"},USER_REJECTED:{label:"User rejected",tag:"REJ",badge:"red",color:"var(--red-11)"},SIGNUP_NOTIFICATIONS_ON:{label:"Signup notifications on",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},SIGNUP_NOTIFICATIONS_OFF:{label:"Signup notifications off",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},APPROVAL_EMAIL_RESENT:{label:"Approval email resent",tag:"MAIL",badge:"amber",color:"var(--amber-11)"},USER_DELETED:{label:"User deleted",tag:"DEL",badge:"yellow",color:"var(--red-11)"},ADMIN_GRANTED:{label:"Admin granted",tag:"ADMN",badge:"gray",color:"var(--violet-11)"},ADMIN_REVOKED:{label:"Admin revoked",tag:"ADMN",badge:"gray",color:"var(--orange-11)"},ADMIN_ROLE_CHANGED:{label:"Role changed",tag:"ROLE",badge:"amber",color:"var(--violet-11)"},SESSION_REVOKED:{label:"Session revoked",tag:"SESS",badge:"gray",color:"var(--gray-11)"},APP_GRANTED:{label:"App access granted",tag:"APP",badge:"green",color:"var(--green-11)"},APP_REVOKED:{label:"App access revoked",tag:"APP",badge:"red",color:"var(--orange-11)"}};function Hn(e){return uo[e]??{label:e,tag:e.slice(0,4).toUpperCase(),badge:"gray",color:"var(--gray-11)"}}import{jsx as mo}from"react/jsx-runtime";function Xr(){return mo("div",{className:"auth-art-card",children:mo("img",{src:"/arm-logo-inverted.svg",alt:"araMetrics",style:{width:"56%",maxWidth:x.brandLogoMax,display:"block",userSelect:"none"},draggable:!1})})}import{jsx as ur,jsxs as _n}from"react/jsx-runtime";function On({children:e}){return _n("div",{style:{minHeight:"100vh",display:"flex",background:"var(--surface-content)",padding:"var(--space-5)",gap:"var(--space-5)"},children:[ur("div",{className:"auth-card-left",style:{width:"47%",flexShrink:0,position:"sticky",top:"var(--space-5)",height:"calc(100vh - var(--space-8))"},children:ur(Xr,{})}),ur("div",{className:"auth-card-right",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:"calc(100vh - var(--space-8))",padding:"var(--space-7) var(--space-5)"},children:ur("main",{style:{maxWidth:x.authFormMax,width:"100%",marginLeft:"auto",marginRight:"auto",background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",boxShadow:"var(--shadow-card)",padding:"var(--space-7) var(--space-5)"},children:e})})]})}import{jsx as mr,jsxs as Wn}from"react/jsx-runtime";function Zr(){return Wn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[mr("path",{d:"M15.68 8.18c0-.57-.05-1.11-.14-1.64H8v3.1h4.3a3.68 3.68 0 0 1-1.6 2.42v2h2.58c1.51-1.39 2.4-3.44 2.4-5.88Z",fill:"#4285F4"}),mr("path",{d:"M8 16c2.16 0 3.97-.71 5.3-1.94l-2.59-2a4.88 4.88 0 0 1-7.27-2.56H0.9v2.07A8 8 0 0 0 8 16Z",fill:"#34A853"}),mr("path",{d:"M3.44 9.5A4.8 4.8 0 0 1 3.19 8c0-.52.09-1.03.25-1.5V4.43H.9A8 8 0 0 0 0 8c0 1.29.31 2.51.9 3.57L3.44 9.5Z",fill:"#FBBC05"}),mr("path",{d:"M8 3.18c1.22 0 2.31.42 3.17 1.24l2.37-2.37A7.94 7.94 0 0 0 8 0 8 8 0 0 0 .9 4.43L3.44 6.5A4.77 4.77 0 0 1 8 3.18Z",fill:"#EA4335"})]})}import{jsx as fr,jsxs as Vn}from"react/jsx-runtime";function Jr(){return Vn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[fr("rect",{x:"0",y:"0",width:"7.6",height:"7.6",fill:"#F25022"}),fr("rect",{x:"8.4",y:"0",width:"7.6",height:"7.6",fill:"#7FBA00"}),fr("rect",{x:"0",y:"8.4",width:"7.6",height:"7.6",fill:"#00A4EF"}),fr("rect",{x:"8.4",y:"8.4",width:"7.6",height:"7.6",fill:"#FFB900"})]})}import{useRef as $n}from"react";import{TextField as Gn}from"@radix-ui/themes";import{jsx as fo}from"react/jsx-runtime";function Qr({value:e,onChange:r,disabled:t}){let o=$n([]);function a(s,c){let g=c.target.value.replace(/\D/g,"").slice(-1),p=Array.from({length:4},(u,h)=>e[h]??"");p[s]=g,r(p.join("")),g&&s<3&&o.current[s+1]?.focus()}function n(s,c){let g=Array.from({length:4},(p,u)=>e[u]??"");c.key==="Backspace"?!g[s]&&s>0&&(g[s-1]="",r(g.join("")),o.current[s-1]?.focus()):c.key==="ArrowLeft"&&s>0?o.current[s-1]?.focus():c.key==="ArrowRight"&&s<3&&o.current[s+1]?.focus()}function i(s){let c=s.clipboardData.getData("text").replace(/\D/g,"").slice(0,4);c&&(s.preventDefault(),r(c),o.current[Math.min(c.length,3)]?.focus())}let l=Array.from({length:4},(s,c)=>e[c]??"");return fo("div",{style:{display:"flex",gap:"var(--space-3)",justifyContent:"center"},children:l.map((s,c)=>fo(Gn.Root,{ref:g=>{o.current[c]=g},type:"text",inputMode:"numeric",maxLength:1,value:s,onChange:g=>a(c,g),onKeyDown:g=>n(c,g),onPaste:i,disabled:t,className:"otp-box","aria-label":`Digit ${c+1}`,autoComplete:c===0?"one-time-code":"off"},c))})}import{Button as et,Callout as Ue,Heading as Un,Text as rt}from"@radix-ui/themes";import{ExclamationTriangleIcon as jn}from"@radix-ui/react-icons";import{Fragment as vo,jsx as j,jsxs as pe}from"react/jsx-runtime";function Kn({email:e,title:r,subtitle:t,code:o,onCodeChange:a,otpDevHint:n,error:i,errorAction:l,busy:s,otpExpiresAt:c,otpSecondsLeft:g,resendCooldown:p,onResend:u,onUseDifferentEmail:h}){return pe(vo,{children:[pe("div",{style:{marginBottom:"var(--space-6)",textAlign:"center"},children:[j(Un,{as:"h1",size:_.h1,style:{color:"var(--ink-strong)",marginBottom:"var(--space-3)"},children:r}),pe(rt,{as:"p",size:"2",style:{color:"var(--ink-mid)",lineHeight:1.55},children:[t," ",j("span",{style:{fontWeight:600,color:"var(--ink-strong)"},children:e}),"."]})]}),n&&j(Ue.Root,{color:"gray",variant:"surface",size:"1",style:{marginBottom:"var(--space-5)"},children:pe(Ue.Text,{style:{fontFamily:"var(--font-poppins)"},children:["Dev hint \u2014 code is ",j("strong",{children:n})]})}),i&&pe(Ue.Root,{color:"red",variant:"surface",size:"2",style:{marginBottom:"var(--space-5)"},children:[j(Ue.Icon,{children:j(jn,{})}),pe(Ue.Text,{style:{fontFamily:"var(--font-poppins)"},children:[i,l&&pe(vo,{children:[" ",j(et,{type:"button",variant:"ghost",size:"1",onClick:l.onClick,style:{fontWeight:600,textDecoration:"underline",height:"auto",padding:0},children:l.label})]})]})]}),pe("div",{children:[j(Qr,{value:o,onChange:a,disabled:s||g<=0}),s?j(rt,{as:"p",size:"1",style:{color:"var(--ink-mid)",marginTop:"var(--space-3)",textAlign:"center"},children:"Checking code\u2026"}):c&&g<=0?j(rt,{as:"p",size:"1",style:{color:"var(--red-11)",marginTop:"var(--space-3)",textAlign:"center"},children:"Code expired \u2014 resend to get a new one."}):null]}),pe("div",{style:{marginTop:"var(--space-5)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--space-3)"},children:[j(et,{type:"button",variant:"ghost",size:"2",disabled:p>0||s,onClick:u,style:{fontWeight:500,color:p>0?"rgba(85, 85, 85, 0.4)":"var(--ink-strong)",textDecoration:p>0?"none":"underline"},children:p>0?`Resend email (${p}s)`:"Resend email"}),j(et,{type:"button",variant:"ghost",size:"2",className:"auth-underline-link",disabled:s,onClick:h,style:{fontWeight:500,color:"var(--ink-strong)"},children:"Use a Different Email"})]})]})}import{jsx as yo}from"react/jsx-runtime";function W({provider:e}){return e==="microsoft"?yo(Jr,{}):yo(Zr,{})}var Yn={google:"Google",microsoft:"Microsoft"};import{useState as tt}from"react";import{Link as To,useLocation as qn}from"react-router-dom";import{Avatar as ho,Badge as So,DropdownMenu as ge,IconButton as bo,Text as Ke,Tooltip as vr}from"@radix-ui/themes";import{ChevronDownIcon as Xn,ChevronLeftIcon as Zn,ChevronRightIcon as xo,Cross1Icon as Jn,DotFilledIcon as Ro,DotsVerticalIcon as Qn,ExitIcon as ei,GearIcon as Co,QuestionMarkCircledIcon as ri}from"@radix-ui/react-icons";import{Fragment as st,jsx as m,jsxs as I}from"react/jsx-runtime";var yr="var(--space-9)",je=e=>"items"in e,at=e=>e.badge?`${e.label} \xB7 ${e.badge}`:e.label;function ti(e){if(!e)return{};try{let r=JSON.parse(localStorage.getItem(e)??"{}");return!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).filter(t=>typeof t[1]=="boolean"))}catch{return{}}}function oi(e,r){if(e)try{localStorage.setItem(e,JSON.stringify(r))}catch{}}var ai="calc(4 * var(--space-9))",ni="calc(var(--space-9) + var(--space-6))",ii="calc(4 * var(--space-9) + var(--space-5))",si="var(--space-8)",nt="var(--space-5)",it="var(--space-5)",ko="calc(var(--space-5) + var(--space-3))",li="var(--space-3)",ci=e=>e?"opacity 130ms ease 80ms":"opacity 90ms ease",wo="opacity 200ms ease";function di({collapsed:e,onToggle:r,onClose:t,items:o,persistKey:a,utilityHrefs:n,user:i,onSignOut:l,hasCalendarAccounts:s=!1,brandLogoExpandedSrc:c="/expand.svg",brandLogoCollapsedSrc:g="/shrink.svg",helpHref:p,devRoles:u,onDevRoleSelect:h,showDevRoles:v=!1}){let f=qn().pathname,[S,E]=tt(!1),[X,ne]=tt(null),C=()=>ne(null),z=!!t,R=!e||z,fe=z?ii:e?ni:ai,b=d=>!d.roles||!!i&&d.roles.includes(i.role),F=d=>{if(!b(d))return[];if(!d.bundle||!d.children)return[d];let w=d.children.flatMap(F);return w.length>0?[{...d,children:w}]:[]},H=o.flatMap(d=>{if(!je(d))return F(d);let w=d.items.flatMap(F);return w.length>0?[{...d,items:w}]:[]}),G=H.filter(d=>!je(d)),ce=H.flatMap(d=>je(d)?d.items:[d]),[de,Ae]=tt(()=>ti(a)),Nt=d=>de[d.id]??!!d.defaultCollapsed;function ia(d){let w={...de,[d.id]:!Nt(d)};Ae(w),oi(a,w)}let Bt=new Set(n),sa=H.filter(d=>je(d)||!Bt.has(d.href)),Mt=G.find(d=>d.href==="/settings"),Er=G.filter(d=>Bt.has(d.href)&&d.href!=="/settings");function ir(d){return d.root??d.href}function zt(d){return!!d.children?.length&&(ir(d)!=="/calendar"||s)}function Nr(d){let w=ir(d);return f===w||f===d.href||f.startsWith(w+"/")?!0:!!d.bundle&&!!d.children?.some(Nr)}let sr=[];for(let d=ce;;){let w=d.find(Z=>zt(Z)&&Nr(Z));if(!w)break;sr.push(w),d=w.children}let Br=X?.path===f?Math.min(X.depth,sr.length):sr.length,Pe=Br>0?sr[Br-1]:void 0,la=()=>ne({path:f,depth:Br-1});function Mr(d,w){return d==="/home"||w?f===d:f===d||f.startsWith(d+"/")}function zr(d){return Ft(d,!0)}function Ft(d,w){let Z=d.bundle?Nr(d):Mr(ir(d),d.end),lr=zt(d),Ht=m(ot,{item:d,active:Z,expanded:R,uppercase:w,showChevron:lr,onClick:lr?C:void 0},d.href);return R?Ht:m(vr,{content:at(d),side:"right",delayDuration:300,children:Ht},d.href)}function ca(d){let w=`nav-group-${d.id}`;if(!R)return I("div",{role:"group","aria-label":d.label,children:[m("div",{"aria-hidden":"true",style:{height:1,background:"var(--gray-4)",margin:`var(--space-2) ${nt}`}}),d.items.map(zr)]},w);let Z=Nt(d);return I("div",{style:{display:"flex",flexDirection:"column",marginTop:"var(--space-3)"},children:[m(pi,{label:d.label,folded:Z,holdsActive:Z&&d.items.some(lr=>Mr(ir(lr))),controls:w,onToggle:()=>ia(d)}),m("div",{id:w,role:"group","aria-label":d.label,hidden:Z,children:d.items.map(zr)})]},w)}let da=f.startsWith("/admin")&&(i?.role==="admin"||i?.role==="operator"),Lt=i?.name?.split(" ").map(d=>d[0]).join("").slice(0,2)||"?";return I("aside",{style:{position:"relative",width:fe,height:"100%",minHeight:"100vh",background:"var(--shell-surface)",borderRight:"1px solid var(--gray-6)",flexShrink:0,transition:z?"none":"width 200ms ease",zIndex:2},children:[I("div",{style:{width:"100%",height:"100%",minHeight:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[I("div",{style:{height:yr,flexShrink:0,position:"relative",overflow:"hidden",borderBottom:"1px solid var(--border-hairline)"},children:[m("img",{src:c,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:wo,opacity:R?1:0,pointerEvents:"none",userSelect:"none"}}),m("img",{src:g,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:wo,opacity:R?0:1,pointerEvents:"none",userSelect:"none"}}),z&&m(bo,{variant:"ghost",color:"gray",size:"1",onClick:t,"aria-label":"Close menu",style:{position:"absolute",right:"var(--space-2)",top:"50%",transform:"translateY(-50%)"},children:m(Jn,{style:y("--space-3")})})]}),m("nav",{"aria-label":"Main navigation",style:{flex:1,overflowY:"auto",overflowX:"hidden",paddingTop:"var(--space-5)",display:"flex",flexDirection:"column"},children:Pe?I(st,{children:[(()=>{let d=m(ot,{item:{label:Pe.label,href:"#",Icon:Zn},active:!1,expanded:R,uppercase:!0,asButton:!0,onClick:la});return R?d:m(vr,{content:Pe.label,side:"right",delayDuration:300,children:d})})(),Pe.children.map(d=>Ft(d,!!Pe.bundle))]}):sa.map(d=>je(d)?ca(d):zr(d))}),!Pe&&Er.length>0&&m("nav",{"aria-label":"Utility navigation",style:{flexShrink:0,borderTop:"1px solid var(--gray-4)",paddingTop:"var(--space-2)",paddingBottom:"var(--space-2)",display:"flex",flexDirection:"column"},children:Er.map(d=>{let w=Mr(d.href),Z=m(ot,{item:d,active:w,expanded:R,uppercase:!0,showChevron:!!d.children,onClick:d.children?C:void 0},d.href);return R?Z:m(vr,{content:at(d),side:"right",delayDuration:300,children:Z},d.href)})}),I("div",{style:{borderTop:Er.length>0?"none":"1px solid var(--gray-4)",padding:R?"var(--space-2) var(--space-4)":"var(--space-2) 0",flexShrink:0,display:"flex",flexDirection:"column",gap:"var(--space-2)"},children:[R&&da&&I(So,{color:"gray",variant:"soft",highContrast:!0,size:"1",radius:"full",style:{alignSelf:"flex-start"},children:[m(Ro,{style:y("--space-2")}),"Administering platform"]}),I("div",{style:{display:"flex",flexDirection:R?"row":"column",alignItems:"center",justifyContent:R?"space-between":"center",gap:"var(--space-2)"},children:[R?I("div",{className:"shell-profile-chip",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0,flex:1,padding:"var(--space-1)",borderRadius:"var(--radius-3)"},children:[m(ho,{size:"2",radius:"full",src:i?.avatarSrc,fallback:Lt,color:"gray",variant:"soft",style:{flexShrink:0}}),m(Ke,{as:"p",size:"2",weight:"medium",truncate:!0,style:{color:"var(--shell-ink-strong)"},children:i?.name})]}):m(vr,{content:i?.name??"Account",side:"right",delayDuration:300,children:m(ho,{size:"3",radius:"full",src:i?.avatarSrc,fallback:Lt,color:"gray",variant:"soft"})}),I(ge.Root,{children:[m(ge.Trigger,{children:m(bo,{variant:"ghost",color:"gray","aria-label":"Account menu",className:"sidebar-icon-btn",style:{flexShrink:0},children:m(Qn,{style:y("--space-4")})})}),I(ge.Content,{align:R?"end":"start",side:R?"top":"right",style:{minWidth:200},children:[Mt&&m(ge.Item,{asChild:!0,children:I(To,{to:Mt.href,onClick:C,children:[m(Co,{}),"Settings"]})}),p&&I(ge.Item,{onClick:()=>window.open(p,"_blank","noopener,noreferrer"),children:[m(ri,{}),"Help"]}),m(ge.Separator,{}),I(ge.Item,{color:"red",onClick:()=>E(!0),children:[m(ei,{}),"Log Out"]}),v&&u&&u.length>0&&I(st,{children:[m(ge.Separator,{}),m("div",{style:{padding:"var(--space-1) var(--space-3)"},children:m(Ke,{size:"1",style:{fontFamily:"monospace",color:"var(--gray-11)",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Dev \xB7 switch role"})}),u.map(d=>I(ge.Item,{onClick:()=>h?.(d.email),disabled:i?.role===d.role,children:[m(Co,{}),d.label,I(Ke,{size:"1",color:"gray",style:{marginLeft:"auto"},children:[d.role,"@"]})]},d.role))]})]})]})]})]})]}),!z&&m("button",{onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:"sidebar-collapse-btn",style:{top:"calc(var(--space-9) / 2)",transform:"translateY(-50%)",right:"calc(-1 * var(--space-3))"},children:m(gi,{flipped:e})}),m(Hr,{open:S,onOpenChange:E,title:"Confirm Logout",description:"Are you sure you want to log out?",onConfirm:l})]})}function ot({item:e,active:r,expanded:t,onClick:o,asButton:a,showChevron:n,uppercase:i}){let l={position:"relative",textDecoration:"none",display:"flex",alignItems:"center",height:si,flexShrink:0,paddingLeft:ko,paddingRight:t?`calc(${it} + var(--space-1))`:0,gap:t?li:0,color:r?"var(--shell-ink-strong)":"var(--shell-ink-mid)",cursor:"pointer"},s=I(st,{children:[r&&m("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"var(--space-1)",height:"100%",background:"var(--accent-9)",borderRadius:"0 var(--radius-1) var(--radius-1) 0"}}),m("span",{"aria-hidden":"true",className:"nav-pill",style:{position:"absolute",top:0,bottom:0,left:nt,right:t?it:nt,borderRadius:"var(--radius-3)",background:r?"var(--accent-9)":"transparent",transition:"background 80ms ease"}}),m(e.Icon,{width:20,height:20,style:{position:"relative",flexShrink:0}}),I("span",{style:{position:"relative",display:"flex",alignItems:"center",gap:"var(--space-1)",minWidth:0,overflow:"hidden",maxWidth:t?void 0:0,opacity:t?1:0,transition:ci(t)},children:[m(Ke,{as:"span",size:"3",weight:r?"medium":"regular",style:{lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,textTransform:i?"uppercase":void 0},children:e.label}),e.badge&&m(So,{color:"gray",variant:r?"solid":"soft",highContrast:r,size:"1",radius:"full",style:{flexShrink:0,paddingInline:"var(--space-1)",textTransform:i?"uppercase":void 0},children:e.badge})]}),n&&t&&(r?m("span",{style:{position:"relative",marginLeft:"auto",marginRight:"var(--space-1)",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-2)",boxShadow:"0 1px 2px rgba(0,0,0,0.12)"},children:m(xo,{style:{...y("--space-4"),color:"var(--gray-11)"}})}):m(xo,{style:{...y("--space-4"),position:"relative",marginLeft:"auto",color:"var(--shell-ink-mid)",flexShrink:0}}))]});return a?m("button",{type:"button",onClick:o,className:"shell-nav-item",style:{...l,background:"none",border:"none",width:"100%",textAlign:"left",font:"inherit"},children:s}):m(To,{to:e.href,onClick:o,className:"shell-nav-item","data-active":r?"true":void 0,"aria-current":r?"page":void 0,title:t?at(e):void 0,style:l,children:s})}function pi({label:e,folded:r,holdsActive:t,controls:o,onToggle:a}){return I("button",{type:"button",onClick:a,"aria-expanded":!r,"aria-controls":o,className:"shell-nav-group","data-holds-active":t?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-1)",height:"var(--space-6)",flexShrink:0,width:"100%",paddingLeft:ko,paddingRight:`calc(${it} + var(--space-1))`,background:"none",border:"none",font:"inherit",textAlign:"left",cursor:"pointer",color:t?"var(--shell-ink-strong)":"var(--shell-ink-mid)"},children:[m(Ke,{as:"span",size:"1",weight:"medium",style:{textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:e}),t&&m(Ro,{"aria-hidden":"true",style:{...y("--space-3"),color:"var(--accent-9)",flexShrink:0}}),m(Xn,{"aria-hidden":"true",style:{...y("--space-4"),marginLeft:"auto",flexShrink:0,transform:r?"rotate(-90deg)":void 0,transition:"transform 120ms ease"}})]})}function gi({flipped:e}){return I("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"scaleX(-1)":void 0},children:[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5",stroke:"currentColor"}),m("path",{d:"M5.5 2.5v11",stroke:"currentColor"}),m("path",{d:"M11 5.5 8.5 8l2.5 2.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})}import{Link as ui,useLocation as mi}from"react-router-dom";import{HamburgerMenuIcon as fi,MagnifyingGlassIcon as vi,BellIcon as yi}from"@radix-ui/react-icons";import{Flex as hi,Heading as bi,IconButton as xi,Text as Do,Tooltip as Ci}from"@radix-ui/themes";import{Fragment as ki,jsx as V,jsxs as hr}from"react/jsx-runtime";var wi=[["/home","Home","/home","Home"],["/calendar/syncs","Calendar","/calendar/syncs","Manage Syncs"],["/calendar/view","Calendar","/calendar/syncs","My Calendar"],["/calendar","Calendar","/calendar/syncs","Manage Syncs"],["/settings/account","Settings","/settings/account","Account"],["/settings/linked","Settings","/settings/account","Linked Account"],["/settings","Settings","/settings/account","Settings"]],Ti=[["/admin/overview","Overview"],["/admin/users","Users"],["/admin/monitoring","Monitoring"],["/admin/calendar-ops","Calendar Ops"],["/admin/logs","Logs"],["/admin/security","Security"],["/admin/audit","Audit Log"]];function Si(e,r,t){if(e==="/admin"||e.startsWith("/admin/")){let l=t.find(([s])=>e===s||e.startsWith(s+"/"));return{section:"Admin Portal",sectionHref:"/admin/overview",page:l?l[1]:"Admin Portal"}}if(e==="/calendar/syncs/new")return{section:"Calendar",sectionHref:"/calendar/syncs",page:"New Sync"};if(/^\/calendar\/syncs\/[^/]+$/.test(e))return{section:"Calendar",sectionHref:"/calendar/syncs",page:"Edit Sync"};let o=r.find(([l,,,,s])=>s?e===l:e===l||e.startsWith(l+"/"));if(!o)return{section:"Home",sectionHref:"/home",page:"Home"};let[,a,n,i]=o;return{section:a,sectionHref:n,page:i}}function Ri({onSearchOpen:e,onMenuOpen:r,showMenu:t,titles:o=wi,adminTitles:a=Ti}){let n=mi().pathname;return hr("header",{style:{height:yr,background:"var(--accent-9)",borderBottom:"1px solid var(--border-hairline)",flexShrink:0,display:"flex",alignItems:"center",padding:"0 var(--space-6)",gap:"var(--space-4)"},children:[t&&V(xi,{variant:"ghost",size:"1",onClick:r,"aria-label":"Open navigation",style:{marginRight:"var(--space-1)",color:"var(--shell-ink-strong)"},children:V(fi,{style:y("--space-4")})}),(()=>{let{section:i,sectionHref:l,page:s}=Si(n,o,a);return hr(hi,{align:"baseline",gap:"2",style:{minWidth:0,overflow:"hidden"},children:[i!==s&&hr(ki,{children:[V(Do,{asChild:!0,size:"3",weight:"regular",children:V(ui,{to:l,style:{color:"var(--shell-ink-mid)",whiteSpace:"nowrap",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",flexShrink:0},className:"topbar-breadcrumb-link",children:i})}),V(Do,{size:"3",weight:"regular",className:"topbar-breadcrumb-sep",style:{color:"var(--shell-ink-mid)",flexShrink:0},children:"/"})]}),V(bi,{as:"h1",size:_.h1,weight:"medium",style:{color:"var(--shell-ink-strong)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:s})]})})(),V("div",{style:{flex:1}}),hr("button",{className:"topbar-search",onClick:e,"aria-label":"Search (\u2318K)",children:[V(vi,{width:16,height:16,style:{color:"var(--shell-ink-strong)",flexShrink:0}}),V("span",{className:"topbar-search-placeholder",children:"Search for something"})]}),V(Ci,{content:"Coming soon",children:V("span",{children:V("button",{className:"topbar-icon-circle","aria-label":"Notifications (coming soon)",disabled:!0,children:V(yi,{style:y("--space-4")})})})})]})}import{useEffect as Io,useRef as Ao,useState as lt}from"react";import{Dialog as ct,Flex as Po,Spinner as Di,Text as ee,TextField as Ii,VisuallyHidden as Ai}from"@radix-ui/themes";import{CalendarIcon as Pi,MagnifyingGlassIcon as Ei,PersonIcon as Ni,ReaderIcon as Bi}from"@radix-ui/react-icons";import{Fragment as Oi,jsx as T,jsxs as K}from"react/jsx-runtime";var Mi={app:Pi,people:Ni,page:Bi},zi={app:"Apps",people:"People",page:"Pages"};function Fi(e){let r=["app","people","page"],t=[],o=0;for(let a of r){let n=e.filter(i=>i.type===a);n.length>0&&(t.push({type:a,label:zi[a],items:n,startIdx:o}),o+=n.length)}return t}function Li({open:e,onClose:r,results:t,onSelectResult:o,title:a="Search",placeholder:n="Search\u2026"}){return T(ct.Root,{open:e,onOpenChange:i=>!i&&r(),children:T(ct.Content,{"aria-describedby":void 0,style:{padding:0,maxWidth:"calc(9 * var(--space-9) + var(--space-2))",overflow:"hidden",boxShadow:"0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.10), 0 0 0 1px var(--gray-5)"},children:T(Hi,{onClose:r,resultPool:t,onSelectResult:o,title:a,placeholder:n})})})}function Hi({onClose:e,resultPool:r,onSelectResult:t,title:o,placeholder:a}){let[n,i]=lt(""),[l,s]=lt(null),[c,g]=lt(-1),p=Ao(null),u=Ao(null),h=!!l&&l.q===n,v=h?l.items:[],f=n.trim()?h?v.length?"results":"no-match":"searching":"prompt";Io(()=>{if(!n.trim())return;let C=setTimeout(()=>{let z=n.toLowerCase(),R=r.filter(fe=>fe.title.toLowerCase().includes(z)||fe.subtitle.toLowerCase().includes(z));s({q:n,items:R}),g(-1)},320);return()=>clearTimeout(C)},[n,r]),Io(()=>{if(c<0||!u.current)return;u.current.querySelector(`[data-idx="${c}"]`)?.scrollIntoView({block:"nearest"})},[c]);function S(C){C.key==="Escape"?e():C.key==="ArrowDown"?(C.preventDefault(),g(z=>Math.min(z+1,v.length-1))):C.key==="ArrowUp"?(C.preventDefault(),g(z=>Math.max(z-1,0))):C.key==="Enter"&&(C.preventDefault(),c>=0&&v[c]&&(t(v[c]),e()))}function E(C){t(C),e()}let X=Fi(v),ne="calc(2 * var(--space-9) + var(--space-6))";return K(Oi,{children:[T(Ai,{children:T(ct.Title,{children:o})}),K("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-3) var(--space-4)",borderBottom:"1px solid var(--gray-5)"},children:[f==="searching"?T(Di,{size:"1",style:{flexShrink:0}}):T(Ei,{width:16,height:16,style:{color:"var(--gray-9)",flexShrink:0}}),T(Ii.Root,{ref:p,autoFocus:!0,type:"text",placeholder:a,value:n,onChange:C=>i(C.target.value),onKeyDown:S,className:"search-overlay-input",style:{flex:1,border:"none",outline:"none",background:"transparent",boxShadow:"none","--text-field-selection-color":"unset"}}),T("kbd",{style:{color:"var(--gray-11)",background:"var(--gray-3)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1) var(--space-2)",flexShrink:0},children:T(ee,{size:"1",as:"span",children:"Esc"})})]}),K("div",{ref:u,style:{minHeight:ne,maxHeight:"calc(6 * var(--space-9) + var(--space-7))",overflowY:"auto"},children:[f==="prompt"&&T(Po,{align:"center",justify:"center",style:{height:ne},children:T(ee,{size:"2",color:"gray",children:"Type to search\u2026"})}),f==="no-match"&&T(Po,{align:"center",justify:"center",style:{height:ne},children:K("div",{style:{textAlign:"center"},children:[K(ee,{size:"2",color:"gray",as:"p",children:["No results for \u201C",n,"\u201D"]}),T(ee,{size:"1",color:"gray",as:"p",mt:"1",children:"Try searching with different keywords"})]})}),f==="results"&&T("div",{style:{padding:"var(--space-2)"},children:X.map(C=>{let z=Mi[C.type];return K("div",{style:{marginBottom:"var(--space-1)"},children:[T("div",{style:{padding:"var(--space-2) var(--space-3) var(--space-1)",display:"flex",alignItems:"center",gap:"var(--space-2)"},children:T(ee,{size:"1",style:{color:"var(--gray-11)",fontWeight:500,letterSpacing:"0.04em",textTransform:"uppercase",fontFamily:"var(--font-poppins)"},children:C.label})}),C.items.map((R,fe)=>{let b=C.startIdx+fe,F=c===b;return K("button",{"data-idx":b,onClick:()=>E(R),onMouseEnter:()=>g(b),className:"search-result-item",style:{width:"100%",display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)",borderRadius:"var(--radius-2)",border:"none",cursor:"pointer",textAlign:"left",background:F?"var(--gray-3)":"transparent"},children:[T("div",{style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"var(--radius-1)",background:F?"var(--accent-a3)":"var(--gray-3)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background 100ms ease"},children:T(z,{width:12,height:12,style:{color:F?"var(--accent-11)":"var(--gray-9)"}})}),K("div",{style:{flex:1,minWidth:0},children:[T(ee,{as:"p",size:"2",weight:"medium",style:{color:F?"var(--gray-12)":"var(--gray-11)",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.title}),T(ee,{as:"p",size:"1",style:{color:"var(--gray-11)",lineHeight:1.3,marginTop:"1px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.subtitle})]}),F&&T("kbd",{style:{color:"var(--gray-9)",background:"var(--gray-4)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1)",flexShrink:0},children:T(ee,{size:"1",as:"span",className:"data-mono",children:"\u21B5"})})]},R.id)})]},C.type)})})]}),f!=="prompt"&&K("div",{style:{borderTop:"1px solid var(--gray-4)",padding:"var(--space-2) var(--space-4)",display:"flex",gap:"var(--space-4)"},children:[K(ee,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"\u2191\u2193"})," navigate"]}),K(ee,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"\u21B5"})," open"]}),K(ee,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"Esc"})," close"]})]})]})}function Y(e,r){for(let t of e){let o=t.calendars.find(a=>a.id===r);if(o)return{account:t,calendar:o}}}import dt from"dayjs";import{Flex as Eo,Text as No}from"@radix-ui/themes";import{jsx as pt,jsxs as _i}from"react/jsx-runtime";function gt({date:e,today:r=new Date}){let t=dt(e).isSame(r,"day");return _i(Eo,{direction:"column",align:"center",gap:"1",py:"1",children:[pt(No,{size:"1",weight:"medium",color:"gray",style:{letterSpacing:"0.04em"},children:dt(e).format("ddd").toUpperCase()}),pt(Eo,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",background:t?"var(--accent-9)":"transparent",lineHeight:1},children:pt(No,{size:"3",weight:t?"medium":"regular",style:{color:t?"var(--accent-contrast)":"var(--gray-12)",lineHeight:1},children:dt(e).format("D")})})]})}import{Box as Ye,Checkbox as Wi,Flex as Vi,RadioGroup as Bo,Text as qe}from"@radix-ui/themes";import{jsx as M,jsxs as zo}from"react/jsx-runtime";function $i(e){return e.flatMap(r=>r.calendars.map(t=>({calendarId:t.id,calendarName:t.name,email:r.email,provider:r.provider})))}function Gi({provider:e}){return M("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",flexShrink:0},children:M(W,{provider:e})})}function Mo({row:e,control:r,selected:t,disabled:o,disabledLabel:a}){return zo(qe,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-3)",width:"100%",paddingBlock:"var(--space-3)",paddingInline:"var(--space-4)",cursor:o?"not-allowed":"pointer",opacity:o?.45:1,background:t?"var(--accent-2)":"transparent",color:"var(--gray-12)"},children:[M(Gi,{provider:e.provider}),zo(Vi,{direction:"column",gap:"0",style:{minWidth:0,flex:1},children:[M(qe,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.calendarName}),M(qe,{size:"1",color:"gray",truncate:!0,children:e.email})]}),a?M(qe,{size:"1",color:"gray",style:{flexShrink:0},children:a}):null,M(Ye,{style:{flexShrink:0,display:"flex",alignItems:"center"},children:r})]})}function Ui({accounts:e,mode:r,sourceCalendarIds:t,targetCalendarId:o,takenSourceIds:a,onToggleSource:n,onSelectTarget:i,fill:l=!1}){let s=$i(e),g=r==="sources"&&s.length>0&&s.every(p=>p.calendarId===o||a.has(p.calendarId))?M(Ye,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",padding:"var(--space-4)",...l?{flex:1,minHeight:0}:{}},children:M(qe,{as:"p",size:"2",color:"gray",align:"center",children:"All your calendars are already used as sources in other syncs, or set as this sync's target. Remove a calendar from another sync to make it available here."})}):M(Ye,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",...l?{flex:1,minHeight:0,overflowY:"auto"}:{overflow:"hidden"}},children:s.map((p,u)=>{if(r==="sources"){let f=p.calendarId===o,S=a.has(p.calendarId),E=f||S,X=t.includes(p.calendarId);return M(Ye,{style:{borderTop:u>0?"1px solid var(--gray-4)":void 0},children:M(Mo,{row:p,selected:X,disabled:E,disabledLabel:f?"Target":S?"In use":void 0,control:M(Wi,{checked:X,disabled:E,onCheckedChange:()=>{E||n(p.calendarId)}})})},p.calendarId)}let h=t.includes(p.calendarId),v=p.calendarId===o;return M(Ye,{style:{borderTop:u>0?"1px solid var(--gray-4)":void 0},children:M(Mo,{row:p,selected:v,disabled:h,disabledLabel:h?"Source":void 0,control:M(Bo.Item,{value:p.calendarId,disabled:h})})},p.calendarId)})});return r==="target"?M(Bo.Root,{value:o??"",onValueChange:p=>{p&&i(p)},style:l?{flex:1,minHeight:0,display:"flex",flexDirection:"column"}:void 0,children:g}):g}import{Button as Fo,Flex as ut,Heading as ji,IconButton as Lo}from"@radix-ui/themes";import{ChevronLeftIcon as Ki,ChevronRightIcon as Yi}from"@radix-ui/react-icons";import{Navigate as mt}from"react-big-calendar";import{jsx as ve,jsxs as Ho}from"react/jsx-runtime";function ft({label:e,view:r,onNavigate:t,onView:o}){return Ho(ut,{align:"center",justify:"between",gap:"3",wrap:"wrap",className:"calendar-toolbar",children:[Ho(ut,{align:"center",gap:"2",children:[ve(Lo,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Previous",onClick:()=>t(mt.PREVIOUS),children:ve(Ki,{})}),ve(Fo,{size:"2",variant:"soft",color:"gray",onClick:()=>t(mt.TODAY),children:"Today"}),ve(Lo,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Next",onClick:()=>t(mt.NEXT),children:ve(Yi,{})})]}),ve(ji,{as:"h2",size:_.h2,weight:"medium",style:{color:"var(--gray-12)"},children:e}),ve(ut,{gap:"1",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",padding:"var(--space-1)",background:"var(--gray-2)"},children:["week","month"].map(a=>ve(Fo,{size:"2",variant:r===a?"solid":"soft",className:r===a?"btn-amber-primary":void 0,color:r===a?void 0:"gray",onClick:()=>o(a),style:r===a?void 0:{background:"transparent"},children:a==="week"?"Week":"Month"},a))})]})}import{Button as qi,Flex as br,Spinner as Xi,Text as vt}from"@radix-ui/themes";import{ChevronRightIcon as Zi,ExclamationTriangleIcon as Ji}from"@radix-ui/react-icons";import{jsx as re,jsxs as Xe}from"react/jsx-runtime";var Fe={google:{label:"Google Calendar",description:"Connect a Google account calendar"},microsoft:{label:"Outlook Calendar",description:"Connect an Outlook account calendar"}},Qi=["google","microsoft"];function yt({connectingProvider:e,failedProvider:r,exhausted:t=!1,onConnect:o}){return re(br,{direction:"column",gap:"3",style:{width:"100%",textAlign:"left"},children:Qi.map(a=>{let n=Fe[a],i=e===a;return Xe("div",{children:[Xe("button",{type:"button",className:"provider-choice",onClick:()=>o(a),disabled:e!==null,"data-connecting":i?"true":void 0,"aria-busy":i||void 0,"aria-label":`Connect ${n.label}`,children:[re(B,{children:re(W,{provider:a})}),Xe(br,{direction:"column",className:"provider-choice__copy",gap:"1",children:[re(vt,{size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:n.label}),re(vt,{size:"2",color:"gray",truncate:!0,children:n.description})]}),re("span",{className:"provider-choice__chevron","aria-hidden":!0,children:i?re(Xi,{size:"2"}):re(Zi,{style:y("--space-5")})})]}),r===a&&Xe(br,{align:"center",justify:"between",gap:"3",mt:"2",px:"1",children:[Xe(br,{align:"center",gap:"2",children:[re(Ji,{style:{...y("--space-4"),color:"var(--red-9)",flexShrink:0}}),re(vt,{size:"2",style:{color:"var(--red-11)"},children:t?`No more ${n.label} accounts available to connect.`:`Couldn't connect ${n.label}. Please try again.`})]}),!t&&re(qi,{variant:"ghost",size:"1",onClick:()=>o(a),children:"Retry"})]})]},a)})})}import{Badge as Oo,Box as es,DropdownMenu as Ze,Flex as _o,IconButton as rs,Text as Wo}from"@radix-ui/themes";import{DotsVerticalIcon as ts,ReloadIcon as os,TrashIcon as as}from"@radix-ui/react-icons";import{jsx as q,jsxs as Te}from"react/jsx-runtime";function ns({account:e,onRemove:r,onReconnect:t,onClick:o}){let a=e.authStatus==="reauth",n=e.authStatus==="failed",i=q(Wo,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.displayName});return Te(es,{onClick:o,style:{width:"100%",minWidth:0,height:x.connectedAccountCardH,boxSizing:"border-box",padding:"var(--space-3)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",display:"flex",alignItems:"center",gap:"var(--space-3)",cursor:o?"pointer":void 0},children:[q(B,{size:"var(--space-6)",children:q(W,{provider:e.provider})}),Te(_o,{direction:"column",style:{flex:1,minWidth:0},children:[Te(_o,{align:"center",gap:"2",style:{minWidth:0},children:[o?q("button",{type:"button",className:"card-title-button",onClick:l=>{l.stopPropagation(),o()},children:i}):i,a&&q(Oo,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),n&&q(Oo,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),q(Wo,{size:"1",color:"gray",truncate:!0,children:e.email})]}),Te(Ze.Root,{children:[q(Ze.Trigger,{children:q(rs,{variant:"ghost",color:"gray",size:"1","aria-label":`${e.displayName} actions`,onClick:l=>l.stopPropagation(),children:q(ts,{})})}),Te(Ze.Content,{align:"end",onClick:l=>l.stopPropagation(),children:[(a||n)&&t&&Te(Ze.Item,{onSelect:t,children:[q(os,{})," Reconnect"]}),Te(Ze.Item,{color:"red",onSelect:r,children:[q(as,{})," Remove account"]})]})]})]})}import{Flex as is,Text as ss,Heading as ls}from"@radix-ui/themes";import{jsx as ht,jsxs as ds}from"react/jsx-runtime";function cs({icon:e,title:r,description:t,action:o,headingAs:a="h2"}){return ds(is,{direction:"column",align:"center",gap:"3",style:{width:"100%",paddingTop:"var(--space-9)",textAlign:"center"},children:[ht(B,{size:"var(--space-8)",children:e}),ht(ls,{as:a,size:_[a],weight:"medium",align:"center",children:r}),t&&ht(ss,{size:"2",color:"gray",align:"center",style:{maxWidth:x.emptyStateCopyMax},children:t}),o]})}import{useState as ps}from"react";import{Dialog as Je,Flex as gs,Text as xr,Checkbox as us,Button as Vo}from"@radix-ui/themes";import{Fragment as fs,jsx as $,jsxs as bt}from"react/jsx-runtime";function Se({account:e,onOpenChange:r,onImport:t,initiallySelectedIds:o,disabledIds:a,disabledReason:n,title:i="Calendars",description:l="Choose which calendars you want to import.",confirmLabel:s="Import Calendars"}){let c=e?`${e.id}:${(o??e.calendars.map(g=>g.id)).join(",")}`:"closed";return $(Je.Root,{open:!!e,onOpenChange:r,children:$(Je.Content,{maxWidth:x.dialogMd,onInteractOutside:g=>g.preventDefault(),children:e&&$(ms,{account:e,initiallySelectedIds:o,disabledIds:a,disabledReason:n,title:i,description:l,confirmLabel:s,onImport:t},c)})})}function ms({account:e,initiallySelectedIds:r,disabledIds:t,disabledReason:o,title:a,description:n,confirmLabel:i,onImport:l}){let[s,c]=ps(()=>new Set(r??e.calendars.map(u=>u.id))),g=new Set(t??[]);function p(u){g.has(u)||c(h=>{let v=new Set(h);return v.has(u)?v.delete(u):v.add(u),v})}return bt(fs,{children:[$(Je.Title,{size:"5",weight:"medium",mb:"1",children:a}),$(Je.Description,{size:"2",color:"gray",mb:"2",children:n}),$(xr,{as:"p",size:"2",weight:"medium",mb:"5",style:{color:"var(--gray-12)"},children:e.email}),$(gs,{direction:"column",gap:"3",mb:"5",children:e.calendars.map(u=>{let h=s.has(u.id),v=g.has(u.id);return bt(xr,{as:"label",size:"3",className:"calendar-picker-row","data-selected":h||void 0,"data-disabled":v?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-4)",cursor:v?"default":"pointer"},children:[$(us,{checked:h,disabled:v,onCheckedChange:()=>p(u.id)}),$(xr,{weight:"medium",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:u.name}),v&&o&&$(xr,{size:"1",color:"gray",style:{flexShrink:0},children:o})]},u.id)})}),bt(J,{justify:"between",noTopMargin:!0,pad:"var(--space-5)",radius:"var(--radius-4)",children:[$(Je.Close,{children:$(Vo,{size:"2",variant:"outline",color:"gray",children:"Cancel"})}),$(Vo,{size:"2",className:"btn-amber-primary",disabled:s.size===0,onClick:()=>l(Array.from(s)),children:i})]})]})}import{Box as Qe,Flex as vs,Text as te}from"@radix-ui/themes";import{jsx as L,jsxs as Cr}from"react/jsx-runtime";function ys(e){let r=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!r)return"white";let t=parseInt(r[1],16),o=n=>{let i=n/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*o(t>>16&255)+.7152*o(t>>8&255)+.0722*o(t&255)>.45?"black":"white"}function $o({tone:e,title:r,meta:t,accentColor:o}){let a=e==="synced"?o||"var(--accent-9)":"var(--blue-11)",n=e==="synced"?o?ys(o):"var(--accent-contrast)":"white";return Cr(Qe,{style:{background:a,borderRadius:"var(--radius-2)",padding:"var(--space-2) var(--space-3)"},children:[L(te,{as:"p",size:"2",weight:"medium",style:{color:n},children:r}),t?L(te,{as:"p",size:"1",style:{color:n},children:t}):null]})}var hs="Busy",bs={title:"Gym",time:"10:00 AM",location:"Flex Gym on 16th Ave",description:"Workout notes"};function xs({hasSources:e,hasTarget:r,sourceLabel:t,targetLabel:o,showTitle:a,showDescription:n,showLocation:i,tagLabel:l,accentColor:s,sampleEvent:c=bs}){let g=c.title,p=[c.time,c.location].filter(Boolean).join(" \xB7 "),u=l?.trim()||hs,h=a?`${c.title} - (${u})`:u,v=[c.time].filter(Boolean);i&&c.location&&v.push(c.location),n&&c.description&&v.push(c.description);let f=v.join(" \xB7 ");return Cr(vs,{direction:"column",gap:"4",style:{padding:"var(--space-4)"},children:[L(te,{as:"p",className:"ds-section-label",style:{textAlign:"center"},children:"Sync Preview"}),L(te,{as:"p",size:"1",color:"gray",style:{textAlign:"center",marginTop:"calc(-1 * var(--space-2))"},children:"Example event \u2014 not from your calendars."}),Cr(Qe,{children:[L(te,{as:"p",size:"1",color:"gray",mb:"1",children:"Sources"}),L(te,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:e?t||"Selected sources":"\u2014"}),L(Qe,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:L($o,{tone:"source",title:g,meta:p})})]}),Cr(Qe,{children:[L(te,{as:"p",size:"1",color:"gray",mb:"1",children:"Target"}),L(te,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:r?o||"Selected target":"\u2014"}),L(Qe,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:r?L($o,{tone:"synced",title:h,meta:f,...s?{accentColor:s}:{}}):L(te,{as:"p",size:"2",color:"gray",children:"Pick one target calendar"})})]}),!e||!r?L(te,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Select one or more sources, then one target"}):L(te,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Only the highlighted block is posted to the target"})]})}import{Flex as xt,Text as Ct}from"@radix-ui/themes";import{CheckIcon as Cs}from"@radix-ui/react-icons";import{jsx as Le,jsxs as Go}from"react/jsx-runtime";function wt({steps:e,current:r}){return Le("div",{role:"list","aria-label":"Wizard progress",style:{display:"flex",flexWrap:"wrap",width:"100%",flexShrink:0,marginBottom:0,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",overflow:"hidden"},children:e.map((t,o)=>{let a=o+1,n=a===r,i=a<r;return Go(xt,{align:"start",gap:"3",role:"listitem","aria-current":n?"step":void 0,style:{flex:"1 1 calc(3 * var(--space-9) + var(--space-6))",minWidth:"calc(3 * var(--space-9) + var(--space-6))",paddingTop:"var(--space-4)",paddingBottom:"var(--space-4)",paddingLeft:"var(--space-4)",paddingRight:"var(--space-4)",marginBottom:"-1px",borderBottom:n?"2px solid var(--accent-9)":"2px solid transparent"},children:[Le(xt,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",flexShrink:0,marginTop:"var(--space-1)",background:i?"var(--green-9)":n?"var(--accent-9)":"var(--gray-3)",color:i?"white":n?"var(--accent-contrast)":"var(--gray-11)"},children:i?Le(Cs,{style:y("--space-3")}):Le(Ct,{size:"1",weight:"medium",children:t.n})}),Go(xt,{direction:"column",gap:"1",style:{minWidth:0,flex:1,paddingTop:"var(--space-1)"},children:[Le(Ct,{size:"2",weight:"medium",style:{color:n||i?"var(--gray-12)":"var(--gray-10)",lineHeight:"var(--line-height-2)"},children:t.title}),Le(Ct,{size:"1",color:"gray",style:{lineHeight:"var(--line-height-1)"},children:t.description})]})]},t.n)})})}import{jsx as jo}from"react/jsx-runtime";var ws=[{n:"01",title:"Connect",description:"Connect your calendar account"},{n:"02",title:"Calendars",description:"Import at least 2 calendars"},{n:"03",title:"Sync",description:"Set up your first sync"}];function Uo({current:e}){return jo(wt,{steps:ws,current:e})}function Ts({current:e,total:r=3}){return jo(Uo,{current:e})}import Tt from"dayjs";import{Flex as Ko,Grid as Yo,IconButton as qo,Text as Xo}from"@radix-ui/themes";import{ChevronLeftIcon as Ss,ChevronRightIcon as Rs}from"@radix-ui/react-icons";import{jsx as ue,jsxs as St}from"react/jsx-runtime";var ks=["S","M","T","W","T","F","S"];function Rt({cursor:e,onSelect:r,today:t=new Date}){let o=Tt(e).startOf("month"),a=o.startOf("week"),n=Array.from({length:42},(i,l)=>a.add(l,"day"));return St("div",{children:[St(Ko,{align:"center",justify:"between",mb:"2",children:[ue(Xo,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:o.format("MMMM YYYY")}),St(Ko,{gap:"1",children:[ue(qo,{size:"1",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r(Tt(e).subtract(1,"month").toDate()),children:ue(Ss,{})}),ue(qo,{size:"1",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r(Tt(e).add(1,"month").toDate()),children:ue(Rs,{})})]})]}),ue(Yo,{columns:"7",gap:"1",mb:"1",children:ks.map((i,l)=>ue(Xo,{size:"1",color:"gray",align:"center",children:i},l))}),ue(Yo,{columns:"7",gap:"1",justify:"center",align:"center",style:{justifyItems:"center"},children:n.map(i=>{let l=i.isSame(t,"day"),s=i.isSame(e,"day"),c=!i.isSame(o,"month");return ue("button",{type:"button",onClick:()=>r(i.toDate()),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",boxSizing:"border-box",flexShrink:0,padding:0,borderRadius:"50%",border:l&&!s?"1.5px solid var(--accent-9)":"none",cursor:"pointer",background:s?"var(--accent-9)":"transparent",color:s?"var(--accent-contrast)":c?"var(--gray-11)":l?"var(--accent-11)":"var(--gray-12)",fontWeight:l||s?500:400,fontSize:"var(--font-size-1)",fontFamily:"var(--font-poppins)"},children:i.format("D")},i.format("YYYY-MM-DD"))})})]})}import{useState as Ds}from"react";import{Dialog as er,Flex as rr,Text as wr,Button as kt,IconButton as Is,Badge as Zo,Separator as As,Box as Jo}from"@radix-ui/themes";import{Cross2Icon as Ps,PlusIcon as Es,ReloadIcon as Ns}from"@radix-ui/react-icons";import{Fragment as Qo,jsx as A,jsxs as oe}from"react/jsx-runtime";function Bs({account:e,catalog:r,onOpenChange:t,onRemoveCalendar:o,onSaveCalendars:a,onReconnect:n}){let[i,l]=Ds(!1),s=e?.authStatus==="reauth",c=e?.authStatus==="failed";function g(p){if(!e||!r)return;let u=new Set(p);a(e,r.calendars.filter(h=>u.has(h.id))),l(!1)}return oe(Qo,{children:[A(er.Root,{open:!!e&&!i,onOpenChange:p=>{p||t(!1)},children:A(er.Content,{maxWidth:x.dialogMd,children:e&&oe(Qo,{children:[oe(rr,{align:"center",gap:"3",mb:"1",children:[A(B,{size:"var(--space-6)",children:A(W,{provider:e.provider})}),oe(Jo,{style:{minWidth:0,flex:1},children:[oe(rr,{align:"center",gap:"2",mb:"1",style:{minWidth:0},children:[A(er.Title,{size:"4",weight:"medium",mb:"0",truncate:!0,style:{minWidth:0},children:e.displayName}),s&&A(Zo,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),c&&A(Zo,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),A(er.Description,{size:"2",color:"gray",mb:"0",children:e.email})]})]}),(s||c)&&n&&oe(kt,{size:"2",variant:"soft",color:c?"red":"amber",mt:"3",onClick:()=>n(e.id),children:[A(Ns,{}),"Reconnect"]}),A(As,{size:"4",my:"4"}),oe(rr,{align:"center",justify:"between",gap:"3",mb:"3",children:[A(wr,{as:"p",className:"ds-section-label",mb:"0",children:"Calendars"}),r&&r.calendars.length>0&&oe(kt,{size:"1",variant:"soft",color:"gray",onClick:()=>l(!0),children:[A(Es,{style:y("--space-3")}),"Change calendars"]})]}),A(rr,{direction:"column",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",overflow:"hidden",background:"var(--color-panel-solid)"},children:e.calendars.length===0?A(wr,{size:"2",color:"gray",style:{padding:"var(--space-4)"},children:"No calendars imported."}):e.calendars.map((p,u)=>oe(rr,{align:"center",gap:"3",className:"data-table-row",style:{padding:"var(--space-3) var(--space-4)",minHeight:"var(--space-7)",borderTop:u>0?"1px solid var(--gray-4)":void 0},children:[A(Jo,{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:p.colorToken,flexShrink:0}}),oe(wr,{size:"2",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:[p.name,p.isPrimary&&oe(wr,{size:"1",color:"gray",children:[" ","\xB7 Primary"]})]}),A(Is,{variant:"ghost",color:"gray",size:"1","aria-label":`Remove ${p.name}`,onClick:()=>o(e,p),children:A(Ps,{})})]},p.id))}),A(J,{justify:"end",children:A(er.Close,{children:A(kt,{size:"2",variant:"soft",color:"gray",children:"Close"})})})]})})}),A(Se,{account:i&&r?r:null,initiallySelectedIds:e?.calendars.map(p=>p.id),title:"Change calendars",description:"Choose which calendars to keep on this account.",confirmLabel:"Save calendars",onOpenChange:p=>{p||l(!1)},onImport:g})]})}import{useMemo as Ms}from"react";import Rr from"dayjs";import{Calendar as zs,dayjsLocalizer as Fs,Views as tr}from"react-big-calendar";import"react-big-calendar/lib/css/react-big-calendar.css";import{Text as Tr}from"@radix-ui/themes";import{jsx as He,jsxs as Sr}from"react/jsx-runtime";var Ls=Fs(Rr),Hs=new Date(1970,0,1,8,0,0);function Dt({blocks:e,view:r,onViewChange:t,date:o,onNavigate:a,accounts:n,today:i=new Date}){let l=Ms(()=>e.map(s=>{let c=new Date(s.date);c.setHours(s.startHour,s.startMinute,0,0);let g=new Date(s.date);return g.setHours(s.endHour,s.endMinute,0,0),{id:s.id,title:s.title,start:c,end:g,resource:s}}),[e]);return He("div",{className:"rbc-radix-scope",style:{height:"100%",containerType:"inline-size"},children:He(zs,{localizer:Ls,events:l,view:r==="week"?tr.WEEK:tr.MONTH,onView:s=>t(s===tr.MONTH?"month":"week"),date:o,onNavigate:a,views:[tr.WEEK,tr.MONTH],toolbar:!0,popup:!0,scrollToTime:Hs,enableAutoScroll:!0,getNow:()=>i,tooltipAccessor:null,eventPropGetter:s=>{let g=Y(n,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return r==="month"?{style:{background:"transparent",border:"none",boxShadow:"none"}}:{style:{backgroundColor:g,border:"none"}}},components:{toolbar:ft,week:{header:s=>He(gt,{...s,today:i}),event:({event:s})=>{let c=(s.end.getTime()-s.start.getTime())/6e4,g=c>=60,p=c>=30;return Sr("div",{children:[He(Tr,{size:"1",weight:"medium",style:{color:"white",display:"block"},truncate:!0,children:s.title}),p&&Sr(Tr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:[Rr(s.start).format("h:mm A")," \u2013 ",Rr(s.end).format("h:mm A")]}),g&&s.resource.location&&He(Tr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:s.resource.location})]})}},month:{event:({event:s})=>{let g=Y(n,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return Sr(Tr,{size:"1",style:{display:"flex",alignItems:"center",gap:"var(--space-1)",color:"var(--gray-12)",background:`color-mix(in srgb, ${g} 28%, transparent)`,borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)"},truncate:!0,children:[He("span",{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:g,flexShrink:0}}),Sr("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[Rr(s.start).format("H:mm")," ",s.title]})]})}}}})})}import{Dialog as or,Flex as Re,Text as ke,Button as ea,Separator as Os,Badge as _s}from"@radix-ui/themes";import{Fragment as Vs,jsx as k,jsxs as he}from"react/jsx-runtime";var ra={synced:{label:"Synced",color:"green"},syncing:{label:"Syncing\u2026",color:"amber"},error:{label:"Error",color:"red"}};function Ws({sync:e,accounts:r,onOpenChange:t,onEdit:o}){let a=e?(()=>{let n=e.sourceCalendarIds.map(l=>Y(r,l)?.calendar.name).filter(l=>!!l),i=Y(r,e.targetCalendarId)?.calendar.name??"\u2014";return`${n.join(", ")||"\u2014"} \u2192 ${i}`})():"";return k(or.Root,{open:!!e,onOpenChange:t,children:k(or.Content,{maxWidth:x.dialogMd,children:e&&he(Vs,{children:[he(Re,{align:"center",justify:"between",mb:"1",children:[k(or.Title,{size:"4",mb:"0",children:e.name}),k(_s,{color:ra[e.status].color,variant:"soft",size:"1",radius:"full",children:ra[e.status].label})]}),k(or.Description,{size:"2",color:"gray",mb:"4",children:"Sync configuration"}),he(Re,{direction:"column",gap:"3",children:[k(ye,{label:"Calendars",children:a}),k(ye,{label:"Sources",children:k(Re,{direction:"column",gap:"1",align:"end",children:e.sourceCalendarIds.map(n=>{let i=Y(r,n);return i?he(Re,{direction:"column",align:"end",children:[k(ke,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:i.calendar.name}),k(ke,{size:"1",color:"gray",children:i.account.email})]},n):null})||"\u2014"})}),k(ye,{label:"Target",children:(()=>{let n=Y(r,e.targetCalendarId);return n?he(Re,{direction:"column",align:"end",children:[k(ke,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:n.calendar.name}),k(ke,{size:"1",color:"gray",children:n.account.email})]}):"\u2014"})()}),k(ye,{label:"Last synced",children:e.lastSyncedLabel??"\u2014"})]}),k(Os,{size:"4",my:"4"}),k(ke,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"WHAT TO SHOW"}),he(Re,{direction:"column",gap:"3",children:[k(ye,{label:"Tag",children:e.tagLabel?.trim()||"Busy"}),k(ye,{label:"Event titles",children:e.showTitle?"Shown":"Hidden"}),k(ye,{label:"Event description",children:e.showDescription?"Shown":"Hidden"}),k(ye,{label:"Event location",children:e.showLocation?"Shown":"Hidden"})]}),he(J,{justify:"between",children:[k(or.Close,{children:k(ea,{size:"2",variant:"soft",color:"gray",children:"Close"})}),k(ea,{size:"2",className:"btn-amber-primary",onClick:()=>o(e.id),children:"Edit sync"})]})]})})})}function ye({label:e,children:r}){return he(Re,{align:"baseline",justify:"between",gap:"4",children:[k(ke,{size:"2",color:"gray",style:{flexShrink:0},children:e}),k(ke,{size:"2",weight:"medium",align:"right",style:{color:"var(--gray-12)"},children:r})]})}import{useState as kr}from"react";function ar({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o}){let[a,n]=kr(null),[i,l]=kr(null),[s,c]=kr(null),[g,p]=kr(!1);function u(v){if(a)return;c(null),p(!1),n(v);let f=e.map(S=>S.id);r(v,f).then(S=>{n(null),S?l(S):(c(v),p(!0))}).catch(()=>{n(null),c(v),p(!1)})}function h(v){if(!i)return;let f=new Set(v);t({...i,calendars:i.calendars.filter(S=>f.has(S.id))}),l(null),o?.()}return{connectingProvider:a,pendingAccount:i,failedProvider:s,exhausted:g,connect:u,confirmImport:h,cancelImport:()=>l(null),dismissError:()=>c(null)}}import{Box as $s,DropdownMenu as Dr,Button as Gs,Flex as Us,Text as ta}from"@radix-ui/themes";import{PlusIcon as oa}from"@radix-ui/react-icons";import{Fragment as Ks,jsx as ae,jsxs as Oe}from"react/jsx-runtime";function js({variant:e="button",trigger:r,accounts:t,connectProvider:o,onAccountAdded:a,onImported:n}){let{pendingAccount:i,failedProvider:l,exhausted:s,connect:c,confirmImport:g,cancelImport:p,dismissError:u}=ar({accounts:t,connectProvider:o,onAccountAdded:a,onImported:n}),h=["google","microsoft"],v=e==="tile"?Oe("button",{type:"button",className:"connect-account-tile","aria-label":"Connect Account",children:[ae(oa,{style:y("--space-4")}),"Connect Account"]}):Oe(Gs,{size:"2",className:"btn-amber-primary",children:[ae(oa,{style:y("--space-4")}),"Connect Account"]}),f=Oe(Dr.Root,{children:[ae(Dr.Trigger,{children:r??v}),ae(Dr.Content,{align:"start",style:{width:"max-content",minWidth:"max-content"},children:h.map(S=>{let E=Fe[S];return Oe(Dr.Item,{onSelect:()=>c(S),style:{height:"auto",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)"},children:[ae(B,{size:"var(--space-6)",children:ae(W,{provider:S})}),Oe(Us,{direction:"column",gap:"1",style:{flexShrink:0},children:[ae(ta,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:E.label}),ae(ta,{size:"1",color:"gray",children:E.description})]})]},S)})})]});return Oe(Ks,{children:[e==="tile"&&!r?ae($s,{style:{width:"100%",minWidth:0},children:f}):f,ae(Se,{account:i,onOpenChange:S=>!S&&p(),onImport:g}),l&&ae($r,{msg:s?`No more ${Fe[l].label} accounts available to connect.`:`Couldn't connect ${Fe[l].label}. Please try again.`,color:"red",onDone:u})]})}import{Card as Ys,Flex as It,Text as qs,Heading as Xs}from"@radix-ui/themes";import{CalendarIcon as Zs}from"@radix-ui/react-icons";import{jsx as be,jsxs as aa}from"react/jsx-runtime";function Js({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o}){let{connectingProvider:a,pendingAccount:n,failedProvider:i,exhausted:l,connect:s,confirmImport:c,cancelImport:g}=ar({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o});return aa(It,{direction:"column",align:"center",justify:"center",style:{width:"100%",flex:1,minHeight:0},children:[be(Ys,{style:{width:"100%",maxWidth:x.providerChooserMax},children:aa(It,{direction:"column",align:"center",justify:"center",gap:"3",py:"6",px:"3",style:{width:"100%",textAlign:"center"},children:[be(B,{children:be(Zs,{style:{...y("--space-5"),color:"var(--gray-7)"}})}),be(Xs,{as:"h2",size:_.h2,weight:"medium",children:e.length>0?"Connect another account":"Connect your first account"}),be(qs,{as:"p",size:"2",color:"gray",children:e.length>0?"Add another Google or Microsoft account, then choose which calendars to import.":"Connect a Google or Microsoft account to import calendars for sync."}),be(It,{direction:"column",style:{width:"100%"},mt:"3",children:be(yt,{connectingProvider:a,failedProvider:i,exhausted:l,onConnect:s})})]})}),be(Se,{account:n,onOpenChange:p=>!p&&g(),onImport:c})]})}import{useEffect as Qs,useMemo as At,useState as Ir}from"react";import{Link as el}from"react-router-dom";import{Box as Pt,Checkbox as na,Flex as nr,Separator as Et,Text as De}from"@radix-ui/themes";import{ChevronDownIcon as rl,GearIcon as tl,HamburgerMenuIcon as ol}from"@radix-ui/react-icons";import{jsx as P,jsxs as me}from"react/jsx-runtime";function al({accounts:e,view:r,setView:t,hideClones:o,setHideClones:a,mergedCalendarIds:n,visibleCalendarIds:i,toggleCalendarVisible:l,getVisibleBlocksInRange:s,manageAccountsHref:c,today:g=new Date}){let[p,u]=Ir(g),[h,v]=Ir(new Set),[f,S]=Ir(()=>typeof window<"u"&&window.innerWidth<900),[E,X]=Ir(!1);Qs(()=>{function b(){S(window.innerWidth<900)}return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let ne=At(()=>{let b=new Date(p);return b.setDate(b.getDate()-42),b},[p]),C=At(()=>{let b=new Date(p);return b.setDate(b.getDate()+42),b},[p]),z=s(ne,C),R=At(()=>{let b=[],F=new Map;for(let H of n){let G=Y(e,H);if(!G)continue;let ce=F.get(G.account.id);ce===void 0&&(ce=b.length,F.set(G.account.id,ce),b.push({accountId:G.account.id,calendarIds:[]})),b[ce].calendarIds.push(H)}return b},[n,e]);function fe(b){v(F=>{let H=new Set(F);return H.has(b)?H.delete(b):H.add(b),H})}return me(nr,{gap:"5",align:"start",direction:f?"column":"row",flexGrow:"1",minHeight:"0",height:"100%",children:[(!f||E)&&me(Pt,{minWidth:f?void 0:x.sidebarColMin,p:"4",maxHeight:"100%",style:{flex:f?"1 1 100%":`0 0 ${x.sidebarColBasis}`,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",boxShadow:"var(--shadow-card)",overflow:"auto"},children:[P(Rt,{cursor:p,onSelect:u,today:g}),P(Et,{size:"4",my:"3"}),P(De,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"CALENDARS"}),P(nr,{direction:"column",gap:"1",mb:"4",children:R.map(({accountId:b,calendarIds:F},H)=>{let G=e.find(de=>de.id===b);if(!G)return null;let ce=h.has(b);return me("div",{style:{paddingTop:H>0?"var(--space-2)":void 0,borderTop:H>0?"1px solid var(--gray-3)":void 0},children:[me(nr,{align:"center",gap:"2",mb:"2",py:"1",className:"calendar-legend-account-row",style:{cursor:"pointer",borderRadius:"var(--radius-2)"},onClick:()=>fe(b),children:[P(rl,{style:{...y("--space-3"),color:"var(--gray-9)",transform:ce?"rotate(-90deg)":void 0,transition:"transform 120ms ease",flexShrink:0}}),P(W,{provider:G.provider}),P(De,{size:"2",weight:"medium",truncate:!0,title:G.email,style:{color:"var(--gray-12)",minWidth:0},children:G.email})]}),!ce&&P(nr,{direction:"column",gap:"1",pl:"5",children:F.map(de=>{let Ae=Y(e,de);return Ae?me(De,{as:"label",size:"2",className:"calendar-legend-row",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer",borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)",marginLeft:"calc(var(--space-2) * -1)"},children:[me(nr,{align:"center",gap:"1",children:[P(na,{checked:i.has(de),onCheckedChange:()=>l(de)}),P("span",{"aria-hidden":!0,style:{width:"var(--space-3)",height:"var(--space-3)",borderRadius:"50%",background:Ae.calendar.colorToken,flexShrink:0}})]}),P(De,{size:"2",truncate:!0,style:{color:"var(--gray-12)"},title:Ae.calendar.name,children:Ae.calendar.name})]},de):null})})]},b)})}),P(Et,{size:"4",mb:"3"}),me(De,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer"},mb:"3",children:[P(na,{checked:o,onCheckedChange:b=>a(!!b)}),"Hide synced events"]}),P(Et,{size:"4",mb:"3"}),me(el,{to:c,style:{display:"flex",alignItems:"center",gap:"var(--space-2)",color:"var(--gray-11)",textDecoration:"none"},children:[P(tl,{style:y("--space-3")}),P(De,{size:"2",children:"Manage accounts"})]}),P(De,{as:"p",size:"1",color:"gray",mt:"4",children:"On your target calendars, others see only what each sync is set to share. Full detail stays in araMetrics."})]}),me(Pt,{width:f?"100%":void 0,minHeight:x.bigCalendarH,height:"100%",style:{flex:f?"1 1 100%":`1 1 ${x.syncColWide}`,minWidth:f?0:x.syncColMin,display:"flex",flexDirection:"column",alignSelf:"stretch"},children:[f&&P("button",{type:"button",className:"sidebar-icon-btn","aria-label":E?"Hide calendars":"Show calendars",style:{alignSelf:"flex-start",marginBottom:"var(--space-3)"},onClick:()=>X(b=>!b),children:P(ol,{style:y("--space-4")})}),P(Pt,{flexGrow:"1",minHeight:"0",height:"100%",children:P(Dt,{blocks:z,view:r,onViewChange:t,date:p,onNavigate:u,accounts:e,today:g})})]})]})}import{clsx as nl}from"clsx";import{twMerge as il}from"tailwind-merge";function Ie(...e){return il(nl(e))}function sl(e,r="solid"){return D.variants[e]?.[r]||D.variants.primary[r]}function ll(e){let r=D.sizes[e]||D.sizes.md;return`${r.text} ${r.padding} ${r.height}`}function cl(){return Ie(D.base.transition,D.base.focus,D.base.disabled,D.accessibility.reducedMotion)}function dl(){return Ie(D.base.interactive,D.accessibility.focusTrap,D.accessibility.touchTarget)}function pl(e={}){return Ie(e.focusVisible&&D.accessibility.focusTrap,e.highContrast&&D.accessibility.highContrast,e.reducedMotion&&D.accessibility.reducedMotion)}function gl(e,r=""){return typeof e=="string"?`${r}${e}`:typeof e=="object"&&e!==null?Object.entries(e).map(([t,o])=>o===void 0?"":`${t==="xs"?"":`${t}:`}${r}${o}`).filter(Boolean).join(" "):""}function ul(e,r="gap"){let t=D.spacing[e]||D.spacing.md;switch(r){case"margin":return t.replace("gap-","m-");case"padding":return t.replace("gap-","p-");default:return t}}function ml(e){return D.radius[e]||D.radius.md}function fl(e){return D.typography[e]||D.typography.base}function vl(e,r=500){return`bg-${e}-${r}`}function yl(e,r=500){return`text-${e}-${r}`}function hl(e,r=500){return`border-${e}-${r}`}function bl(e,r=500){return`hover:bg-${e}-${r}`}function xl(e,r=500){return`hover:text-${e}-${r}`}function Cl(e,r=500){return`focus:ring-${e}-${r}`}function wl(e){let r=D.animations[e];return typeof r=="string"?r:""}function Tl(e,r,t){return o=>{let a=e;return Object.entries(r).forEach(([n,i])=>{let l=o[n];l&&i[l]&&(a+=` ${i[l]}`)}),t?.forEach(({conditions:n,className:i})=>{Object.entries(n).every(([s,c])=>o[s]===c)&&(a+=` ${i}`)}),Ie(a)}}function Sl(e){return function(t){let{className:o,...a}=t,n={...e.defaultVariants,...a},i=e.base||"";return e.variants&&Object.entries(e.variants).forEach(([l,s])=>{let c=n[l];c&&s[c]&&(i+=` ${s[c]}`)}),e.compoundVariants?.forEach(({conditions:l,className:s})=>{Object.entries(l).every(([g,p])=>n[g]===p)&&(i+=` ${s}`)}),Ie(i,o)}}function Rl(e,r){let t={...e};return Object.keys(r).forEach(o=>{let a=r[o],n=e[o];o==="className"?t[o]=Ie(n,a):typeof a=="object"&&typeof n=="object"&&a!==null&&n!==null&&!Array.isArray(a)&&!Array.isArray(n)?t[o]={...n,...a}:t[o]=a}),t}function kl(e,r,t){return e?r:t&&e===!1?t:""}function Dl(e){let r=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(", ");return Array.from(e.querySelectorAll(r))}function Il(e,r,t,o={}){let{loop:a=!0,orientation:n="both"}=o,i=t;switch(e.key){case"ArrowDown":(n==="vertical"||n==="both")&&(i=t+1,i>=r.length&&(i=a?0:r.length-1));break;case"ArrowUp":(n==="vertical"||n==="both")&&(i=t-1,i<0&&(i=a?r.length-1:0));break;case"ArrowRight":(n==="horizontal"||n==="both")&&(i=t+1,i>=r.length&&(i=a?0:r.length-1));break;case"ArrowLeft":(n==="horizontal"||n==="both")&&(i=t-1,i<0&&(i=a?r.length-1:0));break;case"Home":i=0;break;case"End":i=r.length-1;break}return i!==t&&(e.preventDefault(),r[i]?.focus()),i}import{Theme as Al}from"@radix-ui/themes";import"@radix-ui/themes/styles.css";import{jsx as El}from"react/jsx-runtime";function Pl({children:e,appearance:r="light",radius:t="none",scaling:o="100%",accentColor:a="amber",grayColor:n="gray",panelBackground:i="solid",className:l=""}){return El(Al,{accentColor:a,grayColor:n,radius:t,scaling:o,panelBackground:i,appearance:r,className:l,children:e})}import*as Ar from"react";function Rf({value:e,defaultValue:r,onChange:t}){let[o,a]=Ar.useState(r),n=e!==void 0,i=n?e:o,l=Ar.useCallback(s=>{let c=typeof s=="function"?s(i):s;n||a(c),t?.(c)},[n,i,t]);return[i,l]}import*as _e from"react";function Df(e=!1){let[r,t]=_e.useState(e),o=_e.useCallback(()=>t(!0),[]),a=_e.useCallback(()=>t(!1),[]),n=_e.useCallback(()=>t(i=>!i),[]);return{isOpen:r,open:o,close:a,toggle:n,onOpen:o,onClose:a,onToggle:n}}import*as Pr from"react";function Af(e,r=!0){let t=Pr.useRef(null);return Pr.useEffect(()=>{if(!r)return;let o=a=>{t.current&&!t.current.contains(a.target)&&e()};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[e,r]),t}export*from"@radix-ui/react-icons";export{Ln as ACTIVITY_META,uo as AUDIT_ACTION_META,Ra as AccentCard,Yt as AccentHeader,Pc as AccessibleIcon,_t as Accordion,$t as AccordionContent,Wt as AccordionItem,Vt as AccordionTrigger,Bs as AccountCalendarsDialog,Fa as AccountCard,fn as ActivityRow,js as AddAccountMenu,uc as AlertDialog,mn as AppCard,_l as AspectRatio,On as AuthCard,xc as Avatar,Cc as Badge,Dt as BigCalendarView,Ul as Blockquote,Ml as Box,Xr as BrandPanel,Jl as Button,gt as CalendarDayHeader,al as CalendarMergedView,Ui as CalendarPickList,ft as CalendarToolbar,wc as Callout,Tc as Card,J as CardFooter,tc as Checkbox,ac as CheckboxCards,oc as CheckboxGroup,jl as Code,Hr as ConfirmDialog,yt as ConnectProviderList,Js as ConnectProviderRows,ns as ConnectedAccountCard,Ll as Container,fc as ContextMenu,Cn as DashboardErrorCard,Sc as DataList,Ur as DataTableRow,gc as Dialog,ya as Drawer,ba as DrawerClose,Gt as DrawerContent,Ca as DrawerDefaultClose,jt as DrawerDescription,xa as DrawerHeader,Ut as DrawerTitle,ha as DrawerTrigger,mc as DropdownMenu,Kl as Em,cs as EmptyCard,tn as EventBlock,zl as Flex,Zr as GoogleIcon,Fl as Grid,Gl as Heading,yc as HoverCard,Ql as IconButton,B as IconTile,Se as ImportCalendarsDialog,Ol as Inset,Yl as Kbd,Fn as METRIC_STATUS_COLOR,ln as MetricCard,Jr as MicrosoftIcon,Rt as MiniMonthPicker,ja as MonthGrid,Ts as OnboardingStepDots,Uo as OnboardingStepper,Qr as OtpInput,Kn as OtpVerifyStep,Yn as PROVIDER_LABEL,Fe as PROVIDER_META,Nn as Pagination,Or as PausedBadge,vc as Popover,bc as Portal,Rc as Progress,W as ProviderIcon,Xl as Quote,Mn as ROLE_LABELS,gr as ROLE_META,nc as Radio,sc as RadioCards,ic as RadioGroup,yr as SHELL_HEADER_H,zn as STATUS_META,Wl as ScrollArea,Li as SearchOverlay,Hl as Section,pc as SegmentedControl,lc as Select,Vl as Separator,di as Sidebar,ga as Skeleton,cc as Slider,Ec as Slot,Nc as Slottable,kc as Spinner,Zl as Strong,dc as Switch,Ws as SyncDetailsDialog,xs as SyncPreviewRail,Ac as TabNav,Dc as Table,Ic as Tabs,$l as Text,rc as TextArea,ec as TextField,ql as TextLink,$r as Toast,hc as Tooltip,Ri as Topbar,Pl as UIProvider,Bc as VisuallyHidden,wt as WizardStepper,Hn as auditActionMeta,Ie as cn,pa as colors,kl as conditionalClass,Tl as createCompoundVariants,Sl as createVariantGenerator,Y as findCalendar,pl as getAccessibilityStyles,wl as getAnimationClass,cl as getBaseStyles,vl as getBgClass,hl as getBorderClass,Ot as getColor,Cl as getFocusRingClass,Dl as getFocusableElements,bl as getHoverBgClass,xl as getHoverTextClass,dl as getInteractiveStyles,ml as getRadiusClass,gl as getResponsiveClasses,ll as getSizeStyles,ul as getSpacingClass,yl as getTextClass,fl as getTypographyClass,sl as getVariantStyles,Il as handleArrowNavigation,_ as headingSize,x as layout,Rl as mergeProps,D as theme,Af as useClickOutside,ar as useConnectAccount,Rf as useControllableState,Df as useDisclosure};
1
+ import{a as pa,b as D,c as Ot}from"./chunk-LGJWNA6J.mjs";import{Box as zl,Flex as Fl,Grid as Ll,Container as Hl,Section as Ol,Inset as _l,AspectRatio as Wl,ScrollArea as Vl,Separator as $l,Text as Gl,Heading as Ul,Blockquote as jl,Code as Kl,Em as Yl,Kbd as ql,Link as Xl,Quote as Zl,Strong as Jl,Button as Ql,IconButton as ec,TextField as rc,TextArea as tc,Checkbox as oc,CheckboxGroup as ac,CheckboxCards as nc,Radio as ic,RadioGroup as sc,RadioCards as lc,Select as cc,Slider as dc,Switch as pc,SegmentedControl as gc,Dialog as uc,AlertDialog as mc,DropdownMenu as fc,ContextMenu as vc,Popover as yc,HoverCard as hc,Tooltip as bc,Portal as xc,Avatar as Cc,Badge as wc,Callout as Tc,Card as Sc,DataList as Rc,Progress as kc,Spinner as Dc,Table as Ic,Tabs as Ac,TabNav as Pc,AccessibleIcon as Ec,Slot as Bc,Slottable as Nc,VisuallyHidden as Mc}from"@radix-ui/themes";import{jsx as ua}from"react/jsx-runtime";function ga({width:e="100%",height:r="var(--space-4)",radius:t="var(--radius-2)",circle:o=!1,mb:a,className:n,style:i}){return ua("div",{className:["skeleton",n].filter(Boolean).join(" "),"aria-hidden":"true",style:{width:e,height:r,borderRadius:o?"50%":t,marginBottom:a,...i}})}import*as We from"react";import*as ie from"@radix-ui/react-accordion";import{ChevronDownIcon as ma}from"@radix-ui/react-icons";import{jsx as Be,jsxs as fa}from"react/jsx-runtime";var _t=We.forwardRef(({className:e="",...r},t)=>Be(ie.Root,{ref:t,className:`arm-accordion ${e}`,...r}));_t.displayName="Accordion";var Wt=We.forwardRef(({className:e="",...r},t)=>Be(ie.Item,{ref:t,className:`arm-accordion__item ${e}`,...r}));Wt.displayName="AccordionItem";var Vt=We.forwardRef(({className:e="",children:r,...t},o)=>Be(ie.Header,{className:"arm-accordion__header",children:fa(ie.Trigger,{ref:o,className:`arm-accordion__trigger ${e}`,...t,children:[r,Be(ma,{"aria-hidden":!0,className:"arm-accordion__chevron"})]})}));Vt.displayName="AccordionTrigger";var $t=We.forwardRef(({className:e="",children:r,...t},o)=>Be(ie.Content,{ref:o,className:`arm-accordion__content ${e}`,...t,children:Be("div",{className:"arm-accordion__body",children:r})}));$t.displayName="AccordionContent";import*as cr from"react";import*as B from"@radix-ui/react-dialog";import{Cross2Icon as va}from"@radix-ui/react-icons";import{jsx as xe,jsxs as wa}from"react/jsx-runtime";var ya=B.Root,ha=B.Trigger,ba=B.Close,Gt=cr.forwardRef(({className:e="",side:r="right",size:t="md",children:o,...a},n)=>wa(B.Portal,{children:[xe(B.Overlay,{className:"arm-drawer__overlay"}),xe(B.Content,{ref:n,"data-side":r,"data-size":t,className:`arm-drawer ${e}`,...a,children:o})]}));Gt.displayName="DrawerContent";var xa=({className:e="",children:r,...t})=>xe("div",{className:`arm-drawer__header ${e}`,...t,children:r}),Ut=cr.forwardRef(({className:e="",...r},t)=>xe(B.Title,{ref:t,className:`arm-drawer__title ${e}`,...r}));Ut.displayName="DrawerTitle";var jt=cr.forwardRef(({className:e="",...r},t)=>xe(B.Description,{ref:t,className:`arm-drawer__description ${e}`,...r}));jt.displayName="DrawerDescription";var Ca=()=>xe(B.Close,{"aria-label":"Close",className:"arm-drawer__close",children:xe(va,{"aria-hidden":!0,className:"arm-drawer__close-icon"})});import{Box as Kt,Flex as Ta,Text as Sa}from"@radix-ui/themes";import{jsx as Fr,jsxs as qt}from"react/jsx-runtime";function Yt({title:e,trailing:r,style:t}){let o=typeof e=="string"||typeof e=="number"?Fr(Sa,{size:"3",weight:"medium",style:{color:"var(--accent-contrast)"},children:e}):e;return qt(Ta,{align:"center",justify:"between",gap:"3",px:"4",style:{background:"var(--accent-9)",minHeight:"var(--space-7)",...t},children:[o,r]})}function Ra({title:e,trailing:r,children:t,bodyPadding:o="4",style:a}){return qt(Kt,{style:{background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",overflow:"hidden",boxShadow:"var(--shadow-card)",...a},children:[Fr(Yt,{title:e,trailing:r}),Fr(Kt,{p:o,children:t})]})}import{AlertDialog as Ce,Button as Xt}from"@radix-ui/themes";var x={contentMax:"calc(15 * var(--space-9) + var(--space-5))",accountCardW:"calc(3 * var(--space-9) + var(--space-8))",accountCardMinH:"calc(2 * var(--space-9) - var(--space-2))",monthTitleMinW:"calc(3 * var(--space-9) - var(--space-1))",bigCalendarH:"calc(10 * var(--space-9))",sidebarColBasis:"calc(4 * var(--space-9) - var(--space-2))",sidebarColMin:"calc(3 * var(--space-9) + var(--space-6))",syncColMin:"calc(5 * var(--space-9))",syncColWide:"calc(7 * var(--space-9) + var(--space-6))",dialogSm:"calc(6 * var(--space-9) - var(--space-2))",dialogBody:"calc(5 * var(--space-9) + var(--space-7))",authFormMax:"calc(6 * var(--space-9) + var(--space-8))",brandLogoMax:"calc(6 * var(--space-9) + var(--space-8) - var(--space-1))",connectedAccountCardH:"calc(var(--space-9) - var(--space-1))",dialogMd:"calc(6 * var(--space-9) + var(--space-6))",dialogLg:"calc(7 * var(--space-9) - var(--space-1))",emptyStateMax:"calc(10 * var(--space-9))",emptyStateCopyMax:"calc(6 * var(--space-9))",providerChooserMax:"calc(6 * var(--space-9) + var(--space-6))",auditColTime:"calc(var(--space-9) + var(--space-2))",auditColAction:"calc(var(--space-9) + var(--space-5) + var(--space-1))",searchFieldW:"calc(3 * var(--space-9) + var(--space-5) + var(--space-1))",settingsGridMin:"calc(5 * var(--space-9) + var(--space-5))",placeholderMd:"calc(6 * var(--space-9) + var(--space-4))"};import{Flex as ka}from"@radix-ui/themes";import{jsx as Da}from"react/jsx-runtime";function J({children:e,justify:r="end",noTopMargin:t,pad:o="var(--space-5)",radius:a="var(--radius-5)"}){return Da(ka,{justify:r,style:{margin:`${t?"0":"var(--space-5)"} calc(-1 * ${o}) calc(-1 * ${o})`,padding:`var(--space-4) ${o}`,alignItems:"center",background:"var(--gray-2)",borderTop:"1px solid var(--gray-5)",borderRadius:`0 0 ${a} ${a}`},children:e})}import{jsx as we,jsxs as Lr}from"react/jsx-runtime";function Hr({title:e,description:r,confirmLabel:t="Yes",cancelLabel:o="Cancel",onConfirm:a,trigger:n,open:i,onOpenChange:l}){return Lr(Ce.Root,{open:i,onOpenChange:l,children:[n?we(Ce.Trigger,{children:n}):null,Lr(Ce.Content,{maxWidth:x.dialogSm,children:[we(Ce.Title,{size:"5",mb:"1",style:{fontFamily:"var(--heading-font-family)",fontWeight:"var(--font-weight-medium)"},children:e}),we(Ce.Description,{size:"2",color:"gray",mb:"5",children:r}),Lr(J,{justify:"between",noTopMargin:!0,children:[we(Ce.Cancel,{children:we(Xt,{size:"2",variant:"outline",color:"gray",children:o})}),we(Ce.Action,{children:we(Xt,{size:"2",className:"btn-amber-primary",onClick:a,children:t})})]})]})]})}import{PauseIcon as Ia}from"@radix-ui/react-icons";function y(e){return{width:`var(${e})`,height:`var(${e})`}}import{jsx as Zt,jsxs as Aa}from"react/jsx-runtime";function Or({label:e="Paused",style:r}){return Aa("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--space-1)",height:"calc(var(--space-4) + var(--space-1))",padding:"var(--space-1) var(--space-2)",border:"1px solid var(--color-paused)",borderRadius:999,background:"var(--color-panel-solid)",color:"var(--color-paused)",fontSize:"var(--font-size-1)",fontWeight:600,lineHeight:1,whiteSpace:"nowrap",...r},children:[Zt("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-3)",height:"var(--space-3)",flexShrink:0,borderRadius:"50%",border:"1px solid var(--color-paused)"},children:Zt(Ia,{style:y("--space-2")})}),e]})}import{Avatar as Pa,Box as Jt,DropdownMenu as Ne,Flex as Qt,IconButton as Ea,Text as eo}from"@radix-ui/themes";import{DotsVerticalIcon as Ba,PauseIcon as Na,PlayIcon as Ma,TrashIcon as za}from"@radix-ui/react-icons";import{jsx as U,jsxs as se}from"react/jsx-runtime";function Fa({name:e,email:r,avatarSrc:t,paused:o=!1,onPause:a,onResume:n,onDelete:i,onClick:l,badge:s,accentColor:c,style:g}){let p=U(eo,{as:l?"span":"p",size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)",minWidth:0},children:e});return se(Jt,{onClick:l,style:{width:x.accountCardW,minHeight:x.accountCardMinH,padding:"var(--space-3)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-4)",boxShadow:"var(--shadow-card)",cursor:l?"pointer":void 0,...g},children:[se(Qt,{align:"center",justify:"between",gap:"2",mb:"3",children:[se(Qt,{align:"center",gap:"2",style:{minWidth:0},children:[se("div",{style:{position:"relative",flexShrink:0},children:[U(Pa,{size:"3",radius:"full",src:t,fallback:e.charAt(0).toUpperCase()||"?",style:c?{background:c,color:"white"}:void 0}),s&&U("span",{style:{position:"absolute",right:"calc(-1 * var(--space-1))",bottom:"calc(-1 * var(--space-1))",width:"var(--space-4)",height:"var(--space-4)",borderRadius:"50%",background:"var(--color-panel-solid)",border:"1px solid var(--gray-4)",display:"inline-flex",alignItems:"center",justifyContent:"center",transform:"scale(0.72)"},children:s})]}),o&&U(Or,{})]}),se(Ne.Root,{children:[U(Ne.Trigger,{children:U(Ea,{variant:"ghost",color:"gray","aria-label":"Account actions",style:{flexShrink:0},onClick:u=>u.stopPropagation(),children:U(Ba,{})})}),se(Ne.Content,{align:"end",onClick:u=>u.stopPropagation(),children:[o?se(Ne.Item,{onSelect:n,children:[U(Ma,{})," Resume"]}):se(Ne.Item,{onSelect:a,children:[U(Na,{})," Pause"]}),se(Ne.Item,{color:"red",onSelect:i,children:[U(za,{})," Delete"]})]})]})]}),se(Jt,{style:{minWidth:0},children:[l?U("button",{type:"button",className:"card-title-button",onClick:u=>{u.stopPropagation(),l()},children:p}):p,U(eo,{as:"p",size:"1",color:"gray",truncate:!0,children:r})]})]})}import{Box as ro,Flex as to,Heading as La,IconButton as oo,Text as ao}from"@radix-ui/themes";import{ChevronLeftIcon as Ha,ChevronRightIcon as Oa}from"@radix-ui/react-icons";var _={h1:"6",h2:"5",h3:"4",h4:"3"};import{Fragment as Ka,jsx as O,jsxs as Wr}from"react/jsx-runtime";var _a=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],_r="var(--space-9)",Wa="var(--space-8)",no="var(--space-2)",Va=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"}),$a=new Intl.DateTimeFormat("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"});function Ga(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function io(e){return(e+6)%7}function Ua(e){let r=e.getMonth(),t=e.getFullYear(),o=new Date(t,r,1),a=new Date(t,r+1,0),n=io(o.getDay()),i=6-io(a.getDay()),l=new Date(t,r,1-n),s=n+a.getDate()+i;return Array.from({length:s},(c,g)=>{let p=new Date(l.getFullYear(),l.getMonth(),l.getDate()+g);return{date:p,inCurrentMonth:p.getMonth()===r}})}function so(e,r){return new Date(e.getFullYear(),e.getMonth()+r,1)}function ja({month:e,onMonthChange:r,events:t=[],dayDots:o,today:a,onSelectDay:n,style:i}){let l=a??new Date,s=Ua(e),c=new Set(t.map(g=>g.toDateString()));return Wr(to,{direction:"column",align:"center",gap:"4",style:i,children:[Wr(to,{align:"center",gap:"2",children:[O(oo,{type:"button",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r?.(so(e,-1)),children:O(Ha,{style:y("--space-4")})}),O(La,{as:"h2",size:_.h2,weight:"medium",style:{minWidth:x.monthTitleMinW,textAlign:"center"},children:Va.format(e)}),O(oo,{type:"button",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r?.(so(e,1)),children:O(Oa,{style:y("--space-4")})})]}),O(ro,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${_r})`,gap:no},children:_a.map(g=>O(ao,{size:"2",align:"center",style:{color:"var(--gray-11)"},children:g},g))}),O(ro,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${_r})`,gap:no},children:s.map(({date:g,inCurrentMonth:p})=>{let u=Ga(g,l),h=o?.get(g.toDateString()),v=c.has(g.toDateString()),f={position:"relative",width:_r,height:Wa,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:p?u?"var(--color-panel-solid)":"transparent":"var(--gray-2)",border:u?"1.5px solid var(--accent-9)":"none",borderRadius:u?"var(--radius-3)":p?void 0:"var(--radius-2)",padding:0,font:"inherit",cursor:n?"pointer":void 0},S=Wr(Ka,{children:[h&&h.length>0?O("span",{"aria-hidden":"true",style:{position:"absolute",bottom:"var(--space-1)",left:0,right:0,display:"flex",justifyContent:"center",gap:"2px"},children:h.slice(0,3).map((X,ne)=>O("span",{style:{width:"var(--space-1)",height:"var(--space-1)",borderRadius:"50%",background:X}},ne))}):v&&O("span",{"aria-hidden":"true",style:{position:"absolute",top:"var(--space-1)",right:"var(--space-2)",width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:"var(--accent-9)"}}),O(ao,{size:"3",style:{color:p?"var(--gray-12)":"var(--gray-11)",fontWeight:u?600:400},children:g.getDate()})]}),E=g.toISOString();return n?O("button",{type:"button",onClick:()=>n(g),"aria-label":$a.format(g),style:f,children:S},E):O("div",{style:f,children:S},E)})})]})}import{useEffect as Ya}from"react";import{Callout as Vr}from"@radix-ui/themes";import{CheckCircledIcon as qa,ExclamationTriangleIcon as Xa}from"@radix-ui/react-icons";import{jsx as Ve,jsxs as Za}from"react/jsx-runtime";function $r({msg:e,color:r="green",onDone:t,durationMs:o=3e3}){return Ya(()=>{let a=setTimeout(t,o);return()=>clearTimeout(a)},[t,o]),Ve("div",{style:{position:"fixed",bottom:"var(--space-5)",right:"var(--space-5)",zIndex:1e4,maxWidth:x.dialogBody,pointerEvents:"none"},children:Za(Vr.Root,{color:r,variant:"soft",size:"1",children:[Ve(Vr.Icon,{children:r==="red"?Ve(Xa,{}):Ve(qa,{})}),Ve(Vr.Text,{children:e})]})})}import{jsx as Ja}from"react/jsx-runtime";function N({children:e,size:r="var(--space-7)"}){return Ja("div",{style:{width:r,height:r,borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e})}import{Box as Qa,Flex as en,Text as lo}from"@radix-ui/themes";import{LockClosedIcon as rn}from"@radix-ui/react-icons";import{jsx as co,jsxs as Gr}from"react/jsx-runtime";function tn({title:e,time:r,detail:t,color:o,locked:a}){return Gr(en,{align:"center",justify:"between",style:{background:o,borderRadius:"var(--radius-3)",padding:"var(--space-3)",color:"white"},children:[Gr(Qa,{style:{minWidth:0},children:[co(lo,{as:"p",size:"2",weight:"medium",style:{color:"white"},truncate:!0,children:e}),Gr(lo,{as:"p",size:"1",style:{color:"rgba(255,255,255,0.85)"},truncate:!0,children:[r,t?` \xB7 ${t}`:""]})]}),a&&co(rn,{style:{flexShrink:0,color:"rgba(255,255,255,0.85)"}})]})}import{Box as on}from"@radix-ui/themes";import{jsx as an}from"react/jsx-runtime";function Ur({children:e,style:r,showBorder:t=!1,onActivate:o,selected:a=!1,className:n,"aria-label":i}){let l=!!o;function s(c){o&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())}return an(on,{role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":i,onClick:o,onKeyDown:l?s:void 0,className:["data-table-row",l&&"data-table-row--interactive",l&&a&&"data-table-row--selected",n].filter(Boolean).join(" "),style:{borderTop:t?"1px solid var(--gray-3)":void 0,...r},children:e})}import{useId as nn}from"react";import{Card as sn,Flex as jr,Text as Kr}from"@radix-ui/themes";import{jsx as le,jsxs as Me}from"react/jsx-runtime";function ln({label:e,value:r,delta:t,deltaDir:o,goodDirection:a,statusColor:n,sparkline:i}){return le(sn,{className:"metric-card",children:Me(jr,{direction:"column",p:"1",children:[Me(jr,{align:"center",justify:"between",mb:"3",children:[le(Kr,{as:"span",className:"ds-section-label",children:e}),le("div",{style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:n,flexShrink:0}})]}),le(Kr,{as:"p",className:"metric-card-value",children:r}),Me(jr,{align:"end",justify:"between",children:[Me(Kr,{size:"1",style:{color:o==="flat"?"var(--gray-11)":o===a?"var(--green-11)":"var(--red-11)",lineHeight:1.4},children:[o==="up"?"\u2191 ":o==="down"?"\u2193 ":"",t]}),le(cn,{data:i,color:n})]})]})})}function cn({data:e,color:r}){let a=Math.min(...e),i=Math.max(...e)-a||1,l=e.map((u,h)=>({x:h/(e.length-1)*72,y:28-(u-a)/i*28*.75-28*.1})),s=l.map((u,h)=>`${h===0?"M":"L"} ${u.x.toFixed(1)} ${u.y.toFixed(1)}`).join(" "),c=["M 0 28",...l.map(u=>`L ${u.x.toFixed(1)} ${u.y.toFixed(1)}`),"L 72 28 Z"].join(" "),p=`spk${nn().replace(/[^a-zA-Z0-9_-]/g,"")}`;return Me("svg",{width:72,height:28,viewBox:"0 0 72 28","aria-hidden":!0,style:{overflow:"visible",flexShrink:0},children:[le("defs",{children:Me("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[le("stop",{offset:"0%",stopColor:r,stopOpacity:"0.18"}),le("stop",{offset:"100%",stopColor:r,stopOpacity:"0"})]})}),le("path",{d:c,fill:`url(#${p})`}),le("path",{d:s,fill:"none",stroke:r,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})}import{Link as dn}from"react-router-dom";import{Badge as pn,Button as gn,Card as un,Flex as po,Text as go}from"@radix-ui/themes";import{ArrowRightIcon as mn}from"@radix-ui/react-icons";import{jsx as Te,jsxs as dr}from"react/jsx-runtime";function fn({href:e,icon:r,name:t,description:o,badge:a}){return dr(un,{style:{height:"100%",display:"flex",flexDirection:"column"},children:[dr(po,{direction:"column",gap:"3",p:"1",flexGrow:"1",children:[dr(po,{align:"center",gap:"3",minWidth:"0",children:[Te(N,{children:r}),Te(go,{size:"4",weight:"medium",style:{color:"var(--gray-12)",fontFamily:"var(--font-poppins)"},truncate:!0,children:t}),a&&Te(pn,{color:"gray",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:a})]}),Te(go,{size:"2",style:{color:"var(--gray-11)",fontFamily:"var(--font-poppins)",lineHeight:1.5},children:o})]}),Te(J,{pad:"var(--space-3)",radius:"var(--radius-4)",children:Te(gn,{size:"2",className:"btn-amber-primary",asChild:!0,children:dr(dn,{to:e,children:["Open",Te(mn,{style:y("--space-3")})]})})})]})}import{Text as $e}from"@radix-ui/themes";import{jsx as Yr,jsxs as qr}from"react/jsx-runtime";function vn({tag:e,tagColor:r,msg:t,actor:o,timeAgo:a,timestamp:n,showBorder:i}){return qr(Ur,{showBorder:i,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",paddingBlock:"var(--space-2)",paddingInline:"var(--space-4)"},children:[Yr($e,{as:"span",size:"1",weight:"medium",className:"data-mono",style:{color:r,minWidth:"var(--space-6)",letterSpacing:"0.06em",flexShrink:0},children:e}),qr($e,{as:"span",size:"2",style:{flex:1,color:"var(--gray-11)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,o&&qr($e,{as:"span",size:"1",style:{color:"var(--gray-11)",marginLeft:"var(--space-2)"},children:["by ",o]})]}),a&&Yr($e,{as:"span",size:"1",color:"gray",style:{whiteSpace:"nowrap",flexShrink:0},children:a}),Yr($e,{as:"span",size:"1",className:"data-mono",style:{color:"var(--gray-11)",whiteSpace:"nowrap",flexShrink:0,minWidth:"var(--space-7)",textAlign:"right"},children:n})]})}import{Button as yn,Card as hn,Flex as bn,Text as xn}from"@radix-ui/themes";import{ExclamationTriangleIcon as Cn}from"@radix-ui/react-icons";import{jsx as Ge,jsxs as Tn}from"react/jsx-runtime";function wn({onRetry:e,message:r="Couldn't load your dashboard."}){return Ge(hn,{children:Tn(bn,{direction:"column",align:"center",justify:"center",py:"9",gap:"3",children:[Ge(N,{children:Ge(Cn,{style:{...y("--space-5"),color:"var(--gray-7)"}})}),Ge(xn,{size:"2",color:"gray",children:r}),Ge(yn,{size:"2",color:"amber",variant:"solid",className:"btn-amber-primary",onClick:e,children:"Retry"})]})})}import{useMemo as Sn}from"react";import{Button as Rn,Flex as kn,IconButton as pr,Text as Dn}from"@radix-ui/themes";import{ChevronLeftIcon as In,ChevronRightIcon as An,DoubleArrowLeftIcon as Pn,DoubleArrowRightIcon as En}from"@radix-ui/react-icons";import{jsx as Q,jsxs as Mn}from"react/jsx-runtime";var ze="\u2026";function Bn(e,r,t){let o=t*2+5;if(r<=o)return Array.from({length:r},(c,g)=>g+1);let a=Math.max(e-t,1),n=Math.min(e+t,r),i=a>2,l=n<r-1;if(!i&&l)return[...Array.from({length:3+t*2},(g,p)=>p+1),ze,r];if(i&&!l){let c=3+t*2,g=Array.from({length:c},(p,u)=>r-c+u+1);return[1,ze,...g]}let s=Array.from({length:n-a+1},(c,g)=>a+g);return[1,ze,...s,ze,r]}function Nn({currentPage:e,totalPages:r,onPageChange:t,siblingCount:o=1,showFirstLast:a=!1,size:n="2"}){let i=Sn(()=>Bn(e,r,o),[e,r,o]),l=e<=1,s=e>=r;return Q(kn,{asChild:!0,align:"center",gap:"1",children:Mn("nav",{"aria-label":"Pagination",children:[a&&Q(pr,{size:n,variant:"soft",color:"gray","aria-label":"First page",disabled:l,onClick:()=>t(1),children:Q(Pn,{})}),Q(pr,{size:n,variant:"soft",color:"gray","aria-label":"Previous page",disabled:l,onClick:()=>t(e-1),children:Q(In,{})}),i.map((c,g)=>c===ze?Q(Dn,{size:n,color:"gray","aria-hidden":!0,style:{paddingInline:"var(--space-1)"},children:ze},`ellipsis-${g}`):Q(Rn,{size:n,"aria-label":`Page ${c}`,"aria-current":c===e?"page":void 0,variant:c===e?"solid":"soft",color:c===e?void 0:"gray",className:c===e?"btn-amber-primary":void 0,onClick:()=>c!==e&&t(c),children:c},c)),Q(pr,{size:n,variant:"soft",color:"gray","aria-label":"Next page",disabled:s,onClick:()=>t(e+1),children:Q(An,{})}),a&&Q(pr,{size:n,variant:"soft",color:"gray","aria-label":"Last page",disabled:s,onClick:()=>t(r),children:Q(En,{})})]})})}var gr={admin:{label:"Admin",color:"amber"},operator:{label:"Operator",color:"blue"},user:{label:"Platform User",color:"gray"}},zn={admin:gr.admin.label,operator:gr.operator.label,user:gr.user.label},Fn={active:{label:"Active",color:"var(--color-success)"},inactive:{label:"Inactive",color:"var(--gray-11)"},suspended:{label:"Suspended",color:"var(--color-danger)"}},Ln={ok:"var(--green-9)",warn:"var(--orange-9)",error:"var(--red-9)"},Hn={auth:{tag:"AUTH",color:"var(--gray-11)"},sync:{tag:"SYNC",color:"var(--blue-11)"},role:{tag:"ROLE",color:"var(--violet-11)"},provision:{tag:"PROV",color:"var(--green-11)"},health:{tag:"HLTH",color:"var(--teal-11)"},error:{tag:"ERR!",color:"var(--red-11)"}},uo={USER_UPDATED:{label:"User updated",tag:"UPD",badge:"amber",color:"var(--amber-11)"},USER_DISABLED:{label:"User disabled",tag:"DIS",badge:"red",color:"var(--red-11)"},USER_ENABLED:{label:"User enabled",tag:"ENA",badge:"green",color:"var(--teal-11)"},USER_APPROVED:{label:"User approved",tag:"APPR",badge:"green",color:"var(--green-11)"},USER_REJECTED:{label:"User rejected",tag:"REJ",badge:"red",color:"var(--red-11)"},SIGNUP_NOTIFICATIONS_ON:{label:"Signup notifications on",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},SIGNUP_NOTIFICATIONS_OFF:{label:"Signup notifications off",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},APPROVAL_EMAIL_RESENT:{label:"Approval email resent",tag:"MAIL",badge:"amber",color:"var(--amber-11)"},USER_DELETED:{label:"User deleted",tag:"DEL",badge:"yellow",color:"var(--red-11)"},ADMIN_GRANTED:{label:"Admin granted",tag:"ADMN",badge:"gray",color:"var(--violet-11)"},ADMIN_REVOKED:{label:"Admin revoked",tag:"ADMN",badge:"gray",color:"var(--orange-11)"},ADMIN_ROLE_CHANGED:{label:"Role changed",tag:"ROLE",badge:"amber",color:"var(--violet-11)"},SESSION_REVOKED:{label:"Session revoked",tag:"SESS",badge:"gray",color:"var(--gray-11)"},APP_GRANTED:{label:"App access granted",tag:"APP",badge:"green",color:"var(--green-11)"},APP_REVOKED:{label:"App access revoked",tag:"APP",badge:"red",color:"var(--orange-11)"}};function On(e){return uo[e]??{label:e,tag:e.slice(0,4).toUpperCase(),badge:"gray",color:"var(--gray-11)"}}import{jsx as mo}from"react/jsx-runtime";function Xr(){return mo("div",{className:"auth-art-card",children:mo("img",{src:"/arm-logo-inverted.svg",alt:"araMetrics",style:{width:"56%",maxWidth:x.brandLogoMax,display:"block",userSelect:"none"},draggable:!1})})}import{jsx as ur,jsxs as Wn}from"react/jsx-runtime";function _n({children:e}){return Wn("div",{style:{minHeight:"100vh",display:"flex",background:"var(--surface-content)",padding:"var(--space-5)",gap:"var(--space-5)"},children:[ur("div",{className:"auth-card-left",style:{width:"47%",flexShrink:0,position:"sticky",top:"var(--space-5)",height:"calc(100vh - var(--space-8))"},children:ur(Xr,{})}),ur("div",{className:"auth-card-right",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:"calc(100vh - var(--space-8))",padding:"var(--space-7) var(--space-5)"},children:ur("main",{style:{maxWidth:x.authFormMax,width:"100%",marginLeft:"auto",marginRight:"auto",background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",boxShadow:"var(--shadow-card)",padding:"var(--space-7) var(--space-5)"},children:e})})]})}import{jsx as mr,jsxs as Vn}from"react/jsx-runtime";function Zr(){return Vn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[mr("path",{d:"M15.68 8.18c0-.57-.05-1.11-.14-1.64H8v3.1h4.3a3.68 3.68 0 0 1-1.6 2.42v2h2.58c1.51-1.39 2.4-3.44 2.4-5.88Z",fill:"#4285F4"}),mr("path",{d:"M8 16c2.16 0 3.97-.71 5.3-1.94l-2.59-2a4.88 4.88 0 0 1-7.27-2.56H0.9v2.07A8 8 0 0 0 8 16Z",fill:"#34A853"}),mr("path",{d:"M3.44 9.5A4.8 4.8 0 0 1 3.19 8c0-.52.09-1.03.25-1.5V4.43H.9A8 8 0 0 0 0 8c0 1.29.31 2.51.9 3.57L3.44 9.5Z",fill:"#FBBC05"}),mr("path",{d:"M8 3.18c1.22 0 2.31.42 3.17 1.24l2.37-2.37A7.94 7.94 0 0 0 8 0 8 8 0 0 0 .9 4.43L3.44 6.5A4.77 4.77 0 0 1 8 3.18Z",fill:"#EA4335"})]})}import{jsx as fr,jsxs as $n}from"react/jsx-runtime";function Jr(){return $n("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[fr("rect",{x:"0",y:"0",width:"7.6",height:"7.6",fill:"#F25022"}),fr("rect",{x:"8.4",y:"0",width:"7.6",height:"7.6",fill:"#7FBA00"}),fr("rect",{x:"0",y:"8.4",width:"7.6",height:"7.6",fill:"#00A4EF"}),fr("rect",{x:"8.4",y:"8.4",width:"7.6",height:"7.6",fill:"#FFB900"})]})}import{useRef as Gn}from"react";import{TextField as Un}from"@radix-ui/themes";import{jsx as fo}from"react/jsx-runtime";function Qr({value:e,onChange:r,disabled:t}){let o=Gn([]);function a(s,c){let g=c.target.value.replace(/\D/g,"").slice(-1),p=Array.from({length:4},(u,h)=>e[h]??"");p[s]=g,r(p.join("")),g&&s<3&&o.current[s+1]?.focus()}function n(s,c){let g=Array.from({length:4},(p,u)=>e[u]??"");c.key==="Backspace"?!g[s]&&s>0&&(g[s-1]="",r(g.join("")),o.current[s-1]?.focus()):c.key==="ArrowLeft"&&s>0?o.current[s-1]?.focus():c.key==="ArrowRight"&&s<3&&o.current[s+1]?.focus()}function i(s){let c=s.clipboardData.getData("text").replace(/\D/g,"").slice(0,4);c&&(s.preventDefault(),r(c),o.current[Math.min(c.length,3)]?.focus())}let l=Array.from({length:4},(s,c)=>e[c]??"");return fo("div",{style:{display:"flex",gap:"var(--space-3)",justifyContent:"center"},children:l.map((s,c)=>fo(Un.Root,{ref:g=>{o.current[c]=g},type:"text",inputMode:"numeric",maxLength:1,value:s,onChange:g=>a(c,g),onKeyDown:g=>n(c,g),onPaste:i,disabled:t,className:"otp-box","aria-label":`Digit ${c+1}`,autoComplete:c===0?"one-time-code":"off"},c))})}import{Button as et,Callout as Ue,Heading as jn,Text as rt}from"@radix-ui/themes";import{ExclamationTriangleIcon as Kn}from"@radix-ui/react-icons";import{Fragment as vo,jsx as j,jsxs as pe}from"react/jsx-runtime";function Yn({email:e,title:r,subtitle:t,code:o,onCodeChange:a,otpDevHint:n,error:i,errorAction:l,busy:s,otpExpiresAt:c,otpSecondsLeft:g,resendCooldown:p,onResend:u,onUseDifferentEmail:h}){return pe(vo,{children:[pe("div",{style:{marginBottom:"var(--space-6)",textAlign:"center"},children:[j(jn,{as:"h1",size:_.h1,style:{color:"var(--ink-strong)",marginBottom:"var(--space-3)"},children:r}),pe(rt,{as:"p",size:"2",style:{color:"var(--ink-mid)",lineHeight:1.55},children:[t," ",j("span",{style:{fontWeight:600,color:"var(--ink-strong)"},children:e}),"."]})]}),n&&j(Ue.Root,{color:"gray",variant:"surface",size:"1",style:{marginBottom:"var(--space-5)"},children:pe(Ue.Text,{style:{fontFamily:"var(--font-poppins)"},children:["Dev hint \u2014 code is ",j("strong",{children:n})]})}),i&&pe(Ue.Root,{color:"red",variant:"surface",size:"2",style:{marginBottom:"var(--space-5)"},children:[j(Ue.Icon,{children:j(Kn,{})}),pe(Ue.Text,{style:{fontFamily:"var(--font-poppins)"},children:[i,l&&pe(vo,{children:[" ",j(et,{type:"button",variant:"ghost",size:"1",onClick:l.onClick,style:{fontWeight:600,textDecoration:"underline",height:"auto",padding:0},children:l.label})]})]})]}),pe("div",{children:[j(Qr,{value:o,onChange:a,disabled:s||g<=0}),s?j(rt,{as:"p",size:"1",style:{color:"var(--ink-mid)",marginTop:"var(--space-3)",textAlign:"center"},children:"Checking code\u2026"}):c&&g<=0?j(rt,{as:"p",size:"1",style:{color:"var(--red-11)",marginTop:"var(--space-3)",textAlign:"center"},children:"Code expired \u2014 resend to get a new one."}):null]}),pe("div",{style:{marginTop:"var(--space-5)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--space-3)"},children:[j(et,{type:"button",variant:"ghost",size:"2",disabled:p>0||s,onClick:u,style:{fontWeight:500,color:p>0?"rgba(85, 85, 85, 0.4)":"var(--ink-strong)",textDecoration:p>0?"none":"underline"},children:p>0?`Resend email (${p}s)`:"Resend email"}),j(et,{type:"button",variant:"ghost",size:"2",className:"auth-underline-link",disabled:s,onClick:h,style:{fontWeight:500,color:"var(--ink-strong)"},children:"Use a Different Email"})]})]})}import{jsx as yo}from"react/jsx-runtime";function W({provider:e}){return e==="microsoft"?yo(Jr,{}):yo(Zr,{})}var qn={google:"Google",microsoft:"Microsoft"};import{useState as tt}from"react";import{Link as To,useLocation as Xn}from"react-router-dom";import{Avatar as ho,Badge as So,DropdownMenu as ge,IconButton as bo,Text as Ke,Tooltip as vr}from"@radix-ui/themes";import{ChevronDownIcon as Zn,ChevronLeftIcon as Jn,ChevronRightIcon as xo,Cross1Icon as Qn,DotFilledIcon as Ro,DotsVerticalIcon as ei,ExitIcon as ri,GearIcon as Co,QuestionMarkCircledIcon as ti}from"@radix-ui/react-icons";import{Fragment as st,jsx as m,jsxs as I}from"react/jsx-runtime";var yr="var(--space-9)",je=e=>"items"in e,at=e=>e.badge?`${e.label} \xB7 ${e.badge}`:e.label;function oi(e){if(!e)return{};try{let r=JSON.parse(localStorage.getItem(e)??"{}");return!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).filter(t=>typeof t[1]=="boolean"))}catch{return{}}}function ai(e,r){if(e)try{localStorage.setItem(e,JSON.stringify(r))}catch{}}var ni="calc(4 * var(--space-9))",ii="calc(var(--space-9) + var(--space-6))",si="calc(4 * var(--space-9) + var(--space-5))",li="var(--space-8)",nt="var(--space-5)",it="var(--space-5)",ko="calc(var(--space-5) + var(--space-3))",ci="var(--space-3)",di=e=>e?"opacity 130ms ease 80ms":"opacity 90ms ease",wo="opacity 200ms ease";function pi({collapsed:e,onToggle:r,onClose:t,items:o,persistKey:a,utilityHrefs:n,user:i,onSignOut:l,hasCalendarAccounts:s=!1,brandLogoExpandedSrc:c="/expand.svg",brandLogoCollapsedSrc:g="/shrink.svg",helpHref:p,devRoles:u,onDevRoleSelect:h,showDevRoles:v=!1}){let f=Xn().pathname,[S,E]=tt(!1),[X,ne]=tt(null),C=()=>ne(null),z=!!t,R=!e||z,fe=z?si:e?ii:ni,b=d=>!d.roles||!!i&&d.roles.includes(i.role),F=d=>{if(!b(d))return[];if(!d.bundle||!d.children)return[d];let w=d.children.flatMap(F);return w.length>0?[{...d,children:w}]:[]},H=o.flatMap(d=>{if(!je(d))return F(d);let w=d.items.flatMap(F);return w.length>0?[{...d,items:w}]:[]}),G=H.filter(d=>!je(d)),ce=H.flatMap(d=>je(d)?d.items:[d]),[de,Pe]=tt(()=>oi(a)),Bt=d=>de[d.id]??!!d.defaultCollapsed;function ia(d){let w={...de,[d.id]:!Bt(d)};Pe(w),ai(a,w)}let Nt=new Set(n),sa=H.filter(d=>je(d)||!Nt.has(d.href)),Mt=G.find(d=>d.href==="/settings"),Er=G.filter(d=>Nt.has(d.href)&&d.href!=="/settings");function ir(d){return d.root??d.href}function zt(d){return!!d.children?.length&&(ir(d)!=="/calendar"||s)}function Br(d){let w=ir(d);return f===w||f===d.href||f.startsWith(w+"/")?!0:!!d.bundle&&!!d.children?.some(Br)}let sr=[];for(let d=ce;;){let w=d.find(Z=>zt(Z)&&Br(Z));if(!w)break;sr.push(w),d=w.children}let Nr=X?.path===f?Math.min(X.depth,sr.length):sr.length,Ee=Nr>0?sr[Nr-1]:void 0,la=()=>ne({path:f,depth:Nr-1});function Mr(d,w){return d==="/home"||w?f===d:f===d||f.startsWith(d+"/")}function zr(d){return Ft(d,!0)}function Ft(d,w){let Z=d.bundle?Br(d):Mr(ir(d),d.end),lr=zt(d),Ht=m(ot,{item:d,active:Z,expanded:R,uppercase:w,showChevron:lr,onClick:lr?C:void 0},d.href);return R?Ht:m(vr,{content:at(d),side:"right",delayDuration:300,children:Ht},d.href)}function ca(d){let w=`nav-group-${d.id}`;if(!R)return I("div",{role:"group","aria-label":d.label,children:[m("div",{"aria-hidden":"true",style:{height:1,background:"var(--gray-4)",margin:`var(--space-2) ${nt}`}}),d.items.map(zr)]},w);let Z=Bt(d);return I("div",{style:{display:"flex",flexDirection:"column",marginTop:"var(--space-3)"},children:[m(gi,{label:d.label,folded:Z,holdsActive:Z&&d.items.some(lr=>Mr(ir(lr))),controls:w,onToggle:()=>ia(d)}),m("div",{id:w,role:"group","aria-label":d.label,hidden:Z,children:d.items.map(zr)})]},w)}let da=f.startsWith("/admin")&&(i?.role==="admin"||i?.role==="operator"),Lt=i?.name?.split(" ").map(d=>d[0]).join("").slice(0,2)||"?";return I("aside",{style:{position:"relative",width:fe,height:"100%",minHeight:"100vh",background:"var(--shell-surface)",borderRight:"1px solid var(--gray-6)",flexShrink:0,transition:z?"none":"width 200ms ease",zIndex:2},children:[I("div",{style:{width:"100%",height:"100%",minHeight:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[I("div",{style:{height:yr,flexShrink:0,position:"relative",overflow:"hidden",borderBottom:"1px solid var(--border-hairline)"},children:[m("img",{src:c,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:wo,opacity:R?1:0,pointerEvents:"none",userSelect:"none"}}),m("img",{src:g,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:wo,opacity:R?0:1,pointerEvents:"none",userSelect:"none"}}),z&&m(bo,{variant:"ghost",color:"gray",size:"1",onClick:t,"aria-label":"Close menu",style:{position:"absolute",right:"var(--space-2)",top:"50%",transform:"translateY(-50%)"},children:m(Qn,{style:y("--space-3")})})]}),m("nav",{"aria-label":"Main navigation",style:{flex:1,overflowY:"auto",overflowX:"hidden",paddingTop:"var(--space-5)",display:"flex",flexDirection:"column"},children:Ee?I(st,{children:[(()=>{let d=m(ot,{item:{label:Ee.label,href:"#",Icon:Jn},active:!1,expanded:R,uppercase:!0,asButton:!0,onClick:la});return R?d:m(vr,{content:Ee.label,side:"right",delayDuration:300,children:d})})(),Ee.children.map(d=>Ft(d,!!Ee.bundle))]}):sa.map(d=>je(d)?ca(d):zr(d))}),!Ee&&Er.length>0&&m("nav",{"aria-label":"Utility navigation",style:{flexShrink:0,borderTop:"1px solid var(--gray-4)",paddingTop:"var(--space-2)",paddingBottom:"var(--space-2)",display:"flex",flexDirection:"column"},children:Er.map(d=>{let w=Mr(d.href),Z=m(ot,{item:d,active:w,expanded:R,uppercase:!0,showChevron:!!d.children,onClick:d.children?C:void 0},d.href);return R?Z:m(vr,{content:at(d),side:"right",delayDuration:300,children:Z},d.href)})}),I("div",{style:{borderTop:Er.length>0?"none":"1px solid var(--gray-4)",padding:R?"var(--space-2) var(--space-4)":"var(--space-2) 0",flexShrink:0,display:"flex",flexDirection:"column",gap:"var(--space-2)"},children:[R&&da&&I(So,{color:"gray",variant:"soft",highContrast:!0,size:"1",radius:"full",style:{alignSelf:"flex-start"},children:[m(Ro,{style:y("--space-2")}),"Administering platform"]}),I("div",{style:{display:"flex",flexDirection:R?"row":"column",alignItems:"center",justifyContent:R?"space-between":"center",gap:"var(--space-2)"},children:[R?I("div",{className:"shell-profile-chip",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0,flex:1,padding:"var(--space-1)",borderRadius:"var(--radius-3)"},children:[m(ho,{size:"2",radius:"full",src:i?.avatarSrc,fallback:Lt,color:"gray",variant:"soft",style:{flexShrink:0}}),m(Ke,{as:"p",size:"2",weight:"medium",truncate:!0,style:{color:"var(--shell-ink-strong)"},children:i?.name})]}):m(vr,{content:i?.name??"Account",side:"right",delayDuration:300,children:m(ho,{size:"3",radius:"full",src:i?.avatarSrc,fallback:Lt,color:"gray",variant:"soft"})}),I(ge.Root,{children:[m(ge.Trigger,{children:m(bo,{variant:"ghost",color:"gray","aria-label":"Account menu",className:"sidebar-icon-btn",style:{flexShrink:0},children:m(ei,{style:y("--space-4")})})}),I(ge.Content,{align:R?"end":"start",side:R?"top":"right",style:{minWidth:200},children:[Mt&&m(ge.Item,{asChild:!0,children:I(To,{to:Mt.href,onClick:C,children:[m(Co,{}),"Settings"]})}),p&&I(ge.Item,{onClick:()=>window.open(p,"_blank","noopener,noreferrer"),children:[m(ti,{}),"Help"]}),m(ge.Separator,{}),I(ge.Item,{color:"red",onClick:()=>E(!0),children:[m(ri,{}),"Log Out"]}),v&&u&&u.length>0&&I(st,{children:[m(ge.Separator,{}),m("div",{style:{padding:"var(--space-1) var(--space-3)"},children:m(Ke,{size:"1",style:{fontFamily:"monospace",color:"var(--gray-11)",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Dev \xB7 switch role"})}),u.map(d=>I(ge.Item,{onClick:()=>h?.(d.email),disabled:i?.role===d.role,children:[m(Co,{}),d.label,I(Ke,{size:"1",color:"gray",style:{marginLeft:"auto"},children:[d.role,"@"]})]},d.role))]})]})]})]})]})]}),!z&&m("button",{onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:"sidebar-collapse-btn",style:{top:"calc(var(--space-9) / 2)",transform:"translateY(-50%)",right:"calc(-1 * var(--space-3))"},children:m(ui,{flipped:e})}),m(Hr,{open:S,onOpenChange:E,title:"Confirm Logout",description:"Are you sure you want to log out?",onConfirm:l})]})}function ot({item:e,active:r,expanded:t,onClick:o,asButton:a,showChevron:n,uppercase:i}){let l={position:"relative",textDecoration:"none",display:"flex",alignItems:"center",height:li,flexShrink:0,paddingLeft:ko,paddingRight:t?`calc(${it} + var(--space-1))`:0,gap:t?ci:0,color:r?"var(--shell-ink-strong)":"var(--shell-ink-mid)",cursor:"pointer"},s=I(st,{children:[r&&m("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"var(--space-1)",height:"100%",background:"var(--accent-9)",borderRadius:"0 var(--radius-1) var(--radius-1) 0"}}),m("span",{"aria-hidden":"true",className:"nav-pill",style:{position:"absolute",top:0,bottom:0,left:nt,right:t?it:nt,borderRadius:"var(--radius-3)",background:r?"var(--accent-9)":"transparent",transition:"background 80ms ease"}}),m(e.Icon,{width:20,height:20,style:{position:"relative",flexShrink:0}}),I("span",{style:{position:"relative",display:"flex",alignItems:"center",gap:"var(--space-1)",minWidth:0,overflow:"hidden",maxWidth:t?void 0:0,opacity:t?1:0,transition:di(t)},children:[m(Ke,{as:"span",size:"3",weight:r?"medium":"regular",style:{lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,textTransform:i?"uppercase":void 0},children:e.label}),e.badge&&m(So,{color:"gray",variant:r?"solid":"soft",highContrast:r,size:"1",radius:"full",style:{flexShrink:0,paddingInline:"var(--space-1)",textTransform:i?"uppercase":void 0},children:e.badge})]}),n&&t&&(r?m("span",{style:{position:"relative",marginLeft:"auto",marginRight:"var(--space-1)",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-2)",boxShadow:"0 1px 2px rgba(0,0,0,0.12)"},children:m(xo,{style:{...y("--space-4"),color:"var(--gray-11)"}})}):m(xo,{style:{...y("--space-4"),position:"relative",marginLeft:"auto",color:"var(--shell-ink-mid)",flexShrink:0}}))]});return a?m("button",{type:"button",onClick:o,className:"shell-nav-item",style:{...l,background:"none",border:"none",width:"100%",textAlign:"left",font:"inherit"},children:s}):m(To,{to:e.href,onClick:o,className:"shell-nav-item","data-active":r?"true":void 0,"aria-current":r?"page":void 0,title:t?at(e):void 0,style:l,children:s})}function gi({label:e,folded:r,holdsActive:t,controls:o,onToggle:a}){return I("button",{type:"button",onClick:a,"aria-expanded":!r,"aria-controls":o,className:"shell-nav-group","data-holds-active":t?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-1)",height:"var(--space-6)",flexShrink:0,width:"100%",paddingLeft:ko,paddingRight:`calc(${it} + var(--space-1))`,background:"none",border:"none",font:"inherit",textAlign:"left",cursor:"pointer",color:t?"var(--shell-ink-strong)":"var(--shell-ink-mid)"},children:[m(Ke,{as:"span",size:"1",weight:"medium",style:{textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:e}),t&&m(Ro,{"aria-hidden":"true",style:{...y("--space-3"),color:"var(--accent-9)",flexShrink:0}}),m(Zn,{"aria-hidden":"true",style:{...y("--space-4"),marginLeft:"auto",flexShrink:0,transform:r?"rotate(-90deg)":void 0,transition:"transform 120ms ease"}})]})}function ui({flipped:e}){return I("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"scaleX(-1)":void 0},children:[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5",stroke:"currentColor"}),m("path",{d:"M5.5 2.5v11",stroke:"currentColor"}),m("path",{d:"M11 5.5 8.5 8l2.5 2.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})}import{Link as mi,useLocation as fi}from"react-router-dom";import{HamburgerMenuIcon as vi,MagnifyingGlassIcon as yi,BellIcon as hi}from"@radix-ui/react-icons";import{Flex as bi,Heading as xi,IconButton as Ci,Text as Do,Tooltip as wi}from"@radix-ui/themes";import{Fragment as Di,jsx as V,jsxs as hr}from"react/jsx-runtime";var Ti=[["/home","Home","/home","Home"],["/calendar/syncs","Calendar","/calendar/syncs","Manage Syncs"],["/calendar/view","Calendar","/calendar/syncs","My Calendar"],["/calendar","Calendar","/calendar/syncs","Manage Syncs"],["/settings/account","Settings","/settings/account","Account"],["/settings/linked","Settings","/settings/account","Linked Account"],["/settings","Settings","/settings/account","Settings"]],Si=[["/admin/overview","Overview"],["/admin/users","Users"],["/admin/monitoring","Monitoring"],["/admin/calendar-ops","Calendar Ops"],["/admin/logs","Logs"],["/admin/security","Security"],["/admin/audit","Audit Log"]];function Ri(e,r,t){if(e==="/admin"||e.startsWith("/admin/")){let l=t.find(([s])=>e===s||e.startsWith(s+"/"));return{section:"Admin Portal",sectionHref:"/admin/overview",page:l?l[1]:"Admin Portal"}}if(e==="/calendar/syncs/new")return{section:"Calendar",sectionHref:"/calendar/syncs",page:"New Sync"};if(/^\/calendar\/syncs\/[^/]+$/.test(e))return{section:"Calendar",sectionHref:"/calendar/syncs",page:"Edit Sync"};let o=r.find(([l,,,,s])=>s?e===l:e===l||e.startsWith(l+"/"));if(!o)return{section:"Home",sectionHref:"/home",page:"Home"};let[,a,n,i]=o;return{section:a,sectionHref:n,page:i}}function ki({onSearchOpen:e,onMenuOpen:r,showMenu:t,titles:o=Ti,adminTitles:a=Si}){let n=fi().pathname;return hr("header",{style:{height:yr,background:"var(--accent-9)",borderBottom:"1px solid var(--border-hairline)",flexShrink:0,display:"flex",alignItems:"center",padding:"0 var(--space-6)",gap:"var(--space-4)"},children:[t&&V(Ci,{variant:"ghost",size:"1",onClick:r,"aria-label":"Open navigation",style:{marginRight:"var(--space-1)",color:"var(--shell-ink-strong)"},children:V(vi,{style:y("--space-4")})}),(()=>{let{section:i,sectionHref:l,page:s}=Ri(n,o,a);return hr(bi,{align:"baseline",gap:"2",style:{minWidth:0,overflow:"hidden"},children:[i!==s&&hr(Di,{children:[V(Do,{asChild:!0,size:"3",weight:"regular",children:V(mi,{to:l,style:{color:"var(--shell-ink-mid)",whiteSpace:"nowrap",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",flexShrink:0},className:"topbar-breadcrumb-link",children:i})}),V(Do,{size:"3",weight:"regular",className:"topbar-breadcrumb-sep",style:{color:"var(--shell-ink-mid)",flexShrink:0},children:"/"})]}),V(xi,{as:"h1",size:_.h1,weight:"medium",style:{color:"var(--shell-ink-strong)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:s})]})})(),V("div",{style:{flex:1}}),hr("button",{className:"topbar-search",onClick:e,"aria-label":"Search (\u2318K)",children:[V(yi,{width:16,height:16,style:{color:"var(--shell-ink-strong)",flexShrink:0}}),V("span",{className:"topbar-search-placeholder",children:"Search for something"})]}),V(wi,{content:"Coming soon",children:V("span",{children:V("button",{className:"topbar-icon-circle","aria-label":"Notifications (coming soon)",disabled:!0,children:V(hi,{style:y("--space-4")})})})})]})}import{useEffect as Io,useRef as Ao,useState as lt}from"react";import{Dialog as ct,Flex as Po,Spinner as Ii,Text as ee,TextField as Ai,VisuallyHidden as Pi}from"@radix-ui/themes";import{CalendarIcon as Ei,MagnifyingGlassIcon as Bi,PersonIcon as Ni,ReaderIcon as Mi}from"@radix-ui/react-icons";import{Fragment as _i,jsx as T,jsxs as K}from"react/jsx-runtime";var zi={app:Ei,people:Ni,page:Mi},Fi={app:"Apps",people:"People",page:"Pages"};function Li(e){let r=["app","people","page"],t=[],o=0;for(let a of r){let n=e.filter(i=>i.type===a);n.length>0&&(t.push({type:a,label:Fi[a],items:n,startIdx:o}),o+=n.length)}return t}function Hi({open:e,onClose:r,results:t,onSelectResult:o,title:a="Search",placeholder:n="Search\u2026"}){return T(ct.Root,{open:e,onOpenChange:i=>!i&&r(),children:T(ct.Content,{"aria-describedby":void 0,style:{padding:0,maxWidth:"calc(9 * var(--space-9) + var(--space-2))",overflow:"hidden",boxShadow:"0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.10), 0 0 0 1px var(--gray-5)"},children:T(Oi,{onClose:r,resultPool:t,onSelectResult:o,title:a,placeholder:n})})})}function Oi({onClose:e,resultPool:r,onSelectResult:t,title:o,placeholder:a}){let[n,i]=lt(""),[l,s]=lt(null),[c,g]=lt(-1),p=Ao(null),u=Ao(null),h=!!l&&l.q===n,v=h?l.items:[],f=n.trim()?h?v.length?"results":"no-match":"searching":"prompt";Io(()=>{if(!n.trim())return;let C=setTimeout(()=>{let z=n.toLowerCase(),R=r.filter(fe=>fe.title.toLowerCase().includes(z)||fe.subtitle.toLowerCase().includes(z));s({q:n,items:R}),g(-1)},320);return()=>clearTimeout(C)},[n,r]),Io(()=>{if(c<0||!u.current)return;u.current.querySelector(`[data-idx="${c}"]`)?.scrollIntoView({block:"nearest"})},[c]);function S(C){C.key==="Escape"?e():C.key==="ArrowDown"?(C.preventDefault(),g(z=>Math.min(z+1,v.length-1))):C.key==="ArrowUp"?(C.preventDefault(),g(z=>Math.max(z-1,0))):C.key==="Enter"&&(C.preventDefault(),c>=0&&v[c]&&(t(v[c]),e()))}function E(C){t(C),e()}let X=Li(v),ne="calc(2 * var(--space-9) + var(--space-6))";return K(_i,{children:[T(Pi,{children:T(ct.Title,{children:o})}),K("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-3) var(--space-4)",borderBottom:"1px solid var(--gray-5)"},children:[f==="searching"?T(Ii,{size:"1",style:{flexShrink:0}}):T(Bi,{width:16,height:16,style:{color:"var(--gray-9)",flexShrink:0}}),T(Ai.Root,{ref:p,autoFocus:!0,type:"text",placeholder:a,value:n,onChange:C=>i(C.target.value),onKeyDown:S,className:"search-overlay-input",style:{flex:1,border:"none",outline:"none",background:"transparent",boxShadow:"none","--text-field-selection-color":"unset"}}),T("kbd",{style:{color:"var(--gray-11)",background:"var(--gray-3)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1) var(--space-2)",flexShrink:0},children:T(ee,{size:"1",as:"span",children:"Esc"})})]}),K("div",{ref:u,style:{minHeight:ne,maxHeight:"calc(6 * var(--space-9) + var(--space-7))",overflowY:"auto"},children:[f==="prompt"&&T(Po,{align:"center",justify:"center",style:{height:ne},children:T(ee,{size:"2",color:"gray",children:"Type to search\u2026"})}),f==="no-match"&&T(Po,{align:"center",justify:"center",style:{height:ne},children:K("div",{style:{textAlign:"center"},children:[K(ee,{size:"2",color:"gray",as:"p",children:["No results for \u201C",n,"\u201D"]}),T(ee,{size:"1",color:"gray",as:"p",mt:"1",children:"Try searching with different keywords"})]})}),f==="results"&&T("div",{style:{padding:"var(--space-2)"},children:X.map(C=>{let z=zi[C.type];return K("div",{style:{marginBottom:"var(--space-1)"},children:[T("div",{style:{padding:"var(--space-2) var(--space-3) var(--space-1)",display:"flex",alignItems:"center",gap:"var(--space-2)"},children:T(ee,{size:"1",style:{color:"var(--gray-11)",fontWeight:500,letterSpacing:"0.04em",textTransform:"uppercase",fontFamily:"var(--font-poppins)"},children:C.label})}),C.items.map((R,fe)=>{let b=C.startIdx+fe,F=c===b;return K("button",{"data-idx":b,onClick:()=>E(R),onMouseEnter:()=>g(b),className:"search-result-item",style:{width:"100%",display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)",borderRadius:"var(--radius-2)",border:"none",cursor:"pointer",textAlign:"left",background:F?"var(--gray-3)":"transparent"},children:[T("div",{style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"var(--radius-1)",background:F?"var(--accent-a3)":"var(--gray-3)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background 100ms ease"},children:T(z,{width:12,height:12,style:{color:F?"var(--accent-11)":"var(--gray-9)"}})}),K("div",{style:{flex:1,minWidth:0},children:[T(ee,{as:"p",size:"2",weight:"medium",style:{color:F?"var(--gray-12)":"var(--gray-11)",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.title}),T(ee,{as:"p",size:"1",style:{color:"var(--gray-11)",lineHeight:1.3,marginTop:"1px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.subtitle})]}),F&&T("kbd",{style:{color:"var(--gray-9)",background:"var(--gray-4)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1)",flexShrink:0},children:T(ee,{size:"1",as:"span",className:"data-mono",children:"\u21B5"})})]},R.id)})]},C.type)})})]}),f!=="prompt"&&K("div",{style:{borderTop:"1px solid var(--gray-4)",padding:"var(--space-2) var(--space-4)",display:"flex",gap:"var(--space-4)"},children:[K(ee,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"\u2191\u2193"})," navigate"]}),K(ee,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"\u21B5"})," open"]}),K(ee,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"Esc"})," close"]})]})]})}function Y(e,r){for(let t of e){let o=t.calendars.find(a=>a.id===r);if(o)return{account:t,calendar:o}}}import dt from"dayjs";import{Flex as Eo,Text as Bo}from"@radix-ui/themes";import{jsx as pt,jsxs as Wi}from"react/jsx-runtime";function gt({date:e,today:r=new Date}){let t=dt(e).isSame(r,"day");return Wi(Eo,{direction:"column",align:"center",gap:"1",py:"1",children:[pt(Bo,{size:"1",weight:"medium",color:"gray",style:{letterSpacing:"0.04em"},children:dt(e).format("ddd").toUpperCase()}),pt(Eo,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",background:t?"var(--accent-9)":"transparent",lineHeight:1},children:pt(Bo,{size:"3",weight:t?"medium":"regular",style:{color:t?"var(--accent-contrast)":"var(--gray-12)",lineHeight:1},children:dt(e).format("D")})})]})}import{Box as Ye,Checkbox as Vi,Flex as $i,RadioGroup as No,Text as qe}from"@radix-ui/themes";import{jsx as M,jsxs as zo}from"react/jsx-runtime";function Gi(e){return e.flatMap(r=>r.calendars.map(t=>({calendarId:t.id,calendarName:t.name,email:r.email,provider:r.provider})))}function Ui({provider:e}){return M("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",flexShrink:0},children:M(W,{provider:e})})}function Mo({row:e,control:r,selected:t,disabled:o,disabledLabel:a}){return zo(qe,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-3)",width:"100%",paddingBlock:"var(--space-3)",paddingInline:"var(--space-4)",cursor:o?"not-allowed":"pointer",opacity:o?.45:1,background:t?"var(--accent-2)":"transparent",color:"var(--gray-12)"},children:[M(Ui,{provider:e.provider}),zo($i,{direction:"column",gap:"0",style:{minWidth:0,flex:1},children:[M(qe,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.calendarName}),M(qe,{size:"1",color:"gray",truncate:!0,children:e.email})]}),a?M(qe,{size:"1",color:"gray",style:{flexShrink:0},children:a}):null,M(Ye,{style:{flexShrink:0,display:"flex",alignItems:"center"},children:r})]})}function ji({accounts:e,mode:r,sourceCalendarIds:t,targetCalendarId:o,takenSourceIds:a,onToggleSource:n,onSelectTarget:i,fill:l=!1}){let s=Gi(e),g=r==="sources"&&s.length>0&&s.every(p=>p.calendarId===o||a.has(p.calendarId))?M(Ye,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",padding:"var(--space-4)",...l?{flex:1,minHeight:0}:{}},children:M(qe,{as:"p",size:"2",color:"gray",align:"center",children:"All your calendars are already used as sources in other syncs, or set as this sync's target. Remove a calendar from another sync to make it available here."})}):M(Ye,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",...l?{flex:1,minHeight:0,overflowY:"auto"}:{overflow:"hidden"}},children:s.map((p,u)=>{if(r==="sources"){let f=p.calendarId===o,S=a.has(p.calendarId),E=f||S,X=t.includes(p.calendarId);return M(Ye,{style:{borderTop:u>0?"1px solid var(--gray-4)":void 0},children:M(Mo,{row:p,selected:X,disabled:E,disabledLabel:f?"Target":S?"In use":void 0,control:M(Vi,{checked:X,disabled:E,onCheckedChange:()=>{E||n(p.calendarId)}})})},p.calendarId)}let h=t.includes(p.calendarId),v=p.calendarId===o;return M(Ye,{style:{borderTop:u>0?"1px solid var(--gray-4)":void 0},children:M(Mo,{row:p,selected:v,disabled:h,disabledLabel:h?"Source":void 0,control:M(No.Item,{value:p.calendarId,disabled:h})})},p.calendarId)})});return r==="target"?M(No.Root,{value:o??"",onValueChange:p=>{p&&i(p)},style:l?{flex:1,minHeight:0,display:"flex",flexDirection:"column"}:void 0,children:g}):g}import{Button as Fo,Flex as ut,Heading as Ki,IconButton as Lo}from"@radix-ui/themes";import{ChevronLeftIcon as Yi,ChevronRightIcon as qi}from"@radix-ui/react-icons";import{Navigate as mt}from"react-big-calendar";import{jsx as ve,jsxs as Ho}from"react/jsx-runtime";function ft({label:e,view:r,onNavigate:t,onView:o}){return Ho(ut,{align:"center",justify:"between",gap:"3",wrap:"wrap",className:"calendar-toolbar",children:[Ho(ut,{align:"center",gap:"2",children:[ve(Lo,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Previous",onClick:()=>t(mt.PREVIOUS),children:ve(Yi,{})}),ve(Fo,{size:"2",variant:"soft",color:"gray",onClick:()=>t(mt.TODAY),children:"Today"}),ve(Lo,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Next",onClick:()=>t(mt.NEXT),children:ve(qi,{})})]}),ve(Ki,{as:"h2",size:_.h2,weight:"medium",style:{color:"var(--gray-12)"},children:e}),ve(ut,{gap:"1",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",padding:"var(--space-1)",background:"var(--gray-2)"},children:["week","month"].map(a=>ve(Fo,{size:"2",variant:r===a?"solid":"soft",className:r===a?"btn-amber-primary":void 0,color:r===a?void 0:"gray",onClick:()=>o(a),style:r===a?void 0:{background:"transparent"},children:a==="week"?"Week":"Month"},a))})]})}import{Button as Xi,Flex as br,Spinner as Zi,Text as vt}from"@radix-ui/themes";import{ChevronRightIcon as Ji,ExclamationTriangleIcon as Qi}from"@radix-ui/react-icons";import{jsx as re,jsxs as Xe}from"react/jsx-runtime";var Fe={google:{label:"Google Calendar",description:"Connect a Google account calendar"},microsoft:{label:"Outlook Calendar",description:"Connect an Outlook account calendar"}},es=["google","microsoft"];function yt({connectingProvider:e,failedProvider:r,exhausted:t=!1,onConnect:o}){return re(br,{direction:"column",gap:"3",style:{width:"100%",textAlign:"left"},children:es.map(a=>{let n=Fe[a],i=e===a;return Xe("div",{children:[Xe("button",{type:"button",className:"provider-choice",onClick:()=>o(a),disabled:e!==null,"data-connecting":i?"true":void 0,"aria-busy":i||void 0,"aria-label":`Connect ${n.label}`,children:[re(N,{children:re(W,{provider:a})}),Xe(br,{direction:"column",className:"provider-choice__copy",gap:"1",children:[re(vt,{size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:n.label}),re(vt,{size:"2",color:"gray",truncate:!0,children:n.description})]}),re("span",{className:"provider-choice__chevron","aria-hidden":!0,children:i?re(Zi,{size:"2"}):re(Ji,{style:y("--space-5")})})]}),r===a&&Xe(br,{align:"center",justify:"between",gap:"3",mt:"2",px:"1",children:[Xe(br,{align:"center",gap:"2",children:[re(Qi,{style:{...y("--space-4"),color:"var(--red-9)",flexShrink:0}}),re(vt,{size:"2",style:{color:"var(--red-11)"},children:t?`No more ${n.label} accounts available to connect.`:`Couldn't connect ${n.label}. Please try again.`})]}),!t&&re(Xi,{variant:"ghost",size:"1",onClick:()=>o(a),children:"Retry"})]})]},a)})})}import{Badge as Oo,Box as rs,DropdownMenu as Ze,Flex as _o,IconButton as ts,Text as Wo}from"@radix-ui/themes";import{DotsVerticalIcon as os,ReloadIcon as as,TrashIcon as ns}from"@radix-ui/react-icons";import{jsx as q,jsxs as Se}from"react/jsx-runtime";function is({account:e,onRemove:r,onReconnect:t,onClick:o}){let a=e.authStatus==="reauth",n=e.authStatus==="failed",i=q(Wo,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.displayName});return Se(rs,{onClick:o,style:{width:"100%",minWidth:0,height:x.connectedAccountCardH,boxSizing:"border-box",padding:"var(--space-3)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",display:"flex",alignItems:"center",gap:"var(--space-3)",cursor:o?"pointer":void 0},children:[q(N,{size:"var(--space-6)",children:q(W,{provider:e.provider})}),Se(_o,{direction:"column",style:{flex:1,minWidth:0},children:[Se(_o,{align:"center",gap:"2",style:{minWidth:0},children:[o?q("button",{type:"button",className:"card-title-button",onClick:l=>{l.stopPropagation(),o()},children:i}):i,a&&q(Oo,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),n&&q(Oo,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),q(Wo,{size:"1",color:"gray",truncate:!0,children:e.email})]}),Se(Ze.Root,{children:[q(Ze.Trigger,{children:q(ts,{variant:"ghost",color:"gray",size:"1","aria-label":`${e.displayName} actions`,onClick:l=>l.stopPropagation(),children:q(os,{})})}),Se(Ze.Content,{align:"end",onClick:l=>l.stopPropagation(),children:[(a||n)&&t&&Se(Ze.Item,{onSelect:t,children:[q(as,{})," Reconnect"]}),Se(Ze.Item,{color:"red",onSelect:r,children:[q(ns,{})," Remove account"]})]})]})]})}import{Flex as ss,Text as ls,Heading as cs}from"@radix-ui/themes";import{jsx as ht,jsxs as ps}from"react/jsx-runtime";function ds({icon:e,title:r,description:t,action:o,headingAs:a="h2"}){return ps(ss,{direction:"column",align:"center",gap:"3",style:{width:"100%",paddingTop:"var(--space-9)",textAlign:"center"},children:[ht(N,{size:"var(--space-8)",children:e}),ht(cs,{as:a,size:_[a],weight:"medium",align:"center",children:r}),t&&ht(ls,{size:"2",color:"gray",align:"center",style:{maxWidth:x.emptyStateCopyMax},children:t}),o]})}import{useState as gs}from"react";import{Dialog as Je,Flex as us,Text as xr,Checkbox as ms,Button as Vo}from"@radix-ui/themes";import{Fragment as vs,jsx as $,jsxs as bt}from"react/jsx-runtime";function Re({account:e,onOpenChange:r,onImport:t,initiallySelectedIds:o,disabledIds:a,disabledReason:n,title:i="Calendars",description:l="Choose which calendars you want to import.",confirmLabel:s="Import Calendars"}){let c=e?`${e.id}:${(o??e.calendars.map(g=>g.id)).join(",")}`:"closed";return $(Je.Root,{open:!!e,onOpenChange:r,children:$(Je.Content,{maxWidth:x.dialogMd,onInteractOutside:g=>g.preventDefault(),children:e&&$(fs,{account:e,initiallySelectedIds:o,disabledIds:a,disabledReason:n,title:i,description:l,confirmLabel:s,onImport:t},c)})})}function fs({account:e,initiallySelectedIds:r,disabledIds:t,disabledReason:o,title:a,description:n,confirmLabel:i,onImport:l}){let[s,c]=gs(()=>new Set(r??e.calendars.map(u=>u.id))),g=new Set(t??[]);function p(u){g.has(u)||c(h=>{let v=new Set(h);return v.has(u)?v.delete(u):v.add(u),v})}return bt(vs,{children:[$(Je.Title,{size:"5",weight:"medium",mb:"1",children:a}),$(Je.Description,{size:"2",color:"gray",mb:"2",children:n}),$(xr,{as:"p",size:"2",weight:"medium",mb:"5",style:{color:"var(--gray-12)"},children:e.email}),$(us,{direction:"column",gap:"3",mb:"5",children:e.calendars.map(u=>{let h=s.has(u.id),v=g.has(u.id);return bt(xr,{as:"label",size:"3",className:"calendar-picker-row","data-selected":h||void 0,"data-disabled":v?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-4)",cursor:v?"default":"pointer"},children:[$(ms,{checked:h,disabled:v,onCheckedChange:()=>p(u.id)}),$(xr,{weight:"medium",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:u.name}),v&&o&&$(xr,{size:"1",color:"gray",style:{flexShrink:0},children:o})]},u.id)})}),bt(J,{justify:"between",noTopMargin:!0,pad:"var(--space-5)",radius:"var(--radius-4)",children:[$(Je.Close,{children:$(Vo,{size:"2",variant:"outline",color:"gray",children:"Cancel"})}),$(Vo,{size:"2",className:"btn-amber-primary",disabled:s.size===0,onClick:()=>l(Array.from(s)),children:i})]})]})}import{Box as Qe,Flex as ys,Text as te}from"@radix-ui/themes";import{jsx as L,jsxs as Cr}from"react/jsx-runtime";function hs(e){let r=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!r)return"white";let t=parseInt(r[1],16),o=n=>{let i=n/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*o(t>>16&255)+.7152*o(t>>8&255)+.0722*o(t&255)>.45?"black":"white"}function $o({tone:e,title:r,meta:t,accentColor:o}){let a=e==="synced"?o||"var(--accent-9)":"var(--blue-11)",n=e==="synced"?o?hs(o):"var(--accent-contrast)":"white";return Cr(Qe,{style:{background:a,borderRadius:"var(--radius-2)",padding:"var(--space-2) var(--space-3)"},children:[L(te,{as:"p",size:"2",weight:"medium",style:{color:n},children:r}),t?L(te,{as:"p",size:"1",style:{color:n},children:t}):null]})}var bs="Busy",xs={title:"Gym",time:"10:00 AM",location:"Flex Gym on 16th Ave",description:"Workout notes"};function Cs({hasSources:e,hasTarget:r,sourceLabel:t,targetLabel:o,showTitle:a,showDescription:n,showLocation:i,tagLabel:l,accentColor:s,sampleEvent:c=xs}){let g=c.title,p=[c.time,c.location].filter(Boolean).join(" \xB7 "),u=l?.trim()||bs,h=a?`${c.title} - (${u})`:u,v=[c.time].filter(Boolean);i&&c.location&&v.push(c.location),n&&c.description&&v.push(c.description);let f=v.join(" \xB7 ");return Cr(ys,{direction:"column",gap:"4",style:{padding:"var(--space-4)"},children:[L(te,{as:"p",className:"ds-section-label",style:{textAlign:"center"},children:"Sync Preview"}),L(te,{as:"p",size:"1",color:"gray",style:{textAlign:"center",marginTop:"calc(-1 * var(--space-2))"},children:"Example event \u2014 not from your calendars."}),Cr(Qe,{children:[L(te,{as:"p",size:"1",color:"gray",mb:"1",children:"Sources"}),L(te,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:e?t||"Selected sources":"\u2014"}),L(Qe,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:L($o,{tone:"source",title:g,meta:p})})]}),Cr(Qe,{children:[L(te,{as:"p",size:"1",color:"gray",mb:"1",children:"Target"}),L(te,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:r?o||"Selected target":"\u2014"}),L(Qe,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:r?L($o,{tone:"synced",title:h,meta:f,...s?{accentColor:s}:{}}):L(te,{as:"p",size:"2",color:"gray",children:"Pick one target calendar"})})]}),!e||!r?L(te,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Select one or more sources, then one target"}):L(te,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Only the highlighted block is posted to the target"})]})}import{Flex as xt,Text as Ct}from"@radix-ui/themes";import{CheckIcon as ws}from"@radix-ui/react-icons";import{jsx as Le,jsxs as Go}from"react/jsx-runtime";function wt({steps:e,current:r}){return Le("div",{role:"list","aria-label":"Wizard progress",style:{display:"flex",flexWrap:"wrap",width:"100%",flexShrink:0,marginBottom:0,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",overflow:"hidden"},children:e.map((t,o)=>{let a=o+1,n=a===r,i=a<r;return Go(xt,{align:"start",gap:"3",role:"listitem","aria-current":n?"step":void 0,style:{flex:"1 1 calc(3 * var(--space-9) + var(--space-6))",minWidth:"calc(3 * var(--space-9) + var(--space-6))",paddingTop:"var(--space-4)",paddingBottom:"var(--space-4)",paddingLeft:"var(--space-4)",paddingRight:"var(--space-4)",marginBottom:"-1px",borderBottom:n?"2px solid var(--accent-9)":"2px solid transparent"},children:[Le(xt,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",flexShrink:0,marginTop:"var(--space-1)",background:i?"var(--green-9)":n?"var(--accent-9)":"var(--gray-3)",color:i?"white":n?"var(--accent-contrast)":"var(--gray-11)"},children:i?Le(ws,{style:y("--space-3")}):Le(Ct,{size:"1",weight:"medium",children:t.n})}),Go(xt,{direction:"column",gap:"1",style:{minWidth:0,flex:1,paddingTop:"var(--space-1)"},children:[Le(Ct,{size:"2",weight:"medium",style:{color:n||i?"var(--gray-12)":"var(--gray-10)",lineHeight:"var(--line-height-2)"},children:t.title}),Le(Ct,{size:"1",color:"gray",style:{lineHeight:"var(--line-height-1)"},children:t.description})]})]},t.n)})})}import{jsx as jo}from"react/jsx-runtime";var Ts=[{n:"01",title:"Connect",description:"Connect your calendar account"},{n:"02",title:"Calendars",description:"Import at least 2 calendars"},{n:"03",title:"Sync",description:"Set up your first sync"}];function Uo({current:e}){return jo(wt,{steps:Ts,current:e})}function Ss({current:e,total:r=3}){return jo(Uo,{current:e})}import Tt from"dayjs";import{Flex as Ko,Grid as Yo,IconButton as qo,Text as Xo}from"@radix-ui/themes";import{ChevronLeftIcon as Rs,ChevronRightIcon as ks}from"@radix-ui/react-icons";import{jsx as ue,jsxs as St}from"react/jsx-runtime";var Ds=["S","M","T","W","T","F","S"];function Rt({cursor:e,onSelect:r,today:t=new Date}){let o=Tt(e).startOf("month"),a=o.startOf("week"),n=Array.from({length:42},(i,l)=>a.add(l,"day"));return St("div",{children:[St(Ko,{align:"center",justify:"between",mb:"2",children:[ue(Xo,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:o.format("MMMM YYYY")}),St(Ko,{gap:"1",children:[ue(qo,{size:"1",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r(Tt(e).subtract(1,"month").toDate()),children:ue(Rs,{})}),ue(qo,{size:"1",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r(Tt(e).add(1,"month").toDate()),children:ue(ks,{})})]})]}),ue(Yo,{columns:"7",gap:"1",mb:"1",children:Ds.map((i,l)=>ue(Xo,{size:"1",color:"gray",align:"center",children:i},l))}),ue(Yo,{columns:"7",gap:"1",justify:"center",align:"center",style:{justifyItems:"center"},children:n.map(i=>{let l=i.isSame(t,"day"),s=i.isSame(e,"day"),c=!i.isSame(o,"month");return ue("button",{type:"button",onClick:()=>r(i.toDate()),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",boxSizing:"border-box",flexShrink:0,padding:0,borderRadius:"50%",border:l&&!s?"1.5px solid var(--accent-9)":"none",cursor:"pointer",background:s?"var(--accent-9)":"transparent",color:s?"var(--accent-contrast)":c?"var(--gray-11)":l?"var(--accent-11)":"var(--gray-12)",fontWeight:l||s?500:400,fontSize:"var(--font-size-1)",fontFamily:"var(--font-poppins)"},children:i.format("D")},i.format("YYYY-MM-DD"))})})]})}import{useState as Is}from"react";import{Dialog as er,Flex as rr,Text as wr,Button as kt,IconButton as As,Badge as Zo,Separator as Ps,Box as Jo}from"@radix-ui/themes";import{Cross2Icon as Es,PlusIcon as Bs,ReloadIcon as Ns}from"@radix-ui/react-icons";import{Fragment as Qo,jsx as A,jsxs as oe}from"react/jsx-runtime";function Ms({account:e,catalog:r,onOpenChange:t,onRemoveCalendar:o,onSaveCalendars:a,onReconnect:n}){let[i,l]=Is(!1),s=e?.authStatus==="reauth",c=e?.authStatus==="failed";function g(p){if(!e||!r)return;let u=new Set(p);a(e,r.calendars.filter(h=>u.has(h.id))),l(!1)}return oe(Qo,{children:[A(er.Root,{open:!!e&&!i,onOpenChange:p=>{p||t(!1)},children:A(er.Content,{maxWidth:x.dialogMd,children:e&&oe(Qo,{children:[oe(rr,{align:"center",gap:"3",mb:"1",children:[A(N,{size:"var(--space-6)",children:A(W,{provider:e.provider})}),oe(Jo,{style:{minWidth:0,flex:1},children:[oe(rr,{align:"center",gap:"2",mb:"1",style:{minWidth:0},children:[A(er.Title,{size:"4",weight:"medium",mb:"0",truncate:!0,style:{minWidth:0},children:e.displayName}),s&&A(Zo,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),c&&A(Zo,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),A(er.Description,{size:"2",color:"gray",mb:"0",children:e.email})]})]}),(s||c)&&n&&oe(kt,{size:"2",variant:"soft",color:c?"red":"amber",mt:"3",onClick:()=>n(e.id),children:[A(Ns,{}),"Reconnect"]}),A(Ps,{size:"4",my:"4"}),oe(rr,{align:"center",justify:"between",gap:"3",mb:"3",children:[A(wr,{as:"p",className:"ds-section-label",mb:"0",children:"Calendars"}),r&&r.calendars.length>0&&oe(kt,{size:"1",variant:"soft",color:"gray",onClick:()=>l(!0),children:[A(Bs,{style:y("--space-3")}),"Change calendars"]})]}),A(rr,{direction:"column",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",overflow:"hidden",background:"var(--color-panel-solid)"},children:e.calendars.length===0?A(wr,{size:"2",color:"gray",style:{padding:"var(--space-4)"},children:"No calendars imported."}):e.calendars.map((p,u)=>oe(rr,{align:"center",gap:"3",className:"data-table-row",style:{padding:"var(--space-3) var(--space-4)",minHeight:"var(--space-7)",borderTop:u>0?"1px solid var(--gray-4)":void 0},children:[A(Jo,{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:p.colorToken,flexShrink:0}}),oe(wr,{size:"2",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:[p.name,p.isPrimary&&oe(wr,{size:"1",color:"gray",children:[" ","\xB7 Primary"]})]}),A(As,{variant:"ghost",color:"gray",size:"1","aria-label":`Remove ${p.name}`,onClick:()=>o(e,p),children:A(Es,{})})]},p.id))}),A(J,{justify:"end",children:A(er.Close,{children:A(kt,{size:"2",variant:"soft",color:"gray",children:"Close"})})})]})})}),A(Re,{account:i&&r?r:null,initiallySelectedIds:e?.calendars.map(p=>p.id),title:"Change calendars",description:"Choose which calendars to keep on this account.",confirmLabel:"Save calendars",onOpenChange:p=>{p||l(!1)},onImport:g})]})}import{useMemo as zs}from"react";import Rr from"dayjs";import{Calendar as Fs,dayjsLocalizer as Ls,Views as tr}from"react-big-calendar";import"react-big-calendar/lib/css/react-big-calendar.css";import{Text as Tr}from"@radix-ui/themes";import{jsx as He,jsxs as Sr}from"react/jsx-runtime";var Hs=Ls(Rr),Os=new Date(1970,0,1,8,0,0);function Dt({blocks:e,view:r,onViewChange:t,date:o,onNavigate:a,accounts:n,today:i=new Date}){let l=zs(()=>e.map(s=>{let c=new Date(s.date);c.setHours(s.startHour,s.startMinute,0,0);let g=new Date(s.date);return g.setHours(s.endHour,s.endMinute,0,0),{id:s.id,title:s.title,start:c,end:g,resource:s}}),[e]);return He("div",{className:"rbc-radix-scope",style:{height:"100%",containerType:"inline-size"},children:He(Fs,{localizer:Hs,events:l,view:r==="week"?tr.WEEK:tr.MONTH,onView:s=>t(s===tr.MONTH?"month":"week"),date:o,onNavigate:a,views:[tr.WEEK,tr.MONTH],toolbar:!0,popup:!0,scrollToTime:Os,enableAutoScroll:!0,getNow:()=>i,tooltipAccessor:null,eventPropGetter:s=>{let g=Y(n,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return r==="month"?{style:{background:"transparent",border:"none",boxShadow:"none"}}:{style:{backgroundColor:g,border:"none"}}},components:{toolbar:ft,week:{header:s=>He(gt,{...s,today:i}),event:({event:s})=>{let c=(s.end.getTime()-s.start.getTime())/6e4,g=c>=60,p=c>=30;return Sr("div",{children:[He(Tr,{size:"1",weight:"medium",style:{color:"white",display:"block"},truncate:!0,children:s.title}),p&&Sr(Tr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:[Rr(s.start).format("h:mm A")," \u2013 ",Rr(s.end).format("h:mm A")]}),g&&s.resource.location&&He(Tr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:s.resource.location})]})}},month:{event:({event:s})=>{let g=Y(n,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return Sr(Tr,{size:"1",style:{display:"flex",alignItems:"center",gap:"var(--space-1)",color:"var(--gray-12)",background:`color-mix(in srgb, ${g} 28%, transparent)`,borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)"},truncate:!0,children:[He("span",{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:g,flexShrink:0}}),Sr("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[Rr(s.start).format("H:mm")," ",s.title]})]})}}}})})}import{Dialog as or,Flex as ke,Text as De,Button as ea,Separator as _s,Badge as Ws}from"@radix-ui/themes";import{Fragment as $s,jsx as k,jsxs as he}from"react/jsx-runtime";var ra={synced:{label:"Synced",color:"green"},syncing:{label:"Syncing\u2026",color:"amber"},error:{label:"Error",color:"red"}};function Vs({sync:e,accounts:r,onOpenChange:t,onEdit:o}){let a=e?(()=>{let n=e.sourceCalendarIds.map(l=>Y(r,l)?.calendar.name).filter(l=>!!l),i=Y(r,e.targetCalendarId)?.calendar.name??"\u2014";return`${n.join(", ")||"\u2014"} \u2192 ${i}`})():"";return k(or.Root,{open:!!e,onOpenChange:t,children:k(or.Content,{maxWidth:x.dialogMd,children:e&&he($s,{children:[he(ke,{align:"center",justify:"between",mb:"1",children:[k(or.Title,{size:"4",mb:"0",children:e.name}),k(Ws,{color:ra[e.status].color,variant:"soft",size:"1",radius:"full",children:ra[e.status].label})]}),k(or.Description,{size:"2",color:"gray",mb:"4",children:"Sync configuration"}),he(ke,{direction:"column",gap:"3",children:[k(ye,{label:"Calendars",children:a}),k(ye,{label:"Sources",children:k(ke,{direction:"column",gap:"1",align:"end",children:e.sourceCalendarIds.map(n=>{let i=Y(r,n);return i?he(ke,{direction:"column",align:"end",children:[k(De,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:i.calendar.name}),k(De,{size:"1",color:"gray",children:i.account.email})]},n):null})||"\u2014"})}),k(ye,{label:"Target",children:(()=>{let n=Y(r,e.targetCalendarId);return n?he(ke,{direction:"column",align:"end",children:[k(De,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:n.calendar.name}),k(De,{size:"1",color:"gray",children:n.account.email})]}):"\u2014"})()}),k(ye,{label:"Last synced",children:e.lastSyncedLabel??"\u2014"})]}),k(_s,{size:"4",my:"4"}),k(De,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"WHAT TO SHOW"}),he(ke,{direction:"column",gap:"3",children:[k(ye,{label:"Tag",children:e.tagLabel?.trim()||"Busy"}),k(ye,{label:"Event titles",children:e.showTitle?"Shown":"Hidden"}),k(ye,{label:"Event description",children:e.showDescription?"Shown":"Hidden"}),k(ye,{label:"Event location",children:e.showLocation?"Shown":"Hidden"})]}),he(J,{justify:"between",children:[k(or.Close,{children:k(ea,{size:"2",variant:"soft",color:"gray",children:"Close"})}),k(ea,{size:"2",className:"btn-amber-primary",onClick:()=>o(e.id),children:"Edit sync"})]})]})})})}function ye({label:e,children:r}){return he(ke,{align:"baseline",justify:"between",gap:"4",children:[k(De,{size:"2",color:"gray",style:{flexShrink:0},children:e}),k(De,{size:"2",weight:"medium",align:"right",style:{color:"var(--gray-12)"},children:r})]})}import{useState as kr}from"react";function ar({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o}){let[a,n]=kr(null),[i,l]=kr(null),[s,c]=kr(null),[g,p]=kr(!1);function u(v){if(a)return;c(null),p(!1),n(v);let f=e.map(S=>S.id);r(v,f).then(S=>{n(null),S?l(S):(c(v),p(!0))}).catch(()=>{n(null),c(v),p(!1)})}function h(v){if(!i)return;let f=new Set(v);t({...i,calendars:i.calendars.filter(S=>f.has(S.id))}),l(null),o?.()}return{connectingProvider:a,pendingAccount:i,failedProvider:s,exhausted:g,connect:u,confirmImport:h,cancelImport:()=>l(null),dismissError:()=>c(null)}}import{Box as Gs,DropdownMenu as Dr,Button as Us,Flex as js,Text as ta}from"@radix-ui/themes";import{PlusIcon as oa}from"@radix-ui/react-icons";import{Fragment as Ys,jsx as ae,jsxs as Oe}from"react/jsx-runtime";function Ks({variant:e="button",trigger:r,accounts:t,connectProvider:o,onAccountAdded:a,onImported:n}){let{pendingAccount:i,failedProvider:l,exhausted:s,connect:c,confirmImport:g,cancelImport:p,dismissError:u}=ar({accounts:t,connectProvider:o,onAccountAdded:a,onImported:n}),h=["google","microsoft"],v=e==="tile"?Oe("button",{type:"button",className:"connect-account-tile","aria-label":"Connect Account",children:[ae(oa,{style:y("--space-4")}),"Connect Account"]}):Oe(Us,{size:"2",className:"btn-amber-primary",children:[ae(oa,{style:y("--space-4")}),"Connect Account"]}),f=Oe(Dr.Root,{children:[ae(Dr.Trigger,{children:r??v}),ae(Dr.Content,{align:"start",style:{width:"max-content",minWidth:"max-content"},children:h.map(S=>{let E=Fe[S];return Oe(Dr.Item,{onSelect:()=>c(S),style:{height:"auto",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)"},children:[ae(N,{size:"var(--space-6)",children:ae(W,{provider:S})}),Oe(js,{direction:"column",gap:"1",style:{flexShrink:0},children:[ae(ta,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:E.label}),ae(ta,{size:"1",color:"gray",children:E.description})]})]},S)})})]});return Oe(Ys,{children:[e==="tile"&&!r?ae(Gs,{style:{width:"100%",minWidth:0},children:f}):f,ae(Re,{account:i,onOpenChange:S=>!S&&p(),onImport:g}),l&&ae($r,{msg:s?`No more ${Fe[l].label} accounts available to connect.`:`Couldn't connect ${Fe[l].label}. Please try again.`,color:"red",onDone:u})]})}import{Card as qs,Flex as It,Text as Xs,Heading as Zs}from"@radix-ui/themes";import{CalendarIcon as Js}from"@radix-ui/react-icons";import{jsx as be,jsxs as aa}from"react/jsx-runtime";function Qs({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o}){let{connectingProvider:a,pendingAccount:n,failedProvider:i,exhausted:l,connect:s,confirmImport:c,cancelImport:g}=ar({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o});return aa(It,{direction:"column",align:"center",justify:"center",style:{width:"100%",flex:1,minHeight:0},children:[be(qs,{style:{width:"100%",maxWidth:x.providerChooserMax},children:aa(It,{direction:"column",align:"center",justify:"center",gap:"3",py:"6",px:"3",style:{width:"100%",textAlign:"center"},children:[be(N,{children:be(Js,{style:{...y("--space-5"),color:"var(--gray-7)"}})}),be(Zs,{as:"h2",size:_.h2,weight:"medium",children:e.length>0?"Connect another account":"Connect your first account"}),be(Xs,{as:"p",size:"2",color:"gray",children:e.length>0?"Add another Google or Microsoft account, then choose which calendars to import.":"Connect a Google or Microsoft account to import calendars for sync."}),be(It,{direction:"column",style:{width:"100%"},mt:"3",children:be(yt,{connectingProvider:a,failedProvider:i,exhausted:l,onConnect:s})})]})}),be(Re,{account:n,onOpenChange:p=>!p&&g(),onImport:c})]})}import{useEffect as el,useMemo as At,useState as Ir}from"react";import{Link as rl}from"react-router-dom";import{Box as Pt,Checkbox as na,Flex as nr,Separator as Et,Text as Ie}from"@radix-ui/themes";import{ChevronDownIcon as tl,GearIcon as ol,HamburgerMenuIcon as al}from"@radix-ui/react-icons";import{jsx as P,jsxs as me}from"react/jsx-runtime";function nl({accounts:e,view:r,setView:t,hideClones:o,setHideClones:a,mergedCalendarIds:n,visibleCalendarIds:i,toggleCalendarVisible:l,getVisibleBlocksInRange:s,manageAccountsHref:c,today:g=new Date}){let[p,u]=Ir(g),[h,v]=Ir(new Set),[f,S]=Ir(()=>typeof window<"u"&&window.innerWidth<900),[E,X]=Ir(!1);el(()=>{function b(){S(window.innerWidth<900)}return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let ne=At(()=>{let b=new Date(p);return b.setDate(b.getDate()-42),b},[p]),C=At(()=>{let b=new Date(p);return b.setDate(b.getDate()+42),b},[p]),z=s(ne,C),R=At(()=>{let b=[],F=new Map;for(let H of n){let G=Y(e,H);if(!G)continue;let ce=F.get(G.account.id);ce===void 0&&(ce=b.length,F.set(G.account.id,ce),b.push({accountId:G.account.id,calendarIds:[]})),b[ce].calendarIds.push(H)}return b},[n,e]);function fe(b){v(F=>{let H=new Set(F);return H.has(b)?H.delete(b):H.add(b),H})}return me(nr,{gap:"5",align:"start",direction:f?"column":"row",flexGrow:"1",minHeight:"0",height:"100%",children:[(!f||E)&&me(Pt,{minWidth:f?void 0:x.sidebarColMin,p:"4",maxHeight:"100%",style:{flex:f?"1 1 100%":`0 0 ${x.sidebarColBasis}`,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",boxShadow:"var(--shadow-card)",overflow:"auto"},children:[P(Rt,{cursor:p,onSelect:u,today:g}),P(Et,{size:"4",my:"3"}),P(Ie,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"CALENDARS"}),P(nr,{direction:"column",gap:"1",mb:"4",children:R.map(({accountId:b,calendarIds:F},H)=>{let G=e.find(de=>de.id===b);if(!G)return null;let ce=h.has(b);return me("div",{style:{paddingTop:H>0?"var(--space-2)":void 0,borderTop:H>0?"1px solid var(--gray-3)":void 0},children:[me(nr,{align:"center",gap:"2",mb:"2",py:"1",className:"calendar-legend-account-row",style:{cursor:"pointer",borderRadius:"var(--radius-2)"},onClick:()=>fe(b),children:[P(tl,{style:{...y("--space-3"),color:"var(--gray-9)",transform:ce?"rotate(-90deg)":void 0,transition:"transform 120ms ease",flexShrink:0}}),P(W,{provider:G.provider}),P(Ie,{size:"2",weight:"medium",truncate:!0,title:G.email,style:{color:"var(--gray-12)",minWidth:0},children:G.email})]}),!ce&&P(nr,{direction:"column",gap:"1",pl:"5",children:F.map(de=>{let Pe=Y(e,de);return Pe?me(Ie,{as:"label",size:"2",className:"calendar-legend-row",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer",borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)",marginLeft:"calc(var(--space-2) * -1)"},children:[me(nr,{align:"center",gap:"1",children:[P(na,{checked:i.has(de),onCheckedChange:()=>l(de)}),P("span",{"aria-hidden":!0,style:{width:"var(--space-3)",height:"var(--space-3)",borderRadius:"50%",background:Pe.calendar.colorToken,flexShrink:0}})]}),P(Ie,{size:"2",truncate:!0,style:{color:"var(--gray-12)"},title:Pe.calendar.name,children:Pe.calendar.name})]},de):null})})]},b)})}),P(Et,{size:"4",mb:"3"}),me(Ie,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer"},mb:"3",children:[P(na,{checked:o,onCheckedChange:b=>a(!!b)}),"Hide synced events"]}),P(Et,{size:"4",mb:"3"}),me(rl,{to:c,style:{display:"flex",alignItems:"center",gap:"var(--space-2)",color:"var(--gray-11)",textDecoration:"none"},children:[P(ol,{style:y("--space-3")}),P(Ie,{size:"2",children:"Manage accounts"})]}),P(Ie,{as:"p",size:"1",color:"gray",mt:"4",children:"On your target calendars, others see only what each sync is set to share. Full detail stays in araMetrics."})]}),me(Pt,{width:f?"100%":void 0,minHeight:x.bigCalendarH,height:"100%",style:{flex:f?"1 1 100%":`1 1 ${x.syncColWide}`,minWidth:f?0:x.syncColMin,display:"flex",flexDirection:"column",alignSelf:"stretch"},children:[f&&P("button",{type:"button",className:"sidebar-icon-btn","aria-label":E?"Hide calendars":"Show calendars",style:{alignSelf:"flex-start",marginBottom:"var(--space-3)"},onClick:()=>X(b=>!b),children:P(al,{style:y("--space-4")})}),P(Pt,{flexGrow:"1",minHeight:"0",height:"100%",children:P(Dt,{blocks:z,view:r,onViewChange:t,date:p,onNavigate:u,accounts:e,today:g})})]})]})}import{clsx as il}from"clsx";import{twMerge as sl}from"tailwind-merge";function Ae(...e){return sl(il(e))}function ll(e,r="solid"){return D.variants[e]?.[r]||D.variants.primary[r]}function cl(e){let r=D.sizes[e]||D.sizes.md;return`${r.text} ${r.padding} ${r.height}`}function dl(){return Ae(D.base.transition,D.base.focus,D.base.disabled,D.accessibility.reducedMotion)}function pl(){return Ae(D.base.interactive,D.accessibility.focusTrap,D.accessibility.touchTarget)}function gl(e={}){return Ae(e.focusVisible&&D.accessibility.focusTrap,e.highContrast&&D.accessibility.highContrast,e.reducedMotion&&D.accessibility.reducedMotion)}function ul(e,r=""){return typeof e=="string"?`${r}${e}`:typeof e=="object"&&e!==null?Object.entries(e).map(([t,o])=>o===void 0?"":`${t==="xs"?"":`${t}:`}${r}${o}`).filter(Boolean).join(" "):""}function ml(e,r="gap"){let t=D.spacing[e]||D.spacing.md;switch(r){case"margin":return t.replace("gap-","m-");case"padding":return t.replace("gap-","p-");default:return t}}function fl(e){return D.radius[e]||D.radius.md}function vl(e){return D.typography[e]||D.typography.base}function yl(e,r=500){return`bg-${e}-${r}`}function hl(e,r=500){return`text-${e}-${r}`}function bl(e,r=500){return`border-${e}-${r}`}function xl(e,r=500){return`hover:bg-${e}-${r}`}function Cl(e,r=500){return`hover:text-${e}-${r}`}function wl(e,r=500){return`focus:ring-${e}-${r}`}function Tl(e){let r=D.animations[e];return typeof r=="string"?r:""}function Sl(e,r,t){return o=>{let a=e;return Object.entries(r).forEach(([n,i])=>{let l=o[n];l&&i[l]&&(a+=` ${i[l]}`)}),t?.forEach(({conditions:n,className:i})=>{Object.entries(n).every(([s,c])=>o[s]===c)&&(a+=` ${i}`)}),Ae(a)}}function Rl(e){return function(t){let{className:o,...a}=t,n={...e.defaultVariants,...a},i=e.base||"";return e.variants&&Object.entries(e.variants).forEach(([l,s])=>{let c=n[l];c&&s[c]&&(i+=` ${s[c]}`)}),e.compoundVariants?.forEach(({conditions:l,className:s})=>{Object.entries(l).every(([g,p])=>n[g]===p)&&(i+=` ${s}`)}),Ae(i,o)}}function kl(e,r){let t={...e};return Object.keys(r).forEach(o=>{let a=r[o],n=e[o];o==="className"?t[o]=Ae(n,a):typeof a=="object"&&typeof n=="object"&&a!==null&&n!==null&&!Array.isArray(a)&&!Array.isArray(n)?t[o]={...n,...a}:t[o]=a}),t}function Dl(e,r,t){return e?r:t&&e===!1?t:""}function Il(e){let r=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(", ");return Array.from(e.querySelectorAll(r))}function Al(e,r,t,o={}){let{loop:a=!0,orientation:n="both"}=o,i=t;switch(e.key){case"ArrowDown":(n==="vertical"||n==="both")&&(i=t+1,i>=r.length&&(i=a?0:r.length-1));break;case"ArrowUp":(n==="vertical"||n==="both")&&(i=t-1,i<0&&(i=a?r.length-1:0));break;case"ArrowRight":(n==="horizontal"||n==="both")&&(i=t+1,i>=r.length&&(i=a?0:r.length-1));break;case"ArrowLeft":(n==="horizontal"||n==="both")&&(i=t-1,i<0&&(i=a?r.length-1:0));break;case"Home":i=0;break;case"End":i=r.length-1;break}return i!==t&&(e.preventDefault(),r[i]?.focus()),i}import{Theme as Pl}from"@radix-ui/themes";import"@radix-ui/themes/styles.css";import{jsx as Bl}from"react/jsx-runtime";function El({children:e,appearance:r="light",radius:t="none",scaling:o="100%",accentColor:a="amber",grayColor:n="gray",panelBackground:i="solid",className:l=""}){return Bl(Pl,{accentColor:a,grayColor:n,radius:t,scaling:o,panelBackground:i,appearance:r,className:l,children:e})}import*as Ar from"react";function kf({value:e,defaultValue:r,onChange:t}){let[o,a]=Ar.useState(r),n=e!==void 0,i=n?e:o,l=Ar.useCallback(s=>{let c=typeof s=="function"?s(i):s;n||a(c),t?.(c)},[n,i,t]);return[i,l]}import*as _e from"react";function If(e=!1){let[r,t]=_e.useState(e),o=_e.useCallback(()=>t(!0),[]),a=_e.useCallback(()=>t(!1),[]),n=_e.useCallback(()=>t(i=>!i),[]);return{isOpen:r,open:o,close:a,toggle:n,onOpen:o,onClose:a,onToggle:n}}import*as Pr from"react";function Pf(e,r=!0){let t=Pr.useRef(null);return Pr.useEffect(()=>{if(!r)return;let o=a=>{t.current&&!t.current.contains(a.target)&&e()};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[e,r]),t}export*from"@radix-ui/react-icons";export{Hn as ACTIVITY_META,uo as AUDIT_ACTION_META,Ra as AccentCard,Yt as AccentHeader,Ec as AccessibleIcon,_t as Accordion,$t as AccordionContent,Wt as AccordionItem,Vt as AccordionTrigger,Ms as AccountCalendarsDialog,Fa as AccountCard,vn as ActivityRow,Ks as AddAccountMenu,mc as AlertDialog,fn as AppCard,Wl as AspectRatio,_n as AuthCard,Cc as Avatar,wc as Badge,Dt as BigCalendarView,jl as Blockquote,zl as Box,Xr as BrandPanel,Ql as Button,gt as CalendarDayHeader,nl as CalendarMergedView,ji as CalendarPickList,ft as CalendarToolbar,Tc as Callout,Sc as Card,J as CardFooter,oc as Checkbox,nc as CheckboxCards,ac as CheckboxGroup,Kl as Code,Hr as ConfirmDialog,yt as ConnectProviderList,Qs as ConnectProviderRows,is as ConnectedAccountCard,Hl as Container,vc as ContextMenu,wn as DashboardErrorCard,Rc as DataList,Ur as DataTableRow,uc as Dialog,ya as Drawer,ba as DrawerClose,Gt as DrawerContent,Ca as DrawerDefaultClose,jt as DrawerDescription,xa as DrawerHeader,Ut as DrawerTitle,ha as DrawerTrigger,fc as DropdownMenu,Yl as Em,ds as EmptyCard,tn as EventBlock,Fl as Flex,Zr as GoogleIcon,Ll as Grid,Ul as Heading,hc as HoverCard,ec as IconButton,N as IconTile,Re as ImportCalendarsDialog,_l as Inset,ql as Kbd,Ln as METRIC_STATUS_COLOR,ln as MetricCard,Jr as MicrosoftIcon,Rt as MiniMonthPicker,ja as MonthGrid,Ss as OnboardingStepDots,Uo as OnboardingStepper,Qr as OtpInput,Yn as OtpVerifyStep,qn as PROVIDER_LABEL,Fe as PROVIDER_META,Nn as Pagination,Or as PausedBadge,yc as Popover,xc as Portal,kc as Progress,W as ProviderIcon,Zl as Quote,zn as ROLE_LABELS,gr as ROLE_META,ic as Radio,lc as RadioCards,sc as RadioGroup,yr as SHELL_HEADER_H,Fn as STATUS_META,Vl as ScrollArea,Hi as SearchOverlay,Ol as Section,gc as SegmentedControl,cc as Select,$l as Separator,pi as Sidebar,ga as Skeleton,dc as Slider,Bc as Slot,Nc as Slottable,Dc as Spinner,Jl as Strong,pc as Switch,Vs as SyncDetailsDialog,Cs as SyncPreviewRail,Pc as TabNav,Ic as Table,Ac as Tabs,Gl as Text,tc as TextArea,rc as TextField,Xl as TextLink,$r as Toast,bc as Tooltip,ki as Topbar,El as UIProvider,Mc as VisuallyHidden,wt as WizardStepper,On as auditActionMeta,Ae as cn,pa as colors,Dl as conditionalClass,Sl as createCompoundVariants,Rl as createVariantGenerator,Y as findCalendar,gl as getAccessibilityStyles,Tl as getAnimationClass,dl as getBaseStyles,yl as getBgClass,bl as getBorderClass,Ot as getColor,wl as getFocusRingClass,Il as getFocusableElements,xl as getHoverBgClass,Cl as getHoverTextClass,pl as getInteractiveStyles,fl as getRadiusClass,ul as getResponsiveClasses,cl as getSizeStyles,ml as getSpacingClass,hl as getTextClass,vl as getTypographyClass,ll as getVariantStyles,Al as handleArrowNavigation,_ as headingSize,x as layout,kl as mergeProps,D as theme,Pf as useClickOutside,ar as useConnectAccount,kf as useControllableState,If as useDisclosure};
2
2
  //# sourceMappingURL=index.mjs.map