@devqubit/ui 0.1.10-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/api/client.d.ts +72 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/index.d.ts +8 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/components/GroupsTable/GroupsTable.d.ts +6 -0
- package/dist/components/GroupsTable/GroupsTable.d.ts.map +1 -0
- package/dist/components/GroupsTable/index.d.ts +3 -0
- package/dist/components/GroupsTable/index.d.ts.map +1 -0
- package/dist/components/Layout/Layout.d.ts +18 -0
- package/dist/components/Layout/Layout.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts +3 -0
- package/dist/components/Layout/index.d.ts.map +1 -0
- package/dist/components/ProjectsTable/ProjectsTable.d.ts +7 -0
- package/dist/components/ProjectsTable/ProjectsTable.d.ts.map +1 -0
- package/dist/components/ProjectsTable/index.d.ts +3 -0
- package/dist/components/ProjectsTable/index.d.ts.map +1 -0
- package/dist/components/RunsTable/RunsTable.d.ts +14 -0
- package/dist/components/RunsTable/RunsTable.d.ts.map +1 -0
- package/dist/components/RunsTable/index.d.ts +3 -0
- package/dist/components/RunsTable/index.d.ts.map +1 -0
- package/dist/components/Table/Table.d.ts +16 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/ui/forms.d.ts +18 -0
- package/dist/components/ui/forms.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +5 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/primitives.d.ts +66 -0
- package/dist/components/ui/primitives.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +109 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2160 -0
- package/dist/pages/ArtifactPage.d.ts +5 -0
- package/dist/pages/ArtifactPage.d.ts.map +1 -0
- package/dist/pages/DiffPage.d.ts +5 -0
- package/dist/pages/DiffPage.d.ts.map +1 -0
- package/dist/pages/GroupDetailPage.d.ts +5 -0
- package/dist/pages/GroupDetailPage.d.ts.map +1 -0
- package/dist/pages/GroupsPage.d.ts +5 -0
- package/dist/pages/GroupsPage.d.ts.map +1 -0
- package/dist/pages/ProjectsPage.d.ts +5 -0
- package/dist/pages/ProjectsPage.d.ts.map +1 -0
- package/dist/pages/RunDetailPage.d.ts +5 -0
- package/dist/pages/RunDetailPage.d.ts.map +1 -0
- package/dist/pages/RunsPage.d.ts +5 -0
- package/dist/pages/RunsPage.d.ts.map +1 -0
- package/dist/pages/SearchPage.d.ts +5 -0
- package/dist/pages/SearchPage.d.ts.map +1 -0
- package/dist/pages/index.d.ts +9 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/router/index.d.ts +5 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +171 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/index.d.ts +138 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +55 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),T=require("react-router-dom");var Fe={exports:{}},ve={};var Ns;function yr(){if(Ns)return ve;Ns=1;var r=v,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function m(a,u,x){var g,j={},w=null,H=null;x!==void 0&&(w=""+x),u.key!==void 0&&(w=""+u.key),u.ref!==void 0&&(H=u.ref);for(g in u)i.call(u,g)&&!o.hasOwnProperty(g)&&(j[g]=u[g]);if(a&&a.defaultProps)for(g in u=a.defaultProps,u)j[g]===void 0&&(j[g]=u[g]);return{$$typeof:t,type:a,key:w,ref:H,props:j,_owner:d.current}}return ve.Fragment=n,ve.jsx=m,ve.jsxs=m,ve}var be={};var ys;function _r(){return ys||(ys=1,process.env.NODE_ENV!=="production"&&(function(){var r=v,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),S=Symbol.iterator,Z="@@iterator";function K(s){if(s===null||typeof s!="object")return null;var l=S&&s[S]||s[Z];return typeof l=="function"?l:null}var J=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(s){{for(var l=arguments.length,h=new Array(l>1?l-1:0),p=1;p<l;p++)h[p-1]=arguments[p];le("error",s,h)}}function le(s,l,h){{var p=J.ReactDebugCurrentFrame,E=p.getStackAddendum();E!==""&&(l+="%s",h=h.concat([E]));var P=h.map(function(R){return String(R)});P.unshift("Warning: "+l),Function.prototype.apply.call(console[s],console,P)}}var oe=!1,ee=!1,Se=!1,Ee=!1,de=!1,je;je=Symbol.for("react.module.reference");function Ie(s){return!!(typeof s=="string"||typeof s=="function"||s===i||s===o||de||s===d||s===x||s===g||Ee||s===H||oe||ee||Se||typeof s=="object"&&s!==null&&(s.$$typeof===w||s.$$typeof===j||s.$$typeof===m||s.$$typeof===a||s.$$typeof===u||s.$$typeof===je||s.getModuleId!==void 0))}function Ue(s,l,h){var p=s.displayName;if(p)return p;var E=l.displayName||l.name||"";return E!==""?h+"("+E+")":h}function Pe(s){return s.displayName||"Context"}function _(s){if(s==null)return null;if(typeof s.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case i:return"Fragment";case n:return"Portal";case o:return"Profiler";case d:return"StrictMode";case x:return"Suspense";case g:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case a:var l=s;return Pe(l)+".Consumer";case m:var h=s;return Pe(h._context)+".Provider";case u:return Ue(s,s.render,"ForwardRef");case j:var p=s.displayName||null;return p!==null?p:_(s.type)||"Memo";case w:{var E=s,P=E._payload,R=E._init;try{return _(R(P))}catch{return null}}}return null}var C=Object.assign,ne=0,pe,Te,ae,ss,rs,ts,ns;function as(){}as.__reactDisabledLog=!0;function Ks(){{if(ne===0){pe=console.log,Te=console.info,ae=console.warn,ss=console.error,rs=console.group,ts=console.groupCollapsed,ns=console.groupEnd;var s={configurable:!0,enumerable:!0,value:as,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}ne++}}function Js(){{if(ne--,ne===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},s,{value:pe}),info:C({},s,{value:Te}),warn:C({},s,{value:ae}),error:C({},s,{value:ss}),group:C({},s,{value:rs}),groupCollapsed:C({},s,{value:ts}),groupEnd:C({},s,{value:ns})})}ne<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Me=J.ReactCurrentDispatcher,qe;function Ce(s,l,h){{if(qe===void 0)try{throw Error()}catch(E){var p=E.stack.trim().match(/\n( *(at )?)/);qe=p&&p[1]||""}return`
|
|
2
|
+
`+qe+s}}var Ge=!1,ke;{var Xs=typeof WeakMap=="function"?WeakMap:Map;ke=new Xs}function is(s,l){if(!s||Ge)return"";{var h=ke.get(s);if(h!==void 0)return h}var p;Ge=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=Me.current,Me.current=null,Ks();try{if(l){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(V){p=V}Reflect.construct(s,[],R)}else{try{R.call()}catch(V){p=V}s.call(R.prototype)}}else{try{throw Error()}catch(V){p=V}s()}}catch(V){if(V&&p&&typeof V.stack=="string"){for(var b=V.stack.split(`
|
|
3
|
+
`),M=p.stack.split(`
|
|
4
|
+
`),F=b.length-1,$=M.length-1;F>=1&&$>=0&&b[F]!==M[$];)$--;for(;F>=1&&$>=0;F--,$--)if(b[F]!==M[$]){if(F!==1||$!==1)do if(F--,$--,$<0||b[F]!==M[$]){var z=`
|
|
5
|
+
`+b[F].replace(" at new "," at ");return s.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",s.displayName)),typeof s=="function"&&ke.set(s,z),z}while(F>=1&&$>=0);break}}}finally{Ge=!1,Me.current=P,Js(),Error.prepareStackTrace=E}var he=s?s.displayName||s.name:"",ie=he?Ce(he):"";return typeof s=="function"&&ke.set(s,ie),ie}function Qs(s,l,h){return is(s,!1)}function Zs(s){var l=s.prototype;return!!(l&&l.isReactComponent)}function De(s,l,h){if(s==null)return"";if(typeof s=="function")return is(s,Zs(s));if(typeof s=="string")return Ce(s);switch(s){case x:return Ce("Suspense");case g:return Ce("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case u:return Qs(s.render);case j:return De(s.type,l,h);case w:{var p=s,E=p._payload,P=p._init;try{return De(P(E),l,h)}catch{}}}return""}var ge=Object.prototype.hasOwnProperty,cs={},ls=J.ReactDebugCurrentFrame;function Ae(s){if(s){var l=s._owner,h=De(s.type,s._source,l?l.type:null);ls.setExtraStackFrame(h)}else ls.setExtraStackFrame(null)}function er(s,l,h,p,E){{var P=Function.call.bind(ge);for(var R in s)if(P(s,R)){var b=void 0;try{if(typeof s[R]!="function"){var M=Error((p||"React class")+": "+h+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw M.name="Invariant Violation",M}b=s[R](l,R,p,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(F){b=F}b&&!(b instanceof Error)&&(Ae(E),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",p||"React class",h,R,typeof b),Ae(null)),b instanceof Error&&!(b.message in cs)&&(cs[b.message]=!0,Ae(E),k("Failed %s type: %s",h,b.message),Ae(null))}}}var sr=Array.isArray;function Ve(s){return sr(s)}function rr(s){{var l=typeof Symbol=="function"&&Symbol.toStringTag,h=l&&s[Symbol.toStringTag]||s.constructor.name||"Object";return h}}function tr(s){try{return os(s),!1}catch{return!0}}function os(s){return""+s}function ds(s){if(tr(s))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rr(s)),os(s)}var us=J.ReactCurrentOwner,nr={key:!0,ref:!0,__self:!0,__source:!0},hs,xs;function ar(s){if(ge.call(s,"ref")){var l=Object.getOwnPropertyDescriptor(s,"ref").get;if(l&&l.isReactWarning)return!1}return s.ref!==void 0}function ir(s){if(ge.call(s,"key")){var l=Object.getOwnPropertyDescriptor(s,"key").get;if(l&&l.isReactWarning)return!1}return s.key!==void 0}function cr(s,l){typeof s.ref=="string"&&us.current}function lr(s,l){{var h=function(){hs||(hs=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};h.isReactWarning=!0,Object.defineProperty(s,"key",{get:h,configurable:!0})}}function or(s,l){{var h=function(){xs||(xs=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};h.isReactWarning=!0,Object.defineProperty(s,"ref",{get:h,configurable:!0})}}var dr=function(s,l,h,p,E,P,R){var b={$$typeof:t,type:s,key:l,ref:h,props:R,_owner:P};return b._store={},Object.defineProperty(b._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(b,"_self",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.defineProperty(b,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(b.props),Object.freeze(b)),b};function ur(s,l,h,p,E){{var P,R={},b=null,M=null;h!==void 0&&(ds(h),b=""+h),ir(l)&&(ds(l.key),b=""+l.key),ar(l)&&(M=l.ref,cr(l,E));for(P in l)ge.call(l,P)&&!nr.hasOwnProperty(P)&&(R[P]=l[P]);if(s&&s.defaultProps){var F=s.defaultProps;for(P in F)R[P]===void 0&&(R[P]=F[P])}if(b||M){var $=typeof s=="function"?s.displayName||s.name||"Unknown":s;b&&lr(R,$),M&&or(R,$)}return dr(s,b,M,E,p,us.current,R)}}var We=J.ReactCurrentOwner,ms=J.ReactDebugCurrentFrame;function ue(s){if(s){var l=s._owner,h=De(s.type,s._source,l?l.type:null);ms.setExtraStackFrame(h)}else ms.setExtraStackFrame(null)}var Ye;Ye=!1;function ze(s){return typeof s=="object"&&s!==null&&s.$$typeof===t}function fs(){{if(We.current){var s=_(We.current.type);if(s)return`
|
|
6
|
+
|
|
7
|
+
Check the render method of \``+s+"`."}return""}}function hr(s){return""}var js={};function xr(s){{var l=fs();if(!l){var h=typeof s=="string"?s:s.displayName||s.name;h&&(l=`
|
|
8
|
+
|
|
9
|
+
Check the top-level render call using <`+h+">.")}return l}}function ps(s,l){{if(!s._store||s._store.validated||s.key!=null)return;s._store.validated=!0;var h=xr(l);if(js[h])return;js[h]=!0;var p="";s&&s._owner&&s._owner!==We.current&&(p=" It was passed a child from "+_(s._owner.type)+"."),ue(s),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,p),ue(null)}}function gs(s,l){{if(typeof s!="object")return;if(Ve(s))for(var h=0;h<s.length;h++){var p=s[h];ze(p)&&ps(p,l)}else if(ze(s))s._store&&(s._store.validated=!0);else if(s){var E=K(s);if(typeof E=="function"&&E!==s.entries)for(var P=E.call(s),R;!(R=P.next()).done;)ze(R.value)&&ps(R.value,l)}}}function mr(s){{var l=s.type;if(l==null||typeof l=="string")return;var h;if(typeof l=="function")h=l.propTypes;else if(typeof l=="object"&&(l.$$typeof===u||l.$$typeof===j))h=l.propTypes;else return;if(h){var p=_(l);er(h,s.props,"prop",p,s)}else if(l.PropTypes!==void 0&&!Ye){Ye=!0;var E=_(l);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof l.getDefaultProps=="function"&&!l.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fr(s){{for(var l=Object.keys(s.props),h=0;h<l.length;h++){var p=l[h];if(p!=="children"&&p!=="key"){ue(s),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",p),ue(null);break}}s.ref!==null&&(ue(s),k("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}}var vs={};function bs(s,l,h,p,E,P){{var R=Ie(s);if(!R){var b="";(s===void 0||typeof s=="object"&&s!==null&&Object.keys(s).length===0)&&(b+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var M=hr();M?b+=M:b+=fs();var F;s===null?F="null":Ve(s)?F="array":s!==void 0&&s.$$typeof===t?(F="<"+(_(s.type)||"Unknown")+" />",b=" Did you accidentally export a JSX literal instead of a component?"):F=typeof s,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",F,b)}var $=ur(s,l,h,E,P);if($==null)return $;if(R){var z=l.children;if(z!==void 0)if(p)if(Ve(z)){for(var he=0;he<z.length;he++)gs(z[he],s);Object.freeze&&Object.freeze(z)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else gs(z,s)}if(ge.call(l,"key")){var ie=_(s),V=Object.keys(l).filter(function(Nr){return Nr!=="key"}),He=V.length>0?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}";if(!vs[ie+He]){var br=V.length>0?"{"+V.join(": ..., ")+": ...}":"{}";k(`A props object containing a "key" prop is being spread into JSX:
|
|
10
|
+
let props = %s;
|
|
11
|
+
<%s {...props} />
|
|
12
|
+
React keys must be passed directly to JSX without using spread:
|
|
13
|
+
let props = %s;
|
|
14
|
+
<%s key={someKey} {...props} />`,He,ie,br,ie),vs[ie+He]=!0}}return s===i?fr($):mr($),$}}function jr(s,l,h){return bs(s,l,h,!0)}function pr(s,l,h){return bs(s,l,h,!1)}var gr=pr,vr=jr;be.Fragment=i,be.jsx=gr,be.jsxs=vr})()),be}var _s;function Rr(){return _s||(_s=1,process.env.NODE_ENV==="production"?Fe.exports=yr():Fe.exports=_r()),Fe.exports}var e=Rr();class xe extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}class Rs{baseUrl;headers;constructor(t={}){this.baseUrl=t.baseUrl??"",this.headers={"Content-Type":"application/json",...t.headers}}async request(t,n,i={}){let d=`${this.baseUrl}${n}`;if(i.params){const m=new URLSearchParams;Object.entries(i.params).forEach(([u,x])=>{x!=null&&x!==""&&m.set(u,String(x))});const a=m.toString();a&&(d+=`?${a}`)}const o=await fetch(d,{method:t,headers:this.headers,body:i.body?JSON.stringify(i.body):void 0});if(!o.ok){const m=await o.json().catch(()=>({detail:"Unknown error"}));throw new xe(o.status,m.detail||o.statusText)}if(!(o.status===204||o.headers.get("content-length")==="0"))return o.json()}async getCapabilities(){return this.request("GET","/api/v1/capabilities")}async listRuns(t){return this.request("GET","/api/runs",{params:t})}async getRun(t){return this.request("GET",`/api/runs/${t}`)}async deleteRun(t){await this.request("DELETE",`/api/runs/${t}`)}async setBaseline(t,n){return this.request("POST",`/api/projects/${t}/baseline/${n}`,{params:{redirect:"false"}})}async listProjects(t){return this.request("GET","/api/projects",{params:t})}async listGroups(t){return this.request("GET","/api/groups",{params:t})}async getGroup(t){return this.request("GET",`/api/groups/${t}`)}async getDiff(t,n){return this.request("GET","/api/diff",{params:{a:t,b:n}})}async getArtifact(t,n){return this.request("GET",`/api/runs/${t}/artifacts/${n}`)}getArtifactDownloadUrl(t,n){return`${this.baseUrl}/api/runs/${t}/artifacts/${n}/raw`}}const ws=new Rs,Ss=v.createContext(null);function Es({children:r,api:t=ws,initialWorkspace:n=null}){const[i,d]=v.useState(null),[o,m]=v.useState(n);return v.useEffect(()=>{t.getCapabilities().then(d).catch(console.error)},[t]),e.jsx(Ss.Provider,{value:{api:t,capabilities:i,currentWorkspace:o,setCurrentWorkspace:m},children:r})}function W(){const r=v.useContext(Ss);if(!r)throw new Error("useApp must be used within AppProvider");return r}function ce(r,t=[]){const[n,i]=v.useState({data:null,loading:!0,error:null}),d=v.useRef(!0),o=v.useRef(r);o.current=r;const m=v.useCallback(async()=>{i(a=>({...a,loading:!0,error:null}));try{const a=await o.current();d.current&&i({data:a,loading:!1,error:null})}catch(a){d.current&&i({data:null,loading:!1,error:a instanceof xe?a:new xe(500,String(a))})}},[]);return v.useEffect(()=>(d.current=!0,m(),()=>{d.current=!1}),t),{...n,refetch:m}}function Ke(r){const{api:t,currentWorkspace:n}=W();return ce(()=>t.listRuns({...r,workspace:n?.id}),[t,n?.id,r?.project,r?.status,r?.q,r?.limit])}function Je(r){const{api:t}=W();return ce(async()=>{const{run:n}=await t.getRun(r);return n},[t,r])}function Re(){const{api:r,currentWorkspace:t}=W();return ce(async()=>{const{projects:n}=await r.listProjects({workspace:t?.id});return n},[r,t?.id])}function Ps(r){const{api:t,currentWorkspace:n}=W();return ce(async()=>{const{groups:i}=await t.listGroups({...r,workspace:n?.id});return i},[t,n?.id,r?.project])}function Ts(r){const{api:t}=W();return ce(()=>t.getGroup(r),[t,r])}function Cs(r,t){const{api:n}=W();return ce(()=>n.getDiff(r,t),[n,r,t])}function ks(r,t){const{api:n}=W();return ce(()=>n.getArtifact(r,t),[n,r,t])}function me(r){const[t,n]=v.useState(!1),[i,d]=v.useState(null);return{mutate:v.useCallback(async(...m)=>{n(!0),d(null);try{return await r(...m)}catch(a){const u=a instanceof xe?a:new xe(500,String(a));throw d(u),u}finally{n(!1)}},[r]),loading:t,error:i}}function Y(r){return r?.slice(0,8)??""}function Oe(r){return r?.slice(0,12)??"N/A"}function _e(r){const t=new Date(r),i=Math.floor((new Date().getTime()-t.getTime())/1e3);if(i<60)return"just now";if(i<3600){const o=Math.floor(i/60);return`${o} minute${o!==1?"s":""} ago`}if(i<86400){const o=Math.floor(i/3600);return`${o} hour${o!==1?"s":""} ago`}if(i<2592e3){const o=Math.floor(i/86400);return`${o} day${o!==1?"s":""} ago`}if(i<31536e3){const o=Math.floor(i/2592e3);return`${o} month${o!==1?"s":""} ago`}const d=Math.floor(i/31536e3);return`${d} year${d!==1?"s":""} ago`}function Ds(r,t=6){return typeof r!="number"||isNaN(r)?String(r):Number(r.toPrecision(t)).toString()}function ye(r){return r<1024?`${r} bytes`:r<1048576?`${(r/1024).toFixed(1)} KB`:`${(r/1048576).toFixed(1)} MB`}function As(r){return JSON.stringify(r,null,2)}function Fs(r,t=60){return r?r.length<=t?r:r.slice(0,t-3)+"...":""}function wr(r,t){const n=new URLSearchParams;Object.entries(t).forEach(([d,o])=>{o!=null&&o!==""&&n.set(d,String(o))});const i=n.toString();return i?`${r}?${i}`:r}function L(...r){return r.filter(Boolean).join(" ")}const Sr=[{href:"/runs",label:"Runs",matchPaths:["/runs"]},{href:"/projects",label:"Projects",matchPaths:["/projects"]},{href:"/groups",label:"Groups",matchPaths:["/groups"]},{href:"/diff",label:"Compare",matchPaths:["/diff"]},{href:"/search",label:"Search",matchPaths:["/search"]}],Os=v.createContext(null);function Er({config:r,children:t}){return e.jsx(Os.Provider,{value:r,children:t})}function $s(){return v.useContext(Os)}function q({children:r,config:t}){const n=T.useLocation(),d={...$s(),...t},o=d?.navLinks??Sr,m=[...d?.prependNavLinks??[],...o,...d?.appendNavLinks??[]],a=d?.logo??{text:"devqubit",icon:"⚛"},u=x=>x.matchPaths?x.matchPaths.some(g=>n.pathname.startsWith(g)):n.pathname===x.href;return e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("header",{className:"bg-gray-900 h-14 sticky top-0 z-50 border-b border-gray-800",children:e.jsxs("div",{className:"max-w-container mx-auto px-6 h-full flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsxs(T.Link,{to:"/",className:"text-lg font-semibold text-primary hover:text-primary-light flex items-center gap-2 transition-colors hover:no-underline",children:[a.icon&&e.jsx("span",{className:"text-xl",children:a.icon}),a.text]}),e.jsx("nav",{className:"flex gap-1",children:m.map(x=>e.jsx(T.Link,{to:x.href,className:L("px-3 py-1.5 rounded-md text-sm font-medium transition-all duration-150 hover:no-underline",u(x)?"text-white bg-white/10":"text-gray-400 hover:text-white hover:bg-white/5"),children:x.label},x.href))})]}),e.jsx("div",{className:"flex items-center gap-4",children:d?.headerRight})]})}),e.jsx("main",{className:"max-w-container mx-auto p-6 fade-in",children:r})]})}function fe({title:r,subtitle:t,actions:n}){return e.jsxs("div",{className:"flex items-start justify-between mb-6 gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-gray-900 flex items-center gap-2 flex-wrap",children:r}),t&&e.jsx("p",{className:"text-sm text-muted mt-1",children:t})]}),n&&e.jsx("div",{className:"flex gap-2",children:n})]})}function B({variant:r="gray",className:t,children:n,...i}){return e.jsx("span",{className:L("badge",`badge-${r}`,t),...i,children:n})}const O=v.forwardRef(({variant:r="secondary",size:t="default",loading:n,className:i,children:d,disabled:o,...m},a)=>e.jsxs("button",{ref:a,className:L("btn",r==="ghost-danger"?"btn-ghost-danger":`btn-${r}`,t==="sm"&&"btn-sm",i),disabled:o||n,...m,children:[n&&e.jsx(G,{}),d]}));O.displayName="Button";function N({className:r,children:t,...n}){return e.jsx("div",{className:L("card",r),...n,children:t})}function D({className:r,children:t,...n}){return e.jsx("div",{className:L("card-header",r),...n,children:t})}function A({className:r,children:t,...n}){return e.jsx("h3",{className:L("card-title",r),...n,children:t})}function Pr({variant:r="info",className:t,children:n,...i}){return e.jsx("div",{className:L("alert",`alert-${r}`,t),...i,children:n})}function G({className:r,...t}){return e.jsx("span",{className:L("spinner",r),...t})}function te({message:r,hint:t,className:n,...i}){return e.jsxs("div",{className:L("empty-state",n),...i,children:[e.jsx("p",{children:r}),t&&e.jsx("p",{className:"text-sm text-muted mt-2",children:t})]})}function $e({items:r,className:t,...n}){return e.jsx("dl",{className:L("kv-list",t),...n,children:r.map(({label:i,value:d})=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{children:i}),e.jsx("dd",{children:d})]},i))})}function Xe({open:r,onClose:t,title:n,children:i,actions:d}){return r?e.jsx("div",{className:L("modal-backdrop",r&&"active"),onClick:o=>o.target===o.currentTarget&&t(),children:e.jsxs("div",{className:"modal",onClick:o=>o.stopPropagation(),children:[e.jsx("h3",{className:"modal-title",children:n}),e.jsx("div",{className:"modal-body",children:i}),d&&e.jsx("div",{className:"modal-actions",children:d})]})}):null}function we({message:r,variant:t="info",visible:n,onClose:i}){if(!n)return null;const d={success:"✓",error:"✕",info:"i"}[t],o={success:"text-[#059669]",error:"text-[#DC4A4A]",info:"text-[#2563EB]"}[t];return e.jsxs("div",{className:"toast",onClick:i,children:[e.jsx("span",{className:L("mr-2 font-bold",o),children:d}),r]})}function X({children:r,className:t}){return e.jsx("div",{className:L("form-group",t),children:r})}function se({className:r,children:t,...n}){return e.jsx("label",{className:L("form-label",r),...n,children:t})}const Le=v.forwardRef(({className:r,...t},n)=>e.jsx("input",{ref:n,className:L("form-input",r),...t}));Le.displayName="Input";const re=v.forwardRef(({className:r,children:t,...n},i)=>e.jsx("select",{ref:i,className:L("form-input",r),...n,children:t}));re.displayName="Select";function Qe({children:r,className:t}){return e.jsx("div",{className:L("form-row",t),children:r})}function I({className:r,children:t,...n}){return e.jsx("table",{className:L("table",r),...n,children:t})}function Q({className:r,children:t,...n}){return e.jsx("thead",{className:r,...n,children:t})}function U({className:r,children:t,...n}){return e.jsx("tbody",{className:r,...n,children:t})}function f({className:r,children:t,...n}){return e.jsx("tr",{className:r,...n,children:t})}function y({className:r,children:t,...n}){return e.jsx("th",{className:r,...n,children:t})}function c({className:r,children:t,...n}){return e.jsx("td",{className:r,...n,children:t})}function Ze({status:r}){const t={FINISHED:"success",FAILED:"danger",RUNNING:"warning",UNKNOWN:"gray"}[r];return e.jsx(B,{variant:t,children:r})}function Be({runs:r,onDelete:t,loading:n,emptyHint:i,baselineRunId:d}){const[o,m]=v.useState(null),a=()=>{o&&t&&(t(o.run_id),m(null))};return r.length?e.jsxs(e.Fragment,{children:[e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Run ID"}),e.jsx(y,{children:"Name"}),e.jsx(y,{children:"Project"}),e.jsx(y,{children:"Status"}),e.jsx(y,{children:"Created"}),e.jsx(y,{children:"Actions"})]})}),e.jsx(U,{children:r.map(u=>e.jsxs(f,{children:[e.jsxs(c,{children:[e.jsx(T.Link,{to:`/runs/${u.run_id}`,className:"font-mono",children:Y(u.run_id)}),u.run_id===d&&e.jsx(B,{variant:"info",className:"ml-2",children:"Baseline"})]}),e.jsx(c,{children:u.run_name||"—"}),e.jsx(c,{children:u.project}),e.jsx(c,{children:e.jsx(Ze,{status:u.status})}),e.jsx(c,{className:"text-muted",children:_e(u.created_at)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T.Link,{to:`/runs/${u.run_id}`,children:e.jsx(O,{variant:"secondary",size:"sm",children:"View"})}),t&&e.jsx(O,{variant:"ghost-danger",size:"sm",onClick:()=>m(u),disabled:n,children:"Delete"})]})})]},u.run_id))})]}),e.jsxs(Xe,{open:!!o,onClose:()=>m(null),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(O,{variant:"secondary",onClick:()=>m(null),children:"Cancel"}),e.jsxs(O,{variant:"danger",onClick:a,disabled:n,children:[n&&e.jsx(G,{}),"Delete"]})]}),children:[e.jsx("p",{children:"Are you sure you want to delete this run?"}),o&&e.jsx("p",{className:"font-mono text-sm mt-2",children:Y(o.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]})]}):e.jsx(te,{message:"No runs found",hint:i??"Try adjusting your filters"})}function Ls(){const[r,t]=T.useSearchParams(),{api:n}=W(),{data:i}=Re(),[d,o]=v.useState(null),[m,a]=v.useState({project:r.get("project")||"",status:r.get("status")||"",q:r.get("q")||"",limit:parseInt(r.get("limit")||"25",10)}),{data:u,loading:x,refetch:g}=Ke(m),j=me(S=>n.deleteRun(S));v.useEffect(()=>{if(d){const S=setTimeout(()=>o(null),3e3);return()=>clearTimeout(S)}},[d]);const w=v.useCallback((S,Z)=>{a(J=>({...J,[S]:Z}));const K=new URLSearchParams(r);Z?K.set(S,String(Z)):K.delete(S),t(K,{replace:!0})},[r,t]),H=v.useCallback(async S=>{try{await j.mutate(S),o({message:"Run deleted",variant:"success"}),g()}catch{o({message:"Failed to delete run",variant:"error"})}},[j,g]);return e.jsxs(q,{children:[e.jsx(fe,{title:"Runs"}),e.jsx(N,{className:"mb-4",children:e.jsxs(Qe,{children:[e.jsxs(X,{children:[e.jsx(se,{htmlFor:"project",children:"Project"}),e.jsxs(re,{id:"project",value:m.project,onChange:S=>w("project",S.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),i?.map(S=>e.jsx("option",{value:S.name,children:S.name},S.name))]})]}),e.jsxs(X,{children:[e.jsx(se,{htmlFor:"status",children:"Status"}),e.jsxs(re,{id:"status",value:m.status,onChange:S=>w("status",S.target.value),children:[e.jsx("option",{value:"",children:"All"}),e.jsx("option",{value:"FINISHED",children:"Finished"}),e.jsx("option",{value:"FAILED",children:"Failed"}),e.jsx("option",{value:"RUNNING",children:"Running"})]})]}),e.jsxs(X,{children:[e.jsx(se,{htmlFor:"q",children:"Query"}),e.jsx(Le,{id:"q",value:m.q,onChange:S=>w("q",S.target.value),placeholder:"metric.fidelity > 0.9"})]}),e.jsxs(X,{children:[e.jsx(se,{htmlFor:"limit",children:"Limit"}),e.jsxs(re,{id:"limit",value:m.limit,onChange:S=>w("limit",parseInt(S.target.value,10)),children:[e.jsx("option",{value:"25",children:"25"}),e.jsx("option",{value:"50",children:"50"}),e.jsx("option",{value:"100",children:"100"})]})]}),e.jsxs(X,{className:"flex items-end gap-2",children:[e.jsx(O,{variant:"primary",onClick:()=>g(),children:"Filter"}),x&&e.jsx(G,{})]})]})}),e.jsx(N,{children:x&&!u?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Be,{runs:u?.runs??[],onDelete:H,loading:j.loading,baselineRunId:m.project?i?.find(S=>S.name===m.project)?.baseline?.run_id:void 0})}),d&&e.jsx(we,{message:d.message,variant:d.variant,visible:!!d,onClose:()=>o(null)})]})}function Bs({projects:r,currentWorkspace:t}){if(!r.length)return e.jsx(te,{message:"No projects yet",hint:"Projects are created automatically when you log runs"});const n=i=>{const d=new URLSearchParams({project:i});return t&&d.set("workspace",t.id),`/runs?${d}`};return e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Project"}),e.jsx(y,{children:"Runs"}),e.jsx(y,{children:"Baseline"}),e.jsx(y,{})]})}),e.jsx(U,{children:r.map(i=>e.jsxs(f,{children:[e.jsxs(c,{children:[e.jsx("span",{className:"font-medium",children:i.name}),i.description&&e.jsx("p",{className:"text-muted text-sm",children:Fs(i.description)})]}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:i.run_count??0})}),e.jsx(c,{children:i.baseline?e.jsxs(e.Fragment,{children:[e.jsx(T.Link,{to:`/runs/${i.baseline.run_id}`,className:"font-mono text-sm",children:Y(i.baseline.run_id)}),i.baseline.run_name&&e.jsx("p",{className:"text-muted text-sm",children:i.baseline.run_name})]}):e.jsx("span",{className:"text-muted",children:"—"})}),e.jsx(c,{className:"text-right",children:e.jsx(T.Link,{to:n(i.name),children:e.jsx(O,{variant:"secondary",size:"sm",children:"View Runs"})})})]},i.name))})]})}function Is({groups:r}){return r.length?e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Group ID"}),e.jsx(y,{children:"Name"}),e.jsx(y,{children:"Project"}),e.jsx(y,{children:"Runs"}),e.jsx(y,{children:"Actions"})]})}),e.jsx(U,{children:r.map(t=>e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:Y(t.group_id)}),e.jsx(c,{children:t.group_name||"—"}),e.jsx(c,{children:t.project}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:t.run_count})}),e.jsx(c,{children:e.jsx(T.Link,{to:`/groups/${t.group_id}`,children:e.jsx(O,{variant:"secondary",size:"sm",children:"View Runs"})})})]},t.group_id))})]}):e.jsx(te,{message:"No groups found",hint:"Groups are created when runs have a group_id set"})}function Us(){const{runId:r}=T.useParams(),t=T.useNavigate(),{api:n}=W(),{data:i,loading:d,error:o,refetch:m}=Je(r),{data:a,refetch:u}=Re(),[x,g]=v.useState(!1),[j,w]=v.useState(null),{mutate:H,loading:S}=me(()=>n.setBaseline(i.project,i.run_id)),{mutate:Z,loading:K}=me(()=>n.deleteRun(r)),k=a?.find(_=>_.name===i?.project)?.baseline?.run_id===r;if(v.useEffect(()=>{if(j){const _=setTimeout(()=>w(null),3e3);return()=>clearTimeout(_)}},[j]),d)return e.jsx(q,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})});if(o||!i)return e.jsx(q,{children:e.jsx(N,{children:e.jsx(te,{message:"Run not found",hint:o?.message||`Run ${r} does not exist`})})});const le=i.backend||{},oe=i.fingerprints||{},ee=i.data?.params||{},Se=i.data?.metrics||{},Ee=i.data?.tags||{},de=i.artifacts||[],je=i.errors||[],Ie=async()=>{try{await H(),await u(),m(),w({message:"Baseline updated",variant:"success"})}catch{w({message:"Failed to set baseline",variant:"error"})}},Ue=async()=>{try{await Z(),g(!1),w({message:"Run deleted",variant:"success"}),setTimeout(()=>t("/runs"),1e3)}catch{w({message:"Failed to delete run",variant:"error"}),g(!1)}},Pe=async _=>{const C=de[_];try{const ne=n.getArtifactDownloadUrl(i.run_id,_),pe=await fetch(ne);if(!pe.ok)throw new Error("Download failed");const Te=await pe.blob(),ae=document.createElement("a");ae.href=URL.createObjectURL(Te),ae.download=C?.kind||`artifact-${_}`,ae.click(),URL.revokeObjectURL(ae.href),w({message:"Download started",variant:"success"})}catch{w({message:"Download failed",variant:"error"})}};return e.jsxs(q,{children:[k&&e.jsxs("div",{className:"alert alert-info mb-4",children:['This run is the current baseline for project "',i.project,'"']}),e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:i.run_name||"Unnamed Run"}),e.jsx("p",{className:"text-muted text-sm font-mono",children:i.run_id})]}),e.jsxs("div",{className:"flex gap-2",children:[!k&&e.jsxs(O,{variant:"secondary",size:"sm",onClick:Ie,disabled:S,children:[S&&e.jsx(G,{}),"Set as Baseline"]}),e.jsx(O,{variant:"ghost-danger",size:"sm",onClick:()=>g(!0),children:"Delete"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Overview"})}),e.jsx($e,{items:[{label:"Project",value:e.jsx(T.Link,{to:`/runs?project=${i.project}`,children:i.project})},{label:"Name",value:i.run_name||"—"},{label:"Adapter",value:i.adapter||"N/A"},{label:"Status",value:e.jsx(Ze,{status:i.status})},{label:"Created",value:`${i.created_at} (${_e(i.created_at)})`},{label:"Backend",value:le.name||"N/A"},...i.group_id?[{label:"Group",value:e.jsx(T.Link,{to:`/groups/${i.group_id}`,children:i.group_name||Y(i.group_id)})}]:[]]})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Fingerprints"})}),e.jsx($e,{items:[{label:"Run",value:e.jsx("span",{className:"font-mono text-sm truncate",children:oe.run||"N/A"})},{label:"Program",value:e.jsx("span",{className:"font-mono text-sm truncate",children:oe.program||"N/A"})}]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Parameters"})}),Object.keys(ee).length?e.jsx(I,{children:e.jsx(U,{children:Object.entries(ee).map(([_,C])=>e.jsxs(f,{children:[e.jsx(c,{children:_}),e.jsx(c,{className:"font-mono",children:String(C)})]},_))})}):e.jsx("p",{className:"text-muted",children:"No parameters"})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Metrics"})}),Object.keys(Se).length?e.jsx(I,{children:e.jsx(U,{children:Object.entries(Se).map(([_,C])=>e.jsxs(f,{children:[e.jsx(c,{children:_}),e.jsx(c,{className:"font-mono",children:typeof C=="number"?Ds(C):String(C)})]},_))})}):e.jsx("p",{className:"text-muted",children:"No metrics"})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Tags"})}),Object.keys(Ee).length?e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(Ee).map(([_,C])=>e.jsxs(B,{variant:"gray",children:[_,": ",String(C)]},_))}):e.jsx("p",{className:"text-muted",children:"No tags"})]})]}),e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsxs(A,{children:["Artifacts (",de.length,")"]})}),de.length?e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"#"}),e.jsx(y,{children:"Kind"}),e.jsx(y,{children:"Role"}),e.jsx(y,{children:"Media Type"}),e.jsx(y,{children:"Digest"}),e.jsx(y,{children:"Actions"})]})}),e.jsx(U,{children:de.map((_,C)=>e.jsxs(f,{children:[e.jsx(c,{children:C}),e.jsx(c,{className:"font-mono text-sm",children:_.kind}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:_.role})}),e.jsx(c,{className:"text-muted text-sm",children:_.media_type}),e.jsx(c,{className:"font-mono text-sm",children:Oe(_.digest)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T.Link,{to:`/runs/${i.run_id}/artifacts/${C}`,children:e.jsx(O,{variant:"secondary",size:"sm",children:"View"})}),e.jsx(O,{variant:"secondary",size:"sm",onClick:()=>Pe(C),children:"Download"})]})})]},C))})]}):e.jsx("p",{className:"text-muted",children:"No artifacts"})]}),je.length>0&&e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{className:"text-danger",children:"Errors"})}),je.map((_,C)=>e.jsxs("div",{className:"mb-2",children:[e.jsx("strong",{children:_.type}),": ",_.message,_.traceback&&e.jsx("pre",{className:"mt-2",children:_.traceback})]},C))]}),e.jsxs(Xe,{open:x,onClose:()=>g(!1),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(O,{variant:"secondary",onClick:()=>g(!1),children:"Cancel"}),e.jsxs(O,{variant:"danger",onClick:Ue,disabled:K,children:[K&&e.jsx(G,{}),"Delete"]})]}),children:[e.jsx("p",{children:"Are you sure you want to delete this run?"}),e.jsx("p",{className:"font-mono text-sm mt-2",children:Y(i.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]}),j&&e.jsx(we,{message:j.message,variant:j.variant,visible:!!j,onClose:()=>w(null)})]})}function Ms(){const{currentWorkspace:r}=W(),{data:t,loading:n}=Re();return e.jsxs(q,{children:[e.jsx(fe,{title:"Projects"}),e.jsx(N,{children:n?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Bs,{projects:t??[],currentWorkspace:r})})]})}function qs(){const[r,t]=T.useSearchParams(),{data:n}=Re(),[i,d]=v.useState(r.get("project")||""),{data:o,loading:m,refetch:a}=Ps({project:i||void 0}),u=v.useCallback(x=>{d(x);const g=new URLSearchParams(r);x?g.set("project",x):g.delete("project"),t(g,{replace:!0})},[r,t]);return e.jsxs(q,{children:[e.jsx(fe,{title:"Run Groups"}),e.jsx(N,{className:"mb-4",children:e.jsxs(Qe,{children:[e.jsxs(X,{children:[e.jsx(se,{htmlFor:"project",children:"Project"}),e.jsxs(re,{id:"project",value:i,onChange:x=>u(x.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),n?.map(x=>e.jsx("option",{value:x.name,children:x.name},x.name))]})]}),e.jsxs(X,{className:"flex items-end gap-2",children:[e.jsx(O,{variant:"primary",onClick:()=>a(),children:"Filter"}),m&&e.jsx(G,{})]})]})}),e.jsx(N,{children:m&&!o?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Is,{groups:o??[]})})]})}function Gs(){const{groupId:r}=T.useParams(),{api:t}=W(),{data:n,loading:i,error:d,refetch:o}=Ts(r),[m,a]=v.useState(null),u=me(g=>t.deleteRun(g));v.useEffect(()=>{if(m){const g=setTimeout(()=>a(null),3e3);return()=>clearTimeout(g)}},[m]);const x=async g=>{try{await u.mutate(g),a({message:"Run deleted",variant:"success"}),o()}catch{a({message:"Failed to delete run",variant:"error"})}};return i?e.jsx(q,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})}):d||!n?e.jsx(q,{children:e.jsx(N,{children:e.jsx(te,{message:"Group not found",hint:d?.message})})}):e.jsxs(q,{children:[e.jsx(fe,{title:e.jsxs(e.Fragment,{children:["Group ",e.jsx("span",{className:"font-mono",children:Y(r)})]}),subtitle:e.jsx("span",{className:"font-mono text-muted",children:r})}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsxs(A,{children:["Runs in Group (",n.runs.length,")"]})}),e.jsx(Be,{runs:n.runs,onDelete:x,loading:u.loading})]}),m&&e.jsx(we,{message:m.message,variant:m.variant,visible:!!m,onClose:()=>a(null)})]})}function Ne({match:r,yesText:t="✓ Match",noText:n="✗ Different"}){return e.jsx("span",{className:r?"diff-match":"diff-mismatch",children:r?t:n})}function Tr(){const[r,t]=T.useSearchParams(),{data:n}=Ke({limit:100}),i=n?.runs??[],[d,o]=v.useState(r.get("a")||""),[m,a]=v.useState(r.get("b")||""),[u,x]=v.useState(""),g=j=>{if(j.preventDefault(),!d||!m){x("Please select both runs to compare");return}x(""),t({a:d,b:m})};return e.jsxs(e.Fragment,{children:[e.jsx(N,{children:e.jsxs("form",{onSubmit:g,children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(X,{children:[e.jsx(se,{htmlFor:"a",children:"Run A (Baseline)"}),e.jsxs(re,{id:"a",value:d,onChange:j=>{o(j.target.value),x("")},children:[e.jsx("option",{value:"",children:"Select run..."}),i.map(j=>e.jsxs("option",{value:j.run_id,children:[j.run_name||"Unnamed"," (",Y(j.run_id),") — ",j.project]},j.run_id))]})]}),e.jsxs(X,{children:[e.jsx(se,{htmlFor:"b",children:"Run B (Candidate)"}),e.jsxs(re,{id:"b",value:m,onChange:j=>{a(j.target.value),x("")},children:[e.jsx("option",{value:"",children:"Select run..."}),i.map(j=>e.jsxs("option",{value:j.run_id,children:[j.run_name||"Unnamed"," (",Y(j.run_id),") — ",j.project]},j.run_id))]})]})]}),u&&e.jsx("p",{className:"text-sm text-danger mb-3",children:u}),e.jsx("div",{className:"pt-2",children:e.jsx(O,{type:"submit",variant:"primary",children:"Compare"})})]})}),e.jsxs(N,{className:"mt-4",children:[e.jsx(D,{children:e.jsx(A,{children:"Tips"})}),e.jsxs("ul",{className:"text-muted text-sm list-disc pl-6 space-y-1",children:[e.jsx("li",{children:"Select two runs to compare their parameters, metrics, and artifacts"}),e.jsx("li",{children:"The diff will show changed values and compute TVD for result distributions"}),e.jsx("li",{children:"You can also compare from the run detail page"})]})]})]})}function Cr({runIdA:r,runIdB:t}){const{data:n,loading:i,error:d}=Cs(r,t);if(i)return e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})});if(d||!n)return e.jsx(N,{children:e.jsx(te,{message:"Failed to load diff",hint:d?.message})});const{run_a:o,run_b:m,report:a}=n;return e.jsxs(e.Fragment,{children:[a.warnings&&a.warnings.length>0&&e.jsxs("div",{className:"alert alert-warning mb-4",children:[e.jsx("strong",{children:"Warnings:"}),e.jsx("ul",{className:"list-disc pl-6 mt-1",children:a.warnings.map((u,x)=>e.jsx("li",{children:u},x))})]}),e.jsx(N,{className:"mb-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm text-muted uppercase tracking-wider mb-1",children:"Run A (Baseline)"}),e.jsx("p",{children:e.jsx(T.Link,{to:`/runs/${o.run_id}`,children:o.run_name||"Unnamed Run"})}),e.jsx("p",{className:"font-mono text-sm text-muted",children:Y(o.run_id)}),e.jsxs("p",{className:"text-muted text-sm",children:[o.project," · ",_e(o.created_at)]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm text-muted uppercase tracking-wider mb-1",children:"Run B (Candidate)"}),e.jsx("p",{children:e.jsx(T.Link,{to:`/runs/${m.run_id}`,children:m.run_name||"Unnamed Run"})}),e.jsx("p",{className:"font-mono text-sm text-muted",children:Y(m.run_id)}),e.jsxs("p",{className:"text-muted text-sm",children:[m.project," · ",_e(m.created_at)]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Metadata"})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Project"}),e.jsx(c,{children:e.jsx(Ne,{match:a.metadata.project_match})})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Backend"}),e.jsx(c,{children:e.jsx(Ne,{match:a.metadata.backend_match})})]}),!a.metadata.project_match&&e.jsxs(e.Fragment,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Project A"}),e.jsx(c,{className:"font-mono text-sm",children:a.metadata.project_a||"N/A"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Project B"}),e.jsx(c,{className:"font-mono text-sm",children:a.metadata.project_b||"N/A"})]})]}),!a.metadata.backend_match&&e.jsxs(e.Fragment,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Backend A"}),e.jsx(c,{className:"font-mono text-sm",children:a.metadata.backend_a||"N/A"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Backend B"}),e.jsx(c,{className:"font-mono text-sm",children:a.metadata.backend_b||"N/A"})]})]})]})})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Fingerprints"})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono text-sm",children:Oe(a.fingerprints.a)})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono text-sm",children:Oe(a.fingerprints.b)})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Match"}),e.jsx(c,{children:e.jsx(Ne,{match:a.fingerprints.a===a.fingerprints.b,yesText:"✓ Yes",noText:"✗ No"})})]})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsxs(A,{children:["Program",a.program.exact_match?e.jsx(B,{variant:"success",children:"Exact Match"}):a.program.structural_match?e.jsx(B,{variant:"info",children:"Structural Match"}):e.jsx(B,{variant:"warning",children:"Different"})]})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Exact Match"}),e.jsx(c,{children:e.jsx(Ne,{match:a.program.exact_match,yesText:"✓ Yes",noText:"✗ No"})})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Structural Match"}),e.jsx(c,{children:e.jsx(Ne,{match:a.program.structural_match,yesText:"✓ Yes",noText:"✗ No"})})]})]})})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsxs(A,{children:["Device Calibration",a.device_drift?.significant_drift?e.jsx(B,{variant:"warning",children:"Drifted"}):a.device_drift?.has_calibration_data?e.jsx(B,{variant:"success",children:"Stable"}):e.jsx(B,{variant:"gray",children:"N/A"})]})}),a.device_drift?.significant_drift?e.jsx("p",{className:"text-sm text-warning",children:"⚠ Significant calibration drift detected"}):a.device_drift?.has_calibration_data?e.jsx("p",{className:"text-muted",children:"Calibration within acceptable thresholds"}):e.jsx("p",{className:"text-muted",children:"No calibration data available"})]})]}),e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsxs(A,{children:["Parameters ",e.jsx(B,{variant:a.params.match?"success":"warning",children:a.params.match?"Match":"Different"})]})}),a.params.match?e.jsx("p",{className:"text-muted",children:"All parameters match"}):e.jsx(e.Fragment,{children:a.params.changed&&Object.keys(a.params.changed).length>0&&e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Parameter"}),e.jsx(y,{children:"Run A"}),e.jsx(y,{children:"Run B"})]})}),e.jsx(U,{children:Object.entries(a.params.changed).map(([u,x])=>e.jsxs(f,{children:[e.jsx(c,{children:u}),e.jsx(c,{className:"font-mono",children:String(x.a)}),e.jsx(c,{className:"font-mono",children:String(x.b)})]},u))})]})})]}),e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsxs(A,{children:["Metrics ",e.jsx(B,{variant:a.metrics.match?"success":"warning",children:a.metrics.match?"Match":"Different"})]})}),a.metrics.match?e.jsx("p",{className:"text-muted",children:"All metrics match"}):e.jsx(e.Fragment,{children:a.metrics.changed&&Object.keys(a.metrics.changed).length>0&&e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Metric"}),e.jsx(y,{children:"Run A"}),e.jsx(y,{children:"Run B"})]})}),e.jsx(U,{children:Object.entries(a.metrics.changed).map(([u,x])=>e.jsxs(f,{children:[e.jsx(c,{children:u}),e.jsx(c,{className:"font-mono",children:x.a}),e.jsx(c,{className:"font-mono",children:x.b})]},u))})]})})]}),a.circuit_diff&&e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsxs(A,{children:["Circuit",e.jsx(B,{variant:a.circuit_diff.match?"success":"warning",children:a.circuit_diff.match?"Match":"Different"})]})}),a.circuit_diff.match?e.jsx("p",{className:"text-muted",children:"Circuit structure matches"}):e.jsxs(e.Fragment,{children:[a.circuit_diff.changed&&Object.keys(a.circuit_diff.changed).length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Changed"}),e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Property"}),e.jsx(y,{children:"Run A"}),e.jsx(y,{children:"Run B"}),e.jsx(y,{children:"Delta"})]})}),e.jsx(U,{children:Object.entries(a.circuit_diff.changed).map(([u,x])=>e.jsxs(f,{children:[e.jsx(c,{children:x.label||u}),e.jsx(c,{className:"font-mono",children:String(x.a)}),e.jsx(c,{className:"font-mono",children:String(x.b)}),e.jsx(c,{className:"font-mono",children:x.delta!=null&&e.jsxs(e.Fragment,{children:[x.delta>0?"+":"",x.delta,x.pct!=null&&` (${x.pct>0?"+":""}${x.pct.toFixed(1)}%)`]})})]},u))})]})]}),a.circuit_diff.is_clifford_changed&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Clifford Status"}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono",children:a.circuit_diff.is_clifford_a!=null?String(a.circuit_diff.is_clifford_a):"unknown"})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono",children:a.circuit_diff.is_clifford_b!=null?String(a.circuit_diff.is_clifford_b):"unknown"})]})]})})]}),a.circuit_diff.added_gates&&a.circuit_diff.added_gates.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"New Gate Types (in B)"}),e.jsx("p",{className:"font-mono text-sm",children:a.circuit_diff.added_gates.join(", ")})]}),a.circuit_diff.removed_gates&&a.circuit_diff.removed_gates.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Removed Gate Types (from A)"}),e.jsx("p",{className:"font-mono text-sm",children:a.circuit_diff.removed_gates.join(", ")})]})]})]}),a.tvd!=null&&e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsx(A,{children:"Results"})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Total Variation Distance (TVD)"}),e.jsx(c,{className:"font-mono",children:a.tvd.toFixed(6)})]}),a.shots&&e.jsxs(f,{children:[e.jsx(c,{children:"Total Shots (A / B)"}),e.jsxs(c,{className:"font-mono",children:[a.shots.a," / ",a.shots.b]})]}),a.noise_context?.noise_p95&&e.jsxs(f,{children:[e.jsx(c,{children:"Noise Threshold (p95)"}),e.jsx(c,{className:"font-mono",children:a.noise_context.noise_p95.toFixed(6)})]}),a.noise_context?.p_value!=null&&e.jsxs(f,{children:[e.jsx(c,{children:"p-value"}),e.jsx(c,{className:"font-mono",children:a.noise_context.p_value.toFixed(3)})]})]})}),a.tvd>0&&a.noise_context&&e.jsx("p",{className:"text-sm mt-4",children:a.noise_context.p_value!=null?a.noise_context.p_value>=.1?e.jsx("span",{className:"text-success",children:"✓ Consistent with sampling noise — difference is not statistically significant."}):a.noise_context.p_value>=.05?e.jsxs("span",{className:"text-warning",children:["⚠ Borderline (p=",a.noise_context.p_value.toFixed(2),"). Consider increasing shots."]}):e.jsxs("span",{className:"text-danger",children:["✗ Statistically significant difference (p=",a.noise_context.p_value.toFixed(2),") — results show meaningful divergence."]}):a.noise_context.noise_ratio!=null?a.noise_context.noise_ratio<1.5?e.jsx("span",{className:"text-success",children:"✓ TVD is within expected shot noise range."}):a.noise_context.noise_ratio<3?e.jsxs("span",{className:"text-warning",children:["⚠ Ambiguous (",a.noise_context.noise_ratio.toFixed(1),"× expected noise). Consider increasing shots."]}):e.jsxs("span",{className:"text-danger",children:["✗ TVD exceeds expected noise (",a.noise_context.noise_ratio.toFixed(1),"×) — results show meaningful differences."]}):null})]})]})}function Vs(){const[r]=T.useSearchParams(),t=r.get("a"),n=r.get("b"),i=t&&n;return e.jsxs(q,{children:[e.jsx("div",{className:"page-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"page-title",children:["Compare Runs",i&&e.jsx(B,{variant:"info",children:"Comparing"})]}),i&&e.jsx("p",{className:"text-muted text-sm",children:e.jsx(T.Link,{to:"/diff",children:"← Select different runs"})})]})}),i?e.jsx(Cr,{runIdA:t,runIdB:n}):e.jsx(Tr,{})]})}function Ws(){const{api:r}=W(),[t,n]=v.useState(""),[i,d]=v.useState(null),[o,m]=v.useState(!1),[a,u]=v.useState(""),{mutate:x,loading:g}=me(async()=>{const w=await r.listRuns({q:t,limit:100});return d(w.runs),m(!0),w}),j=w=>{if(w.preventDefault(),!t.trim()){u("Please enter a search query");return}u(""),x()};return e.jsxs(q,{children:[e.jsx("div",{className:"page-header",children:e.jsx("h1",{className:"page-title",children:"Search Runs"})}),e.jsx(N,{className:"mb-4",children:e.jsxs("form",{onSubmit:j,children:[e.jsxs(X,{children:[e.jsx(se,{htmlFor:"q",children:"Query"}),e.jsx(Le,{id:"q",type:"text",value:t,onChange:w=>{n(w.target.value),u("")},placeholder:"metric.fidelity > 0.95 and params.shots = 1000",className:"font-mono"})]}),a&&e.jsx("p",{className:"text-sm text-danger mb-3",children:a}),e.jsxs("div",{className:"flex gap-3 items-center pt-2",children:[e.jsxs(O,{type:"submit",variant:"primary",disabled:g,children:[g&&e.jsx(G,{}),"Search"]}),g&&e.jsx("span",{className:"text-muted text-sm",children:"Searching..."})]})]})}),o&&i&&e.jsx(N,{className:"mb-4",children:i.length>0?e.jsx(Be,{runs:i}):e.jsx("p",{className:"text-muted text-center py-8",children:"No runs match your query"})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Query Syntax"})}),e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Field"}),e.jsx(y,{children:"Description"})]})}),e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"params.X"}),e.jsx(c,{children:"Parameter value"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"metric.X"}),e.jsx(c,{children:"Metric value"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"tags.X"}),e.jsx(c,{children:"Tag value"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"status"}),e.jsx(c,{children:"Run status"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"project"}),e.jsx(c,{children:"Project name"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"backend"}),e.jsx(c,{children:"Backend name"})]})]})]})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Operators"})}),e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Operator"}),e.jsx(y,{children:"Description"})]})}),e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"="}),e.jsx(c,{children:"Equals"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"!="}),e.jsx(c,{children:"Not equals"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:">"}),e.jsx(c,{children:"Greater than"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:">="}),e.jsx(c,{children:"Greater or equal"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"<"}),e.jsx(c,{children:"Less than"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"<="}),e.jsx(c,{children:"Less or equal"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"~"}),e.jsx(c,{children:"Contains"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"and"}),e.jsx(c,{children:"Combine conditions"})]})]})]})]})]}),e.jsxs(N,{className:"mt-4",children:[e.jsx(D,{children:e.jsx(A,{children:"Examples"})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"metric.fidelity > 0.95"}),e.jsx(c,{children:"High fidelity runs"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"params.shots = 1000 and status = FINISHED"}),e.jsx(c,{children:"Finished runs with 1000 shots"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"tags.backend ~ ibm"}),e.jsx(c,{children:"Runs with IBM backends"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"metric.error < 0.01"}),e.jsx(c,{children:"Low error runs"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"project = vqe and metric.energy < -2.0"}),e.jsx(c,{children:"VQE runs with low energy"})]})]})})]})]})}function Ys(){const{runId:r,index:t}=T.useParams(),n=parseInt(t,10),{api:i}=W(),{data:d}=Je(r),{data:o,loading:m,error:a}=ks(r,n),[u,x]=v.useState(null);v.useEffect(()=>{if(u){const k=setTimeout(()=>x(null),3e3);return()=>clearTimeout(k)}},[u]);const g=async()=>{try{const k=i.getArtifactDownloadUrl(r,n),le=await fetch(k);if(!le.ok)throw new Error("Download failed");const oe=await le.blob(),ee=document.createElement("a");ee.href=URL.createObjectURL(oe),ee.download=j?.kind||`artifact-${n}`,ee.click(),URL.revokeObjectURL(ee.href),x({message:"Download started",variant:"success"})}catch{x({message:"Download failed",variant:"error"})}};if(m)return e.jsx(q,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})});if(a||!o)return e.jsx(q,{children:e.jsx(N,{children:e.jsx(te,{message:"Artifact not found",hint:a?.message})})});const{artifact:j,size:w,content:H,content_json:S,preview_available:Z,error:K}=o,J=10*1024*1024;return e.jsxs(q,{children:[e.jsx(fe,{title:j.kind,subtitle:e.jsxs(e.Fragment,{children:["← Back to run ",e.jsxs(T.Link,{to:`/runs/${r}`,children:[Y(r),d?.run_name&&` — ${d.run_name}`]})]}),actions:e.jsx(O,{variant:"primary",onClick:g,children:"Download"})}),e.jsx(N,{className:"mb-4",children:e.jsx($e,{items:[{label:"Kind",value:e.jsx("span",{className:"font-mono",children:j.kind})},{label:"Role",value:e.jsx(B,{variant:"gray",children:j.role})},{label:"Media Type",value:j.media_type},{label:"Digest",value:e.jsx("span",{className:"font-mono text-sm",children:j.digest})},{label:"Size",value:ye(w)}]})}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Content"})}),K?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-danger",children:["Error loading artifact: ",K]}),e.jsx("p",{className:"text-muted mt-2",children:e.jsx(O,{variant:"primary",onClick:g,children:"Download to view"})})]}):Z?S?e.jsx("pre",{children:As(S)}):H?e.jsx("pre",{children:H}):e.jsxs("p",{className:"text-muted",children:["Binary content (",ye(w),") — download to view"]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted",children:[e.jsx("strong",{children:"Artifact too large for preview"})," (",ye(w)," exceeds ",ye(J)," limit)"]}),e.jsx("p",{className:"text-sm text-muted mt-2",children:"Download the artifact to view its contents."}),e.jsx("p",{className:"mt-4",children:e.jsx(O,{variant:"primary",onClick:g,children:"Download"})})]})]}),u&&e.jsx(we,{message:u.message,variant:u.variant,visible:!!u,onClose:()=>x(null)})]})}const zs=[{path:"/",element:e.jsx(T.Navigate,{to:"/runs",replace:!0})},{path:"/runs",element:e.jsx(Ls,{})},{path:"/runs/:runId",element:e.jsx(Us,{})},{path:"/runs/:runId/artifacts/:index",element:e.jsx(Ys,{})},{path:"/projects",element:e.jsx(Ms,{})},{path:"/groups",element:e.jsx(qs,{})},{path:"/groups/:groupId",element:e.jsx(Gs,{})},{path:"/diff",element:e.jsx(Vs,{})},{path:"/search",element:e.jsx(Ws,{})}];function es(r=[]){return T.createBrowserRouter([...zs,...r])}const Hs=es();function kr({additionalRoutes:r,...t}){const n=r?.length?es(r):Hs;return e.jsx(Es,{...t,children:e.jsx(T.RouterProvider,{router:n})})}exports.Alert=Pr;exports.ApiClient=Rs;exports.ApiError=xe;exports.App=kr;exports.AppProvider=Es;exports.ArtifactPage=Ys;exports.Badge=B;exports.Button=O;exports.Card=N;exports.CardHeader=D;exports.CardTitle=A;exports.DiffPage=Vs;exports.EmptyState=te;exports.FormGroup=X;exports.FormRow=Qe;exports.GroupDetailPage=Gs;exports.GroupsPage=qs;exports.GroupsTable=Is;exports.Input=Le;exports.KVList=$e;exports.Label=se;exports.Layout=q;exports.LayoutConfigProvider=Er;exports.Modal=Xe;exports.PageHeader=fe;exports.ProjectsPage=Ms;exports.ProjectsTable=Bs;exports.RunDetailPage=Us;exports.RunsPage=Ls;exports.RunsTable=Be;exports.SearchPage=Ws;exports.Select=re;exports.Spinner=G;exports.StatusBadge=Ze;exports.Table=I;exports.TableBody=U;exports.TableCell=c;exports.TableHead=Q;exports.TableHeader=y;exports.TableRow=f;exports.Toast=we;exports.api=ws;exports.buildUrl=wr;exports.cn=L;exports.coreRoutes=zs;exports.createRouter=es;exports.formatBytes=ye;exports.formatNumber=Ds;exports.jsonPretty=As;exports.router=Hs;exports.shortDigest=Oe;exports.shortId=Y;exports.timeAgo=_e;exports.truncate=Fs;exports.useApp=W;exports.useArtifact=ks;exports.useDiff=Cs;exports.useGroup=Ts;exports.useGroups=Ps;exports.useLayoutConfig=$s;exports.useMutation=me;exports.useProjects=Re;exports.useRun=Je;exports.useRuns=Ke;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { App } from './App';
|
|
2
|
+
export type { AppProps } from './App';
|
|
3
|
+
export { AppProvider, useApp } from './hooks';
|
|
4
|
+
export type { AppProviderProps, AppContextValue, AsyncState } from './hooks';
|
|
5
|
+
export { router, createRouter, coreRoutes } from './router';
|
|
6
|
+
export { ApiClient, ApiError, api } from './api';
|
|
7
|
+
export type { ApiConfig } from './api';
|
|
8
|
+
export { useRuns, useRun, useProjects, useGroups, useGroup, useDiff, useArtifact, useMutation, } from './hooks';
|
|
9
|
+
export { Layout, PageHeader, LayoutConfigProvider, useLayoutConfig } from './components/Layout';
|
|
10
|
+
export type { LayoutProps, PageHeaderProps } from './components/Layout';
|
|
11
|
+
export { Badge, Button, Card, CardHeader, CardTitle, Alert, Spinner, EmptyState, KVList, Modal, Toast, FormGroup, FormRow, Label, Input, Select, } from './components/ui';
|
|
12
|
+
export type { BadgeVariant, BadgeProps, ButtonVariant, ButtonSize, ButtonProps, CardProps, CardHeaderProps, CardTitleProps, AlertVariant, AlertProps, SpinnerProps, EmptyStateProps, KVListProps, ModalProps, ToastVariant, ToastProps, FormGroupProps, FormRowProps, LabelProps, InputProps, SelectProps, } from './components/ui';
|
|
13
|
+
export { Table, TableHead, TableBody, TableRow, TableHeader, TableCell, } from './components/Table';
|
|
14
|
+
export type { TableProps, TableHeadProps, TableBodyProps, TableRowProps, TableHeaderProps, TableCellProps, } from './components/Table';
|
|
15
|
+
export { RunsTable, StatusBadge } from './components/RunsTable';
|
|
16
|
+
export type { RunsTableProps } from './components/RunsTable';
|
|
17
|
+
export { ProjectsTable } from './components/ProjectsTable';
|
|
18
|
+
export type { ProjectsTableProps } from './components/ProjectsTable';
|
|
19
|
+
export { GroupsTable } from './components/GroupsTable';
|
|
20
|
+
export type { GroupsTableProps } from './components/GroupsTable';
|
|
21
|
+
export { RunsPage, RunDetailPage, ProjectsPage, GroupsPage, GroupDetailPage, DiffPage, SearchPage, ArtifactPage, } from './pages';
|
|
22
|
+
export { shortId, shortDigest, timeAgo, formatNumber, formatBytes, jsonPretty, truncate, buildUrl, cn, } from './utils';
|
|
23
|
+
export type { RunStatus, Artifact, Fingerprints, RunSummary, RunRecord, Project, Group, RunFilters, GroupFilters, Capabilities, DiffReport, Workspace, NavLink, LayoutConfig, } from './types';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG7E,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjD,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EACL,OAAO,EACP,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,WAAW,GACZ,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAChG,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGxE,OAAO,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,KAAK,EACL,KAAK,EACL,SAAS,EACT,OAAO,EACP,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,EACT,eAAe,EACf,cAAc,EACd,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS,GACV,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,QAAQ,EACR,UAAU,EACV,YAAY,GACb,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,OAAO,EACP,WAAW,EACX,OAAO,EACP,YAAY,EACZ,WAAW,EACX,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,EAAE,GACH,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,SAAS,EACT,OAAO,EACP,KAAK,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,SAAS,EACT,OAAO,EACP,YAAY,GACb,MAAM,SAAS,CAAC"}
|