vendor: 5,307 bytes, lines 1-19
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/maplibre-BOGZE8_b.js","assets/vendor-BS2D_vZZ.js","assets/index-CC3DFpUC.js","assets/deck-gl-Ce2nZgZd.js","assets/index-DGcFPB_5.css"])))=>i.map(i=>d[i]); 2import{r as h,a as Ur,R as zr,p as Vr,b as ii,d as ri}from"./vendor-BS2D_vZZ.js";import{_ as oi,M as Jr}from"./maplibre-BOGZE8_b.js";import{M as Kr,A as Da,S as Qt,D as Yr}from"./deck-gl-Ce2nZgZd.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function a(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=a(i);fetch(i.href,r)}})();var ci={exports:{}},Nn={};/** 3 * @license React 4 * react-jsx-runtime.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var Qr=h,Zr=Symbol.for("react.element"),Xr=Symbol.for("react.fragment"),eo=Object.prototype.hasOwnProperty,to=Qr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,no={key:!0,ref:!0,__self:!0,__source:!0};function li(e,n,a){var s,i={},r=null,c=null;a!==void 0&&(r=""+a),n.key!==void 0&&(r=""+n.key),n.ref!==void 0&&(c=n.ref);for(s in n)eo.call(n,s)&&!no.hasOwnProperty(s)&&(i[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps,n)i[s]===void 0&&(i[s]=n[s]);return{$$typeof:Zr,type:e,key:r,ref:c,props:i,_owner:to.current}}Nn.Fragment=Xr;Nn.jsx=li;Nn.jsxs=li;ci.exports=Nn;var t=ci.exports,di,Ba=Ur;di=Ba.createRoot,Ba.hydrateRoot;/** 11 * @remix-run/router v1.23.2 12 * 13 * Copyright (c) Remix Software Inc. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE.md file in the root directory of this source tree. 17 * 18 * @license MIT 19 */function zt(){return zt=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},zt.apply(this,arguments)}var rt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(rt||(rt={}));const Fa="popstate";function ao(e){e===void 0&&(e={});function n(s,i){let{pathname:r,search:c,hash:o}=s.location;return Zn("",{pathname:r,search:c,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function a(s,i){return typeof i=="string"?i:_n(i)}return io(n,a,null,e)}function _e(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function _a(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function so(){return Math.random().toString(36).substr(2,8)}function qa(e,n){return{usr:e.state,key:e.key,idx:n}}function Zn(e,n,a,s){return a===void 0&&(a=null),zt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof n=="string"?kt(n):n,{state:a,key:n&&n.key||s||so()})}function _n(e){let{pathname:n="/",search:a="",hash:s=""}=e;return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function kt(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substr(a),e=e.substr(0,a));let s=e.indexOf("?");s>=0&&(n.search=e.substr(s),e=e.substr(0,s)),e&&(n.pathname=e)}return n}function io(e,n,a,s){s===void 0&&(s={});let{window:i=document.defaultView,v5Compat:r=!1}=s,c=i.history,o=rt.Pop,d=null,l=g();l==null&&(l=0,c.replaceState(zt({},c.state,{idx:l}),""));function g(){return(c.state||{idx:null}).idx}function u(){o=rt.Pop;let f=g(),b=f==null?null:f-l;l=f,d&&d({action:o,location:p.location,delta:b})}function _(f,b){o=rt.Push;let w=Zn(p.location,f,b);l=g()+1;let j=qa(w,l),C=p.createHref(w);try{c.pushState(j,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(C)}r&&d&&d({action:o,location:p.location,delta:1})}function m(f,b){o=rt.Replace;let w=Zn(p.location,f,b);l=g();let j=qa(w,l),C=p.createHref(w);c.replaceState(j,"",C),r&&d&&d({action:o,location:p.location,delta:0})}function v(f){let b=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof f=="string"?f:_n(f);return w=w.replace(/ $/,"%20"),_e(b,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,b)}let p={get action(){return o},get location(){return e(i,c)},listen(f){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(Fa,u),d=f,()=>{i.removeEventListener(Fa,u),d=null}},createHref(f){return n(i,f)},createURL:v,encodeLocation(f){let b=v(f);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:_,replace:m,go(f){return c.go(f)}};return p}var Ha;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ha||(Ha={}));function ro(e,n,a){return a===void 0&&(a="/"),oo(e,n,a)}function oo(e,n,a,s){let i=typeof n=="string"?kt(n):n,r=ya(i.pathname||"/",a);if(r==null)return null;
vendor: 2,018 bytes, line 19
19let c=ui(e);co(c);let o=null;for(let d=0;o==null&&d<c.length;++d){let l=jo(r);o=yo(c[d],l)}return o}function ui(e,n,a,s){n===void 0&&(n=[]),a===void 0&&(a=[]),s===void 0&&(s="");let i=(r,c,o)=>{let d={relativePath:o===void 0?r.path||"":o,caseSensitive:r.caseSensitive===!0,childrenIndex:c,route:r};d.relativePath.startsWith("/")&&(_e(d.relativePath.startsWith(s),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(s.length));let l=ct([s,d.relativePath]),g=a.concat(d);r.children&&r.children.length>0&&(_e(r.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),ui(r.children,n,g,l)),!(r.path==null&&!r.index)&&n.push({path:l,score:go(l,r.index),routesMeta:g})};return e.forEach((r,c)=>{var o;if(r.path===""||!((o=r.path)!=null&&o.includes("?")))i(r,c);else for(let d of mi(r.path))i(r,c,d)}),n}function mi(e){let n=e.split("/");if(n.length===0)return[];let[a,...s]=n,i=a.endsWith("?"),r=a.replace(/\?$/,"");if(s.length===0)return i?[r,""]:[r];let c=mi(s.join("/")),o=[];return o.push(...c.map(d=>d===""?r:[r,d].join("/"))),i&&o.push(...c),o.map(d=>e.startsWith("/")&&d===""?"/":d)}function co(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:_o(n.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}const lo=/^:[\w-]+$/,uo=3,mo=2,po=1,ho=10,fo=-2,Wa=e=>e==="*";function go(e,n){let a=e.split("/"),s=a.length;return a.some(Wa)&&(s+=fo),n&&(s+=mo),a.filter(i=>!Wa(i)).reduce((i,r)=>i+(lo.test(r)?uo:r===""?po:ho),s)}function _o(e,n){return e.length===n.length&&e.slice(0,-1).every((s,i)=>s===n[i])?e[e.length-1]-n[n.length-1]:0}function yo(e,n,a){let{routesMeta:s}=e,i={},r="/",c=[];for(let o=0;o<s.length;++o){let d=s[o],l=o===s.length-1,g=r==="/"?n:n.slice(r.length)||"/",u=vo({path:d.relativePath,caseSensitive:d.caseSensitive,end:l},g),_=d.route;if(!u)return null;
vendor: 5,987 bytes, lines 19-28
19Object.assign(i,u.params),c.push({params:i,pathname:ct([r,u.pathname]),pathnameBase:So(ct([r,u.pathnameBase])),route:_}),u.pathnameBase!=="/"&&(r=ct([r,u.pathnameBase]))}return c}function vo(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=bo(e.path,e.caseSensitive,e.end),i=n.match(a);if(!i)return null;let r=i[0],c=r.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:s.reduce((l,g,u)=>{let{paramName:_,isOptional:m}=g;if(_==="*"){let p=o[u]||"";c=r.slice(0,r.length-p.length).replace(/(.)\/+$/,"$1")}const v=o[u];return m&&!v?l[_]=void 0:l[_]=(v||"").replace(/%2F/g,"/"),l},{}),pathname:r,pathnameBase:c,pattern:e}}function bo(e,n,a){n===void 0&&(n=!1),a===void 0&&(a=!0),_a(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,o,d)=>(s.push({paramName:o,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,n?void 0:"i"),s]}function jo(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return _a(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+n+").")),e}}function ya(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}const xo=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Io=e=>xo.test(e);function wo(e,n){n===void 0&&(n="/");let{pathname:a,search:s="",hash:i=""}=typeof e=="string"?kt(e):e,r;if(a)if(Io(a))r=a;else{if(a.includes("//")){let c=a;a=a.replace(/\/\/+/g,"/"),_a(!1,"Pathnames cannot have embedded double slashes - normalizing "+(c+" -> "+a))}a.startsWith("/")?r=Ga(a.substring(1),"/"):r=Ga(a,n)}else r=n;return{pathname:r,search:Co(s),hash:Ro(i)}}function Ga(e,n){let a=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?a.length>1&&a.pop():i!=="."&&a.push(i)}),a.length>1?a.join("/"):"/"}function Pn(e,n,a,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+n+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function No(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function va(e,n){let a=No(e);return n?a.map((s,i)=>i===a.length-1?s.pathname:s.pathnameBase):a.map(s=>s.pathnameBase)}function ba(e,n,a,s){s===void 0&&(s=!1);let i;typeof e=="string"?i=kt(e):(i=zt({},e),_e(!i.pathname||!i.pathname.includes("?"),Pn("?","pathname","search",i)),_e(!i.pathname||!i.pathname.includes("#"),Pn("#","pathname","hash",i)),_e(!i.search||!i.search.includes("#"),Pn("#","search","hash",i)));let r=e===""||i.pathname==="",c=r?"/":i.pathname,o;if(c==null)o=a;else{let u=n.length-1;if(!s&&c.startsWith("..")){let _=c.split("/");for(;_[0]==="..";)_.shift(),u-=1;i.pathname=_.join("/")}o=u>=0?n[u]:"/"}let d=wo(i,o),l=c&&c!=="/"&&c.endsWith("/"),g=(r||c===".")&&a.endsWith("/");return!d.pathname.endsWith("/")&&(l||g)&&(d.pathname+="/"),d}const ct=e=>e.join("/").replace(/\/\/+/g,"/"),So=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Co=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ro=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Eo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const pi=["post","put","patch","delete"];new Set(pi);const ko=["get",...pi];new Set(ko);/** 20 * React Router v6.30.3 21 * 22 * Copyright (c) Remix Software Inc. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE.md file in the root directory of this source tree. 26 * 27 * @license MIT 28 */function Vt(){return Vt=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},Vt.apply(this,arguments)}const ja=h.createContext(null),Po=h.createContext(null),lt=h.createContext(null),Sn=h.createContext(null),Qe=h.createContext({outlet:null,matches:[],isDataRoute:!1}),hi=h.createContext(null);function To(e,n){let{relative:a}=n===void 0?{}:n;Pt()||_e(!1);let{basename:s,navigator:i}=h.useContext(lt),{hash:r,pathname:c,search:o}=gi(e,{relative:a}),d=c;return s!=="/"&&(d=c==="/"?s:ct([s,c])),i.createHref({pathname:d,search:o,hash:r})}function Pt(){return h.useContext(Sn)!=null}function $e(){return Pt()||_e(!1),h.useContext(Sn).location}function fi(e){h.useContext(lt).static||h.useLayoutEffect(e)}function We(){let{isDataRoute:e}=h.useContext(Qe);return e?Vo():Ao()}function Ao(){Pt()||_e(!1);let e=h.useContext(ja),{basename:n,future:a,navigator:s}=h.useContext(lt),{matches:i}=h.useContext(Qe),{pathname:r}=$e(),c=JSON.stringify(va(i,a.v7_relativeSplatPath)),o=h.useRef(!1);return fi(()=>{o.current=!0}),h.useCallback(function(l,g){if(g===void 0&&(g={}),!o.current)return;if(typeof l=="number"){s.go(l);return}let u=ba(l,JSON.parse(c),r,g.relative==="path");e==null&&n!=="/"&&(u.pathname=u.pathname==="/"?n:ct([n,u.pathname])),(g.replace?s.replace:s.push)(u,g.state,g)},[n,s,c,r,e])}const Lo=h.createContext(null);function Oo(e){let n=h.useContext(Qe).outlet;return n&&h.createElement(Lo.Provider,{value:e},n)}function gi(e,n){let{relative:a}=n===void 0?{}:n,{future:s}=h.useContext(lt),{matches:i}=h.useContext(Qe),{pathname:r}=$e(),c=JSON.stringify(va(i,s.v7_relativeSplatPath));return h.useMemo(()=>ba(e,JSON.parse(c),r,a==="path"),[e,c,r,a])}
vendor: 5,944 bytes, line 28
28function $o(e,n){return Mo(e,n)}function Mo(e,n,a,s){Pt()||_e(!1);let{navigator:i}=h.useContext(lt),{matches:r}=h.useContext(Qe),c=r[r.length-1],o=c?c.params:{};c&&c.pathname;let d=c?c.pathnameBase:"/";c&&c.route;let l=$e(),g;if(n){var u;let f=typeof n=="string"?kt(n):n;d==="/"||(u=f.pathname)!=null&&u.startsWith(d)||_e(!1),g=f}else g=l;let _=g.pathname||"/",m=_;if(d!=="/"){let f=d.replace(/^\//,"").split("/");m="/"+_.replace(/^\//,"").split("/").slice(f.length).join("/")}let v=ro(e,{pathname:m}),p=Ho(v&&v.map(f=>Object.assign({},f,{params:Object.assign({},o,f.params),pathname:ct([d,i.encodeLocation?i.encodeLocation(f.pathname).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?d:ct([d,i.encodeLocation?i.encodeLocation(f.pathnameBase).pathname:f.pathnameBase])})),r,a,s);return n&&p?h.createElement(Sn.Provider,{value:{location:Vt({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:rt.Pop}},p):p}function Do(){let e=zo(),n=Eo(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},n),a?h.createElement("pre",{style:i},a):null,null)}const Bo=h.createElement(Do,null);class Fo extends h.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){console.error("React Router caught the following error during render",n,a)}render(){return this.state.error!==void 0?h.createElement(Qe.Provider,{value:this.props.routeContext},h.createElement(hi.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function qo(e){let{routeContext:n,match:a,children:s}=e,i=h.useContext(ja);return i&&i.static&&i.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=a.route.id),h.createElement(Qe.Provider,{value:n},s)}function Ho(e,n,a,s){var i;if(n===void 0&&(n=[]),a===void 0&&(a=null),s===void 0&&(s=null),e==null){var r;if(!a)return null;if(a.errors)e=a.matches;else if((r=s)!=null&&r.v7_partialHydration&&n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let c=e,o=(i=a)==null?void 0:i.errors;if(o!=null){let g=c.findIndex(u=>u.route.id&&o?.[u.route.id]!==void 0);g>=0||_e(!1),c=c.slice(0,Math.min(c.length,g+1))}let d=!1,l=-1;if(a&&s&&s.v7_partialHydration)for(let g=0;g<c.length;g++){let u=c[g];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=g),u.route.id){let{loaderData:_,errors:m}=a,v=u.route.loader&&_[u.route.id]===void 0&&(!m||m[u.route.id]===void 0);if(u.route.lazy||v){d=!0,l>=0?c=c.slice(0,l+1):c=[c[0]];break}}}return c.reduceRight((g,u,_)=>{let m,v=!1,p=null,f=null;a&&(m=o&&u.route.id?o[u.route.id]:void 0,p=u.route.errorElement||Bo,d&&(l<0&&_===0?(Jo("route-fallback"),v=!0,f=null):l===_&&(v=!0,f=u.route.hydrateFallbackElement||null)));let b=n.concat(c.slice(0,_+1)),w=()=>{let j;return m?j=p:v?j=f:u.route.Component?j=h.createElement(u.route.Component,null):u.route.element?j=u.route.element:j=g,h.createElement(qo,{match:u,routeContext:{outlet:g,matches:b,isDataRoute:a!=null},children:j})};return a&&(u.route.ErrorBoundary||u.route.errorElement||_===0)?h.createElement(Fo,{location:a.location,revalidation:a.revalidation,component:p,error:m,children:w(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):w()},null)}var _i=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(_i||{}),yi=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(yi||{});function Wo(e){let n=h.useContext(ja);return n||_e(!1),n}function Go(e){let n=h.useContext(Po);return n||_e(!1),n}function Uo(e){let n=h.useContext(Qe);return n||_e(!1),n}function vi(e){let n=Uo(),a=n.matches[n.matches.length-1];return a.route.id||_e(!1),a.route.id}function zo(){var e;let n=h.useContext(hi),a=Go(),s=vi();return n!==void 0?n:(e=a.errors)==null?void 0:e[s]}function Vo(){let{router:e}=Wo(_i.UseNavigateStable),n=vi(yi.UseNavigateStable),a=h.useRef(!1);return fi(()=>{a.current=!0}),h.useCallback(function(i,r){r===void 0&&(r={}),a.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Vt({fromRouteId:n},r)))},[e,n])}const Ua={};function Jo(e,n,a){Ua[e]||(Ua[e]=!0)}function Ko(e,n){e?.v7_startTransition,e?.v7_relativeSplatPath}function Ct(e){let{to:n,replace:a,state:s,relative:i}=e;Pt()||_e(!1);let{future:r,static:c}=h.useContext(lt),{matches:o}=h.useContext(Qe),{pathname:d}=$e(),l=We(),g=ba(n,va(o,r.v7_relativeSplatPath),d,i==="path"),u=JSON.stringify(g);return h.useEffect(()=>l(JSON.parse(u),{replace:a,state:s,relative:i}),[l,u,i,a,s]),null}function Yo(e){return Oo(e.context)}function we(e){_e(!1)}function Qo(e){let{basename:n="/",children:a=null,location:s,navigationType:i=rt.Pop,navigator:r,static:c=!1,future:o}=e;Pt()&&_e(!1);let d=n.replace(/^\/*/,"/"),l=h.useMemo(()=>({basename:d,navigator:r,static:c,future:Vt({v7_relativeSplatPath:!1},o)}),[d,o,r,c]);typeof s=="string"&&(s=kt(s));let{pathname:g="/",search:u="",hash:_="",state:m=null,key:v="default"}=s,p=h.useMemo(()=>{let f=ya(g,d);return f==null?null:{location:{pathname:f,search:u,hash:_,state:m,ke
28y:v},navigationType:i}},[d,g,u,_,m,v,i]);return p==null?null:h.createElement(lt.Provider,{value:l},h.createElement(Sn.Provider,{children:a,value:p}))}function Zo(e){let{children:n,location:a}=e;return $o(Xn(n),a)}new Promise(()=>{});function Xn(e,n){n===void 0&&(n=[]);let a=[];return h.Children.forEach(e,(s,i)=>{if(!h.isValidElement(s))return;let r=[...n,i];if(s.type===h.Fragment){a.push.apply(a,Xn(s.props.children,r));return}s.type!==we&&_e(!1),!s.props.index||!s.props.children||_e(!1);let c={id:s.props.id||r.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=Xn(s.props.children,r)),a.push(c)}),a}/** 29 * React Router DOM v6.30.3 30 * 31 * Copyright (c) Remix Software Inc. 32 * 33 * This source code is licensed under the MIT license found in the 34 * LICENSE.md file in the root directory of this source tree. 35 * 36 * @license MIT 37 */function ea(){return ea=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},ea.apply(this,arguments)}function Xo(e,n){if(e==null)return{};var a={},s=Object.keys(e),i,r;for(r=0;r<s.length;r++)i=s[r],!(n.indexOf(i)>=0)&&(a[i]=e[i]);return a}function ec(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tc(e,n){return e.button===0&&(!n||n==="_self")&&!ec(e)}const nc=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ac="6";try{window.__reactRouterVersion=ac}catch{}const sc="startTransition",za=zr[sc];function ic(e){let{basename:n,children:a,future:s,window:i}=e,r=h.useRef();r.current==null&&(r.current=ao({window:i,v5Compat:!0}));let c=r.current,[o,d]=h.useState({action:c.action,location:c.location}),{v7_startTransition:l}=s||{},g=h.useCallback(u=>{l&&za?za(()=>d(u)):d(u)},[d,l]);return h.useLayoutEffect(()=>c.listen(g),[c,g]),h.useEffect(()=>Ko(s),[s]),h.createElement(Qo,{basename:n,children:a,location:o.location,navigationType:o.action,navigator:c,future:s})}const rc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",oc=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ae=h.forwardRef(function(n,a){let{onClick:s,relative:i,reloadDocument:r,replace:c,state:o,target:d,to:l,preventScrollReset:g,viewTransition:u}=n,_=Xo(n,nc),{basename:m}=h.useContext(lt),v,p=!1;if(typeof l=="string"&&oc.test(l)&&(v=l,rc))try{let j=new URL(window.location.href),C=l.startsWith("//")?new URL(j.protocol+l):new URL(l),N=ya(C.pathname,m);C.origin===j.origin&&N!=null?l=N+C.search+C.hash:p=!0}catch{}let f=To(l,{relative:i}),b=cc(l,{replace:c,state:o,target:d,preventScrollReset:g,relative:i,viewTransition:u});function w(j){s&&s(j),j.defaultPrevented||b(j)}return h.createElement("a",ea({},_,{href:v||f,onClick:p||r?s:w,ref:a,target:d}))});var Va;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Va||(Va={}));var Ja;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ja||(Ja={}));function cc(e,n){let{target:a,replace:s,state:i,preventScrollReset:r,relative:c,viewTransition:o}=n===void 0?{}:n,d=We(),l=$e(),g=gi(e,{relative:c}
37);return h.useCallback(u=>{if(tc(u,a)){u.preventDefault();let _=s!==void 0?s:_n(l)===_n(g);d(e,{replace:_,state:i,preventScrollReset:r,relative:c,viewTransition:o})}},[l,d,g,s,i,a,e,r,c,o])}class Ht extends Error{}Ht.prototype.name="InvalidTokenError";function lc(e){return decodeURIComponent(atob(e).replace(/(.)/g,(n,a)=>{let s=a.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function dc(e){let n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return lc(n)}catch{return atob(n)}}function uc(e,n){if(typeof e!="string")throw new Ht("Invalid token specified: must be a string");n||(n={});const a=n.header===!0?0:1,s=e.split(".")[a];if(typeof s!="string")throw new Ht(`Invalid token specified: missing part #${a+1}`);let i;try{i=dc(s)}catch(r){throw new Ht(`Invalid token specified: invalid base64 for part #${a+1} (${r.message})`)}try{return JSON.parse(i)}catch(r){throw new Ht(`Invalid token specified: invalid json for part #${a+1} (${r.message})`)}}const yn="arcnet.auth.session",mn="autonomousresource.com",bi=h.createContext(null);function Ka(){try{const e=localStorage.getItem(yn);if(!e)return null;const n=JSON.parse(e);if(!n||typeof n!="object"||!n.idToken||!n.email||!n.exp)return null;const a=Math.floor(Date.now()/1e3);return n.exp<=a+60?(localStorage.removeItem(yn),null):n}catch{return null}}function mc({children:e}){const[n,a]=h.useState(()=>Ka()),[s,i]=h.useState(!1);h.useEffect(()=>{const l=()=>{const g=Ka();a(g)};return window.addEventListener("focus",l),()=>window.removeEventListener("focus",l)},[]);const r=h.useCallback(l=>{const g=uc(l);if(!g.email_verified)throw new Error("AUTH: email not verified by Google");if(g.hd!==mn||!g.email.endsWith(`@${mn}`))throw i(!0),new Error(`AUTH: domain restricted to @${mn}; got ${g.email}`);const u={idToken:l,email:g.email,name:g.name??g.email,picture:g.picture,hd:g.hd,exp:g.exp};return localStorage.setItem(yn,JSON.stringify(u)),a(u),i(!1),u},[]),c=h.useCallback(()=>{localStorage.removeItem(yn),a(null),i(!1)},[]),o=h.useCallback(()=>i(!1),[]),d=h.useMemo(()=>({session:n,isAuthenticated:!!n,signIn:r,signOut:c,domainError:s,clearDomainError:o}),[n,r,c,s,o]);return t.jsx(bi.Provider,{value:d,children:e})}function Ue(){const e=h.useContext(bi);if(!e)throw new Error("useAuth must be used inside <AuthProvider>");return e}const Zt=mn,pc={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_GOOGLE_CLIENT_ID:"574194077548-f7537shpp15jli7t2vghv0jmc68s31hn.apps.googleusercontent.com",VITE_VERCEL_BRANCH_URL:"arcnet-git-main-arc-pbc.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_Em7e3BVp1JmprswJ8L1wXdm4zyuh",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"bryan-wisk",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"Bryan Wisk",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #28 from autonomous-resource/codex/v14-pr15-release 38 39[PR-15] ARCNet v1.4 release hardening and docs`,VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"766ad5566d265d42aac05c39522f307a70d0a4c9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"1247035394",VITE_VERCEL_GIT_REPO_OWNER:"autonomous-resource",VITE_VERCEL_GIT_REPO_SLUG:"arcnet",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"63154ca0e7f7d136/script.js","viewEndpoint":"63154ca0e7f7d136/view","eventEndpoint":"63154ca0e7f7d136/event","sessionEndpoint":"63154ca0e7f7d136/session"},"speedInsights":{"scriptSrc":"3baf3a9bcf9edba3/script.js","endpoint":"3baf3a9bcf9edba3/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_HxWtNb43PEpNuipMEsdvbXdMo3te",VITE_VERCEL_PROJECT_PRODUCTION_URL:"www.arcnet.com",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"arcnet-o8i27vpmw-arc-pbc.vercel.app"},ji=pc;function Kt(e){const n=ji[e];return n===!0||n==="true"||n==="1"}const hc=Kt("VITE_FEATURE_ROLE_INDOPACOM"),xa=Kt("VITE_FEATURE_ROLE_DEFENSE_OEM"),fc=Kt("VITE_FEATURE_DIGITAL_TWIN"),xi=Kt("VITE_FEATURE_STREAM_ENVELOPE"),gc=Kt("VITE_FEATURE_FLOW_TWIN_OVERLAY");function _c(){return ji.VITE_COMMAND_TRANSPORT==="grpc"?"grpc":"mock"}const yc=_c();function Ii(e){return e==="indopacom-stakeholder"?hc:e==="defense-oem"?xa:!0}const vc=["indopacom-stakeholder","defense-oem"];
39function bc(e){return vc.includes(e)&&!Ii(e)}const wi="arc-operator",Ni=[wi,"ornl-metallurgist","node-site-manager","line-technician"];function gt(...e){const n=[];for(const a of e)n.includes(a)||n.push(a);for(const a of Ni)n.includes(a)||n.push(a);return n}const jc={"[email protected]":gt("arc-operator"),"[email protected]":gt("ornl-metallurgist","arc-operator"),"[email protected]":gt("arc-operator"),"[email protected]":gt("arc-operator"),"[email protected]":gt("arc-operator"),"[email protected]":gt("arc-operator")};function Yt(e){if(!e)return[wi];const n=e.trim().toLowerCase(),a=jc[n];return a&&a.length>0?a:[...Ni]}function Si(e){return Yt(e)[0]}function xc(e,n){return Yt(e).includes(n)}function Wt(e){switch(e){case"ornl-metallurgist":return"/metallurgist";case"arc-operator":return"/operator";case"node-site-manager":return"/site-manager";case"line-technician":return"/line-technician";case"indopacom-stakeholder":return"/indopacom";case"defense-oem":return"/defense-oem"}}function Ci(e){switch(e){case"/metallurgist":return"ornl-metallurgist";case"/operator":return"arc-operator";case"/site-manager":return"node-site-manager";case"/line-technician":return"line-technician";case"/indopacom":return"indopacom-stakeholder";case"/defense-oem":return"defense-oem";default:return null}}function Ic(e){return!1}function wc(){const{isAuthenticated:e,session:n}=Ue(),a=$e();if(!e)return t.jsx(Ct,{to:"/login",replace:!0,state:{from:a}});const s=Ci(a.pathname);return s&&bc(s)?t.jsx(Ct,{to:"/operator",replace:!0,state:{deferredRoleDowngrade:s,from:a}}):s&&!xc(n?.email,s)&&!Ic()?t.jsx(Ct,{to:"/role-chooser",replace:!0,state:{deniedRole:s,from:a}}):t.jsx(Yo,{})}const Tn={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_GOOGLE_CLIENT_ID:"574194077548-f7537shpp15jli7t2vghv0jmc68s31hn.apps.googleusercontent.com",VITE_VERCEL_BRANCH_URL:"arcnet-git-main-arc-pbc.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_Em7e3BVp1JmprswJ8L1wXdm4zyuh",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"bryan-wisk",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"Bryan Wisk",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #28 from autonomous-resource/codex/v14-pr15-release 40 41[PR-15] ARCNet v1.4 release hardening and docs`,VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"766ad5566d265d42aac05c39522f307a70d0a4c9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"1247035394",VITE_VERCEL_GIT_REPO_OWNER:"autonomous-resource",VITE_VERCEL_GIT_REPO_SLUG:"arcnet",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"63154ca0e7f7d136/script.js","viewEndpoint":"63154ca0e7f7d136/view","eventEndpoint":"63154ca0e7f7d136/event","sessionEndpoint":"63154ca0e7f7d136/session"},"speedInsights":{"scriptSrc":"3baf3a9bcf9edba3/script.js","endpoint":"3baf3a9bcf9edba3/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_HxWtNb43PEpNuipMEsdvbXdMo3te",VITE_VERCEL_PROJECT_PRODUCTION_URL:"www.arcnet.com",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"arcnet-o8i27vpmw-arc-pbc.vercel.app"},ta=new Map,Xt=e=>{const n=ta.get(e);return n?Object.fromEntries(Object.entries(n.stores).map(([a,s])=>[a,s.getState()])):{}},Nc=(e,n,a)=>{if(e===void 0)return{type:"untracked",connection:n.connect(a)};const s=ta.get(a.name);if(s)return{type:"tracked",store:e,...s};const i={connection:n.connect(a),stores:{}};return ta.set(a.name,i),{type:"tracked",store:e,...i}},Sc=(e,n={})=>(a,s,i)=>{const{enabled:r,anonymousActionType:c,store:o,...d}=n;let l;try{l=(r??(Tn?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return(Tn?"production":void 0)!=="production"&&r&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(a,s,i);const{connection:g,...u}=Nc(o,l,d);let _=!0;i.setState=(p,f,b)=>{const w=a(p,f);if(!_)return w;const j=b===void 0?{type:c||"anonymous"}:typeof b=="string"?{type:b}:b;return o===void 0?(g?.send(j,s()),w):(g?.send({...j,type:`${o}/${j.type}`},{...Xt(d.name),[o]:i.getState()}),w)};const m=(...p)=>{const f=_;_=!1,a(...p),_=f},v=e(i.setState,s,i);if(u.type==="untracked"?g?.init(v):(u.stores[u.store]=i,g?.init(Object.fromEntries(Object.entries(u.stores).map(([p,f])=>[p,p===u.store?v:f.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const f=i.dispatch;i.dispatch=(...b)=>{(Tn?"production":void 0)!=="production"&&b[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),f(...b)}}return g.subscribe(p=>{var f;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return An(p.payload,b=>{if(b.type==="__setState"){if(o===void 0){m(b.state);return}
41Object.keys(b.state).length!==1&&console.error(` 42 [zustand devtools middleware] Unsupported __setState action format. 43 When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), 44 and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } 45 `);const w=b.state[o];if(w==null)return;JSON.stringify(i.getState())!==JSON.stringify(w)&&m(w);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(b)});case"DISPATCH":switch(p.payload.type){case"RESET":return m(v),o===void 0?g?.init(i.getState()):g?.init(Xt(d.name));case"COMMIT":if(o===void 0){g?.init(i.getState());return}return g?.init(Xt(d.name));case"ROLLBACK":return An(p.state,b=>{if(o===void 0){m(b),g?.init(i.getState());return}m(b[o]),g?.init(Xt(d.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return An(p.state,b=>{if(o===void 0){m(b);return}JSON.stringify(i.getState())!==JSON.stringify(b[o])&&m(b[o])});case"IMPORT_STATE":{const{nextLiftedState:b}=p.payload,w=(f=b.computedStates.slice(-1)[0])==null?void 0:f.state;if(!w)return;m(o===void 0?w:w[o]),g?.send(null,b);return}case"PAUSE_RECORDING":return _=!_}return}}),v},Ri=Sc,An=(e,n)=>{let a;try{a=JSON.parse(e)}catch(s){console.error("[zustand devtools middleware] Could not parse the received json",s)}a!==void 0&&n(a)},Cc=e=>(n,a,s)=>{const i=s.subscribe;return s.subscribe=(c,o,d)=>{let l=c;if(o){const g=d?.equalityFn||Object.is;let u=c(s.getState());l=_=>{const m=c(_);if(!g(u,m)){const v=u;o(u=m,v)}},d?.fireImmediately&&o(u,u)}return i(l)},e(n,a,s)},Rc=Cc,Ec=e=>(n,a,s)=>(s.setState=(i,r,...c)=>{const o=typeof i=="function"?Vr(i):i;return n(o,r,...c)},e(s.setState,a,s)),kc=Ec,Pc={pending:"info",accepted:"success",denied:"error","stale-state":"warn"},Tc={pending:"pending server acknowledgement",accepted:"accepted",denied:"denied","stale-state":"blocked by stale projection"};function Ei(e){return e.auditRef??`audit:${e.id}:${e.status}`}function Ac(e){return{id:Ei(e),actor:`role:${e.actorRole}`,role:e.actorRole,action:`command.receipt.${e.status}`,subject:{receiptId:e.id,intentId:e.intentId,command:e.command,target:e.target,scope:e.scope,status:e.status,correlationId:e.correlationId,projectionKind:e.projectionKind},attestationRef:`projection:${e.projectionKind}`,at:e.acknowledgedAt??e.requestedAt}}function Lc(e){return{id:`command:${e.id}:${e.status}`,kind:"command.receipt",severity:Pc[e.status],message:`Command ${e.command} ${Tc[e.status]} for ${e.target}`,at:e.acknowledgedAt??e.requestedAt,details:{receiptId:e.id,intentId:e.intentId,status:e.status,command:e.command,target:e.target,scope:e.scope,actorRole:e.actorRole,correlationId:e.correlationId,policyContext:e.policyContext,projectionKind:e.projectionKind,auditRef:Ei(e),reason:e.reason}}}const Ya=500,pt=[];let Qa=0,na=0,Ge={status:"idle",ok:!0,exported:0,at:new Date(0)};function Oc(e){return Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0).map(([n,a])=>[n,String(a)]))}function ot(e,n=1,a={}){Qa+=1,pt.unshift({id:Qa,name:e,value:n,tags:Oc(a),at:new Date}),pt.length>Ya&&(pt.length=Ya)}function Ia(e,n=Date.now()){return Math.max(0,(n-e)/1e3)}function $c(){return[...pt]}function Mc(){const e=new Map;for(const n of pt)e.set(n.name,[...e.get(n.name)??[],n]);return[...e.entries()].map(([n,a])=>{const s=a.map(c=>c.value),i=s.reduce((c,o)=>c+o,0),r=a.reduce((c,o)=>o.id>c.id?o:c);return{name:n,count:a.length,sum:i,min:Math.min(...s),max:Math.max(...s),average:i/a.length,lastValue:r.value,lastAt:r.at}}).sort((n,a)=>n.name.localeCompare(a.name))}function pn(){return{generatedAt:new Date,metrics:$c(),summaries:Mc(),pendingExportCount:ki().length}}function ki(e={}){return[...(e.includePreviouslyExported?pt:pt.filter(s=>s.id>na)).slice(0,e.limit??100)].sort((s,i)=>s.id-i.id)}function Dc(e){return`${BigInt(e.getTime())*1000000n}`}function Za(e){return Object.entries(e).map(([n,a])=>({key:n,value:{stringValue:a}}))}function Bc(e){return e==="ui_twin_frame_rate"?"fps":e.endsWith("_seconds")?"s":"1"}function Fc(e){return new Map(e.summaries.map(n=>[n.name,n]))}function en(e,n,a,s,i,r,c){const o=c.get(a);
45if(!o)return{id:e,label:n,target:s,status:"no-data",detail:"no local samples"};const d=o.max<=i?"ok":o.max<=r?"watch":"breach";return{id:e,label:n,target:s,status:d,detail:`max ${o.max.toFixed(3)}s across ${o.count} sample(s)`}}function Xa(e,n,a,s,i,r,c){const o=c.get(s);if(!o)return{id:e,label:n,target:i,status:"no-data",detail:"no stream samples"};const l=c.get(a)?.sum??0,g=o.sum<=0?0:l/o.sum,u=l===0?"ok":g<=r?"watch":"breach";return{id:e,label:n,target:i,status:u,detail:`${l.toFixed(0)} of ${o.sum.toFixed(0)} frame(s)`}}function qc(e){const n=e.get("ui_twin_frame_rate");return n?{id:"twin-frame-rate",label:"Twin frame rate",target:"30fps floor",status:n.min>=30?"ok":n.min>=20?"watch":"breach",detail:`min ${n.min.toFixed(1)}fps across ${n.count} sample(s)`}:{id:"twin-frame-rate",label:"Twin frame rate",target:"30fps floor",status:"no-data",detail:"sidecar not sampled"}}function Hc(e=pn()){const n=Fc(e);return[en("role-shell-load","Role shell load","ui_role_shell_load_seconds","< 3s",3,4.5,n),en("projection-freshness","Projection freshness","ui_projection_freshness_seconds","< 500ms critical / < 2s standard",.5,2,n),en("command-ack","Command ack","ui_command_ack_seconds","< 250ms",.25,.5,n),en("evidence-drawer","Evidence drawer","ui_evidence_drawer_open_seconds","< 2s",2,3,n),Xa("stream-drops","Stream drops","ui_stream_frames_dropped_total","ui_stream_frames_total","0 dropped frames",.01,n),Xa("stale-frames","Stale frames","ui_stream_frames_stale_total","ui_stream_frames_total","<= 1% stale frames",.01,n),qc(n)]}function Wc(e,{serviceName:n="arcnet-console",serviceVersion:a="0.0.0"}={}){const s=new Map;for(const i of e)s.set(i.name,[...s.get(i.name)??[],i]);return{resourceMetrics:[{resource:{attributes:Za({"service.name":n,"service.version":a,"arcnet.surface":"browser"})},scopeMetrics:[{scope:{name:"arcnet-console.browser",version:a},metrics:[...s.entries()].map(([i,r])=>({name:i,unit:Bc(i),gauge:{dataPoints:r.map(c=>({timeUnixNano:Dc(c.at),asDouble:c.value,attributes:Za({...c.tags,"arcnet.metric.id":String(c.id)})}))}}))}]}]}}function es(){return Ge}async function Pi(e={}){const n=e.endpoint??void 0,a=ki(e);if(!n)return Ge={status:"disabled",ok:!1,exported:0,at:new Date,error:"VITE_OTEL_METRICS_ENDPOINT is not configured."},Ge;if(a.length===0)return Ge={status:"ok",ok:!0,endpoint:n,exported:0,at:new Date},Ge;Ge={status:"exporting",ok:!0,endpoint:n,exported:0,at:new Date};try{const i=await(e.fetchImpl??fetch)(n,{method:"POST",headers:{"content-type":"application/json",...e.headers},body:JSON.stringify(Wc(a,e))});if(!i.ok)throw new Error(`OTel metric export failed with HTTP ${i.status}`);return na=Math.max(na,...a.map(r=>r.id)),Ge={status:"ok",ok:!0,endpoint:n,exported:a.length,at:new Date},Ge}catch(s){return Ge={status:"error",ok:!1,endpoint:n,exported:0,at:new Date,error:s instanceof Error?s.message:String(s)},Ge}}function Gc(e={}){const n=e.endpoint??void 0;if(!n||typeof window>"u")return()=>{};const a=window.setInterval(()=>{Pi({...e,endpoint:n})},e.intervalMs??3e4);return()=>window.clearInterval(a)}function _t(e,n){switch(n.type){case"submit":return"pending";case"receipt":return n.status;case"reset":return"idle"}}const Ti={overview:{longitude:0,latitude:20,zoom:1.2,pitch:0,bearing:0},ornl:{longitude:-84.2696,latitude:35.9311,zoom:8,pitch:60,bearing:-20},alpha:{longitude:-84.2696,latitude:35.9311,zoom:5,pitch:45,bearing:0},bravo:{longitude:-95.3698,latitude:29.7604,zoom:5,pitch:45,bearing:0},charlie:{longitude:-121.8863,latitude:37.3382,zoom:5,pitch:45,bearing:0}},ts=240,ns=500,as=120,ss=500,is=500,rs=500,os=500,cs=500,ls=500,ds=2e3,us=500,ms=500,ps=100,hs=100,fs=100,gs=96,aa={mode:"idle",lastFrameType:null,lastEventId:null,lastTopic:null,lastEntityType:null,lastRoleProjection:null,lastCorrelationId:null,lastCausationId:null,lastTraceId:null,lastObservedAt:null,lastEmittedAt:null,lastReceivedAt:null,lastReplayCursor:null,lastSequence:null,envelopedFrames:0,legacyFrames:0,malformedFrames:0,unknownFrames:0,duplicateFrames:0,droppedFrames:0,outOfOrderFrames:0,staleFrames:0,lastIssue:null},_s={activeRole:null,facilities:{},nodes:{},selectedNodeId:null,selectedFacilityId:null,jobs:{},selectedJobId:null,signalSamples:{},signalEvents:[],recentProcessStates:[],recentControlDecisions:[],recentInterventions:[],recentCorrectionOutcomes:[],recentCorrectionObservability:[],recentRelationalPredictions:[],attestationResults:{},tokenRingPasses:[],modelReleases:[],evidencePackages:{},auditReceipts:[],evidenceReceipts:[],facilityRollups:{},equivalenceResults:{},jonaContextWindows:{},selectedJonaContextId:null,jonaQuarantineEvents:[],jonaClaimReceipts:[],jonaNeighborhoods:{},flowWorkCells:{},flowSnapshotsByCell:{},flowConstraintAssessment:null,flowSimulationRuns:{},flowDbrSchedules:{},flowRecommendations:{},flowDispositions:{},events:[],maxEvents:1e3,globalStats:null,viewState:{longitude:-84.2696,latitude:35.9311,zoom:2.5,pitch:20,bearing:0}
45,isConnected:!1,isPaused:!1,showScanlines:!0,selectedCorrectionTraceKey:null,selectedReceiptLink:null,streamHealth:{...aa},processedStreamEventIds:[],commandHistory:[],commandHistoryIndex:-1,commandLanePhase:"idle",activeCommandIntent:null,commandReceipts:[],proofPointBannerDismissedFor:{}};function tn(e){if(e instanceof Date)return e.getTime();if(typeof e=="string"){const n=Date.parse(e);if(!Number.isNaN(n))return n}return 0}function Uc(e,n){const a=e.findIndex(s=>s.id===n.id);a>=0&&e.splice(a,1),e.unshift(n),e.length>ps&&(e.length=ps)}function Ai(e,n){const a=e.findIndex(s=>s.id===n.id);a>=0&&e.splice(a,1),e.unshift(n),e.length>us&&(e.length=us)}function Li(e,n,a){const s=e.findIndex(i=>i.id===n.id);s>=0&&e.splice(s,1),e.unshift(n),e.length>a&&(e.length=a)}function Ln(e,n){Uc(e.commandReceipts,n),Ai(e.auditReceipts,Ac(n)),Li(e.events,Lc(n),e.maxEvents),zc(n)}function zc(e){e.status!=="pending"&&e.acknowledgedAt&&ot("ui_command_ack_seconds",Ia(e.requestedAt.getTime(),e.acknowledgedAt.getTime()),{command:e.command,role:e.actorRole,status:e.status}),e.status==="stale-state"&&ot("ui_command_stale_blocks_total",1,{command:e.command,role:e.actorRole,projectionKind:e.projectionKind})}const x=ii()(Ri(Rc(kc((e,n)=>({..._s,setActiveRole:a=>e(s=>{s.activeRole=a}),dismissProofPointBanner:a=>e(s=>{s.proofPointBannerDismissedFor[a]=!0}),upsertFacility:a=>e(s=>{s.facilities[a.id]=a}),selectFacility:a=>e(s=>{s.selectedFacilityId=a}),upsertNode:a=>e(s=>{s.nodes[a.id]=a}),removeNode:a=>e(s=>{delete s.nodes[a],s.selectedNodeId===a&&(s.selectedNodeId=null)}),selectNode:a=>e(s=>{s.selectedNodeId=a}),setNetworkMode:(a,s)=>e(i=>{const r=i.nodes[a];r&&(r.networkMode=s)}),upsertJob:a=>e(s=>{s.jobs[a.id]=a}),selectJob:a=>e(s=>{s.selectedJobId=a}),appendSignalSample:a=>e(s=>{const i=s.signalSamples[a.nodeId]??[];i.push(a),i.length>ts&&i.splice(0,i.length-ts),s.signalSamples[a.nodeId]=i}),appendSignalEvent:a=>e(s=>{s.signalEvents.unshift(a),s.signalEvents.length>ns&&(s.signalEvents.length=ns)}),appendProcessState:a=>e(s=>{s.recentProcessStates.unshift(a),s.recentProcessStates.length>ss&&(s.recentProcessStates.length=ss)}),appendControlDecision:a=>e(s=>{s.recentControlDecisions.unshift(a),s.recentControlDecisions.length>is&&(s.recentControlDecisions.length=is)}),appendIntervention:a=>e(s=>{s.recentInterventions.unshift(a),s.recentInterventions.length>rs&&(s.recentInterventions.length=rs)}),appendCorrectionOutcome:a=>e(s=>{s.recentCorrectionOutcomes.unshift(a),s.recentCorrectionOutcomes.length>os&&(s.recentCorrectionOutcomes.length=os)}),appendCorrectionObservability:a=>e(s=>{s.recentCorrectionObservability.unshift(a),s.recentCorrectionObservability.length>cs&&(s.recentCorrectionObservability.length=cs)}),appendRelationalPrediction:a=>e(s=>{s.recentRelationalPredictions.unshift(a),s.recentRelationalPredictions.length>ls&&(s.recentRelationalPredictions.length=ls)}),setAttestationResult:a=>e(s=>{s.attestationResults[a.nodeId]=a}),appendTokenRingPass:a=>e(s=>{s.tokenRingPasses.unshift(a),s.tokenRingPasses.length>as&&(s.tokenRingPasses.length=as)}),appendModelRelease:a=>e(s=>{s.modelReleases.unshift(a)}),upsertEvidencePackage:a=>e(s=>{s.evidencePackages[a.jobId]=a}),appendAuditReceipt:a=>e(s=>{Ai(s.auditReceipts,a)}),appendEvidenceReceipt:a=>e(s=>{const i=s.evidenceReceipts.findIndex(r=>
45r.id===a.id);i>=0&&s.evidenceReceipts.splice(i,1),s.evidenceReceipts.unshift(a),s.evidenceReceipts.length>ms&&(s.evidenceReceipts.length=ms)}),upsertFacilityRollup:a=>e(s=>{s.facilityRollups[a.facilityId]=a}),upsertEquivalenceResult:a=>e(s=>{s.equivalenceResults[a.equivalenceClassId]=a}),upsertJonaContextWindow:a=>e(s=>{s.jonaContextWindows[a.contextId]=a,s.selectedJonaContextId||(s.selectedJonaContextId=a.contextId)}),selectJonaContext:a=>e(s=>{s.selectedJonaContextId=a}),appendJonaQuarantineEvent:a=>e(s=>{s.jonaQuarantineEvents.unshift({...a,receivedAt:a.receivedAt??new Date}),s.jonaQuarantineEvents.length>hs&&(s.jonaQuarantineEvents.length=hs)}),appendJonaClaimReceipt:a=>e(s=>{s.jonaClaimReceipts.unshift({...a,receivedAt:a.receivedAt??new Date}),s.jonaClaimReceipts.length>fs&&(s.jonaClaimReceipts.length=fs)}),setJonaNeighborhood:a=>e(s=>{s.jonaNeighborhoods[a.root]=a}),upsertFlowWorkCell:a=>e(s=>{s.flowWorkCells[a.cellId]=a}),upsertFlowSnapshot:a=>e(s=>{const i=s.flowSnapshotsByCell[a.cellId]??[],r=i.findIndex(c=>c.snapshotId===a.snapshotId);r>=0?i.splice(r,1,a):i.push(a),i.sort((c,o)=>tn(c.windowEnd)-tn(o.windowEnd)),i.length>gs&&i.splice(0,i.length-gs),s.flowSnapshotsByCell[a.cellId]=i}),setFlowConstraintAssessment:a=>e(s=>{const i=s.flowConstraintAssessment;i&&i.assessmentId!==a.assessmentId&&tn(i.generatedAt)>tn(a.generatedAt)||(s.flowConstraintAssessment=a)}),upsertFlowSimulationRun:a=>e(s=>{s.flowSimulationRuns[a.runId]=a}),upsertFlowDbrSchedule:a=>e(s=>{s.flowDbrSchedules[a.scheduleId]=a}),upsertFlowRecommendation:a=>e(s=>{s.flowRecommendations[a.recommendationId]=a}),recordFlowDisposition:a=>e(s=>{s.flowDispositions[a.recommendationId]=a;const i=s.flowRecommendations[a.recommendationId];i&&(i.latestDisposition=a,i.dispositionStatus=a.action==="approve"?"approved":a.action==="reject"?"rejected":"modified")}),appendEvent:a=>e(s=>{Li(s.events,a,s.maxEvents)}),clearEvents:()=>e(a=>{a.events=[]}),setGlobalStats:a=>e(s=>{s.globalStats=a}),setViewState:a=>e(s=>{Object.assign(s.viewState,a)}),flyToNode:a=>{const s=n().nodes[a];if(!s)return;const[i,r]=s.position;e(c=>{c.viewState={longitude:i,latitude:r,zoom:6,pitch:45,bearing:0,transitionDuration:1500},c.selectedNodeId=a})},flyToFacility:a=>{const s=n().facilities[a];if(!s)return;const[i,r]=s.position;e(c=>{c.viewState={longitude:i,latitude:r,zoom:5,pitch:45,bearing:0,transitionDuration:1500},c.selectedFacilityId=a})},flyToPreset:a=>e(s=>{s.viewState={...Ti[a],transitionDuration:2e3}}),setConnected:a=>e(s=>{s.isConnected=a}),togglePause:()=>e(a=>{a.isPaused=!a.isPaused}),toggleScanlines:()=>e(a=>{a.showScanlines=!a.showScanlines}),selectCorrectionTrace:a=>e(s=>{s.selectedCorrectionTraceKey=a}),selectReceiptLink:a=>e(s=>{s.selectedReceiptLink=a}),recordStreamFrame:a=>{const s=n(),i=!!a.eventId&&s.processedStreamEventIds.includes(a.eventId),r=!i&&a.issue?.kind!=="unsupported-major-version"&&a.issue?.kind!=="unknown-frame-type"&&a.format!=="malformed";return e(c=>{const o=c.streamHealth,d=o.mode,l=new Date;if(a.format==="enveloped"?(o.envelopedFrames+=1,o.mode=d==="legacy"||d==="mixed"?"mixed":"enveloped"):a.format==="legacy"?(o.legacyFrames+=1,o.mode=d==="enveloped"||d==="mixed"?"mixed":"legacy"):o.malformedFrames+=1,i){o.duplicateFrames+=1,o.lastIssue={kind:"duplicate-event",message:"Duplicate stream event id ignored.",type:a.type,eventId:a.eventId,sequence:a.sequence,at:l};return}if(a.issue?.kind==="unknown-frame-type"&&(o.unknownFrames+=1),a.issue?.kind==="malformed-envelope"&&a.format!=="malformed"&&(o.malformedFrames+=1),a.stale&&(o.staleFrames+=1),typeof a.sequence=="number"){const g=o.lastSequence;if(typeof g=="number"){if(a.sequence<=g)o.outOfOrderFrames+=1,o.lastIssue={kind:"out-of-order-sequence",message:`Stream sequence ${a.sequence} arrived after ${g}.`,type:a.type,eventId:a.eventId,sequence:a.sequence,at:l};else if(a.sequence>g+1){const u=a.sequence-g-1;o.droppedFrames+=u,o.lastIssue={kind:"dropped-sequence",message:`Stream sequence gap detected: ${u} frame(s) missing.`,type:a.type,eventId:a.eventId,sequence:a.sequence,at:l}}}(g===null||a.sequence>g)&&(o.lastSequence=a.sequence)}a.issue&&(o.lastIssue=a.issue),o.lastFrameType=a.type??null,o.lastEventId=a.eventId??null,o.lastTopic=a.topic??null,o.lastEntityType=a.entityType??null,o.lastRoleProjection=a.roleProjection??null,o.lastCorrelationId=a.correlationId??null,o.lastCausationId=a.causationId??null,o.lastTraceId=a.traceId??null,o.lastObservedAt=a.observedAt??null,o.lastEmittedAt=a.emittedAt??null,o.lastReceivedAt=l,o.lastReplayCursor=a.replayCursor??null,a.eventId&&(c.processedStreamEventIds.push(a.eventId),c.processedStreamEventIds.length>ds&&c.processedStreamEventIds.splice(0,c.processedStreamEventIds.length-ds))}),{accepted:r,duplicate:i}},resetStreamHealth:()=>e(a=>{a.streamHealth={...aa},a.processedStreamEventIds=[]}),addToCommandHistory:a=>e(s=>{s.commandHistory.push(a),s.commandHistory.length>100&&s.commandHistory.splice(0,s.commandHistory.length-100),s.commandHistoryIndex=-1}),setCommandHistoryIndex:a=>e(s=>{s.commandHistoryIndex=a}),beginCommandIntent:(a,s)=>e(i=>{i.commandLanePhase=_t(i.commandLanePhase,{type:"submit"}),i.activeCommandIntent=a,Ln(i,s)}),completeCommandReceipt:a=>e(s=>{s.commandLanePhase=a.status==="pending"?_t(s.commandLanePhase,{type:"submit"}):_t(s.commandLanePhase,{type:"receipt",status:a.status}),s.activeCommandIntent?.id===a.intentId&&(s.activeCommandIntent=null),Ln(s,a)}),recordCommandReceipt:a=>e(s=>{s.commandLanePhase=a.status==="pending"?_t(s.commandLanePhase,{type:"submit"}):_t(s.commandLanePhase,{type:"receipt",status:a.status}),Ln(s,a)}),clearCommandLane:()=>e(a=>{a.commandLanePhase=_t(a.commandLanePhase,{type:"reset"}),a.activeCommandIntent=null,a.commandReceipts=[],a.selectedReceiptLink?.kind==="command"&&(a.selectedReceiptLink=null)}),reset:()=>e(()=>({..._s,streamHealth:{...aa},processedStreamEventIds:[]}))}))),{name:"arcnet-store"})),Oi=(e,n)=>e.signalSamples[n]??[],Vc="_wrap_1xy1d_1",Jc="_trigger_1xy1d_7",Kc="_kicker_1xy1d_31",Yc="_label_1xy1d_38",Qc="_caret_1xy1d_39",Zc="_popover_1xy1d_41",Xc="_item_1xy1d_55",el="_itemActive_1xy1d_71",tl="_itemRoute_1xy1d_72",nl="_sep_1xy1d_74",Be={wrap:Vc,trigger:Jc,kicker:Kc,label:Yc,caret:Qc,popover:Zc,item:Xc,itemActive:el,itemRoute:tl,
45sep:nl},ys={"ornl-metallurgist":"Metallurgist","arc-operator":"Operator","node-site-manager":"Site Manager","line-technician":"Line Tech","indopacom-stakeholder":"INDOPACOM","defense-oem":"Defense OEM"};function Cn(){const{session:e}=Ue(),n=We(),a=$e(),[s,i]=h.useState(!1),r=h.useRef(null),c=x(u=>u.setActiveRole),o=Yt(e?.email).filter(Ii),d=Ci(a.pathname),l=d?ys[d]:"â";h.useEffect(()=>{if(!s)return;function u(m){r.current&&!r.current.contains(m.target)&&i(!1)}function _(m){m.key==="Escape"&&i(!1)}return document.addEventListener("mousedown",u),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",_)}},[s]);const g=o.length>1||d!==o[0];return t.jsxs("div",{ref:r,className:Be.wrap,"data-testid":"role-switcher",children:[t.jsxs("button",{className:Be.trigger,onClick:()=>g&&i(u=>!u),disabled:!g,"aria-haspopup":"menu","aria-expanded":s,children:[t.jsx("span",{className:Be.kicker,children:"role"}),t.jsx("span",{className:Be.label,children:l}),g&&t.jsx("span",{className:Be.caret,children:"â¾"})]}),s&&t.jsxs("ul",{className:Be.popover,role:"menu",children:[o.map(u=>{const _=Wt(u),m=_===a.pathname;return t.jsx("li",{role:"none",children:t.jsxs("button",{className:`${Be.item} ${m?Be.itemActive:""}`,role:"menuitem",onClick:()=>{i(!1),m||(c(u),n(_))},children:[t.jsx("span",{children:ys[u]}),t.jsx("span",{className:Be.itemRoute,children:_})]})},u)}),t.jsx("li",{role:"separator",className:Be.sep}),t.jsx("li",{role:"none",children:t.jsxs("button",{className:Be.item,role:"menuitem",onClick:()=>{i(!1),n("/role-chooser")},children:[t.jsx("span",{children:"Exit to chooser"}),t.jsx("span",{className:Be.itemRoute,children:"/role-chooser"})]})})]})]})}const al="_panel_1qcfp_5",sl="_panelSm_1qcfp_26",il="_panelMd_1qcfp_30",rl="_panelLg_1qcfp_34",ol="_panelWithHeader_1qcfp_39",cl="_header_1qcfp_43",ll="_title_1qcfp_66",dl="_titleGlow_1qcfp_76",ul="_headerActions_1qcfp_81",ml="_corners_1qcfp_88",pl="_interactive_1qcfp_111",hl="_variantDefault_1qcfp_124",fl="_variantAccent_1qcfp_128",gl="_variantWarning_1qcfp_142",_l="_variantError_1qcfp_156",yl="_variantHpc_1qcfp_170",vl="_content_1qcfp_185",Ee={panel:al,panelSm:sl,panelMd:il,panelLg:rl,panelWithHeader:ol,header:cl,title:ll,titleGlow:dl,headerActions:ul,corners:ml,interactive:pl,variantDefault:hl,variantAccent:fl,variantWarning:gl,variantError:_l,variantHpc:yl,content:vl},bl={default:Ee.variantDefault,accent:Ee.variantAccent,warning:Ee.variantWarning,error:Ee.variantError,hpc:Ee.variantHpc},jl={sm:Ee.panelSm,md:Ee.panelMd,lg:Ee.panelLg};function ie({children:e,title:n,headerActions:a,variant:s="default",size:i="md",corners:r=!1,glowTitle:c=!1,interactive:o=!1,className:d="",onClick:l}){const g=n||a,u=[Ee.panel,jl[i],bl[s],g&&Ee.panelWithHeader,r&&Ee.corners,o&&Ee.interactive,d].filter(Boolean).join(" "),_=[Ee.title,c&&Ee.titleGlow].filter(Boolean).join(" ");return t.jsxs("div",{className:u,onClick:o?l:void 0,children:[g&&t.jsxs("div",{className:Ee.header,children:[n&&t.jsx("h3",{className:_,children:n}),a&&t.jsx("div",{className:Ee.headerActions,children:a})]}),t.jsx("div",{className:Ee.content,children:e})]})}const xl="_container_14dwv_5",Il="_bar_14dwv_13",wl="_percentage_14dwv_19",Nl="_label_14dwv_25",Sl="_colorLow_14dwv_31",Cl="_colorMedium_14dwv_36",Rl="_colorHigh_14dwv_41",El="_colorCyan_14dwv_47",kl="_colorHpc_14dwv_52",Pl="_colorCogen_14dwv_57",Tl="_sizeSm_14dwv_63",Al="_sizeMd_14dwv_71",Ll="_sizeLg_14dwv_75",Ol="_animated_14dwv_84",Pe={container:xl,bar:Il,percentage:wl,label:Nl,colorLow:Sl,colorMedium:Cl,colorHigh:Rl,colorCyan:El,colorHpc:kl,colorCogen:Pl,sizeSm:Tl,sizeMd:Al,sizeLg:Ll,animated:Ol},$l={blocks:{filled:"â",empty:"â"},hashes:{filled:"#",empty:"-"},dots:{filled:"â",empty:"â"},arrows:{filled:"â¶",empty:"â·"},equals:{filled:"=",empty:"-"}},Ml=25,Dl=60;function Bl(e){return e<Ml?Pe.colorLow:e<Dl?Pe.colorMedium:Pe.colorHigh}function Fl(e,n){switch(e){case"auto":return Bl(n);case"cyan":return Pe.colorCyan;case"hpc":return Pe.colorHpc;case"cogen":return Pe.colorCogen;case"green":return Pe.colorHigh;default:return Pe.colorHigh}}const ql={sm:Pe.sizeSm,md:Pe.sizeMd,lg:Pe.sizeLg};function it({value:e,max:n=100,width:a=12,showPercentage:s=!0,label:i,colorScheme:r="auto",size:c="md",charStyle:o="blocks",brackets:d=!0,animated:l=!1,className:g=""}){const{bar:u,percentage:_}=h.useMemo(()=>{const p=Math.max(0,Math.min(100,e/n*100)),f=Math.round(p/100*a),b=a-f,w=$l[o],j=w.filled.repeat(f),C=w.empty.repeat(b);let N=j+C;return d&&(N="["+N+"]"),{bar:N,percentage:p}},[e,n,a,o,d]),m=Fl(r,_),v=[Pe.container,ql[c],m,l&&Pe.animated,g].filter(
45Boolean).join(" ");return t.jsxs("div",{className:v,children:[t.jsx("span",{className:Pe.bar,children:u}),s&&t.jsxs("span",{className:Pe.percentage,children:[Math.round(_),"%"]}),i&&t.jsx("span",{className:Pe.label,children:i})]})}const Hl="_badge_1ukil_5",Wl="_dot_1ukil_21",Gl="_sizeSm_1ukil_31",Ul="_sizeMd_1ukil_40",zl="_sizeLg_1ukil_44",Vl="_statusOnline_1ukil_54",Jl="_label_1ukil_66",Kl="_statusOffline_1ukil_71",Yl="_statusBusy_1ukil_88",Ql="_statusIdle_1ukil_106",Zl="_statusStale_1ukil_123",Xl="_statusWarning_1ukil_141",ed="_statusError_1ukil_159",td="_statusCyan_1ukil_245",nd="_statusPending_1ukil_262",ad="_statusActive_1ukil_279",sd="_statusCompleted_1ukil_296",id="_statusFailed_1ukil_312",rd="_variantPill_1ukil_353",od="_variantMinimal_1ukil_384",be={badge:Hl,dot:Wl,sizeSm:Gl,sizeMd:Ul,sizeLg:zl,statusOnline:Vl,label:Jl,statusOffline:Kl,statusBusy:Yl,statusIdle:Ql,statusStale:Zl,statusWarning:Xl,statusError:ed,statusCyan:td,statusPending:nd,statusActive:ad,statusCompleted:sd,statusFailed:id,variantPill:rd,variantMinimal:od},cd={online:be.statusOnline,offline:be.statusOffline,busy:be.statusBusy,idle:be.statusIdle,stale:be.statusStale,warning:be.statusWarning,error:be.statusError,pending:be.statusPending,active:be.statusActive,completed:be.statusCompleted,failed:be.statusFailed,cyan:be.statusCyan},ld={sm:be.sizeSm,md:be.sizeMd,lg:be.sizeLg},dd={default:"",pill:be.variantPill,minimal:be.variantMinimal},ud={online:"Online",offline:"Offline",busy:"Busy",idle:"Idle",stale:"Stale",warning:"Warning",error:"Error",pending:"Pending",active:"Active",completed:"Completed",failed:"Failed",cyan:"Active"};function Rn({status:e,label:n,size:a="md",variant:s="default",dotOnly:i=!1,className:r=""}){const c=n??ud[e],o=[be.badge,cd[e],ld[a],dd[s],r].filter(Boolean).join(" ");return t.jsxs("span",{className:o,children:[t.jsx("span",{className:be.dot}),!i&&t.jsx("span",{className:be.label,children:c})]})}const md="_overlay_1vlv2_5",pd="_scanlines_1vlv2_13",hd="_flicker_1vlv2_28",fd="_intensityLight_1vlv2_44",gd="_intensityMedium_1vlv2_54",_d="_intensityHeavy_1vlv2_64",yd="_vignette_1vlv2_75",vd="_rgbShift_1vlv2_80",bd="_animated_1vlv2_99",jd="_phosphorGlow_1vlv2_113",xd="_noise_1vlv2_122",Id="_glitch_1vlv2_146",He={overlay:md,scanlines:pd,flicker:hd,intensityLight:fd,intensityMedium:gd,intensityHeavy:_d,vignette:yd,rgbShift:vd,animated:bd,phosphorGlow:jd,noise:xd,glitch:Id},wd={light:He.intensityLight,medium:He.intensityMedium,heavy:He.intensityHeavy};function Nd({enabled:e=!0,intensity:n="medium",flicker:a=!0,vignette:s=!1,rgbShift:i=!1,animated:r=!1,phosphorGlow:c=!1,noise:o=!1,glitch:d=!1,className:l=""}){if(!e)return null;const g=[He.overlay,He.scanlines,wd[n],a&&He.flicker,s&&He.vignette,i&&He.rgbShift,r&&He.animated,c&&He.phosphorGlow,o&&He.noise,d&&He.glitch,l].filter(Boolean).join(" ");return t.jsx("div",{className:g,"aria-hidden":"true"})}const Sd="_container_1i704_5",Cd="_text_1i704_14",Rd="_cursor_1i704_19",Ed="_cursorHidden_1i704_29",kd="_cursorBlock_1i704_39",Pd="_cursorLine_1i704_44",Td="_cursorUnderscore_1i704_49",Ad="_glowing_1i704_57",Ld="_colorGreen_1i704_66",Od="_colorCyan_1i704_71",$d="_colorWarning_1i704_76",Md="_colorError_1i704_81",Dd="_colorHpc_1i704_86",Bd="_colorWhite_1i704_91",Fd="_sizeSm_1i704_97",qd="_sizeMd_1i704_106",Hd="_sizeLg_1i704_110",Wd="_sizeXl_1i704_119",Gd="_prefix_1i704_129",Ud="_completed_1i704_135",je={container:Sd,text:Cd,cursor:Rd,cursorHidden:Ed,cursorBlock:kd,cursorLine:Pd,cursorUnderscore:Td,glowing:Ad,colorGreen:Ld,colorCyan:Od,colorWarning:$d,colorError:Md,colorHpc:Dd,colorWhite:Bd,sizeSm:Fd,sizeMd:qd,sizeLg:Hd,sizeXl:Wd,prefix:Gd,completed:Ud},zd={block:je.cursorBlock,line:je.cursorLine,underscore:je.cursorUnderscore},Vd={green:je.colorGreen,cyan:je.colorCyan,warning:je.colorWarning,error:je.colorError,hpc:je.colorHpc,white:je.colorWhite},Jd={sm:je.sizeSm,md:je.sizeMd,lg:je.sizeLg,xl:je.sizeXl};function Kd({text:e,speed:n=50,delay:a=0,showCursor:s=!0,cursorStyle:i="block",hideCursorOnComplete:r=!1,color:c="green",size:o="md",glow:d=!1,prefix:l,onStart:g,onComplete:u,skipAnimation:_=!1,className:m=""}){const[v,p]=h.useState(_?e:""),[,f]=h.useState(!1),[b,w]=h.useState(_),j=h.useRef(null),C=h.useRef(0),N=h.useCallback(()=>
45{if(C.current<e.length){p(e.slice(0,C.current+1)),C.current+=1;const E=Math.random()*30-15,A=Math.max(10,n+E);j.current=setTimeout(N,A)}else f(!1),w(!0),u?.()},[e,n,u]);h.useEffect(()=>{if(_){p(e),w(!0);return}p(""),w(!1),C.current=0;const E=setTimeout(()=>{f(!0),g?.(),N()},a);return()=>{clearTimeout(E),j.current&&clearTimeout(j.current)}},[e,a,_,N,g]);const T=[je.container,Vd[c],Jd[o],d&&je.glowing,b&&je.completed,m].filter(Boolean).join(" "),R=[je.cursor,zd[i],r&&b&&je.cursorHidden].filter(Boolean).join(" ");return t.jsxs("span",{className:T,children:[l&&t.jsx("span",{className:je.prefix,children:l}),t.jsx("span",{className:je.text,children:v}),s&&t.jsx("span",{className:R})]})}const Yd="_container_1dek6_5",Qd="_scanlines_1dek6_16",Zd="_vignette_1dek6_31",Xd="_content_1dek6_39",eu="_logo_1dek6_63",tu="_title_1dek6_86",nu="_divider_1dek6_96",au="_tagline_1dek6_104",su="_ctaRow_1dek6_109",iu="_ctaButton_1dek6_118",ru="_ctaVisible_1dek6_144",ou="_buttonIcon_1dek6_172",cu="_features_1dek6_178",lu="_featuresVisible_1dek6_189",du="_feature_1dek6_178",uu="_featureIcon_1dek6_206",mu="_featureLabel_1dek6_210",pu="_footer_1dek6_215",hu="_footerLine_1dek6_224",ye={container:Yd,scanlines:Qd,vignette:Zd,content:Xd,logo:eu,title:tu,divider:nu,tagline:au,ctaRow:su,ctaButton:iu,ctaVisible:ru,buttonIcon:ou,features:cu,featuresVisible:lu,feature:du,featureIcon:uu,featureLabel:mu,footer:pu,footerLine:hu},fu=` 46 _ ____ ____ _ _ _ 47 / \\ | _ \\ / ___| \\ | | ___| |_ 48 / _ \\ | |_) | | | \\| |/ _ \\ __| 49 / ___ \\| _ <| |___| |\\ | __/ |_ 50/_/ \\_\\_| \\_\\\\____|_| \\_|\\___|\\__| 51`,gu="The operating system for autonomous distributed manufacturing.",_u=[{icon:">",label:"ZERO-TRUST ORCHESTRATION"},{icon:">",label:"HUB-AND-SPOKE TOPOLOGY"},{icon:">",label:"EVIDENCE-PRODUCING AUTONOMY"}];function yu({onEnterConsole:e}={}){const[n,a]=h.useState(!1),s=We(),{isAuthenticated:i}=Ue(),r=()=>{e?e():s(i?"/role-chooser":"/login")};return t.jsxs("div",{className:ye.container,children:[t.jsx("div",{className:ye.scanlines}),t.jsx("div",{className:ye.vignette}),t.jsxs("div",{className:ye.content,children:[t.jsx("pre",{className:ye.logo,children:fu}),t.jsx("h1",{className:ye.title,children:"ARCNet Console"}),t.jsx("div",{className:ye.divider,children:"â".repeat(40)}),t.jsx("div",{className:ye.tagline,children:t.jsx(Kd,{text:gu,speed:30,delay:500,color:"cyan",size:"md",showCursor:!0,hideCursorOnComplete:!0,onComplete:()=>a(!0)})}),t.jsx("div",{className:ye.ctaRow,children:t.jsxs("button",{className:`${ye.ctaButton} ${n?ye.ctaVisible:""}`,onClick:r,"aria-label":"Enter Console",children:[t.jsx("span",{className:ye.buttonIcon,children:">"}),"ENTER CONSOLE"]})}),t.jsx("div",{className:`${ye.features} ${n?ye.featuresVisible:""}`,children:_u.map((c,o)=>t.jsxs("div",{className:ye.feature,children:[t.jsx("span",{className:ye.featureIcon,children:c.icon}),t.jsx("span",{className:ye.featureLabel,children:c.label})]},o))}),t.jsxs("footer",{className:ye.footer,children:[t.jsx("div",{className:ye.footerLine,children:"ARCNET CONSOLE v1.0.0"}),t.jsx("div",{className:ye.footerLine,children:"SECURE ACCESS TERMINAL"})]})]})]})}function vu(e={}){const{nonce:n,onScriptLoadSuccess:a,onScriptLoadError:s}=e,[i,r]=h.useState(!1),c=h.useRef(a);c.current=a;const o=h.useRef(s);return o.current=s,h.useEffect(()=>{const d=document.createElement("script");return d.src="https://accounts.google.com/gsi/client",d.async=!0,d.defer=!0,d.nonce=n,d.onload=()=>{var l;r(!0),(l=c.current)===null||l===void 0||l.call(c)},d.onerror=()=>{var l;r(!1),(l=o.current)===null||l===void 0||l.call(o)},document.body.appendChild(d),()=>{document.body.removeChild(d)}},[n]),i}const $i=h.createContext(null);function bu({clientId:e,nonce:n,onScriptLoadSuccess:a,onScriptLoadError:s,children:i}){const r=vu({nonce:n,onScriptLoadSuccess:a,onScriptLoadError:s}),c=h.useMemo(()=>({clientId:e,scriptLoadedSuccessfully:r}),[e,r]);return ri.createElement($i.Provider,{value:c},i)}function ju(){const e=h.useContext($i);if(!e)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return e}function xu(e){var n;return(n=e?.clientId)!==null&&n!==void 0?n:e?.client_id}const Iu={large:40,medium:32,small:20};function wu({onSuccess:e,onError:n,useOneTap:a,promptMomentNotification:s,type:i="standard",theme:r="outline",size:c="large",text:o,shape:d,logo_alignment:l,width:g,locale:u,click_listener:_,containerProps:m,...v}){const p=h.useRef(null),{clientId:f,scriptLoadedSuccessfully:b}=ju(),w=h.useRef(e);w.current=e;const j=h.useRef(n);j.current=n;const C=h.useRef(s);return C.current=s,h.useEffect(()=>{var N,T,R,E,A,V,re,q,de;if(b)return(R=(T=(N=window?.google)===null||N===void 0?void 0:N.accounts)===null||T===void 0?void 0:T.id)===null||R===void 0||R.initialize({client_id:f,callback:Z=>{var ue;if(!Z?.credential)return(ue=j.current)===null||ue===void 0?void 0:ue.call(j);const{credential:Ce,select_by:$}=Z;w.current({credential:Ce,clientId:xu(Z),select_by:$})},...v}),(V=(A=(E=window?.google)===null||E===void 0?void 0:E.accounts)===null||A===void 0?void 0:A.id)===null||V===void 0||V.renderButton(p.current,{type:i,theme:r,size:c,text:o,shape:d,logo_alignment:l,width:g,locale:u,click_listener:_}),a&&((de=(q=(re=window?.google)===null||re===void 0?void 0:re.accounts)===null||q===void 0?void 0:q.id)===null||de===void 0||de.prompt(C.
51current)),()=>{var Z,ue,Ce;a&&((Ce=(ue=(Z=window?.google)===null||Z===void 0?void 0:Z.accounts)===null||ue===void 0?void 0:ue.id)===null||Ce===void 0||Ce.cancel())}},[f,b,a,i,r,c,o,d,l,g,u]),ri.createElement("div",{...m,ref:p,style:{height:Iu[c],...m?.style}})}const Nu="_container_1y267_5",Su="_scanlines_1y267_16",Cu="_vignette_1y267_30",Ru="_content_1y267_38",Eu="_logo_1y267_61",ku="_title_1y267_74",Pu="_titleLine_1y267_87",Tu="_divider_1y267_97",Au="_notice_1y267_104",Lu="_prompt_1y267_114",Ou="_code_1y267_121",$u="_googleButton_1y267_129",Mu="_error_1y267_136",Du="_dismiss_1y267_148",Bu="_footer_1y267_183",Fu="_footerLine_1y267_197",xe={container:Nu,scanlines:Su,vignette:Cu,content:Ru,logo:Eu,title:ku,titleLine:Pu,divider:Tu,notice:Au,prompt:Lu,code:Ou,googleButton:$u,error:Mu,dismiss:Du,footer:Bu,footerLine:Fu},qu=` 52 _ ____ ____ _ _ _ 53 / \\ | _ \\ / ___| \\ | | ___| |_ 54 / _ \\ | |_) | | | \\| |/ _ \\ __| 55 / ___ \\| _ <| |___| |\\ | __/ |_ 56/_/ \\_\\_| \\_\\\\____|_| \\_|\\___|\\__| 57`,Hu="574194077548-f7537shpp15jli7t2vghv0jmc68s31hn.apps.googleusercontent.com",Wu=!1;function Gu(){const e=We(),n=$e(),{signIn:a,isAuthenticated:s,domainError:i,clearDomainError:r}=Ue();h.useEffect(()=>{if(s){const o=n.state?.from?.pathname??"/role-chooser";e(o,{replace:!0})}},[s,n.state,e]);const c=t.jsxs("div",{className:xe.container,children:[t.jsx("div",{className:xe.scanlines}),t.jsx("div",{className:xe.vignette}),t.jsxs("div",{className:xe.content,children:[t.jsx("pre",{className:xe.logo,children:qu}),t.jsxs("h1",{className:xe.title,children:[t.jsx("span",{className:xe.titleLine,children:"ARCNET CONSOLE"}),t.jsx("span",{className:xe.titleLine,children:"SECURE ACCESS TERMINAL"})]}),t.jsx("div",{className:xe.divider,children:"â".repeat(40)}),t.jsxs("div",{className:xe.notice,children:[t.jsx("span",{className:xe.prompt,children:"$"})," Restricted to"," ",t.jsxs("code",{className:xe.code,children:["@",Zt]})," Workspace accounts."]}),i&&t.jsxs("div",{className:xe.error,children:["ACCESS DENIED · Domain not authorized.",t.jsx("br",{}),"Sign in with an ",t.jsxs("code",{className:xe.code,children:["@",Zt]})," account.",t.jsx("button",{className:xe.dismiss,onClick:r,children:"[ DISMISS ]"})]}),t.jsx("div",{className:xe.googleButton,children:t.jsx(wu,{onSuccess:o=>{if(o.credential)try{a(o.credential)}catch{}},onError:()=>{},theme:"filled_black",text:"signin_with",shape:"rectangular",size:"large",hosted_domain:Zt,auto_select:!1,ux_mode:"popup"})}),Wu,t.jsxs("footer",{className:xe.footer,children:[t.jsx("div",{className:xe.footerLine,children:"ARCNET CONSOLE v1.0.0"}),t.jsxs("div",{className:xe.footerLine,children:["SECURE ACCESS TERMINAL · ",Zt]})]})]})]});return t.jsx(bu,{clientId:Hu,children:c})}const Uu="_container_uynlp_6",zu="_bar_uynlp_14",Vu="_left_uynlp_30",Ju="_brand_uynlp_36",Ku="_divider_uynlp_43",Yu="_section_uynlp_48",Qu="_right_uynlp_54",Zu="_avatar_uynlp_60",Xu="_user_uynlp_67",em="_signOut_uynlp_73",tm="_frame_uynlp_89",Q={container:Uu,bar:zu,left:Vu,brand:Ju,divider:Ku,section:Yu,right:Qu,avatar:Zu,user:Xu,signOut:em,frame:tm};function nm(){const{session:e,signOut:n}=Ue(),a=We(),s=()=>{n(),a("/",{replace:!0})};return t.jsxs("div",{className:Q.container,children:[t.jsxs("header",{className:Q.bar,children:[t.jsxs("div",{className:Q.left,children:[t.jsx("span",{className:Q.brand,children:"ARCNET"}),t.jsx("span",{className:Q.divider,children:"·"}),t.jsx("span",{className:Q.section,children:"DOCUMENTATION"})]}),t.jsxs("div",{className:Q.right,children:[t.jsx(Cn,{}),e?.picture&&t.jsx("img",{src:e.picture,alt:"",className:Q.avatar,referrerPolicy:"no-referrer"}),t.jsx("span",{className:Q.user,children:e?.email}),t.jsx("button",{className:Q.signOut,onClick:s,children:"[ SIGN OUT ]"})]})]}),t.jsx("iframe",{title:"ARCNet Documentation",src:"/docs/index.html",className:Q.frame})]})}const am="_container_zpwol_1",sm="_bar_zpwol_10",im="_left_zpwol_19",rm="_right_zpwol_19",om="_brand_zpwol_20",cm="_divider_zpwol_21",lm="_section_zpwol_22",dm="_user_zpwol_23",um="_avatar_zpwol_24",mm="_signOut_zpwol_25",pm="_main_zpwol_37",hm="_title_zpwol_45",fm="_subtitle_zpwol_53",gm="_notice_zpwol_59",_m="_cardRow_zpwol_77",ym="_card_zpwol_77",vm="_cardKicker_zpwol_107",bm="_cardTitle_zpwol_113",jm="_cardBody_zpwol_120",xm="_cardCta_zpwol_128",Im="_altRow_zpwol_135",wm="_altLabel_zpwol_140",Nm="_altCards_zpwol_145",Sm="_altCard_zpwol_145",Cm="_altTitle_zpwol_164",Rm="_altRoute_zpwol_165",Em="_footer_zpwol_171",O={container:am,bar:sm,left:im,right:rm,brand:om,divi
57der:cm,section:lm,user:dm,avatar:um,signOut:mm,main:pm,title:hm,subtitle:fm,notice:gm,cardRow:_m,card:ym,cardKicker:vm,cardTitle:bm,cardBody:jm,cardCta:xm,altRow:Im,altLabel:wm,altCards:Nm,altCard:Sm,altTitle:Cm,altRoute:Rm,footer:Em},On={"ornl-metallurgist":"ORNL Metallurgist","arc-operator":"ARC Platform Operator","node-site-manager":"Node Site Manager","line-technician":"Line Technician","indopacom-stakeholder":"INDOPACOM Stakeholder","defense-oem":"Defense OEM"},km={"ornl-metallurgist":"Full simulation · phase-field canvas · digital twin · evidence governance.","arc-operator":"Fleet health · attestation · token-ring · model releases · SLA.","node-site-manager":"Powder-lot inventory · throughput · consumables (no geometry / recipe).","line-technician":"Blind manufacturing · anonymized jobs · triage light · SOPs.","indopacom-stakeholder":"Time-to-capability visibility (deferred to Phase Bravo).","defense-oem":"Qualification-chain visibility (deferred to Phase Bravo)."};function Pm(){const e=We(),n=$e(),{session:a,signOut:s}=Ue(),i=a?.email??null,r=Yt(i),c=Si(i),o=n.state?.deniedRole,d=()=>{s(),e("/",{replace:!0})};return t.jsxs("div",{className:O.container,children:[t.jsxs("header",{className:O.bar,children:[t.jsxs("div",{className:O.left,children:[t.jsx("span",{className:O.brand,children:"ARCNET"}),t.jsx("span",{className:O.divider,children:"·"}),t.jsx("span",{className:O.section,children:"POST-AUTH PORTAL CHOOSER"})]}),t.jsxs("div",{className:O.right,children:[a?.picture&&t.jsx("img",{src:a.picture,alt:"",className:O.avatar,referrerPolicy:"no-referrer"}),t.jsx("span",{className:O.user,children:a?.email}),t.jsx("button",{className:O.signOut,onClick:d,children:"[ SIGN OUT ]"})]})]}),t.jsxs("main",{className:O.main,children:[t.jsx("h1",{className:O.title,children:"Choose your portal"}),t.jsxs("p",{className:O.subtitle,children:["Authenticated as ",t.jsx("code",{children:a?.email}),". All portals stay behind the Google-OAuth gate."]}),o&&t.jsxs("div",{className:O.notice,role:"alert","data-testid":"denied-banner",children:["ACCESS DENIED for ",t.jsx("code",{children:On[o]}),". Your permitted operator roles are listed below."]}),t.jsxs("div",{className:O.cardRow,children:[t.jsxs(Ae,{to:"/first-light",className:O.card,"data-testid":"card-first-light",children:[t.jsx("div",{className:O.cardKicker,children:"21-DAY OPERATIONALIZATION · IN718"}),t.jsx("div",{className:O.cardTitle,children:"Project First Light"}),t.jsx("div",{className:O.cardBody,children:"Signed physical runs, calibrated model evidence, bounded recommendations, operator disposition, confirmatory outcome, and NPS Mode C replay."}),t.jsx("div",{className:O.cardCta,children:"â /first-light"})]}),t.jsxs(Ae,{to:"/docs",className:O.card,"data-testid":"card-docs",children:[t.jsx("div",{className:O.cardKicker,children:"DOCUMENTATION"}),t.jsx("div",{className:O.cardTitle,children:"ARCNet Docs"}),t.jsx("div",{className:O.cardBody,children:"Concepts, console + protocol guides, API reference, roadmap, and the v2 transition audit."}),t.jsx("div",{className:O.cardCta,children:"â /docs"})]}),t.jsxs(Ae,{to:"/network-explorer",className:O.card,"data-testid":"card-network-explorer",children:[t.jsx("div",{className:O.cardKicker,children:"DIGITAL TWIN · INTERNAL DEMO"}),t.jsx("div",{className:O.cardTitle,children:"Network Explorer"}),t.jsx("div",{className:O.cardBody,children:"ARCNet theater map across regional, scientific, and test nodes: OpenUSD twin preview, route playback, low-human autonomy event, and demonstration evidence."}),t.jsx("div",{className:O.cardCta,children:"â /network-explorer"})]}),t.jsxs(Ae,{to:"/diagnostics",className:O.card,"data-testid":"card-diagnostics",children:[t.jsx("div",{className:O.cardKicker,children:"OBSERVABILITY · LOCAL"}),t.jsx("div",{className:O.cardTitle,children:"Browser Diagnostics"}),t.jsx("div",{className:O.cardBody,children:"Local ARCNet UI metrics buffer, OTel export posture, stream health counters, command ack latency, and visual QA gate signals."}),t.jsx("div",{className:O.cardCta,children:"â /diagnostics"})]}),t.jsxs(Ae,{to:"/jona",className:O.card,"data-testid":"card-jona-graph",children:[t.jsx("div",{className:O.cardKicker,children:"RESEARCH · KNOWLEDGE GRAPH"}),t.jsx("div",{className:O.cardTitle,children:"JONA Research Graph"}
57),t.jsx("div",{className:O.cardBody,children:"Advisory DoE context windows, graph neighborhoods, and the quarantine/claim-receipt safety feed â the console-native JONA module as a full-width surface."}),t.jsx("div",{className:O.cardCta,children:"â /jona"})]}),t.jsxs(Ae,{to:"/flow",className:O.card,"data-testid":"card-jona-flow",children:[t.jsx("div",{className:O.cardKicker,children:"PRODUCTION · FLOW ADVISORY"}),t.jsx("div",{className:O.cardTitle,children:"JONA Flow"}),t.jsx("div",{className:O.cardBody,children:"Work-cell flow, constraint, DBR advisory â the six-cell microturbine network with queue/utilization state, buffer penetration, and operator disposition cards. Advisory only."}),t.jsx("div",{className:O.cardCta,children:"â /flow"})]}),t.jsxs(Ae,{to:"/jona/cockpit",className:O.card,"data-testid":"card-jona-cockpit",children:[t.jsx("div",{className:O.cardKicker,children:"RESEARCH · FULL APP"}),t.jsx("div",{className:O.cardTitle,children:"JONA Research Console"}),t.jsx("div",{className:O.cardBody,children:"The full JONA cockpit â agent session runtime, review queue, source-backed evidence, and project/run graph â embedded from the jona app gateway."}),t.jsx("div",{className:O.cardCta,children:"â /jona/cockpit"})]}),t.jsxs(Ae,{to:Wt(c),className:O.card,"data-testid":"card-operator-default",children:[t.jsx("div",{className:O.cardKicker,children:"OPERATIONS · default"}),t.jsx("div",{className:O.cardTitle,children:"Operator Console"}),t.jsxs("div",{className:O.cardBody,children:[t.jsx("strong",{children:On[c]})," â"," ",km[c]]}),t.jsxs("div",{className:O.cardCta,children:["â ",Wt(c)]})]})]}),r.length>1&&t.jsxs("div",{className:O.altRow,children:[t.jsx("div",{className:O.altLabel,children:"Other permitted roles"}),t.jsx("div",{className:O.altCards,children:r.slice(1).map(l=>t.jsxs(Ae,{to:Wt(l),className:O.altCard,"data-testid":`card-role-${l}`,children:[t.jsx("span",{className:O.altTitle,children:On[l]}),t.jsx("span",{className:O.altRoute,children:Wt(l)})]},l))})]})]}),t.jsx("footer",{className:O.footer,children:"ARCNET CONSOLE v1.0.0 · domain restricted"})]})}function Tm(e){return Am(Yt(e))}function Am(e){switch(e[0]){case"ornl-metallurgist":return"cto-metallurgist";case"arc-operator":return"operator-demo";case"node-site-manager":return"site-redacted";default:return"denied"}}function vs(e){switch(e){case"cto-metallurgist":return"full-demo";case"operator-demo":return"class-language";case"site-redacted":return"site-redacted";case"denied":return"denied"}}function Lm(e){return e==="cto-metallurgist"||e==="operator-demo"}const Om=oi(()=>import("./maplibre-BOGZE8_b.js").then(e=>e.m),__vite__mapDeps([0,1])),$m=h.forwardRef(function(n,a){return Jr(n,a,Om)}),$n=[-84.2696,35.9311],Mm="_container_i0f5d_5",Dm="_scenarioHud_i0f5d_29",Bm="_tokenHud_i0f5d_30",Fm="_correctionCallout_i0f5d_31",qm="_legendPanel_i0f5d_32",Hm="_bootOverlay_i0f5d_33",Wm="_hudKicker_i0f5d_59",Gm="_scenarioMeta_i0f5d_86",Um="_selectionLine_i0f5d_91",zm="_canvasLegendTitle_i0f5d_159",Vm="_dotProduction_i0f5d_164",Jm="_dotHub_i0f5d_165",Km="_dotCorrection_i0f5d_166",Ym="_tooltip_i0f5d_431",Qm="_tooltipTitle_i0f5d_442",Zm="_tooltipRow_i0f5d_451",Ie={container:Mm,scenarioHud:Dm,tokenHud:Bm,correctionCallout:Fm,legendPanel:qm,bootOverlay:Hm,hudKicker:Wm,scenarioMeta:Gm,selectionLine:Um,canvasLegendTitle:zm,dotProduction:Vm,dotHub:Jm,dotCorrection:Km,tooltip:Ym,tooltipTitle:Qm,tooltipRow:Zm},Xm=new Kr({id:"map"}),ep={version:8,sources:{cartoDark:{type:"raster",tiles:["https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png","https://b.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png","https://c.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png","https://d.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"],tileSize:256,attribution:"OpenStreetMap contributors, CARTO"}},layers:[{id:"carto-dark-base",type:"raster",source:"cartoDark",minzoom:0,maxzoom:19,paint:{"raster-opacity":.82,"raster-saturation":-.35,"raster-contrast":.12}}]},tp={"ornl-hub":[240,110,240],"regional-hub":[255,175,55],production:[0,212,255],"test-qualification":[240,220,60],scout:[60,220,160]},np={"connected-normal":1,"connected-degraded":.55,"disconnected-local":.25};function ap(e){return e?e instanceof Date?e:new Date(e):new Date(0)}function sp(e){const n=ap(e);if(n.getTime()===0||Number.isNaN(n.getTime()))return"--";const a=Math.max(0,Math.floor((Date.now()-n.getTime())/1e3));if(a<60)return`${a}s`;const s=Math.floor(a/60);return s<60?`${s}m`:`${Math.floor(s/60)}h`}function Mn(e,n=2){if(!e)return"pending";const a=e.split("-");return a.length>n?a.slice(-n).join("-"):e}function ip(e){return e?e.status.replace(/-/g," "):"pending"}function Mi(){const e=x(p=>Object.values(p.nodes)),n=x(p=>p.viewState),a=x(p=>
57p.setViewState),s=x(p=>p.selectNode),i=x(p=>p.selectedNodeId),r=x(p=>p.recentProcessStates.slice(0,8)),c=x(p=>p.recentProcessStates[0]),o=x(p=>p.recentCorrectionOutcomes[0]),d=x(p=>Object.values(p.nodes).find(f=>f.tokenHeld)),[l,g]=h.useState(null),u=h.useMemo(()=>e.find(p=>p.id===i),[e,i]),_=h.useMemo(()=>({...n}),[n]),m=h.useCallback(({viewState:p})=>{a(p)},[a]),v=h.useMemo(()=>{const p=[{name:"ORNL Scientific Hub",position:$n}],b=e.filter(N=>N.networkMode==="connected-normal").map(N=>({source:$n,target:N.position})),w=d?[{source:d.position,target:$n}]:[],j=new Map(e.map(N=>[N.id,N])),C=r.map((N,T)=>{const R=j.get(N.nodeId);return R?{processState:N,position:R.position,index:T}:null}).filter(N=>!!N);return[new Da({id:"downlink",data:b,getSourcePosition:N=>N.source,getTargetPosition:N=>N.target,getSourceColor:[240,110,240,160],getTargetColor:[0,212,255,160],getWidth:2}),new Da({id:"uplink",data:w,getSourcePosition:N=>N.source,getTargetPosition:N=>N.target,getSourceColor:[0,255,170,230],getTargetColor:[240,110,240,230],getWidth:3}),new Qt({id:"ornl-hub",data:p,getPosition:N=>N.position,getRadius:55e3,getFillColor:[240,110,240,220],stroked:!0,lineWidthMinPixels:2,getLineColor:[255,255,255,255]}),new Qt({id:"nodes",data:e,getPosition:N=>N.position,getRadius:N=>N.class==="regional-hub"?45e3:N.class==="production"?3e4:22e3,getFillColor:N=>{const[T,R,E]=tp[N.class],A=Math.round(255*np[N.networkMode]);return[T,R,E,A]},stroked:!0,lineWidthMinPixels:1,getLineColor:N=>i===N.id?[255,255,255,255]:N.tokenHeld?[255,200,0,255]:[40,40,40,200],pickable:!0,onClick:N=>{const T=N.object;T&&s(T.id)},onHover:N=>{const T=N.object;g(T?{node:T,x:N.x??0,y:N.y??0}:null)}}),new Qt({id:"selected-node-halo",data:u?[u]:[],getPosition:N=>N.position,getRadius:78e3,getFillColor:[0,212,255,24],stroked:!0,lineWidthMinPixels:2,getLineColor:[0,212,255,230]}),new Qt({id:"correction-pulses",data:C,getPosition:N=>N.position,getRadius:N=>52e3+(7-Math.min(N.index,7))*4500,getFillColor:N=>[255,170,0,Math.max(28,132-N.index*14)],stroked:!0,lineWidthMinPixels:1,getLineColor:N=>[255,190,60,Math.max(70,220-N.index*18)]})]},[e,d,i,u,r,s]);return t.jsxs("div",{className:Ie.container,children:[t.jsx("div",{style:{position:"absolute",inset:0},children:t.jsx(Yr,{views:Xm,viewState:_,controller:!0,onViewStateChange:m,layers:v,children:t.jsx($m,{reuseMaps:!0,attributionControl:!1,mapStyle:ep})})}),e.length===0&&t.jsxs("div",{className:Ie.bootOverlay,children:[t.jsx("span",{children:"BOOTING ALPHA FLEET"}),t.jsx("small",{children:"loading node class map / correction telemetry"})]}),t.jsxs("div",{className:Ie.scenarioHud,children:[t.jsx("span",{className:Ie.hudKicker,children:"ORNL PRESENTATION RUN"}),t.jsx("strong",{children:"ORNL-linked manufacturing control map"}),t.jsxs("span",{className:Ie.scenarioMeta,children:["Knoxville hub · ",e.length," city nodes · ",r.length," recent correction pulses"]}),t.jsxs("span",{className:Ie.selectionLine,children:["Selected node · ",u?Mn(u.id,3):"none"]})]}),t.jsxs("div",{className:Ie.tokenHud,children:[t.jsx("span",{children:"Token holder"}),t.jsx("strong",{children:Mn(d?.id,3)})]}),t.jsxs("div",{className:Ie.correctionCallout,children:[t.jsx("span",{children:"Latest correction"}),t.jsx("strong",{children:Mn(c?.equipmentId,3)}),t.jsxs("small",{children:[ip(o)," · ",sp(o?.measuredAt??c?.observedAt)," ago"]})]}),t.jsxs("div",{className:Ie.legendPanel,children:[t.jsx("span",{className:Ie.canvasLegendTitle,children:"Canvas legend"}),t.jsxs("span",{children:[t.jsx("i",{className:Ie.dotProduction})," Production node"]}
57),t.jsxs("span",{children:[t.jsx("i",{className:Ie.dotHub})," ORNL hub"]}),t.jsxs("span",{children:[t.jsx("i",{className:Ie.dotCorrection})," Recent correction"]})]}),l&&t.jsxs("div",{className:Ie.tooltip,style:{left:(l.x??0)+12,top:(l.y??0)+12},children:[t.jsx("div",{className:Ie.tooltipTitle,children:l.node.id}),t.jsxs("div",{className:Ie.tooltipRow,children:["class: ",l.node.class]}),t.jsxs("div",{className:Ie.tooltipRow,children:["mode: ",l.node.networkMode]}),l.node.tokenHeld&&t.jsx("div",{className:Ie.tooltipRow,children:"â holds token"}),t.jsxs("div",{className:Ie.tooltipRow,children:["attestation: ",l.node.attestationFresh?"â fresh":"â stale"]})]})]})}const rp=2,op="arcnet-pacific-greenfield-omniverse-demo",cp="PACIFIC-GREENFIELD",lp="PGF-HUB-001",dp="Stages/pacific_greenfield.usda",up="omniverse://arcnet/pacific-greenfield/project/Stages/pacific_greenfield.usda",mp={defaultPrim:"World",upAxis:"Z",metersPerUnit:.001},pp=["Materials/MaterialLibrary.usda","Assemblies/FacilityBase.usda","Assemblies/EquipmentAssembly.usda","Assemblies/RouteOverlay.usda","Waypoints/GreenfieldWaypoints.usda","Assemblies/LiveDemoAnnotations.usda"],hp=[{id:"m_powder_floor",label:"Powder-safe floor",diffuseColor:[.05,.23,.18],emissiveColor:[0,0,0]},{id:"m_additive_floor",label:"Additive-zone floor",diffuseColor:[.02,.18,.26],emissiveColor:[0,0,0]},{id:"m_thermal_floor",label:"Thermal-zone floor",diffuseColor:[.28,.16,.03],emissiveColor:[0,0,0]},{id:"m_post_floor",label:"Post-process floor",diffuseColor:[.18,.12,.28],emissiveColor:[0,0,0]},{id:"m_inspection_floor",label:"Inspection floor",diffuseColor:[.04,.25,.13],emissiveColor:[0,0,0]},{id:"m_edge_floor",label:"Secure-edge floor",diffuseColor:[.28,.06,.14],emissiveColor:[0,0,0]},{id:"m_machine_shell",label:"Machine shell",diffuseColor:[.38,.46,.48],emissiveColor:[0,0,0]},{id:"m_thermal_machine",label:"Thermal machine shell",diffuseColor:[.46,.32,.18],emissiveColor:[0,0,0]},{id:"m_coating_cell",label:"Coating-cell shell",diffuseColor:[.34,.25,.45],emissiveColor:[0,0,0]},{id:"m_inspection_machine",label:"Inspection machine shell",diffuseColor:[.27,.44,.38],emissiveColor:[0,0,0]},{id:"m_sensor_mount",label:"Sensor mount",diffuseColor:[.12,.24,.28],emissiveColor:[0,.16,.18]},{id:"m_edge_compute",label:"Secure edge compute",diffuseColor:[.18,.22,.28],emissiveColor:[0,.12,.2]},{id:"m_safety_yellow",label:"Safety marking",diffuseColor:[.95,.64,.04],emissiveColor:[.15,.08,0]},{id:"m_service_tile",label:"Service floor tile",diffuseColor:[.16,.18,.18],emissiveColor:[0,0,0]},{id:"m_emissive_cyan",label:"Cyan status emission",diffuseColor:[0,.45,.55],emissiveColor:[0,.85,.95]},{id:"m_emissive_green",label:"Green status emission",diffuseColor:[0,.36,.16],emissiveColor:[0,.9,.24]},{id:"m_route_active",label:"Active route overlay",diffuseColor:[0,.82,1],emissiveColor:[0,.82,1]},{id:"m_route_idle",label:"Idle route overlay",diffuseColor:[.12,.22,.22],emissiveColor:[0,0,0]},{id:"m_glass",label:"Inspection glass",diffuseColor:[.42,.68,.76],emissiveColor:[0,0,0]},{id:"m_cable",label:"Cable tray",diffuseColor:[.05,.05,.05],emissiveColor:[0,0,0]}],fp=[{id:"powder",label:"Powder Conditioning",materialId:"m_powder_floor",gridColumn:1,gridRow:1,gridWidth:6,gridHeight:7},{id:"additive",label:"Binder Jet Room",materialId:"m_additive_floor",gridColumn:7,gridRow:1,gridWidth:6,gridHeight:15},{id:"thermal",label:"Thermal Processing",materialId:"m_thermal_floor",gridColumn:13,gridRow:1,gridWidth:12,gridHeight:17},{id:"post",label:"Post Processing",materialId:"m_post_floor",gridColumn:1,gridRow:13,gridWidth:13,gridHeight:6},{id:"inspection",label:"Inspection",materialId:"m_inspection_floor",gridColumn:22,gridRow:1,gridWidth:9,gridHeight:12},{id:"edge",label:"Secure Edge",materialId:"m_edge_floor",gridColumn:24,gridRow:13,gridWidth:7,gridHeight:6}],gp=[{assetId:"powder-conditioning",label:"Powder conditioning",category:"materials-processing",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/PowderConditioning",sourceReference:"../Assets/Machines/powder_conditioning.usda",materialId:"m_machine_shell",floor:{zoneId:"powder",gridColumn:2,gridRow:2,gridWidth:4,gridHeight:4},placementMm:{x:500,y:500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"powder-conditioning","arcnet:equipmentId":"PGF-POWDER-01","arcnet:zoneId":"powder","arcnet:routeStep":"powder-ingest","arcnet:machineClass":"materials-processing","arcnet:safetyEnvelope":"sealed handling cell","arcnet:telemetryPolicy":"evidence-only","arcnet:evidenceRole":"evidence-bearing","arcnet:capacityUnitsPerDay":24,"arcnet:maintenanceClass":"weekly-clean"}},{assetId:"manifest-gate",label:"Manifest gate",category:"security",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/ManifestGate",sourceReference:"../Assets/Factory/manifest_gate.usda",materialId:"m_emissive_cyan",floor:{zoneId:"edge",gridColumn:26,gridRow:2,gridWidth:3,gridHeight:3},placementMm:{x:12500,y:500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"manifest-gate","arcnet:equipmentId":"PGF-ZT-GATE-01","arcnet:zoneId":"edge","arcnet:routeStep":"powder-ingest","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"signed manifest boundary","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"policy-managed"}},{assetId:"printer-bank-a",label:"Binder jet bank A",category:"manufacturing-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/PrinterBankA",sourceReference:"../Assets/Machines/binder_jet_bank.usda",materialId:"m_machine_shell",floor:{zoneId:"additive",gridColumn:7,gridRow:2,gridWidth:5,gridHeight:6},placementMm:{x:3e3,y:500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"printer-bank-a","arcnet:equipmentId":"PGF-BJ-A","arcnet:zoneId":"additive","arcnet:routeStep":"binder-jet","arcnet:machineClass":"additive-binder-jet","arcnet:safetyEnvelope":"front clearance locked","arcnet:telemetryPolicy":"anomaly-only","arcnet:evidenceRole":"control-bearing","arcnet:capacityUnitsPerDay":10,"arcnet:maintenanceClass":"daily-powder-path"}},{assetId:"printer-bank-b",label:"Binder jet bank B",category:"manufacturing-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/PrinterBankB",sourceReference:"../Assets/Machines/binder_jet_bank.usda",materialId:"m_machine_shell",floor:{zoneId:"additive",gridColumn:7,gridRow:9,gridWidth:5,gridHeight:6},placementMm:{x:3e3,y:4e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"printer-bank-b","arcnet:equipmentId":"PGF-BJ-B","arcnet:zoneId":"additive","arcnet:routeStep":"binder-jet","arcnet:machineClass":"additive-binder-jet","arcnet:safetyEnvelope":"front clearance locked","arcnet:telemetryPolicy":"anomaly-only","arcnet:evidenceRole":"control-bearing","arcnet:capacityUnitsPerDay":10,"arcnet:maintenanceClass":"daily-powder-path"}},{assetId:"debind-cell",label:"Debind cell",category:"manufacturing-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/DebindCell",sourceReference:"../Assets/Machines/debind_cell.usda",materialId:"m_machine_shell",floor:{zoneId:"thermal",gridColumn:13,gridRow:2,gridWidth:4,gridHeight:4},placementMm:{x:6e3,y:500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"debind-cell","arcnet:equipmentId":"PGF-DEBIND-01","arcnet:zoneId":"thermal","arcnet:routeStep":"debind","arcnet:machineClass":"thermal-processing","arcnet:safetyEnvelope":"local exh
57aust envelope","arcnet:telemetryPolicy":"sketched","arcnet:evidenceRole":"evidence-bearing","arcnet:capacityUnitsPerDay":12,"arcnet:maintenanceClass":"weekly-thermal"}},{assetId:"sinter-furnace",label:"Vacuum sinter",category:"manufacturing-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/SinterFurnace",sourceReference:"../Assets/Machines/vacuum_sinter_furnace.usda",materialId:"m_thermal_machine",floor:{zoneId:"thermal",gridColumn:15,gridRow:7,gridWidth:5,gridHeight:5},placementMm:{x:7e3,y:3e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"sinter-furnace","arcnet:equipmentId":"PGF-SINTER-01","arcnet:zoneId":"thermal","arcnet:routeStep":"sinter","arcnet:machineClass":"sintering-furnace","arcnet:safetyEnvelope":"two-tile thermal perimeter","arcnet:telemetryPolicy":"anomaly-only","arcnet:evidenceRole":"control-bearing","arcnet:capacityUnitsPerDay":8,"arcnet:maintenanceClass":"thermal-critical"}},{assetId:"ae-array",label:"AE sensor array",category:"sensor",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Sensors/AeArray",sourceReference:"../Assets/Sensors/ae_sensor_array.usda",materialId:"m_sensor_mount",floor:{zoneId:"thermal",gridColumn:20,gridRow:7,gridWidth:2,gridHeight:3},placementMm:{x:9500,y:3e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"ae-array","arcnet:equipmentId":"PGF-AE-01","arcnet:zoneId":"thermal","arcnet:routeStep":"sinter","arcnet:machineClass":"sensor","arcnet:safetyEnvelope":"read-only sensor anchor","arcnet:telemetryPolicy":"anomaly-only","arcnet:evidenceRole":"control-bearing","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"calibration-monthly"}},{assetId:"hip-cell",label:"HIP cell",category:"manufacturing-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/HipCell",sourceReference:"../Assets/Machines/hip_cell.usda",materialId:"m_thermal_machine",floor:{zoneId:"thermal",gridColumn:15,gridRow:13,gridWidth:5,gridHeight:4},placementMm:{x:7e3,y:6e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"hip-cell","arcnet:equipmentId":"PGF-HIP-01","arcnet:zoneId":"thermal","arcnet:routeStep":"hip-age","arcnet:machineClass":"hip","arcnet:safetyEnvelope":"pressure vessel exclusion zone","arcnet:telemetryPolicy":"anomaly-only","arcnet:evidenceRole":"control-bearing","arcnet:capacityUnitsPerDay":8,"arcnet:maintenanceClass":"pressure-critical"}},{assetId:"ageing-cell",label:"Ageing furnace",category:"manufacturing-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/AgeingCell",sourceReference:"../Assets/Machines/ageing_furnace.usda",materialId:"m_thermal_machine",floor:{zoneId:"thermal",gridColumn:21,gridRow:13,gridWidth:4,gridHeight:4},placementMm:{x:1e4,y:6e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"ageing-cell","arcnet:equipmentId":"PGF-AGE-01","arcnet:zoneId":"thermal","arcnet:routeStep":"hip-age","arcnet:machineClass":"thermal-processing","arcnet:safetyEnvelope":"thermal perimeter","arcnet:telemetryPolicy":"sketched","arcnet:evidenceRole":"control-bearing","arcnet:capacityUnitsPerDay":8,"arcnet:maintenanceClass":"weekly-thermal"}},{assetId:"cnc-cell",label:"CNC finish",category:"manufacturing-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/CncCell",sourceReference:"../Assets/Machines/cnc_finish_cell.usda",materialId:"m_machine_shell",floor:{zoneId:"post",gridColumn:2,gridRow:14,gridWidth:5,gridHeight:4},placementMm:{x:500,y:6500,z:0,rotationDeg:90},metadata:{"arcnet:assetId":"cnc-cell","arcnet:equipmentId":"PGF-CNC-01","arcnet:zoneId":"post","arcnet:routeStep":"cnc-finish","arcnet:machineClass":"subtractive","arcnet:safetyEnvelope":"guarded work envelope","arcnet:telemetryPolicy":"sketched","arcnet:evidenceRole":"evidence-bearing","arcnet:capacityUnitsPerDay":10,"arcnet:maintenanceClass":"weekly-axis-check"}},{assetId:"coating-cell",label:"Coating cell",category:"manufacturing-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/CoatingCell",sourceReference:"../Assets/Machines/coating_cell.usda",materialId:"m_coating_cell",floor:{zoneId:"post",gridColumn:8,gridRow:14,gridWidth:5,gridHeight:4},placementMm:{x:3500,y:6500,z:0,rotationDeg:90},metadata:{"arcnet:assetId":"coating-cell","arcnet:equipmentId":"PGF-COAT-01","arcnet:zoneId":"post","arcnet:routeStep":"coating","arcnet:machineClass":"coating","arcnet:safetyEnvelope":"robotic spray envelope","arcnet:telemetryPolicy":"sketched","arcnet:evidenceRole":"evidence-bearing","arcnet:capacityUnitsPerDay":10,"arcnet:maintenanceClass":"daily-nozzle-check"}},{assetId:"nde-cell",label:"NDE cell",category:"inspection-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/NdeCell",sourceReference:"../Assets/Machines/nde_cell.usda",materialId:"m_inspection_machine",floor:{zoneId:"inspection",gridColumn:22,gridRow:2,gridWidth:4,gridHeight:4},placementMm:{x:10500,y:500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"nde-cell","arcnet:equipmentId":"PGF-NDE-01","arcnet:zoneId":"inspection","arcnet:routeStep":"nde-ct","arcnet:machineClass":"materials-processing","arcnet:safetyEnvelope":"inspection enclosure","arcnet:telemetryPolicy":"sketched","arcnet:evidenceRole":"evidence-bearing","arcnet:capacityUnitsPerDay":16,"arcnet:maintenanceClass":"calibration-weekly"}},{assetId:"ct-cell",label:"CT cell",category:"inspection-equipment",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/CtCell",sourceReference:"../Assets/Machines/ct_cell.usda",materialId:"m_inspection_machine",floor:{zoneId:"inspection",gridColumn:26,gridRow:6,gridWidth:4,gridHeight:4},placementMm:{x:12500,y:2500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"ct-cell","arcnet:equipmentId":"PGF-CT-01","arcnet:zoneId":"inspection","arcnet:routeStep":"nde-ct","arcnet:machineClass":"materials-processing","arcnet:safetyEnvelope":"radiation interlock envelope","arcnet:telemetryPolicy":"sketched","arcnet:evidenceRole":"evidence-bearing","arcnet:capacityUnitsPerDay":12,"arcnet:maintenanceClass":"calibration-weekly"}},{assetId:"metropolis-camera-grid",label:"Vision AI grid",category:"sensor",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Sensors/MetropolisCameraGrid",sourceReference:"../Assets/Sensors/vision_camera_grid.usda",materialId:"m_sensor_mount",floor:{zoneId:"inspection",gridColumn:22,gridRow:11,gridWidth:3,gridHeight:3},placementMm:{x:10500,y:5e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"metropolis-camera-grid","arcnet:equipmentId":"PGF-VISION-01","arcnet:zoneId":"inspection","arcnet:routeStep":"nde-ct","arcnet:machineClass":"sensor","arcnet:safetyEnvelope":"read-only sensor anchor","arcnet:telemetryPolicy":"anomaly-only","arcnet:evidenceRole":"learning-bearing","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"calibration-monthly"}},{assetId:"edge-hpc-rack",label:"Secure edge HPC",category:"edge-compute",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/EdgeHpcRack",sourceReference:"../Assets/Factory/edge_hpc_rack.usda",materialId:"m_edge_compute",floor:{zoneId:"edge",gridColumn:27,gridRow:14,gridWidth:3,gridHeight:3},placementMm:{x:13e3,y:6500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"edge-hpc-rack","arcnet:equipmentId":"PGF-EDGE-01","arcnet:zoneId":"edge","arcnet:routeStep":"sinter","arcnet:machineClass":"edge-hpc","arcnet:safetyEnvelope":"SCIF boundary","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"control-bearing","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"secured-ops"}},{assetId:"evidence-ledger",label:"Evidence ledger",category:"edge-compute",kind:"component",instanceable:!1,primPath:"/World/PacificGreenfield/Equipment/Machines/Evidence
57Ledger",sourceReference:"../Assets/Factory/evidence_ledger.usda",materialId:"m_emissive_green",floor:{zoneId:"edge",gridColumn:24,gridRow:15,gridWidth:2,gridHeight:2},placementMm:{x:11500,y:7e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"evidence-ledger","arcnet:equipmentId":"PGF-EVIDENCE-01","arcnet:zoneId":"edge","arcnet:routeStep":"evidence-seal","arcnet:machineClass":"edge-hpc","arcnet:safetyEnvelope":"sealed audit boundary","arcnet:telemetryPolicy":"evidence-only","arcnet:evidenceRole":"evidence-bearing","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"secured-ops"}}],_p=[{assetId:"barrier-thermal-01",label:"Safety barrier",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/BarrierThermal01",sourceReference:"../Assets/Props/safety_barrier.usda",materialId:"m_safety_yellow",floor:{zoneId:"thermal",gridColumn:14,gridRow:6,gridWidth:1,gridHeight:2},placementMm:{x:6500,y:2500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"barrier-thermal-01","arcnet:equipmentId":"BARRIER_THERMAL_01","arcnet:zoneId":"thermal","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"barrier-thermal-02",label:"Safety barrier",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/BarrierThermal02",sourceReference:"../Assets/Props/safety_barrier.usda",materialId:"m_safety_yellow",floor:{zoneId:"thermal",gridColumn:21,gridRow:6,gridWidth:1,gridHeight:2},placementMm:{x:1e4,y:2500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"barrier-thermal-02","arcnet:equipmentId":"BARRIER_THERMAL_02","arcnet:zoneId":"thermal","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"barrier-post-01",label:"Safety barrier",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/BarrierPost01",sourceReference:"../Assets/Props/safety_barrier.usda",materialId:"m_safety_yellow",floor:{zoneId:"post",gridColumn:7,gridRow:13,gridWidth:1,gridHeight:1},placementMm:{x:3e3,y:6e3,z:0,rotationDeg:90},metadata:{"arcnet:assetId":"barrier-post-01","arcnet:equipmentId":"BARRIER_POST_01","arcnet:zoneId":"post","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"barrier-inspection-01",label:"Safety barrier",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/BarrierInspection01",sourceReference:"../Assets/Props/safety_barrier.usda",materialId:"m_safety_yellow",floor:{zoneId:"inspection",gridColumn:21,gridRow:5,gridWidth:1,gridHeight:1},placementMm:{x:1e4,y:2e3,z:0,rotationDeg:90},metadata:{"arcnet:assetId":"barrier-inspection-01","arcnet:equipmentId":"BARRIER_INSPECTION_01","arcnet:zoneId":"inspection","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"sensor-mount-ae-01",label:"Sensor mount",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/SensorMountAe01",sourceReference:"../Assets/Props/sensor_mount.usda",materialId:"m_sensor_mount",floor:{zoneId:"thermal",gridColumn:19,gridRow:7,gridWidth:1,gridHeight:1},placementMm:{x:9e3,y:3e3,z:0,rotationDeg:0}
57,metadata:{"arcnet:assetId":"sensor-mount-ae-01","arcnet:equipmentId":"SENSOR_MOUNT_AE_01","arcnet:zoneId":"thermal","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"sensor-mount-vision-01",label:"Sensor mount",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/SensorMountVision01",sourceReference:"../Assets/Props/sensor_mount.usda",materialId:"m_sensor_mount",floor:{zoneId:"inspection",gridColumn:22,gridRow:10,gridWidth:1,gridHeight:1},placementMm:{x:10500,y:4500,z:0,rotationDeg:45},metadata:{"arcnet:assetId":"sensor-mount-vision-01","arcnet:equipmentId":"SENSOR_MOUNT_VISION_01","arcnet:zoneId":"inspection","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"sensor-mount-vision-02",label:"Sensor mount",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/SensorMountVision02",sourceReference:"../Assets/Props/sensor_mount.usda",materialId:"m_sensor_mount",floor:{zoneId:"inspection",gridColumn:25,gridRow:10,gridWidth:1,gridHeight:1},placementMm:{x:12e3,y:4500,z:0,rotationDeg:45},metadata:{"arcnet:assetId":"sensor-mount-vision-02","arcnet:equipmentId":"SENSOR_MOUNT_VISION_02","arcnet:zoneId":"inspection","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"tile-service-01",label:"Service floor tile",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/TileService01",sourceReference:"../Assets/Props/service_floor_tile.usda",materialId:"m_service_tile",floor:{zoneId:"additive",gridColumn:6,gridRow:2,gridWidth:1,gridHeight:1},placementMm:{x:2500,y:500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"tile-service-01","arcnet:equipmentId":"TILE_SERVICE_01","arcnet:zoneId":"additive","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"tile-service-02",label:"Service floor tile",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/TileService02",sourceReference:"../Assets/Props/service_floor_tile.usda",materialId:"m_service_tile",floor:{zoneId:"additive",gridColumn:6,gridRow:9,gridWidth:1,gridHeight:1},placementMm:{x:2500,y:4e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"tile-service-02","arcnet:equipmentId":"TILE_SERVICE_02","arcnet:zoneId":"additive","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"tile-service-03",label:"Service floor tile",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/TileService03",sourceReference:"../Assets/Props/service_floor_tile.usda",materialId:"m_service_tile",floor:{zoneId:"thermal",gridColumn:14,gridRow:12,gridWidth:1,gridHeight:1},placementMm:{x:6500,y:5500,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"tile-service-03","arcnet:equipmentId":"TILE_SERVICE_03","arcnet:zoneId":"thermal","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}},{assetId:"tile-service-04",label:"Service floor tile",category:"repeated-prop",kind:"component",instanceable:!0,primPath:"/World/PacificGreenfield/Equipment/RepeatedProps/TileService04",sourceReference:"../Assets/Props/service_floor_tile.usda",materialId:"m_service_tile",floor:{zoneId:"inspection",gridColumn:25,gridRow:5,gridWidth:1,gridHeight:1},placementMm:{x:12e3,y:2e3,z:0,rotationDeg:0},metadata:{"arcnet:assetId":"tile-service-04","arcnet:equipmentId":"TILE_SERVICE_04","arcnet:zoneId":"inspection","arcnet:routeStep":"facility-context","arcnet:machineClass":"safety","arcnet:safetyEnvelope":"facility support","arcnet:telemetryPolicy":"local-only","arcnet:evidenceRole":"visual-context","arcnet:capacityUnitsPerDay":0,"arcnet:maintenanceClass":"facility-support"}}],yp=[{id:"theater-entry",label:"Theater entry",note:"ARCNet theater map handoff into Pacific Greenfield",primName:"WaypointTheaterEntry",position:[18e3,24e3,16e3],target:[12e3,7e3,0],fovDegrees:44,primPath:"/World/PacificGreenfield/Waypoints/WaypointTheaterEntry"},{id:"site-overview",label:"Full floor overview",note:"Pacific Greenfield regional hub floor overview",primName:"WaypointSiteOverview",position:[18e3,22e3,18e3],target:[12e3,7e3,0],fovDegrees:44,primPath:"/World/PacificGreenfield/Waypoints/WaypointSiteOverview"},{id:"print-bank",label:"Print bank",note:"Binder jet room and signed manifest ingress",primName:"WaypointPrintBank",position:[7e3,14e3,8e3],target:[8e3,8e3,0],fovDegrees:38,primPath:"/World/PacificGreenfield/Waypoints/WaypointPrintBank"}
57,{id:"sinter-cell",label:"Sinter autonomy event",note:"ARC Signal spike, surrogate prediction, ramp halt",primName:"WaypointSinterAutonomy",position:[17e3,12e3,7e3],target:[17e3,6e3,0],fovDegrees:34,primPath:"/World/PacificGreenfield/Waypoints/WaypointSinterAutonomy"},{id:"hip-age",label:"HIP and ageing",note:"Thermal processing and ageing control envelope",primName:"WaypointHipAgeing",position:[21e3,16e3,9e3],target:[18500,14e3,0],fovDegrees:36,primPath:"/World/PacificGreenfield/Waypoints/WaypointHipAgeing"},{id:"coating",label:"Coating",note:"Class-language coating capability demonstration",primName:"WaypointCoating",position:[9e3,18e3,8500],target:[8e3,14e3,0],fovDegrees:36,primPath:"/World/PacificGreenfield/Waypoints/WaypointCoating"},{id:"inspection-cell",label:"NDE / CT",note:"Inspection and synthetic sensor views",primName:"WaypointInspection",position:[24e3,12e3,9e3],target:[23500,7e3,0],fovDegrees:36,primPath:"/World/PacificGreenfield/Waypoints/WaypointInspection"},{id:"evidence-seal",label:"Evidence preview",note:"Capability demonstration evidence preview",primName:"WaypointEvidenceSeal",position:[27e3,17e3,9e3],target:[25e3,15e3,0],fovDegrees:36,primPath:"/World/PacificGreenfield/Waypoints/WaypointEvidenceSeal"},{id:"operator-gate",label:"Policy gate branch",note:"Visual hold-resume operator preview path",primName:"WaypointOperatorGate",position:[21e3,18e3,11e3],target:[18e3,8e3,0],fovDegrees:40,primPath:"/World/PacificGreenfield/Waypoints/WaypointOperatorGate"}],vp=[{id:"powder-ingest",ordinal:1,label:"Powder ingest",assetIds:["powder-conditioning","manifest-gate"],waypointId:"site-overview",overlayPrimName:"RoutePowderIngest",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RoutePowderIngest",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusPowderIngest",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/PowderConditioning","/World/PacificGreenfield/Equipment/Machines/ManifestGate"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointSiteOverview"},{id:"binder-jet",ordinal:2,label:"Binder jet",assetIds:["printer-bank-a","printer-bank-b"],waypointId:"print-bank",overlayPrimName:"RouteBinderJet",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteBinderJet",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusBinderJet",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/PrinterBankA","/World/PacificGreenfield/Equipment/Machines/PrinterBankB"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointPrintBank"},{id:"debind",ordinal:3,label:"Debind",assetIds:["debind-cell"],waypointId:"print-bank",overlayPrimName:"RouteDebind",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteDebind",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusDebind",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/DebindCell"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointPrintBank"},{id:"sinter",ordinal:4,label:"Sinter",assetIds:["sinter-furnace","ae-array","edge-hpc-rack"],waypointId:"sinter-cell",overlayPrimName:"RouteSinter",autonomyEvent:"ARC Signal ramp halt",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteSinter",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusSinter",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/SinterFurnace","/World/PacificGreenfield/Equipment/Sensors/AeArray","/World/PacificGreenfield/Equipment/Machines/EdgeHpcRack"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointSinterAutonomy"},{id:"hip-age",ordinal:5,label:"HIP and ageing",assetIds:["hip-cell","ageing-cell"],waypointId:"hip-age",overlayPrimName:"RouteHipAge",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteHipAge",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusHipAge",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/HipCell","/World/PacificGreenfield/Equipment/Machines/AgeingCell"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointHipAgeing"},{id:"cnc-finish",ordinal:6,label:"CNC finish",assetIds:["cnc-cell"],waypointId:"operator-gate",overlayPrimName:"RouteCncFinish",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteCncFinish",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusCncFinish",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/CncCell"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointOperatorGate"},{id:"coating",ordinal:7,label:"Coating",assetIds:["coating-cell"],waypointId:"coating",overlayPrimName:"RouteCoating",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteCoating",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusCoating",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/CoatingCell"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointCoating"},{id:"nde-ct",ordinal:8,label:"NDE / CT",assetIds:["nde-cell","ct-cell","metropolis-camera-grid"],waypointId:"inspection-cell",overlayPrimName:"RouteNdeCt",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteNdeCt",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusNdeCt",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/NdeCell","/World/PacificGreenfield/Equipment/Machines/CtCell","/World/PacificGreenfield/Equipment/Sensors/MetropolisCameraGrid"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointInspection"},{id:"evidence-seal",ordinal:9,label:"Evidence preview",assetIds:["edge-hpc-rack","evidence-ledger"],waypointId:"evidence-seal",overlayPrimName:"RouteEvidenceSeal",overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteEvidenceSeal",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusEv
57idenceSeal",assetPrimPaths:["/World/PacificGreenfield/Equipment/Machines/EdgeHpcRack","/World/PacificGreenfield/Equipment/Machines/EvidenceLedger"],waypointPrimPath:"/World/PacificGreenfield/Waypoints/WaypointEvidenceSeal"}],bp=[{id:"route-powder-ingest",routeStepId:"powder-ingest",primPath:"/World/PacificGreenfield/RouteOverlays/RoutePowderIngest",overlayKind:"route"},{id:"status-powder-ingest",routeStepId:"powder-ingest",primPath:"/World/PacificGreenfield/StatusOverlays/StatusPowderIngest",overlayKind:"status"},{id:"route-binder-jet",routeStepId:"binder-jet",primPath:"/World/PacificGreenfield/RouteOverlays/RouteBinderJet",overlayKind:"route"},{id:"status-binder-jet",routeStepId:"binder-jet",primPath:"/World/PacificGreenfield/StatusOverlays/StatusBinderJet",overlayKind:"status"},{id:"route-debind",routeStepId:"debind",primPath:"/World/PacificGreenfield/RouteOverlays/RouteDebind",overlayKind:"route"},{id:"status-debind",routeStepId:"debind",primPath:"/World/PacificGreenfield/StatusOverlays/StatusDebind",overlayKind:"status"},{id:"route-sinter",routeStepId:"sinter",primPath:"/World/PacificGreenfield/RouteOverlays/RouteSinter",overlayKind:"route"},{id:"status-sinter",routeStepId:"sinter",primPath:"/World/PacificGreenfield/StatusOverlays/StatusSinter",overlayKind:"status"},{id:"route-hip-age",routeStepId:"hip-age",primPath:"/World/PacificGreenfield/RouteOverlays/RouteHipAge",overlayKind:"route"},{id:"status-hip-age",routeStepId:"hip-age",primPath:"/World/PacificGreenfield/StatusOverlays/StatusHipAge",overlayKind:"status"},{id:"route-cnc-finish",routeStepId:"cnc-finish",primPath:"/World/PacificGreenfield/RouteOverlays/RouteCncFinish",overlayKind:"route"},{id:"status-cnc-finish",routeStepId:"cnc-finish",primPath:"/World/PacificGreenfield/StatusOverlays/StatusCncFinish",overlayKind:"status"},{id:"route-coating",routeStepId:"coating",primPath:"/World/PacificGreenfield/RouteOverlays/RouteCoating",overlayKind:"route"},{id:"status-coating",routeStepId:"coating",primPath:"/World/PacificGreenfield/StatusOverlays/StatusCoating",overlayKind:"status"},{id:"route-nde-ct",routeStepId:"nde-ct",primPath:"/World/PacificGreenfield/RouteOverlays/RouteNdeCt",overlayKind:"route"},{id:"status-nde-ct",routeStepId:"nde-ct",primPath:"/World/PacificGreenfield/StatusOverlays/StatusNdeCt",overlayKind:"status"},{id:"route-evidence-seal",routeStepId:"evidence-seal",primPath:"/World/PacificGreenfield/RouteOverlays/RouteEvidenceSeal",overlayKind:"route"},{id:"status-evidence-seal",routeStepId:"evidence-seal",primPath:"/World/PacificGreenfield/StatusOverlays/StatusEvidenceSeal",overlayKind:"status"},{id:"evidence-preview",routeStepId:"evidence-seal",primPath:"/World/PacificGreenfield/LiveDemoAnnotations/CapabilityBoundary",overlayKind:"evidence-preview"}],jp=[{id:"cto-theater-entry",roleProjection:"cto-metallurgist",waypointId:"theater-entry",label:"Theater entry"},{id:"operator-theater-entry",roleProjection:"operator-demo",waypointId:"theater-entry",label:"Theater entry (class-language)"},{id:"cto-site-overview",roleProjection:"cto-metallurgist",waypointId:"site-overview",label:"Full floor overview"},{id:"operator-site-overview",roleProjection:"operator-demo",waypointId:"site-overview",label:"Full floor overview (class-language)"},{id:"cto-print-bank",roleProjection:"cto-metallurgist",waypointId:"print-bank",label:"Print bank"},{id:"operator-print-bank",roleProjection:"operator-demo",waypointId:"print-bank",label:"Print bank (class-language)"},{id:"cto-sinter-cell",roleProjection:"cto-metallurgist",waypointId:"sinter-cell",label:"Sinter autonomy event"},{id:"operator-sinter-cell",roleProjection:"operator-demo",waypointId:"sinter-cell",label:"Sinter autonomy event (class-language)"},{id:"cto-hip-age",roleProjection:"cto-metallurgist",waypointId:"hip-age",label:"HIP and ageing"},{id:"operator-hip-age",roleProjection:"operator-demo",waypointId:"hip-age",label:"HIP and ageing (class-language)"},{id:"cto-coating",roleProjection:"cto-metallurgist",waypointId:"coating",label:"Coating"},{id:"operator-coating",roleProjection:"operator-demo",waypointId:"coating",label:"Coating (class-language)"},{id:"cto-inspection-cell",roleProjection:"cto-metallurgist",waypointId:"inspection-cell",label:"NDE / CT"},{id:"operator-inspection-cell",roleProjection:"operator-demo",waypointId:"inspection-cell",label:"NDE / CT (class-language)"},{id:"cto-evidence-seal",roleProjection:"cto-metallurgist",waypointId:"evidence-seal",label:"Evidence preview"},{id:"operator-evidence-seal",roleProjection:"operator-demo",waypointId:"evidence-seal",label:"Evidence preview (class-language)"},{id:"cto-operator-gate",roleProjection:"cto-metallurgist",waypointId:"operator-gate",label:"Policy gate branch"},{id:"operator-operator-gate",roleProjection:"operator-demo",waypointId:"operator-gate",label:"Policy gate branch (class-language)"}],xp=[{routeStepId:"powder-ingest",assetIds:["powder-conditioning","manifest-gate"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RoutePowderIngest",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusPowderIngest",waypointId:"site-overview"},{routeStepId:"binder-jet",assetIds:["printer-bank-a","printer-bank-b"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteBinderJet",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusBinderJet",waypointId:"print-bank"},{routeStepId:"debind",assetIds:["debind-cell"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteDebind",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusDebind",waypointId:"print-bank"},{routeStepId:"sinter",assetIds:["sinter-furnace","ae-array","edge-hpc-rack"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteSinter",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusSinter",waypointId:"sinter-cell"},{routeStepId:"hip-age",assetIds:["hip-cell","ageing-cell"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteHipAge",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusHipAge",waypointId:"hip-age"},{routeStepId:"cnc-finish",assetIds:["cnc-cell"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteCncFinish",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusCncFinish",waypointId:"operator-gate"},{routeStepId:"coating",assetIds:["coating-cell"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteCoating",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusCoating",waypointId:"coating"},{routeStepId:"nde-ct",assetIds:["nde-cell","ct-cell","metropolis-camera-grid"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteNdeCt",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusNdeCt",waypointId:"inspection-cell"},{routeStepId:"evidence-seal",assetIds:["edge-hpc-rack","evidence-ledger"],overlayPrimPath:"/World/PacificGreenfield/RouteOverlays/RouteEvidenceSeal",statusPrimPath:"/World/PacificGreenfield/StatusOverlays/StatusEv
57idenceSeal",waypointId:"evidence-seal"}],Ip=[{id:"sinter-arc-signal-band",routeStepId:"sinter",assetId:"ae-array",sensorView:"arc-signal-band",redactionTag:"arc-signal-runtime"},{id:"nde-synthetic-vision",routeStepId:"nde-ct",assetId:"metropolis-camera-grid",sensorView:"synthetic-vision",redactionTag:"synthetic-inspection"},{id:"ct-preview",routeStepId:"nde-ct",assetId:"ct-cell",sensorView:"ct-preview",redactionTag:"inspection-preview"}],wp=[{tag:"arc-signal-runtime",minimumProjection:"cto-metallurgist",classLanguageLabel:"ARC Signal band"},{tag:"synthetic-inspection",minimumProjection:"operator-demo",classLanguageLabel:"Synthetic inspection view"},{tag:"inspection-preview",minimumProjection:"operator-demo",classLanguageLabel:"Inspection preview"}],Np={schemaVersion:rp,scenarioId:op,facilityId:cp,nodeId:lp,stagePath:dp,usdStageUrl:up,stageContract:mp,layers:pp,materials:hp,zones:fp,assets:gp,repeatedProps:_p,waypoints:yp,routeSteps:vp,runtimeOverlays:bp,demoWaypoints:jp,routePlaybackBindings:xp,sensorViewBindings:Ip,redactionTags:wp},Sp=[{facilityId:"ARC-IMPACT-BURLINGTON",explorerNodeId:"arc-impact-burlington",arcnetNodeId:"AIM-BUR-001",firstLightSiteId:"BURLINGTON",label:"ARC Impact Burlington Regional Node",address:"63 3rd Ave, Burlington, MA 01803",position:[-71.2275156,42.4883526],timezone:"America/New_York",mappingStage:"site-survey",mappingStatus:"pending",mappingProfilePath:"omniverse/live-sites/arc-impact-burlington/site_profile.json"},{facilityId:"ARC-IMPACT-NORTH-HUNTINGDON",explorerNodeId:"arc-impact-north-huntingdon",arcnetNodeId:"AIM-NHT-001",firstLightSiteId:"NORTH-HUNTINGDON",label:"ARC Impact North Huntingdon Regional Node",address:"127 Industry Dr, North Huntingdon, PA 15642",position:[-79.6770408,40.3176748],timezone:"America/New_York",mappingStage:"site-survey",mappingStatus:"pending",mappingProfilePath:"omniverse/live-sites/arc-impact-north-huntingdon/site_profile.json"}];function Cp(e){return Sp.find(n=>n.explorerNodeId===e)??null}function Rp(e){return`${e.mappingStage.replace(/-/g," ")} ${e.mappingStatus.replace(/-/g," ")}`}const Ke="pacific-greenfield",Ep=[{id:Ke,label:"Pacific Greenfield Regional Hub",shortLabel:"PGF",facilityId:"PACIFIC-GREENFIELD",nodeId:"PGF-HUB-001",nodeClass:"regional-hub",kind:"greenfield-regional-hub",address:"Pacific Greenfield internal demo facility",position:[-158.0702,21.3245],timezone:"Pacific/Honolulu",mapPosition:{x:14,y:48},twinReadiness:"operational-twin",phase4Role:"Composed OpenUSD operational twin for the hot-section microturbine route.",mission:"Low-human manufacturing route demonstration with visual-demo-only autonomy, policy gate, and evidence preview overlays.",capabilities:["OpenUSD facility layer stack","Omniverse Kit stream target","Route playback overlays","Capability demonstration evidence preview"],usdLayerStack:["base_facility","materials","equipment_references","route_overlays","runtime_demo_overlays","redaction_overlays"]},{id:"arc-impact-burlington",label:"ARC Impact Burlington Regional Node",shortLabel:"BOS",facilityId:"ARC-IMPACT-BURLINGTON",nodeId:"AIM-BUR-001",nodeClass:"regional-hub",kind:"arc-impact-regional-node",address:"63 3rd Ave, Burlington, MA 01803",position:[-71.2275156,42.4883526],timezone:"America/New_York",mapPosition:{x:78,y:26},twinReadiness:"asset-graph-preview",phase4Role:"Regional node asset-graph preview prepared for future CAD/BOM ingestion.",mission:"ARC Impact regional manufacturing node for asset catalog, route-capability discovery, and future facility-specific USD assembly.",capabilities:["Facility asset graph preview","Regional capacity profile placeholder","CAD/BOM data exchange target","Operator-safe capability rollup"],usdLayerStack:["base_facility_stub","cad_ingest_pending","asset_catalog","operations_overlay","redaction_overlay"]},{id:"arc-impact-north-huntingdon",label:"ARC Impact North Huntingdon Regional Node",shortLabel:"PIT",facilityId:"ARC-IMPACT-NORTH-HUNTINGDON",nodeId:"AIM-NHT-001",nodeClass:"regional-hub",kind:"arc-impact-regional-node",address:"127 Industry Dr, North Huntingdon, PA 15642",position:[-79.6770408,40.3176748],timezone:"America/Ne
57w_York",mapPosition:{x:67,y:43},twinReadiness:"asset-graph-preview",phase4Role:"Regional production node preview for composable USD facility onboarding.",mission:"ARC Impact regional node for production-line capability comparison, equipment intake, and future operations-overlay testing.",capabilities:["Route-capability matrix placeholder","Equipment intake manifest target","Regional readiness rollup","Future SimReady asset swap-in"],usdLayerStack:["base_facility_stub","equipment_references_pending","safety_envelopes_pending","operations_overlay","redaction_overlay"]},{id:"ornl-scientific-hub",label:"Oak Ridge National Lab Scientific Hub",shortLabel:"ORNL",facilityId:"ORNL-SCIENTIFIC-HUB",nodeId:"ORNL-SCI-001",nodeClass:"ornl-hub",kind:"scientific-hub",address:"2350 Cherahala Blvd, Knoxville, TN 37932",position:[-84.1530891,35.9563736],timezone:"America/New_York",mapPosition:{x:58,y:56},twinReadiness:"data-exchange-preview",phase4Role:"Scientific hub for model exchange, materials learning, and OpenUSD data-product validation.",mission:"Scientific backbone node for surrogate model review, materials data exchange, and facility-twin validation workflows.",capabilities:["Model and evidence arc source","Materials learning workspace preview","USD validation policy anchor","Scientific review role projection"],usdLayerStack:["model_exchange","materials_context","validation_rules","scientific_overlay","redaction_overlay"]},{id:"nps-test-qualification",label:"Naval Postgraduate School Test & Qual Node",shortLabel:"NPS",facilityId:"NPS-TEST-QUALIFICATION",nodeId:"NPS-TQ-001",nodeClass:"test-qualification",kind:"test-qualification-node",address:"7 Grace Hopper Ave, ST2 Monterey, California 93943",position:[-121.8547266,36.5927789],timezone:"America/Los_Angeles",mapPosition:{x:24,y:64},twinReadiness:"qualification-preview",phase4Role:"Test and qualification preview node with explicit non-qualification demo boundaries.",mission:"Test, evaluation, and qualification-path preview node for future evidence package review without creating qualification claims in the demo.",capabilities:["Test workflow preview","Qualification-path boundary label","Evidence preview review target","Role-redacted report surface"],usdLayerStack:["test_fixture_stub","inspection_context_pending","qualification_preview_overlay","evidence_preview_overlay","redaction_overlay"]}],kp=[{id:"ornl-to-greenfield-model",sourceNodeId:"ornl-scientific-hub",targetNodeId:Ke,label:"model exchange",kind:"model"},{id:"greenfield-to-nps-evidence-preview",sourceNodeId:Ke,targetNodeId:"nps-test-qualification",label:"evidence preview",kind:"evidence"},{id:"ornl-to-burlington-asset-graph",sourceNodeId:"ornl-scientific-hub",targetNodeId:"arc-impact-burlington",label:"asset graph",kind:"asset-graph"},{id:"ornl-to-north-huntingdon-asset-graph",sourceNodeId:"ornl-scientific-hub",targetNodeId:"arc-impact-north-huntingdon",label:"asset graph",kind:"asset-graph"},{id:"burlington-to-north-huntingdon-route",sourceNodeId:"arc-impact-burlington",targetNodeId:"arc-impact-north-huntingdon",label:"regional route",kind:"route"},{id:"nps-to-ornl-qualification-review",sourceNodeId:"nps-test-qualification",targetNodeId:"ornl-scientific-hub",label:"qualification review",kind:"qualification"}],Dn={stateClass:"thermal",role:"control-bearing",localRetention:"PT24H",uplinkReduction:"anomaly-only",evidenceBearing:!0,learningBearing:!0},yt={stateClass:"geometry",role:"evidence-bearing",localRetention:"P7D",uplinkReduction:"sketched",evidenceBearing:!0,learningBearing:!1},Pp={id:"arcnet-pacific-greenfield-omniverse-demo",name:"Pacific Greenfield Regional Hub",stage:"theater-map",regionalHubFacilityId:"PACIFIC-GREENFIELD",regionalHubNodeId:"PGF-HUB-001",regionalHubPosition:[-158.0702,21.3245],usdStageUrl:"omniverse://arcnet/pacific-greenfield/stages/pacific_greenfield.usd",kitAppProfile:"arcnet-greenfield-cto-demo",routeId:"route-microturbine-hot-section-demo",cameraBookmarks:[{id:"site-overview",label:"Regional hub overview",position:[18,22,18],target:[12,7,0],fovDegrees:44},{id:"print-bank",label:"Binder jet room",position:[7,14,8],target:[8,8,0],fovDegrees:38},{id:"sinter-cell",label:"Sinter autonomy cell",position:[17,12,7],target:[17,6,0],fovDegrees:34},{id:"inspection-cell",label:"Inspection and evidence preview",position:[24,12,9],target:[23,7,0],fovDegrees:36},{id:"operator-gate",label:"Secure operator gate",position:[21,18,11],target:[18,8,0],fovDegrees:40}],routeSteps:[{id:"powder-ingest",ordinal:1,label:"Powder ingest",processType:"custom",assetIds:["powder-conditioning","manifest-gate"],cameraBookmarkId:"site-overview",telemetryPolicy:yt,evidenceRole:"evidence-bearing"},{id:"binder-jet",ordinal:2,label:"Binder jet",processType:"binder-jet",assetIds:["printer-bank-a","printer-bank-b"],cameraBookmarkId:"print-bank",telemetryPolicy:{...yt,stateClass:"deposition",uplinkReduction:"anomaly-only"},evidenceRole:"control-bearing"},{id:"debind",ordinal:3,label:"Debind",processType:"debinding",assetIds:["debind-cell"],cameraBookmarkId:"print-bank",telemetryPolicy:{...Dn,role:"evidence-bearing"},evidenceRole:"evidence-bearing"},{id:"sinter",ordinal:4,label:"Sinter",processType:"sintering",assetIds:["sinter-furnace","ae-array","edge-hpc-rack"],cameraBookmarkId:"sinter-cell",telemetryPolicy:Dn,evidenceRole:"control-bearing",autonomyEvent:{label:"ARC Signal ramp halt",trigger:"delta-alpha threshold crossing",policyGate:"local PEP accepts sub-second ramp halt",evidenceRef:"evidence://pgf/sinter/arc-signal-ramp-halt"}},{id:"hip-age",ordinal:5,label:"HIP and ageing",processType:"hip",assetIds:["hip-cell","ageing-cell"],cameraBookmarkId:"sinter-cell",telemetryPolicy:{...Dn,stateClass:"thermal"},evidenceRole:"control-bearing"},{id:"cnc-finish",ordinal:6,label:"CNC finish",processType:"cnc-machining",assetIds:["cnc-cell"],cameraBookmarkId:"operator-gate",telemetryPolicy:{...yt,stateClass:"vibration"},evidenceRole:"evidence-bearing"},{id:"coating",ordinal:7,label:"Coating",processType:"thermal-coating-spray",assetIds:["coating-cell"],cameraBookmarkId:"operator-gate",telemetryPolicy:{...yt,stateClass:"deposition"},evidenceRole:"evidence-bearing"},{id:"nde-ct",ordinal:8,label:"NDE / CT",processType:"inspection",assetIds:["nde-cell","ct-cell","metropolis-camera-grid"],cameraBookmarkId:"inspection-cell",telemetryPolicy:yt,evidenceRole:"evidence-bearing"},{id:"evidence-seal",ordinal:9,label:"Evidence preview",processType:"test",assetIds:["edge-hpc-rack","evidence-ledger"],cameraBookmarkId:"inspection-cell",telemetryPolicy:{...yt,uplinkReduction:"delta"},evidenceRole:"evidence-bearing"}],simReadyAssets:[{id:"powder-conditioning",label:"Powder conditioning",usdPath:"/World/PacificGreenfield/Zones/Powder/Conditioning",floor:{zoneId:"powder",gridColumn:2,gridRow:2,gridWidth:4,gridHeight:4},metadata:{"arcnet:equipmentId":"PGF-POWDER-01","arcnet:machineClass":"materials-processing","arcnet:routeStep":"powder-ingest","arcnet:telemetryPolicy":"evidence-only","arcnet:safetyEnvelope":"sealed handling cell","arcnet:evidenceRole":"evidence-bearing"}},{id:"manifest-gate",label:"Manifest gate",usdPath:"/World/PacificGreenfield/Security/ManifestGate",floor:{zoneId:"edge",gridColumn:26,gridRow:2,gridWidth:3,gridHeight:3},metadata:{"arcnet:equipmentId":"PGF-ZT-GATE-01","arcnet:machineClass":"safety","arcnet:routeStep":"powder-ingest","arcnet:telemetryPolicy":"local-only","arcnet:safetyEnvelope":"signed manifest boundary","arcnet:evidenceRole":"visual-context"}},{id:"printer-bank-a",label:"Binder jet bank A",usdPath:"/World/PacificGreenfield/Zones/Additive/PrinterBankA",floor:{zoneId:"additive",gridColumn:7,gridRow:2,gridWidth:5,gridHeight:6},metadata:{"arcnet:equipmentId":"PGF-BJ-A","arcnet:machineClass":"additive-binder-jet","arcnet:routeStep":"binder-jet","arcnet:telemetryPolicy":"anomaly-only","arcnet:safetyEnvelope":"front clearance locked","arcnet:evidenceRole":"control-bearing"}},{id:"printer-bank-b",label:"Binder jet bank B",usdPath:"/World/PacificGreenfield/Zones/Additive/PrinterBankB",floor:{zoneId:"additive",gridColumn:7,gridRow:9,gridWidth:5,gridHeight:6},metadata:{"arcnet:equipmentId":"PGF-BJ-B","arcnet:machineClass":"additive-binder-jet","arcnet:routeStep":"binder-jet","arcnet:telemetryPolicy":"anomaly-only","arcnet:safetyEnvelope":"front clearance locked","arcnet:evidenceRole":"control-bearing"}},{id:"debind-cell",label:"Debind cell",usdPath:"/World/PacificGreenfield/Zones/Debind/Cell01",floor:{zoneId:"thermal",gridColumn:13,gridRow:2,gridWidth:4,gridHeight:4},metadata:{"arcnet:equipmentId":"PGF-DEBIND-01","arcnet:machineClass":"thermal-processing","arcnet:routeStep":"debind","arcnet:telemetryPolicy":"sketched","arcnet:safetyEnvelope":"local exh
57aust envelope","arcnet:evidenceRole":"evidence-bearing"}},{id:"sinter-furnace",label:"Vacuum sinter",usdPath:"/World/PacificGreenfield/Zones/Thermal/SinterFurnace01",floor:{zoneId:"thermal",gridColumn:15,gridRow:7,gridWidth:5,gridHeight:5},metadata:{"arcnet:equipmentId":"PGF-SINTER-01","arcnet:machineClass":"sintering-furnace","arcnet:routeStep":"sinter","arcnet:telemetryPolicy":"anomaly-only","arcnet:safetyEnvelope":"two-tile thermal perimeter","arcnet:evidenceRole":"control-bearing"}},{id:"ae-array",label:"AE sensor array",usdPath:"/World/PacificGreenfield/Sensors/AcousticEmissionArray",floor:{zoneId:"thermal",gridColumn:20,gridRow:7,gridWidth:2,gridHeight:3},metadata:{"arcnet:equipmentId":"PGF-AE-01","arcnet:machineClass":"sensor","arcnet:routeStep":"sinter","arcnet:telemetryPolicy":"anomaly-only","arcnet:safetyEnvelope":"read-only sensor anchor","arcnet:evidenceRole":"control-bearing"}},{id:"hip-cell",label:"HIP cell",usdPath:"/World/PacificGreenfield/Zones/Thermal/HipCell01",floor:{zoneId:"thermal",gridColumn:15,gridRow:13,gridWidth:5,gridHeight:4},metadata:{"arcnet:equipmentId":"PGF-HIP-01","arcnet:machineClass":"hip","arcnet:routeStep":"hip-age","arcnet:telemetryPolicy":"anomaly-only","arcnet:safetyEnvelope":"pressure vessel exclusion zone","arcnet:evidenceRole":"control-bearing"}},{id:"ageing-cell",label:"Ageing furnace",usdPath:"/World/PacificGreenfield/Zones/Thermal/AgeingCell01",floor:{zoneId:"thermal",gridColumn:21,gridRow:13,gridWidth:4,gridHeight:4},metadata:{"arcnet:equipmentId":"PGF-AGE-01","arcnet:machineClass":"thermal-processing","arcnet:routeStep":"hip-age","arcnet:telemetryPolicy":"sketched","arcnet:safetyEnvelope":"thermal perimeter","arcnet:evidenceRole":"control-bearing"}},{id:"cnc-cell",label:"CNC finish",usdPath:"/World/PacificGreenfield/Zones/PostProcess/CncCell01",floor:{zoneId:"post",gridColumn:2,gridRow:14,gridWidth:5,gridHeight:4},metadata:{"arcnet:equipmentId":"PGF-CNC-01","arcnet:machineClass":"subtractive","arcnet:routeStep":"cnc-finish","arcnet:telemetryPolicy":"sketched","arcnet:safetyEnvelope":"guarded work envelope","arcnet:evidenceRole":"evidence-bearing"}},{id:"coating-cell",label:"Coating cell",usdPath:"/World/PacificGreenfield/Zones/PostProcess/CoatingCell01",floor:{zoneId:"post",gridColumn:8,gridRow:14,gridWidth:5,gridHeight:4},metadata:{"arcnet:equipmentId":"PGF-COAT-01","arcnet:machineClass":"coating","arcnet:routeStep":"coating","arcnet:telemetryPolicy":"sketched","arcnet:safetyEnvelope":"robotic spray envelope","arcnet:evidenceRole":"evidence-bearing"}},{id:"nde-cell",label:"NDE cell",usdPath:"/World/PacificGreenfield/Zones/Inspection/NdeCell01",floor:{zoneId:"inspection",gridColumn:22,gridRow:2,gridWidth:4,gridHeight:4},metadata:{"arcnet:equipmentId":"PGF-NDE-01","arcnet:machineClass":"materials-processing","arcnet:routeStep":"nde-ct","arcnet:telemetryPolicy":"sketched","arcnet:safetyEnvelope":"inspection enclosure","arcnet:evidenceRole":"evidence-bearing"}},{id:"ct-cell",label:"CT cell",usdPath:"/World/PacificGreenfield/Zones/Inspection/CtCell01",floor:{zoneId:"inspection",gridColumn:26,gridRow:6,gridWidth:4,gridHeight:4},metadata:{"arcnet:equipmentId":"PGF-CT-01","arcnet:machineClass":"materials-processing","arcnet:routeStep":"nde-ct","arcnet:telemetryPolicy":"sketched","arcnet:safetyEnvelope":"radiation interlock envelope","arcnet:evidenceRole":"evidence-bearing"}},{id:"metropolis-camera-grid",label:"Vision AI grid",usdPath:"/World/PacificGreenfield/Sensors/CameraGrid",floor:{zoneId:"inspection",gridColumn:22,gridRow:11,gridWidth:3,gridHeight:3},metadata:{"arcnet:equipmentId":"PGF-VISION-01","arcnet:machineClass":"sensor","arcnet:routeStep":"nde-ct","arcnet:telemetryPolicy":"anomaly-only","arcnet:safetyEnvelope":"read-only sensor anchor","arcnet:evidenceRole":"learning-bearing"}},{id:"edge-hpc-rack",label:"Secure edge HPC",usdPath:"/World/PacificGreenfield/Zones/Edge/ScifRack01",floor:{zoneId:"edge",gridColumn:27,gridRow:14,gridWidth:3,gridHeight:3},metadata:{"arcnet:equipmentId":"PGF-EDGE-01","arcnet:machineClass":"edge-hpc","arcnet:routeStep":"sinter","arcnet:telemetryPolicy":"local-only","arcnet:safetyEnvelope":"SCIF boundary","arcnet:evidenceRole":"control-bearing"}},{id:"evidence-ledger",label:"Evidence ledger",usdPath:"/World/PacificGreenfield/Security/Evidence
57Ledger",floor:{zoneId:"edge",gridColumn:24,gridRow:15,gridWidth:2,gridHeight:2},metadata:{"arcnet:equipmentId":"PGF-EVIDENCE-01","arcnet:machineClass":"edge-hpc","arcnet:routeStep":"evidence-seal","arcnet:telemetryPolicy":"evidence-only","arcnet:safetyEnvelope":"sealed audit boundary","arcnet:evidenceRole":"evidence-bearing"}}]},Tp=new Set(["omniverse.asset.selected","omniverse.stage.ready","greenfield.demo.routeStep.changed","omniverse.stream.health","greenfield.demo.evidencePreview.event"]),Ap=new Set(["omniverse.stage.select","omniverse.camera.goto","omniverse.asset.select","omniverse.telemetry.overlayPatch","greenfield.demo.routePlayback.play","greenfield.demo.routePlayback.pause","greenfield.demo.policyGate.preview","greenfield.demo.evidencePreview.show","viz.flow.highlight"]),Lp=[/^arc\./,/^evidence\.seal$/,/^policy\.resume$/,/^secure\.pause$/,/^secure\.resume$/,/^route\./,/^stage\./,/^camera\./,/^asset\./,/^telemetry\.patch$/,/^stream\.health$/,/^evidence\.event$/],vn="visual-demo-only";function Ze(e,n,a,s={}){if(!Ap.has(n)||wa(n))throw new Error(`Rejected non-demo Omniverse command: ${n}`);return{schemaVersion:1,type:n,scenarioId:e,roleProjection:s.roleProjection??"operator-demo",authority:vn,payload:a,requestId:s.requestId??`kit-${Date.now().toString(36)}-${Vp()}`,issuedAt:s.issuedAt??new Date().toISOString()}}function Op(e){if(e.authority!==vn||wa(e.type))throw new Error(`Rejected non-demo Omniverse command: ${e.type}`);return JSON.stringify(e)}function $p(e){const n=typeof e=="string"?zp(e):e;if(!n||typeof n!="object")return null;const a=n;return typeof a.type=="string"&&wa(a.type)||!a.type||!Tp.has(a.type)||typeof a.scenarioId!="string"||!a.payload||typeof a.payload!="object"||a.authority&&a.authority!==vn?null:{schemaVersion:a.schemaVersion===1?1:void 0,type:a.type,scenarioId:a.scenarioId,authority:a.authority??vn,receivedAt:typeof a.receivedAt=="string"?a.receivedAt:new Date().toISOString(),payload:a.payload}}function Mp(e,n){return Ze(e.id,"omniverse.stage.select",{stageId:e.stage,usdStageUrl:e.usdStageUrl,kitAppProfile:e.kitAppProfile},n)}function Dp(e,n,a){return Ze(e.id,"omniverse.camera.goto",{cameraBookmarkId:n.cameraBookmarkId},a)}function Bp(e,n,a){return Ze(e.id,"omniverse.asset.select",{assetId:n.assetIds[0]??"site-overview",routeStepId:n.id},a)}function Fp(e,n,a){return Ze(e.id,"omniverse.telemetry.overlayPatch",{routeStepId:n.id,telemetry:Up(n,a?.roleProjection??"operator-demo")},a)}function qp(e,n,a){return Ze(e.id,"greenfield.demo.routePlayback.play",{routeId:e.routeId,startStepId:n.id},a)}function Hp(e,n="operator-hold",a){return Ze(e.id,"greenfield.demo.routePlayback.pause",{routeId:e.routeId,reason:n},a)}function Wp(e,n,a="policy-gate",s){return Ze(e.id,"greenfield.demo.policyGate.preview",{routeId:e.routeId,routeStepId:n.id,previewKind:a},s)}function Gp(e,n,a){return Ze(e.id,"greenfield.demo.evidencePreview.show",{routeId:e.routeId,routeStepId:n.id,previewKind:"capability-demonstration"},a)}function zP(e,n,a){return Ze(e.id,"viz.flow.highlight",{...n,advisory:!0},a)}function wa(e){return Lp.some(n=>n.test(e))}function Up(e,n){return e.id==="sinter"?n==="cto-metallurgist"?{deltaAlpha:.171,threshold:.12,surrogateConfidence:.91,rampHaltIssued:!0,signalBand:"halted",uplinkReduction:e.telemetryPolicy.uplinkReduction}:{signalBand:"halted",surrogateConfidenceBand:"high",rampHaltIssued:!0,uplinkReduction:e.telemetryPolicy.uplinkReduction}:e.id==="nde-ct"?{syntheticSensorView:"enabled",featureVectorSealed:!0,uplinkReduction:e.telemetryPolicy.uplinkReduction}:{routeOrdinal:e.ordinal,evidenceBearing:e.telemetryPolicy.evidenceBearing,uplinkReduction:e.telemetryPolicy.uplinkReduction}}function zp(e){try{return JSON.parse(e)}catch{return null}}function Vp(){if(typeof crypto<"u"&&"getRandomValues"in crypto){const e=new Uint8Array(3);return crypto.getRandomValues(e),Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}return Math.random().toString(36).slice(2,8)}const Jp="@nvidia/ov-web-rtc";async function Kp(e){e.onStatus("loading");try{const n=await Yp(Jp),a=Qp(n);if(!a)return e.onStatus("sdk-unavailable","AppStreamer export not found"),null;const s=new a({container:e.container,streamConfig:{streamSource:"direct",url:e.streamUrl,profileId:e.profileId},onMessage:i=>{const r=$p(i);r&&e.onMessage(r)},onStart:()=>e.onStatus("connected"),onStop:()=>e.onStatus("idle"),onError:i=>e.onStatus("error",String(i))});return Bn(s,["connect","start","initialize","init"]),e.onStatus("connected"),{send:i=>{const r=Op(i);
57Bn(s,["sendMessage","send","postMessage"],r)||e.container.dispatchEvent(new CustomEvent("arcnet:omniverse-message",{detail:i}))},dispose:()=>{Bn(s,["disconnect","stop","destroy","dispose"])}}}catch(n){return e.onStatus("sdk-unavailable",n instanceof Error?n.message:String(n)),null}}async function Yp(e){return new Function("specifier","return import(specifier)")(e)}function Qp(e){const n=e,a=n.default,s=n.AppStreamer??a?.AppStreamer??a;return typeof s=="function"?s:null}function Bn(e,n,a){if(!e||typeof e!="object")return!1;const s=e;for(const i of n){const r=s[i];if(typeof r=="function")return typeof a>"u"?r.call(e):r.call(e,a),!0}return!1}const Rt="visual-demo-only",Di="Capability demonstration - not a qualification claim",Bi={visible:!1,routeStepId:null,status:"hidden",label:"Evidence preview hidden",claimLabel:Di,authority:Rt},bs={scenarioId:null,roleProjection:"operator-demo",twinOpen:!1,selectedRouteStepId:null,selectedAssetId:null,activeWaypointId:null,playbackStatus:"idle",streamHealth:"idle",lastKitEvent:null,demoTimeline:[],evidencePreview:Bi,redactionLevel:"class-language"},Re=ii()(Ri(e=>({...bs,initializeScenario:(n,a,s,i)=>e({scenarioId:n,roleProjection:a,selectedRouteStepId:s,activeWaypointId:i,redactionLevel:vs(a)},!1,"greenfield/initializeScenario"),setRoleProjection:n=>e({roleProjection:n,redactionLevel:vs(n)},!1,"greenfield/setRoleProjection"),openTwin:()=>e({twinOpen:!0},!1,"greenfield/openTwin"),selectRouteStep:(n,a,s)=>e({selectedRouteStepId:n,selectedAssetId:a,activeWaypointId:s},!1,"greenfield/selectRouteStep"),setPlaybackStatus:n=>e({playbackStatus:n},!1,"greenfield/setPlaybackStatus"),setStreamHealth:n=>e({streamHealth:n},!1,"greenfield/setStreamHealth"),recordKitEvent:n=>e(a=>({lastKitEvent:n,streamHealth:n.type==="omniverse.stream.health"?String(n.payload.status??n.payload.reason??"event"):a.streamHealth}),!1,"greenfield/recordKitEvent"),showEvidencePreview:(n,a="Capability demonstration evidence preview")=>e({evidencePreview:{visible:!0,routeStepId:n,status:"previewing",label:a,claimLabel:Di,authority:Rt}},!1,"greenfield/showEvidencePreview"),addTimelineEvent:n=>e(a=>({demoTimeline:[{...n,id:`greenfield-${Date.now().toString(36)}-${a.demoTimeline.length}`,at:new Date().toISOString(),authority:Rt},...a.demoTimeline].slice(0,24)}),!1,"greenfield/addTimelineEvent"),resetGreenfieldRuntime:()=>e({...bs,evidencePreview:Bi},!1,"greenfield/reset")}),{name:"arcnet-greenfield-runtime"})),Zp="_shell_1agn5_1",Xp="_header_1agn5_12",eh="_backButton_1agn5_33",th="_primaryButton_1agn5_34",nh="_secondaryButton_1agn5_35",ah="_mapNode_1agn5_52",sh="_routeStep_1agn5_53",ih="_routeStepActive_1agn5_54",rh="_assetBlock_1agn5_55",oh="_brand_1agn5_70",ch="_section_1agn5_76",lh="_headerStatus_1agn5_82",dh="_statusPill_1agn5_86",uh="_pillgreen_1agn5_99",mh="_pillcyan_1agn5_104",ph="_pillamber_1agn5_109",hh="_grid_1agn5_114",fh="_deniedShell_1agn5_122",gh="_theaterPanel_1agn5_148",_h="_twinPanel_1agn5_149",yh="_controlPanel_1agn5_150",vh="_panelHeader_1agn5_169",bh="_theaterMap_1agn5_193",jh="_theaterSvg_1agn5_207",xh="_arcPrimary_1agn5_214",Ih="_arcSecondary_1agn5_215",wh="_arcEvidence_1agn5_216",Nh="_arcAssetGraph_1agn5_217",Sh="_mapNodeSelected_1agn5_273",Ch="_mapNodeGreenfield_1agn5_278",Rh="_mapNodeRegional_1agn5_284",Eh="_mapNodeScience_1agn5_289",kh="_mapNodeTest_1agn5_295",Ph="_mapNodeActive_1agn5_301",Th="_mapLegend_1agn5_306",Ah="_legendModel_1agn5_320",Lh="_legendNode_1agn5_321",Oh="_mapActions_1agn5_337",$h="_commandRow_1agn5_338",Mh="_nodeSummary_1agn5_345",Dh="_deckInset_1agn5_395",Bh="_twinStandby_1agn5_404",Fh="_nodePreview_1agn5_428",qh="_nodePreviewHeader_1agn5_441",Hh="_nodePreviewGrid_1agn5_468",Wh="_nodePreviewPanel_1agn5_475",Gh="_layerList_1agn5_516",Uh="_capabilityList_1agn5_517",zh="_streamShell_1agn5_535",Vh="_staticTwin_1agn5_536",Jh="_streamMount_1agn5_544",Kh="_streamFrame_1agn5_545",Yh="_streamHud_1agn5_554",Qh="_staticHud_1agn5_555",Zh="_staticViewport_1agn5_587",Xh="_floorGrid_1agn5_599",ef="_assetActive_1agn5_653",tf="_assetInstance_1agn5_659",nf="_zonePowder_1agn5_664",af="_zoneAdditive_1agn5_668",sf="_zoneThermal_1agn5_672",rf="_zonePost_1agn5_676",of="_zoneInspection_1agn5_680",cf="_zoneEdge_1agn5_684",lf="_routeTrace_1agn5_688",df="_routeList_1agn5_700",uf="_autonomyPanel_1agn5_756",mf="_assemblyPanel_1agn5_757",pf="_evidencePanel_1agn5_758",hf="_timelinePanel_1agn5_759",ff="_hudGrid_1agn5_808",gf="_kicker_1agn5_831",_f="_evidenceBadge_1agn5_839",yf="_flowLegendSlot_1agn5_977",S={shell:Zp,header:Xp,backButton:eh,primaryButton:th,secondaryButton:nh,mapNode:
57ah,routeStep:sh,routeStepActive:ih,assetBlock:rh,brand:oh,section:ch,headerStatus:lh,statusPill:dh,pillgreen:uh,pillcyan:mh,pillamber:ph,grid:hh,deniedShell:fh,theaterPanel:gh,twinPanel:_h,controlPanel:yh,panelHeader:vh,theaterMap:bh,theaterSvg:jh,arcPrimary:xh,arcSecondary:Ih,arcEvidence:wh,arcAssetGraph:Nh,mapNodeSelected:Sh,mapNodeGreenfield:Ch,mapNodeRegional:Rh,mapNodeScience:Eh,mapNodeTest:kh,mapNodeActive:Ph,mapLegend:Th,legendModel:Ah,legendNode:Lh,mapActions:Oh,commandRow:$h,nodeSummary:Mh,deckInset:Dh,twinStandby:Bh,nodePreview:Fh,nodePreviewHeader:qh,nodePreviewGrid:Hh,nodePreviewPanel:Wh,layerList:Gh,capabilityList:Uh,streamShell:zh,staticTwin:Vh,streamMount:Jh,streamFrame:Kh,streamHud:Yh,staticHud:Qh,staticViewport:Zh,floorGrid:Xh,assetActive:ef,assetInstance:tf,zonePowder:nf,zoneAdditive:af,zoneThermal:sf,zonePost:rf,zoneInspection:of,zoneEdge:cf,routeTrace:lf,routeList:df,autonomyPanel:uf,assemblyPanel:mf,evidencePanel:pf,timelinePanel:hf,hudGrid:ff,kicker:gf,evidenceBadge:_f,flowLegendSlot:yf},vf=Np,nn=gc?h.lazy(()=>oi(()=>import("./index-CC3DFpUC.js"),__vite__mapDeps([2,1,0,3,4]))):null,bf={mode:"mock",streamUrl:null,profileId:null};function jf({config:e=bf,scenario:n=Pp,sceneManifest:a=vf,explorerNodes:s=Ep,explorerConnections:i=kp}){const r=We(),{session:c}=Ue(),[o,d]=h.useState([]),[l,g]=h.useState(Ke),u=x(I=>I.upsertFacility),_=x(I=>I.upsertNode),m=x(I=>I.selectNode),v=x(I=>I.appendEvent),p=h.useMemo(()=>Tm(c?.email),[c?.email]),f=Lm(p),b=h.useMemo(()=>s.find(I=>I.id===l)??s[0]??null,[s,l]),w=b?.id===Ke,j=f&&w,C=Re(I=>I.twinOpen),N=Re(I=>I.selectedRouteStepId),T=Re(I=>I.playbackStatus),R=Re(I=>I.streamHealth),E=Re(I=>I.lastKitEvent),A=Re(I=>I.evidencePreview),V=Re(I=>I.redactionLevel),re=Re(I=>I.demoTimeline),q=Re(I=>I.initializeScenario),de=Re(I=>I.openTwin),Z=Re(I=>I.selectRouteStep),ue=Re(I=>I.setPlaybackStatus),Ce=Re(I=>I.setStreamHealth),$=Re(I=>I.recordKitEvent),Me=Re(I=>I.showEvidencePreview),ce=Re(I=>I.addTimelineEvent),W=h.useMemo(()=>({...n,usdStageUrl:a.usdStageUrl}),[n,a.usdStageUrl]),Xe=Math.max(W.routeSteps.findIndex(I=>I.id===N),0),me=W.routeSteps[Xe]??W.routeSteps[0],ht=T==="playing",Tt=e.mode==="stream"&&!!e.streamUrl,P=o[o.length-1]??null,G=h.useMemo(()=>[...a.assets,...a.repeatedProps],[a.assets,a.repeatedProps]),se=h.useMemo(()=>a.routeSteps.find(I=>I.id===me.id)??null,[a.routeSteps,me.id]),ge=h.useMemo(()=>G.filter(I=>me.assetIds.includes(I.assetId)),[G,me.assetIds]),De=h.useMemo(()=>new Set(me.assetIds),[me.assetIds]),J=h.useMemo(()=>({roleProjection:p}),[p]);h.useEffect(()=>{q(W.id,p,me.id,me.cameraBookmarkId)},[W.id,q,p,me.cameraBookmarkId,me.id]),h.useEffect(()=>{s.forEach(I=>{u({id:I.facilityId,name:I.label,position:I.position,timezone:I.timezone,nodeCount:1}),_({id:I.nodeId,facilityId:I.facilityId,class:I.nodeClass,networkMode:"connected-normal",position:I.position,lastSeen:new Date,attestationFresh:!0,tokenHeld:!1,activeJobs:[],registeredEquipment:I.id===Ke?a.assets.filter(fe=>["additive-binder-jet","sintering-furnace","subtractive","coating","thermal-processing","hip","materials-processing"].includes(fe.metadata["arcnet:machineClass"])).map(fe=>({machineClass:fe.metadata["arcnet:machineClass"],machineId:fe.metadata["arcnet:equipmentId"]})):[]})})},[s,a.assets,u,_]),h.useEffect(()=>{if(!ht||!C||!j)return;const I=window.setInterval(()=>{const fe=Re.getState(),Wr=Math.max(W.routeSteps.findIndex(Gr=>Gr.id===fe.selectedRouteStepId),0),ft=W.routeSteps[(Wr+1)%W.routeSteps.length];ft&&(Z(ft.id,ft.assetIds[0]??null,ft.cameraBookmarkId),ce({type:"route-step",label:`Demo route step ${ft.label}`,routeStepId:ft.id}))},2200);return()=>window.clearInterval(I)},[ce,j,W.routeSteps,ht,Z,C]),h.useEffect(()=>{if(!C||ht)return;const I=Dp(W,me,J);d(fe=>[...fe,I])},[J,ht,W,me,C]);const Ne=h.useCallback(I=>{d(fe=>[...fe,I]),ce({type:I.type==="greenfield.demo.policyGate.preview"?"policy-preview":I.type==="greenfield.demo.evidencePreview.show"?"evidence-preview":I.type==="omniverse.telemetry.overlayPatch"||I.type==="viz.flow.highlight"?"telemetry-overlay":I.type==="omniverse.asset.select"?"asset":I.type==="greenfield.demo.routePlayback.play"?"route-step":"stage",label:I.type,routeStepId:"routeStepId"in I.payload?I.payload.routeStepId:void 0,assetId:"assetId"in I.payload?I.payload.assetId:void 0,details:{scenarioId:I.scenarioId,authority:I.authority}}),v({id:`network-explorer-${I.requestId}`,kind:"system",severity:"info",message:`Omniverse command ${I.type}`,at:new Date,facilityId:W.regionalHubFacilityId,nodeId:W.regionalHubNodeId,details:{scenarioId:I.scenarioId,messageType:I.type,roleProjection:I.roleProjection,authority:I.authority}})},[ce,v,W.regionalHubFacilityId,W.regionalHubNodeId]),et=h.useCallback(I=>{g(I.id),m(I.nodeId),ce({type:"stage",label:`Phase 4 node selected: ${I.shortLabel}`,details:{nodeId:I.nodeId,facilityId:I.facilityId,readiness:I.twinReadiness}})},[ce,m]),kn=h.useCallback(()=>
57{if(!f)return;g(Ke);const I=W.routeSteps[0];de(),Z(I.id,I.assetIds[0]??null,I.cameraBookmarkId),ue("idle"),m(W.regionalHubNodeId),Ne(Mp(W,J))},[f,W,Ne,J,de,m,Z,ue]),Lr=h.useCallback(()=>{if(b){if(b.id===Ke){kn();return}et(b),v({id:`network-explorer-node-${b.id}-${Date.now().toString(36)}`,kind:"system",severity:"info",message:`Phase 4 node preview ${b.shortLabel}`,at:new Date,facilityId:b.facilityId,nodeId:b.nodeId,details:{authority:Rt,readiness:b.twinReadiness}})}},[v,et,kn,b]),Or=h.useCallback(I=>{if(!j)return;const fe=W.routeSteps[I];fe&&(Z(fe.id,fe.assetIds[0]??null,fe.cameraBookmarkId),ue("paused"),Ne(Bp(W,fe,J)),Ne(Fp(W,fe,J)))},[j,Ne,W,J,Z,ue]),$r=h.useCallback(()=>{j&&(de(),ue("playing"),Ne(qp(W,me,J)))},[j,Ne,W,me,J,de,ue]),Mr=h.useCallback(()=>{j&&(ue("paused"),Ne(Hp(W,"operator-hold",J)))},[j,Ne,W,J,ue]),Dr=h.useCallback(()=>{if(!j)return;const I=W.routeSteps.find(fe=>fe.id==="sinter")??me;de(),ue("gate-preview"),Z(I.id,I.assetIds[0]??null,I.cameraBookmarkId),Ne(Wp(W,I,"policy-gate",J))},[j,Ne,W,J,de,me,Z,ue]),Br=h.useCallback(()=>{j&&(Me(me.id),Ne(Gp(W,me,J)))},[j,W,Ne,J,me,Me]),Fr=h.useCallback(I=>{$(I),I.type==="omniverse.stream.health"&&Ce(String(I.payload.status??I.payload.reason??"event"))},[$,Ce]),qr=nn?t.jsx(h.Suspense,{fallback:null,children:t.jsx(nn,{slot:"badges",sceneAssets:G,scenario:W})}):null,Hr=nn?t.jsx(h.Suspense,{fallback:null,children:t.jsx(nn,{slot:"legend",sceneAssets:G,scenario:W,onEmitMessage:Ne})}):null;return p==="denied"?t.jsxs("div",{className:S.shell,children:[t.jsxs("header",{className:S.header,children:[t.jsxs("div",{children:[t.jsx("button",{className:S.backButton,onClick:()=>r("/role-chooser"),children:"BACK"}),t.jsx("span",{className:S.brand,children:"ARCNET"}),t.jsx("span",{className:S.section,children:"NETWORK EXPLORER"})]}),t.jsx("div",{className:S.headerStatus,children:t.jsx(St,{label:"ACCESS REDACTED",tone:"amber"})})]}),t.jsxs("main",{className:S.deniedShell,"data-testid":"network-explorer-denied",children:[t.jsx("span",{className:S.kicker,children:"ZERO-TRUST PROJECTION"}),t.jsx("strong",{children:"Network Explorer twin unavailable for this role."}),t.jsx("p",{children:"Line-tech-safe ARCNet views do not expose digital twin, ARC Signal, or evidence preview surfaces."})]})]}):t.jsxs("div",{className:S.shell,children:[t.jsxs("header",{className:S.header,children:[t.jsxs("div",{children:[t.jsx("button",{className:S.backButton,onClick:()=>r("/role-chooser"),children:"BACK"}),t.jsx("span",{className:S.brand,children:"ARCNET"}),t.jsx("span",{className:S.section,children:"NETWORK EXPLORER"})]}),t.jsxs("div",{className:S.headerStatus,children:[t.jsx(St,{label:Fi(p),tone:p==="cto-metallurgist"?"cyan":"amber"}),t.jsx(St,{label:Tt?"OMNIVERSE STREAM":"MOCK STATIC",tone:Tt?"cyan":"amber"}),t.jsx(St,{label:Rt,tone:"green"})]})]}),t.jsxs("main",{className:S.grid,children:[t.jsxs("section",{className:S.theaterPanel,"aria-label":"ARCNet theater map",children:[t.jsxs("div",{className:S.panelHeader,children:[t.jsx("span",{children:"STAGE 1"}),t.jsx("strong",{children:"THEATER MAP"})]}),t.jsx(If,{nodes:s,connections:i,selectedNodeId:b?.id??null,greenfieldOpen:C,onSelectNode:et,onOpenGreenfieldTwin:kn}),t.jsxs("div",{className:S.mapActions,children:[t.jsx("button",{className:S.primaryButton,onClick:Lr,disabled:!f||!b,"data-testid":"open-greenfield-twin",children:w?"OPEN GREENFIELD TWIN":"INSPECT NODE PREVIEW"}),t.jsx("button",{className:S.secondaryButton,onClick:()=>b&&et(b),disabled:!b,children:"SELECT NODE"})]}),b&&t.jsx(wf,{node:b,roleProjection:p}),!Tt&&t.jsx("div",{className:S.deckInset,"data-testid":"fallback-deck-map",children:t.jsx(Mi,{})})]}),t.jsxs("section",{className:S.twinPanel,"aria-label":"Pacific Greenfield digital twin",children:[t.jsxs("div",{className:S.panelHeader,children:[t.jsx("span",{children:w?C?"STAGE 2":"STANDBY":"PHASE 4"}),t.jsx("strong",{children:w?"OMNIVERSE TWIN":"NODE ASSET GRAPH"})]}),w?t.jsx(kf,{isOpen:C,sceneManifest:a,sceneAssets:G,selectedStep:me,selectedManifestStep:se,activeAssetIds:De,roleProjection:p,config:e,outboundMessages:o,onInboundMessage:Fr,flowOverlayBadges:qr,flowOverlayLegend:Hr}):b?t.jsx(Nf,{node:b,roleProjection:p}):null]}),t.jsxs("aside",{className:S.controlPanel,"aria-label":"Network explorer controls",children:[t.jsxs("div",{className:S.panelHeader,children:[t.jsx("span",{children:T.toUpperCase()}),t.jsx("strong",{children:"ROUTE CONTROL"})]}),t.jsxs("div",{className:S.commandRow,children:[t.jsx("button",{className:S.primaryButton,onClick:$r,disabled:!j,"data-testid":"route-play",children:"PLAY"}),t.jsx("button",{className:S.secondaryButton,onClick:Mr,disabled:!j,"data-testid":"route-pause",children:"PAUSE"}),t.jsx("button",{className:S.secondaryButton,onClick:Dr,disabled:!j,"data-testid":"policy-gate-preview",children:"POLICY GATE"}),t.jsx("button",{className:S.secondaryButton,onClick:Br,disabled:!j,"data-testid":"evidence-preview",children:"EVIDENCE PREVIEW"})]}),t.jsxs("div",{className:S.assemblyPanel,"data-testid":"scene-assembly-summary",children:[t.jsx("span",{className:S.kicker,children:"OPENUSD ASSEMBLY"}),t.jsxs("dl",{children:[t.jsxs("div",{children:[t.jsx("dt",{children:"USD layers"}),t.jsx("dd",{children:a.layers.length})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Assets"}),t.jsxs("dd",{children:[a.assets.length," refs / ",a.repeatedProps.length," instances"]})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Waypoints"}
57),t.jsx("dd",{children:a.waypoints.length})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Runtime overlays"}),t.jsx("dd",{children:a.runtimeOverlays?.length??a.routeSteps.length})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Units"}),t.jsxs("dd",{children:[a.stageContract.upAxis,"-up / ",a.stageContract.metersPerUnit," mpu"]})]})]})]}),t.jsx("ol",{className:S.routeList,children:W.routeSteps.map((I,fe)=>t.jsx("li",{children:t.jsxs("button",{className:fe===Xe?S.routeStepActive:S.routeStep,onClick:()=>Or(fe),disabled:!j,"data-testid":`route-step-${I.id}`,children:[t.jsx("span",{children:String(I.ordinal).padStart(2,"0")}),t.jsx("strong",{children:I.label}),t.jsx("small",{children:p==="cto-metallurgist"?I.telemetryPolicy.uplinkReduction:"class-safe"})]})},I.id))}),t.jsxs("div",{className:S.autonomyPanel,"data-testid":"autonomy-panel",children:[t.jsx("span",{className:S.kicker,children:"LOW-HUMAN AUTONOMY"}),t.jsx("strong",{children:me.autonomyEvent?.label??"Policy-monitored route step"}),t.jsx("p",{children:xf(me,p)}),t.jsxs("div",{className:S.hudGrid,"data-testid":"operational-hud",children:[t.jsx("span",{children:"Authority"}),t.jsx("strong",{children:Rt}),t.jsx("span",{children:"Redaction"}),t.jsx("strong",{children:V}),t.jsx("span",{children:"Stream"}),t.jsx("strong",{children:R})]})]}),t.jsxs("div",{className:S.evidencePanel,"data-testid":"evidence-claim",children:[t.jsx("span",{className:S.evidenceBadge,children:"CAPABILITY DEMONSTRATION - NOT A QUALIFICATION CLAIM"}),t.jsxs("dl",{children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Part family"}),t.jsx("dd",{children:"Hot-section microturbine"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Evidence state"}),t.jsx("dd",{children:A.visible?A.label:"Demo evidence preview ready"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Stream event"}),t.jsx("dd",{children:E?.type??P?.type??"omniverse.stage.select"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Current prim"}),t.jsx("dd",{children:p==="cto-metallurgist"?se?.overlayPrimPath??ge[0]?.primPath??"pending":"redacted class binding"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Material"}),t.jsx("dd",{children:p==="cto-metallurgist"?ge[0]?.materialId??"m_route_idle":"class-safe overlay"})]})]})]}),t.jsxs("div",{className:S.timelinePanel,"data-testid":"demo-timeline",children:[t.jsx("span",{className:S.kicker,children:"SCENE DIRECTOR"}),re.slice(0,4).map(I=>t.jsxs("p",{children:[t.jsx("strong",{children:I.label}),t.jsx("small",{children:I.authority})]},I.id))]})]})]})]})}function Fi(e){switch(e){case"cto-metallurgist":return"CTO METALLURGIST";case"operator-demo":return"OPERATOR DEMO";case"site-redacted":return"SITE REDACTED";case"denied":return"DENIED"}}function xf(e,n){return n!=="cto-metallurgist"?e.autonomyEvent?"ARC Signal class spike -> local halt accepted -> evidence preview ready.":`${e.label} is displayed with class-language route telemetry only.`:e.autonomyEvent?`${e.autonomyEvent.trigger} -> ${e.autonomyEvent.policyGate}`:`${e.label} telemetry is reduced at the edge and bound into the demo evidence preview.`}function If({nodes:e,connections:n,selectedNodeId:a,greenfieldOpen:s,onSelectNode:i,onOpenGreenfieldTwin:r}){const c=new Map(e.map(o=>[o.id,o]));return t.jsxs("div",{className:S.theaterMap,children:[t.jsx("svg",{viewBox:"0 0 100 70","aria-hidden":"true",className:S.theaterSvg,children:n.map(o=>{const d=c.get(o.sourceNodeId),l=c.get(o.targetNodeId);return!d||!l?null:t.jsx("path",{className:Cf(o),d:Sf(d,l)},o.id)})}),e.map(o=>{const d=o.id===Ke,l=o.id===a;return t.jsxs("button",{type:"button",className:[S.mapNode,d?S.mapNodeGreenfield:"",l?S.mapNodeSelected:"",d&&s?S.mapNodeActive:"",Rf(o)].filter(Boolean).join(" "),style:{left:`${o.mapPosition.x}%`,top:`${o.mapPosition.y}%`},onClick:()=>{i(o),d&&r()},"data-testid":`node-${o.id}`,children:[t.jsx("span",{}),t.jsx("strong",{children:o.shortLabel})]},o.id)}),t.jsxs("div",{className:S.mapLegend,children:[t.jsxs("span",{children:[t.jsx("i",{className:S.legendModel})," model/evidence arcs"]}),t.jsxs("span",{children:[t.jsx("i",{className:S.legendNode})," trusted nodes"]})]})]})}
57function wf({node:e,roleProjection:n}){return t.jsxs("div",{className:S.nodeSummary,"data-testid":"selected-node-summary",children:[t.jsx("span",{className:S.kicker,children:"PHASE 4 NODE"}),t.jsx("strong",{children:e.label}),t.jsxs("dl",{children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Node"}),t.jsx("dd",{children:e.nodeId})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Readiness"}),t.jsx("dd",{children:qi(e.twinReadiness)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Class"}),t.jsx("dd",{children:e.nodeClass})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Projection"}),t.jsx("dd",{children:Fi(n)})]})]})]})}function Nf({node:e,roleProjection:n}){const a=n==="cto-metallurgist"||n==="operator-demo",s=Cp(e.id);return t.jsxs("div",{className:S.nodePreview,"data-testid":"node-asset-graph-preview",children:[t.jsxs("div",{className:S.nodePreviewHeader,children:[t.jsx("span",{children:e.shortLabel}),t.jsx("strong",{children:e.label}),t.jsx(St,{label:qi(e.twinReadiness),tone:e.twinReadiness==="qualification-preview"?"amber":"cyan"})]}),t.jsxs("div",{className:S.nodePreviewGrid,children:[t.jsxs("section",{className:S.nodePreviewPanel,children:[t.jsx("span",{className:S.kicker,children:"MISSION"}),t.jsx("p",{children:e.mission}),t.jsxs("dl",{children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Address"}),t.jsx("dd",{children:a?e.address:"site location redacted"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Coordinates"}),t.jsx("dd",{children:a?`${e.position[1].toFixed(4)}, ${e.position[0].toFixed(4)}`:"redacted"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Timezone"}),t.jsx("dd",{children:e.timezone})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Kind"}),t.jsx("dd",{children:Ef(e.kind)})]}),s&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{children:[t.jsx("dt",{children:"First Light site"}),t.jsx("dd",{children:s.firstLightSiteId})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Facility mapping"}),t.jsx("dd",{children:Rp(s)})]})]})]})]}),t.jsxs("section",{className:S.nodePreviewPanel,children:[t.jsx("span",{className:S.kicker,children:"USD ASSET GRAPH"}),t.jsx("strong",{children:e.phase4Role}),t.jsx("ol",{className:S.layerList,children:e.usdLayerStack.map(i=>t.jsx("li",{children:i},i))})]}),t.jsxs("section",{className:S.nodePreviewPanel,children:[t.jsx("span",{className:S.kicker,children:"CAPABILITIES"}),t.jsx("ul",{className:S.capabilityList,children:e.capabilities.map(i=>t.jsx("li",{children:i},i))})]}),t.jsxs("section",{className:S.nodePreviewPanel,children:[t.jsx("span",{className:S.kicker,children:"AUTHORITY BOUNDARY"}),t.jsx("p",{children:"This is a Phase 4 asset-graph preview. It does not create route execution, evidence packages, secure pause/resume commands, or qualification claims."}),t.jsx("span",{className:S.evidenceBadge,children:"CAPABILITY DEMONSTRATION - NOT A QUALIFICATION CLAIM"})]})]})]})}function Sf(e,n){const a=e.mapPosition.x,s=e.mapPosition.y,i=n.mapPosition.x,r=n.mapPosition.y,c=Math.max(8,Math.abs(i-a)*.22),o=a+(i>a?c:-c),d=i-(i>a?c:-c);return`M${a} ${s} C${o} ${Math.min(s,r)-10}, ${d} ${Math.max(s,r)+8}, ${i} ${r}`}function Cf(e){switch(e.kind){case"evidence":case"qualification":return S.arcEvidence;case"asset-graph":return S.arcAssetGraph;case"route":return S.arcSecondary;case"model":return S.arcPrimary}}function Rf(e){switch(e.kind){case"greenfield-regional-hub":return S.mapNodeGreenfield;case"arc-impact-regional-node":return S.mapNodeRegional;case"scientific-hub":return S.mapNodeScience;case"test-qualification-node":return S.mapNodeTest}}function qi(e){switch(e){case"operational-twin":return"Operational twin";case"asset-graph-preview":return"Asset graph preview";case"data-exchange-preview":return"Data exchange preview";case"qualification-preview":return"Test preview"}}function Ef(e){switch(e){case"greenfield-regional-hub":return"Greenfield regional hub";case"arc-impact-regional-node":return"ARC Impact regional node";case"scientific-hub":return"Scientific hub";case"test-qualification-node":return"Test and qualification node"}}function kf({isOpen:e,sceneManifest:n,sceneAssets:a,selectedStep:s,selectedManifestStep:i,activeAssetIds:r,roleProjection:c,config:o,outboundMessages:d,onInboundMessage:l,flowOverlayBadges:g=null,flowOverlayLegend:u=null}){const _=h.useRef(null),m=h.useRef(null),v=h.useRef(null),p=h.useRef(0),[f,b]=h.useState("idle"),w=o.mode==="stream"&&!!o.streamUrl;return h.useEffect(()=>{let j=!1;if(!e||!w||!o.streamUrl||!_.current){v.current?.dispose(),v.current=null,b("idle");return}return Kp({container:_.current,streamUrl:o.streamUrl,profileId:o.profileId??void 0,onStatus:C=>{j||b(C)},onMessage:l}).then(C=>{if(j){C?.dispose();return}v.current=C}),()=>{j=!0,v.current?.dispose(),v.current=null}},[o.profileId,o.streamUrl,e,l,w]),h.useEffect(()=>{const j=m.current?.contentWindow??null;if(!v.current&&!j)return;const C=d.slice(p.current);
57C.length!==0&&(p.current=d.length,C.forEach(N=>{if(v.current){v.current.send(N);return}j?.postMessage(N,"*")}))},[d,f]),e?w&&o.streamUrl?t.jsxs("div",{className:S.streamShell,"data-testid":"omniverse-stream-pane",children:[t.jsx("div",{ref:_,className:S.streamMount}),f==="sdk-unavailable"&&t.jsx("iframe",{ref:m,title:"Pacific Greenfield Omniverse stream",className:S.streamFrame,src:Pf(o.streamUrl,o.profileId)}),t.jsxs("div",{className:S.streamHud,children:[t.jsx(St,{label:`SDK ${f.toUpperCase()}`,tone:f==="connected"?"green":"amber"}),t.jsx("span",{children:s.label})]}),u&&t.jsx("div",{className:S.flowLegendSlot,children:u})]}):t.jsxs("div",{className:S.staticTwin,"data-testid":"omniverse-static-fallback",children:[t.jsx("div",{className:S.staticViewport,children:t.jsxs("div",{className:S.floorGrid,"aria-label":"Pacific Greenfield floor mock twin",children:[a.map(j=>t.jsxs("button",{type:"button",className:[S.assetBlock,r.has(j.assetId)?S.assetActive:"",j.instanceable?S.assetInstance:"",Tf(j.floor.zoneId)].filter(Boolean).join(" "),style:{gridColumn:`${j.floor.gridColumn} / span ${j.floor.gridWidth}`,gridRow:`${j.floor.gridRow} / span ${j.floor.gridHeight}`},title:c==="cto-metallurgist"?j.primPath:j.category,children:[t.jsx("span",{children:c==="cto-metallurgist"?j.metadata["arcnet:equipmentId"]:j.metadata["arcnet:machineClass"]}),t.jsx("strong",{children:j.label})]},j.assetId)),t.jsx("div",{className:S.routeTrace}),g]})}),u&&t.jsx("div",{className:S.flowLegendSlot,children:u}),t.jsxs("div",{className:S.staticHud,children:[t.jsx("span",{className:S.kicker,children:"SIMREADY STATIC FRAME"}),t.jsx("strong",{children:s.label}),t.jsxs("small",{children:[c==="cto-metallurgist"?i?.overlayPrimPath??s.assetIds.join(" / "):"class-safe route overlay"," | ",s.evidenceRole]})]})]}):t.jsxs("div",{className:S.twinStandby,"data-testid":"twin-standby",children:[t.jsx("span",{children:"PGF-HUB-001"}),t.jsx("strong",{children:"NODE LOCK PENDING"}),t.jsxs("small",{children:[n.stagePath," / ",n.layers.length," layers"]})]})}function St({label:e,tone:n}){return t.jsx("span",{className:`${S.statusPill} ${S[`pill${n}`]}`,children:e})}function Pf(e,n){if(!n)return e;try{const a=new URL(e);return a.searchParams.set("profileId",n),a.toString()}catch{const a=e.includes("?")?"&":"?";return`${e}${a}profileId=${encodeURIComponent(n)}`}}function Tf(e){switch(e){case"powder":return S.zonePowder;case"additive":return S.zoneAdditive;case"thermal":return S.zoneThermal;case"post":return S.zonePost;case"inspection":return S.zoneInspection;case"edge":return S.zoneEdge;default:return""}}const Af={ok:"Replay healthy",watch:"Replay watch",blocked:"Replay blocked"};function Lf(e){return e.auditRef??`audit:${e.id}:${e.status}`}function Of(e){return`command:${e.id}:${e.status}`}function an(e,n){return e.filter(a=>a.status===n).length}function $f({commandReceipts:e,auditReceipts:n,events:a,streamHealth:s}){const i=new Set(n.map(p=>p.id)),r=new Set(a.map(p=>p.id)),c=n.filter(p=>p.action.startsWith("command.receipt.")).length,o=a.filter(p=>p.kind==="command.receipt").length,d=e.filter(p=>!i.has(Lf(p))).map(p=>p.id),l=e.filter(p=>!r.has(Of(p))).map(p=>p.id),g={duplicateFrames:s.duplicateFrames,droppedFrames:s.droppedFrames,outOfOrderFrames:s.outOfOrderFrames,staleFrames:s.staleFrames,malformedFrames:s.malformedFrames,unknownFrames:s.unknownFrames},u=Object.values(g).reduce((p,f)=>p+f,0),_=an(e,"pending"),m=[];d.length>0&&m.push(`missing audit projection for ${d.join(", ")}`),l.length>0&&m.push(`missing event rail projection for ${l.join(", ")}`),_>0&&m.push(`${_} command receipt(s) pending acknowledgement`),u>0&&m.push(`${u} replay/frame issue(s) recorded by stream health`);const v=d.length>0||l.length>0?"blocked":_>0||u>0?"watch":"ok";return{status:v,label:Af[v],commandReceiptCount:e.length,commandAuditReceiptCount:c,commandEventCount:o,pendingCount:_,acceptedCount:an(e,"accepted"),deniedCount:an(e,"denied"),staleStateCount:an(e,"stale-state"),missingAuditRefs:d,missingEventRefs:l,replayCursor:s.lastReplayCursor,replayCounters:g,issues:m}}const Mf="_page_1sawk_1",Df="_header_1sawk_9",Bf="_kicker_1sawk_20",Ff="_title_1sawk_27",qf="_nav_1sawk_34",Hf="_grid_1sawk_56",Wf="_metricStrip_1sawk_64",Gf="_label_1sawk_76",Uf="_exportRow_1sawk_91",zf
57="_exportStatus_1sawk_98",Vf="_exportDetail_1sawk_104",Jf="_exportMeta_1sawk_105",Kf="_empty_1sawk_106",Yf="_button_1sawk_113",Qf="_replayPanel_1sawk_134",Zf="_summaryPanel_1sawk_135",Xf="_recentPanel_1sawk_136",eg="_replayHeader_1sawk_140",tg="_replayStatus_1sawk_147",ng="_replayStatus_ok_1sawk_153",ag="_replayStatus_ok_1sawk_153",sg="_replayStatus_watch_1sawk_157",ig="_replayStatus_watch_1sawk_157",rg="_replayStatus_blocked_1sawk_161",og="_replayStatus_blocked_1sawk_161",cg="_replayCounts_1sawk_165",lg="_replayCounters_1sawk_166",dg="_issueList_1sawk_190",ug="_sloGrid_1sawk_199",mg="_sloBadge_1sawk_206",pg="_sloBadgeHeader_1sawk_213",hg="_sloTarget_1sawk_229",fg="_sloDetail_1sawk_230",gg="_sloBadge_ok_1sawk_241",_g="_sloBadge_ok_1sawk_241",yg="_sloBadge_watch_1sawk_249",vg="_sloBadge_watch_1sawk_249",bg="_sloBadge_breach_1sawk_257",jg="_sloBadge_breach_1sawk_257",xg="_sloBadge_no-data_1sawk_265",Ig="_table_1sawk_273",wg="_metricName_1sawk_298",Ng="_sampleName_1sawk_299",Sg="_samples_1sawk_303",Cg="_sample_1sawk_299",Rg="_sampleTime_1sawk_320",Eg="_sampleTags_1sawk_321",kg="_sampleValue_1sawk_325",H={page:Mf,header:Df,kicker:Bf,title:Ff,nav:qf,grid:Hf,metricStrip:Wf,label:Gf,exportRow:Uf,exportStatus:zf,exportDetail:Vf,exportMeta:Jf,empty:Kf,button:Yf,replayPanel:Qf,summaryPanel:Zf,recentPanel:Xf,replayHeader:eg,replayStatus:tg,replayStatus_ok:ng,replayStatusOk:ag,replayStatus_watch:sg,replayStatusWatch:ig,replayStatus_blocked:rg,replayStatusBlocked:og,replayCounts:cg,replayCounters:lg,issueList:dg,sloGrid:ug,sloBadge:mg,sloBadgeHeader:pg,sloTarget:hg,sloDetail:fg,sloBadge_ok:gg,sloBadgeOk:_g,sloBadge_watch:yg,sloBadgeWatch:vg,sloBadge_breach:bg,sloBadgeBreach:jg,"sloBadge_no-data":"_sloBadge_no-data_1sawk_265",sloBadgeNoData:xg,table:Ig,metricName:wg,sampleName:Ng,samples:Sg,sample:Cg,sampleTime:Rg,sampleTags:Eg,sampleValue:kg};function Fn(e){return e===0?"0":Math.abs(e)<1?e.toFixed(3):Math.abs(e)<100?e.toFixed(2):Math.round(e).toString()}function sn(e){return e.getTime()===0?"never":e.toISOString().slice(11,19)}const Pg={ok:"OK",watch:"WATCH",breach:"BREACH","no-data":"NO DATA"};function Tg(){const[e,n]=h.useState(()=>pn()),[a,s]=h.useState(()=>es()),i=x(m=>m.commandReceipts),r=x(m=>m.auditReceipts),c=x(m=>m.events),o=x(m=>m.streamHealth),d=h.useMemo(()=>$f({commandReceipts:i,auditReceipts:r,events:c,streamHealth:o}),[r,i,c,o]),l=d.status==="blocked"?"error":d.status==="watch"?"warning":"accent",g=h.useMemo(()=>Hc(e),[e]),u=h.useCallback(()=>{n(pn()),s(es())},[]);h.useEffect(()=>{u();const m=window.setInterval(u,1e3);return()=>window.clearInterval(m)},[u]);const _=async()=>{s({status:"exporting",ok:!0,exported:0,at:new Date}),s(await Pi()),n(pn())};return t.jsxs("div",{className:H.page,"data-testid":"diagnostics-page",children:[t.jsxs("header",{className:H.header,children:[t.jsxs("div",{children:[t.jsx("div",{className:H.kicker,children:"OBSERVABILITY · LOCAL"}),t.jsx("h1",{className:H.title,children:"Browser Diagnostics"})]}),t.jsxs("nav",{className:H.nav,children:[t.jsx(Ae,{to:"/role-chooser",children:"[ Portal ]"}),t.jsx(Ae,{to:"/operator",children:"[ Operator ]"})]})]}),t.jsxs("main",{className:H.grid,children:[t.jsx(ie,{title:"Local Metrics Buffer",size:"sm",variant:"accent",children:t.jsxs("div",{className:H.metricStrip,children:[t.jsxs("div",{children:[t.jsx("span",{className:H.label,children:"Buffered"}),t.jsx("strong",{children:e.metrics.length})]}),t.jsxs("div",{children:[t.jsx("span",{className:H.label,children:"Pending Export"}),t.jsx("strong",{children:e.pendingExportCount})]}),t.jsxs("div",{children:[t.jsx("span",{className:H.label,children:"Generated"}),t.jsx("strong",{children:sn(e.generatedAt)})]})]})}),t.jsxs(ie,{title:"OTel Export Boundary",size:"sm",variant:a.ok?"default":"warning",children:[t.jsxs("div",{className:H.exportRow,children:[t.jsxs("div",{children:[t.jsx("div",{className:H.exportStatus,children:a.status.toUpperCase()}),t.jsx("div",{className:H.exportDetail,children:a.endpoint??a.error??"No export attempted yet."})]}),t.jsx("button",{type:"button",className:H.button,onClick:_,disabled:a.status==="exporting",children:"[ Export Now ]"})]}),t.jsxs("div",{className:H.exportMeta,children:["exported=",a.exported," · at=",sn(a.at)]})]}),t.jsxs(ie,{title:"Command / Audit Replay Health",size:"sm",variant:l,className:H.replayPanel,children:[t.jsxs("div",{className:H.replayHeader,"data-testid":"receipt-replay-health",children:[t.jsxs("div",{children:[t.jsx("div",{className:`${H.replayStatus} ${H[`replayStatus_${d.status}`]}`,children:d.label}
57),t.jsxs("div",{className:H.exportDetail,children:["cursor=",d.replayCursor??"none"," · receipts=",d.commandReceiptCount," · audit=",d.commandAuditReceiptCount," · rail=",d.commandEventCount]})]}),t.jsxs("div",{className:H.replayCounts,children:[t.jsxs("span",{children:["accepted ",d.acceptedCount]}),t.jsxs("span",{children:["denied ",d.deniedCount]}),t.jsxs("span",{children:["stale ",d.staleStateCount]}),t.jsxs("span",{children:["pending ",d.pendingCount]})]})]}),t.jsxs("div",{className:H.replayCounters,children:[t.jsxs("span",{children:["duplicate ",d.replayCounters.duplicateFrames]}),t.jsxs("span",{children:["dropped ",d.replayCounters.droppedFrames]}),t.jsxs("span",{children:["out-of-order ",d.replayCounters.outOfOrderFrames]}),t.jsxs("span",{children:["stale frames ",d.replayCounters.staleFrames]}),t.jsxs("span",{children:["malformed ",d.replayCounters.malformedFrames]}),t.jsxs("span",{children:["unknown ",d.replayCounters.unknownFrames]})]}),d.issues.length===0?t.jsx("div",{className:H.empty,children:"command receipts, audit projections, and event rail entries are aligned"}):t.jsx("ul",{className:H.issueList,children:d.issues.map(m=>t.jsx("li",{children:m},m))})]}),t.jsxs(ie,{title:"Metric SLO Surfaces",size:"sm",className:H.summaryPanel,children:[t.jsx("div",{className:H.sloGrid,"aria-label":"Browser metric SLO status",children:g.map(m=>t.jsxs("div",{className:`${H.sloBadge} ${H[`sloBadge_${m.status}`]}`,"data-testid":`slo-badge-${m.id}`,"data-status":m.status,children:[t.jsxs("div",{className:H.sloBadgeHeader,children:[t.jsx("span",{children:m.label}),t.jsx("strong",{children:Pg[m.status]})]}),t.jsx("div",{className:H.sloTarget,children:m.target}),t.jsx("div",{className:H.sloDetail,children:m.detail})]},m.id))}),e.summaries.length===0?t.jsx("div",{className:H.empty,children:"no browser metrics recorded yet"}):t.jsxs("table",{className:H.table,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Name"}),t.jsx("th",{children:"Count"}),t.jsx("th",{children:"Avg"}),t.jsx("th",{children:"Max"}),t.jsx("th",{children:"Last"})]})}),t.jsx("tbody",{children:e.summaries.map(m=>t.jsxs("tr",{children:[t.jsx("td",{className:H.metricName,children:m.name}),t.jsx("td",{children:m.count}),t.jsx("td",{children:Fn(m.average)}),t.jsx("td",{children:Fn(m.max)}),t.jsx("td",{children:sn(m.lastAt)})]},m.name))})]})]}),t.jsx(ie,{title:"Recent Samples",size:"sm",className:H.recentPanel,children:e.metrics.length===0?t.jsx("div",{className:H.empty,children:"no recent samples"}):t.jsx("div",{className:H.samples,children:e.metrics.slice(0,18).map(m=>t.jsxs("div",{className:H.sample,children:[t.jsx("span",{className:H.sampleTime,children:sn(m.at)}),t.jsx("span",{className:H.sampleName,children:m.name}),t.jsx("span",{className:H.sampleValue,children:Fn(m.value)}),t.jsx("span",{className:H.sampleTags,children:Object.entries(m.tags).map(([v,p])=>`${v}=${p}`).join(" ")})]},m.id))})})]})]})}const Ag="_container_3s36o_1",Lg="_tabs_3s36o_10",Og="_tabButton_3s36o_15",$g="_tabButtonActive_3s36o_27",Mg="_sectionTitle_3s36o_34",Dg="_empty_3s36o_42",Bg="_mono_3s36o_49",Fg="_muted_3s36o_55",qg="_windowList_3s36o_61",Hg="_windowRow_3s36o_67",Wg="_windowRowSelected_3s36o_86",Gg="_advisoryBadge_3s36o_90",Ug="_authorityLine_3s36o_100",zg="_rollupNote_3s36o_110",Vg="_factorsTable_3s36o_117",Jg="_claimRow_3s36o_138",Kg="_doiLink_3s36o_145",Yg="_exclusionRow_3s36o_154",Qg="_graphControl
57s_3s36o_160",Zg="_graphInput_3s36o_166",Xg="_graphButton_3s36o_177",e_="_graphError_3s36o_188",t_="_graphSvg_3s36o_194",n_="_graphEdge_3s36o_200",a_="_graphNodeBox_3s36o_206",s_="_graphNodeBoxQuarantined_3s36o_211",i_="_graphNodeLabel_3s36o_215",r_="_graphColumnLabel_3s36o_221",o_="_feedList_3s36o_230",c_="_feedItem_3s36o_236",l_="_feedItemFlagged_3s36o_247",d_="_feedItemQuarantined_3s36o_252",u_="_feedItemRestored_3s36o_256",m_="_feedTop_3s36o_260",p_="_feedBadge_3s36o_267",h_="_feedBadgeWarn_3s36o_275",f_="_feedBadgeDanger_3s36o_279",g_="_feedBadgeOk_3s36o_283",__="_feedBadgeMuted_3s36o_287",y_="_feedDetail_3s36o_291",v_="_age_3s36o_295",L={container:Ag,tabs:Lg,tabButton:Og,tabButtonActive:$g,sectionTitle:Mg,empty:Dg,mono:Bg,muted:Fg,windowList:qg,windowRow:Hg,windowRowSelected:Wg,advisoryBadge:Gg,authorityLine:Ug,rollupNote:zg,factorsTable:Vg,claimRow:Jg,doiLink:Kg,exclusionRow:Yg,graphControls:Qg,graphInput:Zg,graphButton:Xg,graphError:e_,graphSvg:t_,graphEdge:n_,graphNodeBox:a_,graphNodeBoxQuarantined:s_,graphNodeLabel:i_,graphColumnLabel:r_,feedList:o_,feedItem:c_,feedItemFlagged:l_,feedItemQuarantined:d_,feedItemRestored:u_,feedTop:m_,feedBadge:p_,feedBadgeWarn:h_,feedBadgeDanger:f_,feedBadgeOk:g_,feedBadgeMuted:__,feedDetail:y_,age:v_};function sa(e){return e instanceof Date?e:new Date(e)}function b_(e){const n=Math.max(0,Math.floor((Date.now()-sa(e).getTime())/1e3));if(n<60)return`${n}s`;const a=Math.floor(n/60);return a<60?`${a}m`:`${Math.floor(a/60)}h`}function Hi(e){return e.parameters?.length??e.parameterCount??0}function Wi(e){return e.claims?.length??e.claimCount??0}function j_(e,n){return e==null&&n==null?"â":`${e??"ââ"} ⦠${n??"â"}`}function x_({window:e}){const n=!!e.rollup||!e.parameters;return t.jsxs("div",{"data-testid":"jona-context-detail",children:[t.jsxs("div",{className:L.authorityLine,"data-testid":"jona-advisory-badge",children:["advisory â authority gate: ",e.authorityGate]}),t.jsxs("div",{className:L.mono,children:[t.jsx("span",{children:e.targetMaterial}),e.lineage&&t.jsxs("span",{className:L.muted,children:[" · lineage ",e.lineage.join(" â ")]})]}),e.conditions&&e.conditions.length>0&&t.jsxs("div",{className:`${L.mono} ${L.muted}`,children:["conditions:"," ",e.conditions.map(a=>`${a.type}=${a.value}${a.unit?` ${a.unit}`:""}`).join(", ")]}),n?t.jsxs("div",{className:L.rollupNote,"data-testid":"jona-rollup-note",children:["rollup projection â ",Hi(e)," factor(s), ",Wi(e)," claim(s); details withheld for this role"]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:L.sectionTitle,children:"Factors"}),t.jsxs("table",{className:L.factorsTable,"data-testid":"jona-factors-table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"name"}),t.jsx("th",{children:"type"}),t.jsx("th",{children:"bounds"}),t.jsx("th",{children:"unit"})]})}),t.jsx("tbody",{children:(e.parameters??[]).map(a=>t.jsxs("tr",{children:[t.jsx("td",{children:a.name}),t.jsx("td",{children:a.type}),t.jsx("td",{children:a.type==="categorical"?(a.categories??[]).join(", ")||"â":j_(a.minBound,a.maxBound)}),t.jsx("td",{children:a.unit??"â"})]},a.parameterId))})]}),e.properties&&e.properties.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:L.sectionTitle,children:"Responses"}),t.jsx("div",{className:L.mono,children:e.properties.map(a=>`${a.name} (${a.objective})`).join(", ")})]}),e.claims&&e.claims.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:L.sectionTitle,children:"Claims"}),e.claims.map(a=>t.jsxs("div",{className:`${L.claimRow} ${L.mono}`,children:[t.jsxs("span",{children:[a.claimId.slice(0,8)," · ",a.materialId," · conf"," ",a.confidence.toFixed(2)]}),t.jsx("span",{className:L.muted,children:a.evidence.map(s=>s.doi?t.jsxs("a",{className:L.doiLink,href:`https://doi.org/${s.doi}`,target:"_blank",rel:"noreferrer noopener",children:["doi:",s.doi]},s.documentId):t.jsx("span",{children:s.documentId},s.documentId))})]},a.claimId))]}),e.exclusions&&e.exclusions.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:L.sectionTitle,children:"Exclusions"}),e.exclusions.map(a=>t.jsxs("div",{className:`${L.mono} ${L.exclusionRow}`,"data-testid":"jona-exclusion-row",children:[a.claimId.slice(0,8)," â ",a.reason,a.batchId?` (batch ${a.batchId})`:"",a.materialId?` (${a.materialId})`:""]},a.claimId))]})]})]})}function I_(){const e=x(r=>r.jonaContextWindows),n=x(r=>r.selectedJonaContextId),a=x(r=>r.selectJonaContext),s=h.useMemo(()=>Object.values(e).sort((r,c)=>sa(c.generatedAt).getTime()-sa(r.generatedAt).getTime()),[e]),i=n?e[n]:s[0];return s.length===0?t.jsx("div",{className:L.empty,children:"no context windows yet"}):t.jsxs("div",{className:L.container,children:[t.jsx("div",{className:L.windowList,children:s.map(r=>
57t.jsxs("button",{type:"button","data-testid":`jona-window-row-${r.contextId}`,className:`${L.windowRow} ${i?.contextId===r.contextId?L.windowRowSelected:""}`,onClick:()=>a(r.contextId),children:[t.jsx("span",{children:r.targetMaterial}),t.jsxs("span",{className:L.muted,children:["F",Hi(r)," · C",Wi(r)]}),t.jsx("span",{className:L.advisoryBadge,children:"advisory"}),t.jsx("span",{className:L.age,children:b_(r.generatedAt)})]},r.contextId))}),i&&t.jsx(x_,{window:i})]})}const w_={},bn=w_,N_=typeof bn.VITE_JONA_API_URL=="string"&&bn.VITE_JONA_API_URL||"http://localhost:8093",js=typeof bn.VITE_JONA_SERVICE_TOKEN=="string"?bn.VITE_JONA_SERVICE_TOKEN:void 0;function S_(e){return e===401?"unauthorized":e===403?"forbidden":e===404?"not-found":"error"}async function C_(e,n){const a={};js&&(a["x-arcnet-service-token"]=js),n&&(a["x-arcnet-role"]=n);try{const s=await fetch(`${N_}${e}`,{headers:a});if(!s.ok){let i;try{i=(await s.json())?.reason}catch{i=void 0}return{ok:!1,kind:S_(s.status),reason:i}}return{ok:!0,data:await s.json()}}catch(s){return{ok:!1,kind:"error",reason:s instanceof Error?s.message:"network error"}}}function R_(e,n=1,a){const s=new URLSearchParams({rootId:e,depth:String(n)});return C_(`/jona/v1/graph/neighborhood?${s.toString()}`,a)}const Gi=[{label:"materials",kinds:["material"]},{label:"claims",kinds:["claim"]},{label:"factors / evidence",kinds:["parameter","property","condition","evidence","unknown"]},{label:"batches",kinds:["batch"]}],ia=158,qn=146,Gt=16,xs=6,Is=26;function E_(e){return`material:${e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-+)|(-+$)/g,"")}`}function k_(e){const n=e.label??e.id.split(":").pop()??e.id;return n.length>24?`${n.slice(0,23)}â¦`:n}function P_(e){const n=new Map,a=Gi.map(i=>({label:i.label,nodes:e.nodes.filter(r=>i.kinds.includes(r.kind))}));let s=1;return a.forEach((i,r)=>{s=Math.max(s,i.nodes.length),i.nodes.forEach((c,o)=>{n.set(c.id,{x:r*ia+6,y:Is+o*(Gt+xs)})})}),{positions:n,columns:a,height:Is+s*(Gt+xs)+8}}function T_(){const e=x(f=>f.activeRole),n=x(f=>f.selectedJonaContextId?f.jonaContextWindows[f.selectedJonaContextId]:void 0),a=x(f=>f.jonaNeighborhoods),s=x(f=>f.setJonaNeighborhood),i=n?E_(n.targetMaterial):"material:in625",[r,c]=h.useState(i),[o,d]=h.useState(null),[l,g]=h.useState(null),[u,_]=h.useState(!1),m=o?a[o]:void 0,v=h.useCallback(async()=>{const f=r.trim();if(!f)return;_(!0),g(null);const b=await R_(f,2,e??void 0);_(!1),b.ok?(s(b.data),d(b.data.root)):g(b.kind==="forbidden"?"forbidden â this role has no JONA graph visibility":b.kind==="unauthorized"?"unauthorized â jona-service token missing/invalid":b.kind==="not-found"?"no graph data for that root":`graph fetch failed${b.reason?`: ${b.reason}`:""}`)},[e,r,s]),p=h.useMemo(()=>m?P_(m):null,[m]);return t.jsxs("div",{className:L.container,children:[t.jsxs("div",{className:L.graphControl
57s,children:[t.jsx("input",{className:L.graphInput,"data-testid":"jona-graph-root-input",value:r,onChange:f=>c(f.target.value),placeholder:"material:in625","aria-label":"Neighborhood root id"}),t.jsx("button",{type:"button",className:L.graphButton,"data-testid":"jona-graph-load",onClick:()=>void v(),disabled:u,children:u?"loadingâ¦":"load"})]}),l&&t.jsx("div",{className:L.graphError,"data-testid":"jona-graph-error",children:l}),!m&&!l&&t.jsx("div",{className:L.empty,children:"load a neighborhood to render the graph"}),m&&p&&t.jsxs("svg",{className:L.graphSvg,"data-testid":"jona-graph-svg",viewBox:`0 0 ${Gi.length*ia} ${p.height}`,role:"img","aria-label":`JONA graph neighborhood around ${m.root}`,children:[p.columns.map((f,b)=>t.jsx("text",{className:L.graphColumnLabel,x:b*ia+6,y:14,children:f.label},f.label)),m.edges.map(f=>{const b=p.positions.get(f.from),w=p.positions.get(f.to);return!b||!w?null:t.jsx("line",{className:L.graphEdge,x1:b.x+qn/2,y1:b.y+Gt/2,x2:w.x+qn/2,y2:w.y+Gt/2,children:t.jsx("title",{children:f.relation})},`${f.from}->${f.to}:${f.relation}`)}),m.nodes.map(f=>{const b=p.positions.get(f.id);if(!b)return null;const w=f.kind==="batch"&&f.status==="quarantined";return t.jsxs("g",{"data-testid":`jona-graph-node-${f.id}`,children:[t.jsx("rect",{className:`${L.graphNodeBox} ${w?L.graphNodeBoxQuarantined:""}`,x:b.x,y:b.y,width:qn,height:Gt}),t.jsx("text",{className:L.graphNodeLabel,x:b.x+4,y:b.y+11,children:k_(f)}),t.jsx("title",{children:f.id})]},f.id)})]})]})}function ra(e){if(e instanceof Date)return e;if(typeof e=="string"){const n=new Date(e);if(!Number.isNaN(n.getTime()))return n}return new Date(0)}function Ui(e){const n=Math.max(0,Math.floor((Date.now()-ra(e).getTime())/1e3));if(n<60)return`${n}s`;const a=Math.floor(n/60);return a<60?`${a}m`:`${Math.floor(a/60)}h`}const A_={success:"transacted",partial:"partial",skipped:"skipped",flagged:"flagged"};function L_({event:e}){const n=e.status==="quarantined",a=e.reason??e.reasonCategory;return t.jsxs("div",{className:`${L.feedItem} ${n?L.feedItemQuarantined:L.feedItemRestored}`,"data-testid":"jona-feed-quarantine",children:[t.jsxs("div",{className:L.feedTop,children:[t.jsx("span",{className:`${L.feedBadge} ${n?L.feedBadgeWarn:L.feedBadgeOk}`,children:n?"quarantined":"restored"}),t.jsxs("span",{children:["batch ",e.batchId]}),t.jsx("span",{className:L.age,children:Ui(e.receivedAt)})]}),a&&t.jsxs("div",{className:L.feedDetail,children:["reason: ",a]}),e.justification&&t.jsxs("div",{className:L.feedDetail,children:["justification: ",e.justification]}),e.authorType&&t.jsxs("div",{className:L.feedDetail,children:["by ",e.authorId??e.authorType," (",e.authorType,")"]})]})}function O_({receipt:e}){const n=e.status==="flagged",a=(e.results??[]).filter(i=>i.action==="flagged"),s=n?L.feedBadgeDanger:e.status==="success"?L.feedBadgeOk:L.feedBadgeMuted;return t.jsxs("div",{className:`${L.feedItem} ${n?L.feedItemFlagged:""}`,"data-testid":n?"jona-feed-flagged":"jona-feed-receipt",children:[t.jsxs("div",{className:L.feedTop,children:[t.jsx("span",{className:`${L.feedBadge} ${s}`,children:A_[e.status]}),t.jsxs("span",{children:["claim ",e.claimId.slice(0,8)]}),t.jsx("span",{className:L.age,children:Ui(e.receivedAt)})]}),n&&t.jsxs("div",{className:L.feedDetail,children:["agent write blocked by human-override protection",a.map(i=>t.jsxs("div",{children:[i.id,i.latestAuthor?` â protected by ${i.latestAuthor.authorId}`:""]},i.id))]})]})}function zi(){const e=x(s=>s.jonaQuarantineEvents),n=x(s=>s.jonaClaimReceipts),a=h.useMemo(()=>[...e.map((i,r)=>({key:`quarantine:${i.eventId??`${i.batchId}:${i.status}:${r}`}`,at:ra(i.receivedAt),kind:"quarantine",event:i})),...n.map(i=>({key:`receipt:${i.ingestId}`,at:ra(i.receivedAt),kind:"receipt",receipt:i}))].sort((i,r)=>r.at.getTime()-i.at.getTime()).slice(0,30),[e,n]);return t.jsx(ie,{title:"JONA safety feed",variant:"accent",size:"sm",children:a.length===0?t.jsx("div",{className:L.empty,children:"no quarantine or claim activity yet"}):t.jsx("div",{className:L.feedList,"data-testid":"jona-feed-list",children:a.map(s=>s.kind==="quarantine"?t.jsx(L_,{event:s.event},s.key):t.jsx(O_,{receipt:s.receipt},s.key))})})}const $_=[{id:"context-windows",label:"Context Windows"},{id:"graph",label:"Graph"},{id:"safety-feed",label:"Safety Feed"}];function Vi(){const[e,n]=h.useState("context-windows");return t.jsx(ie,{title:"JONA research graph",variant:"accent",size:"sm",children:t.jsxs("div",{className:L.container,children:[t.jsx("div",{className:L.tabs,role:"tablist","aria-label":"JONA module tabs",children:$_.map(({id:a,label:s})=>t.jsx("button",{type:"button",role:"tab","aria-selected":e===a,"data-testid":`jona-tab-${a}`,className:`${L.tabButton} ${e===a?L.tabButtonActive:""}`,onClick:()=>n(a),children:s},a))}),e==="context-windows"&&t.jsx(I_,{}),e==="graph"&&t.jsx(T_,{}),e==="safety-feed"&&t.jsx(zi,{})]})})}function M_(e){const{url:n,autoReconnect:a=!0,reconnectDelay:s=1e3,maxReconnectDelay:i=3e4,heartbeatInterval:r=3e4,onOpen:c,onClose:o,onError:d,onMessage:l}=e,[g,u]=h.useState("disconnected"),_=h.useRef(null),m=h.useRef(null),v=h.useRef(null),p=h.useRef(0),f=h.useRef([]),b=h.useRef(!0),w=h.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),v.current&&(clearInterval(v.current),v.current=null)},[]),j=h.useCallback(()=>
57{if(!n){u("disconnected");return}if(_.current?.readyState!==WebSocket.OPEN){u("connecting"),w();try{const R=new WebSocket(n);_.current=R,R.onopen=()=>{for(console.log("[WebSocket] Connected to",n),u("connected"),p.current=0;f.current.length>0;){const E=f.current.shift();E&&R.send(JSON.stringify(E))}v.current=setInterval(()=>{R.readyState===WebSocket.OPEN&&R.send(JSON.stringify({type:"ping"}))},r),c?.()},R.onclose=()=>{if(console.log("[WebSocket] Disconnected"),u("disconnected"),w(),o?.(),a&&b.current){const E=Math.min(s*Math.pow(2,p.current),i);p.current++,console.log(`[WebSocket] Reconnecting in ${E}ms (attempt ${p.current})`),m.current=setTimeout(()=>{j()},E)}},R.onerror=E=>{console.error("[WebSocket] Error:",E),u("error"),d?.(E)},R.onmessage=E=>{try{const A=JSON.parse(E.data);l?.(A)}catch(A){console.error("[WebSocket] Failed to parse message:",A)}}}catch(R){console.error("[WebSocket] Connection failed:",R),u("error")}}},[n,a,s,i,r,c,o,d,l,w]),C=h.useCallback(()=>{b.current=!1,w(),_.current&&(_.current.close(),_.current=null),u("disconnected")},[w]),N=h.useCallback(()=>{b.current=!0,p.current=0,C(),setTimeout(j,100)},[j,C]),T=h.useCallback(R=>{_.current?.readyState===WebSocket.OPEN?_.current.send(JSON.stringify(R)):f.current.push(R)},[]);return h.useEffect(()=>(n&&j(),()=>{b.current=!1,C()}),[n,j,C]),{state:g,send:T,reconnect:N,disconnect:C}}function D_(e){return Object.values(e??{}).reduce((n,a)=>n+a,0)}function B_(e){return e.severity==="critical"?"error":"warn"}function F_(e){if(e.dlqCount>0)return`Correction ingest DLQ observed ${e.dlqCount} invalid record(s)`;const n=e.recordsIgnored??0;return n>0?`Correction ingest ignored ${n} non-process record(s)`:`Correction observability ${e.severity} with ${D_(e.issueCounts)} issue(s)`}function Et(e,n=new Date){if(e instanceof Date&&!Number.isNaN(e.getTime()))return e;if(typeof e=="string"){const a=new Date(e);if(!Number.isNaN(a.getTime()))return a}return n}function q_(e,n,a){return`${e}:${a.toISOString()}:${n}`}function H_(e){const n=Et(e.at);return{id:q_(e.jobId,e.seal,n),jobId:e.jobId,seal:e.seal,at:n}}function W_(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const n=e,a=n.id??n.jobId??n.nodeId??n.ref;if(typeof a=="string")return a;try{return JSON.stringify(e).slice(0,80)}catch{return"[object]"}}return e==null?"unspecified subject":String(e)}function G_(e){const n=e.status==="quarantined",a=e.reason??e.reasonCategory;return{id:`jona-quarantine:${e.eventId??`${e.batchId}:${e.status}`}`,kind:"jona.quarantine",severity:n?"warn":"info",message:n?`JONA: batch ${e.batchId} quarantined${a?` (${a})`:""}`:`JONA: batch ${e.batchId} restored to active`,at:Et(e.receivedAt),details:{batchId:e.batchId,status:e.status,reason:e.reason,reasonCategory:e.reasonCategory,authorType:e.authorType}}}function U_(e){const n=(e.results??[]).filter(a=>a.action==="flagged");return{id:`jona-receipt:${e.ingestId}`,kind:"jona.claim-transacted",severity:"warn",message:"JONA: agent write blocked by human-override protection",at:Et(e.receivedAt),details:{claimId:e.claimId,ingestId:e.ingestId,flaggedIds:n.map(a=>a.id),latestAuthors:n.map(a=>a.latestAuthor?.authorId).filter(Boolean)}}}function z_(e,n,a=!1){switch(e.type){case"facility.update":n.upsertFacility(e.facility);break;case"node.update":n.upsertNode(e.node);break;case"job.update":n.upsertJob(e.job);break;case"signal.sample":n.appendSignalSample(e.sample);break;case"signal.event":n.appendSignalEvent(e.event);break;case"process.state":n.appendProcessState(e.processState),n.appendEvent({id:`process:${e.processState.id}`,kind:"process.state",severity:"warn",message:`Process anomaly on ${e.processState.equipmentId}`,at:e.processState.observedAt,nodeId:e.processState.nodeId,jobId:e.processState.jobId,details:{processStateId:e.processState.id,equipmentId:e.processState.equipmentId,machineClass:e.processState.machineClass,phase:e.processState.phase}});break;case"control.decision":n.appendControlDecision(e.decision),n.appendEvent({id:`decision:${e.decision.id}`,kind:"control.decision",severity:e.decision.status==="selected"?"success":"warn",message:`Control decision ${e.decision.status} for ${e.decision.processStateId.slice(-8)}`,at:e.decision.decidedAt,jobId:e.decision.jobId,details:{decisionId:e.decision.id,processStateId:e.decision.processStateId,reason:e.decision.reason}});break;case"intervention.command":n.appendIntervention(e.intervention);break;case"correction.outcome":n.appendCorrectionOutcome(e.outcome);break;case"correction.observability":n.appendCorrectionObservability(e.observability),(e.observability.severity!=="nominal"||e.observability.dlqCount>0)&&n.appendEvent({id:`correction-observability:${e.observability.id}`,kind:"correction.observability",severity:B_(e.observability),message:F_(e.observability),at:e.observability.recordedAt,jobId:e.observability.jobId??void 0,details:{source:e.observability.source,severity:e.observability.severity,issueC
57ounts:e.observability.issueCounts,dlqCount:e.observability.dlqCount,dlqTopicCounts:e.observability.dlqTopicCounts,recordsSeen:e.observability.recordsSeen,recordsIgnored:e.observability.recordsIgnored}});break;case"relational.prediction":n.appendRelationalPrediction(e.prediction),n.appendEvent({id:`relational:${e.prediction.id}`,kind:"relational.prediction",severity:"info",message:`Relational advisory ${e.prediction.scoreBand}/${e.prediction.confidenceBand} for ${e.prediction.targetId.slice(-8)}`,at:e.prediction.generatedAt,details:{predictionId:e.prediction.id,targetId:e.prediction.targetId,modelRef:e.prediction.modelRef,scoreBand:e.prediction.scoreBand,confidenceBand:e.prediction.confidenceBand}});break;case"attestation.result":n.setAttestationResult(e.result);break;case"token-ring.pass":n.appendTokenRingPass(e.pass);break;case"model.release":n.appendModelRelease(e.release);break;case"facility.rollup":n.upsertFacilityRollup(e.rollup);break;case"event.log":n.appendEvent(e.event);break;case"jona.context-window":n.upsertJonaContextWindow(e.contextWindow);break;case"jona.doe-config":n.appendEvent({id:`jona-doe-config:${e.doeConfig.contextId??"unscoped"}:${Date.now()}`,kind:"jona.doe-config",severity:"info",message:`JONA DoE config advisory dispatched (authority gate: ${e.doeConfig.authorityGate})`,at:new Date,details:{contextId:e.doeConfig.contextId}});break;case"jona.quarantine":{const s={...e.quarantine,receivedAt:new Date};n.appendJonaQuarantineEvent(s),n.appendEvent(G_(s));break}case"jona.claim-transacted":{const s={...e.receipt,receivedAt:new Date};n.appendJonaClaimReceipt(s),s.status==="flagged"&&n.appendEvent(U_(s));break}case"jona.flow.snapshot":e.snapshot?.snapshotId&&n.upsertFlowSnapshot(e.snapshot);break;
57case"jona.flow.constraint":e.constraintAssessment?.assessmentId&&n.setFlowConstraintAssessment(e.constraintAssessment);break;case"jona.flow.simulation-run":e.simulationRun?.runId&&n.upsertFlowSimulationRun(e.simulationRun);break;case"jona.flow.dbr-schedule":e.dbrSchedule?.scheduleId&&n.upsertFlowDbrSchedule(e.dbrSchedule);break;case"jona.flow.recommendation":e.recommendation?.recommendationId&&n.upsertFlowRecommendation(e.recommendation);break;case"jona.flow.disposition":e.disposition?.dispositionId&&n.recordFlowDisposition(e.disposition);break;case"evidence.updated":{const s=H_(e.envelope);n.appendEvidenceReceipt(s),n.appendEvent({id:`evidence:${s.id}`,kind:"evidence.updated",severity:"success",message:`Evidence receipt updated for ${s.jobId}`,at:s.at,jobId:s.jobId,details:{receiptId:s.id,seal:s.seal}}),a&&console.log("[Telemetry] Evidence updated:",s.jobId);break}case"command.receipt":{const s={...e.receipt,requestedAt:Et(e.receipt.requestedAt),acknowledgedAt:e.receipt.acknowledgedAt?Et(e.receipt.acknowledgedAt):void 0};n.recordCommandReceipt(s),a&&console.log("[Telemetry] Command receipt:",s);break}case"audit.record":{const s={...e.record,at:Et(e.record.at)};n.appendAuditReceipt(s),n.appendEvent({id:`audit:${s.id}`,kind:"audit.record",severity:"info",message:`Audit ${s.action} by ${s.role} on ${W_(s.subject)}`,at:s.at,details:{auditId:s.id,actor:s.actor,role:s.role,action:s.action,subject:s.subject,attestationRef:s.attestationRef}}),a&&console.log("[Telemetry] Audit:",s);break}default:a&&console.warn("[Telemetry] Unknown message type:",e)}}const V_=1,ws=new Set(["facility.update","node.update","job.update","signal.sample","signal.event","process.state","control.decision","intervention.command","correction.outcome","correction.observability","relational.prediction","attestation.result","token-ring.pass","model.release","audit.record","evidence.updated","command.receipt","facility.rollup","event.log","jona.claim-transacted","jona.context-window","jona.doe-config","jona.quarantine","jona.flow.snapshot","jona.flow.constraint","jona.flow.simulation-run","jona.flow.dbr-schedule","jona.flow.recommendation","jona.flow.disposition"]);function Na(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function J_(e){return Na(e)&&"schemaVersion"in e&&"payload"in e}function Ns(e){if(e instanceof Date)return Number.isNaN(e.getTime())?void 0:e;if(typeof e!="string")return;const n=new Date(e);return Number.isNaN(n.getTime())?void 0:n}function oa(e,n,a){return{kind:e,message:n,type:a?.type,eventId:a?.eventId,sequence:a?.sequence,at:new Date}}function K_(e){if(typeof e!="string")return null;const[n]=e.split("."),a=Number.parseInt(n,10);return Number.isFinite(a)?a:null}function ee(e,n){return Na(e)&&n in e?e[n]:e}function Y_(e,n){switch(e){case"facility.update":return{type:e,facility:ee(n,"facility")};case"node.update":return{type:e,node:ee(n,"node")};case"job.update":return{type:e,job:ee(n,"job")};case"signal.sample":return{type:e,sample:ee(n,"sample")};case"signal.event":return{type:e,event:ee(n,"event")};case"process.state":return{type:e,processState:ee(n,"processState")};case"control.decision":return{type:e,decision:ee(n,"decision")};case"intervention.command":return{type:e,intervention:ee(n,"intervention")};case"correction.outcome":return{type:e,outcome:ee(n,"outcome")};case"correction.observability":return{type:e,observability:ee(n,"observability")};case"relational.prediction":return{type:e,prediction:ee(n,"prediction")};case"attestation.result":return{type:e,result:ee(n,"result")};case"token-ring.pass":return{type:e,pass:ee(n,"pass")};case"model.release":return{type:e,release:ee(n,"release")};case"audit.record":return{type:e,record:ee(n,"record")};case"evidence.updated":return{type:e,envelope:ee(n,"envelope")};case"command.receipt":return{type:e,receipt:ee(n,"receipt")};case"facility.rollup":return{type:e,rollup:ee(n,"rollup")};case"event.log":return{type:e,event:ee(n,"event")};case"jona.claim-transacted":return{type:e,receipt:ee(n,"receipt")};case"jona.context-window":return{type:e,contextWindow:ee(n,"contextWindow")};case"jona.doe-config":return{type:e,doeConfig:ee(n,"doeConfig")};case"jona.quarantine":return{type:e,quarantine:ee(n,"quarantine")};case"jona.flow.snapshot":return{type:e,snapshot:ee(n,"snapshot")};case"jona.flow.constraint":return{type:e,constraintAssessment:ee(n,"constraintAssessment")};case"jona.flow.simulation-run":return{type:e,simulationRun:ee(n,"simulationRun")};case"jona.flow.dbr-schedule":return{type:e,dbrSchedule:ee(n,"dbrSchedule")};case"jona.flow.recommendation":return{type:e,recommendation:ee(n,"recommendation")};case"jona.flow.disposition":return{type:e,disposition:ee(n,"disposition")}}}function Hn(e,n,a){const s=Ns(e.observedAt),i=Ns(e.emittedAt),r=typeof e.freshnessTtlMs=="number"&&!!i&&i.getTime()+e.freshnessTtlMs<n;return{format:"enveloped",type:e.type,eventId:e.eventId,topic:e.topic,entityType:e.entityType,roleProjection:e.roleProjection,correlationId:e.correlationId,causationId:e.causationId,traceId:e.traceId,observedAt:s,emittedAt:i,freshnessTtlMs:e.freshnessTtlMs,sequence:e.sequence,replayCursor:e.replayCursor,stale:r,issue:a??(r?oa("stale-frame","Stream frame exceeded its freshness TTL.",e):void 0)}}
57function Q_(e,n=Date.now()){if(!Na(e))return{message:null,streamRecord:{format:"malformed",issue:{kind:"malformed-envelope",message:"Telemetry frame was not an object.",at:new Date(n)}}};if(!J_(e)){const i=e.type;return typeof i!="string"||!ws.has(i)?{message:null,streamRecord:{format:"legacy",type:typeof i=="string"?i:void 0,issue:{kind:"unknown-frame-type",message:"Legacy telemetry frame type is not documented.",type:typeof i=="string"?i:void 0,at:new Date(n)}}}:{message:e,streamRecord:{format:"legacy",type:i}}}return K_(e.schemaVersion)!==V_?{message:null,streamRecord:Hn(e,n,oa("unsupported-major-version",`Unsupported ARCNet UI stream envelope major version: ${String(e.schemaVersion)}`,e))}:typeof e.type!="string"||!ws.has(e.type)?{message:null,streamRecord:Hn(e,n,oa("unknown-frame-type","Enveloped telemetry frame type is not documented.",e))}:{message:Y_(e.type,e.payload),streamRecord:Hn(e,n)}}const Z_=new Set(["at","acknowledgedAt","createdAt","deadline","decidedAt","expires","generatedAt","issuedAt","lastSeen","lastUpdated","measuredAt","observedAt","passedAt","received","recordedAt","requestedAt","sampledAt","sealedAt","submittedAt","timestamp","verifiedAt","windowEnd","windowStart"]);function Ss(e){if(typeof e!="string")return e;const n=new Date(e);return Number.isNaN(n.getTime())?e:n}function ca(e,n){return Array.isArray(e)?n==="networkModeHistory"?e.map(a=>Array.isArray(a)&&a.length>0?[Ss(a[0]),...a.slice(1)]:a):e.map(a=>ca(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,s])=>[a,ca(s,a)])):n&&Z_.has(n)?Ss(e):e}function Ji(e){const{url:n,debug:a=!1,enableEnvelopeBridge:s=xi}=e,i=x(),r=h.useCallback(_=>{if(!_||typeof _!="object"){a&&console.warn("[Telemetry] Invalid message:",_);return}const m=Q_(ca(_)),v=m.message,p=m.streamRecord.type??"unknown";if(ot("ui_stream_frames_total",1,{format:m.streamRecord.format,type:p}),m.streamRecord.stale&&ot("ui_stream_frames_stale_total",1,{type:p}),s){const f=i.recordStreamFrame(m.streamRecord);if(!f.accepted){ot("ui_stream_frames_dropped_total",1,{type:p,reason:f.duplicate?"duplicate":m.streamRecord.issue?.kind??"stream-contract"}),a&&console.warn("[Telemetry] Frame rejected by stream contract bridge:",m.streamRecord);return}}if(!v){ot("ui_stream_frames_dropped_total",1,{type:p,reason:m.streamRecord.issue?.kind??"undispatchable"}),a&&console.warn("[Telemetry] Undispatchable message:",m.streamRecord);return}try{z_(v,i,a)}catch(f){console.error("[Telemetry] Error processing message:",f,v)}},[i,a,s]),c=h.useCallback(()=>{console.log("[Telemetry] Connected to ARCNet telemetry stream"),i.setConnected(!0)},[i]),o=h.useCallback(()=>{console.log("[Telemetry] Disconnected from ARCNet telemetry stream"),i.setConnected(!1)},[i]),d=h.useCallback(_=>{console.error("[Telemetry] WebSocket error:",_),i.setConnected(!1)},[i]),{state:l,reconnect:g,disconnect:u}=M_({url:n,autoReconnect:!0,reconnectDelay:2e3,maxReconnectDelay:3e4,heartbeatInterval:3e4,onOpen:c,onClose:o,onError:d,onMessage:r});return{connectionState:l,reconnect:g,disconnect:u}}const Jt="ALPHA",X_=7,ey=1500,Cs=["IN625","MAR-M247","CM247LC","Ti-6Al-4V"],jn=[{id:"binder-jet",type:"binder-jet",machineClass:"additive-binder-jet",telemetry:["layer-health","binder-saturation"]},{id:"sinter",type:"sintering",machineClass:"sintering-furnace",telemetry:["thermal","arc-signal"]},{id:"hip",type:"hip",machineClass:"hip",telemetry:["pressure","thermal"]},{id:"heat-treatment",type:"heat-treatment",machineClass:"thermal-processing",telemetry:["thermal"]},{id:"cnc",type:"cnc-machining",machineClass:"subtractive",telemetry:["geometry","vibration"]},{id:"coating",type:"thermal-coating-spray",machineClass:"coating",telemetry:["thermal","deposition"]},{id:"inspect",type:"inspection",machineClass:"materials-processing",telemetry:["geometry"]},{id:"test",type:"test",machineClass:"materials-processing",telemetry:["machine-health"]}],ty=[{id:"BOSTON-MA",position:[-71.0589,42.3601],networkMode:"connected-normal",attestationFresh:!0},{id:"PITTSBURGH-PA",position:[-79.9959,40.4406],networkMode:"connected-normal",attestationFresh:!0},{id:"ANN-ARBOR-MI",position:[-83.743,42.2808],networkMode:"connected-normal",attestationFresh:!0},{id:"DALLAS-TX",position:[-96.797,32.7767],networkMode:"connected-degraded",attestationFresh:!0},{id:"MONTEREY-CA",position:[-121.8947,36.6002],networkMode:"connected-normal",attestationFresh:!0}
57,{id:"OAHU-HI",position:[-157.8583,21.3069],networkMode:"connected-normal",attestationFresh:!0},{id:"WILMINGTON-OH",position:[-83.8285,39.4453],networkMode:"disconnected-local",attestationFresh:!1}];function X(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`}function Oe(e,n){return e+(Math.random()-.5)*n}function ny(){return{id:Jt,name:"ORNL Knoxville Hub",position:[-84.2696,35.9311],timezone:"America/New_York",nodeCount:X_}}function ay(){return ty.map((e,n)=>({id:`${e.id}-node-${String(n+1).padStart(3,"0")}`,facilityId:Jt,class:"production",networkMode:e.networkMode,position:e.position,lastSeen:new Date,attestationFresh:e.attestationFresh,tokenHeld:n===0,activeJobs:[]}))}function sy(e){return{id:"route-ornl-hot-section-hello-world",revision:"rev-2026-06-14",partFamilyId:"micro-turbine-hot-section",materialFamily:"nickel-superalloy",ownerRole:"ornl-metallurgist",issuedAt:e,expiresAt:null,steps:jn.map((n,a)=>({id:n.id,ordinal:a+1,type:n.type,requiredMachineClass:n.machineClass,inputTrackables:a===0?["powder-lot"]:[jn[a-1].id],outputTrackables:[n.id],expectedTelemetry:n.telemetry,safetyPolicy:{securePauseAllowed:!0,localPepRequired:!0},evidenceRequirements:["manifest-proof","machine-identity","operator-session-proof"],payloadRef:`payload://${n.id}/ornl-hot-section`})),securityPolicy:{manifestRequired:!0,policyLeaseRequired:!0,revocationEpochRequired:!0},notes:"Mock ORNL hot-section route proof for console review."}}function Ut(e=Math.random()<.35){const n=e?"MAR-M247":Cs[Math.floor(Math.random()*Cs.length)],a=e?"mbj-superalloy-hot-section":n.startsWith("Ti")?"mbj-titanium":"mbj-superalloy",s=new Date,i=e?sy(s):null;return{id:X("JOB"),facilityId:Jt,status:"submitted",type:a,anonymizedId:`ARC-${String(Math.floor(Math.random()*9999)).padStart(4,"0")}-ALPHA`,powderLotId:`LOT-${String(Math.floor(Math.random()*99999)).padStart(5,"0")}`,geometryRef:`cad://${n}/${X("geom")}`,thermalCurveRef:`curve://${n}/${X("therm")}`,simulationRevision:`frontier-${s.toISOString().slice(0,10)}`,submittedAt:s,targetNodeClass:"production",processRoute:i,manifestId:i?"manifest-ornl-hot-section-replay":null,activeStepId:null,completedStepIds:[],signoffRequired:["ornl-metallurgist"]}}function iy(e,n,a){const s=Math.random()<.05?Oe(.18,.04):Oe(.06,.015),i={};for(const r of[-4,-3,-2,-1,0,1,2,3,4,5,6])i[r]=Oe(1.1+r*.02,.12);return{nodeId:e,jobId:n,equipmentId:a,sampledAt:new Date,windowStart:new Date(Date.now()-1e3),windowEnd:new Date,deltaAlpha:s,hQ:i,spectrumWidth:s,binnedEnergyRate:Oe(1.2,.3)}}function ry(e){if(e.deltaAlpha>.15)return{id:X("evt"),nodeId:e.nodeId,jobId:e.jobId,equipmentId:e.equipmentId,kind:"phase-transition",magnitude:e.deltaAlpha,thresholdCrossed:.12,at:new Date};const n=e.hQ[2]??1,a=e.hQ[6]??1;return n<.8||n>1.8||a<.6||a>1.4?{id:X("evt"),nodeId:e.nodeId,jobId:e.jobId,equipmentId:e.equipmentId,kind:"ageing-drift",magnitude:Math.max(Math.abs(n-1.3),Math.abs(a-1)),thresholdCrossed:1.3,at:new Date}:null}function Ki(e,n,a){const s=Math.random()<.72?"binder-compensate":"stride-compensate",i=s==="binder-compensate"?{saturationDeltaPct:Number(Oe(6.5,2.4).toFixed(2))}:{strideDeltaMm:Number(Oe(-.05,.04).toFixed(3))};return{id:X("iv"),jobId:e??X("SIMJOB"),targetEquipmentId:n,action:s,params:i,justificationRef:`control-candidate:${a}`,deadline:new Date(Date.now()+2e3),issuedAt:new Date}}function Yi(e,n,a,s){const i=Math.random()<.55,r=Number(Oe(.58,.22).toFixed(2));return{id:X("process"),jobId:n??X("SIMJOB"),nodeId:e,equipmentId:a,machineClass:"additive-binder-jet",phase:"printing",observedAt:new Date,features:{layerIndex:320+s%90,severity:r,anomalyAreaMm2:Number(Oe(7.5,4.5).toFixed(2))},anomaly:{kind:i?"dry-line":"powder-wave",confidence:Number(Oe(.93,.08).toFixed(2)),severity:r,source:"mock-layer-detector"},baselineRef:`mock-layer-baseline:${a}`,telemetryPolicy:{stateClass:"geometry",role:"control-bearing",localRetention:"PT24H",uplinkReduction:"anomaly-only",evidenceBearing:!0,learningBearing:!0}}}function Rs(){const e=Math.random();return e<.22?"low":e<.74?"medium":"high"}function Qi(e){return{id:X("prediction"),taskId:`task:correction-efficacy:${e}`,kind:"correction-efficacy",targetId:e,labelKind:"correction-success",scoreBand:Rs(),confidenceBand:Rs(),modelRef:"relational/baseline-correction-efficacy-v0",contextRef:`context:correction-efficacy:${e}`,generatedAt:new Date}}function Zi(e,n,a,s){const i=n.action,r=Number(Oe(s?1.72:1.42,.26).toFixed(3)),c={id:a,jobId:e.jobId,processStateId:e.id,targetEquipmentId:e.equipmentId,machineClass:e.machineClass,action:i,params:n.params,source:"deterministic-planner",horizonMs:1e3,score:r,cost:Number(Oe(.46,.18).toFixed(3)),constraints:i==="binder-compensate"?["binder-delta-bounds","next-layer-deadline"]:["stride-delta-bounds","next-layer-deadline"],expectedOutcome:{relationalAdvisory:!!s,relationalPredictionId:s?.id,relationalScoreBand:s?.scoreBand},generatedAt:new Date(Date.now()-300)};return{id:X("decision"),jobId:e.jobId,processStateId:e.id,status:"selected",reason:"bounded-correction-selected",selectedCandidate:c,rejectedCandidates:[],intervention:n,decidedAt:new Date,latencyBudgetMs:2e3}}function Xi(e,n,a){const s=Math.random(),i=s<.86?"applied":s<.93?"ignored":s<.98?"unsupported":"failed";return{id:X("outcome"),decisionId:n.id,interventionId:e.id,equipmentId:e.targetEquipmentId,status:i,measuredAt:new Date,verification:{action:e.action,equipmentResult:i,controlDelta:e.action==="binder-compensate"?{candidateId:a,controlKind:"binder-saturation",action:e.action,params:e.params}:{candidateId:a,controlKind:"stride-compensation",action:e.action,params:e.params}},evidenceRef:`sim-correction:${n.processStateId}`}}function er(e,n,a,s){const i=Math.max(0,a.measuredAt.getTime()-e.observedAt.getTime()),r=Math.max(0,n.decidedAt.getTime()-e.observedAt.getTime()),c=typeof n.latencyBudgetMs=="number"&&i>n.latencyBudgetMs,o=!!a.evidenceRef,d={};c&&(d.budgetBreach=1),o||(d.evidenceMissing=1),a.status==="unsupported"&&(d.outcomeUnsupported=1),a.status==="failed"&&(d.outcomeFailed=1);const l=Object.values(d).reduce((g,u)=>g+u,0);return{id:X("obs"),source:"simulator",severity:a.status==="failed"?"critical":l>0?"watch":"nominal",windowStart:e.observedAt,windowEnd:a.measuredAt,processStateId:e.id,decisionId:n.id,outcomeId:a.id,jobId:e.jobId,equipmentId:e.equipmentId,loopLatencyMs:i,decisionLatencyMs:r,latencyBudgetMs:n.latencyBudgetMs??null,budgetBreached:c,advisoryPresent:!!s,outcomeStatus:a.status,evidenceRecorded:o,evidenceRef:a.evidenceRef,dlqCount:0,dlqTopicCounts:{},recordsSeen:1,recordsValid:1,recordsInvalid:0,recordsIgnored:0,correctionCount:1,outcomeCount:1,issueCounts:d,recordedAt:new Date}}function oy(e,n,a){const s=[];n.slice(0,3).forEach((i,r)=>{const c=r===0?{...a,nodeId:i.id,status:"printing"}:{...Ut(),nodeId:i.id,status:"printing"};e.upsertJob(c);const o=`${i.id}-printer-${String(r+1).padStart(2,"0")}`,d=X("candidate"),l=Yi(i.id,c.id,o,r+1),g=Ki(c.id,o,d),u=r===1?null:Qi(d);u&&(u.scoreBand=r===0?"high":"medium",u.confidenceBand="high");const _=Zi(l,g,d,u),m=Xi(g,_,d);m.status=r===2?"verified-stable":"applied",m.verification={...m.verification,equipmentResult:m.status};const v=er(l,_,m,u);e.appendProcessState(l),e.appendEvent({id:X("log"),kind:"process.state",severity:"warn",message:`${l.anomaly?.kind??"anomaly"} on ${o}`,at:l.observedAt,nodeId:i.id,jobId:c.id,details:{processStateId:l.id,equipmentId:o,phase:l.phase}}),u&&(e.appendRelationalPrediction(u),e.appendEvent({id:X("log"),kind:"relational.prediction",severity:"info",message:`Relational advisory ${u.scoreBand}/${u.confidenceBand} for ${d.slice(-8)}`,at:u.generatedAt,nodeId:i.id,jobId:c.id,details:{predictionId:u.id,targetId:u.targetId,modelRef:u.modelRef}})),e.appendControlDecision(_),e.appendIntervention(g),e.appendCorrectionOutcome(m),e.appendCorrectionObservability(v),e.appendEvent({id:X("log"),kind:"correction.outcome",severity:"success",message:`${g.action} ${m.status} on ${o}`,at:m.measuredAt,nodeId:i.id,jobId:c.id,details:{decisionId:_.id,outcomeId:m.id,evidenceRef:m.evidenceRef}}),s.push(l.id)}),e.selectCorrectionTrace(s[0]??null)}function cy(e){if(e.processRoute){if(e.status==="downlink-complete")return"route-ready";if(e.status==="route-ready")return"step-running";if(e.status==="step-running")return"step-complete";if(e.status==="step-complete")return(e.completedStepIds?.length??0)>=e.processRoute.steps.length?"route-complete":"step-running"}return{submitted:"downlink-pending","downlink-pending":"downlink-complete","downlink-complete":"printing","route-ready":"step-running","step-running":"step-complete","step-complete":"route-complete","route-complete":"inspected",printing:"printed",printed:"sintering",sintering:"cooled",cooled:"inspected",inspected:"tested",tested:"qualified",qualified:"evidence-sealed","evidence-sealed":null,"requalification-required":null,"anomaly-powder-jam":"printing","anomaly-phase-transition":"cooled","anomaly-attestation-fail":"rejected","anomaly-network-loss":"downlink-pending",rejected:null}[e.status]??e.status}function Wn(e){const n=new Set(e.completedStepIds??[]);return e.processRoute?.steps.find(a=>!n.has(a.id))?.id??null}
57function ly(e,n){if(!e.processRoute)return{...e,status:n};if(n==="route-ready")return{...e,status:n,activeStepId:Wn(e),completedStepIds:[]};if(n==="step-running")return{...e,status:n,activeStepId:Wn(e)};if(n==="step-complete"){const a=e.activeStepId??Wn(e),s=a?Array.from(new Set([...e.completedStepIds??[],a])):e.completedStepIds??[];return{...e,status:n,activeStepId:a,completedStepIds:s}}return n==="route-complete"?{...e,status:n,activeStepId:null,completedStepIds:e.processRoute.steps.map(a=>a.id)}:{...e,status:n}}function dy(e,n){return(e.processRoute?.steps??[]).map((a,s)=>({stepId:a.id,ordinal:a.ordinal,type:a.type,requiredMachineClass:a.requiredMachineClass,machineClass:a.requiredMachineClass,equipmentId:`ornl-${a.id}-cell`,status:"complete",manifestHash:"sha256:mock-ornl-route-manifest",payloadHash:`sha256:mock-payload-${a.id}`,policyLeaseId:`lease:mock:${a.id}`,operatorPresenceProofId:`presence:mock:${a.id}`,revocationEpoch:3,startedAt:new Date(n.getTime()-(jn.length-s)*6e4),completedAt:new Date(n.getTime()-(jn.length-s-1)*6e4),securePauseIds:a.id==="binder-jet"?["pause:mock:binder-jet"]:[],secureResumeIds:a.id==="binder-jet"?["resume:mock:binder-jet"]:[],verificationSummary:{kinematic:"pass",physical:"pass"}}))}function la(e,n,a=new Date){const s=!!e.processRoute;return{jobId:e.id,facilityId:e.facilityId,nodeId:e.nodeId??n[0]?.id??"unknown",powderLotId:e.powderLotId,simulationRevision:e.simulationRevision??"unknown",networkModeHistory:[[new Date,"connected-normal"]],attestationChain:[X("attest")],interventions:[],inspectionRefs:[X("insp")],signoffChain:[],seal:X("seal"),sealedAt:a,manifestHash:s?"sha256:mock-ornl-route-manifest":void 0,processRouteId:e.processRoute?.id,processRouteRevision:e.processRoute?.revision,routeStepChain:s?dy(e,a):void 0,revocationDigest:s?"sha256:mock-revocation-digest":void 0,revocationEpoch:s?3:void 0,operatorSessionProofIds:s?["presence:mock:operator-session"]:void 0,securePauseIds:s?["pause:mock:binder-jet"]:void 0,secureResumeIds:s?["resume:mock:binder-jet"]:void 0}}const uy=[{layerClass:"bond-coat",thicknessUm:120},{layerClass:"ceramic-top-coat",thicknessUm:280},{layerClass:"radiative-barrier",thicknessUm:60}],my=[{partType:"blisk",rotating:!0,valueProposition:"improved-performance"},{partType:"blisk",rotating:!0,valueProposition:"low-cost-substitution"},{partType:"stator",rotating:!1,valueProposition:"improved-performance"},{partType:"stator",rotating:!1,valueProposition:"low-cost-substitution"}];function py(e,n){my.forEach((a,s)=>{const i=Ut(!0),r=a.valueProposition==="improved-performance"?"IMPROVED":"LOWCOST",c=i.processRoute?.steps.map(l=>l.id)??[],o={...i,id:`JOB-DEMO-${a.partType.toUpperCase()}-${r}`,nodeId:n[s%Math.max(n.length,1)]?.id,geometryRef:`cad://microturbine-${a.partType}/${X("geom")}`,thermalCurveRef:`curve://microturbine-${a.partType}/${X("therm")}`,powderLotId:`LOT-MICROTURBINE-${r}`,demonstrationClass:"capability-demonstration",partType:a.partType,rotating:a.rotating,status:"evidence-sealed",activeStepId:null,completedStepIds:c};e.upsertJob(o);const d=la(o,n);e.upsertEvidencePackage({...d,demonstrationClass:"capability-demonstration",partType:a.partType,rotating:a.rotating,coatingStack:uy.map(l=>({...l})),effectiveTemperatureDeltaC:200,creepRuptureLife:{valueProposition:a.valueProposition,appliedStressKsi:40,serviceTemperatureC:800,lifeHoursBaseline:7,lifeHoursCoated:431640}})})}const Es={contextId:"ctx-018f6b2a-8e4f-7c6d-a5b4-c3d2e1f00918",targetMaterial:"IN625",lineage:["material:in625","material:ni-superalloy"],conditions:[{type:"atmosphere",value:"Argon"},{type:"preheat",value:"700",unit:"C"}],parameters:[{parameterId:"param:lit:e6b014ed:10.1016-j.actamat/laser-power",name:"laser power",type:"continuous",minBound:180,maxBound:220,unit:"W",batchId:"lit:e6b014ed:10.1016-j.actamat"},{parameterId:"param:lit:e6b014ed:10.1016-j.actamat/hatch-spacing",name:"hatch spacing",type:"continuous",minBound:90,maxBound:120,unit:"um",batchId:"lit:e6b014ed:10.1016-j.actamat"},{parameterId:"param:operator-window/powder-reuse",name:"powder reuse count",type:"categorical",categories:["0","1","2"],unit:null,batchId:"B-017"}],properties:[{propertyId:"property:density",name:"relative density",objective:"MAXIMIZE"},{propertyId:"property:crack-risk",name:"crack risk",objective:"MINIMIZE"}],claims:[{claimId:"7d3f2a9c-4b1e-4f0a-9c7d-2e8b5a6f1d3e",materialId:"material:in625",confidence:.82,evidence:[{documentId:"doc-acta-118432",doi:"10.1016/j.actamat.2025.118432"}]},{claimId:"1f4a6b90-62dd-4d6a-a6db-b4a67e295be0",materialId:"material:in625",confidence:.7
577,evidence:[{documentId:"doc-mdf-screening-042"}]}],exclusions:[{claimId:"9a1b4c8e-2d6f-4a3b-8c5d-7e9f0a1b2c3d",reason:"quarantined-batch",batchId:"B-017",materialId:"material:in625"}],advisory:!0,authorityGate:"adam-l5",generatedAt:new Date},hy={batchId:"B-017",status:"quarantined",eventId:"evt-jona-batch-b017-quarantine",authorId:"jona-drift-monitor",authorType:"system",reason:"drift>15%",justification:"parameter history moved outside the ADAM L5 approved DoE window",receivedAt:new Date},fy={status:"flagged",claimId:"7d3f2a9c-4b1e-4f0a-9c7d-2e8b5a6f1d3e",ingestId:"ingest-jona-agent-override-demo",txId:57,receivedAt:new Date,results:[{entity:"parameter",id:"param:lit:e6b014ed:10.1016-j.actamat/laser-power",action:"flagged",reason:"human-override-protected",latestAuthor:{authorId:"[email protected]",authorType:"human"}}]},gy={root:"material:in625",nodes:[{id:"material:in625",kind:"material",label:"IN625",safetyStatus:"active"},{id:"claim:7d3f2a9c-4b1e-4f0a-9c7d-2e8b5a6f1d3e",kind:"claim",label:"relative density > 99.5%",confidence:.82},{id:"param:lit:e6b014ed:10.1016-j.actamat/laser-power",kind:"parameter",label:"laser power",type:"continuous",minBound:180,maxBound:220,unit:"W",batchId:"lit:e6b014ed:10.1016-j.actamat"},{id:"property:density",kind:"property",label:"relative density",objective:"MAXIMIZE"},{id:"evidence:doc-acta-118432",kind:"evidence",label:"Acta Materialia 2025",doi:"10.1016/j.actamat.2025.118432"},{id:"batch:B-017",kind:"batch",label:"B-017",batchId:"B-017",status:"quarantined"}],edges:[{from:"claim:7d3f2a9c-4b1e-4f0a-9c7d-2e8b5a6f1d3e",to:"material:in625",relation:"studies-material"},{from:"claim:7d3f2a9c-4b1e-4f0a-9c7d-2e8b5a6f1d3e",to:"param:lit:e6b014ed:10.1016-j.actamat/laser-power",relation:"has-parameter"},{from:"claim:7d3f2a9c-4b1e-4f0a-9c7d-2e8b5a6f1d3e",to:"property:density",relation:"claims-property"},{from:"claim:7d3f2a9c-4b1e-4f0a-9c7d-2e8b5a6f1d3e",to:"evidence:doc-acta-118432",relation:"supported-by"},{from:"batch:B-017",to:"param:lit:e6b014ed:10.1016-j.actamat/laser-power",relation:"quarantines-factor"}]};function _y(e){const n=Date.now();e.upsertJonaContextWindow({...Es,generatedAt:new Date(n-9e4)}),e.selectJonaContext(Es.contextId),e.appendJonaQuarantineEvent({...hy,receivedAt:new Date(n-45e3)}),e.appendJonaClaimReceipt({...fy,receivedAt:new Date(n-3e4)}),e.setJonaNeighborhood(gy)}function tr(e){const{enabled:n,tickMs:a=ey,debug:s=!1}=e,i=x(),r=h.useRef(0),c=h.useRef(!1);h.useEffect(()=>{if(!n)return;if(!c.current){s&&console.log("[MockTelemetry] Booting ALPHA fleet"),i.upsertFacility(ny());const d=ay();d.forEach(m=>i.upsertNode(m)),d.forEach(m=>i.setAttestationResult({nodeId:m.id,ok:m.attestationFresh,firmwareHash:"stub",osHash:"stub",hwHash:"stub",verifiedAt:new Date}));const l=Ut(!0);i.upsertJob(l),oy(i,d,l);const g=Ut(!0),u=g.processRoute?.steps.map(m=>m.id)??[],_={...g,id:"JOB-ORNL-ROUTE-PROOF",nodeId:d[0]?.id,status:"evidence-sealed",activeStepId:null,completedStepIds:u};i.upsertJob(_),i.upsertEvidencePackage(la(_,d)),py(i,d),_y(i),i.setConnected(!0),c.current=!0}const o=setInterval(()=>{r.current+=1;const d=r.current,l=Object.values(i.nodes),g=Object.values(i.jobs);if(d%5===0){const u=Ut(d%10===0);i.upsertJob(u);const _={id:X("log"),kind:"job.submitted",severity:"info",message:`Job ${u.anonymizedId} submitted (${u.type})`,at:new Date,jobId:u.id,facilityId:u.facilityId};i.appendEvent(_)}if(g.length>0){const u=g[d%g.length],_=cy(u);if(_!==u.status){const m=ly(u,_);if(i.upsertJob(m),_==="evidence-sealed"){const v=new Date;i.upsertEvidencePackage(la(m,l,v)),i.appendEvent({id:X("log"),kind:"evidence.sealed",severity:"success",message:`Evidence sealed for ${u.anonymizedId}`,at:new Date,jobId:u.id,facilityId:u.facilityId})}}}if(l.forEach(u=>{const _=`${u.id}-furnace-01`,m=g.find(f=>f.nodeId===u.id&&(f.status==="sintering"||f.status==="cooled")),v=iy(u.id,m?.id,_);i.appendSignalSample(v);const p=ry(v);p&&(i.appendSignalEvent(p),i.appendEvent({id:X("log"),kind:p.kind==="phase-transition"?"signal.phase-transition":"signal.ageing-drift",severity:p.kind==="phase-transition"?"warn":"info",message:`${p.kind} on ${u.id} (Îα=${p.magnitude.toFixed(3)})`,at:new Date,nodeId:u.id,jobId:p.jobId}))}),d%4===0&&l.length>0){const u=l[d%l.length],_=g.find(N=>N.nodeId===u.id||N.status==="printing"||N.status==="downlink-complete"),m=`${u.id}-printer-${String(d%10+1).padStart(2,"0")}`,v=X("candidate"),p=Yi(u.id,_?.id,m,d),f=Ki(p.jobId,m,v),b=Math.random()<.68?Qi(v):null,w=Zi(p,f,v,b);i.appendProcessState(p),i.appendEvent({id:X("log"),kind:"process.state",severity:"warn",message:`${p.anomaly?.kind??"anomaly"} on ${m}`,at:p.observedAt,nodeId:u.id,jobId:p.jobId,details:{processStateId:p.id,equipmentId:m,phase:p.phase}}),b&&(i.appendRelationalPrediction(b),i.appendEvent({id:X("log"),kind:"relational.prediction",severity:"info",message:`Relational advisory ${b.scoreBand}/${b.confidenceBand} for ${v.slice(-8)}`,at:b.generatedAt,nodeId:u.id,jobId:f.jobId,details:{predictionId:b.id,targetId:b.targetId,modelRef:b.modelRef,scoreBand:b.scoreBand,confidenceBand:b.confidenceBand}})),i.appendControlDecision(w),i.appendEvent({id:X("log"),kind:"control.decision",severity:"success",message:`Control decision selected for ${p.id.slice(-8)}`,at:w.decidedAt,nodeId:u.id,jobId:w.jobId,details:{decisionId:w.id,processStateId:p.id,candidateId:v}});const j=Xi(f,w,v),C=er(p,w,j,b);i.appendIntervention(f),i.appendCorrectionOutcome(j),i.appendCorrectionObservability(C),i.appendEvent({id:X("log"),kind:"correction.outcome",severity:j.status==="applied"||j.status==="verified-stable"?"success":j.status==="failed"?"error":"warn",message:`${f.action} ${j.status} on ${m}`,at:new Date,nodeId:u.id,jobId:f.jobId,details:{interventionId:f.id,outcomeId:j.id,evidenceRef:j.evidenceRef}})}if(d%2===0&&l.length>0){const u=l[d%l.length];i.upsertNode({...u,tokenHeld:!0}),l.filter(m=>
57m.id!==u.id).forEach(m=>i.upsertNode({...m,tokenHeld:!1}));const _={facilityId:Jt,holderNodeId:u.id,sequence:d,predecessorSignature:`stub-sig-${d}`,passedAt:new Date};i.appendTokenRingPass(_)}if(d%10===0){const u={facilityId:Jt,at:new Date,nodesOnline:l.filter(_=>_.networkMode==="connected-normal").length,nodesDisconnectedLocal:l.filter(_=>_.networkMode==="disconnected-local").length,jobsInFlight:g.filter(_=>_.status!=="evidence-sealed"&&_.status!=="rejected").length,throughputJobsPerDay:Oe(48,6),consumablesBurnRate:Oe(.35,.1),powerPosture:"normal"};i.upsertFacilityRollup(u)}i.setGlobalStats({facilitiesOnline:Object.keys(i.facilities).length,totalNodes:l.length,nodesOnline:l.filter(u=>u.networkMode==="connected-normal").length,nodesDegraded:l.filter(u=>u.networkMode==="connected-degraded").length,nodesDisconnectedLocal:l.filter(u=>u.networkMode==="disconnected-local").length,jobsInFlight:g.filter(u=>u.status!=="evidence-sealed"&&u.status!=="rejected").length,jobsCompletedToday:g.filter(u=>u.status==="evidence-sealed").length,avgDeltaAlpha:.061,evidenceSealedToday:Object.keys(i.evidencePackages).length,lastUpdated:new Date})},a);return()=>clearInterval(o)},[n,a,s,i])}function yy(e){if(!e||!(e instanceof HTMLElement))return!1;const n=e.tagName.toLowerCase();return n==="input"||n==="textarea"||n==="select"||e.isContentEditable}function vy(e={}){const{onFocusCommandLine:n,onToggleHelp:a,enabled:s=!0}=e,i=x(o=>o.selectNode),r=x(o=>o.flyToPreset),c=h.useCallback(o=>{if(s&&!(o.key!=="Escape"&&yy(o.target))&&!(o.key!=="?"&&(o.ctrlKey||o.metaKey||o.altKey)))switch(o.key){case"Escape":i(null),document.activeElement instanceof HTMLElement&&document.activeElement.blur();break;case"1":r("overview");break;case"2":r("alpha");break;case"3":r("bravo");break;case"4":r("charlie");break;case"o":case"O":r("ornl");break;case"/":o.preventDefault(),n?.();break;case"?":o.preventDefault(),a?.();break;default:return}},[s,i,r,n,a]);h.useEffect(()=>(window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)),[c])}const by=[{key:"Esc",description:"Deselect node / Close overlay"},{key:"1",description:"Fleet overview"},{key:"2",description:"Facility ALPHA"},{key:"3",description:"Facility BRAVO"},{key:"4",description:"Facility CHARLIE"},{key:"O",description:"ORNL Scientific Hub"},{key:"/",description:"Focus command line"},{key:"?",description:"Show this help"}],Sa="receiptKind",Ca="receiptEventId",Ra="commandReceiptId",Ea="auditId",ka="evidenceReceiptId",Pa="receiptJobId",jy=[Sa,Ca,Ra,Ea,ka,Pa];function Ye(e,n){const a=e?.[n];return typeof a=="string"&&a.length>0?a:void 0}function vt(e,n){const a=e.get(n);return a&&a.length>0?a:void 0}function xy(e){return e==="command"||e==="audit"||e==="evidence"?e:null}function nr(e){return e instanceof URLSearchParams?new URLSearchParams(e):new URLSearchParams(e)}function Ta(e){return e&&typeof e=="object"?e:void 0}function ar(e){if(e.action.startsWith("command.receipt."))return Ye(Ta(e.subject),"receiptId")}function sr(e){const n=Ta(e);return Ye(n,"jobId")??Ye(n,"id")??Ye(n,"ref")}function Iy(e){const n=e.details;if(e.kind==="command.receipt"){const a=Ye(n,"receiptId");return a?{kind:"command",sourceEventId:e.id,commandReceiptId:a,auditId:Ye(n,"auditRef"),jobId:e.jobId}:null}if(e.kind==="audit.record"){const a=Ye(n,"auditId");if(!a)return null;const s=n?.subject,i=Ye(Ta(s),"receiptId");return{kind:i?"command":"audit",sourceEventId:e.id,auditId:a,commandReceiptId:i,jobId:e.jobId??sr(s)}}if(e.kind==="evidence.updated"){const a=Ye(n,"receiptId");return a?{kind:"evidence",sourceEventId:e.id,evidenceReceiptId:a,jobId:e.jobId}:null}return null}function wy(e){const n=ar(e);return{kind:n?"command":"audit",auditId:e.id,commandReceiptId:n,jobId:sr(e.subject)}}function Ny(e){return{kind:"evidence",evidenceReceiptId:e.id,jobId:e.jobId}}function ir(e){return{kind:"command",commandReceiptId:e.id,auditId:e.auditRef}}function Sy(e){const n=nr(e),a=xy(vt(n,Sa));if(!a)return null;const s={kind:a,sourceEventId:vt(n,Ca),auditId:vt(n,Ea),commandReceiptId:vt(n,Ra),evidenceReceiptId:vt(n,ka),jobId:vt(n,Pa)};
57return a==="command"&&!s.commandReceiptId&&!s.auditId||a==="audit"&&!s.auditId||a==="evidence"&&!s.evidenceReceiptId&&!s.jobId?null:s}function Cy(e,n=""){const a=nr(n);return jy.forEach(s=>a.delete(s)),a.set(Sa,e.kind),e.sourceEventId&&a.set(Ca,e.sourceEventId),e.commandReceiptId&&a.set(Ra,e.commandReceiptId),e.auditId&&a.set(Ea,e.auditId),e.evidenceReceiptId&&a.set(ka,e.evidenceReceiptId),e.jobId&&a.set(Pa,e.jobId),a}function rr(e,n=""){const a=Cy(e,n).toString();return a?`?${a}`:""}function Ry(e,n){return`${n.pathname}${rr(e,n.search??"")}${n.hash??""}`}function Ey(e,n,a=typeof window<"u"?window.location.origin:""){const s=Ry(e,n);return a?`${a}${s}`:s}function Aa(e){return[e.kind,e.commandReceiptId,e.auditId,e.evidenceReceiptId,e.jobId].filter(Boolean).join(":")}function da(e,n){return e?e.commandReceiptId===n.id||!!n.auditRef&&e.auditId===n.auditRef:!1}function ky(e,n){if(!e)return!1;if(e.auditId===n.id)return!0;const a=ar(n);return!!(a&&a===e.commandReceiptId)}function Py(e,n){return e?e.evidenceReceiptId===n.id||e.kind==="evidence"&&!!e.jobId&&e.jobId===n.jobId:!1}function or(e,n){return!e||!n||e.kind!==n.kind?!1:!!(e.commandReceiptId&&e.commandReceiptId===n.commandReceiptId)||!!(e.auditId&&e.auditId===n.auditId)||!!(e.evidenceReceiptId&&e.evidenceReceiptId===n.evidenceReceiptId)||!!(e.sourceEventId&&e.sourceEventId===n.sourceEventId)}function La(){const e=$e(),n=We(),a=x(s=>s.selectReceiptLink);return h.useCallback(s=>{a(s),n({pathname:e.pathname,search:rr(s,e.search),hash:e.hash},{replace:!1})},[e.hash,e.pathname,e.search,n,a])}function cr(){const e=$e(),[n,a]=h.useState(null),[s,i]=h.useState(null),r=h.useCallback(async c=>{const o=Aa(c),d=Ey(c,e);try{const l=typeof navigator<"u"?navigator.clipboard:void 0;if(!l?.writeText)throw new Error("clipboard unavailable");return await l.writeText(d),a(o),i(null),{ok:!0,url:d}}catch{return a(null),i(o),{ok:!1,url:d}}},[e]);return{copiedKey:n,failedKey:s,copyReceiptLink:r}}const Ty="_content_glgb4_7",Ay="_inner_glgb4_14",Ly="_lede_glgb4_22",Gn={content:Ty,inner:Ay,lede:Ly},Oy=!0,$y=!1;function My(){const{session:e,signOut:n}=Ue(),a=We(),s=x(c=>c.activeRole),i=x(c=>c.setActiveRole);h.useEffect(()=>{s===null&&i("ornl-metallurgist")},[s,i]),tr({enabled:Oy,debug:$y});const r=()=>{n(),a("/",{replace:!0})};return t.jsxs("div",{className:Q.container,children:[t.jsxs("header",{className:Q.bar,children:[t.jsxs("div",{className:Q.left,children:[t.jsx("span",{className:Q.brand,children:"ARCNET"}),t.jsx("span",{className:Q.divider,children:"·"}),t.jsx("span",{className:Q.section,children:"JONA RESEARCH GRAPH"})]}),t.jsxs("div",{className:Q.right,children:[t.jsx(Cn,{}),e?.picture&&t.jsx("img",{src:e.picture,alt:"",className:Q.avatar,referrerPolicy:"no-referrer"}),t.jsx("span",{className:Q.user,children:e?.email}),t.jsx("button",{className:Q.signOut,onClick:r,children:"[ SIGN OUT ]"})]})]}),t.jsx("div",{className:Gn.content,"data-testid":"jona-research-graph",children:t.jsxs("div",{className:Gn.inner,children:[t.jsxs("p",{className:Gn.lede,children:["ARCNet's research-claims knowledge graph â advisory DoE context windows, graph neighborhoods, and the quarantine/claim-receipt safety feed. Graph reads hit the JONA service at"," ",t.jsx("code",{children:"VITE_JONA_API_URL"}),"; the full research app lives at"," ",t.jsx("code",{children:"/jona/cockpit"}),"."]}),t.jsx(Vi,{})]})})]})}const Dy={},ks=Dy,By=typeof ks.VITE_JONA_COCKPIT_URL=="string"&&ks.VITE_JONA_COCKPIT_URL||"http://localhost:9101/";function Fy(){const{session:e,signOut:n}=Ue(),a=We(),s=()=>{n(),a("/",{replace:!0})};return t.jsxs("div",{className:Q.container,children:[t.jsxs("header",{className:Q.bar,children:[t.jsxs("div",{className:Q.left,children:[t.jsx("span",{className:Q.brand,children:"ARCNET"}),t.jsx("span",{className:Q.divider,children:"·"}),t.jsx("span",{className:Q.section,children:"JONA RESEARCH CONSOLE"})]}),t.jsxs("div",{className:Q.right,children:[t.jsx(Cn,{}),e?.picture&&t.jsx("img",{src:e.picture,alt:"",className:Q.avatar,referrerPolicy:"no-referrer"}),t.jsx("span",{className:Q.user,children:e?.email}),t.jsx("button",{className:Q.signOut,onClick:s,children:"[ SIGN OUT ]"})]})]}),t.jsx("iframe",{title:"JONA Research Console",src:By,className:Q.frame,"data-testid":"jona-cockpit-frame"})]})}function Ps(e){const n=[e.lastFrameType?`frame ${e.lastFrameType}`:null,e.lastReplayCursor?`cursor ${e.lastReplayCursor}
57`:null,typeof e.lastSequence=="number"?`seq ${e.lastSequence}`:null].filter(Boolean);return n.length>0?` Last ${n.join(", ")}.`:""}function En({connectionState:e,isMockMode:n,streamHealth:a}){return n?{kind:"mock",label:"Mock",headline:"Mock projection",detail:"Local simulated telemetry is driving this role surface.",tone:"info",showRoleSurface:!1,restrictsPrivilegedWrites:!1}:e==="connecting"?{kind:"connecting",label:"Syncing",headline:"Projection connecting",detail:"The browser is opening the role-projected telemetry stream.",tone:"watch",showRoleSurface:!0,restrictsPrivilegedWrites:!0}:e==="disconnected"||e==="error"?{kind:"offline",label:"Offline",headline:"Projection disconnected",detail:"Live projection updates are unavailable. Treat displayed data as stale until resync completes.",tone:"critical",showRoleSurface:!0,restrictsPrivilegedWrites:!0}:a.malformedFrames>0||a.unknownFrames>0?{kind:"schema",label:"Schema",headline:"Projection schema hold",detail:a.lastIssue?.message??"The browser received an undocumented or malformed projection frame.",tone:"critical",showRoleSurface:!0,restrictsPrivilegedWrites:!0}:a.droppedFrames>0||a.outOfOrderFrames>0?{kind:"degraded",label:"Gap",headline:"Projection degraded",detail:`${a.droppedFrames} dropped and ${a.outOfOrderFrames} out-of-order frame(s) observed.`+Ps(a),tone:"watch",showRoleSurface:!0,restrictsPrivilegedWrites:!0}:a.staleFrames>0?{kind:"stale",label:"Stale",headline:"Projection stale",detail:`${a.staleFrames} frame(s) exceeded freshness TTL.`+Ps(a),tone:"watch",showRoleSurface:!0,restrictsPrivilegedWrites:!0}:a.mode==="legacy"?{kind:"legacy",label:"Legacy",headline:"Legacy stream projection",detail:"The stream is using legacy frames without replay cursor or freshness metadata.",tone:"info",showRoleSurface:!1,restrictsPrivilegedWrites:!1}:a.mode==="enveloped"||a.mode==="mixed"?{kind:"fresh",label:"Fresh",headline:"Projection fresh",detail:"Versioned projection frames are current and replay metadata is available.",tone:"nominal",showRoleSurface:!1,restrictsPrivilegedWrites:!1}:{kind:"standby",label:"Standby",headline:"Projection standby",detail:"No live projection frame has been received yet.",tone:"info",showRoleSurface:!1,restrictsPrivilegedWrites:!1}}const qy="_banner_vn10y_1",Hy="_critical_vn10y_12",Wy="_watch_vn10y_17",Gy="_info_vn10y_22",Uy="_nominal_vn10y_27",zy="_topline_vn10y_32",Vy="_kicker_vn10y_40",Jy="_role_vn10y_41",Ky="_guardrail_vn10y_42",Yy="_headline_vn10y_60",Qy="_detail_vn10y_68",ke={banner:qy,critical:Hy,watch:Wy,info:Gy,nominal:Uy,topline:zy,kicker:Vy,role:Jy,guardrail:Ky,headline:Yy,detail:Qy};function lr({role:e,connectionState:n,isMockMode:a}){const s=x(r=>r.streamHealth),i=En({connectionState:n,isMockMode:a,streamHealth:s});return i.showRoleSurface?t.jsxs("section",{role:"status","aria-live":"polite","data-testid":"projection-posture-banner",className:`${ke.banner} ${ke[i.tone]}`,children:[t.jsxs("div",{className:ke.topline,children:[t.jsx("span",{className:ke.kicker,children:"Projection"}),t.jsx("span",{className:ke.role,children:e})]}),t.jsx("div",{className:ke.headline,children:i.headline}),t.jsx("p",{className:ke.detail,children:i.detail}),i.restrictsPrivilegedWrites&&t.jsx("p",{className:ke.guardrail,children:"Privileged write paths require fresh server-confirmed projection state."})]}):null}function Zy({label:e,reasonCode:n,role:a,provenance:s,tone:i,restrictsPrivilegedWrites:r}){return t.jsxs("section",{role:"status","aria-live":"polite","data-testid":"projection-posture",className:`${ke.banner} ${ke[i]}`,children:[t.jsxs("div",{className:ke.topline,children:[t.jsx("span",{className:ke.kicker,children:"First Light projection"}),t.jsx("span",{className:ke.role,children:a.toUpperCase()})]}),t.jsx("div",{className:ke.headline,children:e}),t.jsxs("p",{className:ke.detail,children:[n," · ",s.toUpperCase()]}),r&&t.jsx("p",{className:ke.guardrail,children:"PRIVILEGED ACTIONS DISABLED · PROJECTION IS READ ONLY"})]})}function st(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Un(e,n){return typeof e=="string"&&n.includes(e)}
57class hn extends Error{reasonCode;constructor(n,a){super(a),this.name="FirstLightDecodeError",this.reasonCode=n}}function Xy(e){if(!st(e))throw new hn("first-light/projection-payload-malformed","Campaign projection must be an object");if(e.schemaVersion!=="FirstLightCampaignProjection/2")throw new hn("first-light/projection-schema-unsupported","Campaign projection schema is unsupported");if(typeof e.campaignId!="string"||!Un(e.classification,["synthetic","public","controlled","confidential"])||!Un(e.provenance,["native-v2","adapted-v1","mixed"])||!st(e.projection)||!Number.isInteger(e.projection.sourceSequence)||typeof e.projection.builtAt!="string"||typeof e.projection.sourceRecordedAt!="string"||typeof e.projection.stale!="boolean"||typeof e.projection.gap!="boolean"||!Un(e.projection.schemaState,["compatible","held"])||!Array.isArray(e.layers)||!st(e.authority)||e.authority.physicalExecutionAuthorized!==!1||e.authority.qualificationAuthorized!==!1||!st(e.physicalSeam)||e.physicalSeam.callable!==!1||!st(e.redaction)||!st(e.extensions))throw new hn("first-light/projection-payload-malformed","Campaign projection failed the v2 contract boundary");return e}function ua(e){return Array.isArray(e)?e.map(ua):st(e)?Object.fromEntries(Object.keys(e).sort().map(n=>[n,ua(e[n])])):e}function Ts(e){return JSON.stringify(ua(e))}function Nt(e){return st(e)&&e.redacted===!0}const At=`sha256:${"a".repeat(64)}`,rn=`sha256:${"b".repeat(64)}`,As={schemaVersion:"FirstLightCampaignProjection/2",campaignId:"campaign-synthetic-offline-pr08",classification:"synthetic",provenance:"native-v2",projection:{sourceSequence:42,sourceEventHash:rn,sourceRecordedAt:"2026-01-01T00:00:00Z",builtAt:"2026-01-01T00:02:00Z",ageSeconds:120,freshness:"stale",stale:!0,gap:!1,schemaState:"compatible",transport:"offline-synthetic",reasonCodes:["first-light/offline-fixture-active"]},run:{runId:"run-synthetic-offline-001",state:"checkpointed",currentAttempt:{attemptId:"attempt-synthetic-offline-001",backend:"local-deterministic-fixture",elapsedSeconds:180},resources:{gpuCount:1,gpuClass:"synthetic-emulation",cpuCount:4},latestReceipt:{hash:At,lifecycleState:"checkpointed",verified:!0}},dataGovernance:{corpusManifestHash:At,splitManifestHash:rn,holdout:{state:"sealed",revealAuthority:"not-granted"},checkpointLineage:[{manifestHash:At,sealed:!0}]},layers:["L1","L2","L3","L4","L5"].map((e,n)=>({layer:e,outputHash:n%2===0?At:rn,modelCardHash:rn,evaluationHash:At,modelId:`synthetic-${e.toLowerCase()}-model`,modelVersion:"0.0-synthetic",releaseState:"experimental",createdAt:"2026-01-01T00:01:00Z",metrics:[{name:"synthetic-score",value:.5+n*.02,unit:"1"}],calibrationState:"unavailable",coverage:.8,aleatoric:.12,epistemic:.18,oodState:e==="L5"?"unknown":"in-domain",missingnessState:"synthetic-complete",physicsViolations:[],disagreement:{state:"within-synthetic-threshold",value:.08,threshold:.1},l2L3Consistency:e==="L3"?"synthetic-check-only":void 0})),policy:{latestDecision:{outcome:"defer",primaryReason:"policy/offline-evidence-not-authoritative",primaryReasonCode:"policy/offline-evidence-not-authoritative",additionalReasons:["first-light/offline-fixture-active"],additionalReasonCodes:["first-light/offline-fixture-active"],reasonCodes:["policy/offline-evidence-not-authoritative","first-light/offline-fixture-active","policy/abstained"],requestedEvidence:["live-signed-projection"],missingEvidence:["live-signed-projection"],evaluatedThresholds:[{name:"synthetic-disagreement",observed:{value:.08,unit:"1"},operator:"lte",limit:{value:.1,unit:"1"},passed:!0}],evaluatedControls:[{name:"production-evidence",passed:!1,reason:"policy/production-evidence-ineligible"}],freshness:{evaluatedAt:"2026-01-01T00:02:00Z",expiresAt:"2026-01-01T00:05:00Z",calibrationState:"unavailable",attestationState:"missing",projectionState:"stale"},sourceSequence:42,abstained:!0,recordedAt:"2026-01-01T00:02:00Z",expiresAt:"2026-01-01T00:05:00Z",limitations:["Synthetic demonstration; no authority"],authority:{physicalExecutionAuthorized:!1,qualificationAuthorized:!1}},humanDispositions:[],technicalAuthorityActions:[]},integrity:{eventSealState:"verified",artifactVerificationState:"verified",replayState:"verified"},capabilityStatus:"capability-demonstration",physicalSeam:{status:"disabled",reasonCode:"first-light/physical-seam-unavailable",callable:!1}
57,authority:{physicalExecutionAuthorized:!1,qualificationAuthorized:!1,limitations:["Offline synthetic fixture; no policy or physical authority","No model release or qualification claim"]},redaction:{role:"arc-operator",reasonCode:"security/no-redaction-required",removed:[]},extensions:{fixture:"synthetic-sanitized-non-operational-non-authoritative"}},ev="/first-light/v2".replace(/\/$/,"");function dr(e){return e==="first-light/access-denied"||e==="first-light/projection-role-unknown"?"access-denied":e==="first-light/projection-schema-unsupported"?"schema-unsupported":e==="first-light/projection-unavailable"?"projection-unavailable":"malformed"}async function tv(e){const n=await e.json().catch(()=>({})),a=typeof n.reasonCode=="string"?n.reasonCode:"first-light/projection-payload-malformed";return{kind:"error",state:dr(a),reasonCode:a,message:typeof n.message=="string"?n.message:`First Light v2 returned HTTP ${e.status}`}}const nv={async loadCampaign(e,n){if(n.offline)return{kind:"offline",source:"offline-synthetic",projection:structuredClone(As)};try{const a=await fetch(`${ev}/campaigns/${encodeURIComponent(e)}?projection=${encodeURIComponent(n.projection)}`,{signal:n.signal,credentials:"same-origin",headers:{accept:"application/json"}});if(!a.ok)return tv(a);const s=await a.json();try{return{kind:"projection",source:"gateway",projection:Xy(s)}}catch(i){if(i instanceof hn)return{kind:"error",state:dr(i.reasonCode),reasonCode:i.reasonCode,message:i.message};throw i}}catch(a){if(n.signal?.aborted||!(a instanceof TypeError))throw a;return{kind:"offline",source:"offline-synthetic",projection:structuredClone(As)}}}},av="_shell_13t37_1",sv="_header_13t37_10",iv="_commandBar_13t37_11",rv="_brand_13t37_21",ov="_prompt_13t37_22",cv="_separator_13t37_23",lv="_headerMeta_13t37_24",dv="_controls_13t37_25",uv="_exportControls_13t37_26",mv="_demoBadge_13t37_27",pv="_backLink_13t37_28",hv="_failure_13t37_33",fv="_stateBanner_13t37_54",gv="_main_13t37_68",_v="_summary_13t37_75",yv="_panel_13t37_76",vv="_limitations_13t37_78",bv="_eyebrow_13t37_96",jv="_reasonList_13t37_111",xv="_definitionList_13t37_114",Iv="_lineage_13t37_119",wv="_tableWrap_13t37_123",Nv="_metricGrid_13t37_131",Sv="_integrityGrid_13t37_132",Cv="_decision_13t37_142",Rv="_authority_13t37_146",Ev="_disabled_13t37_147",kv="_redacted_13t37_148",Pv="_empty_13t37_149",Y={shell:av,header:sv,commandBar:iv,brand:rv,prompt:ov,separator:cv,headerMeta:lv,controls:dv,exportControls:uv,demoBadge:mv,backLink:pv,failure:hv,stateBanner:fv,main:gv,summary:_v,panel:yv,limitations:vv,eyebrow:bv,reasonList:jv,definitionList:xv,lineage:Iv,tableWrap:wv,metricGrid:Nv,integrityGrid:Sv,decision:Cv,authority:Rv,disabled:Ev,redacted:kv,empty:Pv},Ls="first-light-in718-closed-loop",Tv=["L1","L2","L3","L4","L5"];function Lt(e){return typeof e!="string"||e.length===0?"explicitly unavailable":e.length<=24?e:`${e.slice(0,14)}â¦${e.slice(-8)}`}function ae(e,n="explicitly unavailable"){return typeof e=="string"&&e.length>0?e:typeof e=="number"||typeof e=="boolean"?String(e):n}function Os(e){if(typeof e=="number")return String(e);if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const n=e;return`${ae(n.value)} ${ae(n.unit,"")}`.trim()}return"explicitly unavailable"}function Av(e){return e==="verified"||e==="fresh"||e==="in-domain"?"nominal":e==="invalid"||e==="failed"||e==="mismatch"?"critical":"watch"}function Lv(e,n){return n?{label:"OFFLINE SYNTHETIC",reason:"first-light/offline-fixture-active",tone:"watch"}:e.projection.schemaState==="held"?{label:"SCHEMA HOLD",reason:"first-light/projection-schema-unsupported",tone:"critical"}:e.projection.gap?{label:"SEQUENCE GAP",reason:"first-light/projection-sequence-gap",tone:"critical"}:!Nt(e.integrity)&&e.integrity.replayState==="mismatch"?{label:"REPLAY MISMATCH",reason:"first-light/replay-mismatch",tone:"critical"}:e.projection.stale?{label:"STALE PROJECTION",reason:"first-light/projection-stale",tone:"watch"}:{label:"LIVE VERIFIED PROJECTION",reason:"first-light/projection-fresh",tone:"nominal"}}function dt({id:e,title:n,children:a}){const s=`${e}-heading`;return t.jsxs("section",{className:Y.panel,"aria-labelledby":s,"data-testid":e,children:[t.jsx("h2",{id:s,children:n}),a]})}function Ot({rows:e}){return t.jsx("dl",{className:Y.definitionList,children:e.map(([n,a])=>t.jsxs("div",{children:[t.jsx("dt",{children:n}),t.jsx("dd",{children:ae(a)})]},n))})}function on(){return t.jsx("p",{className:Y.redacted,role:"note",children:"REDACTED BEFORE DELIVERY · security/field-redacted"})}function Ov({service:e=nv,initialOffline:n}
57){const a=typeof window<"u"&&new URLSearchParams(window.location.search).get("first-light-mode")==="offline",[s,i]=h.useState("arc-operator"),[r,c]=h.useState(n??a),[o,d]=h.useState(null),[l,g]=h.useState("COPY REDACTED JSON");h.useEffect(()=>{const p=new AbortController;return d(null),e.loadCampaign(Ls,{projection:s,offline:r,signal:p.signal}).then(f=>{p.signal.aborted||d(f)}).catch(()=>{p.signal.aborted||d({kind:"error",state:"malformed",reasonCode:"first-light/projection-payload-malformed",message:"Campaign projection could not be loaded"})}),()=>p.abort()},[r,s,e]);const u=o?.kind==="projection"||o?.kind==="offline"?o.projection:null,_=h.useMemo(()=>u?Lv(u,o?.kind==="offline"):null,[o?.kind,u]),m=async()=>{u&&(await navigator.clipboard?.writeText(Ts(u)),g("COPIED FILTERED PROJECTION"))},v=()=>{if(!u)return;const p=Ts(u),f=URL.createObjectURL(new Blob([p],{type:"application/json"})),b=document.createElement("a");b.href=f,b.download=`${u.campaignId}.redacted.json`,b.click(),URL.revokeObjectURL(f)};return t.jsxs("div",{className:Y.shell,"data-testid":"first-light-console",children:[t.jsxs("header",{className:Y.header,children:[t.jsxs("div",{children:[t.jsx("span",{className:Y.brand,children:"ARCNET"}),t.jsx("span",{className:Y.separator,children:"//"}),t.jsx("span",{children:"PROJECT FIRST LIGHT"})]}),t.jsxs("div",{className:Y.headerMeta,children:[t.jsx("span",{className:Y.demoBadge,children:"CAPABILITY DEMONSTRATION"}),t.jsx(Ae,{to:"/role-chooser",className:Y.backLink,children:"[ PORTALS ]"})]})]}),t.jsxs("nav",{className:Y.commandBar,"aria-label":"First Light projection controls",children:[t.jsxs("span",{children:[t.jsx("span",{className:Y.prompt,children:"arcnet:first-light$"})," project --campaign ",Ls]}),t.jsxs("div",{className:Y.controls,children:[t.jsx("button",{type:"button","aria-pressed":s==="arc-operator",onClick:()=>{c(!1),i("arc-operator")},children:"OPERATIONS"}),t.jsx("button",{type:"button","aria-pressed":s==="indopacom-stakeholder",onClick:()=>{c(!1),i("indopacom-stakeholder")},children:"WORKSHOP SAFE"}),t.jsx("button",{type:"button","aria-pressed":r,onClick:()=>c(!0),children:"OFFLINE DEMO"})]})]}),o===null&&t.jsxs("section",{className:Y.stateBanner,role:"status","aria-live":"polite",children:[t.jsx("strong",{children:"LOADING CAMPAIGN PROJECTION"}),t.jsx("span",{children:"first-light/projection-loading"})]}),o?.kind==="error"&&t.jsx("main",{className:Y.failure,"data-testid":`state-${o.state}`,children:t.jsxs("section",{role:"alert","aria-labelledby":"projection-error-heading",children:[t.jsx("p",{className:Y.eyebrow,children:"FAIL-CLOSED CAMPAIGN READ"}),t.jsx("h1",{id:"projection-error-heading",children:o.state.replaceAll("-"," ").toUpperCase()}),t.jsx("p",{children:o.message}),t.jsx("code",{children:o.reasonCode}),t.jsx("p",{children:"No live content was merged with a fixture. No authority is available."}),o.state==="projection-unavailable"&&t.jsx("button",{type:"button",onClick:()=>c(!0),children:"LOAD EXPLICIT OFFLINE SYNTHETIC DEMO"})]})}),u&&_&&t.jsxs(t.Fragment,{children:[t.jsx(Zy,{label:_.label,reasonCode:_.reason,role:u.redaction.role,provenance:u.provenance,tone:_.tone,restrictsPrivilegedWrites:u.projection.stale||u.projection.gap||Nt(u.integrity)||u.integrity.replayState!=="verified"||o?.kind==="offline"}),t.jsxs("main",{className:Y.main,children:[t.jsxs("section",{className:Y.summary,"aria-labelledby":"campaign-summary-heading",children:[t.jsxs("div",{children:[t.jsx("p",{className:Y.eyebrow,children:"CAMPAIGN PROJECTION / V2"}),t.jsx("h1",{id:"campaign-summary-heading",children:u.campaignId}),t.jsx("p",{children:"Canonical joins and classification filtering were completed server-side."})]}),t.jsxs("div",{className:Y.exportControls,children:[t.jsx("button",{type:"button",onClick:m,children:l}),t.jsx("button",{type:"button",onClick:v,children:"DOWNLOAD REDACTED JSON"})]}),t.jsx(Ot,{rows:[["source sequence",u.projection.sourceSequence],["projection age",`${u.projection.ageSeconds}s`],["source recorded",u.projection.sourceRecordedAt],["projection built",u.projection.builtAt],["classification",u.classification],["redacted fields",u.redaction.removed.length]]})]}),t.jsx(dt,{id:"run-attempt",title:"RUN / ATTEMPT / BACKEND",children:Nt(u.run)?t.jsx(on,{}):(()=>{const p=u.run;return p.runId?t.jsx(Ot,{rows:[["run",p.runId],["state",p.state],["attempt",p.currentAttempt?.attemptId],["backend",p.currentAttempt?.backend],["elapsed",p.currentAttempt?.elapsedSeconds===void 0?void 0:`${p.currentAttempt.elapsedSeconds}s`],["GPU resources",p.resources?.gpuCount===void 0?void 0:`${p.resources.gpuCount} Ã ${ae(p.resources.gpuClass)}`],["CPU resources",p.resources?.cpuCount],["latest receipt",Lt(p.latestReceipt?.hash)],["receipt verified",p.latestReceipt?.verified]]}
57):t.jsx("p",{className:Y.empty,children:"EMPTY CAMPAIGN · no current run"})})()}),t.jsx(dt,{id:"data-governance",title:"DATA / HOLDOUT / CHECKPOINTS",children:Nt(u.dataGovernance)?t.jsx(on,{}):(()=>{const p=u.dataGovernance;return t.jsxs(t.Fragment,{children:[t.jsx(Ot,{rows:[["corpus manifest",Lt(p.corpusManifestHash)],["split manifest",Lt(p.splitManifestHash)],["holdout state",p.holdout?.state],["reveal authority",p.holdout?.revealAuthority],["holdout contents","SEALED · NOT PROJECTED"]]}),t.jsx("ol",{className:Y.lineage,"aria-label":"Sealed checkpoint lineage",children:(p.checkpointLineage??[]).map((f,b)=>t.jsxs("li",{children:[t.jsxs("span",{children:["#",b+1," ",Lt(f.manifestHash)]}),t.jsx("strong",{children:f.sealed?"SEALED":"UNVERIFIED"})]},`${f.manifestHash}-${b}`))})]})})()}),t.jsx(dt,{id:"adam-layers",title:"ADAM FIVE-LAYER L1âL5 EVIDENCE",children:t.jsx("div",{className:Y.tableWrap,children:t.jsxs("table",{children:[t.jsx("caption",{children:"Layer outputs, model identities, uncertainty, and consistency"}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",children:"Layer"}),t.jsx("th",{scope:"col",children:"Model / release"}),t.jsx("th",{scope:"col",children:"Evidence"}),t.jsx("th",{scope:"col",children:"Uncertainty / domain"}),t.jsx("th",{scope:"col",children:"Physics / disagreement"})]})}),t.jsx("tbody",{children:Tv.map(p=>{const f=u.layers.find(b=>b.layer===p);return t.jsxs("tr",{children:[t.jsx("th",{scope:"row",children:p}),f?f.redacted?t.jsxs("td",{colSpan:4,children:["REDACTED · ",f.reasonCode??"security/field-redacted"]}):t.jsxs(t.Fragment,{children:[t.jsxs("td",{children:[ae(f.modelId)," / ",ae(f.modelVersion),t.jsx("br",{}),t.jsx("small",{children:ae(f.releaseState)})]}),t.jsxs("td",{children:[Lt(f.outputHash),t.jsx("br",{}),t.jsx("small",{children:ae(f.createdAt)})]}),t.jsxs("td",{children:["cal ",ae(f.calibrationState)," · cov ",ae(f.coverage),t.jsx("br",{}),"alea ",ae(f.aleatoric)," · epi ",ae(f.epistemic)," · OOD ",ae(f.oodState)," · missing ",ae(f.missingnessState)]}),t.jsxs("td",{children:[(f.physicsViolations??[]).length," violation(s)",t.jsx("br",{}),ae(f.disagreement?.state)," · L2/L3 ",ae(f.l2L3Consistency)]})]}):t.jsx("td",{colSpan:4,children:"EXPLICITLY UNAVAILABLE · no layer output projected"})]},p)})})]})})}),t.jsx(dt,{id:"model-metrics",title:"MODEL EVALUATION METRICS",children:t.jsxs("div",{className:Y.metricGrid,children:[u.layers.flatMap(p=>(p.metrics??[]).map((f,b)=>t.jsxs("article",{children:[t.jsxs("span",{children:[p.layer," · ",ae(f.target,"aggregate")]}),t.jsxs("strong",{children:[ae(f.value)," ",ae(f.unit,"")]}),t.jsx("small",{children:ae(f.name)})]},`${p.layer}-${f.name}-${b}`))),!u.layers.some(p=>(p.metrics?.length??0)>0)&&t.jsx("p",{className:Y.empty,children:"No per-target metrics projected."})]})}),t.jsx(dt,{id:"l5-policy",title:"L5 POLICY / HUMAN DISPOSITION",children:Nt(u.policy)?t.jsx(on,{}):(()=>{const p=u.policy,f=p.latestDecision,b=f?.primaryReason??f?.primaryReasonCode,w=f?.additionalReasons??f?.additionalReasonCodes??[],j=f?.requestedEvidence??f?.missingEvidence??[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:Y.decision,children:[t.jsx("p",{className:Y.eyebrow,children:o?.kind==="projection"&&!u.projection.stale?"AUTHORITATIVE PROJECTED OUTCOME":"NON-AUTHORITATIVE PROJECTED OUTCOME"}),t.jsx("strong",{children:ae(f?.outcome).toUpperCase()}),t.jsx("code",{children:ae(b)}),t.jsxs("p",{children:["Recorded: ",ae(f?.recordedAt??f?.freshness?.evaluatedAt)," · Expires: ",ae(f?.expiresAt??f?.freshness?.expiresAt)]})]}),t.jsx(Ot,{rows:[["abstained",f?.abstained],["decision source sequence",f?.sourceSequence===void 0?void 0:`#${f.sourceSequence}`],["calibration freshness",f?.freshness?.calibrationState],["attestation freshness",f?.freshness?.attestationState],["projection freshness",f?.freshness?.projectionState]]}),t.jsx("h3",{children:"Additional reasons"}),t.jsx("ul",{children:w.map(C=>t.jsx("li",{children:C},C))}),t.jsx("h3",{children:"All deterministic reasons"}),t.jsx("ol",{className:Y.reasonList,"aria-label":"L5 reason priority order",children:(f?.reasonCodes??[]).map(C=>t.jsx("li",{children:C},C))}),t.jsx("h3",{children:"Requested evidence"}),t.jsx("ul",{children:j.map(C=>t.jsx("li",{children:C},C))}),t.jsx("div",{className:Y.tableWrap,children:t.jsxs("table",{children:[t.jsx("caption",{children:"Server-evaluated L5 thresholds; the console does not recompute pass or fail"}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",children:"Control"}),t.jsx("th",{scope:"col",children:"Observed"}),t.jsx("th",{scope:"col",children:"Operator"}),t.jsx("th",{scope:"col",children:"Limit"}),t.jsx("th",{scope:"col",children:"Result"})]})}),t.jsx("tbody",{children:(f?.evaluatedThresholds??[]).map((C,N)=>t.jsxs("tr",{children:[t.jsx("th",{scope:"row",children:ae(C.name)}),t.jsx("td",{children:Os(C.observed)}),t.jsx("td",{children:ae(C.operator)}),t.jsx("td",{children:Os(C.limit??C.threshold)}),t.jsx("td",{children:C.passed===void 0?"projected result unavailable":C.passed?"PASS":"FAIL"})]},String(C.name)+"-"+N))})]})}),t.jsx("h3",{children:"Integrated controls"}),t.jsx("ul",{children:(f?.evaluatedControls??[]).map((C,N)=>t.jsxs("li",{children:[t.jsx("strong",{children:ae(C.name)})," · ",C.passed===!0?"PASS":C.passed===!1?"FAIL":"UNKNOWN",C.reason?" · "+C.reason:""]},String(C.name)+"-"+N))}),t.jsx("h3",{children:"Limitations"}),t.jsx("ul",{children:(f?.limitations??[]).map(C=>t.jsx("li",{children:C},C))}),t.jsx(Ot,{rows:[["human dispositions",p.humanDispositions?.length??0],["technical-authority actions",p.technicalAuthorityActions?.length??0]]}),t.jsx("p",{className:Y.authority,children:"Even a PROCEED outcome grants no release, qualification, canary, or physical authority."})]})})()}),t.jsxs(dt,{id:"integrity",title:"INTEGRITY / REPLAY / FRESHNESS",children:[Nt(u.integrity)?t.jsx(on,{}):t.jsx("div",{className:Y.integrityGrid,children:[["EVENT LOG SEAL",u.integrity.eventSealState],["ARTIFACT VERIFICATION",u.integrity.artifactVerificationState],["DETERMINISTIC REPLAY",u.integrity.replayState],["FRESHNESS",u.projection.freshness]].map(([p,f])=>t.jsxs("div",{"data-tone":Av(f),children:[t.jsx("span",{children:p}),t.jsx("strong",{children:ae(f).toUpperCase()})]},p))}),u.projection.reasonCodes.map(p=>t.jsx("code",{children:p},p))]}),t.jsx(dt,{id:"physical-seam",title:"PHYSICAL SEAM",children:t.jsxs("div",{className:Y.disabled,"aria-label":"Physical seam disabled; no callable action",children:[t.jsx("strong",{children:"DISABLED / NO CALLABLE PATH"}),t.jsx("code",{children:u.physicalSeam.reasonCode}),t.jsx("p",{children:"PR-14 adds read-only authorization and dry-run receipt evidence. This console cannot authorize, confirm, retry, or transmit a process change."})]})}),t.jsxs("footer",{className:Y.limitations,children:[t.jsx("strong",{children:"AUTHORITY LIMITATIONS"}),t.jsx("span",{children:"PHYSICAL EXECUTION: NO · QUALIFICATION: NO"}),u.authority.limitations.map(p=>t.jsx("span",{children:p},p))]})]})]})]})}const $v={cellId:"work-cell:ALPHA/thermal-cell",name:"Thermal cell",facilityId:"ALPHA",equipmentIds:["microturbine-thermal-cell-1"],machineClasses:["hip","thermal-processing"],stepTypes:["hip","heat-treatment"],inputBufferCapacity:6,availableHoursPerDay:20,notes:"Serves two route-step types; shared-resource constraint candidate."},Mv={assessmentId:"flow-assessment:018f9a2c-7b1d-4e0a-9c3d-5e6f7a8b9c0d",facilityId:"ALPHA",windowStart:"2026-08-30T12:00:00Z",windowEnd:"2026-08-30T18:00:00Z",constraintCellId:"work-cell:ALPHA/thermal-cell",method:"utilization-ranking",focusingStep:"identify",confidence:.87,cells:[{cellId:"work-cell:ALPHA/thermal-cell",utilization:.93,queueDepth:3,avgWaitTimeS:8100},{cellId:"work-cell:ALPHA/sinter-cell",utilization:.72,queueDepth:1,avgWaitTimeS:2400},{cellId:"work-cell:ALPHA/metrology-cell",utilization:.66,queueDepth:1,avgWaitTimeS:1500},{cellId:"work-cell:ALPHA/binder-jet-cell",utilization:.61,queueDepth:0,avgWaitTimeS:300},{cellId:"work-cell:ALPHA/cnc-cell",utilization:.55,queueDepth:0,avgWaitTimeS:240},{cellId:"work-cell:ALPHA/coating-cell",utilization:.48,queueDepth:0,avgWaitTimeS:120}],basis:{snapshotIds:["flow-snapshot:work-cell:ALPHA/thermal-cell/2026-08-30T18:00:00Z","flow-snapshot:work-cell:ALPHA/sinter-cell/2026-08-30T18:00:00Z","flow-snapshot:work-cell:ALPHA/metrology-cell/2026-08-30T18:00:00Z","flow-snapshot:work-cell:ALPHA/binder-jet-cell/2026-08-30T18:00:00Z","flow-snapshot:work-cell:ALPHA/cnc-cell/2026-08-30T18:00:00Z","flow-snapshot:work-cell:ALPHA/coating-cell/2026-08-30T18:00:00Z"],simulationRunId:null},advisory:!0,authorityGate:"adam-l5",generatedAt:"2026-08-30T18:00:05Z"},Dv={runId:"sim:run:018f9a3e-1c2b-4d5e-8f90-a1b2c3d4e5f6",facilityId:"ALPHA",engine:"des",engineVersion:"0.4.1",seed:42,horizonDays:30,scenario:{workCellIds:["work-cell:ALPHA/binder-jet-cell","
57work-cell:ALPHA/sinter-cell","work-cell:ALPHA/thermal-cell","work-cell:ALPHA/cnc-cell","work-cell:ALPHA/coating-cell","work-cell:ALPHA/metrology-cell"],demandJobsPerDay:6,calibrationRef:"flow-dataset:first-light-microturbine-2026-06-15",policy:"dbr"},results:{throughputJobsPerDay:5.1,avgFlowTimeS:191e3,avgWip:11.2,constraintCellId:"work-cell:ALPHA/thermal-cell",perCell:[{cellId:"work-cell:ALPHA/binder-jet-cell",utilization:.63},{cellId:"work-cell:ALPHA/sinter-cell",utilization:.74},{cellId:"work-cell:ALPHA/thermal-cell",utilization:.97},{cellId:"work-cell:ALPHA/cnc-cell",utilization:.57},{cellId:"work-cell:ALPHA/coating-cell",utilization:.5},{cellId:"work-cell:ALPHA/metrology-cell",utilization:.69}]},dataQuality:"synthetic",advisory:!0,authorityGate:"adam-l5",generatedAt:"2026-08-30T18:10:00Z"},Bv={scheduleId:"flow-dbr:018f9a4a-9d8c-4b7a-a655-4e3d2c1b0a99",facilityId:"ALPHA",drumCellId:"work-cell:ALPHA/thermal-cell",drumSequence:[{jobId:"job-microturbine-blisk-marm247-replay",plannedStart:"2026-08-31T06:00:00Z",plannedEnd:"2026-08-31T11:00:00Z"}],buffers:{constraintBufferS:43200,shippingBufferS:21600},rope:[{jobId:"job-microturbine-blisk-marm247-replay",recommendedReleaseAt:"2026-08-30T18:00:00Z"}],basis:{assessmentId:"flow-assessment:018f9a2c-7b1d-4e0a-9c3d-5e6f7a8b9c0d",simulationRunId:"sim:run:018f9a3e-1c2b-4d5e-8f90-a1b2c3d4e5f6"},advisory:!0,authorityGate:"adam-l5",generatedAt:"2026-08-30T18:12:00Z"},Fv={recommendationId:"flow-rec:018f9a55-3e2d-4c1b-9a80-7f6e5d4c3b2a",facilityId:"ALPHA",kind:"subordinate-release",summary:"Gate new microturbine job release to the thermal-cell drum minus a 12 h constraint buffer.",detail:{ropeRef:"flow-dbr:018f9a4a-9d8c-4b7a-a655-4e3d2c1b0a99"},expectedEffect:{throughputJobsPerDayDelta:0,avgWipDelta:-3.8,avgFlowTimeSDelta:-66e3},basis:{assessmentId:"flow-assessment:018f9a2c-7b1d-4e0a-9c3d-5e6f7a8b9c0d",scheduleId:"flow-dbr:018f9a4a-9d8c-4b7a-a655-4e3d2c1b0a99"},automation:null,advisory:!0,authorityGate:"adam-l5",generatedAt:"2026-08-30T18:12:30Z"},xn=["work-cell:ALPHA/binder-jet-cell","work-cell:ALPHA/sinter-cell","work-cell:ALPHA/thermal-cell","work-cell:ALPHA/cnc-cell","work-cell:ALPHA/coating-cell","work-cell:ALPHA/metrology-cell"],In="ALPHA",qv="2026-08-30T19:00:00Z",Hv=[{cellId:"work-cell:ALPHA/binder-jet-cell",name:"Binder jet cell",facilityId:"ALPHA",equipmentIds:["microturbine-binder-jet-1"],machineClasses:["additive-binder-jet"],stepTypes:["binder-jet"],inputBufferCapacity:6,availableHoursPerDay:20},{cellId:"work-cell:ALPHA/sinter-cell",name:"Sinter cell",facilityId:"ALPHA",equipmentIds:["microturbine-sinter-1"],machineClasses:["sintering-furnace"],stepTypes:["sintering"],inputBufferCapacity:6,availableHoursPerDay:20},$v,{cellId:"work-cell:ALPHA/cnc-cell",name:"CNC cell",facilityId:"ALPHA",equipmentIds:["microturbine-cnc-1"],machineClasses:["subtractive"],stepTypes:["cnc-machining"],inputBufferCapacity:6,availableHoursPerDay:20},{cellId:"work-cell:ALPHA/coating-cell",name:"Coating cell",facilityId:"ALPHA",equipmentIds:["microturbine-coating-1"],machineClasses:["coating"],stepTypes:["thermal-coating-spray"],inputBufferCapacity:6,availableHoursPerDay:20},{cellId:"work-cell:ALPHA/metrology-cell",name:"Metrology cell",facilityId:"ALPHA",equipmentIds:["microturbine-metrology-1"],machineClasses:["materials-processing"],stepTypes:["inspection","test"],inputBufferCapacity:6,availableHoursPerDay:20,notes:"Serves two route-step types; shared-resource constraint candidate."}],Wv={"work-cell:ALPHA/binder-jet-cell":{arrivals:5,completions:5,wip:1,queueDepth:0,utilization:.61,avgProcessTimeS:2600,avgWaitTimeS:300,throughputJobsPerDay:20},"work-cell:ALPHA/sinter-cell":{arrivals:6,completions:5,wip:2,queueDepth:1,utilization:.72,avgProcessTimeS:3100,avgWaitTimeS:2400,throughputJobsPerDay:20},"work-cell:ALPHA/thermal-cell":{arrivals:6,completions:4,wip:4,queueDepth:3,utilization:.93,avgProcessTimeS:5e3,avgWaitTimeS:8100,throughputJobsPerDay:16},"work-cell:ALPHA/cnc-cell":{arrivals:4,completions:4,wip:1,queueDepth:0,utilization:.55,avgProcessTimeS:2950,avgWaitTimeS:240,throughputJobsPerDay:16},"work-cell:ALPHA/coating-cell":{arrivals:4,completions:4,wip:0,queueDepth:0,utilization:.48,avgProcessTimeS:2600,avgWaitTimeS:120,throughputJobsPerDay:16},"work-cell:ALPHA/metrology-cell":{arrivals:5,completions:4,wip:2,queueDepth:1,utilization:.66,avgProcessTimeS:3550,avgWaitTimeS:1500,throughputJobsPerDay:16}},Gv=6,$s=[13,14,15,16,17,18],ma=[.72,.78,.84,.9,.95,1];function Ms(e){return`2026-08-30T${String(e).padStart(2,"0")}:00:00Z`}function ur(e,n){return`flow-snapshot:${e}/${n}`}function pa(e){return Math.round(e*100)/100}function Uv(e,n){const a=Wv[e],s=ma[n],i=Ms($s[n]),r=Ms($s[n]-Gv),c=n===ma.length-1;return{snapshotId:ur(e,i),cellId:e,facilityId:In,windowStart:r,windowEnd:i,arrivals:c?a.arrivals:Math.max(1,Math.round(a.arrivals*s)),completions:c?a.completions:Math.max(1,Math.round(a.completions*s)),wip:c?a.wip:Math.round(a.wip*s),queueDepth:c?a.queueDepth:Math.round(a.queueDepth*s),utilization:c?a.utilization:pa(a.utilization*s),avgProcessTimeS:a.avgProcessTimeS,avgWaitTimeS:c?a.avgWaitTimeS:Math.round(a.avgWaitTimeS*s),throughputJobsPerDay:c?a.throughputJobsPerDay:pa(a.throughputJobsPerDay*s),data
57Quality:"replay",source:"replay-bundle"}}function zv(){return xn.flatMap(e=>ma.map((n,a)=>Uv(e,a)))}function Vv(){return{facilityId:In,workCells:structuredClone(Hv),snapshots:zv(),constraintAssessment:structuredClone(Mv),simulationRuns:[structuredClone(Dv)],dbrSchedules:[structuredClone(Bv)],recommendations:[structuredClone(Fv)],dispositions:[]}}function Jv(e,n,a=5){const s=new Date(e.windowEnd).getTime()+a*6e4,i=new Date(e.windowStart).getTime()+a*6e4,r=new Date(s).toISOString().replace(".000Z","Z"),c=new Date(i).toISOString().replace(".000Z","Z"),o=Math.sin(n/2)*.02;return{...e,snapshotId:ur(e.cellId,r),windowStart:c,windowEnd:r,utilization:pa(Math.min(.99,Math.max(.05,e.utilization+o)))}}function mr(e){switch(e){case"ornl-metallurgist":case"arc-operator":return"full";case"node-site-manager":return"rollup";default:return"denied"}}function ha(e){return Object.fromEntries(Object.entries(e).map(([n,a])=>[n,a.at(-1)]))}function Kv(e){const n=Object.values(ha(e)).filter(a=>!!a);return n.length===0?null:n.some(a=>a.dataQuality==="degenerate-single-pass")?"degenerate-single-pass":n.every(a=>a.dataQuality==="live")?"live":n.some(a=>a.dataQuality==="synthetic")?"synthetic":"replay"}function Yv(e){if(!e)return null;const{basis:n,...a}=e;return{...a,rollup:!0}}function Qv(e,n){const a=mr(n);if(a==="denied")return null;const s=Object.values(e.flowWorkCells);return a==="rollup"?{access:a,workCells:s,snapshotsByCell:Object.fromEntries(Object.entries(e.flowSnapshotsByCell).map(([i,r])=>[i,r.map(c=>({...c,rollup:!0}))])),constraintAssessment:Yv(e.flowConstraintAssessment),dbrSchedules:[],recommendations:[],dispositions:{}}:{access:a,workCells:s,snapshotsByCell:e.flowSnapshotsByCell,constraintAssessment:e.flowConstraintAssessment,dbrSchedules:Object.values(e.flowDbrSchedules),recommendations:Object.values(e.flowRecommendations),dispositions:e.flowDispositions}}const pr="/jona/v1/flow".replace(/\/$/,""),Ds="arcnet.flow.operator-token";async function hr(e){const n=await e.json().catch(()=>({}));return new Error(n.reason||`Flow gateway returned HTTP ${e.status}`)}async function cn(e,n,a){const s=await fetch(`${pr}${e}`,{signal:a,headers:{accept:"application/json","x-arcnet-role":n}});if(!s.ok)throw await hr(s);return s.json()}const Zv={async loadFlowState(e,n,a){try{const s=encodeURIComponent(e),[i,r,c,o]=await Promise.all([cn(`/work-cells?facilityId=${s}`,n,a),cn(`/snapshots?facilityId=${s}`,n,a),cn(`/constraint?facilityId=${s}`,n,a).catch(d=>{if(d instanceof Error&&d.message==="unknown-facility")return null;throw d}),cn(`/recommendations?facilityId=${s}`,n,a)]);return{bundle:{facilityId:e,workCells:i.workCells,snapshots:r.snapshots,constraintAssessment:c,simulationRuns:[],dbrSchedules:[],recommendations:o.recommendations,dispositions:o.recommendations.map(d=>d.latestDisposition).filter(d=>!!d)},authoritative:!0,source:"gateway"}}catch(s){if(a?.aborted)throw s;return{bundle:Vv(),authoritative:!1,source:"mock-fixture",warning:s instanceof Error?s.message:"Flow gateway unavailable"}}},hasOperatorCredential(){try{return!!sessionStorage.getItem(Ds)}catch{return!1}},async submitDisposition(e,n,a){const s=sessionStorage.getItem(Ds);if(!s)throw new Error("Operator credential unavailable. Load the session operator credential before disposition.");const i=await fetch(`${pr}/recommendations/${encodeURIComponent(e)}/disposition`,{method:"POST",signal:a,headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${s}`},body:JSON.stringify({authorId:n.authorId,authorType:"human",action:n.action,reasonCode:n.reasonCode,note:n.note??null,modifiedPayload:n.modifiedPayload??null})});if(!i.ok)throw await hr(i);return{...await i.json(),authorId:n.authorId,authorType:"human",reasonCode:n.reasonCode,note:n.note??null,modifiedPayload:n.modifiedPayload??null}}},Xv="_shell_a9jlm_1",eb="_header_a9jlm_19",tb="_brand_a9jlm_32",nb="_separator_a9jlm_33",ab="_headerMeta_a9jlm_34",sb="_demoBadge_a9jlm_35",ib="_sourceChip_a9jlm_36",rb="_backLink_a9jlm_37",ob="_offlineBanner_a9jlm_39",cb="_errorBanner_a9jlm_40",lb="_degenerateBanner_a9jlm_41",db="_qualityRow_a9jlm_56",ub="_qualityChip_a9jlm_64",mb="_rollupChip_a9jlm_67",pb="_main_a9jlm_69",hb="_panel_a9jlm_77",fb="_panelTitle_a9jlm_85",gb="_networkPanel_a9jlm_96",_b="_constraintPanel_a9jlm_97",yb="_dbrPanel_a9jlm_98",vb="_recommendationPanel_a9jlm_99",bb="_cellStrip_a9jlm_106",
57jb="_cellSlot_a9jlm_114",xb="_routeArrow_a9jlm_115",Ib="_cell_a9jlm_106",wb="_cellName_a9jlm_132",Nb="_constraintChip_a9jlm_133",Sb="_cellSteps_a9jlm_140",Cb="_cellMetric_a9jlm_142",Rb="_queueBar_a9jlm_143",Eb="_cellStats_a9jlm_153",kb="_assessmentMeta_a9jlm_155",Pb="_ranking_a9jlm_164",Tb="_rankCell_a9jlm_173",Ab="_basis_a9jlm_175",Lb="_disabledNote_a9jlm_177",Ob="_empty_a9jlm_178",$b="_schedule_a9jlm_181",Mb="_scheduleMeta_a9jlm_182",Db="_bufferRow_a9jlm_184",Bb="_bufferLabel_a9jlm_185",Fb="_bufferBar_a9jlm_186",qb="_bufferThirdGreen_a9jlm_193",Hb="_bufferThirdYellow_a9jlm_194",Wb="_bufferThirdRed_a9jlm_195",Gb="_bufferMarker_a9jlm_196",Ub="_drumRope_a9jlm_205",zb="_card_a9jlm_207",Vb="_cardHead_a9jlm_214",Jb="_kindChip_a9jlm_215",Kb="_cardId_a9jlm_216",Yb="_summary_a9jlm_217",Qb="_effects_a9jlm_219",Zb="_advisoryFraming_a9jlm_224",Xb="_modifyEditor_a9jlm_232",ej="_actions_a9jlm_242",tj="_authorityNote_a9jlm_255",nj="_receipt_a9jlm_257",aj="_receiptEcho_a9jlm_265",sj="_footer_a9jlm_267",k={shell:Xv,header:eb,brand:tb,separator:nb,headerMeta:ab,demoBadge:sb,sourceChip:ib,backLink:rb,offlineBanner:ob,errorBanner:cb,degenerateBanner:lb,qualityRow:db,qualityChip:ub,rollupChip:mb,main:pb,panel:hb,panelTitle:fb,networkPanel:gb,constraintPanel:_b,dbrPanel:yb,recommendationPanel:vb,cellStrip:bb,cellSlot:jb,routeArrow:xb,cell:Ib,cellName:wb,constraintChip:Nb,cellSteps:Sb,cellMetric:Cb,queueBar:Rb,cellStats:Eb,assessmentMeta:kb,ranking:Pb,rankCell:Tb,basis:Ab,disabledNote:Lb,empty:Ob,schedule:$b,scheduleMeta:Mb,bufferRow:Db,bufferLabel:Bb,bufferBar:Fb,bufferThirdGreen:qb,bufferThirdYellow:Hb,bufferThirdRed:Wb,bufferMarker:Gb,drumRope:Ub,card:zb,cardHead:Vb,kindChip:Jb,cardId:Kb,summary:Yb,effects:Qb,advisoryFraming:Zb,modifyEditor:Xb,actions:ej,authorityNote:tj,receipt:nj,receiptEcho:aj,footer:sj},Bs=null,ij=15e3,rj="Advisory â authority gate: adam-l5. A disposition records a decision; it does not schedule work.";function zn(e){return e instanceof Date?e.getTime():Date.parse(e)}function bt(e){return(e instanceof Date?e.toISOString():new Date(e).toISOString()).replace(".000Z","Z")}function tt(e){return e.length>34?`${e.slice(0,24)}â¦${e.slice(-8)}`:e}function jt(e){return`${Math.round(e*100)}%`}function oj(e){return e.replace(/Delta$/,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function cj(e,n){const a=n>0?"+":"";return/TimeS(Delta)?$/.test(e)?`${a}${(n/3600).toFixed(1)} h`:`${a}${n}`}function lj(e){const n=xn;return[...e].sort((a,s)=>{const i=n.indexOf(a.cellId),r=n.indexOf(s.cellId);return(i===-1?n.length:i)-(r===-1?n.length:r)})}function Fs(e){return e<1/3?"green":e<2/3?"yellow":"red"}function ln(e){return Math.min(1,Math.max(0,e))}function dj({service:e=Zv,roleOverride:n}){const{session:a}=Ue(),s=x(P=>P.activeRole),i=x(P=>P.streamHealth),r=n??s??Si(a?.email),c=mr(r),o=!Bs,{connectionState:d}=Ji({url:Bs}),[l,g]=h.useState(null),[u,_]=h.useState(null),[m,v]=h.useState(null),[p,f]=h.useState(null),[b,w]=h.useState(null),[j,C]=h.useState(""),N=h.useRef(0);h.useEffect(()=>{if(c==="denied")return;const P=new AbortController;return e.loadFlowState(In,r,P.signal).then(G=>{g(G),_(G.warning??null);const se=x.getState();G.bundle.workCells.forEach(se.upsertFlowWorkCell),G.bundle.snapshots.forEach(se.upsertFlowSnapshot),G.bundle.constraintAssessment&&se.setFlowConstraintAssessment(G.bundle.constraintAssessment),G.bundle.simulationRuns.forEach(se.upsertFlowSimulationRun),G.bundle.dbrSchedules.forEach(se.upsertFlowDbrSchedule),G.bundle.recommendations.forEach(se.upsertFlowRecommendation),G.bundle.dispositions.forEach(se.recordFlowDisposition)}).catch(G=>{P.signal.aborted||_(G instanceof Error?G.message:"Flow state load failed")}),()=>P.abort()},[c,r,e]),h.useEffect(()=>{if(!l||l.source!=="mock-fixture")return;const P=setInterval(()=>{const G=x.getState(),se=ha(G.flowSnapshotsByCell),ge=xn[N.current%xn.length],De=se[ge];N.current+=1,De&&De.dataQuality!=="degenerate-single-pass"&&G.upsertFlowSnapshot(Jv(De,N.current))},ij);return()=>clearInterval(P)},[l]);const T=x(P=>P.flowWorkCells),R=x(P=>P.flowSnapshotsByCell),E=x(P=>P.flowConstraintAssessment),A=x(P=>P.flowDbrSchedules),V=x(P=>P.flowRecommendations),re=x(P=>P.flowDispositions),q=h.useMemo(()=>Qv({flowWorkCells:T,flowSnapshotsByCell:R,flowConstraintAssessment:E,flowDbrSchedules:A,flowRecommendations:V,flowDispositions:re},r),[T,R,E,A,V,re,r]),de=En({connectionState:d,isMockMode:o,streamHealth:i}),Z=async(P,G)=>{v(null);let se=null;if(G==="modify")try{se=JSON.parse(j)}catch{v("Modified payload must be valid JSON.");return}try{const ge=await e.submitDisposition(P.recommendationId,{authorId:a?.email??"operator-session",action:G,reasonCode:G==="approve"?"constraint-confirmed":G==="reject"?"operator-rejected":"operator-modified",note:G==="reject"?"Rejected by operator; constraint evidence not adopted.":"Reviewed under facility procedure; local interlocks remain authoritative.",modifiedPayload:se});f(ge),w(null),x.getState().recordFlowDisposition(ge)}catch(ge){v(ge instanceof Error?ge.message:"Disposition failed")}};if(c==="denied")return t.jsx(Ct,{to:"/role-chooser",replace:!0,state:{deniedRole:r}});const ue=l?.authoritative??!1,Ce=q?Kv(q.snapshotsByCell):null,$=Ce==="degenerate-single-pass",Me=q?ha(q.snapshotsByCell):{},ce=q?.constraintAssessment??null,W=$?null:ce?.constraintCellId??null,Xe=ue?Date.now():zn(qv),me=e.hasOperatorCredential(),ht=q?.access==="full"&&ue&&!de.restrictsPrivilegedWrites&&me&&!$,Tt=q?lj(q.workCells):[];return t.jsxs("div",{className:k.shell,"data-testid":"flow-console",children:[t.jsxs("header",{className:k.header,children:[t.jsxs("div",{children:[t.jsx("span",{className:k.brand,children:"ARCNET"}),t.jsx("span",{className:k.separator,children:"//"}),t.jsx("span",{children:"JONA FLOW"}),t.jsx("span",{className:k.separator,children:"·"}),t.jsxs("span",{children:["FACILITY ",In]})]}),t.jsxs("div",{className:k.headerMeta,children:[t.jsx("span",{className:k.demoBadge,"data-testid":"flow-capability-badge",children:"CAPABILITY DEMONSTRATION â NOT A QUALIFICATION CLAIM"}),t.jsxs("span",{className:k.sourceChip,children:[l?.source==="gateway"?"GATEWAY":"MOCK FIXTURE"," · ROLE ",r]}),t.jsx(Ae,{to:"/role-chooser",className:k.backLink,children:"[ PORTALS ]"})]})]}),t.jsx(lr,{role:r,connectionState:d,isMockMode:o}),(u||m)&&t.jsx("div",{className:m?k.errorBanner:k.offlineBanner,role:"status",children:m?`DISPOSITION BLOCKED
57· ${m}`:`MOCK FIXTURE ACTIVE · flow gateway unavailable · ${u}`}),Ce&&t.jsxs("div",{className:k.qualityRow,children:[t.jsxs("span",{className:k.qualityChip,"data-quality":Ce,"data-testid":"flow-quality-chip",children:["DATA QUALITY · ",Ce.toUpperCase()]}),q?.access==="rollup"&&t.jsx("span",{className:k.rollupChip,"data-testid":"flow-rollup-note",children:"ROLLUP PROJECTION · counts + utilization only · job identities, DBR schedule, and recommendations are not visible to node-site-manager"})]}),$&&t.jsx("div",{className:k.degenerateBanner,role:"alert","data-testid":"flow-degenerate-banner",children:"CALIBRATION ONLY â single-replay window (one job per cell) carries no queue statistics. Constraint identification and recommendations are disabled; nothing on this page is measured flow."}),t.jsxs("main",{className:k.main,children:[t.jsxs("section",{className:`${k.panel} ${k.networkPanel}`,"aria-label":"Work-cell network",children:[t.jsxs("div",{className:k.panelTitle,children:[t.jsx("span",{children:"WORK-CELL NETWORK · MICROTURBINE ROUTE"}),t.jsx("span",{children:"8 ROUTE STEPS â 6 CELLS"})]}),t.jsx("div",{className:k.cellStrip,children:Tt.map((P,G)=>{const se=Me[P.cellId],ge=P.cellId===W;return t.jsxs("div",{className:k.cellSlot,children:[G>0&&t.jsx("div",{className:k.routeArrow,"aria-hidden":"true",children:"â"}),t.jsxs("div",{className:k.cell,"data-constraint":ge||void 0,"data-testid":`flow-cell-${P.name.toLowerCase().replaceAll(" ","-")}`,children:[t.jsxs("div",{className:k.cellName,children:[t.jsx("strong",{children:P.name.toUpperCase()}),ge&&t.jsx("span",{className:k.constraintChip,"data-testid":"flow-constraint-chip",children:"CONSTRAINT"})]}),t.jsx("div",{className:k.cellSteps,children:P.stepTypes.join(" + ")}),se&&!$?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:k.cellMetric,children:[t.jsxs("span",{children:["QUEUE ",se.queueDepth,"/",P.inputBufferCapacity]}),t.jsx("div",{className:k.queueBar,"aria-hidden":"true",children:t.jsx("i",{style:{width:jt(ln(se.queueDepth/P.inputBufferCapacity))},"data-zone":Fs(ln(se.queueDepth/P.inputBufferCapacity))})})]}),t.jsxs("div",{className:k.cellStats,children:[t.jsxs("span",{children:["UTIL ",jt(se.utilization)]}),t.jsxs("span",{children:["WIP ",se.wip]})]})]}):t.jsx("div",{className:k.cellStats,children:t.jsx("span",{children:$?"CALIBRATION ONLY â NO QUEUE STATISTICS":"NO WINDOW"})})]})]},P.cellId)})})]}),t.jsxs("section",{className:`${k.panel} ${k.constraintPanel}`,"aria-label":"Constraint assessment","data-disabled":$||void 0,children:[t.jsxs("div",{className:k.panelTitle,children:[t.jsx("span",{children:"CONSTRAINT ASSESSMENT"}),t.jsx("span",{children:ce&&!$?ce.method.toUpperCase():"â"})]}),$?t.jsx("div",{className:k.disabledNote,"data-testid":"flow-constraint-disabled",children:"DISABLED â constraint identification requires multi-job flow statistics; the current window is a degenerate single pass."}):ce?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:k.assessmentMeta,children:[t.jsxs("span",{children:["FOCUSING STEP · ",ce.focusingStep.toUpperCase()," · CONFIDENCE"," ",jt(ce.confidence)]}),t.jsxs("span",{children:["WINDOW ",bt(ce.windowStart)," â ",bt(ce.windowEnd)]})]}),t.jsx("ol",{className:k.ranking,children:ce.cells.map(P=>t.jsxs("li",{"data-constraint":P.cellId===W||void 0,children:[t.jsx("span",{className:k.rankCell,children:P.cellId.split("/").at(-1)}),t.jsxs("span",{children:["util ",jt(P.utilization)]}),t.jsxs("span",{children:["queue ",P.queueDepth]}),t.jsxs("span",{children:["wait"," ",P.avgWaitTimeS===null?"â":`${(P.avgWaitTimeS/3600).toFixed(1)} h`]})]},P.cellId))}),ce.basis&&t.jsxs("div",{className:k.basis,children:["BASIS · ",ce.basis.snapshotIds.length," window snapshot(s)",ce.basis.simulationRunId?` · sim ${tt(ce.basis.simulationRunId)}`:""]}),ce.rollup&&t.jsx("div",{className:k.basis,children:"ROLLUP · evidence basis withheld"})]}):t.jsx("div",{className:k.empty,children:"NO ASSESSMENT FOR THIS WINDOW"})]}),q?.access==="full"&&t.jsxs("section",{className:`${k.panel} ${k.dbrPanel}`,"aria-label":"Drum-buffer-rope advisory","data-disabled":$||void 0,children:[t.jsxs("div",{className:k.panelTitle,children:[t.jsx("span",{children:"DBR ADVISORY · BUFFER PENETRATION"}),t.jsx("span",{children:"SCHEDULING CONTEXT â NOT A SCHEDULE OF RECORD"})]}),$?t.jsx("div",{className:k.disabledNote,children:"DISABLED â buffer context requires multi-job flow statistics."}):q.dbrSchedules.length>0?q.dbrSchedules.map(P=>{const G=P.rope[0],se=G?ln((Xe-zn(G.recommendedReleaseAt))/P.buffers.constraintBufferS/1e3):0,ge=P.drumSequence[0],De=ge?ln((Xe-zn(ge.plannedEnd))/P.buffers.shippingBufferS/1e3):0;return t.jsxs("div",{className:k.schedule,children:[t.jsxs("div",{className:k.scheduleMeta,children:[t.jsxs("span",{children:["DRUM · ",P.drumCellId.split("/").at(-1)]}
57),t.jsxs("span",{children:["SCHEDULE ",tt(P.scheduleId)]})]}),[{label:"CONSTRAINT BUFFER",seconds:P.buffers.constraintBufferS,penetration:se},{label:"SHIPPING BUFFER",seconds:P.buffers.shippingBufferS,penetration:De}].map(({label:J,seconds:Ne,penetration:et})=>t.jsxs("div",{className:k.bufferRow,children:[t.jsxs("span",{className:k.bufferLabel,children:[J," · ",(Ne/3600).toFixed(0)," h ·"," ",Fs(et).toUpperCase()]}),t.jsxs("div",{className:k.bufferBar,role:"img","aria-label":`${J} penetration ${jt(et)}`,children:[t.jsx("i",{className:k.bufferThirdGreen}),t.jsx("i",{className:k.bufferThirdYellow}),t.jsx("i",{className:k.bufferThirdRed}),t.jsx("span",{className:k.bufferMarker,style:{left:jt(et)}})]})]},J)),t.jsxs("div",{className:k.drumRope,children:[P.drumSequence.map(J=>t.jsxs("div",{children:["DRUM · ",J.jobId," · ",bt(J.plannedStart)," â"," ",bt(J.plannedEnd)]},`drum-${J.jobId}`)),P.rope.map(J=>t.jsxs("div",{children:["ROPE · release ",J.jobId," at ",bt(J.recommendedReleaseAt)]},`rope-${J.jobId}`))]})]},P.scheduleId)}):t.jsx("div",{className:k.empty,children:"NO DBR ADVISORY FOR THIS WINDOW"})]}),q?.access==="full"&&t.jsxs("section",{className:`${k.panel} ${k.recommendationPanel}`,"aria-label":"Flow recommendations","data-disabled":$||void 0,children:[t.jsxs("div",{className:k.panelTitle,children:[t.jsx("span",{children:"RECOMMENDATIONS"}),t.jsx("span",{children:"HUMAN DISPOSITION REQUIRED"})]}),$?t.jsx("div",{className:k.disabledNote,"data-testid":"flow-recommendations-disabled",children:"DISABLED â recommendations require multi-job flow statistics."}):q.recommendations.length>0?q.recommendations.map(P=>{const G=q.dispositions[P.recommendationId]??P.latestDisposition??null,se=!!G,ge=ht&&!se,De=b===P.recommendationId;return t.jsxs("article",{className:k.card,"data-testid":"flow-recommendation-card",children:[t.jsxs("div",{className:k.cardHead,children:[t.jsx("span",{className:k.kindChip,children:P.kind.toUpperCase()}),t.jsx("span",{className:k.cardId,children:tt(P.recommendationId)})]}),t.jsx("p",{className:k.summary,children:P.summary}),t.jsx("dl",{className:k.effects,children:Object.entries(P.expectedEffect).map(([J,Ne])=>t.jsxs("div",{children:[t.jsx("dt",{children:oj(J)}),t.jsx("dd",{children:cj(J,Ne)})]},J))}),t.jsxs("div",{className:k.basis,children:["BASIS",P.basis.assessmentId?` · assessment ${tt(P.basis.assessmentId)}`:"",P.basis.scheduleId?` · schedule ${tt(P.basis.scheduleId)}`:""]}),t.jsx("p",{className:k.advisoryFraming,children:rj}),De&&t.jsxs("label",{className:k.modifyEditor,children:[t.jsx("span",{children:"MODIFIED PAYLOAD (JSON)"}),t.jsx("textarea",{"aria-label":"Modified payload JSON",value:j,onChange:J=>C(J.target.value),rows:5})]}),t.jsxs("div",{className:k.actions,children:[t.jsx("button",{disabled:!ge,onClick:()=>void Z(P,"approve"),children:"[ APPROVE ]"}),t.jsx("button",{disabled:!ge,onClick:()=>void Z(P,"reject"),children:"[ REJECT ]"}),t.jsxs("button",{disabled:!ge,onClick:()=>{De?Z(P,"modify"):(C(JSON.stringify(P.detail,null,2)),w(P.recommendationId))},children:["[ ",De?"SUBMIT MODIFICATION":"MODIFY"," ]"]}),De&&t.jsx("button",{onClick:()=>w(null),children:"[ CANCEL ]"})]}),!ge&&!se&&t.jsx("p",{className:k.authorityNote,children:"Disposition requires an authoritative gateway, a fresh projection, and a session operator credential."}),G&&t.jsxs("div",{className:k.receipt,"data-testid":"flow-disposition-receipt",children:["DISPOSITION ",G.action.toUpperCase()," ·"," ",tt(G.dispositionId)," · ",bt(G.at)," · RECORDED â NO WORK SCHEDULED"]})]},P.recommendationId)}):t.jsx("div",{className:k.empty,children:"NO OPEN RECOMMENDATIONS"}),p&&t.jsxs("div",{className:k.receiptEcho,children:["LAST RECEIPT · ",tt(p.dispositionId)," for"," ",tt(p.recommendationId)]})]})]}),t.jsx("footer",{className:k.footer,children:"Capability demonstration â not a qualification claim. JONA Flow output is advisory scheduling context; facility procedures, interlocks, and the site operator retain absolute physical authority."})]})}const uj="_layout_o270z_19",mj="_crtCurve_o270z_36",pj="_header_o270z_44",hj="_globe_o270z_51",fj="_sidebar_o270z_60",gj="_sidebarPanel_o270z_95",_j="_events_o270z_103",yj="_command_o270z_115",vj="_placeholder_o270z_124",bj="_placeholderL
57abel_o270z_150",jj="_loadingOverlay_o270z_210",xj="_loadingText_o270z_221",Le={layout:uj,crtCurve:mj,header:pj,globe:hj,sidebar:fj,sidebarPanel:gj,events:_j,command:yj,placeholder:vj,placeholderLabel:bj,loadingOverlay:jj,loadingText:xj};function xt({label:e}){return t.jsx("div",{className:Le.placeholder,children:t.jsx("span",{className:Le.placeholderLabel,children:e})})}function Ij({header:e,globe:n,sidebar:a,eventLog:s,commandLine:i,isLoading:r=!1,loadingMessage:c="Initializing ARCNet Console..."}){const o=x(d=>d.showScanlines);return t.jsxs("div",{className:`${Le.layout} ${Le.crtCurve}`,children:[t.jsx("header",{className:Le.header,children:e??t.jsx(xt,{label:"Header"})}),t.jsx("main",{className:Le.globe,"data-testid":"arcnet-map-region",children:n??t.jsx(xt,{label:"Globe Visualization"})}),t.jsx("aside",{className:Le.sidebar,children:a??t.jsxs(t.Fragment,{children:[t.jsx("div",{className:Le.sidebarPanel,children:t.jsx(xt,{label:"Resource Panel"})}),t.jsx("div",{className:Le.sidebarPanel,children:t.jsx(xt,{label:"Node Detail"})})]})}),t.jsx("section",{className:Le.events,children:s??t.jsx(xt,{label:"Event Log"})}),t.jsx("footer",{className:Le.command,children:i??t.jsx(xt,{label:"Command Line"})}),t.jsx(Nd,{enabled:o,intensity:"light",flicker:!1,vignette:!1,rgbShift:!1,phosphorGlow:!1}),r&&t.jsx("div",{className:Le.loadingOverlay,children:t.jsx("span",{className:Le.loadingText,children:c})})]})}const wj="_container_6kx2s_3",Nj="_clickable_6kx2s_21",Sj="_indicator_6kx2s_32",Cj="_green_6kx2s_40",Rj="_yellow_6kx2s_45",Ej="_red_6kx2s_50",kj="_blue_6kx2s_55",Pj="_pulse_6kx2s_61",Tj="_label_6kx2s_95",It={container:wj,clickable:Nj,indicator:Sj,green:Cj,yellow:Rj,red:Ej,blue:kj,pulse:Pj,label:Tj};function Aj({state:e,isMockMode:n,streamHealth:a,onClick:s}){const r=(()=>{if(n)return{label:"MOCK",color:"blue",pulse:!1,tooltip:"Using simulated telemetry data"};if(e==="connected"&&a){if(a.malformedFrames>0||a.unknownFrames>0)return{label:"SCHEMA",color:"red",pulse:!1,tooltip:a.lastIssue?.message??"Stream schema issue detected"};if(a.droppedFrames>0||a.outOfOrderFrames>0)return{label:"GAP",color:"yellow",pulse:!0,tooltip:a.lastIssue?.message??"Stream sequence gap detected"};if(a.staleFrames>0)return{label:"STALE",color:"yellow",pulse:!0,tooltip:a.lastIssue?.message??"Stream frame exceeded freshness TTL"};if(a.mode==="legacy")return{label:"LEGACY",color:"blue",pulse:!0,tooltip:"Connected using legacy telemetry frames"}}switch(e){case"connected":return{label:"LIVE",color:"green",pulse:!0,tooltip:"Connected to ArcNet telemetry stream"};case"connecting":return{label:"CONNECTING",color:"yellow",pulse:!0,tooltip:"Connecting to telemetry stream..."};case"error":return{label:"ERROR",color:"red",pulse:!1,tooltip:"Connection error - click to retry"};case"disconnected":default:return{label:"OFFLINE",color:"red",pulse:!1,tooltip:"Disconnected - click to reconnect"}}})(),c=!n&&(e==="disconnected"||e==="error");return t.jsxs("div",{className:`${It.container} ${c?It.clickable:""}`,onClick:c?s:void 0,title:r.tooltip,children:[t.jsx("div",{className:`${It.indicator} ${It[r.color]} ${r.pulse?It.pulse:""}`}),t.jsx("span",{className:It.label,children:r.label})]})}const Lj="_header_vbigi_5",Oj="_titleSection_vbigi_17",$j="_asciiTitle_vbigi_24",Mj="_titleText_vbigi_34",Dj="_mainTitle_vbigi_40",Bj="_subtitle_vbigi_51",Fj="_statsSection_vbigi_61",qj="_statItem_vbigi_70",Hj="_statLabel_vbigi_78",Wj="_statValue_vbigi_87",Gj="_statHighlight_vbigi_97",Uj="_statWarning_vbigi_102",zj="_statError_vbigi_107",Vj="_toneinfo_vbigi_112",Jj="_tonenominal_vbigi_117",Kj="_tonewatch_vbigi_122",Yj="_tonecritical_vbigi_127",Qj="_statCogen_vbigi_132",Zj="_statDivider_vbigi_137",Xj="_rightSection_vbigi_144",ex="_portalLink_vbigi_151",tx="_clock_vbigi_180",nx="_clockTime_vbigi_187",ax="_clockDate_vbigi_196",sx="_clockLabel_vbigi_205",ix="_connectionStatus_vbigi_215",rx="_connected_vbigi_224",ox="_disconnected_vbigi_228",cx="_connectionDot_vbigi_233",lx="_pulse_vbigi_1",dx="_connectionLabel_vbigi_247",ux="_demoLink_vbigi_261",F={header:Lj,titleSection:Oj,asciiTitle:$j,titleText:Mj,mainTitle:Dj,subtitle:Bj,statsSection:Fj,statItem:qj,statLabel:Hj,statValue:Wj,statHighlight:Gj,statWarning:Uj,statError:zj,toneinfo:Vj,tonenominal:Jj,tonewatch:Kj,tonecritical:Yj,statCogen:Qj,statDivider:Zj,rightSection:Xj,portalLink:ex,clock:tx,clockTime:nx,clockDate:ax,clockLabel:sx,connectionStatus:ix,connected:rx,disconnected:ox,connectionDot:cx,pulse:lx,connectionLabel:dx,demoLink:ux},mx=` _ ____ ____ _ _ _ 58 / \\ | _ \\ / ___| \\ | | ___| |_ 59 / _ \\ | |_) | | | \\| |/ _ \\ __| 60 / ___ \\| _ <| |___| |\\ | __/ |_ 61/_/ \\_\\_| \\_\\\\____|_| \\_|\\___|\\__|`;function dn(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function px(){const[e,n]=h.useState(new Date);return h.useEffect(()=>{const a=setInterval(()=>n(new Date),1e3);return()=>clearInterval(a)},[]),{time:e.toISOString().slice(11,19),date:e.toISOString().slice(0,10)}}function hx({connectionState:e="disconnected",isMockMode:n=!1,onReconnect:a}){const{time:s,date:i}=px(),r=x(_=>
61Object.values(_.nodes)),c=x(_=>Object.values(_.jobs)),o=x(_=>_.globalStats),d=x(_=>_.activeRole),l=x(_=>_.streamHealth),g=En({connectionState:e,isMockMode:n,streamHealth:l}),u=h.useMemo(()=>{const _=c.filter(f=>f.status!=="evidence-sealed"&&f.status!=="rejected").length,m=c.filter(f=>f.status==="evidence-sealed").length,v=r.filter(f=>f.networkMode==="disconnected-local").length,p=r.filter(f=>f.networkMode==="connected-degraded").length;return{totalNodes:r.length,online:r.filter(f=>f.networkMode==="connected-normal").length,degraded:p,disconnected:v,jobsInFlight:_,jobsCompleted:m,avgDeltaAlpha:o?.avgDeltaAlpha??0,evidenceSealed:o?.evidenceSealedToday??0}},[r,c,o]);return t.jsxs("header",{className:F.header,children:[t.jsxs("div",{className:F.titleSection,children:[t.jsx("pre",{className:F.asciiTitle,children:mx}),t.jsxs("div",{className:F.titleText,children:[t.jsx("h1",{className:F.mainTitle,children:"ARCNet Console"}),t.jsx("span",{className:F.subtitle,children:d?`role: ${d}`:"Autonomous Distributed Manufacturing"})]})]}),t.jsxs("div",{className:F.statsSection,children:[t.jsxs("div",{className:F.statItem,children:[t.jsx("span",{className:F.statLabel,children:"Nodes"}),t.jsxs("span",{className:`${F.statValue} ${u.online>0?F.statHighlight:F.statError}`,children:[dn(u.online),"/",dn(u.totalNodes)]})]}),t.jsx("div",{className:F.statDivider}),t.jsxs("div",{className:F.statItem,children:[t.jsx("span",{className:F.statLabel,children:"Degraded"}),t.jsx("span",{className:`${F.statValue} ${u.degraded>0?F.statWarning:""}`,children:u.degraded})]}),t.jsx("div",{className:F.statDivider}),t.jsxs("div",{className:F.statItem,children:[t.jsx("span",{className:F.statLabel,children:"Disc-Local"}),t.jsx("span",{className:`${F.statValue} ${u.disconnected>0?F.statWarning:""}`,children:u.disconnected})]}),t.jsx("div",{className:F.statDivider}),t.jsxs("div",{className:F.statItem,children:[t.jsx("span",{className:F.statLabel,children:"Projection"}),t.jsx("span",{title:g.detail,className:`${F.statValue} ${F[`tone${g.tone}`]}`,children:g.label})]}),t.jsx("div",{className:F.statDivider}),t.jsxs("div",{className:F.statItem,children:[t.jsx("span",{className:F.statLabel,children:"Jobs â»"}),t.jsx("span",{className:`${F.statValue} ${F.statHighlight}`,children:dn(u.jobsInFlight)})]}),t.jsx("div",{className:F.statDivider}),t.jsxs("div",{className:F.statItem,children:[t.jsx("span",{className:F.statLabel,children:"Sealed"}),t.jsx("span",{className:`${F.statValue} ${F.statHighlight}`,children:dn(u.evidenceSealed)})]}),t.jsx("div",{className:F.statDivider}),t.jsxs("div",{className:F.statItem,children:[t.jsx("span",{className:F.statLabel,children:"Avg Îα"}),t.jsx("span",{className:F.statValue,children:u.avgDeltaAlpha.toFixed(3)})]})]}),t.jsxs("div",{className:F.rightSection,children:[t.jsx(Ae,{to:"/role-chooser",className:F.portalLink,"aria-label":"Back to portal chooser",children:"[ Portal ]"}),t.jsx(Cn,{}),t.jsx(Aj,{state:e,isMockMode:n,streamHealth:l,onClick:a}),t.jsxs("div",{className:F.clock,children:[t.jsx("span",{className:F.clockTime,children:s}),t.jsx("span",{className:F.clockDate,children:i}),t.jsx("span",{className:F.clockLabel,children:"UTC"})]})]})]})}const fx="_metricsGrid_1c5nq_5",gx="_metricRow_1c5nq_11",_x="_metricHeader_1c5nq_17",yx="_metricLabel_1c5nq_23",vx="_metricValue_1c5nq_32",bx="_highlight_1c5nq_39",jx="_warning_1c5nq_44",xx="_hpc_1c5nq_54",Ix="_divider_1c5nq_72",wx="_summaryGrid_1c5nq_79",Nx="_summaryItem_1c5nq_85",Sx="_summaryLabel_1c5nq_91",Cx="_summaryValue_1c5nq_100",U={metricsGrid:fx,metricRow:gx,metricHeader:_x,metricLabel:yx,metricValue:vx,highlight:bx,warning:jx,hpc:xx,divider:Ix,summaryGrid:wx,summaryItem:Nx,summaryLabel:Sx,summaryValue:Cx},qs=["ornl-hub","regional-hub","production","test-qualification","scout"],Rx={"ornl-hub":"ORNL","regional-hub":"Regional",production:"Production","test-qualification":"Test&Qual",scout:"Scout"};function fa(){const e=x(o=>Object.values(o.nodes)),n=x(o=>Object.values(o.jobs)),a=x(o=>Object.values(o.evidencePackages)),s=x(o=>o.signalEvents),i=x(o=>Object.values(o.facilityRollups)),r=h.useMemo(()=>{const o=Object.fromEntries(qs.map(m=>[m,e.filter(v=>v.class===m).length])),d=e.filter(m=>m.networkMode==="connected-normal").length,l=e.filter(m=>m.networkMode==="connected-degraded").length,g=e.filter(m=>m.networkMode==="disconnected-local").length,u=n.filter(m=>m.status!=="evidence-sealed"&&m.status!=="rejected").length,_=s.filter(m=>m.kind==="phase-transition"&&Date.now()-m.at.getTime()<6e4).length;return{classes:o,online:d,degraded:l,offline:g,jobsInFlight:u,evidenceSealed:a.length,recentPhase:_,throughput:i.length>0?i[i.length-1]?.throughputJobsPerDay??0:0}},[e,n,a,s,i]),c=e.length||1;return t.jsx(ie,{title:"Facility resources",variant:"default",size:"sm",children:t.jsxs("div",{className:U.metricsGrid,children:[t.jsxs("div",{className:U.metricRow,children:[t.jsxs("div",{className:U.metricHeader,children:[t.jsx("span",{className:U.metricLabel,children:"Network online"}),t.jsxs("span",{className:`${U.metricValue} ${U.highlight}`,children:[r.online,"/",c]})]}),t.jsx(it,{value:r.online/c*100,width:16,showPercentage:!1,colorScheme:"cyan",size:"sm",brackets:!0})]}),t.jsxs("div",{className:U.metricRow,children:[t.jsxs("div",{className:U.metricHeader,children:[t.jsx("span",{className:U.metricLabel,children:"Degraded"}),t.jsx("span",{className:`${U.metricValue} ${r.degraded>0?U.warning:""}`,children:r.degraded}
61)]}),t.jsx(it,{value:r.degraded/c*100,width:16,showPercentage:!1,colorScheme:"auto",size:"sm",brackets:!0})]}),t.jsxs("div",{className:U.metricRow,children:[t.jsxs("div",{className:U.metricHeader,children:[t.jsx("span",{className:U.metricLabel,children:"Disc-Local"}),t.jsx("span",{className:`${U.metricValue} ${r.offline>0?U.warning:""}`,children:r.offline})]}),t.jsx(it,{value:r.offline/c*100,width:16,showPercentage:!1,colorScheme:"auto",size:"sm",brackets:!0})]}),t.jsxs("div",{className:U.metricRow,children:[t.jsxs("div",{className:U.metricHeader,children:[t.jsx("span",{className:U.metricLabel,children:"Jobs in flight"}),t.jsx("span",{className:`${U.metricValue} ${U.highlight}`,children:r.jobsInFlight})]}),t.jsx(it,{value:Math.min(r.jobsInFlight,50),max:50,width:16,showPercentage:!1,colorScheme:"cyan",size:"sm",brackets:!0})]}),t.jsxs("div",{className:U.metricRow,children:[t.jsxs("div",{className:U.metricHeader,children:[t.jsx("span",{className:U.metricLabel,children:"Evidence sealed"}),t.jsx("span",{className:`${U.metricValue} ${U.highlight}`,children:r.evidenceSealed})]}),t.jsx(it,{value:Math.min(r.evidenceSealed,50),max:50,width:16,showPercentage:!1,colorScheme:"cyan",size:"sm",brackets:!0})]}),t.jsx("div",{className:U.divider}),t.jsxs("div",{className:U.summaryGrid,children:[qs.map(o=>t.jsxs("div",{className:U.summaryItem,children:[t.jsx("span",{className:U.summaryLabel,children:Rx[o]}),t.jsx("span",{className:U.summaryValue,children:r.classes[o]})]},o)),t.jsxs("div",{className:U.summaryItem,children:[t.jsx("span",{className:U.summaryLabel,children:"Phase txn (1m)"}),t.jsx("span",{className:`${U.summaryValue} ${U.hpc}`,children:r.recentPhase})]}),t.jsxs("div",{className:U.summaryItem,children:[t.jsx("span",{className:U.summaryLabel,children:"Jobs/day"}),t.jsx("span",{className:U.summaryValue,children:r.throughput.toFixed(0)})]})]})]})})}const Ex="_emptyState_1i4i3_6",kx="_emptyIcon_1i4i3_16",Px="_emptyTitle_1i4i3_23",Tx="_emptyHint_1i4i3_33",Ax="_detailContent_1i4i3_66",Lx="_closeButton_1i4i3_73",Ox="_section_1i4i3_89",$x="_sectionTitle_1i4i3_95",Mx="_nodeHeader_1i4i3_105",Dx="_nodeName_1i4i3_112",Bx="_nodeId_1i4i3_120",Fx="_divider_1i4i3_128",qx="_row_1i4i3_135",Hx="_label_1i4i3_141",Wx="_value_1i4i3_150",Gx="_valueSmall_1i4i3_157",Ux="_valueCode_1i4i3_164",zx="_modelList_1i4i3_177",Vx="_modelTag_1i4i3_183",Jx="_noModels_1i4i3_194",Kx="_actions_1i4i3_202",Yx="_actionButton_1i4i3_210",M={emptyState:Ex,emptyIcon:kx,emptyTitle:Px,emptyHint:Tx,detailContent:Ax,closeButton:Lx,section:Ox,sectionTitle:$x,nodeHeader:Mx,nodeName:Dx,nodeId:Bx,divider:Fx,row:qx,label:Hx,value:Wx,valueSmall:Gx,valueCode:Ux,modelList:zx,modelTag:Vx,noModels:Jx,actions:Kx,actionButton:Yx};function Qx(e){const n=Math.floor((Date.now()-e.getTime())/1e3);return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function Zx(e){return e.networkMode==="disconnected-local"?"offline":e.networkMode==="connected-degraded"?"stale":e.attestationFresh?"online":"idle"}function Xx(){return t.jsxs("div",{className:M.emptyState,children:[t.jsx("div",{className:M.emptyIcon,children:"[ ]"}),t.jsx("span",{className:M.emptyTitle,children:"No node selected"}),t.jsx("span",{className:M.emptyHint,children:"Click a node on the globe to view details"})]})}function ga(){const e=x(l=>l.selectedNodeId),n=x(l=>e?l.nodes[e]:null),a=x(l=>e?l.signalSamples[e]??[]:[]),s=x(l=>l.activeRole),i=x(l=>l.flyToNode),r=x(l=>l.selectNode),c=x(l=>e?l.attestationResults[e]:void 0),o=h.useMemo(()=>a[a.length-1],[a]);if(!n)return t.jsx(ie,{title:"Node Detail",variant:"default",size:"sm",children:t.jsx(Xx,{})});const d=s!=="line-technician";return t.jsx(ie,{title:"Node Detail",variant:"accent",size:"sm",headerActions:t.jsx("button",{className:M.closeButton,onClick:()=>r(null),children:"[Ã]"}),children:t.jsxs("div",{className:M.detailContent,children:[t.jsxs("div",{className:M.section,children:[t.jsxs("div",{className:M.nodeHeader,children:[t.jsx("span",{className:M.nodeName,children:n.id}),t.jsx(Rn,{status:Zx(n),size:"sm"})]}),t.jsxs("span",{className:M.nodeId,children:[n.class," · facility ",n.facilityId]})]}),t.jsx("div",{className:M.divider}),t.jsxs("div",{className:M.section,children:[t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"Network"}),t.jsx("span",{className:M.value,children:n.networkMode})]}),t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"Attestation"}),t.jsxs("span",{className:M.value,children:[n.attestationFresh?"â fresh":"â stale",c?` (${c.verifiedAt.toISOString().slice(11,19)})`:""]})]}),t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"Token"}),t.jsx("span",{className:M.value,children:n.tokenHeld?"â holds":"â"})]})]}),t.jsx("div",{className:M.divider}),d&&t.jsxs("div",{className:M.section,children:[t.jsx("div",{className:M.sectionTitle,children:"ARC Signal"}),t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"Samples"}),t.jsx("span",{className:M.value,children:a.length})]}),o?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"Îα"}),t.jsx("span",{className:M.valueCode,children:o.deltaAlpha.toFixed(4)})]}),t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"h_2"}),t.jsx("span",{className:M.valueCode,children:(o.hQ[2]??0).toFixed(3)})]}),t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"h_6"}),t.jsx("span",{className:M.valueCode,children:(o.hQ[6]??0).toFixed(3)})]})]}):t.jsx("div",{className:M.noModels,children:"no samples yet"})]}),d&&t.jsx("div",{className:M.divider}),t.jsxs("div",{className:M.section,children:[t.jsx("div",{className:M.sectionTitle,children:"Active jobs"}),n.activeJobs.length===0?t.jsx("span",{className:M.noModels,children:"none"}):t.jsx("div",{className:M.modelList,children:n.activeJobs.map(l
61=>t.jsx("span",{className:M.modelTag,children:l},l))})]}),t.jsx("div",{className:M.divider}),t.jsxs("div",{className:M.section,children:[t.jsx("div",{className:M.sectionTitle,children:"Location"}),t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"Coords"}),t.jsxs("span",{className:M.valueSmall,children:[n.position[1].toFixed(4),"°, ",n.position[0].toFixed(4),"°"]})]}),t.jsxs("div",{className:M.row,children:[t.jsx("span",{className:M.label,children:"Seen"}),t.jsx("span",{className:M.valueSmall,children:Qx(n.lastSeen)})]})]}),t.jsx("div",{className:M.actions,children:t.jsx("button",{className:M.actionButton,onClick:()=>i(n.id),children:"[Fly To]"})})]})})}const e0="_container_1ld1y_6",t0="_minimized_1ld1y_23",n0="_header_1ld1y_30",a0="_title_1ld1y_46",s0="_headerActions_1ld1y_56",i0="_eventCount_1ld1y_62",r0="_actionBtn_1ld1y_69",o0="_active_1ld1y_88",c0="_eventList_1ld1y_93",l0="_empty_1ld1y_107",d0="_entryContainer_1ld1y_117",u0="_entry_1ld1y_117",m0="_clickable_1ld1y_134",p0="_selectedReceiptEvent_1ld1y_142",h0="_timestamp_1ld1y_147",f0="_type_1ld1y_152",g0="_message_1ld1y_159",_0="_receiptLink_1ld1y_165",y0="_nodeId_1ld1y_182",v0="_expandIcon_1ld1y_189",b0="_details_1ld1y_197",j0="_detailRow_1ld1y_208",x0="_detailKey_1ld1y_213",I0="_detailValue_1ld1y_218",w0="_typeInference_1ld1y_224",N0="_typeHpc_1ld1y_233",S0="_typeNodeOnline_1ld1y_242",C0="_typeReceipt_1ld1y_250",R0="_typeNodeOffline_1ld1y_259",E0="_typeWarning_1ld1y_267",k0="_typeError_1ld1y_276",P0="_typeSystem_1ld1y_285",T0="_scrollIndicator_1ld1y_295",A0="_filtersPanel_1ld1y_346",L0="_filterSection_1ld1y_356",O0="_filterLabel_1ld1y_362",$0="_searchInput_1ld1y_371",M0="_filterButtons_1ld1y_394",D0="_filterBtn_1ld1y_400",B0="_clearFiltersBtn_1ld1y_453",D={container:e0,minimized:t0,header:n0,title:a0,headerActions:s0,eventCount:i0,actionBtn:r0,active:o0,eventList:c0,empty:l0,entryContainer:d0,entry:u0,clickable:m0,selectedReceiptEvent:p0,timestamp:h0,type:f0,message:g0,receiptLink:_0,nodeId:y0,expandIcon:v0,details:b0,detailRow:j0,detailKey:x0,detailValue:I0,typeInference:w0,typeHpc:N0,typeNodeOnline:S0,typeReceipt:C0,typeNodeOffline:R0,typeWarning:E0,typeError:k0,typeSystem:P0,scrollIndicator:T0,filtersPanel:A0,filterSection:L0,filterLabel:O0,searchInput:$0,filterButtons:M0,filterBtn:D0,clearFiltersBtn:B0};function F0(e){return e.toISOString().slice(11,19)}function fr(e){const n=e.split(".");return(n[n.length-1]??e).toUpperCase().slice(0,8)}function q0(e,n){return n==="error"?D.typeError:n==="warn"?D.typeWarning:e.startsWith("signal.")?D.typeHpc:e.startsWith("job.")||e.startsWith("downlink.")?D.typeInference:e.startsWith("correction.")?D.typeNodeOnline:e.startsWith("relational.")?D.typeHpc:e.startsWith("network-mode.")?D.typeNodeOffline:e.startsWith("attestation.")||e.startsWith("token-ring.")?D.typeSystem:e.startsWith("audit.")||e.startsWith("evidence.")||e.startsWith("command.")?D.typeReceipt:D.typeSystem}const H0=["job.submitted","job.state","downlink.ready","downlink.failed","signal.phase-transition","signal.ageing-drift","intervention.micro-adjust","intervention.ramp-halt","correction.outcome","relational.prediction","attestation.ok","attestation.failed","token-ring.pass","evidence.sealed","evidence.updated","audit.record","command.receipt","network-mode.disconnected","system"],W0=["info","success","warn","error"];function G0({event:e,isExpanded:n,isSelected:a,receiptLink:s,onToggle:i,onSelectReceipt:r}){const c=q0(e.kind,e.severity),o=e.details&&Object.keys(e.details).length>0;return t.jsxs("div",{className:D.entryContainer,children:[t.jsxs("div",{className:`${D.entry} ${c} ${o?D.clickable:""} ${a?D.selectedReceiptEvent:""}`,onClick:o?i:void 0,children:[t.jsxs("span",{className:D.timestamp,children:["[",F0(e.at),"]"]}),t.jsx("span",{className:`${D.type} ${c}`,children:fr(e.kind)}),t.jsx("span",{className:D.message,children:e.message}),s&&t.jsx("button",{type:"button",className:D.receiptLink,onClick:d=>{d.stopPropagation(),r(s)},title:"Trace receipt","data-testid":`event-receipt-link-${e.id}`,children:"[receipt]"}),e.nodeId&&t.jsx("span",{className:D.nodeId,children:e.nodeId.slice(-8)}
61),o&&t.jsx("span",{className:D.expandIcon,children:n?"â¼":"â¶"})]}),n&&o&&e.details&&t.jsx("div",{className:D.details,children:Object.entries(e.details).map(([d,l])=>t.jsxs("div",{className:D.detailRow,children:[t.jsxs("span",{className:D.detailKey,children:[d,":"]}),t.jsx("span",{className:D.detailValue,children:JSON.stringify(l)})]},d))})]})}function U0(){const e=h.useRef(null),[n,a]=h.useState(!0),[s,i]=h.useState(""),[r,c]=h.useState(new Set),[o,d]=h.useState(new Set),[l,g]=h.useState(new Set),[u,_]=h.useState(!1),[m,v]=h.useState(!1),p=x(R=>R.events),f=x(R=>R.selectedReceiptLink),b=La(),w=h.useMemo(()=>{let R=p;if(r.size>0&&(R=R.filter(E=>r.has(E.kind))),o.size>0&&(R=R.filter(E=>o.has(E.severity))),s.trim()){const E=s.toLowerCase();R=R.filter(A=>A.message.toLowerCase().includes(E)||A.nodeId?.toLowerCase().includes(E)||A.jobId?.toLowerCase().includes(E)||A.kind.toLowerCase().includes(E))}return R.slice(0,120)},[p,r,o,s]);h.useEffect(()=>{n&&e.current&&(e.current.scrollTop=e.current.scrollHeight)},[w,n]);const j=h.useCallback(()=>{if(!e.current)return;const{scrollTop:R,scrollHeight:E,clientHeight:A}=e.current;a(E-R-A<50)},[]),C=R=>c(E=>{const A=new Set(E);return A.has(R)?A.delete(R):A.add(R),A}),N=R=>d(E=>{const A=new Set(E);return A.has(R)?A.delete(R):A.add(R),A}),T=r.size>0||o.size>0||s.trim()!=="";return t.jsxs("div",{className:`${D.container} ${m?D.minimized:""}`,children:[t.jsxs("div",{className:D.header,children:[t.jsx("span",{className:D.title,children:"EVENT LOG"}),t.jsxs("div",{className:D.headerActions,children:[!m&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:D.eventCount,children:[w.length,"/",p.length]}),t.jsx("button",{className:`${D.actionBtn} ${u?D.active:""}`,onClick:()=>_(!u),title:"Toggle filters",children:"[â]"}),!n&&t.jsx("button",{className:D.actionBtn,onClick:()=>{e.current&&(e.current.scrollTop=e.current.scrollHeight,a(!0))},title:"Scroll to bottom",children:"[â]"})]}),t.jsx("button",{className:D.actionBtn,onClick:()=>v(!m),title:m?"Expand":"Minimize",children:m?"[+]":"[â]"})]})]}),!m&&t.jsxs(t.Fragment,{children:[u&&t.jsxs("div",{className:D.filtersPanel,children:[t.jsx("div",{className:D.filterSection,children:t.jsx("input",{type:"text",className:D.searchInput,placeholder:"Search events...",value:s,onChange:R=>i(R.target.value)})}),t.jsxs("div",{className:D.filterSection,children:[t.jsx("span",{className:D.filterLabel,children:"Kind:"}),t.jsx("div",{className:D.filterButtons,children:H0.map(R=>t.jsx("button",{className:`${D.filterBtn} ${r.has(R)?D.active:""}`,onClick:()=>C(R),children:fr(R)},R))})]}),t.jsxs("div",{className:D.filterSection,children:[t.jsx("span",{className:D.filterLabel,children:"Severity:"}),t.jsx("div",{className:D.filterButtons,children:W0.map(R=>t.jsx("button",{className:`${D.filterBtn} ${o.has(R)?D.active:""}`,onClick:()=>N(R),children:R.toUpperCase()},R))})]}),T&&t.jsx("button",{className:D.clearFiltersBtn,onClick:()=>{c(new Set),d(new Set),i("")},children:"Clear Filters"})]}),t.jsx("div",{ref:e,className:D.eventList,onScroll:j,children:w.length===0?t.jsx("div",{className:D.empty,children:t.jsx("span",{children:T?"No events match filters":"Waiting for eventsâ¦"})}):w.map(R=>{const E=Iy(R);return t.jsx(G0,{event:R,isExpanded:l.has(R.id),isSelected:or(f,E),receiptLink:E,onToggle:()=>g(A=>{const V=new Set(A);return V.has(R.id)?V.delete(R.id):V.add(R.id),V}),onSelectReceipt:b},R.id)})}),!n&&t.jsxs("div",{className:D.scrollIndicator,children:[t.jsx("span",{children:"New events below"}),t.jsx("button",{onClick:()=>{e.current&&(e.current.scrollTop=e.current.scrollHeight,a(!0))},children:"[â]"})]})]})]})}function z0(e){const n=e.trim();if(!n)return{message:"Empty command"};const a=V0(n);if(a.length===0)return{message:"No command specified"};const s=a[0].toLowerCase(),i=[],r={};for(let c=1;c<a.length;c++){const o=a[c];if(o.startsWith("--")){const d=o.slice(2),l=d.indexOf("=");if(l===-1)r[d]=!0;else{const g=d.slice(0,l),u=d.slice(l+1);if(!g)return{message:`Invalid flag format: ${o}`,position:c};r[g]=u.replace(/^["']|["']$/g,"")}}else if(o.startsWith("-")&&o.length===2){const d=o.slice(1);r[d]=!0}else i.push(o)}return{command:s,args:i,flags:r,raw:n}}function V0(e){const n=[];let a="",s=!1,i="";for(let r=0;r<e.length;r++){const c=e[r];(c==='"'||c==="'")&&!s?(s=!0,i=c,a+=c):c===i&&s?(s=!1,a+=c,i=""):c===" "&&!s?a&&(n.push(a),a=""):a+=c}return a&&n.push(a),n}function J0(e){return"message"in e&&!("command"in e)}const Oa=[{name:"help",help:"Show available commands",allowedRoles:"all",handler:Y0},{name:"role",help:"Switch active role (e.g. role metallurgist)",allowedRoles:"all",handler:Q0},{name:"facilities",help:"List facilities in the fleet",allowedRoles:["ornl-metallurgist","arc-operator","node-site-manager"],handler:Z0},{name:"nodes",help:"List nodes (--class production|scout|test-qualification|regional-hub)",allowedRoles:["ornl-metallurgist","arc-operator","node-site-manager","line-technician"],handler:X0},{name:"jobs",help:"List jobs (--status <state>)",allowedRoles:["ornl-metallurgist","arc-operator","node-site-manager","line-technician"],handler:eI},{name:"signal",help:"Stream ARC Signal events (--node <id>)",allowedRoles:["ornl-metallurgist","arc-operator"],handler:tI},{name:"downlink",help:"Show downlink status for a job (downlink <job-id>)",allowedRoles:["ornl-metallurgist","arc-operator"],handler:nI},{name:"evidence",help:"Open the evidence package viewer (evidence <job-id>)",allowedRoles:["ornl-metallurgist","arc-operator"],handler:aI},{name:"triage",help:"Show triage queue (line-tech)",allowedRoles:["line-technician","node-site-manager"],handler:sI},{name:"attest",help:"Trigger fresh attestation for a node (attest <node-id>)",allowedRoles:["arc-operator"],handler:iI},{name:"fly",help:"Fly the globe camera to a preset or node id",allowedRoles:["ornl-metallurgist","arc-operator"],handler:rI},{name:"history",help:"Show command history",allowedRoles:"all",handler:oI},{name:"clear",help:"Clear the CommandLine output",allowedRoles:"all",handler:cI}];function K0(){const e=x.getState().activeRole,n=a=>a.allowedRoles==="all"?a.handler:!e||!a.allowedRoles.includes(e)?()=>({error:!0,lines:[`access denied: role=${e??"unset"} cannot run \`${a.name}\``]}):a.handler;return Object.fromEntries(Oa.map(a=>[a.name,n(a)]))}function Hs(e){const n=Oa.map(a=>a.name);return e?n.filter(a=>a.startsWith(e.toLowerCase())):n}function Y0(e){const n=x.getState().activeRole,a=["Available commands:",""];for(const s of Oa){const i=s.allowedRoles==="all"||n&&s.allowedRoles.includes(n);a.push(` ${i?" ":"·"} ${s.name.padEnd(12)} ${s.help}`)}return a.push("",`Active role: ${n??"(none)"}`),{lines:a}}function Q0(e){const[n]=e.args;if(!n)return{lines:[`Active role: ${x.getState().activeRole??"(none)"}`]};const a=n.toLowerCase(),s=["ornl-metallurgist","arc-operator","node-site-manager","line-technician","indopacom-stakeholder","defense-oem"];
61return s.includes(a)?(x.getState().setActiveRole(a),{lines:[`role set to ${a}`]}):{error:!0,lines:[`unknown role: ${n}`,`valid: ${s.join(", ")}`]}}function Z0(e){const n=Object.values(x.getState().facilities);return n.length===0?{lines:["(no facilities registered)"]}:{lines:n.map(a=>` ${a.id.padEnd(8)} ${a.name.padEnd(28)} nodes=${a.nodeCount}`)}}function X0(e){const n=e.flags.class,a=Object.values(x.getState().nodes).filter(s=>!n||s.class===n);return a.length===0?{lines:["(no nodes match)"]}:{lines:a.map(s=>` ${s.id.padEnd(20)} class=${s.class.padEnd(18)} mode=${s.networkMode.padEnd(18)} ${s.tokenHeld?"â":" "} ${s.attestationFresh?"â":"â "}`)}}function eI(e){const n=e.flags.status,a=x.getState().activeRole,s=Object.values(x.getState().jobs).filter(r=>!n||r.status===n);if(s.length===0)return{lines:["(no jobs match)"]};const i=r=>` ${(a==="line-technician"?r.anonymizedId:r.id).padEnd(22)} status=${r.status.padEnd(22)} node=${r.nodeId??"-"}`;return{lines:s.map(i)}}function tI(e){const n=e.flags.node,a=x.getState().signalEvents.filter(s=>!n||s.nodeId===n);return a.length===0?{lines:["(no signal events)"]}:{lines:a.slice(0,20).map(s=>` ${s.at.toISOString().slice(11,19)} ${s.kind.padEnd(22)} node=${s.nodeId} Îα=${s.magnitude.toFixed(3)}`)}}function nI(e){const[n]=e.args;if(!n)return{error:!0,lines:["usage: downlink <job-id>"]};const a=x.getState().jobs[n];return a?{lines:[`job=${a.id}`,`status=${a.status}`,`lot=${a.powderLotId}`,`simulation-revision=${a.simulationRevision??"n/a"}`,`geometry-ref=${a.geometryRef??"n/a"}`]}:{error:!0,lines:[`no job ${n}`]}}function aI(e){const[n]=e.args;if(!n)return{error:!0,lines:["usage: evidence <job-id>"]};const a=x.getState().evidencePackages[n];return a?{lines:[`evidence package for ${a.jobId}`,` facility=${a.facilityId} node=${a.nodeId}`,` lot=${a.powderLotId}`,` sim-revision=${a.simulationRevision}`,` attestations=${a.attestationChain.length}`,` interventions=${a.interventions.length}`,` seal=${a.seal}`,` sealed-at=${a.sealedAt.toISOString()}`]}:{lines:[`(no sealed evidence for ${n})`]}}function sI(e){const a=Object.values(x.getState().nodes).filter(s=>s.networkMode==="disconnected-local"||!s.attestationFresh);return{lines:a.length===0?["[ CLEAR ] no triage items"]:a.map(s=>`${s.attestationFresh?"[ YELLOW]":"[ RED ]"} ${s.id}: ${s.attestationFresh?"disconnected-local":"attestation stale"}`)}}function iI(e){const[n]=e.args;if(!n)return{error:!0,lines:["usage: attest <node-id>"]};const a=x.getState().nodes[n];return a?(x.getState().setAttestationResult({nodeId:n,ok:!0,firmwareHash:"manual-attest",osHash:"manual-attest",hwHash:"manual-attest",verifiedAt:new Date}),x.getState().upsertNode({...a,attestationFresh:!0}),{lines:[`attestation refreshed for ${n}`]}):{error:!0,lines:[`no node ${n}`]}}function rI(e){const[n]=e.args;return n?Object.keys(Ti).includes(n)?(x.getState().flyToPreset(n),{lines:[`flying to preset ${n}`]}):x.getState().nodes[n]?(x.getState().flyToNode(n),{lines:[`flying to ${n}`]}):{error:!0,lines:[`unknown target: ${n}`]}:{error:!0,lines:["usage: fly <preset|node-id>"]}}function oI(e){const n=x.getState().commandHistory;return{lines:n.length===0?["(no history)"]:n}}function cI(e){return{lines:[]}}const lI="_commandLine_1d0vq_8",dI="_expanded_1d0vq_21",uI="_toggleBtn_1d0vq_31",mI="_output_1d0vq_53",pI="_outputLine_1d0vq_80",hI="_errorLine_1d0vq_87",fI="_suggestions_1d0vq_95",gI="_suggestion_1d0vq_95",_I="_inputForm_1d0vq_122",yI="_prompt_1d0vq_134",vI="_input_1d0vq_122",bI="_cursor_1d0vq_157",Fe={commandLine:lI,expanded:dI,toggleBtn:uI,output:mI,outputLine:pI,errorLine:hI,suggestions:fI,suggestion:gI,inputForm:_I,prompt:yI,input:vI,cursor:bI},gr=h.forwardRef(function(n,a){const[s,i]=h.useState(""),[r,c]=h.useState([{text:"ArcNet Command Line Interface v1.0",timestamp:new Date},{text:'Type "help" for available commands',timestamp:new Date},{text:"",timestamp:new Date}]),[o,d]=h.useState(-1),[l,g]=h.useState([]),[u,_]=h.useState(!0),[m,v]=h.useState(!1),p=h.useRef(null),f=h.useRef(null),b=x(E=>E.commandHistory),w=x(E=>E.addToCommandHistory);h.useEffect(()=>{const E=setInterval(()=>{_(A=>!A)},530);return()=>clearInterval(E)},[]),h.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[r]),h.useImperativeHandle(a,()=>({focus:()=>{p.current?.focus()}})),h.useEffect(()=>{p.current?.focus()},[]);const j=h.useCallback((E,A=!1)=>{const V=E.map(re=>({text:re,error:A,timestamp:new Date}));c(re=>[...re,...V])},[]),C=h.useCallback(E=>{const A=E.trim();if(!A)return;j([`arcnet> ${A}`]);const V=z0(A);if(J0(V)){j([`Error: ${V.message}`],!0);return}
61const q=K0()[V.command];if(!q){j([`Unknown command: ${V.command}`,'Type "help" for available commands'],!0);return}try{const de=q(V);if(de.lines.length===1&&de.lines[0]==="__CLEAR__"){c([]);return}j(de.lines,de.error),j([""])}catch(de){j([`Error executing command: ${de instanceof Error?de.message:String(de)}`],!0)}},[j]),N=E=>{E.preventDefault(),s.trim()&&(m||v(!0),C(s),w(s),i(""),d(-1),g([]))},T=E=>{if(E.key==="ArrowUp"){if(E.preventDefault(),b.length===0)return;const A=o===-1?b.length-1:Math.max(0,o-1);d(A),i(b[A])}else if(E.key==="ArrowDown"){if(E.preventDefault(),o===-1)return;const A=o+1;A>=b.length?(d(-1),i("")):(d(A),i(b[A]))}else if(E.key==="Tab"){E.preventDefault();const A=s.trim();if(!A){g(Hs(""));return}const V=A.split(" ");if(V.length===1){const re=Hs(V[0]);re.length===1?(i(re[0]+" "),g([])):re.length>1&&g(re)}}else E.key==="Escape"&&g([])},R=E=>{i(E.target.value),g([])};return t.jsxs("div",{className:`${Fe.commandLine} ${m?Fe.expanded:""}`,children:[m&&t.jsx("div",{ref:f,className:Fe.output,children:r.map((E,A)=>t.jsx("div",{className:E.error?Fe.errorLine:Fe.outputLine,children:E.text},A))}),m&&l.length>0&&t.jsx("div",{className:Fe.suggestions,children:l.map((E,A)=>t.jsx("span",{className:Fe.suggestion,children:E},A))}),t.jsxs("form",{onSubmit:N,className:Fe.inputForm,children:[t.jsx("button",{type:"button",className:Fe.toggleBtn,onClick:()=>v(!m),title:m?"Minimize":"Expand",children:m?"[â]":"[+]"}),t.jsx("span",{className:Fe.prompt,children:"arcnet>"}),t.jsx("input",{ref:p,type:"text","aria-label":"ARCNet command input",value:s,onChange:R,onKeyDown:T,className:Fe.input,spellCheck:!1,autoComplete:"off"}),t.jsx("span",{className:Fe.cursor,style:{opacity:u?1:0},children:"â"})]})]})}),jI=180,Ws=2500,xI=[{id:"secure-pause",label:"Secure pause",rpcMethod:"RequestSecurePause",command:"route.secure-pause",target:"active-route",scope:"facility-local",policyContext:"operator-presence + fresh projection",privileged:!0,allowedRoles:["arc-operator","ornl-metallurgist"]},{id:"fresh-attest",label:"Fresh attest",rpcMethod:"RequestReattestation",command:"node.re-attest",target:"selected-node",scope:"node-local",policyContext:"attestation gate + fresh projection",privileged:!0,allowedRoles:["arc-operator"]},{id:"evidence-signoff",label:"Evidence sign-off",rpcMethod:"RequestEvidenceSignoff",command:"evidence.signoff",target:"selected-evidence-package",scope:"evidence-drawer",policyContext:"sign-off authority + fresh projection",privileged:!0,allowedRoles:["ornl-metallurgist"]}];let Gs=0;function fn(e){return Gs+=1,`${e}-${Gs}`}function II(e){switch(e){case"ornl-metallurgist":return"OPERATOR_ROLE_ORNL_METALLURGIST";case"arc-operator":return"OPERATOR_ROLE_ARC_OPERATOR";case"node-site-manager":return"OPERATOR_ROLE_NODE_SITE_MANAGER";case"line-technician":return"OPERATOR_ROLE_LINE_TECHNICIAN";case"indopacom-stakeholder":return"OPERATOR_ROLE_INDOPACOM_STAKEHOLDER";case"defense-oem":return"OPERATOR_ROLE_DEFENSE_OEM"}}function wI(e){switch(e){case"accepted":return"COMMAND_STATUS_ACCEPTED";case"denied":return"COMMAND_STATUS_DENIED";case"stale-state":return"COMMAND_STATUS_STALE_STATE"}}function NI(e){switch(e){case"COMMAND_STATUS_ACCEPTED":return"accepted";case"COMMAND_STATUS_STALE_STATE":return"stale-state";case"COMMAND_STATUS_DENIED":case"COMMAND_STATUS_REAUTH_REQUIRED":case"COMMAND_STATUS_WITNESS_REQUIRED":case"COMMAND_STATUS_CONFLICT":case"COMMAND_STATUS_UNSPECIFIED":default:return"denied"}}function SI(e){return["COMMAND_STATUS_UNSPECIFIED","COMMAND_STATUS_ACCEPTED","COMMAND_STATUS_DENIED","COMMAND_STATUS_REAUTH_REQUIRED","COMMAND_STATUS_WITNESS_REQUIRED","COMMAND_STATUS_STALE_STATE","COMMAND_STATUS_CONFLICT"].includes(e)}function CI(e){return e<=0?Promise.resolve():new Promise(n=>window.setTimeout(n,e))}function RI(e,n,a){return e.privileged&&a.restrictsPrivilegedWrites?{status:"stale-state",reason:`Privileged writes blocked by ${a.headline.toLowerCase()}.`}:e.allowedRoles.includes(n)?null:{status:"denied",reason:`Role ${n} lacks policy authority for ${e.command}.`}}function EI({template:e,role:n,posture:a,requestedAt:s}){const i=fn("cmd-intent"),r=fn("cmd-correlation");return{commandId:i,actorId:`mock-actor:${n}`,actorRole:II(n),sessionId:`mock-session:${n}`,correlationId:r,causationId:`ui:${e.id}`,traceId:fn("cmd-trace"),policyContextId:`policy:${e.id}:${a.kind}`,requestedAt:s.toISOString(),deadlineMs:Ws,metadata:{"x-arcnet-role":n,"x-arcnet-command":e.command,"x-arcnet-rpc-method":e.rpcMethod,"x-arcnet-projection-kind":a.kind,"x-arcnet-deadline-ms":String(Ws)}}}function kI(e,n){switch(e.rpcMethod){case"RequestSecurePause":return{method:"RequestSecurePause",request:{context:n,jobId:"active-job",routeStepId:"active-route-step",nodeId:"selected-node",safeBoundaryPolicyRef:e.policyContext,reason:`UI requested ${e.command}`}};case"RequestReattestation":return{method:"RequestReattestation",request:{context:n,nodeId:"selected-node",challengeRef:"browser-requested-attestation",reason:`UI requested ${e.command}`}};case"RequestEvidenceSignoff":return{method:"RequestEvidenceSignoff",request:{context:n,jobId:"selected-job",form:"EVIDENCE_FORM_POLICY_CONFORMANT_EVIDENCE_PACKAGE",claimClass:"EVIDENCE_CLAIM_CLASS_POLICY_CONFORMANT_EVIDENCE_PACKAGE",evidenceRef:"selected-evidence-package",signoffStatement:"UI requested evidence sign-off."}};default:throw new Error(`Unsupported command method for UI lane: ${e.rpcMethod}`)}}function PI({context:e,template:n,decision:a,reason:s,evaluatedAt:i}){return{policyContextId:e.policyContextId,decision:a,requiredWitnesses:n.privileged?["fresh-projection"]:[],denialReasons:a==="accepted"?[]:[s],evaluatedAt:i.toISOString(),policyBasisRef:n.policyContext}}function $a({context:e,template:n,status:a,reason:s,acknowledgedAt:i,receiptId:r}){const c=a==="accepted"||a==="denied"?`audit:${r}:${a}`:void 0;return{commandId:e.commandId,status:wI(a),correlationId:e.correlationId,causationId:e.causationId,traceId:e.traceId,ackAt:i.toISOString(),policy:PI({context:e,template:n,decision:a,reason:s,evaluatedAt:i}),receipt:c?{auditRecordId:c,acceptedAt:i.toISOString()}:void 0,operatorMessages:[s]}}function Vn({pendingReceipt:e,response:n,template:a}){const s=NI(n.status),i=SI(n.status),r=new Date(n.ackAt),c=Number.isNaN(r.getTime())?new Date:r,o=n.operatorMessages[0]??n.policy.denialReasons[0]??(s==="accepted"?"Command accepted by command transport.":`Command transport returned ${n.status}.`);return{...e,status:s,acknowledgedAt:c,reason:s==="denied"&&!i?`Command transport returned unknown status ${n.status}.`:o,auditRef:i&&n.receipt?.auditRecordId?n.receipt.auditRecordId:s==="accepted"||s==="denied"?`audit:${e.id}:${s}`:void 0,policyContext:n.policy.policyBasisRef||a.policyContext}}function TI({context:e,template:n,receiptId:a,acknowledgedAt:s,error:i}){const r=`Command transport failed: ${i instanceof Error?i.message:String(i)}`;return $a({context:e,template:n,status:"denied",reason:r,acknowledgedAt:s,receiptId:a})}function _r({transportLabel:e,sendCommand:n,ackDelayMs:a=0}){return{issueCommand:({template:s,role:i,posture:r,now:c=new Date})=>{const o=c,d=EI({template:s,role:i,posture:r,requestedAt:o}),l=fn("cmd-receipt"),g=kI(s,d),u={id:l,intentId:d.commandId,command:s.command,target:s.target,scope:s.scope,actorRole:i,requestedAt:o,correlationId:d.correlationId,policyContext:s.policyContext,projectionKind:r.kind},_={...u,id:d.commandId,privileged:s.privileged},m={...u,status:"pending",reason:"Awaiting server acknowledgement."},v=RI(s,i,r);return{intent:_,pendingReceipt:m,envelope:g,transportLabel:e,transportAttempted:!1,execute:async()=>{const p=new Date(o.getTime()+a);if(await CI(a),v){const b=$a({context:d,template:s,status:v.status,reason:v.reason,acknowledgedAt:p,receiptId:l});return{response:b,finalReceipt:Vn({pendingReceipt:m,response:b,template:s}),transportAttempted:!1}}const f={envelope:g,template:s,role:i,posture:r,requestedAt:o,acknowledgedAt:p,pendingReceipt:m};try{const b=await n(f);return{response:b,finalReceipt:Vn({pendingReceipt:m,response:b,template:s}),transportAttempted:!0}}catch(b){const w=TI({context:d,template:s,receiptId:l,acknowledgedAt:p,error:b});return{response:w,finalReceipt:Vn({pendingReceipt:m,response:w,template:s}),transportAttempted:!0}}}}}}}function AI(e,n="Mock command accepted with policy-visible receipt semantics."){return $a({context:e.envelope.request.context,template:e.template,status:"accepted",reason:n,acknowledgedAt:e.acknowledgedAt,receiptId:e.pendingReceipt.id})}
61const LI=_r({transportLabel:"grpc",sendCommand:async()=>{throw new Error("gRPC command transport is not configured.")}}),OI=_r({transportLabel:"mock",ackDelayMs:jI,sendCommand:async e=>AI(e)});function $I(e){return e==="grpc"?LI:OI}const MI=$I(yc),DI="_commandLane_1j1v0_1",BI="_postureRow_1j1v0_6",FI="_phaseChip_1j1v0_24",qI="_phaseOpen_1j1v0_36",HI="_phaseLocked_1j1v0_42",WI="_actionGrid_1j1v0_48",GI="_commandButton_1j1v0_55",UI="_receiptStack_1j1v0_85",zI="_empty_1j1v0_91",VI="_receiptCard_1j1v0_98",JI="_receiptSelected_1j1v0_109",KI="_receiptHeader_1j1v0_115",YI="_receiptStatus_1j1v0_122",QI="_receiptTime_1j1v0_128",ZI="_commandName_1j1v0_134",XI="_receiptMeta_1j1v0_140",ew="_receiptReason_1j1v0_165",tw="_receiptActions_1j1v0_172",nw="_receiptTraceButton_1j1v0_178",aw="_receiptCopyButton_1j1v0_179",sw="_statusPending_1j1v0_198",iw="_statusAccepted_1j1v0_206",rw="_statusDenied_1j1v0_214",ow="_statusStaleState_1j1v0_222",he={commandLane:DI,postureRow:BI,phaseChip:FI,phaseOpen:qI,phaseLocked:HI,actionGrid:WI,commandButton:GI,receiptStack:UI,empty:zI,receiptCard:VI,receiptSelected:JI,receiptHeader:KI,receiptStatus:YI,receiptTime:QI,commandName:ZI,receiptMeta:XI,receiptReason:ew,receiptActions:tw,receiptTraceButton:nw,receiptCopyButton:aw,statusPending:sw,statusAccepted:iw,statusDenied:rw,statusStaleState:ow},cw={pending:"Pending",accepted:"Accepted",denied:"Denied","stale-state":"Stale state"},lw={pending:he.statusPending,accepted:he.statusAccepted,denied:he.statusDenied,"stale-state":he.statusStaleState};function dw(e){return e?e.toISOString().slice(11,19):"--:--:--"}function uw({receipt:e,isSelected:n,onSelect:a,onCopy:s,copiedKey:i,failedKey:r}){const c=ir(e),o=Aa(c),d=i===o?"[ copied ]":r===o?"[ copy failed ]":"[ copy link ]";return t.jsxs("article",{className:`${he.receiptCard} ${lw[e.status]} ${n?he.receiptSelected:""}`,"data-testid":`command-receipt-${e.status}`,"data-selected":n?"true":void 0,children:[t.jsxs("div",{className:he.receiptHeader,children:[t.jsx("span",{className:he.receiptStatus,children:cw[e.status]}),t.jsx("span",{className:he.receiptTime,children:dw(e.acknowledgedAt??e.requestedAt)})]}),t.jsx("div",{className:he.commandName,children:e.command}),t.jsxs("dl",{className:he.receiptMeta,children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Target"}),t.jsx("dd",{children:e.target})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Scope"}),t.jsx("dd",{children:e.scope})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Policy"}),t.jsx("dd",{children:e.policyContext})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Projection"}),t.jsx("dd",{children:e.projectionKind})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Correlation"}),t.jsx("dd",{children:e.correlationId})]}),e.auditRef&&t.jsxs("div",{children:[t.jsx("dt",{children:"Audit"}),t.jsx("dd",{children:e.auditRef})]})]}),t.jsx("div",{className:he.receiptReason,children:e.reason}),t.jsxs("div",{className:he.receiptActions,children:[t.jsx("button",{type:"button",className:he.receiptTraceButton,onClick:()=>a(c),children:"[ trace receipt ]"}),t.jsx("button",{type:"button",className:he.receiptCopyButton,onClick:()=>s(c),"data-testid":`copy-command-receipt-link-${e.id}`,children:d})]})]})}function Us({role:e,connectionState:n,isMockMode:a,commandService:s=MI}){const i=x(j=>j.streamHealth),r=x(j=>j.commandLanePhase),c=x(j=>j.commandReceipts),o=x(j=>j.selectedReceiptLink),d=x(j=>j.beginCommandIntent),l=x(j=>j.completeCommandReceipt),g=La(),{copiedKey:u,failedKey:_,copyReceiptLink:m}=cr(),v=h.useRef(!0),p=h.useMemo(()=>En({connectionState:n,isMockMode:a,streamHealth:i}),[n,a,i]);h.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const f=h.useCallback(j=>{const C=s.issueCommand({template:j,role:e,posture:p});d(C.intent,C.pendingReceipt),C.execute().then(N=>{v.current&&l(N.finalReceipt)})},[d,s,l,p,e]),b=r==="pending",w=c.slice(0,4);return t.jsxs(ie,{title:"Command Lane",size:"sm",className:he.commandLane,headerActions:t.jsx("span",{className:`${he.phaseChip} ${p.restrictsPrivilegedWrites?he.phaseLocked:he.phaseOpen}`,children:r.toUpperCase()}),children:[t.jsxs("div",{className:he.postureRow,children:[t.jsx("span",{children:"Projection"}),t.jsx("strong",{children:p.label})]}),t.jsx("div",{className:he.actionGrid,children:xI.map(j=>t.jsxs("button",{type:"button",className:he.commandButton,onClick:()=>f(j),disabled:b,"data-testid":`command-button-${j.id}`,children:[t.jsx("span",{children:j.label}),t.jsx("small",{children:j.scope})]},j.id))}),t.jsx("div",{className:he.receiptStack,"data-testid":"command-receipt-stack",children:w.length===0?t.jsx("div",{className:he.empty,children:"no command receipts yet"}):w.map(j=>t.jsx(uw,{receipt:j,isSelected:da(o,j),onSelect:g,onCopy:C=>{m(C)},copiedKey:u,failedKey:_},j.id))})]})}
61const mw="_overlay_18yii_3",pw="_modal_18yii_24",hw="_header_18yii_45",fw="_title_18yii_53",gw="_closeButton_18yii_62",_w="_content_18yii_82",yw="_shortcutList_18yii_86",vw="_shortcutRow_18yii_92",bw="_key_18yii_98",jw="_description_18yii_113",xw="_divider_18yii_118",Iw="_section_18yii_124",ww="_sectionTitle_18yii_128",Nw="_footer_18yii_137",Sw="_hint_18yii_143",le={overlay:mw,modal:pw,header:hw,title:fw,closeButton:gw,content:_w,shortcutList:yw,shortcutRow:vw,key:bw,description:jw,divider:xw,section:Iw,sectionTitle:ww,footer:Nw,hint:Sw};function Cw({isOpen:e,onClose:n}){const a=h.useCallback(s=>{(s.key==="Escape"||s.key==="?")&&(s.preventDefault(),n())},[n]);return h.useEffect(()=>{if(e)return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[e,a]),e?t.jsx("div",{className:le.overlay,onClick:n,children:t.jsxs("div",{className:le.modal,onClick:s=>s.stopPropagation(),children:[t.jsxs("div",{className:le.header,children:[t.jsx("h2",{className:le.title,children:"Keyboard Shortcuts"}),t.jsx("button",{className:le.closeButton,onClick:n,children:"ESC"})]}),t.jsxs("div",{className:le.content,children:[t.jsx("div",{className:le.shortcutList,children:by.map(({key:s,description:i})=>t.jsxs("div",{className:le.shortcutRow,children:[t.jsx("kbd",{className:le.key,children:s}),t.jsx("span",{className:le.description,children:i})]},s))}),t.jsx("div",{className:le.divider}),t.jsxs("div",{className:le.section,children:[t.jsx("h3",{className:le.sectionTitle,children:"Command Line"}),t.jsxs("div",{className:le.shortcutList,children:[t.jsxs("div",{className:le.shortcutRow,children:[t.jsx("kbd",{className:le.key,children:"Enter"}),t.jsx("span",{className:le.description,children:"Execute command"})]}),t.jsxs("div",{className:le.shortcutRow,children:[t.jsx("kbd",{className:le.key,children:"Up/Down"}),t.jsx("span",{className:le.description,children:"Navigate history"})]}),t.jsxs("div",{className:le.shortcutRow,children:[t.jsx("kbd",{className:le.key,children:"Tab"}),t.jsx("span",{className:le.description,children:"Autocomplete"})]})]})]})]}),t.jsx("div",{className:le.footer,children:t.jsx("span",{className:le.hint,children:"Press ? or ESC to close"})})]})}):null}const Rw="_container_m14di_5",Ew="_glitchOverlay_m14di_17",kw="_scanlines_m14di_46",Pw="_content_m14di_59",Tw="_ascii_m14di_83",Aw="_title_m14di_106",Lw="_blink_m14di_117",Ow="_errorCode_m14di_126",$w="_label_m14di_134",Mw="_value_m14di_139",Dw="_divider_m14di_144",Bw="_section_m14di_156",Fw="_sectionHeader_m14di_162",qw="_bracket_m14di_172",Hw="_errorMessage_m14di_176",Ww="_stackTrace_m14di_185",Gw="_componentStack_m14di_186",Uw="_actions_m14di_199",zw="_button_m14di_206",Vw="_buttonIcon_m14di_233",Jw="_footer_m14di_238",Kw="_footerText_m14di_247",Yw="_timestamp_m14di_256",K={container:Rw,glitchOverlay:Ew,scanlines:kw,content:Pw,ascii:Tw,title:Aw,blink:Lw,errorCode:Ow,label:$w,value:Mw,divider:Dw,section:Bw,sectionHeader:Fw,bracket:qw,errorMessage:Hw,stackTrace:Ww,componentStack:Gw,actions:Uw,button:zw,buttonIcon:Vw,footer:Jw,footerText:Kw,timestamp:Yw},Qw=` 62 âââââââââââââââ âââââââ âââââââ âââââââ 63 âââââââââââââââââââââââââââââââââââââââââ 64 ââââââ âââââââââââââââââââ âââââââââââ 65 ââââââ âââââââââââââââââââ âââââââââââ 66 âââââââââââ ââââââ âââââââââââââââ âââ 67 âââââââââââ ââââââ âââ âââââââ âââ âââ 68`;class Zw extends h.Component{constructor(n){super(n),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,a){console.error("[TerminalErrorBoundary] Caught error:",n,a),this.setState({errorInfo:a})}handleRetry=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};handleReload=()=>{window.location.reload()};
68render(){if(this.state.hasError){if(this.props.fallback)return this.props.fallback;const{error:n,errorInfo:a}=this.state;return t.jsxs("div",{className:K.container,children:[t.jsx("div",{className:K.glitchOverlay}),t.jsx("div",{className:K.scanlines}),t.jsxs("div",{className:K.content,children:[t.jsx("pre",{className:K.ascii,children:Qw}),t.jsxs("h1",{className:K.title,children:[t.jsx("span",{className:K.blink,children:">"})," SYSTEM MALFUNCTION DETECTED"]}),t.jsxs("div",{className:K.errorCode,children:[t.jsx("span",{className:K.label,children:"ERROR CODE:"}),t.jsxs("span",{className:K.value,children:["0x",Math.random().toString(16).slice(2,10).toUpperCase()]})]}),t.jsx("div",{className:K.divider,children:"â".repeat(60)}),t.jsxs("div",{className:K.section,children:[t.jsxs("div",{className:K.sectionHeader,children:[t.jsx("span",{className:K.bracket,children:"["}),"ERROR MESSAGE",t.jsx("span",{className:K.bracket,children:"]"})]}),t.jsx("pre",{className:K.errorMessage,children:n?.message||"Unknown error occurred"})]}),n?.stack&&t.jsxs("div",{className:K.section,children:[t.jsxs("div",{className:K.sectionHeader,children:[t.jsx("span",{className:K.bracket,children:"["}),"STACK TRACE",t.jsx("span",{className:K.bracket,children:"]"})]}),t.jsx("pre",{className:K.stackTrace,children:n.stack})]}),a?.componentStack&&t.jsxs("div",{className:K.section,children:[t.jsxs("div",{className:K.sectionHeader,children:[t.jsx("span",{className:K.bracket,children:"["}),"COMPONENT STACK",t.jsx("span",{className:K.bracket,children:"]"})]}),t.jsx("pre",{className:K.componentStack,children:a.componentStack})]}),t.jsxs("div",{className:K.actions,children:[t.jsxs("button",{className:K.button,onClick:this.handleRetry,children:[t.jsx("span",{className:K.buttonIcon,children:">"}),"RETRY"]}),t.jsxs("button",{className:K.button,onClick:this.handleReload,children:[t.jsx("span",{className:K.buttonIcon,children:">"}),"RELOAD SYSTEM"]})]}),t.jsxs("div",{className:K.footer,children:[t.jsx("span",{className:K.footerText,children:"ARCNET CONSOLE // RUNTIME ERROR HANDLER"}),t.jsx("span",{className:K.timestamp,children:new Date().toISOString()})]})]})]})}return this.props.children}}const Xw="_wrap_69xh8_1",e1="_canvas_69xh8_7",t1="_legend_69xh8_14",n1="_dAlpha_69xh8_20",a1="_h2_69xh8_23",s1="_h6_69xh8_26",i1="_baselineCeiling_69xh8_29",r1="_coatedCeiling_69xh8_32",o1="_empty_69xh8_36",ze={wrap:Xw,canvas:e1,legend:t1,dAlpha:n1,h2:a1,h6:s1,baselineCeiling:i1,coatedCeiling:r1,empty:o1};function c1(){const e=h.useRef(null),n=x(c=>c.selectedNodeId),a=x(c=>n?Oi(c,n):[]),s=x(c=>c.evidencePackages),i=x(c=>c.jobs),r=h.useMemo(()=>{if(!n)return null;const c=Object.values(s),d=c.find(l=>l.demonstrationClass==="capability-demonstration"&&i[l.jobId]?.nodeId===n)??c.find(l=>l.demonstrationClass==="capability-demonstration");return!d||d.effectiveTemperatureDeltaC==null?null:{deltaC:d.effectiveTemperatureDeltaC,baselineC:d.creepRuptureLife?.serviceTemperatureC??null,partType:d.partType??null}},[s,i,n]);return h.useEffect(()=>{const c=e.current;if(!c)return;const o=c.getContext("2d");if(!o)return;const d=c.width,l=c.height;o.clearRect(0,0,d,l),o.strokeStyle="rgba(127, 214, 255, 0.15)",o.lineWidth=1,o.beginPath();for(let v=0;v<5;v++){const p=l/4*v;o.moveTo(0,p),o.lineTo(d,p)}if(o.stroke(),r){const v=l*.62,p=l*.3;o.fillStyle="rgba(122, 255, 182, 0.1)",o.fillRect(0,p,d,v-p),o.strokeStyle="#ffad33",o.lineWidth=1.25,o.setLineDash([5,4]),o.beginPath(),o.moveTo(0,v),o.lineTo(d,v),o.stroke(),o.setLineDash([]),o.strokeStyle="#7affb6",o.lineWidth=1.5,o.beginPath(),o.moveTo(0,p),o.lineTo(d,p),o.stroke(),o.font='10px "Fira Code", monospace',o.textAlign="left",o.fillStyle="#ffad33",o.fillText(r.baselineC!=null?`uncoated baseline metal temp (${r.baselineC}°C)`:"uncoated baseline metal temp",6,v-4),o.fillStyle="#7affb6",o.fillText("coating-enabled ceiling",6,p-4),o.textAlign="right",o.fillStyle="#7affb6",o.font='bold 12px "Fira Code", monospace',o.fillText(`+${r.deltaC}°C effective-temperature lift`,d-6,(p+v)/2+4),o.textAlign="left"}if(a.length<2)return;const g=a.slice(-200),u=Math.max(.25,...g.map(v=>v.deltaAlpha)),_=d/Math.max(1,g.length-1);o.strokeStyle="#ff99ff",o.lineWidth=1.5,o.beginPath(),g.forEach((v,p)=>{const f=p*_,b=l-v.deltaAlpha/u*(l-12)-6;p===0?o.moveTo(f,b):o.lineTo(f,b)}),o.stroke();const m=(v,p)=>{o.strokeStyle=p,o.lineWidth=1.1,o.globalAlpha=.6,o.beginPath(),g.forEach((f,b)=>{const w=b*_,j=f.hQ[v]??1,C=l-(j-.3)/2.5*(l-12)-6;b===0?o.moveTo(w,C):o.lineTo(w,C)}),o.stroke(),o.globalAlpha=1};m(2,"#7fd6ff"),m(6,"#7affb6")},[a,r]),t.jsx(ie,{title:"Phase-Field Canvas",size:"sm",children:t.jsx("div",{className:ze.wrap,children:n?t.jsxs(t.Fragment,{children:[t.jsx("canvas",{ref:e,width:480,height:180,className:ze.canvas}),t.jsxs("div",{className:ze.legend,children:[t.jsx("span",{className:ze.dAlpha,children:"Îα (spectrum width)"}),t.jsx("span",{className:ze.h2,children:"hâ"}),t.jsx("span",{className:ze.h6,children:"hâ"}),r&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:ze.baselineCeiling,children:"baseline metal temp"}),t.jsxs("span",{className:ze.coatedCeiling,children:["coating ÎT_eff",r.partType?` · ${r.partType}`:""]})]})]})]}):t.jsx("div",{className:ze.empty,children:"select a node to view ARC Signal"})})})}
68const l1="_wrap_1lsj4_1",d1="_stage_1lsj4_7",u1="_svg_1lsj4_13",m1="_meta_1lsj4_18",p1="_row_1lsj4_25",h1="_label_1lsj4_30",pe={wrap:l1,stage:d1,svg:u1,meta:m1,row:p1,label:h1};function f1(){const e=x(s=>s.selectedJobId?s.jobs[s.selectedJobId]:null),a=(x(s=>s.selectedJobId?s.evidencePackages[s.selectedJobId]:null)?.testResults??[]).find(s=>typeof s=="object"&&s!==null&&"kind"in s&&s.kind==="microstructure");return t.jsx(ie,{title:"Digital Twin · Phase Bravo deliverable",size:"sm",children:t.jsx("div",{className:pe.wrap,"data-testid":"digital-twin-placeholder",children:t.jsxs("div",{className:pe.meta,children:[t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Status"}),t.jsx("span",{children:"queued for Phase Bravo"})]}),t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Wiring"}),t.jsx("span",{children:"R3F mesh · per-layer cross-section scrubber"})]}),t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Selected job"}),t.jsx("span",{children:e?.id??"(none selected)"})]}),a?.summary&&t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Microstructure"}),t.jsx("span",{children:a.summary})]}),t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Flag"}),t.jsx("span",{children:"VITE_FEATURE_DIGITAL_TWIN=false"})]})]})})})}function g1(){const e=x(a=>a.selectedJobId?a.jobs[a.selectedJobId]:null),n=e?18.4:0;return t.jsx(ie,{title:"Digital Twin · Live Sinter",size:"sm",children:t.jsxs("div",{className:pe.wrap,children:[t.jsx("div",{className:pe.stage,children:t.jsxs("svg",{viewBox:"-50 -50 100 100",className:pe.svg,preserveAspectRatio:"xMidYMid meet",children:[t.jsx("polygon",{points:"-30,-20 30,-20 40,10 20,25 -40,25 -40,-10",fill:"none",stroke:"#7fd6ff",strokeWidth:"0.8",opacity:"0.55"}),t.jsx("polygon",{points:"-25,-16 25,-16 34,8 17,21 -34,21 -34,-8",fill:"rgba(255, 153, 255, 0.04)",stroke:"#ff99ff",strokeWidth:"0.9"}),t.jsx("text",{x:"-40",y:"-28",fill:"#7fd6ff",fontSize:"4",children:"pre-deformed (Live Sinter)"}),t.jsx("text",{x:"-40",y:"30",fill:"#ff99ff",fontSize:"4",children:"observed (projected)"})]})}),t.jsxs("div",{className:pe.meta,children:[t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Job"}),t.jsx("span",{children:e?.id??"(none selected)"})]}),t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Alloy"}),t.jsx("span",{children:e?.type==="mbj-titanium"?"Ti-6Al-4V":"Ni superalloy"})]}),t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Shrinkage Î"}),t.jsxs("span",{children:[n.toFixed(1),"%"]})]}),t.jsxs("div",{className:pe.row,children:[t.jsx("span",{className:pe.label,children:"Twin source"}),t.jsx("span",{children:e?.simulationRevision??"â"})]})]})]})})}function _1(){return fc?t.jsx(g1,{}):t.jsx(f1,{})}const y1="_listPane_aye4h_1",v1="_listItem_aye4h_10",b1="_selected_aye4h_28",j1="_jobId_aye4h_33",x1="_node_aye4h_37",I1="_at_aye4h_41",w1="_detailPane_aye4h_46",N1="_section_aye4h_56",S1="_sectionTitle_aye4h_61",C1="_row_aye4h_68",R1="_label_aye4h_73",E1="_seal_aye4h_78",k1="_emptyInline_aye4h_84",P1="_receiptList_aye4h_89",T1="_receiptRow_aye4h_94",A1="_receiptRowSelected_aye4h_114",L1="_receiptSelectButton_aye4h_120",O1="_receiptCopyButton_aye4h_136",$1="_receiptKind_aye4h_141",M1="_receiptBody_aye4h_147",D1="_receiptMeta_aye4h_155",B1="_receiptAt_aye4h_161",F1="_hash_aye4h_182",q1="_routeStepList_aye4h_188",H1="_routeStep_aye4h_188",W1="_routeOrdinal_aye4h_206",G1="_routeStepId_aye4h_211",U1="_routeMachine_aye4h_212",z1="_routeStatus_aye4h_216",V1="_actions_aye4h_221",J1="_button_aye4h_228",K1="_empty_aye4h_84",Y1="_sectionTitleRow_aye4h_250",Q1="_sparklineRow_aye4h_257",Z1="_sparklineSegment_aye4h_265",X1="_sparklineLegend_aye4h_269",eN="_sparklineLegendItem_aye4h_277",tN="_sparklineSwatch_aye4h_282",nN="_modeConnectedNormal_aye4h_289",aN="_modeConnectedDegraded_aye4h_293",sN="_modeDisconnectedLocal_aye4h_297",iN="_warningChip_aye4h_301",rN="_listChip_aye4h_312",oN="_stepperRow_aye4h_319",cN="_step_aye4h_319",lN="_stepRing_aye4h_340",dN="_stepLabel_aye4h_346",uN="_stepStatus_aye4h_351",mN="_stepPassed_aye4h_357",pN="_stepFailed_aye4h_363",hN="_stepPending_aye4h_369",fN="_stepConnector_aye4h_376",gN="_stepperFailReason_aye4h_380",_N="_traceTabs_aye4h_391",yN="_traceTab_aye4h_391",vN="_traceTabActive_aye4h_412",bN="_traceBody_aye4h_418",jN="_traceEdge_aye4h_423",xN="_traceNode_aye4h_424",IN="_traceToggle_aye4h_430",wN="_traceTrackable_aye4h_447",NN="_traceIcon_aye4h_453",SN="_traceVerb_aye4h_460",CN="_traceVerbInline_aye4h_461",RN="_traceOpType_aye4h_472",EN="_traceTrackId_aye4h_476",kN="_traceTrackType_aye4h_480",PN="_traceMeta_aye4h_488",TN="_traceMetaDim_aye4h_493",AN="_traceChildren_aye4h_499",LN="_traceFooter_aye4h_503",ON="_inspectionPolicy_aye4h_513",$N="_policyBadgeEvidence_aye4h_519",MN="_policyBadgeLearning_aye4h_520",DN="_viewOnlyChip_aye4h_541",BN="_signoffList_aye4h_5
6853",FN="_signoffEntry_aye4h_562",qN="_signoffRole_aye4h_570",HN="_signoffRef_aye4h_575",WN="_signoffAt_aye4h_581",GN="_proofPointHeader_aye4h_589",UN="_proofPointSubheader_aye4h_597",zN="_partnerBanner_aye4h_604",VN="_partnerBannerKicker_aye4h_616",JN="_partnerBannerBody_aye4h_623",KN="_partnerBannerDismiss_aye4h_627",YN="_airworthinessRow_aye4h_644",QN="_airworthinessChecklist_aye4h_652",ZN="_airworthinessItem_aye4h_657",XN="_airworthinessOk_aye4h_664",eS="_airworthinessPending_aye4h_670",tS="_signoffChainView_aye4h_676",nS="_signoffChainRow_aye4h_682",aS="_signoffChainRing_aye4h_690",sS="_signoffChainSigners_aye4h_694",iS="_signoffChainRequired_aye4h_700",rS="_signoffChainDeferred_aye4h_706",oS="_signoffChainStatus_aye4h_716",cS="_statusPassed_aye4h_722",lS="_statusFailed_aye4h_723",dS="_statusPending_aye4h_724",uS="_passDeltaPanel_aye4h_726",mS="_passDeltaTitle_aye4h_734",pS="_passDeltaRow_aye4h_742",hS="_passDeltaTarget_aye4h_751",fS="_passDeltaFooter_aye4h_755",gS="_capabilitySection_aye4h_765",_S="_capabilityDemoBadge_aye4h_773",yS="_deltaHeadline_aye4h_786",vS="_deltaValue_aye4h_793",bS="_deltaCaption_aye4h_800",jS="_coatingStackList_aye4h_806",xS="_coatingLayerRow_aye4h_814",IS="_layerClass_aye4h_823",wS="_layerThickness_aye4h_827",NS="_deltaMeta_aye4h_832",y={listPane:y1,listItem:v1,selected:b1,jobId:j1,node:x1,at:I1,detailPane:w1,section:N1,sectionTitle:S1,row:C1,label:R1,seal:E1,emptyInline:k1,receiptList:P1,receiptRow:T1,receiptRowSelected:A1,receiptSelectButton:L1,receiptCopyButton:O1,receiptKind:$1,receiptBody:M1,receiptMeta:D1,receiptAt:B1,hash:F1,routeStepList:q1,routeStep:H1,routeOrdinal:W1,routeStepId:G1,routeMachine:U1,routeStatus:z1,actions:V1,button:J1,empty:K1,sectionTitleRow:Y1,sparklineRow:Q1,sparklineSegment:Z1,sparklineLegend:X1,sparklineLegendItem:eN,sparklineSwatch:tN,modeConnectedNormal:nN,modeConnectedDegraded:aN,modeDisconnectedLocal:sN,warningChip:iN,listChip:rN,stepperRow:oN,step:cN,stepRing:lN,stepLabel:dN,stepStatus:uN,stepPassed:mN,stepFailed:pN,stepPending:hN,stepConnector:fN,stepperFailReason:gN,traceTabs:_N,traceTab:yN,traceTabActive:vN,traceBody:bN,traceEdge:jN,traceNode:xN,traceToggle:IN,traceTrackable:wN,traceIcon:NN,traceVerb:SN,traceVerbInline:CN,traceOpType:RN,traceTrackId:EN,traceTrackType:kN,traceMeta:PN,traceMetaDim:TN,traceChildren:AN,traceFooter:LN,inspectionPolicy:ON,policyBadgeEvidence:$N,policyBadgeLearning:MN,viewOnlyChip:DN,signoffList:BN,signoffEntry:FN,signoffRole:qN,signoffRef:HN,signoffAt:WN,proofPointHeader:GN,proofPointSubheader:UN,partnerBanner:zN,partnerBannerKicker:VN,partnerBannerBody:JN,partnerBannerDismiss:KN,airworthinessRow:YN,airworthinessChecklist:QN,airworthinessItem:ZN,airworthinessOk:XN,airworthinessPending:eS,signoffChainView:tS,signoffChainRow:nS,signoffChainRing:aS,signoffChainSigners:sS,signoffChainRequired:iS,signoffChainDeferred:rS,signoffChainStatus:oS,statusPassed:cS,statusFailed:lS,statusPending:dS,passDeltaPanel:uS,passDeltaTitle:mS,passDeltaRow:pS,passDeltaTarget:hS,passDeltaFooter:fS,capabilitySection:gS,capabilityDemoBadge:_S,deltaHeadline:yS,deltaValue:vS,deltaCaption:bS,coatingStackList:jS,coatingLayerRow:xS,layerClass:IS,layerThickness:wS,deltaMeta:NS},yr={"powder-lot-weighed":"â","machine-calibrated":"â","build-started":"â¶","layer-inspected":"â","sintering-started":"ð","nde-performed":"â¿","coupon-extracted":"â","evidence-sealed":"â","manifest-verified":"â","route-step-started":"â·","route-step-completed":"â ","secure-pause":"â¸","secure-resume":"âµ","model-released":"â´","model-rolled-back":"âº","equivalence-class-registered":"â¡"},vr={"powder-lot":"â","build-plate":"â","green-part":"â","sintered-part":"â","machined-part":"â£","coated-part":"â",coupon:"â","evidence-packet":"â","manufacturing-manifest":"â","process-route":"â²","route-step":"â","model-card":"ð",machine:"â"};function br(e,n){return n!=="line-technician"?e:{...e,actorEmail:null,location:null}}function SS({edge:e,role:n,depth:a}){const[s,i]=h.useState(a<2),r=br(e.operation,n);return t.jsxs("div",{className:y.traceEdge,style:{paddingLeft:`${a*12}px`},children:[t.jsxs("button",{type:"button",className:y.traceToggle,onClick:()=>i(c=>!c),"aria-expanded":s,children:[t.jsx("span",{className:y.traceIcon,children:yr[r.type]??"â¢"}),t.jsx("span",{className:y.traceVerb,children:e.role}),t.jsx("span",{className:y.traceOpType,children:r.type}),t.jsx("span",{className:y.traceMeta,children:r.nodeId}),r.actorEmail&&t.jsxs("span",{className:y.traceMetaDim,children:["· ",r.actorEmail]}),t.jsxs("span",{className:y.traceMetaDim,children:["· ",r.timestamp.toISOString().slice(11,19)]})]}),s&&e.produced.length>0&&t.jsx("div",{className:y.traceChildren,children:e.produced.map((c,o)=>t.jsx(jr,{node:c,role:n,depth:a+1},`${e.operation.opId}-${o}`))})]})}
68function jr({node:e,role:n,depth:a}){if(!e.trackable)return null;const s=e.trackable;return t.jsxs("div",{className:y.traceNode,style:{paddingLeft:`${a*12}px`},children:[t.jsxs("div",{className:y.traceTrackable,children:[t.jsx("span",{className:y.traceIcon,children:vr[s.type]??"â¢"}),t.jsx("span",{className:y.traceTrackId,children:s.trackId}),t.jsx("span",{className:y.traceTrackType,children:s.type}),e.emittedAs&&t.jsx("span",{className:y.traceVerbInline,children:e.emittedAs})]}),e.consumedBy.map((i,r)=>t.jsx(SS,{edge:i,role:n,depth:a+1},`${s.trackId}-${r}`))]})}function CS({edge:e,role:n,depth:a}){const[s,i]=h.useState(a<2),r=br(e.operation,n);return t.jsxs("div",{className:y.traceEdge,style:{paddingLeft:`${a*12}px`},children:[t.jsxs("button",{type:"button",className:y.traceToggle,onClick:()=>i(c=>!c),"aria-expanded":s,children:[t.jsx("span",{className:y.traceIcon,children:yr[r.type]??"â¢"}),t.jsx("span",{className:y.traceVerb,children:e.role}),t.jsx("span",{className:y.traceOpType,children:r.type}),t.jsx("span",{className:y.traceMeta,children:r.nodeId}),r.actorEmail&&t.jsxs("span",{className:y.traceMetaDim,children:["· ",r.actorEmail]}),t.jsxs("span",{className:y.traceMetaDim,children:["· ",r.timestamp.toISOString().slice(11,19)]})]}),s&&e.consumed.length>0&&t.jsx("div",{className:y.traceChildren,children:e.consumed.map((c,o)=>t.jsx(xr,{node:c,role:n,depth:a+1},`${e.operation.opId}-${o}`))})]})}function xr({node:e,role:n,depth:a}){if(!e.trackable)return null;const s=e.trackable;return t.jsxs("div",{className:y.traceNode,style:{paddingLeft:`${a*12}px`},children:[t.jsxs("div",{className:y.traceTrackable,children:[t.jsx("span",{className:y.traceIcon,children:vr[s.type]??"â¢"}),t.jsx("span",{className:y.traceTrackId,children:s.trackId}),t.jsx("span",{className:y.traceTrackType,children:s.type}),e.consumedAs&&t.jsx("span",{className:y.traceVerbInline,children:e.consumedAs})]}),e.producedBy.map((i,r)=>t.jsx(CS,{edge:i,role:n,depth:a+1},`${s.trackId}-${r}`))]})}function RS(e){const n=e.sealedAt,a=e.signoffChain[0],s={opId:e.seal,type:"evidence-sealed",timestamp:n,actorRole:a?.role??"ornl-metallurgist",nodeId:e.nodeId},i={trackId:`lot:${e.powderLotId}`,type:"powder-lot",createdAt:n},r={trackId:e.seal,type:"evidence-packet",createdAt:n,originOpId:e.seal};return{forward:{trackable:i,consumedBy:[{operation:s,role:"consumed",produced:[{trackable:r,emittedAs:"sealed",consumedBy:[]}]}]},backward:{trackable:r,producedBy:[{operation:s,role:"sealed",consumed:[{trackable:i,consumedAs:"consumed",producedBy:[]}]}]}}}function ES({pkg:e,activeRole:n}){const[a,s]=h.useState("forward"),i=h.useMemo(()=>e.trace??RS(e),[e]);return t.jsxs("div",{"data-testid":"trace-tree",children:[t.jsxs("div",{className:y.traceTabs,children:[t.jsx("button",{type:"button",className:`${y.traceTab} ${a==="forward"?y.traceTabActive:""}`,onClick:()=>s("forward"),"data-testid":"trace-tab-forward",children:"Forward (downstream)"}),t.jsx("button",{type:"button",className:`${y.traceTab} ${a==="backward"?y.traceTabActive:""}`,onClick:()=>s("backward"),"data-testid":"trace-tab-backward",children:"Backward (upstream)"})]}),t.jsx("div",{className:y.traceBody,children:a==="forward"?t.jsx(jr,{node:i.forward,role:n,depth:0}):t.jsx(xr,{node:i.backward,role:n,depth:0})}),!e.trace&&t.jsxs("div",{className:y.traceFooter,children:["synthesised trace · live thread lands when"," ",t.jsx("code",{children:"arcnet.state.regional"})," stabilises"]})]})}const Ir={"lockheed-martin":"Lockheed Martin (GD heritage)",boeing:"Boeing","ge-aerospace"
68:"GE Aerospace","pratt-whitney":"Pratt & Whitney"},kS={1:"R1 · Material / Process / Machine",2:"R2 · Cross-node equivalence",3:"R3 · Part-family qualification",4:"R4 · Platform evidence"},PS={1:["ornl-metallurgist"],2:["arc-operator"],3:["ornl-metallurgist"],4:["ornl-metallurgist"]},TS={1:[],2:[],3:["defense-oem"],4:["defense-oem","airworthiness-authority"]};function AS({oem:e,onDismiss:n,canDismiss:a}){const s=Ir[e];return t.jsxs("div",{className:y.partnerBanner,"data-testid":"partner-pending-banner",children:[t.jsx("div",{className:y.partnerBannerKicker,children:"PARTNER STATUS"}),t.jsxs("div",{className:y.partnerBannerBody,children:[s," engagement pending. Acceptance bands are realistic-but-non-binding placeholders. Replace with"," ",s,"-confirmed allowables before Ring-3 seal."]}),a&&t.jsx("button",{type:"button",className:y.partnerBannerDismiss,onClick:n,"data-testid":"partner-banner-dismiss",children:"dismiss"})]})}function LS({progression:e}){const a=e.find(s=>s.ring===4)?.status??"pending";return t.jsxs("div",{className:y.airworthinessRow,"data-testid":"airworthiness-checklist",children:[t.jsx("span",{className:y.label,children:"Airworthiness"}),t.jsxs("span",{className:y.airworthinessChecklist,children:[t.jsx("span",{className:`${y.airworthinessItem} ${a==="passed"?y.airworthinessOk:y.airworthinessPending}`,children:"NAVAIR (primary)"}),t.jsx("span",{className:`${y.airworthinessItem} ${a==="passed"?y.airworthinessOk:y.airworthinessPending}`,children:"USAF (secondary)"})]})]})}function OS({progression:e}){return t.jsx("div",{className:y.signoffChainView,children:[1,2,3,4].map(n=>{const s=e.find(c=>c.ring===n)?.status??"pending",i=PS[n],r=TS[n];return t.jsxs("div",{className:y.signoffChainRow,"data-testid":`signoff-chain-${n}`,children:[t.jsx("span",{className:y.signoffChainRing,children:kS[n]}),t.jsxs("span",{className:y.signoffChainSigners,children:[i.map(c=>t.jsx("span",{className:y.signoffChainRequired,children:c},c)),r.map(c=>t.jsxs("span",{className:y.signoffChainDeferred,title:"DEFENSE-OEM SIGNOFF DEFERRED â POST-T2",children:[c," · DEFERRED"]},c))]}),t.jsx("span",{className:`${y.signoffChainStatus} ${s==="passed"?y.statusPassed:s==="failed"?y.statusFailed:y.statusPending}`,children:s.toUpperCase()})]},n)})})}function $S({job:e}){return e.proofPointPass!=="pass-2"?null:t.jsxs("div",{className:y.passDeltaPanel,"data-testid":"pass-delta-panel",children:[t.jsx("div",{className:y.passDeltaTitle,children:"Pass-1 â Pass-2 delta"}),t.jsxs("div",{className:y.passDeltaRow,children:[t.jsx("span",{className:y.label,children:"Cycle-time ratio"}),t.jsx("span",{className:y.passDeltaTarget,children:"⤠0.80 (target)"})]}),t.jsxs("div",{className:y.passDeltaRow,children:[t.jsx("span",{className:y.label,children:"Evidence-latency ratio"}),t.jsx("span",{className:y.passDeltaTarget,children:"⤠0.70 (target)"})]}),t.jsxs("div",{className:y.passDeltaRow,children:[t.jsx("span",{className:y.label,children:"Anomaly-latency ratio"}),t.jsx("span",{className:y.passDeltaTarget,children:"⤠0.60 (target)"})]}),t.jsxs("div",{className:y.passDeltaFooter,children:["live values surface when the protocol-side delta report bus wires through · see ",t.jsx("code",{children:"arcnet.proof-point.spine"})]})]})}function MS({pkg:e,job:n,activeRole:a}){const s=n.proofPointOem??"lockheed-martin",i=n.proofPointPass??"pass-1",r=x(_=>_.proofPointBannerDismissedFor),c=x(_=>_.dismissProofPointBanner),[o,d]=h.useState(!1),l=a==="ornl-metallurgist"||a==="arc-operator",g=!o&&!(r&&r[e.jobId]),u=e.ringProgression??[{ring:1,status:"pending"},{ring:2,status:"pending"},{ring:3,status:"pending"},{ring:4,status:"pending"}];return t.jsxs("div",{className:y.section,"data-testid":"proof-point-panel",children:[t.jsx("div",{className:y.proofPointHeader,children:"F-16 FRC SW · F100 Accessory Mount Bracket · Inconel 718"}),t.jsxs("div",{className:y.proofPointSubheader,children:[Ir[s]," · NAVAIR + USAF · ",i.toUpperCase()]}),g&&t.jsx(AS,{oem:s,canDismiss:l,onDismiss:()=>{d(!0),c&&c(e.jobId)}}),t.jsx(LS,{progression:u}),t.jsx(OS,{progression:u}),t.jsx($S,{job:n})]})}const zs={"connected-normal":"NORMAL","connected-degraded":"DEGRADED","disconnected-local":"DISCONNECTED"},Vs={"connected-normal":y.modeConnectedNormal,"connected-degraded":y.modeConnectedDegraded,"disconnected-local":y.modeDisconnectedLocal};function DS({pkg:e}){const n=h.useMemo(()=>{const s=e.networkModeHistory??[];if(s.length===0)return[];const i=e.sealedAt.getTime();return s.map(([r,c],o)=>{const d=r.getTime(),l=s[o+1],g=l?l[0].getTime():i;return{mode:c,startMs:d,durationMs:Math.max(1,g-d)}})},[e]);if(n.length===0)return t.jsx("div",{className:y.empty,children:"no network-mode history recorded"});const a=n.reduce((s,i)=>s+i.durationMs,0);return t.jsxs("div",{"data-testid":"network-mode-sparkline",children:[t.jsx("div",{className:y.sparklineRow,children:n.map((s,i)=>t.jsx("span",{className:`${y.sparklineSegment} ${Vs[s.mode]}`,title:`${zs[s.mode]} · ${Math.round(s.durationMs/1e3)}s`,style:{flexGrow:s.durationMs/a}},i))}),t.jsx("div",{className:y.sparklineLegend,children:["connected-normal","connected-degraded","disconnected-local"].map(s=>t.jsxs("span",{className:y.sparklineLegendItem,children:[t.jsx("span",{className:`${y.sparklineSwatch} ${Vs[s]}`}),zs[s]]},s))})]})}const Js={1:"R1 · MPM",2:"R2 · Equiv",3:"R3 · Family",4:"R4 · Platform"};function BS(e){return[1,2,3,4].map(a=>({ring:a,status:"pending"}))}function FS({pkg:e}){const n=e.ringProgression??BS(),a=n.filter(s=>s.status==="failed");return t.jsxs("div",{"data-testid":"ring-stepper",children:[t.jsx("div",{className:y.stepperRow,children:n.map((s,i)=>t.jsxs("span",{className:`${y.step} ${s.status==="passed"?y.stepPassed:s.status==="failed"?y.stepFailed:y.stepPending}`,title:s.failedCriteria?.length?`failed: ${s.failedCriteria.join(", ")}`:`${Js[s.ring]} · ${s.status}`,"data-testid":`ring-step-${s.ring}`,children:[t.jsx("span",{className:y.stepRing,children:s.ring}),t.jsx("span",{className:y.stepLabel,children:Js[s.ring]}),t.jsx("span",{className:y.stepStatus,children:s.status.toUpperCase()}),i<n.length-1&&t.jsx("span",{className:y.stepConnector,"aria-hidden":!0})]},s.ring))}),a.length>0&&t.jsx("div",{className:y.stepperFailReason,children:a.map(s=>t.jsxs("div",{children:[t.jsxs("strong",{children:["R",s.ring]})," failed:"," ",s.failedCriteria?.join(", ")??"(no criteria recorded)"]},s.ring))})]})}function qS({pkg:e}){const n=h.useMemo(()=>{const a=e.ringProgression??[],s=new Set(a.filter(c=>c.status==="passed").map(c=>c.ring)),i=(s.has(1)?1:0)+(s.has(3)?1:0),r=s.has(2)?1:0;return{evidenceRings:i,learningRings:r}},[e.ringProgression]);return t.jsxs("span",{className:y.inspectionPolicy,children:[t.jsx("span",{children:e.inspectionRefs.length}),n.evidenceRings>0&&t.jsxs("span",{className:y.policyBadgeEvidence,title:"ring 1 + 3 use evidence-bearing samples","data-testid":"inspection-policy-evd",children:["EVD Ã",n.evidenceRings]}),n.learningRings>0&&t.jsxs("span",{className:y.policyBadgeLearning,title:"ring 2 uses learning-bearing samples","data-testid":"inspection-policy-lrn",children:["LRN Ã",n.learningRings]})]})}function HS({pkg:e,activeRole:n}){const a=n==="ornl-metallurgist"||n==="defense-oem"&&xa,s=n==="arc-operator";return!a&&!s?null:t.jsxs("div",{className:y.section,"data-testid":"signoff-section",children:[t.jsxs("div",{className:y.sectionTitleRow,children:[t.jsx("span",{className:y.sectionTitle,children:"Sign-off"}),s&&t.jsx("span",{className:y.viewOnlyChip,title:"D-0017 §5.9 â sign-off authority reserved for ORNL Metallurgist (Phase Bravo: Defense OEM)","data-testid":"signoff-view-only-chip",children:"VIEW ONLY â sign-off reserved for ORNL Metallurgist (Phase Bravo: Defense OEM)"})]}),t.jsx("div",{className:y.signoffList,children:e.signoffChain.length===0?t.jsx("span",{className:y.muted,children:"(no sign-offs yet)"}):e.signoffChain.map((i,r)=>t.jsxs("div",{className:y.signoffEntry,children:[t.jsx("span",{className:y.signoffRole,children:i.role}),t.jsx("span",{className:y.signoffRef,children:i.attestationRef}),t.jsx("span",{className:y.signoffAt,children:i.at instanceof Date?i.at.toISOString().slice(0,19):String(i.at)})]},`${i.attestationRef}-${r}`))}),a&&t.jsxs("button",{type:"button",className:y.button,"data-testid":"signoff-action",children:["[ Sign off as ",n==="defense-oem"?"Defense OEM":"ORNL Metallurgist"," ]"]})]})}function WS({pkg:e}){return e.replayBudgetExceeded?t.jsx("span",{className:y.warningChip,title:"The disconnected-local replay buffer dropped at least one packet for this job. The chain is incomplete; this job was routed to :requalification-required.","data-testid":"replay-budget-chip",children:"â REPLAY-BUDGET
68-EXCEEDED"}):null}function Jn(e,n=18){return e.length>n+3?`...${e.slice(-n)}`:e}function GS(e,n){if(typeof e=="string")return e.includes(n);if(!e||typeof e!="object")return!1;const a=e;if(a.jobId===n||a.id===n||a.ref===n)return!0;try{return JSON.stringify(e).includes(n)}catch{return!1}}function US({jobId:e,evidenceReceipts:n,auditReceipts:a,commandReceipts:s,selectedReceiptLink:i,onSelectReceipt:r,onCopyReceipt:c,copiedKey:o,failedKey:d}){const l=n.filter(v=>v.jobId===e).slice(0,6),g=a.filter(v=>GS(v.subject,e)).slice(0,6),u=new Set(g.map(v=>v.id)),_=s.filter(v=>da(i,v)||(v.auditRef?u.has(v.auditRef):!1)).slice(0,4),m=v=>{const p=Aa(v);return o===p?"[ copied ]":d===p?"[ copy failed ]":"[ copy ]"};return t.jsxs("div",{className:y.section,"data-testid":"receipt-section",children:[t.jsx("div",{className:y.sectionTitle,children:"Receipts"}),l.length===0&&g.length===0&&_.length===0?t.jsx("div",{className:y.emptyInline,children:"no receipt frames captured for this package"}):t.jsxs("div",{className:y.receiptList,children:[l.map(v=>{const p=Ny(v);return t.jsxs("div",{className:`${y.receiptRow} ${Py(i,v)?y.receiptRowSelected:""}`,"data-testid":`evidence-receipt-link-${v.id}`,children:[t.jsxs("button",{type:"button",className:y.receiptSelectButton,onClick:()=>r(p),children:[t.jsx("span",{className:y.receiptKind,children:"EVD"}),t.jsxs("span",{className:y.receiptBody,children:[t.jsx("span",{children:"seal update"}),t.jsx("span",{className:y.receiptMeta,children:Jn(v.seal)})]}),t.jsx("span",{className:y.receiptAt,children:v.at.toISOString().slice(11,19)})]}),t.jsx("button",{type:"button",className:y.receiptCopyButton,onClick:()=>c(p),"data-testid":`copy-evidence-receipt-link-${v.id}`,children:m(p)})]},v.id)}),g.map(v=>{const p=wy(v);return t.jsxs("div",{className:`${y.receiptRow} ${ky(i,v)?y.receiptRowSelected:""}`,"data-testid":`audit-receipt-link-${v.id}`,children:[t.jsxs("button",{type:"button",className:y.receiptSelectButton,onClick:()=>r(p),children:[t.jsx("span",{className:y.receiptKind,children:"AUD"}),t.jsxs("span",{className:y.receiptBody,children:[t.jsx("span",{children:v.action}),t.jsxs("span",{className:y.receiptMeta,children:[v.role," / ",Jn(v.attestationRef,24)]})]}),t.jsx("span",{className:y.receiptAt,children:v.at.toISOString().slice(11,19)})]}),t.jsx("button",{type:"button",className:y.receiptCopyButton,onClick:()=>c(p),"data-testid":`copy-audit-receipt-link-${v.id}`,children:m(p)})]},v.id)}),_.map(v=>{const p=ir(v);return t.jsxs("div",{className:`${y.receiptRow} ${da(i,v)?y.receiptRowSelected:""}`,"data-testid":`command-receipt-link-${v.id}`,children:[t.jsxs("button",{type:"button",className:y.receiptSelectButton,onClick:()=>r(p),children:[t.jsx("span",{className:y.receiptKind,children:"CMD"}),t.jsxs("span",{className:y.receiptBody,children:[t.jsx("span",{children:v.command}),t.jsxs("span",{className:y.receiptMeta,children:[v.status," / ",Jn(v.correlationId,24)]})]}),t.jsx("span",{className:y.receiptAt,children:(v.acknowledgedAt??v.requestedAt).toISOString().slice(11,19)})]}),t.jsx("button",{type:"button",className:y.receiptCopyButton,onClick:()=>c(p),"data-testid":`copy-command-receipt-link-${v.id}`,children:m(p)})]},v.id)})]})]})}function zS({pkg:e}){const n=e.routeStepChain??[];return!e.processRouteId&&!e.manifestHash&&n.length===0?null:t.jsxs("div",{className:y.section,"data-testid":"route-execution-section",children:[t.jsx("div",{className:y.sectionTitle,children:"Route execution"}),e.processRouteId&&t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Route"}),t.jsx("span",{children:e.processRouteId})]}),e.processRouteRevision&&t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Revision"}),t.jsx("span",{children:e.processRouteRevision})]}),e.manifestHash&&t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Manifest"}),t.jsx("span",{className:y.hash,children:e.manifestHash})]}),e.revocationEpoch!==void 0&&t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Revocation"}),t.jsxs("span",{children:["epoch ",e.revocationEpoch,e.revocationDigest?` · ${e.revocationDigest}`:""]})]}),(e.securePauseIds?.length||e.secureResumeIds?.length)&&t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Pause/resume"}),t.jsxs("span",{children:[e.securePauseIds?.length??0," pause · ",e.secureResumeIds?.length??0," resume"]})]}),n.length>0&&t.jsx("div",{className:y.routeStepList,children:n.map(a=>t.jsxs("div",{className:y.routeStep,children:[t.jsx("span",{className:y.routeOrdinal,children:String(a.ordinal).padStart(2,"0")}),t.jsx("span",{className:y.routeStepId,children:a.stepId}),t.jsx("span",{className:y.routeMachine,children:a.machineClass}),t.jsx("span",{className:y.routeStatus,children:a.status})]},`${a.ordinal}-${a.stepId}`))})]})}const VS={"bond-coat":"Bond coat","ceramic-top-coat":"Ceramic thermal-barrier top coat","radiative-barrier":"Radiative barrier"},JS={"improved-performance":"Improved-performance pathway","low-cost-substitution":"Low-cost-substitution pathway"};function KS({pkg:e}){const n=e.demonstrationClass==="capability-demonstration",a=e.coatingStack??[],s=e.effectiveTemperatureDeltaC,i=e.creepRuptureLife;return!n&&a.length===0&&s==null?null:t.jsxs("div",{className:`${y.section} ${y.capabilitySection}`,children:[t.jsxs("div",{className:y.sectionTitleRow,children:[t.jsx("span",{className:y.sectionTitle,children:"Coating capability"}),n&&t.jsx("span",{className:y.capabilityDemoBadge,title:"A capability demonstration only â not a qualification claim.",children:"Capability demonstration â not a qualification claim"})]}),s!=null&&t.jsxs("div",{className:y.deltaHeadline,children:[t.jsxs("span",{className:y.deltaValue,children:["+",s,"°C"]}
68),t.jsx("span",{className:y.deltaCaption,children:"effective-temperature lift vs uncoated baseline metal temperature"})]}),a.length>0&&t.jsx("ol",{className:y.coatingStackList,children:a.map((r,c)=>t.jsxs("li",{className:y.coatingLayerRow,children:[t.jsx("span",{className:y.layerClass,children:VS[r.layerClass]}),t.jsxs("span",{className:y.layerThickness,children:[r.thicknessUm," µm"]})]},`${r.layerClass}-${c}`))}),e.partType&&t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Geometry"}),t.jsx("span",{children:e.partType==="blisk"?"Blisk (rotating)":"Stator (non-rotating)"})]}),i&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Pathway"}),t.jsx("span",{children:JS[i.valueProposition]})]}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Creep-rupture life"}),t.jsxs("span",{className:y.deltaMeta,children:[i.lifeHoursBaseline.toLocaleString()," h â"," ",i.lifeHoursCoated.toLocaleString()," h @ ",i.serviceTemperatureC,"°C / ",i.appliedStressKsi," ksi"]})]})]})]})}function YS(){const e=h.useRef(Date.now()),n=h.useRef(!1),a=x(j=>Object.values(j.evidencePackages)),s=x(j=>j.evidenceReceipts),i=x(j=>j.auditReceipts),r=x(j=>j.commandReceipts),c=x(j=>j.selectedReceiptLink),o=La(),{copiedKey:d,failedKey:l,copyReceiptLink:g}=cr(),u=x(j=>j.activeRole),_=x(j=>j.jobs),[m,v]=h.useState(null),p=m??a[0]?.jobId??null,f=h.useMemo(()=>p?a.find(j=>j.jobId===p)??null:null,[p,a]),b=h.useMemo(()=>f?_[f.jobId]:null,[f,_]);return h.useEffect(()=>{c?.jobId&&a.some(j=>j.jobId===c.jobId)&&v(c.jobId)},[a,c?.jobId]),h.useEffect(()=>{n.current||!u||(n.current=!0,ot("ui_evidence_drawer_open_seconds",Ia(e.current),{role:u}))},[u]),u==="ornl-metallurgist"||u==="arc-operator"||u==="defense-oem"&&xa?t.jsxs(ie,{title:"Evidence Packages",size:"sm",children:[t.jsx("div",{className:y.listPane,children:a.length===0?t.jsx("div",{className:y.empty,children:"no sealed packages yet"}):a.map(j=>t.jsxs("button",{className:`${y.listItem} ${p===j.jobId?y.selected:""}`,onClick:()=>v(j.jobId),children:[t.jsx("span",{className:y.jobId,children:j.jobId}),t.jsx("span",{className:y.node,children:j.nodeId}),t.jsx("span",{className:y.at,children:j.sealedAt.toISOString().slice(11,19)}),j.replayBudgetExceeded&&t.jsx("span",{className:y.listChip,children:"â "})]},j.jobId))}),f&&t.jsxs("div",{className:y.detailPane,children:[b?.proofPointCampaign&&f.demonstrationClass!=="capability-demonstration"&&t.jsx(MS,{pkg:f,job:b,activeRole:u}),t.jsx(KS,{pkg:f}),t.jsxs("div",{className:y.section,children:[t.jsxs("div",{className:y.sectionTitleRow,children:[t.jsx("span",{className:y.sectionTitle,children:"Lineage"}),t.jsx(WS,{pkg:f})]}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Facility"}),t.jsx("span",{children:f.facilityId})]}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Node"}),t.jsx("span",{children:f.nodeId})]}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Lot"}),t.jsx("span",{children:f.powderLotId})]}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Sim revision"}),t.jsx("span",{children:f.simulationRevision})]})]}),t.jsx(zS,{pkg:f}),f.demonstrationClass!=="capability-demonstration"&&t.jsxs("div",{className:y.section,children:[t.jsx("div",{className:y.sectionTitle,children:"Qualification rings"}),t.jsx(FS,{pkg:f})]}),t.jsxs("div",{className:y.section,children:[t.jsx("div",{className:y.sectionTitle,children:"Network-mode history"}),t.jsx(DS,{pkg:f})]}),t.jsxs("div",{className:y.section,children:[t.jsx("div",{className:y.sectionTitle,children:"Trace"}),t.jsx(ES,{pkg:f,activeRole:u})]}),t.jsxs("div",{className:y.section,children:[t.jsx("div",{className:y.sectionTitle,children:"Chain-of-custody"}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Attestations"}),t.jsx("span",{children:f.attestationChain.length})]}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Interventions"}),t.jsx("span",{children:f.interventions.length})]}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Inspections"}),t.jsx(qS,{pkg:f})]}),t.jsxs("div",{className:y.row,children:[t.jsx("span",{className:y.label,children:"Signoffs"}),t.jsx("span",{children:f.signoffChain.length})]})]}),t.jsx(HS,{pkg:f,activeRole:u}),t.jsxs("div",{className:y.section,children:[t.jsx("div",{className:y.sectionTitle,children:"Seal"}),t.jsx("div",{className:y.seal,children:f.seal}),t.jsxs("div",{className:y.label,children:["sealed ",f.sealedAt.toISOString()]})]}),t.jsx(US,{jobId:f.jobId,evidenceReceipts:s,auditReceipts:i,commandReceipts:r,selectedReceiptLink:c,onSelectReceipt:o,onCopyReceipt:j=>{g(j)},copiedKey:d,failedKey:l}),t.jsxs("div",{className:y.actions,children:[t.jsx("button",{className:y.button,children:"[ Export engineering dossier ]"}),t.jsx("button",{className:y.button,children:"[ Export policy-conformant envelope ]"})]})]})]}):t.jsx(ie,{title:"Evidence Packages",size:"sm",children:t.jsxs("div",{className:y.empty,children:["access denied: role=",u??"unset"," cannot view evidence packages"]})})}const QS="_table_ucnje_1",ZS="_row_ucnje_7",XS="_rowButton_ucnje_15",eC="_rowSelected_ucnje_29",tC="_pillPass_ucnje_33",nC="_pillFail_ucnje_44",aC="_bandsPanel_ucnje_57",sC="_bandsHeader_ucnje_67",iC="_bandsKicker_ucnje_74",rC="_bandsLot_ucnje_80",oC="_bandRow_ucnje_85",cC="_bandLabel_ucnje_93",lC="_bandOk_ucnje_98",dC="_bandBad_ucnje_99",uC="_bandRange_ucnje_100",mC="_bandsFail_ucnje_105",pC="_bandsMissing_ucnje_114",hC="_bandsFooter_ucnje_120",fC="_header_ucnje_128",gC="_id_ucnje_137",_C="_muted_ucnje_141",yC="_warn_ucnje_145",vC="_footer_ucnje_149",bC="_policyBar_ucnje_159",jC="_policyKicker_ucnje_170",xC="_policyChip_ucnje_177",IC="_policyChipOn_ucnje_190",wC="_policyBadge_ucnje_197",te={table:QS,row:ZS,rowButton:XS,rowSelected:eC,pillPass:tC,pillFail:nC,bandsPanel:aC,bandsHeader:sC,bandsKicker:iC,bandsLot:rC,bandRow:oC,bandLabel:cC,bandOk:lC,bandBad:dC,bandRange:uC,bandsFail:mC,bandsMissing:pC,bandsFooter:hC,header:fC,id:gC,muted:_C,warn:yC,footer:vC,policyBar:bC,policyKicker:jC,policyChip:xC,policyChipOn:IC,policyBadge:wC},NC=[{id:"LOT-00042",alloy:"IN625",supplier:"Oerlikon",received:"2026-02-14",psd:{d10:18,d50:32,d90:60},expiryDays:22,telemetryRole:"evidence-bearing"}
68,{id:"LOT-00043",alloy:"MAR-M247",supplier:"Carpenter",received:"2026-02-18",psd:{d10:16,d50:29,d90:55},expiryDays:48,telemetryRole:"control-bearing"},{id:"LOT-00044",alloy:"CM247LC",supplier:"CRS",received:"2026-03-02",psd:{d10:21,d50:35,d90:62},expiryDays:72,telemetryRole:"learning-bearing"},{id:"LOT-00045",alloy:"Ti-6Al-4V",supplier:"Praxair",received:"2026-03-09",psd:{d10:22,d50:41,d90:70},expiryDays:6,telemetryRole:"evidence-bearing"}],Ks={"control-bearing":"CTL","evidence-bearing":"EVD","learning-bearing":"LRN"},Ys={"control-bearing":"control-bearing â feeds the realtime control loop","evidence-bearing":"evidence-bearing â sealed into the evidence chain","learning-bearing":"learning-bearing â feeds the next training pass"},wr={IN625:{d10Min:12,d10Max:22,d50Min:25,d50Max:45,d90Min:50,d90Max:75},"MAR-M247":{d10Min:12,d10Max:22,d50Min:25,d50Max:45,d90Min:50,d90Max:75},CM247LC:{d10Min:12,d10Max:22,d50Min:25,d50Max:45,d90Min:50,d90Max:75},"Ti-6Al-4V":{d10Min:18,d10Max:28,d50Min:35,d50Max:55,d90Min:60,d90Max:90}};function SC(e){const n=wr[e.alloy];if(!n)return{ok:!1,failures:["unknown-alloy"]};const a=[];return(e.psd.d10<n.d10Min||e.psd.d10>n.d10Max)&&a.push("d10-out-of-band"),(e.psd.d50<n.d50Min||e.psd.d50>n.d50Max)&&a.push("d50-out-of-band"),(e.psd.d90<n.d90Min||e.psd.d90>n.d90Max)&&a.push("d90-out-of-band"),{ok:a.length===0,failures:a}}function Kn({label:e,value:n,min:a,max:s}){const i=n>=a&&n<=s;return t.jsxs("div",{className:te.bandRow,children:[t.jsx("span",{className:te.bandLabel,children:e}),t.jsxs("span",{className:i?te.bandOk:te.bandBad,children:[n," µm"]}),t.jsxs("span",{className:te.bandRange,children:["[",a,", ",s,"]"]})]})}const Yn=["control-bearing","evidence-bearing","learning-bearing"];function CC(){const[e,n]=h.useState(null),[a,s]=h.useState(()=>new Set(Yn)),r=x(g=>g.activeRole)!=="line-technician",c=h.useMemo(()=>NC.map(g=>({...g,verdict:SC(g)})),[]),o=h.useMemo(()=>r?c.filter(g=>a.has(g.telemetryRole)):c,[r,c,a]),d=h.useMemo(()=>{if(!e)return null;const g=c.find(_=>_.id===e);if(!g)return null;const u=wr[g.alloy];return{row:g,band:u}},[e,c]),l=g=>{s(u=>{const _=new Set(u);return _.has(g)?_.delete(g):_.add(g),_.size===0?new Set(Yn):_})};return t.jsxs(ie,{title:"Powder Lot Inventory",size:"sm",children:[r&&t.jsxs("div",{className:te.policyBar,"data-testid":"policy-filter-bar",children:[t.jsx("span",{className:te.policyKicker,children:"policy"}),Yn.map(g=>t.jsx("button",{type:"button",className:`${te.policyChip} ${a.has(g)?te.policyChipOn:""}`,title:Ys[g],onClick:()=>l(g),"data-testid":`policy-toggle-${g}`,children:Ks[g]},g))]}),t.jsxs("div",{className:te.table,children:[t.jsxs("div",{className:`${te.row} ${te.header}`,children:[t.jsx("span",{children:"Lot"}),t.jsx("span",{children:"Alloy"}),t.jsx("span",{children:"Supplier"}),t.jsx("span",{children:"D50 µm"}),t.jsx("span",{children:"Expiry"}),t.jsx("span",{children:"Ring 1"})]}),o.map(g=>t.jsxs("button",{className:`${te.row} ${te.rowButton} ${g.expiryDays<14?te.warn:""} ${e===g.id?te.rowSelected:""}`,onClick:()=>n(e===g.id?null:g.id),"data-testid":`lot-${g.id}`,children:[t.jsxs("span",{className:te.id,children:[g.id,r&&t.jsx("span",{className:te.policyBadge,title:Ys[g.telemetryRole],"data-testid":`policy-badge-${g.id}`,children:Ks[g.telemetryRole]})]}),t.jsx("span",{children:g.alloy}),t.jsx("span",{className:te.muted,children:g.supplier}),t.jsx("span",{children:g.psd.d50}),t.jsxs("span",{children:[g.expiryDays,"d"]}),t.jsx("span",{className:g.verdict.ok?te.pillPass:te.pillFail,"data-testid":`ring-1-verdict-${g.id}`,children:g.verdict.ok?"PASS":"FAIL"})]},g.id))]}),d&&t.jsxs("div",{className:te.bandsPanel,"data-testid":"ring-1-bands-panel",children:[t.jsxs("div",{className:te.bandsHeader,children:[t.jsx("span",{className:te.bandsKicker,children:"RING 1 â ACCEPTANCE BANDS"}),t.jsxs("span",{className:te.bandsLot,children:[d.row.id," · ",d.row.alloy]})]}),d.band?t.jsxs(t.Fragment,{children:[t.jsx(Kn,{label:"D10",value:d.row.psd.d10,min:d.band.d10Min,max:d.band.d10Max}),t.jsx(Kn,{label:"D50",value:d.row.psd.d50,min:d.band.d50Min,max:d.band.d50Max}),t.jsx(Kn,{label:"D90",value:d.row.psd.d90,min:d.band.d90Min,max:d.band.d90Max}),!d.row.verdict.ok&&t.jsxs("div",{className:te.bandsFail,children:["failed: ",d.row.verdict.failures.join(", ")
68]})]}):t.jsxs("div",{className:te.bandsMissing,children:["no Ring-1 bands registered for alloy ",t.jsx("code",{children:d.row.alloy})]}),t.jsxs("div",{className:te.bandsFooter,children:["bands sourced from ",t.jsx("code",{children:"resources/qualification-bounds/ring-1-*.edn"})]})]}),t.jsx("div",{className:te.footer,children:"Chemistry assay is CUI · visible to ORNL Metallurgist only."})]})}const RC="_list_5tauz_1",EC="_row_5tauz_8",kC="_pos_5tauz_18",PC="_anonId_5tauz_23",TC="_status_5tauz_28",AC="_empty_5tauz_35",LC="_footer_5tauz_41",ut={list:RC,row:EC,pos:kC,anonId:PC,status:TC,empty:AC,footer:LC},OC=["downlink-pending","downlink-complete","printing","printed","sintering","cooled","inspected","tested"];function $C(){const e=x(n=>Object.values(n.jobs).filter(a=>OC.includes(a.status)));return t.jsxs(ie,{title:"Job Queue",size:"sm",children:[t.jsx("div",{className:ut.list,children:e.length===0?t.jsx("div",{className:ut.empty,children:"no active jobs"}):e.map((n,a)=>t.jsxs("div",{className:ut.row,children:[t.jsx("span",{className:ut.pos,children:String(a+1).padStart(2,"0")}),t.jsx("span",{className:ut.anonId,children:n.anonymizedId}),t.jsx("span",{className:ut.status,children:n.status.toUpperCase()})]},n.id))}),t.jsx("div",{className:ut.footer,children:"Zero-Trust view · restricted manufacturing fields are hidden by projection."})]})}const MC="_list_eefrd_1",DC="_row_eefrd_8",BC="_light_eefrd_17",FC="_title_eefrd_22",qC="_sop_eefrd_26",HC="_red_eefrd_31",WC="_yellow_eefrd_40",GC="_clear_eefrd_49",wt={list:MC,row:DC,light:BC,title:FC,sop:qC,red:HC,yellow:WC,clear:GC},Qs={red:0,yellow:1,clear:2};function UC(){const e=x(s=>Object.values(s.nodes)),n=x(s=>s.signalEvents),a=h.useMemo(()=>{const s=[];return e.forEach(i=>{i.attestationFresh||s.push({id:`${i.id}-attest`,level:"red",title:`Re-attest ${i.id}: hardware root-of-trust stale`,sop:"SOP-ATTEST-001"}),i.networkMode==="disconnected-local"&&s.push({id:`${i.id}-network`,level:"yellow",title:`${i.id} is disconnected-local: uplink buffering`,sop:"SOP-NET-004"})}),n.slice(0,8).forEach(i=>{i.kind==="phase-transition"&&Date.now()-i.at.getTime()<3e4&&s.push({id:i.id,level:"yellow",title:`Phase transition on ${i.nodeId}: confirm furnace ramp-halt`,sop:"SOP-SINTER-002"})}),s.length===0&&s.push({id:"clear",level:"clear",title:"All equipment nominal",sop:"â"}),s.sort((i,r)=>Qs[i.level]-Qs[r.level])},[e,n]);return t.jsx(ie,{title:"Triage",size:"sm",children:t.jsx("div",{className:wt.list,children:a.map(s=>t.jsxs("div",{className:`${wt.row} ${wt[s.level]}`,children:[t.jsx("span",{className:wt.light,children:s.level==="red"?"[ RED ]":s.level==="yellow"?"[ YELLOW]":"[ CLEAR ]"}),t.jsx("span",{className:wt.title,children:s.title}),t.jsx("span",{className:wt.sop,children:s.sop})]},s.id))})})}const zC="_steps_ij7ow_1",VC="_row_ij7ow_8",JC="_num_ij7ow_18",KC="_done_ij7ow_23",YC="_next_ij7ow_28",QC="_text_ij7ow_34",ZC="_btn_ij7ow_38",nt={steps:zC,row:VC,num:JC,done:KC,next:YC,text:QC,btn:ZC},XC=[{n:1,text:"Scan powder-lot QR on feeder hopper",verify:"qr"},{n:2,text:"Confirm hopper level above 40%",verify:"acknowledge"},{n:3,text:"Inspect recoater arm for debris",verify:"acknowledge"},{n:4,text:"Acknowledge build-plate temperature nominal",verify:"acknowledge"},{n:5,text:"Release to queue",verify:"acknowledge"}];function eR({sopId:e="SOP-PRINT-001",steps:n=XC}){const[a,s]=h.useState(new Set),i=n.find(r=>!a.has(r.n));return t.jsxs(ie,{title:`SOP · ${e}`,size:"sm",children:[t.jsx("div",{className:nt.steps,children:n.map(r=>{const c=a.has(r.n),o=i?.n===r.n;return t.jsxs("div",{className:`${nt.row} ${c?nt.done:""} ${o?nt.next:""}`,children:[t.jsx("span",{className:nt.num,children:c?"â":String(r.n).padStart(2,"0")}),t.jsx("span",{className:nt.text,children:r.text}),o&&t.jsx("button",{className:nt.btn,onClick:()=>s(d=>new Set(d).add(r.n)),children:r.verify==="qr"?"[ QR SCAN ]":"[ ACK ]"})]},r.n)})}),!i&&t.jsx("div",{className:nt.done,children:"SOP complete."})]})}const tR="_table_1jior_1",nR="_row_1jior_7",aR="_header_1jior_14",sR="_muted_1jior_23",iR="_bad_1jior_27",rR="_footer_1jior_31",at={table:tR,row:nR,header:aR,muted:sR,bad:iR,footer:rR},oR=[{equipment:"printer-01",kind:"Shop System",metric:"printhead V",value:"3.31",ok:!0},{equipment:"printer-01",kind:"Shop System",metric:"bed temp °C",value:"60.2",ok:!0},{equipment:"printer-02",kind:"Shop System",metric:"printhead V",value:"3.28",ok:!0}
68,{equipment:"printer-03",kind:"Shop System",metric:"printhead V",value:"â",ok:!1},{equipment:"furnace-01",kind:"Pure Sinter",metric:"fan RPM",value:"2360",ok:!0},{equipment:"furnace-01",kind:"Pure Sinter",metric:"vacuum Pa",value:"1.1e-6",ok:!0},{equipment:"furnace-02",kind:"Pure Sinter",metric:"fan RPM",value:"2410",ok:!0}];function cR(){return t.jsxs(ie,{title:"Equipment health",size:"sm",children:[t.jsxs("div",{className:at.table,children:[t.jsxs("div",{className:`${at.row} ${at.header}`,children:[t.jsx("span",{children:"Equipment"}),t.jsx("span",{children:"Kind"}),t.jsx("span",{children:"Metric"}),t.jsx("span",{children:"Value"})]}),oR.map((e,n)=>t.jsxs("div",{className:`${at.row} ${e.ok?"":at.bad}`,children:[t.jsx("span",{children:e.equipment}),t.jsx("span",{className:at.muted,children:e.kind}),t.jsx("span",{className:at.muted,children:e.metric}),t.jsx("span",{children:e.ok?e.value:"â jam"})]},n))]}),t.jsx("div",{className:at.footer,children:"Zero-Trust · restricted process fields are not exposed."})]})}const lR="_strip_rfyr7_1",dR="_head_rfyr7_13",uR="_label_rfyr7_19",mR="_node_rfyr7_24",pR="_svg_rfyr7_29",hR="_legend_rfyr7_34",fR="_dAlpha_rfyr7_40",gR="_h2_rfyr7_43",_R="_h6_rfyr7_46",Ve={strip:lR,head:dR,label:uR,node:mR,svg:pR,legend:hR,dAlpha:fR,h2:gR,h6:_R};function yR({nodeId:e,height:n=60,width:a=240}){const s=x(d=>Oi(d,e)),i=x(d=>d.activeRole);h.useEffect(()=>{},[i]);const{pathDelta:r,pathH2:c,latest:o}=h.useMemo(()=>{const d=s.slice(-120);if(d.length===0)return{pathDelta:"",pathH2:"",latest:null};const l=a/Math.max(1,d.length-1),g=Math.max(.25,...d.map(m=>m.deltaAlpha)),u=d.map((m,v)=>{const p=v*l,f=n-m.deltaAlpha/g*(n-4)-2;return`${v===0?"M":"L"}${p.toFixed(1)},${f.toFixed(1)}`}).join(" "),_=d.map((m,v)=>{const p=v*l,f=m.hQ[2]??1,b=n-(f-.5)/2*(n-4)-2;return`${v===0?"M":"L"}${p.toFixed(1)},${b.toFixed(1)}`}).join(" ");return{pathDelta:u,pathH2:_,latest:d[d.length-1]}},[s,a,n]);return t.jsxs("div",{className:Ve.strip,children:[t.jsxs("div",{className:Ve.head,children:[t.jsx("span",{className:Ve.label,children:"ARC Signal"}),t.jsx("span",{className:Ve.node,children:e})]}),t.jsxs("svg",{width:a,height:n,className:Ve.svg,children:[t.jsx("path",{d:r,stroke:"#ff99ff",strokeWidth:"1.2",fill:"none"}),t.jsx("path",{d:c,stroke:"#7fd6ff",strokeWidth:"1.2",fill:"none",opacity:"0.75"})]}),t.jsxs("div",{className:Ve.legend,children:[t.jsxs("span",{className:Ve.dAlpha,children:["Îα ",o?o.deltaAlpha.toFixed(3):"â"]}),t.jsxs("span",{className:Ve.h2,children:["hâ ",o?(o.hQ[2]??0).toFixed(3):"â"]}),t.jsxs("span",{className:Ve.h6,children:["hâ ",o?(o.hQ[6]??0).toFixed(3):"â"]})]})]})}const vR="_container_gp9mj_1",bR="_compactPanel_gp9mj_8",jR="_compact_gp9mj_8",xR="_summary_gp9mj_17",IR="_summaryHeader_gp9mj_27",wR="_summaryLabel_gp9mj_34",NR="_countLabel_gp9mj_35",SR="_summaryValue_gp9mj_43",CR="_countValue_gp9mj_44",RR="_summaryMeta_gp9mj_51",ER="_advisoryCount_gp9mj_58",kR="_countGrid_gp9mj_66",PR="_countItem_gp9mj_72",TR="_failed_gp9mj_82",AR="_divider_gp9mj_87",LR="_outcomeList_gp9mj_92",OR="_outcomeRow_gp9mj_99",$R="_outcomeRowSelected_gp9mj_123",MR="_rowTop_gp9mj_130",DR="_rowMain_gp9mj_131",BR="_age_gp9mj_139",FR="_modeTag_gp9mj_147",qR="_plannerTag_gp9mj_180",HR="_advisoryTag_gp9mj_185",WR="_equipment_gp9mj_191",GR="_action_gp9mj_202",UR="_evidenceRef_gp9mj_206",zR="_empty_gp9mj_227",z={container:vR,compactPanel:bR,compact:jR,summary:xR,summaryHeader:IR,summaryLabel:wR,countLabel:NR,summaryValue:SR,countValue:CR,summaryMeta:RR,advisoryCount:ER,countGrid:kR,countItem:PR,failed:TR,divider:AR,outcomeList:LR,outcomeRow:OR,outcomeRowSelected:$R,rowTop:MR,rowMain:DR,age:BR,modeTag:FR,plannerTag:qR,advisoryTag:HR,equipment:WR,action:GR,evidenceRef:UR,empty:zR},VR={applied:"Applied",ignored:"Ignored",unsupported:"Unsupported",failed:"Failed","verified-stable":"Stable"};function JR(e){return e instanceof Date?e:new Date(e)}function KR(e){const n=Math.max(0,Math.floor((Date.now()-JR(e).getTime())/1e3));if(n<60)return`${n}s`;const a=Math.floor(n/60);return a<60?`${a}m`:`${Math.floor(a/60)}h`}function YR(e){const n=e.split("-");return n.length>=3?n.slice(-3).join("-"):e}function Zs(e){const n=e.verification?.controlDelta;if(n&&typeof n=="object"&&"candidateId"in n){const a=n.candidateId;
68return typeof a=="string"?a:null}return null}function QR(e){return e==="applied"||e==="verified-stable"?"completed":e==="failed"?"failed":"warning"}function ZR(e,n){return n.get(e.decisionId)?.processStateId??e.id}function XR(e){const n=e.verification?.action;if(typeof n=="string")return n.replace(/-/g," ");const a=e.verification?.controlDelta;if(a&&typeof a=="object"&&"controlKind"in a){const s=a.controlKind;if(typeof s=="string")return s.replace(/-/g," ")}if(a&&typeof a=="object"&&"action"in a){const s=a.action;if(typeof s=="string")return s.replace(/-/g," ")}if(a&&typeof a=="object"&&"kind"in a){const s=a.kind;if(typeof s=="string")return s.replace(/-/g," ")}return"correction"}function eE({outcome:e,prediction:n,traceKey:a,selected:s,onSelect:i}){return t.jsxs("button",{type:"button",className:`${z.outcomeRow} ${s?z.outcomeRowSelected:""}`,"data-testid":`correction-outcome-row-${e.id}`,"aria-pressed":s,onClick:()=>i(a),children:[t.jsxs("div",{className:z.rowTop,children:[t.jsx(Rn,{status:QR(e.status),label:VR[e.status],size:"sm",variant:"minimal"}),t.jsx("span",{className:`${z.modeTag} ${n?z.advisoryTag:z.plannerTag}`,title:n?`planner-plus-relational-advisory: ${n.scoreBand}/${n.confidenceBand}`:"planner-only correction",children:n?"ADVISORY":"PLANNER"}),t.jsx("span",{className:z.age,children:KR(e.measuredAt)})]}),t.jsxs("div",{className:z.rowMain,children:[t.jsx("span",{className:z.equipment,children:YR(e.equipmentId)}),t.jsx("span",{className:z.action,children:XR(e)})]}),e.evidenceRef&&t.jsx("div",{className:z.evidenceRef,children:e.evidenceRef})]})}function Nr({compact:e=!1}){const n=x(m=>m.recentCorrectionOutcomes),a=x(m=>m.recentControlDecisions),s=x(m=>m.recentRelationalPredictions),i=x(m=>m.selectedCorrectionTraceKey),r=x(m=>m.selectCorrectionTrace),c=h.useMemo(()=>{const m=new Map;return s.forEach(v=>{m.has(v.targetId)||m.set(v.targetId,v)}),m},[s]),o=h.useMemo(()=>new Map(a.map(m=>[m.id,m])),[a]),d=h.useMemo(()=>{const m={applied:0,ignored:0,unsupported:0,failed:0,"verified-stable":0};n.forEach(b=>{m[b.status]+=1});const v=n.filter(b=>{const w=Zs(b);return w?c.has(w):!1}).length,p=m.applied+m["verified-stable"],f=n.length;return{counts:m,total:f,advisory:v,successful:p,successRate:f===0?0:p/f*100}},[n,c]),l=h.useMemo(()=>n.map(m=>({outcome:m,traceKey:ZR(m,o)})),[n,o]),g=e?4:6,u=h.useMemo(()=>{const m=l.slice(0,g);if(!e||!i||m.length===0||m.some(p=>p.traceKey===i))return m;const v=l.find(p=>p.traceKey===i);return v?[...m.slice(0,Math.max(0,g-1)),v]:m},[e,g,l,i]),_=i??u[0]?.traceKey??null;return t.jsx(ie,{title:"Correction outcomes",variant:"accent",size:"sm",className:e?z.compactPanel:void 0,children:t.jsxs("div",{className:`${z.container} ${e?z.compact:""}`,children:[t.jsxs("div",{className:z.summary,children:[t.jsxs("div",{className:z.summaryHeader,children:[t.jsx("span",{className:z.summaryLabel,children:"Applied rate"}),t.jsxs("span",{className:z.summaryMeta,children:[t.jsxs("span",{className:z.summaryValue,children:[d.successful,"/",d.total]}),t.jsxs("span",{className:z.advisoryCount,children:["ADV ",d.advisory]})]})]}),!e&&t.jsx(it,{value:d.successRate,width:18,showPercentage:!1,colorScheme:"cyan",size:"sm",brackets:!0})]}),t.jsxs("div",{className:z.countGrid,children:[t.jsxs("div",{className:z.countItem,children:[t.jsx("span",{className:z.countLabel,children:"Applied"}),t.jsx("span",{className:z.countValue,children:d.counts.applied})]}),t.jsxs("div",{className:z.countItem,children:[t.jsx("span",{className:z.countLabel,children:"Ignored"}),t.jsx("span",{className:z.countValue,children:d.counts.ignored})]}),t.jsxs("div",{className:z.countItem,children:[t.jsx("span",{className:z.countLabel,children:"Unsup"}),t.jsx("span",{className:z.countValue,children:d.counts.unsupported})]}),t.jsxs("div",{className:z.countItem,children:[t.jsx("span",{className:z.countLabel,children:"Failed"}),t.jsx("span",{className:`${z.countValue} ${d.counts.failed>0?z.failed:""}`,children:d.counts.failed})]})]}),t.jsx("div",{className:z.divider}),u.length===0?t.jsx("div",{className:z.empty,children:"no correction receipts yet"}):t.jsx("div",{className:z.outcomeList,children:u.map(({outcome:m,traceKey:v})=>{const p=Zs(m);return t.jsx(eE,{outcome:m,prediction:p?c.get(p):void 0,traceKey:v,selected:v===_,onSelect:r},m.id)})})]})})}const tE="_observabilityPanel_pmfs0_1",nE="_compactPanel_pmfs0_7",aE="_container_pmfs0_12",sE="_metricGrid_pmfs0_19",iE="_compact_pmfs0_7",rE="_metric_pmfs0_19",oE="_metricLabel_pmfs0_36",cE="_metricHint_pmfs0_37",lE="_progressRow_pmfs0_38",dE="_statusGrid_pmfs0_39",uE="_metricValue_pmfs0_54",mE="_cyan_pmfs0_81",pE="_green_pmf
68s0_85",hE="_amber_pmfs0_89",fE="_red_pmfs0_93",gE="_progressStack_pmfs0_97",_E="_progressBar_pmfs0_114",oe={observabilityPanel:tE,compactPanel:nE,container:aE,metricGrid:sE,compact:iE,metric:rE,metricLabel:oE,metricHint:cE,progressRow:lE,statusGrid:dE,metricValue:uE,default:"_default_pmfs0_77",cyan:mE,green:pE,amber:hE,red:fE,progressStack:gE,progressBar:_E},gn=60,yE=["applied","verified-stable","ignored","unsupported","failed"];function Xs(e){if(!e)return null;const n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())?null:n}function Qn(e,n){const a=Xs(e),s=Xs(n);if(!a||!s)return null;const i=s.getTime()-a.getTime();return i>=0?i:null}function wn(e,n){if(e.length===0)return null;const a=[...e].sort((i,r)=>i-r),s=Math.min(a.length-1,Math.max(0,Math.ceil(n/100*a.length)-1));return a[s]??null}function ei(e){return e===null?"n/a":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function vE(e,n){return n===0?"0%":`${Math.round(e/n*100)}%`}function bE(e){const n=e.verification?.controlDelta;if(n&&typeof n=="object"&&"candidateId"in n){const a=n.candidateId;return typeof a=="string"?a:null}return null}function jE(e,n,a){const s=e?.selectedCandidate?.id??(n?bE(n):null);return!!(s&&a.has(s))}function xE(e){if(!e)return"";try{return JSON.stringify(e)}catch{return""}}function IE(e){const n=`${e.kind} ${e.message} ${xE(e.details)}`.toLowerCase();return n.includes("dead-letter")||n.includes("dlq")||n.includes("arc.dead-letter")}function Sr(){return Object.fromEntries(yE.map(e=>[e,0]))}function Cr(e,n,a){const s=new Set;return n.forEach(i=>{e.has(i.id)&&i.status==="evidence-sealed"&&s.add(i.id)}),a.forEach(i=>{e.has(i.jobId)&&s.add(i.jobId)}),s.size}function wE(e){return e.reduce((n,a)=>(Object.entries(a.issueCounts??{}).forEach(([s,i])=>{n[s]=(n[s]??0)+i}),n),{})}function Rr(e){return Object.values(e).reduce((n,a)=>n+a,0)}function NE(e){return e.some(n=>n.severity==="critical")?"critical":e.some(n=>n.severity==="watch")?"watch":"nominal"}function $t(e,n){return e.reduce((a,s)=>{const i=s[n];return a+(typeof i=="number"?i:0)},0)}function SE(e,n,a){const s=e.slice(0,gn),i=s.filter(T=>T.processStateId||T.decisionId||T.outcomeId),r=s.filter(T=>T.outcomeStatus),c=Sr();r.forEach(T=>{T.outcomeStatus&&(c[T.outcomeStatus]+=1)});const o=new Set;i.forEach(T=>{T.jobId&&o.add(T.jobId)});const d=i.map(T=>T.loopLatencyMs).filter(T=>typeof T=="number"),l=i.map(T=>T.decisionLatencyMs).filter(T=>typeof T=="number"),g=s.reduce((T,R)=>T+R.dlqCount,0),u=s.find(T=>T.dlqCount>0),_=r.filter(T=>T.evidenceRecorded).length,m=r.length-_,v=c.failed+c.unsupported,p=wE(s),f=Rr(p),b=$t(s,"recordsSeen"),w=$t(s,"recordsValid"),j=$t(s,"recordsInvalid"),C=$t(s,"recordsIgnored"),N=$t(s,"correctionCount");return{windowSize:Math.max(i.length,r.length,s.length,b),totalOutcomes:r.length,pendingDecisions:i.filter(T=>!T.outcomeStatus).length,advisoryDecisions:i.filter(T=>T.advisoryPresent).length,advisoryDenominator:i.length,worstSeverity:NE(s),issueCounts:p,issueTotal:f,recordsSeen:b,recordsValid:w,recordsInvalid:j,recordsIgnored:C,correctionCount:N,loopP95:wn(d,95),decisionP95:wn(l,95),budgetBreaches:i.filter(T=>T.budgetBreached).length,outcomeCounts:c,appliedLike:c.applied+c["verified-stable"],failedLike:v,dlqCount:g,latestDlqLabel:u?`${u.source} ${u.dlqCount}`:s.find(T=>(T.recordsIgnored??0)>0)?`ignored ${s.find(T=>(T.recordsIgnored??0)>0)?.recordsIgnored}`:null,evidenceRecorded:_,evidenceMissing:m,evidenceSealedJobs:Cr(o,n,a),relatedJobCount:o.size}}function Mt({label:e,value:n,hint:a,tone:s="default"}){return t.jsxs("div",{className:oe.metric,children:[t.jsx("span",{className:oe.metricLabel,children:e}),t.jsx("span",{className:`${oe.metricValue} ${oe[s]}`,children:n}),a&&t.jsx("span",{className:oe.metricHint,children:a})]})}function Er({compact:e=!1}){const n=x(u=>u.recentProcessStates),a=x(u=>u.recentControlDecisions),s=x(u=>u.recentCorrectionOutcomes),i=x(u=>u.recentCorrectionObservability),r=x(u=>u.recentRelationalPredictions),c=x(u=>Object.values(u.jobs)),o=x(u=>Object.values(u.evidencePackages)),d=x(u=>u.events),l=h.useMemo(()=>{if(i.length>0)return SE(i,c,o);const u=new Map(n.map($=>[$.id,$])),_=new Map(a.map($=>[$.id,$])),m=new Map(s.map($=>[$.decisionId,$])),v=new Map(r.map($=>[$.targetId,$])),p=a.slice(0,gn),f=s.slice(0,gn),b=f.map($=>{const Me=_.get($.decisionId),ce=Me?u.get(Me.processStateId):void 0;return{outcome:$,decision:Me,processState:ce}}),w=b.map(({processState:$,outcome:Me})=>Qn($?.observedAt,Me.measuredAt)).filter($=>typeof $=="number"),j=p.map($=>Qn(u.get($.processStateId)?.observedAt,$.decidedAt)).filter($=>typeof $=="number"),C=b.filter(({decision:$,processState:Me,outcome:ce})=>{const W=$?.latencyBudgetMs,Xe=Qn(Me?.observedAt,ce.measuredAt);return typeof W=="number"&&typeof Xe=="number"&&Xe>W}).length,N=p.filter($=>$.selectedCandidate),T=N.filter($=>jE($,m.get($.id),v)).length,R=Sr();f.forEach($=>{R[$.status]+=1});const E=new Set;b.forEach(({decision:$})=>{$?.jobId&&E.add($.jobId)}),p.forEach($=>E.add($.jobId));const A=f.filter($=>!!$.evidenceRef).length,V=f.length-A,re=d.filter(IE).slice(0,gn),q=Math.max(0,p.length-f.length),de=R.failed+R.unsupported,Z={};C>0&&(Z.budgetBreach=C),V>0&&(Z.evidenceMissing=V),R.failed>0&&(Z.outcomeFailed=R.failed),R.unsupported>0&&(Z.outcomeUnsupported=R.unsupported),re.length>0&&(Z.invalidRecord=re.length);const ue=Rr(Z),Ce=Math.max(p.length,f.length);return{windowSize:Ce,totalOutcomes:f.length,pendingDecisions:q,advisoryDecisions:T,advisoryDenominator:N.length,advisoryRate:N.length===0?0:T/N.length*100,worstSeverity:de>0?"critical":ue>0?"watch":"nominal",issueCounts:Z,issueTotal:ue,recordsSeen:Ce,recordsValid:Ce,recordsInvalid:re.length,recordsIgnored:0,correctionCount:p.length,loopP95:wn(w,95),decisionP95:wn(j,95),budgetBreaches:C,outcomeCounts:R,appliedLike:R.applied+R["verified-stable"],failedLike:de,dlqCount:re.length,latestDlqLabel:re[0]?.message??null,evidenceRecorded:A,evidenceMissing:V,evidenceSealedJobs:Cr(E,c,o),relatedJobCount:E.size}},[n,a,s,i,r,c,o,d]),g=l.windowSize===0?{status:"pending",label:"Idle"}:l.worstSeverity==="critical"?{status:"error",label:"Critical"}:l.worstSeverity==="watch"||l.dlqCount>0||l.failedLike>0||l.budgetBreaches>0||l.evidenceMissing>0||l.issueTotal>0?{status:"warning",label:"Watch"}:{status:"completed",label:"Nominal"};return t.jsx(ie,{title:"Correction observability",variant:g.status==="error"?"error":g.status==="warning"?"warning":"accent",size:"sm",className:`${oe.observabilityPanel} ${e?oe.compactPanel:""}`,headerActions:t.jsx(Rn,{status:g.status,label:g.label,size:"sm",variant:"minimal"}),children:t.jsxs("div",{className:`${oe.container} ${e?oe.compact:""}`,children:[t.jsxs("div",{className:oe.metricGrid,children:[t.jsx(Mt,{label:"Loop p95",value:ei(l.loopP95),tone:"cyan"}),!e&&t.jsx(Mt,{label:"Decision p95",value:ei(l.decisionP95),tone:"green"}),t.jsx(Mt,{label:"Advisory",value:vE(l.advisoryDecisions,l.advisoryDenominator),hint:`${l.advisoryDecisions}/${l.advisoryDenominator}
68`,tone:"cyan"}),t.jsx(Mt,{label:"DLQ",value:String(l.dlqCount),hint:l.latestDlqLabel??`${l.recordsIgnored} ignored`,tone:l.dlqCount>0?"red":"green"}),e&&t.jsx(Mt,{label:"Evidence",value:`${l.evidenceRecorded}/${l.totalOutcomes}`,hint:l.evidenceMissing>0?`${l.evidenceMissing} missing`:`${l.evidenceSealedJobs} sealed`,tone:l.evidenceMissing>0?"amber":"green"})]}),!e&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:oe.progressStack,children:[t.jsxs("div",{className:oe.progressRow,children:[t.jsx("span",{children:"Applied/stable"}),t.jsx(it,{value:l.appliedLike,max:Math.max(1,l.totalOutcomes),width:14,showPercentage:!1,colorScheme:"cyan",size:"sm",brackets:!0,className:oe.progressBar}),t.jsxs("strong",{children:[l.appliedLike,"/",l.totalOutcomes]})]}),t.jsxs("div",{className:oe.progressRow,children:[t.jsx("span",{children:"Evidence recorded"}),t.jsx(it,{value:l.evidenceRecorded,max:Math.max(1,l.totalOutcomes),width:14,showPercentage:!1,colorScheme:l.evidenceMissing>0?"auto":"green",size:"sm",brackets:!0,className:oe.progressBar}),t.jsxs("strong",{children:[l.evidenceRecorded,"/",l.totalOutcomes]})]})]}),t.jsxs("div",{className:oe.statusGrid,children:[t.jsxs("span",{children:["Budget ",t.jsx("strong",{className:l.budgetBreaches>0?oe.red:oe.green,children:l.budgetBreaches})]}),t.jsxs("span",{children:["Pending ",t.jsx("strong",{children:l.pendingDecisions})]}),t.jsxs("span",{children:["Issues ",t.jsx("strong",{className:l.issueTotal>0?oe.amber:oe.green,children:l.issueTotal})]}),t.jsxs("span",{children:["Records ",t.jsxs("strong",{children:[l.recordsValid,"/",l.recordsSeen]})]}),t.jsxs("span",{children:["Invalid ",t.jsx("strong",{className:l.recordsInvalid>0?oe.red:oe.green,children:l.recordsInvalid})]}),t.jsxs("span",{children:["Ignored ",t.jsx("strong",{className:l.recordsIgnored>0?oe.amber:oe.green,children:l.recordsIgnored})]}),t.jsxs("span",{children:["Failed/unsup ",t.jsx("strong",{className:l.failedLike>0?oe.red:oe.green,children:l.failedLike})]}),t.jsxs("span",{children:["Sealed jobs ",t.jsxs("strong",{children:[l.evidenceSealedJobs,"/",l.relatedJobCount]})]})]})]})]})})}const CE="_detailPanel_7wnd9_1",RE="_compactPanel_7wnd9_7",EE="_container_7wnd9_12",kE="_headerStats_7wnd9_19",PE="_traceSummary_7wnd9_29",TE="_traceTitle_7wnd9_37",AE="_traceAge_7wnd9_53",LE="_timeline_7wnd9_58",OE="_stage_7wnd9_65",$E="_compactTimeline_7wnd9_71",ME="_stageRail_7wnd9_75",DE="_stageIndex_7wnd9_94",BE="_ready_7wnd9_109",FE="_warn_7wnd9_114",qE="_fail_7wnd9_119",HE="_stageBody_7wnd9_124",WE="_stageHeader_7wnd9_133",GE="_stageContent_7wnd9_146",UE="_stageTitle_7wnd9_150",zE="_stageMeta_7wnd9_160",VE="_field_7wnd9_175",JE="_fieldLabel_7wnd9_179",KE="_fieldValue_7wnd9_183",YE="_cyan_7wnd9_218",QE="_green_7wnd9_222",ZE="_amber_7wnd9_226",XE="_red_7wnd9_230",ek="_traceList_7wnd9_234",tk="_traceButton_7wnd9_242",nk="_traceButtonSelected_7wnd9_256",ak="_traceId_7wnd9_261",sk="_traceMode_7wnd9_262",ik="_traceStatus_7wnd9_263",rk="_empty_7wnd9_282",ne={detailPanel:CE,compactPanel:RE,container:EE,headerStats:kE,traceSummary:PE,traceTitle:TE,traceAge:AE,timeline:LE,stage:OE,compactTimeline:$E,stageRail:ME,stageIndex:DE,ready:BE,warn:FE,fail:qE,stageBody:HE,stageHeader:WE,stageContent:GE,stageTitle:UE,stageMeta:zE,field:VE,fieldLabel:JE,fieldValue:KE,default:"_default_7wnd9_214",cyan:YE,green:QE,amber:ZE,red:XE,traceList:ek,traceButton:tk,traceButtonSelected:nk,traceId:ak,traceMode:sk,traceStatus:ik,empty:rk},ok={applied:"completed",ignored:"warning",unsupported:"warning",failed:"failed","verified-stable":"completed"};function Ma(e){return e?e instanceof Date?e:new Date(e):new Date(0)}function Dt(e){const n=Ma(e);return Number.isNaN(n.getTime())||n.getTime()===0?"--:--:--":n.toLocaleTimeString([],{hour12:!1})}function kr(e){const n=Ma(e);if(Number.isNaN(n.getTime())||n.getTime()===0)return"--";const a=Math.max(0,Math.floor((Date.now()-n.getTime())/1e3));if(a<60)return`${a}s`;const s=Math.floor(a/60);return s<60?`${s}m`:`${Math.floor(s/60)}h`}function mt(e,n=2){if(!e)return"pending";const a=e.split("-");return a.length>n?a.slice(-n).join("-"):e.length>18?e.slice(-18):e}function Je(e){return e==null||e===""?"pending":String(e).replace(/-/g," ")}function ti(e,n=2){return typeof e!="number"?"n/a":e.toFixed(n)}function ck(e){const n=e.verification?.controlDelta;if(n&&typeof n=="object"&&"candidateId"in n){const a=n.candidateId;
68return typeof a=="string"?a:null}return null}function ni(e){return e.map(Ma).filter(n=>!Number.isNaN(n.getTime())).sort((n,a)=>a.getTime()-n.getTime())[0]??new Date(0)}function lk(e,n,a,s,i){const r=new Map(a.map(m=>[m.processStateId,m])),c=new Map(a.map(m=>[m.id,m])),o=new Map(s.map(m=>[m.id,m])),d=new Map(i.map(m=>[m.decisionId,m])),l=new Map(i.filter(m=>m.interventionId).map(m=>[m.interventionId,m])),g=new Map(n.map(m=>[m.targetId,m])),u=new Map(e.map(m=>[m.id,m])),_=new Map;return e.forEach(m=>{const v=r.get(m.id),p=v?.selectedCandidate?.id,f=v?.intervention??(v?.intervention?.id?o.get(v.intervention.id):void 0),b=(v?d.get(v.id):void 0)??(f?l.get(f.id):void 0),w=(p?g.get(p):void 0)??g.get(m.id);_.set(m.id,{key:m.id,processState:m,prediction:w,decision:v,intervention:f,outcome:b,updatedAt:ni([m.observedAt,w?.generatedAt,v?.decidedAt,f?.issuedAt,b?.measuredAt])})}),i.forEach(m=>{const v=c.get(m.decisionId),p=v?u.get(v.processStateId):void 0,f=p?.id??v?.processStateId??m.id;if(_.has(f))return;const b=v?.selectedCandidate?.id??ck(m),w=b?g.get(b):void 0,j=v?.intervention??(m.interventionId?o.get(m.interventionId):void 0);_.set(f,{key:f,processState:p,prediction:w,decision:v,intervention:j,outcome:m,updatedAt:ni([p?.observedAt,w?.generatedAt,v?.decidedAt,j?.issuedAt,m.measuredAt])})}),Array.from(_.values()).sort((m,v)=>v.updatedAt.getTime()-m.updatedAt.getTime())}function Bt({index:e,title:n,status:a,meta:s,children:i}){return t.jsxs("div",{className:`${ne.stage} ${ne[a]}`,children:[t.jsx("div",{className:ne.stageRail,children:t.jsx("span",{className:ne.stageIndex,children:e})}),t.jsxs("div",{className:ne.stageBody,children:[t.jsxs("div",{className:ne.stageHeader,children:[t.jsx("span",{className:ne.stageTitle,children:n}),t.jsx("span",{className:ne.stageMeta,children:s})]}),t.jsx("div",{className:ne.stageContent,children:i})]})]})}function ve({label:e,value:n,tone:a="default"}){return t.jsxs("div",{className:ne.field,children:[t.jsx("span",{className:ne.fieldLabel,children:e}),t.jsx("span",{className:`${ne.fieldValue} ${ne[a]}`,children:n})]})}function dk(e){return e.outcome?e.outcome.status==="failed"?"fail":e.outcome.status==="ignored"||e.outcome.status==="unsupported"?"warn":"ready":"pending"}function uk({trace:e,compact:n=!1}){const a=e.processState,s=e.decision,i=s?.selectedCandidate,r=a?.anomaly??{},c=typeof r.severity=="number"?r.severity:a?.features.severity,o=typeof r.confidence=="number"?r.confidence:void 0;return t.jsxs("div",{className:`${ne.timeline} ${n?ne.compactTimeline:""}`,children:[t.jsxs(Bt,{index:"01",title:"ProcessState",status:a?"ready":"pending",meta:Dt(a?.observedAt),children:[t.jsx(ve,{label:"Equipment",value:mt(a?.equipmentId,3),tone:"cyan"}),t.jsx(ve,{label:"Anomaly",value:Je(r.kind),tone:"amber"}),t.jsx(ve,{label:"Severity",value:ti(c)}),t.jsx(ve,{label:"Confidence",value:ti(o)})]}),t.jsxs(Bt,{index:"02",title:"Advisory",status:e.prediction?"ready":"pending",meta:e.prediction?e.prediction.modelRef.split("/").pop()??"baseline":"planner-only",children:[t.jsx(ve,{label:"Mode",value:e.prediction?"planner + advisory":"planner only",tone:e.prediction?"cyan":"default"}),t.jsx(ve,{label:"Score",value:e.prediction?.scoreBand??"none",tone:e.prediction?"green":"default"}),t.jsx(ve,{label:"Confidence",value:e.prediction?.confidenceBand??"none",tone:e.prediction?"green":"default"}),t.jsx(ve,{label:"Target",value:mt(e.prediction?.targetId??i?.id)})]}),t.jsxs(Bt,{index:"03",title:"Decision",status:s?s.status==="selected"?"ready":"warn":"pending",meta:Dt(s?.decidedAt),children:[t.jsx(ve,{label:"Status",value:Je(s?.status),tone:"green"}),t.jsx(ve,{label:"Reason",value:Je(s?.reason)}),t.jsx(ve,{label:"Action",value:Je(i?.action),tone:"cyan"}),t.jsx(ve,{label:"Source",value:Je(i?.source)})]}),t.jsxs(Bt,{index:"04",title:"Intervention",status:e.intervention?"ready":"pending",meta:Dt(e.intervention?.issuedAt),children:[t.jsx(ve,{label:"Command",value:Je(e.intervention?.action),tone:"cyan"}),t.jsx(ve,{label:"Target",value:mt(e.intervention?.targetEquipmentId,3)}),t.jsx(ve,{label:"Deadline",value:Dt(e.intervention?.deadline)}),t.jsx(ve,{label:"Params",value:`${Object.keys(e.intervention?.params??{}).length}`})]}),t.jsxs(Bt,{index:"05",title:"Outcome",status:dk(e),meta:kr(e.outcome?.measuredAt),children:[t.jsx(ve,{label:"Status",value:Je(e.outcome?.status),tone:"green"}),t.jsx(ve,{label:"Receipt",value:mt(e.outcome?.id)}),t.jsx(ve,{label:"Evidence",value:mt(e.outcome?.evidenceRef,3),tone:"cyan"}),t.jsx(ve,{label:"Measured",value:Dt(e.outcome?.measuredAt)})]})]})}function mk({trace:e,selected:n,onSelect:a}){const s=e.outcome?.status,i=!!e.prediction;return t.jsxs("button",{type:"button",className:`${ne.traceButton} ${n?ne.traceButtonSelected:""}`,onClick:()=>
68a(e.key),title:`Open trace ${e.key}`,children:[t.jsx("span",{className:ne.traceId,children:mt(e.processState?.equipmentId??e.key,3)}),t.jsx("span",{className:ne.traceMode,children:i?"ADV":"PLN"}),t.jsx("span",{className:ne.traceStatus,children:s?Je(s):"pending"})]})}function Pr({compact:e=!1}){const n=x(_=>_.recentProcessStates),a=x(_=>_.recentRelationalPredictions),s=x(_=>_.recentControlDecisions),i=x(_=>_.recentInterventions),r=x(_=>_.recentCorrectionOutcomes),c=x(_=>_.selectedCorrectionTraceKey),o=x(_=>_.selectCorrectionTrace),d=h.useMemo(()=>lk(n,a,s,i,r),[n,a,s,i,r]),l=d.find(_=>_.key===c)??d[0]??null,g=d.filter(_=>_.outcome).length,u=d.filter(_=>_.prediction).length;return t.jsx(ie,{title:"Correction detail",variant:"accent",size:"sm",className:`${ne.detailPanel} ${e?ne.compactPanel:""}`,headerActions:t.jsxs("div",{className:ne.headerStats,children:[t.jsxs("span",{children:[g,"/",d.length]}),t.jsxs("span",{children:["ADV ",u]})]}),children:t.jsx("div",{className:ne.container,children:l?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:ne.traceSummary,children:[t.jsxs("div",{className:ne.traceTitle,children:[t.jsx("span",{children:mt(l.processState?.id??l.key,2)}),t.jsx("span",{className:ne.traceAge,children:kr(l.updatedAt)})]}),t.jsx(Rn,{status:l.outcome?ok[l.outcome.status]:"pending",label:l.outcome?Je(l.outcome.status):"Pending",size:"sm",variant:"minimal"})]}),t.jsx(uk,{trace:l,compact:e}),!e&&d.length>1&&t.jsx("div",{className:ne.traceList,children:d.slice(0,4).map(_=>t.jsx(mk,{trace:_,selected:_.key===l.key,onSelect:o},_.key))})]}):t.jsx("div",{className:ne.empty,children:"awaiting correction trace"})})})}const pk="_section_d7vfq_1",hk="_sectionTitle_d7vfq_7",fk="_row_d7vfq_15",gk="_at_d7vfq_23",_k="_kind_d7vfq_27",yk="_ok_d7vfq_32",vk="_bad_d7vfq_36",bk="_node_d7vfq_40",jk="_seq_d7vfq_46",xk="_empty_d7vfq_51",Ik="_divider_d7vfq_57",Se={section:pk,sectionTitle:hk,row:fk,at:gk,kind:_k,ok:yk,bad:vk,node:bk,seq:jk,empty:xk,divider:Ik};function wk(){const e=x(a=>Object.values(a.attestationResults)),n=x(a=>a.tokenRingPasses);return t.jsxs(ie,{title:"Zero-Trust Audit",size:"sm",children:[t.jsxs("div",{className:Se.section,children:[t.jsxs("div",{className:Se.sectionTitle,children:["Attestation (",e.length,")"]}),e.length===0?t.jsx("div",{className:Se.empty,children:"no attestations yet"}):e.slice(-8).reverse().map(a=>t.jsxs("div",{className:Se.row,children:[t.jsx("span",{className:Se.at,children:a.verifiedAt.toISOString().slice(11,19)}),t.jsx("span",{className:`${Se.kind} ${a.ok?Se.ok:Se.bad}`,children:a.ok?"â":"â"}),t.jsx("span",{className:Se.node,children:a.nodeId})]},a.nodeId))]}),t.jsx("div",{className:Se.divider}),t.jsxs("div",{className:Se.section,children:[t.jsxs("div",{className:Se.sectionTitle,children:["Token Ring (",n.length,")"]}),n.length===0?t.jsx("div",{className:Se.empty,children:"no passes yet"}):n.slice(0,8).map(a=>t.jsxs("div",{className:Se.row,children:[t.jsx("span",{className:Se.at,children:a.passedAt.toISOString().slice(11,19)}),t.jsx("span",{className:Se.kind,children:"â"}),t.jsx("span",{className:Se.node,children:a.holderNodeId}),t.jsxs("span",{className:Se.seq,children:["#",a.sequence]})]},`${a.facilityId}-${a.sequence}`))]})]})}const Nk="_table_kaxsl_1",Sk="_summary_kaxsl_7",Ck="_summaryLabel_kaxsl_15",Rk="_summaryValue_kaxsl_21",Ek="_row_kaxsl_26",kk="_rowButton_kaxsl_34",Pk="_rowSelected_kaxsl_48",Tk="_eq_kaxsl_52",Ak="_pillPass_kaxsl_59",Lk="_pillFail_kaxsl_69",Ok="_pillPending_kaxsl_79",$k="_muted_kaxsl_90",Mk="_detail_kaxsl_98",Dk="_detailHeader_kaxsl_106",Bk="_detailEqId_kaxsl_112",Fk="_detailLine_kaxsl_116",qk="_metricSection_kaxsl_120",Hk="_metricRow_kaxsl_127",Wk="_metricLabel_kaxsl_134",Gk="_metricDetail_kaxsl_137",Uk="_header_kaxsl_143",zk="_label_kaxsl_152",Vk="_ok_kaxsl_156",Jk="_warn_kaxsl_159",Kk="_bad_kaxsl_162",Yk="_detailKicker_kaxsl_168",Qk="_equipmentList_kaxsl_177",Zk="_equipmentRow_kaxsl_185",Xk="_equipmentNode_kaxsl_192",eP="_equipmentClass_kaxsl_196",tP="_equipmentId_kaxsl_201",B={table:Nk,summary:Sk,summaryLabel:Ck,summaryValue:Rk,row:Ek,rowButton:kk,rowSelected:Pk,eq:Tk,pillPass:Ak,pillFail:Lk,pillPending:Ok,muted:$k,detail:Mk,detailHeader:Dk,detailEqId:Bk,detailLine:Fk,metricSection:qk,metricRow:Hk,metricLabel:Wk,metricDetail:Gk,header:Uk,label:zk,ok:Vk,warn:Jk,bad:Kk,detailKicker:Yk,equipmentList:Qk,equipmentRow:Zk,equipmentNode:Xk,equipmentClass:eP,equipmentId:tP},Tr=[{class:"ornl-hub",label:"ORNL Scientific Hub"},{class:"regional-hub",label:"Regional Hub"},{class:"production",label:"Production"},{class:"test-qualification",label:"Test & Qualification"},{class:"scout",label:"Scout / Tactical Edge"}];function nP(e){const n={};for(const s of e)(n[s.class]||=[]).push(s);const a={};for(const{class:s}of Tr){const i=n[s]??[],r={};for(const c of i){const o=c.equivalenceClassId??`__no-eq-id__${c.id}`;(r[o]||=[]).push(c)}a[s]={total:i.length,equivalenceClasses:Object.entries(r).filter(([c])=>!c.startsWith("__no-eq-id__")||!0).map(([c,o])=>({id:c.startsWith("__no-eq-id__")?"(unassigned)":c,nodeIds:o.map(d=>d.id),nodeCount:o.length}))}}return a}function aP(e,n){if(!e||e.equivalenceClasses.length===0)return"pending";let a=!1;for(const s of e.equivalenceClasses){const i=n[s.id];if(i&&(a=!0,i.result==="fail"))return"fail"}return a?"pass":"pending"}const Ar={pass:"EQ · PASS",fail:"EQ · FAIL",pending:"EQ · â"},sP={"process-window-distance":"Process-window distance","microstructural-variance":"Microstructural variance","dimensional-accuracy":"Dimensional accuracy","mechanical-property-error":"Mechanical-property error"};function iP({metricId:e,metric:n}){const a=n.details.reason;return t.jsxs("div",{className:B.metricRow,children:[t.jsx("span",{className:B.metricLabel,children:sP[e]}),t.jsx("span",{className:n.result==="pass"?B.ok:n.result==="skipped"?B.muted:B.bad,children:n.result.toUpperCase()}),t.jsxs("span",{className:B.metricDetail,children:[n.details.maxMeanDifference!=null&&t.jsxs(t.Fragment,{children:["Îμ ",n.details.maxMeanDifference.toFixed(3)," "]}),n.details.maxFRatio!=null&&t.jsxs(t.Fragment,{children:["F ",n.details.maxFRatio.toFixed(2)," "]}),a&&t.jsxs("em",{children:["· ",a]})]})]})}function rP({result:e}){const n=Date.now()-e.computedAt,a=Math.round(n/1e3);return t.jsxs("div",{className:B.detail,"data-testid":"equivalence-detail",children:[t.jsxs("div",{className:B.detailHeader,children:[t.jsx("span",{className:B.detailEqId,children:e.equivalenceClassId}),t.jsx("span",{className:e.result==="pass"?B.pillPass:B.pillFail,children:Ar[e.result]})]}),t.jsxs("div",{className:B.detailLine,children:[t.jsx("span",{className:B.muted,children:"nodes:"})," ",e.nodesConsidered.join(", ")||"(none)"]}),e.partFamilyId&&t.jsxs("div",{className:B.detailLine,children:[t.jsx("span",{className:B.muted,children:"part family:"})," ",e.partFamilyId]}),t.jsxs("div",{className:B.detailLine,children:[t.jsx("span",{className:B.muted,children:"computed:"})," ",a,"s ago"]}),e.failedCriteria.length>0&&t.jsxs("div",{className:B.detailLine,children:[t.jsx("span",{className:B.muted,children:"failed:"})," ",t.jsx("span",{className:B.bad,children:e.failedCriteria.join(", ")})]}),t.jsx("div",{className:B.metricSection,children:Object.keys(e.perMetric).map(s=>e.perMetric[s]&&t.jsx(iP,{metricId:s,metric:e.perMetric[s]},s))})]})}
68function oP({nodes:e}){const n=e.flatMap(a=>(a.registeredEquipment??[]).map(s=>({nodeId:a.id,machineClass:s.machineClass,machineId:s.machineId})));return t.jsxs("div",{className:B.detail,"data-testid":"registered-equipment",children:[t.jsx("span",{className:B.detailKicker,children:"REGISTERED EQUIPMENT"}),n.length===0?t.jsxs("div",{className:B.muted,children:["no equipment registered for this class · the protocol-side",t.jsx("code",{children:" arcnet.equipment.registry "})," hasn't surfaced any instances yet."]}):t.jsx("ul",{className:B.equipmentList,children:n.map((a,s)=>t.jsxs("li",{className:B.equipmentRow,children:[t.jsx("span",{className:B.equipmentNode,children:a.nodeId}),t.jsx("span",{className:B.equipmentClass,children:a.machineClass}),t.jsx("span",{className:B.equipmentId,children:a.machineId})]},`${a.nodeId}-${a.machineId}-${s}`))})]})}function cP(){const e=x(l=>Object.values(l.nodes)),n=x(l=>l.equivalenceResults),a=x(l=>{const u=Object.values(l.facilityRollups??{}).filter(_=>_?.nodeClassSummary);if(u.length!==0)return u.sort((_,m)=>m.at.getTime()-_.at.getTime()),u[0].nodeClassSummary}),[s,i]=h.useState(null),r=h.useMemo(()=>a??nP(e),[a,e]),c=h.useMemo(()=>{let l=0,g=0;for(const u of Object.keys(r)){const _=r[u];_&&(l+=_.total,g+=_.equivalenceClasses.length)}return{nodeCount:l,eqClassCount:g}},[r]),o=h.useMemo(()=>Tr.map(({class:l,label:g})=>{const u=e.filter(f=>f.class===l),_=r[l],m=_?.equivalenceClasses.length??0,v=_?.equivalenceClasses.map(f=>`${f.id} · ${f.nodeCount}`).join(` 69`),p=aP(_,n);return{class:l,label:g,total:_?.total??u.length,eqCount:m,tooltip:v,verdict:p,online:u.filter(f=>f.networkMode==="connected-normal").length,degraded:u.filter(f=>f.networkMode==="connected-degraded").length,offline:u.filter(f=>f.networkMode==="disconnected-local").length,stale:u.filter(f=>!f.attestationFresh).length}}),[e,r,n]),d=h.useMemo(()=>{if(!s)return null;const l=r[s];if(!l)return null;for(const g of l.equivalenceClasses){const u=n[g.id];if(u)return u}return null},[s,r,n]);return t.jsxs(ie,{title:"Fleet by Node Class",size:"sm",children:[t.jsxs("div",{className:B.summary,"data-testid":"equivalence-summary",children:[t.jsx("span",{className:B.summaryLabel,children:"Equivalence summary"}),t.jsxs("span",{className:B.summaryValue,children:[c.eqClassCount," class",c.eqClassCount===1?"":"es",","," ",c.nodeCount," nodes total"]})]}),t.jsxs("div",{className:B.table,children:[t.jsxs("div",{className:`${B.row} ${B.header}`,children:[t.jsx("span",{children:"Class"}),t.jsx("span",{children:"Total"}),t.jsx("span",{children:"Eq"}),t.jsx("span",{children:"Eq · Q"}),t.jsx("span",{children:"Online"}),t.jsx("span",{children:"Deg"}),t.jsx("span",{children:"Disc"}),t.jsx("span",{children:"Attest"})]}),o.map(l=>t.jsxs("button",{className:`${B.row} ${B.rowButton} ${s===l.class?B.rowSelected:""}`,title:l.tooltip,"data-eq-count":l.eqCount,"data-eq-verdict":l.verdict,onClick:()=>i(s===l.class?null:l.class),children:[t.jsx("span",{className:B.label,children:l.label}),t.jsx("span",{children:l.total}),t.jsx("span",{className:B.eq,children:l.eqCount}),t.jsx("span",{className:l.verdict==="pass"?B.pillPass:l.verdict==="fail"?B.pillFail:B.pillPending,"data-testid":`verdict-${l.class}`,children:Ar[l.verdict]}),t.jsx("span",{className:B.ok,children:l.online}),t.jsx("span",{className:l.degraded>0?B.warn:"",children:l.degraded}),t.jsx("span",{className:l.offline>0?B.warn:"",children:l.offline}),t.jsx("span",{className:l.stale>0?B.bad:B.ok,children:l.stale>0?`${l.stale}â `:"â"})]},l.class))]}),s&&t.jsxs(t.Fragment,{children:[d?t.jsx(rP,{result:d}):t.jsx("div",{className:B.detail,"data-testid":"equivalence-empty",children:t.jsxs("span",{className:B.muted,children:["no cross-node-equivalence result yet for"," ",t.jsx("strong",{children:s}),"; the qualification harness will publish one once Ring 2 runs."]})}),t.jsx(oP,{nodes:e.filter(l=>l.class===s)})]})]})}const lP="_body_1tbjh_1",dP="_row_1tbjh_9",uP="_label_1tbjh_14",mP="_value_1tbjh_20",pP="_ok_1tbjh_24",hP="_bad_1tbjh_28",Te={body:lP,row:dP,label:uP,value:mP,ok:pP,bad:hP};function fP(){const e=x(r=>Object.values(r.nodes)),n=x(r=>r.tokenRingPasses),a=e.find(r=>r.tokenHeld),s=n[0],i=s&&Date.now()-s.passedAt.getTime()>6e4;return t.jsx(ie,{title:"Token Ring",size:"sm",variant:i?"warning":"default",children:t.jsxs("div",{className:Te.body,children:[t.jsxs("div",{className:Te.row,children:[t.jsx("span",{className:Te.label,children:"Holder"}),t.jsx("span",{className:Te.value,children:a?.id??"â"})]}),t.jsxs("div",{className:Te.row,children:[t.jsx("span",{className:Te.label,children:"Sequence"}),t.jsxs("span",{className:Te.value,children:["#",s?.sequence??0]})]}),t.jsxs("div",{className:Te.row,children:[t.jsx("span",{className:Te.label,children:"Last pass"}),t.jsx("span",{className:Te.value,children:s?s.passedAt.toISOString().slice(11,19):"â"})]}),t.jsxs("div",{className:Te.row,children:[t.jsx("span",{className:Te.label,children:"State"}),t.jsx("span",{className:`${Te.value} ${i?Te.bad:Te.ok}`,children:i?"STALLED":"CYCLING"})]})]})})}const gP="_deck_4ylrr_1",_P="_deckHeader_4ylrr_13",yP="_kicker_4ylrr_23",vP="_liveBadge_4ylrr_24",bP="_tab_4ylrr_25",jP="_title_4ylrr_37",xP="_tabs_4ylrr_55",IP="_tabActive_4ylrr_80",
69wP="_tabPanel_4ylrr_110",NP="_controlGrid_4ylrr_116",SP="_stack_4ylrr_117",qe={deck:gP,deckHeader:_P,kicker:yP,liveBadge:vP,tab:bP,title:jP,tabs:xP,tabActive:IP,tabPanel:wP,controlGrid:NP,stack:SP},CP=[{id:"control",label:"Control Loop",description:"ProcessState -> advisory -> decision -> outcome"},{id:"fleet",label:"Fleet",description:"node classes, equipment, selected node"},{id:"trust",label:"Trust",description:"attestation and token-ring posture"}];function RP(){const[e,n]=h.useState("control");return t.jsxs("div",{className:qe.deck,"data-testid":"operator-presentation-deck",children:[t.jsxs("div",{className:qe.deckHeader,children:[t.jsxs("div",{children:[t.jsx("span",{className:qe.kicker,children:"ORNL DEMO MODE"}),t.jsx("h2",{className:qe.title,children:"Operator Mission Deck"})]}),t.jsx("span",{className:qe.liveBadge,children:"MOCK/LIVE READY"})]}),t.jsx("div",{className:qe.tabs,role:"tablist","aria-label":"Operator presentation deck",children:CP.map(a=>t.jsxs("button",{type:"button",role:"tab","aria-selected":e===a.id,className:`${qe.tab} ${e===a.id?qe.tabActive:""}`,onClick:()=>n(a.id),children:[t.jsx("span",{children:a.label}),t.jsx("small",{children:a.description})]},a.id))}),t.jsxs("div",{className:qe.tabPanel,children:[e==="control"&&t.jsxs("section",{className:qe.controlGrid,"aria-label":"Control loop",children:[t.jsx(Er,{compact:!0}),t.jsx(Nr,{compact:!0}),t.jsx(Pr,{compact:!0})]}),e==="fleet"&&t.jsxs("section",{className:qe.stack,"aria-label":"Fleet",children:[t.jsx(fa,{}),t.jsx(cP,{}),t.jsx(ga,{})]}),e==="trust"&&t.jsxs("section",{className:qe.stack,"aria-label":"Trust",children:[t.jsx(fP,{}),t.jsx(wk,{})]})]})]})}function EP(e){return null}function kP(e,n){return e?e==="offline"?"disconnected":"connected":n}function PP(e,n){return e?!1:n}function Ft(e){return{format:"enveloped",type:"node.update",eventId:`fixture-projection-${e}`,topic:"arc.visual.fixture",entityType:"Node/1",roleProjection:"arc-operator",correlationId:"fixture-projection-correlation",causationId:e===1?"fixture-root":`fixture-projection-${e-1}`,traceId:"fixture-projection-trace",observedAt:new Date("2026-06-27T12:00:00.000Z"),emittedAt:new Date("2026-06-27T12:00:00.100Z"),freshnessTtlMs:5e3,sequence:e,replayCursor:`fixture:projection:${e}`,stale:!1}}function TP(e,n){switch(n.resetStreamHealth(),e){case"fresh":n.recordStreamFrame(Ft(1));break;case"stale":n.recordStreamFrame({...Ft(1),stale:!0});break;case"gap":n.recordStreamFrame(Ft(1)),n.recordStreamFrame(Ft(3));break;case"schema":n.recordStreamFrame({...Ft(1),type:"route.execution.unknown",issue:{kind:"unknown-frame-type",message:"Fixture schema mismatch for projection-state visual QA.",type:"route.execution.unknown",eventId:"fixture-projection-1",sequence:1,at:new Date("2026-06-27T12:00:00.200Z")}});break}}const AP="_deferredRoleBanner_1a6zc_1",LP="_paperReviewEvidenceSurface_1a6zc_12",ai={deferredRoleBanner:AP,paperReviewEvidenceSurface:LP},si=!1,OP={metallurgist:"ornl-metallurgist",operator:"arc-operator","site-manager":"node-site-manager","line-technician":"line-technician"};function $P(e){const n=new URLSearchParams(e);return n.get("visual-qa")==="roles"&&n.get("arc-mode")==="paper-review"}function MP(e,n){return null}function un({route:e}){const a=OP[e],s=h.useRef(null),i=h.useRef(Date.now()),[r,c]=h.useState(!1),o=x(q=>q.setActiveRole),d=x(q=>q.selectedNodeId),l=x(q=>q.setViewState),g=x(q=>q.recordStreamFrame),u=x(q=>q.resetStreamHealth),_=x(q=>q.selectedReceiptLink),m=x(q=>q.selectReceiptLink),v=$e(),p=h.useRef(null),f=h.useMemo(()=>EP(v.search),[v.search]),b=h.useMemo(()=>Sy(v.search),[v.search]),w=h.useMemo(()=>$P(v.search),[v.search]),j=v.state?.deferredRoleDowngrade??null;h.useEffect(()=>{o(a)},[a,o]),h.useEffect(()=>{ot("ui_role_shell_load_seconds",Ia(i.current),{role:a,route:e})},[a,e]),h.useEffect(()=>{e==="operator"&&l({longitude:-114.5,latitude:34.2,zoom:2.15,pitch:0,bearing:0,transitionDuration:0})},[e,l]),h.useEffect(()=>{!b||or(_,b)||m(b)},[b,_,m]);const C=h.useCallback(()=>s.current?.focus(),[]),N=h.useCallback(()=>c(q=>!q),[]);vy({onFocusCommandLine:C,onToggleHelp:N,enabled:!r});const{connectionState:T,reconnect:R}=Ji({url:MP(),debug:si,enableEnvelopeBridge:xi});tr({enabled:!0,debug:si}),h.useEffect(()=>{if(f){TP(f,{recordStreamFrame:g,resetStreamHealth:u}),p.current=f;return}p.current&&(u(),p.current=null)},[f,g,u]);const E=kP(f,T),A=PP(f,!0),V=h.useMemo(()=>t.jsx(lr,{role:a,connectionState:E,isMockMode:A}),[a,E,A]),re=h.useMemo(()=>{switch(e){case"metallurgist":return t.jsxs(t.Fragment,{children:[V,t.jsx(Us,{role:a,connectionState:E,isMockMode:A}),t.jsx(ga,{}),d&&t.jsx(yR,{nodeId:d}),t.jsx(fa,{}),t.jsx(c1,{}),t.jsx(_1,{}),t.jsx(Er,{}),t.jsx(Nr,{}),t.jsx(Pr,{}),t.jsx(Vi,{}),t.jsx("div",{className:w?ai.paperReviewEvidenceSurface:void 0,"data-arc-mode":w?"paper-review":void 0,"data-testid":w?"paper-review-evidence-surface":"operational-evidence-surface",children:t.jsx(YS,{})})]});case"operator":return t.jsxs(t.Fragment,{children:[V,t.jsx(Us,{role:a,connectionState:E,isMockMode:A}),t.jsx(RP,{}),t.jsx(zi,{})]});
69case"site-manager":return t.jsxs(t.Fragment,{children:[V,t.jsx(fa,{}),t.jsx(CC,{}),t.jsx(ga,{})]});case"line-technician":return t.jsxs(t.Fragment,{children:[V,t.jsx($C,{}),t.jsx(UC,{}),t.jsx(eR,{}),t.jsx(cR,{})]})}},[a,E,A,V,e,d,w]);return t.jsxs(Zw,{children:[j&&t.jsxs("div",{role:"status","data-testid":"deferred-role-banner",className:ai.deferredRoleBanner,children:[j.toUpperCase().replace(/-/g," ")," â Phase Bravo role pending (post-T2). Showing ARC operator view in the meantime."]}),t.jsx(Ij,{header:t.jsx(hx,{connectionState:E,isMockMode:A,onReconnect:R}),globe:t.jsx(Mi,{}),sidebar:re,eventLog:t.jsx(U0,{}),commandLine:t.jsx(gr,{ref:s})}),t.jsx(Cw,{isOpen:r,onClose:()=>c(!1)})]})}const DP="_header_t7x61_16",qt={header:DP},BP=[{cmd:"help",desc:"Show all available commands"},{cmd:"role metallurgist",desc:"Switch to the ORNL Metallurgist role"},{cmd:"facilities",desc:"List facilities in the fleet"},{cmd:"nodes --class production",desc:"List Production Nodes"},{cmd:"nodes --class scout",desc:"List Scout / Tactical Edge Nodes"},{cmd:"jobs",desc:"List all jobs"},{cmd:"jobs --status sintering",desc:"Filter jobs by lifecycle state"},{cmd:"signal",desc:"Stream recent ARC Signal events"},{cmd:"signal --node ALPHA-node-001",desc:"Signal events for one node"},{cmd:"downlink JOB-000042",desc:"Downlink status for a job"},{cmd:"evidence JOB-000042",desc:"Open the evidence package viewer"},{cmd:"triage",desc:"Line-technician triage queue"},{cmd:"attest ALPHA-node-004",desc:"Trigger fresh attestation"},{cmd:"fly ornl",desc:"Fly to ORNL hub"},{cmd:"fly alpha",desc:"Fly to Facility ALPHA"}];function FP(){return t.jsxs("div",{className:qt.container,children:[t.jsxs("header",{className:qt.header,children:[t.jsx("h1",{children:"ARCNet Command Line â Sandbox"}),t.jsxs("p",{children:["Try the manufacturing command set. Role-aware: some commands require elevation via ",t.jsx("code",{children:"role <role>"}),"."]})]}),t.jsx("section",{className:qt.examples,children:BP.map(e=>t.jsxs("div",{className:qt.example,children:[t.jsx("code",{children:e.cmd}),t.jsx("span",{children:e.desc})]},e.cmd))}),t.jsx("section",{className:qt.cli,children:t.jsx(gr,{})})]})}function qP(){const e=$e(),n=We();return h.useEffect(()=>{if(typeof window>"u")return;const s=window.location.hash.match(/^#\/?(metallurgist|operator|site-manager|line-technician)$/);if(s){const i=`/${s[1]}`;window.history.replaceState(null,"",i),n(i,{replace:!0})}},[e,n]),null}function HP(){return h.useEffect(()=>Gc(),[]),null}di(document.getElementById("root")).render(t.jsx(h.StrictMode,{children:t.jsx(ic,{children:t.jsxs(mc,{children:[t.jsx(HP,{}),t.jsx(qP,{}),t.jsxs(Zo,{children:[t.jsx(we,{path:"/",element:t.jsx(yu,{})}),t.jsx(we,{path:"/login",element:t.jsx(Gu,{})}),t.jsx(we,{path:"/cli-demo",element:t.jsx(FP,{})}),t.jsxs(we,{element:t.jsx(wc,{}),children:[t.jsx(we,{path:"/role-chooser",element:t.jsx(Pm,{})}),t.jsx(we,{path:"/docs",element:t.jsx(nm,{})}),t.jsx(we,{path:"/network-explorer",element:t.jsx(jf,{})}),t.jsx(we,{path:"/diagnostics",element:t.jsx(Tg,{})}),t.jsx(we,{path:"/jona",element:t.jsx(My,{})}),t.jsx(we,{path:"/jona/cockpit",element:t.jsx(Fy,{})}),t.jsx(we,{path:"/first-light",element:t.jsx(Ov,{})}),t.jsx(we,{path:"/flow",element:t.jsx(dj,{})}),t.jsx(we,{path:"/metallurgist",element:t.jsx(un,{route:"metallurgist"})}),t.jsx(we,{path:"/operator",element:t.jsx(un,{route:"operator"})}),t.jsx(we,{path:"/site-manager",element:t.jsx(un,{route:"site-manager"})}),t.jsx(we,{path:"/line-technician",element:t.jsx(un,{route:"line-technician"})})]}),t.jsx(we,{path:"/console",element:t.jsx(Ct,{to:"/role-chooser",replace:!0})}),t.jsx(we,{path:"*",element:t.jsx(Ct,{to:"/",replace:!0})})]})]})})}));export{x as a,zP as b,Si as d,Kv as f,t as j,ha as l,Qv as p,Ue as u}; 70//# sourceMappingURL=index-C5TzDFSt.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.