@devqubit/ui 0.1.11-beta.1 → 0.1.11-beta.2
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/dist/components/ExportRunButton/ExportRunButton.d.ts +3 -3
- package/dist/components/ExportRunButton/ExportRunButton.d.ts.map +1 -1
- package/dist/components/RunsTable/RunsTable.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +14 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1122 -1064
- package/dist/pages/RunDetailPage.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +36 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* ExportRunButton Component
|
|
3
3
|
*
|
|
4
4
|
* Provides run export functionality (bundle creation) for devqubit-ui.
|
|
5
|
+
* Uses the ApiClient from AppProvider so that Hub's CSRF / auth headers
|
|
6
|
+
* are included automatically.
|
|
5
7
|
*/
|
|
6
8
|
export interface ExportRunButtonProps {
|
|
7
9
|
/** Run ID to export */
|
|
@@ -14,8 +16,6 @@ export interface ExportRunButtonProps {
|
|
|
14
16
|
size?: 'default' | 'sm';
|
|
15
17
|
/** Additional class name */
|
|
16
18
|
className?: string;
|
|
17
|
-
/** Base URL for API requests */
|
|
18
|
-
apiBaseUrl?: string;
|
|
19
19
|
}
|
|
20
20
|
export interface ExportProgress {
|
|
21
21
|
status: 'idle' | 'preparing' | 'packing' | 'downloading' | 'complete' | 'error';
|
|
@@ -28,5 +28,5 @@ export interface ExportProgress {
|
|
|
28
28
|
/**
|
|
29
29
|
* Button that triggers run export/bundle download.
|
|
30
30
|
*/
|
|
31
|
-
export declare function ExportRunButton({ runId, runName, variant, size, className,
|
|
31
|
+
export declare function ExportRunButton({ runId, runName, variant, size, className, }: ExportRunButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
//# sourceMappingURL=ExportRunButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportRunButton.d.ts","sourceRoot":"","sources":["../../../src/components/ExportRunButton/ExportRunButton.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ExportRunButton.d.ts","sourceRoot":"","sources":["../../../src/components/ExportRunButton/ExportRunButton.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IAC5C,kBAAkB;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,OAAO,CAAC;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,OAAO,EACP,OAAqB,EACrB,IAAW,EACX,SAAc,GACf,EAAE,oBAAoB,2CA4LtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunsTable.d.ts","sourceRoot":"","sources":["../../../src/components/RunsTable/RunsTable.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"RunsTable.d.ts","sourceRoot":"","sources":["../../../src/components/RunsTable/RunsTable.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iBAAS,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,2CASrD;AAsCD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,cAAc,2CAqG9F;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ApiClient, ApiError } from '../api';
|
|
2
2
|
import { Capabilities, Workspace } from '../types';
|
|
3
|
+
/** Default polling interval for data fetching (ms). */
|
|
4
|
+
export declare const POLL_INTERVAL = 1000;
|
|
3
5
|
/** Async state for data fetching */
|
|
4
6
|
interface AsyncState<T> {
|
|
5
7
|
data: T | null;
|
|
@@ -31,8 +33,18 @@ export declare function AppProvider({ children, api, initialWorkspace, }: AppPro
|
|
|
31
33
|
* Access app context.
|
|
32
34
|
*/
|
|
33
35
|
export declare function useApp(): AppContextValue;
|
|
36
|
+
/**
|
|
37
|
+
* Poll with setInterval + immediate refetch when the browser tab regains focus.
|
|
38
|
+
*
|
|
39
|
+
* The visibility listener covers the typical workflow: user starts a run in the
|
|
40
|
+
* terminal, switches to the browser, and expects the UI to be up-to-date instantly.
|
|
41
|
+
*/
|
|
42
|
+
export declare function usePolling(refetch: () => void, intervalMs: number, active: boolean): void;
|
|
34
43
|
/**
|
|
35
44
|
* Fetch runs list with filters.
|
|
45
|
+
*
|
|
46
|
+
* Polls every second so new runs and status changes appear immediately.
|
|
47
|
+
* Also refetches instantly when the browser tab regains focus.
|
|
36
48
|
*/
|
|
37
49
|
export declare function useRuns(params?: {
|
|
38
50
|
project?: string;
|
|
@@ -47,6 +59,8 @@ export declare function useRuns(params?: {
|
|
|
47
59
|
};
|
|
48
60
|
/**
|
|
49
61
|
* Fetch single run by ID.
|
|
62
|
+
*
|
|
63
|
+
* Polls every second while the run is still in a non-terminal state.
|
|
50
64
|
*/
|
|
51
65
|
export declare function useRun(runId: string): AsyncState<import('..').RunRecord> & {
|
|
52
66
|
refetch: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,SAAS,EAAqB,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,SAAS,EAAqB,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAExD,uDAAuD;AACvD,eAAO,MAAM,aAAa,OAAQ,CAAC;AAEnC,oCAAoC;AACpC,UAAU,UAAU,CAAC,CAAC;IACpB,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB;AAED,mCAAmC;AACnC,UAAU,eAAe;IACvB,GAAG,EAAE,SAAS,CAAC;IACf,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,SAAS,GAAG,IAAI,CAAC;IACnC,mBAAmB,EAAE,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5D;AAID;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,gBAAgB,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,GAAgB,EAChB,gBAAuB,GACxB,EAAE,gBAAgB,2CAalB;AAED;;GAEG;AACH,wBAAgB,MAAM,IAAI,eAAe,CAIxC;AA8CD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,QAgBlF;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;;;aAzE6B,MAAM,IAAI;EAmFvC;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM;aA1FN,MAAM,IAAI;EAyGvC;AAED;;GAEG;AACH,wBAAgB,WAAW;aA9GG,MAAM,IAAI;EAuHvC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;aA5HzB,MAAM,IAAI;EAqIvC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM;;;;aA1IV,MAAM,IAAI;EAgJvC;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;aArJxB,MAAM,IAAI;EA2JvC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;;;;;aAhK1B,MAAM,IAAI;EAsKvC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAS,OAAO,EAAE,EAAE,OAAO,EAC1D,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,GAC/C;IACD,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAoBA;AAED,YAAY,EACV,UAAU,EACV,eAAe,GAChB,CAAC;AAGF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvE,YAAY,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`+
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),k=require("react-router-dom");var Oe={exports:{}},_e={};var Ct;function As(){if(Ct)return _e;Ct=1;var t=p,r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function u(i,f,h){var m,g={},_=null,z=null;h!==void 0&&(_=""+h),f.key!==void 0&&(_=""+f.key),f.ref!==void 0&&(z=f.ref);for(m in f)n.call(f,m)&&!d.hasOwnProperty(m)&&(g[m]=f[m]);if(i&&i.defaultProps)for(m in f=i.defaultProps,f)g[m]===void 0&&(g[m]=f[m]);return{$$typeof:r,type:i,key:_,ref:z,props:g,_owner:o.current}}return _e.Fragment=a,_e.jsx=u,_e.jsxs=u,_e}var we={};var Tt;function Ls(){return Tt||(Tt=1,process.env.NODE_ENV!=="production"&&(function(){var t=p,r=Symbol.for("react.element"),a=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),i=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),z=Symbol.for("react.offscreen"),w=Symbol.iterator,K="@@iterator";function T(s){if(s===null||typeof s!="object")return null;var l=w&&s[w]||s[K];return typeof l=="function"?l:null}var q=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(s){{for(var l=arguments.length,x=new Array(l>1?l-1:0),v=1;v<l;v++)x[v-1]=arguments[v];re("error",s,x)}}function re(s,l,x){{var v=q.ReactDebugCurrentFrame,S=v.getStackAddendum();S!==""&&(l+="%s",x=x.concat([S]));var C=x.map(function(E){return String(E)});C.unshift("Warning: "+l),Function.prototype.apply.call(console[s],console,C)}}var ae=!1,J=!1,ee=!1,he=!1,xe=!1,be;be=Symbol.for("react.module.reference");function Ge(s){return!!(typeof s=="string"||typeof s=="function"||s===n||s===d||xe||s===o||s===h||s===m||he||s===z||ae||J||ee||typeof s=="object"&&s!==null&&(s.$$typeof===_||s.$$typeof===g||s.$$typeof===u||s.$$typeof===i||s.$$typeof===f||s.$$typeof===be||s.getModuleId!==void 0))}function We(s,l,x){var v=s.displayName;if(v)return v;var S=l.displayName||l.name||"";return S!==""?x+"("+S+")":x}function Te(s){return s.displayName||"Context"}function te(s){if(s==null)return null;if(typeof s.tag=="number"&&P("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 n:return"Fragment";case a:return"Portal";case d:return"Profiler";case o:return"StrictMode";case h:return"Suspense";case m:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case i:var l=s;return Te(l)+".Consumer";case u:var x=s;return Te(x._context)+".Provider";case f:return We(s,s.render,"ForwardRef");case g:var v=s.displayName||null;return v!==null?v:te(s.type)||"Memo";case _:{var S=s,C=S._payload,E=S._init;try{return te(E(C))}catch{return null}}}return null}var R=Object.assign,A=0,Pe,Ne,ke,oe,ot,dt,ut;function ht(){}ht.__reactDisabledLog=!0;function is(){{if(A===0){Pe=console.log,Ne=console.info,ke=console.warn,oe=console.error,ot=console.group,dt=console.groupCollapsed,ut=console.groupEnd;var s={configurable:!0,enumerable:!0,value:ht,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}A++}}function cs(){{if(A--,A===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},s,{value:Pe}),info:R({},s,{value:Ne}),warn:R({},s,{value:ke}),error:R({},s,{value:oe}),group:R({},s,{value:ot}),groupCollapsed:R({},s,{value:dt}),groupEnd:R({},s,{value:ut})})}A<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ve=q.ReactCurrentDispatcher,ze;function De(s,l,x){{if(ze===void 0)try{throw Error()}catch(S){var v=S.stack.trim().match(/\n( *(at )?)/);ze=v&&v[1]||""}return`
|
|
2
|
+
`+ze+s}}var Ye=!1,Ae;{var ls=typeof WeakMap=="function"?WeakMap:Map;Ae=new ls}function xt(s,l){if(!s||Ye)return"";{var x=Ae.get(s);if(x!==void 0)return x}var v;Ye=!0;var S=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=Ve.current,Ve.current=null,is();try{if(l){var E=function(){throw Error()};if(Object.defineProperty(E.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(E,[])}catch(Y){v=Y}Reflect.construct(s,[],E)}else{try{E.call()}catch(Y){v=Y}s.call(E.prototype)}}else{try{throw Error()}catch(Y){v=Y}s()}}catch(Y){if(Y&&v&&typeof Y.stack=="string"){for(var y=Y.stack.split(`
|
|
3
3
|
`),M=v.stack.split(`
|
|
4
|
-
`),
|
|
5
|
-
`+y[
|
|
4
|
+
`),L=y.length-1,F=M.length-1;L>=1&&F>=0&&y[L]!==M[F];)F--;for(;L>=1&&F>=0;L--,F--)if(y[L]!==M[F]){if(L!==1||F!==1)do if(L--,F--,F<0||y[L]!==M[F]){var X=`
|
|
5
|
+
`+y[L].replace(" at new "," at ");return s.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",s.displayName)),typeof s=="function"&&Ae.set(s,X),X}while(L>=1&&F>=0);break}}}finally{Ye=!1,Ve.current=C,cs(),Error.prepareStackTrace=S}var fe=s?s.displayName||s.name:"",de=fe?De(fe):"";return typeof s=="function"&&Ae.set(s,de),de}function os(s,l,x){return xt(s,!1)}function ds(s){var l=s.prototype;return!!(l&&l.isReactComponent)}function Le(s,l,x){if(s==null)return"";if(typeof s=="function")return xt(s,ds(s));if(typeof s=="string")return De(s);switch(s){case h:return De("Suspense");case m:return De("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case f:return os(s.render);case g:return Le(s.type,l,x);case _:{var v=s,S=v._payload,C=v._init;try{return Le(C(S),l,x)}catch{}}}return""}var ye=Object.prototype.hasOwnProperty,mt={},ft=q.ReactDebugCurrentFrame;function Fe(s){if(s){var l=s._owner,x=Le(s.type,s._source,l?l.type:null);ft.setExtraStackFrame(x)}else ft.setExtraStackFrame(null)}function us(s,l,x,v,S){{var C=Function.call.bind(ye);for(var E in s)if(C(s,E)){var y=void 0;try{if(typeof s[E]!="function"){var M=Error((v||"React class")+": "+x+" type `"+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[E]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw M.name="Invariant Violation",M}y=s[E](l,E,v,x,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(L){y=L}y&&!(y instanceof Error)&&(Fe(S),P("%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).",v||"React class",x,E,typeof y),Fe(null)),y instanceof Error&&!(y.message in mt)&&(mt[y.message]=!0,Fe(S),P("Failed %s type: %s",x,y.message),Fe(null))}}}var hs=Array.isArray;function He(s){return hs(s)}function xs(s){{var l=typeof Symbol=="function"&&Symbol.toStringTag,x=l&&s[Symbol.toStringTag]||s.constructor.name||"Object";return x}}function ms(s){try{return jt(s),!1}catch{return!0}}function jt(s){return""+s}function pt(s){if(ms(s))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xs(s)),jt(s)}var gt=q.ReactCurrentOwner,fs={key:!0,ref:!0,__self:!0,__source:!0},vt,bt;function js(s){if(ye.call(s,"ref")){var l=Object.getOwnPropertyDescriptor(s,"ref").get;if(l&&l.isReactWarning)return!1}return s.ref!==void 0}function ps(s){if(ye.call(s,"key")){var l=Object.getOwnPropertyDescriptor(s,"key").get;if(l&&l.isReactWarning)return!1}return s.key!==void 0}function gs(s,l){typeof s.ref=="string"&>.current}function vs(s,l){{var x=function(){vt||(vt=!0,P("%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))};x.isReactWarning=!0,Object.defineProperty(s,"key",{get:x,configurable:!0})}}function bs(s,l){{var x=function(){bt||(bt=!0,P("%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))};x.isReactWarning=!0,Object.defineProperty(s,"ref",{get:x,configurable:!0})}}var Ns=function(s,l,x,v,S,C,E){var y={$$typeof:r,type:s,key:l,ref:x,props:E,_owner:C};return y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function ys(s,l,x,v,S){{var C,E={},y=null,M=null;x!==void 0&&(pt(x),y=""+x),ps(l)&&(pt(l.key),y=""+l.key),js(l)&&(M=l.ref,gs(l,S));for(C in l)ye.call(l,C)&&!fs.hasOwnProperty(C)&&(E[C]=l[C]);if(s&&s.defaultProps){var L=s.defaultProps;for(C in L)E[C]===void 0&&(E[C]=L[C])}if(y||M){var F=typeof s=="function"?s.displayName||s.name||"Unknown":s;y&&vs(E,F),M&&bs(E,F)}return Ns(s,y,M,S,v,gt.current,E)}}var Ke=q.ReactCurrentOwner,Nt=q.ReactDebugCurrentFrame;function me(s){if(s){var l=s._owner,x=Le(s.type,s._source,l?l.type:null);Nt.setExtraStackFrame(x)}else Nt.setExtraStackFrame(null)}var Je;Je=!1;function Xe(s){return typeof s=="object"&&s!==null&&s.$$typeof===r}function yt(){{if(Ke.current){var s=te(Ke.current.type);if(s)return`
|
|
6
6
|
|
|
7
|
-
Check the render method of \``+s+"`."}return""}}function
|
|
7
|
+
Check the render method of \``+s+"`."}return""}}function _s(s){return""}var _t={};function ws(s){{var l=yt();if(!l){var x=typeof s=="string"?s:s.displayName||s.name;x&&(l=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+x+">.")}return l}}function
|
|
9
|
+
Check the top-level render call using <`+x+">.")}return l}}function wt(s,l){{if(!s._store||s._store.validated||s.key!=null)return;s._store.validated=!0;var x=ws(l);if(_t[x])return;_t[x]=!0;var v="";s&&s._owner&&s._owner!==Ke.current&&(v=" It was passed a child from "+te(s._owner.type)+"."),me(s),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',x,v),me(null)}}function Rt(s,l){{if(typeof s!="object")return;if(He(s))for(var x=0;x<s.length;x++){var v=s[x];Xe(v)&&wt(v,l)}else if(Xe(s))s._store&&(s._store.validated=!0);else if(s){var S=T(s);if(typeof S=="function"&&S!==s.entries)for(var C=S.call(s),E;!(E=C.next()).done;)Xe(E.value)&&wt(E.value,l)}}}function Rs(s){{var l=s.type;if(l==null||typeof l=="string")return;var x;if(typeof l=="function")x=l.propTypes;else if(typeof l=="object"&&(l.$$typeof===f||l.$$typeof===g))x=l.propTypes;else return;if(x){var v=te(l);us(x,s.props,"prop",v,s)}else if(l.PropTypes!==void 0&&!Je){Je=!0;var S=te(l);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S||"Unknown")}typeof l.getDefaultProps=="function"&&!l.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Es(s){{for(var l=Object.keys(s.props),x=0;x<l.length;x++){var v=l[x];if(v!=="children"&&v!=="key"){me(s),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),me(null);break}}s.ref!==null&&(me(s),P("Invalid attribute `ref` supplied to `React.Fragment`."),me(null))}}var Et={};function St(s,l,x,v,S,C){{var E=Ge(s);if(!E){var y="";(s===void 0||typeof s=="object"&&s!==null&&Object.keys(s).length===0)&&(y+=" 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=_s();M?y+=M:y+=yt();var L;s===null?L="null":He(s)?L="array":s!==void 0&&s.$$typeof===r?(L="<"+(te(s.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):L=typeof s,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",L,y)}var F=ys(s,l,x,S,C);if(F==null)return F;if(E){var X=l.children;if(X!==void 0)if(v)if(He(X)){for(var fe=0;fe<X.length;fe++)Rt(X[fe],s);Object.freeze&&Object.freeze(X)}else P("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 Rt(X,s)}if(ye.call(l,"key")){var de=te(s),Y=Object.keys(l).filter(function(Ds){return Ds!=="key"}),Qe=Y.length>0?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}";if(!Et[de+Qe]){var ks=Y.length>0?"{"+Y.join(": ..., ")+": ...}":"{}";P(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
13
13
|
let props = %s;
|
|
14
|
-
<%s key={someKey} {...props} />`,Je,ue,Rt,ue),ys[ue+Je]=!0}}return s===a?bt(O):vt(O),O}}function yt(s,l,x){return Ns(s,l,x,!0)}function Nt(s,l,x){return Ns(s,l,x,!1)}var _t=Nt,wt=yt;we.Fragment=a,we.jsx=_t,we.jsxs=wt})()),we}var Rs;function kt(){return Rs||(Rs=1,process.env.NODE_ENV==="production"?Fe.exports=Et():Fe.exports=St()),Fe.exports}var e=kt();class je extends Error{constructor(r,n){super(n),this.status=r,this.name="ApiError"}}class Es{baseUrl;headers;constructor(r={}){this.baseUrl=r.baseUrl??"",this.headers={"Content-Type":"application/json",...r.headers}}async request(r,n,a={}){let u=`${this.baseUrl}${n}`;if(a.params){const d=new URLSearchParams;Object.entries(a.params).forEach(([f,h])=>{h!=null&&h!==""&&d.set(f,String(h))});const i=d.toString();i&&(u+=`?${i}`)}const o=await fetch(u,{method:r,headers:this.headers,body:a.body?JSON.stringify(a.body):void 0});if(!o.ok){const d=await o.json().catch(()=>({detail:"Unknown error"}));throw new je(o.status,d.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(r){return this.request("GET","/api/runs",{params:r})}async getRun(r){return this.request("GET",`/api/runs/${r}`)}async deleteRun(r){await this.request("DELETE",`/api/runs/${r}`)}async setBaseline(r,n){return this.request("POST",`/api/projects/${r}/baseline/${n}`,{params:{redirect:"false"}})}async listProjects(r){return this.request("GET","/api/projects",{params:r})}async listGroups(r){return this.request("GET","/api/groups",{params:r})}async getGroup(r){return this.request("GET",`/api/groups/${r}`)}async getDiff(r,n){return this.request("GET","/api/diff",{params:{a:r,b:n}})}async getArtifact(r,n){return this.request("GET",`/api/runs/${r}/artifacts/${n}`)}getArtifactDownloadUrl(r,n){return`${this.baseUrl}/api/runs/${r}/artifacts/${n}/raw`}async createExport(r){return this.request("POST",`/api/runs/${r}/export`)}async getExportInfo(r){return this.request("GET",`/api/runs/${r}/export/info`)}getExportDownloadUrl(r){return`${this.baseUrl}/api/runs/${r}/export/download`}}const Ss=new Es,ks=g.createContext(null);function Pt({children:t}){const r={theme:"light",resolvedTheme:"light",setTheme:()=>{},toggleTheme:()=>{}};return e.jsx(ks.Provider,{value:r,children:t})}function Ps(){const t=g.useContext(ks);return t||{theme:"light",resolvedTheme:"light",setTheme:()=>{},toggleTheme:()=>{}}}function Tt(){return Ps()}const Ts=g.createContext(null);function Ds({children:t,api:r=Ss,initialWorkspace:n=null}){const[a,u]=g.useState(null),[o,d]=g.useState(n);return g.useEffect(()=>{r.getCapabilities().then(u).catch(console.error)},[r]),e.jsx(Ts.Provider,{value:{api:r,capabilities:a,currentWorkspace:o,setCurrentWorkspace:d},children:t})}function H(){const t=g.useContext(Ts);if(!t)throw new Error("useApp must be used within AppProvider");return t}function he(t,r=[]){const[n,a]=g.useState({data:null,loading:!0,error:null}),u=g.useRef(!0),o=g.useRef(t);o.current=t;const d=g.useCallback(async()=>{a(i=>({...i,loading:!0,error:null}));try{const i=await o.current();u.current&&a({data:i,loading:!1,error:null})}catch(i){u.current&&a({data:null,loading:!1,error:i instanceof je?i:new je(500,String(i))})}},[]);return g.useEffect(()=>(u.current=!0,d(),()=>{u.current=!1}),r),{...n,refetch:d}}function Qe(t){const{api:r,currentWorkspace:n}=H();return he(()=>r.listRuns({...t,workspace:n?.id}),[r,n?.id,t?.project,t?.status,t?.q,t?.limit])}function Ze(t){const{api:r}=H();return he(async()=>{const{run:n}=await r.getRun(t);return n},[r,t])}function Ee(){const{api:t,currentWorkspace:r}=H();return he(async()=>{const{projects:n}=await t.listProjects({workspace:r?.id});return n},[t,r?.id])}function As(t){const{api:r,currentWorkspace:n}=H();return he(async()=>{const{groups:a}=await r.listGroups({...t,workspace:n?.id});return a},[r,n?.id,t?.project])}function Fs(t){const{api:r}=H();return he(()=>r.getGroup(t),[r,t])}function Os(t,r){const{api:n}=H();return he(()=>n.getDiff(t,r),[n,t,r])}function $s(t,r){const{api:n}=H();return he(()=>n.getArtifact(t,r),[n,t,r])}function pe(t){const[r,n]=g.useState(!1),[a,u]=g.useState(null);return{mutate:g.useCallback(async(...d)=>{n(!0),u(null);try{return await t(...d)}catch(i){const f=i instanceof je?i:new je(500,String(i));throw u(f),f}finally{n(!1)}},[t]),loading:r,error:a}}function Q(t){return t?.slice(0,8)??""}function Oe(t){return t?.slice(0,12)??"N/A"}function Le(t){const r=new Date(t),a=Math.floor((new Date().getTime()-r.getTime())/1e3);if(a<60)return"just now";if(a<3600){const o=Math.floor(a/60);return`${o} minute${o!==1?"s":""} ago`}if(a<86400){const o=Math.floor(a/3600);return`${o} hour${o!==1?"s":""} ago`}if(a<2592e3){const o=Math.floor(a/86400);return`${o} day${o!==1?"s":""} ago`}if(a<31536e3){const o=Math.floor(a/2592e3);return`${o} month${o!==1?"s":""} ago`}const u=Math.floor(a/31536e3);return`${u} year${u!==1?"s":""} ago`}function Ls(t,r=6){return typeof t!="number"||isNaN(t)?String(t):Number(t.toPrecision(r)).toString()}function Ce(t){return t<1024?`${t} bytes`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}function Bs(t){return JSON.stringify(t,null,2)}function qs(t,r=60){return t?t.length<=r?t:t.slice(0,r-3)+"...":""}function Dt(t,r){const n=new URLSearchParams;Object.entries(r).forEach(([u,o])=>{o!=null&&o!==""&&n.set(u,String(o))});const a=n.toString();return a?`${t}?${a}`:t}function L(...t){return t.filter(Boolean).join(" ")}const At=[{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"]}],Is=g.createContext(null);function Ft({config:t,children:r}){return e.jsx(Is.Provider,{value:t,children:r})}function Ms(){return g.useContext(Is)}function W({children:t,config:r}){const n=T.useLocation(),u={...Ms(),...r},o=u?.navLinks??At,d=[...u?.prependNavLinks??[],...o,...u?.appendNavLinks??[]],i=u?.logo??{text:"devqubit",icon:"⚛"},f=h=>h.matchPaths?h.matchPaths.some(m=>n.pathname.startsWith(m)):n.pathname===h.href;return e.jsxs("div",{className:"dq-layout",children:[e.jsx("header",{className:"dq-header",children:e.jsxs("div",{className:"dq-header-inner",children:[e.jsxs("div",{className:"dq-header-left",children:[e.jsxs(T.Link,{to:"/",className:"dq-logo",children:[i.icon&&e.jsx("span",{className:"dq-logo-icon",children:i.icon}),i.text]}),e.jsx("nav",{className:"dq-nav",children:d.map(h=>e.jsx(T.Link,{to:h.href,className:L("dq-nav-link",f(h)&&"active"),children:h.label},h.href))})]}),e.jsx("div",{className:"dq-header-right",children:u?.headerRight})]})}),e.jsx("main",{className:"dq-main fade-in",children:t})]})}function ge({title:t,subtitle:r,actions:n}){return e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:t}),r&&e.jsx("p",{className:"text-sm text-muted mt-1",children:r})]}),n&&e.jsx("div",{className:"flex gap-2",children:n})]})}function Y({variant:t="gray",className:r,children:n,...a}){return e.jsx("span",{className:L("badge",`badge-${t}`,r),...a,children:n})}const A=g.forwardRef(({variant:t="secondary",size:r="default",loading:n,className:a,children:u,disabled:o,...d},i)=>e.jsxs("button",{ref:i,className:L("btn",t==="ghost-danger"?"btn-ghost-danger":`btn-${t}`,r==="sm"&&"btn-sm",a),disabled:o||n,...d,children:[n&&e.jsx(I,{}),u]}));A.displayName="Button";function b({className:t,children:r,...n}){return e.jsx("div",{className:L("card",t),...n,children:r})}function U({className:t,children:r,...n}){return e.jsx("div",{className:L("card-header",t),...n,children:r})}function G({className:t,children:r,...n}){return e.jsx("h3",{className:L("card-title",t),...n,children:r})}function Ot({variant:t="info",className:r,children:n,...a}){return e.jsx("div",{className:L("alert",`alert-${t}`,r),...a,children:n})}function I({className:t,...r}){return e.jsx("span",{className:L("spinner",t),...r})}function le({message:t,hint:r,className:n,...a}){return e.jsxs("div",{className:L("empty-state",n),...a,children:[e.jsx("p",{children:t}),r&&e.jsx("p",{className:"text-sm text-muted mt-2",children:r})]})}function $e({items:t,className:r,...n}){return e.jsx("dl",{className:L("kv-list",r),...n,children:t.map(({label:a,value:u})=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:u})]},a))})}function Be({open:t,onClose:r,title:n,children:a,actions:u}){return t?e.jsx("div",{className:L("modal-backdrop",t&&"active"),onClick:o=>o.target===o.currentTarget&&r(),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:a}),u&&e.jsx("div",{className:"modal-actions",children:u})]})}):null}function ve({message:t,variant:r="info",visible:n,onClose:a}){if(!n)return null;const u={success:"✓",error:"✕",info:"i"}[r],o={success:"text-[#059669]",error:"text-[#DC4A4A]",info:"text-[#2563EB]"}[r];return e.jsxs("div",{className:"toast",onClick:a,children:[e.jsx("span",{className:L("mr-2 font-bold",o),children:u}),t]})}function Z({children:t,className:r}){return e.jsx("div",{className:L("form-group",r),children:t})}function re({className:t,children:r,...n}){return e.jsx("label",{className:L("form-label",t),...n,children:r})}const qe=g.forwardRef(({className:t,...r},n)=>e.jsx("input",{ref:n,className:L("form-input",t),...r}));qe.displayName="Input";const ce=g.forwardRef(({className:t,children:r,...n},a)=>e.jsx("select",{ref:a,className:L("form-input",t),...n,children:r}));ce.displayName="Select";function es({children:t,className:r}){return e.jsx("div",{className:L("form-row",r),children:t})}function B({className:t,children:r,...n}){return e.jsx("table",{className:L("table",t),...n,children:r})}function se({className:t,children:r,...n}){return e.jsx("thead",{className:t,...n,children:r})}function q({className:t,children:r,...n}){return e.jsx("tbody",{className:t,...n,children:r})}function j({className:t,children:r,...n}){return e.jsx("tr",{className:t,...n,children:r})}function N({className:t,children:r,...n}){return e.jsx("th",{className:t,...n,children:r})}function c({className:t,children:r,...n}){return e.jsx("td",{className:t,...n,children:r})}function ss({status:t}){const r={FINISHED:"success",FAILED:"danger",RUNNING:"warning",UNKNOWN:"gray"}[t];return e.jsx(Y,{variant:r,children:t})}function Ie({runs:t,onDelete:r,loading:n,emptyHint:a,baselineRunId:u}){const[o,d]=g.useState(null),i=()=>{o&&r&&(r(o.run_id),d(null))};return t.length?e.jsxs(e.Fragment,{children:[e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Run ID"}),e.jsx(N,{children:"Name"}),e.jsx(N,{children:"Project"}),e.jsx(N,{children:"Status"}),e.jsx(N,{children:"Created"}),e.jsx(N,{children:"Actions"})]})}),e.jsx(q,{children:t.map(f=>e.jsxs(j,{children:[e.jsxs(c,{children:[e.jsx(T.Link,{to:`/runs/${f.run_id}`,className:"font-mono",children:Q(f.run_id)}),f.run_id===u&&e.jsx(Y,{variant:"info",className:"ml-2",children:"Baseline"})]}),e.jsx(c,{children:f.run_name||"—"}),e.jsx(c,{children:f.project}),e.jsx(c,{children:e.jsx(ss,{status:f.status})}),e.jsx(c,{className:"text-muted",children:Le(f.created_at)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T.Link,{to:`/runs/${f.run_id}`,children:e.jsx(A,{variant:"secondary",size:"sm",children:"View"})}),r&&e.jsx(A,{variant:"ghost-danger",size:"sm",onClick:()=>d(f),disabled:n,children:"Delete"})]})})]},f.run_id))})]}),e.jsxs(Be,{open:!!o,onClose:()=>d(null),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"secondary",onClick:()=>d(null),children:"Cancel"}),e.jsxs(A,{variant:"danger",onClick:i,disabled:n,children:[n&&e.jsx(I,{}),"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:Q(o.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]})]}):e.jsx(le,{message:"No runs found",hint:a??"Try adjusting your filters"})}function Us(){const[t,r]=T.useSearchParams(),{api:n}=H(),{data:a}=Ee(),[u,o]=g.useState(null),[d,i]=g.useState({project:t.get("project")||"",status:t.get("status")||"",q:t.get("q")||"",limit:parseInt(t.get("limit")||"25",10)}),{data:f,loading:h,refetch:m}=Qe(d),p=pe(R=>n.deleteRun(R));g.useEffect(()=>{if(u){const R=setTimeout(()=>o(null),3e3);return()=>clearTimeout(R)}},[u]);const w=g.useCallback((R,K)=>{i($=>({...$,[R]:K}));const k=new URLSearchParams(t);K?k.set(R,String(K)):k.delete(R),r(k,{replace:!0})},[t,r]),V=g.useCallback(async R=>{try{await p.mutate(R),o({message:"Run deleted",variant:"success"}),m()}catch{o({message:"Failed to delete run",variant:"error"})}},[p,m]);return e.jsxs(W,{children:[e.jsx(ge,{title:"Runs"}),e.jsx(b,{className:"mb-4",children:e.jsxs(es,{children:[e.jsxs(Z,{children:[e.jsx(re,{htmlFor:"project",children:"Project"}),e.jsxs(ce,{id:"project",value:d.project,onChange:R=>w("project",R.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),a?.map(R=>e.jsx("option",{value:R.name,children:R.name},R.name))]})]}),e.jsxs(Z,{children:[e.jsx(re,{htmlFor:"status",children:"Status"}),e.jsxs(ce,{id:"status",value:d.status,onChange:R=>w("status",R.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(Z,{children:[e.jsx(re,{htmlFor:"q",children:"Query"}),e.jsx(qe,{id:"q",value:d.q,onChange:R=>w("q",R.target.value),placeholder:"metric.fidelity > 0.9"})]}),e.jsxs(Z,{children:[e.jsx(re,{htmlFor:"limit",children:"Limit"}),e.jsxs(ce,{id:"limit",value:d.limit,onChange:R=>w("limit",parseInt(R.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(Z,{className:"flex items-end gap-2",children:[e.jsx(A,{variant:"primary",onClick:()=>m(),children:"Filter"}),h&&e.jsx(I,{})]})]})}),e.jsx(b,{children:h&&!f?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(I,{})}):e.jsx(Ie,{runs:f?.runs??[],onDelete:V,loading:p.loading,baselineRunId:d.project?a?.find(R=>R.name===d.project)?.baseline?.run_id:void 0})}),u&&e.jsx(ve,{message:u.message,variant:u.variant,visible:!!u,onClose:()=>o(null)})]})}function Gs({projects:t,currentWorkspace:r}){if(!t.length)return e.jsx(le,{message:"No projects yet",hint:"Projects are created automatically when you log runs"});const n=a=>{const u=new URLSearchParams({project:a});return r&&u.set("workspace",r.id),`/runs?${u}`};return e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Project"}),e.jsx(N,{children:"Runs"}),e.jsx(N,{children:"Baseline"}),e.jsx(N,{})]})}),e.jsx(q,{children:t.map(a=>e.jsxs(j,{children:[e.jsxs(c,{children:[e.jsx("span",{className:"font-medium",children:a.name}),a.description&&e.jsx("p",{className:"text-muted text-sm",children:qs(a.description)})]}),e.jsx(c,{children:e.jsx(Y,{variant:"gray",children:a.run_count??0})}),e.jsx(c,{children:a.baseline?e.jsxs(e.Fragment,{children:[e.jsx(T.Link,{to:`/runs/${a.baseline.run_id}`,className:"font-mono text-sm",children:Q(a.baseline.run_id)}),a.baseline.run_name&&e.jsx("p",{className:"text-muted text-sm",children:a.baseline.run_name})]}):e.jsx("span",{className:"text-muted",children:"—"})}),e.jsx(c,{className:"text-right",children:e.jsx(T.Link,{to:n(a.name),children:e.jsx(A,{variant:"secondary",size:"sm",children:"View Runs"})})})]},a.name))})]})}function Ws({groups:t}){return t.length?e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Group ID"}),e.jsx(N,{children:"Name"}),e.jsx(N,{children:"Project"}),e.jsx(N,{children:"Runs"}),e.jsx(N,{children:"Actions"})]})}),e.jsx(q,{children:t.map(r=>e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:Q(r.group_id)}),e.jsx(c,{children:r.group_name||"—"}),e.jsx(c,{children:r.project}),e.jsx(c,{children:e.jsx(Y,{variant:"gray",children:r.run_count})}),e.jsx(c,{children:e.jsx(T.Link,{to:`/groups/${r.group_id}`,children:e.jsx(A,{variant:"secondary",size:"sm",children:"View Runs"})})})]},r.group_id))})]}):e.jsx(le,{message:"No groups found",hint:"Groups are created when runs have a group_id set"})}function $t({runId:t,runName:r,variant:n="secondary",size:a="sm",className:u="",apiBaseUrl:o=""}){const[d,i]=g.useState({status:"idle"}),[f,h]=g.useState(!1),[m,p]=g.useState(null),w=async()=>{i({status:"preparing",message:"Preparing bundle..."}),h(!0);try{const k=await fetch(`${o}/api/runs/${t}/export`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!k.ok){const ae=await k.json().catch(()=>({detail:"Export failed"}));throw new Error(ae.detail||`Export failed: ${k.statusText}`)}const $=await k.json();i({status:"packing",message:"Creating bundle...",artifactCount:$.artifact_count,objectCount:$.object_count}),i(ae=>({...ae,status:"downloading",message:"Downloading bundle..."}));const P=await fetch(`${o}/api/runs/${t}/export/download`);if(!P.ok)throw new Error("Download failed");const te=await P.blob(),ne=r?`${r.replace(/[^a-zA-Z0-9_-]/g,"_")}_${t.slice(0,8)}.zip`:`run_${t.slice(0,8)}.zip`,J=URL.createObjectURL(te),ee=document.createElement("a");ee.href=J,ee.download=ne,document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),URL.revokeObjectURL(J),i({status:"complete",message:"Export complete!",bundleSize:te.size,artifactCount:$.artifact_count,objectCount:$.object_count}),p({message:"Bundle downloaded successfully",variant:"success"}),setTimeout(()=>{h(!1),i({status:"idle"})},2e3)}catch(k){const $=k instanceof Error?k.message:"Export failed";i({status:"error",message:$}),p({message:$,variant:"error"})}},V=()=>{d.status!=="preparing"&&d.status!=="packing"&&d.status!=="downloading"&&(h(!1),i({status:"idle"}))},R=k=>k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/(1024*1024)).toFixed(1)} MB`,K=["preparing","packing","downloading"].includes(d.status);return e.jsxs(e.Fragment,{children:[e.jsxs(A,{variant:n,size:a,onClick:w,disabled:K,className:u,children:[K&&e.jsx(I,{}),e.jsx(Lt,{}),"Export"]}),e.jsx(Be,{open:f,onClose:V,title:"Export Run",actions:d.status==="error"||d.status==="complete"?e.jsx(A,{variant:"secondary",onClick:V,children:"Close"}):void 0,children:e.jsxs("div",{className:"py-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[d.status==="error"?e.jsx("div",{className:"w-10 h-10 rounded-full bg-[var(--dq-danger-bg)] flex items-center justify-center",children:e.jsx(qt,{})}):d.status==="complete"?e.jsx("div",{className:"w-10 h-10 rounded-full bg-[var(--dq-success-bg)] flex items-center justify-center",children:e.jsx(Bt,{})}):e.jsx("div",{className:"w-10 h-10 rounded-full bg-[var(--dq-primary-bg)] flex items-center justify-center",children:e.jsx(I,{})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:d.message}),d.status==="error"&&e.jsx("p",{className:"text-sm text-[var(--dq-text-muted)]",children:"Please try again or contact support."})]})]}),(d.artifactCount!==void 0||d.objectCount!==void 0||d.bundleSize!==void 0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 mt-4",children:[d.artifactCount!==void 0&&e.jsxs(Y,{variant:"gray",children:[d.artifactCount," artifacts"]}),d.objectCount!==void 0&&e.jsxs(Y,{variant:"gray",children:[d.objectCount," objects"]}),d.bundleSize!==void 0&&e.jsx(Y,{variant:"info",children:R(d.bundleSize)})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-[var(--dq-border-light)]",children:[e.jsxs("p",{className:"text-sm text-[var(--dq-text-muted)]",children:["Run ID: ",e.jsx("code",{className:"text-xs",children:t})]}),r&&e.jsxs("p",{className:"text-sm text-[var(--dq-text-muted)]",children:["Name: ",r]})]})]})}),m&&e.jsx(ve,{message:m.message,variant:m.variant,visible:!!m,onClose:()=>p(null)})]})}function Lt(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function Bt(){return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--dq-success)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function qt(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--dq-danger)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}function Vs(){const{runId:t}=T.useParams(),r=T.useNavigate(),{api:n}=H(),{data:a,loading:u,error:o,refetch:d}=Ze(t),{data:i,refetch:f}=Ee(),[h,m]=g.useState(!1),[p,w]=g.useState(null),{mutate:V,loading:R}=pe(()=>n.setBaseline(a.project,a.run_id)),{mutate:K,loading:k}=pe(()=>n.deleteRun(t)),P=i?.find(_=>_.name===a?.project)?.baseline?.run_id===t;if(g.useEffect(()=>{if(p){const _=setTimeout(()=>w(null),3e3);return()=>clearTimeout(_)}},[p]),u)return e.jsx(W,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(I,{})})});if(o||!a)return e.jsx(W,{children:e.jsx(b,{children:e.jsx(le,{message:"Run not found",hint:o?.message||`Run ${t} does not exist`})})});const te=a.backend||{},ne=a.fingerprints||{},J=a.data?.params||{},ee=a.data?.metrics||{},ae=a.data?.tags||{},xe=a.artifacts||[],be=a.errors||[],Me=async()=>{try{await V(),await f(),d(),w({message:"Baseline updated",variant:"success"})}catch{w({message:"Failed to set baseline",variant:"error"})}},Ue=async()=>{try{await K(),m(!1),w({message:"Run deleted",variant:"success"}),setTimeout(()=>r("/runs"),1e3)}catch{w({message:"Failed to delete run",variant:"error"}),m(!1)}},Se=async _=>{const D=xe[_];try{const oe=n.getArtifactDownloadUrl(a.run_id,_),ye=await fetch(oe);if(!ye.ok)throw new Error("Download failed");const ke=await ye.blob(),de=document.createElement("a");de.href=URL.createObjectURL(ke),de.download=D?.kind||`artifact-${_}`,de.click(),URL.revokeObjectURL(de.href),w({message:"Download started",variant:"success"})}catch{w({message:"Download failed",variant:"error"})}};return e.jsxs(W,{children:[P&&e.jsxs("div",{className:"mb-4 px-4 py-3 bg-[#EFF6FF] border border-[#2563EB]/20 rounded-md text-[#2563EB] text-sm font-medium",children:['This run is the current baseline for project "',a.project,'"']}),e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:a.run_name||"Unnamed Run"}),e.jsx("p",{className:"text-muted text-sm font-mono",children:a.run_id})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx($t,{runId:a.run_id,runName:a.run_name}),!P&&e.jsxs(A,{variant:"secondary",size:"sm",onClick:Me,disabled:R,children:[R&&e.jsx(I,{}),"Set as Baseline"]}),e.jsx(A,{variant:"ghost-danger",size:"sm",onClick:()=>m(!0),children:"Delete"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Overview"})}),e.jsx($e,{items:[{label:"Project",value:e.jsx(T.Link,{to:`/runs?project=${a.project}`,children:a.project})},{label:"Name",value:a.run_name||"—"},{label:"Adapter",value:a.adapter||"N/A"},{label:"Status",value:e.jsx(ss,{status:a.status})},{label:"Created",value:`${a.created_at} (${Le(a.created_at)})`},{label:"Backend",value:te.name||"N/A"},...a.group_id?[{label:"Group",value:e.jsx(T.Link,{to:`/groups/${a.group_id}`,children:a.group_name||Q(a.group_id)})}]:[]]})]}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Fingerprints"})}),e.jsx($e,{items:[{label:"Run",value:e.jsx("span",{className:"font-mono text-sm truncate",children:ne.run||"N/A"})},{label:"Program",value:e.jsx("span",{className:"font-mono text-sm truncate",children:ne.program||"N/A"})}]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Parameters"})}),Object.keys(J).length?e.jsx(B,{children:e.jsx(q,{children:Object.entries(J).map(([_,D])=>e.jsxs(j,{children:[e.jsx(c,{children:_}),e.jsx(c,{className:"font-mono",children:String(D)})]},_))})}):e.jsx("p",{className:"text-muted",children:"No parameters"})]}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Metrics"})}),Object.keys(ee).length?e.jsx(B,{children:e.jsx(q,{children:Object.entries(ee).map(([_,D])=>e.jsxs(j,{children:[e.jsx(c,{children:_}),e.jsx(c,{className:"font-mono",children:typeof D=="number"?Ls(D):String(D)})]},_))})}):e.jsx("p",{className:"text-muted",children:"No metrics"})]}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Tags"})}),Object.keys(ae).length?e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(ae).map(([_,D])=>e.jsxs(Y,{variant:"gray",children:[_,": ",String(D)]},_))}):e.jsx("p",{className:"text-muted",children:"No tags"})]})]}),e.jsxs(b,{className:"mb-4",children:[e.jsx(U,{children:e.jsxs(G,{children:["Artifacts (",xe.length,")"]})}),xe.length?e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"#"}),e.jsx(N,{children:"Kind"}),e.jsx(N,{children:"Role"}),e.jsx(N,{children:"Media Type"}),e.jsx(N,{children:"Digest"}),e.jsx(N,{children:"Actions"})]})}),e.jsx(q,{children:xe.map((_,D)=>e.jsxs(j,{children:[e.jsx(c,{children:D}),e.jsx(c,{className:"font-mono text-sm",children:_.kind}),e.jsx(c,{children:e.jsx(Y,{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/${a.run_id}/artifacts/${D}`,children:e.jsx(A,{variant:"secondary",size:"sm",children:"View"})}),e.jsx(A,{variant:"secondary",size:"sm",onClick:()=>Se(D),children:"Download"})]})})]},D))})]}):e.jsx("p",{className:"text-muted",children:"No artifacts"})]}),be.length>0&&e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{className:"text-danger",children:"Errors"})}),be.map((_,D)=>e.jsxs("div",{className:"mb-2",children:[e.jsx("strong",{children:_.type}),": ",_.message,_.traceback&&e.jsx("pre",{className:"mt-2",children:_.traceback})]},D))]}),e.jsxs(Be,{open:h,onClose:()=>m(!1),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"secondary",onClick:()=>m(!1),children:"Cancel"}),e.jsxs(A,{variant:"danger",onClick:Ue,disabled:k,children:[k&&e.jsx(I,{}),"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:Q(a.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]}),p&&e.jsx(ve,{message:p.message,variant:p.variant,visible:!!p,onClose:()=>w(null)})]})}function zs(){const{currentWorkspace:t}=H(),{data:r,loading:n}=Ee();return e.jsxs(W,{children:[e.jsx(ge,{title:"Projects"}),e.jsx(b,{children:n?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(I,{})}):e.jsx(Gs,{projects:r??[],currentWorkspace:t})})]})}function Ys(){const[t,r]=T.useSearchParams(),{data:n}=Ee(),[a,u]=g.useState(t.get("project")||""),{data:o,loading:d,refetch:i}=As({project:a||void 0}),f=g.useCallback(h=>{u(h);const m=new URLSearchParams(t);h?m.set("project",h):m.delete("project"),r(m,{replace:!0})},[t,r]);return e.jsxs(W,{children:[e.jsx(ge,{title:"Run Groups"}),e.jsx(b,{className:"mb-4",children:e.jsxs(es,{children:[e.jsxs(Z,{children:[e.jsx(re,{htmlFor:"project",children:"Project"}),e.jsxs(ce,{id:"project",value:a,onChange:h=>f(h.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),n?.map(h=>e.jsx("option",{value:h.name,children:h.name},h.name))]})]}),e.jsxs(Z,{className:"flex items-end gap-2",children:[e.jsx(A,{variant:"primary",onClick:()=>i(),children:"Filter"}),d&&e.jsx(I,{})]})]})}),e.jsx(b,{children:d&&!o?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(I,{})}):e.jsx(Ws,{groups:o??[]})})]})}function Hs(){const{groupId:t}=T.useParams(),{api:r}=H(),{data:n,loading:a,error:u,refetch:o}=Fs(t),[d,i]=g.useState(null),f=pe(m=>r.deleteRun(m));g.useEffect(()=>{if(d){const m=setTimeout(()=>i(null),3e3);return()=>clearTimeout(m)}},[d]);const h=async m=>{try{await f.mutate(m),i({message:"Run deleted",variant:"success"}),o()}catch{i({message:"Failed to delete run",variant:"error"})}};return a?e.jsx(W,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(I,{})})}):u||!n?e.jsx(W,{children:e.jsx(b,{children:e.jsx(le,{message:"Group not found",hint:u?.message})})}):e.jsxs(W,{children:[e.jsx(ge,{title:e.jsxs(e.Fragment,{children:["Group ",e.jsx("span",{className:"font-mono",children:Q(t)})]}),subtitle:e.jsx("span",{className:"font-mono text-muted",children:t})}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsxs(G,{children:["Runs in Group (",n.runs.length,")"]})}),e.jsx(Ie,{runs:n.runs,onDelete:h,loading:f.loading})]}),d&&e.jsx(ve,{message:d.message,variant:d.variant,visible:!!d,onClose:()=>i(null)})]})}function It({className:t=""}){return e.jsx("svg",{className:t,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Mt({className:t=""}){return e.jsxs("svg",{className:t,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Ut({className:t=""}){return e.jsxs("svg",{className:t,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function Xe({className:t=""}){return e.jsxs("svg",{className:t,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}function Re({match:t}){return t?e.jsxs("span",{className:"diff-match inline-flex items-center gap-1.5",children:[e.jsx(It,{className:"flex-shrink-0"}),e.jsx("span",{className:"font-medium",children:"Match"})]}):e.jsxs("span",{className:"diff-mismatch inline-flex items-center gap-1.5",children:[e.jsx(Mt,{className:"flex-shrink-0"}),e.jsx("span",{className:"font-medium",children:"Different"})]})}function Gt({warnings:t}){return!t||t.length===0?null:e.jsx("div",{className:"alert alert-warning mb-4",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(Ut,{className:"flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold mb-1",children:t.length===1?"Warning":`${t.length} Warnings`}),e.jsx("ul",{className:"space-y-1",children:t.map((r,n)=>e.jsx("li",{className:"text-sm",children:r},n))})]})]})})}function Cs({label:t,run:r,variant:n}){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:`absolute top-0 left-0 w-1 h-full rounded-l ${n==="a"?"bg-info":"bg-primary"}`}),e.jsxs("div",{className:"pl-4",children:[e.jsx("p",{className:`text-xs font-semibold uppercase tracking-wider mb-2 ${n==="a"?"text-info":"text-primary"}`,children:t}),e.jsx(T.Link,{to:`/runs/${r.run_id}`,className:"text-base font-medium hover:underline",children:r.run_name||"Unnamed Run"}),e.jsx("p",{className:"font-mono text-xs mt-1 text-muted",children:Q(r.run_id)}),e.jsxs("p",{className:"text-sm mt-1 text-muted",children:[r.project," · ",Le(r.created_at)]})]})]})}function ie({children:t,badge:r}){return e.jsx(U,{children:e.jsx(G,{children:e.jsxs("span",{className:"flex items-center gap-2 flex-wrap",children:[t,r&&e.jsx(Y,{variant:r.variant,children:r.label})]})})})}function Wt({tvd:t,noiseContext:r}){if(t===0)return e.jsx("p",{className:"text-sm mt-4 text-success",children:"✓ Distributions are identical (TVD = 0)"});if(!r)return null;const{p_value:n,noise_ratio:a}=r;return n!=null?n>=.1?e.jsx("p",{className:"text-sm mt-4 text-success",children:"✓ Consistent with sampling noise — difference is not statistically significant"}):n>=.05?e.jsxs("p",{className:"text-sm mt-4 text-warning",children:["⚠ Borderline (p=",n.toFixed(2),") — consider increasing shots"]}):e.jsxs("p",{className:"text-sm mt-4 text-danger",children:["✗ Statistically significant difference (p=",n.toFixed(2),") — results show meaningful divergence"]}):a!=null?a<1.5?e.jsx("p",{className:"text-sm mt-4 text-success",children:"✓ TVD is within expected shot noise range"}):a<3?e.jsxs("p",{className:"text-sm mt-4 text-warning",children:["⚠ Ambiguous (",a.toFixed(1),"× expected noise) — consider increasing shots"]}):e.jsxs("p",{className:"text-sm mt-4 text-danger",children:["✗ TVD exceeds expected noise (",a.toFixed(1),"×) — results show meaningful differences"]}):null}function Vt(){const[t,r]=T.useSearchParams(),{data:n}=Qe({limit:100}),a=n?.runs??[],[u,o]=g.useState(t.get("a")||""),[d,i]=g.useState(t.get("b")||""),[f,h]=g.useState(""),m=p=>{if(p.preventDefault(),!u||!d){h("Please select both runs to compare");return}if(u===d){h("Please select two different runs");return}h(""),r({a:u,b:d})};return e.jsxs(e.Fragment,{children:[e.jsx(b,{children:e.jsxs("form",{onSubmit:m,children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(Z,{children:[e.jsx(re,{htmlFor:"a",children:"Run A (Baseline)"}),e.jsxs(ce,{id:"a",value:u,onChange:p=>{o(p.target.value),h("")},children:[e.jsx("option",{value:"",children:"Select run..."}),a.map(p=>e.jsxs("option",{value:p.run_id,children:[p.run_name||"Unnamed"," (",Q(p.run_id),") — ",p.project]},p.run_id))]})]}),e.jsxs(Z,{children:[e.jsx(re,{htmlFor:"b",children:"Run B (Candidate)"}),e.jsxs(ce,{id:"b",value:d,onChange:p=>{i(p.target.value),h("")},children:[e.jsx("option",{value:"",children:"Select run..."}),a.map(p=>e.jsxs("option",{value:p.run_id,children:[p.run_name||"Unnamed"," (",Q(p.run_id),") — ",p.project]},p.run_id))]})]})]}),f&&e.jsx("p",{className:"text-sm mb-3 text-danger",children:f}),e.jsx(A,{type:"submit",variant:"primary",children:"Compare"})]})}),e.jsxs(b,{className:"mt-4",children:[e.jsx(U,{children:e.jsx(G,{children:"How it works"})}),e.jsxs("div",{className:"space-y-2 text-sm text-muted",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Xe,{className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{children:"Select two runs to compare their parameters, metrics, and artifacts"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Xe,{className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{children:"The diff shows changed values and computes TVD for result distributions"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Xe,{className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{children:"You can also compare from the run detail page"})]})]})]})]})}function zt({runIdA:t,runIdB:r}){const{data:n,loading:a,error:u}=Os(t,r);if(a)return e.jsx(b,{children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[e.jsx(I,{}),e.jsx("p",{className:"text-sm text-muted",children:"Comparing runs..."})]})});if(u||!n)return e.jsx(b,{children:e.jsx(le,{message:"Failed to load diff",hint:u?.message})});const{run_a:o,run_b:d,report:i}=n,f=i.device_drift?.significant_drift?{variant:"warning",label:"Drift Detected"}:i.device_drift?.has_calibration_data?{variant:"success",label:"Stable"}:{variant:"gray",label:"No Data"};return e.jsxs(e.Fragment,{children:[e.jsx(Gt,{warnings:i.warnings||[]}),e.jsx(b,{className:"mb-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(Cs,{label:"Run A (Baseline)",run:o,variant:"a"}),e.jsx(Cs,{label:"Run B (Candidate)",run:d,variant:"b"})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(b,{children:[e.jsx(ie,{children:"Metadata"}),e.jsx(B,{children:e.jsxs(q,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Project"}),e.jsx(c,{children:e.jsx(Re,{match:i.metadata.project_match})})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Backend"}),e.jsx(c,{children:e.jsx(Re,{match:i.metadata.backend_match})})]}),!i.metadata.project_match&&e.jsxs(e.Fragment,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"text-sm text-muted",children:"Project A"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.project_a||"N/A"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"text-sm text-muted",children:"Project B"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.project_b||"N/A"})]})]}),!i.metadata.backend_match&&e.jsxs(e.Fragment,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"text-sm text-muted",children:"Backend A"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.backend_a||"N/A"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"text-sm text-muted",children:"Backend B"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.backend_b||"N/A"})]})]})]})})]}),e.jsxs(b,{children:[e.jsx(ie,{children:"Fingerprints"}),e.jsx(B,{children:e.jsxs(q,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono text-sm",children:Oe(i.fingerprints.a)})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono text-sm",children:Oe(i.fingerprints.b)})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Match"}),e.jsx(c,{children:e.jsx(Re,{match:i.fingerprints.a===i.fingerprints.b})})]})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(b,{children:[e.jsx(ie,{badge:{variant:i.program.exact_match?"success":i.program.structural_match?"info":"warning",label:i.program.exact_match?"Exact Match":i.program.structural_match?"Structural Match":"Different"},children:"Program"}),e.jsx(B,{children:e.jsxs(q,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Exact Match"}),e.jsx(c,{children:e.jsx(Re,{match:i.program.exact_match})})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Structural Match"}),e.jsx(c,{children:e.jsx(Re,{match:i.program.structural_match})})]})]})})]}),e.jsxs(b,{children:[e.jsx(ie,{badge:f,children:"Device Calibration"}),i.device_drift?.significant_drift?e.jsx("p",{className:"text-sm text-warning",children:"Significant calibration drift detected between runs"}):i.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(b,{className:"mb-4",children:[e.jsx(ie,{badge:{variant:i.params.match?"success":"warning",label:i.params.match?"Match":"Different"},children:"Parameters"}),i.params.match?e.jsx("p",{className:"text-muted",children:"All parameters match"}):e.jsx(e.Fragment,{children:i.params.changed&&Object.keys(i.params.changed).length>0&&e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Parameter"}),e.jsx(N,{children:"Run A"}),e.jsx(N,{children:"Run B"})]})}),e.jsx(q,{children:Object.entries(i.params.changed).map(([h,m])=>e.jsxs(j,{children:[e.jsx(c,{children:h}),e.jsx(c,{className:"font-mono",children:String(m.a)}),e.jsx(c,{className:"font-mono",children:String(m.b)})]},h))})]})})]}),e.jsxs(b,{className:"mb-4",children:[e.jsx(ie,{badge:{variant:i.metrics.match?"success":"warning",label:i.metrics.match?"Match":"Different"},children:"Metrics"}),i.metrics.match?e.jsx("p",{className:"text-muted",children:"All metrics match"}):e.jsx(e.Fragment,{children:i.metrics.changed&&Object.keys(i.metrics.changed).length>0&&e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Metric"}),e.jsx(N,{children:"Run A"}),e.jsx(N,{children:"Run B"})]})}),e.jsx(q,{children:Object.entries(i.metrics.changed).map(([h,m])=>e.jsxs(j,{children:[e.jsx(c,{children:h}),e.jsx(c,{className:"font-mono",children:m.a}),e.jsx(c,{className:"font-mono",children:m.b})]},h))})]})})]}),i.circuit_diff&&e.jsxs(b,{className:"mb-4",children:[e.jsx(ie,{badge:{variant:i.circuit_diff.match?"success":"warning",label:i.circuit_diff.match?"Match":"Different"},children:"Circuit"}),i.circuit_diff.match?e.jsx("p",{className:"text-muted",children:"Circuit structure matches"}):e.jsxs("div",{className:"space-y-4",children:[i.circuit_diff.changed&&Object.keys(i.circuit_diff.changed).length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2 text-muted",children:"Changed Properties"}),e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Property"}),e.jsx(N,{children:"Run A"}),e.jsx(N,{children:"Run B"}),e.jsx(N,{children:"Delta"})]})}),e.jsx(q,{children:Object.entries(i.circuit_diff.changed).map(([h,m])=>e.jsxs(j,{children:[e.jsx(c,{children:m.label||h}),e.jsx(c,{className:"font-mono",children:String(m.a)}),e.jsx(c,{className:"font-mono",children:String(m.b)}),e.jsx(c,{className:"font-mono",children:m.delta!=null&&e.jsxs("span",{className:m.delta>0?"text-danger":"text-success",children:[m.delta>0?"+":"",m.delta,m.pct!=null&&` (${m.pct>0?"+":""}${m.pct.toFixed(1)}%)`]})})]},h))})]})]}),i.circuit_diff.is_clifford_changed&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2 text-muted",children:"Clifford Status"}),e.jsx(B,{children:e.jsxs(q,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono",children:i.circuit_diff.is_clifford_a!=null?String(i.circuit_diff.is_clifford_a):"unknown"})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono",children:i.circuit_diff.is_clifford_b!=null?String(i.circuit_diff.is_clifford_b):"unknown"})]})]})})]}),i.circuit_diff.added_gates&&i.circuit_diff.added_gates.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2 text-muted",children:"New Gate Types (in B)"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:i.circuit_diff.added_gates.map(h=>e.jsx(Y,{variant:"success",children:h},h))})]}),i.circuit_diff.removed_gates&&i.circuit_diff.removed_gates.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2 text-muted",children:"Removed Gate Types (from A)"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:i.circuit_diff.removed_gates.map(h=>e.jsx(Y,{variant:"danger",children:h},h))})]})]})]}),i.tvd!=null&&e.jsxs(b,{className:"mb-4",children:[e.jsx(ie,{children:"Results Distribution"}),e.jsx(B,{children:e.jsxs(q,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Total Variation Distance (TVD)"}),e.jsx(c,{className:"font-mono font-medium",children:i.tvd.toFixed(6)})]}),i.shots&&e.jsxs(j,{children:[e.jsx(c,{children:"Total Shots (A / B)"}),e.jsxs(c,{className:"font-mono",children:[i.shots.a," / ",i.shots.b]})]}),i.noise_context?.noise_p95&&e.jsxs(j,{children:[e.jsx(c,{children:"Noise Threshold (p95)"}),e.jsx(c,{className:"font-mono",children:i.noise_context.noise_p95.toFixed(6)})]}),i.noise_context?.p_value!=null&&e.jsxs(j,{children:[e.jsx(c,{children:"p-value"}),e.jsx(c,{className:"font-mono",children:i.noise_context.p_value.toFixed(4)})]})]})}),e.jsx(Wt,{tvd:i.tvd,noiseContext:i.noise_context})]})]})}function Ks(){const[t]=T.useSearchParams(),r=t.get("a"),n=t.get("b"),a=r&&n;return e.jsxs(W,{children:[e.jsx("div",{className:"page-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:"Compare Runs"}),a&&e.jsx("p",{className:"text-sm mt-1 text-muted",children:e.jsx(T.Link,{to:"/diff",children:"← Select different runs"})})]})}),a?e.jsx(zt,{runIdA:r,runIdB:n}):e.jsx(Vt,{})]})}function Js(){const{api:t}=H(),[r,n]=g.useState(""),[a,u]=g.useState(null),[o,d]=g.useState(!1),[i,f]=g.useState(""),{mutate:h,loading:m}=pe(async()=>{const w=await t.listRuns({q:r,limit:100});return u(w.runs),d(!0),w}),p=w=>{if(w.preventDefault(),!r.trim()){f("Please enter a search query");return}f(""),h()};return e.jsxs(W,{children:[e.jsx("div",{className:"page-header",children:e.jsx("h1",{className:"page-title",children:"Search Runs"})}),e.jsx(b,{className:"mb-4",children:e.jsxs("form",{onSubmit:p,children:[e.jsxs(Z,{children:[e.jsx(re,{htmlFor:"q",children:"Query"}),e.jsx(qe,{id:"q",type:"text",value:r,onChange:w=>{n(w.target.value),f("")},placeholder:"metric.fidelity > 0.95 and params.shots = 1000",className:"font-mono"})]}),i&&e.jsx("p",{className:"text-sm text-[#DC4A4A] mb-3",children:i}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs(A,{type:"submit",variant:"primary",disabled:m,children:[m&&e.jsx(I,{}),"Search"]}),m&&e.jsx("span",{className:"text-muted text-sm",children:"Searching..."})]})]})}),o&&a&&e.jsx(b,{className:"mb-4",children:a.length>0?e.jsx(Ie,{runs:a}):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(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Query Syntax"})}),e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Field"}),e.jsx(N,{children:"Description"})]})}),e.jsxs(q,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"params.X"}),e.jsx(c,{children:"Parameter value"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"metric.X"}),e.jsx(c,{children:"Metric value"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"tags.X"}),e.jsx(c,{children:"Tag value"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"status"}),e.jsx(c,{children:"Run status"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"project"}),e.jsx(c,{children:"Project name"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"backend"}),e.jsx(c,{children:"Backend name"})]})]})]})]}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Operators"})}),e.jsxs(B,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Operator"}),e.jsx(N,{children:"Description"})]})}),e.jsxs(q,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"="}),e.jsx(c,{children:"Equals"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"!="}),e.jsx(c,{children:"Not equals"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:">"}),e.jsx(c,{children:"Greater than"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:">="}),e.jsx(c,{children:"Greater or equal"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"<"}),e.jsx(c,{children:"Less than"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"<="}),e.jsx(c,{children:"Less or equal"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"~"}),e.jsx(c,{children:"Contains"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"and"}),e.jsx(c,{children:"Combine conditions"})]})]})]})]})]}),e.jsxs(b,{className:"mt-4",children:[e.jsx(U,{children:e.jsx(G,{children:"Examples"})}),e.jsx(B,{children:e.jsxs(q,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"metric.fidelity > 0.95"}),e.jsx(c,{children:"High fidelity runs"})]}),e.jsxs(j,{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(j,{children:[e.jsx(c,{className:"font-mono",children:"tags.backend ~ ibm"}),e.jsx(c,{children:"Runs with IBM backends"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"metric.error < 0.01"}),e.jsx(c,{children:"Low error runs"})]}),e.jsxs(j,{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 Xs(){const{runId:t,index:r}=T.useParams(),n=parseInt(r,10),{api:a}=H(),{data:u}=Ze(t),{data:o,loading:d,error:i}=$s(t,n),[f,h]=g.useState(null);g.useEffect(()=>{if(f){const P=setTimeout(()=>h(null),3e3);return()=>clearTimeout(P)}},[f]);const m=async()=>{try{const P=a.getArtifactDownloadUrl(t,n),te=await fetch(P);if(!te.ok)throw new Error("Download failed");const ne=await te.blob(),J=document.createElement("a");J.href=URL.createObjectURL(ne),J.download=p?.kind||`artifact-${n}`,J.click(),URL.revokeObjectURL(J.href),h({message:"Download started",variant:"success"})}catch{h({message:"Download failed",variant:"error"})}};if(d)return e.jsx(W,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(I,{})})});if(i||!o)return e.jsx(W,{children:e.jsx(b,{children:e.jsx(le,{message:"Artifact not found",hint:i?.message})})});const{artifact:p,size:w,content:V,content_json:R,preview_available:K,error:k}=o,$=10*1024*1024;return e.jsxs(W,{children:[e.jsx(ge,{title:p.kind,subtitle:e.jsxs(e.Fragment,{children:["← Back to run ",e.jsxs(T.Link,{to:`/runs/${t}`,children:[Q(t),u?.run_name&&` — ${u.run_name}`]})]}),actions:e.jsx(A,{variant:"primary",onClick:m,children:"Download"})}),e.jsx(b,{className:"mb-4",children:e.jsx($e,{items:[{label:"Kind",value:e.jsx("span",{className:"font-mono",children:p.kind})},{label:"Role",value:e.jsx(Y,{variant:"gray",children:p.role})},{label:"Media Type",value:p.media_type},{label:"Digest",value:e.jsx("span",{className:"font-mono text-sm",children:p.digest})},{label:"Size",value:Ce(w)}]})}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{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(A,{variant:"primary",onClick:m,children:"Download to view"})})]}):K?R?e.jsx("pre",{children:Bs(R)}):V?e.jsx("pre",{children:V}):e.jsxs("p",{className:"text-muted",children:["Binary content (",Ce(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"})," (",Ce(w)," exceeds ",Ce($)," 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(A,{variant:"primary",onClick:m,children:"Download"})})]})]}),f&&e.jsx(ve,{message:f.message,variant:f.variant,visible:!!f,onClose:()=>h(null)})]})}const Qs=[{path:"/",element:e.jsx(T.Navigate,{to:"/runs",replace:!0})},{path:"/runs",element:e.jsx(Us,{})},{path:"/runs/:runId",element:e.jsx(Vs,{})},{path:"/runs/:runId/artifacts/:index",element:e.jsx(Xs,{})},{path:"/projects",element:e.jsx(zs,{})},{path:"/groups",element:e.jsx(Ys,{})},{path:"/groups/:groupId",element:e.jsx(Hs,{})},{path:"/diff",element:e.jsx(Ks,{})},{path:"/search",element:e.jsx(Js,{})}];function ts(t=[]){return T.createBrowserRouter([...Qs,...t])}const Zs=ts();function Yt({additionalRoutes:t,...r}){const n=t?.length?ts(t):Zs;return e.jsx(Ds,{...r,children:e.jsx(T.RouterProvider,{router:n})})}exports.Alert=Ot;exports.ApiClient=Es;exports.ApiError=je;exports.App=Yt;exports.AppProvider=Ds;exports.ArtifactPage=Xs;exports.Badge=Y;exports.Button=A;exports.Card=b;exports.CardHeader=U;exports.CardTitle=G;exports.DiffPage=Ks;exports.EmptyState=le;exports.FormGroup=Z;exports.FormRow=es;exports.GroupDetailPage=Hs;exports.GroupsPage=Ys;exports.GroupsTable=Ws;exports.Input=qe;exports.KVList=$e;exports.Label=re;exports.Layout=W;exports.LayoutConfigProvider=Ft;exports.Modal=Be;exports.PageHeader=ge;exports.ProjectsPage=zs;exports.ProjectsTable=Gs;exports.RunDetailPage=Vs;exports.RunsPage=Us;exports.RunsTable=Ie;exports.SearchPage=Js;exports.Select=ce;exports.Spinner=I;exports.StatusBadge=ss;exports.Table=B;exports.TableBody=q;exports.TableCell=c;exports.TableHead=se;exports.TableHeader=N;exports.TableRow=j;exports.ThemeProvider=Pt;exports.Toast=ve;exports.api=Ss;exports.buildUrl=Dt;exports.cn=L;exports.coreRoutes=Qs;exports.createRouter=ts;exports.formatBytes=Ce;exports.formatNumber=Ls;exports.jsonPretty=Bs;exports.router=Zs;exports.shortDigest=Oe;exports.shortId=Q;exports.timeAgo=Le;exports.truncate=qs;exports.useApp=H;exports.useArtifact=$s;exports.useDiff=Os;exports.useGroup=Fs;exports.useGroups=As;exports.useLayoutConfig=Ms;exports.useMutation=pe;exports.useProjects=Ee;exports.useRun=Ze;exports.useRuns=Qe;exports.useTheme=Ps;exports.useThemeOptional=Tt;
|
|
14
|
+
<%s key={someKey} {...props} />`,Qe,de,ks,de),Et[de+Qe]=!0}}return s===n?Es(F):Rs(F),F}}function Ss(s,l,x){return St(s,l,x,!0)}function Cs(s,l,x){return St(s,l,x,!1)}var Ts=Cs,Ps=Ss;we.Fragment=n,we.jsx=Ts,we.jsxs=Ps})()),we}var Pt;function Fs(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?Oe.exports=As():Oe.exports=Ls()),Oe.exports}var e=Fs();class je extends Error{constructor(r,a){super(a),this.status=r,this.name="ApiError"}}class Dt{baseUrl;headers;constructor(r={}){this.baseUrl=r.baseUrl??"",this.headers={"Content-Type":"application/json",...r.headers}}async request(r,a,n={}){let o=`${this.baseUrl}${a}`;if(n.params){const u=new URLSearchParams;Object.entries(n.params).forEach(([f,h])=>{h!=null&&h!==""&&u.set(f,String(h))});const i=u.toString();i&&(o+=`?${i}`)}const d=await fetch(o,{method:r,headers:this.headers,body:n.body?JSON.stringify(n.body):void 0});if(!d.ok){const u=await d.json().catch(()=>({detail:"Unknown error"}));throw new je(d.status,u.detail||d.statusText)}if(!(d.status===204||d.headers.get("content-length")==="0"))return d.json()}async getCapabilities(){return this.request("GET","/api/v1/capabilities")}async listRuns(r){return this.request("GET","/api/runs",{params:r})}async getRun(r){return this.request("GET",`/api/runs/${r}`)}async deleteRun(r){await this.request("DELETE",`/api/runs/${r}`)}async setBaseline(r,a){return this.request("POST",`/api/projects/${r}/baseline/${a}`,{params:{redirect:"false"}})}async listProjects(r){return this.request("GET","/api/projects",{params:r})}async listGroups(r){return this.request("GET","/api/groups",{params:r})}async getGroup(r){return this.request("GET",`/api/groups/${r}`)}async getDiff(r,a){return this.request("GET","/api/diff",{params:{a:r,b:a}})}async getArtifact(r,a){return this.request("GET",`/api/runs/${r}/artifacts/${a}`)}getArtifactDownloadUrl(r,a){return`${this.baseUrl}/api/runs/${r}/artifacts/${a}/raw`}async createExport(r){return this.request("POST",`/api/runs/${r}/export`)}async getExportInfo(r){return this.request("GET",`/api/runs/${r}/export/info`)}getExportDownloadUrl(r){return`${this.baseUrl}/api/runs/${r}/export/download`}}const At=new Dt;function Q(t){return t?.slice(0,8)??""}function $e(t){return t?.slice(0,12)??"N/A"}function Se(t){const r=new Date(t),n=Math.floor((new Date().getTime()-r.getTime())/1e3);if(n<60)return"just now";if(n<3600){const d=Math.floor(n/60);return`${d} minute${d!==1?"s":""} ago`}if(n<86400){const d=Math.floor(n/3600);return`${d} hour${d!==1?"s":""} ago`}if(n<2592e3){const d=Math.floor(n/86400);return`${d} day${d!==1?"s":""} ago`}if(n<31536e3){const d=Math.floor(n/2592e3);return`${d} month${d!==1?"s":""} ago`}const o=Math.floor(n/31536e3);return`${o} year${o!==1?"s":""} ago`}function Lt(t,r=6){return typeof t!="number"||isNaN(t)?String(t):Number(t.toPrecision(r)).toString()}function Ee(t){return t<1024?`${t} bytes`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}function Ft(t){return JSON.stringify(t,null,2)}function Ot(t,r=60){return t?t.length<=r?t:t.slice(0,r-3)+"...":""}function Os(t,r){const a=new URLSearchParams;Object.entries(r).forEach(([o,d])=>{d!=null&&d!==""&&a.set(o,String(d))});const n=a.toString();return n?`${t}?${n}`:t}function O(...t){return t.filter(Boolean).join(" ")}function et(t,r){const a=new Date(t).getTime(),n=r?new Date(r).getTime():Date.now();return Math.max(0,Math.floor((n-a)/1e3))}function tt(t){if(t<60)return`${t}s`;const r=Math.floor(t/86400),a=Math.floor(t%86400/3600),n=Math.floor(t%3600/60),o=t%60;return r>0?`${r}d ${a}h ${n}m`:a>0?`${a}h ${n}m ${o}s`:`${n}m ${o}s`}function Ie(t){return t==="FINISHED"||t==="FAILED"||t==="KILLED"}const $t=p.createContext(null);function $s({children:t}){const r={theme:"light",resolvedTheme:"light",setTheme:()=>{},toggleTheme:()=>{}};return e.jsx($t.Provider,{value:r,children:t})}function Bt(){const t=p.useContext($t);return t||{theme:"light",resolvedTheme:"light",setTheme:()=>{},toggleTheme:()=>{}}}function Bs(){return Bt()}const st=1e3,It=p.createContext(null);function qt({children:t,api:r=At,initialWorkspace:a=null}){const[n,o]=p.useState(null),[d,u]=p.useState(a);return p.useEffect(()=>{r.getCapabilities().then(o).catch(console.error)},[r]),e.jsx(It.Provider,{value:{api:r,capabilities:n,currentWorkspace:d,setCurrentWorkspace:u},children:t})}function V(){const t=p.useContext(It);if(!t)throw new Error("useApp must be used within AppProvider");return t}function ue(t,r=[]){const[a,n]=p.useState({data:null,loading:!0,error:null}),o=p.useRef(!0),d=p.useRef(t);d.current=t;const u=p.useCallback(async()=>{n(i=>({...i,loading:!0,error:null}));try{const i=await d.current();o.current&&n({data:i,loading:!1,error:null})}catch(i){o.current&&n({data:null,loading:!1,error:i instanceof je?i:new je(500,String(i))})}},[]);return p.useEffect(()=>(o.current=!0,u(),()=>{o.current=!1}),r),{...a,refetch:u}}function rt(t,r,a){p.useEffect(()=>{if(!a)return;const n=setInterval(t,r),o=()=>{document.visibilityState==="visible"&&t()};return document.addEventListener("visibilitychange",o),()=>{clearInterval(n),document.removeEventListener("visibilitychange",o)}},[t,r,a])}function nt(t){const{api:r,currentWorkspace:a}=V(),n=ue(()=>r.listRuns({...t,workspace:a?.id}),[r,a?.id,t?.project,t?.status,t?.q,t?.limit]);return rt(n.refetch,st,!0),n}function at(t){const{api:r}=V(),a=ue(async()=>{const{run:o}=await r.getRun(t);return o},[r,t]),n=a.data?!Ie(a.data.status):!1;return rt(a.refetch,st,n),a}function Ce(){const{api:t,currentWorkspace:r}=V();return ue(async()=>{const{projects:a}=await t.listProjects({workspace:r?.id});return a},[t,r?.id])}function Mt(t){const{api:r,currentWorkspace:a}=V();return ue(async()=>{const{groups:n}=await r.listGroups({...t,workspace:a?.id});return n},[r,a?.id,t?.project])}function Ut(t){const{api:r}=V();return ue(()=>r.getGroup(t),[r,t])}function Gt(t,r){const{api:a}=V();return ue(()=>a.getDiff(t,r),[a,t,r])}function Wt(t,r){const{api:a}=V();return ue(()=>a.getArtifact(t,r),[a,t,r])}function pe(t){const[r,a]=p.useState(!1),[n,o]=p.useState(null);return{mutate:p.useCallback(async(...u)=>{a(!0),o(null);try{return await t(...u)}catch(i){const f=i instanceof je?i:new je(500,String(i));throw o(f),f}finally{a(!1)}},[t]),loading:r,error:n}}const Is=[{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"]}],Vt=p.createContext(null);function qs({config:t,children:r}){return e.jsx(Vt.Provider,{value:t,children:r})}function zt(){return p.useContext(Vt)}function W({children:t,config:r}){const a=k.useLocation(),o={...zt(),...r},d=o?.navLinks??Is,u=[...o?.prependNavLinks??[],...d,...o?.appendNavLinks??[]],i=o?.logo??{text:"devqubit",icon:"⚛"},f=h=>h.matchPaths?h.matchPaths.some(m=>a.pathname.startsWith(m)):a.pathname===h.href;return e.jsxs("div",{className:"dq-layout",children:[e.jsx("header",{className:"dq-header",children:e.jsxs("div",{className:"dq-header-inner",children:[e.jsxs("div",{className:"dq-header-left",children:[e.jsxs(k.Link,{to:"/",className:"dq-logo",children:[i.icon&&e.jsx("span",{className:"dq-logo-icon",children:i.icon}),i.text]}),e.jsx("nav",{className:"dq-nav",children:u.map(h=>e.jsx(k.Link,{to:h.href,className:O("dq-nav-link",f(h)&&"active"),children:h.label},h.href))})]}),e.jsx("div",{className:"dq-header-right",children:o?.headerRight})]})}),e.jsx("main",{className:"dq-main fade-in",children:t})]})}function ge({title:t,subtitle:r,actions:a}){return e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:t}),r&&e.jsx("p",{className:"text-sm text-muted mt-1",children:r})]}),a&&e.jsx("div",{className:"flex gap-2",children:a})]})}function H({variant:t="gray",className:r,children:a,...n}){return e.jsx("span",{className:O("badge",`badge-${t}`,r),...n,children:a})}const D=p.forwardRef(({variant:t="secondary",size:r="default",loading:a,className:n,children:o,disabled:d,...u},i)=>e.jsxs("button",{ref:i,className:O("btn",t==="ghost-danger"?"btn-ghost-danger":`btn-${t}`,r==="sm"&&"btn-sm",n),disabled:d||a,...u,children:[a&&e.jsx(I,{}),o]}));D.displayName="Button";function b({className:t,children:r,...a}){return e.jsx("div",{className:O("card",t),...a,children:r})}function U({className:t,children:r,...a}){return e.jsx("div",{className:O("card-header",t),...a,children:r})}function G({className:t,children:r,...a}){return e.jsx("h3",{className:O("card-title",t),...a,children:r})}function Ms({variant:t="info",className:r,children:a,...n}){return e.jsx("div",{className:O("alert",`alert-${t}`,r),...n,children:a})}function I({className:t,...r}){return e.jsx("span",{className:O("spinner",t),...r})}function le({message:t,hint:r,className:a,...n}){return e.jsxs("div",{className:O("empty-state",a),...n,children:[e.jsx("p",{children:t}),r&&e.jsx("p",{className:"text-sm text-muted mt-2",children:r})]})}function Be({items:t,className:r,...a}){return e.jsx("dl",{className:O("kv-list",r),...a,children:t.map(({label:n,value:o})=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{children:n}),e.jsx("dd",{children:o})]},n))})}function qe({open:t,onClose:r,title:a,children:n,actions:o}){return t?e.jsx("div",{className:O("modal-backdrop",t&&"active"),onClick:d=>d.target===d.currentTarget&&r(),children:e.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),children:[e.jsx("h3",{className:"modal-title",children:a}),e.jsx("div",{className:"modal-body",children:n}),o&&e.jsx("div",{className:"modal-actions",children:o})]})}):null}function ve({message:t,variant:r="info",visible:a,onClose:n}){if(!a)return null;const o={success:"✓",error:"✕",info:"i"}[r],d={success:"text-[#059669]",error:"text-[#DC4A4A]",info:"text-[#2563EB]"}[r];return e.jsxs("div",{className:"toast",onClick:n,children:[e.jsx("span",{className:O("mr-2 font-bold",d),children:o}),t]})}function Z({children:t,className:r}){return e.jsx("div",{className:O("form-group",r),children:t})}function ne({className:t,children:r,...a}){return e.jsx("label",{className:O("form-label",t),...a,children:r})}const Me=p.forwardRef(({className:t,...r},a)=>e.jsx("input",{ref:a,className:O("form-input",t),...r}));Me.displayName="Input";const ce=p.forwardRef(({className:t,children:r,...a},n)=>e.jsx("select",{ref:n,className:O("form-input",t),...a,children:r}));ce.displayName="Select";function it({children:t,className:r}){return e.jsx("div",{className:O("form-row",r),children:t})}function $({className:t,children:r,...a}){return e.jsx("table",{className:O("table",t),...a,children:r})}function se({className:t,children:r,...a}){return e.jsx("thead",{className:t,...a,children:r})}function B({className:t,children:r,...a}){return e.jsx("tbody",{className:t,...a,children:r})}function j({className:t,children:r,...a}){return e.jsx("tr",{className:t,...a,children:r})}function N({className:t,children:r,...a}){return e.jsx("th",{className:t,...a,children:r})}function c({className:t,children:r,...a}){return e.jsx("td",{className:t,...a,children:r})}function ct({status:t}){const r={FINISHED:"success",FAILED:"danger",KILLED:"gray",RUNNING:"warning",UNKNOWN:"gray"}[t];return e.jsx(H,{variant:r,children:t})}function Us({createdAt:t,endedAt:r,status:a}){const n=!Ie(a),[o,d]=p.useState(Date.now());p.useEffect(()=>{if(!n)return;const h=setInterval(()=>d(Date.now()),1e3);return()=>clearInterval(h)},[n]);const i=et(t,n?void 0:r),f=n?Math.max(0,Math.floor((o-new Date(t).getTime())/1e3)):i;return e.jsx("span",{className:n?"tabular-nums":void 0,children:tt(f)})}function Ue({runs:t,onDelete:r,loading:a,emptyHint:n,baselineRunId:o}){const[d,u]=p.useState(null),i=()=>{d&&r&&(r(d.run_id),u(null))};return t.length?e.jsxs(e.Fragment,{children:[e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Run ID"}),e.jsx(N,{children:"Name"}),e.jsx(N,{children:"Project"}),e.jsx(N,{children:"Status"}),e.jsx(N,{children:"Duration"}),e.jsx(N,{children:"Created"}),e.jsx(N,{children:"Actions"})]})}),e.jsx(B,{children:t.map(f=>e.jsxs(j,{children:[e.jsxs(c,{children:[e.jsx(k.Link,{to:`/runs/${f.run_id}`,className:"font-mono",children:Q(f.run_id)}),f.run_id===o&&e.jsx(H,{variant:"info",className:"ml-2",children:"Baseline"})]}),e.jsx(c,{children:f.run_name||"—"}),e.jsx(c,{children:f.project}),e.jsx(c,{children:e.jsx(ct,{status:f.status})}),e.jsx(c,{className:"font-mono text-sm",children:e.jsx(Us,{createdAt:f.created_at,endedAt:f.ended_at,status:f.status})}),e.jsx(c,{className:"text-muted",children:Se(f.created_at)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k.Link,{to:`/runs/${f.run_id}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View"})}),r&&e.jsx(D,{variant:"ghost-danger",size:"sm",onClick:()=>u(f),disabled:a,children:"Delete"})]})})]},f.run_id))})]}),e.jsxs(qe,{open:!!d,onClose:()=>u(null),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"secondary",onClick:()=>u(null),children:"Cancel"}),e.jsxs(D,{variant:"danger",onClick:i,disabled:a,children:[a&&e.jsx(I,{}),"Delete"]})]}),children:[e.jsx("p",{children:"Are you sure you want to delete this run?"}),d&&e.jsx("p",{className:"font-mono text-sm mt-2",children:Q(d.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]})]}):e.jsx(le,{message:"No runs found",hint:n??"Try adjusting your filters"})}function Yt(){const[t,r]=k.useSearchParams(),{api:a}=V(),{data:n}=Ce(),[o,d]=p.useState(null),[u,i]=p.useState({project:t.get("project")||"",status:t.get("status")||"",q:t.get("q")||"",limit:parseInt(t.get("limit")||"25",10)}),{data:f,loading:h,refetch:m}=nt(u),g=pe(w=>a.deleteRun(w));p.useEffect(()=>{if(o){const w=setTimeout(()=>d(null),3e3);return()=>clearTimeout(w)}},[o]);const _=p.useCallback((w,K)=>{i(q=>({...q,[w]:K}));const T=new URLSearchParams(t);K?T.set(w,String(K)):T.delete(w),r(T,{replace:!0})},[t,r]),z=p.useCallback(async w=>{try{await g.mutate(w),d({message:"Run deleted",variant:"success"}),m()}catch{d({message:"Failed to delete run",variant:"error"})}},[g,m]);return e.jsxs(W,{children:[e.jsx(ge,{title:"Runs"}),e.jsx(b,{className:"mb-4",children:e.jsxs(it,{children:[e.jsxs(Z,{children:[e.jsx(ne,{htmlFor:"project",children:"Project"}),e.jsxs(ce,{id:"project",value:u.project,onChange:w=>_("project",w.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),n?.map(w=>e.jsx("option",{value:w.name,children:w.name},w.name))]})]}),e.jsxs(Z,{children:[e.jsx(ne,{htmlFor:"status",children:"Status"}),e.jsxs(ce,{id:"status",value:u.status,onChange:w=>_("status",w.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(Z,{children:[e.jsx(ne,{htmlFor:"q",children:"Query"}),e.jsx(Me,{id:"q",value:u.q,onChange:w=>_("q",w.target.value),placeholder:"metric.fidelity > 0.9"})]}),e.jsxs(Z,{children:[e.jsx(ne,{htmlFor:"limit",children:"Limit"}),e.jsxs(ce,{id:"limit",value:u.limit,onChange:w=>_("limit",parseInt(w.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(Z,{className:"flex items-end gap-2",children:[e.jsx(D,{variant:"primary",onClick:()=>m(),children:"Filter"}),h&&e.jsx(I,{})]})]})}),e.jsx(b,{children:h&&!f?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(I,{})}):e.jsx(Ue,{runs:f?.runs??[],onDelete:z,loading:g.loading,baselineRunId:u.project?n?.find(w=>w.name===u.project)?.baseline?.run_id:void 0})}),o&&e.jsx(ve,{message:o.message,variant:o.variant,visible:!!o,onClose:()=>d(null)})]})}function Ht({projects:t,currentWorkspace:r}){if(!t.length)return e.jsx(le,{message:"No projects yet",hint:"Projects are created automatically when you log runs"});const a=n=>{const o=new URLSearchParams({project:n});return r&&o.set("workspace",r.id),`/runs?${o}`};return e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Project"}),e.jsx(N,{children:"Runs"}),e.jsx(N,{children:"Baseline"}),e.jsx(N,{})]})}),e.jsx(B,{children:t.map(n=>e.jsxs(j,{children:[e.jsxs(c,{children:[e.jsx("span",{className:"font-medium",children:n.name}),n.description&&e.jsx("p",{className:"text-muted text-sm",children:Ot(n.description)})]}),e.jsx(c,{children:e.jsx(H,{variant:"gray",children:n.run_count??0})}),e.jsx(c,{children:n.baseline?e.jsxs(e.Fragment,{children:[e.jsx(k.Link,{to:`/runs/${n.baseline.run_id}`,className:"font-mono text-sm",children:Q(n.baseline.run_id)}),n.baseline.run_name&&e.jsx("p",{className:"text-muted text-sm",children:n.baseline.run_name})]}):e.jsx("span",{className:"text-muted",children:"—"})}),e.jsx(c,{className:"text-right",children:e.jsx(k.Link,{to:a(n.name),children:e.jsx(D,{variant:"secondary",size:"sm",children:"View Runs"})})})]},n.name))})]})}function Kt({groups:t}){return t.length?e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Group ID"}),e.jsx(N,{children:"Name"}),e.jsx(N,{children:"Project"}),e.jsx(N,{children:"Runs"}),e.jsx(N,{children:"Actions"})]})}),e.jsx(B,{children:t.map(r=>e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:Q(r.group_id)}),e.jsx(c,{children:r.group_name||"—"}),e.jsx(c,{children:r.project}),e.jsx(c,{children:e.jsx(H,{variant:"gray",children:r.run_count})}),e.jsx(c,{children:e.jsx(k.Link,{to:`/groups/${r.group_id}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View Runs"})})})]},r.group_id))})]}):e.jsx(le,{message:"No groups found",hint:"Groups are created when runs have a group_id set"})}function Jt({runId:t,runName:r,variant:a="secondary",size:n="sm",className:o=""}){const{api:d}=V(),[u,i]=p.useState({status:"idle"}),[f,h]=p.useState(!1),[m,g]=p.useState(null),_=async()=>{i({status:"preparing",message:"Preparing bundle..."}),h(!0);try{const T=await d.createExport(t);i({status:"packing",message:"Creating bundle...",artifactCount:T.artifact_count,objectCount:T.object_count}),i(he=>({...he,status:"downloading",message:"Downloading bundle..."}));const q=d.getExportDownloadUrl(t),P=await fetch(q,{credentials:"same-origin"});if(!P.ok)throw new Error("Download failed");const re=await P.blob(),ae=r?`${r.replace(/[^a-zA-Z0-9_-]/g,"_")}_${t.slice(0,8)}.zip`:`run_${t.slice(0,8)}.zip`,J=URL.createObjectURL(re),ee=document.createElement("a");ee.href=J,ee.download=ae,document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),URL.revokeObjectURL(J),i({status:"complete",message:"Export complete!",bundleSize:re.size,artifactCount:T.artifact_count,objectCount:T.object_count}),g({message:"Bundle downloaded successfully",variant:"success"}),setTimeout(()=>{h(!1),i({status:"idle"})},2e3)}catch(T){const q=T instanceof Error?T.message:"Export failed";i({status:"error",message:q}),g({message:q,variant:"error"})}},z=()=>{u.status!=="preparing"&&u.status!=="packing"&&u.status!=="downloading"&&(h(!1),i({status:"idle"}))},w=T=>T<1024?`${T} B`:T<1024*1024?`${(T/1024).toFixed(1)} KB`:`${(T/(1024*1024)).toFixed(1)} MB`,K=["preparing","packing","downloading"].includes(u.status);return e.jsxs(e.Fragment,{children:[e.jsxs(D,{variant:a,size:n,onClick:_,disabled:K,className:o,children:[K&&e.jsx(I,{}),e.jsx(Gs,{}),"Export"]}),e.jsx(qe,{open:f,onClose:z,title:"Export Run",actions:u.status==="error"||u.status==="complete"?e.jsx(D,{variant:"secondary",onClick:z,children:"Close"}):void 0,children:e.jsxs("div",{className:"py-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[u.status==="error"?e.jsx("div",{className:"w-10 h-10 rounded-full bg-[var(--dq-danger-bg)] flex items-center justify-center",children:e.jsx(Vs,{})}):u.status==="complete"?e.jsx("div",{className:"w-10 h-10 rounded-full bg-[var(--dq-success-bg)] flex items-center justify-center",children:e.jsx(Ws,{})}):e.jsx("div",{className:"w-10 h-10 rounded-full bg-[var(--dq-primary-bg)] flex items-center justify-center",children:e.jsx(I,{})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:u.message}),u.status==="error"&&e.jsx("p",{className:"text-sm text-[var(--dq-text-muted)]",children:"Please try again or contact support."})]})]}),(u.artifactCount!==void 0||u.objectCount!==void 0||u.bundleSize!==void 0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 mt-4",children:[u.artifactCount!==void 0&&e.jsxs(H,{variant:"gray",children:[u.artifactCount," artifacts"]}),u.objectCount!==void 0&&e.jsxs(H,{variant:"gray",children:[u.objectCount," objects"]}),u.bundleSize!==void 0&&e.jsx(H,{variant:"info",children:w(u.bundleSize)})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-[var(--dq-border-light)]",children:[e.jsxs("p",{className:"text-sm text-[var(--dq-text-muted)]",children:["Run ID: ",e.jsx("code",{className:"text-xs",children:t})]}),r&&e.jsxs("p",{className:"text-sm text-[var(--dq-text-muted)]",children:["Name: ",r]})]})]})}),m&&e.jsx(ve,{message:m.message,variant:m.variant,visible:!!m,onClose:()=>g(null)})]})}function Gs(){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function Ws(){return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--dq-success)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Vs(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--dq-danger)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}function zs({createdAt:t,endedAt:r,status:a}){const n=!Ie(a),[o,d]=p.useState(Date.now());p.useEffect(()=>{if(!n)return;const i=setInterval(()=>d(Date.now()),1e3);return()=>clearInterval(i)},[n]);const u=n?Math.max(0,Math.floor((o-new Date(t).getTime())/1e3)):et(t,r);return e.jsx("span",{className:n?"tabular-nums":void 0,children:tt(u)})}function Xt(){const{runId:t}=k.useParams(),r=k.useNavigate(),{api:a}=V(),{data:n,loading:o,error:d,refetch:u}=at(t),{data:i,refetch:f}=Ce(),[h,m]=p.useState(!1),[g,_]=p.useState(null),{mutate:z,loading:w}=pe(()=>a.setBaseline(n.project,n.run_id)),{mutate:K,loading:T}=pe(()=>a.deleteRun(t)),P=i?.find(R=>R.name===n?.project)?.baseline?.run_id===t;if(p.useEffect(()=>{if(g){const R=setTimeout(()=>_(null),3e3);return()=>clearTimeout(R)}},[g]),o)return e.jsx(W,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(I,{})})});if(d||!n)return e.jsx(W,{children:e.jsx(b,{children:e.jsx(le,{message:"Run not found",hint:d?.message||`Run ${t} does not exist`})})});const re=n.backend||{},ae=n.fingerprints||{},J=n.data?.params||{},ee=n.data?.metrics||{},he=n.data?.tags||{},xe=n.artifacts||[],be=n.errors||[],Ge=async()=>{try{await z(),await f(),u(),_({message:"Baseline updated",variant:"success"})}catch{_({message:"Failed to set baseline",variant:"error"})}},We=async()=>{try{await K(),m(!1),_({message:"Run deleted",variant:"success"}),setTimeout(()=>r("/runs"),1e3)}catch{_({message:"Failed to delete run",variant:"error"}),m(!1)}},Te=async R=>{const A=xe[R];try{const Pe=a.getArtifactDownloadUrl(n.run_id,R),Ne=await fetch(Pe);if(!Ne.ok)throw new Error("Download failed");const ke=await Ne.blob(),oe=document.createElement("a");oe.href=URL.createObjectURL(ke),oe.download=A?.kind||`artifact-${R}`,oe.click(),URL.revokeObjectURL(oe.href),_({message:"Download started",variant:"success"})}catch{_({message:"Download failed",variant:"error"})}},te=[{label:"Project",value:e.jsx(k.Link,{to:`/runs?project=${n.project}`,children:n.project})},{label:"Name",value:n.run_name||"—"},{label:"Adapter",value:n.adapter||"N/A"},{label:"Status",value:e.jsx(ct,{status:n.status})},{label:"Created",value:`${n.created_at} (${Se(n.created_at)})`},{label:"Duration",value:e.jsx(zs,{createdAt:n.created_at,endedAt:n.ended_at,status:n.status})},...n.ended_at?[{label:"Ended",value:`${n.ended_at} (${Se(n.ended_at)})`}]:[],{label:"Backend",value:re.name||"N/A"},...n.group_id?[{label:"Group",value:e.jsx(k.Link,{to:`/groups/${n.group_id}`,children:n.group_name||Q(n.group_id)})}]:[]];return e.jsxs(W,{children:[P&&e.jsxs("div",{className:"mb-4 px-4 py-3 bg-[#EFF6FF] border border-[#2563EB]/20 rounded-md text-[#2563EB] text-sm font-medium",children:['This run is the current baseline for project "',n.project,'"']}),e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:n.run_name||"Unnamed Run"}),e.jsx("p",{className:"text-muted text-sm font-mono",children:n.run_id})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Jt,{runId:n.run_id,runName:n.run_name}),!P&&e.jsxs(D,{variant:"secondary",size:"sm",onClick:Ge,disabled:w,children:[w&&e.jsx(I,{}),"Set as Baseline"]}),e.jsx(D,{variant:"ghost-danger",size:"sm",onClick:()=>m(!0),children:"Delete"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Overview"})}),e.jsx(Be,{items:te})]}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Fingerprints"})}),e.jsx(Be,{items:[{label:"Run",value:e.jsx("span",{className:"font-mono text-sm truncate",children:ae.run||"N/A"})},{label:"Program",value:e.jsx("span",{className:"font-mono text-sm truncate",children:ae.program||"N/A"})}]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Parameters"})}),Object.keys(J).length?e.jsx($,{children:e.jsx(B,{children:Object.entries(J).map(([R,A])=>e.jsxs(j,{children:[e.jsx(c,{children:R}),e.jsx(c,{className:"font-mono",children:String(A)})]},R))})}):e.jsx("p",{className:"text-muted",children:"No parameters"})]}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Metrics"})}),Object.keys(ee).length?e.jsx($,{children:e.jsx(B,{children:Object.entries(ee).map(([R,A])=>e.jsxs(j,{children:[e.jsx(c,{children:R}),e.jsx(c,{className:"font-mono",children:typeof A=="number"?Lt(A):String(A)})]},R))})}):e.jsx("p",{className:"text-muted",children:"No metrics"})]}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Tags"})}),Object.keys(he).length?e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(he).map(([R,A])=>e.jsxs(H,{variant:"gray",children:[R,": ",String(A)]},R))}):e.jsx("p",{className:"text-muted",children:"No tags"})]})]}),e.jsxs(b,{className:"mb-4",children:[e.jsx(U,{children:e.jsxs(G,{children:["Artifacts (",xe.length,")"]})}),xe.length?e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"#"}),e.jsx(N,{children:"Kind"}),e.jsx(N,{children:"Role"}),e.jsx(N,{children:"Media Type"}),e.jsx(N,{children:"Digest"}),e.jsx(N,{children:"Actions"})]})}),e.jsx(B,{children:xe.map((R,A)=>e.jsxs(j,{children:[e.jsx(c,{children:A}),e.jsx(c,{className:"font-mono text-sm",children:R.kind}),e.jsx(c,{children:e.jsx(H,{variant:"gray",children:R.role})}),e.jsx(c,{className:"text-muted text-sm",children:R.media_type}),e.jsx(c,{className:"font-mono text-sm",children:$e(R.digest)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k.Link,{to:`/runs/${n.run_id}/artifacts/${A}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View"})}),e.jsx(D,{variant:"secondary",size:"sm",onClick:()=>Te(A),children:"Download"})]})})]},A))})]}):e.jsx("p",{className:"text-muted",children:"No artifacts"})]}),be.length>0&&e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{className:"text-danger",children:"Errors"})}),be.map((R,A)=>e.jsxs("div",{className:"mb-2",children:[e.jsx("strong",{children:R.type}),": ",R.message,R.traceback&&e.jsx("pre",{className:"mt-2",children:R.traceback})]},A))]}),e.jsxs(qe,{open:h,onClose:()=>m(!1),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"secondary",onClick:()=>m(!1),children:"Cancel"}),e.jsxs(D,{variant:"danger",onClick:We,disabled:T,children:[T&&e.jsx(I,{}),"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:Q(n.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]}),g&&e.jsx(ve,{message:g.message,variant:g.variant,visible:!!g,onClose:()=>_(null)})]})}function Qt(){const{currentWorkspace:t}=V(),{data:r,loading:a}=Ce();return e.jsxs(W,{children:[e.jsx(ge,{title:"Projects"}),e.jsx(b,{children:a?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(I,{})}):e.jsx(Ht,{projects:r??[],currentWorkspace:t})})]})}function Zt(){const[t,r]=k.useSearchParams(),{data:a}=Ce(),[n,o]=p.useState(t.get("project")||""),{data:d,loading:u,refetch:i}=Mt({project:n||void 0}),f=p.useCallback(h=>{o(h);const m=new URLSearchParams(t);h?m.set("project",h):m.delete("project"),r(m,{replace:!0})},[t,r]);return e.jsxs(W,{children:[e.jsx(ge,{title:"Run Groups"}),e.jsx(b,{className:"mb-4",children:e.jsxs(it,{children:[e.jsxs(Z,{children:[e.jsx(ne,{htmlFor:"project",children:"Project"}),e.jsxs(ce,{id:"project",value:n,onChange:h=>f(h.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),a?.map(h=>e.jsx("option",{value:h.name,children:h.name},h.name))]})]}),e.jsxs(Z,{className:"flex items-end gap-2",children:[e.jsx(D,{variant:"primary",onClick:()=>i(),children:"Filter"}),u&&e.jsx(I,{})]})]})}),e.jsx(b,{children:u&&!d?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(I,{})}):e.jsx(Kt,{groups:d??[]})})]})}function es(){const{groupId:t}=k.useParams(),{api:r}=V(),{data:a,loading:n,error:o,refetch:d}=Ut(t),[u,i]=p.useState(null),f=pe(m=>r.deleteRun(m));p.useEffect(()=>{if(u){const m=setTimeout(()=>i(null),3e3);return()=>clearTimeout(m)}},[u]);const h=async m=>{try{await f.mutate(m),i({message:"Run deleted",variant:"success"}),d()}catch{i({message:"Failed to delete run",variant:"error"})}};return n?e.jsx(W,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(I,{})})}):o||!a?e.jsx(W,{children:e.jsx(b,{children:e.jsx(le,{message:"Group not found",hint:o?.message})})}):e.jsxs(W,{children:[e.jsx(ge,{title:e.jsxs(e.Fragment,{children:["Group ",e.jsx("span",{className:"font-mono",children:Q(t)})]}),subtitle:e.jsx("span",{className:"font-mono text-muted",children:t})}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsxs(G,{children:["Runs in Group (",a.runs.length,")"]})}),e.jsx(Ue,{runs:a.runs,onDelete:h,loading:f.loading})]}),u&&e.jsx(ve,{message:u.message,variant:u.variant,visible:!!u,onClose:()=>i(null)})]})}function Ys({className:t=""}){return e.jsx("svg",{className:t,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Hs({className:t=""}){return e.jsxs("svg",{className:t,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Ks({className:t=""}){return e.jsxs("svg",{className:t,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function Ze({className:t=""}){return e.jsxs("svg",{className:t,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}function Re({match:t}){return t?e.jsxs("span",{className:"diff-match inline-flex items-center gap-1.5",children:[e.jsx(Ys,{className:"flex-shrink-0"}),e.jsx("span",{className:"font-medium",children:"Match"})]}):e.jsxs("span",{className:"diff-mismatch inline-flex items-center gap-1.5",children:[e.jsx(Hs,{className:"flex-shrink-0"}),e.jsx("span",{className:"font-medium",children:"Different"})]})}function Js({warnings:t}){return!t||t.length===0?null:e.jsx("div",{className:"alert alert-warning mb-4",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(Ks,{className:"flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold mb-1",children:t.length===1?"Warning":`${t.length} Warnings`}),e.jsx("ul",{className:"space-y-1",children:t.map((r,a)=>e.jsx("li",{className:"text-sm",children:r},a))})]})]})})}function kt({label:t,run:r,variant:a}){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:`absolute top-0 left-0 w-1 h-full rounded-l ${a==="a"?"bg-info":"bg-primary"}`}),e.jsxs("div",{className:"pl-4",children:[e.jsx("p",{className:`text-xs font-semibold uppercase tracking-wider mb-2 ${a==="a"?"text-info":"text-primary"}`,children:t}),e.jsx(k.Link,{to:`/runs/${r.run_id}`,className:"text-base font-medium hover:underline",children:r.run_name||"Unnamed Run"}),e.jsx("p",{className:"font-mono text-xs mt-1 text-muted",children:Q(r.run_id)}),e.jsxs("p",{className:"text-sm mt-1 text-muted",children:[r.project," · ",Se(r.created_at)]})]})]})}function ie({children:t,badge:r}){return e.jsx(U,{children:e.jsx(G,{children:e.jsxs("span",{className:"flex items-center gap-2 flex-wrap",children:[t,r&&e.jsx(H,{variant:r.variant,children:r.label})]})})})}function Xs({tvd:t,noiseContext:r}){if(t===0)return e.jsx("p",{className:"text-sm mt-4 text-success",children:"✓ Distributions are identical (TVD = 0)"});if(!r)return null;const{p_value:a,noise_ratio:n}=r;return a!=null?a>=.1?e.jsx("p",{className:"text-sm mt-4 text-success",children:"✓ Consistent with sampling noise — difference is not statistically significant"}):a>=.05?e.jsxs("p",{className:"text-sm mt-4 text-warning",children:["⚠ Borderline (p=",a.toFixed(2),") — consider increasing shots"]}):e.jsxs("p",{className:"text-sm mt-4 text-danger",children:["✗ Statistically significant difference (p=",a.toFixed(2),") — results show meaningful divergence"]}):n!=null?n<1.5?e.jsx("p",{className:"text-sm mt-4 text-success",children:"✓ TVD is within expected shot noise range"}):n<3?e.jsxs("p",{className:"text-sm mt-4 text-warning",children:["⚠ Ambiguous (",n.toFixed(1),"× expected noise) — consider increasing shots"]}):e.jsxs("p",{className:"text-sm mt-4 text-danger",children:["✗ TVD exceeds expected noise (",n.toFixed(1),"×) — results show meaningful differences"]}):null}function Qs(){const[t,r]=k.useSearchParams(),{data:a}=nt({limit:100}),n=a?.runs??[],[o,d]=p.useState(t.get("a")||""),[u,i]=p.useState(t.get("b")||""),[f,h]=p.useState(""),m=g=>{if(g.preventDefault(),!o||!u){h("Please select both runs to compare");return}if(o===u){h("Please select two different runs");return}h(""),r({a:o,b:u})};return e.jsxs(e.Fragment,{children:[e.jsx(b,{children:e.jsxs("form",{onSubmit:m,children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(Z,{children:[e.jsx(ne,{htmlFor:"a",children:"Run A (Baseline)"}),e.jsxs(ce,{id:"a",value:o,onChange:g=>{d(g.target.value),h("")},children:[e.jsx("option",{value:"",children:"Select run..."}),n.map(g=>e.jsxs("option",{value:g.run_id,children:[g.run_name||"Unnamed"," (",Q(g.run_id),") — ",g.project]},g.run_id))]})]}),e.jsxs(Z,{children:[e.jsx(ne,{htmlFor:"b",children:"Run B (Candidate)"}),e.jsxs(ce,{id:"b",value:u,onChange:g=>{i(g.target.value),h("")},children:[e.jsx("option",{value:"",children:"Select run..."}),n.map(g=>e.jsxs("option",{value:g.run_id,children:[g.run_name||"Unnamed"," (",Q(g.run_id),") — ",g.project]},g.run_id))]})]})]}),f&&e.jsx("p",{className:"text-sm mb-3 text-danger",children:f}),e.jsx(D,{type:"submit",variant:"primary",children:"Compare"})]})}),e.jsxs(b,{className:"mt-4",children:[e.jsx(U,{children:e.jsx(G,{children:"How it works"})}),e.jsxs("div",{className:"space-y-2 text-sm text-muted",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ze,{className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{children:"Select two runs to compare their parameters, metrics, and artifacts"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ze,{className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{children:"The diff shows changed values and computes TVD for result distributions"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ze,{className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{children:"You can also compare from the run detail page"})]})]})]})]})}function Zs({runIdA:t,runIdB:r}){const{data:a,loading:n,error:o}=Gt(t,r);if(n)return e.jsx(b,{children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[e.jsx(I,{}),e.jsx("p",{className:"text-sm text-muted",children:"Comparing runs..."})]})});if(o||!a)return e.jsx(b,{children:e.jsx(le,{message:"Failed to load diff",hint:o?.message})});const{run_a:d,run_b:u,report:i}=a,f=i.device_drift?.significant_drift?{variant:"warning",label:"Drift Detected"}:i.device_drift?.has_calibration_data?{variant:"success",label:"Stable"}:{variant:"gray",label:"No Data"};return e.jsxs(e.Fragment,{children:[e.jsx(Js,{warnings:i.warnings||[]}),e.jsx(b,{className:"mb-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(kt,{label:"Run A (Baseline)",run:d,variant:"a"}),e.jsx(kt,{label:"Run B (Candidate)",run:u,variant:"b"})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(b,{children:[e.jsx(ie,{children:"Metadata"}),e.jsx($,{children:e.jsxs(B,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Project"}),e.jsx(c,{children:e.jsx(Re,{match:i.metadata.project_match})})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Backend"}),e.jsx(c,{children:e.jsx(Re,{match:i.metadata.backend_match})})]}),!i.metadata.project_match&&e.jsxs(e.Fragment,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"text-sm text-muted",children:"Project A"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.project_a||"N/A"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"text-sm text-muted",children:"Project B"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.project_b||"N/A"})]})]}),!i.metadata.backend_match&&e.jsxs(e.Fragment,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"text-sm text-muted",children:"Backend A"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.backend_a||"N/A"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"text-sm text-muted",children:"Backend B"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.backend_b||"N/A"})]})]})]})})]}),e.jsxs(b,{children:[e.jsx(ie,{children:"Fingerprints"}),e.jsx($,{children:e.jsxs(B,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono text-sm",children:$e(i.fingerprints.a)})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono text-sm",children:$e(i.fingerprints.b)})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Match"}),e.jsx(c,{children:e.jsx(Re,{match:i.fingerprints.a===i.fingerprints.b})})]})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(b,{children:[e.jsx(ie,{badge:{variant:i.program.exact_match?"success":i.program.structural_match?"info":"warning",label:i.program.exact_match?"Exact Match":i.program.structural_match?"Structural Match":"Different"},children:"Program"}),e.jsx($,{children:e.jsxs(B,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Exact Match"}),e.jsx(c,{children:e.jsx(Re,{match:i.program.exact_match})})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Structural Match"}),e.jsx(c,{children:e.jsx(Re,{match:i.program.structural_match})})]})]})})]}),e.jsxs(b,{children:[e.jsx(ie,{badge:f,children:"Device Calibration"}),i.device_drift?.significant_drift?e.jsx("p",{className:"text-sm text-warning",children:"Significant calibration drift detected between runs"}):i.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(b,{className:"mb-4",children:[e.jsx(ie,{badge:{variant:i.params.match?"success":"warning",label:i.params.match?"Match":"Different"},children:"Parameters"}),i.params.match?e.jsx("p",{className:"text-muted",children:"All parameters match"}):e.jsx(e.Fragment,{children:i.params.changed&&Object.keys(i.params.changed).length>0&&e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Parameter"}),e.jsx(N,{children:"Run A"}),e.jsx(N,{children:"Run B"})]})}),e.jsx(B,{children:Object.entries(i.params.changed).map(([h,m])=>e.jsxs(j,{children:[e.jsx(c,{children:h}),e.jsx(c,{className:"font-mono",children:String(m.a)}),e.jsx(c,{className:"font-mono",children:String(m.b)})]},h))})]})})]}),e.jsxs(b,{className:"mb-4",children:[e.jsx(ie,{badge:{variant:i.metrics.match?"success":"warning",label:i.metrics.match?"Match":"Different"},children:"Metrics"}),i.metrics.match?e.jsx("p",{className:"text-muted",children:"All metrics match"}):e.jsx(e.Fragment,{children:i.metrics.changed&&Object.keys(i.metrics.changed).length>0&&e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Metric"}),e.jsx(N,{children:"Run A"}),e.jsx(N,{children:"Run B"})]})}),e.jsx(B,{children:Object.entries(i.metrics.changed).map(([h,m])=>e.jsxs(j,{children:[e.jsx(c,{children:h}),e.jsx(c,{className:"font-mono",children:m.a}),e.jsx(c,{className:"font-mono",children:m.b})]},h))})]})})]}),i.circuit_diff&&e.jsxs(b,{className:"mb-4",children:[e.jsx(ie,{badge:{variant:i.circuit_diff.match?"success":"warning",label:i.circuit_diff.match?"Match":"Different"},children:"Circuit"}),i.circuit_diff.match?e.jsx("p",{className:"text-muted",children:"Circuit structure matches"}):e.jsxs("div",{className:"space-y-4",children:[i.circuit_diff.changed&&Object.keys(i.circuit_diff.changed).length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2 text-muted",children:"Changed Properties"}),e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Property"}),e.jsx(N,{children:"Run A"}),e.jsx(N,{children:"Run B"}),e.jsx(N,{children:"Delta"})]})}),e.jsx(B,{children:Object.entries(i.circuit_diff.changed).map(([h,m])=>e.jsxs(j,{children:[e.jsx(c,{children:m.label||h}),e.jsx(c,{className:"font-mono",children:String(m.a)}),e.jsx(c,{className:"font-mono",children:String(m.b)}),e.jsx(c,{className:"font-mono",children:m.delta!=null&&e.jsxs("span",{className:m.delta>0?"text-danger":"text-success",children:[m.delta>0?"+":"",m.delta,m.pct!=null&&` (${m.pct>0?"+":""}${m.pct.toFixed(1)}%)`]})})]},h))})]})]}),i.circuit_diff.is_clifford_changed&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2 text-muted",children:"Clifford Status"}),e.jsx($,{children:e.jsxs(B,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono",children:i.circuit_diff.is_clifford_a!=null?String(i.circuit_diff.is_clifford_a):"unknown"})]}),e.jsxs(j,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono",children:i.circuit_diff.is_clifford_b!=null?String(i.circuit_diff.is_clifford_b):"unknown"})]})]})})]}),i.circuit_diff.added_gates&&i.circuit_diff.added_gates.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2 text-muted",children:"New Gate Types (in B)"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:i.circuit_diff.added_gates.map(h=>e.jsx(H,{variant:"success",children:h},h))})]}),i.circuit_diff.removed_gates&&i.circuit_diff.removed_gates.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium mb-2 text-muted",children:"Removed Gate Types (from A)"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:i.circuit_diff.removed_gates.map(h=>e.jsx(H,{variant:"danger",children:h},h))})]})]})]}),i.tvd!=null&&e.jsxs(b,{className:"mb-4",children:[e.jsx(ie,{children:"Results Distribution"}),e.jsx($,{children:e.jsxs(B,{children:[e.jsxs(j,{children:[e.jsx(c,{children:"Total Variation Distance (TVD)"}),e.jsx(c,{className:"font-mono font-medium",children:i.tvd.toFixed(6)})]}),i.shots&&e.jsxs(j,{children:[e.jsx(c,{children:"Total Shots (A / B)"}),e.jsxs(c,{className:"font-mono",children:[i.shots.a," / ",i.shots.b]})]}),i.noise_context?.noise_p95&&e.jsxs(j,{children:[e.jsx(c,{children:"Noise Threshold (p95)"}),e.jsx(c,{className:"font-mono",children:i.noise_context.noise_p95.toFixed(6)})]}),i.noise_context?.p_value!=null&&e.jsxs(j,{children:[e.jsx(c,{children:"p-value"}),e.jsx(c,{className:"font-mono",children:i.noise_context.p_value.toFixed(4)})]})]})}),e.jsx(Xs,{tvd:i.tvd,noiseContext:i.noise_context})]})]})}function ts(){const[t]=k.useSearchParams(),r=t.get("a"),a=t.get("b"),n=r&&a;return e.jsxs(W,{children:[e.jsx("div",{className:"page-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:"Compare Runs"}),n&&e.jsx("p",{className:"text-sm mt-1 text-muted",children:e.jsx(k.Link,{to:"/diff",children:"← Select different runs"})})]})}),n?e.jsx(Zs,{runIdA:r,runIdB:a}):e.jsx(Qs,{})]})}function ss(){const{api:t}=V(),[r,a]=p.useState(""),[n,o]=p.useState(null),[d,u]=p.useState(!1),[i,f]=p.useState(""),{mutate:h,loading:m}=pe(async()=>{const _=await t.listRuns({q:r,limit:100});return o(_.runs),u(!0),_}),g=_=>{if(_.preventDefault(),!r.trim()){f("Please enter a search query");return}f(""),h()};return e.jsxs(W,{children:[e.jsx("div",{className:"page-header",children:e.jsx("h1",{className:"page-title",children:"Search Runs"})}),e.jsx(b,{className:"mb-4",children:e.jsxs("form",{onSubmit:g,children:[e.jsxs(Z,{children:[e.jsx(ne,{htmlFor:"q",children:"Query"}),e.jsx(Me,{id:"q",type:"text",value:r,onChange:_=>{a(_.target.value),f("")},placeholder:"metric.fidelity > 0.95 and params.shots = 1000",className:"font-mono"})]}),i&&e.jsx("p",{className:"text-sm text-[#DC4A4A] mb-3",children:i}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs(D,{type:"submit",variant:"primary",disabled:m,children:[m&&e.jsx(I,{}),"Search"]}),m&&e.jsx("span",{className:"text-muted text-sm",children:"Searching..."})]})]})}),d&&n&&e.jsx(b,{className:"mb-4",children:n.length>0?e.jsx(Ue,{runs:n}):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(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Query Syntax"})}),e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Field"}),e.jsx(N,{children:"Description"})]})}),e.jsxs(B,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"params.X"}),e.jsx(c,{children:"Parameter value"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"metric.X"}),e.jsx(c,{children:"Metric value"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"tags.X"}),e.jsx(c,{children:"Tag value"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"status"}),e.jsx(c,{children:"Run status"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"project"}),e.jsx(c,{children:"Project name"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"backend"}),e.jsx(c,{children:"Backend name"})]})]})]})]}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Operators"})}),e.jsxs($,{children:[e.jsx(se,{children:e.jsxs(j,{children:[e.jsx(N,{children:"Operator"}),e.jsx(N,{children:"Description"})]})}),e.jsxs(B,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"="}),e.jsx(c,{children:"Equals"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"!="}),e.jsx(c,{children:"Not equals"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:">"}),e.jsx(c,{children:"Greater than"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:">="}),e.jsx(c,{children:"Greater or equal"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"<"}),e.jsx(c,{children:"Less than"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"<="}),e.jsx(c,{children:"Less or equal"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"~"}),e.jsx(c,{children:"Contains"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"and"}),e.jsx(c,{children:"Combine conditions"})]})]})]})]})]}),e.jsxs(b,{className:"mt-4",children:[e.jsx(U,{children:e.jsx(G,{children:"Examples"})}),e.jsx($,{children:e.jsxs(B,{children:[e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"metric.fidelity > 0.95"}),e.jsx(c,{children:"High fidelity runs"})]}),e.jsxs(j,{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(j,{children:[e.jsx(c,{className:"font-mono",children:"tags.backend ~ ibm"}),e.jsx(c,{children:"Runs with IBM backends"})]}),e.jsxs(j,{children:[e.jsx(c,{className:"font-mono",children:"metric.error < 0.01"}),e.jsx(c,{children:"Low error runs"})]}),e.jsxs(j,{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 rs(){const{runId:t,index:r}=k.useParams(),a=parseInt(r,10),{api:n}=V(),{data:o}=at(t),{data:d,loading:u,error:i}=Wt(t,a),[f,h]=p.useState(null);p.useEffect(()=>{if(f){const P=setTimeout(()=>h(null),3e3);return()=>clearTimeout(P)}},[f]);const m=async()=>{try{const P=n.getArtifactDownloadUrl(t,a),re=await fetch(P);if(!re.ok)throw new Error("Download failed");const ae=await re.blob(),J=document.createElement("a");J.href=URL.createObjectURL(ae),J.download=g?.kind||`artifact-${a}`,J.click(),URL.revokeObjectURL(J.href),h({message:"Download started",variant:"success"})}catch{h({message:"Download failed",variant:"error"})}};if(u)return e.jsx(W,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(I,{})})});if(i||!d)return e.jsx(W,{children:e.jsx(b,{children:e.jsx(le,{message:"Artifact not found",hint:i?.message})})});const{artifact:g,size:_,content:z,content_json:w,preview_available:K,error:T}=d,q=10*1024*1024;return e.jsxs(W,{children:[e.jsx(ge,{title:g.kind,subtitle:e.jsxs(e.Fragment,{children:["← Back to run ",e.jsxs(k.Link,{to:`/runs/${t}`,children:[Q(t),o?.run_name&&` — ${o.run_name}`]})]}),actions:e.jsx(D,{variant:"primary",onClick:m,children:"Download"})}),e.jsx(b,{className:"mb-4",children:e.jsx(Be,{items:[{label:"Kind",value:e.jsx("span",{className:"font-mono",children:g.kind})},{label:"Role",value:e.jsx(H,{variant:"gray",children:g.role})},{label:"Media Type",value:g.media_type},{label:"Digest",value:e.jsx("span",{className:"font-mono text-sm",children:g.digest})},{label:"Size",value:Ee(_)}]})}),e.jsxs(b,{children:[e.jsx(U,{children:e.jsx(G,{children:"Content"})}),T?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-danger",children:["Error loading artifact: ",T]}),e.jsx("p",{className:"text-muted mt-2",children:e.jsx(D,{variant:"primary",onClick:m,children:"Download to view"})})]}):K?w?e.jsx("pre",{children:Ft(w)}):z?e.jsx("pre",{children:z}):e.jsxs("p",{className:"text-muted",children:["Binary content (",Ee(_),") — download to view"]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted",children:[e.jsx("strong",{children:"Artifact too large for preview"})," (",Ee(_)," exceeds ",Ee(q)," 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(D,{variant:"primary",onClick:m,children:"Download"})})]})]}),f&&e.jsx(ve,{message:f.message,variant:f.variant,visible:!!f,onClose:()=>h(null)})]})}const ns=[{path:"/",element:e.jsx(k.Navigate,{to:"/runs",replace:!0})},{path:"/runs",element:e.jsx(Yt,{})},{path:"/runs/:runId",element:e.jsx(Xt,{})},{path:"/runs/:runId/artifacts/:index",element:e.jsx(rs,{})},{path:"/projects",element:e.jsx(Qt,{})},{path:"/groups",element:e.jsx(Zt,{})},{path:"/groups/:groupId",element:e.jsx(es,{})},{path:"/diff",element:e.jsx(ts,{})},{path:"/search",element:e.jsx(ss,{})}];function lt(t=[]){return k.createBrowserRouter([...ns,...t])}const as=lt();function er({additionalRoutes:t,...r}){const a=t?.length?lt(t):as;return e.jsx(qt,{...r,children:e.jsx(k.RouterProvider,{router:a})})}exports.Alert=Ms;exports.ApiClient=Dt;exports.ApiError=je;exports.App=er;exports.AppProvider=qt;exports.ArtifactPage=rs;exports.Badge=H;exports.Button=D;exports.Card=b;exports.CardHeader=U;exports.CardTitle=G;exports.DiffPage=ts;exports.EmptyState=le;exports.ExportRunButton=Jt;exports.FormGroup=Z;exports.FormRow=it;exports.GroupDetailPage=es;exports.GroupsPage=Zt;exports.GroupsTable=Kt;exports.Input=Me;exports.KVList=Be;exports.Label=ne;exports.Layout=W;exports.LayoutConfigProvider=qs;exports.Modal=qe;exports.POLL_INTERVAL=st;exports.PageHeader=ge;exports.ProjectsPage=Qt;exports.ProjectsTable=Ht;exports.RunDetailPage=Xt;exports.RunsPage=Yt;exports.RunsTable=Ue;exports.SearchPage=ss;exports.Select=ce;exports.Spinner=I;exports.StatusBadge=ct;exports.Table=$;exports.TableBody=B;exports.TableCell=c;exports.TableHead=se;exports.TableHeader=N;exports.TableRow=j;exports.ThemeProvider=$s;exports.Toast=ve;exports.api=At;exports.buildUrl=Os;exports.cn=O;exports.coreRoutes=ns;exports.createRouter=lt;exports.elapsedSeconds=et;exports.formatBytes=Ee;exports.formatDuration=tt;exports.formatNumber=Lt;exports.isTerminalStatus=Ie;exports.jsonPretty=Ft;exports.router=as;exports.shortDigest=$e;exports.shortId=Q;exports.timeAgo=Se;exports.truncate=Ot;exports.useApp=V;exports.useArtifact=Wt;exports.useDiff=Gt;exports.useGroup=Ut;exports.useGroups=Mt;exports.useLayoutConfig=zt;exports.useMutation=pe;exports.usePolling=rt;exports.useProjects=Ce;exports.useRun=at;exports.useRuns=nt;exports.useTheme=Bt;exports.useThemeOptional=Bs;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type { AppProviderProps, AppContextValue, AsyncState } from './hooks';
|
|
|
5
5
|
export { router, createRouter, coreRoutes } from './router';
|
|
6
6
|
export { ApiClient, ApiError, api } from './api';
|
|
7
7
|
export type { ApiConfig } from './api';
|
|
8
|
-
export { useRuns, useRun, useProjects, useGroups, useGroup, useDiff, useArtifact, useMutation, ThemeProvider, useTheme, useThemeOptional, } from './hooks';
|
|
8
|
+
export { useRuns, useRun, useProjects, useGroups, useGroup, useDiff, useArtifact, useMutation, usePolling, POLL_INTERVAL, ThemeProvider, useTheme, useThemeOptional, } from './hooks';
|
|
9
9
|
export type { Theme, ThemeContextValue, ThemeProviderProps } from './hooks';
|
|
10
10
|
export { Layout, PageHeader, LayoutConfigProvider, useLayoutConfig } from './components/Layout';
|
|
11
11
|
export type { LayoutProps, PageHeaderProps } from './components/Layout';
|
|
@@ -19,7 +19,9 @@ export { ProjectsTable } from './components/ProjectsTable';
|
|
|
19
19
|
export type { ProjectsTableProps } from './components/ProjectsTable';
|
|
20
20
|
export { GroupsTable } from './components/GroupsTable';
|
|
21
21
|
export type { GroupsTableProps } from './components/GroupsTable';
|
|
22
|
+
export { ExportRunButton } from './components/ExportRunButton';
|
|
23
|
+
export type { ExportRunButtonProps, ExportProgress } from './components/ExportRunButton';
|
|
22
24
|
export { RunsPage, RunDetailPage, ProjectsPage, GroupsPage, GroupDetailPage, DiffPage, SearchPage, ArtifactPage, } from './pages';
|
|
23
|
-
export { shortId, shortDigest, timeAgo, formatNumber, formatBytes, jsonPretty, truncate, buildUrl, cn, } from './utils';
|
|
25
|
+
export { shortId, shortDigest, timeAgo, formatNumber, formatBytes, jsonPretty, truncate, buildUrl, cn, isTerminalStatus, elapsedSeconds, formatDuration, } from './utils';
|
|
24
26
|
export type { RunStatus, Artifact, Fingerprints, RunSummary, RunRecord, Project, Group, RunFilters, GroupFilters, Capabilities, DiffReport, Workspace, NavLink, LayoutConfig, } from './types';
|
|
25
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +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,EACX,aAAa,EACb,QAAQ,EACR,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG5E,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,
|
|
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,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG5E,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,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGzF,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,EACF,gBAAgB,EAChB,cAAc,EACd,cAAc,GACf,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"}
|