@devqubit/ui 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ React frontend for devqubit experiment tracking UI (open-core).
14
14
  ```bash
15
15
  npm install
16
16
  npm run dev # Start dev server (localhost:5173)
17
- npm run build # Build for production
17
+ npm run build # Build for production (auto-copies to static/)
18
18
  npm run build:lib # Build as npm library
19
19
  npm run lint # Run ESLint
20
20
  npm run typecheck # TypeScript type check
@@ -24,7 +24,8 @@ Dev server proxies `/api` requests to `localhost:8000`.
24
24
 
25
25
  ## Build for Python Package
26
26
 
27
+ The build process automatically copies production files to `../src/devqubit_ui/static/`:
28
+
27
29
  ```bash
28
30
  npm run build
29
- cp -r dist/* ../src/devqubit_ui/static/
30
31
  ```
@@ -67,6 +67,23 @@ export declare class ApiClient {
67
67
  error?: string;
68
68
  }>;
69
69
  getArtifactDownloadUrl(runId: string, index: number): string;
70
+ createExport(runId: string): Promise<{
71
+ status: string;
72
+ run_id: string;
73
+ artifact_count: number;
74
+ object_count: number;
75
+ missing_objects: string[];
76
+ }>;
77
+ getExportInfo(runId: string): Promise<{
78
+ run_id: string;
79
+ run_name?: string;
80
+ project?: string;
81
+ artifact_count: number;
82
+ object_count: number;
83
+ available_objects: number;
84
+ missing_objects: number;
85
+ }>;
86
+ getExportDownloadUrl(runId: string): string;
70
87
  }
71
88
  export declare const api: ApiClient;
72
89
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,OAAO,EACP,KAAK,EACL,YAAY,EACZ,UAAU,EACV,QAAQ,EACT,MAAM,UAAU,CAAC;AAElB,qBAAa,QAAS,SAAQ,KAAK;IAExB,MAAM,EAAE,MAAM;gBAAd,MAAM,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,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,MAAM,EAAE,CAAC;KAC3B,CAAC;IAII,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAC1C,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IAIF,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAG5C;AAED,eAAO,MAAM,GAAG,WAAkB,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ExportRunButton Component
3
+ *
4
+ * Provides run export functionality (bundle creation) for devqubit-ui.
5
+ */
6
+ export interface ExportRunButtonProps {
7
+ /** Run ID to export */
8
+ runId: string;
9
+ /** Optional run name for display */
10
+ runName?: string;
11
+ /** Button variant */
12
+ variant?: 'primary' | 'secondary' | 'ghost';
13
+ /** Button size */
14
+ size?: 'default' | 'sm';
15
+ /** Additional class name */
16
+ className?: string;
17
+ /** Base URL for API requests */
18
+ apiBaseUrl?: string;
19
+ }
20
+ export interface ExportProgress {
21
+ status: 'idle' | 'preparing' | 'packing' | 'downloading' | 'complete' | 'error';
22
+ message?: string;
23
+ progress?: number;
24
+ artifactCount?: number;
25
+ objectCount?: number;
26
+ bundleSize?: number;
27
+ }
28
+ /**
29
+ * Button that triggers run export/bundle download.
30
+ */
31
+ export declare function ExportRunButton({ runId, runName, variant, size, className, apiBaseUrl, }: ExportRunButtonProps): import("react/jsx-runtime").JSX.Element;
32
+ //# sourceMappingURL=ExportRunButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportRunButton.d.ts","sourceRoot":"","sources":["../../../src/components/ExportRunButton/ExportRunButton.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,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;IACnB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;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,EACd,UAAe,GAChB,EAAE,oBAAoB,2CAmMtB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * ExportRunButton Component Exports
3
+ */
4
+ export { ExportRunButton } from './ExportRunButton';
5
+ export type { ExportRunButtonProps, ExportProgress } from './ExportRunButton';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ExportRunButton/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
@@ -4,10 +4,11 @@ export interface RunsTableProps {
4
4
  onDelete?: (runId: string) => void;
5
5
  loading?: boolean;
6
6
  emptyHint?: string;
7
+ baselineRunId?: string;
7
8
  }
8
9
  declare function StatusBadge({ status }: {
9
10
  status: RunStatus;
10
11
  }): import("react/jsx-runtime").JSX.Element;
11
- export declare function RunsTable({ runs, onDelete, loading, emptyHint }: RunsTableProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function RunsTable({ runs, onDelete, loading, emptyHint, baselineRunId }: RunsTableProps): import("react/jsx-runtime").JSX.Element;
12
13
  export { StatusBadge };
13
14
  //# sourceMappingURL=RunsTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RunsTable.d.ts","sourceRoot":"","sources":["../../../src/components/RunsTable/RunsTable.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,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;CACpB;AAED,iBAAS,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,2CAQrD;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,cAAc,2CA8D/E;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"RunsTable.d.ts","sourceRoot":"","sources":["../../../src/components/RunsTable/RunsTable.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;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,2CAQrD;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,cAAc,2CA6F9F;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -13,4 +13,6 @@ export { ProjectsTable } from './ProjectsTable';
13
13
  export type { ProjectsTableProps } from './ProjectsTable';
14
14
  export { GroupsTable } from './GroupsTable';
15
15
  export type { GroupsTableProps } from './GroupsTable';
16
+ export { ExportRunButton } from './ExportRunButton';
17
+ export type { ExportRunButtonProps, ExportProgress } from './ExportRunButton';
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG7D,cAAc,MAAM,CAAC;AAGrB,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG7D,cAAc,MAAM,CAAC;AAGrB,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,5 +1,5 @@
1
- export { Badge, Button, Card, CardHeader, CardTitle, Alert, Spinner, EmptyState, KVList, Modal, Toast, } from './primitives';
2
- export type { BadgeVariant, BadgeProps, ButtonVariant, ButtonSize, ButtonProps, CardProps, CardHeaderProps, CardTitleProps, AlertVariant, AlertProps, SpinnerProps, EmptyStateProps, KVListProps, ModalProps, ToastVariant, ToastProps, } from './primitives';
1
+ export { Badge, Button, Card, CardHeader, CardTitle, Alert, Spinner, EmptyState, KVList, Modal, Toast, Skeleton, TableSkeleton, } from './primitives';
2
+ export type { BadgeVariant, BadgeProps, ButtonVariant, ButtonSize, ButtonProps, CardProps, CardHeaderProps, CardTitleProps, AlertVariant, AlertProps, SpinnerProps, EmptyStateProps, KVListProps, ModalProps, ToastVariant, ToastProps, SkeletonProps, TableSkeletonProps, } from './primitives';
3
3
  export { FormGroup, FormRow, Label, Input, Select, } from './forms';
4
4
  export type { FormGroupProps, FormRowProps, LabelProps, InputProps, SelectProps, } from './forms';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,KAAK,EACL,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,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,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,KAAK,EACL,KAAK,EACL,QAAQ,EACR,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,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,aAAa,EACb,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAC"}
@@ -53,4 +53,14 @@ export interface ToastProps {
53
53
  onClose: () => void;
54
54
  }
55
55
  export declare function Toast({ message, variant, visible, onClose }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
56
+ export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
57
+ width?: string | number;
58
+ height?: string | number;
59
+ }
60
+ export declare function Skeleton({ width, height, className, style, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
61
+ export interface TableSkeletonProps {
62
+ rows?: number;
63
+ cols?: number;
64
+ }
65
+ export declare function TableSkeleton({ rows, cols }: TableSkeletonProps): import("react/jsx-runtime").JSX.Element;
56
66
  //# sourceMappingURL=primitives.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/components/ui/primitives.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAInF,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1F,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IACjE,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,wBAAgB,KAAK,CAAC,EAAE,OAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAMpF;AAGD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,CAAC;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AAGD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,KAAK,CAAC,EAAE,OAAO,EAAE,OAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,kDAqBhF;AAGD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IACnE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAQpF;AAGD,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAQ,EAAE,IAAQ,EAAE,EAAE,kBAAkB,2CAgBvE"}
package/dist/index.cjs CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),P=require("react-router-dom");var Ee={exports:{}},me={};var vr;function ys(){if(vr)return me;vr=1;var s=y,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function f(i,x,o){var p,I={},_=null,V=null;o!==void 0&&(_=""+o),x.key!==void 0&&(_=""+x.key),x.ref!==void 0&&(V=x.ref);for(p in x)a.call(x,p)&&!h.hasOwnProperty(p)&&(I[p]=x[p]);if(i&&i.defaultProps)for(p in x=i.defaultProps,x)I[p]===void 0&&(I[p]=x[p]);return{$$typeof:t,type:i,key:_,ref:V,props:I,_owner:d.current}}return me.Fragment=n,me.jsx=f,me.jsxs=f,me}var fe={};var br;function _s(){return br||(br=1,process.env.NODE_ENV!=="production"&&(function(){var s=y,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),i=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),K=Symbol.iterator,de="@@iterator";function ve(r){if(r===null||typeof r!="object")return null;var l=K&&r[K]||r[de];return typeof l=="function"?l:null}var Q=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(r){{for(var l=arguments.length,u=new Array(l>1?l-1:0),j=1;j<l;j++)u[j-1]=arguments[j];be("error",r,u)}}function be(r,l,u){{var j=Q.ReactDebugCurrentFrame,R=j.getStackAddendum();R!==""&&(l+="%s",u=u.concat([R]));var w=u.map(function(N){return String(N)});w.unshift("Warning: "+l),Function.prototype.apply.call(console[r],console,w)}}var ue=!1,Ne=!1,Oe=!1,Fe=!1,$e=!1,S;S=Symbol.for("react.module.reference");function F(r){return!!(typeof r=="string"||typeof r=="function"||r===a||r===h||$e||r===d||r===o||r===p||Fe||r===V||ue||Ne||Oe||typeof r=="object"&&r!==null&&(r.$$typeof===_||r.$$typeof===I||r.$$typeof===f||r.$$typeof===i||r.$$typeof===x||r.$$typeof===S||r.getModuleId!==void 0))}function ye(r,l,u){var j=r.displayName;if(j)return j;var R=l.displayName||l.name||"";return R!==""?u+"("+R+")":u}function _e(r){return r.displayName||"Context"}function Y(r){if(r==null)return null;if(typeof r.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case a:return"Fragment";case n:return"Portal";case h:return"Profiler";case d:return"StrictMode";case o:return"Suspense";case p:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case i:var l=r;return _e(l)+".Consumer";case f:var u=r;return _e(u._context)+".Provider";case x:return ye(r,r.render,"ForwardRef");case I:var j=r.displayName||null;return j!==null?j:Y(r.type)||"Memo";case _:{var R=r,w=R._payload,N=R._init;try{return Y(N(w))}catch{return null}}}return null}var se=Object.assign,he=0,Je,Xe,Qe,Ze,er,rr,sr;function tr(){}tr.__reactDisabledLog=!0;function Kr(){{if(he===0){Je=console.log,Xe=console.info,Qe=console.warn,Ze=console.error,er=console.group,rr=console.groupCollapsed,sr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:tr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}he++}}function Jr(){{if(he--,he===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},r,{value:Je}),info:se({},r,{value:Xe}),warn:se({},r,{value:Qe}),error:se({},r,{value:Ze}),group:se({},r,{value:er}),groupCollapsed:se({},r,{value:rr}),groupEnd:se({},r,{value:sr})})}he<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Le=Q.ReactCurrentDispatcher,Be;function Re(r,l,u){{if(Be===void 0)try{throw Error()}catch(R){var j=R.stack.trim().match(/\n( *(at )?)/);Be=j&&j[1]||""}return`
2
- `+Be+r}}var Ie=!1,we;{var Xr=typeof WeakMap=="function"?WeakMap:Map;we=new Xr}function nr(r,l){if(!r||Ie)return"";{var u=we.get(r);if(u!==void 0)return u}var j;Ie=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var w;w=Le.current,Le.current=null,Kr();try{if(l){var N=function(){throw Error()};if(Object.defineProperty(N.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(N,[])}catch(q){j=q}Reflect.construct(r,[],N)}else{try{N.call()}catch(q){j=q}r.call(N.prototype)}}else{try{throw Error()}catch(q){j=q}r()}}catch(q){if(q&&j&&typeof q.stack=="string"){for(var g=q.stack.split(`
3
- `),M=j.stack.split(`
4
- `),C=g.length-1,k=M.length-1;C>=1&&k>=0&&g[C]!==M[k];)k--;for(;C>=1&&k>=0;C--,k--)if(g[C]!==M[k]){if(C!==1||k!==1)do if(C--,k--,k<0||g[C]!==M[k]){var H=`
5
- `+g[C].replace(" at new "," at ");return r.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",r.displayName)),typeof r=="function"&&we.set(r,H),H}while(C>=1&&k>=0);break}}}finally{Ie=!1,Le.current=w,Jr(),Error.prepareStackTrace=R}var ie=r?r.displayName||r.name:"",te=ie?Re(ie):"";return typeof r=="function"&&we.set(r,te),te}function Qr(r,l,u){return nr(r,!1)}function Zr(r){var l=r.prototype;return!!(l&&l.isReactComponent)}function Se(r,l,u){if(r==null)return"";if(typeof r=="function")return nr(r,Zr(r));if(typeof r=="string")return Re(r);switch(r){case o:return Re("Suspense");case p:return Re("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case x:return Qr(r.render);case I:return Se(r.type,l,u);case _:{var j=r,R=j._payload,w=j._init;try{return Se(w(R),l,u)}catch{}}}return""}var xe=Object.prototype.hasOwnProperty,ar={},ir=Q.ReactDebugCurrentFrame;function Pe(r){if(r){var l=r._owner,u=Se(r.type,r._source,l?l.type:null);ir.setExtraStackFrame(u)}else ir.setExtraStackFrame(null)}function es(r,l,u,j,R){{var w=Function.call.bind(xe);for(var N in r)if(w(r,N)){var g=void 0;try{if(typeof r[N]!="function"){var M=Error((j||"React class")+": "+u+" type `"+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[N]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw M.name="Invariant Violation",M}g=r[N](l,N,j,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(C){g=C}g&&!(g instanceof Error)&&(Pe(R),O("%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).",j||"React class",u,N,typeof g),Pe(null)),g instanceof Error&&!(g.message in ar)&&(ar[g.message]=!0,Pe(R),O("Failed %s type: %s",u,g.message),Pe(null))}}}var rs=Array.isArray;function Me(r){return rs(r)}function ss(r){{var l=typeof Symbol=="function"&&Symbol.toStringTag,u=l&&r[Symbol.toStringTag]||r.constructor.name||"Object";return u}}function ts(r){try{return cr(r),!1}catch{return!0}}function cr(r){return""+r}function lr(r){if(ts(r))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ss(r)),cr(r)}var or=Q.ReactCurrentOwner,ns={key:!0,ref:!0,__self:!0,__source:!0},dr,ur;function as(r){if(xe.call(r,"ref")){var l=Object.getOwnPropertyDescriptor(r,"ref").get;if(l&&l.isReactWarning)return!1}return r.ref!==void 0}function is(r){if(xe.call(r,"key")){var l=Object.getOwnPropertyDescriptor(r,"key").get;if(l&&l.isReactWarning)return!1}return r.key!==void 0}function cs(r,l){typeof r.ref=="string"&&or.current}function ls(r,l){{var u=function(){dr||(dr=!0,O("%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))};u.isReactWarning=!0,Object.defineProperty(r,"key",{get:u,configurable:!0})}}function os(r,l){{var u=function(){ur||(ur=!0,O("%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))};u.isReactWarning=!0,Object.defineProperty(r,"ref",{get:u,configurable:!0})}}var ds=function(r,l,u,j,R,w,N){var g={$$typeof:t,type:r,key:l,ref:u,props:N,_owner:w};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:j}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function us(r,l,u,j,R){{var w,N={},g=null,M=null;u!==void 0&&(lr(u),g=""+u),is(l)&&(lr(l.key),g=""+l.key),as(l)&&(M=l.ref,cs(l,R));for(w in l)xe.call(l,w)&&!ns.hasOwnProperty(w)&&(N[w]=l[w]);if(r&&r.defaultProps){var C=r.defaultProps;for(w in C)N[w]===void 0&&(N[w]=C[w])}if(g||M){var k=typeof r=="function"?r.displayName||r.name||"Unknown":r;g&&ls(N,k),M&&os(N,k)}return ds(r,g,M,R,j,or.current,N)}}var Ue=Q.ReactCurrentOwner,hr=Q.ReactDebugCurrentFrame;function ae(r){if(r){var l=r._owner,u=Se(r.type,r._source,l?l.type:null);hr.setExtraStackFrame(u)}else hr.setExtraStackFrame(null)}var qe;qe=!1;function Ge(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}function xr(){{if(Ue.current){var r=Y(Ue.current.type);if(r)return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),T=require("react-router-dom");var Fe={exports:{}},_e={};var _s;function Rt(){if(_s)return _e;_s=1;var t=v,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function d(i,f,h){var m,p={},w=null,V=null;h!==void 0&&(w=""+h),f.key!==void 0&&(w=""+f.key),f.ref!==void 0&&(V=f.ref);for(m in f)a.call(f,m)&&!o.hasOwnProperty(m)&&(p[m]=f[m]);if(i&&i.defaultProps)for(m in f=i.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:r,type:i,key:w,ref:V,props:p,_owner:u.current}}return _e.Fragment=n,_e.jsx=d,_e.jsxs=d,_e}var we={};var ws;function Et(){return ws||(ws=1,process.env.NODE_ENV!=="production"&&(function(){var t=v,r=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=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"),p=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),R=Symbol.iterator,K="@@iterator";function k(s){if(s===null||typeof s!="object")return null;var l=R&&s[R]||s[K];return typeof l=="function"?l:null}var $=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),g=1;g<l;g++)x[g-1]=arguments[g];te("error",s,x)}}function te(s,l,x){{var g=$.ReactDebugCurrentFrame,S=g.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 ne=!1,J=!1,ee=!1,ae=!1,xe=!1,be;be=Symbol.for("react.module.reference");function Me(s){return!!(typeof s=="string"||typeof s=="function"||s===a||s===o||xe||s===u||s===h||s===m||ae||s===V||ne||J||ee||typeof s=="object"&&s!==null&&(s.$$typeof===w||s.$$typeof===p||s.$$typeof===d||s.$$typeof===i||s.$$typeof===f||s.$$typeof===be||s.getModuleId!==void 0))}function Ue(s,l,x){var g=s.displayName;if(g)return g;var S=l.displayName||l.name||"";return S!==""?x+"("+S+")":x}function Ce(s){return s.displayName||"Context"}function _(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 a:return"Fragment";case n:return"Portal";case o:return"Profiler";case u:return"StrictMode";case h:return"Suspense";case m:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case i:var l=s;return Ce(l)+".Consumer";case d:var x=s;return Ce(x._context)+".Provider";case f:return Ue(s,s.render,"ForwardRef");case p:var g=s.displayName||null;return g!==null?g:_(s.type)||"Memo";case w:{var S=s,C=S._payload,E=S._init;try{return _(E(C))}catch{return null}}}return null}var D=Object.assign,oe=0,ye,ke,de,rs,ns,as,is;function cs(){}cs.__reactDisabledLog=!0;function Qs(){{if(oe===0){ye=console.log,ke=console.info,de=console.warn,rs=console.error,ns=console.group,as=console.groupCollapsed,is=console.groupEnd;var s={configurable:!0,enumerable:!0,value:cs,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}oe++}}function Zs(){{if(oe--,oe===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},s,{value:ye}),info:D({},s,{value:ke}),warn:D({},s,{value:de}),error:D({},s,{value:rs}),group:D({},s,{value:ns}),groupCollapsed:D({},s,{value:as}),groupEnd:D({},s,{value:is})})}oe<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ge=$.ReactCurrentDispatcher,We;function Pe(s,l,x){{if(We===void 0)try{throw Error()}catch(S){var g=S.stack.trim().match(/\n( *(at )?)/);We=g&&g[1]||""}return`
2
+ `+We+s}}var Ve=!1,Te;{var et=typeof WeakMap=="function"?WeakMap:Map;Te=new et}function ls(s,l){if(!s||Ve)return"";{var x=Te.get(s);if(x!==void 0)return x}var g;Ve=!0;var S=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=Ge.current,Ge.current=null,Qs();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(z){g=z}Reflect.construct(s,[],E)}else{try{E.call()}catch(z){g=z}s.call(E.prototype)}}else{try{throw Error()}catch(z){g=z}s()}}catch(z){if(z&&g&&typeof z.stack=="string"){for(var y=z.stack.split(`
3
+ `),M=g.stack.split(`
4
+ `),F=y.length-1,O=M.length-1;F>=1&&O>=0&&y[F]!==M[O];)O--;for(;F>=1&&O>=0;F--,O--)if(y[F]!==M[O]){if(F!==1||O!==1)do if(F--,O--,O<0||y[F]!==M[O]){var X=`
5
+ `+y[F].replace(" at new "," at ");return s.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",s.displayName)),typeof s=="function"&&Te.set(s,X),X}while(F>=1&&O>=0);break}}}finally{Ve=!1,Ge.current=C,Zs(),Error.prepareStackTrace=S}var fe=s?s.displayName||s.name:"",ue=fe?Pe(fe):"";return typeof s=="function"&&Te.set(s,ue),ue}function st(s,l,x){return ls(s,!1)}function tt(s){var l=s.prototype;return!!(l&&l.isReactComponent)}function De(s,l,x){if(s==null)return"";if(typeof s=="function")return ls(s,tt(s));if(typeof s=="string")return Pe(s);switch(s){case h:return Pe("Suspense");case m:return Pe("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case f:return st(s.render);case p:return De(s.type,l,x);case w:{var g=s,S=g._payload,C=g._init;try{return De(C(S),l,x)}catch{}}}return""}var Ne=Object.prototype.hasOwnProperty,os={},ds=$.ReactDebugCurrentFrame;function Ae(s){if(s){var l=s._owner,x=De(s.type,s._source,l?l.type:null);ds.setExtraStackFrame(x)}else ds.setExtraStackFrame(null)}function rt(s,l,x,g,S){{var C=Function.call.bind(Ne);for(var E in s)if(C(s,E)){var y=void 0;try{if(typeof s[E]!="function"){var M=Error((g||"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,g,x,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(F){y=F}y&&!(y instanceof Error)&&(Ae(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).",g||"React class",x,E,typeof y),Ae(null)),y instanceof Error&&!(y.message in os)&&(os[y.message]=!0,Ae(S),P("Failed %s type: %s",x,y.message),Ae(null))}}}var nt=Array.isArray;function ze(s){return nt(s)}function at(s){{var l=typeof Symbol=="function"&&Symbol.toStringTag,x=l&&s[Symbol.toStringTag]||s.constructor.name||"Object";return x}}function it(s){try{return us(s),!1}catch{return!0}}function us(s){return""+s}function hs(s){if(it(s))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",at(s)),us(s)}var xs=$.ReactCurrentOwner,ct={key:!0,ref:!0,__self:!0,__source:!0},ms,fs;function lt(s){if(Ne.call(s,"ref")){var l=Object.getOwnPropertyDescriptor(s,"ref").get;if(l&&l.isReactWarning)return!1}return s.ref!==void 0}function ot(s){if(Ne.call(s,"key")){var l=Object.getOwnPropertyDescriptor(s,"key").get;if(l&&l.isReactWarning)return!1}return s.key!==void 0}function dt(s,l){typeof s.ref=="string"&&xs.current}function ut(s,l){{var x=function(){ms||(ms=!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 ht(s,l){{var x=function(){fs||(fs=!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 xt=function(s,l,x,g,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:g}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function mt(s,l,x,g,S){{var C,E={},y=null,M=null;x!==void 0&&(hs(x),y=""+x),ot(l)&&(hs(l.key),y=""+l.key),lt(l)&&(M=l.ref,dt(l,S));for(C in l)Ne.call(l,C)&&!ct.hasOwnProperty(C)&&(E[C]=l[C]);if(s&&s.defaultProps){var F=s.defaultProps;for(C in F)E[C]===void 0&&(E[C]=F[C])}if(y||M){var O=typeof s=="function"?s.displayName||s.name||"Unknown":s;y&&ut(E,O),M&&ht(E,O)}return xt(s,y,M,S,g,xs.current,E)}}var Ye=$.ReactCurrentOwner,js=$.ReactDebugCurrentFrame;function me(s){if(s){var l=s._owner,x=De(s.type,s._source,l?l.type:null);js.setExtraStackFrame(x)}else js.setExtraStackFrame(null)}var He;He=!1;function Ke(s){return typeof s=="object"&&s!==null&&s.$$typeof===r}function ps(){{if(Ye.current){var s=_(Ye.current.type);if(s)return`
6
6
 
7
- Check the render method of \``+r+"`."}return""}}function hs(r){return""}var mr={};function xs(r){{var l=xr();if(!l){var u=typeof r=="string"?r:r.displayName||r.name;u&&(l=`
7
+ Check the render method of \``+s+"`."}return""}}function ft(s){return""}var gs={};function jt(s){{var l=ps();if(!l){var x=typeof s=="string"?s:s.displayName||s.name;x&&(l=`
8
8
 
9
- Check the top-level render call using <`+u+">.")}return l}}function fr(r,l){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var u=xs(l);if(mr[u])return;mr[u]=!0;var j="";r&&r._owner&&r._owner!==Ue.current&&(j=" It was passed a child from "+Y(r._owner.type)+"."),ae(r),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,j),ae(null)}}function jr(r,l){{if(typeof r!="object")return;if(Me(r))for(var u=0;u<r.length;u++){var j=r[u];Ge(j)&&fr(j,l)}else if(Ge(r))r._store&&(r._store.validated=!0);else if(r){var R=ve(r);if(typeof R=="function"&&R!==r.entries)for(var w=R.call(r),N;!(N=w.next()).done;)Ge(N.value)&&fr(N.value,l)}}}function ms(r){{var l=r.type;if(l==null||typeof l=="string")return;var u;if(typeof l=="function")u=l.propTypes;else if(typeof l=="object"&&(l.$$typeof===x||l.$$typeof===I))u=l.propTypes;else return;if(u){var j=Y(l);es(u,r.props,"prop",j,r)}else if(l.PropTypes!==void 0&&!qe){qe=!0;var R=Y(l);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof l.getDefaultProps=="function"&&!l.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fs(r){{for(var l=Object.keys(r.props),u=0;u<l.length;u++){var j=l[u];if(j!=="children"&&j!=="key"){ae(r),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",j),ae(null);break}}r.ref!==null&&(ae(r),O("Invalid attribute `ref` supplied to `React.Fragment`."),ae(null))}}var pr={};function gr(r,l,u,j,R,w){{var N=F(r);if(!N){var g="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(g+=" 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=hs();M?g+=M:g+=xr();var C;r===null?C="null":Me(r)?C="array":r!==void 0&&r.$$typeof===t?(C="<"+(Y(r.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):C=typeof r,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,g)}var k=us(r,l,u,R,w);if(k==null)return k;if(N){var H=l.children;if(H!==void 0)if(j)if(Me(H)){for(var ie=0;ie<H.length;ie++)jr(H[ie],r);Object.freeze&&Object.freeze(H)}else O("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 jr(H,r)}if(xe.call(l,"key")){var te=Y(r),q=Object.keys(l).filter(function(Ns){return Ns!=="key"}),We=q.length>0?"{key: someKey, "+q.join(": ..., ")+": ...}":"{key: someKey}";if(!pr[te+We]){var bs=q.length>0?"{"+q.join(": ..., ")+": ...}":"{}";O(`A props object containing a "key" prop is being spread into JSX:
9
+ Check the top-level render call using <`+x+">.")}return l}}function vs(s,l){{if(!s._store||s._store.validated||s.key!=null)return;s._store.validated=!0;var x=jt(l);if(gs[x])return;gs[x]=!0;var g="";s&&s._owner&&s._owner!==Ye.current&&(g=" It was passed a child from "+_(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,g),me(null)}}function bs(s,l){{if(typeof s!="object")return;if(ze(s))for(var x=0;x<s.length;x++){var g=s[x];Ke(g)&&vs(g,l)}else if(Ke(s))s._store&&(s._store.validated=!0);else if(s){var S=k(s);if(typeof S=="function"&&S!==s.entries)for(var C=S.call(s),E;!(E=C.next()).done;)Ke(E.value)&&vs(E.value,l)}}}function pt(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===p))x=l.propTypes;else return;if(x){var g=_(l);rt(x,s.props,"prop",g,s)}else if(l.PropTypes!==void 0&&!He){He=!0;var S=_(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 gt(s){{for(var l=Object.keys(s.props),x=0;x<l.length;x++){var g=l[x];if(g!=="children"&&g!=="key"){me(s),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),me(null);break}}s.ref!==null&&(me(s),P("Invalid attribute `ref` supplied to `React.Fragment`."),me(null))}}var ys={};function Ns(s,l,x,g,S,C){{var E=Me(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=ft();M?y+=M:y+=ps();var F;s===null?F="null":ze(s)?F="array":s!==void 0&&s.$$typeof===r?(F="<"+(_(s.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):F=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",F,y)}var O=mt(s,l,x,S,C);if(O==null)return O;if(E){var X=l.children;if(X!==void 0)if(g)if(ze(X)){for(var fe=0;fe<X.length;fe++)bs(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 bs(X,s)}if(Ne.call(l,"key")){var ue=_(s),z=Object.keys(l).filter(function(wt){return wt!=="key"}),Je=z.length>0?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}";if(!ys[ue+Je]){var _t=z.length>0?"{"+z.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} />`,We,te,bs,te),pr[te+We]=!0}}return r===a?fs(k):ms(k),k}}function js(r,l,u){return gr(r,l,u,!0)}function ps(r,l,u){return gr(r,l,u,!1)}var gs=ps,vs=js;fe.Fragment=a,fe.jsx=gs,fe.jsxs=vs})()),fe}var Nr;function Rs(){return Nr||(Nr=1,process.env.NODE_ENV==="production"?Ee.exports=ys():Ee.exports=_s()),Ee.exports}var e=Rs();class ce extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}class yr{baseUrl;headers;constructor(t={}){this.baseUrl=t.baseUrl??"",this.headers={"Content-Type":"application/json",...t.headers}}async request(t,n,a={}){let d=`${this.baseUrl}${n}`;if(a.params){const f=new URLSearchParams;Object.entries(a.params).forEach(([x,o])=>{o!=null&&o!==""&&f.set(x,String(o))});const i=f.toString();i&&(d+=`?${i}`)}const h=await fetch(d,{method:t,headers:this.headers,body:a.body?JSON.stringify(a.body):void 0});if(!h.ok){const f=await h.json().catch(()=>({detail:"Unknown error"}));throw new ce(h.status,f.detail||h.statusText)}if(!(h.status===204||h.headers.get("content-length")==="0"))return h.json()}async getCapabilities(){return this.request("GET","/api/v1/capabilities")}async listRuns(t){return this.request("GET","/api/runs",{params:t})}async getRun(t){return this.request("GET",`/api/runs/${t}`)}async deleteRun(t){await this.request("DELETE",`/api/runs/${t}`)}async setBaseline(t,n){return this.request("POST",`/api/projects/${t}/baseline/${n}`,{params:{redirect:"false"}})}async listProjects(t){return this.request("GET","/api/projects",{params:t})}async listGroups(t){return this.request("GET","/api/groups",{params:t})}async getGroup(t){return this.request("GET",`/api/groups/${t}`)}async getDiff(t,n){return this.request("GET","/api/diff",{params:{a:t,b:n}})}async getArtifact(t,n){return this.request("GET",`/api/runs/${t}/artifacts/${n}`)}getArtifactDownloadUrl(t,n){return`${this.baseUrl}/api/runs/${t}/artifacts/${n}/raw`}}const _r=new yr,Rr=y.createContext(null);function wr({children:s,api:t=_r,initialWorkspace:n=null}){const[a,d]=y.useState(null),[h,f]=y.useState(n);return y.useEffect(()=>{t.getCapabilities().then(d).catch(console.error)},[t]),e.jsx(Rr.Provider,{value:{api:t,capabilities:a,currentWorkspace:h,setCurrentWorkspace:f},children:s})}function W(){const s=y.useContext(Rr);if(!s)throw new Error("useApp must be used within AppProvider");return s}function ne(s,t=[]){const[n,a]=y.useState({data:null,loading:!0,error:null}),d=y.useRef(!0),h=y.useRef(s);h.current=s;const f=y.useCallback(async()=>{a(i=>({...i,loading:!0,error:null}));try{const i=await h.current();d.current&&a({data:i,loading:!1,error:null})}catch(i){d.current&&a({data:null,loading:!1,error:i instanceof ce?i:new ce(500,String(i))})}},[]);return y.useEffect(()=>(d.current=!0,f(),()=>{d.current=!1}),t),{...n,refetch:f}}function Ve(s){const{api:t,currentWorkspace:n}=W();return ne(()=>t.listRuns({...s,workspace:n?.id}),[t,n?.id,s?.project,s?.status,s?.q,s?.limit])}function Ye(s){const{api:t}=W();return ne(async()=>{const{run:n}=await t.getRun(s);return n},[t,s])}function ke(){const{api:s,currentWorkspace:t}=W();return ne(async()=>{const{projects:n}=await s.listProjects({workspace:t?.id});return n},[s,t?.id])}function Sr(s){const{api:t,currentWorkspace:n}=W();return ne(async()=>{const{groups:a}=await t.listGroups({...s,workspace:n?.id});return a},[t,n?.id,s?.project])}function Pr(s){const{api:t}=W();return ne(()=>t.getGroup(s),[t,s])}function Er(s,t){const{api:n}=W();return ne(()=>n.getDiff(s,t),[n,s,t])}function Tr(s,t){const{api:n}=W();return ne(()=>n.getArtifact(s,t),[n,s,t])}function le(s){const[t,n]=y.useState(!1),[a,d]=y.useState(null);return{mutate:y.useCallback(async(...f)=>{n(!0),d(null);try{return await s(...f)}catch(i){const x=i instanceof ce?i:new ce(500,String(i));throw d(x),x}finally{n(!1)}},[s]),loading:t,error:a}}function z(s){return s?.slice(0,8)??""}function Te(s){return s?.slice(0,12)??"N/A"}function ge(s){const t=new Date(s),a=Math.floor((new Date().getTime()-t.getTime())/1e3);if(a<60)return"just now";if(a<3600){const h=Math.floor(a/60);return`${h} minute${h!==1?"s":""} ago`}if(a<86400){const h=Math.floor(a/3600);return`${h} hour${h!==1?"s":""} ago`}if(a<2592e3){const h=Math.floor(a/86400);return`${h} day${h!==1?"s":""} ago`}if(a<31536e3){const h=Math.floor(a/2592e3);return`${h} month${h!==1?"s":""} ago`}const d=Math.floor(a/31536e3);return`${d} year${d!==1?"s":""} ago`}function Cr(s,t=6){return typeof s!="number"||isNaN(s)?String(s):Number(s.toPrecision(t)).toString()}function pe(s){return s<1024?`${s} bytes`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(1)} MB`}function kr(s){return JSON.stringify(s,null,2)}function Dr(s,t=60){return s?s.length<=t?s:s.slice(0,t-3)+"...":""}function ws(s,t){const n=new URLSearchParams;Object.entries(t).forEach(([d,h])=>{h!=null&&h!==""&&n.set(d,String(h))});const a=n.toString();return a?`${s}?${a}`:s}function A(...s){return s.filter(Boolean).join(" ")}const Ss=[{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"]}],Ar=y.createContext(null);function Ps({config:s,children:t}){return e.jsx(Ar.Provider,{value:s,children:t})}function Or(){return y.useContext(Ar)}function U({children:s,config:t}){const n=P.useLocation(),d={...Or(),...t},h=d?.navLinks??Ss,f=[...d?.prependNavLinks??[],...h,...d?.appendNavLinks??[]],i=d?.logo??{text:"devqubit",icon:"⚛"},x=o=>o.matchPaths?o.matchPaths.some(p=>n.pathname.startsWith(p)):n.pathname===o.href;return e.jsxs("div",{className:"min-h-screen bg-primary-bg",children:[e.jsx("header",{className:"bg-gray-900 h-14 sticky top-0 z-50",children:e.jsxs("div",{className:"max-w-container mx-auto px-6 h-full flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsxs(P.Link,{to:"/",className:"text-lg font-bold text-primary hover:text-primary-light flex items-center gap-1.5",children:[i.icon&&e.jsx("span",{children:i.icon}),i.text]}),e.jsx("nav",{className:"flex gap-1",children:f.map(o=>e.jsx(P.Link,{to:o.href,className:A("px-3 py-2 rounded-md text-sm font-medium transition-all",x(o)?"text-white bg-primary/20":"text-gray-400 hover:text-white hover:bg-white/10"),children:o.label},o.href))})]}),e.jsx("div",{className:"flex items-center gap-4",children:d?.headerRight})]})}),e.jsx("main",{className:"max-w-container mx-auto p-6",children:s})]})}function oe({title:s,subtitle:t,actions:n}){return e.jsxs("div",{className:"flex items-start justify-between mb-6 gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-gray-900 flex items-center gap-2 flex-wrap",children:s}),t&&e.jsx("p",{className:"text-sm text-muted mt-1",children:t})]}),n&&e.jsx("div",{className:"flex gap-2",children:n})]})}function B({variant:s="gray",className:t,children:n,...a}){return e.jsx("span",{className:A("badge",`badge-${s}`,t),...a,children:n})}const D=y.forwardRef(({variant:s="secondary",size:t="default",loading:n,className:a,children:d,disabled:h,...f},i)=>e.jsxs("button",{ref:i,className:A("btn",s==="ghost-danger"?"btn-ghost-danger":`btn-${s}`,t==="sm"&&"btn-sm",a),disabled:h||n,...f,children:[n&&e.jsx(G,{}),d]}));D.displayName="Button";function v({className:s,children:t,...n}){return e.jsx("div",{className:A("card",s),...n,children:t})}function E({className:s,children:t,...n}){return e.jsx("div",{className:A("card-header",s),...n,children:t})}function T({className:s,children:t,...n}){return e.jsx("h3",{className:A("card-title",s),...n,children:t})}function Es({variant:s="info",className:t,children:n,...a}){return e.jsx("div",{className:A("alert",`alert-${s}`,t),...a,children:n})}function G({className:s,...t}){return e.jsx("span",{className:A("spinner",s),...t})}function re({message:s,hint:t,className:n,...a}){return e.jsxs("div",{className:A("empty-state",n),...a,children:[e.jsx("p",{children:s}),t&&e.jsx("p",{className:"text-sm text-muted mt-2",children:t})]})}function Ce({items:s,className:t,...n}){return e.jsx("dl",{className:A("kv-list",t),...n,children:s.map(({label:a,value:d})=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:d})]},a))})}function Fr({open:s,onClose:t,title:n,children:a,actions:d}){return s?e.jsx("div",{className:A("modal-backdrop",s&&"active"),onClick:h=>h.target===h.currentTarget&&t(),children:e.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[e.jsx("h3",{className:"modal-title",children:n}),e.jsx("div",{className:"modal-body",children:a}),d&&e.jsx("div",{className:"modal-actions",children:d})]})}):null}function $r({message:s,variant:t="info",visible:n,onClose:a}){if(!n)return null;const d={success:"bg-success-bg text-[#065f46] border-[#a7f3d0]",error:"bg-danger-bg text-[#991b1b] border-[#fecaca]",info:"bg-info-bg text-[#1e40af] border-[#bfdbfe]"}[t];return e.jsx("div",{className:A("toast",d),onClick:a,children:s})}function J({children:s,className:t}){return e.jsx("div",{className:A("form-group",t),children:s})}function Z({className:s,children:t,...n}){return e.jsx("label",{className:A("form-label",s),...n,children:t})}const De=y.forwardRef(({className:s,...t},n)=>e.jsx("input",{ref:n,className:A("form-input",s),...t}));De.displayName="Input";const ee=y.forwardRef(({className:s,children:t,...n},a)=>e.jsx("select",{ref:a,className:A("form-input",s),...n,children:t}));ee.displayName="Select";function ze({children:s,className:t}){return e.jsx("div",{className:A("form-row",t),children:s})}function $({className:s,children:t,...n}){return e.jsx("table",{className:A("table",s),...n,children:t})}function X({className:s,children:t,...n}){return e.jsx("thead",{className:s,...n,children:t})}function L({className:s,children:t,...n}){return e.jsx("tbody",{className:s,...n,children:t})}function m({className:s,children:t,...n}){return e.jsx("tr",{className:s,...n,children:t})}function b({className:s,children:t,...n}){return e.jsx("th",{className:s,...n,children:t})}function c({className:s,children:t,...n}){return e.jsx("td",{className:s,...n,children:t})}function He({status:s}){const t={FINISHED:"success",FAILED:"danger",RUNNING:"warning",UNKNOWN:"gray"}[s];return e.jsx(B,{variant:t,children:s})}function Ae({runs:s,onDelete:t,loading:n,emptyHint:a}){return s.length?e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Run ID"}),e.jsx(b,{children:"Name"}),e.jsx(b,{children:"Project"}),e.jsx(b,{children:"Status"}),e.jsx(b,{children:"Created"}),e.jsx(b,{children:"Actions"})]})}),e.jsx(L,{children:s.map(d=>e.jsxs(m,{children:[e.jsx(c,{children:e.jsx(P.Link,{to:`/runs/${d.run_id}`,className:"font-mono",children:z(d.run_id)})}),e.jsx(c,{children:d.run_name||"—"}),e.jsx(c,{children:d.project}),e.jsx(c,{children:e.jsx(He,{status:d.status})}),e.jsx(c,{className:"text-muted",children:ge(d.created_at)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P.Link,{to:`/runs/${d.run_id}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View"})}),t&&e.jsx(D,{variant:"ghost-danger",size:"sm",onClick:()=>{confirm(`Delete run ${z(d.run_id)}? This cannot be undone.`)&&t(d.run_id)},disabled:n,children:"Delete"})]})})]},d.run_id))})]}):e.jsx(re,{message:"No runs found",hint:a??"Try adjusting your filters"})}function Lr(){const[s,t]=P.useSearchParams(),{api:n}=W(),{data:a}=ke(),[d,h]=y.useState({project:s.get("project")||"",status:s.get("status")||"",q:s.get("q")||"",limit:parseInt(s.get("limit")||"25",10)}),{data:f,loading:i,refetch:x}=Ve(d),o=le(_=>n.deleteRun(_)),p=y.useCallback((_,V)=>{h(de=>({...de,[_]:V}));const K=new URLSearchParams(s);V?K.set(_,String(V)):K.delete(_),t(K,{replace:!0})},[s,t]),I=y.useCallback(async _=>{await o.mutate(_),x()},[o,x]);return e.jsxs(U,{children:[e.jsx(oe,{title:"Runs"}),e.jsx(v,{className:"mb-4",children:e.jsxs(ze,{children:[e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"project",children:"Project"}),e.jsxs(ee,{id:"project",value:d.project,onChange:_=>p("project",_.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),a?.map(_=>e.jsx("option",{value:_.name,children:_.name},_.name))]})]}),e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"status",children:"Status"}),e.jsxs(ee,{id:"status",value:d.status,onChange:_=>p("status",_.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(J,{children:[e.jsx(Z,{htmlFor:"q",children:"Query"}),e.jsx(De,{id:"q",value:d.q,onChange:_=>p("q",_.target.value),placeholder:"metric.fidelity > 0.9"})]}),e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"limit",children:"Limit"}),e.jsxs(ee,{id:"limit",value:d.limit,onChange:_=>p("limit",parseInt(_.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(J,{className:"flex items-end gap-2",children:[e.jsx(D,{variant:"primary",onClick:()=>x(),children:"Filter"}),i&&e.jsx(G,{})]})]})}),e.jsx(v,{children:i&&!f?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Ae,{runs:f?.runs??[],onDelete:I,loading:o.loading})})]})}function Br({projects:s,currentWorkspace:t}){if(!s.length)return e.jsx(re,{message:"No projects yet",hint:"Projects are created automatically when you log runs"});const n=a=>{const d=new URLSearchParams({project:a});return t&&d.set("workspace",t.id),`/runs?${d}`};return e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Project"}),e.jsx(b,{children:"Runs"}),e.jsx(b,{children:"Baseline"}),e.jsx(b,{})]})}),e.jsx(L,{children:s.map(a=>e.jsxs(m,{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:Dr(a.description)})]}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:a.run_count??0})}),e.jsx(c,{children:a.baseline?e.jsxs(e.Fragment,{children:[e.jsx(P.Link,{to:`/runs/${a.baseline.run_id}`,className:"font-mono text-sm",children:z(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(P.Link,{to:n(a.name),children:e.jsx(D,{variant:"secondary",size:"sm",children:"View Runs"})})})]},a.name))})]})}function Ir({groups:s}){return s.length?e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Group ID"}),e.jsx(b,{children:"Name"}),e.jsx(b,{children:"Project"}),e.jsx(b,{children:"Runs"}),e.jsx(b,{children:"Actions"})]})}),e.jsx(L,{children:s.map(t=>e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:z(t.group_id)}),e.jsx(c,{children:t.group_name||"—"}),e.jsx(c,{children:t.project}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:t.run_count})}),e.jsx(c,{children:e.jsx(P.Link,{to:`/groups/${t.group_id}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View Runs"})})})]},t.group_id))})]}):e.jsx(re,{message:"No groups found",hint:"Groups are created when runs have a group_id set"})}function Mr(){const{runId:s}=P.useParams(),t=P.useNavigate(),{api:n}=W(),{data:a,loading:d,error:h,refetch:f}=Ye(s),[i,x]=y.useState(!1),[o,p]=y.useState(null),{mutate:I,loading:_}=le(()=>n.setBaseline(a.project,a.run_id)),{mutate:V,loading:K}=le(()=>n.deleteRun(s));if(y.useEffect(()=>{if(o){const S=setTimeout(()=>p(null),3e3);return()=>clearTimeout(S)}},[o]),d)return e.jsx(U,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})});if(h||!a)return e.jsx(U,{children:e.jsx(v,{children:e.jsx(re,{message:"Run not found",hint:h?.message||`Run ${s} does not exist`})})});const de=a.backend||{},ve=a.fingerprints||{},Q=a.data?.params||{},O=a.data?.metrics||{},be=a.data?.tags||{},ue=a.artifacts||[],Ne=a.errors||[],Oe=async()=>{await I(),f()},Fe=async()=>{await V(),t("/runs")},$e=async S=>{try{const F=n.getArtifactDownloadUrl(a.run_id,S),ye=await fetch(F);if(!ye.ok)throw new Error("Download failed");const _e=await ye.blob(),Y=document.createElement("a");Y.href=URL.createObjectURL(_e),Y.download=`artifact-${S}`,Y.click(),URL.revokeObjectURL(Y.href),p({message:"Download started",variant:"success"})}catch{p({message:"Download failed",variant:"error"})}};return e.jsxs(U,{children:[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.jsxs(D,{variant:"secondary",size:"sm",onClick:Oe,disabled:_,children:[_&&e.jsx(G,{}),"Set as Baseline"]}),e.jsx(D,{variant:"ghost-danger",size:"sm",onClick:()=>x(!0),children:"Delete"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Overview"})}),e.jsx(Ce,{items:[{label:"Project",value:e.jsx(P.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(He,{status:a.status})},{label:"Created",value:`${a.created_at} (${ge(a.created_at)})`},{label:"Backend",value:de.name||"N/A"},...a.group_id?[{label:"Group",value:e.jsx(P.Link,{to:`/groups/${a.group_id}`,children:a.group_name||z(a.group_id)})}]:[]]})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Fingerprints"})}),e.jsx(Ce,{items:[{label:"Run",value:e.jsx("span",{className:"font-mono text-sm truncate",children:ve.run||"N/A"})},{label:"Program",value:e.jsx("span",{className:"font-mono text-sm truncate",children:ve.program||"N/A"})}]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Parameters"})}),Object.keys(Q).length?e.jsx($,{children:e.jsx(L,{children:Object.entries(Q).map(([S,F])=>e.jsxs(m,{children:[e.jsx(c,{children:S}),e.jsx(c,{className:"font-mono",children:String(F)})]},S))})}):e.jsx("p",{className:"text-muted",children:"No parameters"})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Metrics"})}),Object.keys(O).length?e.jsx($,{children:e.jsx(L,{children:Object.entries(O).map(([S,F])=>e.jsxs(m,{children:[e.jsx(c,{children:S}),e.jsx(c,{className:"font-mono",children:typeof F=="number"?Cr(F):String(F)})]},S))})}):e.jsx("p",{className:"text-muted",children:"No metrics"})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Tags"})}),Object.keys(be).length?e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(be).map(([S,F])=>e.jsxs(B,{variant:"gray",children:[S,": ",String(F)]},S))}):e.jsx("p",{className:"text-muted",children:"No tags"})]})]}),e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsxs(T,{children:["Artifacts (",ue.length,")"]})}),ue.length?e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"#"}),e.jsx(b,{children:"Kind"}),e.jsx(b,{children:"Role"}),e.jsx(b,{children:"Media Type"}),e.jsx(b,{children:"Digest"}),e.jsx(b,{children:"Actions"})]})}),e.jsx(L,{children:ue.map((S,F)=>e.jsxs(m,{children:[e.jsx(c,{children:F}),e.jsx(c,{className:"font-mono text-sm",children:S.kind}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:S.role})}),e.jsx(c,{className:"text-muted text-sm",children:S.media_type}),e.jsx(c,{className:"font-mono text-sm",children:Te(S.digest)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P.Link,{to:`/runs/${a.run_id}/artifacts/${F}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View"})}),e.jsx(D,{variant:"secondary",size:"sm",onClick:()=>$e(F),children:"Download"})]})})]},F))})]}):e.jsx("p",{className:"text-muted",children:"No artifacts"})]}),Ne.length>0&&e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{className:"text-danger",children:"Errors"})}),Ne.map((S,F)=>e.jsxs("div",{className:"mb-2",children:[e.jsx("strong",{children:S.type}),": ",S.message,S.traceback&&e.jsx("pre",{className:"mt-2",children:S.traceback})]},F))]}),e.jsxs(Fr,{open:i,onClose:()=>x(!1),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"secondary",onClick:()=>x(!1),children:"Cancel"}),e.jsxs(D,{variant:"danger",onClick:Fe,disabled:K,children:[K&&e.jsx(G,{}),"Delete"]})]}),children:[e.jsx("p",{children:"Are you sure you want to delete this run?"}),e.jsx("p",{className:"font-mono text-sm mt-2",children:z(a.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]}),o&&e.jsx($r,{message:o.message,variant:o.variant,visible:!!o,onClose:()=>p(null)})]})}function Ur(){const{currentWorkspace:s}=W(),{data:t,loading:n}=ke();return e.jsxs(U,{children:[e.jsx(oe,{title:"Projects"}),e.jsx(v,{children:n?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Br,{projects:t??[],currentWorkspace:s})})]})}function qr(){const[s,t]=P.useSearchParams(),{data:n}=ke(),[a,d]=y.useState(s.get("project")||""),{data:h,loading:f,refetch:i}=Sr({project:a||void 0}),x=y.useCallback(o=>{d(o);const p=new URLSearchParams(s);o?p.set("project",o):p.delete("project"),t(p,{replace:!0})},[s,t]);return e.jsxs(U,{children:[e.jsx(oe,{title:"Run Groups"}),e.jsx(v,{className:"mb-4",children:e.jsxs(ze,{children:[e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"project",children:"Project"}),e.jsxs(ee,{id:"project",value:a,onChange:o=>x(o.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),n?.map(o=>e.jsx("option",{value:o.name,children:o.name},o.name))]})]}),e.jsxs(J,{className:"flex items-end gap-2",children:[e.jsx(D,{variant:"primary",onClick:()=>i(),children:"Filter"}),f&&e.jsx(G,{})]})]})}),e.jsx(v,{children:f&&!h?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Ir,{groups:h??[]})})]})}function Gr(){const{groupId:s}=P.useParams(),{api:t}=W(),{data:n,loading:a,error:d,refetch:h}=Pr(s),f=le(x=>t.deleteRun(x)),i=async x=>{await f.mutate(x),h()};return a?e.jsx(U,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})}):d||!n?e.jsx(U,{children:e.jsx(v,{children:e.jsx(re,{message:"Group not found",hint:d?.message})})}):e.jsxs(U,{children:[e.jsx(oe,{title:e.jsxs(e.Fragment,{children:["Group ",e.jsx("span",{className:"font-mono",children:z(s)})]}),subtitle:e.jsx("span",{className:"font-mono text-muted",children:s})}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsxs(T,{children:["Runs in Group (",n.runs.length,")"]})}),e.jsx(Ae,{runs:n.runs,onDelete:i,loading:f.loading})]})]})}function je({match:s,yesText:t="✓ Match",noText:n="✗ Different"}){return e.jsx("span",{className:s?"diff-match":"diff-mismatch",children:s?t:n})}function Ts(){const[s,t]=P.useSearchParams(),{data:n}=Ve({limit:100}),a=n?.runs??[],[d,h]=y.useState(s.get("a")||""),[f,i]=y.useState(s.get("b")||""),x=o=>{o.preventDefault(),d&&f&&t({a:d,b:f})};return e.jsxs(e.Fragment,{children:[e.jsx(v,{children:e.jsxs("form",{onSubmit:x,children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"a",children:"Run A (Baseline)"}),e.jsxs(ee,{id:"a",value:d,onChange:o=>h(o.target.value),required:!0,children:[e.jsx("option",{value:"",children:"Select run..."}),a.map(o=>e.jsxs("option",{value:o.run_id,children:[o.run_name||"Unnamed"," (",z(o.run_id),") — ",o.project]},o.run_id))]})]}),e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"b",children:"Run B (Candidate)"}),e.jsxs(ee,{id:"b",value:f,onChange:o=>i(o.target.value),required:!0,children:[e.jsx("option",{value:"",children:"Select run..."}),a.map(o=>e.jsxs("option",{value:o.run_id,children:[o.run_name||"Unnamed"," (",z(o.run_id),") — ",o.project]},o.run_id))]})]})]}),e.jsx(D,{type:"submit",variant:"primary",disabled:!d||!f,children:"Compare"})]})}),e.jsxs(v,{className:"mt-4",children:[e.jsx(E,{children:e.jsx(T,{children:"Tips"})}),e.jsxs("ul",{className:"text-muted text-sm list-disc pl-6 space-y-1",children:[e.jsx("li",{children:"Select two runs to compare their parameters, metrics, and artifacts"}),e.jsx("li",{children:"The diff will show changed values and compute TVD for result distributions"}),e.jsx("li",{children:"You can also compare from the run detail page"})]})]})]})}function Cs({runIdA:s,runIdB:t}){const{data:n,loading:a,error:d}=Er(s,t);if(a)return e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})});if(d||!n)return e.jsx(v,{children:e.jsx(re,{message:"Failed to load diff",hint:d?.message})});const{run_a:h,run_b:f,report:i}=n;return e.jsxs(e.Fragment,{children:[i.warnings&&i.warnings.length>0&&e.jsxs("div",{className:"alert alert-warning mb-4",children:[e.jsx("strong",{children:"Warnings:"}),e.jsx("ul",{className:"list-disc pl-6 mt-1",children:i.warnings.map((x,o)=>e.jsx("li",{children:x},o))})]}),e.jsx(v,{className:"mb-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm text-muted uppercase tracking-wider mb-1",children:"Run A (Baseline)"}),e.jsx("p",{children:e.jsx(P.Link,{to:`/runs/${h.run_id}`,children:h.run_name||"Unnamed Run"})}),e.jsx("p",{className:"font-mono text-sm text-muted",children:z(h.run_id)}),e.jsxs("p",{className:"text-muted text-sm",children:[h.project," · ",ge(h.created_at)]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm text-muted uppercase tracking-wider mb-1",children:"Run B (Candidate)"}),e.jsx("p",{children:e.jsx(P.Link,{to:`/runs/${f.run_id}`,children:f.run_name||"Unnamed Run"})}),e.jsx("p",{className:"font-mono text-sm text-muted",children:z(f.run_id)}),e.jsxs("p",{className:"text-muted text-sm",children:[f.project," · ",ge(f.created_at)]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Metadata"})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Project"}),e.jsx(c,{children:e.jsx(je,{match:i.metadata.project_match})})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Backend"}),e.jsx(c,{children:e.jsx(je,{match:i.metadata.backend_match})})]}),!i.metadata.project_match&&e.jsxs(e.Fragment,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Project A"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.project_a||"N/A"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"text-muted text-sm",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(m,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Backend A"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.backend_a||"N/A"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Backend B"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.backend_b||"N/A"})]})]})]})})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Fingerprints"})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono text-sm",children:Te(i.fingerprints.a)})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono text-sm",children:Te(i.fingerprints.b)})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Match"}),e.jsx(c,{children:e.jsx(je,{match:i.fingerprints.a===i.fingerprints.b,yesText:"✓ Yes",noText:"✗ No"})})]})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsxs(T,{children:["Program",i.program.exact_match?e.jsx(B,{variant:"success",children:"Exact Match"}):i.program.structural_match?e.jsx(B,{variant:"info",children:"Structural Match"}):e.jsx(B,{variant:"warning",children:"Different"})]})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Exact Match"}),e.jsx(c,{children:e.jsx(je,{match:i.program.exact_match,yesText:"✓ Yes",noText:"✗ No"})})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Structural Match"}),e.jsx(c,{children:e.jsx(je,{match:i.program.structural_match,yesText:"✓ Yes",noText:"✗ No"})})]})]})})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsxs(T,{children:["Device Calibration",i.device_drift?.significant_drift?e.jsx(B,{variant:"warning",children:"Drifted"}):i.device_drift?.has_calibration_data?e.jsx(B,{variant:"success",children:"Stable"}):e.jsx(B,{variant:"gray",children:"N/A"})]})}),i.device_drift?.significant_drift?e.jsx("p",{className:"text-sm text-warning",children:"⚠ Significant calibration drift detected"}):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(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsxs(T,{children:["Parameters ",e.jsx(B,{variant:i.params.match?"success":"warning",children:i.params.match?"Match":"Different"})]})}),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(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Parameter"}),e.jsx(b,{children:"Run A"}),e.jsx(b,{children:"Run B"})]})}),e.jsx(L,{children:Object.entries(i.params.changed).map(([x,o])=>e.jsxs(m,{children:[e.jsx(c,{children:x}),e.jsx(c,{className:"font-mono",children:String(o.a)}),e.jsx(c,{className:"font-mono",children:String(o.b)})]},x))})]})})]}),e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsxs(T,{children:["Metrics ",e.jsx(B,{variant:i.metrics.match?"success":"warning",children:i.metrics.match?"Match":"Different"})]})}),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(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Metric"}),e.jsx(b,{children:"Run A"}),e.jsx(b,{children:"Run B"})]})}),e.jsx(L,{children:Object.entries(i.metrics.changed).map(([x,o])=>e.jsxs(m,{children:[e.jsx(c,{children:x}),e.jsx(c,{className:"font-mono",children:o.a}),e.jsx(c,{className:"font-mono",children:o.b})]},x))})]})})]}),i.circuit_diff&&e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsxs(T,{children:["Circuit",e.jsx(B,{variant:i.circuit_diff.match?"success":"warning",children:i.circuit_diff.match?"Match":"Different"})]})}),i.circuit_diff.match?e.jsx("p",{className:"text-muted",children:"Circuit structure matches"}):e.jsxs(e.Fragment,{children:[i.circuit_diff.changed&&Object.keys(i.circuit_diff.changed).length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Changed"}),e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Property"}),e.jsx(b,{children:"Run A"}),e.jsx(b,{children:"Run B"}),e.jsx(b,{children:"Delta"})]})}),e.jsx(L,{children:Object.entries(i.circuit_diff.changed).map(([x,o])=>e.jsxs(m,{children:[e.jsx(c,{children:o.label||x}),e.jsx(c,{className:"font-mono",children:String(o.a)}),e.jsx(c,{className:"font-mono",children:String(o.b)}),e.jsx(c,{className:"font-mono",children:o.delta!=null&&e.jsxs(e.Fragment,{children:[o.delta>0?"+":"",o.delta,o.pct!=null&&` (${o.pct>0?"+":""}${o.pct.toFixed(1)}%)`]})})]},x))})]})]}),i.circuit_diff.is_clifford_changed&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Clifford Status"}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{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(m,{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",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"New Gate Types (in B)"}),e.jsx("p",{className:"font-mono text-sm",children:i.circuit_diff.added_gates.join(", ")})]}),i.circuit_diff.removed_gates&&i.circuit_diff.removed_gates.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Removed Gate Types (from A)"}),e.jsx("p",{className:"font-mono text-sm",children:i.circuit_diff.removed_gates.join(", ")})]})]})]}),i.tvd!=null&&e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsx(T,{children:"Results"})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Total Variation Distance (TVD)"}),e.jsx(c,{className:"font-mono",children:i.tvd.toFixed(6)})]}),i.shots&&e.jsxs(m,{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(m,{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(m,{children:[e.jsx(c,{children:"p-value"}),e.jsx(c,{className:"font-mono",children:i.noise_context.p_value.toFixed(3)})]})]})}),i.tvd>0&&i.noise_context&&e.jsx("p",{className:"text-sm mt-4",children:i.noise_context.p_value!=null?i.noise_context.p_value>=.1?e.jsx("span",{className:"text-success",children:"✓ Consistent with sampling noise — difference is not statistically significant."}):i.noise_context.p_value>=.05?e.jsxs("span",{className:"text-warning",children:["⚠ Borderline (p=",i.noise_context.p_value.toFixed(2),"). Consider increasing shots."]}):e.jsxs("span",{className:"text-danger",children:["✗ Statistically significant difference (p=",i.noise_context.p_value.toFixed(2),") — results show meaningful divergence."]}):i.noise_context.noise_ratio!=null?i.noise_context.noise_ratio<1.5?e.jsx("span",{className:"text-success",children:"✓ TVD is within expected shot noise range."}):i.noise_context.noise_ratio<3?e.jsxs("span",{className:"text-warning",children:["⚠ Ambiguous (",i.noise_context.noise_ratio.toFixed(1),"× expected noise). Consider increasing shots."]}):e.jsxs("span",{className:"text-danger",children:["✗ TVD exceeds expected noise (",i.noise_context.noise_ratio.toFixed(1),"×) — results show meaningful differences."]}):null})]})]})}function Wr(){const[s]=P.useSearchParams(),t=s.get("a"),n=s.get("b"),a=t&&n;return e.jsxs(U,{children:[e.jsx("div",{className:"page-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"page-title",children:["Compare Runs",a&&e.jsx(B,{variant:"info",children:"Comparing"})]}),a&&e.jsx("p",{className:"text-muted text-sm",children:e.jsx(P.Link,{to:"/diff",children:"← Select different runs"})})]})}),a?e.jsx(Cs,{runIdA:t,runIdB:n}):e.jsx(Ts,{})]})}function Vr(){const{api:s}=W(),[t,n]=y.useState(""),[a,d]=y.useState(null),[h,f]=y.useState(!1),{mutate:i,loading:x}=le(async()=>{const p=await s.listRuns({q:t,limit:100});return d(p.runs),f(!0),p}),o=p=>{p.preventDefault(),t.trim()&&i()};return e.jsxs(U,{children:[e.jsx("div",{className:"page-header",children:e.jsx("h1",{className:"page-title",children:"Search Runs"})}),e.jsx(v,{className:"mb-4",children:e.jsxs("form",{onSubmit:o,children:[e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"q",children:"Query"}),e.jsx(De,{id:"q",type:"text",value:t,onChange:p=>n(p.target.value),placeholder:"metric.fidelity > 0.95 and params.shots = 1000",className:"font-mono"})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs(D,{type:"submit",variant:"primary",disabled:x||!t.trim(),children:[x&&e.jsx(G,{}),"Search"]}),x&&e.jsx("span",{className:"text-muted text-sm",children:"Searching..."})]})]})}),h&&a&&e.jsx(v,{className:"mb-4",children:a.length>0?e.jsx(Ae,{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(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Query Syntax"})}),e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Field"}),e.jsx(b,{children:"Description"})]})}),e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"params.X"}),e.jsx(c,{children:"Parameter value"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"metric.X"}),e.jsx(c,{children:"Metric value"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"tags.X"}),e.jsx(c,{children:"Tag value"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"status"}),e.jsx(c,{children:"Run status"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"project"}),e.jsx(c,{children:"Project name"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"backend"}),e.jsx(c,{children:"Backend name"})]})]})]})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Operators"})}),e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Operator"}),e.jsx(b,{children:"Description"})]})}),e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"="}),e.jsx(c,{children:"Equals"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"!="}),e.jsx(c,{children:"Not equals"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:">"}),e.jsx(c,{children:"Greater than"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:">="}),e.jsx(c,{children:"Greater or equal"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"<"}),e.jsx(c,{children:"Less than"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"<="}),e.jsx(c,{children:"Less or equal"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"~"}),e.jsx(c,{children:"Contains"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"and"}),e.jsx(c,{children:"Combine conditions"})]})]})]})]})]}),e.jsxs(v,{className:"mt-4",children:[e.jsx(E,{children:e.jsx(T,{children:"Examples"})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"metric.fidelity > 0.95"}),e.jsx(c,{children:"High fidelity runs"})]}),e.jsxs(m,{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(m,{children:[e.jsx(c,{className:"font-mono",children:"tags.backend ~ ibm"}),e.jsx(c,{children:"Runs with IBM backends"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"metric.error < 0.01"}),e.jsx(c,{children:"Low error runs"})]}),e.jsxs(m,{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 Yr(){const{runId:s,index:t}=P.useParams(),n=parseInt(t,10),{api:a}=W(),{data:d}=Ye(s),{data:h,loading:f,error:i}=Tr(s,n);if(f)return e.jsx(U,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})});if(i||!h)return e.jsx(U,{children:e.jsx(v,{children:e.jsx(re,{message:"Artifact not found",hint:i?.message})})});const{artifact:x,size:o,content:p,content_json:I,preview_available:_,error:V}=h,K=10*1024*1024;return e.jsxs(U,{children:[e.jsx(oe,{title:x.kind,subtitle:e.jsxs(e.Fragment,{children:["← Back to run ",e.jsxs(P.Link,{to:`/runs/${s}`,children:[z(s),d?.run_name&&` — ${d.run_name}`]})]}),actions:e.jsx("a",{href:a.getArtifactDownloadUrl(s,n),children:e.jsx(D,{variant:"primary",children:"Download"})})}),e.jsx(v,{className:"mb-4",children:e.jsx(Ce,{items:[{label:"Kind",value:e.jsx("span",{className:"font-mono",children:x.kind})},{label:"Role",value:e.jsx(B,{variant:"gray",children:x.role})},{label:"Media Type",value:x.media_type},{label:"Digest",value:e.jsx("span",{className:"font-mono text-sm",children:x.digest})},{label:"Size",value:pe(o)}]})}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Content"})}),V?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-danger",children:["⚠ Error loading artifact: ",V]}),e.jsx("p",{className:"text-muted mt-2",children:e.jsx("a",{href:a.getArtifactDownloadUrl(s,n),children:e.jsx(D,{variant:"primary",children:"Download to view"})})})]}):_?I?e.jsx("pre",{children:kr(I)}):p?e.jsx("pre",{children:p}):e.jsxs("p",{className:"text-muted",children:["Binary content (",pe(o),") — download to view"]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted",children:[e.jsx("strong",{children:"Artifact too large for preview"})," (",pe(o)," exceeds ",pe(K)," 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",{href:a.getArtifactDownloadUrl(s,n),children:e.jsx(D,{variant:"primary",children:"Download"})})})]})]})]})}const zr=[{path:"/",element:e.jsx(P.Navigate,{to:"/runs",replace:!0})},{path:"/runs",element:e.jsx(Lr,{})},{path:"/runs/:runId",element:e.jsx(Mr,{})},{path:"/runs/:runId/artifacts/:index",element:e.jsx(Yr,{})},{path:"/projects",element:e.jsx(Ur,{})},{path:"/groups",element:e.jsx(qr,{})},{path:"/groups/:groupId",element:e.jsx(Gr,{})},{path:"/diff",element:e.jsx(Wr,{})},{path:"/search",element:e.jsx(Vr,{})}];function Ke(s=[]){return P.createBrowserRouter([...zr,...s])}const Hr=Ke();function ks({additionalRoutes:s,...t}){const n=s?.length?Ke(s):Hr;return e.jsx(wr,{...t,children:e.jsx(P.RouterProvider,{router:n})})}exports.Alert=Es;exports.ApiClient=yr;exports.ApiError=ce;exports.App=ks;exports.AppProvider=wr;exports.ArtifactPage=Yr;exports.Badge=B;exports.Button=D;exports.Card=v;exports.CardHeader=E;exports.CardTitle=T;exports.DiffPage=Wr;exports.EmptyState=re;exports.FormGroup=J;exports.FormRow=ze;exports.GroupDetailPage=Gr;exports.GroupsPage=qr;exports.GroupsTable=Ir;exports.Input=De;exports.KVList=Ce;exports.Label=Z;exports.Layout=U;exports.LayoutConfigProvider=Ps;exports.Modal=Fr;exports.PageHeader=oe;exports.ProjectsPage=Ur;exports.ProjectsTable=Br;exports.RunDetailPage=Mr;exports.RunsPage=Lr;exports.RunsTable=Ae;exports.SearchPage=Vr;exports.Select=ee;exports.Spinner=G;exports.StatusBadge=He;exports.Table=$;exports.TableBody=L;exports.TableCell=c;exports.TableHead=X;exports.TableHeader=b;exports.TableRow=m;exports.Toast=$r;exports.api=_r;exports.buildUrl=ws;exports.cn=A;exports.coreRoutes=zr;exports.createRouter=Ke;exports.formatBytes=pe;exports.formatNumber=Cr;exports.jsonPretty=kr;exports.router=Hr;exports.shortDigest=Te;exports.shortId=z;exports.timeAgo=ge;exports.truncate=Dr;exports.useApp=W;exports.useArtifact=Tr;exports.useDiff=Er;exports.useGroup=Pr;exports.useGroups=Sr;exports.useLayoutConfig=Or;exports.useMutation=le;exports.useProjects=ke;exports.useRun=Ye;exports.useRuns=Ve;
14
+ <%s key={someKey} {...props} />`,Je,ue,_t,ue),ys[ue+Je]=!0}}return s===a?gt(O):pt(O),O}}function vt(s,l,x){return Ns(s,l,x,!0)}function bt(s,l,x){return Ns(s,l,x,!1)}var yt=bt,Nt=vt;we.Fragment=a,we.jsx=yt,we.jsxs=Nt})()),we}var Rs;function St(){return Rs||(Rs=1,process.env.NODE_ENV==="production"?Fe.exports=Rt():Fe.exports=Et()),Fe.exports}var e=St();class je extends Error{constructor(r,n){super(n),this.status=r,this.name="ApiError"}}class Ss{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 Cs=new Ss,ks=v.createContext(null);function Ps({children:t,api:r=Cs,initialWorkspace:n=null}){const[a,u]=v.useState(null),[o,d]=v.useState(n);return v.useEffect(()=>{r.getCapabilities().then(u).catch(console.error)},[r]),e.jsx(ks.Provider,{value:{api:r,capabilities:a,currentWorkspace:o,setCurrentWorkspace:d},children:t})}function H(){const t=v.useContext(ks);if(!t)throw new Error("useApp must be used within AppProvider");return t}function he(t,r=[]){const[n,a]=v.useState({data:null,loading:!0,error:null}),u=v.useRef(!0),o=v.useRef(t);o.current=t;const d=v.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 v.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 Se(){const{api:t,currentWorkspace:r}=H();return he(async()=>{const{projects:n}=await t.listProjects({workspace:r?.id});return n},[t,r?.id])}function Ts(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 Ds(t){const{api:r}=H();return he(()=>r.getGroup(t),[r,t])}function As(t,r){const{api:n}=H();return he(()=>n.getDiff(t,r),[n,t,r])}function Fs(t,r){const{api:n}=H();return he(()=>n.getArtifact(t,r),[n,t,r])}function pe(t){const[r,n]=v.useState(!1),[a,u]=v.useState(null);return{mutate:v.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 Os(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 $s(t){return JSON.stringify(t,null,2)}function Ls(t,r=60){return t?t.length<=r?t:t.slice(0,r-3)+"...":""}function Ct(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 kt=[{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"]}],Bs=v.createContext(null);function Pt({config:t,children:r}){return e.jsx(Bs.Provider,{value:t,children:r})}function Is(){return v.useContext(Bs)}function W({children:t,config:r}){const n=T.useLocation(),u={...Is(),...r},o=u?.navLinks??kt,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:"min-h-screen bg-gray-50",children:[e.jsx("header",{className:"bg-gray-900 h-14 sticky top-0 z-50 shadow-sm",children:e.jsxs("div",{className:"max-w-container mx-auto px-6 h-full flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsxs(T.Link,{to:"/",className:"text-lg font-semibold text-primary hover:text-primary-light flex items-center gap-2 transition-colors",children:[i.icon&&e.jsx("span",{className:"text-xl",children:i.icon}),i.text]}),e.jsx("nav",{className:"flex gap-1",children:d.map(h=>e.jsx(T.Link,{to:h.href,className:L("px-3 py-2 rounded-md text-sm font-medium transition-colors duration-150",f(h)?"text-white bg-white/10":"text-gray-400 hover:text-white hover:bg-white/5"),children:h.label},h.href))})]}),e.jsx("div",{className:"flex items-center gap-4",children:u?.headerRight})]})}),e.jsx("main",{className:"max-w-container mx-auto p-6 fade-in",children:t})]})}function ge({title:t,subtitle:r,actions:n}){return e.jsxs("div",{className:"flex items-start justify-between mb-6 gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-gray-900 flex items-center gap-2 flex-wrap",children: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=v.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(q,{}),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 Tt({variant:t="info",className:r,children:n,...a}){return e.jsx("div",{className:L("alert",`alert-${t}`,r),...a,children:n})}function q({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 Ie=v.forwardRef(({className:t,...r},n)=>e.jsx("input",{ref:n,className:L("form-input",t),...r}));Ie.displayName="Input";const ce=v.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 I({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 qe({runs:t,onDelete:r,loading:n,emptyHint:a,baselineRunId:u}){const[o,d]=v.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(I,{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(q,{}),"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 qs(){const[t,r]=T.useSearchParams(),{api:n}=H(),{data:a}=Se(),[u,o]=v.useState(null),[d,i]=v.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));v.useEffect(()=>{if(u){const R=setTimeout(()=>o(null),3e3);return()=>clearTimeout(R)}},[u]);const w=v.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=v.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(Ie,{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(q,{})]})]})}),e.jsx(b,{children:h&&!f?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(q,{})}):e.jsx(qe,{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 Ms({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(I,{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:Ls(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 Us({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(I,{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 Dt({runId:t,runName:r,variant:n="secondary",size:a="sm",className:u="",apiBaseUrl:o=""}){const[d,i]=v.useState({status:"idle"}),[f,h]=v.useState(!1),[m,p]=v.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(q,{}),e.jsx(At,{}),"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(Ot,{})}):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(Ft,{})}):e.jsx("div",{className:"w-10 h-10 rounded-full bg-[var(--dq-primary-bg)] flex items-center justify-center",children:e.jsx(q,{})}),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 At(){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 Ft(){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 Ot(){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 Gs(){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}=Se(),[h,m]=v.useState(!1),[p,w]=v.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(v.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(q,{})})});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)}},Ce=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(Dt,{runId:a.run_id,runName:a.run_name}),!P&&e.jsxs(A,{variant:"secondary",size:"sm",onClick:Me,disabled:R,children:[R&&e.jsx(q,{}),"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(I,{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(I,{children:Object.entries(ee).map(([_,D])=>e.jsxs(j,{children:[e.jsx(c,{children:_}),e.jsx(c,{className:"font-mono",children:typeof D=="number"?Os(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(I,{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:()=>Ce(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(q,{}),"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 Ws(){const{currentWorkspace:t}=H(),{data:r,loading:n}=Se();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(q,{})}):e.jsx(Ms,{projects:r??[],currentWorkspace:t})})]})}function Vs(){const[t,r]=T.useSearchParams(),{data:n}=Se(),[a,u]=v.useState(t.get("project")||""),{data:o,loading:d,refetch:i}=Ts({project:a||void 0}),f=v.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(q,{})]})]})}),e.jsx(b,{children:d&&!o?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(q,{})}):e.jsx(Us,{groups:o??[]})})]})}function zs(){const{groupId:t}=T.useParams(),{api:r}=H(),{data:n,loading:a,error:u,refetch:o}=Ds(t),[d,i]=v.useState(null),f=pe(m=>r.deleteRun(m));v.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(q,{})})}):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(qe,{runs:n.runs,onDelete:h,loading:f.loading})]}),d&&e.jsx(ve,{message:d.message,variant:d.variant,visible:!!d,onClose:()=>i(null)})]})}function $t({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 Lt({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 Bt({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($t,{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(Lt,{className:"flex-shrink-0"}),e.jsx("span",{className:"font-medium",children:"Different"})]})}function It({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(Bt,{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 Es({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 qt({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 Mt(){const[t,r]=T.useSearchParams(),{data:n}=Qe({limit:100}),a=n?.runs??[],[u,o]=v.useState(t.get("a")||""),[d,i]=v.useState(t.get("b")||""),[f,h]=v.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 Ut({runIdA:t,runIdB:r}){const{data:n,loading:a,error:u}=As(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(q,{}),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(It,{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(Es,{label:"Run A (Baseline)",run:o,variant:"a"}),e.jsx(Es,{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(I,{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(I,{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(I,{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(I,{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(I,{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(I,{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(I,{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(I,{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(qt,{tvd:i.tvd,noiseContext:i.noise_context})]})]})}function Ys(){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(Ut,{runIdA:r,runIdB:n}):e.jsx(Mt,{})]})}function Hs(){const{api:t}=H(),[r,n]=v.useState(""),[a,u]=v.useState(null),[o,d]=v.useState(!1),[i,f]=v.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(Ie,{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(q,{}),"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(qe,{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(I,{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(I,{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(I,{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 Ks(){const{runId:t,index:r}=T.useParams(),n=parseInt(r,10),{api:a}=H(),{data:u}=Ze(t),{data:o,loading:d,error:i}=Fs(t,n),[f,h]=v.useState(null);v.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(q,{})})});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:Ee(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:$s(R)}):V?e.jsx("pre",{children:V}):e.jsxs("p",{className:"text-muted",children:["Binary content (",Ee(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"})," (",Ee(w)," exceeds ",Ee($)," 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 Js=[{path:"/",element:e.jsx(T.Navigate,{to:"/runs",replace:!0})},{path:"/runs",element:e.jsx(qs,{})},{path:"/runs/:runId",element:e.jsx(Gs,{})},{path:"/runs/:runId/artifacts/:index",element:e.jsx(Ks,{})},{path:"/projects",element:e.jsx(Ws,{})},{path:"/groups",element:e.jsx(Vs,{})},{path:"/groups/:groupId",element:e.jsx(zs,{})},{path:"/diff",element:e.jsx(Ys,{})},{path:"/search",element:e.jsx(Hs,{})}];function ts(t=[]){return T.createBrowserRouter([...Js,...t])}const Xs=ts();function Gt({additionalRoutes:t,...r}){const n=t?.length?ts(t):Xs;return e.jsx(Ps,{...r,children:e.jsx(T.RouterProvider,{router:n})})}exports.Alert=Tt;exports.ApiClient=Ss;exports.ApiError=je;exports.App=Gt;exports.AppProvider=Ps;exports.ArtifactPage=Ks;exports.Badge=Y;exports.Button=A;exports.Card=b;exports.CardHeader=U;exports.CardTitle=G;exports.DiffPage=Ys;exports.EmptyState=le;exports.FormGroup=Z;exports.FormRow=es;exports.GroupDetailPage=zs;exports.GroupsPage=Vs;exports.GroupsTable=Us;exports.Input=Ie;exports.KVList=$e;exports.Label=re;exports.Layout=W;exports.LayoutConfigProvider=Pt;exports.Modal=Be;exports.PageHeader=ge;exports.ProjectsPage=Ws;exports.ProjectsTable=Ms;exports.RunDetailPage=Gs;exports.RunsPage=qs;exports.RunsTable=qe;exports.SearchPage=Hs;exports.Select=ce;exports.Spinner=q;exports.StatusBadge=ss;exports.Table=B;exports.TableBody=I;exports.TableCell=c;exports.TableHead=se;exports.TableHeader=N;exports.TableRow=j;exports.Toast=ve;exports.api=Cs;exports.buildUrl=Ct;exports.cn=L;exports.coreRoutes=Js;exports.createRouter=ts;exports.formatBytes=Ee;exports.formatNumber=Os;exports.jsonPretty=$s;exports.router=Xs;exports.shortDigest=Oe;exports.shortId=Q;exports.timeAgo=Le;exports.truncate=Ls;exports.useApp=H;exports.useArtifact=Fs;exports.useDiff=As;exports.useGroup=Ds;exports.useGroups=Ts;exports.useLayoutConfig=Is;exports.useMutation=pe;exports.useProjects=Se;exports.useRun=Ze;exports.useRuns=Qe;