vendor: 10,574 bytes, lines 1-9
1import{r as m,j as e,d as Ws,L as Bs}from"./react-vendor-Cjoe_APl.js";import{S as Hs}from"./ScrollTextReveal-CtAXcCNB.js";import{S as Us}from"./SEOHead-BH5ZIFLC.js";import{c as Tt,b as U,d as H,f as Je,g as Vs,u as Rt,j as At,e as Ks,h as Ge}from"./radix-Bj2ee229.js";import{aj as qs,l as A,bj as Zs,r as ht,x as _t,f as ke,U as M,Q as w,S as D,i as Js,$ as fe,e as Ys,g as Le,j as Pe,V as me,O as Et,T as Lt,o as Pt}from"./index-D8DLnaN_.js";import{u as Mt}from"./index-DEBIf06-.js";import{C as Ye,a as Xe,b as W}from"./3d-card-B2gj-xE7.js";import{A as xe}from"./AnimatedCounter-SkR9Rk2l.js";import{u as Xs,a as Qs}from"./useGitHubContributions-B65FZm6G.js";import{e as ea}from"./github-D4KtTGaN.js";import{DEFAULT_GITHUB_OWNER as Qe}from"./project-config-CI2n7JTS.js";import{u as Dt}from"./useWakaTime-DJ8pdepC.js";import{a as B,b as Q,L as pe}from"./LoadState-ChpIOMdE.js";import{a as J,m as b,h as ta,A as K}from"./framer-motion-Bt-cU7Mj.js";import{a as sa}from"./useProjects-DjZwoe_h.js";import{c as aa}from"./SkeletonCharts-BkHZGLAd.js";import{A as ft,P as na}from"./PageNav-CpnzLkIF.js";import{b9 as et,aq as ra,a0 as ia,bL as oa,i as la,bk as ca,au as da,b as ua,af as ma,bM as It,bp as Ce,ay as tt,ax as $t,a4 as G,K as ge,m as Me,G as xa,E as st,bm as pa,aX as ha,z as zt,at as fa,bo as ga,bC as ba,bD as ja,bE as Ot,bF as Ft,bN as Gt,a1 as va}from"./icons-DW2APY13.js";import{W as We}from"./WidgetBoundary-D2v9p4PA.js";import{getCaseStudy as Be}from"./case-studies-DNJuVFPX.js";import"./shapes-I6kHKg7I.js";import"./universe-palette-BLt7x6P5.js";import"./media-queries-6ySLs9KL.js";var De="rovingFocusGroup.onEntryFocus",ya={bubbles:!1,cancelable:!0},be="RovingFocusGroup",[He,Wt,Na]=qs(be),[wa,Bt]=Je(be,[Na]),[ka,Ca]=wa(be),Ht=m.forwardRef((t,s)=>e.jsx(He.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(He.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(Sa,{...t,ref:s})})}));Ht.displayName=be;var Sa=m.forwardRef((t,s)=>{const{__scopeRovingFocusGroup:a,orientation:n,loop:r=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...h}=t,x=m.useRef(null),y=Vs(s,x),f=Mt(i),[p,N]=Rt({prop:l,defaultProp:o??null,onChange:c,caller:be}),[L,I]=m.useState(!1),j=At(d),k=Wt(a),T=m.useRef(!1),[_,E]=m.useState(0);return m.useEffect(()=>{const S=x.current;if(S)return S.addEventListener(De,j),()=>S.removeEventListener(De,j)},[j]),e.jsx(ka,{scope:a,orientation:n,dir:f,loop:r,currentTabStopId:p,onItemFocus:m.useCallback(S=>N(S),[N]),onItemShiftTab:m.useCallback(()=>I(!0),[]),onFocusableItemAdd:m.useCallback(()=>E(S=>S+1),[]),onFocusableItemRemove:m.useCallback(()=>E(S=>S-1),[]),children:e.jsx(U.div,{tabIndex:L||_===0?-1:0,"data-orientation":n,...h,ref:y,style:{outline:"none",...t.style},onMouseDown:H(t.onMouseDown,()=>{T.current=!0}),onFocus:H(t.onFocus,S=>{const P=!T.current;if(S.target===S.currentTarget&&P&&!L){const F=new CustomEvent(De,ya);if(S.currentTarget.dispatchEvent(F),!F.defaultPrevented){const $=k().filter(O=>O.focusable),V=$.find(O=>O.active),ie=$.find(O=>O.id===p),Y=[V,ie,...$].filter(Boolean).map(O=>O.ref.current);Kt(Y,u)}}T.current=!1}),onBlur:H(t.onBlur,()=>I(!1))})})}),Ut="RovingFocusGroupItem",Vt=m.forwardRef((t,s)=>{const{__scopeRovingFocusGroup:a,focusable:n=!0,active:r=!1,tabStopId:i,children:l,...o}=t,c=Tt(),d=i||c,u=Ca(Ut,a),h=u.currentTabStopId===d,x=Wt(a),{onFocusableItemAdd:y,onFocusableItemRemove:f,currentTabStopId:p}=u;return m.useEffect(()=>{if(n)return y(),()=>f()},[n,y,f]),e.jsx(He.ItemSlot,{scope:a,id:d,focusable:n,active:r,children:e.jsx(U.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...o,ref:s,onMouseDown:H(t.onMouseDown,N=>{n?u.onItemFocus(d):N.preventDefault()}),onFocus:H(t.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(t.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){u.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const L=Aa(N,u.orientation,u.dir);if(L!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let j=x().filter(k=>k.focusable).map(k=>k.ref.current);if(L==="last")j.reverse();else if(L==="prev"||L==="next"){L==="prev"&&j.reverse();const k=j.indexOf(N.currentTarget);j=u.loop?_a(j,k+1):j.slice(k+1)}setTimeout(()=>Kt(j))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:p!=null}):l})})});Vt.displayName=Ut;var Ta={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ra(t,s){return s!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Aa(t,s,a){const n=Ra(t.key,a);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Ta[n]}function Kt(t,s=!1){const a=document.activeElement;for(const n of t)if(n===a||(n.focus({preventScroll:s}),document.activeElement!==a))return}function _a(t,s){return t.map((a,n)=>t[(s+n)%t.length])}var Ea=Ht,La=Vt,Se="Tabs",[Pa]=Je(Se,[Bt]),qt=Bt(),[Ma,at]=Pa(Se),Zt=m.forwardRef((t,s)=>{const{__scopeTabs:a,value:n,onValueChange:r,defaultValue:i,orientation:l="horizontal",dir:o,activationMode:c="automatic",...d}=t,u=Mt(o),[h,x]=Rt({prop:n,onChange:r,defaultProp:i??"",caller:Se});return e.jsx(Ma,{scope:a,baseId:Tt(),value:h,onValueChange:x,orientation:l,dir:u,activationMode:c,children:e.jsx(U.div,{dir:u,"data-orientation":l,...d,ref:s})})});Zt.displayName=Se;var Jt="TabsList",Yt=m.forwardRef((t,s)=>{const{__scopeTabs:a,loop:n=!0,...r}=t,i=at(Jt,a),l=qt(a);return e.jsx(Ea,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:n,children:e.jsx(U.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:s})})});Yt.displayName=Jt;var Xt="TabsTrigger",Qt=m.forwardRef((t,s)=>{const{__scopeTabs:a,value:n,disabled:r=!1,...i}=t,l=at(Xt,a),o=qt(a),c=ss(l.baseId,n),d=as(l.baseId,n),u=n===l.value;return e.jsx(La,{asChild:!0,...o,focusable:!r,active:u,children:e.jsx(U.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...i,ref:s,onMouseDown:H(t.onMouseDown,h=>{!r&&h.button===0&&h.ctrlKey===!1?l.onValueChange(n):h.preventDefault()}),onKeyDown:H(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&l.onValueChange(n)}),onFocus:H(t.onFocus,()=>{const h=l.activationMode!=="manual";!u&&!r&&h&&l.onValueChange(n)})})})});Qt.displayName=Xt;var es="TabsContent",ts=m.forwardRef((t,s)=>{const{__scopeTabs:a,value:n,forceMount:r,children:i,...l}=t,o=at(es,a),c=ss(o.baseId,n),d=as(o.baseId,n),u=n===o.value,h=m.useRef(u);return m.useEffect(()=>{const x=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(x)},[]),e.jsx(Ks,{present:r||u,children:({present:x})=>e.jsx(U.div,{"data-state":u?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!x,id:d,tabIndex:0,...l,ref:s,style:{...t.style,animationDuration:h.current?"0s":void 0},children:x&&i})})});ts.displayName=es;function ss(t,s){return`${t}-trigger-${s}`}function as(t,s){return`${t}-content-${s}`}var Da=Zt,ns=Yt,rs=Qt,is=ts;const Ia=Da,os=m.forwardRef(({className:t,...s},a)=>e.jsx(ns,{ref:a,className:A("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...s}));os.displayName=ns.displayName;const ce=m.forwardRef(({className:t,...s},a)=>e.jsx(rs,{ref:a,className:A("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...s}));ce.displayName=rs.displayName;const de=m.forwardRef(({className:t,...s},a)=>e.jsx(is,{ref:a,className:A("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...s}));de.displayName=is.displayName;const $a=Zs("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ls({className:t,variant:s,...a}){return e.jsx("div",{className:A($a({variant:s}),t),...a})}var cs={exports:{}},ds={};/** 2 * @license React 3 * use-sync-external-store-shim.production.js 4 * 5 * Copyright (c) Meta Platforms, Inc. and affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var ne=m;function za(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Oa=typeof Object.is=="function"?Object.is:za,Fa=ne.useState,Ga=ne.useEffect,Wa=ne.useLayoutEffect,Ba=ne.useDebugValue;function Ha(t,s){var a=s(),n=Fa({inst:{value:a,getSnapshot:s}}),r=n[0].inst,i=n[1];return Wa(function(){r.value=a,r.getSnapshot=s,Ie(r)&&i({inst:r})},[t,a,s]),Ga(function(){return Ie(r)&&i({inst:r}),t(function(){Ie(r)&&i({inst:r})})},[t]),Ba(a),a}function Ie(t){var s=t.getSnapshot;t=t.value;try{var a=s();return!Oa(t,a)}catch{return!0}}function Ua(t,s){return s()}var Va=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ua:Ha;ds.useSyncExternalStore=ne.useSyncExternalStore!==void 0?ne.useSyncExternalStore:Va;cs.exports=ds;var Ka=cs.exports;function qa(){return Ka.useSyncExternalStore(Za,()=>!0,()=>!1)}function Za(){return()=>{}}var nt="Avatar",[Ja]=Je(nt),[Ya,us]=Ja(nt),ms=m.forwardRef((t,s)=>{const{__scopeAvatar:a,...n}=t,[r,i]=m.useState("idle");return e.jsx(Ya,{scope:a,imageLoadingStatus:r,onImageLoadingStatusChange:i,children:e.jsx(U.span,{...n,ref:s})})});ms.displayName=nt;var xs="AvatarImage",ps=m.forwardRef((t,s)=>{const{__scopeAvatar:a,src:n,onLoadingStatusChange:r=()=>{},...i}=t,l=us(xs,a),o=Xa(n,i),c=At(d=>{r(d),l.onImageLoadingStatusChange(d)});return Ge(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?e.jsx(U.img,{...i,ref:s,src:n}):null});ps.displayName=xs;var hs="AvatarFallback",fs=m.forwardRef((t,s)=>{const{__scopeAvatar:a,delayMs:n,...r}=t,i=us(hs,a),[l,o]=m.useState(n===void 0);return m.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>
9o(!0),n);return()=>window.clearTimeout(c)}},[n]),l&&i.imageLoadingStatus!=="loaded"?e.jsx(U.span,{...r,ref:s}):null});fs.displayName=hs;function gt(t,s){return t?s?(t.src!==s&&(t.src=s),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Xa(t,{referrerPolicy:s,crossOrigin:a}){const n=qa(),r=m.useRef(null),i=n?(r.current||(r.current=new window.Image),r.current):null,[l,o]=m.useState(()=>gt(i,t));return Ge(()=>{o(gt(i,t))},[i,t]),Ge(()=>{const c=h=>()=>{o(h)};if(!i)return;const d=c("loaded"),u=c("error");return i.addEventListener("load",d),i.addEventListener("error",u),s&&(i.referrerPolicy=s),typeof a=="string"&&(i.crossOrigin=a),()=>{i.removeEventListener("load",d),i.removeEventListener("error",u)}},[i,a,s]),l}var gs=ms,bs=ps,js=fs;const rt=m.forwardRef(({className:t,...s},a)=>e.jsx(gs,{ref:a,className:A("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...s}));rt.displayName=gs.displayName;const it=m.forwardRef(({className:t,...s},a)=>e.jsx(bs,{ref:a,className:A("media-arrive aspect-square h-full w-full",t),...s}));it.displayName=bs.displayName;const ot=m.forwardRef(({className:t,...s},a)=>e.jsx(js,{ref:a,className:A("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...s}));ot.displayName=js.displayName;const oe=new Map;function Qa(t){const[s,a]=m.useState(oe.get(t)??new Map),[n,r]=m.useState(!oe.has(t));return m.useEffect(()=>{if(oe.has(t)){a(oe.get(t)),r(!1);return}r(!0),ea(Qe,t).then(i=>{oe.set(t,i),a(i),r(!1)})},[t]),{data:s,loading:n}}const bt={Python:"#3572a5",TypeScript:"#2b7489",JavaScript:"#f1e05a",Go:"#00add8",Rust:"#dea584",Shell:"#89e051",YAML:"#cb171e",HCL:"#844fba",Dockerfile:"#384d54",Bash:"#89e051",Markdown:"#083fa1",JSON:"#cbcb41",Other:"#8e8e8e"},re=200,q=re/2,ae=re/2,ee=68,vs=ee+26,Ue=40,Ve=30,en=re+Ue*2,tn=re+Ve*2;function Z(t,s){return{x:q+s*Math.sin(t),y:ae-s*Math.cos(t)}}function sn(t){const s=(t??[]).slice(0,8),a=Math.max(...s.map(n=>n.percent),1);return s.map((n,r)=>({name:n.name,color:bt[n.name]??bt.Other,ratio:n.percent/a,angle:2*Math.PI*r/s.length}))}const ys={viewBox:`${-Ue} ${-Ve} ${en} ${tn}`,width:re+Ue*2,height:re+Ve*2,className:"w-full max-w-[280px]",style:{overflow:"visible"}},Ke=t=>t.map(s=>`${s.x.toFixed(2)},${s.y.toFixed(2)}`).join(" "),jt=6;function Ns(){const t=Array.from({length:jt},(a,n)=>2*Math.PI*n/jt),s=m.useMemo(()=>{const a=_t(7);return t.map(n=>Z(n,ee*(.38+a()*.5)))},[]);return e.jsx("div",{className:"flex justify-center","data-loader":"tech-radar",children:e.jsxs("svg",{...ys,"aria-hidden":"true",children:[[.25,.5,.75,1].map((a,n)=>e.jsx("polygon",{points:Ke(t.map(r=>Z(r,ee*a))),fill:"none",stroke:"currentColor",strokeOpacity:.08,strokeWidth:"1"},n)),t.map((a,n)=>{const r=Z(a,ee);return e.jsx("line",{x1:q,y1:ae,x2:r.x,y2:r.y,stroke:"currentColor",strokeOpacity:.1,strokeWidth:"1"},n)}),e.jsx("polygon",{className:"loader-breathe",points:Ke(s),fill:ht("spotify",12),stroke:ht("spotify",45),strokeWidth:"1.5",strokeLinejoin:"round"}),t.map((a,n)=>{const r=Z(a,vs),i=r.x-q,l=30,o=i>8?r.x:i<-8?r.x-l:r.x-l/2;return e.jsx("rect",{className:"loader-breathe",style:{"--loader-delay":`${n*140}ms`},x:o,y:r.y-3,width:l,height:6,rx:3,fill:"currentColor",fillOpacity:.1},n)}),e.jsx("text",{x:q,y:ae,textAnchor:"middle",dominantBaseline:"middle",fontSize:7,letterSpacing:2,fill:"currentColor",fillOpacity:.12,fontWeight:300,children:"STACK"})]})})}function an({languages:t,loading:s,error:a,onRetry:n}){const r=m.useMemo(()=>sn(t),[t]),i=s??t===void 0;return e.jsxs("div",{className:"space-y-3 w-full",children:[e.jsx("p",{className:"text-[10px] font-light tracking-[0.15em] uppercase text-muted-foreground/40 text-center",children:"Tech Radar"}),e.jsx(B,{label:"tech radar",loading:i,error:!i&&r.length===0?a:void 0,empty:r.length===0,onRetry:n,skeleton:e.jsx(Ns,{}),emptyFallback:e.jsx(Q,{title:"No languages logged yet",message:"The radar fills in after the first coding session.",className:"py-2"}),children:()=>e.jsx(nn,{axes:r})})]})}function nn({axes:t}){const s=m.useRef(null),a=J(s,{once:!0,margin:"-60px"}),n=[.25,.5,.75,1];function r(o){return t.map(c=>Z(c.angle,ee*o))}const i=t.map(o=>Z(o.angle,ee*o.ratio)),l=i.length?i.map((o,c)=>`${c===0?"M":"L"}${o.x.toFixed(2)},${o.y.toFixed(2)}`).join(" ")+" Z":"";return e.jsx("div",{className:"flex justify-center",children:e.jsxs("svg",{ref:s,...ys,children:[e.jsx("defs",{children:e.jsxs("filter",{id:"radar-glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[e.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),e.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})}),n.map((o,c)=>e.jsx("polygon",{points:Ke(r(o)),fill:"none",stroke:"currentColor",strokeOpacity:.08,strokeWidth:"1"},c)),t.map((o,c)=>{const d=Z(o.angle,ee);return e.jsx("line",{x1:q,y1:ae,x2:d.x,y2:d.y,stroke:"currentColor",strokeOpacity:.1,strokeWidth:"1"},c)}),l&&e.jsx(b.path,{d:l,fill:"rgba(29,185,84,0.12)",stroke:"#1DB954",strokeWidth:"1.5",strokeLinejoin:"round",initial:{opacity:0,scale:.1},animate:a?{opacity:1,scale:1}:{opacity:0,scale:.1},transition:{duration:.8,ease:[.22,1,.36,1]},style:{transformOrigin:`${q}px ${ae}px`}
9,filter:"url(#radar-glow)"}),t.map((o,c)=>{const d=i[c];return e.jsx(b.circle,{cx:d.x,cy:d.y,r:3,fill:o.color,initial:{opacity:0,scale:0},animate:a?{opacity:1,scale:1}:{opacity:0,scale:0},transition:{duration:.4,delay:.5+c*.05,ease:[.22,1,.36,1]},style:{transformOrigin:`${d.x}px ${d.y}px`}},c)}),t.map((o,c)=>{const d=Z(o.angle,vs),u=d.x-q,h=u>8?"start":u<-8?"end":"middle",x=o.name.length>11?o.name.slice(0,10)+"â¦":o.name;return e.jsx(b.text,{x:d.x,y:d.y,textAnchor:h,dominantBaseline:"middle",fontSize:8.5,fontWeight:300,fill:o.color,fillOpacity:.85,initial:{opacity:0},animate:a?{opacity:1}:{opacity:0},transition:{duration:.4,delay:.6+c*.05},children:x},c)}),e.jsx("text",{x:q,y:ae,textAnchor:"middle",dominantBaseline:"middle",fontSize:7,letterSpacing:2,fill:"currentColor",fillOpacity:.2,fontWeight:300,children:"STACK"})]})})}const $e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function rn({weeks:t}){const{dayTotals:s,dayCounts:a,maxAvg:n}=m.useMemo(()=>{const l=new Array(7).fill(0),o=new Array(7).fill(0);for(const d of t)for(const u of d.contributionDays){const h=new Date(u.date+"T12:00:00").getDay();l[h]+=u.contributionCount,o[h]++}const c=l.map((d,u)=>o[u]>0?d/o[u]:0);return{dayTotals:l,dayCounts:o,maxAvg:Math.max(...c,1)}},[t]),r=$e.map((l,o)=>a[o]>0?s[o]/a[o]:0),i=$e[r.indexOf(Math.max(...r))];return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-xs font-light tracking-wide text-muted-foreground uppercase flex items-center gap-2",children:"Coding patterns"}),e.jsx("div",{className:"flex items-end gap-2",children:$e.map((l,o)=>{const d=r[o]/n,u=Math.max(4,Math.round(d*48)),h=l===i;return e.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-1",children:[e.jsx("div",{className:"h-12 w-full flex items-end",children:e.jsx(b.div,{className:"w-full rounded-sm",initial:{height:0,opacity:0},whileInView:{height:u,opacity:1},viewport:{once:!0},transition:{duration:.5,delay:o*.06,ease:[.22,1,.36,1]},style:{background:h?"rgba(6, 182, 212, 0.5)":`rgba(255, 255, 255, ${.04+d*.12})`,minHeight:4}})}),e.jsx("span",{className:`text-[9px] font-light tracking-wider ${h?"text-cyan-400/60":"text-muted-foreground/25"}`,children:l})]},l)})}),e.jsxs("div",{className:"flex items-center justify-between text-[9px] text-muted-foreground/20 font-light",children:[e.jsxs("span",{children:["avg ",r[r.indexOf(Math.max(...r))].toFixed(1)," commits/day on ",i]}),e.jsxs("span",{children:[s.reduce((l,o)=>l+o,0).toLocaleString()," total"]})]})]})}const ws="github-actions-meta-v4",on=60*60*1e3;function ks(){return`github-actions-today-${new Date().toISOString().slice(0,10)}`}const ln=60*60*1e3;function cn(){try{const t=localStorage.getItem(ws);if(!t)return null;const s=JSON.parse(t);return Date.now()-s.ts<on?s:null}catch{return null}}function dn(){try{const t=localStorage.getItem(ks());if(!t)return null;const s=JSON.parse(t);return Date.now()-s.ts<ln?s:null}catch{return null}}function un(t,s,a,n){try{localStorage.setItem(ws,JSON.stringify({total:t,publicTotal:s,scope:a,days:n,ts:Date.now()}))}catch{}}function mn(t){try{localStorage.setItem(ks(),JSON.stringify({todayRuns:t,ts:Date.now()}))}catch{}}function xn(){const t=cn(),s=dn(),[a,n]=m.useState((t==null?void 0:t.total)??null),[r,i]=m.useState((t==null?void 0:t.publicTotal)??null),[l,o]=m.useState((t==null?void 0:t.scope)??null),[c,d]=m.useState((t==null?void 0:t.days)??null),[u,h]=m.useState((s==null?void 0:s.todayRuns)??null),[x,y]=m.useState(!t||!s);return m.useEffect(()=>{t&&s&&y(!1),ke(`/api/live?type=github&sub=actions&owner=${Qe}`).then(f=>f.ok?f.json():Promise.reject()).then(f=>{if(typeof f.total=="number"){const p=typeof f.publicTotal=="number"?f.publicTotal:null,N=f.scope==="all"||f.scope==="public"?f.scope:null;n(f.total),i(p),o(N),d(f.days??null),h(f.todayRuns??0),un(f.total,p,N,f.days??null),mn(f.todayRuns??0)}}).catch(()=>{}).finally(()=>y(!1))},[]),{total:a,publicTotal:r,scope:l,days:c,todayRuns:u,loading:x}}const Te=m.memo(({blur:t=0,inactiveZone:s=.7,proximity:a=0,spread:n=20,variant:r="default",glow:i=!1,className:l,movementDuration:o=2,borderWidth:c=1,disabled:d=!0})=>{const u=m.useRef(null),h=m.useRef({x:0,y:0}),x=m.useRef(0),y=m.useCallback(f=>{u.current&&(x.current&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{const p=u.current;
9if(!p)return;const{left:N,top:L,width:I,height:j}=p.getBoundingClientRect(),k=(f==null?void 0:f.x)??h.current.x,T=(f==null?void 0:f.y)??h.current.y;f&&(h.current={x:k,y:T});const _=[N+I*.5,L+j*.5],E=Math.hypot(k-_[0],T-_[1]),S=.5*Math.min(I,j)*s;if(E<S){p.style.setProperty("--active","0");return}const P=k>N-a&&k<N+I+a&&T>L-a&&T<L+j+a;if(p.style.setProperty("--active",P?"1":"0"),!P)return;const F=parseFloat(p.style.getPropertyValue("--start"))||0,V=(180*Math.atan2(T-_[1],k-_[0])/Math.PI+90-F+180)%360-180,ie=F+V;ta(F,ie,{duration:o,ease:[.16,1,.3,1],onUpdate:je=>{p.style.setProperty("--start",String(je))}})}))},[s,a,o]);return m.useEffect(()=>{if(d)return;const f=()=>y(),p=N=>y(N);return window.addEventListener("scroll",f,{passive:!0}),document.body.addEventListener("pointermove",p,{passive:!0}),()=>{x.current&&cancelAnimationFrame(x.current),window.removeEventListener("scroll",f),document.body.removeEventListener("pointermove",p)}},[y,d]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:A("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity",i&&"opacity-100",r==="white"&&"border-white",d&&"!block")}),e.jsx("div",{ref:u,style:{"--blur":`${t}px`,"--spread":n,"--start":"0","--active":"0","--glowingeffect-border-width":`${c}px`,"--repeating-conic-gradient-times":"5","--gradient":r==="white"?`repeating-conic-gradient( 10 from 236.84deg at 50% 50%, 11 var(--black), 12 var(--black) calc(25% / var(--repeating-conic-gradient-times)) 13 )`:`radial-gradient(circle, #dd7bbb 10%, #dd7bbb00 20%), 14 radial-gradient(circle at 40% 40%, #d79f1e 5%, #d79f1e00 15%), 15 radial-gradient(circle at 60% 60%, #5a922c 10%, #5a922c00 20%), 16 radial-gradient(circle at 40% 60%, #4c7894 10%, #4c789400 20%), 17 repeating-conic-gradient( 18 from 236.84deg at 50% 50%, 19 #dd7bbb 0%, 20 #d79f1e calc(25% / var(--repeating-conic-gradient-times)), 21 #5a922c calc(50% / var(--repeating-conic-gradient-times)), 22 #4c7894 calc(75% / var(--repeating-conic-gradient-times)), 23 #dd7bbb calc(100% / var(--repeating-conic-gradient-times)) 24 )`},className:A("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity",i&&"opacity-100",t>0&&"blur-[var(--blur)] ",l,d&&"!hidden"),children:e.jsx("div",{className:A("glow","rounded-[inherit]",'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]',"after:[border:var(--glowingeffect-border-width)_solid_transparent]","after:[background:var(--gradient)] after:[background-attachment:fixed]","after:opacity-[var(--active)] after:transition-opacity after:duration-300","after:[mask-clip:padding-box,border-box]","after:[mask-composite:intersect]","after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]")})})]})});Te.displayName="GlowingEffect";const vt={Python:"#3572a5",TypeScript:"#2b7489",JavaScript:"#f1e05a",Go:"#00add8",Rust:"#dea584",Shell:"#89e051",YAML:"#cb171e",HCL:"#844fba",Dockerfile:"#384d54",Other:"#8e8e8e"};function pn({name:t,percent:s,color:a}){const n=m.useRef(null),r=J(n,{once:!0});return e.jsxs("div",{ref:n,className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-light text-foreground/70",children:[e.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:a}}),t]}),e.jsxs("span",{className:"text-[11px] font-mono text-muted-foreground/50",children:[s.toFixed(1),"%"]})]}),e.jsx("div",{className:"h-1 rounded-full bg-border overflow-hidden",children:e.jsx(b.div,{className:"h-full rounded-full",style:{backgroundColor:a},initial:{width:0},animate:{width:r?`${s}%`:0},transition:{duration:.9,ease:[.22,1,.36,1],delay:.2}})})]})}const hn=[{name:10,bar:"58%"},{name:8,bar:"22%"},{name:6,bar:"9%"},{name:5,bar:"5%"},{name:7,bar:"3%"}];function fn(){return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 gap-3",children:[9,9].map((t,s)=>e.jsxs("div",{className:"border border-border rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx(M,{className:"size-3",sweep:!1}),e.jsx(w,{width:t,textClassName:"text-[10px] font-light"})]}),e.jsx(w,{width:s===0?"78%":"64%",textClassName:"text-lg font-light",tone:"violet"})]},s))}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("p",{className:"text-[10px] font-light tracking-[0.15em] uppercase text-muted-foreground
24/25",children:"Top Languages"}),hn.map((t,s)=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-light",children:[e.jsx(M,{className:"w-2 h-2",sweep:!1}),e.jsx(w,{width:t.name,textClassName:"text-xs"})]}),e.jsx(w,{width:4,textClassName:"text-[11px] font-mono"})]}),e.jsx("div",{className:"h-1 rounded-full bg-border overflow-hidden",children:e.jsx(D,{tone:"violet",className:"h-full rounded-full",style:{width:t.bar}})})]},s))]}),e.jsx(w,{width:"56%",textClassName:"text-[11px] font-light"})]})}function gn({stats:t}){var s;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"border border-border rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx(ra,{className:"size-3 text-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] font-light text-muted-foreground/50",children:"This week"})]}),e.jsx("p",{className:"text-lg font-light text-foreground",children:t.human_readable_total_including_other_language})]}),e.jsxs("div",{className:"border border-border rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx(ia,{className:"size-3 text-muted-foreground/40"}),e.jsx("span",{className:"text-[10px] font-light text-muted-foreground/50",children:"Daily avg"})]}),e.jsx("p",{className:"text-lg font-light text-foreground",children:t.human_readable_daily_average_including_other_language})]})]}),(((s=t.languages)==null?void 0:s.length)??0)>0&&e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("p",{className:"text-[10px] font-light tracking-[0.15em] uppercase text-muted-foreground/40",children:"Top Languages"}),t.languages.slice(0,5).map(a=>e.jsx(pn,{name:a.name,percent:a.percent,color:vt[a.name]??vt.Other},a.name))]}),t.best_day&&e.jsxs("p",{className:"text-[11px] font-light text-muted-foreground/40",children:["Best day: ",t.best_day.text," on ",new Date(t.best_day.date).toLocaleDateString("en",{month:"short",day:"numeric"})]})]})}function bn(){const[t,s]=m.useState(0);return e.jsx(jn,{onRetry:()=>s(a=>a+1)},t)}function jn({onRetry:t}){var d,u;const{stats:s,loading:a,error:n}=Dt(),r=m.useRef(null),i=J(r,{once:!0,margin:"-60px"}),l=s?s.status==="error":!!n,o=!!s&&!l&&(((d=s.languages)==null?void 0:d.length)??0)===0&&!s.best_day,c=!!((u=s==null?void 0:s.best_day)!=null&&u.date)&&s.best_day.date===new Date().toISOString().slice(0,10);return e.jsxs(b.div,{ref:r,initial:{opacity:0,y:20},animate:i?{opacity:1,y:0}:{},transition:{duration:.7,ease:[.22,1,.36,1]},className:"border border-border rounded-2xl p-5 space-y-4 bg-background/50 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"p-1.5 rounded-lg border border-border",children:e.jsx(et,{className:"size-3.5 text-muted-foreground/60"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-light tracking-[0.15em] uppercase text-muted-foreground/50",children:"Live Activity"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-light text-foreground/80",children:"Coding Stats"}),c&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-light text-green-400/90",children:[e.jsxs("span",{className:"relative flex size-1.5",children:[e.jsx("span",{className:"animate-ping absolute inset-0 rounded-full bg-green-400 opacity-75"}),e.jsx("span",{className:"relative rounded-full size-1.5 bg-green-500"})]}),"Active Today"]})]})]})]}),e.jsx("a",{href:"https://wakatime.com",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-light text-muted-foreground/40 hover:text-muted-foreground/60 transition-colors",children:"via WakaTime"})]}),e.jsx(B,{label:"coding stats",loading:a&&!s,error:l,empty:o,onRetry:t,skeleton:e.jsx(fn,{}),emptyFallback:e.jsx(Q,{title:"A quiet week so far",message:"WakaTime has no coding logged for the last 7 days yet."}),children:()=>e.jsx(gn,{stats:s})})]})}const yt="codetime-cache-v3";function Nt(t){return Js(t)&&typeof t.totalTime=="string"&&Array.isArray(t.languages)}const vn=36e5;function yn(){const[t,s]=m.useState(null),[a,n]=m.useState(!0),[r,i]=m.useState(null);return m.useEffect(()=>{try{const o=localStorage.getItem(yt);if(o){const c=JSON.parse(o);if(Nt(c==null?void 0:c.data)&&typeof c.ts=="number"&&Date.now()-c.ts<vn){s(c.data),n(!1);return}}}catch{}const l=new AbortController;return ke("/api/codetime",{signal:l.signal}).then(o=>o.ok?o.json():Promise.reject(o.status)).then(o=>{if(!l.signal.aborted){if(!Nt(o))throw new Error("unexpected CodeTime shape");s(o);try{localStorage.setItem(yt,JSON.stringify({data:o,ts:Date.now()}))}catch{}}}).catch(o=>{(o==null?void 0:o.name)==="AbortError"&&l.signal.aborted||i("Could not load CodeTime stats")}).finally(()=>{l.signal.aborted||n(!1)}),()=>{l.abort()}},[]),{stats:t,loading:a,error:r}}const wt={TypeScript:"#2b7489",JavaScript:"#f1e05a",Python:"#3572a5",Markdown:"#083fa1",SQL:"#e38c00","github-actions-workflow":"#2088ff",HTML:"#e34c26",CSS:"#563d7c",Go:"#00add8",Rust:"#dea584",Shell:"#89e051",YAML:"#cb171e",HCL:"#844fba",Dockerfile:"#384d54",Other:"#8e8e8e"};function ze({icon:t,label:s,value:a}){return e.jsxs("div",{className:"flex flex-col gap-1 p-2.5 sm:p-3 rounded-xl border border-border bg-background/30",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(t,{className:"size-3 text-muted-foreground
24/40 flex-shrink-0"}),e.jsx("span",{className:"text-[9px] sm:text-[10px] font-light tracking-[0.12em] uppercase text-muted-foreground/50 truncate",children:s})]}),e.jsx("p",{className:"text-sm font-light text-foreground tabular-nums leading-tight",children:a??e.jsx("span",{className:"text-muted-foreground/40",children:"n/a"})})]})}function Nn({lang:t,maxSeconds:s,index:a}){const n=m.useRef(null),r=J(n,{once:!0}),i=s>0?t.seconds/s*100:0,l=wt[t.name]??wt.Other,o=Math.floor(t.seconds/3600),c=Math.floor(t.seconds%3600/60),d=o>0?`${o}h${c>0?` ${c}m`:""}`:`${c}m`;return e.jsxs("div",{ref:n,className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-light text-foreground/70 min-w-0",children:[e.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:l}}),e.jsx("span",{className:"truncate",children:t.name})]}),e.jsx("span",{className:"text-[11px] font-mono text-muted-foreground/50 ml-2 flex-shrink-0",children:d})]}),e.jsx("div",{className:"h-1 rounded-full bg-border overflow-hidden",children:e.jsx(b.div,{className:"h-full rounded-full",style:{backgroundColor:l},initial:{width:0},animate:{width:r?`${i}%`:0},transition:{duration:.9,ease:[.22,1,.36,1],delay:.15+a*.07}})})]})}const wn=[{name:10,bar:100},{name:8,bar:64},{name:6,bar:41},{name:9,bar:26},{name:5,bar:14}];function kn(){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(w,{width:9,tone:"violet",textClassName:"text-2xl md:text-3xl tracking-tight leading-none"}),e.jsx(w,{width:22,textClassName:"text-[10px] mt-1"})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[5,6,4].map((t,s)=>e.jsxs("div",{className:"flex flex-col gap-1 p-2.5 sm:p-3 rounded-xl border border-border bg-background/30",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(M,{className:"size-3"}),e.jsx(w,{width:t,textClassName:"text-[9px] sm:text-[10px] tracking-[0.12em] uppercase"})]}),e.jsx(w,{width:4,textClassName:"text-sm leading-tight"})]},s))}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx(w,{width:18,textClassName:"text-[10px] tracking-[0.15em] uppercase"}),wn.map((t,s)=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(M,{className:"size-2",tone:s===0?"cyan":"neutral"}),e.jsx(w,{width:t.name,textClassName:"text-xs"})]}),e.jsx(w,{width:5,textClassName:"text-[11px] font-mono ml-2 shrink-0"})]}),e.jsx("div",{className:"h-1 rounded-full bg-border overflow-hidden",children:e.jsx(D,{tone:s===0?"cyan":"violet",className:"h-full rounded-full",style:{width:`${t.bar}%`}})})]},s))]})]})}function Cn(){var l,o;const{stats:t,loading:s,error:a}=yn(),n=m.useRef(null),r=J(n,{once:!0,margin:"-60px"}),i=((o=(l=t==null?void 0:t.languages)==null?void 0:l[0])==null?void 0:o.seconds)??1;return e.jsxs(b.div,{ref:n,initial:{opacity:0,y:20},animate:r?{opacity:1,y:0}:{},transition:{duration:.7,ease:[.22,1,.36,1],delay:.1},className:"border border-border rounded-2xl p-5 space-y-4 bg-background/50 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"p-1.5 rounded-lg border border-border",children:e.jsx(oa,{className:"size-3.5 text-muted-foreground/60"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-light tracking-[0.15em] uppercase text-muted-foreground/50",children:"All-Time Activity"}),e.jsx("p",{className:"text-sm font-light text-foreground/80",children:"Total Coding Time"})]})]}),e.jsx("a",{href:"https://codetime.dev",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-light text-muted-foreground/40 hover:text-muted-foreground/60 transition-colors",children:"via CodeTime"})]}),e.jsx(B,{label:"coding time",loading:s&&!t,error:!t&&a,errorFallback:e.jsx(pe,{title:"CodeTime did not answer",message:"The all-time total comes back on the next visit. WakaTime's numbers sit beside this card."}),empty:!t,emptyFallback:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-light text-foreground
24/80",children:"No coding time tracked yet"}),e.jsx("p",{className:"mt-1 text-[11px] font-light text-muted-foreground",children:"The total appears after the first tracked session."})]}),skeleton:e.jsx(kn,{}),children:()=>{var c;return t&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl md:text-3xl font-light text-foreground tracking-tight leading-none",children:t.totalTime}),e.jsx("p",{className:"text-[10px] text-muted-foreground/40 font-light mt-1",children:"total coding time tracked"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(ze,{icon:la,label:"Today",value:t.todayTime}),e.jsx(ze,{icon:ca,label:"Streak",value:t.streakCurrent!=null?`${t.streakCurrent}d`:null}),e.jsx(ze,{icon:da,label:"Best",value:t.streakBest!=null?`${t.streakBest}d`:null})]}),(((c=t.languages)==null?void 0:c.length)??0)>0&&e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("p",{className:"text-[10px] font-light tracking-[0.15em] uppercase text-muted-foreground/40",children:"Top Languages (30d)"}),t.languages.slice(0,5).map((d,u)=>e.jsx(Nn,{lang:d,maxSeconds:i,index:u},d.name))]})]})}})]})}const qe="SubhanshuMG",kt="github_pulse_v7",Cs=5*60*1e3,Sn={commit:$t,pr:tt,star:Ce,fork:It,branch:ma,issue:ua};function Ss(t){const s=Date.now()-new Date(t).getTime(),a=Math.floor(s/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;const n=Math.floor(a/60);if(n<24)return`${n}h ago`;const r=Math.floor(n/24);return r<7?`${r}d ago`:`${Math.floor(r/7)}w ago`}function Tn(t){const s=!t.public,a=t.repo.name.split("/")[1],n=s?`https://github.com/${qe}`:`https://github.com/${t.repo.name}`,r=Ss(t.created_at);switch(t.type){case"PushEvent":{const i=t.payload.commits??[],l=i.length||1,o=s?[]:i.map(c=>({sha:(c.sha??"").slice(0,7),message:(c.message??"").split(` 25`)[0].slice(0,72),url:`https://github.com/${t.repo.name}/commit/${c.sha}`}));return{id:t.id,iconType:"commit",color:"text-blue-400",label:`Pushed ${l} commit${l>1?"s":""} to`,repo:a,repoUrl:n,time:r,isPrivate:s,commits:l,commitMeta:o.length?o:void 0}}case"PullRequestEvent":{const i=t.payload.pull_request,l=t.payload.action,o=i==null?void 0:i.merged;return{id:t.id,iconType:"pr",color:o?"text-purple-400":"text-emerald-400",label:o?"Merged PR in":l==="opened"?"Opened PR in":`${l} PR in`,repo:a,repoUrl:n,time:r,isPrivate:s}}case"WatchEvent":return{id:t.id,iconType:"star",color:"text-yellow-400",label:"Starred",repo:a,repoUrl:n,time:r,isPrivate:s};case"ForkEvent":return{id:t.id,iconType:"fork",color:"text-indigo-400",label:"Forked",repo:a,repoUrl:n,time:r,isPrivate:s};case"CreateEvent":{const i=t.payload.ref_type;return{id:t.id,iconType:"branch",color:"text-cyan-400",label:i==="repository"?"Created repo":`Created ${i} in`,repo:a,repoUrl:n,time:r,isPrivate:s}}case"IssuesEvent":{const i=t.payload.action;return{id:t.id,iconType:"issue",color:i==="closed"?"text-purple-400":"text-orange-400",label:i==="opened"?"Opened issue in":"Closed issue in",repo:a,repoUrl:n,time:r,isPrivate:s}}default:return null}}function Rn(t){var n;const s=[];let a=0;for(;a<t.length;){const r=t[a];if(r.iconType!=="commit"){s.push(r),a++;continue}if(r.isPrivate){const l=[r];for(;a+l.length<t.length&&t[a+l.length].iconType==="commit"&&t[a+l.length].isPrivate;)l.push(t[a+l.length]);const o=l.reduce((c,d)=>c+(d.commits??1),0);s.push({...r,commits:o}),a+=l.length;continue}const i=[r];for(;a+i.length<t.length&&t[a+i.length].iconType==="commit"&&!t[a+i.length].isPrivate&&t[a+i.length].repo===r.repo;)i.push(t[a+i.length]);if(i.length===1){const l={...r};(((n=r.commitMeta)==null?void 0:n.length)??0)>=2&&(l.allCommitMeta=r.commitMeta),s.push(l)}else{const l=i.reduce((c,d)=>c+(d.commits??1),0),o=i.flatMap(c=>c.commitMeta??[]);s.push({...r,label:`Pushed ${l} commit${l>1?"s":""} to`,commits:l,allCommitMeta:o.length?o:void 0})}a+=i.length}return s}function An(t){var a;if(!(t!=null&&t.starred_at)||!((a=t.repo)!=null&&a.name))return null;const s=t.repo.name.split("/")[1]??t.repo.name;return{id:`star:${t.repo.name}:${t.starred_at}`,iconType:"star",color:"text-yellow-400",label:"Starred",repo:s,repoUrl:t.repo.html_url,time:Ss(t.starred_at),isPrivate:!1}}async function _n(){try{const x=localStorage.getItem(kt);if(x){const{data:y,ts:f}=JSON.parse(x);if(Date.now()-f<Cs)return y}}catch{}const[t,s]=await Promise.all([ke(`/api/live?type=github&sub=events&username=${qe}&page=1`),ke(`/api/live?type=github&sub=recent-stars&username=${qe}`)]);if(!t.ok&&!s.ok)throw new Error(`GitHub activity: HTTP ${t.status}`);const a=t.ok?await t.json().catch(()=>null):null,n=s.ok?await s.json().catch(()=>null):null,r=Array.isArray(a)?a.filter(x=>x&&typeof x=="object"):[],i=Array.isArray(n)?n.filter(x=>x&&typeof x=="object"):[],l=r.map(Tn).filter(x=>x!==null),o=i.map(An).filter(x=>x!==null),c=new Set(o.map(x=>x.repo)),d=new Map;for(const x of r)d.set(x.id,new Date(x.created_at).getTime());const u=[...o.map(x=>({item:x,ts:new Date(x.id.split(":").slice(2).join(":")).getTime()})),...l.filter(x=>!(x.iconType==="star"&&c.has(x.repo))).map(x=>({item:x,ts:d.get(x.id)??0}))];u.sort((x,y)=>y.ts-x.ts);const h=u.map(x=>x.item).slice(0,20);try{localStorage.setItem(kt,JSON.stringify({data:h,ts:Date.now()}))}catch{}return h}function En({row:t,idx:s,inView:a}){var o;const[n,r]=m.useState(!1),i=Sn[t.iconType]??$t,l=(((o=t.allCommitMeta)==null?void 0:o.length)??0)>0;return e.jsx(b.li,{initial:{opacity:0,x:-6},animate:a?{opacity:1,x:0}:{},transition:{duration:.35,delay:s*.06,ease:[.22,1,.36,1]},children:t.isPrivate?e.jsxs("div",{className:"flex items-center gap-2 text-[12px] font-light",children:[e.jsx(G,{className:"size-3 shrink-0 text-muted-foreground
25/40"}),e.jsx("span",{className:"text-muted-foreground/50 truncate",children:t.commits?`${t.commits} commit${t.commits>1?"s":""} in private repository`:`${t.label.split(" to")[0]} in private repository`}),e.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-muted-foreground/25 tabular-nums",children:t.time})]}):l?e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>r(c=>!c),className:"w-full flex items-center gap-2 text-[12px] font-light hover:opacity-75 transition-opacity text-left",children:[e.jsx(i,{className:`size-3 shrink-0 ${t.color}`}),e.jsxs("span",{className:"text-muted-foreground/65 min-w-0 truncate",children:[t.label,"Â ",e.jsx("span",{className:"text-foreground/75",children:t.repo})]}),e.jsxs("span",{className:"ml-auto shrink-0 flex items-center gap-1 text-[10px] text-muted-foreground/35 tabular-nums",children:[t.time,e.jsx(ge,{className:`size-2.5 transition-transform duration-200 ${n?"rotate-180":""}`})]})]}),e.jsx(K,{initial:!1,children:n&&e.jsx(b.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22,ease:[.4,0,.2,1]},className:"overflow-hidden",children:e.jsx("ul",{className:"ml-4 mt-1.5 mb-0.5 space-y-1 border-l border-border/40 pl-3",children:t.allCommitMeta.map(c=>e.jsx("li",{children:e.jsxs("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-baseline gap-2 text-[11px] font-light hover:opacity-75 transition-opacity",children:[e.jsx("code",{className:"shrink-0 text-[10px] text-muted-foreground/40 font-mono",children:c.sha}),e.jsx("span",{className:"text-muted-foreground/55 min-w-0 truncate",children:c.message})]})},c.sha))})},"expanded")})]}):e.jsxs("a",{href:t.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-[12px] font-light hover:opacity-75 transition-opacity",children:[e.jsx(i,{className:`size-3 shrink-0 ${t.color}`}),e.jsxs("span",{className:"text-muted-foreground/65 min-w-0 truncate",children:[t.label,"Â ",e.jsx("span",{className:"text-foreground/75",children:t.repo})]}),e.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-muted-foreground/35 tabular-nums",children:t.time})]})})}const Ln=3,Pn=fe(Ln,21,46,82);function Ts(){return e.jsx("ul",{className:"space-y-1.5","aria-hidden":"true",children:Pn.map((t,s)=>e.jsxs("li",{className:"flex items-center gap-2 text-[12px] font-light",children:[e.jsx(D,{tone:s%3===1?"violet":"cyan",className:"size-3 shrink-0 rounded-sm"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(w,{width:t,textClassName:"text-[12px]"})}),e.jsx(w,{width:4.5,textClassName:"shrink-0 text-[10px]"})]},s))})}function Mn(){return e.jsxs("div",{className:"space-y-2.5","aria-hidden":"true",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(D,{tone:"emerald",className:"size-1.5 rounded-full"}),e.jsx(w,{width:14,textClassName:"text-[10px] tracking-[0.15em] uppercase"})]}),e.jsx(Ts,{})]})}function Dn(){const t=m.useRef(null),s=J(t,{once:!0,margin:"-60px"}),[a,n]=m.useState([]),[r,i]=m.useState(!0),[l,o]=m.useState(null),[c,d]=m.useState(0);m.useEffect(()=>{let h=!0;const x=f=>_n().then(p=>{h&&(n(p),o(null))}).catch(p=>{h&&f&&o(p)}).finally(()=>{h&&f&&i(!1)});i(!0),x(!0);const y=setInterval(()=>x(!1),Cs);return()=>{h=!1,clearInterval(y)}},[c]);const u=Rn(a).slice(0,6);return e.jsxs("div",{ref:t,className:"space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"relative flex size-1.5",children:[e.jsx("span",{className:"absolute inline-flex size-full rounded-full bg-green-400 opacity-75 animate-ping"}),e.jsx("span",{className:"relative inline-flex size-1.5 rounded-full bg-green-400"})]}),e.jsx("p",{className:"text-[10px] font-light tracking-[0.15em] uppercase text-muted-foreground/50",children:"GitHub Activity"})]}),e.jsx(B,{label:"GitHub activity",loading:r&&u.length===0,error:u.length===0&&l,empty:u.length===0,onRetry:()=>d(h=>h+1),fallbackShape:"none",emptyFallback:e.jsx(Q,{title:"No recent public activity",message:"Pushes, pull requests and stars show up here within a few minutes.",className:"py-3"}),skeleton:e.jsx(Ts,{}),children:()=>e.jsx("ul",{className:"space-y-1.5",children:u.map((h,x)=>e.jsx(En,{row:h,idx:x,inView:s},h.id))})})]})}const R=[.4,0,.2,1],Re={TypeScript:"#3178c6",JavaScript:"#f1e05a",Python:"#3572A5",HCL:"#844FBA",Shell:"#89e051",Dockerfile:"#384d54",Java:"#b07219",HTML:"#e34c26",CSS:"#563d7c",Go:"#00ADD8",Rust:"#dea584",EJS:"#a91e50"},In=[];function X(t){return Array.isArray(t)?t:In}function se(t){return typeof t=="number"&&Number.isFinite(t)?t:0}function $n(t){if(!t||typeof t!="object")return null;const s=t.contributionCalendar;return!s||typeof s!="object"?null:Array.isArray(s.weeks)&&typeof s.totalContributions=="number"&&Array.isArray(t.commitContributionsByRepository)&&Array.isArray(t.pullRequestContributionsByRepository)&&Array.isArray(t.issueContributionsByRepository)&&typeof t.totalCommitContributions=="number"&&typeof t.totalIssueContributions=="number"&&typeof t.totalPullRequestContributions=="number"&&typeof t.totalPullRequestReviewContributions=="number"&&typeof t.restrictedContributionsCount=="number"?t:{...t,contributionCalendar:{...s,weeks:X(s.weeks),totalContributions:se(s.totalContributions)},commitContributionsByRepository:X(t.commitContributionsByRepository),pullRequestContributionsByRepository:X(t.pullRequestContributionsByRepository),issueC
25ontributionsByRepository:X(t.issueContributionsByRepository),totalCommitContributions:se(t.totalCommitContributions),totalIssueContributions:se(t.totalIssueContributions),totalPullRequestContributions:se(t.totalPullRequestContributions),totalPullRequestReviewContributions:se(t.totalPullRequestReviewContributions),restrictedContributionsCount:se(t.restrictedContributionsCount)}}const zn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ze(t){return t===0?"var(--contrib-0)":t<=3?"var(--contrib-1)":t<=6?"var(--contrib-2)":t<=9?"var(--contrib-3)":"var(--contrib-4)"}const On={hidden:{opacity:0,scaleY:.5},show:{opacity:1,scaleY:1,transition:{duration:.28,ease:[.4,0,.2,1]}}};function Fn({weeks:t,animKey:s,privateAdditions:a}){const n=m.useRef(null),r=J(n,{once:!0,margin:"-60px"});if(!t.length)return null;const i=t.length,l=i*14+36,o=t.map((u,h)=>{var N;const x=u.contributionDays[0];if(!(x!=null&&x.date))return null;const y=new Date(x.date+"T12:00:00").getMonth(),f=h>0?(N=t[h-1].contributionDays[0])==null?void 0:N.date:null,p=f?new Date(f+"T12:00:00").getMonth():-1;return y!==p?zn[y]:null}),c=["","Mon","","Wed","","Fri",""],d=`repeat(${i}, minmax(0, 1fr))`;return e.jsx("div",{ref:n,className:"overflow-x-auto heatmap-scroll w-full",children:e.jsxs("div",{className:"rounded-xl border border-border/50 bg-background/80 backdrop-blur-sm p-3 md:p-4",style:{minWidth:`${l}px`},children:[e.jsxs("div",{className:"flex mb-1.5",style:{gap:"2px"},children:[e.jsx("div",{className:"shrink-0",style:{width:28}}),e.jsx("div",{className:"flex-1 grid text-[10px] text-muted-foreground/60 font-light select-none",style:{gridTemplateColumns:d,gap:"2px"},children:o.map((u,h)=>e.jsx("div",{className:"overflow-visible whitespace-nowrap",children:u??""},h))})]}),e.jsxs("div",{className:"flex",style:{gap:"2px"},children:[e.jsx("div",{className:"shrink-0 flex flex-col text-[10px] text-muted-foreground/60 font-light select-none",style:{width:28,gap:"2px"},children:c.map((u,h)=>e.jsx("div",{className:"flex-1 flex items-center justify-end",style:{paddingRight:4,minHeight:0},children:u},h))}),e.jsx(b.div,{className:"flex-1 grid",style:{gridTemplateColumns:d,gap:"2px"},variants:{hidden:{},show:{transition:{staggerChildren:.006}}},initial:"hidden",animate:r?"show":"hidden",children:t.map((u,h)=>e.jsx(b.div,{variants:On,className:"flex flex-col",style:{gap:"2px",transformOrigin:"top"},children:Array.from({length:7}).map((x,y)=>{const f=u.contributionDays[y];return e.jsx("div",{className:"heatmap-cell w-full rounded-[2px]",style:{aspectRatio:"1",backgroundColor:f?Ze(f.contributionCount):"var(--contrib-0)"},title:f!=null&&f.date?(()=>{const p=(a==null?void 0:a.get(f.date))??0,N=f.contributionCount;return p>0&&N>0?`${f.date}: ~${N} contributions (incl. ~${p} private)`:`${f.date}: ${N} contribution${N!==1?"s":""}`})():""},y)})},h))},s)]}),e.jsxs("div",{className:"flex items-center justify-between mt-3 flex-wrap gap-2",children:[a&&a.size>0?e.jsxs("span",{className:"text-[10px] text-muted-foreground/45 font-light flex items-center gap-1 select-none",children:[e.jsx(G,{className:"size-2.5 inline"})," Includes estimated private contributions"]}):e.jsx("span",{}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground/50 font-light select-none",children:"Less"}),[0,2,5,8,12].map(u=>e.jsx("div",{className:"rounded-[2px]",style:{width:11,height:11,backgroundColor:Ze(u)}},u)),e.jsx("span",{className:"text-[10px] text-muted-foreground/50 font-light select-none",children:"More"})]})]})]})})}function Gn({commits:t,reviews:s,issues:a,prs:n}){const r=t+s+a+n;if(r===0)return null;const i=t/r,l=s/r,o=a/r,c=n/r,d=58,u=180,h=180,x=u/2,y=h/2,f="#4ade80";return e.jsxs("div",{className:"flex flex-col items-center gap-0.5 select-none w-full",children:[e.jsxs("div",{className:"text-[11px] text-muted-foreground text-center",children:[e.jsxs("span",{className:"text-foreground font-normal",children:[Math.round(l*100),"%"]})," Code review"]}),e.jsxs("div",{className:"flex items-center gap-0.5 justify-center",children:[e.jsxs("div",{className:"text-[11px] text-muted-foreground text-right",style:{minWidth:68}
25,children:[e.jsxs("span",{className:"text-foreground font-normal",children:[Math.round(i*100),"%"]})," Commits"]}),e.jsxs("svg",{width:u,height:h,viewBox:`0 0 ${u} ${h}`,className:"overflow-visible shrink-0",children:[e.jsx("line",{x1:0,y1:y,x2:u,y2:y,stroke:"currentColor",strokeOpacity:"0.12",strokeWidth:"1"}),e.jsx("line",{x1:x,y1:0,x2:x,y2:h,stroke:"currentColor",strokeOpacity:"0.12",strokeWidth:"1"}),e.jsx("line",{x1:x,y1:y,x2:x-i*d,y2:y,stroke:f,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:x,y1:y,x2:x,y2:y-l*d,stroke:f,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:x,y1:y,x2:x+o*d,y2:y,stroke:f,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("line",{x1:x,y1:y,x2:x,y2:y+c*d,stroke:f,strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("circle",{cx:x,cy:y,r:5,fill:f})]}),e.jsxs("div",{className:"text-[11px] text-muted-foreground",style:{minWidth:52},children:[e.jsxs("span",{className:"text-foreground font-normal",children:[Math.round(o*100),"%"]})," Issues"]})]}),e.jsxs("div",{className:"text-[11px] text-muted-foreground text-center",children:[e.jsxs("span",{className:"text-foreground font-normal",children:[Math.round(c*100),"%"]})," Pull requests"]})]})}function Wn({data:t}){const s=t.commitContributionsByRepository;if(!s.length)return null;const a=Math.max(...s.map(n=>n.contributions.totalCount),1);return e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground font-light",children:"Contributed to"}),e.jsx("div",{className:"space-y-2",children:s.slice(0,8).map(({repository:n,contributions:r})=>{var d,u;const i=n.isPrivate,l=i?"#6b7280":((d=n.primaryLanguage)==null?void 0:d.color)??Re[((u=n.primaryLanguage)==null?void 0:u.name)??""]??"#4ade80",o=r.totalCount/a*100,c=n.nameWithOwner.split("/")[1]||n.nameWithOwner;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[i?e.jsxs("span",{className:"text-xs font-light text-muted-foreground/40 flex items-center gap-1.5 truncate flex-1",children:[e.jsx(G,{className:"size-3 shrink-0"})," private repository"]}):e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-light text-primary/80 hover:text-primary truncate hover:underline flex-1",children:c}),e.jsxs("span",{className:"text-[11px] text-muted-foreground/60 shrink-0",children:[r.totalCount,"c"]})]}),e.jsx("div",{className:"h-1.5 rounded-full bg-background/70 backdrop-blur-sm0 overflow-hidden",children:e.jsx(b.div,{className:"h-full rounded-full",style:{backgroundColor:l},initial:{width:0},whileInView:{width:`${o}%`},viewport:{once:!0},transition:{duration:.7,ease:R}})})]},n.nameWithOwner)})})]})}function Bn(t,s){const a=new Date(t+"T12:00:00"),n=new Date(s+"T12:00:00"),r={month:"short",day:"numeric"},i=a.toLocaleString("en-US",r),l=n.toLocaleString("en-US",r);return i===l?i:`${i} â ${l}`}function Hn({group:t,calendarTotal:s,dateRange:a,defaultOpen:n=!1,monthlyLoading:r=!1}){const[i,l]=m.useState(n),o=Pt(r,180,{minVisible:360}),c=t.commits.find(p=>p.isPrivate),d=t.commits.filter(p=>!p.isPrivate),u=Math.max(...d.map(p=>p.count),1),h=d.length>0||t.creates.length>0||t.prs.length>0,x=h||!!c,y=d.reduce((p,N)=>p+N.count,0),f=[y>0&&`${y} commit${y!==1?"s":""}`,t.creates.length>0&&`${t.creates.length} repo${t.creates.length!==1?"s":""} created`,t.prs.length>0&&`${t.prs.length} PR${t.prs.length!==1?"s":""}`,c&&!h&&s?`${s} contributions`:null,!x&&s?`${s} contributions`:null].filter(Boolean).join(" · ");return e.jsxs("div",{className:"relative pl-7",children:[e.jsx("div",{className:"absolute left-2.5 top-0 bottom-0 w-px bg-border/50"}),e.jsx("div",{className:"absolute left-0.5 top-2 size-4 rounded-full bg-muted border border-border flex items-center justify-center",children:e.jsx(b.div,{className:"size-1.5 rounded-full bg-muted-foreground/50",animate:i?{scale:1.3,backgroundColor:"hsl(var(--foreground) / 0.7)"}:{scale:1},transition:{duration:.2}})}),e.jsxs("div",{className:"pb-5",children:[e.jsxs("button",{onClick:()=>l(p=>!p),className:"w-full flex items-center justify-between gap-3 pt-0.5 pb-2 text-left group/hdr",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("p",{className:"text-sm font-light text-foreground",children:t.label}),f&&e.jsxs("span",{className:"text-[11px] text-muted-foreground
25/60 font-light truncate hidden sm:block",children:["· ",f]})]}),e.jsx(b.div,{animate:{rotate:i?180:0},transition:{duration:.2},children:e.jsx(ge,{className:"size-3.5 text-muted-foreground/50 shrink-0 group-hover/hdr:text-muted-foreground transition-colors"})})]}),e.jsx(K,{initial:!1,children:i&&e.jsx(b.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.28,ease:[.4,0,.2,1]},style:{overflow:"hidden"},children:e.jsxs("div",{className:"space-y-2 pb-1",children:[c&&e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 rounded-lg border border-border/60 bg-background/70 backdrop-blur-sm w-full",children:[e.jsx(G,{className:"size-3.5 text-muted-foreground/60 shrink-0"}),e.jsxs("span",{className:"text-sm font-light text-muted-foreground flex-1",children:[d.length===0?s??c.count:c.count," ",d.length===0?"contributions":"commits"," in private repositories"]}),a&&e.jsx("span",{className:"text-xs text-muted-foreground/45 font-light shrink-0",children:Bn(a.first,a.last)})]}),d.length>0&&e.jsx(he,{icon:Gt,header:e.jsxs(e.Fragment,{children:[d.reduce((p,N)=>p+N.count,0)," commit",d.reduce((p,N)=>p+N.count,0)!==1?"s":""," in ",d.length," ",d.length===1?"repository":"repositories"]}),children:e.jsx("div",{className:"space-y-2 pt-1.5",children:d.map(p=>e.jsxs("div",{className:"flex items-center gap-2",children:[p.isPrivate?e.jsxs("span",{className:"text-xs font-light text-muted-foreground/40 flex items-center gap-1.5 truncate flex-1",children:[e.jsx(G,{className:"size-3 shrink-0"})," private repository"]}):e.jsx("a",{href:p.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-light text-primary/80 hover:text-primary hover:underline truncate flex-1",children:p.repoName.split("/")[1]||p.repoName}),e.jsxs("span",{className:"text-[11px] text-muted-foreground/60 shrink-0",children:[p.count,"c"]}),e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-background/70 backdrop-blur-sm0 overflow-hidden shrink-0",children:e.jsx(b.div,{className:"h-full rounded-full",style:{backgroundColor:p.isPrivate?"#6b7280":p.langColor},initial:{width:0},animate:{width:`${p.count/u*100}%`},transition:{duration:.5,ease:R}})})]},p.repoName))})}),t.creates.length>0&&e.jsx(he,{icon:va,header:e.jsxs(e.Fragment,{children:["Created ",t.creates.length," ",t.creates.length===1?"repository":"repositories"]}),children:e.jsx("div",{className:"space-y-1.5 pt-1.5",children:t.creates.map(p=>e.jsxs("a",{href:p.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-xs text-primary/80 hover:text-primary hover:underline",children:[e.jsx("span",{className:"size-2 rounded-full shrink-0",style:{backgroundColor:p.langColor}}),p.repoName.split("/")[1]||p.repoName,e.jsx("span",{className:"text-muted-foreground/50 ml-auto shrink-0",children:new Date(p.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},p.repoName))})}),t.prs.length>0&&e.jsx(he,{icon:tt,header:e.jsxs(e.Fragment,{children:["Pull requests in ",t.prs.length," ",t.prs.length===1?"repository":"repositories"]}),children:e.jsx("div",{className:"space-y-1.5 pt-1.5",children:t.prs.map(p=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:p.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary/80 hover:text-primary hover:underline flex-1 truncate",children:p.repoName.split("/")[1]||p.repoName}),e.jsx("span",{className:A("text-[10px] px-1.5 py-0.5 rounded-full font-light",p.status==="merged"?"bg-violet-500/15 text-violet-400":p.status==="closed"?"bg-red-500/15 text-red-400":"bg-green-500/15 text-green-400"),children:p.status})]},p.repoName))})}),!x&&(r?e.jsx(Et,{label:`commit data for ${t.label}`,children:e.jsx("div",{className:"transition-opacity duration-300 ease-out",style:{opacity:o?1:0},children:e.jsx(Ms,{seed:t.label.length,rows:2})})}):s!==void 0&&s>0?e.jsxs("p",{className:"text-xs text-muted-foreground/60 font-light pl-1",children:[s," contributions"]}):null)]})})})]})]})}function Un({data:t,repos:s}){const a=m.useMemo(()=>{var i;if((i=t==null?void 0:t.commitContributionsByRepository)!=null&&i.length){const l={};for(const{repository:c}of t.commitContributionsByRepository){const d=c.primaryLanguage;d!=null&&d.name&&(l[d.name]||(l[d.name]={count:0,color:d.color}),l[d.name].count++)}const o=Object.values(l).reduce((c,d)=>c+d.count,0)||1;return Object.entries(l).sort(([,c],[,d])=>d.count-c.count).slice(0,6).map(([c,{count:d,color:u}])=>
25({lang:c,count:d,color:u,percent:Math.round(d/o*100)}))}const n={};s.forEach(l=>{l.language&&(n[l.language]=(n[l.language]||0)+1)});const r=Object.values(n).reduce((l,o)=>l+o,0)||1;return Object.entries(n).sort(([,l],[,o])=>o-l).slice(0,6).map(([l,o])=>({lang:l,count:o,color:Re[l]||"#8b8b8b",percent:Math.round(o/r*100)}))},[t,s]);return a.length?e.jsxs(b.div,{className:"space-y-3 border-t border-border pt-5",initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.5,delay:.4,ease:R},children:[e.jsxs("h4",{className:"text-xs font-light tracking-wide text-muted-foreground flex items-center gap-2 uppercase",children:[e.jsx(et,{className:"size-3.5"})," Top Languages"]}),e.jsx("div",{className:"flex h-2.5 rounded-full overflow-hidden bg-background/70 backdrop-blur-sm0",children:a.map((n,r)=>e.jsx(b.div,{className:"h-full",style:{backgroundColor:n.color},initial:{width:0},animate:{width:`${n.percent}%`},transition:{duration:.8,delay:.15+r*.06,ease:R}},n.lang))}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5",children:a.map(n=>e.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-light text-muted-foreground",children:[e.jsx("span",{className:"size-2.5 rounded-full",style:{backgroundColor:n.color}}),n.lang," ",e.jsxs("span",{className:"text-muted-foreground/50",children:[n.percent,"%"]})]},n.lang))})]}):null}const te=new Date().getFullYear(),Rs=Array.from({length:te-2018},(t,s)=>te-s);function Vn(t,s){if(!t.length)return t;const a=new Date,n=new Date(s,11,31,23,59,59);if(n<=a)return t;let r=null;for(let c=t.length-1;c>=0&&!r;c--){const d=t[c].contributionDays;for(let u=d.length-1;u>=0;u--)if(d[u].date){r=new Date(d[u].date+"T12:00:00");break}}if(!r||r>=n)return t;const i=t.map(c=>({...c,contributionDays:[...c.contributionDays]})),l=i[i.length-1];let o=new Date(r);for(;l.contributionDays.length<7&&o<n;)o=new Date(o),o.setDate(o.getDate()+1),l.contributionDays.push({date:o.toISOString().split("T")[0],contributionCount:0,color:"#ebedf0"});for(o=new Date(l.contributionDays[l.contributionDays.length-1].date+"T12:00:00"),o.setDate(o.getDate()+1);o<=n;){const c={contributionDays:[]};for(let d=0;d<7&&o<=n;d++)c.contributionDays.push({date:o.toISOString().split("T")[0],contributionCount:0,color:"#ebedf0"}),o=new Date(o),o.setDate(o.getDate()+1);c.contributionDays.length>0&&i.push(c)}return i}function he({icon:t,header:s,children:a,defaultOpen:n=!0}){const[r,i]=m.useState(n);return e.jsxs("div",{className:"rounded-xl border border-border/50 bg-background/80 backdrop-blur-sm overflow-hidden",children:[e.jsxs("button",{onClick:()=>i(l=>!l),className:"w-full flex items-center justify-between gap-3 px-3.5 py-3 text-left group/blk",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(t,{className:"size-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-sm font-light text-foreground",children:s})]}),e.jsx(b.div,{animate:{rotate:r?180:0},transition:{duration:.2},children:e.jsx(ge,{className:"size-4 text-muted-foreground/50 group-hover/blk:text-muted-foreground transition-colors shrink-0"})})]}),e.jsx(K,{initial:!1,children:r&&e.jsx(b.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.26,ease:[.4,0,.2,1]},style:{overflow:"hidden"},children:e.jsx("div",{className:"px-3 pb-3",children:a})},"body")})]})}function Kn({data:t,langColorMap:s}){const{commitContributionsByRepository:a,pullRequestContributionsByRepository:n}=t,r=a.length>0,i=n.length>0;if(!r&&!i)return e.jsx("p",{className:"text-xs text-muted-foreground font-light py-4",children:"No detailed activity data available for this year."});const l=Math.max(...a.map(o=>o.contributions.totalCount),1);return e.jsxs("div",{className:"space-y-3 mt-3",children:[r&&e.jsx(he,{icon:Gt,header:e.jsxs(e.Fragment,{children:[t.totalCommitContributions.toLocaleString()," commits in"," ",a.length," ",a.length===1?"repository":"repositories"]}),children:e.jsx("div",{className:"space-y-1.5 pt-1",children:a.slice(0,12).map(({repository:o,contributions:c})=>{var x;const d=((x=o.primaryLanguage)==null?void 0:x.color)??s.get(o.nameWithOwner.split("/")[1]??"")??"#4ade80",u=c.totalCount/l*100,h=o.nameWithOwner.split("/")[1]||o.nameWithOwner;return e.jsxs("div",{className:"flex items-center gap-2",children:[o.isPrivate?e.jsxs("span",{className:"text-xs font-light text-muted-foreground
25/40 flex items-center gap-1.5 truncate flex-1",children:[e.jsx(G,{className:"size-3 shrink-0"})," private repository"]}):e.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-light text-primary/80 hover:text-primary hover:underline truncate flex-1",children:h}),e.jsxs("span",{className:"text-[11px] text-muted-foreground/60 shrink-0 whitespace-nowrap",children:[c.totalCount," commits"]}),e.jsx("div",{className:"w-20 h-1.5 rounded-full bg-muted/60 overflow-hidden shrink-0",children:e.jsx(b.div,{className:"h-full rounded-full",style:{backgroundColor:o.isPrivate?"#6b7280":d},initial:{width:0},animate:{width:`${u}%`},transition:{duration:.6,ease:R}})})]},o.nameWithOwner)})})}),i&&e.jsx(he,{icon:tt,header:e.jsxs(e.Fragment,{children:[t.totalPullRequestContributions," pull requests in"," ",n.length," ",n.length===1?"repository":"repositories"]}),children:e.jsx("div",{className:"space-y-1 pt-1",children:n.slice(0,8).map(({repository:o,contributions:c})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary/80 hover:text-primary hover:underline flex-1 truncate",children:o.nameWithOwner.split("/")[1]||o.nameWithOwner}),e.jsxs("span",{className:"text-[11px] text-muted-foreground/60 shrink-0",children:[c.totalCount," ",c.totalCount===1?"PR":"PRs"]})]},o.nameWithOwner))})})]})}const lt=3;function qn({calendarGroupsForYear:t,monthlyRepoData:s,monthlyLoading:a,initialCount:n=lt}){const[r,i]=m.useState(!1),l=r?t:t.slice(0,n);return e.jsxs("div",{className:"mt-3",children:[l.map((o,c)=>{const d=s.get(o.key)??[],u=d.length>0?{label:o.label,commits:d.map(x=>({repoName:x.repoName,repoUrl:x.repoUrl,count:x.count,langColor:x.langColor,isPrivate:x.isPrivate})),creates:[],prs:[],total:d.reduce((x,y)=>x+y.count,0)}:{label:o.label,commits:[],creates:[],prs:[],total:0},h=o.firstDay&&o.lastDay?{first:o.firstDay,last:o.lastDay}:void 0;return e.jsx(Hn,{group:u,calendarTotal:o.total,dateRange:h,defaultOpen:c===0,monthlyLoading:a&&d.length===0},o.label)}),!r&&t.length>n&&e.jsx("div",{className:"flex justify-center pt-2",children:e.jsxs("button",{onClick:()=>i(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-xl border border-border/60 text-xs font-light text-muted-foreground hover:text-foreground hover:border-border hover:bg-muted/40 transition-all duration-200",children:[e.jsx(ge,{className:"size-3.5"})," Show more activity"]})})]})}function As(t){const s=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${a}-${n}`}function Oe(t,s){const a=new Date(t+"T12:00:00");return a.setDate(a.getDate()+s),As(a)}function Zn(t){try{const s=new Map;for(const d of t)for(const u of d.contributionDays??[])!u||!u.date||s.set(u.date,(s.get(u.date)??0)+(u.contributionCount??0));if(s.size===0)return{current:0,longest:0};const a=As(new Date),n=[...s.keys()].filter(d=>d<=a).sort();let r=0,i=0,l=null;for(const d of n)(s.get(d)??0)>0?(i=l&&Oe(l,1)===d?i+1:1,r=Math.max(r,i)):i=0,l=d;let o=a;(s.get(o)??0)===0&&(o=Oe(a,-1));let c=0;for(;(s.get(o)??0)>0;)c+=1,o=Oe(o,-1);return{current:c,longest:r}}catch{return{current:0,longest:0}}}function Jn({weeks:t}){const{current:s,longest:a}=m.useMemo(()=>Zn(t),[t]),n=m.useRef(null),r=J(n,{once:!0,margin:"-40px"});return e.jsx("div",{ref:n,className:"grid grid-cols-2 gap-3",children:[{label:"Current Streak",value:s,unit:s===1?"day":"days",icon:s>0?"ð¥":"ð¤",accent:s>0?"text-orange-400":"text-muted-foreground/50",glow:s>7},{label:"Longest Streak",value:a,unit:a===1?"day":"days",icon:"â¡",accent:"text-yellow-400/80",glow:!1}].map(({label:i,value:l,unit:o,icon:c,accent:d,glow:u},h)=>e.jsxs(b.div,{initial:{opacity:0,y:12},animate:r?{opacity:1,y:0}:{},transition:{duration:.5,delay:h*.1,ease:R},className:A("border border-border/60 rounded-2xl p-4 space-y-1",u&&"border-orange-400/20 bg-orange-500/[0.03]"),children:[e.jsx("p",{className:"text-[10px] font-light tracking-widest uppercase text-muted-foreground/50",children:i}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-2xl leading-none",children:c}),e.jsx(xe,{value:l,className:A("text-2xl font-light tabular-nums",d)}),e.jsx("span",{className:"text-xs font-light text-muted-foreground
25/50",children:o})]})]},i))})}function Yn({selectedYear:t,setSelectedYear:s,data:a,loading:n,repos:r}){const{stats:i,loading:l,error:o}=Dt(),c=!n,d=m.useMemo(()=>{const j=new Map;return a==null||a.commitContributionsByRepository.forEach(({repository:k})=>{var T;if((T=k.primaryLanguage)!=null&&T.color){const _=k.nameWithOwner.split("/")[1];j.set(k.nameWithOwner,k.primaryLanguage.color),_&&j.set(_,k.primaryLanguage.color),j.set(`${Qe}/${_}`,k.primaryLanguage.color)}}),j},[a]),{calendarMonthTotals:u,calendarMonthRanges:h}=m.useMemo(()=>{const j=new Map,k=new Map;return a==null||a.contributionCalendar.weeks.forEach(T=>{T.contributionDays.forEach(_=>{if(!_.date)return;const E=new Date(_.date+"T12:00:00"),S=`${E.getFullYear()}-${String(E.getMonth()+1).padStart(2,"0")}`;if(j.set(S,(j.get(S)??0)+_.contributionCount),_.contributionCount>0){const P=k.get(S);k.set(S,{first:(P==null?void 0:P.first)??_.date,last:_.date})}})}),{calendarMonthTotals:j,calendarMonthRanges:k}},[a]),x=m.useMemo(()=>u.size?Array.from(u.entries()).filter(([j])=>j.startsWith(String(t))).sort(([j],[k])=>k.localeCompare(j)).filter(([,j])=>j>0).map(([j,k])=>{const[T,_]=j.split("-").map(Number),E=new Date(T,_-1,1).toLocaleString("en-US",{month:"long",year:"numeric"}),S=h.get(j);return{key:j,label:E,total:k,firstDay:S==null?void 0:S.first,lastDay:S==null?void 0:S.last}}):[],[u,h,t]),{data:y,loading:f}=Qa(t),p=a==null?void 0:a.contributionCalendar,N=m.useMemo(()=>p?Vn(p.weeks,t):[],[p,t]),L=m.useMemo(()=>{const j=new Map;return y.size&&y.forEach((k,T)=>{const _=k.find($=>$.isPrivate);if(!_||_.count===0)return;const[E,S]=T.split("-").map(Number),P=new Date(E,S,0).getDate(),F=Math.round(_.count/P);if(F!==0)for(let $=1;$<=P;$++){const V=`${E}-${String(S).padStart(2,"0")}-${String($).padStart(2,"0")}`;j.set(V,F)}}),j},[y]),I=m.useMemo(()=>!L.size||!N.length?N:N.map(j=>({...j,contributionDays:j.contributionDays.map(k=>{const T=k.date?L.get(k.date)??0:0;return T===0?k:{...k,contributionCount:k.contributionCount+T}})})),[N,L]);return e.jsxs(b.div,{className:"space-y-6",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,delay:.45,ease:R},children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("h4",{className:"text-sm font-light tracking-wide text-muted-foreground flex items-center gap-2",children:[e.jsx(ga,{className:"size-4"}),c?p?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-foreground font-normal",children:p.totalContributions.toLocaleString()})," ","contributions in ",t]}):"Contributions":e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-foreground font-normal",children:e.jsx(me,{chars:5,accent:!0,label:`contributions in ${t}`})})," ","contributions in ",t]})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:Rs.map(j=>e.jsx("button",{onClick:()=>s(j),className:A("px-2.5 py-1 text-xs font-light rounded-full transition-all duration-200",t===j?"bg-foreground
25/10 text-foreground ring-1 ring-border":"text-muted-foreground hover:text-foreground hover:bg-muted/40"),children:j},j))})]}),e.jsx(B,{label:`contributions for ${t}`,loading:n,error:!a,errorFallback:e.jsx(pe,{title:`Could not load contributions for ${t}`,message:"GitHub did not answer. Try another year, or come back in a minute."}),skeleton:e.jsx(Es,{}),children:()=>e.jsxs("div",{className:"space-y-6",children:[!p||p.weeks.length===0?e.jsx("div",{className:"h-16 flex items-center justify-center border border-dashed border-border/60 rounded-xl",children:e.jsx("p",{className:"text-xs text-muted-foreground font-light",children:"No contribution data for this year"})}):e.jsx(Fn,{weeks:I,animKey:t,privateAdditions:L.size>0?L:void 0}),I.length>0&&e.jsx(Jn,{weeks:I}),a&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex flex-wrap gap-5 text-xs text-muted-foreground font-light",children:[{label:"Commits",v:a.totalCommitContributions},{label:"Pull Requests",v:a.totalPullRequestContributions},{label:"Issues",v:a.totalIssueContributions},{label:"Reviews",v:a.totalPullRequestReviewContributions}].map(({label:j,v:k})=>e.jsxs("span",{children:[e.jsx("span",{className:"text-foreground font-normal",children:k.toLocaleString()})," ",j]},j))}),a.restrictedContributionsCount>0&&e.jsxs("p",{className:"text-[11px] text-muted-foreground/60 font-light flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block size-2 rounded-sm bg-[var(--contrib-3)] shrink-0"}),a.restrictedContributionsCount.toLocaleString()," contribution",a.restrictedContributionsCount!==1?"s":""," in private repositories"]})]}),a&&e.jsxs("div",{className:"border border-border/60 rounded-2xl p-5 space-y-4 bg-background/20 backdrop-blur-sm",children:[e.jsx("p",{className:"text-xs font-light tracking-wide text-muted-foreground uppercase",children:"Activity overview"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 items-start",children:[e.jsx(Wn,{data:a}),e.jsxs("div",{className:"flex flex-col items-center gap-6 sm:flex-row sm:justify-center sm:items-center",children:[e.jsx(Gn,{commits:a.totalCommitContributions,reviews:a.totalPullRequestReviewContributions,issues:a.totalIssueContributions,prs:a.totalPullRequestContributions}),e.jsx("div",{className:"w-full max-w-[260px]",children:e.jsx(We,{name:"tech-radar",children:e.jsx(an,{languages:i&&i.status!=="error"?i.languages:void 0,loading:l&&!i,error:o??((i==null?void 0:i.status)==="error"?"error":void 0)})})})]})]})]}),a&&a.contributionCalendar.weeks.length>0&&e.jsx("div",{className:"border border-border/60 rounded-2xl p-5 bg-background/20 backdrop-blur-sm",children:e.jsx(rn,{weeks:a.contributionCalendar.weeks})})]})}),c?e.jsx(Un,{data:a,repos:r}):e.jsx(Ls,{}),e.jsxs("div",{className:"space-y-2 border-t border-border pt-5",children:[e.jsxs("h4",{className:"text-xs font-light tracking-wide text-muted-foreground uppercase flex items-center gap-2",children:[e.jsx(zt,{className:"size-3.5"})," Contribution activity"]}),n?e.jsx(Et,{label:`contribution activity for ${t}`,className:"mt-3",children:e.jsx(rr,{year:t})}):x.length>0?e.jsx(qn,{calendarGroupsForYear:x,monthlyRepoData:y,monthlyLoading:f,initialCount:t===te?1:lt}):a?e.jsx(Kn,{data:a,langColorMap:d}):e.jsx(Q,{title:`No activity recorded for ${t}`,message:"Pick another year to see its commits, pull requests and new repositories.",className:"py-4"})]})]})}const _s=53,Xn=(()=>{const t=_t(11);return Array.from({length:_s*7},()=>Math.round(t()*3)*9)})();function Qn(){const t=_s,s=`repeat(${t}, minmax(0, 1fr))`,a=new Set(Array.from({length:12},(n,r)=>Math.round(r*t/12)));return e.jsx("div",{className:"overflow-x-auto heatmap-scroll w-full","aria-hidden":"true",children:e.jsxs("div",{className:"rounded-xl border border-border/50 bg-background/80 backdrop-blur-sm p-3 md:p-4",style:{minWidth:`${t*14+36}px`},children:[e.jsxs("div",{className:"flex mb-1.5",style:{gap:"2px"},children:[e.jsx("div",{className:"shrink-0",style:{width:28}}),e.jsx("div",{className:"flex-1 grid text-[10px]",style:{gridTemplateColumns:s,gap:"2px"},children:Array.from({length:t},(n,r)=>e.jsx("div",{className:"overflow-visible flex items-center",style:{height:"1lh"},children:a.has(r)&&e.jsx(D,{sweep:!1,className:"h-[0.6em] w-[2.4ch] shrink-0 rounded-full"})},r))})]}),e.jsxs("div",{className:"flex",style:{gap:"2px"},children:[e.jsx("div",{className:"shrink-0 flex flex-col text-[10px]",style:{width:28,gap:"2px"},children:[0,1,0,1,0,1,0].map((n,r)=>e.jsx("div",{className:"flex-1 flex items-center justify-end",style:{paddingRight:4,minHeight:0},children:n?e.jsx(D,{sweep:!1,className:"h-[0.6em] w-[2.6ch] rounded-full"}):null},r))}),e.jsx("div",{className:"flex-1 grid",style:{gridTemplateColumns:s,gap:"2px"},children:Array.from({length:t},(n,r)=>e.jsx("div",{className:"flex flex-col",style:{gap:"2px"},children:Array.from({length:7},(i,l)=>e.jsx("div",{className:"loader-wave w-full rounded-[2px]",style:{aspectRatio:"1",backgroundColor:`color-mix(in oklab, var(--contrib-1) ${Xn[r*7+l]}%, var(--contrib-0))`,"--loader-delay":`${(r+l)*45%2600}ms`}},l))},r))})]}),e.jsxs("div",{className:"flex items-center justify-between mt-3 flex-wrap gap-2",children:[e.jsx("span",{}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground
25/30 font-light select-none",children:"Less"}),[0,2,5,8,12].map(n=>e.jsx("div",{className:"rounded-[2px] opacity-50",style:{width:11,height:11,backgroundColor:Ze(n)}},n)),e.jsx("span",{className:"text-[10px] text-muted-foreground/30 font-light select-none",children:"More"})]})]})]})})}function er(){return e.jsx("div",{className:"grid grid-cols-2 gap-3","aria-hidden":"true",children:[0,1].map(t=>e.jsxs("div",{className:"border border-border/60 rounded-2xl p-4 space-y-1",children:[e.jsx(w,{width:12,textClassName:"text-[10px]"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(w,{width:7,textClassName:"text-2xl",tone:t===0?"cyan":"violet"})})]},t))})}function Es(){return e.jsxs("div",{className:"space-y-6",children:[e.jsx(Qn,{}),e.jsx(er,{}),e.jsx("div",{className:"flex flex-wrap gap-5 text-xs","aria-hidden":"true",children:[11,13,9,10].map((t,s)=>e.jsx(w,{width:t,textClassName:"text-xs"},s))}),e.jsxs("div",{className:"border border-border/60 rounded-2xl p-5 space-y-4 bg-background/20 backdrop-blur-sm","aria-hidden":"true",children:[e.jsx(w,{width:16,textClassName:"text-xs"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 items-start",children:[e.jsxs("div",{className:"space-y-2.5",children:[e.jsx(w,{width:14,textClassName:"text-xs"}),e.jsx("div",{className:"space-y-2",children:fe(6,5,40,78).map((t,s)=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(w,{width:t,textClassName:"text-xs"})}),e.jsx(w,{width:3,textClassName:"text-[11px]"})]}),e.jsx(D,{tone:"emerald",className:"h-1.5 rounded-full",style:{width:`${100-s*13}%`}})]},s))})]}),e.jsxs("div",{className:"flex flex-col items-center gap-6 sm:flex-row sm:justify-center sm:items-center",children:[e.jsx(aa,{sides:4,rings:3,labels:!0,tone:"emerald",seed:5,className:"w-[180px] max-w-full"}),e.jsxs("div",{className:"w-full max-w-[260px] space-y-3",children:[e.jsx(w,{width:10,textClassName:"text-[10px] tracking-[0.15em] uppercase justify-center"}),e.jsx(Ns,{})]})]})]})]}),e.jsx("div",{className:"border border-border/60 rounded-2xl p-5 bg-background/20 backdrop-blur-sm","aria-hidden":"true",children:e.jsx(sr,{})})]})}const tr=[18,34,40,30,44,26,12];function sr(){return e.jsxs("div",{className:"space-y-3",children:[e.jsx(w,{width:15,textClassName:"text-xs"}),e.jsx("div",{className:"flex items-end gap-2",children:tr.map((t,s)=>e.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-1",children:[e.jsx("div",{className:"h-12 w-full flex items-end",children:e.jsx(D,{tone:s===4?"cyan":"neutral",className:"loader-grow w-full rounded-sm origin-bottom",style:{height:t,"--loader-delay":`${s*110}ms`}})}),e.jsx(w,{width:3,textClassName:"text-[9px] justify-center"})]},s))}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(w,{width:28,textClassName:"text-[9px]"}),e.jsx(w,{width:9,textClassName:"text-[9px]"})]})]})}const ar=[38,22,16,11,8,5];function Ls(){return e.jsxs("div",{className:"space-y-3 border-t border-border pt-5","aria-hidden":"true",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"size-3.5"}),e.jsx(w,{width:13,textClassName:"text-xs"})]}),e.jsx("div",{className:"flex h-2.5 rounded-full overflow-hidden gap-px",children:ar.map((t,s)=>e.jsx(D,{tone:s%2?"violet":"cyan",strength:s===0?30:18,className:"h-full rounded-none",style:{width:`${t}%`}},s))}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5",children:[10,8,9,7,8,6].map((t,s)=>e.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx(M,{className:"size-2.5"}),e.jsx(w,{width:t,textClassName:"text-xs"})]},s))})]})}function nr(){const t=fe(4,13,35,70);return e.jsxs("div",{className:"space-y-4 border-t border-border pt-6","aria-hidden":"true",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"size-4"}),e.jsx(w,{width:15,textClassName:"text-sm"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:t.map((s,a)=>e.jsxs("div",{className:"card-flat bg-background/75 backdrop-blur-sm p-4 md:p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(w,{width:s,textClassName:"text-sm"})}),e.jsx(M,{className:"size-3.5 mt-0.5"})]}),e.jsx(Lt,{lines:2,textClassName:"text-xs leading-relaxed",lastLineWidth:"58%"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{className:"size-2.5",tone:a%2?"violet":"cyan"}),e.jsx(w,{width:8,textClassName:"text-xs"}),e.jsx(D,{className:"h-4 w-12 rounded-full"})]})]},a))}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(D,{className:"h-[42px] w-[212px] rounded-2xl"})})]})}function Ps({open:t=!1,seed:s=1,rows:a=3}){return e.jsxs("div",{className:"relative pl-7","aria-hidden":"true",children:[e.jsx("div",{className:"absolute left-2.5 top-0 bottom-0 w-px bg-border/50"}),e.jsx("div",{className:"absolute left-0.5 top-2 size-4 rounded-full bg-muted border border-border"}),e.jsxs("div",{className:"pb-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 pt-0.5 pb-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(w,{width:11+s%3,textClassName:"text-sm"}),e.jsx(w,{width:16+s%4*2,textClassName:"text-[11px] hidden sm:flex"})]}),e.jsx(M,{className:"size-3.5"})]}),t&&e.jsx(Ms,{seed:s,rows:a})]})]})}function Ms({seed:t=1,rows:s=3}){return e.jsxs("div",{className:"rounded-xl border border-border/50 bg-background/80 backdrop-blur-sm overflow-hidden","aria-hidden":"true",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-3.5 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5 flex-1",children:[e.jsx(M,{className:"size-4"}),e.jsx(w,{width:"min(26ch, 70%)",textClassName:"text-sm"})]}),e.jsx(M,{className:"size-4"})]}),e.jsx("div",{className:"px-3 pb-3 space-y-2 pt-1.5",children:fe(s,t+3,30,60).map((a,n)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(w,{width:a,textClassName:"text-xs"})}),e.jsx(w,{width:2.5,textClassName:"text-[11px]"}),e.jsx(D,{tone:"cyan",className:"w-16 h-1.5 rounded-full shrink-0"})]},n))})]})}function rr({year:t=te}){const s=Pt(!0,180),a=t===te?1:lt;return e.jsxs("div",{className:"transition-opacity duration-300 ease-out",style:{opacity:s?1:0},children:[Array.from({length:a},(n,r)=>e.jsx(Ps,{open:r===0,seed:r+1,rows:t===te?1:3},r)),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(D,{className:"h-[34px] w-[164px] rounded-xl",sweep:!1,strength:4})})]})}function Fe({count:t=6,sortBar:s=!0,seed:a=2}){const n=fe(t,a,35,70);return e.jsxs("div",{className:"space-y-5","aria-hidden":"true",children:[s&&e.jsx("div",{className:"flex items-center gap-2",children:[0,1,2].map(r=>e.jsx(D,{className:"h-8 w-[84px] rounded-full"},r))}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:n.map((r,i)=>e.jsxs("div",{className:"rounded-2xl card-flat bg-background/75 backdrop-blur-sm p-4 md:p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(w,{width:r,textClassName:"text-sm"})}),e.jsx(M,{className:"size-3.5 mt-0.5"})]}),e.jsx(Lt,{lines:2,textClassName:"text-xs leading-relaxed",lastLineWidth:"58%"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{className:"size-2.5",tone:i%2?"violet":"cyan"}),e.jsx(w,{width:8,textClassName:"text-xs"}),e.jsx(D,{className:"h-4 w-12 rounded-full"})]})]},i))})]})}function ir(){return e.jsxs("div",{className:"space-y-8","aria-hidden":"true",children:[e.jsxs("div",{className:"flex items-center gap-4 pb-2",children:[e.jsx(M,{className:"size-16 md:size-20",tone:"cyan"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(w,{width:18,textClassName:"text-xl"}),e.jsx(w,{width:"min(52ch, 90%)",textClassName:"text-sm mt-1"}),e.jsx(w,{width:12,textClassName:"text-xs mt-2"})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 ga
25p-4 items-stretch",children:[0,1,2,3,4].map(t=>e.jsxs("div",{className:A("rounded-2xl card-glass bg-background/75 backdrop-blur-sm p-4 md:p-6 lg:p-4 xl:p-6 space-y-2",t===4&&"sm:col-span-2 lg:col-span-1 ring-1 ring-[color:var(--accent-cyan)]/25"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"size-4"}),e.jsx(w,{width:t===4?13:11,textClassName:"text-xs"})]}),e.jsx(w,{width:4.5,textClassName:"text-2xl md:text-3xl",tone:t===4?"cyan":"neutral"}),e.jsx("div",{className:"h-4"}),e.jsx("div",{className:"h-4"})]},t))}),e.jsx("div",{className:"rounded-2xl border border-border/60 bg-background/70 backdrop-blur-sm p-5",children:e.jsx(Mn,{})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsx(w,{width:26,textClassName:"text-sm"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:Rs.map(t=>e.jsx(D,{sweep:!1,className:"h-6 w-11 rounded-full"},t))})]}),e.jsx(Es,{}),e.jsx(Ls,{}),e.jsxs("div",{className:"space-y-2 border-t border-border pt-5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"size-3.5"}),e.jsx(w,{width:21,textClassName:"text-xs"})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx(Ps,{open:!0,seed:1,rows:1}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(D,{className:"h-[34px] w-[164px] rounded-xl",sweep:!1,strength:4})})]})]})]}),e.jsx(nr,{})]})}function le({label:t,value:s,icon:a,index:n,todayBadge:r,footnote:i,featured:l,share:o,loading:c,loadingHint:d}){const[u,h]=m.useState(!1),x=typeof s=="number",y=s==null,f=y&&c===!0,p=typeof o=="number"&&Number.isFinite(o)?Math.min(100,Math.max(0,o*100)):null;return e.jsxs("div",{className:"relative rounded-2xl h-full",children:[e.jsx(Te,{spread:40,glow:!1,disabled:!u,proximity:64,inactiveZone:.01,borderWidth:2}),e.jsx(b.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:n*.1,ease:R},onAnimationComplete:()=>h(!0),children:e.jsx(Ye,{containerClassName:"w-full h-full",children:e.jsxs(Xe,{className:A("relative group/card w-full h-full rounded-2xl card-glass bg-background/75 backdrop-blur-sm overflow-hidden",l&&"ring-1 ring-[color:var(--accent-cyan)]/25 bg-[color:var(--accent-cyan)]/[0.035]"),children:[l&&e.jsx("span",{"aria-hidden":"true",className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-[color:var(--accent-cyan)]/50 to-transparent"}),e.jsxs("div",{className:"p-4 md:p-6 lg:p-4 xl:p-6 space-y-2",children:[e.jsx(W,{translateZ:"20",children:e.jsxs("div",{className:A("flex items-center gap-2",l?"text-[color:var(--accent-cyan)]/75":"text-muted-foreground"),children:[e.jsx(a,{className:"size-4 shrink-0"}),e.jsx("span",{className:"text-xs font-light tracking-wide uppercase whitespace-nowrap",children:t})]})}),e.jsx(W,{translateZ:"40",children:e.jsx("p",{className:"text-2xl md:text-3xl font-light tracking-wide",children:y?f?e.jsx(me,{chars:4.5,accent:l,label:t}):e.jsx(ue,{title:"This source did not answer"}):x?e.jsx(xe,{value:s}):s})}),e.jsx(W,{translateZ:"20",children:e.jsx("p",{className:"text-[11px] font-light tracking-wide h-4",children:r&&e.jsx("span",{className:"text-emerald-400/80",children:r})})}),e.jsx(W,{translateZ:"10",children:e.jsx("p",{className:"text-[10px] font-light tracking-wide text-muted-foreground/45 leading-snug h-4 truncate",children:f&&d?e.jsxs("span",{className:"inline-flex items-center gap-1.5 align-middle",children:[e.jsx("span",{"aria-hidden":"true",className:A("loader-breathe size-1 shrink-0 rounded-full",l?"bg-[color:var(--accent-cyan)]/70":"bg-foreground
25/40")}),d]}):i??"Â "})})]}),p!==null&&e.jsx("span",{"aria-hidden":"true",className:"absolute inset-x-0 bottom-0 h-[3px] bg-[color:var(--accent-cyan)]/10",children:e.jsx("span",{className:"absolute left-0 top-0 h-full bg-[color:var(--accent-cyan)]/55 transition-[width] duration-700 ease-out",style:{width:`${p}%`}})})]})})})]})}function Ct({repo:t,index:s}){var r;const a=t.language?Re[t.language]||"#8b8b8b":null,n=e.jsxs("div",{className:"p-4 md:p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[t.private&&e.jsx(G,{className:"size-3 shrink-0 text-muted-foreground/50"}),e.jsx("h4",{className:"text-sm font-light tracking-wide text-foreground truncate",children:t.private?"private repository":t.name})]}),!t.private&&e.jsx(st,{className:"size-3.5 text-muted-foreground shrink-0 mt-0.5 group-hover/card:text-foreground transition-colors duration-200"})]}),!t.private&&t.description&&e.jsx("p",{className:"text-xs font-light text-muted-foreground leading-relaxed line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground font-light",children:[t.language&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"size-2.5 rounded-full",style:{backgroundColor:a||"#8b8b8b"}}),t.language]}),!t.private&&((r=t.topics)==null?void 0:r.slice(0,3).map(i=>e.jsx(ls,{variant:"secondary",className:"text-[10px] font-light px-1.5 py-0",children:i},i)))]})]});return e.jsx(b.div,{className:"group/card card-flat bg-background/75 backdrop-blur-sm",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:s*.03,ease:R},whileHover:{y:-2},children:t.private?e.jsx("div",{className:"opacity-70",children:n}):e.jsx("a",{href:t.html_url,target:"_blank",rel:"noopener noreferrer",className:"block",children:n})})}function or({project:t,index:s,isPrivate:a=!1}){var c;const[n,r]=m.useState(!1),i=m.useId(),l=((c=t.techStack)==null?void 0:c.split(", ").filter(
25Boolean))||[],o=!!Be(t.slug);return e.jsxs("div",{className:"relative rounded-2xl h-full",children:[e.jsx(Te,{spread:40,glow:!1,disabled:!n,proximity:64,inactiveZone:.01,borderWidth:2}),e.jsx(b.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:s*.03,ease:R},onAnimationComplete:()=>r(!0),children:e.jsx(Ye,{containerClassName:"w-full h-full",children:e.jsxs(Xe,{className:"relative group/card w-full h-full rounded-2xl card-glass bg-background/75 backdrop-blur-sm",children:[e.jsx(Bs,{to:`/projects/${t.slug}`,"aria-labelledby":i,className:"absolute inset-0 z-0 rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-400 focus-visible:ring-offset-2 focus-visible:ring-offset-background"}),e.jsxs("div",{className:"relative pointer-events-none p-4 md:p-5 space-y-3",children:[e.jsx(W,{translateZ:"30",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h4",{id:i,className:"text-sm font-light tracking-wide text-foreground",children:t.title}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-light px-1.5 py-0.5 rounded-full bg-muted/60 text-muted-foreground/70 border border-border/50",children:[e.jsx(G,{className:"size-2.5"}),"Private"]}),o&&e.jsx("span",{className:"text-[10px] font-light px-1.5 py-0.5 rounded-full dark:bg-violet-500/10 bg-violet-100 dark:text-violet-400/80 text-violet-700 border dark:border-violet-500/20 border-violet-300",children:"case study"}),!a&&t.githubUrl&&e.jsx("a",{href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`${t.title} on GitHub (opens in a new tab)`,className:"pointer-events-auto relative z-10 -my-3 -mr-3 inline-flex size-11 items-center justify-center rounded-full text-muted-foreground hover:text-foreground group-hover/card:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-400",children:e.jsx(st,{className:"size-3.5","aria-hidden":"true"})})]})]})}),t.description&&e.jsx(W,{translateZ:"20",children:e.jsx("p",{className:"text-xs font-light text-muted-foreground leading-relaxed line-clamp-2",children:t.description})}),e.jsx(W,{translateZ:"10",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground font-light",children:[l.slice(0,4).map(d=>e.jsx(ls,{variant:"secondary",className:"text-[10px] font-light px-1.5 py-0",children:d},d)),t.year&&e.jsx("span",{className:"text-[10px] text-muted-foreground",children:t.year})]})})]})]})})})]})}function lr({repo:t,index:s}){const[a,n]=m.useState(!1),r=t.language?Re[t.language]||"#8b8b8b":null;return e.jsxs("div",{className:"relative rounded-2xl h-full",children:[e.jsx(Te,{spread:40,glow:!1,disabled:!a,proximity:64,inactiveZone:.01,borderWidth:2}),e.jsx(b.div,{className:"h-full",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:s*.03,ease:R},onAnimationComplete:()=>n(!0),children:e.jsx(Ye,{containerClassName:"w-full h-full",children:e.jsx(Xe,{className:"relative group/card w-full h-full rounded-2xl card-glass bg-background/75 backdrop-blur-sm",children:e.jsxs("a",{href:t.html_url,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col h-full p-4 md:p-5 space-y-3",children:[e.jsx(W,{translateZ:"30",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsxs(rt,{className:"size-5 rounded-sm shrink-0",children:[e.jsx(it,{src:t.owner.avatar_url,alt:t.owner.login}),e.jsx(ot,{className:"rounded-sm text-[10px]",children:t.owner.login[0].toUpperCase()})]}),e.jsx("h4",{className:"text-sm font-light tracking-wide text-foreground truncate",children:t.full_name})]}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[e.jsx(Ce,{className:"size-3"}),e.jsx("span",{children:t.stargazers_count.toLocaleString()})]})]})}),t.description&&e.jsx(W,{translateZ:"20",children:e.jsx("p",{className:"text-xs font-light text-muted-foreground leading-relaxed line-clamp-2",children:t.description})}),t.language&&e.jsx(W,{translateZ:"10",children:e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground font-light",children:[e.jsx("span",{className:"size-2.5 rounded-full",style:{backgroundColor:r||"#8b8b8b"}}),t.language]})})]})})})})]})}const cr=[{key:"recent",label:"Recent",icon:ba},{key:"oldest",label:"Oldest",icon:ja}],dr=[{key:"az",label:"A â Z",icon:Ft},{key:"za",label:"Z â A",icon:Ot}];function St({sort:t,setSort:s,layoutId:a}){const[n,r]=m.useState(!1),i=m.useRef(null);return m.useEffect(()=>{const l=o=>{i.current&&!i.current.contains(o.target)&&r(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]),e.jsxs("div",{className:"flex justify-end gap-2 mb-4",children:[cr.map(({key:l,label:o,icon:c})=>e.jsxs("button",{onClick:()=>{s(l),r(!1)},className:A("relative inline-flex items-center gap-1.5 px-3 py-1.5 text-xs md:text-sm font-light tracking-wide rounded-full transition-colors duration-200",t===l?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t===l&&e.jsx(b.div,{layoutId:a,className:"absolute inset-0 bg-muted rounded-full",transition:{type:"spring",stiffness:380,damping:30}}),e.jsxs("span",{className:"relative z-10 flex items-center gap-1.5",children:[e.jsx(c,{className:"size-3.5"}),o]})]},l)),e.jsxs("div",{ref:i,className:"relative",children:[e.jsxs("button",{onClick:()=>r(l=>!l),className:A("relative inline-flex items-center gap-1.5 px-3 py-1.5 text-xs md:text-sm font-light tracking-wide rounded-full transition-colors duration-200",t==="az"||t==="za"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[(t==="az"||t==="za")&&e.jsx(b.div,{layoutId:a,className:"absolute inset-0 bg-muted rounded-full",transition:{type:"spring",stiffness:380,damping:30}}),e.jsxs("span",{className:"relative z-10 flex items-center gap-1.5",children:[t==="za"?e.jsx(Ot,{className:"size-3.5"}):e.jsx(Ft,{className:"size-3.5"}),t==="za"?"Z â A":"A â Z",e.jsx(ge,{className:A("size-3 transition-transform duration-200",n&&"rotate-180")}
25)]})]}),e.jsx(K,{children:n&&e.jsx(b.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 mt-2 min-w-[100px] rounded-lg border border-border bg-background shadow-lg overflow-hidden z-50",children:dr.map(({key:l,label:o,icon:c})=>e.jsxs("button",{onClick:()=>{s(l),r(!1)},className:A("w-full flex items-center gap-2 px-3 py-2 text-xs md:text-sm font-light tracking-wide transition-colors duration-150",t===l?"text-foreground bg-muted":"text-muted-foreground hover:text-foreground hover:bg-background/70 backdrop-blur-sm0"),children:[e.jsx(c,{className:"size-3.5"}),o]},l))})})]})]})}function ue({title:t}){return e.jsx("span",{className:"text-[0.6em] font-light tracking-wide text-muted-foreground/45",title:t,children:"n/a"})}function Mr(){const t=Ys(),{user:s,repos:a,starredRepos:n,loading:r}=Xs(),i=s&&typeof s.login=="string"?s:null,{projects:l,loading:o}=sa(),c=X(a),d=X(n),u=X(l),[h,x]=Ws(),y=h.get("tab")??"overview",f=g=>x({tab:g},{replace:!0}),[p,N]=m.useState(te),[L,I]=m.useState("recent"),[j,k]=m.useState("recent"),[T,_]=m.useState(null),[E,S]=m.useState(!1),[P,F]=m.useState(!1),$=m.useRef(null),{data:V,loading:ie}=Qs(p),je=m.useMemo(()=>$n(V),[V]),{total:Y,publicTotal:O,scope:ct,todayRuns:Ae,loading:Ds}=xn(),Is=ct==="all"&&Y!=null&&Y>0&&O!=null?O/Y:null,$s=(()=>{if(Y!=null){if(ct==="public")return"public repos only";if(O!=null)return`${O.toLocaleString()} in public repos`}})(),ve=m.useMemo(()=>{const g=[...c];switch(L){case"recent":return g.sort((v,C)=>new Date(C.pushed_at).getTime()-new Date(v.pushed_at).getTime());case"oldest":return g.sort((v,C)=>new Date(v.pushed_at).getTime()-new Date(C.pushed_at).getTime());case"az":return g.sort((v,C)=>v.name.localeCompare(C.name));case"za":return g.sort((v,C)=>C.name.localeCompare(v.name));default:return g}},[c,L]),ye=m.useMemo(()=>{const g=[...u];switch(j){case"recent":return g.sort((v,C)=>new Date(C.updatedAt||C.createdAt||C.year).getTime()-new Date(v.updatedAt||v.createdAt||v.year).getTime());case"oldest":return g.sort((v,C)=>new Date(v.createdAt||v.year).getTime()-new Date(C.createdAt||C.year).getTime());case"az":return g.sort((v,C)=>v.title.localeCompare(C.title));case"za":return g.sort((v,C)=>C.title.localeCompare(v.title));default:return g}},[u,j]),zs=m.useMemo(()=>{var v;const g={};for(const C of u)for(const z of((v=C.techStack)==null?void 0:v.split(", ").filter(
25Boolean))??[])g[z]=(g[z]??0)+1;return Object.entries(g).sort((C,z)=>z[1]-C[1]).map(([C])=>C)},[u]),Ne=m.useMemo(()=>{let g=T?ye.filter(v=>{var C;return(C=v.techStack)==null?void 0:C.split(", ").includes(T)}):ye;return P&&(g=g.filter(v=>!!Be(v.slug))),g},[ye,T,P]),dt=m.useMemo(()=>u.filter(g=>!!Be(g.slug)).length,[u]),ut=m.useMemo(()=>[...c].sort((g,v)=>new Date(v.pushed_at).getTime()-new Date(g.pushed_at).getTime()).slice(0,4),[c]),mt=m.useMemo(()=>c.reduce((g,v)=>g+(v.stargazers_count||0),0),[c]),Os=m.useMemo(()=>c.reduce((g,v)=>g+(v.forks_count||0),0),[c]),we=m.useMemo(()=>{if(c.length===0)return{};const g=new Set(c.map(z=>z.language).filter(Boolean)).size,v=c.filter(z=>(z.stargazers_count||0)>0).length,C=c.filter(z=>(z.forks_count||0)>0).length;return{repos:`${c.length} sources · ${g} languages`,followers:typeof(i==null?void 0:i.following)=="number"?`following ${i.following.toLocaleString()}`:void 0,stars:v>0?`across ${v} repos`:void 0,forks:C>0?`across ${C} repos`:void 0}},[c,i]),xt=typeof(i==null?void 0:i.owned_private_repos)=="number"?i.owned_private_repos:null,Fs=(i==null?void 0:i.public_repos)??c.length,_e=!r&&!i&&c.length===0,pt=m.useMemo(()=>new Set(c.map(g=>g.name.toLowerCase())),[c]),Ee=m.useMemo(()=>u.filter(g=>{var C,z;if(g.isPrivate===!0)return!0;if(g.isPrivate===!1)return!1;const v=(z=(C=g.githubUrl)==null?void 0:C.split("/").pop())==null?void 0:z.toLowerCase();return v&&!pt.has(v)}),[u,pt]),Gs=()=>{f("repositories"),setTimeout(()=>{var g;return(g=$.current)==null?void 0:g.scrollIntoView({behavior:"smooth",block:"start"})},50)};return e.jsxs(e.Fragment,{children:[e.jsx(Us,{title:"Open Source",description:"Open-source work by Subhanshu Mohan Gupta: repositories, contribution heatmap, streak and starred projects."}),e.jsxs("div",{className:"min-h-screen relative",children:[e.jsx("section",{className:"py-28 md:py-36 px-6 lg:px-8 border-b border-border",children:e.jsxs("div",{className:"max-w-4xl mx-auto text-center space-y-6",children:[e.jsx(b.h1,{className:"text-5xl md:text-6xl lg:text-7xl font-extralight tracking-wide",initial:t.instant?!1:Pe,animate:Le,transition:t.transition(0),children:"Open Source"}),e.jsx(b.p,{className:"text-lg md:text-xl text-muted-foreground font-light tracking-wide",initial:t.instant?!1:Pe,animate:Le,transition:t.transition(1),children:"Projects, repositories and contributions"}),e.jsxs(b.div,{className:"flex flex-col items-center gap-5",initial:t.instant?!1:Pe,animate:Le,transition:t.transition(2),children:[e.jsx("div",{className:"flex items-center p-[3px] rounded-full border border-border/50 bg-background/80 backdrop-blur-sm",children:["Public","Private"].map(g=>{const v=g==="Private"===E;return e.jsxs("button",{onClick:()=>S(g==="Private"),className:"relative px-4 py-1.5 rounded-full text-xs font-light tracking-wide transition-colors duration-200 flex items-center gap-1.5",children:[v&&e.jsx(b.div,{layoutId:"hero-privacy-pill",className:"absolute inset-0 rounded-full bg-foreground",transition:{type:"spring",stiffness:400,damping:30}}),g==="Private"&&e.jsx(G,{className:A("relative z-10 size-2.5 transition-colors duration-200",v?"text-background":"text-muted-foreground/60")}),e.jsx("span",{className:A("relative z-10 transition-colors duration-200",v?"text-background":"text-muted-foreground"),children:g})]},g)})}),e.jsxs("div",{className:"grid w-full max-w-sm grid-cols-3 rounded-2xl border border-border/50 bg-background/80 backdrop-blur-sm overflow-hidden divide-x divide-border/50 sm:w-auto sm:max-w-none",children:[e.jsxs("div",{className:"flex min-w-0 flex-col items-center px-3 sm:px-10 md:px-14 pt-5 pb-3 gap-1.5 cursor-default",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground/50",children:[E?e.jsx(G,{className:"size-3"}):e.jsx(Me,{className:"size-3"}),e.jsx("span",{className:"text-[10px] font-light tracking-[0.2em] uppercase",children:"Repos"})]}),e.jsx(K,{mode:"wait",children:e.jsx(b.p,{className:"text-3xl md:text-4xl font-extralight tracking-tight tabular-nums",initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:R},children:r?e.jsx(me,{chars:2,label:E?"private repos":"public repos"}):_e?e.jsx(ue,{title:"GitHub did not answer"}):E&&xt===null?e.jsx(ue,{title:"This count is not available to the server-side token"}):e.jsx(xe,{value:E?xt:Fs,duration:.9})},E?"priv-repos":"pub-repos")}),e.jsx("span",{className:"h-4","aria-hidden":"true"})]}),e.jsxs("div",{className:"flex min-w-0 flex-col items-center px-3 sm:px-10 md:px-14 pt-5 pb-3 gap-1.5 cursor-default",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground
25/50",children:[E?e.jsx(G,{className:"size-3"}):e.jsx(et,{className:"size-3"}),e.jsx("span",{className:"text-[10px] font-light tracking-[0.2em] uppercase",children:"Projects"})]}),e.jsx(K,{mode:"wait",children:e.jsx(b.p,{className:"text-3xl md:text-4xl font-extralight tracking-tight tabular-nums",initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:R},children:o?e.jsx(me,{chars:2,label:E?"private projects":"public projects"}):_e?e.jsx(ue,{title:"GitHub did not answer, so public and private cannot be told apart"}):e.jsx(xe,{value:E?Ee.length:u.length-Ee.length,duration:.9})},E?"priv-proj":"pub-proj")}),e.jsx("span",{className:"h-4","aria-hidden":"true"})]}),e.jsxs("div",{className:"flex min-w-0 flex-col items-center px-3 sm:px-10 md:px-14 pt-5 pb-3 gap-1.5 cursor-default",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground/50",children:[e.jsx(Ce,{className:"size-3"}),e.jsx("span",{className:"text-[10px] font-light tracking-[0.2em] uppercase",children:"Stars"})]}),e.jsx("p",{className:"text-3xl md:text-4xl font-extralight tracking-tight tabular-nums",children:r?e.jsx(me,{chars:3,accent:!0,label:"stars"}):_e?e.jsx(ue,{title:"GitHub did not answer"}):e.jsx(xe,{value:mt,duration:1.4})}),e.jsx("span",{className:"h-4 text-[11px] font-light leading-4 text-muted-foreground/60 whitespace-nowrap",children:"public only"})]})]})]}),e.jsx(b.div,{className:"mx-auto h-px bg-border",initial:{scaleX:0,width:"80px"},animate:{scaleX:1},transition:{duration:.8,delay:.35,ease:R}})]})}),e.jsx("section",{className:"py-16 md:py-24 px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-5xl mx-auto space-y-12",children:[e.jsxs(b.div,{className:"flex items-center gap-3",initial:{opacity:0,scale:.8},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{duration:.5,ease:R},children:[e.jsx(xa,{className:"size-6 text-muted-foreground"}),e.jsx(Hs,{as:"h2",className:"text-3xl md:text-4xl font-light tracking-wide",baseOpacity:.1,scrollOffset:["start 0.9","start 0.6"],children:"Profile & Repositories"})]}),e.jsx("div",{ref:$,children:e.jsxs(Ia,{value:y,onValueChange:f,className:"w-full",children:[e.jsxs(os,{className:"w-full md:w-auto",children:[e.jsx(ce,{value:"overview",className:"text-xs md:text-sm font-light",children:"Overview"}),e.jsx(ce,{value:"projects",className:"text-xs md:text-sm font-light",children:"Projects"}),e.jsx(ce,{value:"repositories",className:"text-xs md:text-sm font-light",children:"Repositories"}),e.jsx(ce,{value:"stars",className:"text-xs md:text-sm font-light",children:"Stars"})]}),e.jsx(de,{value:"overview",className:"mt-6",children:e.jsx(B,{label:"GitHub profile",loading:r&&!i,error:!i,errorFallback:e.jsx(pe,{title:"Could not load the GitHub profile",message:"GitHub did not answer. The repositories and projects tabs may still have cached data."}),skeleton:e.jsx(ir,{}),children:()=>i&&e.jsxs(b.div,{className:"space-y-8",initial:{opacity:0}
25,animate:{opacity:1},transition:{duration:.4,ease:R},children:[e.jsxs(b.div,{className:"flex items-center gap-4 pb-2",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:R},children:[e.jsxs(rt,{className:"size-16 md:size-20",children:[e.jsx(it,{src:i.avatar_url,alt:i.name||i.login}),e.jsx(ot,{className:"text-lg",children:i.login[0].toUpperCase()})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-light tracking-wide",children:i.name||i.login}),i.bio&&e.jsx("p",{className:"text-sm text-muted-foreground font-light mt-1",children:i.bio}),e.jsxs("a",{href:i.html_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground font-light mt-2 hover:text-foreground transition-colors",children:[e.jsx(st,{className:"size-3"}),i.login]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4 items-stretch",children:[e.jsx(le,{label:"Public Repos",value:i.public_repos,icon:Me,index:0,footnote:we.repos}),e.jsx(le,{label:"Followers",value:i.followers,icon:pa,index:1,footnote:we.followers}),e.jsx(le,{label:"Stars Received",value:mt,icon:Ce,index:2,footnote:we.stars}),e.jsx(le,{label:"Total Forks",value:Os,icon:It,index:3,footnote:we.forks}),e.jsx("div",{className:"sm:col-span-2 lg:col-span-1",children:e.jsx(le,{label:"Workflow Runs",value:Y,icon:ha,index:4,todayBadge:Ae!=null&&Ae>0?`+${Ae} today`:void 0,footnote:$s,featured:!0,share:Is,loading:Ds,loadingHint:"counting runs"})})]}),e.jsx(b.div,{className:"rounded-2xl border border-border/60 bg-background/70 backdrop-blur-sm p-5",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,delay:.45,ease:R},children:e.jsx(Dn,{})}),e.jsxs(ft,{children:[e.jsx(Yn,{selectedYear:p,setSelectedYear:N,data:je,loading:ie,repos:c}),ut.length>0&&e.jsxs(b.div,{className:"space-y-4 border-t border-border pt-6",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,delay:.5,ease:R},children:[e.jsxs("h4",{className:"text-sm font-light tracking-wide text-muted-foreground flex items-center gap-2",children:[e.jsx(zt,{className:"size-4"})," Recently Active"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ut.map((g,v)=>e.jsx(Ct,{repo:g,index:v},g.name))}),e.jsx(b.div,{className:"flex justify-center pt-2",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.4,delay:.6,ease:R},children:e.jsxs(b.button,{onClick:Gs,className:"group inline-flex items-center gap-2 px-5 py-2.5 rounded-2xl border border-border/60 text-sm font-light text-muted-foreground hover:text-foreground hover:border-border hover:bg-accent/60 hover:shadow-md transition-all duration-200",whileHover:{y:-2},whileTap:{scale:.97},transition:{type:"spring",stiffness:380,damping:28},children:[e.jsx("span",{children:"View all repositories"}),e.jsx(fa,{className:"size-4 transition-transform duration-200 group-hover:translate-x-0.5"})]})})]})]})]})})}),e.jsx(de,{value:"projects",className:"mt-6",children:e.jsx(B,{label:"projects",loading:o,empty:ye.length===0,emptyFallback:e.jsx(Q,{title:"No projects to show yet",message:"Projects appear here once their repositories are published."}),skeleton:e.jsx(Fe,{count:6,seed:4}),children:()=>e.jsxs("div",{className:"space-y-5",children:[e.jsx(St,{sort:j,setSort:k,layoutId:"project-sort-pill"}),dt>0&&e.jsxs(b.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.45,ease:R},className:"relative overflow-hidden rounded-2xl border dark:border-violet-500/20 border-violet-300 dark:bg-violet-500/[0.04] bg-violet-50 p-4 flex items-center justify-between gap-4",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r dark:from-violet-500/[0.06] from-violet-500/[0.03] via-trans
25parent to-transparent pointer-events-none"}),e.jsxs("div",{className:"relative space-y-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"size-3 dark:text-violet-400/60 text-violet-600"}),e.jsx("span",{className:"text-[10px] font-light tracking-[0.18em] uppercase dark:text-violet-400/70 text-violet-700 font-medium",children:"Case Studies"}),e.jsx("span",{className:"text-[10px] font-light px-1.5 py-0.5 rounded-full dark:bg-violet-500/15 bg-violet-200 dark:text-violet-400/80 text-violet-800 dark:border-violet-500/25 border-violet-300 tabular-nums border",children:dt})]}),e.jsx("p",{className:"text-xs font-light dark:text-muted-foreground/70 text-foreground/60 leading-snug",children:"Deep dives into architecture, decisions, and lessons learned. Click any project to explore."})]}),e.jsx(b.button,{onClick:()=>F(g=>!g),whileHover:{scale:1.02},whileTap:{scale:.97},className:A("relative shrink-0 text-[11px] font-light px-4 py-2 rounded-full border transition-all duration-200",P?"bg-violet-500 text-white border-violet-500 shadow-sm shadow-violet-500/25":"dark:border-violet-500/30 border-violet-500 dark:text-violet-400/80 text-violet-700 dark:hover:border-violet-500/60 hover:border-violet-600 dark:hover:bg-violet-500/10 hover:bg-violet-100"),children:P?"Showing case studies":"Filter case studies"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[10px] font-light tracking-widest uppercase text-muted-foreground/70",children:"Filter by technology"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:zs.map(g=>{const v=T===g;return e.jsx(b.button,{onClick:()=>_(v?null:g),whileHover:{y:-1},whileTap:{scale:.95},className:A("px-2.5 py-1 rounded-lg text-xs font-light tracking-wide border transition-all duration-200 cursor-pointer",v?"bg-foreground text-background border-foreground":"border-border dark:text-muted-foreground text-foreground/70 dark:hover:border-foreground
25/40 hover:border-foreground/60 hover:text-foreground"),children:g},g)})})]}),e.jsx(K,{children:(T||P)&&e.jsxs(b.p,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},className:"text-xs text-muted-foreground/60 font-light",children:[Ne.length," ",P?`case stud${Ne.length!==1?"ies":"y"}`:`project${Ne.length!==1?"s":""}`,T&&e.jsxs(e.Fragment,{children:[" using ",e.jsx("span",{className:"text-foreground/80",children:T})]})]})}),e.jsx(b.div,{className:"grid grid-cols-1 md:grid-cols-2 gap-4",layout:!0,initial:{opacity:0},animate:{opacity:1},transition:{duration:.4,ease:R},children:e.jsx(K,{mode:"popLayout",children:Ne.map((g,v)=>e.jsx(b.div,{layout:!0,initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-8,scale:.97},transition:{duration:.3,delay:v*.03,ease:R},children:e.jsx(or,{project:g,index:v,isPrivate:Ee.some(C=>C.id===g.id)})},g.id))})})]})})}),e.jsx(de,{value:"repositories",className:"mt-6",children:e.jsx(B,{label:"repositories",loading:r&&ve.length===0,error:!r&&!i&&ve.length===0,errorFallback:e.jsx(pe,{label:"repositories",message:"GitHub did not answer. It usually comes back on its own."}),empty:ve.length===0,emptyFallback:e.jsx(Q,{title:"No public repositories yet"}),skeleton:e.jsx(Fe,{count:6,seed:6}),children:()=>e.jsxs(e.Fragment,{children:[e.jsx(St,{sort:L,setSort:I,layoutId:"repo-sort-pill"}),e.jsx(b.div,{className:"grid grid-cols-1 md:grid-cols-2 gap-4",initial:{opacity:0}
25,animate:{opacity:1},transition:{duration:.4,ease:R},children:ve.map((g,v)=>e.jsx(Ct,{repo:g,index:v},g.name))})]})})}),e.jsx(de,{value:"stars",className:"mt-6",children:e.jsx(B,{label:"starred repositories",loading:r&&d.length===0,error:!r&&!i&&d.length===0,errorFallback:e.jsx(pe,{label:"starred repositories",message:"GitHub did not answer. It usually comes back on its own."}),empty:d.length===0,emptyFallback:e.jsx(Q,{title:"No starred repositories yet"}),skeleton:e.jsx(Fe,{count:6,sortBar:!1,seed:8}),children:()=>e.jsx(b.div,{className:"grid grid-cols-1 md:grid-cols-2 gap-4",initial:{opacity:0},animate:{opacity:1},transition:{duration:.4,ease:R},children:d.map((g,v)=>e.jsx(lr,{repo:g,index:v},g.full_name))})})})]})})]})}),e.jsx(ft,{children:e.jsx("section",{"aria-labelledby":"github-time-title",className:"py-16 md:py-24 px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"max-w-5xl mx-auto space-y-10",children:[e.jsxs(b.div,{className:"space-y-3 text-center",initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{duration:.5,ease:R},children:[e.jsx("h2",{id:"github-time-title",className:"text-3xl md:text-5xl font-light tracking-wide",children:"Time Lost to Code"}),e.jsx("p",{className:"text-base md:text-lg text-muted-foreground font-light tracking-wide",children:"Live proof I have no work-life balance. Last 7 days via WakaTime, all-time via CodeTime"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(We,{name:"wakatime",children:e.jsx(bn,{})}),e.jsx(We,{name:"codetime",children:e.jsx(Cn,{})})]})]})})}),e.jsx(na,{})]})]})}export{Mr as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.