@continuous-excellence/ze-great-dashboard-client 0.31.64 → 0.31.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{z as e}from"zod";import{StrictMode as t,useCallback as n,useEffect as r,useId as i,useMemo as a,useRef as o,useState as s,useSyncExternalStore as c}from"react";import{createRoot as l}from"react-dom/client";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{ErrorResponse as p,User as m,UserManager as h,WebStorageStateStore as g}from"oidc-client-ts";import{AuthProvider as _,hasAuthParams as v,useAuth as y}from"react-oidc-context";import{createPortal as b}from"react-dom";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var x=e.enum([`warning`,`blocked`]),S=e.object({assetPath:e.string().min(1),assetPathId:e.string().regex(/^sha256:[a-f0-9]{64}$/),proxyPath:e.string().min(1),board:e.string().min(1),auth:e.object({issuer:e.string().min(1),clientId:e.string().min(1),audience:e.string().min(1)}).optional(),security:x.optional()}),C=S.pick({assetPath:!0,assetPathId:!0}).extend({serverVersion:e.string().min(1)});function w(t=globalThis.window?.env){let n=S.safeParse(t);if(!n.success)throw Error(`window.env is missing or invalid \u2014 the server did not inject usable configuration.
|
|
2
|
-
${e.prettifyError(n.error)}`);return n.data}var ee=/^([1-9][0-9]*)(ms|s|m|h)$/,te={ms:1,s:1e3,m:6e4,h:36e5};function T(e){let t=ee.exec(e);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)return null;let i=Number(n);return i<=0?null:i*te[r]}e.string().regex(/^[1-9][0-9]*(?:ms|s|m|h)$/,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand();var E=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),ne=e.object({kind:E,message:e.string()}),D=e.discriminatedUnion(`state`,[e.object({panelId:e.string().min(1),state:e.literal(`ok`),observedAt:e.iso.datetime(),link:e.url().nullable(),signal:e.unknown()}),e.object({panelId:e.string().min(1),state:e.literal(`error`),observedAt:e.iso.datetime(),link:e.url().nullable(),error:ne})]),re=e.object({kind:e.enum([`job`,`stage`,`step`]),name:e.string().min(1),parent:e.string().min(1).optional()}),O=e.discriminatedUnion(`status`,[e.object({type:e.literal(`test-count`),status:e.literal(`reported`),total:e.number().int().nonnegative(),run:e.object({id:e.string().min(1),attempt:e.number().int().positive(),updatedAt:e.iso.datetime()}).optional(),passed:e.number().int().nonnegative().optional(),failed:e.number().int().nonnegative().optional(),skipped:e.number().int().nonnegative().optional()}),e.object({type:e.literal(`test-count`),status:e.literal(`pending`)}),e.object({type:e.literal(`test-count`),status:e.literal(`not-reported`)})]),ie=e.discriminatedUnion(`state`,[e.object({state:e.literal(`ok`),observedAt:e.iso.datetime(),signal:O}),e.object({state:e.literal(`error`),observedAt:e.iso.datetime(),error:ne})]),k=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`warning`,`running`,`cancelled`,`unknown`]),rawStatus:e.string(),testResults:ie.optional(),name:e.string().min(1),branch:e.string().min(1).optional(),durationMs:e.number().int().nonnegative().optional(),runStartedAt:e.iso.datetime().optional(),sourceRunId:e.string().min(1).optional(),activity:re.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),ae={passed:0,cancelled:1,unknown:2,running:3,warning:4,failed:5};function oe(e){return ae[e]}var se=e.object({label:e.string().min(1),status:k.shape.status,detail:e.string().min(1),link:e.url().nullable()}),ce=e.object({type:e.literal(`pull-request-health`),status:k.shape.status,summary:e.string().min(1),workflows:e.array(se),pullRequests:e.array(se),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),le=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),ue=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(le),truncated:e.boolean().optional()}),de=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:se}),fe=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:se}),pe=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),me=12,he=12;function ge(e){let t=e.flatMap(e=>!e.position||A(e.position)||_e(e.position)?[]:[{panelId:e.id,kind:`out-of-bounds`,position:e.position,conflictsWith:[]}]),n=new Map;for(let r=0;r<e.length;r++){let i=e[r];if(i?.position&&!A(i.position))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||A(r.position)||!ve(i.position,r.position))continue;let o=`${r.id}\0overlap`,s=n.get(o);if(s)s.conflictsWith.push(i.id);else{let e={panelId:r.id,kind:`overlap`,position:r.position,conflictsWith:[i.id]};n.set(o,e),t.push(e)}}}return{issues:t}}function A(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function _e(e){return!A(e)&&e.x+e.w<=me&&e.y+e.h<=he}function ve(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}var ye={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function be(e,t){let n=(e,t)=>T(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,ye.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,ye.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,ye.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,ye.runningCompletionWindowMillis)}}var xe=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`],Se=e.strictObject({oidc:e.literal(!0),policy:e.discriminatedUnion(`mode`,[e.strictObject({mode:e.literal(`authenticated`)}),e.strictObject({mode:e.literal(`subjects`)}),e.strictObject({mode:e.literal(`claim`),claim:e.string().min(1),match:e.enum([`any`,`all`])})])}),Ce=e.object({id:e.string().min(1),attempt:e.number().int().positive(),updatedAt:e.iso.datetime(),total:e.number().int().nonnegative()}),we=e.object({inspectedAt:e.iso.datetime(),inspectedRuns:e.number().int().min(0).max(8),complete:e.boolean(),samples:e.array(Ce).max(8),retryAt:e.iso.datetime().optional()});function Te(e,t){if(!e)return;let n=/^\d+$/.test(e)?t+Number(e)*1e3:Date.parse(e);return Number.isFinite(n)&&n>t?n:void 0}var j={board:`_board_12472_1`,header:`_header_12472_11`,attentionRail:`_attentionRail_12472_18`,attentionGlyph:`_attentionGlyph_12472_43`,"attention-beacon":`_attention-beacon_12472_46`,"attention-alarm":`_attention-alarm_12472_51`,"attention-steady":`_attention-steady_12472_59`,title:`_title_12472_81`,grid:`_grid_12472_87`,footerTools:`_footerTools_12472_97`,layoutWarning:`_layoutWarning_12472_102`,layoutWarningButton:`_layoutWarningButton_12472_105`,layoutWarningDialog:`_layoutWarningDialog_12472_123`,layoutWarningHeading:`_layoutWarningHeading_12472_136`,layoutWarningClose:`_layoutWarningClose_12472_154`,layoutWarningDownloads:`_layoutWarningDownloads_12472_162`,layoutWarningNote:`_layoutWarningNote_12472_181`,footer:`_footer_12472_97`};function Ee(e){return e.board?.attention?e.board.panels.flatMap(t=>{if(!t.attention)return[];let n=t.label??t.id;if(t.type===`http-value`&&t.facts)return t.facts.flatMap(r=>{let i=e.factSignals[t.id]?.[r.id],a=De(i);return a?[{panelId:t.id,label:n,reason:`${r.label}: ${a}`,factId:r.id}]:[]});let r=Oe(t.type,e.signals[t.id],e.updateHealth[t.id]);return r?[{panelId:t.id,label:n,reason:r}]:[]}):[]}function De(e){if(e?.failure)return`Updates unavailable — ${e.failure}`;if(e?.updateHealth)return`Updates unavailable — ${e.updateHealth.message}`;if(e?.envelope)return e.envelope.state===`error`?e.envelope.error.message:pe.safeParse(e.envelope.signal).success?void 0:`Invalid value`}function Oe(e,t,n){if(n)return`Updates unavailable — ${n.message}`;if(t){if(t.state===`error`)return t.error.message;if(e===`pipeline-status`){let e=k.safeParse(t.signal);return e.success?e.data.status===`failed`?`Pipeline failed`:void 0:`Invalid signal`}if(e===`pull-request-health`){let e=ce.safeParse(t.signal);if(!e.success)return`Invalid signal`;if(e.data.status===`failed`)return e.data.summary;let n=e.data.incompleteObservations?.[0];return n?`${n.label}: ${n.message}`:void 0}if(e===`http-value`)return pe.safeParse(t.signal).success?void 0:`Invalid value`}}var M={diagnostics:`_diagnostics_lseur_1`,button:`_button_lseur_5`,area:`_area_lseur_14`,warning:`_warning_lseur_31`,panels:`_panels_lseur_35`,actions:`_actions_lseur_43`};function ke({log:e,updateActivity:t}){let[n,r]=s(!1);c(e.subscribe,e.snapshot,e.snapshot);let i=e.count(),a=e.githubConsistencyIncidentCount(),o=e.summary();return f(`section`,{className:M.diagnostics,children:[f(`button`,{className:M.button,type:`button`,"aria-expanded":n,onClick:()=>r(!n),children:[`Diagnostics (`,i,`)`,a>0&&` · GitHub consistency ${a}`]}),n&&f(`div`,{className:M.area,children:[f(`p`,{children:[`Client `,e.clientVersion(),` · assets `,e.assetPath()]}),f(`p`,{children:[o.retained.eventCount,` retained browser-local events across`,` `,o.retained.sessionCount,` session`,o.retained.sessionCount===1?``:`s`,o.retained.firstEventAt&&o.retained.lastEventAt?` (${Ae(o.retained.firstEventAt,o.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),o.retained.evidenceMayBeIncomplete&&f(`p`,{className:M.warning,role:`alert`,children:[`Earlier evidence was pruned: `,o.retained.retention.eventsPrunedByCount,` at the 2,000-event cap and `,o.retained.retention.eventsPrunedByAge,` by the 7-day age limit. “No failures” applies only to the retained window.`]}),f(`p`,{children:[`Update failures: `,o.failures.clientUpdate,`; board fetch failures:`,` `,o.failures.boardFetch,`.`]}),e.githubConsistencyIncidentCount()>0&&f(`p`,{className:M.warning,role:`alert`,children:[`GitHub API consistency incidents: `,e.githubConsistencyIncidentCount(),`. A response older than the last accepted run was rejected; download diagnostics to report it.`]}),o.panels.length>0&&d(`div`,{className:M.panels,children:o.panels.map(e=>f(`p`,{children:[d(`strong`,{children:e.panelId}),` — `,e.requests,` requests`,Object.keys(e.httpStatuses).length?`; HTTP ${Object.entries(e.httpStatuses).map(([e,t])=>`${e}×${t}`).join(`, `)}`:``,`; parse/network failures `,e.parseFailures,`/`,e.networkFailures,`; visible changes `,e.visibleStateChanges,`; latest`,` `,e.latestRendered?`${e.latestRendered.state}${e.latestRendered.status?`/${e.latestRendered.status}`:``}`:`not rendered`,`.`,e.latestFailedObservation&&f(u,{children:[` `,`Failure: `,e.latestFailedObservation.reason,`. Support reference:`,` `,d(`code`,{children:e.latestFailedObservation.supportReference??`not provided`}),`.`]})]},e.panelId))}),f(`div`,{className:M.actions,children:[d(`button`,{className:M.button,type:`button`,onClick:()=>{let n=new Blob([JSON.stringify(e.export(t?{updateActivity:t()}:{}),null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`dashboard-diagnostics-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,i.click(),URL.revokeObjectURL(r)},children:`Download`}),d(`button`,{className:M.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function Ae(e,t){return e===t?e:`${e} to ${t}`}function je(){try{return window.localStorage}catch{return}}function Me(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function Ne(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function Pe(e,t){try{e?.removeItem(t)}catch{}}function Fe(e,t,n=0){let r=new Map,i=new Set,a=0,o=0;for(let t of e){if(i.add(t.sessionId),t.kind===`client-update-failure`&&a++,(t.kind===`board-fetch-failure`||t.kind===`board-fetch-parse-failure`)&&o++,!(`panelId`in t))continue;let e=r.get(t.panelId)??{panelId:t.panelId,requests:0,httpStatuses:{},parseFailures:0,networkFailures:0,visibleStateChanges:0};if(t.kind===`panel-fetch-start`&&e.requests++,t.kind===`panel-fetch-response`){if(t.status!==void 0){let n=String(t.status);e.httpStatuses[n]=(e.httpStatuses[n]??0)+1}t.failure&&(e.latestFailedObservation=t.failure)}t.kind===`panel-fetch-parse-failure`&&e.parseFailures++,t.kind===`panel-fetch-failure`&&e.networkFailures++,t.kind===`panel-rendered`&&(e.visibleStateChanges++,e.latestRendered=t.rendered),r.set(t.panelId,e)}let s=e.map(e=>e.at).sort(),c=t.eventsPrunedByAge+t.eventsPrunedByCount;return{githubConsistencyIncidents:n,retained:{eventCount:e.length,firstEventAt:s[0],lastEventAt:s.at(-1),sessionCount:i.size,retention:t,evidenceMayBeIncomplete:c>0},failures:{clientUpdate:a,boardFetch:o},panels:[...r.values()].sort((e,t)=>e.panelId.localeCompare(t.panelId))}}var Ie=`0.31.64`,Le=`ze-great-dashboard.diagnostics.v2`,Re=`ze-great-dashboard.diagnostics.v1`,ze=2e3,Be=6048e5,Ve=[`session-start`,`auth-session`,`client-update-check`,`client-update-response`,`client-update-failure`,`client-update-detected`,`board-fetch-start`,`board-fetch-response`,`board-fetch-parse-failure`,`board-fetch-failure`,`layout-analyzed`,`panel-fetch-start`,`panel-fetch-response`,`panel-fetch-parse-failure`,`panel-fetch-failure`,`panel-rendered`,`test-history-repair`],He=class{env;storage;now;events=[];retention=Ge();revision=0;incidents=[];listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=je(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,Pe(this.storage,Re),this.events=this.read(),this.record({kind:`session-start`})}recordGithubConsistencyIncident(e){this.incidents.push({...e,at:this.now().toISOString(),board:this.env.board}),this.persist(),this.revision++,this.notify()}githubConsistencyIncidentCount=()=>this.incidents.length;record(e){let t=qe([...this.events,{...e,schemaVersion:2,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board,clientVersion:Ie,clientAssetPath:this.env.assetPath,clientAssetPathId:this.env.assetPathId}],this.now(),this.retention);this.events=t.events,this.retention=t.retention,this.persist(),this.revision++,this.notify()}count=()=>this.events.length;clientVersion=()=>Ie;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>Fe(this.events,this.retention,this.incidents.length);retainedEvidence=()=>({events:[...this.events],retention:{...this.retention}});clear(){this.events=[],this.incidents=[],this.retention=Ge(),Pe(this.storage,Le),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=e=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:Ie,assetPath:this.env.assetPath,assetPathId:this.env.assetPathId,board:this.env.board,sessionId:this.sessionId},events:this.events,githubConsistencyIncidents:this.incidents,summary:this.summary(),...e});read(){let e=Me(this.storage,Le);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(Je))return Pe(this.storage,Le),[];let t=qe(e.events.map(e=>({...e,schemaVersion:2})),this.now(),Ke(e.retention));return this.retention=t.retention,this.incidents=Ue(e.githubConsistencyIncidents),t.events}persist(){Ne(this.storage,Le,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function Ue(e){return Array.isArray(e)?e.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.at==`string`&&typeof t.board==`string`&&typeof t.panelId==`string`&&typeof t.endpoint==`string`&&!!t.accepted&&!!t.regressed&&!!t.response}):[]}function We(e){let t=Object.fromEntries([[`cacheControl`,`cache-control`],[`etag`,`etag`],[`lastModified`,`last-modified`],[`date`,`date`],[`age`,`age`]].flatMap(([t,n])=>{let r=e.get(n);return r?[[t,r]]:[]}));return Object.keys(t).length?t:void 0}function Ge(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function Ke(e){if(!e||typeof e!=`object`)return Ge();let t=e;return{eventsPrunedByAge:typeof t.eventsPrunedByAge==`number`&&t.eventsPrunedByAge>=0?t.eventsPrunedByAge:0,eventsPrunedByCount:typeof t.eventsPrunedByCount==`number`&&t.eventsPrunedByCount>=0?t.eventsPrunedByCount:0}}function qe(e,t,n){let r=t.valueOf()-Be,i=e.filter(e=>Number.isFinite(new Date(e.at).valueOf())&&new Date(e.at).valueOf()>=r),a=e.length-i.length,o=Math.max(0,i.length-ze);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function Je(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.schemaVersion===void 0||t.schemaVersion===2)&&typeof t.at==`string`&&Number.isFinite(new Date(t.at).valueOf())&&typeof t.sessionId==`string`&&typeof t.board==`string`&&Ve.includes(t.kind)}function N(e,t,n,r=globalThis.fetch,i={}){let a=new Headers(n?.headers);return a.set(`X-Dashboard-Client-Version`,Ie),a.set(`X-Dashboard-Client-Origin`,globalThis.window.location.origin),a.set(`X-Dashboard-Client-Asset-Id`,e.assetPathId),i.accessToken&&a.set(`authorization`,`Bearer ${i.accessToken}`),r(t,{...n,headers:a}).then(e=>((e.status===401||e.status===403)&&i.onAuthenticationFailure?.(e.status),e))}function Ye({board:e,layout:t,env:n,auth:i}){let[a,o]=s(!1),c=`layout-warning-${e}`;r(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let l=`${n.proxyPath}/boards/${encodeURIComponent(e)}`;return f(`div`,{className:j.layoutWarning,"data-layout-warning":!0,children:[f(`button`,{className:j.layoutWarningButton,type:`button`,"aria-label":`Layout warnings (${t.issues.length})`,"aria-expanded":a,"aria-controls":c,onClick:()=>o(!a),children:[d(`span`,{"aria-hidden":`true`,children:`⚠`}),d(`span`,{children:t.issues.length})]}),a&&f(`aside`,{className:j.layoutWarningDialog,id:c,role:`dialog`,"aria-labelledby":`${c}-title`,"aria-modal":`false`,children:[f(`div`,{className:j.layoutWarningHeading,children:[d(`strong`,{id:`${c}-title`,children:`Layout warnings`}),d(`button`,{className:j.layoutWarningClose,type:`button`,"aria-label":`Close layout warnings`,onClick:()=>o(!1),children:`×`})]}),f(`p`,{children:[t.issues.length,` layout issue`,t.issues.length===1?``:`s`,` detected against the intended 12×12 space. The live board is unchanged: explicit overlaps remain overlapped and overflow continues in implicit rows.`]}),d(`ul`,{children:t.issues.map(e=>f(`li`,{children:[d(`strong`,{children:e.panelId}),`: `,e.kind,` at (`,e.position.x,`,`,` `,e.position.y,`), `,e.position.w,`×`,e.position.h,e.conflictsWith.length?`; overlaps ${e.conflictsWith.join(`, `)}`:``]},`${e.panelId}-${e.kind}`))}),f(`div`,{className:j.layoutWarningDownloads,children:[d(`button`,{type:`button`,onClick:()=>void Xe(n,`${l}/rendered`,i),children:`Download legal rendered layout`}),d(`button`,{type:`button`,onClick:()=>void Xe(n,`${l}/authored`,i),children:`Download authored layout`})]}),d(`p`,{className:j.layoutWarningNote,children:`The legal rendered layout normalizes the currently visible explicit area into 12×12 and makes the smallest deterministic adjustments needed to avoid collisions. The authored layout preserves the original coordinates exactly.`})]})]})}async function Xe(e,t,n){let r=await N(e,t,void 0,globalThis.fetch,n);if(!r.ok)throw Error(`Layout download returned ${r.status}`);let i=document.createElement(`a`);i.href=URL.createObjectURL(await r.blob()),i.download=r.headers.get(`content-disposition`)?.match(/filename="([^"]+)"/)?.[1]??`layout.yaml`,i.click(),URL.revokeObjectURL(i.href)}var Ze={auth:`_auth_19xn9_1`,signout:`_signout_19xn9_24`},Qe=class{values=new Map;async set(e,t){this.values.set(e,t)}async get(e){return this.values.get(e)??null}async remove(e){let t=this.values.get(e)??null;return this.values.delete(e),t}async getAllKeys(){return[...this.values.keys()]}};function $e(e){let t=new h({authority:e.issuer,client_id:e.clientId,redirect_uri:`${window.location.origin}/`,post_logout_redirect_uri:`${window.location.origin}/`,response_type:`code`,scope:`openid profile offline_access`,resource:e.audience,extraQueryParams:{audience:e.audience},userStore:new Qe,stateStore:new g({store:window.sessionStorage}),automaticSilentRenew:!0,maxSilentRenewTimeoutRetries:1}),n=et(window);return n&&t.storeUser(new m({access_token:n.accessToken,expires_at:n.expiresAt,scope:n.scope,token_type:n.tokenType,profile:{iss:e.issuer,aud:e.clientId,exp:n.expiresAt,iat:n.expiresAt-1,sub:`playwright-token-bootstrap`}})),t}function et(e=window){let t=e.__DASHBOARD_OIDC_TEST_BOOTSTRAP__;if(delete e.__DASHBOARD_OIDC_TEST_BOOTSTRAP__,t&&typeof t.accessToken==`string`&&t.accessToken&&Number.isSafeInteger(t.expiresAt)&&typeof t.scope==`string`&&typeof t.tokenType==`string`)return t}function tt({env:e,auth:t,children:r}){let i=a(()=>$e(t),[t]),[o,c]=s(),l=a(()=>o?{...e,board:o}:e,[e,o]),u=a(()=>new He(l),[l]),f=n(e=>{let t=typeof e==`string`&&e?e:void 0,n=t?`/boards/${encodeURIComponent(t)}`:window.location.pathname;window.history.replaceState({},document.title,n),c(t)},[]);return d(_,{userManager:i,onSigninCallback:e=>f(e?.state),children:d(nt,{env:l,diagnostics:u,diagnosticsControl:d(ke,{log:u}),completeCallback:f,children:(e,t)=>r(e,t,l,u)})})}function nt({env:e,diagnostics:t,diagnosticsControl:i,completeCallback:a,children:c}){let l=y(),[m,h]=s(!1),[g]=s(v),[_,b]=s(),x=o(!1),S=o(void 0),C=o(void 0),w=`dashboard.signed-out:${e.auth?.issuer}:${e.auth?.clientId}`,ee=n(()=>h(!0),[]),{events:te,user:T,error:E,signinRedirect:ne}=l,D=!!T&&(T===_||T.expired),re=window.location.pathname.startsWith(`/boards/`)?e.board:void 0;r(()=>{l.isAuthenticated||h(!1)},[l.isAuthenticated]),r(()=>{if(T?.expires_at)return te.addAccessTokenExpired(()=>b(T))},[te,T]),r(()=>{T&&!T.expired&&T!==C.current&&(C.current=T,t.record({kind:`auth-session`,outcome:`ready`,hasRefreshToken:!!T.refresh_token}))},[t,T]),r(()=>{if(!E||E===S.current)return;S.current=E;let e=E.innerError;t.record({kind:`auth-session`,outcome:`failed`,phase:E.source===`renewSilent`?`renewal`:E.source===`signinCallback`?`callback`:`navigation`,reason:rt(e)}),E.source===`signinCallback`&&v()&&a(e instanceof p?e.state:void 0)},[a,t,E]);let O=!x.current&&!l.isLoading&&!l.activeNavigator&&!m&&(!g||l.isAuthenticated)&&(!l.isAuthenticated||D&&E?.source===`renewSilent`)&&!window.sessionStorage.getItem(w);return r(()=>{O&&!x.current&&(x.current=!0,t.record({kind:`auth-session`,outcome:`restoring`,trigger:D?`expiry`:`startup`}),ne({prompt:`none`,redirectMethod:`replace`,state:re}))},[t,D,re,O,ne]),O||l.isLoading||l.isAuthenticated&&D&&!E?d(`main`,{className:Ze.auth,"aria-live":`polite`,children:O||x.current||D?`Restoring session…`:`Signing in…`}):m?f(`main`,{className:Ze.auth,children:[d(`h1`,{children:`Access denied`}),d(`p`,{children:`Your authenticated identity is not permitted to view this dashboard.`}),i]}):!l.isAuthenticated||D||!T?.access_token?f(`main`,{className:Ze.auth,children:[d(`h1`,{children:e.board}),d(`p`,{children:`Sign in to view the dashboard.`}),d(`button`,{type:`button`,onClick:()=>{window.sessionStorage.removeItem(w),t.record({kind:`auth-session`,outcome:`sign-in-selected`}),ne({state:re})},children:`Sign in`}),i]}):f(u,{children:[d(`button`,{className:Ze.signout,type:`button`,onClick:()=>{window.sessionStorage.setItem(w,`1`),t.record({kind:`auth-session`,outcome:`sign-out-selected`}),l.signoutRedirect()},children:`Sign out`}),c(T.access_token,ee)]})}function rt(e){if(e instanceof p)switch(e.error){case`login_required`:case`interaction_required`:case`consent_required`:case`account_selection_required`:case`invalid_grant`:return e.error}return e instanceof Error&&e.name===`ErrorTimeout`?`timeout`:`other`}var P={panel:`_panel_1n078_1`,attentionActive:`_attentionActive_1n078_22`,content:`_content_1n078_26`,evidence:`_evidence_1n078_38`,sourceAction:`_sourceAction_1n078_42`,details:`_details_1n078_46`,statusBand:`_statusBand_1n078_54`,error:`_error_1n078_80`,wide:`_wide_1n078_83`,"density-comfortable":`_density-comfortable_1n078_86`,"density-compact":`_density-compact_1n078_93`,label:`_label_1n078_103`,typeGlyph:`_typeGlyph_1n078_114`,identityText:`_identityText_1n078_117`,hint:`_hint_1n078_123`,branch:`_branch_1n078_129`,observed:`_observed_1n078_133`,meta:`_meta_1n078_139`,metaValue:`_metaValue_1n078_142`,compactValue:`_compactValue_1n078_146`,warning:`_warning_1n078_149`,serious:`_serious_1n078_152`,status:`_status_1n078_54`,statusGlyph:`_statusGlyph_1n078_160`,compactOnlyStatus:`_compactOnlyStatus_1n078_163`,passed:`_passed_1n078_169`,failed:`_failed_1n078_172`,running:`_running_1n078_176`,cancelled:`_cancelled_1n078_179`,unknown:`_unknown_1n078_180`,shallow:`_shallow_1n078_213`,"density-auto":`_density-auto_1n078_214`,fullValue:`_fullValue_1n078_372`,statusText:`_statusText_1n078_467`};function it({label:e,hint:t,wide:n=!1}){return f(`section`,{className:`${P.panel} ${n?P.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[d(`h2`,{className:P.label,children:e}),d(`p`,{className:P.hint,children:t})]})}function at(e){switch(e){case`unauthorized`:return{label:`Access denied`,emphasis:`serious`};case`not-found`:return{label:`Source not found`,emphasis:`serious`};case`unreachable`:case`upstream-error`:return{label:`Source unavailable`,emphasis:`serious`};case`no-runs`:return{label:`No workflow runs`,emphasis:`warning`}}}var F={fact:`_fact_bnc4n_1`,facts:`_facts_bnc4n_5`,factCell:`_factCell_bnc4n_12`,factSource:`_factSource_bnc4n_31`};function ot(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}var st={passed:{glyph:`✓`,label:`Passed`},failed:{glyph:`✕`,label:`Failed`},warning:{glyph:`⚠`,label:`Warning`},running:{glyph:`↻`,label:`Running`},cancelled:{glyph:`⊘`,label:`Cancelled`},unknown:{glyph:`?`,label:`Unknown`}};function ct(e){return X(e)?.symbol}function I({children:e,className:t,title:n}){return d(`p`,{className:`${P.hint} ${t??``}`,title:n,children:e})}function L({glyph:e,label:t,value:n,compact:r,title:i,observed:a=!1,emphasis:o,className:s}){return f(`p`,{className:`${P.hint} ${a?P.observed:``} ${o?P[o]:``} ${P.meta} ${s??``}`,"data-panel-meta":!0,children:[d(`span`,{"aria-hidden":`true`,children:e}),` `,f(`span`,{className:`screen-reader-only`,children:[t,`: `]}),f(`span`,{className:P.metaValue,title:i,children:[d(`span`,{className:P.fullValue,children:n}),r&&d(`span`,{className:P.compactValue,"aria-hidden":`true`,children:r.kind===`short-value`?r.value:null})]})]})}function R({children:e,className:t,priority:n=`secondary`,anchor:r}){return d(`div`,{className:`${P.evidence} ${t??``}`,"data-panel-evidence":!0,"data-panel-evidence-priority":n,"data-panel-anchor":r,children:e})}function z({status:e,emphasis:t,glyph:n,label:r,compactOnly:i=!1}){return f(`p`,{className:`${P.status} ${e?P[e]:``} ${t?P[t]:``} ${i?P.compactOnlyStatus:``}`,"data-panel-status":!0,children:[n&&d(`span`,{className:P.statusGlyph,"aria-hidden":`true`,children:n}),n&&r&&` `,d(`span`,{className:P.statusText,children:r})]})}function lt({children:e,emphasis:t}){return d(`p`,{className:`${P.status} ${t?P[t]:``}`,children:e})}function B({panel:e,envelope:t,sourceLink:n,busy:r,attentionActive:i=!1,error:a=!1,field:o,layout:s,children:c}){let l=e.density??`auto`,u=e.position,p=ct(e.type),m=u!==void 0&&u.h<=2,h=u!==void 0&&u.h<=3;return f(`section`,{className:`${P.panel} ${P[`density-${l}`]} ${m?P.shallow:``} ${h?P.short:``} ${a?P.error:``} ${i?P.attentionActive:``}`,id:`panel-${e.id}`,style:ot(e),"aria-busy":r===!0?!0:t||r===!1?void 0:!0,"data-panel":!0,"data-panel-id":e.id,"data-panel-position":u?`${u.x},${u.y},${u.w},${u.h}`:void 0,"data-density":l,"data-shallow":m,"data-short":h,"data-error":a||void 0,"data-panel-type":e.type,"data-attention-active":i||void 0,children:[o,d(ut,{panelId:e.id,link:t?.link??n}),f(`div`,{className:`${P.content} ${s===`status-band`?P.statusBand:``}`,"data-panel-content":!0,"data-panel-layout":s,children:[f(`h2`,{className:P.label,"data-panel-anchor":`identity`,children:[p&&d(`span`,{className:P.typeGlyph,"aria-hidden":`true`,title:p.label,"data-panel-type-glyph":!0,children:p.glyph}),d(`span`,{className:P.identityText,"data-panel-identity-text":!0,children:e.label??e.id})]}),c]})]})}function ut({panelId:e,link:t}){return t?f(`a`,{className:P.sourceAction,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,"data-panel-action":`source`,"data-panel-link":!0,children:[d(`span`,{"aria-hidden":`true`,children:`↗`}),d(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}function V({value:e,label:t=`Observed`}){return d(mt,{value:e,label:t})}function dt({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r}){return n&&r?d(mt,{value:r,label:`Started`}):d(mt,{value:e??t,label:e?`Last update`:`Observed`})}function ft({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return f(u,{children:[d(L,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),d(mt,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function pt({value:e}){return d(mt,{value:e,label:`Last confirmed`})}function mt({value:e,label:t}){let n=new Date(e),r=n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),i=Date.now()-n.getTime(),a=`${t} ${ht(i)}`;return d(L,{glyph:`◷`,label:t,value:a,compact:{kind:`short-value`,value:gt(i)},title:`${t} at ${r}`,observed:!0})}function ht(e){if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ${t%60}m ago`}function gt(e){if(e<6e4)return`now`;let t=Math.floor(e/6e4);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function _t({panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}){if(e.facts)return d(vt,{panel:e,attentionActive:n,facts:i});if(!t)return d(B,{panel:e,attentionActive:n,children:d(R,{children:d(I,{children:`Loading…`})})});if(t.state===`error`){let r=at(t.error.kind);return d(B,{panel:e,envelope:t,attentionActive:n,error:!0,children:f(R,{children:[d(z,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),d(I,{children:t.error.message})]})})}let a=pe.safeParse(t.signal);return a.success?d(B,{panel:e,envelope:t,attentionActive:n,children:f(R,{className:F.fact,children:[d(z,{glyph:`✓`,label:`Value read`,compactOnly:!0}),d(lt,{children:String(a.data.value)}),d(V,{value:t.observedAt}),r&&d(ft,{health:r})]})}):d(B,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(R,{children:d(z,{glyph:`⚠`,label:`Invalid value`})})})}function vt({panel:e,attentionActive:t,facts:n}){return e.facts?d(B,{panel:e,attentionActive:t,children:d(R,{children:d(`div`,{className:F.facts,"data-http-value-facts":!0,children:e.facts.map(e=>d(yt,{label:e.label,observation:n?.[e.id]},e.id))})})}):null}function yt({label:e,observation:t}){let n=t?.envelope;if(!n)return f(`section`,{className:F.factCell,"data-http-value-fact":!0,children:[d(`h3`,{children:e}),d(lt,{emphasis:t?.failure?`serious`:void 0,children:t?.failure?`⚠ Updates unavailable`:`Loading…`}),t?.updateHealth&&d(ft,{health:t.updateHealth})]});if(n.state===`error`){let t=at(n.error.kind);return f(`section`,{className:F.factCell,"data-http-value-fact":!0,"data-error":!0,children:[d(bt,{label:e,link:n.link}),d(`h3`,{children:e}),d(z,{glyph:`⚠`,label:t.label,emphasis:t.emphasis}),d(I,{children:n.error.message}),d(V,{value:n.observedAt})]})}let r=pe.safeParse(n.signal);return r.success?f(`section`,{className:F.factCell,"data-http-value-fact":!0,children:[d(bt,{label:e,link:n.link}),d(`h3`,{children:e}),d(lt,{children:String(r.data.value)}),d(V,{value:n.observedAt})]}):f(`section`,{className:F.factCell,"data-http-value-fact":!0,"data-error":!0,children:[d(bt,{label:e,link:n.link}),d(`h3`,{children:e}),d(z,{glyph:`⚠`,label:`Invalid value`,emphasis:`serious`}),d(V,{value:n.observedAt})]})}function bt({label:e,link:t}){return t?f(`a`,{className:F.factSource,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,children:[d(`span`,{"aria-hidden":`true`,children:`↗`}),d(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}var xt={variant:`_variant_14ks8_1`,variantPrefix:`_variantPrefix_14ks8_9`},St={field:`_field_1x3vm_1`,grid:`_grid_1x3vm_10`,piece:`_piece_1x3vm_14`,cell:`_cell_1x3vm_34`,clearingCell:`_clearingCell_1x3vm_38`,"clear-cell":`_clear-cell_1x3vm_1`},Ct=.85,wt=[[{x:0,y:0},{x:1,y:0}],[{x:0,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:2,y:0}],[{x:0,y:0},{x:0,y:1},{x:1,y:1}]];function Tt(e,t){return e>t?`horizontal`:`vertical`}function Et(e,t=e===`horizontal`?12:3,n=e===`horizontal`?3:12){let r=Math.max(1,t*.8),i=Math.max(1,n*.8),a=Math.max(24,Math.min(42,Math.min(r,i)/4)),o=Math.max(3,Math.min(24,Math.round(r/a))),s=Math.max(3,Math.min(16,Math.round(i/a)));return e===`horizontal`?{columns:Math.max(o,s),rows:s}:{columns:o,rows:Math.max(s,o)}}function Dt(e,t,n){let r=Math.max(...e.map(e=>e.x)),i=Math.max(...e.map(e=>e.y));return r<t&&i<n}function Ot(e,t){return e.cells.some(n=>t.cells.some(r=>e.x+n.x===t.x+r.x&&e.y+n.y===t.y+r.y))}function kt(e,t,n){let r=wt.filter(e=>Dt(e,t,n));return r[Rt(e,r.length)]??[{x:0,y:0}]}function At(e,t,n,r,i,a=0,o=!1){let s=Math.max(...e.map(e=>e.x))+1,c=Math.max(...e.map(e=>e.y))+1,l=[];for(let a=0;a<=r-c;a++)for(let c=0;c<=n-s;c++){let s={id:-1,bornAt:0,cells:e,x:c,y:a,phase:`settled`};if(i.some(e=>Ot(s,e))||!Lt(e,t,n,r,s,i))continue;let u=t===`vertical`?e.filter(e=>a+e.y===r-1||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x&&t.y+n.y===a+e.y+1))).length:e.filter(e=>c+e.x===0||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x-1&&t.y+n.y===a+e.y))).length;o&&u<It(e,t)||l.push({x:c,y:a,support:u})}l.sort((e,n)=>n.support-e.support||(t===`vertical`?n.y-e.y||e.x-n.x:e.x-n.x||e.y-n.y));let u=l[0]?.support,d=l.filter(e=>e.support===u),f=d[Rt(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function jt(e,t,n,r,i,a){let o=wt.flatMap((o,s)=>{if(!Dt(o,t,n))return[];let c=At(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[Rt(i,o.length)]}function Mt(e,t,n){return Math.ceil(e*t*Ct*Math.min(1,Math.max(0,n)))}function Nt(e){return e.reduce((e,t)=>e+t.cells.length,0)}function Pt(e,t,n,r,i){let a=e===`vertical`?n-1:0,o=new Set(r.flatMap(t=>t.cells.filter(n=>e===`vertical`?t.y+n.y===a:t.x+n.x===a).map(n=>e===`vertical`?t.x+n.x:t.y+n.y))),s=e===`vertical`?t:n,c=o.size===s;if(!c&&!i||o.size===0)return;let l=[];return{shapes:r.flatMap(t=>{let n=t.cells.filter(n=>{let r=e===`vertical`?t.y+n.y===a:t.x+n.x===a;return r&&l.push({x:t.x+n.x,y:t.y+n.y}),!r});return n.length===0?[]:[{...t,cells:n,y:e===`vertical`?t.y+1:t.y,x:e===`horizontal`?t.x-1:t.x}]}),cleared:l,complete:c}}function Ft(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=kt(i,t,n),c=At(s,e,t,n,a,i+1);if(!c)break;a.push({id:o,bornAt:0,cells:s,x:c.x,y:c.y,phase:`settled`})}return a}function It(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Lt(e,t,n,r,i,a){let o=Math.max(...e.map(e=>e.x))+1,s=Math.max(...e.map(e=>e.y))+1;if(t===`vertical`){for(let e=0;e<=i.y;e+=1)if(a.some(t=>Ot({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>Ot({...i,x:e},t)))return!1;return i.x+o<=n}function Rt(e,t){if(t<=1)return 0;let n=Math.sin(e*12.9898+78.233)*43758.5453;return Math.floor((n-Math.floor(n))*t)}var zt=1250;function Bt(){return{settled:[],active:[],nextPieceAt:zt,recycleUntil:0,nextId:0,recycling:!1,clearingCells:[]}}function Vt(e,t){if(t.elapsed<e.recycleUntil)return e;let n=e.settled,r=e.active,i=e.nextPieceAt,a=e.recycleUntil,o=e.nextId,s=e.recycling,c=e.clearingCells;if(s&&(s=!1,c=[]),t.elapsed>=i&&r.length===0){let a=Mt(t.columns,t.rows,t.progress);if(t.progress<1&&Nt(n)>=a)return{...e,recycling:s,clearingCells:c};let l=jt(t.direction,t.columns,t.rows,n,t.seed+o*17+1,!t.overdue);if(!l&&(t.progress>=1||t.estimatedDurationMs===void 0)){let r=Pt(t.direction,t.columns,t.rows,n,!0);if(r)return{...e,settled:r.shapes,recycleUntil:t.elapsed+500,nextPieceAt:t.elapsed+500,recycling:!0,clearingCells:r.cleared}}if(l){let e=Math.max(...l.shape.map(e=>e.y))+1;r=[{id:o,bornAt:t.elapsed,cells:l.shape,x:t.direction===`horizontal`?t.columns-Math.max(...l.shape.map(e=>e.x))-.5:l.destination.x,y:t.direction===`vertical`?-e+.5:l.destination.y,targetX:l.destination.x,targetY:l.destination.y,phase:`entry`}],o+=1,i+=Ut(t.estimatedDurationMs,t.columns,t.rows)}}let l=[];for(let e of r){let r=t.elapsed-e.bornAt,i=Math.min(1,Math.max(0,(r-250)/850));if(i>=1&&e.targetX!==void 0&&e.targetY!==void 0){n=[...n,{...e,x:e.targetX,y:e.targetY,phase:`settled`}];continue}let a=t.direction===`horizontal`?t.columns-Math.max(...e.cells.map(e=>e.x))-1:e.targetX??e.x,o=t.direction===`vertical`?0:e.targetY??e.y,s=Math.min(1,Math.max(0,r/1100));l.push({...e,x:t.direction===`horizontal`?a+((e.targetX??a)-a)*i:a,y:t.direction===`vertical`?o+((e.targetY??o)-o)*i:o,phase:r<250?`entry`:s<.35?`align`:`travel`})}return{settled:n,active:l,nextPieceAt:i,recycleUntil:a,nextId:o,recycling:s,clearingCells:c}}function Ht(e){return[...e.settled,...e.active]}function Ut(e,t,n){let r=Math.ceil(t*n*.85);return e===void 0||r<=0?zt:Math.max(400,e/Math.max(1,Math.ceil(r/3)))}var Wt=50;function Gt({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let a=o(null),[c,l]=s({...Et(`vertical`),direction:`vertical`}),[u,p]=s(!1),[m,h]=s(Bt),g=o(c),_=o(void 0),v=o(e),y=o(i),b=o(Bt()),x=o(Date.now());r(()=>{v.current=e,y.current=i},[e,i]),r(()=>{let e=a.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();if(t.width===0||t.height===0)return;let n=_.current??Tt(t.width,t.height);_.current=n;let r={...Et(n,t.width,t.height),direction:n};g.current=r,l(r)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),r(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{if(b.current=Bt(),x.current=Date.now(),u){let e=Ft(c.direction,c.columns,c.rows,y.current,Math.max(1,Math.floor(v.current*6)));h({...Bt(),settled:e})}else h(b.current)},[c,u]),r(()=>{if(u)return;let e=window.setInterval(()=>{let e=Vt(b.current,{elapsed:Date.now()-x.current,...g.current,progress:v.current,estimatedDurationMs:t,overdue:n,seed:y.current});b.current=e,h(e)},Wt);return()=>window.clearInterval(e)},[t,n,u]);let S=Ht(m);return d(`div`,{ref:a,className:St.field,"data-running-part":`falling-shapes-field`,"data-overdue":n||void 0,"data-direction":c.direction,"data-recycling":m.recycling||void 0,style:{"--shape-columns":c.columns,"--shape-rows":c.rows},children:f(`div`,{className:St.grid,children:[m.clearingCells.map(e=>d(`span`,{className:St.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),S.map(e=>d(`div`,{className:St.piece,"data-piece":e.id,"data-piece-phase":e.phase,style:{"--piece-x":e.x,"--piece-y":e.y,"--piece-width":Math.max(...e.cells.map(e=>e.x))+1,"--piece-height":Math.max(...e.cells.map(e=>e.y))+1},children:e.cells.map(e=>d(`span`,{className:St.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}var H={scene:`_scene_1u5dz_1`,ground:`_ground_1u5dz_6`,groundGlow:`_groundGlow_1u5dz_12`,groundTerrain:`_groundTerrain_1u5dz_25`,groundTerrainOverdrive:`_groundTerrainOverdrive_1u5dz_26`,"ground-stream":`_ground-stream_1u5dz_1`,groundRunway:`_groundRunway_1u5dz_48`,"runway-stream":`_runway-stream_1u5dz_1`,cloudLayer:`_cloudLayer_1u5dz_62`,cloudLayerFar:`_cloudLayerFar_1u5dz_67`,cloudLayerNear:`_cloudLayerNear_1u5dz_70`,plane:`_plane_1u5dz_73`,aircraft:`_aircraft_1u5dz_83`,windows:`_windows_1u5dz_90`,"holding-pattern":`_holding-pattern_1u5dz_1`,cloud:`_cloud_1u5dz_62`,"cloud-stream":`_cloud-stream_1u5dz_1`,cloudOne:`_cloudOne_1u5dz_129`,cloudTwo:`_cloudTwo_1u5dz_135`,cloudThree:`_cloudThree_1u5dz_141`,cloudFour:`_cloudFour_1u5dz_147`,cloudFive:`_cloudFive_1u5dz_153`,cloudSix:`_cloudSix_1u5dz_159`,cloudSeven:`_cloudSeven_1u5dz_165`,cloudEight:`_cloudEight_1u5dz_171`,"rough-air":`_rough-air_1u5dz_1`},Kt={x:8,y:74},qt={x:22,y:74},Jt={x:38,y:30},Yt={x:65,y:30},Xt={x:88,y:48};function Zt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Qt(e,t,n,r,i){let a=1-i;return{x:a**3*e.x+3*a**2*i*t.x+3*a*i**2*n.x+i**3*r.x,y:a**3*e.y+3*a**2*i*t.y+3*a*i**2*n.y+i**3*r.y}}function $t(e,t,n,r,i=0){return{worldX:e.x,worldY:e.y,cameraX:t.x,cameraY:t.y,x:e.x-t.x,y:e.y-t.y,pitch:n,groundOffsetY:i,stage:r}}function en(e){return{x:e.x-50,y:e.y-50}}function tn(e,t){if(t){let e={x:50,y:30};return $t(e,en(e),0,`holding`,20)}let n=Math.min(1,Math.max(0,e));if(n<.18)return $t(Zt(Kt,qt,n/.18),{x:0,y:0},0,`rollout`);if(n<.35){let e=(n-.18)/.17,t=Qt(qt,{x:28,y:74},{x:32,y:30},Jt,e),r=e*e*(3-2*e),i=en(t);return $t(t,{x:i.x*r,y:i.y*r},-7,`climb`,20*r)}if(n<.7){let e=Zt(Jt,Yt,(n-.35)/.35);return $t(e,en(e),0,`cruise`,20)}let r=(n-.7)/.3,i=Qt(Yt,{x:72,y:30},{x:80,y:47},Xt,r),a=r*r*(3-2*r);return $t(i,en(i),4,`approach`,20*(1-a))}function nn({progress:e,indeterminate:t}){let n=tn(e,t),r={"--flight-x":`${n.x}%`,"--flight-y":`${n.y}%`,"--flight-camera-x":`${n.cameraX}%`,"--flight-camera-y":`${n.cameraY}%`,"--flight-ground-x":`${-n.cameraX}%`,"--flight-ground-y":`${-n.cameraY+n.groundOffsetY}%`,"--flight-cloud-x":`${-n.cameraX*.45}%`,"--flight-cloud-y":`${-n.cameraY*.32}%`,"--flight-pitch":`${n.pitch}deg`};return f(`span`,{className:H.scene,"data-running-part":`flight-path`,"data-flight-stage":n.stage,style:r,children:[f(`span`,{className:H.ground,"data-running-part":`flight-ground`,children:[d(`span`,{className:H.groundGlow}),d(`span`,{className:H.groundTerrain,"data-running-part":`flight-ground-terrain`}),d(`span`,{className:H.groundTerrainOverdrive,"data-running-part":`flight-ground-overdrive`}),d(`span`,{className:H.groundRunway,"data-running-part":`flight-ground-runway`})]}),f(`span`,{className:`${H.cloudLayer} ${H.cloudLayerFar}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`far`,children:[d(`span`,{className:`${H.cloud} ${H.cloudOne}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudTwo}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudThree}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudFour}`,"data-running-part":`flight-cloud`})]}),d(`span`,{className:H.plane,"data-running-part":`flight-plane`,children:f(`svg`,{className:H.aircraft,viewBox:`0 0 72 40`,"aria-hidden":`true`,children:[d(`path`,{"data-running-part":`flight-fuselage`,d:`M3 21c5-4 12-6 23-6h27c8 0 13 2 16 5-3 3-8 5-16 5H26C15 25 8 24 3 21Z`}),d(`path`,{"data-running-part":`flight-wing`,d:`m33 23 17 11h-12L23 24Z`}),d(`path`,{"data-running-part":`flight-tail`,d:`m13 17 5-11h7l-1 11Z`}),d(`path`,{className:H.windows,d:`M25 18h4v2h-4zm7 0h4v2h-4zm7 0h4v2h-4z`})]})}),f(`span`,{className:`${H.cloudLayer} ${H.cloudLayerNear}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`near`,children:[d(`span`,{className:`${H.cloud} ${H.cloudFive}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudSix}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudSeven}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudEight}`,"data-running-part":`flight-cloud`})]})]})}var U={frontier:`_frontier_xpzp3_1`,now:`_now_xpzp3_12`,routes:`_routes_xpzp3_20`,route:`_route_xpzp3_20`,trail:`_trail_xpzp3_41`,packet:`_packet_xpzp3_42`,"packet-stall":`_packet-stall_xpzp3_1`,"trail-backup":`_trail-backup_xpzp3_1`};function rn(){return f(u,{children:[d(`span`,{className:U.frontier,"data-running-part":`frontier`}),d(`span`,{className:U.now,"data-running-part":`transit-now`}),d(`span`,{className:U.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>d(`span`,{className:U.route},e))}),d(`span`,{className:U.trail,"data-running-part":`transit-trail`}),d(`span`,{className:U.packet,"data-running-part":`transit-packet`})]})}var an={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},on={field:`_field_ozs8n_1`,canvas:`_canvas_ozs8n_7`};function sn(e){let t=e*.25,n=e*.2,r=t<700||n<350?`snowfall`:n<530?`arrival`:n<1030?`hop`:`full`,i=un((n-(r===`full`?1030:530))/(r===`full`?1620:620),0,1),a=r===`full`?500+1e3*i:0,o=r===`arrival`?0:180+70*i,s=r===`arrival`?Math.min(900,n):350+550*i,c=e*.95,l=c-o;return{mode:r,bodyStart:e*.75-Math.min(2500,t),bodyEnd:e*.75,headStart:l-s-a,hopStart:l-s,land:l,settleEnd:l+(o?120+60*i:0),end:c}}function cn(e,t,n){return n===t?Number(e>=n):un((e-t)/(n-t),0,1)}function ln(e){return e*e*(3-2*e)}function un(e,t,n){return Math.max(t,Math.min(n,e))}var dn=25,fn=.5,pn=.95;function mn(e={width:360,height:180}){return{nextAt:0,id:0,lastElapsed:0,grid:hn(e),flakes:[],cells:[],toppled:!1}}function hn(e){return{columns:Kn(Math.round(e.width/4),48,180),rows:Kn(Math.round(e.height/4),28,100)}}function gn(e,t,n){return n?`overdue`:t===void 0||sn(t).mode===`snowfall`?`snowing`:e>=pn?`complete`:e>=fn?`assembling`:`drift`}function _n(e,t){let n=G(e+41)<.5?-1:1,r=n*(.72+G(e+43)*.45),i=Math.sin(t/1600+G(e+47)*Math.PI*2)*.4,a=n*Math.max(0,Math.sin(t/3100+G(e+53)*Math.PI*2))**7*(3.2+G(e+59)*1.8);return r+i+a}function vn(e){let t=hn(e);return Math.round(t.columns*t.rows*.18)}function yn(e,t,n=!1,r=0){if(e===void 0)return n?30:60;let i=e*pn/vn(t);if(n)return i/2;let a=sn(e);return a.mode!==`snowfall`&&r>=Math.max(0,a.bodyStart-500)?i*4:i}function bn(e,{elapsed:t,progress:n,estimatedDurationMs:r,overdue:i,seed:a,dimensions:o}){let s=hn(o),c=e.grid.columns===s.columns&&e.grid.rows===s.rows?Gn(e):mn(o),l=Math.max(c.lastElapsed,t);for(let e=c.lastElapsed+dn;e<=l;e+=dn)c=Cn(c,e,r===void 0?n:e/r,r,i&&(r===void 0||e>=r),a,o),c.lastElapsed=e;return c}function xn(e){return e.filter(e=>e.owner===`snowman`).length}function Sn(e){return e.cells.map(t=>{let n=t.owner===`body`?e.body:t.owner===`head`?e.head:void 0,r=n&&t.localX!==void 0&&t.localY!==void 0?{...t,x:n.x+t.localX*Math.cos(n.angle)-t.localY*Math.sin(n.angle),y:n.y+t.localX*Math.sin(n.angle)+t.localY*Math.cos(n.angle)}:t;return e.toppling&&r.owner!==`ground`?Wn(r,e.toppling):r})}function Cn(e,t,n,r,i,a,o){let s=gn(n,r,i),c=yn(r,o,i,t);for(;t>=e.nextAt;)e.flakes.push({id:e.id++,x:G(a+e.id*17)*e.grid.columns,y:-1-G(a+e.id*23)*6,bornAt:e.nextAt}),e.nextAt+=c;wn(e,n,r,i);let l=Ln(e),u=_n(a,t)*(dn/1e3),d=r===void 0?.52:Math.max(.52,(e.grid.rows+7)*dn/(r*.25)),f=[];for(let t of e.flakes){let n={...t,x:t.x+u,y:t.y+d},r=On(e,n);if(r){kn(e,r,t.id,n.x-r.x,n.y-r.y);continue}let i=zn(n,l,e.grid,u,a);if(!i){f.push({...n,x:Kn(n.x,0,e.grid.columns-1)});continue}let o=l.get(W(i.x,i.y+1));e.cells.push({id:t.id,x:i.x,y:i.y,owner:o===`body`||o===`head`||o===`snowman`?`snowman`:`ground`}),l.set(W(i.x,i.y),e.cells.at(-1)?.owner??`ground`)}e.flakes=f,r!==void 0&&s!==`drift`&&s!==`snowing`&&En(e),Mn(e),Rn(e,a,t),Rn(e,a,t+dn/2);let p=e.body;return p?.locked&&(p.supportY??=Bn(e,p.x,p.radius,p.y+p.radius),p.y=p.supportY),i&&!e.toppling&&!e.toppled&&xn(e.cells)>=60&&Hn(e,t),Un(e,t),e}function wn(e,t,n,r){if(n===void 0)return;let i=sn(n);if(i.mode===`snowfall`)return;let a=t*n,{columns:o,rows:s}=e.grid,c=ln(cn(a,i.bodyStart,i.bodyEnd));if(a>=i.bodyStart&&!e.body){let t=o*.14;e.body={kind:`body`,x:t,y:Bn(e,t,2,s-1),radius:2,angle:0,locked:!1}}let l=e.body;if(l&&!l.locked){l.radius=Math.max(l.radius,Vn(e,`body`,2));let t=o*(.14+.38*c);Tn(l,t,Bn(e,t,l.radius,s-1)),l.locked=a>=i.bodyEnd}if(a>=i.headStart&&!e.head){let t=o*(i.mode===`full`?.88:.66);e.head={kind:`head`,x:t,y:Bn(e,t,1.7,s-1),radius:1.7,angle:0,locked:!1},En(e)}let u=e.head;if(u&&l&&!u.locked){if(u.radius=Math.max(u.radius,Vn(e,`head`,1.7)),a<i.hopStart){let t=o*(.88-.22*ln(cn(a,i.headStart,i.hopStart)));Tn(u,t,Bn(e,t,u.radius,s-1))}else{u.launch??={x:u.x,y:u.y};let e=cn(a,i.hopStart,i.land),t=l.y-l.radius-u.radius+.5;if(u.x=u.launch.x+(l.x-u.launch.x)*ln(e),u.y=u.launch.y+(t-u.launch.y)*ln(e)-Math.sin(Math.PI*e)*Math.max(5,l.radius*1.5),a>=i.land){let e=cn(a,i.land,i.settleEnd);u.y+=Math.sin(Math.PI*e)*.45}u.locked=a>=i.settleEnd}}if(u&&a>=i.land){let t=cn(a,i.land,i.end);e.hat={x:u.x,y:u.y-u.radius-1-5*(1-t*t),angle:(1-ln(t))*-.22}}}function Tn(e,t,n){let r=qn(e.y,n,.16),i=t-e.x;e.angle+=Math.sign(i)*Math.hypot(i,r-e.y)/Math.max(e.radius,1),e.x=t,e.y=r}function En(e){let t=Sn(e),n=new Map(e.cells.map(e=>[e.id,e])),r=new Set(t.filter(e=>e.owner===`ground`).map(e=>W(Math.round(e.x),Math.round(e.y)))),i=new Set(t.filter(e=>e.owner===`ground`).filter(e=>!r.has(W(Math.round(e.x),Math.round(e.y)-1))).map(e=>e.id));for(let r of[e.body,e.head]){if(!r||r.locked)continue;let a=r.kind,o=r.radius+.75;for(let a of t){if(!Dn(e,r))break;if(a.owner!==`ground`)continue;let t=a.x-r.x,s=a.y-r.y,c=Math.hypot(t,s);if(!i.has(a.id)||c>o||s<-r.radius*.2)continue;let l=n.get(a.id);l&&kn(e,r,l.id,t,s)}r.radius=Math.max(r.radius,Vn(e,a,r.kind===`body`?2:1.7))}}function Dn(e,t){if(t.kind===`body`||!e.body)return!0;let n=e.body.radius*.72,r=Math.max(12,Math.round(Math.PI*(Math.max(0,n-1.7)/.6)**2));return e.cells.filter(e=>e.owner===`head`).length<r}function On(e,t){return[e.body,e.head].filter(e=>e!==void 0&&!e.locked).find(n=>Dn(e,n)&&Math.hypot(t.x-n.x,t.y-n.y)<=n.radius)}function kn(e,t,n,r,i){let a=Math.cos(-t.angle),o=Math.sin(-t.angle),s=r*a-i*o;i=r*o+i*a,r=s;let c=e.cells.find(e=>e.id===n),l=jn(e,t,n),u=An(e,t,r,i,n),d={id:n,x:t.x+u.x,y:t.y+u.y,owner:t.kind,localX:u.x,localY:u.y,targetLocalX:l.x,targetLocalY:l.y};c?Object.assign(c,d):e.cells.push(d),t.radius=Math.max(t.radius,Vn(e,t.kind,t.kind===`body`?2:1.7)),Nn(e,t)}function An(e,t,n,r,i){let a=e.cells.filter(e=>e.id!==i&&e.owner===t.kind),o=(e,t)=>a.every(n=>Math.hypot((n.localX??0)-e,(n.localY??0)-t)>=.75);if(o(n,r))return{x:n,y:r};for(let e=.75;;e+=.75)for(let i=0;i<32;i++){let a=i*Math.PI/16,s=n+Math.cos(a)*e,c=r+Math.sin(a)*e;if((Math.hypot(s,c)<=t.radius+.75||e>t.radius*2)&&o(s,c))return t.radius=Math.max(t.radius,Math.hypot(s,c)-.5),{x:s,y:c}}}function jn(e,t,n){let r=e.cells.filter(e=>e.owner===t.kind&&e.targetLocalX!==void 0&&e.targetLocalY!==void 0),i=(e,t,n=.72)=>r.every(r=>Math.hypot((r.targetLocalX??0)-e,(r.targetLocalY??0)-t)>=n);for(let e=0;e<64;e+=1){let r=G(n*31+e*17)*Math.PI*2,a=Math.sqrt(G(n*37+e*19))*Math.max(.4,t.radius-.35),o=Math.cos(r)*a,s=Math.sin(r)*a;if(i(o,s))return{x:o,y:s}}for(let e=.4;e<=t.radius-.35;e+=.5){let t=Math.max(6,Math.round(2*Math.PI*e/.72));for(let r=0;r<t;r++){let a=r*Math.PI*2/t+G(n*13),o=Math.cos(a)*e,s=Math.sin(a)*e;if(i(o,s,.6))return{x:o,y:s}}}return{x:0,y:0}}function Mn(e){for(let t of e.cells){if(t.packed||t.localX===void 0||t.localY===void 0||t.targetLocalX===void 0||t.targetLocalY===void 0)continue;let e=qn(t.localX,t.targetLocalX,.25),n=qn(t.localY,t.targetLocalY,.25);t.localX=e,t.localY=n,t.packed=e===t.targetLocalX&&n===t.targetLocalY}}function Nn(e,t){let n=e.cells.filter(e=>e.owner===t.kind&&e.localX!==void 0&&e.localY!==void 0),r=Pn(t.radius,n.length);n.sort((e,t)=>e.id-t.id);for(let[e,t]of n.entries()){let n=r[e];if(!n)break;t.targetLocalX=n.x,t.targetLocalY=n.y,t.packed=!1}}function Pn(e,t){let n=Math.max(.2,e-.1),r=[],i=.9,a=i*Math.sqrt(3)/2;for(let e=-Math.ceil(n/a);e<=Math.ceil(n/a);e+=1){let t=e*a,o=e&1?i/2:0;for(let e=-Math.ceil(n/i);e<=Math.ceil(n/i);e+=1){let a=e*i+o;Math.hypot(a,t)<=n&&r.push({x:a,y:t})}}r.sort((e,t)=>Math.hypot(e.x,e.y)-Math.hypot(t.x,t.y));let o=[];for(let e of r)if(o.every(t=>Math.hypot(t.x-e.x,t.y-e.y)>=.82)&&o.push(e),o.length===t)break;return o}function Fn(e){if(e.hat)return e.toppling?{...Wn(e.hat,e.toppling),angle:e.hat.angle+e.toppling.angle}:e.hat}function In(e,t,n){let r=Gn(t),i=(e,t)=>e+(t-e)*Kn(n,0,1);for(let t of[`body`,`head`]){let n=e[t],a=r[t];n&&a&&(a.x=i(n.x,a.x),a.y=i(n.y,a.y),a.angle=i(n.angle,a.angle))}let a=new Map(e.flakes.map(e=>[e.id,e]));for(let e of r.flakes){let t=a.get(e.id);t&&(e.x=i(t.x,e.x),e.y=i(t.y,e.y))}return r.toppling&&e.toppling&&(r.toppling.angle=i(e.toppling.angle,r.toppling.angle)),r.hat&&e.hat&&(r.hat={x:i(e.hat.x,r.hat.x),y:i(e.hat.y,r.hat.y),angle:i(e.hat.angle,r.hat.angle)}),r}function Ln(e){let t=new Map;for(let n of Sn(e))t.set(W(Math.round(n.x),Math.round(n.y)),n.owner);return t}function Rn(e,t,n){let r=Ln(e),i=e.cells.filter(e=>e.owner===`ground`).sort((e,t)=>t.y-e.y||e.x-t.x);for(let a of i){let i=W(a.x,a.y+1);if(a.y<e.grid.rows-1&&!r.has(i)){r.delete(W(a.x,a.y)),a.y+=1,r.set(W(a.x,a.y),a.owner);continue}let o=G(t+a.id*29+n)<.5?-1:1;for(let t of[o,-o]){let n=a.x+t;if(!(n<0||n>=e.grid.columns||a.y>=e.grid.rows-1||r.has(W(n,a.y))||r.has(W(n,a.y+1)))){r.delete(W(a.x,a.y)),a.x=n,a.y+=1,r.set(W(a.x,a.y),a.owner);break}}}}function zn(e,t,n,r,i){let a=Math.round(e.x),o=Math.round(e.y);if(o<0)return;if(o>=n.rows-1)return{x:a,y:n.rows-1};if(!t.has(W(a,o+1)))return;let s=r>=0?1:-1,c=G(i+e.id*71+o)>.5?s:-s;for(let e of[c,-c]){let r=a+e;if(r>=0&&r<n.columns&&!t.has(W(r,o+1))&&!t.has(W(r,o)))return{x:r,y:o+1}}return t.has(W(a,o))?{x:a,y:Math.max(0,o-1)}:{x:a,y:o}}function Bn(e,t,n,r){let i=Sn(e).filter(e=>e.owner===`ground`&&Math.abs(e.x-t)<=n);return(i.length?Math.min(...i.map(e=>e.y)):r)-n}function Vn(e,t,n){let r=e.cells.filter(e=>e.owner===t).length;return n+Math.sqrt(r/Math.PI)*.5}function Hn(e,t){let n=e.body;n&&(e.toppling={startedAt:t,angle:0,pivotX:n.x,pivotY:n.y+n.radius*.72})}function Un(e,t){let n=e.toppling;if(!n)return;let r=Kn((t-n.startedAt)/750,0,1);n.angle=(1-(1-r)**3)*(Math.PI/2),r===1&&(e.toppled=!0)}function Wn(e,t){let n=Math.cos(t.angle),r=Math.sin(t.angle),i=e.x-t.pivotX,a=e.y-t.pivotY;return{...e,x:t.pivotX+i*n-a*r,y:t.pivotY+i*r+a*n}}function Gn(e){return{...e,grid:{...e.grid},hat:e.hat&&{...e.hat},flakes:e.flakes.map(e=>({...e})),cells:e.cells.map(e=>({...e})),body:e.body&&{...e.body},head:e.head&&{...e.head},toppling:e.toppling&&{...e.toppling}}}function W(e,t){return`${e}:${t}`}function Kn(e,t,n){return Math.max(t,Math.min(n,e))}function qn(e,t,n){return Math.abs(t-e)<=n?t:e+Math.sign(t-e)*n}function G(e){let t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Jn(e,t,n){if(!e)return;let r=e.getContext(`2d`);if(!r)return;let i=window.devicePixelRatio||1,a=Math.max(1,Math.round(n.width)),o=Math.max(1,Math.round(n.height));(e.width!==a*i||e.height!==o*i)&&(e.width=a*i,e.height=o*i,e.style.width=`${a}px`,e.style.height=`${o}px`),r.setTransform(i,0,0,i,0,0),r.clearRect(0,0,a,o);let s=a/t.grid.columns,c=o/t.grid.rows;r.fillStyle=`rgba(244, 241, 223, 0.52)`;for(let e of Sn(t))Yn(r,(e.x+.5)*s,(e.y+.5)*c,s,c);r.fillStyle=`rgba(244, 241, 223, 0.76)`;for(let e of t.flakes)Yn(r,(e.x+.5)*s,(e.y+.5)*c,s*.72,c*.72);let l=Fn(t);if(l&&t.head){let e=t.head.radius;r.save(),r.translate(l.x*s,l.y*c),r.scale(s,c),r.rotate(l.angle),r.fillStyle=`rgba(27, 31, 24, 0.78)`,r.fillRect(-e*.65,-2,e*1.3,2),r.fillRect(-e,-.3,e*2,.45),r.restore()}}function Yn(e,t,n,r,i){e.beginPath(),e.arc(t,n,Math.max(.8,Math.min(r,i)*.42),0,Math.PI*2),e.fill()}function Xn({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let a=o(null),c=o(null),[l,u]=s({width:360,height:180}),[f,p]=s(()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),m=o(e),h=o(n),g=o({startedAt:Date.now(),progressAt:Date.now(),progress:e,simulation:mn()});r(()=>{m.current=e,g.current.progressAt=Date.now(),g.current.progress=e},[e]),r(()=>{h.current=n},[n]),r(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{let e=a.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>0&&t.height>0&&u({width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),r(()=>{if(f)return;g.current.simulation=mn(l);let e=0,n=()=>{let r=g.current,o=t===void 0?Date.now()-r.startedAt:r.progress*t+(Date.now()-r.progressAt),s={progress:m.current,estimatedDurationMs:t,overdue:h.current,seed:i,dimensions:l},u=bn(r.simulation,{...s,elapsed:o});r.simulation=u;let d=In(u,bn(u,{...s,elapsed:u.lastElapsed+25}),(o-u.lastElapsed)/25);Jn(c.current,d,l);let p=a.current;p&&(p.dataset.snowCellCount=String(u.cells.length),p.dataset.snowDensity=u.grid.columns<65?`compact`:`full`,u.toppled?p.dataset.snowmanToppled=`true`:delete p.dataset.snowmanToppled),f||(e=window.requestAnimationFrame(n))};return e=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(e)},[l,t,f,i]),r(()=>{if(!f)return;let r=bn(mn(l),{elapsed:t===void 0?4800:e*t,progress:e,estimatedDurationMs:t,overdue:n,seed:i,dimensions:l});Jn(c.current,r,l),a.current&&(a.current.dataset.snowCellCount=String(r.cells.length),r.toppled?a.current.dataset.snowmanToppled=`true`:delete a.current.dataset.snowmanToppled)},[l,t,n,e,f,i]);let _=gn(e,t,n);return d(`div`,{ref:a,className:on.field,"data-running-part":`snowman-field`,"data-snowman-phase":_,"data-reduced-motion":f||void 0,children:d(`canvas`,{ref:c,className:on.canvas,"data-running-part":`snowman-canvas`})})}var K={haze:`_haze_1uy2p_1`,pressure:`_pressure_1uy2p_17`,band:`_band_1uy2p_20`,bandOne:`_bandOne_1uy2p_33`,bandTwo:`_bandTwo_1uy2p_36`,bandThree:`_bandThree_1uy2p_40`,drift:`_drift_1uy2p_45`,driftOne:`_driftOne_1uy2p_54`,driftTwo:`_driftTwo_1uy2p_58`,driftThree:`_driftThree_1uy2p_67`,driftFour:`_driftFour_1uy2p_76`,driftFive:`_driftFive_1uy2p_85`,"storm-band":`_storm-band_1uy2p_1`};function Zn(){return f(u,{children:[d(`span`,{className:K.haze,"data-running-part":`weather-haze`}),d(`span`,{className:K.pressure,"data-running-part":`weather-pressure`}),d(`span`,{className:`${K.band} ${K.bandOne}`}),d(`span`,{className:`${K.band} ${K.bandTwo}`}),d(`span`,{className:`${K.band} ${K.bandThree}`}),d(`span`,{className:`${K.drift} ${K.driftOne}`}),d(`span`,{className:`${K.drift} ${K.driftTwo}`}),d(`span`,{className:`${K.drift} ${K.driftThree}`}),d(`span`,{className:`${K.drift} ${K.driftFour}`}),d(`span`,{className:`${K.drift} ${K.driftFive}`})]})}var Qn={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function $n({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return d(`span`,{className:`${Qn.anchor} ${e??``}`,"data-running-part":r,children:d(`span`,{className:`${Qn.body} ${t??``}`,"data-running-part":i,style:a})})}var er={frontier:`_frontier_1dg7b_1`,flare:`_flare_1dg7b_12`,lanes:`_lanes_1dg7b_15`,lane:`_lane_1dg7b_15`,markerAnchor:`_markerAnchor_1dg7b_31`,markerBody:`_markerBody_1dg7b_35`,"bloom-flare":`_bloom-flare_1dg7b_1`};function tr(){return f(u,{children:[d(`span`,{className:er.frontier,"data-running-part":`frontier`}),d(`span`,{className:er.flare,"data-running-part":`bloom-flare`}),d(`span`,{className:er.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>d(`span`,{className:er.lane,"data-running-part":`bloom-lane`,children:d($n,{anchorClassName:er.markerAnchor,bodyClassName:er.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function nr(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`].includes(e)}function rr({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return f(`div`,{className:`${an.field} ${r?an.overdue:``}`,"data-animation":e,"data-running-field":!0,"data-overdue":r||void 0,"data-indeterminate":i||void 0,"aria-hidden":`true`,style:o,children:[e===`telemetry-bloom`&&d(tr,{}),e===`release-transit`&&d(rn,{}),e===`status-weather`&&d(Zn,{}),e===`falling-shapes`&&d(Gt,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`snowman`&&d(Xn,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`flight-path`&&d(nn,{progress:t,indeterminate:i})]})}var ir=20;function ar(e,t){let n=or(!!e),r=e?new Date(e).valueOf():NaN,i=Number.isFinite(r)?Math.max(0,n-r):void 0,a=i!==void 0&&t!==void 0;return{elapsedMs:i,estimatedDurationMs:t,hasEstimate:a,overdue:a&&i>t,progress:a?Math.min(i/t,1):0}}function or(e){let[t,n]=s(()=>Date.now());return r(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),ir);return()=>window.clearInterval(t)},[e]),t}function sr(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${lr(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${lr(t)}`}${n?` · Over estimate`:``}`}function cr(e,t,n){let r=e===void 0?`—`:ur(e),i=t===void 0?`?`:`~${ur(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function lr(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function ur(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${r}:${String(i).padStart(2,`0`)}`;return n>0?`${n}:${a.padStart(5,`0`)}`:a}function dr({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return f(`p`,{className:`${an.timing} ${n?an.timingOverdue:``}`,children:[d(`span`,{className:`screen-reader-only`,children:sr(e,t,n)}),d(`span`,{"aria-hidden":`true`,children:cr(e,t,n)})]})}var q={progress:`_progress_1ti2m_1`,visual:`_visual_1ti2m_8`,timing:`_timing_1ti2m_12`,overdue:`_overdue_1ti2m_17`,readout:`_readout_1ti2m_23`,radial:`_radial_1ti2m_31`,sweep:`_sweep_1ti2m_1`,"alarm-ring":`_alarm-ring_1ti2m_1`,radialCore:`_radialCore_1ti2m_58`,"reactor-breathe":`_reactor-breathe_1ti2m_1`,runway:`_runway_1ti2m_70`,"barrier-pulse":`_barrier-pulse_1ti2m_1`,spark:`_spark_1ti2m_114`,sparkTwo:`_sparkTwo_1ti2m_128`,orbit:`_orbit_1ti2m_135`,orbitCore:`_orbitCore_1ti2m_151`,particle:`_particle_1ti2m_163`,particleTwo:`_particleTwo_1ti2m_174`,"gravity-well":`_gravity-well_1ti2m_1`,indeterminate:`_indeterminate_1ti2m_191`,shift:`_shift_1ti2m_1`,signalField:`_signalField_1ti2m_199`,rail:`_rail_1ti2m_217`,lead:`_lead_1ti2m_223`,pulse:`_pulse_1ti2m_233`,pulseTwo:`_pulseTwo_1ti2m_244`,tracks:`_tracks_1ti2m_247`,sparkWide:`_sparkWide_1ti2m_1`,track:`_track_1ti2m_247`,markerAnchor:`_markerAnchor_1ti2m_382`,markerBody:`_markerBody_1ti2m_386`,"endpoint-pulse":`_endpoint-pulse_1ti2m_1`,short:`_short_1ti2m_424`};function fr({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,c=sr(n,r,a),l={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?q.signalField:q[e];return f(`div`,{className:`${q.progress} ${p} ${a?q.overdue:``} ${i?``:q.indeterminate}`,style:l,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[f(`div`,{className:q.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&d(`span`,{className:q.radialCore}),e===`runway`&&f(u,{children:[d(`span`,{className:q.spark,"data-running-part":`runway-spark`}),d(`span`,{className:`${q.spark} ${q.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&f(u,{children:[d(`span`,{className:q.orbitCore}),d(`span`,{className:q.particle}),d(`span`,{className:`${q.particle} ${q.particleTwo}`})]}),e===`signal-field`&&f(u,{children:[d(`span`,{className:q.rail}),d(`span`,{className:q.lead}),d(`span`,{className:q.pulse}),d(`span`,{className:`${q.pulse} ${q.pulseTwo}`}),d(`span`,{className:q.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>d(`span`,{className:q.track,"data-running-part":`signal-track`,children:d($n,{anchorClassName:q.markerAnchor,bodyClassName:q.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),d(`p`,{className:`${q.timing} ${s?q.readout:``}`,children:s?f(u,{children:[d(`span`,{className:`screen-reader-only`,children:c}),d(`span`,{"aria-hidden":`true`,children:cr(n,r,a)})]}):c})]})}function pr(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}function mr(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}var hr=2e4,gr=15e3,_r=3e5,vr=1.25,yr=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`];function br({panel:e}){let t=Cr(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=xr(e.demo_run_duration,hr),i=xr(e.demo_review_duration,_r),a=n?Math.ceil(i*vr):r,o=Math.floor(t/a),s=n??yr[o%yr.length]??`radial`,c=o*a;return d(Sr,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:gr})}function xr(e,t){return e?T(e)??t:t}function Sr({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=ar(new Date(n).toISOString(),r),a=nr(t);return d(B,{panel:e,field:a?d(rr,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:mr(e.id)},`${t}-${n}`):void 0,children:f(R,{children:[d(z,{status:`running`,glyph:`↻`,label:`Running`}),f(`p`,{className:xt.variant,children:[d(`span`,{className:xt.variantPrefix,children:`Demo treatment · `}),t]}),a?d(dr,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):d(fr,{animation:t,timing:i})]})})}function Cr(){let[e,t]=s(()=>Date.now());return r(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var wr={details:`_details_19avj_1`,activity:`_activity_19avj_7`,duration:`_duration_19avj_8`};function Tr(e,t=`Passed`){let n=st[e];return e===`passed`?{...n,label:t}:n}function Er(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}var Dr={summary:`_summary_1su3w_1`,delta:`_delta_1su3w_15`,emphasized:`_emphasized_1su3w_22`,sparkline:`_sparkline_1su3w_28`,explanation:`_explanation_1su3w_42`};function Or({direction:e,children:t}){let[n,a]=s(!1),[c,l]=s(!1),[p,m]=s({left:0,top:0}),h=o(null),g=o(null),_=i(),v=()=>{let e=h.current?.getBoundingClientRect();e&&m({left:Math.max(8,Math.min(e.left,window.innerWidth-328)),top:Math.max(8,Math.min(e.bottom,window.innerHeight-180))}),a(!0)};if(r(()=>{e||(a(!1),l(!1))},[e]),r(()=>{if(!n)return;let e=e=>{e.target instanceof Node&&!h.current?.contains(e.target)&&!g.current?.contains(e.target)&&(a(!1),l(!1))},t=e=>{e.key===`Escape`&&(a(!1),l(!1))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]),!e)return d(u,{children:t});let y=e.totals.map((e,t,n)=>`${n.length===1?48:t*48/(n.length-1)},${16-e/Math.max(1,...n)*14}`).join(` `);return f(u,{children:[f(`button`,{ref:h,type:`button`,className:Dr.summary,"aria-describedby":n?_:void 0,"aria-expanded":n,onMouseEnter:v,onMouseLeave:e=>{!c&&!(e.relatedTarget instanceof Node&&g.current?.contains(e.relatedTarget))&&a(!1)},onFocus:v,onBlur:()=>{a(!1),l(!1)},onClick:()=>{c?(l(!1),a(!1)):(l(!0),v())},children:[t,e.mode!==`quiet`&&f(`span`,{className:`${Dr.delta} ${e.emphasized?Dr.emphasized:``}`,"aria-hidden":`true`,children:[e.symbol,` `,e.delta>0?`+`:e.delta<0?`−`:``,Math.abs(e.delta).toLocaleString()]}),e.totals.length>1&&d(`svg`,{className:Dr.sparkline,viewBox:`0 0 48 18`,"aria-hidden":`true`,children:d(`polyline`,{points:y})})]}),n&&b(d(`span`,{ref:g,id:_,role:`tooltip`,className:Dr.explanation,style:{...p,maxHeight:Math.max(40,window.innerHeight-p.top-8)},onMouseLeave:e=>{!c&&!(e.relatedTarget instanceof Node&&h.current?.contains(e.relatedTarget))&&a(!1)},children:e.explanation}),document.body)]})}function kr({envelope:e,direction:t}){if(e.state===`error`)return d(L,{glyph:`⚠`,label:`Tests`,value:`Test results unavailable: ${e.error.message}`});let n=e.signal;return n.status===`reported`?d(L,{glyph:`≡`,label:`Tests`,value:d(Ar,{tests:n,direction:t})}):d(L,{glyph:`≡`,label:`Tests`,value:n.status===`pending`?`Tests pending`:`No test results published`})}function Ar({tests:e,direction:t}){let n=e.total>0&&e.passed===e.total;return f(Or,{direction:t,children:[n?f(`span`,{className:P.passed,children:[`✓ `,e.total.toLocaleString(),` passed`]}):`${e.total.toLocaleString()} tests`,!!e.failed&&f(`span`,{className:P.failed,children:[` · ✕ `,e.failed.toLocaleString(),` failed`]}),!!e.skipped&&f(`span`,{className:P.warning,children:[` · ↷ `,e.skipped.toLocaleString(),` skipped`]})]})}function jr(e){return e.state===`error`?{state:e.state,kind:e.error.kind,message:e.error.message}:{state:e.state,...Mr(e.signal)}}function Mr(e){if(e.status!==`reported`)return e;let{run:t,...n}=e;return n}function Nr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,testDirection:a}){if(!t&&i)return d(Pr,{panel:e,rejected:i});if(!t)return d(B,{panel:e,attentionActive:n,children:d(R,{children:d(I,{children:`Loading…`})})});if(t.state===`error`){let r=at(t.error.kind);return f(B,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),d(R,{anchor:`evidence`,children:d(I,{children:t.error.message})})]})}let o=k.safeParse(t.signal);return o.success?d(Fr,{panel:e,envelope:t,signal:o.data,testDirection:a,updateHealth:r,attentionActive:n}):f(B,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{glyph:`⚠`,label:`Invalid signal`})}),d(R,{anchor:`evidence`,children:d(I,{children:`The received pipeline status could not be read.`})})]})}function Pr({panel:e,rejected:t}){let n=Tr(t.status);return f(B,{panel:e,sourceLink:t.link,busy:!1,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{status:t.status,glyph:n.glyph,label:n.label})}),f(R,{className:wr.details,anchor:`evidence`,children:[f(I,{children:[t.github?`GitHub`:`The source`,` returned an older result; checking again`,t.github&&f(u,{children:[` · `,d(`a`,{href:`https://github.com/orgs/community/discussions/206725`,target:`_blank`,rel:`noopener noreferrer`,children:`GitHub API report`})]})]}),d(pt,{value:t.sourceUpdatedAt})]})]})}function Fr({panel:e,envelope:t,signal:n,updateHealth:r,attentionActive:i,testDirection:a}){let c=Tr(n.status),[l,u]=s(()=>n.status===`running`?Ir():void 0),p=o(n.status);if(n.status!==p.current){let t=p.current===`running`;p.current=n.status,e.running_animation===void 0&&!t&&n.status===`running`&&u(e=>Ir(e))}let m=e.running_animation??l??`off`,h=n.status===`running`&&m!==`off`,g=ar(n.runStartedAt,n.estimatedDurationMs),_=h&&nr(m),v=h&&pr(m);return f(B,{panel:e,envelope:t,attentionActive:i,layout:_||v?void 0:`status-band`,field:_?d(rr,{animation:m,progress:g.progress,estimatedDurationMs:g.estimatedDurationMs,overdue:g.overdue,indeterminate:!g.hasEstimate,seed:mr(e.id)}):void 0,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{status:n.status,glyph:c.glyph,label:c.label})}),f(R,{className:wr.details,anchor:`evidence`,children:[n.status===`running`&&d(L,{glyph:`⚙`,label:`Activity`,value:Er(n.activity),compact:{kind:`glyph-only`},title:`Activity: ${Er(n.activity)}`,className:wr.activity}),n.testResults&&d(kr,{envelope:n.testResults,direction:a}),n.branch&&d(L,{glyph:`⎇`,label:`Branch`,value:d(`span`,{className:wr.branch,children:n.branch}),compact:{kind:`short-value`,value:d(`span`,{className:wr.branch,children:n.branch})},title:`Branch: ${n.branch}`}),_&&d(dr,{elapsedMs:g.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:g.overdue}),v&&d(fr,{animation:m,timing:g}),n.status!==`running`&&n.durationMs!==void 0&&d(L,{glyph:`◷`,label:`Duration`,value:`Took ${Lr(n.durationMs)}`,compact:{kind:`short-value`,value:Lr(n.durationMs)},title:`Duration: Took ${Lr(n.durationMs)}`,className:wr.duration}),d(dt,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt}),r&&d(ft,{health:r})]})]})}function Ir(e){let t=xe.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function Lr(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function Rr(e){let t={state:e.state,link:e.link};if(e.state===`error`)return t;let n=k.safeParse(e.signal);return{...t,status:n.success?n.data.status:void 0,...n.success&&n.data.testResults?{tests:jr(n.data.testResults)}:{}}}var J={compactFacts:`_compactFacts_f62xm_1`,incomplete:`_incomplete_f62xm_8`,compactFact:`_compactFact_f62xm_1`,failedItem:`_failedItem_f62xm_19`,evidence:`_evidence_f62xm_27`,freshness:`_freshness_f62xm_28`,statusAnchor:`_statusAnchor_f62xm_36`,fullSummary:`_fullSummary_f62xm_44`};function Y(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function zr(e){let t=[...e.workflows,...e.pullRequests].find(e=>e.status===`failed`||e.status===`warning`);return t?{workflow:Y(e.workflows.length,`workflow`),pullRequests:Y(e.pullRequests.length,`open PR`),primary:`${t.label} ${t.status}`,secondary:`${Y(e.workflows.length,`workflow`)} · ${Y(e.pullRequests.length,`open PR`)}`,primaryDetail:t.detail,primaryKind:t.status===`warning`?`warning`:`failed`,title:`${e.summary} — ${t.label}: ${t.detail}`}:{workflow:Y(e.workflows.length,`workflow`),pullRequests:Y(e.pullRequests.length,`open PR`),primary:Y(e.workflows.length,`workflow`),secondary:Y(e.pullRequests.length,`open PR`),title:e.summary}}function Br({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return d(B,{panel:e,attentionActive:n,children:d(R,{children:d(I,{children:`Loading…`})})});if(t.state===`error`){let r=at(t.error.kind);return f(B,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),d(R,{anchor:`evidence`,children:d(I,{children:t.error.message})})]})}let i=ce.safeParse(t.signal);if(!i.success)return f(B,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{glyph:`⚠`,label:`Invalid signal`})}),d(R,{anchor:`evidence`,children:d(I,{children:`The received pull-request health status could not be read.`})})]});let a=Tr(i.data.status,`Healthy`),o=zr(i.data);return f(B,{panel:e,envelope:t,attentionActive:n,layout:`status-band`,children:[d(`div`,{className:J.statusAnchor,"data-panel-anchor":`status`,children:d(z,{status:i.data.status,glyph:a.glyph,label:a.label})}),f(`div`,{className:J.evidence,"data-panel-anchor":`evidence`,"data-panel-evidence-priority":`secondary`,children:[d(I,{className:J.fullSummary,title:i.data.summary,children:i.data.summary}),f(`div`,{className:J.compactFacts,title:o.title,"data-compact-facts":!0,children:[o.primaryDetail&&f(`p`,{className:J.failedItem,title:o.primaryDetail,children:[d(`span`,{"aria-hidden":`true`,children:`⚠`}),` `,f(`span`,{className:`screen-reader-only`,children:[o.primaryKind===`warning`?`Warning`:`Failed`,` item:`,` `]}),o.primary,f(`span`,{className:`screen-reader-only`,children:[`. Detail: `,o.primaryDetail]})]}),d(L,{glyph:`⚙`,label:`Update workflows`,value:o.workflow,compact:{kind:`short-value`,value:i.data.workflows.length},title:`Update workflows: ${o.workflow}`,className:J.compactFact}),d(L,{glyph:`⎇`,label:`Open update pull requests`,value:o.pullRequests,compact:{kind:`short-value`,value:i.data.pullRequests.length},title:`Open update pull requests: ${o.pullRequests}`,className:J.compactFact})]}),f(`div`,{className:J.freshness,children:[d(V,{value:t.observedAt,label:`Observed (oldest evidence)`}),i.data.newestObservedAt&&f(`span`,{className:`screen-reader-only`,children:[`Newest evidence observed `,i.data.newestObservedAt,`.`]}),r&&d(ft,{health:r})]}),i.data.incompleteObservations&&d(`div`,{role:`status`,children:f(I,{className:J.incomplete,children:[`⚠ Incomplete observations:`,` `,i.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}function Vr(e){let t={state:e.state,link:e.link};if(e.state===`error`)return t;let n=ce.safeParse(e.signal);return{...t,status:n.success?n.data.status:void 0}}function Hr({panel:e,envelope:t,attentionActive:n,updateHealth:r,testDirection:i}){if(!t)return d(B,{panel:e,attentionActive:n,children:d(R,{children:d(I,{children:`Loading…`})})});if(t.state===`error`){let r=at(t.error.kind);return d(B,{panel:e,envelope:t,attentionActive:n,error:!0,children:f(R,{children:[d(z,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),d(I,{children:t.error.message})]})})}let a=O.safeParse(t.signal);if(!a.success)return d(B,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(R,{children:d(z,{glyph:`⚠`,label:`Invalid test result`})})});let o=a.data;return o.status===`pending`?d(Ur,{panel:e,envelope:t,attentionActive:n,label:`Pending`,hint:`The selected workflow run is still in progress.`}):o.status===`not-reported`?d(Ur,{panel:e,envelope:t,attentionActive:n,label:`No test results published`,hint:`This completed workflow did not publish the configured test summary.`}):d(B,{panel:e,envelope:t,attentionActive:n,children:f(R,{children:[d(z,{glyph:`✓`,label:`Test results reported`,compactOnly:!0}),d(lt,{children:d(Ar,{tests:o,direction:i})}),d(V,{value:t.observedAt}),r&&d(ft,{health:r})]})})}function Ur({panel:e,envelope:t,attentionActive:n,label:r,hint:i}){return d(B,{panel:e,envelope:t,attentionActive:n,children:f(R,{children:[d(z,{glyph:`◌`,label:r}),d(I,{children:i}),d(V,{value:t.observedAt})]})})}function Wr(e){let t=ie.safeParse(e);return{state:e.state,link:e.link,...t.success?{tests:jr(t.data)}:{}}}function Gr(e){let t=typeof e==`object`&&e?e.update_workflows:void 0;return Array.isArray(t)?t.flatMap(e=>typeof e==`object`&&e&&typeof e.workflow==`string`?[{workflow:e.workflow}]:[]):[]}var Kr={kind:`single`,initialPaths:(e,t)=>[t]},qr=e=>({state:e.state,link:e.link}),Jr=new Map(Object.entries({"pipeline-status":{testHistory:!0,symbol:{glyph:`▣`,label:`Pipeline status`},Renderer:Nr,polling:Kr,projectDiagnostic:Rr},"pull-request-health":{symbol:{glyph:`⌘`,label:`Pull request health`},Renderer:Br,polling:{kind:`pull-request-health`,initialPaths:(e,t)=>[`${t}/pull-requests`,...Gr(e).map(({workflow:e})=>`${t}/update-workflow/${encodeURIComponent(e)}`)]},projectDiagnostic:Vr},"http-value":{symbol:{glyph:`◌`,label:`HTTP value`},Renderer:_t,polling:{kind:`facts`,initialPaths:(e,t)=>e.facts?e.facts.map(e=>`${t}/facts/${encodeURIComponent(e.id)}`):[t]},projectDiagnostic:qr},"test-count":{testHistory:!0,symbol:{glyph:`≡`,label:`Test count`},Renderer:Hr,polling:Kr,projectDiagnostic:Wr},"pipeline-animation-demo":{symbol:{glyph:`✦`,label:`Pipeline animation demo`},Renderer:br,polling:{kind:`local`},projectDiagnostic:qr}}));function X(e){return Jr.get(e)}function Yr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a,testDirection:o}){let s=X(e.type)?.Renderer;return s?d(s,{panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a,testDirection:o}):d(it,{label:e.type,hint:`Not wired yet`,wide:!0})}var Xr={control:`_control_giazw_1`,backdrop:`_backdrop_giazw_5`,dialog:`_dialog_giazw_15`};function Zr({env:e,auth:t}){let[n,i]=s(!1),[a,c]=s(`idle`),[l,p]=s(),m=o(null),h=o(null),g=o(null),_=o(!1);r(()=>{if(!n){_.current&&m.current?.focus(),_.current=!1;return}_.current=!0;let e=()=>i(!1),t=t=>{t.key===`Escape`&&e()},r=e=>{if(e.key!==`Tab`)return;let t=[...h.current?.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]],n=t.at(0),r=t.at(-1);n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},a=h.current;return a?.addEventListener(`keydown`,r),window.addEventListener(`keydown`,t),g.current?.focus(),()=>{a?.removeEventListener(`keydown`,r),window.removeEventListener(`keydown`,t)}},[n]);async function v(){i(!0),c(`loading`),p(void 0);try{let n=await N(e,`${e.proxyPath}/boards/${encodeURIComponent(e.board)}/security`,void 0,globalThis.fetch,t);if(!n.ok)throw Error(`Security details returned ${n.status}`);let r=Se.safeParse(await n.json());if(!r.success)throw Error(`Security details were malformed`);p(r.data),c(`idle`)}catch{c(`error`)}}return f(u,{children:[d(`button`,{ref:m,className:Xr.control,type:`button`,"aria-expanded":n,"aria-controls":`security-details-dialog`,onClick:()=>void v(),children:`Security`}),n&&d(`div`,{className:Xr.backdrop,role:`presentation`,children:f(`section`,{ref:h,className:Xr.dialog,id:`security-details-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`security-title`,children:[d(`h2`,{id:`security-title`,children:`Security details`}),a===`loading`&&d(`p`,{"aria-live":`polite`,children:`Loading security details…`}),a===`error`&&d(`p`,{role:`alert`,children:`Security details are unavailable.`}),l&&d(Qr,{details:l}),d(`button`,{ref:g,type:`button`,onClick:()=>i(!1),children:`Close`})]})})]})}function Qr({details:e}){return e.policy.mode===`claim`?f(`p`,{children:[`OIDC is enabled. Access uses the `,d(`code`,{children:e.policy.claim}),` claim with a`,` `,d(`strong`,{children:e.policy.match}),` match policy.`]}):e.policy.mode===`authenticated`?d(`p`,{children:`OIDC is enabled. Any verified API access token with a subject may view this board.`}):d(`p`,{children:`OIDC is enabled. Access is limited to a server-held subject policy.`})}var $r={notice:`_notice_1h5h0_1`,blocked:`_blocked_1h5h0_18`},ei=`https://github.com/robertfmurdock/ze-great-dashboard/blob/main/docs/oidc-authentication.md`;function ti({mode:e}){return e===`blocked`?f(`main`,{className:$r.blocked,role:`alert`,children:[d(`h1`,{children:`⚠ Authentication configuration required`}),d(`p`,{children:`This dashboard is blocked because authentication is required but has not been configured.`}),d(`p`,{children:`No dashboard data was loaded.`}),f(`p`,{children:[d(`a`,{href:ei,children:`Read the authentication setup guide`}),`.`]})]}):f(`aside`,{className:$r.notice,role:`alert`,"aria-label":`Unauthenticated deployment warning`,children:[d(`span`,{"aria-hidden":`true`,children:`⚠`}),f(`span`,{children:[d(`strong`,{children:`This deployment has no authentication.`}),` If this is reachable on a public network and reveals important information, take it down now. Configure the board’s`,` `,d(`code`,{children:`auth`}),` block and `,d(`code`,{children:`security: required`}),`, or set`,` `,d(`code`,{children:`security: unsecured`}),` to explicitly acknowledge intentional public access.`,` `,d(`a`,{href:ei,children:`Read the authentication setup guide`}),`.`]})]})}var Z={trigger:`_trigger_g9eon_1`,close:`_close_g9eon_2`,dialog:`_dialog_g9eon_11`,dialogHeader:`_dialogHeader_g9eon_22`,note:`_note_g9eon_32`,empty:`_empty_g9eon_33`,body:`_body_g9eon_43`,legend:`_legend_g9eon_48`,axis:`_axis_g9eon_57`,lanes:`_lanes_g9eon_64`,lane:`_lane_g9eon_64`,laneLabel:`_laneLabel_g9eon_75`,track:`_track_g9eon_78`,observed:`_observed_g9eon_85`,expected:`_expected_g9eon_86`},ni=6e5;function ri({schedules:e,events:t,retention:n,now:r=new Date}){let i=r.valueOf(),a=i-ni,o=t.filter(e=>e.kind===`panel-fetch-start`&&Number.isFinite(Date.parse(e.at))&&Date.parse(e.at)>=a&&Date.parse(e.at)<=i),s=e.map(e=>{let t=new Map;for(let n of o){if(n.panelId!==e.panelId)continue;let r=t.get(n.path)??[];r.push(n.at),t.set(n.path,r)}return{...e,observed:[...t.entries()].map(([e,t])=>({path:e,starts:t})),hasRetainedEvidence:t.size>0}});return{capturedAt:r.toISOString(),window:{from:new Date(a).toISOString(),to:r.toISOString()},schedules:e,lanes:s,evidenceMayBeIncomplete:n.eventsPrunedByAge>0||n.eventsPrunedByCount>0}}function ii(e,t){return Math.max(0,Math.min(100,(Date.parse(e)-(t.valueOf()-ni))/ni*100))}function ai(e,t){return`${e.label}, panel ${e.panelId}; ${oi(e.cadence)} cadence; ${e.inFlight?`request in flight`:e.nextDueAt?si(e.nextDueAt,t):`awaiting first request`}; ${e.observed.length?`${e.observed.length} observed proxy path${e.observed.length===1?``:`s`}`:`no retained requests in the last 10 minutes`}`}function oi(e){return e===`completion-window`?`Completion-window`:e===`running`?`Running`:`Normal`}function si(e,t){let n=Date.parse(e)-t.valueOf();return n<0?`Overdue by ${ci(-n)}`:`Next poll in ${ci(n)}`}function ci(e){return e%6e4==0?`${Math.round(e/6e4)}m`:`${Math.max(1,Math.round(e/1e3))}s`}function li({board:e,schedules:t,log:n}){let[i,l]=s(()=>new Date),[p,m]=s(!1),h=o(null),g=o(null),_=o(null),v=o(!1);c(n.subscribe,n.snapshot,n.snapshot),r(()=>{if(!p)return;let e=window.setInterval(()=>l(new Date),1e3);return()=>window.clearInterval(e)},[p]);let y=a(()=>ri({schedules:t,...n.retainedEvidence(),now:i}),[n,i,t]);return r(()=>{if(!p){v.current&&h.current?.focus(),v.current=!1;return}v.current=!0;let e=()=>m(!1),t=window.setTimeout(e,6e4),n=()=>{window.clearTimeout(t),t=window.setTimeout(e,6e4)},r=t=>{t.key===`Escape`&&e()},i=e=>{if(e.key!==`Tab`)return;let t=[...g.current?.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]],n=t.at(0),r=t.at(-1);n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},a=g.current;return a?.addEventListener(`pointerdown`,n),a?.addEventListener(`keydown`,n),a?.addEventListener(`focusin`,n),a?.addEventListener(`keydown`,i),window.addEventListener(`keydown`,r),_.current?.focus(),()=>{window.clearTimeout(t),a?.removeEventListener(`pointerdown`,n),a?.removeEventListener(`keydown`,n),a?.removeEventListener(`focusin`,n),a?.removeEventListener(`keydown`,i),window.removeEventListener(`keydown`,r)}},[p]),f(u,{children:[d(`button`,{ref:h,className:Z.trigger,type:`button`,"aria-expanded":p,"aria-controls":`update-activity-dialog`,onClick:()=>{l(new Date),m(!0)},children:`Update activity`}),p&&f(`section`,{ref:g,className:Z.dialog,"data-update-activity":!0,id:`update-activity-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`update-activity-title`,children:[f(`div`,{className:Z.dialogHeader,children:[f(`div`,{children:[d(`h2`,{id:`update-activity-title`,children:`Update activity`}),d(`p`,{children:`Browser-local proxy reads from the last 10 minutes. Panels schedule independently.`})]}),d(`button`,{ref:_,className:Z.close,type:`button`,onClick:()=>m(!1),children:`Close`})]}),f(`div`,{className:Z.body,children:[d(`span`,{className:Z.legend,children:`● observed · ◇ expected`}),e&&y.lanes.length===0&&d(`p`,{className:Z.empty,children:`No visible polling panels are configured.`}),y.lanes.length>0&&f(u,{children:[f(`div`,{className:Z.axis,"aria-hidden":`true`,children:[d(`span`,{children:`10m ago`}),d(`span`,{children:`now`})]}),d(`div`,{className:Z.lanes,children:y.lanes.map(e=>f(`div`,{className:Z.lane,"data-update-activity-lane":!0,children:[d(`span`,{className:Z.laneLabel,children:e.label}),f(`span`,{className:Z.track,role:`img`,"aria-label":ai(e,i),children:[e.observed.flatMap(({path:e,starts:t})=>t.map(t=>d(`i`,{className:Z.observed,style:{left:`${ii(t,i)}%`},title:`Observed request: ${e}`},`${e}-${t}`))),e.nextDueAt&&d(`i`,{className:Z.expected,style:{left:`${ii(e.nextDueAt,i)}%`},title:`Expected next poll`})]})]},e.panelId))})]}),y.evidenceMayBeIncomplete&&d(`p`,{className:Z.note,children:`Older browser evidence was pruned, so an empty lane only means no retained request in this window.`}),d(`p`,{className:Z.note,children:`Observed markers are requests this browser started; the outlined marker is the current expected next poll, not an observed request.`})]})]})]})}function ui({env:e,diagnostics:t,auth:n}){let[i,a]=s(),[o,c]=s();return r(()=>{let r=!1;a(void 0),c(void 0);let i=`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`;return t.record({kind:`board-fetch-start`,path:i}),N(e,i,void 0,globalThis.fetch,n).then(async e=>{if(t.record({kind:`board-fetch-response`,path:i,status:e.status,cache:We(e.headers)}),!e.ok)throw Error(`Board configuration returned ${e.status}`);try{return await e.json()}catch(e){throw t.record({kind:`board-fetch-parse-failure`,path:i,message:di(e)}),new fi(e)}}).then(n=>{if(r)return;a(n),c(e.board);let o=Array.isArray(n.panels)?n.panels:[];t.record({kind:`board-fetch-response`,path:i,boardSummary:{panelCount:o.length,panelIds:o.flatMap(e=>typeof e.id==`string`?[e.id]:[])}})}).catch(n=>{n instanceof fi||t.record({kind:`board-fetch-failure`,path:i,message:di(n)}),r||(a({panels:[]}),c(e.board))}),()=>{r=!0}},[n,t,e]),{board:i,loadedBoardName:o}}function di(e){return e instanceof Error?e.message:String(e)}var fi=class extends Error{constructor(e){super(di(e))}},pi=6e4,mi=1e4,hi=()=>globalThis.window.location.reload();function gi({env:e,diagnostics:t,fetcher:n,reload:i=hi,auth:a}){r(()=>{let r=!1,o=!1,s,c=`${e.proxyPath}/client`,l=async()=>{if(r||o)return;o=!0;let u=new AbortController;s=u;let d=globalThis.setTimeout(()=>u.abort(),mi);t.record({kind:`client-update-check`,path:c});try{let o=await N(e,c,{cache:`no-store`,signal:u.signal},n??globalThis.fetch,a);if(!o.ok)throw Error(`Client identity returned ${o.status}`);let s=C.safeParse(await o.json());if(!s.success)throw Error(`Client identity response was invalid`);if(r)return;t.record({kind:`client-update-response`,path:c,serverVersion:s.data.serverVersion,assetPathIdMatches:s.data.assetPathId===e.assetPathId}),s.data.assetPath!==e.assetPath&&(t.record({kind:`client-update-detected`,path:c,current:{assetPath:e.assetPath},next:s.data}),i())}catch(e){!r&&!(e instanceof DOMException&&e.name===`AbortError`)&&t.record({kind:`client-update-failure`,path:c,message:e instanceof Error?e.message:String(e)})}finally{globalThis.clearTimeout(d),o=!1,s===u&&(s=void 0),r||globalThis.setTimeout(()=>void l(),pi)}};return l(),()=>{r=!0,s?.abort()}},[a,t,e,n,i])}function _i(e,t){return X(e.type)?.projectDiagnostic(t)??{state:t.state,link:t.link}}function vi(e){let t=Object.entries(e).map(([e,t])=>t?.envelope?{id:e,state:t.envelope.state,link:t.envelope.link}:{id:e,state:`unavailable`,link:null});return{state:t.some(e=>e.state===`ok`)?`ok`:`error`,link:null,facts:t}}function yi(e){if(e.state!==`ok`)return;let t=k.safeParse(e.signal);if(t.success){if(t.data.status===`running`||t.data.testResults?.state!==`ok`)return;let e=t.data.testResults.signal;return e.status===`reported`?e:void 0}let n=O.safeParse(e.signal);return n.success&&n.data.status===`reported`?n.data:void 0}function bi(e,t){let n=Math.abs(t-e);return n>=20&&(e===0||n/e>=.2)}function xi(e){let t=e.slice(-8).map(e=>e.total),n=t.at(-1);if(n===void 0)return;let r=t.at(-2),i=`quiet`,a=r??n,o=Math.min(2,t.length);if(r!==void 0&&n===0&&r>0)i=`zero`;else if(r!==void 0&&bi(r,n))i=`jump`;else{for(let e=t.length-3;e>=1;e--){let n=t[e-1],r=t[e];if(n!==void 0&&r!==void 0&&bi(n,r)&&t.slice(e+1).every(e=>Math.abs(e-r)<=Math.max(2,r*.02))){i=`holding`,a=n,o=t.length-e+1;break}}if(i===`quiet`){let e=t.slice(1).map((e,n)=>e-(t[n]??e)).filter(e=>e!==0),s=n-(t[0]??n);e.length>=3&&Math.abs(s)>=5&&e.every(e=>Math.sign(e)===Math.sign(s))?(i=`trend`,a=t[0]??n,o=t.length):r!==void 0&&n!==r&&(i=`change`)}}let s=n-a,c=i===`quiet`?``:i===`zero`?`⚠ ↓`:i===`holding`?`→`:i===`trend`?s>0?`↗`:`↘`:s>0?`↑`:`↓`,l=a>0?` (${s>0?`+`:``}${(s/a*100).toFixed(1)}%)`:``,u={zero:`Reported zero tests; previously ${a.toLocaleString()}.`,jump:`Large jump: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,holding:`Holding a new level: ${n.toLocaleString()} tests, previously ${a.toLocaleString()}${l}.`,trend:`Sustained ${s>0?`increase`:`decrease`}: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,change:`Latest change: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,quiet:`No clear count change. Latest: ${n.toLocaleString()} tests.`};return{mode:i,symbol:c,delta:s,emphasized:i===`zero`||i===`jump`,totals:t,explanation:`${u[i]} Comparison: ${o} retained run reading${o===1?``:`s`}. History: ${t.join(` → `)}. Source readings retained by this browser are included; this is not complete CI history or a measure of test quality.`}}function Si(e){if(e)return{mode:e.mode,delta:e.delta,totals:e.totals}}var Ci=36e5,wi=24*Ci,Q={retentionMillis:14*wi,retainedReadings:32,refreshMillis:wi,gapMillis:Ci,minimumAttemptMillis:Ci,retryDelaysMillis:[Ci,6*Ci,wi]},Ti={failures:0,gapPending:!1};function Ei(e){return JSON.stringify([e.id,e.attempt])}function Di(e,t){return Date.parse(e.updatedAt)-Date.parse(t.updatedAt)||e.id.localeCompare(t.id,`en`,{numeric:!0})||e.attempt-t.attempt}function Oi(e,t,n){let r=new Map(e.map(e=>[Ei(e),e]));for(let e of t){let t=r.get(Ei(e));(!t||Date.parse(e.updatedAt)>=Date.parse(t.updatedAt))&&r.set(Ei(e),e)}return[...r.values()].filter(e=>Date.parse(e.updatedAt)>=n-Q.retentionMillis).sort(Di).slice(-Q.retainedReadings)}function ki(e,t,n=!1){let r=e.findIndex(e=>Ei(e)===Ei(t));if(r<0)return;let i=xi([...e.slice(0,r),t]);return i&&n?{...i,explanation:`${i.explanation} Recent source-history inspection was incomplete.`}:i}function Ai(e=Ti,t){return{...e,lastConfirmedAt:t,gapPending:e.gapPending||e.lastConfirmedAt!==void 0&&t-e.lastConfirmedAt>=Q.gapMillis}}function ji(e=Ti,t,n){return n>=(e.nextAttemptAt??0)&&(e.lastCompleteAt===void 0||n-e.lastCompleteAt>=Q.refreshMillis||e.gapPending||e.hadSamples===!0&&!t)}function Mi(e=Ti,t){return{...e,lastAttemptAt:t,nextAttemptAt:t+Q.minimumAttemptMillis}}function Ni(e=Ti,t,n,r,i=0){let a={...e,hadSamples:n,partial:!t?.complete||t.samples.length<t.inspectedRuns};if(t?.complete)return{...a,lastCompleteAt:r,failures:0,gapPending:!1,nextAttemptAt:r+Q.minimumAttemptMillis};let o=e.failures+1,s=Q.retryDelaysMillis[Math.min(o-1,Q.retryDelaysMillis.length-1)]??Q.refreshMillis;return{...a,failures:o,nextAttemptAt:Math.max(r+s,i,t?.retryAt?Date.parse(t.retryAt):0)}}var Pi=`ze-great-dashboard.panel-memory.v1`,Fi=1,Ii=12096e5,Li=class{now;histories;storage;constructor(e=je(),t=()=>new Date){this.now=t,this.storage=e,this.histories=this.read(),this.pruneAll()}latest(e){return this.history(e).latest}rememberLatest(e,t){this.history(e).latest=t,this.persist()}recordRun(e,t,n=!1){let r=this.history(e);n&&(r.durations[Ri(t)]=t);let i=r.latestCompleted;(!i||zi(t.sourceUpdatedAt,i.sourceUpdatedAt))&&(r.latestCompleted=t),this.pruneHistory(r),this.persist()}recordSuccessfulRun(e,t){this.recordRun(e,t,!0)}recordCompletedRun(e,t){this.recordRun(e,t)}medianDuration(e){let t=this.history(e);this.pruneHistory(t);let n=Object.values(t.durations).map(({durationMs:e})=>e).sort((e,t)=>e-t);if(n.length===0)return;let r=Math.floor(n.length/2);if(n.length%2==1)return n[r];let i=n[r-1],a=n[r];return i===void 0||a===void 0?void 0:Math.floor((i+a)/2)}resolveEstimatedDuration(e){let t=this.medianDuration(e);if(t!==void 0)return t;let n=this.history(e);return this.pruneHistory(n),n.latestCompleted?.durationMs}observeTests(e,t,n){let r=yi(n);if(!r?.run)return;let i=this.testHistory(e,t),a={...r.run,total:r.total};return i.tests=Oi(i.tests??[],[a],this.now().valueOf()),i.repair&&={...i.repair,hadSamples:!!i.tests.length},this.persist(),ki(i.tests,a,i.repair?.partial)}testDirection(e,t,n){let r=yi(n);if(!r?.run)return;let i=this.testHistory(e,t);return this.pruneHistory(i),ki(i.tests??[],{...r.run,total:r.total},i.repair?.partial)}confirmTestPoll(e,t){let n=this.testHistory(e,t);n.repair=Ai(n.repair,this.now().valueOf()),this.persist()}testRepairDue(e,t){let n=this.testHistory(e,t);return this.pruneHistory(n),ji(n.repair,!!n.tests?.length,this.now().valueOf())}beginTestRepair(e,t){let n=this.testHistory(e,t);n.repair=Mi(n.repair,this.now().valueOf()),this.persist()}finishTestRepair(e,t,n,r){let i=this.testHistory(e,t),a=this.now().valueOf();i.tests=Oi(i.tests??[],n?.samples??[],a),i.repair=Ni(i.repair,n,!!i.tests.length,a,r),this.persist()}testHistory(e,t){return this.history({...Vi(e,t),testArtifact:JSON.stringify(t.test_results??null)})}history(e){let t=Hi(e),n=this.histories[t];if(n)return n;let r={durations:{}};return this.histories[t]=r,r}pruneAll(){for(let e of Object.values(this.histories))this.pruneHistory(e);this.persist()}pruneHistory(e){let t=this.now().valueOf()-Ii;e.tests&&=Oi(e.tests,[],this.now().valueOf());for(let[n,r]of Object.entries(e.durations)){let i=Bi(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?Bi(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=Me(this.storage,Pi);return e?.schemaVersion!==Fi||!e.histories?{}:Ui(e.histories)?e.histories:{}}persist(){Ne(this.storage,Pi,{schemaVersion:Fi,histories:this.histories})}};function Ri(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function zi(e,t){let n=Bi(e),r=Bi(t);return n!==void 0&&(r===void 0||n>=r)}function Bi(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Vi(e,t){return{board:e,panelId:t.id,source:t.source??``,workflow:typeof t.pipeline==`string`||typeof t.pipeline==`number`?String(t.pipeline):``,branch:t.branch??``}}function Hi(e){let t=[e.board,e.panelId,e.source,e.workflow,e.branch];return e.testArtifact!==void 0&&t.push(e.testArtifact),JSON.stringify(t)}function Ui(e){return $(e)?Object.values(e).every(Wi):!1}function Wi(e){if(!$(e)||!$(e.durations)||!Object.values(e.durations).every(Gi))return!1;if(e.repair!==void 0){if(!$(e.repair)||!Number.isInteger(e.repair.failures)||Number(e.repair.failures)<0||typeof e.repair.gapPending!=`boolean`)return!1;for(let t of[`lastConfirmedAt`,`lastCompleteAt`,`lastAttemptAt`,`nextAttemptAt`]){let n=e.repair[t];if(n!==void 0&&(typeof n!=`number`||!Number.isFinite(n)||n<0))return!1}if(e.repair.partial!==void 0&&typeof e.repair.partial!=`boolean`||e.repair.hadSamples!==void 0&&typeof e.repair.hadSamples!=`boolean`)return!1}return e.tests!==void 0&&(!Array.isArray(e.tests)||!e.tests.every(e=>$(e)&&typeof e.id==`string`&&e.id.length>0&&Number.isInteger(e.attempt)&&Number(e.attempt)>0&&typeof e.updatedAt==`string`&&Number.isFinite(Date.parse(e.updatedAt))&&Number.isInteger(e.total)&&Number(e.total)>=0))?!1:e.latestCompleted===void 0||Gi(e.latestCompleted)}function Gi(e){return $(e)?(typeof e.link==`string`||e.link===null)&&(e.sourceRunId===void 0||typeof e.sourceRunId==`string`)&&typeof e.durationMs==`number`&&Number.isInteger(e.durationMs)&&e.durationMs>=0&&typeof e.sourceUpdatedAt==`string`&&Bi(e.sourceUpdatedAt)!==void 0:!1}function $(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function Ki(e){e.diagnostics.record({kind:`panel-fetch-start`,panelId:e.panelId,path:e.path});try{let t=await e.fetcher(e.path,{signal:e.signal}),n={kind:`panel-fetch-response`,panelId:e.panelId,path:e.path,status:t.status,cache:We(t.headers)};if(t.status===304){e.diagnostics.record(n);let t=e.cache.get(e.path);return t?{envelope:t}:{error:`Source returned not modified before an initial observation.`}}let r=D.safeParse(await t.json());if(!r.success)return e.diagnostics.record(n),e.diagnostics.record({kind:`panel-fetch-parse-failure`,panelId:e.panelId,path:e.path,message:`Response was not a valid signal envelope.`}),{error:`Response was not a valid signal envelope.`};let i=r.data;return e.diagnostics.record({...n,envelope:i,...i.state===`error`?{failure:qi(i,t)}:{}}),i.state===`ok`&&e.cache.set(e.path,i),{envelope:i}}catch(t){return e.signal?.aborted||e.diagnostics.record({kind:`panel-fetch-failure`,panelId:e.panelId,path:e.path,message:Ji(t)}),{error:Ji(t)}}}function qi(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function Ji(e){return e instanceof Error?e.message:String(e)}function Yi(e){return e.reconciliation.kind===`rejected`&&e.accepted?{envelope:e.current,rejected:{status:e.accepted.status,sourceUpdatedAt:e.accepted.sourceUpdatedAt,link:e.accepted.link,github:Qi(e.reconciliation.envelope.link)}}:{envelope:e.reconciliation.envelope}}function Xi(e){let t=Zi(e.envelope);if(!t)return{kind:`not-pipeline`,envelope:e.envelope};if(e.accepted&&t.sourceUpdatedAt&&Date.parse(t.sourceUpdatedAt)<Date.parse(e.accepted.sourceUpdatedAt))return e.envelope.state!==`ok`||!t.sourceUpdatedAt?{kind:`not-pipeline`,envelope:e.envelope}:{kind:`rejected`,envelope:e.envelope,signal:{...t,sourceUpdatedAt:t.sourceUpdatedAt}};let n=t.sourceUpdatedAt?{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:e.envelope.link}:void 0,r=t.status!==`running`&&t.durationMs!==void 0&&t.sourceUpdatedAt&&Number.isFinite(Date.parse(t.sourceUpdatedAt))?{link:e.envelope.link,...t.sourceRunId?{sourceRunId:t.sourceRunId}:{},durationMs:t.durationMs,sourceUpdatedAt:t.sourceUpdatedAt}:void 0;return{kind:`accepted`,envelope:t.status===`running`&&e.estimatedDurationMs!==void 0&&e.envelope.state===`ok`?{...e.envelope,signal:{...t,estimatedDurationMs:e.estimatedDurationMs}}:e.envelope,signal:t,accepted:n,durationSample:r}}function Zi(e){if(e.state!==`ok`)return;let t=k.safeParse(e.signal);return t.success?t.data:void 0}function Qi(e){if(!e)return!1;try{return new URL(e).hostname===`github.com`}catch{return!1}}function $i(e){return e.panels.flatMap(e=>{if(A(e.position))return[];let t=X(e.type)?.polling;return t&&t.kind!==`local`?[{panel:e,polling:t}]:[]})}function ea(e,t){return`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(t)}`}function ta(e,t,{panel:n,polling:r}){let i=ea(t,n.id),a=r.initialPaths(n,i);return{panelId:n.id,label:n.label??n.id,settings:be(e,n),cadence:`normal`,inFlight:!1,knownPaths:a}}function na(e,t,n){let r=ra(e);if(!r)return{delayMillis:n.refreshMillis,cadence:`normal`};let i=ia(r);return i===void 0?{delayMillis:n.runningRefreshMillis,cadence:`running`}:t<i?{delayMillis:Math.min(n.runningRefreshMillis,i-t),cadence:`running`}:t<i+n.runningCompletionWindowMillis?{delayMillis:n.runningCompletionRefreshMillis,cadence:`completion-window`}:{delayMillis:n.runningRefreshMillis,cadence:`running`}}function ra(e){if(e?.state!==`ok`)return;let t=k.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function ia(e){if(!e.runStartedAt||e.estimatedDurationMs===void 0)return;let t=Date.parse(e.runStartedAt);return Number.isFinite(t)?t+e.estimatedDurationMs:void 0}function aa(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=sa(n.envelope,`pull-request-workflow`);if(r)return r.item;let i=n.error??`No usable observation is available.`;return t.push({label:`Update workflow ${e}`,message:i}),{label:e,status:`unknown`,detail:`Update workflow ${e} · Unavailable: ${i}`,link:null}}),r=ca(e.candidates.envelope);if(!r){let r=e.candidates.error??`No usable observation is available.`;return t.push({label:`Open update PR candidates`,message:r}),n.every(e=>e.status===`unknown`)?void 0:oa(e,n,[],t,la(e.workflows.map(({observation:e})=>e)))}return r.truncated&&t.push({label:`Open update PR candidates`,message:`The first 100 candidates were observed; additional open update PRs may exist.`}),oa(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=sa(r?.envelope,`pull-request-build`);if(i)return{...i.item,label:`PR #${n.number}`,detail:i.item.detail,link:n.link};let a=r?.error??`No usable observation is available.`;return t.push({label:`PR #${n.number}`,message:a}),{label:`PR #${n.number}`,status:`unknown`,detail:`${n.branch} · Unavailable: ${a}`,link:n.link}}),t,la([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function oa(e,t,n,r,i){let a=ua([...t,...n].map(e=>e.status)),o=[...t,...n].find(e=>e.status===a),s=a!==`passed`&&o?`${o.label}: ${o.detail}`:n.length===0?`${t.length} update workflow${t.length===1?``:`s`} · No open update PRs`:`${t.length} update workflow${t.length===1?``:`s`} · ${n.length} open update PR${n.length===1?``:`s`}`,c=i.sort();return{panelId:e.panelId,state:`ok`,observedAt:c[0]??new Date().toISOString(),link:e.link,signal:{type:`pull-request-health`,status:a,summary:s,workflows:t,pullRequests:n,...r.length?{incompleteObservations:r}:{},...c.length>1?{newestObservedAt:c.at(-1)}:{}}}}function sa(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?de:fe).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function ca(e){if(e?.state!==`ok`)return;let t=ue.safeParse(e.signal);return t.success?t.data:void 0}function la(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function ua(e){return e.reduce((e,t)=>oe(t)>oe(e)?t:e,`passed`)}var da=class{options;pending=new Map;activePolls=new Set;healthy=new Set;controller;disposed=!1;constructor(e){this.options=e}currentStarted(e){this.activePolls.add(e)}currentSettled(e,t,n,r){this.disposed||(this.activePolls.delete(e.id),r||this.pending.delete(e.id),n?this.healthy.add(e.id):this.healthy.delete(e.id),n&&r&&(this.options.memory.confirmTestPoll(this.options.board,e),this.options.memory.testRepairDue(this.options.board,e)&&this.pending.set(e.id,{panel:e,path:`${t}/test-history`})),this.drain())}dispose(){this.disposed=!0,this.pending.clear(),this.controller?.abort()}drain(){if(!(this.disposed||this.controller||this.activePolls.size||!(this.options.visible?.()??document.visibilityState===`visible`))){for(let[e,t]of this.pending)if(this.pending.delete(e),this.healthy.has(e)&&this.options.memory.testRepairDue(this.options.board,t.panel)){this.controller=new AbortController,this.run(t,this.controller);return}}}async run({panel:e,path:t},n){let{board:r,memory:i,diagnostics:a}=this.options;i.beginTestRepair(r,e);let o,s;try{let e=await this.options.fetcher(t,{signal:n.signal});s=Te(e.headers.get(`retry-after`),Date.now()),e.ok&&(o=we.parse(await e.json()))}catch{}!this.disposed&&!n.signal.aborted&&(i.finishTestRepair(r,e,o,s),a.record({kind:`test-history-repair`,panelId:e.id,path:t,outcome:o?.complete?`complete`:o?`partial`:`failed`,inspectedRuns:o?.inspectedRuns??0,samples:o?.samples.length??0}),this.options.onMerged(e)),this.controller=void 0,this.drain()}};function fa({board:e,env:t,diagnostics:n,memory:i,auth:a}){let[c,l]=s({}),u=o({}),[d,f]=s({}),[p,m]=s({}),[h,g]=s({}),[_,v]=s([]),[y,b]=s({}),x=o({}),S=o({}),C=o(null);return C.current||=i??new Li,r(()=>{if(x.current={},S.current={},f({}),l({}),u.current={},m({}),g({}),v([]),b({}),!e)return;let r=!1,i=C.current;if(!i)return;let o=new Map,s=(e,r)=>{JSON.stringify(o.get(e.id))!==JSON.stringify(r)&&(o.set(e.id,r),n.record({kind:`panel-rendered`,panelId:e.id,path:ea(t,e.id),rendered:r}))},c=(e,n)=>{if(r)return;let a=X(e.type)?.testHistory?i.testDirection(t.board,e,n):void 0,o=Si(a);s(e,{..._i(e,n),...o?{testDirection:o}:{}}),u.current={...u.current,[e.id]:a},l(u.current),x.current={...x.current,[e.id]:n},f(x.current)},d=(e,t)=>{r||(s(e,vi(t)),S.current={...S.current,[e.id]:t},g(S.current))},p=new da({board:t.board,memory:i,diagnostics:n,fetcher:(e,n)=>N(t,e,n,globalThis.fetch,a),onMerged:e=>{let t=x.current[e.id];t&&c(e,t)}}),h=new Set,_=new Set,y=$i(e),w=y.map(n=>ta(e,t,n)),ee=new Map(w.map(e=>[e.panelId,e]));v(w);let te=(e,t)=>{r||v(n=>n.map(n=>n.panelId===e?{...n,...t}:n))};for(let{panel:e,polling:i}of y){let o=!1,s=C.current;if(!s)return;let l=ee.get(e.id);if(!l)continue;let{settings:u}=l,f=ea(t,e.id),g,v,y=()=>{v=new Date().toISOString(),r||m(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n})},S=t=>{let n=v;if(r||!n)return;let i=ha(t);m(t=>{let r=t[e.id];return{...t,[e.id]:{consecutiveFailures:(r?.consecutiveFailures??0)+1,message:i,lastConfirmedAt:n}}})},w=async t=>{if(r||o)return;o=!0;let i=new AbortController,a={signal:i.signal,healthy:!1,historySupported:!1};_.add(i),p.currentStarted(e.id),te(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0});try{await t(a)}catch(t){!r&&!a.signal.aborted&&(S(t),t instanceof ga||n.record({kind:`panel-fetch-failure`,panelId:e.id,path:f,message:ha(t)}))}finally{if(o=!1,_.delete(i),!r&&!a.signal.aborted){let n=na(g,Date.now(),u);te(e.id,{inFlight:!1,cadence:n.cadence,nextDueAt:new Date(Date.now()+n.delayMillis).toISOString()});let r=window.setTimeout(()=>{h.delete(r),w(t)},n.delayMillis);h.add(r)}p.currentSettled(e,f,a.healthy,a.historySupported)}};switch(i.kind){case`facts`:{if(!e.facts)break;let r=e.facts,i=new Map;w(async({signal:o})=>{let s=await Promise.all(r.map(async r=>{let s=await Ki({diagnostics:n,panelId:e.id,path:`${f}/facts/${encodeURIComponent(r.id)}`,signal:o,cache:i,fetcher:(e,n)=>N(t,e,n,globalThis.fetch,a)});return[r.id,s.error?{failure:s.error}:s]}));o.aborted||d(e,Object.fromEntries(s))});continue}case`pull-request-health`:{let i=Gr(e),o=new Map;w(async({signal:s})=>{let l=async r=>{let i=await Ki({diagnostics:n,panelId:e.id,path:r,signal:s,cache:o,fetcher:(e,n)=>N(t,e,n,globalThis.fetch,a)});return i.envelope?.state===`error`?{error:i.envelope.error.message}:i},[u,...d]=await Promise.all([l(`${f}/pull-requests`),...i.map(({workflow:e})=>l(`${f}/update-workflow/${encodeURIComponent(e)}`))]);if(r||s.aborted)return;let p=u.envelope?.state===`ok`&&ma(u.envelope.signal)?u.envelope.signal.pullRequests:[],m=await Promise.all(p.map(async e=>[e.branch,await l(`${f}/pull-request-build?branch=${encodeURIComponent(e.branch)}`)]));if(r||s.aborted)return;let h=aa({panelId:e.id,link:u.envelope?.link??null,workflows:i.map(({workflow:e},t)=>({workflow:e,observation:d[t]??{error:`Missing workflow result.`}})),candidates:u,builds:new Map(m)});h?(g=h,y(),c(e,h)):S(`No usable pull-request observations.`)});continue}}w(async i=>{n.record({kind:`panel-fetch-start`,panelId:e.id,path:f});let o=await N(t,f,{signal:i.signal},globalThis.fetch,a);i.historySupported=X(e.type)?.testHistory===!0&&o.headers.get(`X-Dashboard-Test-History`)===`supported`;let l={kind:`panel-fetch-response`,panelId:e.id,path:f,status:o.status,cache:We(o.headers)};if(o.status===304){i.healthy=g?.state===`ok`,n.record(l),y();return}let u;try{let t=_a(await o.json());if(!t){n.record(l),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:f,message:`Response was not a valid signal envelope.`}),S(`Response was not a valid signal envelope.`);return}u=t,n.record({...l,envelope:u,...u.state===`error`?{failure:pa(u,o)}:{}}),i.healthy=u.state===`ok`,y()}catch(t){throw n.record(l),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:f,message:ha(t)}),new ga(t)}if(r||i.signal.aborted)return;let d={status:o.status,cache:l.cache};if(e.type===`pipeline-status`){let i=Vi(t.board,e),a=s.latest(i),o=Xi({envelope:u,accepted:a,estimatedDurationMs:s.resolveEstimatedDuration(i)}),c=Yi({current:x.current[e.id],reconciliation:o,accepted:a});if(o.kind===`rejected`&&a){let t=o.signal;n.recordGithubConsistencyIncident({panelId:e.id,endpoint:f,identity:{source:i.source,workflow:i.workflow,branch:i.branch},accepted:a,regressed:{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:u.link},response:{httpStatus:d.status,date:d.cache?.date,etag:d.cache?.etag,cacheControl:d.cache?.cacheControl}}),r||b(t=>({...t,[e.id]:c.rejected}));return}if(o.kind===`accepted`&&(u=o.envelope,!r&&c.rejected===void 0&&b(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n}),o.accepted&&s.rememberLatest(i,o.accepted),o.durationSample)){let e={link:o.durationSample.link,...o.durationSample.sourceRunId?{sourceRunId:o.durationSample.sourceRunId}:{},durationMs:o.durationSample.durationMs,sourceUpdatedAt:o.durationSample.sourceUpdatedAt};s.recordRun(i,e,o.signal.status===`passed`)}}g=u,X(e.type)?.testHistory&&s.observeTests(t.board,e,u),c(e,u)})}return()=>{r=!0,p.dispose();for(let e of _)e.abort();for(let e of h)window.clearTimeout(e)}},[a,e,n,t]),{signals:d,updateHealth:p,factSignals:h,schedules:_,rejectedPipelines:y,testDirections:c}}function pa(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function ma(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function ha(e){return e instanceof Error?e.message:String(e)}var ga=class extends Error{constructor(e){super(ha(e))}};function _a(e){let t=D.safeParse(e);return t.success?t.data:void 0}function va({env:e}){return e.security===`blocked`?d(ti,{mode:`blocked`}):e.auth?d(tt,{env:e,auth:e.auth,children:(e,t,n,r)=>d(ya,{env:n,accessToken:e,onDenied:t,diagnosticLog:r})}):d(ya,{env:e})}function ya({env:e,accessToken:t,onDenied:n,diagnosticLog:i}){let s=o(null);s.current||=i??new He(e);let c=i??s.current,l=a(()=>t?{accessToken:t,onAuthenticationFailure:e=>e===403&&n?.()}:void 0,[t,n]);gi({env:e,diagnostics:c,auth:l});let{board:u,loadedBoardName:p}=ui({env:e,diagnostics:c,auth:l}),{signals:m,updateHealth:h,factSignals:g,schedules:_,rejectedPipelines:v,testDirections:y}=fa({board:p===e.board?u:void 0,env:e,diagnostics:c,auth:l}),b=a(()=>u?ge(u.panels):void 0,[u]),x=a(()=>Ee({board:u,signals:m,updateHealth:h,factSignals:g}),[u,g,m,h]),S=x.length?u?.attention?.treatment:void 0,C=new Set(x.map(e=>e.panelId));return r(()=>{b&&b.issues.length!==0&&c.record({kind:`layout-analyzed`,issueCount:b.issues.length,affectedPanelIds:b.issues.map(e=>e.panelId)})},[c,b]),f(`div`,{className:`${j.board} ${S?j[`attention-${S}`]:``}`,"data-attention-treatment":S,"data-attention-active":x.length||void 0,children:[f(`header`,{className:j.header,children:[d(`h1`,{className:j.title,children:e.board}),e.security===`warning`&&d(ti,{mode:`warning`}),x.length>0&&f(`aside`,{className:j.attentionRail,role:`alert`,"aria-label":`Important panel attention`,children:[d(`span`,{className:j.attentionGlyph,"aria-hidden":`true`,children:`⚠`}),d(`ul`,{children:x.map(e=>d(`li`,{children:f(`a`,{href:`#panel-${e.panelId}`,children:[d(`strong`,{children:e.label}),`: `,e.reason]})},`${e.panelId}-${e.factId??`panel`}-${e.reason}`))})]})]}),f(`main`,{className:j.grid,children:[!u&&d(it,{label:`board`,hint:`Loading configuration…`,wide:!0}),u?.panels.filter(e=>!A(e.position)).map(e=>d(Yr,{panel:e,envelope:m[e.id],attentionActive:C.has(e.id),updateHealth:h[e.id],rejectedPipeline:v[e.id],facts:g[e.id],testDirection:y[e.id]},e.id))]}),f(`footer`,{className:j.footer,"data-board-footer":!0,children:[d(`span`,{children:`Signals are read live from their configured authorities.`}),f(`div`,{className:j.footerTools,children:[l&&d(Zr,{env:e,auth:l}),b&&b.issues.length>0&&d(Ye,{board:e.board,layout:b,env:e,auth:l}),d(ke,{log:c,updateActivity:()=>{let e=c.retainedEvidence(),t=ri({schedules:_,...e});return{capturedAt:t.capturedAt,window:t.window,schedules:t.schedules}}}),d(li,{board:u,schedules:_,log:c})]})]})]})}var ba={error:`_error_yx1g9_1`};function xa({message:e}){return f(`div`,{className:ba.error,role:`alert`,children:[d(`h1`,{children:`⚠️ Dashboard misconfigured`}),d(`p`,{children:`The page loaded, but the server did not hand it usable configuration.`}),d(`pre`,{children:e})]})}var Sa=document.getElementById(`root`);if(!Sa)throw Error(`No #root element in the document — the template is not the one we expect.`);var Ca=l(Sa);try{Ca.render(d(t,{children:d(va,{env:w()})}))}catch(e){Ca.render(d(xa,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
-
//# sourceMappingURL=index-
|
|
2
|
+
${e.prettifyError(n.error)}`);return n.data}var ee=/^([1-9][0-9]*)(ms|s|m|h)$/,te={ms:1,s:1e3,m:6e4,h:36e5};function T(e){let t=ee.exec(e);if(!t)return null;let[,n,r]=t;if(n===void 0||r===void 0)return null;let i=Number(n);return i<=0?null:i*te[r]}e.string().regex(/^[1-9][0-9]*(?:ms|s|m|h)$/,{message:`must be a positive duration like "30s", "5m", or "1h"`}).brand();var E=e.enum([`unreachable`,`unauthorized`,`not-found`,`no-runs`,`upstream-error`]),ne=e.object({kind:E,message:e.string()}),D=e.discriminatedUnion(`state`,[e.object({panelId:e.string().min(1),state:e.literal(`ok`),observedAt:e.iso.datetime(),link:e.url().nullable(),signal:e.unknown()}),e.object({panelId:e.string().min(1),state:e.literal(`error`),observedAt:e.iso.datetime(),link:e.url().nullable(),error:ne})]),re=e.object({kind:e.enum([`job`,`stage`,`step`]),name:e.string().min(1),parent:e.string().min(1).optional()}),O=e.discriminatedUnion(`status`,[e.object({type:e.literal(`test-count`),status:e.literal(`reported`),total:e.number().int().nonnegative(),run:e.object({id:e.string().min(1),attempt:e.number().int().positive(),updatedAt:e.iso.datetime()}).optional(),passed:e.number().int().nonnegative().optional(),failed:e.number().int().nonnegative().optional(),skipped:e.number().int().nonnegative().optional()}),e.object({type:e.literal(`test-count`),status:e.literal(`pending`)}),e.object({type:e.literal(`test-count`),status:e.literal(`not-reported`)})]),ie=e.discriminatedUnion(`state`,[e.object({state:e.literal(`ok`),observedAt:e.iso.datetime(),signal:O}),e.object({state:e.literal(`error`),observedAt:e.iso.datetime(),error:ne})]),k=e.object({type:e.literal(`pipeline-status`),status:e.enum([`passed`,`failed`,`warning`,`running`,`cancelled`,`unknown`]),rawStatus:e.string(),testResults:ie.optional(),name:e.string().min(1),branch:e.string().min(1).optional(),durationMs:e.number().int().nonnegative().optional(),runStartedAt:e.iso.datetime().optional(),sourceRunId:e.string().min(1).optional(),activity:re.optional(),estimatedDurationMs:e.number().int().positive().optional(),sourceUpdatedAt:e.iso.datetime().optional()}),ae={passed:0,cancelled:1,unknown:2,running:3,warning:4,failed:5};function oe(e){return ae[e]}var se=e.object({label:e.string().min(1),status:k.shape.status,detail:e.string().min(1),link:e.url().nullable()}),ce=e.object({type:e.literal(`pull-request-health`),status:k.shape.status,summary:e.string().min(1),workflows:e.array(se),pullRequests:e.array(se),incompleteObservations:e.array(e.object({label:e.string().min(1),message:e.string().min(1)})).optional(),newestObservedAt:e.iso.datetime().optional()}),le=e.object({number:e.number().int().positive(),branch:e.string().min(1),link:e.url()}),ue=e.object({type:e.literal(`pull-request-candidates`),pullRequests:e.array(le),truncated:e.boolean().optional()}),de=e.object({type:e.literal(`pull-request-workflow`),workflow:e.string().min(1),item:se}),fe=e.object({type:e.literal(`pull-request-build`),branch:e.string().min(1),item:se}),pe=e.object({type:e.literal(`http-value`),value:e.union([e.string(),e.number(),e.boolean()])}),me=12,he=12;function ge(e){let t=e.flatMap(e=>!e.position||A(e.position)||_e(e.position)?[]:[{panelId:e.id,kind:`out-of-bounds`,position:e.position,conflictsWith:[]}]),n=new Map;for(let r=0;r<e.length;r++){let i=e[r];if(i?.position&&!A(i.position))for(let a=r+1;a<e.length;a++){let r=e[a];if(!r?.position||A(r.position)||!ve(i.position,r.position))continue;let o=`${r.id}\0overlap`,s=n.get(o);if(s)s.conflictsWith.push(i.id);else{let e={panelId:r.id,kind:`overlap`,position:r.position,conflictsWith:[i.id]};n.set(o,e),t.push(e)}}}return{issues:t}}function A(e){return e?.x===0&&e.y===0&&e.w===0&&e.h===0}function _e(e){return!A(e)&&e.x+e.w<=me&&e.y+e.h<=he}function ve(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}var ye={refreshMillis:6e4,runningRefreshMillis:15e3,runningCompletionRefreshMillis:5e3,runningCompletionWindowMillis:12e4};function be(e,t){let n=(e,t)=>T(e??``)??t,r=(r,i,a)=>n(t[r],n(e[i],a));return{refreshMillis:r(`refresh`,`refresh`,ye.refreshMillis),runningRefreshMillis:r(`running_refresh`,`running_refresh`,ye.runningRefreshMillis),runningCompletionRefreshMillis:r(`running_completion_refresh`,`running_completion_refresh`,ye.runningCompletionRefreshMillis),runningCompletionWindowMillis:r(`running_completion_window`,`running_completion_window`,ye.runningCompletionWindowMillis)}}var xe=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`],Se=e.strictObject({oidc:e.literal(!0),policy:e.discriminatedUnion(`mode`,[e.strictObject({mode:e.literal(`authenticated`)}),e.strictObject({mode:e.literal(`subjects`)}),e.strictObject({mode:e.literal(`claim`),claim:e.string().min(1),match:e.enum([`any`,`all`])})])}),Ce=e.object({id:e.string().min(1),attempt:e.number().int().positive(),updatedAt:e.iso.datetime(),total:e.number().int().nonnegative()}),we=e.object({inspectedAt:e.iso.datetime(),inspectedRuns:e.number().int().min(0).max(8),complete:e.boolean(),samples:e.array(Ce).max(8),retryAt:e.iso.datetime().optional()});function Te(e,t){if(!e)return;let n=/^\d+$/.test(e)?t+Number(e)*1e3:Date.parse(e);return Number.isFinite(n)&&n>t?n:void 0}var j={board:`_board_12472_1`,header:`_header_12472_11`,attentionRail:`_attentionRail_12472_18`,attentionGlyph:`_attentionGlyph_12472_43`,"attention-beacon":`_attention-beacon_12472_46`,"attention-alarm":`_attention-alarm_12472_51`,"attention-steady":`_attention-steady_12472_59`,title:`_title_12472_81`,grid:`_grid_12472_87`,footerTools:`_footerTools_12472_97`,layoutWarning:`_layoutWarning_12472_102`,layoutWarningButton:`_layoutWarningButton_12472_105`,layoutWarningDialog:`_layoutWarningDialog_12472_123`,layoutWarningHeading:`_layoutWarningHeading_12472_136`,layoutWarningClose:`_layoutWarningClose_12472_154`,layoutWarningDownloads:`_layoutWarningDownloads_12472_162`,layoutWarningNote:`_layoutWarningNote_12472_181`,footer:`_footer_12472_97`};function Ee(e){return e.board?.attention?e.board.panels.flatMap(t=>{if(!t.attention)return[];let n=t.label??t.id;if(t.type===`http-value`&&t.facts)return t.facts.flatMap(r=>{let i=e.factSignals[t.id]?.[r.id],a=De(i);return a?[{panelId:t.id,label:n,reason:`${r.label}: ${a}`,factId:r.id}]:[]});let r=Oe(t.type,e.signals[t.id],e.updateHealth[t.id]);return r?[{panelId:t.id,label:n,reason:r}]:[]}):[]}function De(e){if(e?.failure)return`Updates unavailable — ${e.failure}`;if(e?.updateHealth)return`Updates unavailable — ${e.updateHealth.message}`;if(e?.envelope)return e.envelope.state===`error`?e.envelope.error.message:pe.safeParse(e.envelope.signal).success?void 0:`Invalid value`}function Oe(e,t,n){if(n)return`Updates unavailable — ${n.message}`;if(t){if(t.state===`error`)return t.error.message;if(e===`pipeline-status`){let e=k.safeParse(t.signal);return e.success?e.data.status===`failed`?`Pipeline failed`:void 0:`Invalid signal`}if(e===`pull-request-health`){let e=ce.safeParse(t.signal);if(!e.success)return`Invalid signal`;if(e.data.status===`failed`)return e.data.summary;let n=e.data.incompleteObservations?.[0];return n?`${n.label}: ${n.message}`:void 0}if(e===`http-value`)return pe.safeParse(t.signal).success?void 0:`Invalid value`}}var M={diagnostics:`_diagnostics_lseur_1`,button:`_button_lseur_5`,area:`_area_lseur_14`,warning:`_warning_lseur_31`,panels:`_panels_lseur_35`,actions:`_actions_lseur_43`};function ke({log:e,updateActivity:t}){let[n,r]=s(!1);c(e.subscribe,e.snapshot,e.snapshot);let i=e.count(),a=e.githubConsistencyIncidentCount(),o=e.summary();return f(`section`,{className:M.diagnostics,children:[f(`button`,{className:M.button,type:`button`,"aria-expanded":n,onClick:()=>r(!n),children:[`Diagnostics (`,i,`)`,a>0&&` · GitHub consistency ${a}`]}),n&&f(`div`,{className:M.area,children:[f(`p`,{children:[`Client `,e.clientVersion(),` · assets `,e.assetPath()]}),f(`p`,{children:[o.retained.eventCount,` retained browser-local events across`,` `,o.retained.sessionCount,` session`,o.retained.sessionCount===1?``:`s`,o.retained.firstEventAt&&o.retained.lastEventAt?` (${Ae(o.retained.firstEventAt,o.retained.lastEventAt)})`:``,`. They are never uploaded.`]}),o.retained.evidenceMayBeIncomplete&&f(`p`,{className:M.warning,role:`alert`,children:[`Earlier evidence was pruned: `,o.retained.retention.eventsPrunedByCount,` at the 2,000-event cap and `,o.retained.retention.eventsPrunedByAge,` by the 7-day age limit. “No failures” applies only to the retained window.`]}),f(`p`,{children:[`Update failures: `,o.failures.clientUpdate,`; board fetch failures:`,` `,o.failures.boardFetch,`.`]}),e.githubConsistencyIncidentCount()>0&&f(`p`,{className:M.warning,role:`alert`,children:[`GitHub API consistency incidents: `,e.githubConsistencyIncidentCount(),`. A response older than the last accepted run was rejected; download diagnostics to report it.`]}),o.panels.length>0&&d(`div`,{className:M.panels,children:o.panels.map(e=>f(`p`,{children:[d(`strong`,{children:e.panelId}),` — `,e.requests,` requests`,Object.keys(e.httpStatuses).length?`; HTTP ${Object.entries(e.httpStatuses).map(([e,t])=>`${e}×${t}`).join(`, `)}`:``,`; parse/network failures `,e.parseFailures,`/`,e.networkFailures,`; visible changes `,e.visibleStateChanges,`; latest`,` `,e.latestRendered?`${e.latestRendered.state}${e.latestRendered.status?`/${e.latestRendered.status}`:``}`:`not rendered`,`.`,e.latestFailedObservation&&f(u,{children:[` `,`Failure: `,e.latestFailedObservation.reason,`. Support reference:`,` `,d(`code`,{children:e.latestFailedObservation.supportReference??`not provided`}),`.`]})]},e.panelId))}),f(`div`,{className:M.actions,children:[d(`button`,{className:M.button,type:`button`,onClick:()=>{let n=new Blob([JSON.stringify(e.export(t?{updateActivity:t()}:{}),null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`dashboard-diagnostics-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,i.click(),URL.revokeObjectURL(r)},children:`Download`}),d(`button`,{className:M.button,type:`button`,onClick:()=>{window.confirm(`Clear this browser’s retained dashboard diagnostics?`)&&e.clear()},children:`Clear`})]})]})]})}function Ae(e,t){return e===t?e:`${e} to ${t}`}function je(){try{return window.localStorage}catch{return}}function Me(e,t){try{let n=e?.getItem(t);return n?JSON.parse(n):void 0}catch{return}}function Ne(e,t,n){try{e?.setItem(t,JSON.stringify(n))}catch{}}function Pe(e,t){try{e?.removeItem(t)}catch{}}function Fe(e,t,n=0){let r=new Map,i=new Set,a=0,o=0;for(let t of e){if(i.add(t.sessionId),t.kind===`client-update-failure`&&a++,(t.kind===`board-fetch-failure`||t.kind===`board-fetch-parse-failure`)&&o++,!(`panelId`in t))continue;let e=r.get(t.panelId)??{panelId:t.panelId,requests:0,httpStatuses:{},parseFailures:0,networkFailures:0,visibleStateChanges:0};if(t.kind===`panel-fetch-start`&&e.requests++,t.kind===`panel-fetch-response`){if(t.status!==void 0){let n=String(t.status);e.httpStatuses[n]=(e.httpStatuses[n]??0)+1}t.failure&&(e.latestFailedObservation=t.failure)}t.kind===`panel-fetch-parse-failure`&&e.parseFailures++,t.kind===`panel-fetch-failure`&&e.networkFailures++,t.kind===`panel-rendered`&&(e.visibleStateChanges++,e.latestRendered=t.rendered),r.set(t.panelId,e)}let s=e.map(e=>e.at).sort(),c=t.eventsPrunedByAge+t.eventsPrunedByCount;return{githubConsistencyIncidents:n,retained:{eventCount:e.length,firstEventAt:s[0],lastEventAt:s.at(-1),sessionCount:i.size,retention:t,evidenceMayBeIncomplete:c>0},failures:{clientUpdate:a,boardFetch:o},panels:[...r.values()].sort((e,t)=>e.panelId.localeCompare(t.panelId))}}var Ie=`0.31.65`,Le=`ze-great-dashboard.diagnostics.v2`,Re=`ze-great-dashboard.diagnostics.v1`,ze=2e3,Be=6048e5,Ve=[`session-start`,`auth-session`,`client-update-check`,`client-update-response`,`client-update-failure`,`client-update-detected`,`board-fetch-start`,`board-fetch-response`,`board-fetch-parse-failure`,`board-fetch-failure`,`layout-analyzed`,`panel-fetch-start`,`panel-fetch-response`,`panel-fetch-parse-failure`,`panel-fetch-failure`,`panel-rendered`,`test-history-repair`],He=class{env;storage;now;events=[];retention=Ge();revision=0;incidents=[];listeners=new Set;sessionId=crypto.randomUUID?.()??`${Date.now()}-${Math.random()}`;constructor(e,t=je(),n=()=>new Date){this.env=e,this.storage=t,this.now=n,Pe(this.storage,Re),this.events=this.read(),this.record({kind:`session-start`})}recordGithubConsistencyIncident(e){this.incidents.push({...e,at:this.now().toISOString(),board:this.env.board}),this.persist(),this.revision++,this.notify()}githubConsistencyIncidentCount=()=>this.incidents.length;record(e){let t=qe([...this.events,{...e,schemaVersion:2,at:this.now().toISOString(),sessionId:this.sessionId,board:this.env.board,clientVersion:Ie,clientAssetPath:this.env.assetPath,clientAssetPathId:this.env.assetPathId}],this.now(),this.retention);this.events=t.events,this.retention=t.retention,this.persist(),this.revision++,this.notify()}count=()=>this.events.length;clientVersion=()=>Ie;assetPath=()=>this.env.assetPath;snapshot=()=>this.revision;summary=()=>Fe(this.events,this.retention,this.incidents.length);retainedEvidence=()=>({events:[...this.events],retention:{...this.retention}});clear(){this.events=[],this.incidents=[],this.retention=Ge(),Pe(this.storage,Le),this.revision++,this.notify()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});export=e=>({schemaVersion:2,exportedAt:this.now().toISOString(),client:{version:Ie,assetPath:this.env.assetPath,assetPathId:this.env.assetPathId,board:this.env.board,sessionId:this.sessionId},events:this.events,githubConsistencyIncidents:this.incidents,summary:this.summary(),...e});read(){let e=Me(this.storage,Le);if(!e||e.schemaVersion!==2||!Array.isArray(e.events)||!e.events.every(Je))return Pe(this.storage,Le),[];let t=qe(e.events.map(e=>({...e,schemaVersion:2})),this.now(),Ke(e.retention));return this.retention=t.retention,this.incidents=Ue(e.githubConsistencyIncidents),t.events}persist(){Ne(this.storage,Le,{schemaVersion:2,events:this.events,retention:this.retention,githubConsistencyIncidents:this.incidents})}notify(){for(let e of this.listeners)e()}};function Ue(e){return Array.isArray(e)?e.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.at==`string`&&typeof t.board==`string`&&typeof t.panelId==`string`&&typeof t.endpoint==`string`&&!!t.accepted&&!!t.regressed&&!!t.response}):[]}function We(e){let t=Object.fromEntries([[`cacheControl`,`cache-control`],[`etag`,`etag`],[`lastModified`,`last-modified`],[`date`,`date`],[`age`,`age`]].flatMap(([t,n])=>{let r=e.get(n);return r?[[t,r]]:[]}));return Object.keys(t).length?t:void 0}function Ge(){return{eventsPrunedByAge:0,eventsPrunedByCount:0}}function Ke(e){if(!e||typeof e!=`object`)return Ge();let t=e;return{eventsPrunedByAge:typeof t.eventsPrunedByAge==`number`&&t.eventsPrunedByAge>=0?t.eventsPrunedByAge:0,eventsPrunedByCount:typeof t.eventsPrunedByCount==`number`&&t.eventsPrunedByCount>=0?t.eventsPrunedByCount:0}}function qe(e,t,n){let r=t.valueOf()-Be,i=e.filter(e=>Number.isFinite(new Date(e.at).valueOf())&&new Date(e.at).valueOf()>=r),a=e.length-i.length,o=Math.max(0,i.length-ze);return{events:i.slice(-2e3),retention:{eventsPrunedByAge:n.eventsPrunedByAge+a,eventsPrunedByCount:n.eventsPrunedByCount+o}}}function Je(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.schemaVersion===void 0||t.schemaVersion===2)&&typeof t.at==`string`&&Number.isFinite(new Date(t.at).valueOf())&&typeof t.sessionId==`string`&&typeof t.board==`string`&&Ve.includes(t.kind)}function N(e,t,n,r=globalThis.fetch,i={}){let a=new Headers(n?.headers);return a.set(`X-Dashboard-Client-Version`,Ie),a.set(`X-Dashboard-Client-Origin`,globalThis.window.location.origin),a.set(`X-Dashboard-Client-Asset-Id`,e.assetPathId),i.accessToken&&a.set(`authorization`,`Bearer ${i.accessToken}`),r(t,{...n,headers:a}).then(e=>((e.status===401||e.status===403)&&i.onAuthenticationFailure?.(e.status),e))}function Ye({board:e,layout:t,env:n,auth:i}){let[a,o]=s(!1),c=`layout-warning-${e}`;r(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let l=`${n.proxyPath}/boards/${encodeURIComponent(e)}`;return f(`div`,{className:j.layoutWarning,"data-layout-warning":!0,children:[f(`button`,{className:j.layoutWarningButton,type:`button`,"aria-label":`Layout warnings (${t.issues.length})`,"aria-expanded":a,"aria-controls":c,onClick:()=>o(!a),children:[d(`span`,{"aria-hidden":`true`,children:`⚠`}),d(`span`,{children:t.issues.length})]}),a&&f(`aside`,{className:j.layoutWarningDialog,id:c,role:`dialog`,"aria-labelledby":`${c}-title`,"aria-modal":`false`,children:[f(`div`,{className:j.layoutWarningHeading,children:[d(`strong`,{id:`${c}-title`,children:`Layout warnings`}),d(`button`,{className:j.layoutWarningClose,type:`button`,"aria-label":`Close layout warnings`,onClick:()=>o(!1),children:`×`})]}),f(`p`,{children:[t.issues.length,` layout issue`,t.issues.length===1?``:`s`,` detected against the intended 12×12 space. The live board is unchanged: explicit overlaps remain overlapped and overflow continues in implicit rows.`]}),d(`ul`,{children:t.issues.map(e=>f(`li`,{children:[d(`strong`,{children:e.panelId}),`: `,e.kind,` at (`,e.position.x,`,`,` `,e.position.y,`), `,e.position.w,`×`,e.position.h,e.conflictsWith.length?`; overlaps ${e.conflictsWith.join(`, `)}`:``]},`${e.panelId}-${e.kind}`))}),f(`div`,{className:j.layoutWarningDownloads,children:[d(`button`,{type:`button`,onClick:()=>void Xe(n,`${l}/rendered`,i),children:`Download legal rendered layout`}),d(`button`,{type:`button`,onClick:()=>void Xe(n,`${l}/authored`,i),children:`Download authored layout`})]}),d(`p`,{className:j.layoutWarningNote,children:`The legal rendered layout normalizes the currently visible explicit area into 12×12 and makes the smallest deterministic adjustments needed to avoid collisions. The authored layout preserves the original coordinates exactly.`})]})]})}async function Xe(e,t,n){let r=await N(e,t,void 0,globalThis.fetch,n);if(!r.ok)throw Error(`Layout download returned ${r.status}`);let i=document.createElement(`a`);i.href=URL.createObjectURL(await r.blob()),i.download=r.headers.get(`content-disposition`)?.match(/filename="([^"]+)"/)?.[1]??`layout.yaml`,i.click(),URL.revokeObjectURL(i.href)}var Ze={auth:`_auth_19xn9_1`,signout:`_signout_19xn9_24`},Qe=class{values=new Map;async set(e,t){this.values.set(e,t)}async get(e){return this.values.get(e)??null}async remove(e){let t=this.values.get(e)??null;return this.values.delete(e),t}async getAllKeys(){return[...this.values.keys()]}};function $e(e){let t=new h({authority:e.issuer,client_id:e.clientId,redirect_uri:`${window.location.origin}/`,post_logout_redirect_uri:`${window.location.origin}/`,response_type:`code`,scope:`openid profile offline_access`,resource:e.audience,extraQueryParams:{audience:e.audience},userStore:new Qe,stateStore:new g({store:window.sessionStorage}),automaticSilentRenew:!0,maxSilentRenewTimeoutRetries:1}),n=et(window);return n&&t.storeUser(new m({access_token:n.accessToken,expires_at:n.expiresAt,scope:n.scope,token_type:n.tokenType,profile:{iss:e.issuer,aud:e.clientId,exp:n.expiresAt,iat:n.expiresAt-1,sub:`playwright-token-bootstrap`}})),t}function et(e=window){let t=e.__DASHBOARD_OIDC_TEST_BOOTSTRAP__;if(delete e.__DASHBOARD_OIDC_TEST_BOOTSTRAP__,t&&typeof t.accessToken==`string`&&t.accessToken&&Number.isSafeInteger(t.expiresAt)&&typeof t.scope==`string`&&typeof t.tokenType==`string`)return t}function tt({env:e,auth:t,children:r}){let i=a(()=>$e(t),[t]),[o,c]=s(),l=a(()=>o?{...e,board:o}:e,[e,o]),u=a(()=>new He(l),[l]),f=n(e=>{let t=typeof e==`string`&&e?e:void 0,n=t?`/boards/${encodeURIComponent(t)}`:window.location.pathname;window.history.replaceState({},document.title,n),c(t)},[]);return d(_,{userManager:i,onSigninCallback:e=>f(e?.state),children:d(nt,{env:l,diagnostics:u,diagnosticsControl:d(ke,{log:u}),completeCallback:f,children:(e,t)=>r(e,t,l,u)})})}function nt({env:e,diagnostics:t,diagnosticsControl:i,completeCallback:a,children:c}){let l=y(),[m,h]=s(!1),[g]=s(v),[_,b]=s(),x=o(!1),S=o(void 0),C=o(void 0),w=`dashboard.signed-out:${e.auth?.issuer}:${e.auth?.clientId}`,ee=n(()=>h(!0),[]),{events:te,user:T,error:E,signinRedirect:ne}=l,D=!!T&&(T===_||T.expired),re=window.location.pathname.startsWith(`/boards/`)?e.board:void 0;r(()=>{l.isAuthenticated||h(!1)},[l.isAuthenticated]),r(()=>{if(T?.expires_at)return te.addAccessTokenExpired(()=>b(T))},[te,T]),r(()=>{T&&!T.expired&&T!==C.current&&(C.current=T,t.record({kind:`auth-session`,outcome:`ready`,hasRefreshToken:!!T.refresh_token}))},[t,T]),r(()=>{if(!E||E===S.current)return;S.current=E;let e=E.innerError;t.record({kind:`auth-session`,outcome:`failed`,phase:E.source===`renewSilent`?`renewal`:E.source===`signinCallback`?`callback`:`navigation`,reason:rt(e)}),E.source===`signinCallback`&&v()&&a(e instanceof p?e.state:void 0)},[a,t,E]);let O=!x.current&&!l.isLoading&&!l.activeNavigator&&!m&&(!g||l.isAuthenticated)&&(!l.isAuthenticated||D&&E?.source===`renewSilent`)&&!window.sessionStorage.getItem(w);return r(()=>{O&&!x.current&&(x.current=!0,t.record({kind:`auth-session`,outcome:`restoring`,trigger:D?`expiry`:`startup`}),ne({prompt:`none`,redirectMethod:`replace`,state:re}))},[t,D,re,O,ne]),O||l.isLoading||l.isAuthenticated&&D&&!E?d(`main`,{className:Ze.auth,"aria-live":`polite`,children:O||x.current||D?`Restoring session…`:`Signing in…`}):m?f(`main`,{className:Ze.auth,children:[d(`h1`,{children:`Access denied`}),d(`p`,{children:`Your authenticated identity is not permitted to view this dashboard.`}),i]}):!l.isAuthenticated||D||!T?.access_token?f(`main`,{className:Ze.auth,children:[d(`h1`,{children:e.board}),d(`p`,{children:`Sign in to view the dashboard.`}),d(`button`,{type:`button`,onClick:()=>{window.sessionStorage.removeItem(w),t.record({kind:`auth-session`,outcome:`sign-in-selected`}),ne({state:re})},children:`Sign in`}),i]}):f(u,{children:[d(`button`,{className:Ze.signout,type:`button`,onClick:()=>{window.sessionStorage.setItem(w,`1`),t.record({kind:`auth-session`,outcome:`sign-out-selected`}),l.signoutRedirect()},children:`Sign out`}),c(T.access_token,ee)]})}function rt(e){if(e instanceof p)switch(e.error){case`login_required`:case`interaction_required`:case`consent_required`:case`account_selection_required`:case`invalid_grant`:return e.error}return e instanceof Error&&e.name===`ErrorTimeout`?`timeout`:`other`}var P={panel:`_panel_1n078_1`,attentionActive:`_attentionActive_1n078_22`,content:`_content_1n078_26`,evidence:`_evidence_1n078_38`,sourceAction:`_sourceAction_1n078_42`,details:`_details_1n078_46`,statusBand:`_statusBand_1n078_54`,error:`_error_1n078_80`,wide:`_wide_1n078_83`,"density-comfortable":`_density-comfortable_1n078_86`,"density-compact":`_density-compact_1n078_93`,label:`_label_1n078_103`,typeGlyph:`_typeGlyph_1n078_114`,identityText:`_identityText_1n078_117`,hint:`_hint_1n078_123`,branch:`_branch_1n078_129`,observed:`_observed_1n078_133`,meta:`_meta_1n078_139`,metaValue:`_metaValue_1n078_142`,compactValue:`_compactValue_1n078_146`,warning:`_warning_1n078_149`,serious:`_serious_1n078_152`,status:`_status_1n078_54`,statusGlyph:`_statusGlyph_1n078_160`,compactOnlyStatus:`_compactOnlyStatus_1n078_163`,passed:`_passed_1n078_169`,failed:`_failed_1n078_172`,running:`_running_1n078_176`,cancelled:`_cancelled_1n078_179`,unknown:`_unknown_1n078_180`,shallow:`_shallow_1n078_213`,"density-auto":`_density-auto_1n078_214`,fullValue:`_fullValue_1n078_372`,statusText:`_statusText_1n078_467`};function it({label:e,hint:t,wide:n=!1}){return f(`section`,{className:`${P.panel} ${n?P.wide:``}`,"data-panel":!0,"data-panel-id":`placeholder`,children:[d(`h2`,{className:P.label,children:e}),d(`p`,{className:P.hint,children:t})]})}function at(e){switch(e){case`unauthorized`:return{label:`Access denied`,emphasis:`serious`};case`not-found`:return{label:`Source not found`,emphasis:`serious`};case`unreachable`:case`upstream-error`:return{label:`Source unavailable`,emphasis:`serious`};case`no-runs`:return{label:`No workflow runs`,emphasis:`warning`}}}var F={fact:`_fact_bnc4n_1`,facts:`_facts_bnc4n_5`,factCell:`_factCell_bnc4n_12`,factSource:`_factSource_bnc4n_31`};function ot(e){let t=e.position;if(t)return{"--panel-column":`${t.x+1} / span ${t.w}`,"--panel-row":`${t.y+1} / span ${t.h}`}}var st={passed:{glyph:`✓`,label:`Passed`},failed:{glyph:`✕`,label:`Failed`},warning:{glyph:`⚠`,label:`Warning`},running:{glyph:`↻`,label:`Running`},cancelled:{glyph:`⊘`,label:`Cancelled`},unknown:{glyph:`?`,label:`Unknown`}};function ct(e){return X(e)?.symbol}function I({children:e,className:t,title:n}){return d(`p`,{className:`${P.hint} ${t??``}`,title:n,children:e})}function L({glyph:e,label:t,value:n,compact:r,title:i,observed:a=!1,emphasis:o,className:s}){return f(`p`,{className:`${P.hint} ${a?P.observed:``} ${o?P[o]:``} ${P.meta} ${s??``}`,"data-panel-meta":!0,children:[d(`span`,{"aria-hidden":`true`,children:e}),` `,f(`span`,{className:`screen-reader-only`,children:[t,`: `]}),f(`span`,{className:P.metaValue,title:i,children:[d(`span`,{className:P.fullValue,children:n}),r&&d(`span`,{className:P.compactValue,"aria-hidden":`true`,children:r.kind===`short-value`?r.value:null})]})]})}function R({children:e,className:t,priority:n=`secondary`,anchor:r}){return d(`div`,{className:`${P.evidence} ${t??``}`,"data-panel-evidence":!0,"data-panel-evidence-priority":n,"data-panel-anchor":r,children:e})}function z({status:e,emphasis:t,glyph:n,label:r,compactOnly:i=!1}){return f(`p`,{className:`${P.status} ${e?P[e]:``} ${t?P[t]:``} ${i?P.compactOnlyStatus:``}`,"data-panel-status":!0,children:[n&&d(`span`,{className:P.statusGlyph,"aria-hidden":`true`,children:n}),n&&r&&` `,d(`span`,{className:P.statusText,children:r})]})}function lt({children:e,emphasis:t}){return d(`p`,{className:`${P.status} ${t?P[t]:``}`,children:e})}function B({panel:e,envelope:t,sourceLink:n,busy:r,attentionActive:i=!1,error:a=!1,field:o,layout:s,children:c}){let l=e.density??`auto`,u=e.position,p=ct(e.type),m=u!==void 0&&u.h<=2,h=u!==void 0&&u.h<=3;return f(`section`,{className:`${P.panel} ${P[`density-${l}`]} ${m?P.shallow:``} ${h?P.short:``} ${a?P.error:``} ${i?P.attentionActive:``}`,id:`panel-${e.id}`,style:ot(e),"aria-busy":r===!0?!0:t||r===!1?void 0:!0,"data-panel":!0,"data-panel-id":e.id,"data-panel-position":u?`${u.x},${u.y},${u.w},${u.h}`:void 0,"data-density":l,"data-shallow":m,"data-short":h,"data-error":a||void 0,"data-panel-type":e.type,"data-attention-active":i||void 0,children:[o,d(ut,{panelId:e.id,link:t?.link??n}),f(`div`,{className:`${P.content} ${s===`status-band`?P.statusBand:``}`,"data-panel-content":!0,"data-panel-layout":s,children:[f(`h2`,{className:P.label,"data-panel-anchor":`identity`,children:[p&&d(`span`,{className:P.typeGlyph,"aria-hidden":`true`,title:p.label,"data-panel-type-glyph":!0,children:p.glyph}),d(`span`,{className:P.identityText,"data-panel-identity-text":!0,children:e.label??e.id})]}),c]})]})}function ut({panelId:e,link:t}){return t?f(`a`,{className:P.sourceAction,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,"data-panel-action":`source`,"data-panel-link":!0,children:[d(`span`,{"aria-hidden":`true`,children:`↗`}),d(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}function V({value:e,label:t=`Observed`}){return d(mt,{value:e,label:t})}function dt({sourceUpdatedAt:e,observedAt:t,running:n,runStartedAt:r}){return n&&r?d(mt,{value:r,label:`Started`}):d(mt,{value:e??t,label:e?`Last update`:`Observed`})}function ft({health:e}){let t=e.consecutiveFailures>=3,n=t?`Updates unavailable`:`Updates delayed`;return f(u,{children:[d(L,{glyph:`⚠`,label:n,value:`${n} · ${e.message}`,title:e.message,emphasis:t?`serious`:`warning`}),d(mt,{value:e.lastConfirmedAt,label:`Last confirmed`})]})}function pt({value:e}){return d(mt,{value:e,label:`Last confirmed`})}function mt({value:e,label:t}){let n=new Date(e),r=n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),i=Date.now()-n.getTime(),a=`${t} ${ht(i)}`;return d(L,{glyph:`◷`,label:t,value:a,compact:{kind:`short-value`,value:gt(i)},title:`${t} at ${r}`,observed:!0})}function ht(e){if(e<6e4)return`just now`;let t=Math.floor(e/6e4);return t<60?`${t}m ago`:`${Math.floor(t/60)}h ${t%60}m ago`}function gt(e){if(e<6e4)return`now`;let t=Math.floor(e/6e4);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function _t({panel:e,envelope:t,attentionActive:n,updateHealth:r,facts:i}){if(e.facts)return d(vt,{panel:e,attentionActive:n,facts:i});if(!t)return d(B,{panel:e,attentionActive:n,children:d(R,{children:d(I,{children:`Loading…`})})});if(t.state===`error`){let r=at(t.error.kind);return d(B,{panel:e,envelope:t,attentionActive:n,error:!0,children:f(R,{children:[d(z,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),d(I,{children:t.error.message})]})})}let a=pe.safeParse(t.signal);return a.success?d(B,{panel:e,envelope:t,attentionActive:n,children:f(R,{className:F.fact,children:[d(z,{glyph:`✓`,label:`Value read`,compactOnly:!0}),d(lt,{children:String(a.data.value)}),d(V,{value:t.observedAt}),r&&d(ft,{health:r})]})}):d(B,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(R,{children:d(z,{glyph:`⚠`,label:`Invalid value`})})})}function vt({panel:e,attentionActive:t,facts:n}){return e.facts?d(B,{panel:e,attentionActive:t,children:d(R,{children:d(`div`,{className:F.facts,"data-http-value-facts":!0,children:e.facts.map(e=>d(yt,{label:e.label,observation:n?.[e.id]},e.id))})})}):null}function yt({label:e,observation:t}){let n=t?.envelope;if(!n)return f(`section`,{className:F.factCell,"data-http-value-fact":!0,children:[d(`h3`,{children:e}),d(lt,{emphasis:t?.failure?`serious`:void 0,children:t?.failure?`⚠ Updates unavailable`:`Loading…`}),t?.updateHealth&&d(ft,{health:t.updateHealth})]});if(n.state===`error`){let t=at(n.error.kind);return f(`section`,{className:F.factCell,"data-http-value-fact":!0,"data-error":!0,children:[d(bt,{label:e,link:n.link}),d(`h3`,{children:e}),d(z,{glyph:`⚠`,label:t.label,emphasis:t.emphasis}),d(I,{children:n.error.message}),d(V,{value:n.observedAt})]})}let r=pe.safeParse(n.signal);return r.success?f(`section`,{className:F.factCell,"data-http-value-fact":!0,children:[d(bt,{label:e,link:n.link}),d(`h3`,{children:e}),d(lt,{children:String(r.data.value)}),d(V,{value:n.observedAt})]}):f(`section`,{className:F.factCell,"data-http-value-fact":!0,"data-error":!0,children:[d(bt,{label:e,link:n.link}),d(`h3`,{children:e}),d(z,{glyph:`⚠`,label:`Invalid value`,emphasis:`serious`}),d(V,{value:n.observedAt})]})}function bt({label:e,link:t}){return t?f(`a`,{className:F.factSource,href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`View source for ${e} (opens in a new tab)`,title:`View source for ${e} (opens in a new tab)`,children:[d(`span`,{"aria-hidden":`true`,children:`↗`}),d(`span`,{className:`screen-reader-only`,children:`View source`})]}):null}var xt={variant:`_variant_14ks8_1`,variantPrefix:`_variantPrefix_14ks8_9`},St={field:`_field_1x3vm_1`,grid:`_grid_1x3vm_10`,piece:`_piece_1x3vm_14`,cell:`_cell_1x3vm_34`,clearingCell:`_clearingCell_1x3vm_38`,"clear-cell":`_clear-cell_1x3vm_1`},Ct=.85,wt=[[{x:0,y:0},{x:1,y:0}],[{x:0,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:0,y:1}],[{x:0,y:0},{x:1,y:0},{x:2,y:0}],[{x:0,y:0},{x:0,y:1},{x:1,y:1}]];function Tt(e,t){return e>t?`horizontal`:`vertical`}function Et(e,t=e===`horizontal`?12:3,n=e===`horizontal`?3:12){let r=Math.max(1,t*.8),i=Math.max(1,n*.8),a=Math.max(24,Math.min(42,Math.min(r,i)/4)),o=Math.max(3,Math.min(24,Math.round(r/a))),s=Math.max(3,Math.min(16,Math.round(i/a)));return e===`horizontal`?{columns:Math.max(o,s),rows:s}:{columns:o,rows:Math.max(s,o)}}function Dt(e,t,n){let r=Math.max(...e.map(e=>e.x)),i=Math.max(...e.map(e=>e.y));return r<t&&i<n}function Ot(e,t){return e.cells.some(n=>t.cells.some(r=>e.x+n.x===t.x+r.x&&e.y+n.y===t.y+r.y))}function kt(e,t,n){let r=wt.filter(e=>Dt(e,t,n));return r[Rt(e,r.length)]??[{x:0,y:0}]}function At(e,t,n,r,i,a=0,o=!1){let s=Math.max(...e.map(e=>e.x))+1,c=Math.max(...e.map(e=>e.y))+1,l=[];for(let a=0;a<=r-c;a++)for(let c=0;c<=n-s;c++){let s={id:-1,bornAt:0,cells:e,x:c,y:a,phase:`settled`};if(i.some(e=>Ot(s,e))||!Lt(e,t,n,r,s,i))continue;let u=t===`vertical`?e.filter(e=>a+e.y===r-1||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x&&t.y+n.y===a+e.y+1))).length:e.filter(e=>c+e.x===0||i.some(t=>t.cells.some(n=>t.x+n.x===c+e.x-1&&t.y+n.y===a+e.y))).length;o&&u<It(e,t)||l.push({x:c,y:a,support:u})}l.sort((e,n)=>n.support-e.support||(t===`vertical`?n.y-e.y||e.x-n.x:e.x-n.x||e.y-n.y));let u=l[0]?.support,d=l.filter(e=>e.support===u),f=d[Rt(a,d.length)];return f?{x:f.x,y:f.y}:void 0}function jt(e,t,n,r,i,a){let o=wt.flatMap((o,s)=>{if(!Dt(o,t,n))return[];let c=At(o,e,t,n,r,i+s*31,a);return c?[{shape:o,destination:c}]:[]});if(o.length!==0)return o[Rt(i,o.length)]}function Mt(e,t,n){return Math.ceil(e*t*Ct*Math.min(1,Math.max(0,n)))}function Nt(e){return e.reduce((e,t)=>e+t.cells.length,0)}function Pt(e,t,n,r,i){let a=e===`vertical`?n-1:0,o=new Set(r.flatMap(t=>t.cells.filter(n=>e===`vertical`?t.y+n.y===a:t.x+n.x===a).map(n=>e===`vertical`?t.x+n.x:t.y+n.y))),s=e===`vertical`?t:n,c=o.size===s;if(!c&&!i||o.size===0)return;let l=[];return{shapes:r.flatMap(t=>{let n=t.cells.filter(n=>{let r=e===`vertical`?t.y+n.y===a:t.x+n.x===a;return r&&l.push({x:t.x+n.x,y:t.y+n.y}),!r});return n.length===0?[]:[{...t,cells:n,y:e===`vertical`?t.y+1:t.y,x:e===`horizontal`?t.x-1:t.x}]}),cleared:l,complete:c}}function Ft(e,t,n,r,i){let a=[];for(let o=0;o<i;o+=1){let i=r+o*17,s=kt(i,t,n),c=At(s,e,t,n,a,i+1);if(!c)break;a.push({id:o,bornAt:0,cells:s,x:c.x,y:c.y,phase:`settled`})}return a}function It(e,t){return t===`vertical`?new Set(e.map(e=>e.x)).size:new Set(e.map(e=>e.y)).size}function Lt(e,t,n,r,i,a){let o=Math.max(...e.map(e=>e.x))+1,s=Math.max(...e.map(e=>e.y))+1;if(t===`vertical`){for(let e=0;e<=i.y;e+=1)if(a.some(t=>Ot({...i,y:e},t)))return!1;return i.y+s<=r}for(let e=n-o;e>=i.x;--e)if(a.some(t=>Ot({...i,x:e},t)))return!1;return i.x+o<=n}function Rt(e,t){if(t<=1)return 0;let n=Math.sin(e*12.9898+78.233)*43758.5453;return Math.floor((n-Math.floor(n))*t)}var zt=1250;function Bt(){return{settled:[],active:[],nextPieceAt:zt,recycleUntil:0,nextId:0,recycling:!1,clearingCells:[]}}function Vt(e,t){if(t.elapsed<e.recycleUntil)return e;let n=e.settled,r=e.active,i=e.nextPieceAt,a=e.recycleUntil,o=e.nextId,s=e.recycling,c=e.clearingCells;if(s&&(s=!1,c=[]),t.elapsed>=i&&r.length===0){let a=Mt(t.columns,t.rows,t.progress);if(t.progress<1&&Nt(n)>=a)return{...e,recycling:s,clearingCells:c};let l=jt(t.direction,t.columns,t.rows,n,t.seed+o*17+1,!t.overdue);if(!l&&(t.progress>=1||t.estimatedDurationMs===void 0)){let r=Pt(t.direction,t.columns,t.rows,n,!0);if(r)return{...e,settled:r.shapes,recycleUntil:t.elapsed+500,nextPieceAt:t.elapsed+500,recycling:!0,clearingCells:r.cleared}}if(l){let e=Math.max(...l.shape.map(e=>e.y))+1;r=[{id:o,bornAt:t.elapsed,cells:l.shape,x:t.direction===`horizontal`?t.columns-Math.max(...l.shape.map(e=>e.x))-.5:l.destination.x,y:t.direction===`vertical`?-e+.5:l.destination.y,targetX:l.destination.x,targetY:l.destination.y,phase:`entry`}],o+=1,i+=Ut(t.estimatedDurationMs,t.columns,t.rows)}}let l=[];for(let e of r){let r=t.elapsed-e.bornAt,i=Math.min(1,Math.max(0,(r-250)/850));if(i>=1&&e.targetX!==void 0&&e.targetY!==void 0){n=[...n,{...e,x:e.targetX,y:e.targetY,phase:`settled`}];continue}let a=t.direction===`horizontal`?t.columns-Math.max(...e.cells.map(e=>e.x))-1:e.targetX??e.x,o=t.direction===`vertical`?0:e.targetY??e.y,s=Math.min(1,Math.max(0,r/1100));l.push({...e,x:t.direction===`horizontal`?a+((e.targetX??a)-a)*i:a,y:t.direction===`vertical`?o+((e.targetY??o)-o)*i:o,phase:r<250?`entry`:s<.35?`align`:`travel`})}return{settled:n,active:l,nextPieceAt:i,recycleUntil:a,nextId:o,recycling:s,clearingCells:c}}function Ht(e){return[...e.settled,...e.active]}function Ut(e,t,n){let r=Math.ceil(t*n*.85);return e===void 0||r<=0?zt:Math.max(400,e/Math.max(1,Math.ceil(r/3)))}var Wt=50;function Gt({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let a=o(null),[c,l]=s({...Et(`vertical`),direction:`vertical`}),[u,p]=s(!1),[m,h]=s(Bt),g=o(c),_=o(void 0),v=o(e),y=o(i),b=o(Bt()),x=o(Date.now());r(()=>{v.current=e,y.current=i},[e,i]),r(()=>{let e=a.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();if(t.width===0||t.height===0)return;let n=_.current??Tt(t.width,t.height);_.current=n;let r={...Et(n,t.width,t.height),direction:n};g.current=r,l(r)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),r(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{if(b.current=Bt(),x.current=Date.now(),u){let e=Ft(c.direction,c.columns,c.rows,y.current,Math.max(1,Math.floor(v.current*6)));h({...Bt(),settled:e})}else h(b.current)},[c,u]),r(()=>{if(u)return;let e=window.setInterval(()=>{let e=Vt(b.current,{elapsed:Date.now()-x.current,...g.current,progress:v.current,estimatedDurationMs:t,overdue:n,seed:y.current});b.current=e,h(e)},Wt);return()=>window.clearInterval(e)},[t,n,u]);let S=Ht(m);return d(`div`,{ref:a,className:St.field,"data-running-part":`falling-shapes-field`,"data-overdue":n||void 0,"data-direction":c.direction,"data-recycling":m.recycling||void 0,style:{"--shape-columns":c.columns,"--shape-rows":c.rows},children:f(`div`,{className:St.grid,children:[m.clearingCells.map(e=>d(`span`,{className:St.clearingCell,style:{"--clear-x":e.x,"--clear-y":e.y}},`${e.x}-${e.y}`)),S.map(e=>d(`div`,{className:St.piece,"data-piece":e.id,"data-piece-phase":e.phase,style:{"--piece-x":e.x,"--piece-y":e.y,"--piece-width":Math.max(...e.cells.map(e=>e.x))+1,"--piece-height":Math.max(...e.cells.map(e=>e.y))+1},children:e.cells.map(e=>d(`span`,{className:St.cell,style:{"--cell-x":e.x,"--cell-y":e.y}},`${e.x}-${e.y}`))},e.id))]})})}var H={scene:`_scene_1u5dz_1`,ground:`_ground_1u5dz_6`,groundGlow:`_groundGlow_1u5dz_12`,groundTerrain:`_groundTerrain_1u5dz_25`,groundTerrainOverdrive:`_groundTerrainOverdrive_1u5dz_26`,"ground-stream":`_ground-stream_1u5dz_1`,groundRunway:`_groundRunway_1u5dz_48`,"runway-stream":`_runway-stream_1u5dz_1`,cloudLayer:`_cloudLayer_1u5dz_62`,cloudLayerFar:`_cloudLayerFar_1u5dz_67`,cloudLayerNear:`_cloudLayerNear_1u5dz_70`,plane:`_plane_1u5dz_73`,aircraft:`_aircraft_1u5dz_83`,windows:`_windows_1u5dz_90`,"holding-pattern":`_holding-pattern_1u5dz_1`,cloud:`_cloud_1u5dz_62`,"cloud-stream":`_cloud-stream_1u5dz_1`,cloudOne:`_cloudOne_1u5dz_129`,cloudTwo:`_cloudTwo_1u5dz_135`,cloudThree:`_cloudThree_1u5dz_141`,cloudFour:`_cloudFour_1u5dz_147`,cloudFive:`_cloudFive_1u5dz_153`,cloudSix:`_cloudSix_1u5dz_159`,cloudSeven:`_cloudSeven_1u5dz_165`,cloudEight:`_cloudEight_1u5dz_171`,"rough-air":`_rough-air_1u5dz_1`},Kt={x:8,y:74},qt={x:22,y:74},Jt={x:38,y:30},Yt={x:65,y:30},Xt={x:88,y:48};function Zt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Qt(e,t,n,r,i){let a=1-i;return{x:a**3*e.x+3*a**2*i*t.x+3*a*i**2*n.x+i**3*r.x,y:a**3*e.y+3*a**2*i*t.y+3*a*i**2*n.y+i**3*r.y}}function $t(e,t,n,r,i=0){return{worldX:e.x,worldY:e.y,cameraX:t.x,cameraY:t.y,x:e.x-t.x,y:e.y-t.y,pitch:n,groundOffsetY:i,stage:r}}function en(e){return{x:e.x-50,y:e.y-50}}function tn(e,t){if(t){let e={x:50,y:30};return $t(e,en(e),0,`holding`,20)}let n=Math.min(1,Math.max(0,e));if(n<.18)return $t(Zt(Kt,qt,n/.18),{x:0,y:0},0,`rollout`);if(n<.35){let e=(n-.18)/.17,t=Qt(qt,{x:28,y:74},{x:32,y:30},Jt,e),r=e*e*(3-2*e),i=en(t);return $t(t,{x:i.x*r,y:i.y*r},-7,`climb`,20*r)}if(n<.7){let e=Zt(Jt,Yt,(n-.35)/.35);return $t(e,en(e),0,`cruise`,20)}let r=(n-.7)/.3,i=Qt(Yt,{x:72,y:30},{x:80,y:47},Xt,r),a=r*r*(3-2*r);return $t(i,en(i),4,`approach`,20*(1-a))}function nn({progress:e,indeterminate:t}){let n=tn(e,t),r={"--flight-x":`${n.x}%`,"--flight-y":`${n.y}%`,"--flight-camera-x":`${n.cameraX}%`,"--flight-camera-y":`${n.cameraY}%`,"--flight-ground-x":`${-n.cameraX}%`,"--flight-ground-y":`${-n.cameraY+n.groundOffsetY}%`,"--flight-cloud-x":`${-n.cameraX*.45}%`,"--flight-cloud-y":`${-n.cameraY*.32}%`,"--flight-pitch":`${n.pitch}deg`};return f(`span`,{className:H.scene,"data-running-part":`flight-path`,"data-flight-stage":n.stage,style:r,children:[f(`span`,{className:H.ground,"data-running-part":`flight-ground`,children:[d(`span`,{className:H.groundGlow}),d(`span`,{className:H.groundTerrain,"data-running-part":`flight-ground-terrain`}),d(`span`,{className:H.groundTerrainOverdrive,"data-running-part":`flight-ground-overdrive`}),d(`span`,{className:H.groundRunway,"data-running-part":`flight-ground-runway`})]}),f(`span`,{className:`${H.cloudLayer} ${H.cloudLayerFar}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`far`,children:[d(`span`,{className:`${H.cloud} ${H.cloudOne}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudTwo}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudThree}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudFour}`,"data-running-part":`flight-cloud`})]}),d(`span`,{className:H.plane,"data-running-part":`flight-plane`,children:f(`svg`,{className:H.aircraft,viewBox:`0 0 72 40`,"aria-hidden":`true`,children:[d(`path`,{"data-running-part":`flight-fuselage`,d:`M3 21c5-4 12-6 23-6h27c8 0 13 2 16 5-3 3-8 5-16 5H26C15 25 8 24 3 21Z`}),d(`path`,{"data-running-part":`flight-wing`,d:`m33 23 17 11h-12L23 24Z`}),d(`path`,{"data-running-part":`flight-tail`,d:`m13 17 5-11h7l-1 11Z`}),d(`path`,{className:H.windows,d:`M25 18h4v2h-4zm7 0h4v2h-4zm7 0h4v2h-4z`})]})}),f(`span`,{className:`${H.cloudLayer} ${H.cloudLayerNear}`,"data-running-part":`flight-cloud-layer`,"data-flight-depth":`near`,children:[d(`span`,{className:`${H.cloud} ${H.cloudFive}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudSix}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudSeven}`,"data-running-part":`flight-cloud`}),d(`span`,{className:`${H.cloud} ${H.cloudEight}`,"data-running-part":`flight-cloud`})]})]})}var U={frontier:`_frontier_xpzp3_1`,now:`_now_xpzp3_12`,routes:`_routes_xpzp3_20`,route:`_route_xpzp3_20`,trail:`_trail_xpzp3_41`,packet:`_packet_xpzp3_42`,"packet-stall":`_packet-stall_xpzp3_1`,"trail-backup":`_trail-backup_xpzp3_1`};function rn(){return f(u,{children:[d(`span`,{className:U.frontier,"data-running-part":`frontier`}),d(`span`,{className:U.now,"data-running-part":`transit-now`}),d(`span`,{className:U.routes,"data-running-part":`transit-routes`,children:[0,1,2].map(e=>d(`span`,{className:U.route},e))}),d(`span`,{className:U.trail,"data-running-part":`transit-trail`}),d(`span`,{className:U.packet,"data-running-part":`transit-packet`})]})}var an={field:`_field_1i9kx_1`,overdue:`_overdue_1i9kx_11`,timing:`_timing_1i9kx_14`,timingOverdue:`_timingOverdue_1i9kx_28`},on={field:`_field_ozs8n_1`,canvas:`_canvas_ozs8n_7`};function sn(e){let t=e*.25,n=e*.2,r=t<700||n<350?`snowfall`:n<530?`arrival`:n<1030?`hop`:`full`,i=un((n-(r===`full`?1030:530))/(r===`full`?1620:620),0,1),a=r===`full`?500+1e3*i:0,o=r===`arrival`?0:180+70*i,s=r===`arrival`?Math.min(900,n):350+550*i,c=e*.95,l=c-o;return{mode:r,bodyStart:e*.75-Math.min(2500,t),bodyEnd:e*.75,headStart:l-s-a,hopStart:l-s,land:l,settleEnd:l+(o?120+60*i:0),end:c}}function cn(e,t,n){return n===t?Number(e>=n):un((e-t)/(n-t),0,1)}function ln(e){return e*e*(3-2*e)}function un(e,t,n){return Math.max(t,Math.min(n,e))}var dn=25,fn=.5,pn=.95;function mn(e={width:360,height:180}){return{nextAt:0,id:0,lastElapsed:0,grid:hn(e),flakes:[],cells:[],toppled:!1}}function hn(e){return{columns:Kn(Math.round(e.width/4),48,180),rows:Kn(Math.round(e.height/4),28,100)}}function gn(e,t,n){return n?`overdue`:t===void 0||sn(t).mode===`snowfall`?`snowing`:e>=pn?`complete`:e>=fn?`assembling`:`drift`}function _n(e,t){let n=G(e+41)<.5?-1:1,r=n*(.72+G(e+43)*.45),i=Math.sin(t/1600+G(e+47)*Math.PI*2)*.4,a=n*Math.max(0,Math.sin(t/3100+G(e+53)*Math.PI*2))**7*(3.2+G(e+59)*1.8);return r+i+a}function vn(e){let t=hn(e);return Math.round(t.columns*t.rows*.18)}function yn(e,t,n=!1,r=0){if(e===void 0)return n?30:60;let i=e*pn/vn(t);if(n)return i/2;let a=sn(e);return a.mode!==`snowfall`&&r>=Math.max(0,a.bodyStart-500)?i*4:i}function bn(e,{elapsed:t,progress:n,estimatedDurationMs:r,overdue:i,seed:a,dimensions:o}){let s=hn(o),c=e.grid.columns===s.columns&&e.grid.rows===s.rows?Gn(e):mn(o),l=Math.max(c.lastElapsed,t);for(let e=c.lastElapsed+dn;e<=l;e+=dn)c=Cn(c,e,r===void 0?n:e/r,r,i&&(r===void 0||e>=r),a,o),c.lastElapsed=e;return c}function xn(e){return e.filter(e=>e.owner===`snowman`).length}function Sn(e){return e.cells.map(t=>{let n=t.owner===`body`?e.body:t.owner===`head`?e.head:void 0,r=n&&t.localX!==void 0&&t.localY!==void 0?{...t,x:n.x+t.localX*Math.cos(n.angle)-t.localY*Math.sin(n.angle),y:n.y+t.localX*Math.sin(n.angle)+t.localY*Math.cos(n.angle)}:t;return e.toppling&&r.owner!==`ground`?Wn(r,e.toppling):r})}function Cn(e,t,n,r,i,a,o){let s=gn(n,r,i),c=yn(r,o,i,t);for(;t>=e.nextAt;)e.flakes.push({id:e.id++,x:G(a+e.id*17)*e.grid.columns,y:-1-G(a+e.id*23)*6,bornAt:e.nextAt}),e.nextAt+=c;wn(e,n,r,i);let l=Ln(e),u=_n(a,t)*(dn/1e3),d=r===void 0?.52:Math.max(.52,(e.grid.rows+7)*dn/(r*.25)),f=[];for(let t of e.flakes){let n={...t,x:t.x+u,y:t.y+d},r=On(e,n);if(r){kn(e,r,t.id,n.x-r.x,n.y-r.y);continue}let i=zn(n,l,e.grid,u,a);if(!i){f.push({...n,x:Kn(n.x,0,e.grid.columns-1)});continue}let o=l.get(W(i.x,i.y+1));e.cells.push({id:t.id,x:i.x,y:i.y,owner:o===`body`||o===`head`||o===`snowman`?`snowman`:`ground`}),l.set(W(i.x,i.y),e.cells.at(-1)?.owner??`ground`)}e.flakes=f,r!==void 0&&s!==`drift`&&s!==`snowing`&&En(e),Mn(e),Rn(e,a,t),Rn(e,a,t+dn/2);let p=e.body;return p?.locked&&(p.supportY??=Bn(e,p.x,p.radius,p.y+p.radius),p.y=p.supportY),i&&!e.toppling&&!e.toppled&&xn(e.cells)>=60&&Hn(e,t),Un(e,t),e}function wn(e,t,n,r){if(n===void 0)return;let i=sn(n);if(i.mode===`snowfall`)return;let a=t*n,{columns:o,rows:s}=e.grid,c=ln(cn(a,i.bodyStart,i.bodyEnd));if(a>=i.bodyStart&&!e.body){let t=o*.14;e.body={kind:`body`,x:t,y:Bn(e,t,2,s-1),radius:2,angle:0,locked:!1}}let l=e.body;if(l&&!l.locked){l.radius=Math.max(l.radius,Vn(e,`body`,2));let t=o*(.14+.38*c);Tn(l,t,Bn(e,t,l.radius,s-1)),l.locked=a>=i.bodyEnd}if(a>=i.headStart&&!e.head){let t=o*(i.mode===`full`?.88:.66);e.head={kind:`head`,x:t,y:Bn(e,t,1.7,s-1),radius:1.7,angle:0,locked:!1},En(e)}let u=e.head;if(u&&l&&!u.locked){if(u.radius=Math.max(u.radius,Vn(e,`head`,1.7)),a<i.hopStart){let t=o*(.88-.22*ln(cn(a,i.headStart,i.hopStart)));Tn(u,t,Bn(e,t,u.radius,s-1))}else{u.launch??={x:u.x,y:u.y};let e=cn(a,i.hopStart,i.land),t=l.y-l.radius-u.radius+.5;if(u.x=u.launch.x+(l.x-u.launch.x)*ln(e),u.y=u.launch.y+(t-u.launch.y)*ln(e)-Math.sin(Math.PI*e)*Math.max(5,l.radius*1.5),a>=i.land){let e=cn(a,i.land,i.settleEnd);u.y+=Math.sin(Math.PI*e)*.45}u.locked=a>=i.settleEnd}}if(u&&a>=i.land){let t=cn(a,i.land,i.end);e.hat={x:u.x,y:u.y-u.radius-1-5*(1-t*t),angle:(1-ln(t))*-.22}}}function Tn(e,t,n){let r=qn(e.y,n,.16),i=t-e.x;e.angle+=Math.sign(i)*Math.hypot(i,r-e.y)/Math.max(e.radius,1),e.x=t,e.y=r}function En(e){let t=Sn(e),n=new Map(e.cells.map(e=>[e.id,e])),r=new Set(t.filter(e=>e.owner===`ground`).map(e=>W(Math.round(e.x),Math.round(e.y)))),i=new Set(t.filter(e=>e.owner===`ground`).filter(e=>!r.has(W(Math.round(e.x),Math.round(e.y)-1))).map(e=>e.id));for(let r of[e.body,e.head]){if(!r||r.locked)continue;let a=r.kind,o=r.radius+.75;for(let a of t){if(!Dn(e,r))break;if(a.owner!==`ground`)continue;let t=a.x-r.x,s=a.y-r.y,c=Math.hypot(t,s);if(!i.has(a.id)||c>o||s<-r.radius*.2)continue;let l=n.get(a.id);l&&kn(e,r,l.id,t,s)}r.radius=Math.max(r.radius,Vn(e,a,r.kind===`body`?2:1.7))}}function Dn(e,t){if(t.kind===`body`||!e.body)return!0;let n=e.body.radius*.72,r=Math.max(12,Math.round(Math.PI*(Math.max(0,n-1.7)/.6)**2));return e.cells.filter(e=>e.owner===`head`).length<r}function On(e,t){return[e.body,e.head].filter(e=>e!==void 0&&!e.locked).find(n=>Dn(e,n)&&Math.hypot(t.x-n.x,t.y-n.y)<=n.radius)}function kn(e,t,n,r,i){let a=Math.cos(-t.angle),o=Math.sin(-t.angle),s=r*a-i*o;i=r*o+i*a,r=s;let c=e.cells.find(e=>e.id===n),l=jn(e,t,n),u=An(e,t,r,i,n),d={id:n,x:t.x+u.x,y:t.y+u.y,owner:t.kind,localX:u.x,localY:u.y,targetLocalX:l.x,targetLocalY:l.y};c?Object.assign(c,d):e.cells.push(d),t.radius=Math.max(t.radius,Vn(e,t.kind,t.kind===`body`?2:1.7)),Nn(e,t)}function An(e,t,n,r,i){let a=e.cells.filter(e=>e.id!==i&&e.owner===t.kind),o=(e,t)=>a.every(n=>Math.hypot((n.localX??0)-e,(n.localY??0)-t)>=.75);if(o(n,r))return{x:n,y:r};for(let e=.75;;e+=.75)for(let i=0;i<32;i++){let a=i*Math.PI/16,s=n+Math.cos(a)*e,c=r+Math.sin(a)*e;if((Math.hypot(s,c)<=t.radius+.75||e>t.radius*2)&&o(s,c))return t.radius=Math.max(t.radius,Math.hypot(s,c)-.5),{x:s,y:c}}}function jn(e,t,n){let r=e.cells.filter(e=>e.owner===t.kind&&e.targetLocalX!==void 0&&e.targetLocalY!==void 0),i=(e,t,n=.72)=>r.every(r=>Math.hypot((r.targetLocalX??0)-e,(r.targetLocalY??0)-t)>=n);for(let e=0;e<64;e+=1){let r=G(n*31+e*17)*Math.PI*2,a=Math.sqrt(G(n*37+e*19))*Math.max(.4,t.radius-.35),o=Math.cos(r)*a,s=Math.sin(r)*a;if(i(o,s))return{x:o,y:s}}for(let e=.4;e<=t.radius-.35;e+=.5){let t=Math.max(6,Math.round(2*Math.PI*e/.72));for(let r=0;r<t;r++){let a=r*Math.PI*2/t+G(n*13),o=Math.cos(a)*e,s=Math.sin(a)*e;if(i(o,s,.6))return{x:o,y:s}}}return{x:0,y:0}}function Mn(e){for(let t of e.cells){if(t.packed||t.localX===void 0||t.localY===void 0||t.targetLocalX===void 0||t.targetLocalY===void 0)continue;let e=qn(t.localX,t.targetLocalX,.25),n=qn(t.localY,t.targetLocalY,.25);t.localX=e,t.localY=n,t.packed=e===t.targetLocalX&&n===t.targetLocalY}}function Nn(e,t){let n=e.cells.filter(e=>e.owner===t.kind&&e.localX!==void 0&&e.localY!==void 0),r=Pn(t.radius,n.length);n.sort((e,t)=>e.id-t.id);for(let[e,t]of n.entries()){let n=r[e];if(!n)break;t.targetLocalX=n.x,t.targetLocalY=n.y,t.packed=!1}}function Pn(e,t){let n=Math.max(.2,e-.1),r=[],i=.9,a=i*Math.sqrt(3)/2;for(let e=-Math.ceil(n/a);e<=Math.ceil(n/a);e+=1){let t=e*a,o=e&1?i/2:0;for(let e=-Math.ceil(n/i);e<=Math.ceil(n/i);e+=1){let a=e*i+o;Math.hypot(a,t)<=n&&r.push({x:a,y:t})}}r.sort((e,t)=>Math.hypot(e.x,e.y)-Math.hypot(t.x,t.y));let o=[];for(let e of r)if(o.every(t=>Math.hypot(t.x-e.x,t.y-e.y)>=.82)&&o.push(e),o.length===t)break;return o}function Fn(e){if(e.hat)return e.toppling?{...Wn(e.hat,e.toppling),angle:e.hat.angle+e.toppling.angle}:e.hat}function In(e,t,n){let r=Gn(t),i=(e,t)=>e+(t-e)*Kn(n,0,1);for(let t of[`body`,`head`]){let n=e[t],a=r[t];n&&a&&(a.x=i(n.x,a.x),a.y=i(n.y,a.y),a.angle=i(n.angle,a.angle))}let a=new Map(e.flakes.map(e=>[e.id,e]));for(let e of r.flakes){let t=a.get(e.id);t&&(e.x=i(t.x,e.x),e.y=i(t.y,e.y))}return r.toppling&&e.toppling&&(r.toppling.angle=i(e.toppling.angle,r.toppling.angle)),r.hat&&e.hat&&(r.hat={x:i(e.hat.x,r.hat.x),y:i(e.hat.y,r.hat.y),angle:i(e.hat.angle,r.hat.angle)}),r}function Ln(e){let t=new Map;for(let n of Sn(e))t.set(W(Math.round(n.x),Math.round(n.y)),n.owner);return t}function Rn(e,t,n){let r=Ln(e),i=e.cells.filter(e=>e.owner===`ground`).sort((e,t)=>t.y-e.y||e.x-t.x);for(let a of i){let i=W(a.x,a.y+1);if(a.y<e.grid.rows-1&&!r.has(i)){r.delete(W(a.x,a.y)),a.y+=1,r.set(W(a.x,a.y),a.owner);continue}let o=G(t+a.id*29+n)<.5?-1:1;for(let t of[o,-o]){let n=a.x+t;if(!(n<0||n>=e.grid.columns||a.y>=e.grid.rows-1||r.has(W(n,a.y))||r.has(W(n,a.y+1)))){r.delete(W(a.x,a.y)),a.x=n,a.y+=1,r.set(W(a.x,a.y),a.owner);break}}}}function zn(e,t,n,r,i){let a=Math.round(e.x),o=Math.round(e.y);if(o<0)return;if(o>=n.rows-1)return{x:a,y:n.rows-1};if(!t.has(W(a,o+1)))return;let s=r>=0?1:-1,c=G(i+e.id*71+o)>.5?s:-s;for(let e of[c,-c]){let r=a+e;if(r>=0&&r<n.columns&&!t.has(W(r,o+1))&&!t.has(W(r,o)))return{x:r,y:o+1}}return t.has(W(a,o))?{x:a,y:Math.max(0,o-1)}:{x:a,y:o}}function Bn(e,t,n,r){let i=Sn(e).filter(e=>e.owner===`ground`&&Math.abs(e.x-t)<=n);return(i.length?Math.min(...i.map(e=>e.y)):r)-n}function Vn(e,t,n){let r=e.cells.filter(e=>e.owner===t).length;return n+Math.sqrt(r/Math.PI)*.5}function Hn(e,t){let n=e.body;n&&(e.toppling={startedAt:t,angle:0,pivotX:n.x,pivotY:n.y+n.radius*.72})}function Un(e,t){let n=e.toppling;if(!n)return;let r=Kn((t-n.startedAt)/750,0,1);n.angle=(1-(1-r)**3)*(Math.PI/2),r===1&&(e.toppled=!0)}function Wn(e,t){let n=Math.cos(t.angle),r=Math.sin(t.angle),i=e.x-t.pivotX,a=e.y-t.pivotY;return{...e,x:t.pivotX+i*n-a*r,y:t.pivotY+i*r+a*n}}function Gn(e){return{...e,grid:{...e.grid},hat:e.hat&&{...e.hat},flakes:e.flakes.map(e=>({...e})),cells:e.cells.map(e=>({...e})),body:e.body&&{...e.body},head:e.head&&{...e.head},toppling:e.toppling&&{...e.toppling}}}function W(e,t){return`${e}:${t}`}function Kn(e,t,n){return Math.max(t,Math.min(n,e))}function qn(e,t,n){return Math.abs(t-e)<=n?t:e+Math.sign(t-e)*n}function G(e){let t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Jn(e,t,n){if(!e)return;let r=e.getContext(`2d`);if(!r)return;let i=window.devicePixelRatio||1,a=Math.max(1,Math.round(n.width)),o=Math.max(1,Math.round(n.height));(e.width!==a*i||e.height!==o*i)&&(e.width=a*i,e.height=o*i,e.style.width=`${a}px`,e.style.height=`${o}px`),r.setTransform(i,0,0,i,0,0),r.clearRect(0,0,a,o);let s=a/t.grid.columns,c=o/t.grid.rows;r.fillStyle=`rgba(244, 241, 223, 0.52)`;for(let e of Sn(t))Yn(r,(e.x+.5)*s,(e.y+.5)*c,s,c);r.fillStyle=`rgba(244, 241, 223, 0.76)`;for(let e of t.flakes)Yn(r,(e.x+.5)*s,(e.y+.5)*c,s*.72,c*.72);let l=Fn(t);if(l&&t.head){let e=t.head.radius;r.save(),r.translate(l.x*s,l.y*c),r.scale(s,c),r.rotate(l.angle),r.fillStyle=`rgba(27, 31, 24, 0.78)`,r.fillRect(-e*.65,-2,e*1.3,2),r.fillRect(-e,-.3,e*2,.45),r.restore()}}function Yn(e,t,n,r,i){e.beginPath(),e.arc(t,n,Math.max(.8,Math.min(r,i)*.42),0,Math.PI*2),e.fill()}function Xn({progress:e,estimatedDurationMs:t,overdue:n,seed:i=0}){let a=o(null),c=o(null),[l,u]=s({width:360,height:180}),[f,p]=s(()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),m=o(e),h=o(n),g=o({startedAt:Date.now(),progressAt:Date.now(),progress:e,simulation:mn()});r(()=>{m.current=e,g.current.progressAt=Date.now(),g.current.progress=e},[e]),r(()=>{h.current=n},[n]),r(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener?.(`change`,t),()=>e.removeEventListener?.(`change`,t)},[]),r(()=>{let e=a.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>0&&t.height>0&&u({width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),r(()=>{if(f)return;g.current.simulation=mn(l);let e=0,n=()=>{let r=g.current,o=t===void 0?Date.now()-r.startedAt:r.progress*t+(Date.now()-r.progressAt),s={progress:m.current,estimatedDurationMs:t,overdue:h.current,seed:i,dimensions:l},u=bn(r.simulation,{...s,elapsed:o});r.simulation=u;let d=In(u,bn(u,{...s,elapsed:u.lastElapsed+25}),(o-u.lastElapsed)/25);Jn(c.current,d,l);let p=a.current;p&&(p.dataset.snowCellCount=String(u.cells.length),p.dataset.snowDensity=u.grid.columns<65?`compact`:`full`,u.toppled?p.dataset.snowmanToppled=`true`:delete p.dataset.snowmanToppled),f||(e=window.requestAnimationFrame(n))};return e=window.requestAnimationFrame(n),()=>window.cancelAnimationFrame(e)},[l,t,f,i]),r(()=>{if(!f)return;let r=bn(mn(l),{elapsed:t===void 0?4800:e*t,progress:e,estimatedDurationMs:t,overdue:n,seed:i,dimensions:l});Jn(c.current,r,l),a.current&&(a.current.dataset.snowCellCount=String(r.cells.length),r.toppled?a.current.dataset.snowmanToppled=`true`:delete a.current.dataset.snowmanToppled)},[l,t,n,e,f,i]);let _=gn(e,t,n);return d(`div`,{ref:a,className:on.field,"data-running-part":`snowman-field`,"data-snowman-phase":_,"data-reduced-motion":f||void 0,children:d(`canvas`,{ref:c,className:on.canvas,"data-running-part":`snowman-canvas`})})}var K={haze:`_haze_1uy2p_1`,pressure:`_pressure_1uy2p_17`,band:`_band_1uy2p_20`,bandOne:`_bandOne_1uy2p_33`,bandTwo:`_bandTwo_1uy2p_36`,bandThree:`_bandThree_1uy2p_40`,drift:`_drift_1uy2p_45`,driftOne:`_driftOne_1uy2p_54`,driftTwo:`_driftTwo_1uy2p_58`,driftThree:`_driftThree_1uy2p_67`,driftFour:`_driftFour_1uy2p_76`,driftFive:`_driftFive_1uy2p_85`,"storm-band":`_storm-band_1uy2p_1`};function Zn(){return f(u,{children:[d(`span`,{className:K.haze,"data-running-part":`weather-haze`}),d(`span`,{className:K.pressure,"data-running-part":`weather-pressure`}),d(`span`,{className:`${K.band} ${K.bandOne}`}),d(`span`,{className:`${K.band} ${K.bandTwo}`}),d(`span`,{className:`${K.band} ${K.bandThree}`}),d(`span`,{className:`${K.drift} ${K.driftOne}`}),d(`span`,{className:`${K.drift} ${K.driftTwo}`}),d(`span`,{className:`${K.drift} ${K.driftThree}`}),d(`span`,{className:`${K.drift} ${K.driftFour}`}),d(`span`,{className:`${K.drift} ${K.driftFive}`})]})}var Qn={anchor:`_anchor_1bd86_1`,body:`_body_1bd86_6`,"phased-marker":`_phased-marker_1bd86_1`};function $n({anchorClassName:e,bodyClassName:t,delay:n,anchorPart:r,bodyPart:i}){let a=n?{"--phased-marker-delay":n}:void 0;return d(`span`,{className:`${Qn.anchor} ${e??``}`,"data-running-part":r,children:d(`span`,{className:`${Qn.body} ${t??``}`,"data-running-part":i,style:a})})}var er={frontier:`_frontier_1dg7b_1`,flare:`_flare_1dg7b_12`,lanes:`_lanes_1dg7b_15`,lane:`_lane_1dg7b_15`,markerAnchor:`_markerAnchor_1dg7b_31`,markerBody:`_markerBody_1dg7b_35`,"bloom-flare":`_bloom-flare_1dg7b_1`};function tr(){return f(u,{children:[d(`span`,{className:er.frontier,"data-running-part":`frontier`}),d(`span`,{className:er.flare,"data-running-part":`bloom-flare`}),d(`span`,{className:er.lanes,"data-running-part":`bloom-lanes`,children:[0,1,2,3].map(e=>d(`span`,{className:er.lane,"data-running-part":`bloom-lane`,children:d($n,{anchorClassName:er.markerAnchor,bodyClassName:er.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`][e],anchorPart:`bloom-marker-anchor`,bodyPart:`bloom-marker`})},e))})]})}function nr(e){return[`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`].includes(e)}function rr({animation:e,progress:t,estimatedDurationMs:n,overdue:r,indeterminate:i,seed:a}){let o={"--running-progress":`${t*100}%`};return f(`div`,{className:`${an.field} ${r?an.overdue:``}`,"data-animation":e,"data-running-field":!0,"data-overdue":r||void 0,"data-indeterminate":i||void 0,"aria-hidden":`true`,style:o,children:[e===`telemetry-bloom`&&d(tr,{}),e===`release-transit`&&d(rn,{}),e===`status-weather`&&d(Zn,{}),e===`falling-shapes`&&d(Gt,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`snowman`&&d(Xn,{progress:t,estimatedDurationMs:n,overdue:r,seed:a}),e===`flight-path`&&d(nn,{progress:t,indeterminate:i})]})}var ir=20;function ar(e,t){let n=or(!!e),r=e?new Date(e).valueOf():NaN,i=Number.isFinite(r)?Math.max(0,n-r):void 0,a=i!==void 0&&t!==void 0;return{elapsedMs:i,estimatedDurationMs:t,hasEstimate:a,overdue:a&&i>t,progress:a?Math.min(i/t,1):0}}function or(e){let[t,n]=s(()=>Date.now());return r(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),ir);return()=>window.clearInterval(t)},[e]),t}function sr(e,t,n){return`${e===void 0?`Run in progress`:`Elapsed ${lr(e)}`} · ${t===void 0?`Expected duration unavailable`:`Expected ≈ ${lr(t)}`}${n?` · Over estimate`:``}`}function cr(e,t,n){let r=e===void 0?`—`:ur(e),i=t===void 0?`?`:`~${ur(t)}`;return`${n?`⚠`:`\xA0`}${r}/${i}`}function lr(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function ur(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${r}:${String(i).padStart(2,`0`)}`;return n>0?`${n}:${a.padStart(5,`0`)}`:a}function dr({elapsedMs:e,estimatedDurationMs:t,overdue:n}){return f(`p`,{className:`${an.timing} ${n?an.timingOverdue:``}`,children:[d(`span`,{className:`screen-reader-only`,children:sr(e,t,n)}),d(`span`,{"aria-hidden":`true`,children:cr(e,t,n)})]})}var q={progress:`_progress_1ti2m_1`,visual:`_visual_1ti2m_8`,timing:`_timing_1ti2m_12`,overdue:`_overdue_1ti2m_17`,readout:`_readout_1ti2m_23`,radial:`_radial_1ti2m_31`,sweep:`_sweep_1ti2m_1`,"alarm-ring":`_alarm-ring_1ti2m_1`,radialCore:`_radialCore_1ti2m_58`,"reactor-breathe":`_reactor-breathe_1ti2m_1`,runway:`_runway_1ti2m_70`,"barrier-pulse":`_barrier-pulse_1ti2m_1`,spark:`_spark_1ti2m_114`,sparkTwo:`_sparkTwo_1ti2m_128`,orbit:`_orbit_1ti2m_135`,orbitCore:`_orbitCore_1ti2m_151`,particle:`_particle_1ti2m_163`,particleTwo:`_particleTwo_1ti2m_174`,"gravity-well":`_gravity-well_1ti2m_1`,indeterminate:`_indeterminate_1ti2m_191`,shift:`_shift_1ti2m_1`,signalField:`_signalField_1ti2m_199`,rail:`_rail_1ti2m_217`,lead:`_lead_1ti2m_223`,pulse:`_pulse_1ti2m_233`,pulseTwo:`_pulseTwo_1ti2m_244`,tracks:`_tracks_1ti2m_247`,sparkWide:`_sparkWide_1ti2m_1`,track:`_track_1ti2m_247`,markerAnchor:`_markerAnchor_1ti2m_382`,markerBody:`_markerBody_1ti2m_386`,"endpoint-pulse":`_endpoint-pulse_1ti2m_1`,short:`_short_1ti2m_424`};function fr({animation:e,timing:t}){let{elapsedMs:n,estimatedDurationMs:r,hasEstimate:i,overdue:a,progress:o}=t,s=e===`runway`||e===`signal-field`,c=sr(n,r,a),l={"--running-progress":`${o*100}%`,"--running-degrees":`${o*360}deg`},p=e===`signal-field`?q.signalField:q[e];return f(`div`,{className:`${q.progress} ${p} ${a?q.overdue:``} ${i?``:q.indeterminate}`,style:l,"data-running-progress":e,"data-overdue":a||void 0,"data-indeterminate":!i||void 0,children:[f(`div`,{className:q.visual,"aria-hidden":`true`,"data-running-visual":!0,children:[e===`radial`&&d(`span`,{className:q.radialCore}),e===`runway`&&f(u,{children:[d(`span`,{className:q.spark,"data-running-part":`runway-spark`}),d(`span`,{className:`${q.spark} ${q.sparkTwo}`,"data-running-part":`runway-spark-two`})]}),e===`orbit`&&f(u,{children:[d(`span`,{className:q.orbitCore}),d(`span`,{className:q.particle}),d(`span`,{className:`${q.particle} ${q.particleTwo}`})]}),e===`signal-field`&&f(u,{children:[d(`span`,{className:q.rail}),d(`span`,{className:q.lead}),d(`span`,{className:q.pulse}),d(`span`,{className:`${q.pulse} ${q.pulseTwo}`}),d(`span`,{className:q.tracks,"data-running-part":`signal-tracks`,children:[0,1,2,3,4].map(e=>d(`span`,{className:q.track,"data-running-part":`signal-track`,children:d($n,{anchorClassName:q.markerAnchor,bodyClassName:q.markerBody,delay:[void 0,`-0.8s`,`-1.7s`,`-2.4s`,`-0.35s`][e],anchorPart:`signal-marker-anchor`,bodyPart:`signal-marker`})},e))})]})]}),d(`p`,{className:`${q.timing} ${s?q.readout:``}`,children:s?f(u,{children:[d(`span`,{className:`screen-reader-only`,children:c}),d(`span`,{"aria-hidden":`true`,children:cr(n,r,a)})]}):c})]})}function pr(e){return[`radial`,`runway`,`orbit`,`signal-field`].includes(e)}function mr(e){return Array.from(e).reduce((e,t)=>e*31+t.charCodeAt(0)>>>0,7)}var hr=2e4,gr=15e3,_r=3e5,vr=1.25,yr=[`radial`,`runway`,`orbit`,`signal-field`,`telemetry-bloom`,`release-transit`,`status-weather`,`falling-shapes`,`snowman`,`flight-path`];function br({panel:e}){let t=Cr(),n=e.running_animation===void 0||e.running_animation===`off`?void 0:e.running_animation,r=xr(e.demo_run_duration,hr),i=xr(e.demo_review_duration,_r),a=n?Math.ceil(i*vr):r,o=Math.floor(t/a),s=n??yr[o%yr.length]??`radial`,c=o*a;return d(Sr,{panel:e,animation:s,runStartedAt:c,estimatedDurationMs:n?i:gr})}function xr(e,t){return e?T(e)??t:t}function Sr({panel:e,animation:t,runStartedAt:n,estimatedDurationMs:r}){let i=ar(new Date(n).toISOString(),r),a=nr(t);return d(B,{panel:e,field:a?d(rr,{animation:t,progress:i.progress,estimatedDurationMs:i.estimatedDurationMs,overdue:i.overdue,indeterminate:!i.hasEstimate,seed:mr(e.id)},`${t}-${n}`):void 0,children:f(R,{children:[d(z,{status:`running`,glyph:`↻`,label:`Running`}),f(`p`,{className:xt.variant,children:[d(`span`,{className:xt.variantPrefix,children:`Demo treatment · `}),t]}),a?d(dr,{elapsedMs:i.elapsedMs,estimatedDurationMs:r,overdue:i.overdue}):d(fr,{animation:t,timing:i})]})})}function Cr(){let[e,t]=s(()=>Date.now());return r(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}var wr={details:`_details_19avj_1`,activity:`_activity_19avj_7`,duration:`_duration_19avj_8`};function Tr(e,t=`Passed`){let n=st[e];return e===`passed`?{...n,label:t}:n}function Er(e){return e?e.parent?`${e.parent} › ${e.name}`:e.name:`Activity unavailable`}var Dr={summary:`_summary_1su3w_1`,delta:`_delta_1su3w_15`,emphasized:`_emphasized_1su3w_22`,sparkline:`_sparkline_1su3w_28`,explanation:`_explanation_1su3w_42`};function Or({direction:e,children:t}){let[n,a]=s(!1),[c,l]=s(!1),[p,m]=s({left:0,top:0}),h=o(null),g=o(null),_=i(),v=()=>{let e=h.current?.getBoundingClientRect();e&&m({left:Math.max(8,Math.min(e.left,window.innerWidth-328)),top:Math.max(8,Math.min(e.bottom,window.innerHeight-180))}),a(!0)};if(r(()=>{e||(a(!1),l(!1))},[e]),r(()=>{if(!n)return;let e=e=>{e.target instanceof Node&&!h.current?.contains(e.target)&&!g.current?.contains(e.target)&&(a(!1),l(!1))},t=e=>{e.key===`Escape`&&(a(!1),l(!1))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]),!e)return d(u,{children:t});let y=e.totals.map((e,t,n)=>`${n.length===1?48:t*48/(n.length-1)},${16-e/Math.max(1,...n)*14}`).join(` `);return f(u,{children:[f(`button`,{ref:h,type:`button`,className:Dr.summary,"aria-describedby":n?_:void 0,"aria-expanded":n,onMouseEnter:v,onMouseLeave:e=>{!c&&!(e.relatedTarget instanceof Node&&g.current?.contains(e.relatedTarget))&&a(!1)},onFocus:v,onBlur:()=>{a(!1),l(!1)},onClick:()=>{c?(l(!1),a(!1)):(l(!0),v())},children:[t,e.mode!==`quiet`&&f(`span`,{className:`${Dr.delta} ${e.emphasized?Dr.emphasized:``}`,"aria-hidden":`true`,children:[e.symbol,` `,e.delta>0?`+`:e.delta<0?`−`:``,Math.abs(e.delta).toLocaleString()]}),e.totals.length>1&&d(`svg`,{className:Dr.sparkline,viewBox:`0 0 48 18`,"aria-hidden":`true`,children:d(`polyline`,{points:y})})]}),n&&b(d(`span`,{ref:g,id:_,role:`tooltip`,className:Dr.explanation,style:{...p,maxHeight:Math.max(40,window.innerHeight-p.top-8)},onMouseLeave:e=>{!c&&!(e.relatedTarget instanceof Node&&h.current?.contains(e.relatedTarget))&&a(!1)},children:e.explanation}),document.body)]})}function kr({envelope:e,direction:t}){if(e.state===`error`)return d(L,{glyph:`⚠`,label:`Tests`,value:`Test results unavailable: ${e.error.message}`});let n=e.signal;return n.status===`reported`?d(L,{glyph:`≡`,label:`Tests`,value:d(Ar,{tests:n,direction:t})}):d(L,{glyph:`≡`,label:`Tests`,value:n.status===`pending`?`Tests pending`:`No test results published`})}function Ar({tests:e,direction:t}){let n=e.total>0&&e.passed===e.total;return f(Or,{direction:t,children:[n?f(`span`,{className:P.passed,children:[`✓ `,e.total.toLocaleString(),` passed`]}):`${e.total.toLocaleString()} tests`,!!e.failed&&f(`span`,{className:P.failed,children:[` · ✕ `,e.failed.toLocaleString(),` failed`]}),!!e.skipped&&f(`span`,{className:P.warning,children:[` · ↷ `,e.skipped.toLocaleString(),` skipped`]})]})}function jr(e){return e.state===`error`?{state:e.state,kind:e.error.kind,message:e.error.message}:{state:e.state,...Mr(e.signal)}}function Mr(e){if(e.status!==`reported`)return e;let{run:t,...n}=e;return n}function Nr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,testDirection:a}){if(!t&&i)return d(Pr,{panel:e,rejected:i});if(!t)return d(B,{panel:e,attentionActive:n,children:d(R,{children:d(I,{children:`Loading…`})})});if(t.state===`error`){let r=at(t.error.kind);return f(B,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),d(R,{anchor:`evidence`,children:d(I,{children:t.error.message})})]})}let o=k.safeParse(t.signal);return o.success?d(Fr,{panel:e,envelope:t,signal:o.data,testDirection:a,updateHealth:r,attentionActive:n}):f(B,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{glyph:`⚠`,label:`Invalid signal`})}),d(R,{anchor:`evidence`,children:d(I,{children:`The received pipeline status could not be read.`})})]})}function Pr({panel:e,rejected:t}){let n=Tr(t.status);return f(B,{panel:e,sourceLink:t.link,busy:!1,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{status:t.status,glyph:n.glyph,label:n.label})}),f(R,{className:wr.details,anchor:`evidence`,children:[f(I,{children:[t.github?`GitHub`:`The source`,` returned an older result; checking again`,t.github&&f(u,{children:[` · `,d(`a`,{href:`https://github.com/orgs/community/discussions/206725`,target:`_blank`,rel:`noopener noreferrer`,children:`GitHub API report`})]})]}),d(pt,{value:t.sourceUpdatedAt})]})]})}function Fr({panel:e,envelope:t,signal:n,updateHealth:r,attentionActive:i,testDirection:a}){let c=Tr(n.status),[l,u]=s(()=>n.status===`running`?Ir():void 0),p=o(n.status);if(n.status!==p.current){let t=p.current===`running`;p.current=n.status,e.running_animation===void 0&&!t&&n.status===`running`&&u(e=>Ir(e))}let m=e.running_animation??l??`off`,h=n.status===`running`&&m!==`off`,g=ar(n.runStartedAt,n.estimatedDurationMs),_=h&&nr(m),v=h&&pr(m);return f(B,{panel:e,envelope:t,attentionActive:i,layout:_||v?void 0:`status-band`,field:_?d(rr,{animation:m,progress:g.progress,estimatedDurationMs:g.estimatedDurationMs,overdue:g.overdue,indeterminate:!g.hasEstimate,seed:mr(e.id)}):void 0,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{status:n.status,glyph:c.glyph,label:c.label})}),f(R,{className:wr.details,anchor:`evidence`,children:[n.status===`running`&&d(L,{glyph:`⚙`,label:`Activity`,value:Er(n.activity),compact:{kind:`glyph-only`},title:`Activity: ${Er(n.activity)}`,className:wr.activity}),n.testResults&&d(kr,{envelope:n.testResults,direction:a}),n.branch&&d(L,{glyph:`⎇`,label:`Branch`,value:d(`span`,{className:wr.branch,children:n.branch}),compact:{kind:`short-value`,value:d(`span`,{className:wr.branch,children:n.branch})},title:`Branch: ${n.branch}`}),_&&d(dr,{elapsedMs:g.elapsedMs,estimatedDurationMs:n.estimatedDurationMs,overdue:g.overdue}),v&&d(fr,{animation:m,timing:g}),n.status!==`running`&&n.durationMs!==void 0&&d(L,{glyph:`◷`,label:`Duration`,value:`Took ${Lr(n.durationMs)}`,compact:{kind:`short-value`,value:Lr(n.durationMs)},title:`Duration: Took ${Lr(n.durationMs)}`,className:wr.duration}),d(dt,{sourceUpdatedAt:n.sourceUpdatedAt,observedAt:t.observedAt,running:n.status===`running`,runStartedAt:n.runStartedAt}),r&&d(ft,{health:r})]})]})}function Ir(e){let t=xe.filter(t=>t!==e);return t[Math.floor(Math.random()*t.length)]??`telemetry-bloom`}function Lr(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function Rr(e){let t={state:e.state,link:e.link};if(e.state===`error`)return t;let n=k.safeParse(e.signal);return{...t,status:n.success?n.data.status:void 0,...n.success&&n.data.testResults?{tests:jr(n.data.testResults)}:{}}}var J={compactFacts:`_compactFacts_f62xm_1`,incomplete:`_incomplete_f62xm_8`,compactFact:`_compactFact_f62xm_1`,failedItem:`_failedItem_f62xm_19`,evidence:`_evidence_f62xm_27`,freshness:`_freshness_f62xm_28`,statusAnchor:`_statusAnchor_f62xm_36`,fullSummary:`_fullSummary_f62xm_44`};function Y(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function zr(e){let t=[...e.workflows,...e.pullRequests].find(e=>e.status===`failed`||e.status===`warning`);return t?{workflow:Y(e.workflows.length,`workflow`),pullRequests:Y(e.pullRequests.length,`open PR`),primary:`${t.label} ${t.status}`,secondary:`${Y(e.workflows.length,`workflow`)} · ${Y(e.pullRequests.length,`open PR`)}`,primaryDetail:t.detail,primaryKind:t.status===`warning`?`warning`:`failed`,title:`${e.summary} — ${t.label}: ${t.detail}`}:{workflow:Y(e.workflows.length,`workflow`),pullRequests:Y(e.pullRequests.length,`open PR`),primary:Y(e.workflows.length,`workflow`),secondary:Y(e.pullRequests.length,`open PR`),title:e.summary}}function Br({panel:e,envelope:t,attentionActive:n,updateHealth:r}){if(!t)return d(B,{panel:e,attentionActive:n,children:d(R,{children:d(I,{children:`Loading…`})})});if(t.state===`error`){let r=at(t.error.kind);return f(B,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{glyph:`⚠`,label:r.label,emphasis:r.emphasis})}),d(R,{anchor:`evidence`,children:d(I,{children:t.error.message})})]})}let i=ce.safeParse(t.signal);if(!i.success)return f(B,{panel:e,envelope:t,attentionActive:n,error:!0,layout:`status-band`,children:[d(`div`,{"data-panel-anchor":`status`,children:d(z,{glyph:`⚠`,label:`Invalid signal`})}),d(R,{anchor:`evidence`,children:d(I,{children:`The received pull-request health status could not be read.`})})]});let a=Tr(i.data.status,`Healthy`),o=zr(i.data);return f(B,{panel:e,envelope:t,attentionActive:n,layout:`status-band`,children:[d(`div`,{className:J.statusAnchor,"data-panel-anchor":`status`,children:d(z,{status:i.data.status,glyph:a.glyph,label:a.label})}),f(`div`,{className:J.evidence,"data-panel-anchor":`evidence`,"data-panel-evidence-priority":`secondary`,children:[d(I,{className:J.fullSummary,title:i.data.summary,children:i.data.summary}),f(`div`,{className:J.compactFacts,title:o.title,"data-compact-facts":!0,children:[o.primaryDetail&&f(`p`,{className:J.failedItem,title:o.primaryDetail,children:[d(`span`,{"aria-hidden":`true`,children:`⚠`}),` `,f(`span`,{className:`screen-reader-only`,children:[o.primaryKind===`warning`?`Warning`:`Failed`,` item:`,` `]}),o.primary,f(`span`,{className:`screen-reader-only`,children:[`. Detail: `,o.primaryDetail]})]}),d(L,{glyph:`⚙`,label:`Update workflows`,value:o.workflow,compact:{kind:`short-value`,value:i.data.workflows.length},title:`Update workflows: ${o.workflow}`,className:J.compactFact}),d(L,{glyph:`⎇`,label:`Open update pull requests`,value:o.pullRequests,compact:{kind:`short-value`,value:i.data.pullRequests.length},title:`Open update pull requests: ${o.pullRequests}`,className:J.compactFact})]}),f(`div`,{className:J.freshness,children:[d(V,{value:t.observedAt,label:`Observed (oldest evidence)`}),i.data.newestObservedAt&&f(`span`,{className:`screen-reader-only`,children:[`Newest evidence observed `,i.data.newestObservedAt,`.`]}),r&&d(ft,{health:r})]}),i.data.incompleteObservations&&d(`div`,{role:`status`,children:f(I,{className:J.incomplete,children:[`⚠ Incomplete observations:`,` `,i.data.incompleteObservations.map(({label:e,message:t})=>`${e}: ${t}`).join(` · `)]})})]})]})}function Vr(e){let t={state:e.state,link:e.link};if(e.state===`error`)return t;let n=ce.safeParse(e.signal);return{...t,status:n.success?n.data.status:void 0}}function Hr({panel:e,envelope:t,attentionActive:n,updateHealth:r,testDirection:i}){if(!t)return d(B,{panel:e,attentionActive:n,children:d(R,{children:d(I,{children:`Loading…`})})});if(t.state===`error`){let r=at(t.error.kind);return d(B,{panel:e,envelope:t,attentionActive:n,error:!0,children:f(R,{children:[d(z,{glyph:`⚠`,label:r.label,emphasis:r.emphasis}),d(I,{children:t.error.message})]})})}let a=O.safeParse(t.signal);if(!a.success)return d(B,{panel:e,envelope:t,attentionActive:n,error:!0,children:d(R,{children:d(z,{glyph:`⚠`,label:`Invalid test result`})})});let o=a.data;return o.status===`pending`?d(Ur,{panel:e,envelope:t,attentionActive:n,label:`Pending`,hint:`The selected workflow run is still in progress.`}):o.status===`not-reported`?d(Ur,{panel:e,envelope:t,attentionActive:n,label:`No test results published`,hint:`This completed workflow did not publish the configured test summary.`}):d(B,{panel:e,envelope:t,attentionActive:n,children:f(R,{children:[d(z,{glyph:`✓`,label:`Test results reported`,compactOnly:!0}),d(lt,{children:d(Ar,{tests:o,direction:i})}),d(V,{value:t.observedAt}),r&&d(ft,{health:r})]})})}function Ur({panel:e,envelope:t,attentionActive:n,label:r,hint:i}){return d(B,{panel:e,envelope:t,attentionActive:n,children:f(R,{children:[d(z,{glyph:`◌`,label:r}),d(I,{children:i}),d(V,{value:t.observedAt})]})})}function Wr(e){let t=ie.safeParse(e);return{state:e.state,link:e.link,...t.success?{tests:jr(t.data)}:{}}}function Gr(e){let t=typeof e==`object`&&e?e.update_workflows:void 0;return Array.isArray(t)?t.flatMap(e=>typeof e==`object`&&e&&typeof e.workflow==`string`?[{workflow:e.workflow}]:[]):[]}var Kr={kind:`single`,initialPaths:(e,t)=>[t]},qr=e=>({state:e.state,link:e.link}),Jr=new Map(Object.entries({"pipeline-status":{testHistory:!0,symbol:{glyph:`▣`,label:`Pipeline status`},Renderer:Nr,polling:Kr,projectDiagnostic:Rr},"pull-request-health":{symbol:{glyph:`⌘`,label:`Pull request health`},Renderer:Br,polling:{kind:`pull-request-health`,initialPaths:(e,t)=>[`${t}/pull-requests`,...Gr(e).map(({workflow:e})=>`${t}/update-workflow/${encodeURIComponent(e)}`)]},projectDiagnostic:Vr},"http-value":{symbol:{glyph:`◌`,label:`HTTP value`},Renderer:_t,polling:{kind:`facts`,initialPaths:(e,t)=>e.facts?e.facts.map(e=>`${t}/facts/${encodeURIComponent(e.id)}`):[t]},projectDiagnostic:qr},"test-count":{testHistory:!0,symbol:{glyph:`≡`,label:`Test count`},Renderer:Hr,polling:Kr,projectDiagnostic:Wr},"pipeline-animation-demo":{symbol:{glyph:`✦`,label:`Pipeline animation demo`},Renderer:br,polling:{kind:`local`},projectDiagnostic:qr}}));function X(e){return Jr.get(e)}function Yr({panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a,testDirection:o}){let s=X(e.type)?.Renderer;return s?d(s,{panel:e,envelope:t,attentionActive:n,updateHealth:r,rejectedPipeline:i,facts:a,testDirection:o}):d(it,{label:e.type,hint:`Not wired yet`,wide:!0})}var Xr={control:`_control_giazw_1`,backdrop:`_backdrop_giazw_5`,dialog:`_dialog_giazw_15`};function Zr({env:e,auth:t}){let[n,i]=s(!1),[a,c]=s(`idle`),[l,p]=s(),m=o(null),h=o(null),g=o(null),_=o(!1);r(()=>{if(!n){_.current&&m.current?.focus(),_.current=!1;return}_.current=!0;let e=()=>i(!1),t=t=>{t.key===`Escape`&&e()},r=e=>{if(e.key!==`Tab`)return;let t=[...h.current?.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]],n=t.at(0),r=t.at(-1);n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},a=h.current;return a?.addEventListener(`keydown`,r),window.addEventListener(`keydown`,t),g.current?.focus(),()=>{a?.removeEventListener(`keydown`,r),window.removeEventListener(`keydown`,t)}},[n]);async function v(){i(!0),c(`loading`),p(void 0);try{let n=await N(e,`${e.proxyPath}/boards/${encodeURIComponent(e.board)}/security`,void 0,globalThis.fetch,t);if(!n.ok)throw Error(`Security details returned ${n.status}`);let r=Se.safeParse(await n.json());if(!r.success)throw Error(`Security details were malformed`);p(r.data),c(`idle`)}catch{c(`error`)}}return f(u,{children:[d(`button`,{ref:m,className:Xr.control,type:`button`,"aria-expanded":n,"aria-controls":`security-details-dialog`,onClick:()=>void v(),children:`Security`}),n&&d(`div`,{className:Xr.backdrop,role:`presentation`,children:f(`section`,{ref:h,className:Xr.dialog,id:`security-details-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`security-title`,children:[d(`h2`,{id:`security-title`,children:`Security details`}),a===`loading`&&d(`p`,{"aria-live":`polite`,children:`Loading security details…`}),a===`error`&&d(`p`,{role:`alert`,children:`Security details are unavailable.`}),l&&d(Qr,{details:l}),d(`button`,{ref:g,type:`button`,onClick:()=>i(!1),children:`Close`})]})})]})}function Qr({details:e}){return e.policy.mode===`claim`?f(`p`,{children:[`OIDC is enabled. Access uses the `,d(`code`,{children:e.policy.claim}),` claim with a`,` `,d(`strong`,{children:e.policy.match}),` match policy.`]}):e.policy.mode===`authenticated`?d(`p`,{children:`OIDC is enabled. Any verified API access token with a subject may view this board.`}):d(`p`,{children:`OIDC is enabled. Access is limited to a server-held subject policy.`})}var $r={notice:`_notice_1h5h0_1`,blocked:`_blocked_1h5h0_18`},ei=`https://github.com/robertfmurdock/ze-great-dashboard/blob/main/docs/oidc-authentication.md`;function ti({mode:e}){return e===`blocked`?f(`main`,{className:$r.blocked,role:`alert`,children:[d(`h1`,{children:`⚠ Authentication configuration required`}),d(`p`,{children:`This dashboard is blocked because authentication is required but has not been configured.`}),d(`p`,{children:`No dashboard data was loaded.`}),f(`p`,{children:[d(`a`,{href:ei,children:`Read the authentication setup guide`}),`.`]})]}):f(`aside`,{className:$r.notice,role:`alert`,"aria-label":`Unauthenticated deployment warning`,children:[d(`span`,{"aria-hidden":`true`,children:`⚠`}),f(`span`,{children:[d(`strong`,{children:`This deployment has no authentication.`}),` If this is reachable on a public network and reveals important information, take it down now. Configure the board’s`,` `,d(`code`,{children:`auth`}),` block and `,d(`code`,{children:`security: required`}),`, or set`,` `,d(`code`,{children:`security: unsecured`}),` to explicitly acknowledge intentional public access.`,` `,d(`a`,{href:ei,children:`Read the authentication setup guide`}),`.`]})]})}var Z={trigger:`_trigger_g9eon_1`,close:`_close_g9eon_2`,dialog:`_dialog_g9eon_11`,dialogHeader:`_dialogHeader_g9eon_22`,note:`_note_g9eon_32`,empty:`_empty_g9eon_33`,body:`_body_g9eon_43`,legend:`_legend_g9eon_48`,axis:`_axis_g9eon_57`,lanes:`_lanes_g9eon_64`,lane:`_lane_g9eon_64`,laneLabel:`_laneLabel_g9eon_75`,track:`_track_g9eon_78`,observed:`_observed_g9eon_85`,expected:`_expected_g9eon_86`},ni=6e5;function ri({schedules:e,events:t,retention:n,now:r=new Date}){let i=r.valueOf(),a=i-ni,o=t.filter(e=>e.kind===`panel-fetch-start`&&Number.isFinite(Date.parse(e.at))&&Date.parse(e.at)>=a&&Date.parse(e.at)<=i),s=e.map(e=>{let t=new Map;for(let n of o){if(n.panelId!==e.panelId)continue;let r=t.get(n.path)??[];r.push(n.at),t.set(n.path,r)}return{...e,observed:[...t.entries()].map(([e,t])=>({path:e,starts:t})),hasRetainedEvidence:t.size>0}});return{capturedAt:r.toISOString(),window:{from:new Date(a).toISOString(),to:r.toISOString()},schedules:e,lanes:s,evidenceMayBeIncomplete:n.eventsPrunedByAge>0||n.eventsPrunedByCount>0}}function ii(e,t){return Math.max(0,Math.min(100,(Date.parse(e)-(t.valueOf()-ni))/ni*100))}function ai(e,t){return`${e.label}, panel ${e.panelId}; ${oi(e.cadence)} cadence; ${e.inFlight?`request in flight`:e.nextDueAt?si(e.nextDueAt,t):`awaiting first request`}; ${e.observed.length?`${e.observed.length} observed proxy path${e.observed.length===1?``:`s`}`:`no retained requests in the last 10 minutes`}`}function oi(e){return e===`completion-window`?`Completion-window`:e===`running`?`Running`:`Normal`}function si(e,t){let n=Date.parse(e)-t.valueOf();return n<0?`Overdue by ${ci(-n)}`:`Next poll in ${ci(n)}`}function ci(e){return e%6e4==0?`${Math.round(e/6e4)}m`:`${Math.max(1,Math.round(e/1e3))}s`}function li({board:e,schedules:t,log:n}){let[i,l]=s(()=>new Date),[p,m]=s(!1),h=o(null),g=o(null),_=o(null),v=o(!1);c(n.subscribe,n.snapshot,n.snapshot),r(()=>{if(!p)return;let e=window.setInterval(()=>l(new Date),1e3);return()=>window.clearInterval(e)},[p]);let y=a(()=>ri({schedules:t,...n.retainedEvidence(),now:i}),[n,i,t]);return r(()=>{if(!p){v.current&&h.current?.focus(),v.current=!1;return}v.current=!0;let e=()=>m(!1),t=window.setTimeout(e,6e4),n=()=>{window.clearTimeout(t),t=window.setTimeout(e,6e4)},r=t=>{t.key===`Escape`&&e()},i=e=>{if(e.key!==`Tab`)return;let t=[...g.current?.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)??[]],n=t.at(0),r=t.at(-1);n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},a=g.current;return a?.addEventListener(`pointerdown`,n),a?.addEventListener(`keydown`,n),a?.addEventListener(`focusin`,n),a?.addEventListener(`keydown`,i),window.addEventListener(`keydown`,r),_.current?.focus(),()=>{window.clearTimeout(t),a?.removeEventListener(`pointerdown`,n),a?.removeEventListener(`keydown`,n),a?.removeEventListener(`focusin`,n),a?.removeEventListener(`keydown`,i),window.removeEventListener(`keydown`,r)}},[p]),f(u,{children:[d(`button`,{ref:h,className:Z.trigger,type:`button`,"aria-expanded":p,"aria-controls":`update-activity-dialog`,onClick:()=>{l(new Date),m(!0)},children:`Update activity`}),p&&f(`section`,{ref:g,className:Z.dialog,"data-update-activity":!0,id:`update-activity-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`update-activity-title`,children:[f(`div`,{className:Z.dialogHeader,children:[f(`div`,{children:[d(`h2`,{id:`update-activity-title`,children:`Update activity`}),d(`p`,{children:`Browser-local proxy reads from the last 10 minutes. Panels schedule independently.`})]}),d(`button`,{ref:_,className:Z.close,type:`button`,onClick:()=>m(!1),children:`Close`})]}),f(`div`,{className:Z.body,children:[d(`span`,{className:Z.legend,children:`● observed · ◇ expected`}),e&&y.lanes.length===0&&d(`p`,{className:Z.empty,children:`No visible polling panels are configured.`}),y.lanes.length>0&&f(u,{children:[f(`div`,{className:Z.axis,"aria-hidden":`true`,children:[d(`span`,{children:`10m ago`}),d(`span`,{children:`now`})]}),d(`div`,{className:Z.lanes,children:y.lanes.map(e=>f(`div`,{className:Z.lane,"data-update-activity-lane":!0,children:[d(`span`,{className:Z.laneLabel,children:e.label}),f(`span`,{className:Z.track,role:`img`,"aria-label":ai(e,i),children:[e.observed.flatMap(({path:e,starts:t})=>t.map(t=>d(`i`,{className:Z.observed,style:{left:`${ii(t,i)}%`},title:`Observed request: ${e}`},`${e}-${t}`))),e.nextDueAt&&d(`i`,{className:Z.expected,style:{left:`${ii(e.nextDueAt,i)}%`},title:`Expected next poll`})]})]},e.panelId))})]}),y.evidenceMayBeIncomplete&&d(`p`,{className:Z.note,children:`Older browser evidence was pruned, so an empty lane only means no retained request in this window.`}),d(`p`,{className:Z.note,children:`Observed markers are requests this browser started; the outlined marker is the current expected next poll, not an observed request.`})]})]})]})}function ui({env:e,diagnostics:t,auth:n}){let[i,a]=s(),[o,c]=s();return r(()=>{let r=!1;a(void 0),c(void 0);let i=`${e.proxyPath}/boards/${encodeURIComponent(e.board)}`;return t.record({kind:`board-fetch-start`,path:i}),N(e,i,void 0,globalThis.fetch,n).then(async e=>{if(t.record({kind:`board-fetch-response`,path:i,status:e.status,cache:We(e.headers)}),!e.ok)throw Error(`Board configuration returned ${e.status}`);try{return await e.json()}catch(e){throw t.record({kind:`board-fetch-parse-failure`,path:i,message:di(e)}),new fi(e)}}).then(n=>{if(r)return;a(n),c(e.board);let o=Array.isArray(n.panels)?n.panels:[];t.record({kind:`board-fetch-response`,path:i,boardSummary:{panelCount:o.length,panelIds:o.flatMap(e=>typeof e.id==`string`?[e.id]:[])}})}).catch(n=>{n instanceof fi||t.record({kind:`board-fetch-failure`,path:i,message:di(n)}),r||(a({panels:[]}),c(e.board))}),()=>{r=!0}},[n,t,e]),{board:i,loadedBoardName:o}}function di(e){return e instanceof Error?e.message:String(e)}var fi=class extends Error{constructor(e){super(di(e))}},pi=6e4,mi=1e4,hi=()=>globalThis.window.location.reload();function gi({env:e,diagnostics:t,fetcher:n,reload:i=hi,auth:a}){r(()=>{let r=!1,o=!1,s,c=`${e.proxyPath}/client`,l=async()=>{if(r||o)return;o=!0;let u=new AbortController;s=u;let d=globalThis.setTimeout(()=>u.abort(),mi);t.record({kind:`client-update-check`,path:c});try{let o=await N(e,c,{cache:`no-store`,signal:u.signal},n??globalThis.fetch,a);if(!o.ok)throw Error(`Client identity returned ${o.status}`);let s=C.safeParse(await o.json());if(!s.success)throw Error(`Client identity response was invalid`);if(r)return;t.record({kind:`client-update-response`,path:c,serverVersion:s.data.serverVersion,assetPathIdMatches:s.data.assetPathId===e.assetPathId}),s.data.assetPath!==e.assetPath&&(t.record({kind:`client-update-detected`,path:c,current:{assetPath:e.assetPath},next:s.data}),i())}catch(e){!r&&!(e instanceof DOMException&&e.name===`AbortError`)&&t.record({kind:`client-update-failure`,path:c,message:e instanceof Error?e.message:String(e)})}finally{globalThis.clearTimeout(d),o=!1,s===u&&(s=void 0),r||globalThis.setTimeout(()=>void l(),pi)}};return l(),()=>{r=!0,s?.abort()}},[a,t,e,n,i])}function _i(e,t){return X(e.type)?.projectDiagnostic(t)??{state:t.state,link:t.link}}function vi(e){let t=Object.entries(e).map(([e,t])=>t?.envelope?{id:e,state:t.envelope.state,link:t.envelope.link}:{id:e,state:`unavailable`,link:null});return{state:t.some(e=>e.state===`ok`)?`ok`:`error`,link:null,facts:t}}function yi(e){if(e.state!==`ok`)return;let t=k.safeParse(e.signal);if(t.success){if(t.data.status===`running`||t.data.testResults?.state!==`ok`)return;let e=t.data.testResults.signal;return e.status===`reported`?e:void 0}let n=O.safeParse(e.signal);return n.success&&n.data.status===`reported`?n.data:void 0}function bi(e,t){let n=Math.abs(t-e);return n>=20&&(e===0||n/e>=.2)}function xi(e){let t=e.slice(-8).map(e=>e.total),n=t.at(-1);if(n===void 0)return;let r=t.at(-2),i=`quiet`,a=r??n,o=Math.min(2,t.length);if(r!==void 0&&n===0&&r>0)i=`zero`;else if(r!==void 0&&bi(r,n))i=`jump`;else{for(let e=t.length-3;e>=1;e--){let n=t[e-1],r=t[e];if(n!==void 0&&r!==void 0&&bi(n,r)&&t.slice(e+1).every(e=>Math.abs(e-r)<=Math.max(2,r*.02))){i=`holding`,a=n,o=t.length-e+1;break}}if(i===`quiet`){let e=t.slice(1).map((e,n)=>e-(t[n]??e)).filter(e=>e!==0),s=n-(t[0]??n);e.length>=3&&Math.abs(s)>=5&&e.every(e=>Math.sign(e)===Math.sign(s))?(i=`trend`,a=t[0]??n,o=t.length):r!==void 0&&n!==r&&(i=`change`)}}let s=n-a,c=i===`quiet`?``:i===`zero`?`⚠ ↓`:i===`holding`?`→`:i===`trend`?s>0?`↗`:`↘`:s>0?`↑`:`↓`,l=a>0?` (${s>0?`+`:``}${(s/a*100).toFixed(1)}%)`:``,u={zero:`Reported zero tests; previously ${a.toLocaleString()}.`,jump:`Large jump: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,holding:`Holding a new level: ${n.toLocaleString()} tests, previously ${a.toLocaleString()}${l}.`,trend:`Sustained ${s>0?`increase`:`decrease`}: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,change:`Latest change: ${a.toLocaleString()} → ${n.toLocaleString()} tests${l}.`,quiet:`No clear count change. Latest: ${n.toLocaleString()} tests.`};return{mode:i,symbol:c,delta:s,emphasized:i===`zero`||i===`jump`,totals:t,explanation:`${u[i]} Comparison: ${o} retained run reading${o===1?``:`s`}. History: ${t.join(` → `)}. Source readings retained by this browser are included; this is not complete CI history or a measure of test quality.`}}function Si(e){if(e)return{mode:e.mode,delta:e.delta,totals:e.totals}}var Ci=36e5,wi=24*Ci,Q={retentionMillis:14*wi,retainedReadings:32,refreshMillis:wi,gapMillis:Ci,minimumAttemptMillis:Ci,retryDelaysMillis:[Ci,6*Ci,wi]},Ti={failures:0,gapPending:!1};function Ei(e){return JSON.stringify([e.id,e.attempt])}function Di(e,t){return Date.parse(e.updatedAt)-Date.parse(t.updatedAt)||e.id.localeCompare(t.id,`en`,{numeric:!0})||e.attempt-t.attempt}function Oi(e,t,n){let r=new Map(e.map(e=>[Ei(e),e]));for(let e of t){let t=r.get(Ei(e));(!t||Date.parse(e.updatedAt)>=Date.parse(t.updatedAt))&&r.set(Ei(e),e)}return[...r.values()].filter(e=>Date.parse(e.updatedAt)>=n-Q.retentionMillis).sort(Di).slice(-Q.retainedReadings)}function ki(e,t,n=!1){let r=e.findIndex(e=>Ei(e)===Ei(t));if(r<0)return;let i=xi([...e.slice(0,r),t]);return i&&n?{...i,explanation:`${i.explanation} Recent source-history inspection was incomplete.`}:i}function Ai(e=Ti,t){return{...e,lastConfirmedAt:t,gapPending:e.gapPending||e.lastConfirmedAt!==void 0&&t-e.lastConfirmedAt>=Q.gapMillis}}function ji(e=Ti,t,n){return n>=(e.nextAttemptAt??0)&&(e.lastCompleteAt===void 0||n-e.lastCompleteAt>=Q.refreshMillis||e.gapPending||e.hadSamples===!0&&!t)}function Mi(e=Ti,t){return{...e,lastAttemptAt:t,nextAttemptAt:t+Q.minimumAttemptMillis}}function Ni(e=Ti,t,n,r,i=0){let a={...e,hadSamples:n,partial:!t?.complete||t.samples.length<t.inspectedRuns};if(t?.complete)return{...a,lastCompleteAt:r,failures:0,gapPending:!1,nextAttemptAt:r+Q.minimumAttemptMillis};let o=e.failures+1,s=Q.retryDelaysMillis[Math.min(o-1,Q.retryDelaysMillis.length-1)]??Q.refreshMillis;return{...a,failures:o,nextAttemptAt:Math.max(r+s,i,t?.retryAt?Date.parse(t.retryAt):0)}}var Pi=`ze-great-dashboard.panel-memory.v1`,Fi=1,Ii=12096e5,Li=class{now;histories;storage;constructor(e=je(),t=()=>new Date){this.now=t,this.storage=e,this.histories=this.read(),this.pruneAll()}latest(e){return this.history(e).latest}rememberLatest(e,t){this.history(e).latest=t,this.persist()}recordRun(e,t,n=!1){let r=this.history(e);n&&(r.durations[Ri(t)]=t);let i=r.latestCompleted;(!i||zi(t.sourceUpdatedAt,i.sourceUpdatedAt))&&(r.latestCompleted=t),this.pruneHistory(r),this.persist()}recordSuccessfulRun(e,t){this.recordRun(e,t,!0)}recordCompletedRun(e,t){this.recordRun(e,t)}medianDuration(e){let t=this.history(e);this.pruneHistory(t);let n=Object.values(t.durations).map(({durationMs:e})=>e).sort((e,t)=>e-t);if(n.length===0)return;let r=Math.floor(n.length/2);if(n.length%2==1)return n[r];let i=n[r-1],a=n[r];return i===void 0||a===void 0?void 0:Math.floor((i+a)/2)}resolveEstimatedDuration(e){let t=this.medianDuration(e);if(t!==void 0)return t;let n=this.history(e);return this.pruneHistory(n),n.latestCompleted?.durationMs}observeTests(e,t,n){let r=yi(n);if(!r?.run)return;let i=this.testHistory(e,t),a={...r.run,total:r.total};return i.tests=Oi(i.tests??[],[a],this.now().valueOf()),i.repair&&={...i.repair,hadSamples:!!i.tests.length},this.persist(),ki(i.tests,a,i.repair?.partial)}testDirection(e,t,n){let r=yi(n);if(!r?.run)return;let i=this.testHistory(e,t);return this.pruneHistory(i),ki(i.tests??[],{...r.run,total:r.total},i.repair?.partial)}confirmTestPoll(e,t){let n=this.testHistory(e,t);n.repair=Ai(n.repair,this.now().valueOf()),this.persist()}testRepairDue(e,t){let n=this.testHistory(e,t);return this.pruneHistory(n),ji(n.repair,!!n.tests?.length,this.now().valueOf())}beginTestRepair(e,t){let n=this.testHistory(e,t);n.repair=Mi(n.repair,this.now().valueOf()),this.persist()}finishTestRepair(e,t,n,r){let i=this.testHistory(e,t),a=this.now().valueOf();i.tests=Oi(i.tests??[],n?.samples??[],a),i.repair=Ni(i.repair,n,!!i.tests.length,a,r),this.persist()}testHistory(e,t){return this.history({...Vi(e,t),testArtifact:JSON.stringify(t.test_results??null)})}history(e){let t=Hi(e),n=this.histories[t];if(n)return n;let r={durations:{}};return this.histories[t]=r,r}pruneAll(){for(let e of Object.values(this.histories))this.pruneHistory(e);this.persist()}pruneHistory(e){let t=this.now().valueOf()-Ii;e.tests&&=Oi(e.tests,[],this.now().valueOf());for(let[n,r]of Object.entries(e.durations)){let i=Bi(r.sourceUpdatedAt);(i===void 0||i<t)&&delete e.durations[n]}let n=e.latestCompleted?Bi(e.latestCompleted.sourceUpdatedAt):void 0;e.latestCompleted&&(n===void 0||n<t)&&delete e.latestCompleted}read(){let e=Me(this.storage,Pi);return e?.schemaVersion!==Fi||!e.histories?{}:Ui(e.histories)?e.histories:{}}persist(){Ne(this.storage,Pi,{schemaVersion:Fi,histories:this.histories})}};function Ri(e){return e.sourceRunId??e.link??e.sourceUpdatedAt}function zi(e,t){let n=Bi(e),r=Bi(t);return n!==void 0&&(r===void 0||n>=r)}function Bi(e){let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function Vi(e,t){return{board:e,panelId:t.id,source:t.source??``,workflow:typeof t.pipeline==`string`||typeof t.pipeline==`number`?String(t.pipeline):``,branch:t.branch??``}}function Hi(e){let t=[e.board,e.panelId,e.source,e.workflow,e.branch];return e.testArtifact!==void 0&&t.push(e.testArtifact),JSON.stringify(t)}function Ui(e){return $(e)?Object.values(e).every(Wi):!1}function Wi(e){if(!$(e)||!$(e.durations)||!Object.values(e.durations).every(Gi))return!1;if(e.repair!==void 0){if(!$(e.repair)||!Number.isInteger(e.repair.failures)||Number(e.repair.failures)<0||typeof e.repair.gapPending!=`boolean`)return!1;for(let t of[`lastConfirmedAt`,`lastCompleteAt`,`lastAttemptAt`,`nextAttemptAt`]){let n=e.repair[t];if(n!==void 0&&(typeof n!=`number`||!Number.isFinite(n)||n<0))return!1}if(e.repair.partial!==void 0&&typeof e.repair.partial!=`boolean`||e.repair.hadSamples!==void 0&&typeof e.repair.hadSamples!=`boolean`)return!1}return e.tests!==void 0&&(!Array.isArray(e.tests)||!e.tests.every(e=>$(e)&&typeof e.id==`string`&&e.id.length>0&&Number.isInteger(e.attempt)&&Number(e.attempt)>0&&typeof e.updatedAt==`string`&&Number.isFinite(Date.parse(e.updatedAt))&&Number.isInteger(e.total)&&Number(e.total)>=0))?!1:e.latestCompleted===void 0||Gi(e.latestCompleted)}function Gi(e){return $(e)?(typeof e.link==`string`||e.link===null)&&(e.sourceRunId===void 0||typeof e.sourceRunId==`string`)&&typeof e.durationMs==`number`&&Number.isInteger(e.durationMs)&&e.durationMs>=0&&typeof e.sourceUpdatedAt==`string`&&Bi(e.sourceUpdatedAt)!==void 0:!1}function $(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function Ki(e){e.diagnostics.record({kind:`panel-fetch-start`,panelId:e.panelId,path:e.path});try{let t=await e.fetcher(e.path,{signal:e.signal}),n={kind:`panel-fetch-response`,panelId:e.panelId,path:e.path,status:t.status,cache:We(t.headers)};if(t.status===304){e.diagnostics.record(n);let t=e.cache.get(e.path);return t?{envelope:t}:{error:`Source returned not modified before an initial observation.`}}let r=D.safeParse(await t.json());if(!r.success)return e.diagnostics.record(n),e.diagnostics.record({kind:`panel-fetch-parse-failure`,panelId:e.panelId,path:e.path,message:`Response was not a valid signal envelope.`}),{error:`Response was not a valid signal envelope.`};let i=r.data;return e.diagnostics.record({...n,envelope:i,...i.state===`error`?{failure:qi(i,t)}:{}}),i.state===`ok`&&e.cache.set(e.path,i),{envelope:i}}catch(t){return e.signal?.aborted||e.diagnostics.record({kind:`panel-fetch-failure`,panelId:e.panelId,path:e.path,message:Ji(t)}),{error:Ji(t)}}}function qi(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function Ji(e){return e instanceof Error?e.message:String(e)}function Yi(e){return e.reconciliation.kind===`rejected`&&e.accepted?{envelope:e.current,rejected:{status:e.accepted.status,sourceUpdatedAt:e.accepted.sourceUpdatedAt,link:e.accepted.link,github:Qi(e.reconciliation.envelope.link)}}:{envelope:e.reconciliation.envelope}}function Xi(e){let t=Zi(e.envelope);if(!t)return{kind:`not-pipeline`,envelope:e.envelope};if(e.accepted&&t.sourceUpdatedAt&&Date.parse(t.sourceUpdatedAt)<Date.parse(e.accepted.sourceUpdatedAt))return e.envelope.state!==`ok`||!t.sourceUpdatedAt?{kind:`not-pipeline`,envelope:e.envelope}:{kind:`rejected`,envelope:e.envelope,signal:{...t,sourceUpdatedAt:t.sourceUpdatedAt}};let n=t.sourceUpdatedAt?{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:e.envelope.link}:void 0,r=t.status!==`running`&&t.durationMs!==void 0&&t.sourceUpdatedAt&&Number.isFinite(Date.parse(t.sourceUpdatedAt))?{link:e.envelope.link,...t.sourceRunId?{sourceRunId:t.sourceRunId}:{},durationMs:t.durationMs,sourceUpdatedAt:t.sourceUpdatedAt}:void 0;return{kind:`accepted`,envelope:t.status===`running`&&e.estimatedDurationMs!==void 0&&e.envelope.state===`ok`?{...e.envelope,signal:{...t,estimatedDurationMs:e.estimatedDurationMs}}:e.envelope,signal:t,accepted:n,durationSample:r}}function Zi(e){if(e.state!==`ok`)return;let t=k.safeParse(e.signal);return t.success?t.data:void 0}function Qi(e){if(!e)return!1;try{return new URL(e).hostname===`github.com`}catch{return!1}}function $i(e){return e.panels.flatMap(e=>{if(A(e.position))return[];let t=X(e.type)?.polling;return t&&t.kind!==`local`?[{panel:e,polling:t}]:[]})}function ea(e,t){return`${e.proxyPath}/panel/${encodeURIComponent(e.board)}/${encodeURIComponent(t)}`}function ta(e,t,{panel:n,polling:r}){let i=ea(t,n.id),a=r.initialPaths(n,i);return{panelId:n.id,label:n.label??n.id,settings:be(e,n),cadence:`normal`,inFlight:!1,knownPaths:a}}function na(e,t,n){let r=ra(e);if(!r)return{delayMillis:n.refreshMillis,cadence:`normal`};let i=ia(r);return i===void 0?{delayMillis:n.runningRefreshMillis,cadence:`running`}:t<i?{delayMillis:Math.min(n.runningRefreshMillis,i-t),cadence:`running`}:t<i+n.runningCompletionWindowMillis?{delayMillis:n.runningCompletionRefreshMillis,cadence:`completion-window`}:{delayMillis:n.runningRefreshMillis,cadence:`running`}}function ra(e){if(e?.state!==`ok`)return;let t=k.safeParse(e.signal);return t.success&&t.data.status===`running`?t.data:void 0}function ia(e){if(!e.runStartedAt||e.estimatedDurationMs===void 0)return;let t=Date.parse(e.runStartedAt);return Number.isFinite(t)?t+e.estimatedDurationMs:void 0}function aa(e){let t=[],n=e.workflows.map(({workflow:e,observation:n})=>{let r=sa(n.envelope,`pull-request-workflow`);if(r)return r.item;let i=n.error??`No usable observation is available.`;return t.push({label:`Update workflow ${e}`,message:i}),{label:e,status:`unknown`,detail:`Update workflow ${e} · Unavailable: ${i}`,link:null}}),r=ca(e.candidates.envelope);if(!r){let r=e.candidates.error??`No usable observation is available.`;return t.push({label:`Open update PR candidates`,message:r}),n.every(e=>e.status===`unknown`)?void 0:oa(e,n,[],t,la(e.workflows.map(({observation:e})=>e)))}return r.truncated&&t.push({label:`Open update PR candidates`,message:`The first 100 candidates were observed; additional open update PRs may exist.`}),oa(e,n,r.pullRequests.map(n=>{let r=e.builds.get(n.branch),i=sa(r?.envelope,`pull-request-build`);if(i)return{...i.item,label:`PR #${n.number}`,detail:i.item.detail,link:n.link};let a=r?.error??`No usable observation is available.`;return t.push({label:`PR #${n.number}`,message:a}),{label:`PR #${n.number}`,status:`unknown`,detail:`${n.branch} · Unavailable: ${a}`,link:n.link}}),t,la([...e.workflows.map(({observation:e})=>e),e.candidates,...e.builds.values()]))}function oa(e,t,n,r,i){let a=ua([...t,...n].map(e=>e.status)),o=[...t,...n].find(e=>e.status===a),s=a!==`passed`&&o?`${o.label}: ${o.detail}`:n.length===0?`${t.length} update workflow${t.length===1?``:`s`} · No open update PRs`:`${t.length} update workflow${t.length===1?``:`s`} · ${n.length} open update PR${n.length===1?``:`s`}`,c=i.sort();return{panelId:e.panelId,state:`ok`,observedAt:c[0]??new Date().toISOString(),link:e.link,signal:{type:`pull-request-health`,status:a,summary:s,workflows:t,pullRequests:n,...r.length?{incompleteObservations:r}:{},...c.length>1?{newestObservedAt:c.at(-1)}:{}}}}function sa(e,t){if(e?.state!==`ok`)return;let n=(t===`pull-request-workflow`?de:fe).safeParse(e.signal);return n.success?{item:n.data.item}:void 0}function ca(e){if(e?.state!==`ok`)return;let t=ue.safeParse(e.signal);return t.success?t.data:void 0}function la(e){return e.flatMap(({envelope:e})=>e?.state===`ok`?[e.observedAt]:[])}function ua(e){return e.reduce((e,t)=>oe(t)>oe(e)?t:e,`passed`)}var da=class{options;pending=new Map;activePolls=new Set;healthy=new Set;controller;disposed=!1;constructor(e){this.options=e}currentStarted(e){this.activePolls.add(e)}currentSettled(e,t,n,r){this.disposed||(this.activePolls.delete(e.id),r||this.pending.delete(e.id),n?this.healthy.add(e.id):this.healthy.delete(e.id),n&&r&&(this.options.memory.confirmTestPoll(this.options.board,e),this.options.memory.testRepairDue(this.options.board,e)&&this.pending.set(e.id,{panel:e,path:`${t}/test-history`})),this.drain())}dispose(){this.disposed=!0,this.pending.clear(),this.controller?.abort()}drain(){if(!(this.disposed||this.controller||this.activePolls.size||!(this.options.visible?.()??document.visibilityState===`visible`))){for(let[e,t]of this.pending)if(this.pending.delete(e),this.healthy.has(e)&&this.options.memory.testRepairDue(this.options.board,t.panel)){this.controller=new AbortController,this.run(t,this.controller);return}}}async run({panel:e,path:t},n){let{board:r,memory:i,diagnostics:a}=this.options;i.beginTestRepair(r,e);let o,s;try{let e=await this.options.fetcher(t,{signal:n.signal});s=Te(e.headers.get(`retry-after`),Date.now()),e.ok&&(o=we.parse(await e.json()))}catch{}!this.disposed&&!n.signal.aborted&&(i.finishTestRepair(r,e,o,s),a.record({kind:`test-history-repair`,panelId:e.id,path:t,outcome:o?.complete?`complete`:o?`partial`:`failed`,inspectedRuns:o?.inspectedRuns??0,samples:o?.samples.length??0}),this.options.onMerged(e)),this.controller=void 0,this.drain()}};function fa({board:e,env:t,diagnostics:n,memory:i,auth:a}){let[c,l]=s({}),u=o({}),[d,f]=s({}),[p,m]=s({}),[h,g]=s({}),[_,v]=s([]),[y,b]=s({}),x=o({}),S=o({}),C=o(null);return C.current||=i??new Li,r(()=>{if(x.current={},S.current={},f({}),l({}),u.current={},m({}),g({}),v([]),b({}),!e)return;let r=!1,i=C.current;if(!i)return;let o=new Map,s=(e,r)=>{JSON.stringify(o.get(e.id))!==JSON.stringify(r)&&(o.set(e.id,r),n.record({kind:`panel-rendered`,panelId:e.id,path:ea(t,e.id),rendered:r}))},c=(e,n)=>{if(r)return;let a=X(e.type)?.testHistory?i.testDirection(t.board,e,n):void 0,o=Si(a);s(e,{..._i(e,n),...o?{testDirection:o}:{}}),u.current={...u.current,[e.id]:a},l(u.current),x.current={...x.current,[e.id]:n},f(x.current)},d=(e,t)=>{r||(s(e,vi(t)),S.current={...S.current,[e.id]:t},g(S.current))},p=new da({board:t.board,memory:i,diagnostics:n,fetcher:(e,n)=>N(t,e,n,globalThis.fetch,a),onMerged:e=>{let t=x.current[e.id];t&&c(e,t)}}),h=new Set,_=new Set,y=$i(e),w=y.map(n=>ta(e,t,n)),ee=new Map(w.map(e=>[e.panelId,e]));v(w);let te=(e,t)=>{r||v(n=>n.map(n=>n.panelId===e?{...n,...t}:n))};for(let{panel:e,polling:i}of y){let o=!1,s=C.current;if(!s)return;let l=ee.get(e.id);if(!l)continue;let{settings:u}=l,f=ea(t,e.id),g,v,y=()=>{v=new Date().toISOString(),r||m(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n})},S=t=>{let n=v;if(r||!n)return;let i=ha(t);m(t=>{let r=t[e.id];return{...t,[e.id]:{consecutiveFailures:(r?.consecutiveFailures??0)+1,message:i,lastConfirmedAt:n}}})},w=async t=>{if(r||o)return;o=!0;let i=new AbortController,a={signal:i.signal,healthy:!1,historySupported:!1};_.add(i),p.currentStarted(e.id),te(e.id,{inFlight:!0,lastRequestStartedAt:new Date().toISOString(),nextDueAt:void 0});try{await t(a)}catch(t){!r&&!a.signal.aborted&&(S(t),t instanceof ga||n.record({kind:`panel-fetch-failure`,panelId:e.id,path:f,message:ha(t)}))}finally{if(o=!1,_.delete(i),!r&&!a.signal.aborted){let n=na(g,Date.now(),u);te(e.id,{inFlight:!1,cadence:n.cadence,nextDueAt:new Date(Date.now()+n.delayMillis).toISOString()});let r=window.setTimeout(()=>{h.delete(r),w(t)},n.delayMillis);h.add(r)}p.currentSettled(e,f,a.healthy,a.historySupported)}};switch(i.kind){case`facts`:{if(!e.facts)break;let r=e.facts,i=new Map;w(async({signal:o})=>{let s=await Promise.all(r.map(async r=>{let s=await Ki({diagnostics:n,panelId:e.id,path:`${f}/facts/${encodeURIComponent(r.id)}`,signal:o,cache:i,fetcher:(e,n)=>N(t,e,n,globalThis.fetch,a)});return[r.id,s.error?{failure:s.error}:s]}));o.aborted||d(e,Object.fromEntries(s))});continue}case`pull-request-health`:{let i=Gr(e),o=new Map;w(async({signal:s})=>{let l=async r=>{let i=await Ki({diagnostics:n,panelId:e.id,path:r,signal:s,cache:o,fetcher:(e,n)=>N(t,e,n,globalThis.fetch,a)});return i.envelope?.state===`error`?{error:i.envelope.error.message}:i},[u,...d]=await Promise.all([l(`${f}/pull-requests`),...i.map(({workflow:e})=>l(`${f}/update-workflow/${encodeURIComponent(e)}`))]);if(r||s.aborted)return;let p=u.envelope?.state===`ok`&&ma(u.envelope.signal)?u.envelope.signal.pullRequests:[],m=await Promise.all(p.map(async e=>[e.branch,await l(`${f}/pull-request-build?branch=${encodeURIComponent(e.branch)}`)]));if(r||s.aborted)return;let h=aa({panelId:e.id,link:u.envelope?.link??null,workflows:i.map(({workflow:e},t)=>({workflow:e,observation:d[t]??{error:`Missing workflow result.`}})),candidates:u,builds:new Map(m)});h?(g=h,y(),c(e,h)):S(`No usable pull-request observations.`)});continue}}w(async i=>{n.record({kind:`panel-fetch-start`,panelId:e.id,path:f});let o=await N(t,f,{signal:i.signal},globalThis.fetch,a);i.historySupported=X(e.type)?.testHistory===!0&&o.headers.get(`X-Dashboard-Test-History`)===`supported`;let l={kind:`panel-fetch-response`,panelId:e.id,path:f,status:o.status,cache:We(o.headers)};if(o.status===304){i.healthy=g?.state===`ok`,n.record(l),y();return}let u;try{let t=_a(await o.json());if(!t){n.record(l),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:f,message:`Response was not a valid signal envelope.`}),S(`Response was not a valid signal envelope.`);return}u=t,n.record({...l,envelope:u,...u.state===`error`?{failure:pa(u,o)}:{}}),i.healthy=u.state===`ok`,y()}catch(t){throw n.record(l),n.record({kind:`panel-fetch-parse-failure`,panelId:e.id,path:f,message:ha(t)}),new ga(t)}if(r||i.signal.aborted)return;let d={status:o.status,cache:l.cache};if(e.type===`pipeline-status`){let i=Vi(t.board,e),a=s.latest(i),o=Xi({envelope:u,accepted:a,estimatedDurationMs:s.resolveEstimatedDuration(i)}),c=Yi({current:x.current[e.id],reconciliation:o,accepted:a});if(o.kind===`rejected`&&a){let t=o.signal;n.recordGithubConsistencyIncident({panelId:e.id,endpoint:f,identity:{source:i.source,workflow:i.workflow,branch:i.branch},accepted:a,regressed:{sourceUpdatedAt:t.sourceUpdatedAt,status:t.status,link:u.link},response:{httpStatus:d.status,date:d.cache?.date,etag:d.cache?.etag,cacheControl:d.cache?.cacheControl}}),r||b(t=>({...t,[e.id]:c.rejected}));return}if(o.kind===`accepted`&&(u=o.envelope,!r&&c.rejected===void 0&&b(t=>{if(!t[e.id])return t;let n={...t};return delete n[e.id],n}),o.accepted&&s.rememberLatest(i,o.accepted),o.durationSample)){let e={link:o.durationSample.link,...o.durationSample.sourceRunId?{sourceRunId:o.durationSample.sourceRunId}:{},durationMs:o.durationSample.durationMs,sourceUpdatedAt:o.durationSample.sourceUpdatedAt};s.recordRun(i,e,o.signal.status===`passed`)}}g=u,X(e.type)?.testHistory&&s.observeTests(t.board,e,u),c(e,u)})}return()=>{r=!0,p.dispose();for(let e of _)e.abort();for(let e of h)window.clearTimeout(e)}},[a,e,n,t]),{signals:d,updateHealth:p,factSignals:h,schedules:_,rejectedPipelines:y,testDirections:c}}function pa(e,t){let n=t.headers.get(`x-dashboard-request-id`);return{reason:e.error.message,...n?{supportReference:n}:{}}}function ma(e){return typeof e==`object`&&!!e&&e.type===`pull-request-candidates`&&Array.isArray(e.pullRequests)}function ha(e){return e instanceof Error?e.message:String(e)}var ga=class extends Error{constructor(e){super(ha(e))}};function _a(e){let t=D.safeParse(e);return t.success?t.data:void 0}function va({env:e}){return e.security===`blocked`?d(ti,{mode:`blocked`}):e.auth?d(tt,{env:e,auth:e.auth,children:(e,t,n,r)=>d(ya,{env:n,accessToken:e,onDenied:t,diagnosticLog:r})}):d(ya,{env:e})}function ya({env:e,accessToken:t,onDenied:n,diagnosticLog:i}){let s=o(null);s.current||=i??new He(e);let c=i??s.current,l=a(()=>t?{accessToken:t,onAuthenticationFailure:e=>e===403&&n?.()}:void 0,[t,n]);gi({env:e,diagnostics:c,auth:l});let{board:u,loadedBoardName:p}=ui({env:e,diagnostics:c,auth:l}),{signals:m,updateHealth:h,factSignals:g,schedules:_,rejectedPipelines:v,testDirections:y}=fa({board:p===e.board?u:void 0,env:e,diagnostics:c,auth:l}),b=a(()=>u?ge(u.panels):void 0,[u]),x=a(()=>Ee({board:u,signals:m,updateHealth:h,factSignals:g}),[u,g,m,h]),S=x.length?u?.attention?.treatment:void 0,C=new Set(x.map(e=>e.panelId));return r(()=>{b&&b.issues.length!==0&&c.record({kind:`layout-analyzed`,issueCount:b.issues.length,affectedPanelIds:b.issues.map(e=>e.panelId)})},[c,b]),f(`div`,{className:`${j.board} ${S?j[`attention-${S}`]:``}`,"data-attention-treatment":S,"data-attention-active":x.length||void 0,children:[f(`header`,{className:j.header,children:[d(`h1`,{className:j.title,children:e.board}),e.security===`warning`&&d(ti,{mode:`warning`}),x.length>0&&f(`aside`,{className:j.attentionRail,role:`alert`,"aria-label":`Important panel attention`,children:[d(`span`,{className:j.attentionGlyph,"aria-hidden":`true`,children:`⚠`}),d(`ul`,{children:x.map(e=>d(`li`,{children:f(`a`,{href:`#panel-${e.panelId}`,children:[d(`strong`,{children:e.label}),`: `,e.reason]})},`${e.panelId}-${e.factId??`panel`}-${e.reason}`))})]})]}),f(`main`,{className:j.grid,children:[!u&&d(it,{label:`board`,hint:`Loading configuration…`,wide:!0}),u?.panels.filter(e=>!A(e.position)).map(e=>d(Yr,{panel:e,envelope:m[e.id],attentionActive:C.has(e.id),updateHealth:h[e.id],rejectedPipeline:v[e.id],facts:g[e.id],testDirection:y[e.id]},e.id))]}),f(`footer`,{className:j.footer,"data-board-footer":!0,children:[d(`span`,{children:`Signals are read live from their configured authorities.`}),f(`div`,{className:j.footerTools,children:[l&&d(Zr,{env:e,auth:l}),b&&b.issues.length>0&&d(Ye,{board:e.board,layout:b,env:e,auth:l}),d(ke,{log:c,updateActivity:()=>{let e=c.retainedEvidence(),t=ri({schedules:_,...e});return{capturedAt:t.capturedAt,window:t.window,schedules:t.schedules}}}),d(li,{board:u,schedules:_,log:c})]})]})]})}var ba={error:`_error_yx1g9_1`};function xa({message:e}){return f(`div`,{className:ba.error,role:`alert`,children:[d(`h1`,{children:`⚠️ Dashboard misconfigured`}),d(`p`,{children:`The page loaded, but the server did not hand it usable configuration.`}),d(`pre`,{children:e})]})}var Sa=document.getElementById(`root`);if(!Sa)throw Error(`No #root element in the document — the template is not the one we expect.`);var Ca=l(Sa);try{Ca.render(d(t,{children:d(va,{env:w()})}))}catch(e){Ca.render(d(xa,{message:e instanceof Error?e.message:String(e)}))}
|
|
3
|
+
//# sourceMappingURL=index-5wqvEuCo.js.map
|