1(()=>{const t=document.querySelectorAll(".repo-compact-about[data-repo-about]"),e=document.querySelectorAll(".repo-compact-stat[data-repo-stat][data-repo-stat-repository]");if(!t.length&&!e.length)return;const o=new Map,a=new Map,s=new Map,r=(t,e,o)=>{t.has(e)||t.set(e,[]),t.get(e).push(o)};for(const e of t){const t=(e.dataset.repoAbout||"").trim();if(!t)continue;const s=(e.dataset.repoAboutDefault||"").trim();s&&!a.has(t)&&a.set(t,s),e.classList.add("is-loading"),r(o,t,e)}for(const t of e){const e=(t.dataset.repoStatRepository||"").trim(),o=(t.dataset.repoStat||"").trim();e&&o&&(t.classList.add("is-loading"),r(s,e,t))}const n=(t,e)=>{const a=(e||"").trim(),s=o.get(t)||[];for(const t of s)t.classList.remove("is-loading"),a?(t.textContent=a,t.classList.remove("is-empty"),t.title=a):(t.textContent="",t.classList.add("is-empty"),t.removeAttribute("title"))},i="en",c=new Intl.NumberFormat(i),d=new Intl.NumberFormat(i,{maximumFractionDigits:1,notation:"compact"}),u="function"==typeof Intl.RelativeTimeFormat?new Intl.RelativeTimeFormat(i,{numeric:"auto"}):null,l=t=>Number.isFinite(t)?Math.abs(t)<1e3?c.format(t):d.format(t):"--",p=t=>{const e=Date.parse(t);if(!Number.isFinite(e))return"--";if(!u)return new Date(e).toLocaleDateString(i);const o=Math.round((e-Date.now())/1e3),a=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];for(const[t,e]of a)if(Math.abs(o)>=e)return u.format(Math.round(o/e),t);return u.format(0,"second")},m=(t,e)=>e&&"object"==typeof e?"stars"===t?l(Number(e.stargazers_count)):"forks"===t?l(Number(e.forks_count)):"commits"===t?p(e.pushed_at):"issues"===t?l(Number(e.open_issues_count)):"--":"--",f=()=>{for(const t of e){if("commits"!==t.dataset.repoStat)continue;const e=t.dataset.repoStatDate,o=t.querySelector("[data-repo-stat-value]");e&&o&&(o.textContent=p(e))}},h=(t,e)=>{const o=s.get(t)||[];for(const t of o){const o=t.querySelector("[data-repo-stat-value]");if(t.classList.remove("is-loading"),o){if("commits"===t.dataset.repoStat){const o=e&&"string"==typeof e.pushed_at?e.pushed_at:"";o?t.dataset.repoStatDate=o:delete t.dataset.repoStatDate}o.textContent=m(t.dataset.repoStat,e)}}};Array.from(e).some(t=>"commits"===t.dataset.repoStat)&&(window.setInterval(f,6e4),window.addEventListener("pageshow",f),document.addEventListener("visibilitychange",()=>{document.hidden||f()}));const g=864e5,y=(t,e=NaN)=>{if(!t||"object"!=typeof t)return null;const o="string"==typeof t.fetched_at?Date.parse(t.fetched_at):e,a=Number.isFinite(o)?o:0;return{data:t,fresh:Number.isFinite(o)&&Date.now()-o<=g,timestamp:a}},b=new Map;for(const t of document.querySelectorAll(".repo-compact[data-repo-repository][data-repo-static]")){const e=(t.dataset.repoRepository||"").trim();if(e)try{const o=JSON.parse(t.dataset.repoStatic),a=y(o);a&&b.set(e,a)}catch(t){}}const w=t=>{try{const e=window.localStorage.getItem(`repo-meta:${t}`);if(!e)return null;const o=JSON.parse(e);if(!o||"object"!=typeof o||!o.data||"object"!=typeof o.data)return null;const a="number"==typeof o.exp?o.exp-g:NaN;return y(o.data,a)}catch(t){return null}},S=(t,e)=>{try{const o={data:e,exp:Date.now()+g};window.localStorage.setItem(`repo-meta:${t}`,JSON.stringify(o))}catch(t){}},N=(...t)=>t.filter(Boolean).reduce((t,e)=>!t||e.timestamp>t.timestamp?e:t,null),v={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},L=new Map,D=t=>fetch(`https://api.github.com/repos/${t}`,{headers:v}).then(t=>{if(!t.ok)throw new Error(`GitHub API returned ${t.status}`);return t.json()}).then(e=>{const o={...e,fetched_at:(new Date).toISOString()};return S(t,o),o}),x=t=>{const e=w(t);if(e?.fresh)return Promise.resolve(e.data);if(!L.has(t)){const e=D(t).finally(()=>L.delete(t));L.set(t,e)}return L.get(t)},A=new Set([...o.keys(),...s.keys()]),_=document.querySelector("[data-repo-stats-status]"),F=new Set;for(const t of A){const e=a.get(t)||"";e&&n(t,e);const o=N(w(t),b.get(t));if(o){if(!e){const e="string"==typeof o.data.description?o.data.description:"";n(t,e)}s.has(t)&&h(t,o.data)}else s.has(t)&&h(t,null);s.has(t)&&!o?.fresh&&F.add(t)}const I=(t,e)=>{for(const o of s.get(t)||[])o.classList.toggle("is-loading",e)},M=async({repositories:t=[...A]}={})=>
1{if(!t.length)return;const e=[...new Set(t)].filter(t=>A.has(t));if(!e.length)return;for(const t of e)I(t,!0);_&&(_.textContent=_.dataset.loadingLabel||"Loading GitHub statistics\u2026");const r=(await Promise.all(e.map(async t=>{try{const e=await x(t),r=a.get(t)||"";if(o.has(t)&&!r){const o=e&&"string"==typeof e.description?e.description:"";n(t,o)}return s.has(t)&&h(t,e),!0}catch(e){return I(t,!1),!1}}))).filter(t=>!t).length;_&&(_.textContent=r?_.dataset.errorLabel||"Some GitHub statistics could not be loaded.":_.dataset.loadedLabel||"GitHub statistics loaded.")};F.size&&M({repositories:[...F]})})();
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.