arize-phoenix 5.5.1__py3-none-any.whl → 5.6.0__py3-none-any.whl

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.

Potentially problematic release.


This version of arize-phoenix might be problematic. Click here for more details.

Files changed (172) hide show
  1. {arize_phoenix-5.5.1.dist-info → arize_phoenix-5.6.0.dist-info}/METADATA +8 -11
  2. {arize_phoenix-5.5.1.dist-info → arize_phoenix-5.6.0.dist-info}/RECORD +171 -171
  3. phoenix/config.py +8 -8
  4. phoenix/core/model.py +3 -3
  5. phoenix/core/model_schema.py +41 -50
  6. phoenix/core/model_schema_adapter.py +17 -16
  7. phoenix/datetime_utils.py +2 -2
  8. phoenix/db/bulk_inserter.py +10 -20
  9. phoenix/db/engines.py +2 -1
  10. phoenix/db/enums.py +2 -2
  11. phoenix/db/helpers.py +8 -7
  12. phoenix/db/insertion/dataset.py +9 -19
  13. phoenix/db/insertion/document_annotation.py +14 -13
  14. phoenix/db/insertion/helpers.py +6 -16
  15. phoenix/db/insertion/span_annotation.py +14 -13
  16. phoenix/db/insertion/trace_annotation.py +14 -13
  17. phoenix/db/insertion/types.py +19 -30
  18. phoenix/db/migrations/versions/3be8647b87d8_add_token_columns_to_spans_table.py +8 -8
  19. phoenix/db/models.py +28 -28
  20. phoenix/experiments/evaluators/base.py +2 -1
  21. phoenix/experiments/evaluators/code_evaluators.py +4 -5
  22. phoenix/experiments/evaluators/llm_evaluators.py +157 -4
  23. phoenix/experiments/evaluators/utils.py +3 -2
  24. phoenix/experiments/functions.py +10 -21
  25. phoenix/experiments/tracing.py +2 -1
  26. phoenix/experiments/types.py +20 -29
  27. phoenix/experiments/utils.py +2 -1
  28. phoenix/inferences/errors.py +6 -5
  29. phoenix/inferences/fixtures.py +6 -5
  30. phoenix/inferences/inferences.py +37 -37
  31. phoenix/inferences/schema.py +11 -10
  32. phoenix/inferences/validation.py +13 -14
  33. phoenix/logging/_formatter.py +3 -3
  34. phoenix/metrics/__init__.py +5 -4
  35. phoenix/metrics/binning.py +2 -1
  36. phoenix/metrics/metrics.py +2 -1
  37. phoenix/metrics/mixins.py +7 -6
  38. phoenix/metrics/retrieval_metrics.py +2 -1
  39. phoenix/metrics/timeseries.py +5 -4
  40. phoenix/metrics/wrappers.py +2 -2
  41. phoenix/pointcloud/clustering.py +3 -4
  42. phoenix/pointcloud/pointcloud.py +7 -5
  43. phoenix/pointcloud/umap_parameters.py +2 -1
  44. phoenix/server/api/dataloaders/annotation_summaries.py +12 -19
  45. phoenix/server/api/dataloaders/average_experiment_run_latency.py +2 -2
  46. phoenix/server/api/dataloaders/cache/two_tier_cache.py +3 -2
  47. phoenix/server/api/dataloaders/dataset_example_revisions.py +3 -8
  48. phoenix/server/api/dataloaders/dataset_example_spans.py +2 -5
  49. phoenix/server/api/dataloaders/document_evaluation_summaries.py +12 -18
  50. phoenix/server/api/dataloaders/document_evaluations.py +3 -7
  51. phoenix/server/api/dataloaders/document_retrieval_metrics.py +6 -13
  52. phoenix/server/api/dataloaders/experiment_annotation_summaries.py +4 -8
  53. phoenix/server/api/dataloaders/experiment_error_rates.py +2 -5
  54. phoenix/server/api/dataloaders/experiment_run_annotations.py +3 -7
  55. phoenix/server/api/dataloaders/experiment_run_counts.py +1 -5
  56. phoenix/server/api/dataloaders/experiment_sequence_number.py +2 -5
  57. phoenix/server/api/dataloaders/latency_ms_quantile.py +21 -30
  58. phoenix/server/api/dataloaders/min_start_or_max_end_times.py +7 -13
  59. phoenix/server/api/dataloaders/project_by_name.py +3 -3
  60. phoenix/server/api/dataloaders/record_counts.py +11 -18
  61. phoenix/server/api/dataloaders/span_annotations.py +3 -7
  62. phoenix/server/api/dataloaders/span_dataset_examples.py +3 -8
  63. phoenix/server/api/dataloaders/span_descendants.py +3 -7
  64. phoenix/server/api/dataloaders/span_projects.py +2 -2
  65. phoenix/server/api/dataloaders/token_counts.py +12 -19
  66. phoenix/server/api/dataloaders/trace_row_ids.py +3 -7
  67. phoenix/server/api/dataloaders/user_roles.py +3 -3
  68. phoenix/server/api/dataloaders/users.py +3 -3
  69. phoenix/server/api/helpers/__init__.py +4 -3
  70. phoenix/server/api/helpers/dataset_helpers.py +10 -9
  71. phoenix/server/api/input_types/AddExamplesToDatasetInput.py +2 -2
  72. phoenix/server/api/input_types/AddSpansToDatasetInput.py +2 -2
  73. phoenix/server/api/input_types/ChatCompletionMessageInput.py +13 -1
  74. phoenix/server/api/input_types/ClusterInput.py +2 -2
  75. phoenix/server/api/input_types/DeleteAnnotationsInput.py +1 -3
  76. phoenix/server/api/input_types/DeleteDatasetExamplesInput.py +2 -2
  77. phoenix/server/api/input_types/DeleteExperimentsInput.py +1 -3
  78. phoenix/server/api/input_types/DimensionFilter.py +4 -4
  79. phoenix/server/api/input_types/Granularity.py +1 -1
  80. phoenix/server/api/input_types/InvocationParameters.py +2 -2
  81. phoenix/server/api/input_types/PatchDatasetExamplesInput.py +2 -2
  82. phoenix/server/api/mutations/dataset_mutations.py +4 -4
  83. phoenix/server/api/mutations/experiment_mutations.py +1 -2
  84. phoenix/server/api/mutations/export_events_mutations.py +7 -7
  85. phoenix/server/api/mutations/span_annotations_mutations.py +4 -4
  86. phoenix/server/api/mutations/trace_annotations_mutations.py +4 -4
  87. phoenix/server/api/mutations/user_mutations.py +4 -4
  88. phoenix/server/api/openapi/schema.py +2 -2
  89. phoenix/server/api/queries.py +20 -20
  90. phoenix/server/api/routers/oauth2.py +4 -4
  91. phoenix/server/api/routers/v1/datasets.py +22 -36
  92. phoenix/server/api/routers/v1/evaluations.py +6 -5
  93. phoenix/server/api/routers/v1/experiment_evaluations.py +2 -2
  94. phoenix/server/api/routers/v1/experiment_runs.py +2 -2
  95. phoenix/server/api/routers/v1/experiments.py +4 -4
  96. phoenix/server/api/routers/v1/spans.py +13 -12
  97. phoenix/server/api/routers/v1/traces.py +5 -5
  98. phoenix/server/api/routers/v1/utils.py +5 -5
  99. phoenix/server/api/subscriptions.py +289 -167
  100. phoenix/server/api/types/AnnotationSummary.py +3 -3
  101. phoenix/server/api/types/Cluster.py +8 -7
  102. phoenix/server/api/types/Dataset.py +5 -4
  103. phoenix/server/api/types/Dimension.py +3 -3
  104. phoenix/server/api/types/DocumentEvaluationSummary.py +8 -7
  105. phoenix/server/api/types/EmbeddingDimension.py +6 -5
  106. phoenix/server/api/types/EvaluationSummary.py +3 -3
  107. phoenix/server/api/types/Event.py +7 -7
  108. phoenix/server/api/types/Experiment.py +3 -3
  109. phoenix/server/api/types/ExperimentComparison.py +2 -4
  110. phoenix/server/api/types/Inferences.py +9 -8
  111. phoenix/server/api/types/InferencesRole.py +2 -2
  112. phoenix/server/api/types/Model.py +2 -2
  113. phoenix/server/api/types/Project.py +11 -18
  114. phoenix/server/api/types/Segments.py +3 -3
  115. phoenix/server/api/types/Span.py +8 -7
  116. phoenix/server/api/types/TimeSeries.py +8 -7
  117. phoenix/server/api/types/Trace.py +2 -2
  118. phoenix/server/api/types/UMAPPoints.py +6 -6
  119. phoenix/server/api/types/User.py +3 -3
  120. phoenix/server/api/types/node.py +1 -3
  121. phoenix/server/api/types/pagination.py +4 -4
  122. phoenix/server/api/utils.py +2 -4
  123. phoenix/server/app.py +16 -25
  124. phoenix/server/bearer_auth.py +4 -10
  125. phoenix/server/dml_event.py +3 -3
  126. phoenix/server/dml_event_handler.py +10 -24
  127. phoenix/server/grpc_server.py +3 -2
  128. phoenix/server/jwt_store.py +22 -21
  129. phoenix/server/main.py +3 -3
  130. phoenix/server/oauth2.py +3 -2
  131. phoenix/server/rate_limiters.py +5 -8
  132. phoenix/server/static/.vite/manifest.json +31 -31
  133. phoenix/server/static/assets/components-C70HJiXz.js +1612 -0
  134. phoenix/server/static/assets/{index-BHfTZ6x_.js → index-DLe1Oo3l.js} +2 -2
  135. phoenix/server/static/assets/{pages-aAez_Ntk.js → pages-C8-Sl7JI.js} +269 -434
  136. phoenix/server/static/assets/{vendor-6IcPAw_j.js → vendor-CtqfhlbC.js} +6 -6
  137. phoenix/server/static/assets/{vendor-arizeai-DRZuoyuF.js → vendor-arizeai-C_3SBz56.js} +2 -2
  138. phoenix/server/static/assets/{vendor-codemirror-DVE2_WBr.js → vendor-codemirror-wfdk9cjp.js} +1 -1
  139. phoenix/server/static/assets/{vendor-recharts-DwrexFA4.js → vendor-recharts-BiVnSv90.js} +1 -1
  140. phoenix/server/thread_server.py +1 -1
  141. phoenix/server/types.py +17 -29
  142. phoenix/services.py +4 -3
  143. phoenix/session/client.py +12 -24
  144. phoenix/session/data_extractor.py +3 -3
  145. phoenix/session/evaluation.py +1 -2
  146. phoenix/session/session.py +11 -20
  147. phoenix/trace/attributes.py +16 -28
  148. phoenix/trace/dsl/filter.py +17 -21
  149. phoenix/trace/dsl/helpers.py +3 -3
  150. phoenix/trace/dsl/query.py +13 -22
  151. phoenix/trace/fixtures.py +11 -17
  152. phoenix/trace/otel.py +5 -15
  153. phoenix/trace/projects.py +3 -2
  154. phoenix/trace/schemas.py +2 -2
  155. phoenix/trace/span_evaluations.py +9 -8
  156. phoenix/trace/span_json_decoder.py +3 -3
  157. phoenix/trace/span_json_encoder.py +2 -2
  158. phoenix/trace/trace_dataset.py +6 -5
  159. phoenix/trace/utils.py +6 -6
  160. phoenix/utilities/deprecation.py +3 -2
  161. phoenix/utilities/error_handling.py +3 -2
  162. phoenix/utilities/json.py +2 -1
  163. phoenix/utilities/logging.py +2 -2
  164. phoenix/utilities/project.py +1 -1
  165. phoenix/utilities/re.py +3 -4
  166. phoenix/utilities/template_formatters.py +5 -4
  167. phoenix/version.py +1 -1
  168. phoenix/server/static/assets/components-mVBxvljU.js +0 -1428
  169. {arize_phoenix-5.5.1.dist-info → arize_phoenix-5.6.0.dist-info}/WHEEL +0 -0
  170. {arize_phoenix-5.5.1.dist-info → arize_phoenix-5.6.0.dist-info}/entry_points.txt +0 -0
  171. {arize_phoenix-5.5.1.dist-info → arize_phoenix-5.6.0.dist-info}/licenses/IP_NOTICE +0 -0
  172. {arize_phoenix-5.5.1.dist-info → arize_phoenix-5.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,33 +1,33 @@
1
- import{r as u,j as e,R as Ke,n as ya,ak as Ms,l as s,I as U,x as C,al as Pe,z as Y,t as D,am as Pn,an as ln,$ as B,ao as ca,D as he,E as ke,H as Z,G as Rn,g as Ml,ap as Xe,aq as ue,ar as Ye,as as Ns,J as Ga,at as Cn,au as se,av as ve,a5 as Ie,a6 as G,a7 as Vs,aw as _e,ax as zs,ay as La,az as Pa,aA as wa,aB as Un,aC as fa,o as $s,aD as Os,aE as Qs,ab as js,ac as qs,aF as Us,p as Bs,q as Hs,aG as Gs,y as Ws,aH as O,aI as Js,aJ as Zs,aK as ml,aL as Xs,aM as Ys,aN as eo,aO as no,aP as ao,aQ as lo,aR as to,aS as io}from"./vendor-6IcPAw_j.js";import{C as H,d as F,K as Mn,D as W,c as h,I as P,a as I,J as Wa,G as Te,H as J,M as Ee,N as de,O as ro,m as ha,Q as na,P as tn,S as Be,i as Nn,j as re,q as Fn,r as Vn,v as ge,b as K,o as Nl,U as Me,L as Xn,V as Vl,e as M,t as ne,W as zl,X as $l,Y as so,Z as oo,h as kn,w as aa,T as Le,k as X,B as ka,s as ye,$ as V,a0 as Ja,E as ba,f as An,a1 as Za,a2 as co,z as la,u as uo,a3 as mo,R as ga,n as Ol}from"./vendor-arizeai-DRZuoyuF.js";import{c as go,N as po,T as yo,L as fe,u as ce,B as fo,a as mn,D as ho,G as ko,b as bo,d as So,S as vo,R as xe,e as Ve,f as He,g as Xa,P as Ql,h as jl,M as gl,i as pl,j as zn,k as Co,l as Fo,m as Q,n as ql,o as Ce,p as Sa,q as $n,r as Ul,s as On,t as Qn,v as Bl,w as Ge,x as Qe,C as pe,y as va,z as rn,A as Ya,E as We,F as Hl,H as Ko,I as xo,J as Do,K as To,O as Io,Q as Lo,U as je,V as me,W as Po,X as wo,Y as Gl,Z as Ao,_ as _o,$ as yl,a0 as Eo,a1 as Ro,a2 as Mo,a3 as No,a4 as Vo,a5 as zo,a6 as Wl,a7 as Kn,a8 as $o,a9 as Oo,aa as Qo,ab as jo,ac as qo,ad as bn,ae as el,af as Jl,ag as wn,ah as Qa,ai as In,aj as ze,ak as Uo,al as Bo,am as oe,an as Zl,ao as Ca,ap as we,aq as Fa,ar as xn,as as le,at as Je,au as Ho,av as nl,aw as Oe,ax as Re,ay as Sn,az as al,aA as Xl,aB as ll,aC as Go,aD as Yl,aE as Ae,aF as qe,aG as ta,aH as Wo,aI as ia,aJ as Ka,aK as et,aL as nt,aM as Jo,aN as at,aO as lt,aP as tt,aQ as jn,aR as en,aS as Ze,aT as Fe,aU as Zo,aV as fl,aW as it,aX as Xo,aY as Yo,aZ as ed,a_ as nd,a$ as ad,b0 as _n,b1 as pn,b2 as ja,b3 as yn,b4 as rt,b5 as ld,b6 as fn,b7 as td,b8 as xa,b9 as id,ba as tl,bb as rd,bc as il,bd as st,be as ot,bf as sd,bg as qa,bh as dt,bi as od,bj as dd,bk as ua,bl as cd,bm as ct,bn as ut,bo as ud,bp as mt,bq as md,br as Da,bs as gd,bt as pd,bu as yd,bv as fd,bw as gt,bx as hd,by as kd,bz as bd,bA as Sd,bB as vd,bC as Cd,bD as Fd,bE as hl,bF as Kd}from"./components-mVBxvljU.js";import{R as sn,C as ra,X as on,Y as Ne,a as dn,T as cn,B as En,A as Yn,b as pt,c as rl,L as yt,d as xd,P as Dd,e as Td,f as Id}from"./vendor-recharts-DwrexFA4.js";import{p as sl,R as sa,n as oa,j as Ld,E as ft,m as Pd,o as wd,g as Ad}from"./vendor-codemirror-DVE2_WBr.js";const ht=u.createContext(null);function Ey({children:n,...a}){const[l]=u.useState(()=>go(a));return e(ht.Provider,{value:l,children:n})}function Ua(n,a){const l=Ke.useContext(ht);if(!l)throw new Error("Missing CredentialsContext.Provider in the tree");return ya(l,n,a)}const kt="arize-phoenix-feature-flags",Aa={playground:!1,playgroundNonStreaming:!1,playgroundWithDatasets:!1};function _d(){const n=localStorage.getItem(kt);if(!n)return Aa;try{const a=JSON.parse(n);return Object.assign({},Aa,a)}catch{return Aa}}const bt=u.createContext(null);function St(){const n=Ke.useContext(bt);if(n===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return n}function Ta(n){const{featureFlags:a}=St();return a[n]}function Ry(n){const[a,l]=u.useState(_d()),t=i=>{localStorage.setItem(kt,JSON.stringify(i)),l(i)};return e(bt.Provider,{value:{featureFlags:a,setFeatureFlags:t},children:e(Ed,{children:n.children})})}function Ed(n){const{children:a}=n,{featureFlags:l,setFeatureFlags:t}=St(),[i,r]=u.useState(!1);return Ms("ctrl+shift+f",()=>r(!0)),s(U,{children:[a,e(W,{type:"modal",isDismissable:!0,onDismiss:()=>r(!1),children:i&&e(H,{title:"Feature Flags",children:e(F,{height:"size-1000",padding:"size-100",children:Object.keys(l).map(o=>e(Mn,{isSelected:l[o],onChange:c=>t({...l,[o]:c}),children:o},o))})})})]})}const vt=u.createContext(null);function Rd(){const n=u.useContext(vt);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function My(n){return e(vt.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const Md=C`
1
+ import{r as u,j as e,R as Ke,n as ba,ak as zs,l as s,I as H,x as v,al as _e,z as Y,t as I,am as wn,an as tn,$ as U,ao as ua,D as ke,E as be,H as X,G as Nn,g as Ut,ap as Xe,aq as ue,ar as Ye,as as Vs,J as Xa,at as vn,au as le,av as Ce,a7 as $s,a5 as Ae,a6 as Z,aw as Te,ax as Os,ay as _a,az as Ea,aA as pa,aB as Wn,aC as la,o as Qs,aD as js,aE as qs,ab as Us,ac as Bs,aF as Hs,p as Gs,q as Ws,aG as Js,y as Zs,aH as M,aI as Bt,aJ as Xs,aK as St,aL as Ys,aM as eo,aN as no,aO as ao,aP as to,aQ as lo,aR as io,aS as ro}from"./vendor-CtqfhlbC.js";import{C as B,d as F,O as zn,D as W,c as h,I as w,a as L,N as Ya,K as Pe,M as J,Q as Re,S as de,U as so,m as Sa,H as va,P as Cn,B as ln,i as Vn,j as se,q as Fn,r as $n,v as ge,b as K,o as Ht,V as Me,L as ya,W as Gt,e as N,t as te,X as Wt,Y as Jt,Z as oo,$ as co,h as hn,w as ia,T as we,a0 as et,s as fe,k as G,E as Ca,G as $,f as En,a1 as nt,a2 as uo,J as On,u as mo,z as at,a3 as go,R as Rn,n as tt,l as vt}from"./vendor-arizeai-C_3SBz56.js";import{c as po,N as yo,T as fo,L as he,u as ce,B as ho,a as mn,D as ko,G as bo,b as So,d as vo,S as Co,R as xe,e as Ve,f as Ue,g as lt,P as Zt,h as Xt,M as Ct,i as Ft,j as Qn,k as Fo,l as Ko,m as Q,n as Yt,o as ye,p as Fa,q as jn,r as el,s as qn,t as Un,v as nl,w as Be,x as Qe,C as pe,y as Ka,z as rn,A as it,E as He,F as xo,H as To,I as Do,J as Io,K as Po,O as Lo,Q as wo,U as je,V as me,W as _o,X as Eo,Y as al,Z as Ao,_ as Ro,$ as Kt,a0 as Mo,a1 as No,a2 as zo,a3 as Vo,a4 as $o,a5 as Oo,a6 as tl,a7 as Kn,a8 as Qo,a9 as jo,aa as qo,ab as Uo,ac as Bo,ad as kn,ae as rt,af as ll,ag as _n,ah as Ba,ai as Pn,aj as Ze,ak as Ho,al as Go,am as il,an as rl,ao as xa,ap as Ee,aq as Ta,ar as xn,as as ae,at as Ge,au as Wo,av as oe,aw as st,ax as Oe,ay as De,az as bn,aA as ot,aB as sl,aC as Tn,aD as Jo,aE as dt,aF as Le,aG as Ne,aH as Bn,aI as Zo,aJ as ra,aK as Da,aL as ol,aM as dl,aN as Xo,aO as cl,aP as ul,aQ as ml,aR as Hn,aS as en,aT as We,aU as Fe,aV as Yo,aW as xt,aX as gl,aY as ed,aZ as nd,a_ as ad,a$ as td,b0 as ld,b1 as An,b2 as pn,b3 as Ha,b4 as Je,b5 as pl,b6 as id,b7 as yn,b8 as rd,b9 as Ia,ba as sd,bb as ct,bc as od,bd as ut,be as yl,bf as fl,bg as dd,bh as Ga,bi as hl,bj as cd,bk as ud,bl as ma,bm as md,bn as kl,bo as bl,bp as gd,bq as mt,br as Sl,bs as pd,bt as Pa,bu as vl,bv as yd,bw as fd,bx as hd,by as kd,bz as Cl,bA as bd,bB as Sd,bC as vd,bD as Cd,bE as Fd,bF as Kd,bG as xd,bH as Td,bI as Dd,bJ as Id,bK as Tt,bL as Pd}from"./components-C70HJiXz.js";import{R as sn,C as sa,X as on,Y as ze,a as dn,T as cn,B as Mn,A as aa,b as Fl,c as gt,L as Kl,d as Ld,P as wd,e as _d,f as Ed}from"./vendor-recharts-BiVnSv90.js";import{p as pt,R as oa,n as da,j as Ad,E as xl,m as Rd,o as Md,g as Nd}from"./vendor-codemirror-wfdk9cjp.js";const Tl=u.createContext(null);function Uy({children:n,...a}){const[t]=u.useState(()=>po(a));return e(Tl.Provider,{value:t,children:n})}function Wa(n,a){const t=Ke.useContext(Tl);if(!t)throw new Error("Missing CredentialsContext.Provider in the tree");return ba(t,n,a)}const Dl="arize-phoenix-feature-flags",Aa={playground:!1,playgroundNonStreaming:!1,playgroundWithDatasets:!1};function zd(){const n=localStorage.getItem(Dl);if(!n)return Aa;try{const a=JSON.parse(n);return Object.assign({},Aa,a)}catch{return Aa}}const Il=u.createContext(null);function Pl(){const n=Ke.useContext(Il);if(n===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return n}function La(n){const{featureFlags:a}=Pl();return a[n]}function By(n){const[a,t]=u.useState(zd()),l=i=>{localStorage.setItem(Dl,JSON.stringify(i)),t(i)};return e(Il.Provider,{value:{featureFlags:a,setFeatureFlags:l},children:e(Vd,{children:n.children})})}function Vd(n){const{children:a}=n,{featureFlags:t,setFeatureFlags:l}=Pl(),[i,r]=u.useState(!1);return zs("ctrl+shift+f",()=>r(!0)),s(H,{children:[a,e(W,{type:"modal",isDismissable:!0,onDismiss:()=>r(!1),children:i&&e(B,{title:"Feature Flags",children:e(F,{height:"size-1000",padding:"size-100",children:Object.keys(t).map(o=>e(zn,{isSelected:t[o],onChange:c=>l({...t,[o]:c}),children:o},o))})})})]})}const Ll=u.createContext(null);function $d(){const n=u.useContext(Ll);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function Hy(n){return e(Ll.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const Od=v`
2
2
  display: flex;
3
3
  direction: row;
4
4
  height: 100vh;
5
5
  overflow: hidden;
6
- `,Nd=C`
6
+ `,Qd=v`
7
7
  display: flex;
8
8
  flex-direction: column;
9
9
  flex: 1 1 auto;
10
10
  height: 100%;
11
11
  overflow: hidden;
12
12
  padding-left: var(--px-nav-collapsed-width);
13
- `,Vd=C`
13
+ `,jd=v`
14
14
  flex: 1 1 auto;
15
15
  display: flex;
16
16
  flex-direction: column;
17
17
  height: 100%;
18
18
  overflow: hidden;
19
- `,zd=C`
19
+ `,qd=v`
20
20
  display: flex;
21
21
  flex-direction: column;
22
22
  margin: 0;
23
23
  list-style: none;
24
24
  gap: var(--ac-global-dimension-size-50);
25
25
  padding-inline-start: 0;
26
- `,$d=C`
26
+ `,Ud=v`
27
27
  display: flex;
28
28
  flex-direction: column;
29
29
  gap: var(--ac-global-dimension-size-50);
30
- `;function Ny(){return s("div",{css:Md,"data-testid":"layout",children:[e(Od,{}),s("div",{css:Nd,children:[e(yo,{children:e(po,{})}),e("div",{"data-testid":"content",css:Vd,children:e(u.Suspense,{fallback:e(fe,{}),children:e(Pe,{})})})]})]})}function Od(){const n=u.useMemo(()=>window.Config.hasInferences,[]),a=ce(),{authenticationEnabled:l}=Rd(),t=Y(),i=u.useCallback(async()=>{const o=await fetch("/auth/logout",{method:"POST"});if(o.ok){t("/login");return}a({title:"Logout Failed",message:"Failed to log out: "+o.statusText})},[t,a]),r=Ta("playground");return s(vo,{children:[e(fo,{}),s(h,{direction:"column",justifyContent:"space-between",flex:"1 1 auto",children:[s("ul",{css:$d,children:[n&&e("li",{children:e(mn,{to:"/model",text:"Model",icon:e(P,{svg:e(I.CubeOutline,{})})})}),e("li",{children:e(mn,{to:"/projects",text:"Projects",icon:e(P,{svg:e(I.GridOutline,{})})})}),e("li",{children:e(mn,{to:"/datasets",text:"Datasets",icon:e(P,{svg:e(I.DatabaseOutline,{})})})}),r&&e("li",{children:e(mn,{to:"/playground",text:"Playground",icon:e(P,{svg:e(I.PlayCircleOutline,{})})})}),e("li",{children:e(mn,{to:"/apis",text:"APIs",icon:e(P,{svg:e(I.Code,{})})})})]}),s("ul",{css:zd,children:[e("li",{children:e(mn,{to:"/settings",text:"Settings",icon:e(P,{svg:e(I.SettingsOutline,{})})})}),e("li",{children:e(ho,{})}),e("li",{children:e(ko,{})}),e("li",{children:e(bo,{})}),l&&s(U,{children:[e("li",{children:e(mn,{to:"/profile",text:"Profile",icon:e(P,{svg:e(I.PersonOutline,{})})})}),e("li",{children:e(So,{text:"Log Out",icon:e(P,{svg:e(I.LogOut,{})}),onClick:i})})]})]})]})]})}const Ct=function(){var n=[{alias:null,args:null,concreteType:"Functionality",kind:"LinkedField",name:"functionality",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"modelInferences",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"ProjectConnection",kind:"LinkedField",name:"projects",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"project",args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"homeLoaderQuery",selections:n,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"homeLoaderQuery",selections:n},params:{cacheID:"6926e4e720b443f7b7252b60271944e6",id:null,metadata:{},name:"homeLoaderQuery",operationKind:"query",text:`query homeLoaderQuery {
30
+ `;function Gy(){return s("div",{css:Od,"data-testid":"layout",children:[e(Bd,{}),s("div",{css:Qd,children:[e(fo,{children:e(yo,{})}),e("div",{"data-testid":"content",css:jd,children:e(u.Suspense,{fallback:e(he,{}),children:e(_e,{})})})]})]})}function Bd(){const n=u.useMemo(()=>window.Config.hasInferences,[]),a=ce(),{authenticationEnabled:t}=$d(),l=Y(),i=u.useCallback(async()=>{const o=await fetch("/auth/logout",{method:"POST"});if(o.ok){l("/login");return}a({title:"Logout Failed",message:"Failed to log out: "+o.statusText})},[l,a]),r=La("playground");return s(Co,{children:[e(ho,{}),s(h,{direction:"column",justifyContent:"space-between",flex:"1 1 auto",children:[s("ul",{css:Ud,children:[n&&e("li",{children:e(mn,{to:"/model",text:"Model",icon:e(w,{svg:e(L.CubeOutline,{})})})}),e("li",{children:e(mn,{to:"/projects",text:"Projects",icon:e(w,{svg:e(L.GridOutline,{})})})}),e("li",{children:e(mn,{to:"/datasets",text:"Datasets",icon:e(w,{svg:e(L.DatabaseOutline,{})})})}),r&&e("li",{children:e(mn,{to:"/playground",text:"Playground",icon:e(w,{svg:e(L.PlayCircleOutline,{})})})}),e("li",{children:e(mn,{to:"/apis",text:"APIs",icon:e(w,{svg:e(L.Code,{})})})})]}),s("ul",{css:qd,children:[e("li",{children:e(mn,{to:"/settings",text:"Settings",icon:e(w,{svg:e(L.SettingsOutline,{})})})}),e("li",{children:e(ko,{})}),e("li",{children:e(bo,{})}),e("li",{children:e(So,{})}),t&&s(H,{children:[e("li",{children:e(mn,{to:"/profile",text:"Profile",icon:e(w,{svg:e(L.PersonOutline,{})})})}),e("li",{children:e(vo,{text:"Log Out",icon:e(w,{svg:e(L.LogOut,{})}),onClick:i})})]})]})]})]})}const wl=function(){var n=[{alias:null,args:null,concreteType:"Functionality",kind:"LinkedField",name:"functionality",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"modelInferences",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"ProjectConnection",kind:"LinkedField",name:"projects",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"project",args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"homeLoaderQuery",selections:n,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"homeLoaderQuery",selections:n},params:{cacheID:"6926e4e720b443f7b7252b60271944e6",id:null,metadata:{},name:"homeLoaderQuery",operationKind:"query",text:`query homeLoaderQuery {
31
31
  functionality {
32
32
  modelInferences
33
33
  }
@@ -40,7 +40,7 @@ import{r as u,j as e,R as Ke,n as ya,ak as Ms,l as s,I as U,x as C,al as Pe,z as
40
40
  }
41
41
  }
42
42
  }
43
- `}}}();Ct.hash="a4bbc4917b3217b8254d68ec7c76dbdd";async function Vy(n){var l;const a=await D.fetchQuery(xe,Ct,{}).toPromise();if(a!=null&&a.functionality.modelInferences)return Pn("/model");if((l=a==null?void 0:a.projects.edges)!=null&&l.length){let t=0,i=null;for(const{project:o}of a.projects.edges)o.endTime!=null&&(t++,i=o.id);if(t>1)return Pn("/projects");if(t===1&&i!=null)return Pn(`/projects/${i}`);const r=a==null?void 0:a.projects.edges[0].project.id;return Pn(`/projects/${r}`)}else throw new Error("No functionality available")}const Ft=function(){var n={defaultValue:null,kind:"LocalArgument",name:"endTime"},a={defaultValue:null,kind:"LocalArgument",name:"startTime"},l=[{kind:"Variable",name:"endTime",variableName:"endTime"},{kind:"Variable",name:"startTime",variableName:"startTime"}],t=[{kind:"Literal",name:"first",value:50}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},o={fields:[{kind:"Variable",name:"end",variableName:"endTime"},{kind:"Variable",name:"start",variableName:"startTime"}],kind:"ObjectValue",name:"timeRange"},c={alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},d=[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],g={alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"ModelPageQuery",selections:[{args:l,kind:"FragmentSpread",name:"ModelSchemaTable_dimensions"},{args:l,kind:"FragmentSpread",name:"ModelEmbeddingsTable_embeddingDimensions"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"ModelPageQuery",selections:[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{alias:null,args:t,concreteType:"DimensionConnection",kind:"LinkedField",name:"dimensions",plural:!1,selections:[{alias:null,args:null,concreteType:"DimensionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"dimension",args:null,concreteType:"Dimension",kind:"LinkedField",name:"node",plural:!1,selections:[i,r,{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dataType",storageKey:null},{alias:"cardinality",args:[{kind:"Literal",name:"metric",value:"cardinality"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"percentEmpty",args:[{kind:"Literal",name:"metric",value:"percentEmpty"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"min",args:[{kind:"Literal",name:"metric",value:"min"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"mean",args:[{kind:"Literal",name:"metric",value:"mean"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"max",args:[{kind:"Literal",name:"metric",value:"max"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"psi",args:[{kind:"Literal",name:"metric",value:"psi"},o],kind:"ScalarField",name:"driftMetric",storageKey:null}],storageKey:null},c,{alias:null,args:null,concreteType:"Dimension",kind:"LinkedField",name:"node",plural:!1,selections:d,storageKey:null}],storageKey:null},g],storageKey:"dimensions(first:50)"},{alias:null,args:t,filters:null,handle:"connection",key:"ModelSchemaTable_dimensions",kind:"LinkedHandle",name:"dimensions"},{alias:null,args:t,concreteType:"EmbeddingDimensionConnection",kind:"LinkedField",name:"embeddingDimensions",plural:!1,selections:[{alias:null,args:null,concreteType:"EmbeddingDimensionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"embedding",args:null,concreteType:"EmbeddingDimension",kind:"LinkedField",name:"node",plural:!1,selections:[i,r,{alias:"euclideanDistance",args:[{kind:"Literal",name:"metric",value:"euclideanDistance"},o],kind:"ScalarField",name:"driftMetric",storageKey:null}],storageKey:null},c,{alias:null,args:null,concreteType:"EmbeddingDimension",kind:"LinkedField",name:"node",plural:!1,selections:d,storageKey:null}],storageKey:null},g],storageKey:"embeddingDimensions(first:50)"},{alias:null,args:t,filters:null,handle:"connection",key:"ModelEmbeddingsTable_embeddingDimensions",kind:"LinkedHandle",name:"embeddingDimensions"}],storageKey:null}]},params:{cacheID:"18059ac8df6b3c15d5e4bc04ca2c9877",id:null,metadata:{},name:"ModelPageQuery",operationKind:"query",text:`query ModelPageQuery(
43
+ `}}}();wl.hash="a4bbc4917b3217b8254d68ec7c76dbdd";async function Wy(n){var t;const a=await I.fetchQuery(xe,wl,{}).toPromise();if(a!=null&&a.functionality.modelInferences)return wn("/model");if((t=a==null?void 0:a.projects.edges)!=null&&t.length){let l=0,i=null;for(const{project:o}of a.projects.edges)o.endTime!=null&&(l++,i=o.id);if(l>1)return wn("/projects");if(l===1&&i!=null)return wn(`/projects/${i}`);const r=a==null?void 0:a.projects.edges[0].project.id;return wn(`/projects/${r}`)}else throw new Error("No functionality available")}const _l=function(){var n={defaultValue:null,kind:"LocalArgument",name:"endTime"},a={defaultValue:null,kind:"LocalArgument",name:"startTime"},t=[{kind:"Variable",name:"endTime",variableName:"endTime"},{kind:"Variable",name:"startTime",variableName:"startTime"}],l=[{kind:"Literal",name:"first",value:50}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},o={fields:[{kind:"Variable",name:"end",variableName:"endTime"},{kind:"Variable",name:"start",variableName:"startTime"}],kind:"ObjectValue",name:"timeRange"},c={alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},d=[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],g={alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"ModelPageQuery",selections:[{args:t,kind:"FragmentSpread",name:"ModelSchemaTable_dimensions"},{args:t,kind:"FragmentSpread",name:"ModelEmbeddingsTable_embeddingDimensions"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"ModelPageQuery",selections:[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{alias:null,args:l,concreteType:"DimensionConnection",kind:"LinkedField",name:"dimensions",plural:!1,selections:[{alias:null,args:null,concreteType:"DimensionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"dimension",args:null,concreteType:"Dimension",kind:"LinkedField",name:"node",plural:!1,selections:[i,r,{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dataType",storageKey:null},{alias:"cardinality",args:[{kind:"Literal",name:"metric",value:"cardinality"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"percentEmpty",args:[{kind:"Literal",name:"metric",value:"percentEmpty"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"min",args:[{kind:"Literal",name:"metric",value:"min"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"mean",args:[{kind:"Literal",name:"metric",value:"mean"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"max",args:[{kind:"Literal",name:"metric",value:"max"},o],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"psi",args:[{kind:"Literal",name:"metric",value:"psi"},o],kind:"ScalarField",name:"driftMetric",storageKey:null}],storageKey:null},c,{alias:null,args:null,concreteType:"Dimension",kind:"LinkedField",name:"node",plural:!1,selections:d,storageKey:null}],storageKey:null},g],storageKey:"dimensions(first:50)"},{alias:null,args:l,filters:null,handle:"connection",key:"ModelSchemaTable_dimensions",kind:"LinkedHandle",name:"dimensions"},{alias:null,args:l,concreteType:"EmbeddingDimensionConnection",kind:"LinkedField",name:"embeddingDimensions",plural:!1,selections:[{alias:null,args:null,concreteType:"EmbeddingDimensionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"embedding",args:null,concreteType:"EmbeddingDimension",kind:"LinkedField",name:"node",plural:!1,selections:[i,r,{alias:"euclideanDistance",args:[{kind:"Literal",name:"metric",value:"euclideanDistance"},o],kind:"ScalarField",name:"driftMetric",storageKey:null}],storageKey:null},c,{alias:null,args:null,concreteType:"EmbeddingDimension",kind:"LinkedField",name:"node",plural:!1,selections:d,storageKey:null}],storageKey:null},g],storageKey:"embeddingDimensions(first:50)"},{alias:null,args:l,filters:null,handle:"connection",key:"ModelEmbeddingsTable_embeddingDimensions",kind:"LinkedHandle",name:"embeddingDimensions"}],storageKey:null}]},params:{cacheID:"18059ac8df6b3c15d5e4bc04ca2c9877",id:null,metadata:{},name:"ModelPageQuery",operationKind:"query",text:`query ModelPageQuery(
44
44
  $startTime: DateTime!
45
45
  $endTime: DateTime!
46
46
  ) {
@@ -98,9 +98,9 @@ fragment ModelSchemaTable_dimensions_3uKjWt on Query {
98
98
  }
99
99
  }
100
100
  }
101
- `}}}();Ft.hash="b612239336c7638df42037315b00f635";function zy(n){const{referenceInferences:a}=Ve(),{timeRange:l}=He(),t=D.useLazyLoadQuery(Ft,{startTime:l.start.toISOString(),endTime:l.end.toISOString()});return s("main",{children:[s(Xa,{children:[e(Ql,{}),a?e(jl,{inferencesRole:"reference",timeRange:{start:new Date(a.startTime),end:new Date(a.endTime)}}):null]}),e("section",{css:C`
101
+ `}}}();_l.hash="b612239336c7638df42037315b00f635";function Jy(n){const{referenceInferences:a}=Ve(),{timeRange:t}=Ue(),l=I.useLazyLoadQuery(_l,{startTime:t.start.toISOString(),endTime:t.end.toISOString()});return s("main",{children:[s(lt,{children:[e(Zt,{}),a?e(Xt,{inferencesRole:"reference",timeRange:{start:new Date(a.startTime),end:new Date(a.endTime)}}):null]}),e("section",{css:v`
102
102
  margin: var(--px-spacing-lg);
103
- `,children:e(Wa,{title:"Model Schema",variant:"compact",bodyStyle:{padding:0},children:s(Te,{children:[e(J,{name:"All",children:s(Ee,{children:[e(de,{title:"Embeddings",id:"embeddings",children:e(gl,{model:t})}),e(de,{title:"Dimensions",id:"dimensions",children:e(pl,{model:t})})]})},"all"),e(J,{name:"Embeddings",children:e(gl,{model:t})},"embeddings"),e(J,{name:"Dimensions",children:e(pl,{model:t})},"dimensions")]})})}),e(Pe,{})]})}const Kt={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"EmbeddingPageModelQuery",selections:[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"MetricSelector_dimensions"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"EmbeddingPageModelQuery",selections:[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{alias:"numericDimensions",args:[{kind:"Literal",name:"include",value:{dataTypes:["numeric"]}}],concreteType:"DimensionConnection",kind:"LinkedField",name:"dimensions",plural:!1,selections:[{alias:null,args:null,concreteType:"DimensionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Dimension",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'dimensions(include:{"dataTypes":["numeric"]})'}],storageKey:null}]},params:{cacheID:"4ccf476dd862525b059197daccd0d4d9",id:null,metadata:{},name:"EmbeddingPageModelQuery",operationKind:"query",text:`query EmbeddingPageModelQuery {
103
+ `,children:e(Ya,{title:"Model Schema",variant:"compact",bodyStyle:{padding:0},children:s(Pe,{children:[e(J,{name:"All",children:s(Re,{children:[e(de,{title:"Embeddings",id:"embeddings",children:e(Ct,{model:l})}),e(de,{title:"Dimensions",id:"dimensions",children:e(Ft,{model:l})})]})},"all"),e(J,{name:"Embeddings",children:e(Ct,{model:l})},"embeddings"),e(J,{name:"Dimensions",children:e(Ft,{model:l})},"dimensions")]})})}),e(_e,{})]})}const El={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"EmbeddingPageModelQuery",selections:[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"MetricSelector_dimensions"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"EmbeddingPageModelQuery",selections:[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{alias:"numericDimensions",args:[{kind:"Literal",name:"include",value:{dataTypes:["numeric"]}}],concreteType:"DimensionConnection",kind:"LinkedField",name:"dimensions",plural:!1,selections:[{alias:null,args:null,concreteType:"DimensionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Dimension",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'dimensions(include:{"dataTypes":["numeric"]})'}],storageKey:null}]},params:{cacheID:"4ccf476dd862525b059197daccd0d4d9",id:null,metadata:{},name:"EmbeddingPageModelQuery",operationKind:"query",text:`query EmbeddingPageModelQuery {
104
104
  model {
105
105
  ...MetricSelector_dimensions
106
106
  }
@@ -117,7 +117,7 @@ fragment MetricSelector_dimensions on Model {
117
117
  }
118
118
  }
119
119
  }
120
- `}};Kt.hash="374499f7f8ce6919e4a0a4ecbe380c52";const xt=function(){var n={defaultValue:null,kind:"LocalArgument",name:"clusterMinSamples"},a={defaultValue:null,kind:"LocalArgument",name:"clusterSelectionEpsilon"},l={defaultValue:null,kind:"LocalArgument",name:"dataQualityMetricColumnName"},t={defaultValue:null,kind:"LocalArgument",name:"fetchDataQualityMetric"},i={defaultValue:null,kind:"LocalArgument",name:"fetchPerformanceMetric"},r={defaultValue:null,kind:"LocalArgument",name:"id"},o={defaultValue:null,kind:"LocalArgument",name:"minClusterSize"},c={defaultValue:null,kind:"LocalArgument",name:"minDist"},d={defaultValue:null,kind:"LocalArgument",name:"nNeighbors"},g={defaultValue:null,kind:"LocalArgument",name:"nSamples"},f={defaultValue:null,kind:"LocalArgument",name:"performanceMetric"},m={defaultValue:null,kind:"LocalArgument",name:"timeRange"},p=[{kind:"Variable",name:"id",variableName:"id"}],y={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},b={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"x",storageKey:null},S={alias:null,args:null,kind:"ScalarField",name:"y",storageKey:null},v=[y,{alias:null,args:null,kind:"ScalarField",name:"eventId",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"coordinates",plural:!1,selections:[b,{kind:"InlineFragment",selections:[k,S,{alias:null,args:null,kind:"ScalarField",name:"z",storageKey:null}],type:"Point3D",abstractKey:null},{kind:"InlineFragment",selections:[k,S],type:"Point2D",abstractKey:null}],storageKey:null},{alias:null,args:null,concreteType:"EmbeddingMetadata",kind:"LinkedField",name:"embeddingMetadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"linkToData",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"rawData",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"EventMetadata",kind:"LinkedField",name:"eventMetadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"predictionId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"predictionLabel",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"actualLabel",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"predictionScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"actualScore",storageKey:null}],storageKey:null}],w=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],L={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"clusterMinSamples",variableName:"clusterMinSamples"},{kind:"Variable",name:"clusterSelectionEpsilon",variableName:"clusterSelectionEpsilon"},{kind:"Variable",name:"minClusterSize",variableName:"minClusterSize"},{kind:"Variable",name:"minDist",variableName:"minDist"},{kind:"Variable",name:"nNeighbors",variableName:"nNeighbors"},{kind:"Variable",name:"nSamples",variableName:"nSamples"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"UMAPPoints",kind:"LinkedField",name:"UMAPPoints",plural:!1,selections:[{alias:null,args:null,concreteType:"UMAPPoint",kind:"LinkedField",name:"data",plural:!0,selections:v,storageKey:null},{alias:null,args:null,concreteType:"UMAPPoint",kind:"LinkedField",name:"referenceData",plural:!0,selections:v,storageKey:null},{alias:null,args:null,concreteType:"UMAPPoint",kind:"LinkedField",name:"corpusData",plural:!0,selections:v,storageKey:null},{alias:null,args:null,concreteType:"Cluster",kind:"LinkedField",name:"clusters",plural:!0,selections:[y,{alias:null,args:null,kind:"ScalarField",name:"eventIds",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"driftRatio",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primaryToCorpusRatio",storageKey:null},{condition:"fetchDataQualityMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"columnName",variableName:"dataQualityMetricColumnName"},{kind:"Literal",name:"metric",value:"mean"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"dataQualityMetric",plural:!1,selections:w,storageKey:null}]},{condition:"fetchPerformanceMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"metric",variableName:"performanceMetric"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"performanceMetric",plural:!1,selections:w,storageKey:null}]}],storageKey:null},{alias:null,args:null,concreteType:"Retrieval",kind:"LinkedField",name:"contextRetrievals",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"queryId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"relevance",storageKey:null}],storageKey:null}],storageKey:null}],type:"EmbeddingDimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,l,t,i,r,o,c,d,g,f,m],kind:"Fragment",metadata:null,name:"EmbeddingPageUMAPQuery",selections:[{alias:"embedding",args:p,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[L],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[r,m,c,d,g,o,n,a,t,l,i,f],kind:"Operation",name:"EmbeddingPageUMAPQuery",selections:[{alias:"embedding",args:p,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[b,L,{kind:"TypeDiscriminator",abstractKey:"__isNode"},y],storageKey:null}]},params:{cacheID:"d30210c52f86b9d9a7ac958f866aa93e",id:null,metadata:{},name:"EmbeddingPageUMAPQuery",operationKind:"query",text:`query EmbeddingPageUMAPQuery(
120
+ `}};El.hash="374499f7f8ce6919e4a0a4ecbe380c52";const Al=function(){var n={defaultValue:null,kind:"LocalArgument",name:"clusterMinSamples"},a={defaultValue:null,kind:"LocalArgument",name:"clusterSelectionEpsilon"},t={defaultValue:null,kind:"LocalArgument",name:"dataQualityMetricColumnName"},l={defaultValue:null,kind:"LocalArgument",name:"fetchDataQualityMetric"},i={defaultValue:null,kind:"LocalArgument",name:"fetchPerformanceMetric"},r={defaultValue:null,kind:"LocalArgument",name:"id"},o={defaultValue:null,kind:"LocalArgument",name:"minClusterSize"},c={defaultValue:null,kind:"LocalArgument",name:"minDist"},d={defaultValue:null,kind:"LocalArgument",name:"nNeighbors"},g={defaultValue:null,kind:"LocalArgument",name:"nSamples"},f={defaultValue:null,kind:"LocalArgument",name:"performanceMetric"},m={defaultValue:null,kind:"LocalArgument",name:"timeRange"},p=[{kind:"Variable",name:"id",variableName:"id"}],y={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},S={alias:null,args:null,kind:"ScalarField",name:"x",storageKey:null},C={alias:null,args:null,kind:"ScalarField",name:"y",storageKey:null},b=[y,{alias:null,args:null,kind:"ScalarField",name:"eventId",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"coordinates",plural:!1,selections:[k,{kind:"InlineFragment",selections:[S,C,{alias:null,args:null,kind:"ScalarField",name:"z",storageKey:null}],type:"Point3D",abstractKey:null},{kind:"InlineFragment",selections:[S,C],type:"Point2D",abstractKey:null}],storageKey:null},{alias:null,args:null,concreteType:"EmbeddingMetadata",kind:"LinkedField",name:"embeddingMetadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"linkToData",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"rawData",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"EventMetadata",kind:"LinkedField",name:"eventMetadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"predictionId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"predictionLabel",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"actualLabel",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"predictionScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"actualScore",storageKey:null}],storageKey:null}],T=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],P={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"clusterMinSamples",variableName:"clusterMinSamples"},{kind:"Variable",name:"clusterSelectionEpsilon",variableName:"clusterSelectionEpsilon"},{kind:"Variable",name:"minClusterSize",variableName:"minClusterSize"},{kind:"Variable",name:"minDist",variableName:"minDist"},{kind:"Variable",name:"nNeighbors",variableName:"nNeighbors"},{kind:"Variable",name:"nSamples",variableName:"nSamples"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"UMAPPoints",kind:"LinkedField",name:"UMAPPoints",plural:!1,selections:[{alias:null,args:null,concreteType:"UMAPPoint",kind:"LinkedField",name:"data",plural:!0,selections:b,storageKey:null},{alias:null,args:null,concreteType:"UMAPPoint",kind:"LinkedField",name:"referenceData",plural:!0,selections:b,storageKey:null},{alias:null,args:null,concreteType:"UMAPPoint",kind:"LinkedField",name:"corpusData",plural:!0,selections:b,storageKey:null},{alias:null,args:null,concreteType:"Cluster",kind:"LinkedField",name:"clusters",plural:!0,selections:[y,{alias:null,args:null,kind:"ScalarField",name:"eventIds",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"driftRatio",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primaryToCorpusRatio",storageKey:null},{condition:"fetchDataQualityMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"columnName",variableName:"dataQualityMetricColumnName"},{kind:"Literal",name:"metric",value:"mean"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"dataQualityMetric",plural:!1,selections:T,storageKey:null}]},{condition:"fetchPerformanceMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"metric",variableName:"performanceMetric"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"performanceMetric",plural:!1,selections:T,storageKey:null}]}],storageKey:null},{alias:null,args:null,concreteType:"Retrieval",kind:"LinkedField",name:"contextRetrievals",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"queryId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"relevance",storageKey:null}],storageKey:null}],storageKey:null}],type:"EmbeddingDimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,t,l,i,r,o,c,d,g,f,m],kind:"Fragment",metadata:null,name:"EmbeddingPageUMAPQuery",selections:[{alias:"embedding",args:p,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[P],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[r,m,c,d,g,o,n,a,l,t,i,f],kind:"Operation",name:"EmbeddingPageUMAPQuery",selections:[{alias:"embedding",args:p,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[k,P,{kind:"TypeDiscriminator",abstractKey:"__isNode"},y],storageKey:null}]},params:{cacheID:"d30210c52f86b9d9a7ac958f866aa93e",id:null,metadata:{},name:"EmbeddingPageUMAPQuery",operationKind:"query",text:`query EmbeddingPageUMAPQuery(
121
121
  $id: GlobalID!
122
122
  $timeRange: TimeRange!
123
123
  $minDist: Float!
@@ -241,7 +241,7 @@ fragment MetricSelector_dimensions on Model {
241
241
  id
242
242
  }
243
243
  }
244
- `}}}();xt.hash="f1ee7ce02317f1c3fe96b77af405095f";function Qd(){const{theme:n}=zn();return u.useMemo(()=>n==="light"?Co:Fo,[n])}function jd(){const{embeddingDimensionId:n}=ln();if(!n)throw new Error("Missing embeddingDimensionId in URL params");return n}const Dt={euclideanDistance:{name:"Euclidean Distance",shortName:"Euc. Distance",definition:"Euclidean distance over time captures how much your primary inferences's embeddings are drifting from the reference data. Euclidean distance of the embeddings is calculated by taking the centroid of the embedding vectors for each inferences and calculating the distance between the two centroids."},queryDistance:{name:"Query Distance",shortName:"Query Distance",definition:"The query distance is the euclidean distance of the centroid of queries from the centroid of the corpus."},accuracyScore:{name:"Accuracy Score",shortName:"Accuracy",definition:"Accuracy classification score. In multi-label classification, this function computes subset accuracy: the set of labels predicted for a sample must exactly match the corresponding set of labels in the ground truth."}};function hn(n){const a=Dt[n];return a!=null?a.shortName:n}function _a(n){const a=Dt[n];return a&&a.definition!=null&&a.definition||null}function Dn(n){return`${n.column}:${n.dir}`}function qd(){const{referenceInferences:n}=Ve(),a=!!n,l=Q(d=>d.clusterSort),t=Q(d=>d.setClusterSort),[i,r]=u.useState(!1),o=u.useMemo(()=>{const d=[];return a&&d.push({label:"Most drift",value:Dn({column:"driftRatio",dir:"desc"})}),[...d,{label:"Largest clusters",value:Dn({column:"size",dir:"desc"})},{label:"Smallest clusters",value:Dn({column:"size",dir:"asc"})},{label:"Highest metric value",value:Dn({column:"primaryMetricValue",dir:"desc"})},{label:"Lowest metric value",value:Dn({column:"primaryMetricValue",dir:"asc"})}]},[a]),c=Dn(l);return e("div",{css:d=>C`
244
+ `}}}();Al.hash="f1ee7ce02317f1c3fe96b77af405095f";function Hd(){const{theme:n}=Qn();return u.useMemo(()=>n==="light"?Fo:Ko,[n])}function Gd(){const{embeddingDimensionId:n}=tn();if(!n)throw new Error("Missing embeddingDimensionId in URL params");return n}const Rl={euclideanDistance:{name:"Euclidean Distance",shortName:"Euc. Distance",definition:"Euclidean distance over time captures how much your primary inferences's embeddings are drifting from the reference data. Euclidean distance of the embeddings is calculated by taking the centroid of the embedding vectors for each inferences and calculating the distance between the two centroids."},queryDistance:{name:"Query Distance",shortName:"Query Distance",definition:"The query distance is the euclidean distance of the centroid of queries from the centroid of the corpus."},accuracyScore:{name:"Accuracy Score",shortName:"Accuracy",definition:"Accuracy classification score. In multi-label classification, this function computes subset accuracy: the set of labels predicted for a sample must exactly match the corresponding set of labels in the ground truth."}};function fn(n){const a=Rl[n];return a!=null?a.shortName:n}function Ra(n){const a=Rl[n];return a&&a.definition!=null&&a.definition||null}function Dn(n){return`${n.column}:${n.dir}`}function Wd(){const{referenceInferences:n}=Ve(),a=!!n,t=Q(d=>d.clusterSort),l=Q(d=>d.setClusterSort),[i,r]=u.useState(!1),o=u.useMemo(()=>{const d=[];return a&&d.push({label:"Most drift",value:Dn({column:"driftRatio",dir:"desc"})}),[...d,{label:"Largest clusters",value:Dn({column:"size",dir:"desc"})},{label:"Smallest clusters",value:Dn({column:"size",dir:"asc"})},{label:"Highest metric value",value:Dn({column:"primaryMetricValue",dir:"desc"})},{label:"Lowest metric value",value:Dn({column:"primaryMetricValue",dir:"asc"})}]},[a]),c=Dn(t);return e("div",{css:d=>v`
245
245
  .ac-action-button {
246
246
  background: none;
247
247
  border: none;
@@ -254,7 +254,7 @@ fragment MetricSelector_dimensions on Model {
254
254
  color: var(--ac-global-text-color-900);
255
255
  }
256
256
  }
257
- `,children:s(tn,{placement:"bottom right","aria-label":"Sort clusters by",isOpen:i,onOpenChange:d=>r(d),children:[s(ro,{children:["Sort",e("span",{"aria-hidden":!0,"data-testid":"dropdown-caret",css:C`
257
+ `,children:s(Cn,{placement:"bottom right","aria-label":"Sort clusters by",isOpen:i,onOpenChange:d=>r(d),children:[s(so,{children:["Sort",e("span",{"aria-hidden":!0,"data-testid":"dropdown-caret",css:v`
258
258
  margin-left: var(--px-spacing-sm);
259
259
  border-bottom-color: #0000;
260
260
  border-left-color: #0000;
@@ -266,14 +266,14 @@ fragment MetricSelector_dimensions on Model {
266
266
  height: 0;
267
267
  vertical-align: middle;
268
268
  width: 0;
269
- `})]}),e(ha,{children:e(na,{style:{width:200},selectedKeys:[c],selectionMode:"single",items:o,onSelectionChange:d=>{if(d instanceof Set&&d.size>0){const[g]=d.values(),[f,m]=g.split(":");t({column:f,dir:m})}r(!1)},children:d=>e(B,{children:d.label},d.value)})})]})})}const Tt=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"clusters"}],a=[{alias:null,args:[{kind:"Variable",name:"clusters",variableName:"clusters"}],concreteType:"ExportedFile",kind:"LinkedField",name:"exportClusters",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"fileName",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"EmbeddingActionMenuExportClustersMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"EmbeddingActionMenuExportClustersMutation",selections:a},params:{cacheID:"1bef6586fcb3d6eb7034204fbe49633c",id:null,metadata:{},name:"EmbeddingActionMenuExportClustersMutation",operationKind:"mutation",text:`mutation EmbeddingActionMenuExportClustersMutation(
269
+ `})]}),e(Sa,{children:e(va,{style:{width:200},selectedKeys:[c],selectionMode:"single",items:o,onSelectionChange:d=>{if(d instanceof Set&&d.size>0){const[g]=d.values(),[f,m]=g.split(":");l({column:f,dir:m})}r(!1)},children:d=>e(U,{children:d.label},d.value)})})]})})}const Ml=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"clusters"}],a=[{alias:null,args:[{kind:"Variable",name:"clusters",variableName:"clusters"}],concreteType:"ExportedFile",kind:"LinkedField",name:"exportClusters",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"fileName",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"EmbeddingActionMenuExportClustersMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"EmbeddingActionMenuExportClustersMutation",selections:a},params:{cacheID:"1bef6586fcb3d6eb7034204fbe49633c",id:null,metadata:{},name:"EmbeddingActionMenuExportClustersMutation",operationKind:"mutation",text:`mutation EmbeddingActionMenuExportClustersMutation(
270
270
  $clusters: [ClusterInput!]!
271
271
  ) {
272
272
  exportClusters(clusters: $clusters) {
273
273
  fileName
274
274
  }
275
275
  }
276
- `}}}();Tt.hash="b5ff2517dbb0d19a1b24dea1796a3576";function Ud(){const n=Q(r=>r.clusters),{notifyError:a,notifySuccess:l}=ql(),[t,i]=D.useMutation(Tt);return e(Be,{align:"end",buttonSize:"compact",icon:i?e(P,{svg:e(I.LoadingOutline,{})}):null,onAction:r=>{switch(r){case"export_cluster":t({variables:{clusters:n.map(o=>({eventIds:o.eventIds,id:o.id}))},onCompleted:o=>{const{fileName:c}=o.exportClusters;l({title:"Clusters Exported",message:"dataframe is available via px.active_session().exports or can be downloaded by clicking below",action:{text:"Download",onClick:()=>{window.open(`/exports?filename=${c}`,"_self")}}})},onError:o=>{a({title:"Failed to export clusters",message:`Failed to export clusters: ${o.message}`})}});break}},children:s(B,{children:[e(P,{svg:e(I.Download,{})}),"Export clusters"]},"export_cluster")})}const It={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"MetricSelector_dimensions",selections:[{alias:"numericDimensions",args:[{kind:"Literal",name:"include",value:{dataTypes:["numeric"]}}],concreteType:"DimensionConnection",kind:"LinkedField",name:"dimensions",plural:!1,selections:[{alias:null,args:null,concreteType:"DimensionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Dimension",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'dimensions(include:{"dataTypes":["numeric"]})'}],type:"Model",abstractKey:null};It.hash="55d03de16503d7af254c17cef7d18ee0";const Ln=":";function Bd(n){return["drift","performance","dataQuality","retrieval"].includes(n)}function Bn(n){const{type:a,metric:l}=n;switch(a){case"drift":return`${a}${Ln}${l}`;case"retrieval":return`${a}${Ln}${l}`;case"performance":return`${a}${Ln}${l}`;case"dataQuality":{const{name:t}=n.dimension;return`${a}${Ln}${l}${Ln}${t}`}default:Ce()}}function Hd({metricKey:n,dimensions:a}){const[l,t,i]=n.split(Ln);if(!Bd(l))throw new Error(`Invalid metric type: ${l}`);switch(l){case"drift":return{type:l,metric:t};case"retrieval":return{type:l,metric:t};case"performance":return{type:l,metric:t};case"dataQuality":{const r=a.find(o=>o.name===i);if(!r)throw new Error(`Invalid dimension name: ${i}`);return{type:l,metric:t,dimension:r}}default:Ce()}}const Gd=s(Vn,{variant:"info",children:[e(re,{level:4,children:"Analysis Metric"}),s(Fn,{children:[e("p",{children:"Select a metric to drive the analysis of your embeddings."}),e("p",{children:"To analyze the the drift between your two inferencess, select a drift metric and the UI will highlight areas of high drift."}),e("p",{children:"To analyze the quality of your embeddings, select a dimension data quality metric by which to analyze the point cloud. The UI will highlight areas where the data quality is degrading."})]})]});function Wd({model:n}){const[,a]=u.useTransition(),l=D.useFragment(It,n),{referenceInferences:t,corpusInferences:i}=Ve(),r=!!t,o=!!i,c=Q(y=>y.metric),d=Q(y=>y.loading),g=Q(y=>y.setMetric),f=l.numericDimensions.edges.map(y=>y.node),m=f.length>0,p=u.useCallback(y=>{const b=Hd({metricKey:y,dimensions:f});a(()=>{g(b)})},[g,f,a]);return s(Nn,{label:"metric",labelExtra:Gd,selectedKey:c?Bn(c):void 0,onSelectionChange:p,placeholder:"Select a metric...",isDisabled:d,children:[r?e(ca,{title:"Drift",children:e(B,{children:"Euclidean Distance"},Bn({type:"drift",metric:"euclideanDistance"}))}):null,o?e(ca,{title:"Retrieval",children:e(B,{children:"Query Distance"},Bn({type:"retrieval",metric:"queryDistance"}))}):null,e(ca,{title:"Performance",children:e(B,{children:"Accuracy Score"},Bn({type:"performance",metric:"accuracyScore"}))}),m?e(ca,{title:"Data Quality",children:f.map(y=>e(B,{children:`${y.name} avg`},Bn({type:"dataQuality",metric:"average",dimension:y})))}):null]})}const Lt=function(){var n={defaultValue:null,kind:"LocalArgument",name:"countGranularity"},a={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},l={defaultValue:null,kind:"LocalArgument",name:"embeddingDimensionId"},t={defaultValue:null,kind:"LocalArgument",name:"fetchDataQuality"},i={defaultValue:null,kind:"LocalArgument",name:"fetchDrift"},r={defaultValue:null,kind:"LocalArgument",name:"fetchPerformance"},o={defaultValue:null,kind:"LocalArgument",name:"fetchQueryDistance"},c={defaultValue:null,kind:"LocalArgument",name:"metricGranularity"},d={defaultValue:null,kind:"LocalArgument",name:"performanceMetric"},g={defaultValue:null,kind:"LocalArgument",name:"timeRange"},f=[{kind:"Variable",name:"id",variableName:"embeddingDimensionId"}],m={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},p={kind:"Variable",name:"granularity",variableName:"metricGranularity"},y={kind:"Variable",name:"timeRange",variableName:"timeRange"},b=[p,{kind:"Literal",name:"metric",value:"euclideanDistance"},y],k=[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],S={kind:"InlineFragment",selections:[{condition:"fetchDrift",kind:"Condition",passingValue:!0,selections:[{alias:"euclideanDistanceTimeSeries",args:b,concreteType:"DriftTimeSeries",kind:"LinkedField",name:"driftTimeSeries",plural:!1,selections:k,storageKey:null}]},{condition:"fetchQueryDistance",kind:"Condition",passingValue:!0,selections:[{alias:null,args:b,concreteType:"DriftTimeSeries",kind:"LinkedField",name:"retrievalMetricTimeSeries",plural:!1,selections:k,storageKey:null}]},{alias:"trafficTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"countGranularity"},{kind:"Literal",name:"metric",value:"count"},y],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:k,storageKey:null}],type:"EmbeddingDimension",abstractKey:null},v=[{kind:"Variable",name:"id",variableName:"dimensionId"}],w={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:[p,{kind:"Literal",name:"metric",value:"mean"},y],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:k,storageKey:null}],type:"Dimension",abstractKey:null},L={alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{condition:"fetchPerformance",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[p,{fields:[{kind:"Variable",name:"metric",variableName:"performanceMetric"}],kind:"ObjectValue",name:"metric"},y],concreteType:"PerformanceTimeSeries",kind:"LinkedField",name:"performanceTimeSeries",plural:!1,selections:k,storageKey:null}]}],storageKey:null},A={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null};return{fragment:{argumentDefinitions:[n,a,l,t,i,r,o,c,d,g],kind:"Fragment",metadata:null,name:"MetricTimeSeriesQuery",selections:[{alias:"embedding",args:f,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[m,S],storageKey:null},{condition:"fetchDataQuality",kind:"Condition",passingValue:!0,selections:[{alias:"dimension",args:v,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[w],storageKey:null}]},L],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[l,g,c,n,i,o,t,a,r,d],kind:"Operation",name:"MetricTimeSeriesQuery",selections:[{alias:"embedding",args:f,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[A,m,S],storageKey:null},{condition:"fetchDataQuality",kind:"Condition",passingValue:!0,selections:[{alias:"dimension",args:v,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[A,w,{kind:"TypeDiscriminator",abstractKey:"__isNode"},m],storageKey:null}]},L]},params:{cacheID:"a68a8204bf7fdd13e6915b338d4b5497",id:null,metadata:{},name:"MetricTimeSeriesQuery",operationKind:"query",text:`query MetricTimeSeriesQuery(
276
+ `}}}();Ml.hash="b5ff2517dbb0d19a1b24dea1796a3576";function Jd(){const n=Q(r=>r.clusters),{notifyError:a,notifySuccess:t}=Yt(),[l,i]=I.useMutation(Ml);return e(ln,{align:"end",buttonSize:"compact",icon:i?e(w,{svg:e(L.LoadingOutline,{})}):null,onAction:r=>{switch(r){case"export_cluster":l({variables:{clusters:n.map(o=>({eventIds:o.eventIds,id:o.id}))},onCompleted:o=>{const{fileName:c}=o.exportClusters;t({title:"Clusters Exported",message:"dataframe is available via px.active_session().exports or can be downloaded by clicking below",action:{text:"Download",onClick:()=>{window.open(`/exports?filename=${c}`,"_self")}}})},onError:o=>{a({title:"Failed to export clusters",message:`Failed to export clusters: ${o.message}`})}});break}},children:s(U,{children:[e(w,{svg:e(L.Download,{})}),"Export clusters"]},"export_cluster")})}const Nl={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"MetricSelector_dimensions",selections:[{alias:"numericDimensions",args:[{kind:"Literal",name:"include",value:{dataTypes:["numeric"]}}],concreteType:"DimensionConnection",kind:"LinkedField",name:"dimensions",plural:!1,selections:[{alias:null,args:null,concreteType:"DimensionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Dimension",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'dimensions(include:{"dataTypes":["numeric"]})'}],type:"Model",abstractKey:null};Nl.hash="55d03de16503d7af254c17cef7d18ee0";const Ln=":";function Zd(n){return["drift","performance","dataQuality","retrieval"].includes(n)}function Jn(n){const{type:a,metric:t}=n;switch(a){case"drift":return`${a}${Ln}${t}`;case"retrieval":return`${a}${Ln}${t}`;case"performance":return`${a}${Ln}${t}`;case"dataQuality":{const{name:l}=n.dimension;return`${a}${Ln}${t}${Ln}${l}`}default:ye()}}function Xd({metricKey:n,dimensions:a}){const[t,l,i]=n.split(Ln);if(!Zd(t))throw new Error(`Invalid metric type: ${t}`);switch(t){case"drift":return{type:t,metric:l};case"retrieval":return{type:t,metric:l};case"performance":return{type:t,metric:l};case"dataQuality":{const r=a.find(o=>o.name===i);if(!r)throw new Error(`Invalid dimension name: ${i}`);return{type:t,metric:l,dimension:r}}default:ye()}}const Yd=s($n,{variant:"info",children:[e(se,{level:4,children:"Analysis Metric"}),s(Fn,{children:[e("p",{children:"Select a metric to drive the analysis of your embeddings."}),e("p",{children:"To analyze the the drift between your two inferencess, select a drift metric and the UI will highlight areas of high drift."}),e("p",{children:"To analyze the quality of your embeddings, select a dimension data quality metric by which to analyze the point cloud. The UI will highlight areas where the data quality is degrading."})]})]});function ec({model:n}){const[,a]=u.useTransition(),t=I.useFragment(Nl,n),{referenceInferences:l,corpusInferences:i}=Ve(),r=!!l,o=!!i,c=Q(y=>y.metric),d=Q(y=>y.loading),g=Q(y=>y.setMetric),f=t.numericDimensions.edges.map(y=>y.node),m=f.length>0,p=u.useCallback(y=>{const k=Xd({metricKey:y,dimensions:f});a(()=>{g(k)})},[g,f,a]);return s(Vn,{label:"metric",labelExtra:Yd,selectedKey:c?Jn(c):void 0,onSelectionChange:p,placeholder:"Select a metric...",isDisabled:d,children:[r?e(ua,{title:"Drift",children:e(U,{children:"Euclidean Distance"},Jn({type:"drift",metric:"euclideanDistance"}))}):null,o?e(ua,{title:"Retrieval",children:e(U,{children:"Query Distance"},Jn({type:"retrieval",metric:"queryDistance"}))}):null,e(ua,{title:"Performance",children:e(U,{children:"Accuracy Score"},Jn({type:"performance",metric:"accuracyScore"}))}),m?e(ua,{title:"Data Quality",children:f.map(y=>e(U,{children:`${y.name} avg`},Jn({type:"dataQuality",metric:"average",dimension:y})))}):null]})}const zl=function(){var n={defaultValue:null,kind:"LocalArgument",name:"countGranularity"},a={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},t={defaultValue:null,kind:"LocalArgument",name:"embeddingDimensionId"},l={defaultValue:null,kind:"LocalArgument",name:"fetchDataQuality"},i={defaultValue:null,kind:"LocalArgument",name:"fetchDrift"},r={defaultValue:null,kind:"LocalArgument",name:"fetchPerformance"},o={defaultValue:null,kind:"LocalArgument",name:"fetchQueryDistance"},c={defaultValue:null,kind:"LocalArgument",name:"metricGranularity"},d={defaultValue:null,kind:"LocalArgument",name:"performanceMetric"},g={defaultValue:null,kind:"LocalArgument",name:"timeRange"},f=[{kind:"Variable",name:"id",variableName:"embeddingDimensionId"}],m={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},p={kind:"Variable",name:"granularity",variableName:"metricGranularity"},y={kind:"Variable",name:"timeRange",variableName:"timeRange"},k=[p,{kind:"Literal",name:"metric",value:"euclideanDistance"},y],S=[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],C={kind:"InlineFragment",selections:[{condition:"fetchDrift",kind:"Condition",passingValue:!0,selections:[{alias:"euclideanDistanceTimeSeries",args:k,concreteType:"DriftTimeSeries",kind:"LinkedField",name:"driftTimeSeries",plural:!1,selections:S,storageKey:null}]},{condition:"fetchQueryDistance",kind:"Condition",passingValue:!0,selections:[{alias:null,args:k,concreteType:"DriftTimeSeries",kind:"LinkedField",name:"retrievalMetricTimeSeries",plural:!1,selections:S,storageKey:null}]},{alias:"trafficTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"countGranularity"},{kind:"Literal",name:"metric",value:"count"},y],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:S,storageKey:null}],type:"EmbeddingDimension",abstractKey:null},b=[{kind:"Variable",name:"id",variableName:"dimensionId"}],T={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:[p,{kind:"Literal",name:"metric",value:"mean"},y],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:S,storageKey:null}],type:"Dimension",abstractKey:null},P={alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{condition:"fetchPerformance",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[p,{fields:[{kind:"Variable",name:"metric",variableName:"performanceMetric"}],kind:"ObjectValue",name:"metric"},y],concreteType:"PerformanceTimeSeries",kind:"LinkedField",name:"performanceTimeSeries",plural:!1,selections:S,storageKey:null}]}],storageKey:null},_={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null};return{fragment:{argumentDefinitions:[n,a,t,l,i,r,o,c,d,g],kind:"Fragment",metadata:null,name:"MetricTimeSeriesQuery",selections:[{alias:"embedding",args:f,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[m,C],storageKey:null},{condition:"fetchDataQuality",kind:"Condition",passingValue:!0,selections:[{alias:"dimension",args:b,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[T],storageKey:null}]},P],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[t,g,c,n,i,o,l,a,r,d],kind:"Operation",name:"MetricTimeSeriesQuery",selections:[{alias:"embedding",args:f,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[_,m,C],storageKey:null},{condition:"fetchDataQuality",kind:"Condition",passingValue:!0,selections:[{alias:"dimension",args:b,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[_,T,{kind:"TypeDiscriminator",abstractKey:"__isNode"},m],storageKey:null}]},P]},params:{cacheID:"a68a8204bf7fdd13e6915b338d4b5497",id:null,metadata:{},name:"MetricTimeSeriesQuery",operationKind:"query",text:`query MetricTimeSeriesQuery(
277
277
  $embeddingDimensionId: GlobalID!
278
278
  $timeRange: TimeRange!
279
279
  $metricGranularity: Granularity!
@@ -332,7 +332,7 @@ fragment MetricSelector_dimensions on Model {
332
332
  }
333
333
  }
334
334
  }
335
- `}}}();Lt.hash="f31abad2141a5a1c461ef2a598ffa4f3";const kl=new Intl.NumberFormat([],{maximumFractionDigits:2}),Pt=()=>{const n=Ge(),a=n.blue400,l=n.gray500;return{color:a,barColor:l}};function Jd({active:n,payload:a,label:l}){var r,o,c;const{color:t,barColor:i}=Pt();if(n&&a&&a.length){const d=((r=a[1])==null?void 0:r.value)??null,g=((o=a[0])==null?void 0:o.value)??null,f=typeof d=="number"?kl.format(d):"--",m=typeof g=="number"?kl.format(g):"--";return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(l))}`}),e(pe,{color:t,name:((c=a[1])==null?void 0:c.payload.metricName)??"Metric",value:f}),e(pe,{color:i,shape:"square",name:"Count",value:m}),e(va,{}),s("div",{css:C`
335
+ `}}}();zl.hash="f31abad2141a5a1c461ef2a598ffa4f3";const Dt=new Intl.NumberFormat([],{maximumFractionDigits:2}),Vl=()=>{const n=Be(),a=n.blue400,t=n.gray500;return{color:a,barColor:t}};function nc({active:n,payload:a,label:t}){var r,o,c;const{color:l,barColor:i}=Vl();if(n&&a&&a.length){const d=((r=a[1])==null?void 0:r.value)??null,g=((o=a[0])==null?void 0:o.value)??null,f=typeof d=="number"?Dt.format(d):"--",m=typeof g=="number"?Dt.format(g):"--";return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(t))}`}),e(pe,{color:l,name:((c=a[1])==null?void 0:c.payload.metricName)??"Metric",value:f}),e(pe,{color:i,shape:"square",name:"Count",value:m}),e(Ka,{}),s("div",{css:v`
336
336
  display: flex;
337
337
  flex-direction: row;
338
338
  align-items: center;
@@ -340,7 +340,7 @@ fragment MetricSelector_dimensions on Model {
340
340
  gap: var(--px-spacing-sm);
341
341
 
342
342
  margin-top: var(--px-spacing-sm);
343
- `,children:[e(P,{svg:e(Nl,{})}),e("span",{children:"Click to view the point cloud at this time"})]})]})}return null}function Zd(n){switch(n.type){case"drift":return"Embedding Drift";case"performance":return"Model Performance";case"dataQuality":return"Data Quality";case"retrieval":return"Query Distance";default:Ce()}}function Xd(n){if(n)switch(n.type){case"drift":return hn(n.metric);case"performance":return hn(n.metric);case"dataQuality":return`${n.dimension.name} avg`;case"retrieval":return hn(n.metric);default:Ce()}else return"Count"}function Yd(n){switch(n.type){case"drift":return _a(n.metric);case"performance":return _a(n.metric);case"dataQuality":return null;case"retrieval":return _a(n.metric);default:Ce()}}function ec({embeddingDimensionId:n}){const a=Q(x=>x.metric),l=a.type==="drift",t=a.type==="retrieval",i=a.type==="dataQuality",r=a.type==="performance",{timeRange:o}=He(),{selectedTimestamp:c,setSelectedTimestamp:d}=Sa(),g=$n(o),f=D.useLazyLoadQuery(Lt,{embeddingDimensionId:n,timeRange:{start:o.start.toISOString(),end:o.end.toISOString()},metricGranularity:Ul(o),countGranularity:g,fetchDrift:l,fetchQueryDistance:t,fetchDataQuality:i,fetchPerformance:r,dimensionId:a.type==="dataQuality"?a.dimension.id:n,performanceMetric:a.type==="performance"?a.metric:"accuracyScore"}),m=On({samplingIntervalMinutes:g.samplingIntervalMinutes}),p=u.useCallback(x=>{const{activePayload:T}=x;if(T!=null&&T.length>0){const E=T[0].payload;d(new Date(E.timestamp))}},[d]),y=nc({data:f,metric:a}),k=ac(f).reduce((x,T)=>(x[T.timestamp]=T.value,x),{})??{},S=y.map(x=>{const T=k[x.timestamp];return{...x,traffic:T,timestamp:new Date(x.timestamp).getTime()}}),v=Xd(a),w=Yd(a),{color:L,barColor:A}=Pt();return s("section",{css:C`
343
+ `,children:[e(w,{svg:e(Ht,{})}),e("span",{children:"Click to view the point cloud at this time"})]})]})}return null}function ac(n){switch(n.type){case"drift":return"Embedding Drift";case"performance":return"Model Performance";case"dataQuality":return"Data Quality";case"retrieval":return"Query Distance";default:ye()}}function tc(n){if(n)switch(n.type){case"drift":return fn(n.metric);case"performance":return fn(n.metric);case"dataQuality":return`${n.dimension.name} avg`;case"retrieval":return fn(n.metric);default:ye()}else return"Count"}function lc(n){switch(n.type){case"drift":return Ra(n.metric);case"performance":return Ra(n.metric);case"dataQuality":return null;case"retrieval":return Ra(n.metric);default:ye()}}function ic({embeddingDimensionId:n}){const a=Q(x=>x.metric),t=a.type==="drift",l=a.type==="retrieval",i=a.type==="dataQuality",r=a.type==="performance",{timeRange:o}=Ue(),{selectedTimestamp:c,setSelectedTimestamp:d}=Fa(),g=jn(o),f=I.useLazyLoadQuery(zl,{embeddingDimensionId:n,timeRange:{start:o.start.toISOString(),end:o.end.toISOString()},metricGranularity:el(o),countGranularity:g,fetchDrift:t,fetchQueryDistance:l,fetchDataQuality:i,fetchPerformance:r,dimensionId:a.type==="dataQuality"?a.dimension.id:n,performanceMetric:a.type==="performance"?a.metric:"accuracyScore"}),m=qn({samplingIntervalMinutes:g.samplingIntervalMinutes}),p=u.useCallback(x=>{const{activePayload:D}=x;if(D!=null&&D.length>0){const A=D[0].payload;d(new Date(A.timestamp))}},[d]),y=rc({data:f,metric:a}),S=sc(f).reduce((x,D)=>(x[D.timestamp]=D.value,x),{})??{},C=y.map(x=>{const D=S[x.timestamp];return{...x,traffic:D,timestamp:new Date(x.timestamp).getTime()}}),b=tc(a),T=lc(a),{color:P,barColor:_}=Vl();return s("section",{css:v`
344
344
  width: 100%;
345
345
  height: 100%;
346
346
  display: flex;
@@ -360,7 +360,7 @@ fragment MetricSelector_dimensions on Model {
360
360
  width: 100%;
361
361
  overflow: hidden;
362
362
  }
363
- `,children:[s(re,{level:3,children:[Zd(a),w!=null?s(Vn,{children:[e(re,{level:4,children:v}),e(Fn,{children:w})]}):null]}),e("div",{children:e(sn,{width:"100%",height:"100%",children:s(ra,{data:S,margin:{top:25,right:18,left:18,bottom:10},onClick:p,children:[s("defs",{children:[s("linearGradient",{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:L,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:L,stopOpacity:0})]}),s("linearGradient",{id:"barColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:A,stopOpacity:.3}),e("stop",{offset:"95%",stopColor:A,stopOpacity:0})]})]}),e(on,{...Qn,tickFormatter:x=>m(new Date(x)),style:{fill:"var(--ac-global-text-color-700)"}}),e(Ne,{stroke:ge.colors.gray200,label:{value:v,angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(Ne,{yAxisId:"right",orientation:"right",label:{value:"Count",angle:90,position:"insideRight",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(Jd,{})}),e(En,{yAxisId:"right",dataKey:"traffic",fill:"url(#barColor)",spacing:5}),e(Yn,{type:"monotone",dataKey:"value",stroke:L,fillOpacity:1,fill:"url(#colorUv)"}),c!=null?e(pt,{...Bl,x:c.getTime()}):null]})})})]})}function nc({data:n,metric:a}){var l,t,i,r,o,c;if(((l=n.embedding.euclideanDistanceTimeSeries)==null?void 0:l.data)!=null&&n.embedding.euclideanDistanceTimeSeries.data.length>0)return n.embedding.euclideanDistanceTimeSeries.data.map(d=>({metricName:hn(a.metric),...d}));if(((t=n.embedding.retrievalMetricTimeSeries)==null?void 0:t.data)!=null&&n.embedding.retrievalMetricTimeSeries.data.length>0)return n.embedding.retrievalMetricTimeSeries.data.map(d=>({metricName:hn(a.metric),...d}));if(n.dimension&&((r=(i=n.dimension)==null?void 0:i.dataQualityTimeSeries)==null?void 0:r.data)!=null&&n.dimension.dataQualityTimeSeries.data.length>0){const d=n.dimension.name||"unknown";return n.dimension.dataQualityTimeSeries.data.map(g=>({metricName:`${d} avg`,...g}))}else{if(n.model&&((o=n.model.performanceTimeSeries)==null?void 0:o.data)!=null&&n.model.performanceTimeSeries.data.length>0)return n.model.performanceTimeSeries.data.map(d=>({metricName:hn(a.metric),...d}));if(((c=n.embedding.trafficTimeSeries)==null?void 0:c.data)!=null)return n.embedding.trafficTimeSeries.data.map(d=>({metricName:"Count",...d}))}return[]}function ac(n){var a;return((a=n.embedding.trafficTimeSeries)==null?void 0:a.data)!=null?[...n.embedding.trafficTimeSeries.data]:[]}const wt=function(){var n={defaultValue:null,kind:"LocalArgument",name:"corpusEventIds"},a={defaultValue:null,kind:"LocalArgument",name:"primaryEventIds"},l={defaultValue:null,kind:"LocalArgument",name:"referenceEventIds"},t=[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"DimensionWithValue",kind:"LinkedField",name:"dimensions",plural:!0,selections:[{alias:null,args:null,concreteType:"Dimension",kind:"LinkedField",name:"dimension",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"EventMetadata",kind:"LinkedField",name:"eventMetadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"predictionId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"predictionLabel",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"predictionScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"actualLabel",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"actualScore",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PromptResponse",kind:"LinkedField",name:"promptAndResponse",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"prompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"response",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentText",storageKey:null}],i=[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{alias:null,args:null,concreteType:"Inferences",kind:"LinkedField",name:"primaryInferences",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"eventIds",variableName:"primaryEventIds"}],concreteType:"Event",kind:"LinkedField",name:"events",plural:!0,selections:t,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Inferences",kind:"LinkedField",name:"referenceInferences",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"eventIds",variableName:"referenceEventIds"}],concreteType:"Event",kind:"LinkedField",name:"events",plural:!0,selections:t,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Inferences",kind:"LinkedField",name:"corpusInferences",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"eventIds",variableName:"corpusEventIds"}],concreteType:"Event",kind:"LinkedField",name:"events",plural:!0,selections:t,storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"PointSelectionPanelContentQuery",selections:i,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,l,n],kind:"Operation",name:"PointSelectionPanelContentQuery",selections:i},params:{cacheID:"8b48064eba35d0d6c8dc834c2f7795c0",id:null,metadata:{},name:"PointSelectionPanelContentQuery",operationKind:"query",text:`query PointSelectionPanelContentQuery(
363
+ `,children:[s(se,{level:3,children:[ac(a),T!=null?s($n,{children:[e(se,{level:4,children:b}),e(Fn,{children:T})]}):null]}),e("div",{children:e(sn,{width:"100%",height:"100%",children:s(sa,{data:C,margin:{top:25,right:18,left:18,bottom:10},onClick:p,children:[s("defs",{children:[s("linearGradient",{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:P,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:P,stopOpacity:0})]}),s("linearGradient",{id:"barColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:_,stopOpacity:.3}),e("stop",{offset:"95%",stopColor:_,stopOpacity:0})]})]}),e(on,{...Un,tickFormatter:x=>m(new Date(x)),style:{fill:"var(--ac-global-text-color-700)"}}),e(ze,{stroke:ge.colors.gray200,label:{value:b,angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(ze,{yAxisId:"right",orientation:"right",label:{value:"Count",angle:90,position:"insideRight",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(nc,{})}),e(Mn,{yAxisId:"right",dataKey:"traffic",fill:"url(#barColor)",spacing:5}),e(aa,{type:"monotone",dataKey:"value",stroke:P,fillOpacity:1,fill:"url(#colorUv)"}),c!=null?e(Fl,{...nl,x:c.getTime()}):null]})})})]})}function rc({data:n,metric:a}){var t,l,i,r,o,c;if(((t=n.embedding.euclideanDistanceTimeSeries)==null?void 0:t.data)!=null&&n.embedding.euclideanDistanceTimeSeries.data.length>0)return n.embedding.euclideanDistanceTimeSeries.data.map(d=>({metricName:fn(a.metric),...d}));if(((l=n.embedding.retrievalMetricTimeSeries)==null?void 0:l.data)!=null&&n.embedding.retrievalMetricTimeSeries.data.length>0)return n.embedding.retrievalMetricTimeSeries.data.map(d=>({metricName:fn(a.metric),...d}));if(n.dimension&&((r=(i=n.dimension)==null?void 0:i.dataQualityTimeSeries)==null?void 0:r.data)!=null&&n.dimension.dataQualityTimeSeries.data.length>0){const d=n.dimension.name||"unknown";return n.dimension.dataQualityTimeSeries.data.map(g=>({metricName:`${d} avg`,...g}))}else{if(n.model&&((o=n.model.performanceTimeSeries)==null?void 0:o.data)!=null&&n.model.performanceTimeSeries.data.length>0)return n.model.performanceTimeSeries.data.map(d=>({metricName:fn(a.metric),...d}));if(((c=n.embedding.trafficTimeSeries)==null?void 0:c.data)!=null)return n.embedding.trafficTimeSeries.data.map(d=>({metricName:"Count",...d}))}return[]}function sc(n){var a;return((a=n.embedding.trafficTimeSeries)==null?void 0:a.data)!=null?[...n.embedding.trafficTimeSeries.data]:[]}const $l=function(){var n={defaultValue:null,kind:"LocalArgument",name:"corpusEventIds"},a={defaultValue:null,kind:"LocalArgument",name:"primaryEventIds"},t={defaultValue:null,kind:"LocalArgument",name:"referenceEventIds"},l=[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"DimensionWithValue",kind:"LinkedField",name:"dimensions",plural:!0,selections:[{alias:null,args:null,concreteType:"Dimension",kind:"LinkedField",name:"dimension",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"EventMetadata",kind:"LinkedField",name:"eventMetadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"predictionId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"predictionLabel",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"predictionScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"actualLabel",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"actualScore",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PromptResponse",kind:"LinkedField",name:"promptAndResponse",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"prompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"response",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentText",storageKey:null}],i=[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{alias:null,args:null,concreteType:"Inferences",kind:"LinkedField",name:"primaryInferences",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"eventIds",variableName:"primaryEventIds"}],concreteType:"Event",kind:"LinkedField",name:"events",plural:!0,selections:l,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Inferences",kind:"LinkedField",name:"referenceInferences",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"eventIds",variableName:"referenceEventIds"}],concreteType:"Event",kind:"LinkedField",name:"events",plural:!0,selections:l,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Inferences",kind:"LinkedField",name:"corpusInferences",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"eventIds",variableName:"corpusEventIds"}],concreteType:"Event",kind:"LinkedField",name:"events",plural:!0,selections:l,storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"PointSelectionPanelContentQuery",selections:i,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,t,n],kind:"Operation",name:"PointSelectionPanelContentQuery",selections:i},params:{cacheID:"8b48064eba35d0d6c8dc834c2f7795c0",id:null,metadata:{},name:"PointSelectionPanelContentQuery",operationKind:"query",text:`query PointSelectionPanelContentQuery(
364
364
  $primaryEventIds: [ID!]!
365
365
  $referenceEventIds: [ID!]!
366
366
  $corpusEventIds: [ID!]!
@@ -440,7 +440,7 @@ fragment MetricSelector_dimensions on Model {
440
440
  }
441
441
  }
442
442
  }
443
- `}}}();wt.hash="4bd627481610322f2acbcf73dfbfaadc";const bl=C`
443
+ `}}}();$l.hash="4bd627481610322f2acbcf73dfbfaadc";const It=v`
444
444
  margin: var(--px-spacing-lg);
445
445
  display: flex;
446
446
  flex-direction: column;
@@ -458,83 +458,83 @@ fragment MetricSelector_dimensions on Model {
458
458
  margin-inline-start: 0;
459
459
  }
460
460
  }
461
- `;function Hn(n){return e("div",{css:C`
461
+ `;function Zn(n){return e("div",{css:v`
462
462
  max-height: 200px;
463
463
  overflow-y: auto;
464
- `,children:e("pre",{css:C`
464
+ `,children:e("pre",{css:v`
465
465
  padding: var(--px-spacing-lg);
466
466
  color: var(--ac-global-text-color-900);
467
467
  white-space: normal;
468
468
  margin: 0;
469
- `,children:n.children})})}function lc({event:n}){const a=n.retrievedDocuments&&n.retrievedDocuments.length>0,l=!n.id.includes("CORPUS");return s("section",{css:C`
469
+ `,children:n.children})})}function oc({event:n}){const a=n.retrievedDocuments&&n.retrievedDocuments.length>0,t=!n.id.includes("CORPUS");return s("section",{css:v`
470
470
  height: 100%;
471
471
  overflow-y: auto;
472
- `,children:[e(sc,{event:n}),s(Ee,{children:[l?e(de,{id:"prediction",title:"Prediction Details",children:s("dl",{css:bl,children:[n.predictionId!=null&&s("div",{children:[e("dt",{children:"Prediction ID"}),e("dd",{css:C`
472
+ `,children:[e(mc,{event:n}),s(Re,{children:[t?e(de,{id:"prediction",title:"Prediction Details",children:s("dl",{css:It,children:[n.predictionId!=null&&s("div",{children:[e("dt",{children:"Prediction ID"}),e("dd",{css:v`
473
473
  display: flex;
474
474
  align-items: center;
475
- `,children:n.predictionId})]}),n.predictionLabel!=null&&s("div",{children:[e("dt",{children:"Prediction Label"}),e("dd",{children:n.predictionLabel})]}),n.predictionScore!=null&&s("div",{children:[e("dt",{children:"Prediction Score"}),e("dd",{children:n.predictionScore})]}),n.actualLabel!=null&&s("div",{children:[e("dt",{children:"Actual Label"}),e("dd",{children:n.actualLabel})]}),n.actualScore!=null&&s("div",{children:[e("dt",{children:"Actual Score"}),e("dd",{children:n.actualScore})]})]})}):e(de,{id:"document",title:"Document Details",children:e("dl",{css:bl,children:n.predictionId!=null&&s("div",{children:[e("dt",{children:"Document ID"}),e("dd",{css:C`
475
+ `,children:n.predictionId})]}),n.predictionLabel!=null&&s("div",{children:[e("dt",{children:"Prediction Label"}),e("dd",{children:n.predictionLabel})]}),n.predictionScore!=null&&s("div",{children:[e("dt",{children:"Prediction Score"}),e("dd",{children:n.predictionScore})]}),n.actualLabel!=null&&s("div",{children:[e("dt",{children:"Actual Label"}),e("dd",{children:n.actualLabel})]}),n.actualScore!=null&&s("div",{children:[e("dt",{children:"Actual Score"}),e("dd",{children:n.actualScore})]})]})}):e(de,{id:"document",title:"Document Details",children:e("dl",{css:It,children:n.predictionId!=null&&s("div",{children:[e("dt",{children:"Document ID"}),e("dd",{css:v`
476
476
  display: flex;
477
477
  align-items: center;
478
- `,children:n.predictionId})]})})}),e(de,{id:"dimensions",title:"Dimensions",children:e(ic,{dimensions:n.dimensions})}),a&&e(de,{id:"retrievals",title:"Retrieved Documents",titleExtra:e(Me,{variant:"light",children:n.retrievedDocuments.length}),children:e("ul",{css:C`
478
+ `,children:n.predictionId})]})})}),e(de,{id:"dimensions",title:"Dimensions",children:e(cc,{dimensions:n.dimensions})}),a&&e(de,{id:"retrievals",title:"Retrieved Documents",titleExtra:e(Me,{variant:"light",children:n.retrievedDocuments.length}),children:e("ul",{css:v`
479
479
  padding: var(--px-spacing-med);
480
480
  li + li {
481
481
  margin-top: var(--px-spacing-med);
482
482
  }
483
- `,children:n.retrievedDocuments.map(t=>e("li",{children:e(tc,{document:t})},t.id))})})]})]})}function tc({document:n}){return e(F,{borderRadius:"medium",backgroundColor:"light",children:s(h,{direction:"column",children:[e(F,{width:"100%",borderBottomWidth:"thin",borderBottomColor:"dark",children:s(h,{direction:"row",justifyContent:"space-between",margin:"size-100",alignItems:"center",children:[s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(P,{svg:e(I.FileOutline,{})}),s(re,{level:4,children:["document ",n.id]})]}),typeof n.relevance=="number"&&e(Xn,{color:"blue",children:`relevance ${Ya(n.relevance)}`})]})}),e("pre",{css:C`
483
+ `,children:n.retrievedDocuments.map(l=>e("li",{children:e(dc,{document:l})},l.id))})})]})]})}function dc({document:n}){return e(F,{borderRadius:"medium",backgroundColor:"light",children:s(h,{direction:"column",children:[e(F,{width:"100%",borderBottomWidth:"thin",borderBottomColor:"dark",children:s(h,{direction:"row",justifyContent:"space-between",margin:"size-100",alignItems:"center",children:[s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(w,{svg:e(L.FileOutline,{})}),s(se,{level:4,children:["document ",n.id]})]}),typeof n.relevance=="number"&&e(ya,{color:"blue",children:`relevance ${it(n.relevance)}`})]})}),e("pre",{css:v`
484
484
  padding: var(--px-spacing-lg);
485
485
  white-space: normal;
486
486
  margin: 0;
487
- `,children:n.text})]})})}function ic({dimensions:n}){const a=u.useMemo(()=>n.map(i=>({name:i.dimension.name,type:i.dimension.type,value:i.value??"--"})),[n]),l=u.useMemo(()=>[{header:()=>"Name",accessorKey:"name"},{header:()=>"Type",accessorKey:"type"},{header:()=>"Value",accessorKey:"value"}],[]),t=he({columns:l,data:a,getCoreRowModel:ke()});return s("table",{css:We,children:[e("thead",{children:t.getHeaderGroups().map(i=>e("tr",{children:i.headers.map(r=>e("th",{colSpan:r.colSpan,children:r.isPlaceholder?null:e("div",{children:Z(r.column.columnDef.header,r.getContext())})},r.id))},i.id))}),t.getCoreRowModel().rows.length?e("tbody",{children:t.getRowModel().rows.map(i=>e("tr",{children:i.getVisibleCells().map(r=>e("td",{children:Z(r.column.columnDef.cell,r.getContext())},r.id))},i.id))}):e(oc,{})]})}function rc({dataUrl:n}){const a=Ko(n),l=xo(n);return a?e("video",{src:n,controls:!0,css:C`
487
+ `,children:n.text})]})})}function cc({dimensions:n}){const a=u.useMemo(()=>n.map(i=>({name:i.dimension.name,type:i.dimension.type,value:i.value??"--"})),[n]),t=u.useMemo(()=>[{header:()=>"Name",accessorKey:"name"},{header:()=>"Type",accessorKey:"type"},{header:()=>"Value",accessorKey:"value"}],[]),l=ke({columns:t,data:a,getCoreRowModel:be()});return s("table",{css:He,children:[e("thead",{children:l.getHeaderGroups().map(i=>e("tr",{children:i.headers.map(r=>e("th",{colSpan:r.colSpan,children:r.isPlaceholder?null:e("div",{children:X(r.column.columnDef.header,r.getContext())})},r.id))},i.id))}),l.getCoreRowModel().rows.length?e("tbody",{children:l.getRowModel().rows.map(i=>e("tr",{children:i.getVisibleCells().map(r=>e("td",{children:X(r.column.columnDef.cell,r.getContext())},r.id))},i.id))}):e(gc,{})]})}function uc({dataUrl:n}){const a=To(n),t=Do(n);return a?e("video",{src:n,controls:!0,css:v`
488
488
  width: 100%;
489
489
  height: 500px;
490
490
  background-color: black;
491
- `}):l?e("audio",{src:n,controls:!0,autoPlay:!0}):e("img",{src:n,alt:"event image",width:"100%",height:"200px",css:C`
491
+ `}):t?e("audio",{src:n,controls:!0,autoPlay:!0}):e("img",{src:n,alt:"event image",width:"100%",height:"200px",css:v`
492
492
  object-fit: contain;
493
493
  background-color: black;
494
- `})}function sc({event:n}){const a=n.linkToData||void 0,l=n.rawData,t=n.prompt||n.response?{prompt:n.prompt,response:n.response}:null,i=n.documentText;let r=null;return a?r=s(h,{direction:"column",children:[e(rc,{dataUrl:a}),l&&e(Ee,{children:e(de,{id:"raw",title:"Raw Data",children:e(Hn,{children:l})})})]}):i?r=e(Ee,{children:e(de,{id:"document",title:"Document",children:e(Hn,{children:i})})}):t?r=s(Ee,{children:[e(de,{id:"prompt",title:"Prompt",children:e(Hn,{children:t.prompt})}),e(de,{id:"response",title:"Response",children:e(Hn,{children:t.response})})]}):n.rawData&&n.rawData&&n.rawData,r}function oc(){return e("tbody",{className:"is-empty",children:e("tr",{children:e("td",{colSpan:100,css:n=>C`
494
+ `})}function mc({event:n}){const a=n.linkToData||void 0,t=n.rawData,l=n.prompt||n.response?{prompt:n.prompt,response:n.response}:null,i=n.documentText;let r=null;return a?r=s(h,{direction:"column",children:[e(uc,{dataUrl:a}),t&&e(Re,{children:e(de,{id:"raw",title:"Raw Data",children:e(Zn,{children:t})})})]}):i?r=e(Re,{children:e(de,{id:"document",title:"Document",children:e(Zn,{children:i})})}):l?r=s(Re,{children:[e(de,{id:"prompt",title:"Prompt",children:e(Zn,{children:l.prompt})}),e(de,{id:"response",title:"Response",children:e(Zn,{children:l.response})})]}):n.rawData&&n.rawData&&n.rawData,r}function gc(){return e("tbody",{className:"is-empty",children:e("tr",{children:e("td",{colSpan:100,css:n=>v`
495
495
  text-align: center;
496
496
  padding: ${n.spacing.margin24}px ${n.spacing.margin24}px !important;
497
- `,children:e(Hl,{graphicKey:"documents",message:"This embedding has no associated dimensions"})})})})}const At=function(){var n=[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{alias:null,args:null,concreteType:"ExportedFile",kind:"LinkedField",name:"exportedFiles",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"fileName",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ExportSelectionButtonExportsQuery",selections:n,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"ExportSelectionButtonExportsQuery",selections:n},params:{cacheID:"2f7e3554305121746dc799b6a8d120da",id:null,metadata:{},name:"ExportSelectionButtonExportsQuery",operationKind:"query",text:`query ExportSelectionButtonExportsQuery {
497
+ `,children:e(xo,{graphicKey:"documents",message:"This embedding has no associated dimensions"})})})})}const Ol=function(){var n=[{alias:null,args:null,concreteType:"Model",kind:"LinkedField",name:"model",plural:!1,selections:[{alias:null,args:null,concreteType:"ExportedFile",kind:"LinkedField",name:"exportedFiles",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"fileName",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ExportSelectionButtonExportsQuery",selections:n,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"ExportSelectionButtonExportsQuery",selections:n},params:{cacheID:"2f7e3554305121746dc799b6a8d120da",id:null,metadata:{},name:"ExportSelectionButtonExportsQuery",operationKind:"query",text:`query ExportSelectionButtonExportsQuery {
498
498
  model {
499
499
  exportedFiles {
500
500
  fileName
501
501
  }
502
502
  }
503
503
  }
504
- `}}}();At.hash="7e6db431afe21f137e54505645c787f4";const _t=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"eventIds"}],a=[{alias:null,args:[{kind:"Variable",name:"eventIds",variableName:"eventIds"}],concreteType:"ExportedFile",kind:"LinkedField",name:"exportEvents",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"fileName",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExportSelectionButtonMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExportSelectionButtonMutation",selections:a},params:{cacheID:"d370df04ca30a5059288c7aa298239a8",id:null,metadata:{},name:"ExportSelectionButtonMutation",operationKind:"mutation",text:`mutation ExportSelectionButtonMutation(
504
+ `}}}();Ol.hash="7e6db431afe21f137e54505645c787f4";const Ql=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"eventIds"}],a=[{alias:null,args:[{kind:"Variable",name:"eventIds",variableName:"eventIds"}],concreteType:"ExportedFile",kind:"LinkedField",name:"exportEvents",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"fileName",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExportSelectionButtonMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExportSelectionButtonMutation",selections:a},params:{cacheID:"d370df04ca30a5059288c7aa298239a8",id:null,metadata:{},name:"ExportSelectionButtonMutation",operationKind:"mutation",text:`mutation ExportSelectionButtonMutation(
505
505
  $eventIds: [ID!]!
506
506
  ) {
507
507
  exportEvents(eventIds: $eventIds) {
508
508
  fileName
509
509
  }
510
510
  }
511
- `}}}();_t.hash="8b0d6962e2034d4c148d1b9919111d2f";const dc=`import phoenix as px
511
+ `}}}();Ql.hash="8b0d6962e2034d4c148d1b9919111d2f";const pc=`import phoenix as px
512
512
 
513
513
  exports = px.active_session().exports
514
514
  dataframe = exports[-1]
515
- dataframe`,cc=C`
515
+ dataframe`,yc=v`
516
516
  .cm-content {
517
517
  padding: var(--ac-global-dimension-static-size-100);
518
518
  }
519
- `;function uc({value:n}){const{theme:a}=zn(),l=a==="light"?void 0:oa;return e(sa,{value:n,basicSetup:!1,extensions:[sl()],editable:!1,theme:l,css:cc})}function mc(){const n=Q(o=>o.selectedEventIds),[a,l]=D.useMutation(_t),[t,i]=u.useState(null),r=u.useCallback(()=>{a({variables:{eventIds:[...n]},onCompleted:o=>{i(o.exportEvents)}})},[a,n]);return s(U,{children:[e(M,{variant:"default",size:"compact",icon:e(P,{svg:e(Vl,{})}),"aria-label":"Export selection / cluster",loading:l,onClick:r,children:l?"Exporting":"Export"}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>i(null),children:t!=null&&s(H,{title:"Cluster Exports",size:"M",children:[e(ne,{variant:"success",banner:!0,title:"Export succeeded",extra:e(M,{variant:"success",size:"compact",onClick:()=>{window.open(`/exports?filename=${t.fileName}`,"_self")},children:"Download"})}),s("div",{css:C`
519
+ `;function fc({value:n}){const{theme:a}=Qn(),t=a==="light"?void 0:da;return e(oa,{value:n,basicSetup:!1,extensions:[pt()],editable:!1,theme:t,css:yc})}function hc(){const n=Q(o=>o.selectedEventIds),[a,t]=I.useMutation(Ql),[l,i]=u.useState(null),r=u.useCallback(()=>{a({variables:{eventIds:[...n]},onCompleted:o=>{i(o.exportEvents)}})},[a,n]);return s(H,{children:[e(N,{variant:"default",size:"compact",icon:e(w,{svg:e(Gt,{})}),"aria-label":"Export selection / cluster",loading:t,onClick:r,children:t?"Exporting":"Export"}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>i(null),children:l!=null&&s(B,{title:"Cluster Exports",size:"M",children:[e(te,{variant:"success",banner:!0,title:"Export succeeded",extra:e(N,{variant:"success",size:"compact",onClick:()=>{window.open(`/exports?filename=${l.fileName}`,"_self")},children:"Download"})}),s("div",{css:v`
520
520
  display: flex;
521
521
  flex-direction: column;
522
522
  justify-content: space-between;
523
523
  align-items: flex-start;
524
524
  padding: 16px;
525
525
  gap: 16px;
526
- `,children:[e("p",{css:C`
526
+ `,children:[e("p",{css:v`
527
527
  margin: 0;
528
528
  flex: 1 1 auto;
529
- `,children:"You can retrieve your export in your notebook via"}),e(F,{borderColor:"light",borderWidth:"thin",borderRadius:"medium",children:e(uc,{value:dc})})]}),e(Ee,{children:e(de,{id:"all-exports",title:"Latest Exports",children:e(u.Suspense,{fallback:e(fe,{}),children:e(gc,{})})})})]})})]})}function gc(){const n=D.useLazyLoadQuery(At,{},{fetchPolicy:"network-only"});return e($l,{children:n.model.exportedFiles.map((a,l)=>e(zl,{children:s("div",{css:C`
529
+ `,children:"You can retrieve your export in your notebook via"}),e(F,{borderColor:"light",borderWidth:"thin",borderRadius:"medium",children:e(fc,{value:pc})})]}),e(Re,{children:e(de,{id:"all-exports",title:"Latest Exports",children:e(u.Suspense,{fallback:e(he,{}),children:e(kc,{})})})})]})})]})}function kc(){const n=I.useLazyLoadQuery(Ol,{},{fetchPolicy:"network-only"});return e(Jt,{children:n.model.exportedFiles.map((a,t)=>e(Wt,{children:s("div",{css:v`
530
530
  display: flex;
531
531
  flex-direction: row;
532
532
  justify-content: space-between;
533
533
  align-items: center;
534
- `,children:[a.fileName,e(M,{size:"compact","aria-label":"Download",variant:"default",icon:e(P,{svg:e(Vl,{})}),onClick:()=>{window.open(`/exports?filename=${a.fileName}`,"_self")}})]})},l))})}function pc(n){const{getInferencesNameByRole:a}=Ve(),{events:l,onItemSelected:t}=n,i=Q(g=>g.eventIdToDataMap),r=Q(g=>g.eventIdToGroup),o=Q(g=>g.pointGroupColors),c=Q(g=>g.selectionGridSize),d=Q(g=>g.setHoveredEventId);return e("div",{css:C`
534
+ `,children:[a.fileName,e(N,{size:"compact","aria-label":"Download",variant:"default",icon:e(w,{svg:e(Gt,{})}),onClick:()=>{window.open(`/exports?filename=${a.fileName}`,"_self")}})]})},t))})}function bc(n){const{getInferencesNameByRole:a}=Ve(),{events:t,onItemSelected:l}=n,i=Q(g=>g.eventIdToDataMap),r=Q(g=>g.eventIdToGroup),o=Q(g=>g.pointGroupColors),c=Q(g=>g.selectionGridSize),d=Q(g=>g.setHoveredEventId);return e("div",{css:v`
535
535
  flex: 1 1 auto;
536
536
  overflow-y: auto;
537
- `,"data-testid":"grid-view-scroll-container",children:e("ul",{"data-grid-size":c,css:C`
537
+ `,"data-testid":"grid-view-scroll-container",children:e("ul",{"data-grid-size":c,css:v`
538
538
  &[data-grid-size="small"] {
539
539
  --grid-item-min-width: 100px;
540
540
  --grid-item-height: 100px;
@@ -560,7 +560,7 @@ dataframe`,cc=C`
560
560
  min-width: var(--grid-item-min-width);
561
561
  height: var(--grid-item-height);
562
562
  }
563
- `,children:l.map((g,f)=>{const m=i.get(g.id),{rawData:p=null,linkToData:y=null}=(m==null?void 0:m.embeddingMetadata)??{},{predictionLabel:b=null,actualLabel:k=null}=(m==null?void 0:m.eventMetadata)??{},S=Do(g.id),v=a(S),w=r[g.id],L=o[w];return e("li",{children:e(To,{rawData:p,linkToData:y,inferencesName:v,group:w,onClick:()=>{t(g.id)},onMouseOver:()=>{d(g.id)},onMouseOut:()=>{d(null)},color:L,size:c,predictionLabel:b,actualLabel:k,promptAndResponse:g.promptAndResponse,documentText:g.documentText,autoPlay:!1})},f)})})})}function yc({data:n,onPointSelected:a}){const{primaryInferences:l,referenceInferences:t}=Ve(),i=Q(f=>f.metric),[r,o]=u.useState([]),{columns:c,tableData:d}=u.useMemo(()=>{const f=n.filter(L=>L.id.includes("CORPUS")===!1);let m=!1,p=!1,y=!1,b=!1,k=!1;n.forEach(L=>{L.linkToData&&(m=!0),L.rawData&&(p=!0),(L.prompt||L.response)&&(y=!0),L.predictionLabel&&(b=!0),L.actualLabel&&(k=!0)});const S=[];t&&S.push({header:"Inference Set",accessorKey:"id",size:50,cell:({getValue:L})=>e(fc,{id:L(),primaryInferencesName:l.name,referenceInferencesName:(t==null?void 0:t.name)??"reference"})}),m&&S.push({header:"Link",accessorKey:"linkToData",cell:({getValue:L})=>{const A=L();if(typeof A=="string"){const x=A.split("/").pop();return e(je,{href:A,children:x})}return null}}),y?(S.push({header:"Prompt",accessorKey:"prompt",cell:me,size:200}),S.push({header:"Response",accessorKey:"response",cell:me,size:200})):p&&S.push({header:"Raw Data",accessorKey:"rawData"}),b&&S.push({header:"Prediction Label",accessorKey:"predictionLabel",size:50}),k&&S.push({header:"Actual Label",accessorKey:"actualLabel",size:50});const v=[];if(i&&i.type==="dataQuality"){const L=i.dimension.name;v.push({header:i.dimension.name,accessorKey:"metric",cell:Io,sortingFn:"basic"}),f.forEach(A=>{var T;const x=(T=A.dimensions.find(E=>E.dimension.name===L))==null?void 0:T.value;A.metric=x!=null?Number(x):null})}return{columns:[...S,...v,{header:"",id:"view-details",size:50,cell:({row:L})=>e(Lo,{"aria-label":"view point details",onClick:()=>{a(L.original.id)},children:"view details"})}],tableData:f}},[n,a,l,t,i]),g=he({columns:c,data:d,state:{sorting:r},getCoreRowModel:ke(),onSortingChange:o,getSortedRowModel:Rn()});return s("table",{css:We,children:[e("thead",{children:g.getHeaderGroups().map(f=>e("tr",{children:f.headers.map(m=>s("th",{children:[m.isPlaceholder?null:s("div",{className:m.column.getCanSort()?"cursor-pointer":"",onClick:m.column.getToggleSortingHandler(),children:[Z(m.column.columnDef.header,m.getContext()),m.column.getIsSorted()?e(P,{className:"sort-icon",svg:m.column.getIsSorted()==="asc"?e(I.ArrowDownFilled,{}):e(I.ArrowUpFilled,{})}):null]}),e("div",{onMouseDown:m.getResizeHandler(),onTouchStart:m.getResizeHandler(),className:`resizer ${m.column.getIsResizing()?"isResizing":""}`,style:{transform:m.column.getIsResizing()?`translateX(${g.getState().columnSizingInfo.deltaOffset}px)`:""}})]},m.id))},f.id))}),e("tbody",{children:g.getRowModel().rows.map(f=>e("tr",{children:f.getVisibleCells().map(m=>e("td",{style:{width:m.column.getSize()},children:Z(m.column.columnDef.cell,m.getContext())},m.id))},f.id))})]})}function fc({id:n,primaryInferencesName:a,referenceInferencesName:l}){const t=n.includes("PRIMARY"),i=Qd();return s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(wo,{shape:Po.circle,color:i[t?0:1]}),t?a:l]})}const hc=C`
563
+ `,children:t.map((g,f)=>{const m=i.get(g.id),{rawData:p=null,linkToData:y=null}=(m==null?void 0:m.embeddingMetadata)??{},{predictionLabel:k=null,actualLabel:S=null}=(m==null?void 0:m.eventMetadata)??{},C=Io(g.id),b=a(C),T=r[g.id],P=o[T];return e("li",{children:e(Po,{rawData:p,linkToData:y,inferencesName:b,group:T,onClick:()=>{l(g.id)},onMouseOver:()=>{d(g.id)},onMouseOut:()=>{d(null)},color:P,size:c,predictionLabel:k,actualLabel:S,promptAndResponse:g.promptAndResponse,documentText:g.documentText,autoPlay:!1})},f)})})})}function Sc({data:n,onPointSelected:a}){const{primaryInferences:t,referenceInferences:l}=Ve(),i=Q(f=>f.metric),[r,o]=u.useState([]),{columns:c,tableData:d}=u.useMemo(()=>{const f=n.filter(P=>P.id.includes("CORPUS")===!1);let m=!1,p=!1,y=!1,k=!1,S=!1;n.forEach(P=>{P.linkToData&&(m=!0),P.rawData&&(p=!0),(P.prompt||P.response)&&(y=!0),P.predictionLabel&&(k=!0),P.actualLabel&&(S=!0)});const C=[];l&&C.push({header:"Inference Set",accessorKey:"id",size:50,cell:({getValue:P})=>e(vc,{id:P(),primaryInferencesName:t.name,referenceInferencesName:(l==null?void 0:l.name)??"reference"})}),m&&C.push({header:"Link",accessorKey:"linkToData",cell:({getValue:P})=>{const _=P();if(typeof _=="string"){const x=_.split("/").pop();return e(je,{href:_,children:x})}return null}}),y?(C.push({header:"Prompt",accessorKey:"prompt",cell:me,size:200}),C.push({header:"Response",accessorKey:"response",cell:me,size:200})):p&&C.push({header:"Raw Data",accessorKey:"rawData"}),k&&C.push({header:"Prediction Label",accessorKey:"predictionLabel",size:50}),S&&C.push({header:"Actual Label",accessorKey:"actualLabel",size:50});const b=[];if(i&&i.type==="dataQuality"){const P=i.dimension.name;b.push({header:i.dimension.name,accessorKey:"metric",cell:Lo,sortingFn:"basic"}),f.forEach(_=>{var D;const x=(D=_.dimensions.find(A=>A.dimension.name===P))==null?void 0:D.value;_.metric=x!=null?Number(x):null})}return{columns:[...C,...b,{header:"",id:"view-details",size:50,cell:({row:P})=>e(wo,{"aria-label":"view point details",onClick:()=>{a(P.original.id)},children:"view details"})}],tableData:f}},[n,a,t,l,i]),g=ke({columns:c,data:d,state:{sorting:r},getCoreRowModel:be(),onSortingChange:o,getSortedRowModel:Nn()});return s("table",{css:He,children:[e("thead",{children:g.getHeaderGroups().map(f=>e("tr",{children:f.headers.map(m=>s("th",{children:[m.isPlaceholder?null:s("div",{className:m.column.getCanSort()?"cursor-pointer":"",onClick:m.column.getToggleSortingHandler(),children:[X(m.column.columnDef.header,m.getContext()),m.column.getIsSorted()?e(w,{className:"sort-icon",svg:m.column.getIsSorted()==="asc"?e(L.ArrowDownFilled,{}):e(L.ArrowUpFilled,{})}):null]}),e("div",{onMouseDown:m.getResizeHandler(),onTouchStart:m.getResizeHandler(),className:`resizer ${m.column.getIsResizing()?"isResizing":""}`,style:{transform:m.column.getIsResizing()?`translateX(${g.getState().columnSizingInfo.deltaOffset}px)`:""}})]},m.id))},f.id))}),e("tbody",{children:g.getRowModel().rows.map(f=>e("tr",{children:f.getVisibleCells().map(m=>e("td",{style:{width:m.column.getSize()},children:X(m.column.columnDef.cell,m.getContext())},m.id))},f.id))})]})}function vc({id:n,primaryInferencesName:a,referenceInferencesName:t}){const l=n.includes("PRIMARY"),i=Hd();return s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Eo,{shape:_o.circle,color:i[l?0:1]}),l?a:t]})}const Cc=v`
564
564
  width: 100%;
565
565
  height: 100%;
566
566
  position: relative;
@@ -590,37 +590,37 @@ dataframe`,cc=C`
590
590
  }
591
591
  }
592
592
  }
593
- `;function kc({event:n,relevance:a}){return{id:n.eventMetadata.predictionId||"unknown id",text:n.documentText??"empty document",relevance:a}}function bc(){const n=Q(x=>x.selectedEventIds),a=Q(x=>x.setSelectedEventIds),l=Q(x=>x.setSelectedClusterId),t=Q(x=>x.selectionDisplay),[i,r]=Ke.useState(null),{primaryEventIds:o,referenceEventIds:c,corpusEventIds:d}=u.useMemo(()=>{const x=[],T=[],E=[];return n.forEach(R=>{R.includes("PRIMARY")?x.push(R):R.includes("CORPUS")?E.push(R):T.push(R)}),{primaryEventIds:x,referenceEventIds:T,corpusEventIds:E}},[n]),g=D.useLazyLoadQuery(wt,{primaryEventIds:[...o],referenceEventIds:[...c],corpusEventIds:[...d]}),f=u.useMemo(()=>{var R,j,ae,ie,be,Se;const x=((j=(R=g.model)==null?void 0:R.primaryInferences)==null?void 0:j.events)??[],T=((ie=(ae=g.model)==null?void 0:ae.referenceInferences)==null?void 0:ie.events)??[],E=((Se=(be=g.model)==null?void 0:be.corpusInferences)==null?void 0:Se.events)??[];return[...x,...T,...E]},[g]),m=()=>{a(new Set),l(null)},p=Q(x=>x.eventIdToDataMap),y=Q(x=>x.pointData),b=Q(x=>x.selectionSearchText),k=u.useMemo(()=>f.map(x=>{var R,j,ae,ie,be,Se,N;const T=p.get(x.id),E=[];return y!=null&&(T==null?void 0:T.retrievals)!=null&&T.retrievals.forEach(({documentId:z,relevance:_})=>{const $=y[z];$!=null&&E.push(kc({event:$,relevance:_}))}),{id:x.id,predictionId:((R=x.eventMetadata)==null?void 0:R.predictionId)??null,actualLabel:((j=x.eventMetadata)==null?void 0:j.actualLabel)??null,actualScore:((ae=x.eventMetadata)==null?void 0:ae.actualScore)??null,predictionLabel:((ie=x.eventMetadata)==null?void 0:ie.predictionLabel)??null,predictionScore:((be=x.eventMetadata)==null?void 0:be.predictionScore)??null,rawData:(T==null?void 0:T.embeddingMetadata.rawData)??null,linkToData:(T==null?void 0:T.embeddingMetadata.linkToData)??null,dimensions:x.dimensions,prompt:((Se=x.promptAndResponse)==null?void 0:Se.prompt)??null,response:((N=x.promptAndResponse)==null?void 0:N.response)??null,retrievedDocuments:E,documentText:x.documentText??null}}),[f,p,y]),S=u.useMemo(()=>{if(b){const x=b.toLowerCase();return k.filter(T=>{var E,R,j,ae;return T.id.includes(x)||((E=T.documentText)==null?void 0:E.toLowerCase().includes(x))||((R=T.predictionId)==null?void 0:R.includes(x))||((j=T.prompt)==null?void 0:j.toLowerCase().includes(x))||((ae=T.response)==null?void 0:ae.toLowerCase().includes(x))})}return k},[k,b]),v=u.useMemo(()=>{if(b){const x=b.toLowerCase();return f.filter(T=>{var E,R,j,ae,ie,be,Se;return T.id.includes(x)||((E=T.documentText)==null?void 0:E.toLowerCase().includes(x))||((j=(R=T.eventMetadata)==null?void 0:R.predictionId)==null?void 0:j.includes(x))||((ie=(ae=T.promptAndResponse)==null?void 0:ae.prompt)==null?void 0:ie.toLowerCase().includes(x))||((Se=(be=T.promptAndResponse)==null?void 0:be.response)==null?void 0:Se.toLowerCase().includes(x))})}return f},[f,b]),w=u.useMemo(()=>i?k.find(T=>T.id===i)??null:null,[k,i]),L=f.length,A=v.length;return s("section",{css:hc,children:[s("div",{role:"toolbar",css:C`
593
+ `;function Fc({event:n,relevance:a}){return{id:n.eventMetadata.predictionId||"unknown id",text:n.documentText??"empty document",relevance:a}}function Kc(){const n=Q(x=>x.selectedEventIds),a=Q(x=>x.setSelectedEventIds),t=Q(x=>x.setSelectedClusterId),l=Q(x=>x.selectionDisplay),[i,r]=Ke.useState(null),{primaryEventIds:o,referenceEventIds:c,corpusEventIds:d}=u.useMemo(()=>{const x=[],D=[],A=[];return n.forEach(R=>{R.includes("PRIMARY")?x.push(R):R.includes("CORPUS")?A.push(R):D.push(R)}),{primaryEventIds:x,referenceEventIds:D,corpusEventIds:A}},[n]),g=I.useLazyLoadQuery($l,{primaryEventIds:[...o],referenceEventIds:[...c],corpusEventIds:[...d]}),f=u.useMemo(()=>{var R,j,ne,re,Se,ve;const x=((j=(R=g.model)==null?void 0:R.primaryInferences)==null?void 0:j.events)??[],D=((re=(ne=g.model)==null?void 0:ne.referenceInferences)==null?void 0:re.events)??[],A=((ve=(Se=g.model)==null?void 0:Se.corpusInferences)==null?void 0:ve.events)??[];return[...x,...D,...A]},[g]),m=()=>{a(new Set),t(null)},p=Q(x=>x.eventIdToDataMap),y=Q(x=>x.pointData),k=Q(x=>x.selectionSearchText),S=u.useMemo(()=>f.map(x=>{var R,j,ne,re,Se,ve,z;const D=p.get(x.id),A=[];return y!=null&&(D==null?void 0:D.retrievals)!=null&&D.retrievals.forEach(({documentId:V,relevance:E})=>{const O=y[V];O!=null&&A.push(Fc({event:O,relevance:E}))}),{id:x.id,predictionId:((R=x.eventMetadata)==null?void 0:R.predictionId)??null,actualLabel:((j=x.eventMetadata)==null?void 0:j.actualLabel)??null,actualScore:((ne=x.eventMetadata)==null?void 0:ne.actualScore)??null,predictionLabel:((re=x.eventMetadata)==null?void 0:re.predictionLabel)??null,predictionScore:((Se=x.eventMetadata)==null?void 0:Se.predictionScore)??null,rawData:(D==null?void 0:D.embeddingMetadata.rawData)??null,linkToData:(D==null?void 0:D.embeddingMetadata.linkToData)??null,dimensions:x.dimensions,prompt:((ve=x.promptAndResponse)==null?void 0:ve.prompt)??null,response:((z=x.promptAndResponse)==null?void 0:z.response)??null,retrievedDocuments:A,documentText:x.documentText??null}}),[f,p,y]),C=u.useMemo(()=>{if(k){const x=k.toLowerCase();return S.filter(D=>{var A,R,j,ne;return D.id.includes(x)||((A=D.documentText)==null?void 0:A.toLowerCase().includes(x))||((R=D.predictionId)==null?void 0:R.includes(x))||((j=D.prompt)==null?void 0:j.toLowerCase().includes(x))||((ne=D.response)==null?void 0:ne.toLowerCase().includes(x))})}return S},[S,k]),b=u.useMemo(()=>{if(k){const x=k.toLowerCase();return f.filter(D=>{var A,R,j,ne,re,Se,ve;return D.id.includes(x)||((A=D.documentText)==null?void 0:A.toLowerCase().includes(x))||((j=(R=D.eventMetadata)==null?void 0:R.predictionId)==null?void 0:j.includes(x))||((re=(ne=D.promptAndResponse)==null?void 0:ne.prompt)==null?void 0:re.toLowerCase().includes(x))||((ve=(Se=D.promptAndResponse)==null?void 0:Se.response)==null?void 0:ve.toLowerCase().includes(x))})}return f},[f,k]),T=u.useMemo(()=>i?S.find(D=>D.id===i)??null:null,[S,i]),P=f.length,_=b.length;return s("section",{css:Cc,children:[s("div",{role:"toolbar",css:v`
594
594
  position: absolute;
595
595
  top: var(--px-spacing-med);
596
596
  right: var(--px-spacing-lg);
597
597
  display: flex;
598
598
  flex-direction: row-reverse;
599
599
  gap: var(--px-spacing-med);
600
- `,children:[e(M,{variant:"default",size:"compact",icon:e(P,{svg:e(so,{})}),"aria-label":"Clear selection",onClick:m}),e(mc,{})]}),e(Te,{children:s(J,{name:"Selection",children:[e(Sc,{numSelectedEvents:L,numMatchingEvents:A,searchText:b}),t===Gl.list?e("div",{css:C`
600
+ `,children:[e(N,{variant:"default",size:"compact",icon:e(w,{svg:e(oo,{})}),"aria-label":"Clear selection",onClick:m}),e(hc,{})]}),e(Pe,{children:s(J,{name:"Selection",children:[e(xc,{numSelectedEvents:P,numMatchingEvents:_,searchText:k}),l===al.list?e("div",{css:v`
601
601
  flex: 1 1 auto;
602
602
  overflow-y: auto;
603
- `,children:e(yc,{data:S,onPointSelected:r})}):e(pc,{events:v,onItemSelected:r})]})}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>r(null),children:w&&e(H,{title:"Embedding Details",size:"L",children:e(lc,{event:w})})})]})}function Sc({numSelectedEvents:n,numMatchingEvents:a,searchText:l}){const t=Q(g=>g.selectionDisplay),i=Q(g=>g.setSelectionDisplay),r=Q(g=>g.selectionGridSize),o=Q(g=>g.setSelectionGridSize),c=Q(g=>g.setSelectionSearchText),d=u.useMemo(()=>l?`${a}/${n} match "${l}"`:`${n} selected`,[n,a,l]);return e(Xa,{extra:s("div",{css:C`
603
+ `,children:e(Sc,{data:C,onPointSelected:r})}):e(bc,{events:b,onItemSelected:r})]})}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>r(null),children:T&&e(B,{title:"Embedding Details",size:"L",children:e(oc,{event:T})})})]})}function xc({numSelectedEvents:n,numMatchingEvents:a,searchText:t}){const l=Q(g=>g.selectionDisplay),i=Q(g=>g.setSelectionDisplay),r=Q(g=>g.selectionGridSize),o=Q(g=>g.setSelectionGridSize),c=Q(g=>g.setSelectionSearchText),d=u.useMemo(()=>t?`${a}/${n} match "${t}"`:`${n} selected`,[n,a,t]);return e(lt,{extra:s("div",{css:v`
604
604
  display: flex;
605
605
  flex-direction: row;
606
606
  gap: var(--px-spacing-med);
607
- `,children:[e(oo,{placeholder:"Search by text or ID",onChange:g=>{c(g)}}),t===Gl.gallery&&e(Ao,{size:r,onChange:o}),e(_o,{mode:t,onChange:g=>{i(g)}})]}),children:e(K,{children:d})})}const Et=xt;function $y(){const{referenceInferences:n,corpusInferences:a}=Ve(),{timeRange:l}=He(),t=u.useMemo(()=>{let i={};return a!=null?i=Mo():n!=null?i=No():i=Vo(),i={...i,umapParameters:{...window.Config.UMAP}},i},[a,n]);return e(Wl,{initialTimestamp:l.end,children:e(zo,{...t,children:e(vc,{})})})}function vc(){const n=jd(),{primaryInferences:a,referenceInferences:l}=Ve(),t=Q(v=>v.umapParameters),i=Q(v=>v.getHDSCANParameters),r=Q(v=>v.getMetric),o=Q(v=>v.reset),c=Q(v=>v.setLoading),[d,g]=u.useState(!0),[f,m,p]=D.useQueryLoader(Et),{selectedTimestamp:y}=Sa(),b=u.useMemo(()=>y??new Date(a.endTime),[y,a.endTime]),k=u.useMemo(()=>({start:Ml(b,2).toISOString(),end:b.toISOString()}),[b]),S=D.useLazyLoadQuery(Kt,{});return u.useEffect(()=>{o(),c(!0);const v=r();return m({id:n,timeRange:k,...t,...i(),fetchDataQualityMetric:v.type==="dataQuality",fetchPerformanceMetric:v.type==="performance",dataQualityMetricColumnName:v.type==="dataQuality"?v.dimension.name:null,performanceMetric:v.type==="performance"?v.metric:"accuracyScore"},{fetchPolicy:"network-only"}),()=>{p()}},[c,o,n,m,p,t,i,r,k]),s("main",{css:C`
607
+ `,children:[e(co,{placeholder:"Search by text or ID",onChange:g=>{c(g)}}),l===al.gallery&&e(Ao,{size:r,onChange:o}),e(Ro,{mode:l,onChange:g=>{i(g)}})]}),children:e(K,{children:d})})}const jl=Al;function Zy(){const{referenceInferences:n,corpusInferences:a}=Ve(),{timeRange:t}=Ue(),l=u.useMemo(()=>{let i={};return a!=null?i=zo():n!=null?i=Vo():i=$o(),i={...i,umapParameters:{...window.Config.UMAP}},i},[a,n]);return e(tl,{initialTimestamp:t.end,children:e(Oo,{...l,children:e(Tc,{})})})}function Tc(){const n=Gd(),{primaryInferences:a,referenceInferences:t}=Ve(),l=Q(b=>b.umapParameters),i=Q(b=>b.getHDSCANParameters),r=Q(b=>b.getMetric),o=Q(b=>b.reset),c=Q(b=>b.setLoading),[d,g]=u.useState(!0),[f,m,p]=I.useQueryLoader(jl),{selectedTimestamp:y}=Fa(),k=u.useMemo(()=>y??new Date(a.endTime),[y,a.endTime]),S=u.useMemo(()=>({start:Ut(k,2).toISOString(),end:k.toISOString()}),[k]),C=I.useLazyLoadQuery(El,{});return u.useEffect(()=>{o(),c(!0);const b=r();return m({id:n,timeRange:S,...l,...i(),fetchDataQualityMetric:b.type==="dataQuality",fetchPerformanceMetric:b.type==="performance",dataQualityMetricColumnName:b.type==="dataQuality"?b.dimension.name:null,performanceMetric:b.type==="performance"?b.metric:"accuracyScore"},{fetchPolicy:"network-only"}),()=>{p()}},[c,o,n,m,p,l,i,r,S]),s("main",{css:v`
608
608
  flex: 1 1 auto;
609
609
  display: flex;
610
610
  flex-direction: column;
611
611
  overflow: hidden;
612
- `,children:[e(Lc,{}),s(Xa,{extra:s(h,{direction:"row",justifyContent:"center",alignItems:"center",gap:"size-100",children:[e(Mn,{onChange:v=>{g(v)},defaultSelected:!0,labelPlacement:"start",children:"Show Timeseries"}),e(Ud,{})]}),children:[e(Ql,{}),l?e(jl,{inferencesRole:"reference",timeRange:{start:new Date(l.startTime),end:new Date(l.endTime)}}):null,e(Wd,{model:S.model})]}),s(Xe,{direction:"vertical",children:[d?s(U,{children:[e(ue,{defaultSize:20,collapsible:!0,order:1,children:e(u.Suspense,{fallback:e(fe,{}),children:e(ec,{embeddingDimensionId:n})})}),e(Ye,{css:Kn})]}):null,e(ue,{order:2,children:e("div",{css:C`
612
+ `,children:[e(Ac,{}),s(lt,{extra:s(h,{direction:"row",justifyContent:"center",alignItems:"center",gap:"size-100",children:[e(zn,{onChange:b=>{g(b)},defaultSelected:!0,labelPlacement:"start",children:"Show Timeseries"}),e(Jd,{})]}),children:[e(Zt,{}),t?e(Xt,{inferencesRole:"reference",timeRange:{start:new Date(t.startTime),end:new Date(t.endTime)}}):null,e(ec,{model:C.model})]}),s(Xe,{direction:"vertical",children:[d?s(H,{children:[e(ue,{defaultSize:20,collapsible:!0,order:1,children:e(u.Suspense,{fallback:e(he,{}),children:e(ic,{embeddingDimensionId:n})})}),e(Ye,{css:Kn})]}):null,e(ue,{order:2,children:e("div",{css:v`
613
613
  width: 100%;
614
614
  height: 100%;
615
615
  position: relative;
616
- `,children:e(u.Suspense,{fallback:e($o,{}),children:f?e(Fc,{queryReference:f}):null})})})]})]})}function Cc(n){if(n.__typename!=="Point3D")throw new Error(`Expected Point3D but got ${n.__typename} for coordinates`);return[n.x,n.y,n.z]}function Fc({queryReference:n}){const a=D.usePreloadedQuery(Et,n),l=u.useMemo(()=>{var g,f;return((f=(g=a.embedding)==null?void 0:g.UMAPPoints)==null?void 0:f.data)??[]},[a]),t=u.useMemo(()=>{var g,f;return((f=(g=a.embedding)==null?void 0:g.UMAPPoints)==null?void 0:f.referenceData)??[]},[a]),i=u.useMemo(()=>{var g,f;return((f=(g=a.embedding)==null?void 0:g.UMAPPoints)==null?void 0:f.corpusData)??[]},[a]),r=u.useMemo(()=>{var g,f;return((f=(g=a.embedding)==null?void 0:g.UMAPPoints)==null?void 0:f.contextRetrievals)??[]},[a]),o=u.useMemo(()=>[...l,...t,...i].map(f=>({...f,position:Cc(f.coordinates),metaData:{id:f.eventId}})),[t,l,i]),c=Q(g=>g.setInitialData),d=Q(g=>g.setClusters);return Ns(()=>{var f,m;const g=((m=(f=a.embedding)==null?void 0:f.UMAPPoints)==null?void 0:m.clusters)||[];c({points:o,clusters:g,retrievals:r})},[o,n,r,c,d]),e("div",{css:C`
616
+ `,children:e(u.Suspense,{fallback:e(Qo,{}),children:f?e(Ic,{queryReference:f}):null})})})]})]})}function Dc(n){if(n.__typename!=="Point3D")throw new Error(`Expected Point3D but got ${n.__typename} for coordinates`);return[n.x,n.y,n.z]}function Ic({queryReference:n}){const a=I.usePreloadedQuery(jl,n),t=u.useMemo(()=>{var g,f;return((f=(g=a.embedding)==null?void 0:g.UMAPPoints)==null?void 0:f.data)??[]},[a]),l=u.useMemo(()=>{var g,f;return((f=(g=a.embedding)==null?void 0:g.UMAPPoints)==null?void 0:f.referenceData)??[]},[a]),i=u.useMemo(()=>{var g,f;return((f=(g=a.embedding)==null?void 0:g.UMAPPoints)==null?void 0:f.corpusData)??[]},[a]),r=u.useMemo(()=>{var g,f;return((f=(g=a.embedding)==null?void 0:g.UMAPPoints)==null?void 0:f.contextRetrievals)??[]},[a]),o=u.useMemo(()=>[...t,...l,...i].map(f=>({...f,position:Dc(f.coordinates),metaData:{id:f.eventId}})),[l,t,i]),c=Q(g=>g.setInitialData),d=Q(g=>g.setClusters);return Vs(()=>{var f,m;const g=((m=(f=a.embedding)==null?void 0:f.UMAPPoints)==null?void 0:m.clusters)||[];c({points:o,clusters:g,retrievals:r})},[o,n,r,c,d]),e("div",{css:v`
617
617
  flex: 1 1 auto;
618
618
  display: flex;
619
619
  flex-direction: row;
620
620
  align-items: stretch;
621
621
  width: 100%;
622
622
  height: 100%;
623
- `,"data-testid":"point-cloud-display",children:s(Xe,{direction:"horizontal",children:[e(ue,{id:"embedding-left",defaultSize:15,maxSize:30,minSize:10,collapsible:!0,children:s(Xe,{autoSaveId:"embedding-controls-vertical",direction:"vertical",children:[e(ue,{css:C`
623
+ `,"data-testid":"point-cloud-display",children:s(Xe,{direction:"horizontal",children:[e(ue,{id:"embedding-left",defaultSize:15,maxSize:30,minSize:10,collapsible:!0,children:s(Xe,{autoSaveId:"embedding-controls-vertical",direction:"vertical",children:[e(ue,{css:v`
624
624
  display: flex;
625
625
  flex-direction: column;
626
626
  .ac-tabs {
@@ -641,7 +641,7 @@ dataframe`,cc=C`
641
641
  }
642
642
  }
643
643
  }
644
- `,children:e(Tc,{})}),e(Ye,{css:Kn}),e(ue,{css:C`
644
+ `,children:e(_c,{})}),e(Ye,{css:Kn}),e(ue,{css:v`
645
645
  .ac-tabs {
646
646
  height: 100%;
647
647
  overflow: hidden;
@@ -650,27 +650,27 @@ dataframe`,cc=C`
650
650
  overflow-y: auto;
651
651
  }
652
652
  }
653
- `,children:s(Te,{children:[e(J,{name:"Display",children:e(Oo,{})}),e(J,{name:"Hyperparameters",children:e(Qo,{})})]})})]})}),e(Ye,{css:jo}),e(ue,{children:s("div",{css:C`
653
+ `,children:s(Pe,{children:[e(J,{name:"Display",children:e(jo,{})}),e(J,{name:"Hyperparameters",children:e(qo,{})})]})})]})}),e(Ye,{css:Uo}),e(ue,{children:s("div",{css:v`
654
654
  position: relative;
655
655
  width: 100%;
656
656
  height: 100%;
657
- `,children:[e(Kc,{}),e(qo,{})]})})]})})}function Kc(){return Q(a=>a.selectedEventIds).size===0?null:e("div",{css:C`
657
+ `,children:[e(Pc,{}),e(Bo,{})]})})]})})}function Pc(){return Q(a=>a.selectedEventIds).size===0?null:e("div",{css:v`
658
658
  position: absolute;
659
659
  top: 0;
660
660
  left: 0;
661
661
  bottom: 0;
662
662
  right: 0;
663
- `,"data-testid":"selection-panel",children:s(Xe,{direction:"vertical",children:[e(ue,{}),e(Ye,{css:Kn,style:{zIndex:1}}),e(ue,{id:"embedding-point-selection",defaultSize:40,minSize:20,order:2,style:{zIndex:1},children:e(xc,{children:e(u.Suspense,{fallback:e(fe,{}),children:e(bc,{})})})})]})})}function xc(n){return e("div",{css:C`
663
+ `,"data-testid":"selection-panel",children:s(Xe,{direction:"vertical",children:[e(ue,{}),e(Ye,{css:Kn,style:{zIndex:1}}),e(ue,{id:"embedding-point-selection",defaultSize:40,minSize:20,order:2,style:{zIndex:1},children:e(Lc,{children:e(u.Suspense,{fallback:e(he,{}),children:e(Kc,{})})})})]})})}function Lc(n){return e("div",{css:v`
664
664
  background-color: var(--ac-global-color-grey-75);
665
665
  width: 100%;
666
666
  height: 100%;
667
- `,children:n.children})}const Dc=1,Tc=Ke.memo(function(){const{referenceInferences:a}=Ve(),l=Q(m=>m.clusters),t=Q(m=>m.selectedClusterId),i=Q(m=>m.metric),r=Q(m=>m.setSelectedClusterId),o=Q(m=>m.setSelectedEventIds),c=Q(m=>m.setHighlightedClusterId),d=Q(m=>m.setClusterColorMode),g=a==null||i.type==="drift",f=u.useCallback(m=>{d(m===Dc?yl.highlight:yl.default)},[d]);return s(Te,{onChange:f,children:[e(J,{name:"Clusters",extra:e(Me,{children:l.length}),children:s(h,{direction:"column",height:"100%",children:[e(F,{borderBottomColor:"dark",borderBottomWidth:"thin",backgroundColor:"dark",flex:"none",padding:"size-50",children:e(h,{direction:"row",justifyContent:"end",children:e(qd,{})})}),e(F,{flex:"1 1 auto",overflow:"auto",children:e("ul",{css:m=>C`
667
+ `,children:n.children})}const wc=1,_c=Ke.memo(function(){const{referenceInferences:a}=Ve(),t=Q(m=>m.clusters),l=Q(m=>m.selectedClusterId),i=Q(m=>m.metric),r=Q(m=>m.setSelectedClusterId),o=Q(m=>m.setSelectedEventIds),c=Q(m=>m.setHighlightedClusterId),d=Q(m=>m.setClusterColorMode),g=a==null||i.type==="drift",f=u.useCallback(m=>{d(m===wc?Kt.highlight:Kt.default)},[d]);return s(Pe,{onChange:f,children:[e(J,{name:"Clusters",extra:e(Me,{children:t.length}),children:s(h,{direction:"column",height:"100%",children:[e(F,{borderBottomColor:"dark",borderBottomWidth:"thin",backgroundColor:"dark",flex:"none",padding:"size-50",children:e(h,{direction:"row",justifyContent:"end",children:e(Wd,{})})}),e(F,{flex:"1 1 auto",overflow:"auto",children:e("ul",{css:m=>v`
668
668
  flex: 1 1 auto;
669
669
  display: flex;
670
670
  flex-direction: column;
671
671
  gap: ${m.spacing.margin8}px;
672
672
  margin: ${m.spacing.margin8}px;
673
- `,children:l.map(m=>e("li",{children:e(Eo,{clusterId:m.id,numPoints:m.eventIds.length,isSelected:t===m.id,driftRatio:m.driftRatio,primaryToCorpusRatio:m.primaryToCorpusRatio,primaryMetricValue:m.primaryMetricValue,referenceMetricValue:m.referenceMetricValue,metricName:Ic(i),hideReference:g,onClick:()=>{t!==m.id?(r(m.id),o(new Set(m.eventIds))):(r(null),o(new Set))},onMouseEnter:()=>{c(m.id)},onMouseLeave:()=>{c(null)}})},m.id))})})]})}),e(J,{name:"Configuration",children:e(F,{overflow:"auto",height:"100%",children:e(Ro,{})})})]})});function Ic(n){const{type:a,metric:l}=n;switch(a){case"dataQuality":return`${n.dimension.name} avg`;case"drift":{switch(l){case"euclideanDistance":return"Cluster Drift";default:Ce()}break}case"performance":return hn(l);case"retrieval":{switch(l){case"queryDistance":return"% Query";default:Ce()}break}default:Ce()}}function Lc(){const{notifyError:n}=ql(),a=Q(t=>t.errorMessage),l=Q(t=>t.setErrorMessage);return u.useEffect(()=>{a!==null&&n({title:"An error occurred",message:a,action:{text:"Dismiss",onClick:()=>{l(null)}}})},[a,n,l]),null}const Rt=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"embeddingLoaderQuery",selections:[{alias:"embedding",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[l,t],type:"EmbeddingDimension",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"embeddingLoaderQuery",selections:[{alias:"embedding",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[t],type:"EmbeddingDimension",abstractKey:null}],storageKey:null}]},params:{cacheID:"cff0ac130f1ef79784f7bef4161ac60d",id:null,metadata:{},name:"embeddingLoaderQuery",operationKind:"query",text:`query embeddingLoaderQuery(
673
+ `,children:t.map(m=>e("li",{children:e(Mo,{clusterId:m.id,numPoints:m.eventIds.length,isSelected:l===m.id,driftRatio:m.driftRatio,primaryToCorpusRatio:m.primaryToCorpusRatio,primaryMetricValue:m.primaryMetricValue,referenceMetricValue:m.referenceMetricValue,metricName:Ec(i),hideReference:g,onClick:()=>{l!==m.id?(r(m.id),o(new Set(m.eventIds))):(r(null),o(new Set))},onMouseEnter:()=>{c(m.id)},onMouseLeave:()=>{c(null)}})},m.id))})})]})}),e(J,{name:"Configuration",children:e(F,{overflow:"auto",height:"100%",children:e(No,{})})})]})});function Ec(n){const{type:a,metric:t}=n;switch(a){case"dataQuality":return`${n.dimension.name} avg`;case"drift":{switch(t){case"euclideanDistance":return"Cluster Drift";default:ye()}break}case"performance":return fn(t);case"retrieval":{switch(t){case"queryDistance":return"% Query";default:ye()}break}default:ye()}}function Ac(){const{notifyError:n}=Yt(),a=Q(l=>l.errorMessage),t=Q(l=>l.setErrorMessage);return u.useEffect(()=>{a!==null&&n({title:"An error occurred",message:a,action:{text:"Dismiss",onClick:()=>{t(null)}}})},[a,n,t]),null}const ql=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"embeddingLoaderQuery",selections:[{alias:"embedding",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[t,l],type:"EmbeddingDimension",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"embeddingLoaderQuery",selections:[{alias:"embedding",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[l],type:"EmbeddingDimension",abstractKey:null}],storageKey:null}]},params:{cacheID:"cff0ac130f1ef79784f7bef4161ac60d",id:null,metadata:{},name:"embeddingLoaderQuery",operationKind:"query",text:`query embeddingLoaderQuery(
674
674
  $id: GlobalID!
675
675
  ) {
676
676
  embedding: node(id: $id) {
@@ -683,7 +683,7 @@ dataframe`,cc=C`
683
683
  id
684
684
  }
685
685
  }
686
- `}}}();Rt.hash="c049e57d92943f64b5e751e0daa89dc8";async function Oy(n){const{embeddingDimensionId:a}=n.params;return D.fetchQuery(xe,Rt,{id:a}).toPromise()}const Mt=function(){var n={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},a={defaultValue:null,kind:"LocalArgument",name:"hasReference"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"Variable",name:"timeRange",variableName:"timeRange"},o=[r],c=[{kind:"Variable",name:"hasReference",variableName:"hasReference"},r],d={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},g=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null}],f={kind:"Literal",name:"metric",value:"cardinality"},m={kind:"Literal",name:"metric",value:"percentEmpty"},p={kind:"Literal",name:"inferencesRole",value:"reference"};return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"DimensionPageQuery",selections:[{alias:"dimension",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[i,{args:o,kind:"FragmentSpread",name:"DimensionSegmentsBarChart_dimension"},{args:o,kind:"FragmentSpread",name:"DimensionCountStats_dimension"},{args:o,kind:"FragmentSpread",name:"DimensionDriftStats_dimension"},{args:c,kind:"FragmentSpread",name:"DimensionCardinalityStats_dimension"},{args:c,kind:"FragmentSpread",name:"DimensionPercentEmptyStats_dimension"},{args:o,kind:"FragmentSpread",name:"DimensionQuantilesStats_dimension"}],type:"Dimension",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,l,a],kind:"Operation",name:"DimensionPageQuery",selections:[{alias:"dimension",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[d,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"primaryTimeRange",variableName:"timeRange"}],concreteType:"Segments",kind:"LinkedField",name:"segmentsComparison",plural:!1,selections:[{alias:null,args:null,concreteType:"Segment",kind:"LinkedField",name:"segments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bin",plural:!1,selections:[d,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],type:"NominalBin",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"NumericRange",kind:"LinkedField",name:"range",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"start",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end",storageKey:null}],storageKey:null}],type:"IntervalBin",abstractKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"counts",plural:!1,selections:g,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"totalCounts",plural:!1,selections:g,storageKey:null}],storageKey:null},{alias:"count",args:[{kind:"Literal",name:"metric",value:"count"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"psi",args:[{kind:"Literal",name:"metric",value:"psi"},r],kind:"ScalarField",name:"driftMetric",storageKey:null},{alias:"cardinality",args:[f,r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"percentEmpty",args:[m,r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p99",args:[{kind:"Literal",name:"metric",value:"p99"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p75",args:[{kind:"Literal",name:"metric",value:"p75"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p50",args:[{kind:"Literal",name:"metric",value:"p50"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p25",args:[{kind:"Literal",name:"metric",value:"p25"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p1",args:[{kind:"Literal",name:"metric",value:"p01"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{condition:"hasReference",kind:"Condition",passingValue:!0,selections:[{alias:"referenceCardinality",args:[p,f],kind:"ScalarField",name:"dataQualityMetric",storageKey:'dataQualityMetric(inferencesRole:"reference",metric:"cardinality")'},{alias:"referencePercentEmpty",args:[p,m],kind:"ScalarField",name:"dataQualityMetric",storageKey:'dataQualityMetric(inferencesRole:"reference",metric:"percentEmpty")'}]}],type:"Dimension",abstractKey:null}],storageKey:null}]},params:{cacheID:"2ad937e56d4647309b9d78ac11f57265",id:null,metadata:{},name:"DimensionPageQuery",operationKind:"query",text:`query DimensionPageQuery(
686
+ `}}}();ql.hash="c049e57d92943f64b5e751e0daa89dc8";async function Xy(n){const{embeddingDimensionId:a}=n.params;return I.fetchQuery(xe,ql,{id:a}).toPromise()}const Ul=function(){var n={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},a={defaultValue:null,kind:"LocalArgument",name:"hasReference"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"Variable",name:"timeRange",variableName:"timeRange"},o=[r],c=[{kind:"Variable",name:"hasReference",variableName:"hasReference"},r],d={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},g=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null}],f={kind:"Literal",name:"metric",value:"cardinality"},m={kind:"Literal",name:"metric",value:"percentEmpty"},p={kind:"Literal",name:"inferencesRole",value:"reference"};return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"DimensionPageQuery",selections:[{alias:"dimension",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[i,{args:o,kind:"FragmentSpread",name:"DimensionSegmentsBarChart_dimension"},{args:o,kind:"FragmentSpread",name:"DimensionCountStats_dimension"},{args:o,kind:"FragmentSpread",name:"DimensionDriftStats_dimension"},{args:c,kind:"FragmentSpread",name:"DimensionCardinalityStats_dimension"},{args:c,kind:"FragmentSpread",name:"DimensionPercentEmptyStats_dimension"},{args:o,kind:"FragmentSpread",name:"DimensionQuantilesStats_dimension"}],type:"Dimension",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a],kind:"Operation",name:"DimensionPageQuery",selections:[{alias:"dimension",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[d,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"primaryTimeRange",variableName:"timeRange"}],concreteType:"Segments",kind:"LinkedField",name:"segmentsComparison",plural:!1,selections:[{alias:null,args:null,concreteType:"Segment",kind:"LinkedField",name:"segments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bin",plural:!1,selections:[d,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],type:"NominalBin",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"NumericRange",kind:"LinkedField",name:"range",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"start",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end",storageKey:null}],storageKey:null}],type:"IntervalBin",abstractKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"counts",plural:!1,selections:g,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"totalCounts",plural:!1,selections:g,storageKey:null}],storageKey:null},{alias:"count",args:[{kind:"Literal",name:"metric",value:"count"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"psi",args:[{kind:"Literal",name:"metric",value:"psi"},r],kind:"ScalarField",name:"driftMetric",storageKey:null},{alias:"cardinality",args:[f,r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"percentEmpty",args:[m,r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p99",args:[{kind:"Literal",name:"metric",value:"p99"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p75",args:[{kind:"Literal",name:"metric",value:"p75"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p50",args:[{kind:"Literal",name:"metric",value:"p50"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p25",args:[{kind:"Literal",name:"metric",value:"p25"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p1",args:[{kind:"Literal",name:"metric",value:"p01"},r],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{condition:"hasReference",kind:"Condition",passingValue:!0,selections:[{alias:"referenceCardinality",args:[p,f],kind:"ScalarField",name:"dataQualityMetric",storageKey:'dataQualityMetric(inferencesRole:"reference",metric:"cardinality")'},{alias:"referencePercentEmpty",args:[p,m],kind:"ScalarField",name:"dataQualityMetric",storageKey:'dataQualityMetric(inferencesRole:"reference",metric:"percentEmpty")'}]}],type:"Dimension",abstractKey:null}],storageKey:null}]},params:{cacheID:"2ad937e56d4647309b9d78ac11f57265",id:null,metadata:{},name:"DimensionPageQuery",operationKind:"query",text:`query DimensionPageQuery(
687
687
  $dimensionId: GlobalID!
688
688
  $timeRange: TimeRange!
689
689
  $hasReference: Boolean!
@@ -764,7 +764,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
764
764
  }
765
765
  }
766
766
  }
767
- `}}}();Mt.hash="d194bfd656408e8ba7cb427ddc80fc85";const Nt=function(){var n={kind:"Literal",name:"metric",value:"cardinality"};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"hasReference"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionCardinalityStats_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"cardinality",args:[n,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{condition:"hasReference",kind:"Condition",passingValue:!0,selections:[{alias:"referenceCardinality",args:[{kind:"Literal",name:"inferencesRole",value:"reference"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:'dataQualityMetric(inferencesRole:"reference",metric:"cardinality")'}]}],type:"Dimension",abstractKey:null}}();Nt.hash="8b4edef350e4df49e799afa70ca34918";function Pc(n){const a=D.useFragment(Nt,n.dimension);return s(U,{children:[e(K,{elementType:"h3",textSize:"small",color:"text-700",children:"Cardinality"}),e(K,{textSize:"xlarge",children:bn(a.cardinality)}),a.referenceCardinality!=null&&e(K,{textSize:"medium",color:"designationPurple",children:bn(a.referenceCardinality)})]})}const Vt=function(){var n={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},a={defaultValue:null,kind:"LocalArgument",name:"granularity"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"InlineFragment",selections:[{alias:"cardinalityTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"granularity"},{kind:"Literal",name:"metric",value:"cardinality"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"DimensionCardinalityTimeSeriesQuery",selections:[{alias:"dimension",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,l,a],kind:"Operation",name:"DimensionCardinalityTimeSeriesQuery",selections:[{alias:"dimension",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i,r],storageKey:null}]},params:{cacheID:"f53e5ac5e0bfd6a0a6c50b761223a617",id:null,metadata:{},name:"DimensionCardinalityTimeSeriesQuery",operationKind:"query",text:`query DimensionCardinalityTimeSeriesQuery(
767
+ `}}}();Ul.hash="d194bfd656408e8ba7cb427ddc80fc85";const Bl=function(){var n={kind:"Literal",name:"metric",value:"cardinality"};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"hasReference"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionCardinalityStats_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"cardinality",args:[n,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{condition:"hasReference",kind:"Condition",passingValue:!0,selections:[{alias:"referenceCardinality",args:[{kind:"Literal",name:"inferencesRole",value:"reference"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:'dataQualityMetric(inferencesRole:"reference",metric:"cardinality")'}]}],type:"Dimension",abstractKey:null}}();Bl.hash="8b4edef350e4df49e799afa70ca34918";function Rc(n){const a=I.useFragment(Bl,n.dimension);return s(H,{children:[e(K,{elementType:"h3",textSize:"small",color:"text-700",children:"Cardinality"}),e(K,{textSize:"xlarge",children:kn(a.cardinality)}),a.referenceCardinality!=null&&e(K,{textSize:"medium",color:"designationPurple",children:kn(a.referenceCardinality)})]})}const Hl=function(){var n={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},a={defaultValue:null,kind:"LocalArgument",name:"granularity"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"InlineFragment",selections:[{alias:"cardinalityTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"granularity"},{kind:"Literal",name:"metric",value:"cardinality"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"DimensionCardinalityTimeSeriesQuery",selections:[{alias:"dimension",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a],kind:"Operation",name:"DimensionCardinalityTimeSeriesQuery",selections:[{alias:"dimension",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i,r],storageKey:null}]},params:{cacheID:"f53e5ac5e0bfd6a0a6c50b761223a617",id:null,metadata:{},name:"DimensionCardinalityTimeSeriesQuery",operationKind:"query",text:`query DimensionCardinalityTimeSeriesQuery(
768
768
  $dimensionId: GlobalID!
769
769
  $timeRange: TimeRange!
770
770
  $granularity: Granularity!
@@ -782,7 +782,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
782
782
  }
783
783
  }
784
784
  }
785
- `}}}();Vt.hash="88ce04bb2022d5e2bc75c663abd7e5de";const da={top:25,right:18,left:18,bottom:5},wc=new Intl.NumberFormat([],{maximumFractionDigits:2}),zt=()=>{const{gray300:n}=Ge();return{color:n}};function Ac({active:n,payload:a,label:l}){var i;const{color:t}=zt();if(n&&a&&a.length){const r=((i=a[0])==null?void 0:i.value)??null,o=typeof r=="number"?wc.format(r):"--";return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(l))}`}),e(pe,{color:t,name:"Cardinality",value:o}),e(va,{})]})}return null}function _c({dimensionId:n}){var c;const{timeRange:a}=He(),l=$n(a),t=D.useLazyLoadQuery(Vt,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},granularity:l}),{color:i}=zt(),r=((c=t.dimension.cardinalityTimeSeries)==null?void 0:c.data.map(d=>({timestamp:new Date(d.timestamp).valueOf(),value:d.value})))||[],o=On({samplingIntervalMinutes:l.samplingIntervalMinutes});return e(sn,{width:"100%",height:"100%",children:s(ra,{data:r,margin:da,syncId:"dimensionDetails",children:[e("defs",{children:s("linearGradient",{id:"cardinalityColorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:i,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:i,stopOpacity:0})]})}),e(on,{...Qn,tickFormatter:d=>o(new Date(d))}),e(Ne,{stroke:ge.colors.gray200,label:{value:"Cardinality",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(Ac,{})}),e(Yn,{type:"monotone",dataKey:"value",stroke:i,fillOpacity:1,fill:"url(#cardinalityColorUv)"})]})})}const $t={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionCountStats_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"count",args:[{kind:"Literal",name:"metric",value:"count"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],kind:"ScalarField",name:"dataQualityMetric",storageKey:null}],type:"Dimension",abstractKey:null};$t.hash="6dccac51f3fb0853276677c692af5a43";function Ec(n){const l=D.useFragment($t,n.dimension).count??0;return s(U,{children:[e(K,{elementType:"h3",textSize:"small",color:"text-700",children:"Total Count"}),e(K,{textSize:"xlarge",children:bn(l)})]})}const Ot=function(){var n={defaultValue:null,kind:"LocalArgument",name:"countGranularity"},a={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"InlineFragment",selections:[{alias:"trafficTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"countGranularity"},{kind:"Literal",name:"metric",value:"count"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"DimensionCountTimeSeriesQuery",selections:[{alias:"embedding",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,l,n],kind:"Operation",name:"DimensionCountTimeSeriesQuery",selections:[{alias:"embedding",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i,r],storageKey:null}]},params:{cacheID:"1f9eff6d8d453148844edae32b844df7",id:null,metadata:{},name:"DimensionCountTimeSeriesQuery",operationKind:"query",text:`query DimensionCountTimeSeriesQuery(
785
+ `}}}();Hl.hash="88ce04bb2022d5e2bc75c663abd7e5de";const ca={top:25,right:18,left:18,bottom:5},Mc=new Intl.NumberFormat([],{maximumFractionDigits:2}),Gl=()=>{const{gray300:n}=Be();return{color:n}};function Nc({active:n,payload:a,label:t}){var i;const{color:l}=Gl();if(n&&a&&a.length){const r=((i=a[0])==null?void 0:i.value)??null,o=typeof r=="number"?Mc.format(r):"--";return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(t))}`}),e(pe,{color:l,name:"Cardinality",value:o}),e(Ka,{})]})}return null}function zc({dimensionId:n}){var c;const{timeRange:a}=Ue(),t=jn(a),l=I.useLazyLoadQuery(Hl,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},granularity:t}),{color:i}=Gl(),r=((c=l.dimension.cardinalityTimeSeries)==null?void 0:c.data.map(d=>({timestamp:new Date(d.timestamp).valueOf(),value:d.value})))||[],o=qn({samplingIntervalMinutes:t.samplingIntervalMinutes});return e(sn,{width:"100%",height:"100%",children:s(sa,{data:r,margin:ca,syncId:"dimensionDetails",children:[e("defs",{children:s("linearGradient",{id:"cardinalityColorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:i,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:i,stopOpacity:0})]})}),e(on,{...Un,tickFormatter:d=>o(new Date(d))}),e(ze,{stroke:ge.colors.gray200,label:{value:"Cardinality",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(Nc,{})}),e(aa,{type:"monotone",dataKey:"value",stroke:i,fillOpacity:1,fill:"url(#cardinalityColorUv)"})]})})}const Wl={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionCountStats_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"count",args:[{kind:"Literal",name:"metric",value:"count"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],kind:"ScalarField",name:"dataQualityMetric",storageKey:null}],type:"Dimension",abstractKey:null};Wl.hash="6dccac51f3fb0853276677c692af5a43";function Vc(n){const t=I.useFragment(Wl,n.dimension).count??0;return s(H,{children:[e(K,{elementType:"h3",textSize:"small",color:"text-700",children:"Total Count"}),e(K,{textSize:"xlarge",children:kn(t)})]})}const Jl=function(){var n={defaultValue:null,kind:"LocalArgument",name:"countGranularity"},a={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"InlineFragment",selections:[{alias:"trafficTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"countGranularity"},{kind:"Literal",name:"metric",value:"count"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"DimensionCountTimeSeriesQuery",selections:[{alias:"embedding",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,t,n],kind:"Operation",name:"DimensionCountTimeSeriesQuery",selections:[{alias:"embedding",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i,r],storageKey:null}]},params:{cacheID:"1f9eff6d8d453148844edae32b844df7",id:null,metadata:{},name:"DimensionCountTimeSeriesQuery",operationKind:"query",text:`query DimensionCountTimeSeriesQuery(
786
786
  $dimensionId: GlobalID!
787
787
  $timeRange: TimeRange!
788
788
  $countGranularity: Granularity!
@@ -800,7 +800,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
800
800
  }
801
801
  }
802
802
  }
803
- `}}}();Ot.hash="9677ef7c6b298554824fe3fd3904c7aa";const Rc=new Intl.NumberFormat([],{maximumFractionDigits:2}),Qt=()=>{const{gray300:n}=Ge();return{barColor:n}};function Mc({active:n,payload:a,label:l}){var i;const{barColor:t}=Qt();if(n&&a&&a.length){const r=((i=a[0])==null?void 0:i.value)??null,o=typeof r=="number"?Rc.format(r):"--";return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(l))}`}),e(pe,{color:t,shape:"square",name:"Count",value:o})]})}return null}function Nc({dimensionId:n}){var d;const{timeRange:a}=He(),l=$n(a),r=(((d=D.useLazyLoadQuery(Ot,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},countGranularity:l}).embedding.trafficTimeSeries)==null?void 0:d.data)||[]).map(g=>({...g,timestamp:new Date(g.timestamp).valueOf()})),o=On({samplingIntervalMinutes:l.samplingIntervalMinutes}),{barColor:c}=Qt();return e(sn,{width:"100%",height:"100%",children:s(rl,{data:r,margin:da,syncId:"dimensionDetails",children:[e("defs",{children:s("linearGradient",{id:"countBarColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:c,stopOpacity:1}),e("stop",{offset:"95%",stopColor:c,stopOpacity:.5})]})}),e(on,{...Qn,tickFormatter:g=>o(new Date(g))}),e(Ne,{stroke:ge.colors.gray200,label:{value:"Count",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{...el,content:e(Mc,{})}),e(En,{dataKey:"value",fill:"url(#countBarColor)",spacing:5})]})})}const jt=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"dimensionId"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"dimensionId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t=[{kind:"Variable",name:"primaryTimeRange",variableName:"timeRange"}],i={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},o={alias:null,args:null,concreteType:"NumericRange",kind:"LinkedField",name:"range",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"start",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end",storageKey:null}],storageKey:null},c=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],d={alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"counts",plural:!1,selections:c,storageKey:null},g={alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"totalCounts",plural:!1,selections:c,storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DimensionDriftBreakdownSegmentBarChartQuery",selections:[{alias:"dimension",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"InlineFragment",selections:[{kind:"RequiredField",field:{alias:null,args:t,concreteType:"Segments",kind:"LinkedField",name:"segmentsComparison",plural:!1,selections:[{alias:null,args:null,concreteType:"Segment",kind:"LinkedField",name:"segments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bin",plural:!1,selections:[{kind:"InlineFragment",selections:[i,r],type:"NominalBin",abstractKey:null},{kind:"InlineFragment",selections:[i,o],type:"IntervalBin",abstractKey:null},{kind:"InlineFragment",selections:[i],type:"MissingValueBin",abstractKey:null}],storageKey:null},d],storageKey:null},g],storageKey:null},action:"THROW",path:"dimension.segmentsComparison"}],type:"Dimension",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DimensionDriftBreakdownSegmentBarChartQuery",selections:[{alias:"dimension",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,l,{kind:"InlineFragment",selections:[{alias:null,args:t,concreteType:"Segments",kind:"LinkedField",name:"segmentsComparison",plural:!1,selections:[{alias:null,args:null,concreteType:"Segment",kind:"LinkedField",name:"segments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bin",plural:!1,selections:[i,{kind:"InlineFragment",selections:[r],type:"NominalBin",abstractKey:null},{kind:"InlineFragment",selections:[o],type:"IntervalBin",abstractKey:null}],storageKey:null},d],storageKey:null},g],storageKey:null}],type:"Dimension",abstractKey:null}],storageKey:null}]},params:{cacheID:"7d11d88f419003f5ee8cd9d11312e427",id:null,metadata:{},name:"DimensionDriftBreakdownSegmentBarChartQuery",operationKind:"query",text:`query DimensionDriftBreakdownSegmentBarChartQuery(
803
+ `}}}();Jl.hash="9677ef7c6b298554824fe3fd3904c7aa";const $c=new Intl.NumberFormat([],{maximumFractionDigits:2}),Zl=()=>{const{gray300:n}=Be();return{barColor:n}};function Oc({active:n,payload:a,label:t}){var i;const{barColor:l}=Zl();if(n&&a&&a.length){const r=((i=a[0])==null?void 0:i.value)??null,o=typeof r=="number"?$c.format(r):"--";return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(t))}`}),e(pe,{color:l,shape:"square",name:"Count",value:o})]})}return null}function Qc({dimensionId:n}){var d;const{timeRange:a}=Ue(),t=jn(a),r=(((d=I.useLazyLoadQuery(Jl,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},countGranularity:t}).embedding.trafficTimeSeries)==null?void 0:d.data)||[]).map(g=>({...g,timestamp:new Date(g.timestamp).valueOf()})),o=qn({samplingIntervalMinutes:t.samplingIntervalMinutes}),{barColor:c}=Zl();return e(sn,{width:"100%",height:"100%",children:s(gt,{data:r,margin:ca,syncId:"dimensionDetails",children:[e("defs",{children:s("linearGradient",{id:"countBarColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:c,stopOpacity:1}),e("stop",{offset:"95%",stopColor:c,stopOpacity:.5})]})}),e(on,{...Un,tickFormatter:g=>o(new Date(g))}),e(ze,{stroke:ge.colors.gray200,label:{value:"Count",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{...rt,content:e(Oc,{})}),e(Mn,{dataKey:"value",fill:"url(#countBarColor)",spacing:5})]})})}const Xl=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"dimensionId"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"dimensionId"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l=[{kind:"Variable",name:"primaryTimeRange",variableName:"timeRange"}],i={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},o={alias:null,args:null,concreteType:"NumericRange",kind:"LinkedField",name:"range",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"start",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end",storageKey:null}],storageKey:null},c=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],d={alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"counts",plural:!1,selections:c,storageKey:null},g={alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"totalCounts",plural:!1,selections:c,storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DimensionDriftBreakdownSegmentBarChartQuery",selections:[{alias:"dimension",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineFragment",selections:[{kind:"RequiredField",field:{alias:null,args:l,concreteType:"Segments",kind:"LinkedField",name:"segmentsComparison",plural:!1,selections:[{alias:null,args:null,concreteType:"Segment",kind:"LinkedField",name:"segments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bin",plural:!1,selections:[{kind:"InlineFragment",selections:[i,r],type:"NominalBin",abstractKey:null},{kind:"InlineFragment",selections:[i,o],type:"IntervalBin",abstractKey:null},{kind:"InlineFragment",selections:[i],type:"MissingValueBin",abstractKey:null}],storageKey:null},d],storageKey:null},g],storageKey:null},action:"THROW",path:"dimension.segmentsComparison"}],type:"Dimension",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DimensionDriftBreakdownSegmentBarChartQuery",selections:[{alias:"dimension",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,t,{kind:"InlineFragment",selections:[{alias:null,args:l,concreteType:"Segments",kind:"LinkedField",name:"segmentsComparison",plural:!1,selections:[{alias:null,args:null,concreteType:"Segment",kind:"LinkedField",name:"segments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bin",plural:!1,selections:[i,{kind:"InlineFragment",selections:[r],type:"NominalBin",abstractKey:null},{kind:"InlineFragment",selections:[o],type:"IntervalBin",abstractKey:null}],storageKey:null},d],storageKey:null},g],storageKey:null}],type:"Dimension",abstractKey:null}],storageKey:null}]},params:{cacheID:"7d11d88f419003f5ee8cd9d11312e427",id:null,metadata:{},name:"DimensionDriftBreakdownSegmentBarChartQuery",operationKind:"query",text:`query DimensionDriftBreakdownSegmentBarChartQuery(
804
804
  $dimensionId: GlobalID!
805
805
  $timeRange: TimeRange!
806
806
  ) {
@@ -840,7 +840,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
840
840
  }
841
841
  }
842
842
  }
843
- `}}}();jt.hash="6bb76e3cce4ee28c333e485b3aa2dffd";const Sl=Ga(".2f"),qt=()=>{const{primary:n,reference:a}=Ge();return{primaryBarColor:n,referenceBarColor:a}};function Vc({active:n,payload:a,label:l}){var r,o,c,d,g,f;const{primaryBarColor:t,referenceBarColor:i}=qt();if(n&&a&&a.length){const m=(o=(r=a[0])==null?void 0:r.payload)==null?void 0:o.primaryName,p=(c=a[0])==null?void 0:c.value,y=(g=(d=a[0])==null?void 0:d.payload)==null?void 0:g.referenceName,b=(f=a[1])==null?void 0:f.value;return s(rn,{children:[e(K,{elementType:"h3",textSize:"medium",weight:"heavy",children:l}),e(pe,{color:t,shape:"square",name:m,value:p!=null?`${Sl(p)}%`:"--"}),e(pe,{color:i,shape:"square",name:y,value:b!=null?`${Sl(b)}%`:"--"})]})}return null}function zc(n){var p,y,b,k,S;const{primaryInferences:a,referenceInferences:l}=Ve(),t=a.name,i=(l==null?void 0:l.name)||"reference",{selectedTimestamp:r}=Sa(),o=u.useMemo(()=>r??new Date(a.endTime),[r,a.endTime]),c=u.useMemo(()=>({start:Ml(o,2).toISOString(),end:o.toISOString()}),[o]),d=D.useLazyLoadQuery(jt,{dimensionId:n.dimensionId,timeRange:c}),g=u.useMemo(()=>{var A,x,T,E,R;const v=((A=d.dimension.segmentsComparison)==null?void 0:A.segments)??[],w=((T=(x=d.dimension.segmentsComparison)==null?void 0:x.totalCounts)==null?void 0:T.primaryValue)??0,L=((R=(E=d.dimension.segmentsComparison)==null?void 0:E.totalCounts)==null?void 0:R.referenceValue)??0;return v.map(j=>{var z,_;const ae=((z=j.counts)==null?void 0:z.primaryValue)??0,ie=((_=j.counts)==null?void 0:_.referenceValue)??0,be=Jl(j.bin),Se=ae/w*100,N=ie/L*100;return{name:be,primaryName:t,referenceName:i,primaryPercent:Se,referencePercent:N}})},[(p=d.dimension.segmentsComparison)==null?void 0:p.segments,(b=(y=d.dimension.segmentsComparison)==null?void 0:y.totalCounts)==null?void 0:b.primaryValue,(S=(k=d.dimension.segmentsComparison)==null?void 0:k.totalCounts)==null?void 0:S.referenceValue,t,i]),{primaryBarColor:f,referenceBarColor:m}=qt();return s(h,{direction:"column",height:"100%",children:[e(F,{flex:"none",paddingTop:"size-100",paddingStart:"size-200",children:e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:`Distribution comparison at ${Qe(new Date(c.end))}`})}),e(F,{flex:!0,children:e(sn,{children:s(rl,{data:g,margin:{top:15,right:18,left:18,bottom:5},children:[s("defs",{children:[s("linearGradient",{id:"dimensionPrimarySegmentsBarColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:f,stopOpacity:1}),e("stop",{offset:"95%",stopColor:f,stopOpacity:.5})]}),s("linearGradient",{id:"dimensionReferenceSegmentsBarColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:m,stopOpacity:1}),e("stop",{offset:"95%",stopColor:m,stopOpacity:.5})]})]}),e(on,{dataKey:"name",style:{fill:"var(--ac-global-text-color-700)"}}),e(Ne,{stroke:ge.colors.gray200,label:{value:"Percent",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{...el,content:e(Vc,{})}),e(En,{dataKey:"primaryPercent",fill:"url(#dimensionPrimarySegmentsBarColor)"}),e(En,{dataKey:"referencePercent",fill:"url(#dimensionReferenceSegmentsBarColor)"})]})})})]})}const Ut={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionDriftStats_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"psi",args:[{kind:"Literal",name:"metric",value:"psi"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],kind:"ScalarField",name:"driftMetric",storageKey:null}],type:"Dimension",abstractKey:null};Ut.hash="f8a9fb08a14f63906e38bc247d50b189";const $c=s(Vn,{variant:"info",placement:"top end",children:[e(re,{weight:"heavy",level:4,children:"Population Stability Index"}),e(Fn,{children:e(K,{children:"PSI is a symmetric metric that measures the relative entropy, or difference in information represented by two distributions. It can be thought of as measuring the distance between two data distributions showing how different the two distributions are from each other."})}),e("footer",{children:e(je,{href:"https://arize.com/blog-course/population-stability-index-psi/#:~:text=Population%20Stability%20Index%20(PSI)%20Overview,distributions%20are%20from%20each%20other.",children:"Learn more"})})]});function Oc(n){const a=D.useFragment(Ut,n.dimension);return s(U,{children:[s(h,{direction:"row",alignItems:"center",gap:"size-25",children:[e(K,{elementType:"h3",textSize:"small",color:"text-700",children:"PSI"}),$c]}),e(K,{textSize:"xlarge",children:wn(a.psi)})]})}const Bt=function(){var n={defaultValue:null,kind:"LocalArgument",name:"countGranularity"},a={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},l={defaultValue:null,kind:"LocalArgument",name:"driftGranularity"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},i=[{kind:"Variable",name:"id",variableName:"dimensionId"}],r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},o={kind:"Variable",name:"timeRange",variableName:"timeRange"},c=[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],d={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"granularity",variableName:"driftGranularity"},{kind:"Literal",name:"metric",value:"psi"},o],concreteType:"DriftTimeSeries",kind:"LinkedField",name:"driftTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"trafficTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"countGranularity"},{kind:"Literal",name:"metric",value:"count"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,l,t],kind:"Fragment",metadata:null,name:"DimensionDriftTimeSeriesQuery",selections:[{alias:"embedding",args:i,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[r,d],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,t,l,n],kind:"Operation",name:"DimensionDriftTimeSeriesQuery",selections:[{alias:"embedding",args:i,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r,d],storageKey:null}]},params:{cacheID:"af2d25e28675891b3c8a6bc75027f731",id:null,metadata:{},name:"DimensionDriftTimeSeriesQuery",operationKind:"query",text:`query DimensionDriftTimeSeriesQuery(
843
+ `}}}();Xl.hash="6bb76e3cce4ee28c333e485b3aa2dffd";const Pt=Xa(".2f"),Yl=()=>{const{primary:n,reference:a}=Be();return{primaryBarColor:n,referenceBarColor:a}};function jc({active:n,payload:a,label:t}){var r,o,c,d,g,f;const{primaryBarColor:l,referenceBarColor:i}=Yl();if(n&&a&&a.length){const m=(o=(r=a[0])==null?void 0:r.payload)==null?void 0:o.primaryName,p=(c=a[0])==null?void 0:c.value,y=(g=(d=a[0])==null?void 0:d.payload)==null?void 0:g.referenceName,k=(f=a[1])==null?void 0:f.value;return s(rn,{children:[e(K,{elementType:"h3",textSize:"medium",weight:"heavy",children:t}),e(pe,{color:l,shape:"square",name:m,value:p!=null?`${Pt(p)}%`:"--"}),e(pe,{color:i,shape:"square",name:y,value:k!=null?`${Pt(k)}%`:"--"})]})}return null}function qc(n){var p,y,k,S,C;const{primaryInferences:a,referenceInferences:t}=Ve(),l=a.name,i=(t==null?void 0:t.name)||"reference",{selectedTimestamp:r}=Fa(),o=u.useMemo(()=>r??new Date(a.endTime),[r,a.endTime]),c=u.useMemo(()=>({start:Ut(o,2).toISOString(),end:o.toISOString()}),[o]),d=I.useLazyLoadQuery(Xl,{dimensionId:n.dimensionId,timeRange:c}),g=u.useMemo(()=>{var _,x,D,A,R;const b=((_=d.dimension.segmentsComparison)==null?void 0:_.segments)??[],T=((D=(x=d.dimension.segmentsComparison)==null?void 0:x.totalCounts)==null?void 0:D.primaryValue)??0,P=((R=(A=d.dimension.segmentsComparison)==null?void 0:A.totalCounts)==null?void 0:R.referenceValue)??0;return b.map(j=>{var V,E;const ne=((V=j.counts)==null?void 0:V.primaryValue)??0,re=((E=j.counts)==null?void 0:E.referenceValue)??0,Se=ll(j.bin),ve=ne/T*100,z=re/P*100;return{name:Se,primaryName:l,referenceName:i,primaryPercent:ve,referencePercent:z}})},[(p=d.dimension.segmentsComparison)==null?void 0:p.segments,(k=(y=d.dimension.segmentsComparison)==null?void 0:y.totalCounts)==null?void 0:k.primaryValue,(C=(S=d.dimension.segmentsComparison)==null?void 0:S.totalCounts)==null?void 0:C.referenceValue,l,i]),{primaryBarColor:f,referenceBarColor:m}=Yl();return s(h,{direction:"column",height:"100%",children:[e(F,{flex:"none",paddingTop:"size-100",paddingStart:"size-200",children:e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:`Distribution comparison at ${Qe(new Date(c.end))}`})}),e(F,{flex:!0,children:e(sn,{children:s(gt,{data:g,margin:{top:15,right:18,left:18,bottom:5},children:[s("defs",{children:[s("linearGradient",{id:"dimensionPrimarySegmentsBarColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:f,stopOpacity:1}),e("stop",{offset:"95%",stopColor:f,stopOpacity:.5})]}),s("linearGradient",{id:"dimensionReferenceSegmentsBarColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:m,stopOpacity:1}),e("stop",{offset:"95%",stopColor:m,stopOpacity:.5})]})]}),e(on,{dataKey:"name",style:{fill:"var(--ac-global-text-color-700)"}}),e(ze,{stroke:ge.colors.gray200,label:{value:"Percent",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{...rt,content:e(jc,{})}),e(Mn,{dataKey:"primaryPercent",fill:"url(#dimensionPrimarySegmentsBarColor)"}),e(Mn,{dataKey:"referencePercent",fill:"url(#dimensionReferenceSegmentsBarColor)"})]})})})]})}const ei={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionDriftStats_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"psi",args:[{kind:"Literal",name:"metric",value:"psi"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],kind:"ScalarField",name:"driftMetric",storageKey:null}],type:"Dimension",abstractKey:null};ei.hash="f8a9fb08a14f63906e38bc247d50b189";const Uc=s($n,{variant:"info",placement:"top end",children:[e(se,{weight:"heavy",level:4,children:"Population Stability Index"}),e(Fn,{children:e(K,{children:"PSI is a symmetric metric that measures the relative entropy, or difference in information represented by two distributions. It can be thought of as measuring the distance between two data distributions showing how different the two distributions are from each other."})}),e("footer",{children:e(je,{href:"https://arize.com/blog-course/population-stability-index-psi/#:~:text=Population%20Stability%20Index%20(PSI)%20Overview,distributions%20are%20from%20each%20other.",children:"Learn more"})})]});function Bc(n){const a=I.useFragment(ei,n.dimension);return s(H,{children:[s(h,{direction:"row",alignItems:"center",gap:"size-25",children:[e(K,{elementType:"h3",textSize:"small",color:"text-700",children:"PSI"}),Uc]}),e(K,{textSize:"xlarge",children:_n(a.psi)})]})}const ni=function(){var n={defaultValue:null,kind:"LocalArgument",name:"countGranularity"},a={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},t={defaultValue:null,kind:"LocalArgument",name:"driftGranularity"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},i=[{kind:"Variable",name:"id",variableName:"dimensionId"}],r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},o={kind:"Variable",name:"timeRange",variableName:"timeRange"},c=[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],d={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"granularity",variableName:"driftGranularity"},{kind:"Literal",name:"metric",value:"psi"},o],concreteType:"DriftTimeSeries",kind:"LinkedField",name:"driftTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"trafficTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"countGranularity"},{kind:"Literal",name:"metric",value:"count"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,t,l],kind:"Fragment",metadata:null,name:"DimensionDriftTimeSeriesQuery",selections:[{alias:"embedding",args:i,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[r,d],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,l,t,n],kind:"Operation",name:"DimensionDriftTimeSeriesQuery",selections:[{alias:"embedding",args:i,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r,d],storageKey:null}]},params:{cacheID:"af2d25e28675891b3c8a6bc75027f731",id:null,metadata:{},name:"DimensionDriftTimeSeriesQuery",operationKind:"query",text:`query DimensionDriftTimeSeriesQuery(
844
844
  $dimensionId: GlobalID!
845
845
  $timeRange: TimeRange!
846
846
  $driftGranularity: Granularity!
@@ -865,7 +865,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
865
865
  }
866
866
  }
867
867
  }
868
- `}}}();Bt.hash="6312b58dbb252b17efdf08d44dd58630";const Ht=()=>{const{orange300:n,gray300:a}=Ge();return{color:n,barColor:a}};function Qc({active:n,payload:a,label:l}){var i;const{color:t}=Ht();if(n&&a&&a.length){const r=((i=a[1])==null?void 0:i.value)??null;return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(l))}`}),e(pe,{color:t,name:"PSI",value:wn(r)}),e(va,{}),s("div",{css:C`
868
+ `}}}();ni.hash="6312b58dbb252b17efdf08d44dd58630";const ai=()=>{const{orange300:n,gray300:a}=Be();return{color:n,barColor:a}};function Hc({active:n,payload:a,label:t}){var i;const{color:l}=ai();if(n&&a&&a.length){const r=((i=a[1])==null?void 0:i.value)??null;return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(t))}`}),e(pe,{color:l,name:"PSI",value:_n(r)}),e(Ka,{}),s("div",{css:v`
869
869
  display: flex;
870
870
  flex-direction: row;
871
871
  align-items: center;
@@ -873,7 +873,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
873
873
  gap: var(--px-spacing-sm);
874
874
 
875
875
  margin-top: var(--px-spacing-sm);
876
- `,children:[e(P,{svg:e(Nl,{})}),e("span",{children:"Click to view details"})]})]})}return null}function jc({dimensionId:n}){var y,b;const{timeRange:a}=He(),{selectedTimestamp:l,setSelectedTimestamp:t}=Sa(),i=$n(a),r=D.useLazyLoadQuery(Bt,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},driftGranularity:Ul(a),countGranularity:i}),o=((y=r.embedding.driftTimeSeries)==null?void 0:y.data)||[],c=((b=r.embedding.trafficTimeSeries)==null?void 0:b.data.reduce((k,S)=>(k[S.timestamp]=S.value,k),{}))??{},d=o.map(k=>{const S=c[k.timestamp];return{...k,traffic:S,timestamp:new Date(k.timestamp).valueOf()}}),g=On({samplingIntervalMinutes:i.samplingIntervalMinutes}),f=u.useCallback(k=>{const{activePayload:S}=k;if(S!=null&&S.length>0){const v=S[0].payload;t(new Date(v.timestamp))}},[t]),{color:m,barColor:p}=Ht();return e(sn,{width:"100%",height:"100%",children:s(ra,{data:d,margin:da,onClick:f,syncId:"dimensionDetails",children:[s("defs",{children:[s("linearGradient",{id:"dimensionDriftColorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:m,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:m,stopOpacity:0})]}),s("linearGradient",{id:"barColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:p,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:p,stopOpacity:0})]})]}),e(on,{...Qn,tickFormatter:k=>g(new Date(k))}),e(Ne,{stroke:ge.colors.gray200,label:{value:"PSI",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(Ne,{yAxisId:"right",orientation:"right",tick:!1,tickLine:!1,width:0}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(Qc,{})}),e(En,{yAxisId:"right",dataKey:"traffic",fill:"url(#barColor)",spacing:5}),e(Yn,{type:"monotone",dataKey:"value",stroke:m,fillOpacity:1,fill:"url(#dimensionDriftColorUv)"}),l!=null?e(pt,{...Bl,x:l.getTime()}):null]})})}const Gt=function(){var n={kind:"Literal",name:"metric",value:"percentEmpty"};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"hasReference"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionPercentEmptyStats_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"percentEmpty",args:[n,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{condition:"hasReference",kind:"Condition",passingValue:!0,selections:[{alias:"referencePercentEmpty",args:[{kind:"Literal",name:"inferencesRole",value:"reference"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:'dataQualityMetric(inferencesRole:"reference",metric:"percentEmpty")'}]}],type:"Dimension",abstractKey:null}}();Gt.hash="1e10d0449d6607d9292f355548c41c78";function qc(n){const a=D.useFragment(Gt,n.dimension);return s(U,{children:[e(K,{elementType:"h3",textSize:"small",color:"text-700",children:"% Empty"}),e(K,{textSize:"xlarge",children:Qa(a.percentEmpty)}),a.referencePercentEmpty!=null&&e(K,{textSize:"medium",color:"designationPurple",children:Qa(a.referencePercentEmpty)})]})}const Wt=function(){var n={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},a={defaultValue:null,kind:"LocalArgument",name:"granularity"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"InlineFragment",selections:[{alias:"percentEmptyTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"granularity"},{kind:"Literal",name:"metric",value:"percentEmpty"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"DimensionPercentEmptyTimeSeriesQuery",selections:[{alias:"embedding",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,l,a],kind:"Operation",name:"DimensionPercentEmptyTimeSeriesQuery",selections:[{alias:"embedding",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i,r],storageKey:null}]},params:{cacheID:"9be05c72f19755036f4829777a96f97d",id:null,metadata:{},name:"DimensionPercentEmptyTimeSeriesQuery",operationKind:"query",text:`query DimensionPercentEmptyTimeSeriesQuery(
876
+ `,children:[e(w,{svg:e(Ht,{})}),e("span",{children:"Click to view details"})]})]})}return null}function Gc({dimensionId:n}){var y,k;const{timeRange:a}=Ue(),{selectedTimestamp:t,setSelectedTimestamp:l}=Fa(),i=jn(a),r=I.useLazyLoadQuery(ni,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},driftGranularity:el(a),countGranularity:i}),o=((y=r.embedding.driftTimeSeries)==null?void 0:y.data)||[],c=((k=r.embedding.trafficTimeSeries)==null?void 0:k.data.reduce((S,C)=>(S[C.timestamp]=C.value,S),{}))??{},d=o.map(S=>{const C=c[S.timestamp];return{...S,traffic:C,timestamp:new Date(S.timestamp).valueOf()}}),g=qn({samplingIntervalMinutes:i.samplingIntervalMinutes}),f=u.useCallback(S=>{const{activePayload:C}=S;if(C!=null&&C.length>0){const b=C[0].payload;l(new Date(b.timestamp))}},[l]),{color:m,barColor:p}=ai();return e(sn,{width:"100%",height:"100%",children:s(sa,{data:d,margin:ca,onClick:f,syncId:"dimensionDetails",children:[s("defs",{children:[s("linearGradient",{id:"dimensionDriftColorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:m,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:m,stopOpacity:0})]}),s("linearGradient",{id:"barColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:p,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:p,stopOpacity:0})]})]}),e(on,{...Un,tickFormatter:S=>g(new Date(S))}),e(ze,{stroke:ge.colors.gray200,label:{value:"PSI",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(ze,{yAxisId:"right",orientation:"right",tick:!1,tickLine:!1,width:0}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(Hc,{})}),e(Mn,{yAxisId:"right",dataKey:"traffic",fill:"url(#barColor)",spacing:5}),e(aa,{type:"monotone",dataKey:"value",stroke:m,fillOpacity:1,fill:"url(#dimensionDriftColorUv)"}),t!=null?e(Fl,{...nl,x:t.getTime()}):null]})})}const ti=function(){var n={kind:"Literal",name:"metric",value:"percentEmpty"};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"hasReference"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionPercentEmptyStats_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"percentEmpty",args:[n,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{condition:"hasReference",kind:"Condition",passingValue:!0,selections:[{alias:"referencePercentEmpty",args:[{kind:"Literal",name:"inferencesRole",value:"reference"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:'dataQualityMetric(inferencesRole:"reference",metric:"percentEmpty")'}]}],type:"Dimension",abstractKey:null}}();ti.hash="1e10d0449d6607d9292f355548c41c78";function Wc(n){const a=I.useFragment(ti,n.dimension);return s(H,{children:[e(K,{elementType:"h3",textSize:"small",color:"text-700",children:"% Empty"}),e(K,{textSize:"xlarge",children:Ba(a.percentEmpty)}),a.referencePercentEmpty!=null&&e(K,{textSize:"medium",color:"designationPurple",children:Ba(a.referencePercentEmpty)})]})}const li=function(){var n={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},a={defaultValue:null,kind:"LocalArgument",name:"granularity"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"InlineFragment",selections:[{alias:"percentEmptyTimeSeries",args:[{kind:"Variable",name:"granularity",variableName:"granularity"},{kind:"Literal",name:"metric",value:"percentEmpty"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"DimensionPercentEmptyTimeSeriesQuery",selections:[{alias:"embedding",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a],kind:"Operation",name:"DimensionPercentEmptyTimeSeriesQuery",selections:[{alias:"embedding",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i,r],storageKey:null}]},params:{cacheID:"9be05c72f19755036f4829777a96f97d",id:null,metadata:{},name:"DimensionPercentEmptyTimeSeriesQuery",operationKind:"query",text:`query DimensionPercentEmptyTimeSeriesQuery(
877
877
  $dimensionId: GlobalID!
878
878
  $timeRange: TimeRange!
879
879
  $granularity: Granularity!
@@ -891,15 +891,15 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
891
891
  }
892
892
  }
893
893
  }
894
- `}}}();Wt.hash="1e843d6c8dbe05b389b24188c6bdb394";const Uc=new Intl.NumberFormat([],{maximumFractionDigits:2}),Jt=()=>{const{gray100:n}=Ge();return{color:n}};function Bc({active:n,payload:a,label:l}){var i;const{color:t}=Jt();if(n&&a&&a.length){const r=((i=a[0])==null?void 0:i.value)??null,o=typeof r=="number"?Uc.format(r):"--";return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(l))}`}),e(pe,{color:t,name:"% Empty",value:o})]})}return null}function Hc({dimensionId:n}){var c;const{timeRange:a}=He(),l=$n(a),i=((c=D.useLazyLoadQuery(Wt,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},granularity:l}).embedding.percentEmptyTimeSeries)==null?void 0:c.data.map(d=>({timestamp:new Date(d.timestamp).valueOf(),value:d.value})))||[],r=On({samplingIntervalMinutes:l.samplingIntervalMinutes}),{color:o}=Jt();return e(sn,{width:"100%",height:"100%",children:s(ra,{data:i,margin:da,syncId:"dimensionDetails",children:[e("defs",{children:s("linearGradient",{id:"percentEmptyColorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:o,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:o,stopOpacity:0})]})}),e(on,{...Qn,tickFormatter:d=>r(new Date(d))}),e(Ne,{stroke:ge.colors.gray200,label:{value:"% Empty",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(Bc,{})}),e(yt,{type:"monotone",dataKey:"value",stroke:o,fillOpacity:1,fill:"url(#percentEmptyColorUv)"})]})})}const Zt=function(){var n={kind:"Variable",name:"timeRange",variableName:"timeRange"};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionQuantilesStats_dimension",selections:[{alias:"p99",args:[{kind:"Literal",name:"metric",value:"p99"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p75",args:[{kind:"Literal",name:"metric",value:"p75"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p50",args:[{kind:"Literal",name:"metric",value:"p50"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p25",args:[{kind:"Literal",name:"metric",value:"p25"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p1",args:[{kind:"Literal",name:"metric",value:"p01"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null}],type:"Dimension",abstractKey:null}}();Zt.hash="c306c8eafb1d34be464d3a658d5f94a7";function Gc(n){const a=D.useFragment(Zt,n.dimension);return e("ul",{css:C`
894
+ `}}}();li.hash="1e843d6c8dbe05b389b24188c6bdb394";const Jc=new Intl.NumberFormat([],{maximumFractionDigits:2}),ii=()=>{const{gray100:n}=Be();return{color:n}};function Zc({active:n,payload:a,label:t}){var i;const{color:l}=ii();if(n&&a&&a.length){const r=((i=a[0])==null?void 0:i.value)??null,o=typeof r=="number"?Jc.format(r):"--";return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(t))}`}),e(pe,{color:l,name:"% Empty",value:o})]})}return null}function Xc({dimensionId:n}){var c;const{timeRange:a}=Ue(),t=jn(a),i=((c=I.useLazyLoadQuery(li,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},granularity:t}).embedding.percentEmptyTimeSeries)==null?void 0:c.data.map(d=>({timestamp:new Date(d.timestamp).valueOf(),value:d.value})))||[],r=qn({samplingIntervalMinutes:t.samplingIntervalMinutes}),{color:o}=ii();return e(sn,{width:"100%",height:"100%",children:s(sa,{data:i,margin:ca,syncId:"dimensionDetails",children:[e("defs",{children:s("linearGradient",{id:"percentEmptyColorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:o,stopOpacity:.8}),e("stop",{offset:"95%",stopColor:o,stopOpacity:0})]})}),e(on,{...Un,tickFormatter:d=>r(new Date(d))}),e(ze,{stroke:ge.colors.gray200,label:{value:"% Empty",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(Zc,{})}),e(Kl,{type:"monotone",dataKey:"value",stroke:o,fillOpacity:1,fill:"url(#percentEmptyColorUv)"})]})})}const ri=function(){var n={kind:"Variable",name:"timeRange",variableName:"timeRange"};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionQuantilesStats_dimension",selections:[{alias:"p99",args:[{kind:"Literal",name:"metric",value:"p99"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p75",args:[{kind:"Literal",name:"metric",value:"p75"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p50",args:[{kind:"Literal",name:"metric",value:"p50"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p25",args:[{kind:"Literal",name:"metric",value:"p25"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null},{alias:"p1",args:[{kind:"Literal",name:"metric",value:"p01"},n],kind:"ScalarField",name:"dataQualityMetric",storageKey:null}],type:"Dimension",abstractKey:null}}();ri.hash="c306c8eafb1d34be464d3a658d5f94a7";function Yc(n){const a=I.useFragment(ri,n.dimension);return e("ul",{css:v`
895
895
  display: flex;
896
896
  flex-direction: column;
897
897
  gap: var(--px-spacing-sm);
898
- `,children:Object.keys(a).map(l=>{const t=a[l];return s("li",{css:C`
898
+ `,children:Object.keys(a).map(t=>{const l=a[t];return s("li",{css:v`
899
899
  display: flex;
900
900
  flex-direction: column;
901
901
  align-items: flex-end;
902
- `,children:[e(K,{elementType:"h3",textSize:"xsmall",color:"text-700",children:l}),e(K,{textSize:"medium","data-raw":t,children:Ya(t)})]},l)})})}const Xt=function(){var n={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},a={defaultValue:null,kind:"LocalArgument",name:"granularity"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"Variable",name:"granularity",variableName:"granularity"},o={kind:"Variable",name:"timeRange",variableName:"timeRange"},c=[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],d={kind:"InlineFragment",selections:[{alias:"p99TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p99"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"p75TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p75"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"p50TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p50"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"p25TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p25"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"p01TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p01"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"DimensionQuantilesTimeSeriesQuery",selections:[{alias:"dimension",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,d],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,l,a],kind:"Operation",name:"DimensionQuantilesTimeSeriesQuery",selections:[{alias:"dimension",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i,d],storageKey:null}]},params:{cacheID:"0bb3d9faf9d7f0c2e27995120ae24e1c",id:null,metadata:{},name:"DimensionQuantilesTimeSeriesQuery",operationKind:"query",text:`query DimensionQuantilesTimeSeriesQuery(
902
+ `,children:[e(K,{elementType:"h3",textSize:"xsmall",color:"text-700",children:t}),e(K,{textSize:"medium","data-raw":l,children:it(l)})]},t)})})}const si=function(){var n={defaultValue:null,kind:"LocalArgument",name:"dimensionId"},a={defaultValue:null,kind:"LocalArgument",name:"granularity"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"dimensionId"}],i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={kind:"Variable",name:"granularity",variableName:"granularity"},o={kind:"Variable",name:"timeRange",variableName:"timeRange"},c=[{alias:null,args:null,concreteType:"TimeSeriesDataPoint",kind:"LinkedField",name:"data",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],d={kind:"InlineFragment",selections:[{alias:"p99TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p99"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"p75TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p75"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"p50TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p50"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"p25TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p25"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null},{alias:"p01TimeSeries",args:[r,{kind:"Literal",name:"metric",value:"p01"},o],concreteType:"DataQualityTimeSeries",kind:"LinkedField",name:"dataQualityTimeSeries",plural:!1,selections:c,storageKey:null}],type:"Dimension",abstractKey:null};return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"DimensionQuantilesTimeSeriesQuery",selections:[{alias:"dimension",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[i,d],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a],kind:"Operation",name:"DimensionQuantilesTimeSeriesQuery",selections:[{alias:"dimension",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i,d],storageKey:null}]},params:{cacheID:"0bb3d9faf9d7f0c2e27995120ae24e1c",id:null,metadata:{},name:"DimensionQuantilesTimeSeriesQuery",operationKind:"query",text:`query DimensionQuantilesTimeSeriesQuery(
903
903
  $dimensionId: GlobalID!
904
904
  $timeRange: TimeRange!
905
905
  $granularity: Granularity!
@@ -941,14 +941,14 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
941
941
  }
942
942
  }
943
943
  }
944
- `}}}();Xt.hash="134f0dad0e0ecc7863dfbb0f437d829b";const Wc=Ga("~s");var Yt=(n=>(n.p99_p01="p99_p01",n.p75_p25="p75_p25",n.p50="p50",n))(Yt||{});const Jc=new Intl.NumberFormat([],{maximumFractionDigits:2});function Gn(n){return typeof n=="number"?Jc.format(n):"--"}const ei=()=>{const n=Ge();return{outerColor:n.gray500,innerColor:n.gray300,lineColor:n.default}};function Zc({active:n,payload:a,label:l}){const{outerColor:t,innerColor:i,lineColor:r}=ei();if(n&&a&&a.length){const o=a[0].payload;return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(l))}`}),e(pe,{color:t,name:"p99",value:Gn(o.p99_p01[0])}),e(pe,{color:i,name:"p75",value:Gn(o.p75_p25[0])}),e(pe,{color:r,name:"p50",value:Gn(o.p50)}),e(pe,{color:i,name:"p25",value:Gn(o.p75_p25[1])}),e(pe,{color:t,name:"p01",value:Gn(o.p99_p01[1])})]})}return null}function Xc({dimensionId:n}){var L,A,x,T,E;const{timeRange:a}=He(),l=$n(a),t=D.useLazyLoadQuery(Xt,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},granularity:l}),i=((L=t.dimension.p99TimeSeries)==null?void 0:L.data.map(R=>R))||[],r=((A=t.dimension.p01TimeSeries)==null?void 0:A.data.map(R=>R))||[],o=((x=t.dimension.p75TimeSeries)==null?void 0:x.data.map(R=>R))||[],c=((T=t.dimension.p25TimeSeries)==null?void 0:T.data.map(R=>R))||[],d=((E=t.dimension.p50TimeSeries)==null?void 0:E.data.map(R=>R))||[],g=i.map((R,j)=>({timestamp:new Date(R.timestamp).valueOf(),p99_p01:[R.value,r[j].value],p75_p25:[o[j].value,c[j].value],p50:d[j].value})),f=On({samplingIntervalMinutes:l.samplingIntervalMinutes}),[m,p]=u.useState(Object.keys(Yt).reduce((R,j)=>(R[j]=!1,R),{})),y=R=>{m[R.dataKey]||p({...m})},b=()=>{p({...m})},k=R=>{p({...m,[String(R.dataKey)]:!m[R.dataKey]})},{outerColor:S,innerColor:v,lineColor:w}=ei();return e(sn,{width:"100%",height:"100%",children:s(ra,{data:g,margin:da,syncId:"dimensionDetails",children:[s("defs",{children:[s("linearGradient",{id:"p99_p01ColorUV",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"10%",stopColor:S,stopOpacity:.7}),e("stop",{offset:"50%",stopColor:S,stopOpacity:.3}),e("stop",{offset:"90%",stopColor:S,stopOpacity:.7})]}),s("linearGradient",{id:"p75_p25ColorUV",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"10%",stopColor:v,stopOpacity:.7}),e("stop",{offset:"50%",stopColor:v,stopOpacity:.3}),e("stop",{offset:"90%",stopColor:v,stopOpacity:.7})]})]}),e(on,{...Qn,tickFormatter:R=>f(new Date(R))}),e(Ne,{stroke:ge.colors.gray200,label:{value:"Value",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},tickFormatter:R=>Wc(R),style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(Zc,{})}),e(xd,{onClick:k,onMouseOver:y,onMouseOut:b}),e(Yn,{type:"monotone",dataKey:"p99_p01",name:"p99 - p01",fillOpacity:1,fill:"url(#p99_p01ColorUV)",stroke:S,hide:m.p99_p01===!0}),e(Yn,{type:"monotone",dataKey:"p75_p25",name:"p75 - p25",fillOpacity:1,stroke:v,fill:"url(#p75_p25ColorUV)",hide:m.p75_p25===!0}),e(yt,{type:"monotone",dataKey:"p50",stroke:w,hide:m.p50===!0})]})})}const ni=function(){var n={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},a=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionSegmentsBarChart_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:[{kind:"Variable",name:"primaryTimeRange",variableName:"timeRange"}],concreteType:"Segments",kind:"LinkedField",name:"segmentsComparison",plural:!1,selections:[{alias:null,args:null,concreteType:"Segment",kind:"LinkedField",name:"segments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bin",plural:!1,selections:[{kind:"InlineFragment",selections:[n,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],type:"NominalBin",abstractKey:null},{kind:"InlineFragment",selections:[n,{alias:null,args:null,concreteType:"NumericRange",kind:"LinkedField",name:"range",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"start",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end",storageKey:null}],storageKey:null}],type:"IntervalBin",abstractKey:null},{kind:"InlineFragment",selections:[n],type:"MissingValueBin",abstractKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"counts",plural:!1,selections:a,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"totalCounts",plural:!1,selections:a,storageKey:null}],storageKey:null}],type:"Dimension",abstractKey:null}}();ni.hash="8cef9841e9a5bd7d0d50acb5db9028b0";const Yc=Ga(".2f"),ai=()=>{const{primary:n}=Ge();return{color:n}};function eu({active:n,payload:a,label:l}){var i;const{color:t}=ai();if(n&&a&&a.length){const r=(i=a[0])==null?void 0:i.value;return e(rn,{children:e(pe,{color:t,shape:"square",name:l,value:r!=null?`${Yc(r)}%`:"--"})})}return null}function nu(n){const a=D.useFragment(ni,n.dimension),l=u.useMemo(()=>{var o,c,d;const i=((o=a.segmentsComparison)==null?void 0:o.segments)??[],r=((d=(c=a.segmentsComparison)==null?void 0:c.totalCounts)==null?void 0:d.primaryValue)??0;return i.map(g=>{var y;const f=((y=g.counts)==null?void 0:y.primaryValue)??0,m=Jl(g.bin),p=f/r*100;return{name:m,percent:p}})},[a]),{color:t}=ai();return e(sn,{children:s(rl,{data:l,margin:{top:25,right:18,left:18,bottom:5},children:[e("defs",{children:s("linearGradient",{id:"dimensionSegmentsBarColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:t,stopOpacity:1}),e("stop",{offset:"95%",stopColor:t,stopOpacity:.5})]})}),e(on,{dataKey:"name",style:{fill:"var(--ac-global-text-color-700)"}}),e(Ne,{stroke:ge.colors.gray200,label:{value:"% Volume",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{...el,content:e(eu,{})}),e(En,{dataKey:"percent",fill:"url(#dimensionSegmentsBarColor)",spacing:15})]})})}function Qy(){const{dimensionId:n}=ln(),{timeRange:a}=He(),l=Cn(),{referenceInferences:t}=Ve(),i=t!==null,r=i,o=l.dimension.shape!=="continuous",c=l.dimension.dataType==="numeric",d=Y(),g=D.useLazyLoadQuery(Mt,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},hasReference:i});if(!n)throw new Error("Dimension ID is required to display a dimension");return e(Wl,{initialTimestamp:new Date(a.end),children:e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>d(-1),children:e(H,{size:"L",title:l.dimension.name,children:e("main",{css:C`
944
+ `}}}();si.hash="134f0dad0e0ecc7863dfbb0f437d829b";const eu=Xa("~s");var oi=(n=>(n.p99_p01="p99_p01",n.p75_p25="p75_p25",n.p50="p50",n))(oi||{});const nu=new Intl.NumberFormat([],{maximumFractionDigits:2});function Xn(n){return typeof n=="number"?nu.format(n):"--"}const di=()=>{const n=Be();return{outerColor:n.gray500,innerColor:n.gray300,lineColor:n.default}};function au({active:n,payload:a,label:t}){const{outerColor:l,innerColor:i,lineColor:r}=di();if(n&&a&&a.length){const o=a[0].payload;return s(rn,{children:[e(K,{weight:"heavy",textSize:"medium",children:`${Qe(new Date(t))}`}),e(pe,{color:l,name:"p99",value:Xn(o.p99_p01[0])}),e(pe,{color:i,name:"p75",value:Xn(o.p75_p25[0])}),e(pe,{color:r,name:"p50",value:Xn(o.p50)}),e(pe,{color:i,name:"p25",value:Xn(o.p75_p25[1])}),e(pe,{color:l,name:"p01",value:Xn(o.p99_p01[1])})]})}return null}function tu({dimensionId:n}){var P,_,x,D,A;const{timeRange:a}=Ue(),t=jn(a),l=I.useLazyLoadQuery(si,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},granularity:t}),i=((P=l.dimension.p99TimeSeries)==null?void 0:P.data.map(R=>R))||[],r=((_=l.dimension.p01TimeSeries)==null?void 0:_.data.map(R=>R))||[],o=((x=l.dimension.p75TimeSeries)==null?void 0:x.data.map(R=>R))||[],c=((D=l.dimension.p25TimeSeries)==null?void 0:D.data.map(R=>R))||[],d=((A=l.dimension.p50TimeSeries)==null?void 0:A.data.map(R=>R))||[],g=i.map((R,j)=>({timestamp:new Date(R.timestamp).valueOf(),p99_p01:[R.value,r[j].value],p75_p25:[o[j].value,c[j].value],p50:d[j].value})),f=qn({samplingIntervalMinutes:t.samplingIntervalMinutes}),[m,p]=u.useState(Object.keys(oi).reduce((R,j)=>(R[j]=!1,R),{})),y=R=>{m[R.dataKey]||p({...m})},k=()=>{p({...m})},S=R=>{p({...m,[String(R.dataKey)]:!m[R.dataKey]})},{outerColor:C,innerColor:b,lineColor:T}=di();return e(sn,{width:"100%",height:"100%",children:s(sa,{data:g,margin:ca,syncId:"dimensionDetails",children:[s("defs",{children:[s("linearGradient",{id:"p99_p01ColorUV",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"10%",stopColor:C,stopOpacity:.7}),e("stop",{offset:"50%",stopColor:C,stopOpacity:.3}),e("stop",{offset:"90%",stopColor:C,stopOpacity:.7})]}),s("linearGradient",{id:"p75_p25ColorUV",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"10%",stopColor:b,stopOpacity:.7}),e("stop",{offset:"50%",stopColor:b,stopOpacity:.3}),e("stop",{offset:"90%",stopColor:b,stopOpacity:.7})]})]}),e(on,{...Un,tickFormatter:R=>f(new Date(R))}),e(ze,{stroke:ge.colors.gray200,label:{value:"Value",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},tickFormatter:R=>eu(R),style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{content:e(au,{})}),e(Ld,{onClick:S,onMouseOver:y,onMouseOut:k}),e(aa,{type:"monotone",dataKey:"p99_p01",name:"p99 - p01",fillOpacity:1,fill:"url(#p99_p01ColorUV)",stroke:C,hide:m.p99_p01===!0}),e(aa,{type:"monotone",dataKey:"p75_p25",name:"p75 - p25",fillOpacity:1,stroke:b,fill:"url(#p75_p25ColorUV)",hide:m.p75_p25===!0}),e(Kl,{type:"monotone",dataKey:"p50",stroke:T,hide:m.p50===!0})]})})}const ci=function(){var n={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},a=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:null,name:"DimensionSegmentsBarChart_dimension",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:[{kind:"Variable",name:"primaryTimeRange",variableName:"timeRange"}],concreteType:"Segments",kind:"LinkedField",name:"segmentsComparison",plural:!1,selections:[{alias:null,args:null,concreteType:"Segment",kind:"LinkedField",name:"segments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bin",plural:!1,selections:[{kind:"InlineFragment",selections:[n,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],type:"NominalBin",abstractKey:null},{kind:"InlineFragment",selections:[n,{alias:null,args:null,concreteType:"NumericRange",kind:"LinkedField",name:"range",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"start",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end",storageKey:null}],storageKey:null}],type:"IntervalBin",abstractKey:null},{kind:"InlineFragment",selections:[n],type:"MissingValueBin",abstractKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"counts",plural:!1,selections:a,storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetValues",kind:"LinkedField",name:"totalCounts",plural:!1,selections:a,storageKey:null}],storageKey:null}],type:"Dimension",abstractKey:null}}();ci.hash="8cef9841e9a5bd7d0d50acb5db9028b0";const lu=Xa(".2f"),ui=()=>{const{primary:n}=Be();return{color:n}};function iu({active:n,payload:a,label:t}){var i;const{color:l}=ui();if(n&&a&&a.length){const r=(i=a[0])==null?void 0:i.value;return e(rn,{children:e(pe,{color:l,shape:"square",name:t,value:r!=null?`${lu(r)}%`:"--"})})}return null}function ru(n){const a=I.useFragment(ci,n.dimension),t=u.useMemo(()=>{var o,c,d;const i=((o=a.segmentsComparison)==null?void 0:o.segments)??[],r=((d=(c=a.segmentsComparison)==null?void 0:c.totalCounts)==null?void 0:d.primaryValue)??0;return i.map(g=>{var y;const f=((y=g.counts)==null?void 0:y.primaryValue)??0,m=ll(g.bin),p=f/r*100;return{name:m,percent:p}})},[a]),{color:l}=ui();return e(sn,{children:s(gt,{data:t,margin:{top:25,right:18,left:18,bottom:5},children:[e("defs",{children:s("linearGradient",{id:"dimensionSegmentsBarColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"5%",stopColor:l,stopOpacity:1}),e("stop",{offset:"95%",stopColor:l,stopOpacity:.5})]})}),e(on,{dataKey:"name",style:{fill:"var(--ac-global-text-color-700)"}}),e(ze,{stroke:ge.colors.gray200,label:{value:"% Volume",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"var(--ac-global-text-color-900)"}},style:{fill:"var(--ac-global-text-color-700)"}}),e(dn,{strokeDasharray:"4 4",stroke:ge.colors.gray200,strokeOpacity:.5}),e(cn,{...rt,content:e(iu,{})}),e(Mn,{dataKey:"percent",fill:"url(#dimensionSegmentsBarColor)",spacing:15})]})})}function Yy(){const{dimensionId:n}=tn(),{timeRange:a}=Ue(),t=vn(),{referenceInferences:l}=Ve(),i=l!==null,r=i,o=t.dimension.shape!=="continuous",c=t.dimension.dataType==="numeric",d=Y(),g=I.useLazyLoadQuery(Ul,{dimensionId:n,timeRange:{start:a.start.toISOString(),end:a.end.toISOString()},hasReference:i});if(!n)throw new Error("Dimension ID is required to display a dimension");return e(tl,{initialTimestamp:new Date(a.end),children:e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>d(-1),children:e(B,{size:"L",title:t.dimension.name,children:e("main",{css:v`
945
945
  padding: var(--px-spacing-med);
946
946
  display: flex;
947
947
  flex-direction: column;
948
948
  min-height: 400px;
949
949
  overflow-y: auto;
950
950
  height: 100%;
951
- `,children:e(u.Suspense,{fallback:e(fe,{}),children:s(h,{direction:"column",gap:"size-100",children:[e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-1600",children:e(nu,{dimension:g.dimension})}),e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-1600","data-testid":"dimension-count-time-series-view",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(Nc,{dimensionId:n}),e(In,{children:e(Ec,{dimension:g.dimension})})]})}),r?e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",children:s(h,{direction:"column",alignItems:"stretch",children:[e(F,{width:"100%",height:"size-1600",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(F,{flex:!0,children:e(jc,{dimensionId:n})}),e(In,{children:e(Oc,{dimension:g.dimension})})]})}),e(F,{height:"size-1600",width:"100%",borderTopColor:"dark",borderTopWidth:"thin",children:e(u.Suspense,{fallback:e(fe,{}),children:e(zc,{dimensionId:n})})})]})}):null,c?e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-3000",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(F,{flex:!0,children:e(Xc,{dimensionId:n})}),e(In,{children:e(Gc,{dimension:g.dimension})})]})}):null,o?e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-1600",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(F,{flex:!0,children:e(_c,{dimensionId:n})}),e(In,{children:e(Pc,{dimension:g.dimension})})]})}):null,e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-1600",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(Hc,{dimensionId:n}),e(In,{children:e(qc,{dimension:g.dimension})})]})})]})})})})})})}const li=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"dataType",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"shape",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"dimensionLoaderQuery",selections:[{alias:"dimension",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[l,t,i,r],type:"Dimension",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"dimensionLoaderQuery",selections:[{alias:"dimension",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[t,i,r],type:"Dimension",abstractKey:null}],storageKey:null}]},params:{cacheID:"03a9aafe3f08a9d093b029ff4a9e3253",id:null,metadata:{},name:"dimensionLoaderQuery",operationKind:"query",text:`query dimensionLoaderQuery(
951
+ `,children:e(u.Suspense,{fallback:e(he,{}),children:s(h,{direction:"column",gap:"size-100",children:[e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-1600",children:e(ru,{dimension:g.dimension})}),e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-1600","data-testid":"dimension-count-time-series-view",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(Qc,{dimensionId:n}),e(Pn,{children:e(Vc,{dimension:g.dimension})})]})}),r?e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",children:s(h,{direction:"column",alignItems:"stretch",children:[e(F,{width:"100%",height:"size-1600",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(F,{flex:!0,children:e(Gc,{dimensionId:n})}),e(Pn,{children:e(Bc,{dimension:g.dimension})})]})}),e(F,{height:"size-1600",width:"100%",borderTopColor:"dark",borderTopWidth:"thin",children:e(u.Suspense,{fallback:e(he,{}),children:e(qc,{dimensionId:n})})})]})}):null,c?e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-3000",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(F,{flex:!0,children:e(tu,{dimensionId:n})}),e(Pn,{children:e(Yc,{dimension:g.dimension})})]})}):null,o?e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-1600",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(F,{flex:!0,children:e(zc,{dimensionId:n})}),e(Pn,{children:e(Rc,{dimension:g.dimension})})]})}):null,e(F,{borderColor:"dark",borderRadius:"medium",borderWidth:"thin",height:"size-1600",children:s(h,{direction:"row",alignItems:"stretch",height:"100%",children:[e(Xc,{dimensionId:n}),e(Pn,{children:e(Wc,{dimension:g.dimension})})]})})]})})})})})})}const mi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"dataType",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"shape",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"dimensionLoaderQuery",selections:[{alias:"dimension",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[t,l,i,r],type:"Dimension",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"dimensionLoaderQuery",selections:[{alias:"dimension",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[l,i,r],type:"Dimension",abstractKey:null}],storageKey:null}]},params:{cacheID:"03a9aafe3f08a9d093b029ff4a9e3253",id:null,metadata:{},name:"dimensionLoaderQuery",operationKind:"query",text:`query dimensionLoaderQuery(
952
952
  $id: GlobalID!
953
953
  ) {
954
954
  dimension: node(id: $id) {
@@ -963,7 +963,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
963
963
  id
964
964
  }
965
965
  }
966
- `}}}();li.hash="5a662d77e69d2e9bb4eb2af4cad6b722";async function jy(n){const{dimensionId:a}=n.params;return D.fetchQuery(xe,li,{id:a}).toPromise()}const ti=function(){var n={defaultValue:null,kind:"LocalArgument",name:"id"},a={defaultValue:null,kind:"LocalArgument",name:"traceId"},l=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"traceId",variableName:"traceId"}],concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:[{kind:"Literal",name:"first",value:1e3}],concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},{alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:"spans(first:1000)"}],storageKey:null}],type:"Project",abstractKey:null};return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"TraceDetailsQuery",selections:[{alias:"project",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"TraceDetailsQuery",selections:[{alias:"project",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r,{kind:"TypeDiscriminator",abstractKey:"__isNode"},t],storageKey:null}]},params:{cacheID:"22103e9bb1f983529081ca93d60e76ef",id:null,metadata:{},name:"TraceDetailsQuery",operationKind:"query",text:`query TraceDetailsQuery(
966
+ `}}}();mi.hash="5a662d77e69d2e9bb4eb2af4cad6b722";async function ef(n){const{dimensionId:a}=n.params;return I.fetchQuery(xe,mi,{id:a}).toPromise()}const gi=function(){var n={defaultValue:null,kind:"LocalArgument",name:"id"},a={defaultValue:null,kind:"LocalArgument",name:"traceId"},t=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"traceId",variableName:"traceId"}],concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:[{kind:"Literal",name:"first",value:1e3}],concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},{alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:"spans(first:1000)"}],storageKey:null}],type:"Project",abstractKey:null};return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"TraceDetailsQuery",selections:[{alias:"project",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"TraceDetailsQuery",selections:[{alias:"project",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},r,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l],storageKey:null}]},params:{cacheID:"22103e9bb1f983529081ca93d60e76ef",id:null,metadata:{},name:"TraceDetailsQuery",operationKind:"query",text:`query TraceDetailsQuery(
967
967
  $traceId: ID!
968
968
  $id: GlobalID!
969
969
  ) {
@@ -1003,7 +1003,7 @@ fragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {
1003
1003
  id
1004
1004
  }
1005
1005
  }
1006
- `}}}();ti.hash="8b568616f23f7d349cac5a31807463fb";const ii=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},c={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"statusMessage",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},b={alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},k=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"mimeType",storageKey:null}],S={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:k,storageKey:null},v={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:k,storageKey:null},w={alias:null,args:null,kind:"ScalarField",name:"attributes",storageKey:null},L={alias:null,args:null,concreteType:"SpanEvent",kind:"LinkedField",name:"events",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null}],storageKey:null},A={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},x={alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},T={alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},E={alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},R={alias:null,args:null,concreteType:"DocumentEvaluation",kind:"LinkedField",name:"documentEvaluations",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"documentPosition",storageKey:null},r,x,T,E],storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanDetailsQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"InlineFragment",selections:[t,i,r,o,c,d,g,f,m,p,y,b,S,v,w,{kind:"RequiredField",field:L,action:"THROW",path:"span.events"},A,R,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[r],storageKey:null},{args:null,kind:"FragmentSpread",name:"SpanFeedback_annotations"},{args:null,kind:"FragmentSpread",name:"SpanAside_span"}],type:"Span",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanDetailsQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[i,r,o,c,d,g,f,m,p,y,b,S,v,w,L,A,R,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[r,x,T,E,{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},t],storageKey:null},{alias:"code",args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"b1a80a0108c40baebf6e64b811ca0202",id:null,metadata:{},name:"SpanDetailsQuery",operationKind:"query",text:`query SpanDetailsQuery(
1006
+ `}}}();gi.hash="8b568616f23f7d349cac5a31807463fb";const pi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},c={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"statusMessage",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},S=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"mimeType",storageKey:null}],C={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:S,storageKey:null},b={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:S,storageKey:null},T={alias:null,args:null,kind:"ScalarField",name:"attributes",storageKey:null},P={alias:null,args:null,concreteType:"SpanEvent",kind:"LinkedField",name:"events",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null}],storageKey:null},_={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},x={alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},D={alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},A={alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},R={alias:null,args:null,concreteType:"DocumentEvaluation",kind:"LinkedField",name:"documentEvaluations",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"documentPosition",storageKey:null},r,x,D,A],storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanDetailsQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineFragment",selections:[l,i,r,o,c,d,g,f,m,p,y,k,C,b,T,{kind:"RequiredField",field:P,action:"THROW",path:"span.events"},_,R,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[r],storageKey:null},{args:null,kind:"FragmentSpread",name:"SpanFeedback_annotations"},{args:null,kind:"FragmentSpread",name:"SpanAside_span"}],type:"Span",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanDetailsQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,r,o,c,d,g,f,m,p,y,k,C,b,T,P,_,R,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[r,x,D,A,{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},l],storageKey:null},{alias:"code",args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"b1a80a0108c40baebf6e64b811ca0202",id:null,metadata:{},name:"SpanDetailsQuery",operationKind:"query",text:`query SpanDetailsQuery(
1007
1007
  $spanId: GlobalID!
1008
1008
  ) {
1009
1009
  span: node(id: $spanId) {
@@ -1088,7 +1088,7 @@ fragment SpanFeedback_annotations on Span {
1088
1088
  annotatorKind
1089
1089
  }
1090
1090
  }
1091
- `}}}();ii.hash="eaf52d9b37b1f5a29cae360a05b7c975";function ol(n){return u.useMemo(()=>n==="user"||n==="human"?{backgroundColor:"grey-100",borderColor:"grey-500"}:n==="assistant"||n==="ai"?{backgroundColor:"blue-100",borderColor:"blue-700"}:n==="system"?{backgroundColor:"indigo-100",borderColor:"indigo-700"}:["function","tool"].includes(n)?{backgroundColor:"yellow-100",borderColor:"yellow-700"}:{backgroundColor:"grey-100",borderColor:"grey-700"},[n])}function vl(n){return Array.isArray(n)&&n.every(a=>typeof a=="object"&&se.message in a&&au(a[se.message]))}function au(n){return typeof n=="object"&&n!==null&&ve.role in n}const Ea=C`
1091
+ `}}}();pi.hash="eaf52d9b37b1f5a29cae360a05b7c975";function yt(n){return u.useMemo(()=>n==="user"||n==="human"?{backgroundColor:"grey-100",borderColor:"grey-500"}:n==="assistant"||n==="ai"?{backgroundColor:"blue-100",borderColor:"blue-700"}:n==="system"?{backgroundColor:"indigo-100",borderColor:"indigo-700"}:["function","tool"].includes(n)?{backgroundColor:"yellow-100",borderColor:"yellow-700"}:{backgroundColor:"grey-100",borderColor:"grey-700"},[n])}function Lt(n){return Array.isArray(n)&&n.every(a=>typeof a=="object"&&le.message in a&&su(a[le.message]))}function su(n){return typeof n=="object"&&n!==null&&Ce.role in n}const Ma=v`
1092
1092
  display: flex;
1093
1093
  align-items: center;
1094
1094
  .ac-text {
@@ -1098,189 +1098,7 @@ fragment SpanFeedback_annotations on Span {
1098
1098
  overflow: hidden;
1099
1099
  text-overflow: ellipsis;
1100
1100
  }
1101
- `;function De(n){const{name:a,metric:l,k:t,score:i}=n,r=typeof t=="number"?`${l}@${t}`:l,o=u.useMemo(()=>l==="hit"?i?"true":"false":typeof i=="number"&&ze(i)||"--",[i,l]);return s(Le,{delay:500,offset:3,children:[e(kn,{children:e("div",{css:Uo,children:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Bo,{color:"var(--ac-global-color-seafoam-1000)"}),a?e("div",{css:Ea,children:e(K,{weight:"heavy",textSize:"small",color:"inherit",children:a})}):null,e("div",{css:Ea,children:e(K,{textSize:"small",color:"inherit",children:r})}),e("div",{css:Ea,children:e(K,{textSize:"small",children:o})})]})})}),e(aa,{children:s(h,{direction:"row",gap:"size-100",children:[s(K,{weight:"heavy",color:"inherit",children:[a," ",r]}),e(K,{color:"inherit",children:o})]})})]})}const ri=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"projectId"},{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"projectId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null}],type:"Project",abstractKey:null},i=[{kind:"Variable",name:"id",variableName:"spanId"}],r={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null},o={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"EditSpanAnnotationsDialogNewAnnotationQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t],storageKey:null},{alias:"span",args:i,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,r],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"EditSpanAnnotationsDialogNewAnnotationQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[o,l,t],storageKey:null},{alias:"span",args:i,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[o,l,r],storageKey:null}]},params:{cacheID:"4aa13fbe70360943615a8ff4d4b2a06f",id:null,metadata:{},name:"EditSpanAnnotationsDialogNewAnnotationQuery",operationKind:"query",text:`query EditSpanAnnotationsDialogNewAnnotationQuery(
1102
- $projectId: GlobalID!
1103
- $spanId: GlobalID!
1104
- ) {
1105
- project: node(id: $projectId) {
1106
- __typename
1107
- id
1108
- ... on Project {
1109
- spanAnnotationNames
1110
- }
1111
- }
1112
- span: node(id: $spanId) {
1113
- __typename
1114
- id
1115
- ... on Span {
1116
- spanAnnotations {
1117
- id
1118
- name
1119
- annotatorKind
1120
- }
1121
- }
1122
- }
1123
- }
1124
- `}}}();ri.hash="09b2ee5f96c0192a5618ae6c04c321ae";const si=function(){var n={defaultValue:null,kind:"LocalArgument",name:"annotationId"},a={defaultValue:null,kind:"LocalArgument",name:"explanation"},l={defaultValue:null,kind:"LocalArgument",name:"label"},t={defaultValue:null,kind:"LocalArgument",name:"name"},i={defaultValue:null,kind:"LocalArgument",name:"score"},r={defaultValue:null,kind:"LocalArgument",name:"spanId"},o=[{items:[{fields:[{kind:"Variable",name:"annotationId",variableName:"annotationId"},{kind:"Literal",name:"annotatorKind",value:"HUMAN"},{kind:"Variable",name:"explanation",variableName:"explanation"},{kind:"Variable",name:"label",variableName:"label"},{kind:"Variable",name:"name",variableName:"name"},{kind:"Variable",name:"score",variableName:"score"}],kind:"ObjectValue",name:"input.0"}],kind:"ListValue",name:"input"}],c=[{kind:"Variable",name:"id",variableName:"spanId"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:[n,a,l,t,i,r],kind:"Fragment",metadata:null,name:"EditSpanAnnotationsDialogEditAnnotationMutation",selections:[{alias:null,args:o,concreteType:"SpanAnnotationMutationPayload",kind:"LinkedField",name:"patchSpanAnnotations",plural:!1,selections:[{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:c,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[{args:null,kind:"FragmentSpread",name:"EditSpanAnnotationsDialog_spanAnnotations"}],type:"Span",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[r,n,t,l,i,a],kind:"Operation",name:"EditSpanAnnotationsDialogEditAnnotationMutation",selections:[{alias:null,args:o,concreteType:"SpanAnnotationMutationPayload",kind:"LinkedField",name:"patchSpanAnnotations",plural:!1,selections:[{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:c,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},d,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"8b7ea6d08a6f8f06744567701ccb5f34",id:null,metadata:{},name:"EditSpanAnnotationsDialogEditAnnotationMutation",operationKind:"mutation",text:`mutation EditSpanAnnotationsDialogEditAnnotationMutation(
1125
- $spanId: GlobalID!
1126
- $annotationId: GlobalID!
1127
- $name: String!
1128
- $label: String
1129
- $score: Float
1130
- $explanation: String
1131
- ) {
1132
- patchSpanAnnotations(input: [{annotationId: $annotationId, name: $name, label: $label, score: $score, explanation: $explanation, annotatorKind: HUMAN}]) {
1133
- query {
1134
- node(id: $spanId) {
1135
- __typename
1136
- ... on Span {
1137
- ...EditSpanAnnotationsDialog_spanAnnotations
1138
- }
1139
- __isNode: __typename
1140
- id
1141
- }
1142
- }
1143
- }
1144
- }
1145
-
1146
- fragment EditSpanAnnotationsDialog_spanAnnotations on Span {
1147
- id
1148
- spanAnnotations {
1149
- id
1150
- name
1151
- annotatorKind
1152
- score
1153
- label
1154
- explanation
1155
- }
1156
- }
1157
- `}}}();si.hash="46647cda8c9874c89d8a4034bf82fe14";const oi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"EditSpanAnnotationsDialogSpanAnnotationsQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"EditSpanAnnotationsDialog_spanAnnotations"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"EditSpanAnnotationsDialogSpanAnnotationsQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"8649eb1dd42a29a0d38b9a1538490de4",id:null,metadata:{},name:"EditSpanAnnotationsDialogSpanAnnotationsQuery",operationKind:"query",text:`query EditSpanAnnotationsDialogSpanAnnotationsQuery(
1158
- $id: GlobalID!
1159
- ) {
1160
- node(id: $id) {
1161
- __typename
1162
- ...EditSpanAnnotationsDialog_spanAnnotations
1163
- __isNode: __typename
1164
- id
1165
- }
1166
- }
1167
-
1168
- fragment EditSpanAnnotationsDialog_spanAnnotations on Span {
1169
- id
1170
- spanAnnotations {
1171
- id
1172
- name
1173
- annotatorKind
1174
- score
1175
- label
1176
- explanation
1177
- }
1178
- }
1179
- `}}}();oi.hash="07aedb847a2af03a77823f0afc0c98d4";const di=function(){var n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:oi,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"EditSpanAnnotationsDialog_spanAnnotations",selections:[n,{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}}();di.hash="07aedb847a2af03a77823f0afc0c98d4";const ci=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"EditSpanAnnotationsDialogQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"InlineFragment",selections:[{args:null,kind:"FragmentSpread",name:"EditSpanAnnotationsDialog_spanAnnotations"}],type:"Span",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"EditSpanAnnotationsDialogQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"532b3c148c3bf1411b8820714c68f4e3",id:null,metadata:{},name:"EditSpanAnnotationsDialogQuery",operationKind:"query",text:`query EditSpanAnnotationsDialogQuery(
1180
- $spanId: GlobalID!
1181
- ) {
1182
- span: node(id: $spanId) {
1183
- __typename
1184
- id
1185
- ... on Span {
1186
- ...EditSpanAnnotationsDialog_spanAnnotations
1187
- }
1188
- }
1189
- }
1190
-
1191
- fragment EditSpanAnnotationsDialog_spanAnnotations on Span {
1192
- id
1193
- spanAnnotations {
1194
- id
1195
- name
1196
- annotatorKind
1197
- score
1198
- label
1199
- explanation
1200
- }
1201
- }
1202
- `}}}();ci.hash="36093f4285a168993ec87fd6aac82365";const ui=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"},{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{items:[{kind:"Variable",name:"input.0",variableName:"input"}],kind:"ListValue",name:"input"}],l=[{kind:"Variable",name:"id",variableName:"spanId"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"NewSpanAnnotationFormMutation",selections:[{alias:null,args:a,concreteType:"SpanAnnotationMutationPayload",kind:"LinkedField",name:"createSpanAnnotations",plural:!1,selections:[{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[{args:null,kind:"FragmentSpread",name:"EditSpanAnnotationsDialog_spanAnnotations"}],type:"Span",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"NewSpanAnnotationFormMutation",selections:[{alias:null,args:a,concreteType:"SpanAnnotationMutationPayload",kind:"LinkedField",name:"createSpanAnnotations",plural:!1,selections:[{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"d6f016f4dfb0c142854c3ecd840b09f5",id:null,metadata:{},name:"NewSpanAnnotationFormMutation",operationKind:"mutation",text:`mutation NewSpanAnnotationFormMutation(
1203
- $input: CreateSpanAnnotationInput!
1204
- $spanId: GlobalID!
1205
- ) {
1206
- createSpanAnnotations(input: [$input]) {
1207
- query {
1208
- node(id: $spanId) {
1209
- __typename
1210
- ... on Span {
1211
- ...EditSpanAnnotationsDialog_spanAnnotations
1212
- }
1213
- __isNode: __typename
1214
- id
1215
- }
1216
- }
1217
- }
1218
- }
1219
-
1220
- fragment EditSpanAnnotationsDialog_spanAnnotations on Span {
1221
- id
1222
- spanAnnotations {
1223
- id
1224
- name
1225
- annotatorKind
1226
- score
1227
- label
1228
- explanation
1229
- }
1230
- }
1231
- `}}}();ui.hash="ded0a7a64a2706f6ec472a63c1c57eca";const lu=C`
1232
- color: var(--ac-global-text-color-900);
1233
- font-size: 12px;
1234
- `;function mi(n){const{initialData:a,isReadOnly:l,onSubmit:t,isSubmitting:i=!1}=n,{control:r,handleSubmit:o,formState:{isDirty:c,isValid:d},setError:g,reset:f}=Ie({defaultValues:a,disabled:l}),m=u.useCallback(y=>{const b=!y.label,k=y.score===""||y.score==null;if(b&&k){g("label",{type:"manual",message:"Label or score is required"}),g("score",{type:"manual",message:"Label or score is required"});return}const S={...y,score:y.score!=null?parseFloat(y.score.toString()):null};t&&t(S),f(S)},[t,g,f]),p=l;return s(ye,{onSubmit:o(m),children:[e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-100",children:[s("div",{css:C`
1235
- display: flex;
1236
- flex-direction: row;
1237
- width: 100%;
1238
- overflow: hidden;
1239
- gap: var(--ac-global-dimension-size-100);
1240
- & > * {
1241
- flex: 1 1 auto;
1242
- }
1243
- .ac-textfield {
1244
- min-width: 0;
1245
- }
1246
- `,children:[e(G,{name:"label",control:r,render:({field:{onChange:y,onBlur:b,value:k},fieldState:{invalid:S,error:v}})=>e(X,{label:"Label",placeholder:"e.x. good, bad",description:"A categorical label like 'good' or 'bad'",isReadOnly:l,errorMessage:v==null?void 0:v.message,validationState:S?"invalid":"valid",onChange:y,onBlur:b,value:(k==null?void 0:k.toString())||""})}),e(G,{name:"score",control:r,render:({field:{onChange:y,onBlur:b,value:k},fieldState:{invalid:S,error:v}})=>e(X,{label:"Score",type:"number",placeholder:"e.x. 0.8",description:"A numeric grade",errorMessage:v==null?void 0:v.message,isReadOnly:l,validationState:S?"invalid":"valid",onChange:y,onBlur:b,value:(k==null?void 0:k.toString())||""})})]}),s("details",{open:!p,css:lu,children:[e("summary",{children:"Annotation Details"}),e(F,{paddingTop:"size-50",children:e(G,{name:"explanation",control:r,render:({field:{onChange:y,onBlur:b,value:k},fieldState:{invalid:S,error:v}})=>e(ka,{label:"Explanation",height:70,isReadOnly:l,description:"Why this score or label was given",errorMessage:v==null?void 0:v.message,validationState:S?"invalid":"valid",onChange:y,onBlur:b,value:(k==null?void 0:k.toString())||""})})})]})]})}),e(U,{children:l?null:e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingEnd:"size-200",paddingStart:"size-200",borderTopWidth:"thin",borderColor:"dark",children:e(h,{direction:"row",justifyContent:"end",children:e(M,{variant:c?"primary":"default",type:"submit",size:"compact",disabled:!d||!c||i,children:i?"Saving...":"Save"})})})})]})}function tu(n){const{annotationName:a,spanNodeId:l,onCreated:t}=n,[i,r]=D.useMutation(ui);return e(mi,{initialData:{name:a},isSubmitting:r,onSubmit:c=>{i({variables:{input:{spanId:l,annotatorKind:"HUMAN",...c},spanId:l},onCompleted:()=>{t()}})}})}const gi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"annotationId"},{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{fields:[{items:[{kind:"Variable",name:"annotationIds.0",variableName:"annotationId"}],kind:"ListValue",name:"annotationIds"}],kind:"ObjectValue",name:"input"}],l=[{kind:"Variable",name:"id",variableName:"spanId"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanAnnotationActionMenuDeleteMutation",selections:[{alias:null,args:a,concreteType:"SpanAnnotationMutationPayload",kind:"LinkedField",name:"deleteSpanAnnotations",plural:!1,selections:[{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[{args:null,kind:"FragmentSpread",name:"EditSpanAnnotationsDialog_spanAnnotations"}],type:"Span",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanAnnotationActionMenuDeleteMutation",selections:[{alias:null,args:a,concreteType:"SpanAnnotationMutationPayload",kind:"LinkedField",name:"deleteSpanAnnotations",plural:!1,selections:[{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"422687a283120080277d2649c1b9f6ee",id:null,metadata:{},name:"SpanAnnotationActionMenuDeleteMutation",operationKind:"mutation",text:`mutation SpanAnnotationActionMenuDeleteMutation(
1247
- $annotationId: GlobalID!
1248
- $spanId: GlobalID!
1249
- ) {
1250
- deleteSpanAnnotations(input: {annotationIds: [$annotationId]}) {
1251
- query {
1252
- node(id: $spanId) {
1253
- __typename
1254
- ... on Span {
1255
- ...EditSpanAnnotationsDialog_spanAnnotations
1256
- }
1257
- __isNode: __typename
1258
- id
1259
- }
1260
- }
1261
- }
1262
- }
1263
-
1264
- fragment EditSpanAnnotationsDialog_spanAnnotations on Span {
1265
- id
1266
- spanAnnotations {
1267
- id
1268
- name
1269
- annotatorKind
1270
- score
1271
- label
1272
- explanation
1273
- }
1274
- }
1275
- `}}}();gi.hash="a898fcb037b08cb626daaf3d385588ce";function iu(n){const{onDelete:a,isDisabled:l=!1}=n;return e("div",{onClick:t=>{t.preventDefault(),t.stopPropagation()},children:e(Be,{align:"end",buttonSize:"compact",isDisabled:l,onAction:t=>{switch(t){case"deleteAnnotation":a();break}},children:e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.TrashOutline,{})}),e(K,{children:"Delete"})]})},"deleteAnnotation")})})}function ru(n){const{annotationId:a,spanNodeId:l,annotationName:t,onSpanAnnotationActionSuccess:i,onSpanAnnotationActionError:r}=n,[o,c]=u.useState(null),[d,g]=D.useMutation(gi),f=u.useCallback(()=>{u.startTransition(()=>{d({variables:{annotationId:a,spanId:l},onCompleted:()=>{i({title:"Annotation Deleted",message:`Annotation ${t} has been deleted.`})},onError:p=>{r(p)}})})},[d,a,l,i,t,r]),m=u.useCallback(()=>{c(s(H,{size:"S",title:"Delete Annotation",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:`Are you sure you want to delete annotation ${t}? This cannot be undone.`})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(M,{variant:"danger",onClick:()=>{f(),c(null)},children:"Delete Annotation"})})})]}))},[f,t]);return s("div",{children:[e(iu,{onDelete:m,isDisabled:g}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>c(null),children:o})]})}function su(n){const{projectId:a,spanNodeId:l}=n,[t,i]=u.useState(null),r=oe();return e(H,{title:"Annotate",size:"M",isDismissable:!0,extra:e(ou,{projectId:a,spanNodeId:l,disabled:t!==null,onAnnotationNameSelect:i}),children:s("div",{css:C`
1276
- height: 100%;
1277
- overflow-y: auto;
1278
- padding: var(--ac-global-dimension-size-200);
1279
- `,children:[t&&e(F,{paddingBottom:"size-200",children:e(mu,{spanNodeId:l,name:t,onDelete:()=>{i(null)},onCreated:()=>{i(null),r({title:"New Span Annotation",message:`Annotation ${t} has been created.`})}})}),e(u.Suspense,{children:e(cu,{...n})})]})})}function ou(n){const{projectId:a,disabled:l=!1,spanNodeId:t,onAnnotationNameSelect:i}=n,[r,o]=u.useState(!1);return s(tn,{placement:"bottom end",crossOffset:300,isOpen:r,onOpenChange:c=>{o(c)},children:[e(M,{variant:"default",disabled:l,size:"compact",icon:e(P,{svg:e(I.PlusCircleOutline,{})}),onClick:()=>{o(!0)},children:"New"}),e(du,{projectId:a,spanNodeId:t,onAnnotationNameSelect:c=>{i(c),o(!1)}})]})}function du(n){const{projectId:a,spanNodeId:l,onAnnotationNameSelect:t}=n;return e(V,{title:"New Annotation",backgroundColor:"light",borderColor:"light",variant:"compact",bodyStyle:{padding:0},children:e(u.Suspense,{children:e(pu,{projectId:a,spanId:l,onAnnotationNameSelect:t})})})}function cu(n){const a=D.useLazyLoadQuery(ci,{spanId:n.spanNodeId},{fetchPolicy:"store-and-network"});return e(uu,{span:a.span})}function uu(n){const{span:a}=n,[l]=D.useRefetchableFragment(di,a),t=l.spanAnnotations||[],i=t.length>0;return s("div",{children:[!i&&e(Hl,{graphicKey:"documents",message:"No annotations for this span"}),e("ul",{css:C`
1280
- display: flex;
1281
- flex-direction: column;
1282
- gap: var(--ac-global-dimension-size-200);
1283
- `,children:t.map((r,o)=>e("li",{children:e(gu,{annotation:r,spanNodeId:l.id})},`${o}_${r.name}`))})]})}function mu(n){const{spanNodeId:a,name:l,onDelete:t,onCreated:i}=n;return s(V,{variant:"compact",title:l,borderColor:"orange-900",extra:s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(pi,{kind:"HUMAN"}),e(M,{variant:"default",size:"compact",isDisabled:!0,"aria-label":"delete annotation",icon:e(P,{svg:e(I.CloseOutline,{})}),onClick:t})]}),bodyStyle:{padding:0},children:[e(ne,{variant:"info",banner:!0,children:"Fill out the fields below and click save to create a new annotation."}),e(tu,{annotationName:l,spanNodeId:a,onCreated:i})]})}function gu(n){const{annotation:a,spanNodeId:l}=n,[t,i]=u.useState(null),r=oe(),[o,c]=D.useMutation(si),d=u.useCallback(g=>{u.startTransition(()=>{o({variables:{annotationId:a.id,spanId:l,...g},onCompleted:()=>{r({title:"Annotation Updated",message:`Annotation ${a.name} has been updated.`})},onError:f=>{i(f)}})})},[a.id,a.name,o,r,l]);return s(V,{variant:"compact",title:a.name,titleExtra:a.label||typeof a.score=="number"&&ze(a.score)||null,collapsible:!0,bodyStyle:{padding:0},extra:s(h,{gap:"size-100",alignItems:"center",children:[e(pi,{kind:a.annotatorKind}),e(ru,{annotationId:a.id,spanNodeId:l,annotationName:a.name,onSpanAnnotationActionSuccess:g=>{r(g)},onSpanAnnotationActionError:g=>{i(g)}})]}),children:[t&&e(ne,{variant:"danger",banner:!0,children:t.message}),e(mi,{initialData:a,isReadOnly:a.annotatorKind==="LLM",isSubmitting:c,onSubmit:g=>{d(g)}})]})}function pi(n){const{kind:a}=n;return e(Xn,{color:a==="HUMAN"?"blue-900":"orange-900",children:a})}function pu(n){const{projectId:a,spanId:l,onAnnotationNameSelect:t}=n,i=D.useLazyLoadQuery(ri,{projectId:a,spanId:l}),[r,o]=u.useState(""),c=u.useMemo(()=>{var f,m;return((m=(f=i==null?void 0:i.span)==null?void 0:f.spanAnnotations)==null?void 0:m.map(p=>p.name))||[]},[i.span.spanAnnotations]),d=u.useMemo(()=>(i.project.spanAnnotationNames||[]).filter(m=>!c.includes(m)),[i.project.spanAnnotationNames,c]),g=d.length>0;return s(U,{children:[e(F,{padding:"size-200",children:s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(X,{label:"Annotation Name",value:r,placeholder:"e.x. correctness",onChange:f=>{o(f)}}),e(M,{variant:"primary",onClick:()=>{t(r)},children:"Create"})]})}),g&&s(U,{children:[e(F,{borderTopWidth:"thin",borderBottomWidth:"thin",borderColor:"light",paddingStart:"size-200",paddingTop:"size-100",paddingBottom:"size-100",backgroundColor:"grey-300",children:e("label",{children:"select from existing"})}),e(na,{selectionMode:"single",onSelectionChange:f=>{if(f==="all"||f.size===0)return;const p=f.values().next().value;o(p||"")},disabledKeys:c,children:d.map(f=>e(B,{children:f},f))})]})]})}function yu(n){const{spanNodeId:a,projectId:l}=n,[t,i]=u.useState(null);return s(U,{children:[e(M,{variant:"default",icon:e(P,{svg:e(I.EditOutline,{})}),onClick:()=>i(e(su,{spanNodeId:a,projectId:l})),children:"Annotate"}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>i(null),children:t})]})}const yi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanAsideSpanQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"SpanAside_span"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanAsideSpanQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[{alias:"code",args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"878027b90513af8f947e6aa408450057",id:null,metadata:{},name:"SpanAsideSpanQuery",operationKind:"query",text:`query SpanAsideSpanQuery(
1101
+ `;function Ie(n){const{name:a,metric:t,k:l,score:i}=n,r=typeof l=="number"?`${t}@${l}`:t,o=u.useMemo(()=>t==="hit"?i?"true":"false":typeof i=="number"&&Ze(i)||"--",[i,t]);return s(we,{delay:500,offset:3,children:[e(hn,{children:e("div",{css:Ho,children:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Go,{color:"var(--ac-global-color-seafoam-1000)"}),a?e("div",{css:Ma,children:e(K,{weight:"heavy",textSize:"small",color:"inherit",children:a})}):null,e("div",{css:Ma,children:e(K,{textSize:"small",color:"inherit",children:r})}),e("div",{css:Ma,children:e(K,{textSize:"small",children:o})})]})})}),e(ia,{children:s(h,{direction:"row",gap:"size-100",children:[s(K,{weight:"heavy",color:"inherit",children:[a," ",r]}),e(K,{color:"inherit",children:o})]})})]})}function ou(n){const{spanNodeId:a,projectId:t}=n,[l,i]=u.useState(null);return s(H,{children:[e(N,{variant:"default",icon:e(w,{svg:e(L.EditOutline,{})}),onClick:()=>i(e(il,{spanNodeId:a,projectId:t})),children:"Annotate"}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>i(null),children:l})]})}const yi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanAsideSpanQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"SpanAside_span"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanAsideSpanQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[{alias:"code",args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"878027b90513af8f947e6aa408450057",id:null,metadata:{},name:"SpanAsideSpanQuery",operationKind:"query",text:`query SpanAsideSpanQuery(
1284
1102
  $id: GlobalID!
1285
1103
  ) {
1286
1104
  node(id: $id) {
@@ -1307,22 +1125,22 @@ fragment SpanAside_span on Span {
1307
1125
  score
1308
1126
  }
1309
1127
  }
1310
- `}}}();yi.hash="cb5cab60889623d77ad0c96c98b3f8ac";const fi=function(){var n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:yi,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"SpanAside_span",selections:[n,{alias:"code",args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}}();fi.hash="cb5cab60889623d77ad0c96c98b3f8ac";const fu=C`
1128
+ `}}}();yi.hash="cb5cab60889623d77ad0c96c98b3f8ac";const fi=function(){var n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:yi,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"SpanAside_span",selections:[n,{alias:"code",args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null}}();fi.hash="cb5cab60889623d77ad0c96c98b3f8ac";const du=v`
1311
1129
  display: flex;
1312
1130
  padding-top: var(--ac-global-dimension-size-50);
1313
1131
  flex-direction: column;
1314
1132
  gap: var(--ac-global-dimension-size-100);
1315
1133
  align-items: flex-start;
1316
- `;function hu(n){const[a]=D.useRefetchableFragment(fi,n.span),{startTime:l,endTime:t,code:i,tokenCountCompletion:r,tokenCountPrompt:o,tokenCountTotal:c}=a,d=u.useMemo(()=>new Date(l),[l]),g=u.useMemo(()=>t?new Date(t):null,[t]),f=u.useMemo(()=>g?g.getTime()-d.getTime():null,[g,d]),m=Zl(i),p=a.spanAnnotations,y=p.length>0;return e(F,{padding:"size-200",borderColor:"dark",backgroundColor:"dark",borderLeftWidth:"thin",width:"230px",flex:"none",minHeight:"100%",children:s(h,{direction:"column",gap:"size-200",children:[e(Tn,{label:"Status",children:s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(Ca,{statusCode:i}),e(K,{textSize:"xlarge",color:m,children:i})]})}),e(Tn,{label:"Start Time",children:e(K,{textSize:"xlarge",children:Qe(d)})}),g&&e(Tn,{label:"End Time",children:e(K,{textSize:"xlarge",children:Qe(g)})}),e(Tn,{label:"Latency",children:e(K,{textSize:"xlarge",children:typeof f=="number"?e(we,{latencyMs:f,textSize:"xlarge"}):"--"})}),c?e(Tn,{label:"Total Tokens",children:e(Fa,{tokenCountTotal:c,tokenCountPrompt:o??0,tokenCountCompletion:r??0,textSize:"xlarge"})},"tokens"):null,y&&e(Tn,{label:"Feedback",children:e("ul",{css:fu,children:p.map(b=>e("li",{children:e(xn,{annotation:b,annotationDisplayPreference:"label"})},b.id))})})]})})}function Tn({label:n,children:a}){return s(h,{direction:"column",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:n}),a]})}function ku(n){const{spanId:a,traceId:l}=n;return e("div",{css:C`
1134
+ `;function cu(n){const[a]=I.useRefetchableFragment(fi,n.span),{startTime:t,endTime:l,code:i,tokenCountCompletion:r,tokenCountPrompt:o,tokenCountTotal:c}=a,d=u.useMemo(()=>new Date(t),[t]),g=u.useMemo(()=>l?new Date(l):null,[l]),f=u.useMemo(()=>g?g.getTime()-d.getTime():null,[g,d]),m=rl(i),p=a.spanAnnotations,y=p.length>0;return e(F,{padding:"size-200",borderColor:"dark",backgroundColor:"dark",borderLeftWidth:"thin",width:"230px",flex:"none",minHeight:"100%",children:s(h,{direction:"column",gap:"size-200",children:[e(In,{label:"Status",children:s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(xa,{statusCode:i}),e(K,{textSize:"xlarge",color:m,children:i})]})}),e(In,{label:"Start Time",children:e(K,{textSize:"xlarge",children:Qe(d)})}),g&&e(In,{label:"End Time",children:e(K,{textSize:"xlarge",children:Qe(g)})}),e(In,{label:"Latency",children:e(K,{textSize:"xlarge",children:typeof f=="number"?e(Ee,{latencyMs:f,textSize:"xlarge"}):"--"})}),c?e(In,{label:"Total Tokens",children:e(Ta,{tokenCountTotal:c,tokenCountPrompt:o??0,tokenCountCompletion:r??0,textSize:"xlarge"})},"tokens"):null,y&&e(In,{label:"Feedback",children:e("ul",{css:du,children:p.map(k=>e("li",{children:e(xn,{annotation:k,annotationDisplayPreference:"label"})},k.id))})})]})})}function In({label:n,children:a}){return s(h,{direction:"column",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:n}),a]})}function uu(n){const{spanId:a,traceId:t}=n;return e("div",{css:v`
1317
1135
  button.ac-dropdown-button {
1318
1136
  min-width: 50px;
1319
1137
  .ac-dropdown-button__text {
1320
1138
  padding-right: 10px;
1321
1139
  }
1322
1140
  }
1323
- `,children:s(tn,{placement:"bottom right",children:[e(Ja,{addonBefore:e(P,{svg:e(I.Code,{})}),children:"Code"}),e(ha,{children:e(F,{padding:"size-200",children:s(ye,{children:[s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(X,{label:"Span ID",isReadOnly:!0,value:a}),e(le,{text:a,size:"default"})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(X,{label:"Trace ID",isReadOnly:!0,value:l}),e(le,{text:l,size:"default"})]})]})})})]})})}const hi={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"SpanFeedback_annotations",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null};hi.hash="6199ecd4f0143cffbaa2fe5e19a8739c";function bu(){const[n,a]=u.useState(null);return s(F,{padding:"size-200",children:[s(h,{direction:"column",gap:"size-100",alignItems:"center",children:[e(ba,{graphicKey:"documents"}),e(K,{children:"No annotations for this span"}),e(M,{variant:"default",size:"compact",onClick:()=>{a(e(H,{title:"Span Annotations",isDismissable:!0,children:s(F,{padding:"size-200",children:[e("p",{css:C`
1141
+ `,children:s(Cn,{placement:"bottom right",children:[e(et,{addonBefore:e(w,{svg:e(L.Code,{})}),children:"Code"}),e(Sa,{children:e(F,{padding:"size-200",children:s(fe,{children:[s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(G,{label:"Span ID",isReadOnly:!0,value:a}),e(ae,{text:a,size:"default"})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(G,{label:"Trace ID",isReadOnly:!0,value:t}),e(ae,{text:t,size:"default"})]})]})})})]})})}const hi={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"SpanFeedback_annotations",selections:[{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null};hi.hash="6199ecd4f0143cffbaa2fe5e19a8739c";function mu(){const[n,a]=u.useState(null);return s(F,{padding:"size-200",children:[s(h,{direction:"column",gap:"size-100",alignItems:"center",children:[e(Ca,{graphicKey:"documents"}),e(K,{children:"No annotations for this span"}),e(N,{variant:"default",size:"compact",onClick:()=>{a(e(B,{title:"Span Annotations",isDismissable:!0,children:s(F,{padding:"size-200",children:[e("p",{css:v`
1324
1142
  margin: 0 0 var(--ac-global-dimension-size-100) 0;
1325
- `,children:"Annotations are pivotal for tracking and improving the performance of your application. Phoenix allows for both LLM and HUMAN annotations."}),e(je,{href:"https://docs.arize.com/phoenix/tracing/concepts-tracing/how-to-evaluate-traces",children:"View annotation documentation"})]})}))},icon:e(P,{svg:e(I.Edit2Outline,{})}),children:"How to Annotate"})]}),e(W,{onDismiss:()=>a(null),isDismissable:!0,children:n})]})}const Su=[{header:"name",accessorKey:"name",size:100},{header:"label",accessorKey:"label",size:100},{header:"score",accessorKey:"score",size:100},{header:"explanation",accessorKey:"explanation",cell:Ho,size:400}];function Cl({annotations:n}){const a=u.useMemo(()=>[...n],[n]),l=he({columns:Su,data:a,getCoreRowModel:ke()}),i=l.getRowModel().rows.length===0;return s("table",{css:We,children:[e("thead",{children:l.getHeaderGroups().map(r=>e("tr",{children:r.headers.map(o=>e("th",{colSpan:o.colSpan,children:o.isPlaceholder?null:e(U,{children:Z(o.column.columnDef.header,o.getContext())})},o.id))},r.id))}),i?e(Je,{}):e("tbody",{children:l.getRowModel().rows.map(r=>e("tr",{children:r.getVisibleCells().map(o=>e("td",{style:{width:o.column.getSize()},children:Z(o.column.columnDef.cell,o.getContext())},o.id))},r.id))})]})}function vu({span:n}){const a=D.useFragment(hi,n),l=u.useMemo(()=>a.spanAnnotations.filter(r=>r.annotatorKind==="HUMAN"),[a.spanAnnotations]),t=u.useMemo(()=>a.spanAnnotations.filter(r=>r.annotatorKind==="LLM"),[a.spanAnnotations]);return a.spanAnnotations.length>0?s(Ee,{children:[e(de,{id:"evaluations",title:"Evaluations",children:e(Cl,{annotations:t})}),e(de,{id:"human",title:"Human Annotations",children:e(Cl,{annotations:l})})]}):e(bu,{})}function Cu(n){return n==="__REDACTED__"}const Fu=C`
1143
+ `,children:"Annotations are pivotal for tracking and improving the performance of your application. Phoenix allows for both LLM and HUMAN annotations."}),e(je,{href:"https://docs.arize.com/phoenix/tracing/concepts-tracing/how-to-evaluate-traces",children:"View annotation documentation"})]})}))},icon:e(w,{svg:e(L.Edit2Outline,{})}),children:"How to Annotate"})]}),e(W,{onDismiss:()=>a(null),isDismissable:!0,children:n})]})}const gu=[{header:"name",accessorKey:"name",size:100},{header:"label",accessorKey:"label",size:100},{header:"score",accessorKey:"score",size:100},{header:"explanation",accessorKey:"explanation",cell:Wo,size:400}];function wt({annotations:n}){const a=u.useMemo(()=>[...n],[n]),t=ke({columns:gu,data:a,getCoreRowModel:be()}),i=t.getRowModel().rows.length===0;return s("table",{css:He,children:[e("thead",{children:t.getHeaderGroups().map(r=>e("tr",{children:r.headers.map(o=>e("th",{colSpan:o.colSpan,children:o.isPlaceholder?null:e(H,{children:X(o.column.columnDef.header,o.getContext())})},o.id))},r.id))}),i?e(Ge,{}):e("tbody",{children:t.getRowModel().rows.map(r=>e("tr",{children:r.getVisibleCells().map(o=>e("td",{style:{width:o.column.getSize()},children:X(o.column.columnDef.cell,o.getContext())},o.id))},r.id))})]})}function pu({span:n}){const a=I.useFragment(hi,n),t=u.useMemo(()=>a.spanAnnotations.filter(r=>r.annotatorKind==="HUMAN"),[a.spanAnnotations]),l=u.useMemo(()=>a.spanAnnotations.filter(r=>r.annotatorKind==="LLM"),[a.spanAnnotations]);return a.spanAnnotations.length>0?s(Re,{children:[e(de,{id:"evaluations",title:"Evaluations",children:e(wt,{annotations:l})}),e(de,{id:"human",title:"Human Annotations",children:e(wt,{annotations:t})})]}):e(mu,{})}function yu(n){return n==="__REDACTED__"}const fu=v`
1326
1144
  position: relative;
1327
1145
  overflow: hidden;
1328
1146
  width: 200px;
@@ -1361,7 +1179,7 @@ fragment SpanAside_span on Span {
1361
1179
  object-fit: cover;
1362
1180
  }
1363
1181
  }
1364
- `;function Ku(n){const[a,l]=u.useState(!1);let t;const i=Cu(n.url);return i?t=e(xu,{}):t=e("img",{src:n.url}),s("div",{className:Vs({"is-expanded":a}),css:Fu,children:[!i&&e(M,{variant:"default",size:"compact",onClick:()=>l(!a),icon:e(P,{svg:a?e(I.CollapseOutline,{}):e(I.ExpandOutline,{})}),"aria-label":"Expand / Collapse Image"}),t]})}const xu=()=>s("svg",{width:"130",height:"130",viewBox:"0 0 130 130",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{x:"1.5",y:"1.5",width:"127",height:"127",rx:"6.5",strokeOpacity:"0.8",strokeWidth:"3"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40 27.5H90C96.8917 27.5 102.5 33.1083 102.5 40V90C102.5 96.8917 96.8917 102.5 90 102.5H40C33.1083 102.5 27.5 96.8917 27.5 90V40C27.5 33.1083 33.1083 27.5 40 27.5ZM40 35.8333H90C92.3 35.8333 94.1667 37.7 94.1667 40V74.85L80.8208 63.4667C76.6958 59.9583 70.2417 59.9583 66.1542 63.4417L35.8333 88.7417V40C35.8333 37.7 37.7 35.8333 40 35.8333ZM54.5833 50.4167C54.5833 53.8667 51.7833 56.6667 48.3333 56.6667C44.8833 56.6667 42.0833 53.8667 42.0833 50.4167C42.0833 46.9667 44.8833 44.1667 48.3333 44.1667C51.7833 44.1667 54.5833 46.9667 54.5833 50.4167ZM42.3375 94.1667H90C92.3 94.1667 94.1667 92.3 94.1667 90V85.8083L75.4125 69.8083C74.4083 68.9458 72.55 68.9417 71.525 69.8125L42.3375 94.1667Z",fill:"var(--ac-global-color-grey-300)"})]}),ki=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"addExamplesToDataset",plural:!1,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"dataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanToDatasetExampleDialogAddExampleToDatasetMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanToDatasetExampleDialogAddExampleToDatasetMutation",selections:a},params:{cacheID:"d93c9d47668fc266ba09ecb14c2b72ae",id:null,metadata:{},name:"SpanToDatasetExampleDialogAddExampleToDatasetMutation",operationKind:"mutation",text:`mutation SpanToDatasetExampleDialogAddExampleToDatasetMutation(
1182
+ `;function hu(n){const[a,t]=u.useState(!1);let l;const i=yu(n.url);return i?l=e(ku,{}):l=e("img",{src:n.url}),s("div",{className:$s({"is-expanded":a}),css:fu,children:[!i&&e(N,{variant:"default",size:"compact",onClick:()=>t(!a),icon:e(w,{svg:a?e(L.CollapseOutline,{}):e(L.ExpandOutline,{})}),"aria-label":"Expand / Collapse Image"}),l]})}const ku=()=>s("svg",{width:"130",height:"130",viewBox:"0 0 130 130",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{x:"1.5",y:"1.5",width:"127",height:"127",rx:"6.5",strokeOpacity:"0.8",strokeWidth:"3"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40 27.5H90C96.8917 27.5 102.5 33.1083 102.5 40V90C102.5 96.8917 96.8917 102.5 90 102.5H40C33.1083 102.5 27.5 96.8917 27.5 90V40C27.5 33.1083 33.1083 27.5 40 27.5ZM40 35.8333H90C92.3 35.8333 94.1667 37.7 94.1667 40V74.85L80.8208 63.4667C76.6958 59.9583 70.2417 59.9583 66.1542 63.4417L35.8333 88.7417V40C35.8333 37.7 37.7 35.8333 40 35.8333ZM54.5833 50.4167C54.5833 53.8667 51.7833 56.6667 48.3333 56.6667C44.8833 56.6667 42.0833 53.8667 42.0833 50.4167C42.0833 46.9667 44.8833 44.1667 48.3333 44.1667C51.7833 44.1667 54.5833 46.9667 54.5833 50.4167ZM42.3375 94.1667H90C92.3 94.1667 94.1667 92.3 94.1667 90V85.8083L75.4125 69.8083C74.4083 68.9458 72.55 68.9417 71.525 69.8125L42.3375 94.1667Z",fill:"var(--ac-global-color-grey-300)"})]}),ki=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"addExamplesToDataset",plural:!1,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"dataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanToDatasetExampleDialogAddExampleToDatasetMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanToDatasetExampleDialogAddExampleToDatasetMutation",selections:a},params:{cacheID:"d93c9d47668fc266ba09ecb14c2b72ae",id:null,metadata:{},name:"SpanToDatasetExampleDialogAddExampleToDatasetMutation",operationKind:"mutation",text:`mutation SpanToDatasetExampleDialogAddExampleToDatasetMutation(
1365
1183
  $input: AddExamplesToDatasetInput!
1366
1184
  ) {
1367
1185
  addExamplesToDataset(input: $input) {
@@ -1370,7 +1188,7 @@ fragment SpanAside_span on Span {
1370
1188
  }
1371
1189
  }
1372
1190
  }
1373
- `}}}();ki.hash="75120065d239f28304e9dd91fc34bec9";const bi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],l={kind:"InlineFragment",selections:[{alias:"revision",args:null,concreteType:"SpanAsExampleRevision",kind:"LinkedField",name:"asExampleRevision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanToDatasetExampleDialogQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null},{args:null,kind:"FragmentSpread",name:"DatasetPicker__datasets"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanToDatasetExampleDialogQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},t],storageKey:null},{alias:null,args:null,concreteType:"DatasetConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"dataset",args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"340325aadd2b2d81cb509e6b6bee7f0b",id:null,metadata:{},name:"SpanToDatasetExampleDialogQuery",operationKind:"query",text:`query SpanToDatasetExampleDialogQuery(
1191
+ `}}}();ki.hash="75120065d239f28304e9dd91fc34bec9";const bi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],t={kind:"InlineFragment",selections:[{alias:"revision",args:null,concreteType:"SpanAsExampleRevision",kind:"LinkedField",name:"asExampleRevision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null}],type:"Span",abstractKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanToDatasetExampleDialogQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null},{args:null,kind:"FragmentSpread",name:"DatasetPicker__datasets"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanToDatasetExampleDialogQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l],storageKey:null},{alias:null,args:null,concreteType:"DatasetConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"dataset",args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"340325aadd2b2d81cb509e6b6bee7f0b",id:null,metadata:{},name:"SpanToDatasetExampleDialogQuery",operationKind:"query",text:`query SpanToDatasetExampleDialogQuery(
1374
1192
  $spanId: GlobalID!
1375
1193
  ) {
1376
1194
  span: node(id: $spanId) {
@@ -1412,7 +1230,7 @@ fragment DatasetPicker__datasets on Query {
1412
1230
  }
1413
1231
  }
1414
1232
  }
1415
- `}};Si.hash="03d88d1706089bb63edcd44d04563cbc";const vi={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:[],operation:Si}},name:"DatasetPicker__datasets",selections:[{alias:null,args:null,concreteType:"DatasetConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"dataset",args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};vi.hash="03d88d1706089bb63edcd44d04563cbc";function Du(n){const[a,l]=D.useRefetchableFragment(vi,n.query);return s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(Nn,{label:"dataset","data-testid":"dataset-picker",className:"dataset-picker",width:"100%","aria-label":"The dataset to add the example to",onSelectionChange:n.onSelectionChange,placeholder:"Select a dataset",onBlur:n.onBlur,isRequired:!0,validationState:n.validationState,errorMessage:n.errorMessage,children:a.datasets.edges.map(({dataset:t})=>e(B,{children:t.name},t.id))}),e(Tu,{onDatasetCreated:()=>{u.startTransition(()=>{l({},{fetchPolicy:"store-and-network"})})}})]})}function Tu({onDatasetCreated:n}){const[a,l]=u.useState(null),[t,i]=u.useState(!1),r=oe();return s(tn,{placement:"bottom right",isOpen:t,onOpenChange:o=>{l(null),i(o)},children:[e(M,{variant:"default",icon:e(P,{svg:e(I.PlusCircleOutline,{})}),"aria-label":"Create a new dataset"}),e(V,{title:"Create New Dataset",bodyStyle:{padding:0},variant:"compact",borderColor:"light",backgroundColor:"light",children:s(F,{width:"500px",children:[a?e(ne,{variant:"danger",children:a}):null,e(nl,{onDatasetCreateError:o=>l(o.message),onDatasetCreated:({id:o,name:c})=>{l(null),i(!1),r({title:"Dataset Created",message:`Dataset "${c}" created successfully`}),n(o)}})]})})]})}const Ra={backgroundColor:"light",borderColor:"light",collapsible:!0,bodyStyle:{padding:0}};function Iu({spanId:n,onCompleted:a}){const[l,t]=u.useState(null),i=D.useLazyLoadQuery(bi,{spanId:n},{fetchPolicy:"store-and-network"}),{span:{revision:r}}=i,[o,c]=D.useMutation(ki),{control:d,setError:g,handleSubmit:f,formState:{isValid:m}}=Ie({defaultValues:{input:JSON.stringify(r==null?void 0:r.input,null,2),output:JSON.stringify(r==null?void 0:r.output,null,2),metadata:JSON.stringify(r==null?void 0:r.metadata,null,2),datasetId:""}}),p=u.useCallback(y=>{if(t(null),!Oe(y==null?void 0:y.input))return g("input",{message:"Input must be a valid JSON object"});if(!Oe(y==null?void 0:y.output))return g("output",{message:"Output must be a valid JSON object"});if(!Oe(y==null?void 0:y.metadata))return g("metadata",{message:"Metadata must be a valid JSON object"});if(!(y!=null&&y.datasetId))return g("datasetId",{message:"Dataset is required"});o({variables:{input:{datasetId:y.datasetId,examples:[{input:JSON.parse(y.input),output:JSON.parse(y.output),metadata:JSON.parse(y.metadata),spanId:n}]}},onCompleted:()=>{a(y.datasetId)},onError:b=>{t(b.message)}})},[o,g,n,a]);return e(H,{size:"fullscreen",title:"Add Example to Dataset",extra:e(M,{variant:"primary",size:"compact",disabled:!m||c,loading:c,onClick:f(p),icon:e(P,{svg:e(I.PlusCircleOutline,{})}),children:"Add Example"}),children:e("div",{css:C`
1233
+ `}};Si.hash="03d88d1706089bb63edcd44d04563cbc";const vi={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:[],operation:Si}},name:"DatasetPicker__datasets",selections:[{alias:null,args:null,concreteType:"DatasetConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"dataset",args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};vi.hash="03d88d1706089bb63edcd44d04563cbc";function bu(n){const[a,t]=I.useRefetchableFragment(vi,n.query);return s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(Vn,{label:"dataset","data-testid":"dataset-picker",className:"dataset-picker",width:"100%","aria-label":"The dataset to add the example to",onSelectionChange:n.onSelectionChange,placeholder:"Select a dataset",onBlur:n.onBlur,isRequired:!0,validationState:n.validationState,errorMessage:n.errorMessage,children:a.datasets.edges.map(({dataset:l})=>e(U,{children:l.name},l.id))}),e(Su,{onDatasetCreated:()=>{u.startTransition(()=>{t({},{fetchPolicy:"store-and-network"})})}})]})}function Su({onDatasetCreated:n}){const[a,t]=u.useState(null),[l,i]=u.useState(!1),r=oe();return s(Cn,{placement:"bottom right",isOpen:l,onOpenChange:o=>{t(null),i(o)},children:[e(N,{variant:"default",icon:e(w,{svg:e(L.PlusCircleOutline,{})}),"aria-label":"Create a new dataset"}),e($,{title:"Create New Dataset",bodyStyle:{padding:0},variant:"compact",borderColor:"light",backgroundColor:"light",children:s(F,{width:"500px",children:[a?e(te,{variant:"danger",children:a}):null,e(st,{onDatasetCreateError:o=>t(o.message),onDatasetCreated:({id:o,name:c})=>{t(null),i(!1),r({title:"Dataset Created",message:`Dataset "${c}" created successfully`}),n(o)}})]})})]})}const Na={backgroundColor:"light",borderColor:"light",collapsible:!0,bodyStyle:{padding:0}};function vu({spanId:n,onCompleted:a}){const[t,l]=u.useState(null),i=I.useLazyLoadQuery(bi,{spanId:n},{fetchPolicy:"store-and-network"}),{span:{revision:r}}=i,[o,c]=I.useMutation(ki),{control:d,setError:g,handleSubmit:f,formState:{isValid:m}}=Ae({defaultValues:{input:JSON.stringify(r==null?void 0:r.input,null,2),output:JSON.stringify(r==null?void 0:r.output,null,2),metadata:JSON.stringify(r==null?void 0:r.metadata,null,2),datasetId:""}}),p=u.useCallback(y=>{if(l(null),!Oe(y==null?void 0:y.input))return g("input",{message:"Input must be a valid JSON object"});if(!Oe(y==null?void 0:y.output))return g("output",{message:"Output must be a valid JSON object"});if(!Oe(y==null?void 0:y.metadata))return g("metadata",{message:"Metadata must be a valid JSON object"});if(!(y!=null&&y.datasetId))return g("datasetId",{message:"Dataset is required"});o({variables:{input:{datasetId:y.datasetId,examples:[{input:JSON.parse(y.input),output:JSON.parse(y.output),metadata:JSON.parse(y.metadata),spanId:n}]}},onCompleted:()=>{a(y.datasetId)},onError:k=>{l(k.message)}})},[o,g,n,a]);return e(B,{size:"fullscreen",title:"Add Example to Dataset",extra:e(N,{variant:"primary",size:"compact",disabled:!m||c,loading:c,onClick:f(p),icon:e(w,{svg:e(L.PlusCircleOutline,{})}),children:"Add Example"}),children:e("div",{css:v`
1416
1234
  overflow-y: auto;
1417
1235
  padding: var(--ac-global-dimension-size-400);
1418
1236
  /* Make widths configurable */
@@ -1423,7 +1241,7 @@ fragment DatasetPicker__datasets on Query {
1423
1241
  width: 100%;
1424
1242
  }
1425
1243
  }
1426
- `,children:e(h,{direction:"row",justifyContent:"center",children:e(F,{width:"900px",paddingStart:"auto",paddingEnd:"auto",children:s(h,{direction:"column",gap:"size-200",children:[l?e(ne,{variant:"danger",children:l}):null,e(G,{control:d,name:"datasetId",render:({field:{onChange:y,onBlur:b},fieldState:{invalid:k,error:S}})=>e(Du,{onSelectionChange:y,onBlur:b,validationState:k?"invalid":"valid",errorMessage:S==null?void 0:S.message,query:i})}),e(G,{control:d,name:"input",render:({field:{onChange:y,onBlur:b,value:k},fieldState:{invalid:S,error:v}})=>s(V,{title:"Input",subTitle:"The input to the LLM, retriever, program, etc.",...Ra,children:[S?e(ne,{variant:"danger",banner:!0,children:v==null?void 0:v.message}):null,e(Re,{value:k,onChange:y,onBlur:b})]})}),e(G,{control:d,name:"output",render:({field:{onChange:y,onBlur:b,value:k},fieldState:{invalid:S,error:v}})=>s(V,{title:"Output",subTitle:"The output of the LLM or program to be used as an expected output",...Ra,backgroundColor:"green-100",borderColor:"green-700",children:[S?e(ne,{variant:"danger",banner:!0,children:v==null?void 0:v.message}):null,e(Re,{value:k,onChange:y,onBlur:b})]})}),e(G,{control:d,name:"metadata",render:({field:{onChange:y,onBlur:b,value:k},fieldState:{invalid:S,error:v}})=>s(V,{title:"Metadata",subTitle:"All data from the span to use during experimentation or evaluation",...Ra,children:[S?e(ne,{variant:"danger",banner:!0,children:v==null?void 0:v.message}):null,e(Re,{value:k,onChange:y,onBlur:b})]})})]})})})})})}const Lu=n=>u.useMemo(()=>ll(n),[n]),Pu=n=>n.events.some(a=>a.name==="exception"),te={backgroundColor:"light",borderColor:"light",variant:"compact",collapsible:!0};function wu({spanNodeId:n,projectId:a}){const l=Ta("playground"),t=Y(),{span:i}=D.useLazyLoadQuery(ii,{spanId:n});if(i.__typename!=="Span")throw new Error("Expected a span, but got a different type"+i.__typename);const r=u.useMemo(()=>Pu(i),[i]),o=Sn(d=>d.showSpanAside),c=Sn(d=>d.setShowSpanAside);return s(h,{direction:"column",flex:"1 1 auto",height:"100%",children:[e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-150",paddingEnd:"size-200",flex:"none",children:s(h,{direction:"row",gap:"size-200",alignItems:"center",children:[s(h,{direction:"row",gap:"size-100",width:"100%",height:"100%",alignItems:"center",children:[e(al,{spanKind:i.spanKind}),e(K,{children:i.name})]}),s(h,{flex:"none",direction:"row",alignItems:"center",gap:"size-100",children:[l?e(M,{variant:"default",icon:e(P,{svg:e(I.PlayCircleOutline,{})}),disabled:i.spanKind!=="llm",onClick:()=>{t(`/playground/spans/${i.id}`)},children:"Playground"}):null,e(ku,{traceId:i.context.traceId,spanId:i.context.spanId}),e(Eu,{span:i}),e(yu,{spanNodeId:i.id,projectId:a}),s(Le,{placement:"top",offset:5,children:[e(M,{variant:"default","aria-label":"Toggle showing span details",onClick:()=>{c(!o)},icon:e(P,{svg:o?e(I.SlideIn,{}):e(I.SlideOut,{})})}),e(An,{children:o?"Hide Span Details":"Show Span Details"})]})]})]})}),s(Te,{children:[e(J,{name:"Info",children:s(h,{direction:"row",height:"100%",children:[e(_u,{children:e(Xl,{children:e(Ru,{span:i})})}),o?e(hu,{span:i}):null]})}),e(J,{name:"Feedback",extra:e(Me,{variant:"light",children:i.spanAnnotations.length}),children:d=>d?e(vu,{span:i}):null}),e(J,{name:"Attributes",title:"Attributes",children:e(F,{padding:"size-200",children:e(V,{title:"All Attributes",...te,titleExtra:Ki,extra:e(le,{text:i.attributes}),bodyStyle:{padding:0},children:e(nn,{children:i.attributes})})})}),e(J,{name:"Events",extra:e(Me,{variant:r?"danger":"light",children:i.events.length}),children:e(Xu,{events:i.events})})]})]})}const Au=C`
1244
+ `,children:e(h,{direction:"row",justifyContent:"center",children:e(F,{width:"900px",paddingStart:"auto",paddingEnd:"auto",children:s(h,{direction:"column",gap:"size-200",children:[t?e(te,{variant:"danger",children:t}):null,e(Z,{control:d,name:"datasetId",render:({field:{onChange:y,onBlur:k},fieldState:{invalid:S,error:C}})=>e(bu,{onSelectionChange:y,onBlur:k,validationState:S?"invalid":"valid",errorMessage:C==null?void 0:C.message,query:i})}),e(Z,{control:d,name:"input",render:({field:{onChange:y,onBlur:k,value:S},fieldState:{invalid:C,error:b}})=>s($,{title:"Input",subTitle:"The input to the LLM, retriever, program, etc.",...Na,children:[C?e(te,{variant:"danger",banner:!0,children:b==null?void 0:b.message}):null,e(De,{value:S,onChange:y,onBlur:k})]})}),e(Z,{control:d,name:"output",render:({field:{onChange:y,onBlur:k,value:S},fieldState:{invalid:C,error:b}})=>s($,{title:"Output",subTitle:"The output of the LLM or program to be used as an expected output",...Na,backgroundColor:"green-100",borderColor:"green-700",children:[C?e(te,{variant:"danger",banner:!0,children:b==null?void 0:b.message}):null,e(De,{value:S,onChange:y,onBlur:k})]})}),e(Z,{control:d,name:"metadata",render:({field:{onChange:y,onBlur:k,value:S},fieldState:{invalid:C,error:b}})=>s($,{title:"Metadata",subTitle:"All data from the span to use during experimentation or evaluation",...Na,children:[C?e(te,{variant:"danger",banner:!0,children:b==null?void 0:b.message}):null,e(De,{value:S,onChange:y,onBlur:k})]})})]})})})})})}const Cu=n=>u.useMemo(()=>Tn(n),[n]),Fu=n=>n.events.some(a=>a.name==="exception"),ie={backgroundColor:"light",borderColor:"light",variant:"compact",collapsible:!0};function Ku({spanNodeId:n,projectId:a}){const t=La("playground"),l=Y(),{span:i}=I.useLazyLoadQuery(pi,{spanId:n});if(i.__typename!=="Span")throw new Error("Expected a span, but got a different type"+i.__typename);const r=u.useMemo(()=>Fu(i),[i]),o=bn(d=>d.showSpanAside),c=bn(d=>d.setShowSpanAside);return s(h,{direction:"column",flex:"1 1 auto",height:"100%",children:[e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-150",paddingEnd:"size-200",flex:"none",children:s(h,{direction:"row",gap:"size-200",alignItems:"center",children:[s(h,{direction:"row",gap:"size-100",width:"100%",height:"100%",alignItems:"center",children:[e(ot,{spanKind:i.spanKind}),e(K,{children:i.name})]}),s(h,{flex:"none",direction:"row",alignItems:"center",gap:"size-100",children:[t?e(N,{variant:"default",icon:e(w,{svg:e(L.PlayCircleOutline,{})}),disabled:i.spanKind!=="llm",onClick:()=>{l(`/playground/spans/${i.id}`)},children:"Playground"}):null,e(uu,{traceId:i.context.traceId,spanId:i.context.spanId}),e(Du,{span:i}),e(ou,{spanNodeId:i.id,projectId:a}),s(we,{placement:"top",offset:5,children:[e(N,{variant:"default","aria-label":"Toggle showing span details",onClick:()=>{c(!o)},icon:e(w,{svg:o?e(L.SlideIn,{}):e(L.SlideOut,{})})}),e(En,{children:o?"Hide Span Details":"Show Span Details"})]})]})]})}),s(Pe,{children:[e(J,{name:"Info",children:s(h,{direction:"row",height:"100%",children:[e(Tu,{children:e(sl,{children:e(Iu,{span:i})})}),o?e(cu,{span:i}):null]})}),e(J,{name:"Feedback",extra:e(Me,{variant:"light",children:i.spanAnnotations.length}),children:d=>d?e(pu,{span:i}):null}),e(J,{name:"Attributes",title:"Attributes",children:e(F,{padding:"size-200",children:e($,{title:"All Attributes",...ie,titleExtra:Ki,extra:e(ae,{text:i.attributes}),bodyStyle:{padding:0},children:e(nn,{children:i.attributes})})})}),e(J,{name:"Events",extra:e(Me,{variant:r?"danger":"light",children:i.events.length}),children:e(Uu,{events:i.events})})]})]})}const xu=v`
1427
1245
  flex: 1 1 auto;
1428
1246
  overflow-y: auto;
1429
1247
  // Overflow fails to take into account padding
@@ -1432,62 +1250,62 @@ fragment DatasetPicker__datasets on Query {
1432
1250
  display: block;
1433
1251
  height: var(--ac-global-dimension-static-size-400);
1434
1252
  }
1435
- `;function _u({children:n}){return e("div",{css:Au,"data-testid":"span-info-wrap",children:n})}function Eu({span:n}){const[a,l]=u.useState(null),t=oe(),i=Y(),r=u.useCallback(()=>{l(e(Iu,{spanId:n.id,onCompleted:o=>{l(null),t({title:"Span Added to Dataset",message:"Successfully added span to dataset",action:{text:"View Dataset",onClick:()=>{i(`/datasets/${o}/examples`)}}})}}))},[n.id,t,i]);return s(U,{children:[e(M,{variant:"default",icon:e(P,{svg:e(I.DatabaseOutline,{})}),onClick:r,children:"Add to Dataset"}),e(u.Suspense,{children:e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>l(null),children:a})})]})}function Ru({span:n}){const{spanKind:a,attributes:l}=n,{json:t,parseError:i}=Lu(l),r=u.useMemo(()=>n.statusMessage?e(ne,{variant:"danger",title:"Status Description",children:n.statusMessage}):null,[n]);if(i||!t)return e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-200",children:[r,e(ne,{variant:"warning",title:"Un-parsable attributes",children:`Failed to parse span attributes. ${i instanceof Error?i.message:""}`}),e(V,{...te,title:"Attributes",children:e(F,{padding:"size-100",children:l})})]})});let o;switch(a){case"llm":{o=e(Mu,{span:n,spanAttributes:t});break}case"retriever":{o=e(Nu,{span:n,spanAttributes:t});break}case"reranker":{o=e(Vu,{span:n,spanAttributes:t});break}case"embedding":{o=e(zu,{span:n,spanAttributes:t});break}case"tool":{o=e($u,{span:n,spanAttributes:t});break}default:o=e(Ci,{span:n})}return e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-200",children:[r,o,t!=null&&t.metadata?e(V,{...te,title:"Metadata",children:e(nn,{children:JSON.stringify(t.metadata)})}):null]})})}function Mu(n){const{spanAttributes:a,span:l}=n,{input:t,output:i}=l,r=u.useMemo(()=>a[se.llm]||null,[a]),o=u.useMemo(()=>{if(r==null)return null;const E=r[_e.model_name];return typeof E=="string"?E:null},[r]),c=u.useMemo(()=>{if(r==null)return[];const E=r[_e.input_messages];return vl(E)?(E==null?void 0:E.map(R=>R[se.message]).filter(Boolean))||[]:[]},[r]),d=u.useMemo(()=>{if(r==null)return[];const E=r[_e.tools];return Array.isArray(E)?E==null?void 0:E.map(j=>j[se.tool]).filter(Boolean):[]},[r]),g=u.useMemo(()=>d.reduce((E,R)=>(R!=null&&R.json_schema&&E.push(R.json_schema),E),[]),[d]),f=u.useMemo(()=>{if(r==null)return[];const E=r[_e.output_messages];return vl(E)?E.map(R=>R[se.message]).filter(Boolean)||[]:[]},[r]),m=u.useMemo(()=>{if(r==null)return[];const E=r[_e.prompts];return Go(E)?E:[]},[r]),p=u.useMemo(()=>{if(r==null)return null;const E=r[_e.prompt_template];return E??null},[r]),y=u.useMemo(()=>r==null?"{}":r[_e.invocation_parameters]||"{}",[r]),b=u.useMemo(()=>o==null?null:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Yl,{spanKind:"llm"}),e(K,{textSize:"large",weight:"heavy",children:o})]}),[o]),k=t!=null&&t.value!=null,S=c.length>0,v=g.length>0,w=i!=null&&i.value!=null,L=f.length>0,A=m.length>0,x=Object.keys(JSON.parse(y)).length>0,T=p!=null;return s(h,{direction:"column",gap:"size-200",children:[e(V,{collapsible:!0,backgroundColor:"light",borderColor:"light",bodyStyle:{padding:0},titleSeparator:!1,variant:"compact",title:b,children:s(Te,{children:[S?e(J,{name:"Input Messages",hidden:!S,children:e(Fl,{messages:c})}):null,v?e(J,{name:"Tools",hidden:!v,children:e(qu,{toolSchemas:g})}):null,k?e(J,{name:"Input",hidden:!k,children:e(F,{padding:"size-200",children:e(Ae,{children:e(V,{...te,title:"LLM Input",extra:s(h,{direction:"row",gap:"size-100",children:[e(qe,{}),e(le,{text:t.value})]}),children:e(Ue,{...t})})})})}):null,T?e(J,{name:"Prompt Template",hidden:!T,children:e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-100",children:[e(F,{borderRadius:"medium",borderColor:"light",backgroundColor:"light",borderWidth:"thin",padding:"size-200",children:s(ma,{text:p.template,children:[e(K,{color:"text-700",fontStyle:"italic",children:"prompt template"}),e(Fi,{children:p.template})]})}),e(F,{borderRadius:"medium",borderColor:"light",backgroundColor:"light",borderWidth:"thin",padding:"size-200",children:s(ma,{text:JSON.stringify(p.variables),children:[e(K,{color:"text-700",fontStyle:"italic",children:"template variables"}),e(nn,{children:JSON.stringify(p.variables)})]})})]})})}):null,e(J,{name:"Prompts",hidden:!A,children:e(Uu,{prompts:m})}),e(J,{name:"Invocation Params",hidden:!x,children:e(ma,{text:y,padding:"size-100",children:e(nn,{children:y})})})]})}),w||L?e(Wa,{...te,children:s(Te,{children:[L?e(J,{name:"Output Messages",hidden:!L,children:e(Fl,{messages:f})}):null,w?e(J,{name:"Output",hidden:!w,children:e(F,{padding:"size-200",children:e(Ae,{children:e(V,{...te,title:"LLM Output",extra:s(h,{direction:"row",gap:"size-100",children:[e(qe,{}),e(le,{text:i.value})]}),children:e(Ue,{...i})})})})}):null]})}):null]})}function Nu(n){const{spanAttributes:a,span:l}=n,{input:t}=l,i=u.useMemo(()=>a[se.retrieval]||null,[a]),r=u.useMemo(()=>{var f;return i==null?[]:((f=i[zs.documents])==null?void 0:f.map(m=>m[se.document]).filter(Boolean))||[]},[i]),o=u.useMemo(()=>l.documentEvaluations.reduce((m,p)=>{const y=p.documentPosition,b=m[y]||[];return{...m,[y]:[...b,p]}},{}),[l.documentEvaluations]),c=t!=null&&t.value!=null,d=r.length>0,g=l.documentRetrievalMetrics.length>0;return s(h,{direction:"column",gap:"size-200",children:[c?e(Ae,{children:e(V,{title:"Input",...te,extra:s(h,{direction:"row",gap:"size-100",children:[e(qe,{}),e(le,{text:t.value})]}),children:e(Ue,{...t})})}):null,d?e(Ae,{children:e(V,{title:"Documents",...te,titleExtra:g&&e(h,{direction:"row",alignItems:"center",gap:"size-100",children:l.documentRetrievalMetrics.map(f=>s(U,{children:[e(De,{name:f.evaluationName,metric:"ndcg",score:f.ndcg},"ndcg"),e(De,{name:f.evaluationName,metric:"precision",score:f.precision},"precision"),e(De,{name:f.evaluationName,metric:"hit",score:f.hit},"hit")]}))}),extra:e(qe,{}),children:e("ul",{css:C`
1253
+ `;function Tu({children:n}){return e("div",{css:xu,"data-testid":"span-info-wrap",children:n})}function Du({span:n}){const[a,t]=u.useState(null),l=oe(),i=Y(),r=u.useCallback(()=>{t(e(vu,{spanId:n.id,onCompleted:o=>{t(null),l({title:"Span Added to Dataset",message:"Successfully added span to dataset",action:{text:"View Dataset",onClick:()=>{i(`/datasets/${o}/examples`)}}})}}))},[n.id,l,i]);return s(H,{children:[e(N,{variant:"default",icon:e(w,{svg:e(L.DatabaseOutline,{})}),onClick:r,children:"Add to Dataset"}),e(u.Suspense,{children:e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>t(null),children:a})})]})}function Iu({span:n}){const{spanKind:a,attributes:t}=n,{json:l,parseError:i}=Cu(t),r=u.useMemo(()=>n.statusMessage?e(te,{variant:"danger",title:"Status Description",children:n.statusMessage}):null,[n]);if(i||!l)return e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-200",children:[r,e(te,{variant:"warning",title:"Un-parsable attributes",children:`Failed to parse span attributes. ${i instanceof Error?i.message:""}`}),e($,{...ie,title:"Attributes",children:e(F,{padding:"size-100",children:t})})]})});let o;switch(a){case"llm":{o=e(Pu,{span:n,spanAttributes:l});break}case"retriever":{o=e(Lu,{span:n,spanAttributes:l});break}case"reranker":{o=e(wu,{span:n,spanAttributes:l});break}case"embedding":{o=e(_u,{span:n,spanAttributes:l});break}case"tool":{o=e(Eu,{span:n,spanAttributes:l});break}default:o=e(Ci,{span:n})}return e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-200",children:[r,o,l!=null&&l.metadata?e($,{...ie,title:"Metadata",children:e(nn,{children:JSON.stringify(l.metadata)})}):null]})})}function Pu(n){const{spanAttributes:a,span:t}=n,{input:l,output:i}=t,r=u.useMemo(()=>a[le.llm]||null,[a]),o=u.useMemo(()=>{if(r==null)return null;const A=r[Te.model_name];return typeof A=="string"?A:null},[r]),c=u.useMemo(()=>{if(r==null)return[];const A=r[Te.input_messages];return Lt(A)?(A==null?void 0:A.map(R=>R[le.message]).filter(Boolean))||[]:[]},[r]),d=u.useMemo(()=>{if(r==null)return[];const A=r[Te.tools];return Array.isArray(A)?A==null?void 0:A.map(j=>j[le.tool]).filter(Boolean):[]},[r]),g=u.useMemo(()=>d.reduce((A,R)=>(R!=null&&R.json_schema&&A.push(R.json_schema),A),[]),[d]),f=u.useMemo(()=>{if(r==null)return[];const A=r[Te.output_messages];return Lt(A)?A.map(R=>R[le.message]).filter(Boolean)||[]:[]},[r]),m=u.useMemo(()=>{if(r==null)return[];const A=r[Te.prompts];return Jo(A)?A:[]},[r]),p=u.useMemo(()=>{if(r==null)return null;const A=r[Te.prompt_template];return A??null},[r]),y=u.useMemo(()=>r==null?"{}":r[Te.invocation_parameters]||"{}",[r]),k=u.useMemo(()=>o==null?null:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(dt,{spanKind:"llm"}),e(K,{textSize:"large",weight:"heavy",children:o})]}),[o]),S=l!=null&&l.value!=null,C=c.length>0,b=g.length>0,T=i!=null&&i.value!=null,P=f.length>0,_=m.length>0,x=Object.keys(JSON.parse(y)).length>0,D=p!=null;return s(h,{direction:"column",gap:"size-200",children:[e($,{collapsible:!0,backgroundColor:"light",borderColor:"light",bodyStyle:{padding:0},titleSeparator:!1,variant:"compact",title:k,children:s(Pe,{children:[C?e(J,{name:"Input Messages",hidden:!C,children:e(_t,{messages:c})}):null,b?e(J,{name:"Tools",hidden:!b,children:e(Nu,{toolSchemas:g})}):null,S?e(J,{name:"Input",hidden:!S,children:e(F,{padding:"size-200",children:e(Le,{children:e($,{...ie,title:"LLM Input",extra:s(h,{direction:"row",gap:"size-100",children:[e(Ne,{}),e(ae,{text:l.value})]}),children:e(qe,{...l})})})})}):null,D?e(J,{name:"Prompt Template",hidden:!D,children:e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-100",children:[e(F,{borderRadius:"medium",borderColor:"light",backgroundColor:"light",borderWidth:"thin",padding:"size-200",children:s(fa,{text:p.template,children:[e(K,{color:"text-700",fontStyle:"italic",children:"prompt template"}),e(Fi,{children:p.template})]})}),e(F,{borderRadius:"medium",borderColor:"light",backgroundColor:"light",borderWidth:"thin",padding:"size-200",children:s(fa,{text:JSON.stringify(p.variables),children:[e(K,{color:"text-700",fontStyle:"italic",children:"template variables"}),e(nn,{children:JSON.stringify(p.variables)})]})})]})})}):null,e(J,{name:"Prompts",hidden:!_,children:e(zu,{prompts:m})}),e(J,{name:"Invocation Params",hidden:!x,children:e(fa,{text:y,padding:"size-100",children:e(nn,{children:y})})})]})}),T||P?e(Ya,{...ie,children:s(Pe,{children:[P?e(J,{name:"Output Messages",hidden:!P,children:e(_t,{messages:f})}):null,T?e(J,{name:"Output",hidden:!T,children:e(F,{padding:"size-200",children:e(Le,{children:e($,{...ie,title:"LLM Output",extra:s(h,{direction:"row",gap:"size-100",children:[e(Ne,{}),e(ae,{text:i.value})]}),children:e(qe,{...i})})})})}):null]})}):null]})}function Lu(n){const{spanAttributes:a,span:t}=n,{input:l}=t,i=u.useMemo(()=>a[le.retrieval]||null,[a]),r=u.useMemo(()=>{var f;return i==null?[]:((f=i[Os.documents])==null?void 0:f.map(m=>m[le.document]).filter(Boolean))||[]},[i]),o=u.useMemo(()=>t.documentEvaluations.reduce((m,p)=>{const y=p.documentPosition,k=m[y]||[];return{...m,[y]:[...k,p]}},{}),[t.documentEvaluations]),c=l!=null&&l.value!=null,d=r.length>0,g=t.documentRetrievalMetrics.length>0;return s(h,{direction:"column",gap:"size-200",children:[c?e(Le,{children:e($,{title:"Input",...ie,extra:s(h,{direction:"row",gap:"size-100",children:[e(Ne,{}),e(ae,{text:l.value})]}),children:e(qe,{...l})})}):null,d?e(Le,{children:e($,{title:"Documents",...ie,titleExtra:g&&e(h,{direction:"row",alignItems:"center",gap:"size-100",children:t.documentRetrievalMetrics.map(f=>s(H,{children:[e(Ie,{name:f.evaluationName,metric:"ndcg",score:f.ndcg},"ndcg"),e(Ie,{name:f.evaluationName,metric:"precision",score:f.precision},"precision"),e(Ie,{name:f.evaluationName,metric:"hit",score:f.hit},"hit")]}))}),extra:e(Ne,{}),children:e("ul",{css:v`
1436
1254
  display: flex;
1437
1255
  flex-direction: column;
1438
1256
  gap: var(--ac-global-dimension-static-size-200);
1439
- `,children:r.map((f,m)=>e("li",{children:e(Ba,{document:f,documentEvaluations:o[m],borderColor:"seafoam-700",backgroundColor:"seafoam-100",labelColor:"seafoam-1000"})},m))})})}):null]})}function Vu(n){const{spanAttributes:a}=n,l=u.useMemo(()=>a[se.reranker]||null,[a]),t=u.useMemo(()=>l==null?null:l[La.query]||null,[l]),i=u.useMemo(()=>{var d;return l==null?[]:((d=l[La.input_documents])==null?void 0:d.map(g=>g[se.document]).filter(Boolean))||[]},[l]),r=u.useMemo(()=>{var d;return l==null?[]:((d=l[La.output_documents])==null?void 0:d.map(g=>g[se.document]).filter(Boolean))||[]},[l]),o=i.length,c=r.length;return s(h,{direction:"column",gap:"size-200",children:[e(Ae,{children:t&&e(V,{title:"Query",...te,children:e(ta,{children:t})})}),e(V,{title:"Input Documents",titleExtra:e(Me,{variant:"light",children:o}),...te,defaultOpen:!1,bodyStyle:{padding:0},children:e("ul",{css:C`
1257
+ `,children:r.map((f,m)=>e("li",{children:e(Ja,{document:f,documentEvaluations:o[m],borderColor:"seafoam-700",backgroundColor:"seafoam-100",labelColor:"seafoam-1000"})},m))})})}):null]})}function wu(n){const{spanAttributes:a}=n,t=u.useMemo(()=>a[le.reranker]||null,[a]),l=u.useMemo(()=>t==null?null:t[_a.query]||null,[t]),i=u.useMemo(()=>{var d;return t==null?[]:((d=t[_a.input_documents])==null?void 0:d.map(g=>g[le.document]).filter(Boolean))||[]},[t]),r=u.useMemo(()=>{var d;return t==null?[]:((d=t[_a.output_documents])==null?void 0:d.map(g=>g[le.document]).filter(Boolean))||[]},[t]),o=i.length,c=r.length;return s(h,{direction:"column",gap:"size-200",children:[e(Le,{children:l&&e($,{title:"Query",...ie,children:e(Bn,{children:l})})}),e($,{title:"Input Documents",titleExtra:e(Me,{variant:"light",children:o}),...ie,defaultOpen:!1,bodyStyle:{padding:0},children:e("ul",{css:v`
1440
1258
  padding: var(--ac-global-dimension-static-size-200);
1441
1259
  display: flex;
1442
1260
  flex-direction: column;
1443
1261
  gap: var(--ac-global-dimension-static-size-200);
1444
- `,children:i.map((d,g)=>e("li",{children:e(Ba,{document:d,borderColor:"seafoam-700",backgroundColor:"seafoam-100",labelColor:"seafoam-1000"})},g))})}),e(V,{title:"Output Documents",titleExtra:e(Me,{variant:"light",children:c}),...te,bodyStyle:{padding:0},children:e("ul",{css:C`
1262
+ `,children:i.map((d,g)=>e("li",{children:e(Ja,{document:d,borderColor:"seafoam-700",backgroundColor:"seafoam-100",labelColor:"seafoam-1000"})},g))})}),e($,{title:"Output Documents",titleExtra:e(Me,{variant:"light",children:c}),...ie,bodyStyle:{padding:0},children:e("ul",{css:v`
1445
1263
  padding: var(--ac-global-dimension-static-size-200);
1446
1264
  display: flex;
1447
1265
  flex-direction: column;
1448
1266
  gap: var(--ac-global-dimension-static-size-200);
1449
- `,children:r.map((d,g)=>e("li",{children:e(Ba,{document:d,borderColor:"celery-700",backgroundColor:"celery-100",labelColor:"celery-1000"})},g))})})]})}function zu(n){const{spanAttributes:a}=n,l=u.useMemo(()=>a[se.embedding]||null,[a]),t=u.useMemo(()=>{var o;return l==null?[]:((o=l[Pa.embeddings])==null?void 0:o.map(c=>c[se.embedding]).filter(Boolean))||[]},[l]),i=t.length>0,r=l==null?void 0:l[Pa.model_name];return e(h,{direction:"column",gap:"size-200",children:i?e(V,{title:"Embeddings"+(typeof r=="string"?`: ${r}`:""),...te,children:e("ul",{css:C`
1267
+ `,children:r.map((d,g)=>e("li",{children:e(Ja,{document:d,borderColor:"celery-700",backgroundColor:"celery-100",labelColor:"celery-1000"})},g))})})]})}function _u(n){const{spanAttributes:a}=n,t=u.useMemo(()=>a[le.embedding]||null,[a]),l=u.useMemo(()=>{var o;return t==null?[]:((o=t[Ea.embeddings])==null?void 0:o.map(c=>c[le.embedding]).filter(Boolean))||[]},[t]),i=l.length>0,r=t==null?void 0:t[Ea.model_name];return e(h,{direction:"column",gap:"size-200",children:i?e($,{title:"Embeddings"+(typeof r=="string"?`: ${r}`:""),...ie,children:e("ul",{css:v`
1450
1268
  display: flex;
1451
1269
  flex-direction: column;
1452
1270
  gap: var(--ac-global-dimension-static-size-200);
1453
- `,children:t.map((o,c)=>e("li",{children:e(Ae,{children:e(V,{...te,backgroundColor:"purple-100",borderColor:"purple-700",title:"Embedded Text",children:e(ta,{children:o[Pa.text]||""})})})},c))})}):e(Ci,{span:n.span})})}function $u(n){const{span:a,spanAttributes:l}=n,{input:t,output:i}=a,r=typeof(t==null?void 0:t.value)=="string",o=typeof(i==null?void 0:i.value)=="string",c=(t==null?void 0:t.mimeType)==="text",d=(i==null?void 0:i.mimeType)==="text",g=u.useMemo(()=>l[se.tool]||{},[l]),f=Object.keys(g).length>0,m=g[wa.name],p=g[wa.description],y=g[wa.parameters];return!r&&!o&&!f?null:s(h,{direction:"column",gap:"size-200",children:[r?e(Ae,{children:e(V,{title:"Input",...te,extra:s(h,{direction:"row",gap:"size-100",children:[c?e(qe,{}):null,e(le,{text:t.value})]}),children:e(Ue,{...t})})}):null,o?e(Ae,{children:e(V,{title:"Output",...te,backgroundColor:"green-100",borderColor:"green-700",extra:s(h,{direction:"row",gap:"size-100",children:[d?e(qe,{}):null,e(le,{text:i.value})]}),children:e(Ue,{...i})})}):null,f?e(V,{title:"Tool"+(typeof m=="string"?`: ${m}`:""),...te,children:s(h,{direction:"column",children:[p!=null?e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderBottomColor:"dark",borderBottomWidth:"thin",backgroundColor:"light",children:s(h,{direction:"column",alignItems:"start",gap:"size-50",children:[e(K,{color:"text-700",fontStyle:"italic",children:"Description"}),e(K,{children:p})]})}):null,y!=null?e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderBottomColor:"dark",borderBottomWidth:"thin",children:s(h,{direction:"column",alignItems:"start",width:"100%",children:[e(K,{color:"text-700",fontStyle:"italic",children:"Parameters"}),e(nn,{children:JSON.stringify(y)})]})}):null]})}):null]})}const Ou=["irrelevant","unrelated"];function Ba({document:n,documentEvaluations:a,backgroundColor:l,borderColor:t,labelColor:i}){const r=n[Un.metadata],o=a&&a.length,c=n[Un.content];return e(V,{...te,backgroundColor:l,borderColor:t,bodyStyle:{padding:0},title:s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(P,{svg:e(I.FileOutline,{})}),s(re,{level:4,children:["document ",n[Un.id]]})]}),extra:typeof n[Un.score]=="number"&&e(Xn,{color:i,children:`score ${Ya(n[Un.score])}`}),children:s(h,{direction:"column",children:[c&&e(F,{padding:"size-200",children:e(ta,{children:c})}),r&&e(U,{children:e(F,{borderColor:t,borderTopWidth:"thin",children:e(nn,{children:JSON.stringify(r)})})}),o&&e(F,{borderColor:t,borderTopWidth:"thin",padding:"size-200",children:s(h,{direction:"column",gap:"size-100",children:[e(re,{level:3,weight:"heavy",children:"Evaluations"}),e("ul",{children:a.map((d,g)=>{const f=d.label&&Ou.includes(d.label)?"danger":i;return e("li",{children:e(F,{padding:"size-200",borderWidth:"thin",borderColor:t,borderRadius:"medium",children:s(h,{direction:"column",gap:"size-50",children:[s(h,{direction:"row",gap:"size-100",children:[e(K,{weight:"heavy",elementType:"h5",children:d.name}),d.label&&e(Xn,{color:f,shape:"badge",children:d.label}),typeof d.score=="number"&&e(Xn,{color:f,shape:"badge",children:s(h,{direction:"row",gap:"size-50",children:[e(K,{textSize:"xsmall",weight:"heavy",color:"inherit",children:"score"}),e(K,{textSize:"xsmall",children:ze(d.score)})]})})]}),typeof d.explanation&&e("p",{css:C`
1271
+ `,children:l.map((o,c)=>e("li",{children:e(Le,{children:e($,{...ie,backgroundColor:"purple-100",borderColor:"purple-700",title:"Embedded Text",children:e(Bn,{children:o[Ea.text]||""})})})},c))})}):e(Ci,{span:n.span})})}function Eu(n){const{span:a,spanAttributes:t}=n,{input:l,output:i}=a,r=typeof(l==null?void 0:l.value)=="string",o=typeof(i==null?void 0:i.value)=="string",c=(l==null?void 0:l.mimeType)==="text",d=(i==null?void 0:i.mimeType)==="text",g=u.useMemo(()=>t[le.tool]||{},[t]),f=Object.keys(g).length>0,m=g[pa.name],p=g[pa.description],y=g[pa.parameters];return!r&&!o&&!f?null:s(h,{direction:"column",gap:"size-200",children:[r?e(Le,{children:e($,{title:"Input",...ie,extra:s(h,{direction:"row",gap:"size-100",children:[c?e(Ne,{}):null,e(ae,{text:l.value})]}),children:e(qe,{...l})})}):null,o?e(Le,{children:e($,{title:"Output",...ie,backgroundColor:"green-100",borderColor:"green-700",extra:s(h,{direction:"row",gap:"size-100",children:[d?e(Ne,{}):null,e(ae,{text:i.value})]}),children:e(qe,{...i})})}):null,f?e($,{title:"Tool"+(typeof m=="string"?`: ${m}`:""),...ie,children:s(h,{direction:"column",children:[p!=null?e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderBottomColor:"dark",borderBottomWidth:"thin",backgroundColor:"light",children:s(h,{direction:"column",alignItems:"start",gap:"size-50",children:[e(K,{color:"text-700",fontStyle:"italic",children:"Description"}),e(K,{children:p})]})}):null,y!=null?e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderBottomColor:"dark",borderBottomWidth:"thin",children:s(h,{direction:"column",alignItems:"start",width:"100%",children:[e(K,{color:"text-700",fontStyle:"italic",children:"Parameters"}),e(nn,{children:JSON.stringify(y)})]})}):null]})}):null]})}const Au=["irrelevant","unrelated"];function Ja({document:n,documentEvaluations:a,backgroundColor:t,borderColor:l,labelColor:i}){const r=n[Wn.metadata],o=a&&a.length,c=n[Wn.content];return e($,{...ie,backgroundColor:t,borderColor:l,bodyStyle:{padding:0},title:s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(w,{svg:e(L.FileOutline,{})}),s(se,{level:4,children:["document ",n[Wn.id]]})]}),extra:typeof n[Wn.score]=="number"&&e(ya,{color:i,children:`score ${it(n[Wn.score])}`}),children:s(h,{direction:"column",children:[c&&e(F,{padding:"size-200",children:e(Bn,{children:c})}),r&&e(H,{children:e(F,{borderColor:l,borderTopWidth:"thin",children:e(nn,{children:JSON.stringify(r)})})}),o&&e(F,{borderColor:l,borderTopWidth:"thin",padding:"size-200",children:s(h,{direction:"column",gap:"size-100",children:[e(se,{level:3,weight:"heavy",children:"Evaluations"}),e("ul",{children:a.map((d,g)=>{const f=d.label&&Au.includes(d.label)?"danger":i;return e("li",{children:e(F,{padding:"size-200",borderWidth:"thin",borderColor:l,borderRadius:"medium",children:s(h,{direction:"column",gap:"size-50",children:[s(h,{direction:"row",gap:"size-100",children:[e(K,{weight:"heavy",elementType:"h5",children:d.name}),d.label&&e(ya,{color:f,shape:"badge",children:d.label}),typeof d.score=="number"&&e(ya,{color:f,shape:"badge",children:s(h,{direction:"row",gap:"size-50",children:[e(K,{textSize:"xsmall",weight:"heavy",color:"inherit",children:"score"}),e(K,{textSize:"xsmall",children:Ze(d.score)})]})})]}),typeof d.explanation&&e("p",{css:v`
1454
1272
  margin-top: var(
1455
1273
  --ac-global-dimension-static-size-100
1456
1274
  );
1457
1275
  margin-bottom: 0;
1458
- `,children:d.explanation})]})})},g)})})]})})]})})}function Qu({message:n}){var c;const a=n[ve.content],l=n[ve.contents],t=((c=n[ve.tool_calls])==null?void 0:c.map(d=>d[se.tool_call]).filter(Boolean))||[],i=n[ve.function_call_arguments_json]&&n[ve.function_call_name],r=n[ve.role]||"unknown",o=ol(r);return e(Ae,{children:s(V,{...te,...o,title:r+(n[ve.name]?`: ${n[ve.name]}`:""),extra:s(h,{direction:"row",gap:"size-100",children:[e(qe,{}),e(le,{text:a||JSON.stringify(n)})]}),children:[e(Xl,{children:l?e(Hu,{messageContents:l}):null}),s(h,{direction:"column",alignItems:"start",children:[a?e(ta,{children:a}):null,t.length>0?t.map((d,g)=>{var f,m;return s("pre",{css:C`
1276
+ `,children:d.explanation})]})})},g)})})]})})]})})}function Ru({message:n}){var c;const a=n[Ce.content],t=n[Ce.contents],l=((c=n[Ce.tool_calls])==null?void 0:c.map(d=>d[le.tool_call]).filter(Boolean))||[],i=n[Ce.function_call_arguments_json]&&n[Ce.function_call_name],r=n[Ce.role]||"unknown",o=yt(r);return e(Le,{children:s($,{...ie,...o,title:r+(n[Ce.name]?`: ${n[Ce.name]}`:""),extra:s(h,{direction:"row",gap:"size-100",children:[e(Ne,{}),e(ae,{text:a||JSON.stringify(n)})]}),children:[e(sl,{children:t?e($u,{messageContents:t}):null}),s(h,{direction:"column",alignItems:"start",children:[a?e(Bn,{children:a}):null,l.length>0?l.map((d,g)=>{var f,m;return s("pre",{css:v`
1459
1277
  text-wrap: wrap;
1460
1278
  margin: var(--ac-global-dimension-static-size-100) 0;
1461
- `,children:[(f=d==null?void 0:d.function)==null?void 0:f.name,"(",JSON.stringify(JSON.parse((m=d==null?void 0:d.function)==null?void 0:m.arguments),null,2),")"]},g)}):null,i?s("pre",{css:C`
1279
+ `,children:[(f=d==null?void 0:d.function)==null?void 0:f.name,"(",JSON.stringify(JSON.parse((m=d==null?void 0:d.function)==null?void 0:m.arguments),null,2),")"]},g)}):null,i?s("pre",{css:v`
1462
1280
  text-wrap: wrap;
1463
1281
  margin: var(--ac-global-dimension-static-size-100) 0;
1464
- `,children:[n[ve.function_call_name],"(",JSON.stringify(JSON.parse(n[ve.function_call_arguments_json]),null,2),")"]}):null]})]})})}function ju({toolSchema:n,index:a}){return e(V,{title:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Yl,{spanKind:"tool"}),e(K,{textSize:"large",weight:"heavy",children:"Tool"})]}),titleExtra:s(Me,{variant:"light",children:["#",a+1]}),...te,backgroundColor:"yellow-100",borderColor:"yellow-700",bodyStyle:{padding:0},extra:e(le,{text:n}),children:e(Ue,{value:n,mimeType:"json"})})}function Fl({messages:n}){return e("ul",{css:C`
1282
+ `,children:[n[Ce.function_call_name],"(",JSON.stringify(JSON.parse(n[Ce.function_call_arguments_json]),null,2),")"]}):null]})]})})}function Mu({toolSchema:n,index:a}){return e($,{title:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(dt,{spanKind:"tool"}),e(K,{textSize:"large",weight:"heavy",children:"Tool"})]}),titleExtra:s(Me,{variant:"light",children:["#",a+1]}),...ie,backgroundColor:"yellow-100",borderColor:"yellow-700",bodyStyle:{padding:0},extra:e(ae,{text:n}),children:e(qe,{value:n,mimeType:"json"})})}function _t({messages:n}){return e("ul",{css:v`
1465
1283
  display: flex;
1466
1284
  flex-direction: column;
1467
1285
  gap: var(--ac-global-dimension-static-size-100);
1468
1286
  padding: var(--ac-global-dimension-static-size-200);
1469
- `,children:n.map((a,l)=>e("li",{children:e(Qu,{message:a})},l))})}function qu({toolSchemas:n}){return e("ul",{css:C`
1287
+ `,children:n.map((a,t)=>e("li",{children:e(Ru,{message:a})},t))})}function Nu({toolSchemas:n}){return e("ul",{css:v`
1470
1288
  display: flex;
1471
1289
  flex-direction: column;
1472
1290
  gap: var(--ac-global-dimension-static-size-100);
1473
1291
  padding: var(--ac-global-dimension-static-size-200);
1474
- `,children:n.map((a,l)=>e("li",{children:e(ju,{toolSchema:a,index:l})},l))})}function Uu({prompts:n}){return e("ul",{"data-testid":"llm-prompts-list",css:C`
1292
+ `,children:n.map((a,t)=>e("li",{children:e(Mu,{toolSchema:a,index:t})},t))})}function zu({prompts:n}){return e("ul",{"data-testid":"llm-prompts-list",css:v`
1475
1293
  padding: var(--ac-global-dimension-size-200);
1476
1294
  display: flex;
1477
1295
  flex-direction: column;
1478
1296
  gap: var(--ac-global-dimension-size-100);
1479
- `,children:n.map((a,l)=>e("li",{children:e(F,{backgroundColor:"gray-600",borderColor:"gray-400",borderWidth:"thin",borderRadius:"medium",padding:"size-100",children:e(ma,{text:a,children:e(Ue,{value:a,mimeType:"text"})})})},l))})}const Bu=C`
1297
+ `,children:n.map((a,t)=>e("li",{children:e(F,{backgroundColor:"gray-600",borderColor:"gray-400",borderWidth:"thin",borderRadius:"medium",padding:"size-100",children:e(fa,{text:a,children:e(qe,{value:a,mimeType:"text"})})})},t))})}const Vu=v`
1480
1298
  display: flex;
1481
1299
  flex-direction: row;
1482
1300
  gap: var(--ac-global-dimension-size-200);
1483
1301
  flex-wrap: wrap;
1484
- `;function Hu({messageContents:n}){return e("ul",{css:Bu,"data-testid":"message-content-list",children:n.map((a,l)=>e(Wu,{messageContentAttribute:a},l))})}const Gu=C`
1302
+ `;function $u({messageContents:n}){return e("ul",{css:Vu,"data-testid":"message-content-list",children:n.map((a,t)=>e(Qu,{messageContentAttribute:a},t))})}const Ou=v`
1485
1303
  flex: 1 1 100%;
1486
- `;function Wu({messageContentAttribute:n}){var r;const{message_content:a}=n,l=a==null?void 0:a.text,t=a==null?void 0:a.image,i=(r=t==null?void 0:t.image)==null?void 0:r.url;return s("li",{css:l?Gu:null,children:[l?e("pre",{css:C`
1304
+ `;function Qu({messageContentAttribute:n}){var r;const{message_content:a}=n,t=a==null?void 0:a.text,l=a==null?void 0:a.image,i=(r=l==null?void 0:l.image)==null?void 0:r.url;return s("li",{css:t?Ou:null,children:[t?e("pre",{css:v`
1487
1305
  white-space: pre-wrap;
1488
1306
  padding: 0;
1489
1307
  margin: 0;
1490
- `,children:l}):null,i?e(Ku,{url:i}):null]})}function Ci({span:n}){const{input:a,output:l}=n,t=a==null&&l==null,i=(a==null?void 0:a.mimeType)==="text",r=(l==null?void 0:l.mimeType)==="text";return s(h,{direction:"column",gap:"size-200",children:[a&&a.value!=null?e(Ae,{children:e(V,{title:"Input",...te,extra:s(h,{direction:"row",gap:"size-100",children:[i?e(qe,{}):null,e(le,{text:a.value})]}),children:e(Ue,{...a})})}):null,l&&l.value!=null?e(Ae,{children:e(V,{title:"Output",...te,backgroundColor:"green-100",borderColor:"green-700",extra:s(h,{direction:"row",gap:"size-100",children:[r?e(qe,{}):null,e(le,{text:l.value})]}),children:e(Ue,{...l})})}):null,t?e(V,{title:"All Attributes",titleExtra:Ki,...te,bodyStyle:{padding:0},extra:e(le,{text:n.attributes}),children:e(nn,{children:n.attributes})}):null]})}const Ju=C`
1308
+ `,children:t}):null,i?e(hu,{url:i}):null]})}function Ci({span:n}){const{input:a,output:t}=n,l=a==null&&t==null,i=(a==null?void 0:a.mimeType)==="text",r=(t==null?void 0:t.mimeType)==="text";return s(h,{direction:"column",gap:"size-200",children:[a&&a.value!=null?e(Le,{children:e($,{title:"Input",...ie,extra:s(h,{direction:"row",gap:"size-100",children:[i?e(Ne,{}):null,e(ae,{text:a.value})]}),children:e(qe,{...a})})}):null,t&&t.value!=null?e(Le,{children:e($,{title:"Output",...ie,backgroundColor:"green-100",borderColor:"green-700",extra:s(h,{direction:"row",gap:"size-100",children:[r?e(Ne,{}):null,e(ae,{text:t.value})]}),children:e(qe,{...t})})}):null,l?e($,{title:"All Attributes",titleExtra:Ki,...ie,bodyStyle:{padding:0},extra:e(ae,{text:n.attributes}),children:e(nn,{children:n.attributes})}):null]})}const ju=v`
1491
1309
  .cm-content {
1492
1310
  padding: var(--ac-global-dimension-static-size-200) 0;
1493
1311
  }
@@ -1495,23 +1313,23 @@ fragment DatasetPicker__datasets on Query {
1495
1313
  .cm-gutters {
1496
1314
  background-color: transparent;
1497
1315
  }
1498
- `;function ma({text:n,children:a,padding:l}){const t=l?`var(--ac-global-dimension-${l})`:"0";return s("div",{css:C`
1316
+ `;function fa({text:n,children:a,padding:t}){const l=t?`var(--ac-global-dimension-${t})`:"0";return s("div",{css:v`
1499
1317
  position: relative;
1500
1318
  .copy-to-clipboard-button {
1501
1319
  transition: opacity 0.2s ease-in-out;
1502
1320
  opacity: 0;
1503
1321
  position: absolute;
1504
- right: ${t};
1505
- top: ${t};
1322
+ right: ${l};
1323
+ top: ${l};
1506
1324
  z-index: 1;
1507
1325
  }
1508
1326
  &:hover .copy-to-clipboard-button {
1509
1327
  opacity: 1;
1510
1328
  }
1511
- `,children:[e(le,{text:n}),a]})}function nn({children:n}){const{theme:a}=zn(),l=a==="light"?void 0:oa,{value:t,mimeType:i}=u.useMemo(()=>{try{return{value:JSON.stringify(JSON.parse(n),null,2),mimeType:"json"}}catch{return{value:n,mimeType:"text"}}},[n]);return i==="json"?e(sa,{value:t,basicSetup:{lineNumbers:!0,foldGutter:!0,bracketMatching:!0,syntaxHighlighting:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1},extensions:[Ld(),ft.lineWrapping],editable:!1,theme:l,css:Ju}):e(Fi,{children:t})}function Fi({children:n}){return e("pre",{css:C`
1329
+ `,children:[e(ae,{text:n}),a]})}function nn({children:n}){const{theme:a}=Qn(),t=a==="light"?void 0:da,{value:l,mimeType:i}=u.useMemo(()=>{try{return{value:JSON.stringify(JSON.parse(n),null,2),mimeType:"json"}}catch{return{value:n,mimeType:"text"}}},[n]);return i==="json"?e(oa,{value:l,basicSetup:{lineNumbers:!0,foldGutter:!0,bracketMatching:!0,syntaxHighlighting:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1},extensions:[Ad(),xl.lineWrapping],editable:!1,theme:t,css:ju}):e(Fi,{children:l})}function Fi({children:n}){return e("pre",{css:v`
1512
1330
  white-space: pre-wrap;
1513
1331
  padding: 0;
1514
- `,children:n})}function Ue({value:n,mimeType:a}){let l;switch(a){case"json":l=e(nn,{children:n});break;case"text":l=e(ta,{children:n});break;default:Ce()}return l}function Zu({text:n}){return s(h,{direction:"column",alignItems:"center",flex:"1 1 auto",height:"size-2400",justifyContent:"center",gap:"size-100",children:[e(ba,{graphicKey:"documents"}),e(K,{children:n})]})}function Xu({events:n}){return n.length===0?e(Zu,{text:"No events"}):e($l,{children:n.map((a,l)=>{const t=a.name==="exception";return e(zl,{children:s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(F,{flex:"none",children:e("div",{"data-event-type":t?"exception":"info",css:i=>C`
1332
+ `,children:n})}function qe({value:n,mimeType:a}){let t;switch(a){case"json":t=e(nn,{children:n});break;case"text":t=e(Bn,{children:n});break;default:ye()}return t}function qu({text:n}){return s(h,{direction:"column",alignItems:"center",flex:"1 1 auto",height:"size-2400",justifyContent:"center",gap:"size-100",children:[e(Ca,{graphicKey:"documents"}),e(K,{children:n})]})}function Uu({events:n}){return n.length===0?e(qu,{text:"No events"}):e(Jt,{children:n.map((a,t)=>{const l=a.name==="exception";return e(Wt,{children:s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(F,{flex:"none",children:e("div",{"data-event-type":l?"exception":"info",css:i=>v`
1515
1333
  &[data-event-type="exception"] {
1516
1334
  --px-event-icon-color: ${i.colors.statusDanger};
1517
1335
  }
@@ -1521,15 +1339,15 @@ fragment DatasetPicker__datasets on Query {
1521
1339
  .ac-icon-wrap {
1522
1340
  color: var(--px-event-icon-color);
1523
1341
  }
1524
- `,children:e(P,{svg:t?e(I.AlertTriangleOutline,{}):e(I.InfoOutline,{})})})}),s(h,{direction:"column",gap:"size-25",flex:"1 1 auto",children:[e(K,{weight:"heavy",children:a.name}),e(K,{color:"text-700",children:a.message})]}),e(F,{children:e(K,{color:"text-700",children:new Date(a.timestamp).toLocaleString()})})]})},l)})})}const Ki=e(h,{alignItems:"center",justifyContent:"center",children:e(F,{marginStart:"size-100",children:s(Vn,{children:[e(re,{weight:"heavy",level:4,children:"Span Attributes"}),e(Fn,{children:e(K,{children:"Attributes are key-value pairs that represent metadata associated with a span. For detailed descriptions of specific attributes, consult the semantic conventions section of the OpenInference tracing specification."})}),e("footer",{children:e(je,{href:"https://github.com/Arize-ai/openinference/blob/main/spec/semantic_conventions.md",children:"Semantic Conventions"})})]})})}),Kl="selectedSpanNodeId";function Yu(n){const a=n.find(i=>i.parentId==null);if(a)return a;const l=new Set(n.map(i=>i.context.spanId)),t=n.filter(i=>i.parentId!=null&&!l.has(i.parentId));return t.length===1?t[0]:null}function dl(n){const{traceId:a,projectId:l}=n,[t,i]=fa(),r=D.useLazyLoadQuery(ti,{traceId:a,id:l},{fetchPolicy:"store-and-network"}),o=u.useMemo(()=>{var m;return(((m=r.project.trace)==null?void 0:m.spans.edges)||[]).map(p=>p.span)},[r]),d=t.get(Kl)??o[0].id,g=u.useMemo(()=>Yu(o),[o]);return u.useEffect(()=>()=>{i(f=>(f.delete("spanNodeId"),f),{replace:!0})},[]),s("main",{css:C`
1342
+ `,children:e(w,{svg:l?e(L.AlertTriangleOutline,{}):e(L.InfoOutline,{})})})}),s(h,{direction:"column",gap:"size-25",flex:"1 1 auto",children:[e(K,{weight:"heavy",children:a.name}),e(K,{color:"text-700",children:a.message})]}),e(F,{children:e(K,{color:"text-700",children:new Date(a.timestamp).toLocaleString()})})]})},t)})})}const Ki=e(h,{alignItems:"center",justifyContent:"center",children:e(F,{marginStart:"size-100",children:s($n,{children:[e(se,{weight:"heavy",level:4,children:"Span Attributes"}),e(Fn,{children:e(K,{children:"Attributes are key-value pairs that represent metadata associated with a span. For detailed descriptions of specific attributes, consult the semantic conventions section of the OpenInference tracing specification."})}),e("footer",{children:e(je,{href:"https://github.com/Arize-ai/openinference/blob/main/spec/semantic_conventions.md",children:"Semantic Conventions"})})]})})}),Et="selectedSpanNodeId";function Bu(n){const a=n.find(i=>i.parentId==null);if(a)return a;const t=new Set(n.map(i=>i.context.spanId)),l=n.filter(i=>i.parentId!=null&&!t.has(i.parentId));return l.length===1?l[0]:null}function ft(n){const{traceId:a,projectId:t}=n,[l,i]=la(),r=I.useLazyLoadQuery(gi,{traceId:a,id:t},{fetchPolicy:"store-and-network"}),o=u.useMemo(()=>{var m;return(((m=r.project.trace)==null?void 0:m.spans.edges)||[]).map(p=>p.span)},[r]),d=l.get(Et)??o[0].id,g=u.useMemo(()=>Bu(o),[o]);return u.useEffect(()=>()=>{i(f=>(f.delete("spanNodeId"),f),{replace:!0})},[]),s("main",{css:v`
1525
1343
  flex: 1 1 auto;
1526
1344
  overflow: hidden;
1527
1345
  display: flex;
1528
1346
  flex-direction: column;
1529
- `,children:[e(em,{rootSpan:g}),s(Xe,{direction:"horizontal",autoSaveId:"trace-panel-group",css:C`
1347
+ `,children:[e(Hu,{rootSpan:g}),s(Xe,{direction:"horizontal",autoSaveId:"trace-panel-group",css:v`
1530
1348
  flex: 1 1 auto;
1531
1349
  overflow: hidden;
1532
- `,children:[e(ue,{defaultSize:30,minSize:10,maxSize:70,children:e(am,{children:e(Wo,{spans:o,selectedSpanNodeId:d,onSpanClick:f=>{i(m=>(m.set(Kl,f.id),m),{replace:!0})}})})}),e(Ye,{css:Kn}),e(ue,{children:e(nm,{children:d?e(u.Suspense,{fallback:e(fe,{}),children:e(wu,{spanNodeId:d,projectId:l})}):null})})]})]})}function em({rootSpan:n}){const{latencyMs:a,statusCode:l,spanAnnotations:t}=n??{latencyMs:null,statusCode:"UNSET",spanAnnotations:[]},i=t.length>0,r=Zl(l);return e(F,{padding:"size-200",borderBottomWidth:"thin",borderBottomColor:"dark",children:s(h,{direction:"row",gap:"size-400",children:[s(h,{direction:"column",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Trace Status"}),e(K,{textSize:"xlarge",children:s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(Ca,{statusCode:l}),e(K,{textSize:"xlarge",color:r,children:l})]})})]}),s(h,{direction:"column",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Latency"}),e(K,{textSize:"xlarge",children:typeof a=="number"?e(we,{latencyMs:a,textSize:"xlarge"}):"--"})]}),i?s(h,{direction:"column",gap:"size-50",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Feedback"}),e(h,{direction:"row",gap:"size-50",children:t.map(o=>e(ia,{annotation:o,children:e(xn,{annotation:o,annotationDisplayPreference:"label"})},o.name))})]}):null]})})}function nm({children:n}){return e("div",{"data-testid":"scrolling-tabs-wrapper",css:C`
1350
+ `,children:[e(ue,{defaultSize:30,minSize:10,maxSize:70,children:e(Wu,{children:e(Zo,{spans:o,selectedSpanNodeId:d,onSpanClick:f=>{i(m=>(m.set(Et,f.id),m),{replace:!0})}})})}),e(Ye,{css:Kn}),e(ue,{children:e(Gu,{children:d?e(u.Suspense,{fallback:e(he,{}),children:e(Ku,{spanNodeId:d,projectId:t})}):null})})]})]})}function Hu({rootSpan:n}){const{latencyMs:a,statusCode:t,spanAnnotations:l}=n??{latencyMs:null,statusCode:"UNSET",spanAnnotations:[]},i=l.length>0,r=rl(t);return e(F,{padding:"size-200",borderBottomWidth:"thin",borderBottomColor:"dark",children:s(h,{direction:"row",gap:"size-400",children:[s(h,{direction:"column",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Trace Status"}),e(K,{textSize:"xlarge",children:s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(xa,{statusCode:t}),e(K,{textSize:"xlarge",color:r,children:t})]})})]}),s(h,{direction:"column",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Latency"}),e(K,{textSize:"xlarge",children:typeof a=="number"?e(Ee,{latencyMs:a,textSize:"xlarge"}):"--"})]}),i?s(h,{direction:"column",gap:"size-50",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Feedback"}),e(h,{direction:"row",gap:"size-50",children:l.map(o=>e(ra,{annotation:o,children:e(xn,{annotation:o,annotationDisplayPreference:"label"})},o.name))})]}):null]})})}function Gu({children:n}){return e("div",{"data-testid":"scrolling-tabs-wrapper",css:v`
1533
1351
  height: 100%;
1534
1352
  overflow: hidden;
1535
1353
  .ac-tabs {
@@ -1549,10 +1367,10 @@ fragment DatasetPicker__datasets on Query {
1549
1367
  }
1550
1368
  }
1551
1369
  }
1552
- `,children:n})}function am({children:n}){return e("div",{"data-testid":"scrolling-panel-content",css:C`
1370
+ `,children:n})}function Wu({children:n}){return e("div",{"data-testid":"scrolling-panel-content",css:v`
1553
1371
  height: 100%;
1554
1372
  overflow-y: auto;
1555
- `,children:n})}function qy(){const{traceId:n,projectId:a}=ln(),l=Y();return e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>l(`/projects/${a}`),children:e(H,{size:"fullscreen",title:"Trace Details",children:e(dl,{traceId:n,projectId:a})})})}const xi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={kind:"Variable",name:"timeRange",variableName:"timeRange"},o=[{kind:"Literal",name:"first",value:50},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Literal",name:"sort",value:{col:"startTime",dir:"desc"}},r],c={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},d={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},p=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],y={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},b={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},k={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},S=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],v=[r];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectPageQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"TracesTable_spans"},{args:null,kind:"FragmentSpread",name:"ProjectPageHeader_stats"},{args:null,kind:"FragmentSpread",name:"StreamToggle_data"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectPageQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[i,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",args:o,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,c,i,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},d,g,f,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},m,{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:p,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:p,storageKey:null},y,b,k,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[t,c,i,d,g,f,m,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:S,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:S,storageKey:null},y,b,k],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:"rootSpans",args:o,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"},{alias:null,args:v,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:v,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},r],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:"latencyMsP99",args:[{kind:"Literal",name:"probability",value:.99},r],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentEvaluationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"43fee2b22bc4798639d2e1fbef09ce21",id:null,metadata:{},name:"ProjectPageQuery",operationKind:"query",text:`query ProjectPageQuery(
1373
+ `,children:n})}function nf(){const{traceId:n,projectId:a}=tn(),t=Y();return e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>t(`/projects/${a}`),children:e(B,{size:"fullscreen",title:"Trace Details",children:e(ft,{traceId:n,projectId:a})})})}const xi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={kind:"Variable",name:"timeRange",variableName:"timeRange"},o=[{kind:"Literal",name:"first",value:50},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Literal",name:"sort",value:{col:"startTime",dir:"desc"}},r],c={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},d={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},p=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],y={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},k={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},S={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},C=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],b=[r];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectPageQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"TracesTable_spans"},{args:null,kind:"FragmentSpread",name:"ProjectPageHeader_stats"},{args:null,kind:"FragmentSpread",name:"StreamToggle_data"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectPageQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",args:o,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,c,i,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},d,g,f,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},m,{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:p,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:p,storageKey:null},y,k,S,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[l,c,i,d,g,f,m,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:C,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:C,storageKey:null},y,k,S],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:"rootSpans",args:o,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"},{alias:null,args:b,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:b,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},r],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:"latencyMsP99",args:[{kind:"Literal",name:"probability",value:.99},r],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentEvaluationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"43fee2b22bc4798639d2e1fbef09ce21",id:null,metadata:{},name:"ProjectPageQuery",operationKind:"query",text:`query ProjectPageQuery(
1556
1374
  $id: GlobalID!
1557
1375
  $timeRange: TimeRange!
1558
1376
  ) {
@@ -1671,7 +1489,7 @@ fragment TracesTable_spans on Project {
1671
1489
  }
1672
1490
  id
1673
1491
  }
1674
- `}}}();xi.hash="e2d168c52b9c1b5fd5543286f4d2786c";const Di=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r=[{kind:"Literal",name:"first",value:50},{kind:"Literal",name:"sort",value:{col:"startTime",dir:"desc"}},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],o=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectPageSpansQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"SpansTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectPageSpansQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[i,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:r,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:o,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:o,storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:r,filters:["sort","filterCondition","timeRange"],handle:"connection",key:"SpansTable_spans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"09e4f18ba3f2a63560f542088a4329ff",id:null,metadata:{},name:"ProjectPageSpansQuery",operationKind:"query",text:`query ProjectPageSpansQuery(
1492
+ `}}}();xi.hash="e2d168c52b9c1b5fd5543286f4d2786c";const Ti=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r=[{kind:"Literal",name:"first",value:50},{kind:"Literal",name:"sort",value:{col:"startTime",dir:"desc"}},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],o=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectPageSpansQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"SpansTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectPageSpansQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:r,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:o,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:o,storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:r,filters:["sort","filterCondition","timeRange"],handle:"connection",key:"SpansTable_spans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"09e4f18ba3f2a63560f542088a4329ff",id:null,metadata:{},name:"ProjectPageSpansQuery",operationKind:"query",text:`query ProjectPageSpansQuery(
1675
1493
  $id: GlobalID!
1676
1494
  $timeRange: TimeRange!
1677
1495
  ) {
@@ -1738,7 +1556,7 @@ fragment SpansTable_spans on Project {
1738
1556
  }
1739
1557
  id
1740
1558
  }
1741
- `}}}();Di.hash="18fe45fad1c124d8c29cdcabf463a213";const Ti=function(){var n={defaultValue:null,kind:"LocalArgument",name:"id"},a={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"id"}],t={kind:"Variable",name:"timeRange",variableName:"timeRange"},i=[t];return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"ProjectPageHeaderQuery",selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"ProjectPageHeader_stats"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"ProjectPageHeaderQuery",selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:i,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:i,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},t],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:"latencyMsP99",args:[{kind:"Literal",name:"probability",value:.99},t],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentEvaluationNames",storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"264a748e3bb636d71fb6b75523a612fe",id:null,metadata:{},name:"ProjectPageHeaderQuery",operationKind:"query",text:`query ProjectPageHeaderQuery(
1559
+ `}}}();Ti.hash="18fe45fad1c124d8c29cdcabf463a213";const Di=function(){var n={defaultValue:null,kind:"LocalArgument",name:"id"},a={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"id"}],l={kind:"Variable",name:"timeRange",variableName:"timeRange"},i=[l];return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"ProjectPageHeaderQuery",selections:[{alias:null,args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"ProjectPageHeader_stats"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"ProjectPageHeaderQuery",selections:[{alias:null,args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:i,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:i,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},l],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:"latencyMsP99",args:[{kind:"Literal",name:"probability",value:.99},l],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentEvaluationNames",storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"264a748e3bb636d71fb6b75523a612fe",id:null,metadata:{},name:"ProjectPageHeaderQuery",operationKind:"query",text:`query ProjectPageHeaderQuery(
1742
1560
  $timeRange: TimeRange
1743
1561
  $id: GlobalID!
1744
1562
  ) {
@@ -1759,7 +1577,7 @@ fragment ProjectPageHeader_stats on Project {
1759
1577
  documentEvaluationNames
1760
1578
  id
1761
1579
  }
1762
- `}}}();Ti.hash="dcce9d160db90e2b5c51eef9971101a4";const Ii=function(){var n={kind:"Variable",name:"timeRange",variableName:"timeRange"},a=[n];return{argumentDefinitions:[{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:Ti,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"ProjectPageHeader_stats",selections:[{alias:null,args:a,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:a,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},n],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:"latencyMsP99",args:[{kind:"Literal",name:"probability",value:.99},n],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentEvaluationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null}}();Ii.hash="dcce9d160db90e2b5c51eef9971101a4";const Li=u.createContext(null);function qn(){const n=Ke.useContext(Li);if(n===null)throw new Error("useStreamState must be used within a StreamStateProvider");return n}function lm({initialFetchKey:n="initial",children:a}){const l=Sn(c=>c.traceStreamingEnabled),t=Sn(c=>c.setTraceStreamingEnabled),[i,r]=u.useState(n),o=u.useCallback(c=>{u.startTransition(()=>{r(c)})},[r]);return e(Li.Provider,{value:{isStreaming:l,setIsStreaming:t,fetchKey:i,setFetchKey:o},children:a})}const Pi=function(){var n={defaultValue:null,kind:"LocalArgument",name:"annotationName"},a={defaultValue:null,kind:"LocalArgument",name:"id"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"id"}],i=[{kind:"Variable",name:"annotationName",variableName:"annotationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}];return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"AnnotationSummaryValueQuery",selections:[{alias:null,args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:i,kind:"FragmentSpread",name:"AnnotationSummaryValueFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,l,a],kind:"Operation",name:"AnnotationSummaryValueQuery",selections:[{alias:null,args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"AnnotationSummary",kind:"LinkedField",name:"spanAnnotationSummary",plural:!1,selections:[{alias:null,args:null,concreteType:"LabelFraction",kind:"LinkedField",name:"labelFractions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"fraction",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"bae90b7000aa37d37050070d8504b41c",id:null,metadata:{},name:"AnnotationSummaryValueQuery",operationKind:"query",text:`query AnnotationSummaryValueQuery(
1580
+ `}}}();Di.hash="dcce9d160db90e2b5c51eef9971101a4";const Ii=function(){var n={kind:"Variable",name:"timeRange",variableName:"timeRange"},a=[n];return{argumentDefinitions:[{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:Di,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"ProjectPageHeader_stats",selections:[{alias:null,args:a,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:a,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},n],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:"latencyMsP99",args:[{kind:"Literal",name:"probability",value:.99},n],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"documentEvaluationNames",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null}}();Ii.hash="dcce9d160db90e2b5c51eef9971101a4";const Pi=u.createContext(null);function Gn(){const n=Ke.useContext(Pi);if(n===null)throw new Error("useStreamState must be used within a StreamStateProvider");return n}function Ju({initialFetchKey:n="initial",children:a}){const t=bn(c=>c.traceStreamingEnabled),l=bn(c=>c.setTraceStreamingEnabled),[i,r]=u.useState(n),o=u.useCallback(c=>{u.startTransition(()=>{r(c)})},[r]);return e(Pi.Provider,{value:{isStreaming:t,setIsStreaming:l,fetchKey:i,setFetchKey:o},children:a})}const Li=function(){var n={defaultValue:null,kind:"LocalArgument",name:"annotationName"},a={defaultValue:null,kind:"LocalArgument",name:"id"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"id"}],i=[{kind:"Variable",name:"annotationName",variableName:"annotationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}];return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"AnnotationSummaryValueQuery",selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:i,kind:"FragmentSpread",name:"AnnotationSummaryValueFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a],kind:"Operation",name:"AnnotationSummaryValueQuery",selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"AnnotationSummary",kind:"LinkedField",name:"spanAnnotationSummary",plural:!1,selections:[{alias:null,args:null,concreteType:"LabelFraction",kind:"LinkedField",name:"labelFractions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"fraction",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"bae90b7000aa37d37050070d8504b41c",id:null,metadata:{},name:"AnnotationSummaryValueQuery",operationKind:"query",text:`query AnnotationSummaryValueQuery(
1763
1581
  $annotationName: String!
1764
1582
  $timeRange: TimeRange!
1765
1583
  $id: GlobalID!
@@ -1782,7 +1600,7 @@ fragment AnnotationSummaryValueFragment_4BTVrq on Project {
1782
1600
  }
1783
1601
  id
1784
1602
  }
1785
- `}}}();Pi.hash="0a8e190e4d87acc87c161366f330e3af";const wi={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"annotationName"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:Pi,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"AnnotationSummaryValueFragment",selections:[{alias:null,args:[{kind:"Variable",name:"annotationName",variableName:"annotationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"AnnotationSummary",kind:"LinkedField",name:"spanAnnotationSummary",plural:!1,selections:[{alias:null,args:null,concreteType:"LabelFraction",kind:"LinkedField",name:"labelFractions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"fraction",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null};wi.hash="0a8e190e4d87acc87c161366f330e3af";const Ai=function(){var n={defaultValue:null,kind:"LocalArgument",name:"annotationName"},a={defaultValue:null,kind:"LocalArgument",name:"id"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"id"}],i=[{kind:"Variable",name:"annotationName",variableName:"annotationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}];return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"AnnotationSummaryQuery",selections:[{alias:"project",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:i,kind:"FragmentSpread",name:"AnnotationSummaryValueFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n,l],kind:"Operation",name:"AnnotationSummaryQuery",selections:[{alias:"project",args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"AnnotationSummary",kind:"LinkedField",name:"spanAnnotationSummary",plural:!1,selections:[{alias:null,args:null,concreteType:"LabelFraction",kind:"LinkedField",name:"labelFractions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"fraction",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"88dfad5d25db7e03286a789f3ba37c75",id:null,metadata:{},name:"AnnotationSummaryQuery",operationKind:"query",text:`query AnnotationSummaryQuery(
1603
+ `}}}();Li.hash="0a8e190e4d87acc87c161366f330e3af";const wi={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"annotationName"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:Li,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"AnnotationSummaryValueFragment",selections:[{alias:null,args:[{kind:"Variable",name:"annotationName",variableName:"annotationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"AnnotationSummary",kind:"LinkedField",name:"spanAnnotationSummary",plural:!1,selections:[{alias:null,args:null,concreteType:"LabelFraction",kind:"LinkedField",name:"labelFractions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"fraction",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null};wi.hash="0a8e190e4d87acc87c161366f330e3af";const _i=function(){var n={defaultValue:null,kind:"LocalArgument",name:"annotationName"},a={defaultValue:null,kind:"LocalArgument",name:"id"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"id"}],i=[{kind:"Variable",name:"annotationName",variableName:"annotationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}];return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"AnnotationSummaryQuery",selections:[{alias:"project",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:i,kind:"FragmentSpread",name:"AnnotationSummaryValueFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n,t],kind:"Operation",name:"AnnotationSummaryQuery",selections:[{alias:"project",args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"AnnotationSummary",kind:"LinkedField",name:"spanAnnotationSummary",plural:!1,selections:[{alias:null,args:null,concreteType:"LabelFraction",kind:"LinkedField",name:"labelFractions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"fraction",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"88dfad5d25db7e03286a789f3ba37c75",id:null,metadata:{},name:"AnnotationSummaryQuery",operationKind:"query",text:`query AnnotationSummaryQuery(
1786
1604
  $id: GlobalID!
1787
1605
  $annotationName: String!
1788
1606
  $timeRange: TimeRange!
@@ -1805,7 +1623,7 @@ fragment AnnotationSummaryValueFragment_4BTVrq on Project {
1805
1623
  }
1806
1624
  id
1807
1625
  }
1808
- `}}}();Ai.hash="6a15ba35fe9e1e35aa4c517ab6309a2b";function tm({annotationName:n}){const{projectId:a}=ln(),{timeRange:l}=Ka(),t=D.useLazyLoadQuery(Ai,{annotationName:n,id:a,timeRange:{start:l.start.toISOString(),end:l.end.toISOString()}});return s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:n}),e(u.Suspense,{fallback:e(K,{textSize:"xlarge",children:"--"}),children:e(im,{annotationName:n,project:t.project})})]})}function im(n){var y,b;const{project:a,annotationName:l}=n,{fetchKey:t}=qn(),[i,r]=D.useRefetchableFragment(wi,a);u.useEffect(()=>{u.startTransition(()=>{r({},{fetchPolicy:"store-and-network"})})},[t,r]);const o=Ge(),d=[et(l),o.default,o.gray600,o.gray400,o.gray200],g=(y=i==null?void 0:i.spanAnnotationSummary)==null?void 0:y.meanScore,f=(b=i==null?void 0:i.spanAnnotationSummary)==null?void 0:b.labelFractions,m=typeof g=="number",p=Array.isArray(f)&&f.length>0;return!m&&!p?e(K,{textSize:"xlarge",children:"--"}):s(Le,{delay:0,placement:"bottom",children:[e(kn,{children:s(h,{direction:"row",alignItems:"center",gap:"size-50",children:[p?e(Dd,{width:24,height:24,children:e(Td,{data:f,dataKey:"fraction",nameKey:"label",cx:"50%",cy:"50%",innerRadius:8,outerRadius:11,strokeWidth:0,stroke:"transparent",children:f.map((k,S)=>e(Id,{fill:d[S%d.length]},`cell-${S}`))})}):null,e(K,{textSize:"xlarge",children:m?ze(g):"--"})]})}),e(aa,{children:e(F,{width:"size-2400",children:s(h,{direction:"column",gap:"size-50",children:[p&&e("ul",{children:f.map((k,S)=>e("li",{children:e(pe,{color:d[S%d.length],name:k.label,shape:"square",value:nt(k.fraction*100)})},k.label))}),p&&m?e(va,{}):null,m?s(h,{direction:"row",justifyContent:"space-between",children:[e(K,{children:"mean"}),e(K,{children:ze(g)})]}):null]})})})]})}const _i=function(){var n={defaultValue:null,kind:"LocalArgument",name:"evaluationName"},a={defaultValue:null,kind:"LocalArgument",name:"id"},l={defaultValue:null,kind:"LocalArgument",name:"timeRange"},t=[{kind:"Variable",name:"id",variableName:"id"}],i=[{kind:"Variable",name:"evaluationName",variableName:"evaluationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}];return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"DocumentEvaluationSummaryValueQuery",selections:[{alias:null,args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:i,kind:"FragmentSpread",name:"DocumentEvaluationSummaryValueFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,l,a],kind:"Operation",name:"DocumentEvaluationSummaryValueQuery",selections:[{alias:null,args:t,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"DocumentEvaluationSummary",kind:"LinkedField",name:"documentEvaluationSummary",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"averageNdcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averagePrecision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanReciprocalRank",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hitRate",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"60d7798d88e1408e6b6b0bebdc1716f5",id:null,metadata:{},name:"DocumentEvaluationSummaryValueQuery",operationKind:"query",text:`query DocumentEvaluationSummaryValueQuery(
1626
+ `}}}();_i.hash="6a15ba35fe9e1e35aa4c517ab6309a2b";function Zu({annotationName:n}){const{projectId:a}=tn(),{timeRange:t}=Da(),l=I.useLazyLoadQuery(_i,{annotationName:n,id:a,timeRange:{start:t.start.toISOString(),end:t.end.toISOString()}});return s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:n}),e(u.Suspense,{fallback:e(K,{textSize:"xlarge",children:"--"}),children:e(Xu,{annotationName:n,project:l.project})})]})}function Xu(n){var y,k;const{project:a,annotationName:t}=n,{fetchKey:l}=Gn(),[i,r]=I.useRefetchableFragment(wi,a);u.useEffect(()=>{u.startTransition(()=>{r({},{fetchPolicy:"store-and-network"})})},[l,r]);const o=Be(),d=[ol(t),o.default,o.gray600,o.gray400,o.gray200],g=(y=i==null?void 0:i.spanAnnotationSummary)==null?void 0:y.meanScore,f=(k=i==null?void 0:i.spanAnnotationSummary)==null?void 0:k.labelFractions,m=typeof g=="number",p=Array.isArray(f)&&f.length>0;return!m&&!p?e(K,{textSize:"xlarge",children:"--"}):s(we,{delay:0,placement:"bottom",children:[e(hn,{children:s(h,{direction:"row",alignItems:"center",gap:"size-50",children:[p?e(wd,{width:24,height:24,children:e(_d,{data:f,dataKey:"fraction",nameKey:"label",cx:"50%",cy:"50%",innerRadius:8,outerRadius:11,strokeWidth:0,stroke:"transparent",children:f.map((S,C)=>e(Ed,{fill:d[C%d.length]},`cell-${C}`))})}):null,e(K,{textSize:"xlarge",children:m?Ze(g):"--"})]})}),e(ia,{children:e(F,{width:"size-2400",children:s(h,{direction:"column",gap:"size-50",children:[p&&e("ul",{children:f.map((S,C)=>e("li",{children:e(pe,{color:d[C%d.length],name:S.label,shape:"square",value:dl(S.fraction*100)})},S.label))}),p&&m?e(Ka,{}):null,m?s(h,{direction:"row",justifyContent:"space-between",children:[e(K,{children:"mean"}),e(K,{children:Ze(g)})]}):null]})})})]})}const Ei=function(){var n={defaultValue:null,kind:"LocalArgument",name:"evaluationName"},a={defaultValue:null,kind:"LocalArgument",name:"id"},t={defaultValue:null,kind:"LocalArgument",name:"timeRange"},l=[{kind:"Variable",name:"id",variableName:"id"}],i=[{kind:"Variable",name:"evaluationName",variableName:"evaluationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}];return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"DocumentEvaluationSummaryValueQuery",selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:i,kind:"FragmentSpread",name:"DocumentEvaluationSummaryValueFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a],kind:"Operation",name:"DocumentEvaluationSummaryValueQuery",selections:[{alias:null,args:l,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"DocumentEvaluationSummary",kind:"LinkedField",name:"documentEvaluationSummary",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"averageNdcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averagePrecision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanReciprocalRank",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hitRate",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"60d7798d88e1408e6b6b0bebdc1716f5",id:null,metadata:{},name:"DocumentEvaluationSummaryValueQuery",operationKind:"query",text:`query DocumentEvaluationSummaryValueQuery(
1809
1627
  $evaluationName: String!
1810
1628
  $timeRange: TimeRange!
1811
1629
  $id: GlobalID!
@@ -1827,7 +1645,7 @@ fragment DocumentEvaluationSummaryValueFragment_1dJL9N on Project {
1827
1645
  }
1828
1646
  id
1829
1647
  }
1830
- `}}}();_i.hash="15d0652aa260c80f62acec943f615d93";const Ei={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"evaluationName"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:_i,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"DocumentEvaluationSummaryValueFragment",selections:[{alias:null,args:[{kind:"Variable",name:"evaluationName",variableName:"evaluationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"DocumentEvaluationSummary",kind:"LinkedField",name:"documentEvaluationSummary",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"averageNdcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averagePrecision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanReciprocalRank",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hitRate",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null};Ei.hash="15d0652aa260c80f62acec943f615d93";const Ri=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"evaluationName"},{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l=[{kind:"Variable",name:"evaluationName",variableName:"evaluationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DocumentEvaluationSummaryQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:l,kind:"FragmentSpread",name:"DocumentEvaluationSummaryValueFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DocumentEvaluationSummaryQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:l,concreteType:"DocumentEvaluationSummary",kind:"LinkedField",name:"documentEvaluationSummary",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"averageNdcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averagePrecision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanReciprocalRank",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hitRate",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"3ebd1cf66ef8f31c995ec6aae6505e94",id:null,metadata:{},name:"DocumentEvaluationSummaryQuery",operationKind:"query",text:`query DocumentEvaluationSummaryQuery(
1648
+ `}}}();Ei.hash="15d0652aa260c80f62acec943f615d93";const Ai={argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"evaluationName"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:Ei,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"DocumentEvaluationSummaryValueFragment",selections:[{alias:null,args:[{kind:"Variable",name:"evaluationName",variableName:"evaluationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"DocumentEvaluationSummary",kind:"LinkedField",name:"documentEvaluationSummary",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"averageNdcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averagePrecision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanReciprocalRank",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hitRate",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null};Ai.hash="15d0652aa260c80f62acec943f615d93";const Ri=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"evaluationName"},{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t=[{kind:"Variable",name:"evaluationName",variableName:"evaluationName"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DocumentEvaluationSummaryQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:t,kind:"FragmentSpread",name:"DocumentEvaluationSummaryValueFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DocumentEvaluationSummaryQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:t,concreteType:"DocumentEvaluationSummary",kind:"LinkedField",name:"documentEvaluationSummary",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"averageNdcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averagePrecision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanReciprocalRank",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hitRate",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"3ebd1cf66ef8f31c995ec6aae6505e94",id:null,metadata:{},name:"DocumentEvaluationSummaryQuery",operationKind:"query",text:`query DocumentEvaluationSummaryQuery(
1831
1649
  $evaluationName: String!
1832
1650
  $id: GlobalID!
1833
1651
  $timeRange: TimeRange!
@@ -1849,7 +1667,7 @@ fragment DocumentEvaluationSummaryValueFragment_1dJL9N on Project {
1849
1667
  }
1850
1668
  id
1851
1669
  }
1852
- `}}}();Ri.hash="4d50474ffa9b9e4a68d07f6e0777c144";function rm({evaluationName:n}){const{projectId:a}=ln(),{timeRange:l}=Ka(),t=D.useLazyLoadQuery(Ri,{id:a,evaluationName:n,timeRange:{start:l.start.toISOString(),end:l.end.toISOString()}});return s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:n}),e(u.Suspense,{fallback:e(K,{textSize:"xlarge",children:"--"}),children:e(sm,{evaluationName:n,project:t==null?void 0:t.project})})]})}function sm(n){var g,f,m,p;const{project:a}=n,{fetchKey:l}=qn(),[t,i]=D.useRefetchableFragment(Ei,a);u.useEffect(()=>{u.startTransition(()=>{i({},{fetchPolicy:"store-and-network"})})},[l,i]);const r=(g=t==null?void 0:t.documentEvaluationSummary)==null?void 0:g.averageNdcg,o=(f=t==null?void 0:t.documentEvaluationSummary)==null?void 0:f.averagePrecision,c=(m=t==null?void 0:t.documentEvaluationSummary)==null?void 0:m.hitRate,d=(p=t==null?void 0:t.documentEvaluationSummary)==null?void 0:p.meanReciprocalRank;return s(Le,{delay:0,placement:"bottom",children:[e(kn,{children:e(h,{direction:"row",alignItems:"center",gap:"size-50",height:"28px",children:s(U,{children:[e(De,{metric:"ndcg",score:r},"ndcg"),e(De,{metric:"precision",score:o},"precision"),e(De,{metric:"hit rate",score:c},"hit")]})})}),e(aa,{children:e(F,{width:"size-2400",children:s(h,{direction:"column",children:[s(h,{justifyContent:"space-between",children:[e(K,{children:"average ndcg"}),e(K,{children:typeof r=="number"?ze(r):"--"})]}),s(h,{justifyContent:"space-between",children:[e(K,{children:"average precision"}),e(K,{children:typeof o=="number"?ze(o):"--"})]}),s(h,{justifyContent:"space-between",children:[e(K,{children:"mean reciprocal rank"}),e(K,{children:typeof d=="number"?ze(d):"--"})]}),s(h,{justifyContent:"space-between",children:[e(K,{children:"hit rate"}),e(K,{children:typeof c=="number"?ze(c):"--"})]})]})})})]})}function om(n){const{extra:a}=n,{fetchKey:l}=qn(),[t,i]=D.useRefetchableFragment(Ii,n.project);u.useEffect(()=>{u.startTransition(()=>{i({},{fetchPolicy:"store-and-network"})})},[l,i]);const r=t==null?void 0:t.latencyMsP50,o=t==null?void 0:t.latencyMsP99,c=t==null?void 0:t.tokenCountTotal,d=t==null?void 0:t.spanAnnotationNames,g=t==null?void 0:t.documentEvaluationNames;return e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-200",paddingBottom:"size-50",flex:"none",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e("div",{css:C`
1670
+ `}}}();Ri.hash="4d50474ffa9b9e4a68d07f6e0777c144";function Yu({evaluationName:n}){const{projectId:a}=tn(),{timeRange:t}=Da(),l=I.useLazyLoadQuery(Ri,{id:a,evaluationName:n,timeRange:{start:t.start.toISOString(),end:t.end.toISOString()}});return s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:n}),e(u.Suspense,{fallback:e(K,{textSize:"xlarge",children:"--"}),children:e(em,{evaluationName:n,project:l==null?void 0:l.project})})]})}function em(n){var g,f,m,p;const{project:a}=n,{fetchKey:t}=Gn(),[l,i]=I.useRefetchableFragment(Ai,a);u.useEffect(()=>{u.startTransition(()=>{i({},{fetchPolicy:"store-and-network"})})},[t,i]);const r=(g=l==null?void 0:l.documentEvaluationSummary)==null?void 0:g.averageNdcg,o=(f=l==null?void 0:l.documentEvaluationSummary)==null?void 0:f.averagePrecision,c=(m=l==null?void 0:l.documentEvaluationSummary)==null?void 0:m.hitRate,d=(p=l==null?void 0:l.documentEvaluationSummary)==null?void 0:p.meanReciprocalRank;return s(we,{delay:0,placement:"bottom",children:[e(hn,{children:e(h,{direction:"row",alignItems:"center",gap:"size-50",height:"28px",children:s(H,{children:[e(Ie,{metric:"ndcg",score:r},"ndcg"),e(Ie,{metric:"precision",score:o},"precision"),e(Ie,{metric:"hit rate",score:c},"hit")]})})}),e(ia,{children:e(F,{width:"size-2400",children:s(h,{direction:"column",children:[s(h,{justifyContent:"space-between",children:[e(K,{children:"average ndcg"}),e(K,{children:typeof r=="number"?Ze(r):"--"})]}),s(h,{justifyContent:"space-between",children:[e(K,{children:"average precision"}),e(K,{children:typeof o=="number"?Ze(o):"--"})]}),s(h,{justifyContent:"space-between",children:[e(K,{children:"mean reciprocal rank"}),e(K,{children:typeof d=="number"?Ze(d):"--"})]}),s(h,{justifyContent:"space-between",children:[e(K,{children:"hit rate"}),e(K,{children:typeof c=="number"?Ze(c):"--"})]})]})})})]})}function nm(n){const{extra:a}=n,{fetchKey:t}=Gn(),[l,i]=I.useRefetchableFragment(Ii,n.project);u.useEffect(()=>{u.startTransition(()=>{i({},{fetchPolicy:"store-and-network"})})},[t,i]);const r=l==null?void 0:l.latencyMsP50,o=l==null?void 0:l.latencyMsP99,c=l==null?void 0:l.tokenCountTotal,d=l==null?void 0:l.spanAnnotationNames,g=l==null?void 0:l.documentEvaluationNames;return e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-200",paddingBottom:"size-50",flex:"none",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e("div",{css:v`
1853
1671
  overflow-x: auto;
1854
1672
  overflow-y: hidden;
1855
1673
  flex: 1 1 auto;
@@ -1885,7 +1703,7 @@ fragment DocumentEvaluationSummaryValueFragment_1dJL9N on Project {
1885
1703
  left center,
1886
1704
  right center;
1887
1705
  background-attachment: local, local, scroll, scroll;
1888
- `,children:s(h,{direction:"row",gap:"size-400",alignItems:"center",children:[s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Total Traces"}),e(K,{textSize:"xlarge",children:bn(t==null?void 0:t.traceCount)})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Total Tokens"}),e(K,{textSize:"xlarge",children:bn(c)})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Latency P50"}),r!=null?e(we,{latencyMs:r,textSize:"xlarge"}):e(K,{textSize:"xlarge",children:"--"})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Latency P99"}),o!=null?e(we,{latencyMs:o,textSize:"xlarge"}):e(K,{textSize:"xlarge",children:"--"})]}),d.map(f=>e(tm,{annotationName:f},f)),g.map(f=>e(rm,{evaluationName:f},`document-${f}`))]})}),e(F,{flex:"none",paddingStart:"size-100",children:a})]})})}const Mi=u.createContext(null);function Ni(){const n=u.useContext(Mi);if(n===null)throw new Error("useSpanFilterCondition must be used within a SpanFilterConditionProvider");return n}function xl(n){const[a,l]=u.useState(""),t=u.useCallback(r=>{u.startTransition(()=>{l(r)})},[]),i=u.useCallback(r=>{u.startTransition(()=>{a.length>0?l(a+" and "+r):l(r)})},[a]);return e(Mi.Provider,{value:{filterCondition:a,setFilterCondition:t,appendFilterCondition:i},children:n.children})}const Vi=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},l={defaultValue:50,kind:"LocalArgument",name:"first"},t={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},r={defaultValue:null,kind:"LocalArgument",name:"timeRange"},o=[{kind:"Variable",name:"id",variableName:"id"}],c={kind:"Variable",name:"after",variableName:"after"},d={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},g={kind:"Variable",name:"first",variableName:"first"},f={kind:"Variable",name:"sort",variableName:"sort"},m={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},b=[c,d,g,f,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],k=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{fragment:{argumentDefinitions:[n,a,l,t,i,r],kind:"Fragment",metadata:null,name:"SpansTableSpansQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[c,d,g,f],kind:"FragmentSpread",name:"SpansTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,l,i,r,t],kind:"Operation",name:"SpansTableSpansQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[m,{kind:"TypeDiscriminator",abstractKey:"__isNode"},p,{kind:"InlineFragment",selections:[y,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:b,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[p,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},y,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:k,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:k,storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[y,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[m],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:b,filters:["sort","filterCondition","timeRange"],handle:"connection",key:"SpansTable_spans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"21dc6f490cf749c02bc20bcdb43c199c",id:null,metadata:{},name:"SpansTableSpansQuery",operationKind:"query",text:`query SpansTableSpansQuery(
1706
+ `,children:s(h,{direction:"row",gap:"size-400",alignItems:"center",children:[s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Total Traces"}),e(K,{textSize:"xlarge",children:kn(l==null?void 0:l.traceCount)})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Total Tokens"}),e(K,{textSize:"xlarge",children:kn(c)})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Latency P50"}),r!=null?e(Ee,{latencyMs:r,textSize:"xlarge"}):e(K,{textSize:"xlarge",children:"--"})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Latency P99"}),o!=null?e(Ee,{latencyMs:o,textSize:"xlarge"}):e(K,{textSize:"xlarge",children:"--"})]}),d.map(f=>e(Zu,{annotationName:f},f)),g.map(f=>e(Yu,{evaluationName:f},`document-${f}`))]})}),e(F,{flex:"none",paddingStart:"size-100",children:a})]})})}const Mi=u.createContext(null);function Ni(){const n=u.useContext(Mi);if(n===null)throw new Error("useSpanFilterCondition must be used within a SpanFilterConditionProvider");return n}function At(n){const[a,t]=u.useState(""),l=u.useCallback(r=>{u.startTransition(()=>{t(r)})},[]),i=u.useCallback(r=>{u.startTransition(()=>{a.length>0?t(a+" and "+r):t(r)})},[a]);return e(Mi.Provider,{value:{filterCondition:a,setFilterCondition:l,appendFilterCondition:i},children:n.children})}const zi=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},t={defaultValue:50,kind:"LocalArgument",name:"first"},l={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},r={defaultValue:null,kind:"LocalArgument",name:"timeRange"},o=[{kind:"Variable",name:"id",variableName:"id"}],c={kind:"Variable",name:"after",variableName:"after"},d={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},g={kind:"Variable",name:"first",variableName:"first"},f={kind:"Variable",name:"sort",variableName:"sort"},m={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},k=[c,d,g,f,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],S=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t,l,i,r],kind:"Fragment",metadata:null,name:"SpansTableSpansQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[c,d,g,f],kind:"FragmentSpread",name:"SpansTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,t,i,r,l],kind:"Operation",name:"SpansTableSpansQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[m,{kind:"TypeDiscriminator",abstractKey:"__isNode"},p,{kind:"InlineFragment",selections:[y,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:k,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[p,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},y,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:S,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:S,storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[y,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[m],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:k,filters:["sort","filterCondition","timeRange"],handle:"connection",key:"SpansTable_spans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"21dc6f490cf749c02bc20bcdb43c199c",id:null,metadata:{},name:"SpansTableSpansQuery",operationKind:"query",text:`query SpansTableSpansQuery(
1889
1707
  $after: String = null
1890
1708
  $filterCondition: String = null
1891
1709
  $first: Int = 50
@@ -1956,14 +1774,14 @@ fragment SpansTable_spans_1XEuU on Project {
1956
1774
  }
1957
1775
  id
1958
1776
  }
1959
- `}}}();Vi.hash="4827989f55b1c0bd269253b6bc977439";const zi=function(){var n=["spans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Vi,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"SpansTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"spans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__SpansTable_spans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:t,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:t,storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},l],type:"Project",abstractKey:null}}();zi.hash="4827989f55b1c0bd269253b6bc977439";const $i=u.createContext(null);function dm({children:n,...a}){const[l]=u.useState(()=>Jo(a));return e($i.Provider,{value:l,children:n})}function an(n,a){const l=Ke.useContext($i);if(!l)throw new Error("Missing TracingContext.Provider in the tree");return ya(l,n,a)}function Oi(n){const{appendFilterCondition:a}=Ni(),{annotation:l}=n,{name:t,label:i,score:r}=l,o=u.useMemo(()=>{const c=[];return i!=null&&(c.push({filterName:"Match label",filterCondition:`annotations['${t}'].label == "${i}"`}),c.push({filterName:"Exclude label",filterCondition:`annotations['${t}'].label != "${i}"`})),typeof r=="number"&&(c.push({filterName:"Greater than score",filterCondition:`annotations['${t}'].score > ${r}`}),c.push({filterName:"Less than score",filterCondition:`annotations['${t}'].score < ${r}`}),c.push({filterName:"Equals score",filterCondition:`annotations['${t}'].score == ${r}`})),c},[t,i,r]);return s(F,{borderStartWidth:"thin",borderColor:"dark",paddingStart:"size-200",paddingEnd:"size-100",marginStart:"size-200",width:300,children:[e(K,{textSize:"large",weight:"heavy",children:"Filters"}),e("ul",{css:C`
1777
+ `}}}();zi.hash="4827989f55b1c0bd269253b6bc977439";const Vi=function(){var n=["spans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:zi,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"SpansTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"spans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__SpansTable_spans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:l,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:l,storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},t],type:"Project",abstractKey:null}}();Vi.hash="4827989f55b1c0bd269253b6bc977439";const $i=u.createContext(null);function am({children:n,...a}){const[t]=u.useState(()=>Xo(a));return e($i.Provider,{value:t,children:n})}function an(n,a){const t=Ke.useContext($i);if(!t)throw new Error("Missing TracingContext.Provider in the tree");return ba(t,n,a)}function Oi(n){const{appendFilterCondition:a}=Ni(),{annotation:t}=n,{name:l,label:i,score:r}=t,o=u.useMemo(()=>{const c=[];return i!=null&&(c.push({filterName:"Match label",filterCondition:`annotations['${l}'].label == "${i}"`}),c.push({filterName:"Exclude label",filterCondition:`annotations['${l}'].label != "${i}"`})),typeof r=="number"&&(c.push({filterName:"Greater than score",filterCondition:`annotations['${l}'].score > ${r}`}),c.push({filterName:"Less than score",filterCondition:`annotations['${l}'].score < ${r}`}),c.push({filterName:"Equals score",filterCondition:`annotations['${l}'].score == ${r}`})),c},[l,i,r]);return s(F,{borderStartWidth:"thin",borderColor:"dark",paddingStart:"size-200",paddingEnd:"size-100",marginStart:"size-200",width:300,children:[e(K,{textSize:"large",weight:"heavy",children:"Filters"}),e("ul",{css:v`
1960
1778
  display: flex;
1961
1779
  flex-direction: row;
1962
1780
  gap: var(--ac-global-dimension-size-100);
1963
1781
  color: var(--ac-global-color-primary);
1964
1782
  padding: var(--ac-global-dimension-size-100) 0;
1965
1783
  flex-wrap: wrap;
1966
- `,children:o.map(c=>e("li",{children:e(cm,{onClick:()=>{a(c.filterCondition)},children:c.filterName})},c.filterName))})]})}function cm({onClick:n,children:a}){return e("button",{onClick:l=>{l.preventDefault(),l.stopPropagation(),n()},className:"button--reset",css:C`
1784
+ `,children:o.map(c=>e("li",{children:e(tm,{onClick:()=>{a(c.filterCondition)},children:c.filterName})},c.filterName))})]})}function tm({onClick:n,children:a}){return e("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n()},className:"button--reset",css:v`
1967
1785
  color: var(--ac-global-text-color-900);
1968
1786
  border: 1px solid var(--ac-global-color-gray-200);
1969
1787
  border-radius: 4px;
@@ -1974,10 +1792,10 @@ fragment SpansTable_spans_1XEuU on Project {
1974
1792
  &:hover {
1975
1793
  background-color: var(--ac-global-color-gray-300);
1976
1794
  }
1977
- `,children:a})}function um({projectName:n}){const[a,l]=u.useState("Python");return e(H,{title:"Send Traces to this Project",size:"L",children:s(F,{padding:"size-400",overflow:"auto",children:[e(F,{paddingBottom:"size-100",children:e(at,{language:a,onChange:l})}),a==="Python"?e(lt,{projectName:n}):e(tt,{projectName:n})]})})}function Qi({projectName:n}){const[a,l]=u.useState(null),t=()=>{l(e(um,{projectName:n}))};return s("tbody",{className:"is-empty",children:[e("tr",{children:e("td",{colSpan:100,css:i=>C`
1795
+ `,children:a})}function lm({projectName:n}){const[a,t]=u.useState("Python");return e(B,{title:"Send Traces to this Project",size:"L",children:s(F,{padding:"size-400",overflow:"auto",children:[e(F,{paddingBottom:"size-100",children:e(cl,{language:a,onChange:t})}),a==="Python"?e(ul,{projectName:n}):e(ml,{projectName:n})]})})}function Qi({projectName:n}){const[a,t]=u.useState(null),l=()=>{t(e(lm,{projectName:n}))};return s("tbody",{className:"is-empty",children:[e("tr",{children:e("td",{colSpan:100,css:i=>v`
1978
1796
  text-align: center;
1979
1797
  padding: ${i.spacing.margin24}px ${i.spacing.margin24}px !important;
1980
- `,children:s(h,{direction:"column",gap:"size-200",alignItems:"center",children:["No traces found for this project",e(M,{variant:"default",icon:e(P,{svg:e(I.PlayCircleOutline,{})}),onClick:t,children:"Get Started"})]})})}),e(W,{onDismiss:()=>l(null),isDismissable:!0,type:"slideOver",children:a})]})}const ji={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"SpanColumnSelector_annotations",selections:[{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null}],type:"Project",abstractKey:null};ji.hash="ad01e6897ad1ea779eb346d85783b8b4";const mm=["spanKind","name"];function qi(n){return e(Za,{menu:e(gm,{...n}),triggerProps:{placement:"bottom end"},children:s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(P,{svg:e(I.Column,{})}),"Columns"]})})}const pa=C`
1798
+ `,children:s(h,{direction:"column",gap:"size-200",alignItems:"center",children:["No traces found for this project",e(N,{variant:"default",icon:e(w,{svg:e(L.PlayCircleOutline,{})}),onClick:l,children:"Get Started"})]})})}),e(W,{onDismiss:()=>t(null),isDismissable:!0,type:"slideOver",children:a})]})}const ji={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"SpanColumnSelector_annotations",selections:[{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null}],type:"Project",abstractKey:null};ji.hash="ad01e6897ad1ea779eb346d85783b8b4";const im=["spanKind","name"];function qi(n){return e(nt,{menu:e(rm,{...n}),triggerProps:{placement:"bottom end"},children:s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(w,{svg:e(L.Column,{})}),"Columns"]})})}const ha=v`
1981
1799
  padding: var(--ac-global-dimension-static-size-50)
1982
1800
  var(--ac-global-dimension-static-size-100);
1983
1801
  label {
@@ -1985,10 +1803,10 @@ fragment SpansTable_spans_1XEuU on Project {
1985
1803
  align-items: center;
1986
1804
  gap: var(--ac-global-dimension-static-size-100);
1987
1805
  }
1988
- `;function gm(n){const{columns:a}=n,l=an(d=>d.columnVisibility),t=an(d=>d.setColumnVisibility),i=u.useMemo(()=>a.filter(d=>!mm.includes(d.id)),[a]),r=u.useMemo(()=>i.every(d=>{const g=l[d.id];return g??!0}),[i,l]),o=u.useCallback(d=>{const{name:g,checked:f}=d.target;t({...l,[g]:f})},[l,t]),c=u.useCallback(d=>{const{checked:g}=d.target,f=i.reduce((m,p)=>({...m,[p.id]:g}),{});t(f)},[i,t]);return e("div",{css:C`
1806
+ `;function rm(n){const{columns:a}=n,t=an(d=>d.columnVisibility),l=an(d=>d.setColumnVisibility),i=u.useMemo(()=>a.filter(d=>!im.includes(d.id)),[a]),r=u.useMemo(()=>i.every(d=>{const g=t[d.id];return g??!0}),[i,t]),o=u.useCallback(d=>{const{name:g,checked:f}=d.target;l({...t,[g]:f})},[t,l]),c=u.useCallback(d=>{const{checked:g}=d.target,f=i.reduce((m,p)=>({...m,[p.id]:g}),{});l(f)},[i,l]);return e("div",{css:v`
1989
1807
  overflow-y: auto;
1990
1808
  max-height: calc(100vh - 200px);
1991
- `,children:s(F,{paddingTop:"size-50",paddingBottom:"size-50",children:[e(F,{borderBottomColor:"dark",borderBottomWidth:"thin",paddingBottom:"size-50",children:e("div",{css:pa,children:s("label",{children:[e("input",{type:"checkbox",name:"toggle-all",checked:r,onChange:c}),"span columns"]})})}),e("ul",{children:i.map(d=>{const g=l[d.id],f=g??!0,m=typeof d.columnDef.header=="string"?d.columnDef.header:d.id;return e("li",{css:pa,children:s("label",{children:[e("input",{type:"checkbox",name:d.id,checked:f,onChange:o}),m]})},d.id)})}),e(pm,{...n})]})})}function pm({query:n}){const a=D.useFragment(ji,n),l=an(o=>o.annotationColumnVisibility),t=an(o=>o.setAnnotationColumnVisibility),i=u.useMemo(()=>a.spanAnnotationNames.every(o=>l[o]||!1),[a.spanAnnotationNames,l]),r=u.useCallback(()=>{const o=a.spanAnnotationNames.reduce((c,d)=>({...c,[d]:!i}),{});t(o)},[a.spanAnnotationNames,t,i]);return s("section",{children:[e(F,{paddingTop:"size-50",paddingBottom:"size-50",borderColor:"dark",borderTopWidth:"thin",borderBottomWidth:"thin",children:e("div",{css:pa,children:s("label",{children:[e("input",{type:"checkbox",name:"toggle-evaluations-all",checked:i,onChange:r}),"feedback"]})})}),e("ul",{children:a.spanAnnotationNames.map(o=>{const c=l[o]??!1;return e("li",{css:pa,children:s("label",{children:[e("input",{type:"checkbox",name:o,checked:c,onChange:()=>{t({...l,[o]:!c})}}),o]})},o)})})]})}const Ui=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"condition"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"condition",variableName:"condition"}],concreteType:"ValidationResult",kind:"LinkedField",name:"validateSpanFilterCondition",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"isValid",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"errorMessage",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanFilterConditionFieldValidationQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanFilterConditionFieldValidationQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}]},params:{cacheID:"29583e7ec666cef832dc7effb9e75678",id:null,metadata:{},name:"SpanFilterConditionFieldValidationQuery",operationKind:"query",text:`query SpanFilterConditionFieldValidationQuery(
1809
+ `,children:s(F,{paddingTop:"size-50",paddingBottom:"size-50",children:[e(F,{borderBottomColor:"dark",borderBottomWidth:"thin",paddingBottom:"size-50",children:e("div",{css:ha,children:s("label",{children:[e("input",{type:"checkbox",name:"toggle-all",checked:r,onChange:c}),"span columns"]})})}),e("ul",{children:i.map(d=>{const g=t[d.id],f=g??!0,m=typeof d.columnDef.header=="string"?d.columnDef.header:d.id;return e("li",{css:ha,children:s("label",{children:[e("input",{type:"checkbox",name:d.id,checked:f,onChange:o}),m]})},d.id)})}),e(sm,{...n})]})})}function sm({query:n}){const a=I.useFragment(ji,n),t=an(o=>o.annotationColumnVisibility),l=an(o=>o.setAnnotationColumnVisibility),i=u.useMemo(()=>a.spanAnnotationNames.every(o=>t[o]||!1),[a.spanAnnotationNames,t]),r=u.useCallback(()=>{const o=a.spanAnnotationNames.reduce((c,d)=>({...c,[d]:!i}),{});l(o)},[a.spanAnnotationNames,l,i]);return s("section",{children:[e(F,{paddingTop:"size-50",paddingBottom:"size-50",borderColor:"dark",borderTopWidth:"thin",borderBottomWidth:"thin",children:e("div",{css:ha,children:s("label",{children:[e("input",{type:"checkbox",name:"toggle-evaluations-all",checked:i,onChange:r}),"feedback"]})})}),e("ul",{children:a.spanAnnotationNames.map(o=>{const c=t[o]??!1;return e("li",{css:ha,children:s("label",{children:[e("input",{type:"checkbox",name:o,checked:c,onChange:()=>{l({...t,[o]:!c})}}),o]})},o)})})]})}const Ui=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"condition"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Variable",name:"condition",variableName:"condition"}],concreteType:"ValidationResult",kind:"LinkedField",name:"validateSpanFilterCondition",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"isValid",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"errorMessage",storageKey:null}],storageKey:null}],type:"Project",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanFilterConditionFieldValidationQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanFilterConditionFieldValidationQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}]},params:{cacheID:"29583e7ec666cef832dc7effb9e75678",id:null,metadata:{},name:"SpanFilterConditionFieldValidationQuery",operationKind:"query",text:`query SpanFilterConditionFieldValidationQuery(
1992
1810
  $condition: String!
1993
1811
  $id: GlobalID!
1994
1812
  ) {
@@ -2004,7 +1822,7 @@ fragment SpansTable_spans_1XEuU on Project {
2004
1822
  id
2005
1823
  }
2006
1824
  }
2007
- `}}}();Ui.hash="22836f192038b0c40201d3b25aad65b4";const Bi=C`
1825
+ `}}}();Ui.hash="22836f192038b0c40201d3b25aad65b4";const Bi=v`
2008
1826
  flex: 1 1 auto;
2009
1827
  .cm-content {
2010
1828
  padding: var(--ac-global-dimension-static-size-100) 0;
@@ -2018,7 +1836,7 @@ fragment SpansTable_spans_1XEuU on Project {
2018
1836
  .cm-selectionLayer .cm-selectionBackground {
2019
1837
  background: var(--ac-global-color-cyan-400) !important;
2020
1838
  }
2021
- `,Hi=C`
1839
+ `,Hi=v`
2022
1840
  border-width: var(--ac-global-border-size-thin);
2023
1841
  border-style: solid;
2024
1842
  border-color: var(--ac-global-input-field-border-color);
@@ -2035,19 +1853,19 @@ fragment SpansTable_spans_1XEuU on Project {
2035
1853
  border-color: var(--ac-global-color-danger);
2036
1854
  }
2037
1855
  box-sizing: border-box;
2038
- `;function ym(n){const a=n.matchBefore(/\w*/);return!a||a.from==a.to&&!n.explicit?null:{from:a.from,options:[{label:"span_kind",type:"variable",info:"The span variant: CHAIN, LLM, RETRIEVER, TOOL, etc."},{label:"status_code",type:"variable",info:"The span status: OK, UNSET, or ERROR"},{label:"input.value",type:"variable",info:"The input value of a span, typically a query"},{label:"output.value",type:"variable",info:"The output value of a span, typically a response"},{label:"name",type:"variable",info:"The name given to a span - e.x. OpenAI"},{label:"latency_ms",type:"variable",info:"Latency (i.e. duration) in milliseconds"},{label:"cumulative_token_count.prompt",type:"variable",info:"Sum of token count for prompt from self and all child spans"},{label:"cumulative_token_count.completion",type:"variable",info:"Sum of token count for completion from self and all child spans"},{label:"cumulative_token_count.total",type:"variable",info:"Sum of token count total (prompt + completion) from self and all child spans"},{label:"llm spans",type:"text",apply:"span_kind == 'LLM'",detail:"macro"},{label:"retriever spans",type:"text",apply:"span_kind == 'RETRIEVER'",detail:"macro"},{label:"search input",type:"text",apply:"'' in input.value",detail:"macro"},{label:"search output",type:"text",apply:"'' in output.value",detail:"macro"},{label:"status_code error",type:"text",apply:"status_code == 'ERROR'",detail:"macro"},{label:"Latency >= 10s",type:"text",apply:"latency_ms >= 10_000",detail:"macro"},{label:"Tokens >= 1,000",type:"text",apply:"llm.token_count.total >= 1_000",detail:"macro"},{label:"Hallucinations",type:"text",apply:"annotations['Hallucination'].label == 'hallucinated'",detail:"macro"},{label:"Annotations",type:"text",apply:"annotations['Hallucination'].label == 'hallucinated'",detail:"macro"},{label:"Metadata",type:"text",apply:"metadata['topic'] == 'agent'",detail:"macro"},{label:"Substring",type:"text",apply:"'agent' in input.value",detail:"macro"}]}}async function fm(n,a){if(!n)return{isValid:!0,errorMessage:null};const l=await $s.fetchQuery(xe,Ui,{condition:n,id:a}).toPromise();if(!l)throw new Error("Filter condition validation is null");return l.project.validateSpanFilterCondition}const hm=[Pd.of([{key:"Enter",run:n=>!0}]),sl(),wd({override:[ym]})];function Gi(n){const{onValidCondition:a,placeholder:l="filter condition (e.x. span_kind == 'LLM')"}=n,[t,i]=u.useState(!1),[r,o]=u.useState(""),{filterCondition:c,setFilterCondition:d,appendFilterCondition:g}=Ni(),f=u.useDeferredValue(c),{theme:m}=zn(),p=m==="dark"?oa:void 0,{projectId:y}=ln();u.useEffect(()=>{fm(f,y).then(S=>{S!=null&&S.isValid?(o(""),u.startTransition(()=>{a(f)})):o((S==null?void 0:S.errorMessage)??"Invalid filter condition")})},[a,f,y]);const b=r!=="",k=c!=="";return s("div",{"data-is-focused":t,"data-is-invalid":b,className:"span-filter-condition-field",css:Hi,children:[s(h,{direction:"row",children:[e(co,{children:e(P,{svg:e(I.Search,{})})}),e(sa,{css:Bi,indentWithTab:!1,basicSetup:{lineNumbers:!1,foldGutter:!1,bracketMatching:!0,syntaxHighlighting:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,defaultKeymap:!1},onFocus:()=>i(!0),onBlur:()=>i(!1),value:c,onChange:d,height:"36px",width:"100%",theme:p,placeholder:l,extensions:hm}),e("button",{css:C`
1856
+ `;function om(n){const a=n.matchBefore(/\w*/);return!a||a.from==a.to&&!n.explicit?null:{from:a.from,options:[{label:"span_kind",type:"variable",info:"The span variant: CHAIN, LLM, RETRIEVER, TOOL, etc."},{label:"status_code",type:"variable",info:"The span status: OK, UNSET, or ERROR"},{label:"input.value",type:"variable",info:"The input value of a span, typically a query"},{label:"output.value",type:"variable",info:"The output value of a span, typically a response"},{label:"name",type:"variable",info:"The name given to a span - e.x. OpenAI"},{label:"latency_ms",type:"variable",info:"Latency (i.e. duration) in milliseconds"},{label:"cumulative_token_count.prompt",type:"variable",info:"Sum of token count for prompt from self and all child spans"},{label:"cumulative_token_count.completion",type:"variable",info:"Sum of token count for completion from self and all child spans"},{label:"cumulative_token_count.total",type:"variable",info:"Sum of token count total (prompt + completion) from self and all child spans"},{label:"llm spans",type:"text",apply:"span_kind == 'LLM'",detail:"macro"},{label:"retriever spans",type:"text",apply:"span_kind == 'RETRIEVER'",detail:"macro"},{label:"search input",type:"text",apply:"'' in input.value",detail:"macro"},{label:"search output",type:"text",apply:"'' in output.value",detail:"macro"},{label:"status_code error",type:"text",apply:"status_code == 'ERROR'",detail:"macro"},{label:"Latency >= 10s",type:"text",apply:"latency_ms >= 10_000",detail:"macro"},{label:"Tokens >= 1,000",type:"text",apply:"llm.token_count.total >= 1_000",detail:"macro"},{label:"Hallucinations",type:"text",apply:"annotations['Hallucination'].label == 'hallucinated'",detail:"macro"},{label:"Annotations",type:"text",apply:"annotations['Hallucination'].label == 'hallucinated'",detail:"macro"},{label:"Metadata",type:"text",apply:"metadata['topic'] == 'agent'",detail:"macro"},{label:"Substring",type:"text",apply:"'agent' in input.value",detail:"macro"}]}}async function dm(n,a){if(!n)return{isValid:!0,errorMessage:null};const t=await Qs.fetchQuery(xe,Ui,{condition:n,id:a}).toPromise();if(!t)throw new Error("Filter condition validation is null");return t.project.validateSpanFilterCondition}const cm=[Rd.of([{key:"Enter",run:n=>!0}]),pt(),Md({override:[om]})];function Gi(n){const{onValidCondition:a,placeholder:t="filter condition (e.x. span_kind == 'LLM')"}=n,[l,i]=u.useState(!1),[r,o]=u.useState(""),{filterCondition:c,setFilterCondition:d,appendFilterCondition:g}=Ni(),f=u.useDeferredValue(c),{theme:m}=Qn(),p=m==="dark"?da:void 0,{projectId:y}=tn();u.useEffect(()=>{dm(f,y).then(C=>{C!=null&&C.isValid?(o(""),u.startTransition(()=>{a(f)})):o((C==null?void 0:C.errorMessage)??"Invalid filter condition")})},[a,f,y]);const k=r!=="",S=c!=="";return s("div",{"data-is-focused":l,"data-is-invalid":k,className:"span-filter-condition-field",css:Hi,children:[s(h,{direction:"row",children:[e(uo,{children:e(w,{svg:e(L.Search,{})})}),e(oa,{css:Bi,indentWithTab:!1,basicSetup:{lineNumbers:!1,foldGutter:!1,bracketMatching:!0,syntaxHighlighting:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,defaultKeymap:!1},onFocus:()=>i(!0),onBlur:()=>i(!1),value:c,onChange:d,height:"36px",width:"100%",theme:p,placeholder:t,extensions:cm}),e("button",{css:v`
2039
1857
  margin-right: var(--ac-global-dimension-static-size-100);
2040
1858
  color: var(--ac-global-text-color-700);
2041
- visibility: ${k?"visible":"hidden"};
2042
- `,onClick:()=>d(""),className:"button--reset",children:e(P,{svg:e(I.CloseCircleOutline,{})})}),s(tn,{placement:"bottom right",children:[e(kn,{children:e("button",{css:C`
1859
+ visibility: ${S?"visible":"hidden"};
1860
+ `,onClick:()=>d(""),className:"button--reset",children:e(w,{svg:e(L.CloseCircleOutline,{})})}),s(Cn,{placement:"bottom right",children:[e(hn,{children:e("button",{css:v`
2043
1861
  color: var(--ac-global-text-color-700);
2044
1862
  background-color: var(--ac-global-color-grey-400);
2045
1863
  padding-left: var(--ac-global-dimension-static-size-100);
2046
1864
  padding-right: var(--ac-global-dimension-static-size-100);
2047
1865
  height: 100%;
2048
- `,className:"button--reset",children:e(P,{svg:e(I.PlusCircleOutline,{})})})}),e(km,{onAddFilterConditionSnippet:g})]})]}),s(Le,{isOpen:b&&t,placement:"bottom",children:[e(kn,{children:e("div",{})}),e(aa,{children:r!=""?e(K,{color:"danger",children:r}):e(K,{color:"success",children:"Valid Expression"})})]})]})}function km(n){const{onAddFilterConditionSnippet:a}=n;return e(F,{width:"500px",paddingTop:"size-200",paddingStart:"size-200",paddingEnd:"size-200",borderRadius:"medium",borderWidth:"thin",borderColor:"light",backgroundColor:"light",children:s(ye,{children:[e(gn,{label:"filter by kind",initialSnippet:"span_kind == 'LLM'",onAddFilterConditionSnippet:a},"kind"),e(gn,{label:"filter by token count",initialSnippet:"cumulative_token_count.total > 1000",onAddFilterConditionSnippet:a},"token_count"),e(gn,{label:"filter by annotation label",initialSnippet:"annotations['Hallucination'].label == 'hallucinated'",onAddFilterConditionSnippet:a},"annotation_label"),e(gn,{label:"filter by evaluation label",initialSnippet:"evals['Hallucination'].label == 'hallucinated'",onAddFilterConditionSnippet:a},"eval_label"),e(gn,{label:"filter by evaluation score",initialSnippet:"evals['Hallucination'].score < 1",onAddFilterConditionSnippet:a},"eval_score"),e(gn,{label:"filter by metadata",initialSnippet:"metadata['topic'] == 'agent'",onAddFilterConditionSnippet:a},"metadata"),e(gn,{label:"filter by substring",initialSnippet:"'agent' in input.value",onAddFilterConditionSnippet:a},"substring")]})})}function gn(n){const{initialSnippet:a,onAddFilterConditionSnippet:l}=n,[t,i]=u.useState(a),{theme:r}=zn(),o=r==="light"?void 0:oa;return e(la,{label:n.label,children:s(h,{direction:"row",width:"100%",gap:"size-100",children:[e("div",{css:C(Hi,C`
1866
+ `,className:"button--reset",children:e(w,{svg:e(L.PlusCircleOutline,{})})})}),e(um,{onAddFilterConditionSnippet:g})]})]}),s(we,{isOpen:k&&l,placement:"bottom",children:[e(hn,{children:e("div",{})}),e(ia,{children:r!=""?e(K,{color:"danger",children:r}):e(K,{color:"success",children:"Valid Expression"})})]})]})}function um(n){const{onAddFilterConditionSnippet:a}=n;return e(F,{width:"500px",paddingTop:"size-200",paddingStart:"size-200",paddingEnd:"size-200",borderRadius:"medium",borderWidth:"thin",borderColor:"light",backgroundColor:"light",children:s(fe,{children:[e(gn,{label:"filter by kind",initialSnippet:"span_kind == 'LLM'",onAddFilterConditionSnippet:a},"kind"),e(gn,{label:"filter by token count",initialSnippet:"cumulative_token_count.total > 1000",onAddFilterConditionSnippet:a},"token_count"),e(gn,{label:"filter by annotation label",initialSnippet:"annotations['Hallucination'].label == 'hallucinated'",onAddFilterConditionSnippet:a},"annotation_label"),e(gn,{label:"filter by evaluation label",initialSnippet:"evals['Hallucination'].label == 'hallucinated'",onAddFilterConditionSnippet:a},"eval_label"),e(gn,{label:"filter by evaluation score",initialSnippet:"evals['Hallucination'].score < 1",onAddFilterConditionSnippet:a},"eval_score"),e(gn,{label:"filter by metadata",initialSnippet:"metadata['topic'] == 'agent'",onAddFilterConditionSnippet:a},"metadata"),e(gn,{label:"filter by substring",initialSnippet:"'agent' in input.value",onAddFilterConditionSnippet:a},"substring")]})})}function gn(n){const{initialSnippet:a,onAddFilterConditionSnippet:t}=n,[l,i]=u.useState(a),{theme:r}=Qn(),o=r==="light"?void 0:da;return e(On,{label:n.label,children:s(h,{direction:"row",width:"100%",gap:"size-100",children:[e("div",{css:v(Hi,v`
2049
1867
  flex: 1 1 auto;
2050
- `),children:e(sa,{value:t,basicSetup:{lineNumbers:!1,foldGutter:!1,bracketMatching:!0,syntaxHighlighting:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1},extensions:[sl()],editable:!0,onChange:i,theme:o,css:Bi})}),e(M,{title:"Add to filter condition",variant:"default",onClick:()=>l(t),icon:e(P,{svg:e(I.PlusCircleOutline,{})})})]})})}const Wi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"addSpansToDataset",plural:!1,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"dataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanSelectionToolbarAddSpansToDatasetMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanSelectionToolbarAddSpansToDatasetMutation",selections:a},params:{cacheID:"1c694540190478b8fba8ef3c0cacf30c",id:null,metadata:{},name:"SpanSelectionToolbarAddSpansToDatasetMutation",operationKind:"mutation",text:`mutation SpanSelectionToolbarAddSpansToDatasetMutation(
1868
+ `),children:e(oa,{value:l,basicSetup:{lineNumbers:!1,foldGutter:!1,bracketMatching:!0,syntaxHighlighting:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1},extensions:[pt()],editable:!0,onChange:i,theme:o,css:Bi})}),e(N,{title:"Add to filter condition",variant:"default",onClick:()=>t(l),icon:e(w,{svg:e(L.PlusCircleOutline,{})})})]})})}const Wi=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"addSpansToDataset",plural:!1,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"dataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"SpanSelectionToolbarAddSpansToDatasetMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"SpanSelectionToolbarAddSpansToDatasetMutation",selections:a},params:{cacheID:"1c694540190478b8fba8ef3c0cacf30c",id:null,metadata:{},name:"SpanSelectionToolbarAddSpansToDatasetMutation",operationKind:"mutation",text:`mutation SpanSelectionToolbarAddSpansToDatasetMutation(
2051
1869
  $input: AddSpansToDatasetInput!
2052
1870
  ) {
2053
1871
  addSpansToDataset(input: $input) {
@@ -2084,15 +1902,15 @@ fragment DatasetSelectorPopoverContent_datasets on Query {
2084
1902
  }
2085
1903
  }
2086
1904
  }
2087
- `}};Xi.hash="7cd8a13144d97d2b5294f2a09c9e1351";function bm(n){const{onCreateNewDataset:a,onDatasetSelected:l}=n,[t,i]=u.useState(""),r=D.useLazyLoadQuery(Xi,{},{fetchPolicy:"network-only"});return s(V,{title:"Add to Dataset",variant:"compact",backgroundColor:"light",borderColor:"light",bodyStyle:{padding:0},extra:e(M,{variant:"default",size:"compact",onClick:a,children:"New Dataset"}),children:[e(F,{padding:"size-100",children:e(X,{type:"search",placeholder:"Search datasets",addonBefore:e(P,{svg:e(I.Search,{})}),onChange:o=>{i(o)}})}),e(F,{borderTopWidth:"thin",borderColor:"light",children:e("div",{css:C`
1905
+ `}};Xi.hash="7cd8a13144d97d2b5294f2a09c9e1351";function mm(n){const{onCreateNewDataset:a,onDatasetSelected:t}=n,[l,i]=u.useState(""),r=I.useLazyLoadQuery(Xi,{},{fetchPolicy:"network-only"});return s($,{title:"Add to Dataset",variant:"compact",backgroundColor:"light",borderColor:"light",bodyStyle:{padding:0},extra:e(N,{variant:"default",size:"compact",onClick:a,children:"New Dataset"}),children:[e(F,{padding:"size-100",children:e(G,{type:"search",placeholder:"Search datasets",addonBefore:e(w,{svg:e(L.Search,{})}),onChange:o=>{i(o)}})}),e(F,{borderTopWidth:"thin",borderColor:"light",children:e("div",{css:v`
2088
1906
  height: 400px;
2089
1907
  overflow-y: auto;
2090
- `,children:e(Sm,{query:r,search:t,onDatasetSelected:l})})})]})}function Sm(n){const{search:a,onDatasetSelected:l}=n,[t]=D.useRefetchableFragment(Zi,n.query),i=u.useMemo(()=>{let o=t.datasets.edges.map(c=>c.dataset);return a&&(o=o.filter(c=>c.name.toLowerCase().includes(a.toLowerCase()))),o},[a,t]);return i.length===0?e(F,{padding:"size-200",children:e(h,{direction:"column",justifyContent:"center",alignItems:"center",flex:"1 1 auto",children:e(K,{children:"No datasets found"})})}):e(na,{selectionMode:"single",onSelectionChange:o=>{if(typeof o=="object"){const c=Array.from(o);l(c[0])}},children:i.map(o=>e(B,{children:o.name},o.id))})}function Yi(n){const a=Y(),[l,t]=u.useState(null),i=oe(),r=ce(),[o,c]=u.useState(!1),{selectedSpans:d,onClearSelection:g}=n,[f,m]=D.useMutation(Wi),p=d.length!==1,y=u.useCallback(b=>{f({variables:{input:{datasetId:b,spanIds:d.map(k=>k.id)}},onCompleted:()=>{i({title:"Examples added to dataset",message:`${d.length} example${p?"s":""} have been added to the dataset.`,action:{text:"View dataset",onClick:()=>{a(`/datasets/${b}/examples`)}}}),g()},onError:k=>{r({title:"An error occurred",message:`Failed to add spans to dataset: ${k.message}`})}})},[f,d,i,p,g,a,r]);return s("div",{css:C`
1908
+ `,children:e(gm,{query:r,search:l,onDatasetSelected:t})})})]})}function gm(n){const{search:a,onDatasetSelected:t}=n,[l]=I.useRefetchableFragment(Zi,n.query),i=u.useMemo(()=>{let o=l.datasets.edges.map(c=>c.dataset);return a&&(o=o.filter(c=>c.name.toLowerCase().includes(a.toLowerCase()))),o},[a,l]);return i.length===0?e(F,{padding:"size-200",children:e(h,{direction:"column",justifyContent:"center",alignItems:"center",flex:"1 1 auto",children:e(K,{children:"No datasets found"})})}):e(va,{selectionMode:"single",onSelectionChange:o=>{if(typeof o=="object"){const c=Array.from(o);t(c[0])}},children:i.map(o=>e(U,{children:o.name},o.id))})}function Yi(n){const a=Y(),[t,l]=u.useState(null),i=oe(),r=ce(),[o,c]=u.useState(!1),{selectedSpans:d,onClearSelection:g}=n,[f,m]=I.useMutation(Wi),p=d.length!==1,y=u.useCallback(k=>{f({variables:{input:{datasetId:k,spanIds:d.map(S=>S.id)}},onCompleted:()=>{i({title:"Examples added to dataset",message:`${d.length} example${p?"s":""} have been added to the dataset.`,action:{text:"View dataset",onClick:()=>{a(`/datasets/${k}/examples`)}}}),g()},onError:S=>{r({title:"An error occurred",message:`Failed to add spans to dataset: ${S.message}`})}})},[f,d,i,p,g,a,r]);return s("div",{css:v`
2091
1909
  position: absolute;
2092
1910
  bottom: var(--ac-global-dimension-size-400);
2093
1911
  left: 50%;
2094
1912
  transform: translateX(-50%);
2095
- `,children:[e(F,{backgroundColor:"light",padding:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"medium",minWidth:"size-6000",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(K,{children:`${d.length} span${p?"s":""} selected`}),s(h,{direction:"row",gap:"size-100",children:[e(M,{variant:"default",size:"compact",onClick:g,children:"Cancel"}),s(tn,{placement:"top end",crossOffset:300,isOpen:o,onOpenChange:b=>{c(b)},children:[e(M,{variant:"primary",size:"compact",icon:e(P,{svg:e(I.DatabaseOutline,{})}),loading:m,disabled:m,children:m?"Adding to dataset":"Add to dataset"}),e(u.Suspense,{children:e(bm,{onDatasetSelected:b=>{y(b),c(!1)},onCreateNewDataset:()=>{c(!1),t(e(H,{title:"New Dataset",isDismissable:!0,onDismiss:()=>t(null),children:e(nl,{onDatasetCreateError:()=>{r({title:"Dataset creation failed",message:"Failed to create dataset."})},onDatasetCreated:b=>{t(null),i({title:"Dataset created",message:`${b.name} has been successfully created.`}),c(!0)}})}))}})})]})]})]})}),e(W,{onDismiss:()=>{t(null)},children:l})]})}const er=C`
1913
+ `,children:[e(F,{backgroundColor:"light",padding:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"medium",minWidth:"size-6000",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(K,{children:`${d.length} span${p?"s":""} selected`}),s(h,{direction:"row",gap:"size-100",children:[e(N,{variant:"default",size:"compact",onClick:g,children:"Cancel"}),s(Cn,{placement:"top end",crossOffset:300,isOpen:o,onOpenChange:k=>{c(k)},children:[e(N,{variant:"primary",size:"compact",icon:e(w,{svg:e(L.DatabaseOutline,{})}),loading:m,disabled:m,children:m?"Adding to dataset":"Add to dataset"}),e(u.Suspense,{children:e(mm,{onDatasetSelected:k=>{y(k),c(!1)},onCreateNewDataset:()=>{c(!1),l(e(B,{title:"New Dataset",isDismissable:!0,onDismiss:()=>l(null),children:e(st,{onDatasetCreateError:()=>{r({title:"Dataset creation failed",message:"Failed to create dataset."})},onDatasetCreated:k=>{l(null),i({title:"Dataset created",message:`${k.name} has been successfully created.`}),c(!0)}})}))}})})]})]})]})}),e(W,{onDismiss:()=>{l(null)},children:t})]})}const er=v`
2096
1914
  display: flex;
2097
1915
  flex-direction: column;
2098
1916
  flex: 1 1 auto;
@@ -2105,10 +1923,10 @@ fragment DatasetSelectorPopoverContent_datasets on Query {
2105
1923
  .ac-dropdown-button {
2106
1924
  min-width: var(--ac-global-dimension-static-size-300);
2107
1925
  }
2108
- `,ea="annotations",$e=":",nr={col:"startTime",dir:"desc"};function ar(n){let a=null,l=null;if(n.id&&n.id.startsWith(ea)){const[,t,i]=n.id.split($e);l={attr:t,name:i}}else a=n.id;return{col:a,evalResultKey:l,dir:n.desc?"desc":"asc"}}const Dl=50;function vm(n){const{fetchKey:a}=qn(),l=u.useRef(null),[t,i]=u.useState({}),[r,o]=u.useState([]),[c,d]=u.useState(""),g=an(N=>N.columnVisibility),f=Y(),{data:m,loadNext:p,hasNext:y,isLoadingNext:b,refetch:k}=D.usePaginationFragment(zi,n.project),S=an(N=>N.annotationColumnVisibility),v=u.useMemo(()=>Object.keys(S).filter(N=>S[N]),[S]),w=u.useMemo(()=>m.spans.edges.map(({span:z})=>z),[m]),L=v.map(N=>({header:N,columns:[{header:"label",accessorKey:`${ea}${$e}label${$e}${N}`,cell:({row:z})=>{const _=z.original.spanAnnotations.find($=>$.name===N);return _?_.label:null}},{header:"score",accessorKey:`${ea}${$e}score${$e}${N}`,cell:({row:z})=>{const _=z.original.spanAnnotations.find($=>$.name===N);return _?_.score:null}}]})),A=[{header:()=>s(h,{direction:"row",gap:"size-50",children:[e("span",{children:"feedback"}),s(Vn,{children:[e(re,{level:3,weight:"heavy",children:"Feedback"}),e(Fn,{children:"Feedback includes evaluations and human annotations logged via the API or set via the UI."})]})]}),accessorKey:"spanAnnotations",enableSorting:!1,cell:({row:N})=>s(h,{direction:"row",gap:"size-50",wrap:"wrap",children:[N.original.spanAnnotations.map(z=>e(ia,{annotation:z,layout:"horizontal",width:"500px",extra:e(Oi,{annotation:z}),children:e(xn,{annotation:z,annotationDisplayPreference:"label"})},z.name)),N.original.documentRetrievalMetrics.map(z=>s(U,{children:[e(De,{name:z.evaluationName,metric:"ndcg",score:z.ndcg},"ndcg"),e(De,{name:z.evaluationName,metric:"precision",score:z.precision},"precision"),e(De,{name:z.evaluationName,metric:"hit",score:z.hit},"hit")]}))]})},...L],x=[{id:"select",maxSize:10,header:({table:N})=>e(en,{checked:N.getIsAllRowsSelected(),indeterminate:N.getIsSomeRowsSelected(),onChange:N.getToggleAllRowsSelectedHandler()}),cell:({row:N})=>e(en,{checked:N.getIsSelected(),disabled:!N.getCanSelect(),indeterminate:N.getIsSomeSelected(),onChange:N.getToggleSelectedHandler()})},{header:"kind",accessorKey:"spanKind",maxSize:100,enableSorting:!1,cell:({getValue:N})=>e(al,{spanKind:N()})},{header:"name",accessorKey:"name",enableSorting:!1,cell:({getValue:N,row:z})=>{const _=z.original,{traceId:$}=_.context;return e(Ze,{to:`traces/${$}?selectedSpanNodeId=${_.id}`,children:N()})}},{header:"input",accessorKey:"input.value",cell:me,enableSorting:!1},{header:"output",accessorKey:"output.value",cell:me,enableSorting:!1},{header:"metadata",accessorKey:"metadata",cell:me,enableSorting:!1},...A,{header:"start time",accessorKey:"startTime",cell:Fe},{header:"latency",accessorKey:"latencyMs",cell:({getValue:N})=>{const z=N();return z===null||typeof z!="number"?null:e(we,{latencyMs:z})}},{header:"total tokens",accessorKey:"tokenCountTotal",cell:({row:N,getValue:z})=>{const _=z();return _===null?"--":e(Fa,{tokenCountTotal:_,tokenCountPrompt:N.original.tokenCountPrompt||0,tokenCountCompletion:N.original.tokenCountCompletion||0})}},{header:"status",accessorKey:"statusCode",enableSorting:!1,cell:({getValue:N})=>e(Ca,{statusCode:N()})}];u.useEffect(()=>{const N=r[0];u.startTransition(()=>{k({sort:N?ar(N):nr,after:null,first:Dl,filterCondition:c},{fetchPolicy:"store-and-network"})})},[r,k,c,a]);const T=u.useCallback(N=>{if(N){const{scrollHeight:z,scrollTop:_,clientHeight:$}=N;z-_-$<300&&!b&&y&&p(Dl)}},[y,b,p]),E=he({columns:x,data:w,state:{sorting:r,columnVisibility:g,rowSelection:t},manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:i,onSortingChange:o,getCoreRowModel:ke(),getSortedRowModel:Rn()}),R=E.getRowModel().rows,j=E.getSelectedRowModel().rows,ae=j.map(N=>N.original),ie=u.useCallback(()=>{i({})},[i]),be=R.length===0,Se=E.getAllColumns().filter(N=>N.columns.length===0);return s("div",{css:er,children:[e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:s(h,{direction:"row",gap:"size-100",width:"100%",alignItems:"center",children:[e(Gi,{onValidCondition:d}),e(qi,{columns:Se,query:m})]})}),e("div",{css:C`
1926
+ `,ta="annotations",$e=":",nr={col:"startTime",dir:"desc"};function ar(n){let a=null,t=null;if(n.id&&n.id.startsWith(ta)){const[,l,i]=n.id.split($e);t={attr:l,name:i}}else a=n.id;return{col:a,evalResultKey:t,dir:n.desc?"desc":"asc"}}const Rt=50;function pm(n){const{fetchKey:a}=Gn(),t=u.useRef(null),[l,i]=u.useState({}),[r,o]=u.useState([]),[c,d]=u.useState(""),g=an(z=>z.columnVisibility),f=Y(),{data:m,loadNext:p,hasNext:y,isLoadingNext:k,refetch:S}=I.usePaginationFragment(Vi,n.project),C=an(z=>z.annotationColumnVisibility),b=u.useMemo(()=>Object.keys(C).filter(z=>C[z]),[C]),T=u.useMemo(()=>m.spans.edges.map(({span:V})=>V),[m]),P=b.map(z=>({header:z,columns:[{header:"label",accessorKey:`${ta}${$e}label${$e}${z}`,cell:({row:V})=>{const E=V.original.spanAnnotations.find(O=>O.name===z);return E?E.label:null}},{header:"score",accessorKey:`${ta}${$e}score${$e}${z}`,cell:({row:V})=>{const E=V.original.spanAnnotations.find(O=>O.name===z);return E?E.score:null}}]})),_=[{header:()=>s(h,{direction:"row",gap:"size-50",children:[e("span",{children:"feedback"}),s($n,{children:[e(se,{level:3,weight:"heavy",children:"Feedback"}),e(Fn,{children:"Feedback includes evaluations and human annotations logged via the API or set via the UI."})]})]}),accessorKey:"spanAnnotations",enableSorting:!1,cell:({row:z})=>s(h,{direction:"row",gap:"size-50",wrap:"wrap",children:[z.original.spanAnnotations.map(V=>e(ra,{annotation:V,layout:"horizontal",width:"500px",extra:e(Oi,{annotation:V}),children:e(xn,{annotation:V,annotationDisplayPreference:"label"})},V.name)),z.original.documentRetrievalMetrics.map(V=>s(H,{children:[e(Ie,{name:V.evaluationName,metric:"ndcg",score:V.ndcg},"ndcg"),e(Ie,{name:V.evaluationName,metric:"precision",score:V.precision},"precision"),e(Ie,{name:V.evaluationName,metric:"hit",score:V.hit},"hit")]}))]})},...P],x=[{id:"select",maxSize:10,header:({table:z})=>e(en,{checked:z.getIsAllRowsSelected(),indeterminate:z.getIsSomeRowsSelected(),onChange:z.getToggleAllRowsSelectedHandler()}),cell:({row:z})=>e(en,{checked:z.getIsSelected(),disabled:!z.getCanSelect(),indeterminate:z.getIsSomeSelected(),onChange:z.getToggleSelectedHandler()})},{header:"kind",accessorKey:"spanKind",maxSize:100,enableSorting:!1,cell:({getValue:z})=>e(ot,{spanKind:z()})},{header:"name",accessorKey:"name",enableSorting:!1,cell:({getValue:z,row:V})=>{const E=V.original,{traceId:O}=E.context;return e(We,{to:`traces/${O}?selectedSpanNodeId=${E.id}`,children:z()})}},{header:"input",accessorKey:"input.value",cell:me,enableSorting:!1},{header:"output",accessorKey:"output.value",cell:me,enableSorting:!1},{header:"metadata",accessorKey:"metadata",cell:me,enableSorting:!1},..._,{header:"start time",accessorKey:"startTime",cell:Fe},{header:"latency",accessorKey:"latencyMs",cell:({getValue:z})=>{const V=z();return V===null||typeof V!="number"?null:e(Ee,{latencyMs:V})}},{header:"total tokens",accessorKey:"tokenCountTotal",cell:({row:z,getValue:V})=>{const E=V();return E===null?"--":e(Ta,{tokenCountTotal:E,tokenCountPrompt:z.original.tokenCountPrompt||0,tokenCountCompletion:z.original.tokenCountCompletion||0})}},{header:"status",accessorKey:"statusCode",enableSorting:!1,cell:({getValue:z})=>e(xa,{statusCode:z()})}];u.useEffect(()=>{const z=r[0];u.startTransition(()=>{S({sort:z?ar(z):nr,after:null,first:Rt,filterCondition:c},{fetchPolicy:"store-and-network"})})},[r,S,c,a]);const D=u.useCallback(z=>{if(z){const{scrollHeight:V,scrollTop:E,clientHeight:O}=z;V-E-O<300&&!k&&y&&p(Rt)}},[y,k,p]),A=ke({columns:x,data:T,state:{sorting:r,columnVisibility:g,rowSelection:l},manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:i,onSortingChange:o,getCoreRowModel:be(),getSortedRowModel:Nn()}),R=A.getRowModel().rows,j=A.getSelectedRowModel().rows,ne=j.map(z=>z.original),re=u.useCallback(()=>{i({})},[i]),Se=R.length===0,ve=A.getAllColumns().filter(z=>z.columns.length===0);return s("div",{css:er,children:[e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:s(h,{direction:"row",gap:"size-100",width:"100%",alignItems:"center",children:[e(Gi,{onValidCondition:d}),e(qi,{columns:ve,query:m})]})}),e("div",{css:v`
2109
1927
  flex: 1 1 auto;
2110
1928
  overflow: auto;
2111
- `,onScroll:N=>T(N.target),ref:l,children:s("table",{css:jn,children:[e("thead",{children:E.getHeaderGroups().map(N=>e("tr",{children:N.headers.map(z=>e("th",{colSpan:z.colSpan,children:z.isPlaceholder?null:s("div",{className:z.column.getCanSort()?"cursor-pointer":"",onClick:z.column.getToggleSortingHandler(),style:{left:z.getStart(),width:z.getSize()},children:[Z(z.column.columnDef.header,z.getContext()),z.column.getIsSorted()?e(P,{className:"sort-icon",svg:z.column.getIsSorted()==="asc"?e(I.ArrowUpFilled,{}):e(I.ArrowDownFilled,{})}):null]})},z.id))},N.id))}),be?e(Qi,{projectName:m.name}):e("tbody",{children:R.map(N=>e("tr",{onClick:()=>f(`traces/${N.original.context.traceId}?selectedSpanNodeId=${N.original.id}`),children:N.getVisibleCells().map(z=>e("td",{children:Z(z.column.columnDef.cell,z.getContext())},z.id))},N.id))})]})}),j.length?e(Yi,{selectedSpans:ae,onClearSelection:ie}):null]})}const lr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"StreamToggleRefetchQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"StreamToggle_data"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"StreamToggleRefetchQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"4e136f41c0942f253822336dc0c5b291",id:null,metadata:{},name:"StreamToggleRefetchQuery",operationKind:"query",text:`query StreamToggleRefetchQuery(
1929
+ `,onScroll:z=>D(z.target),ref:t,children:s("table",{css:Hn,children:[e("thead",{children:A.getHeaderGroups().map(z=>e("tr",{children:z.headers.map(V=>e("th",{colSpan:V.colSpan,children:V.isPlaceholder?null:s("div",{className:V.column.getCanSort()?"cursor-pointer":"",onClick:V.column.getToggleSortingHandler(),style:{left:V.getStart(),width:V.getSize()},children:[X(V.column.columnDef.header,V.getContext()),V.column.getIsSorted()?e(w,{className:"sort-icon",svg:V.column.getIsSorted()==="asc"?e(L.ArrowUpFilled,{}):e(L.ArrowDownFilled,{})}):null]})},V.id))},z.id))}),Se?e(Qi,{projectName:m.name}):e("tbody",{children:R.map(z=>e("tr",{onClick:()=>f(`traces/${z.original.context.traceId}?selectedSpanNodeId=${z.original.id}`),children:z.getVisibleCells().map(V=>e("td",{children:X(V.column.columnDef.cell,V.getContext())},V.id))},z.id))})]})}),j.length?e(Yi,{selectedSpans:ne,onClearSelection:re}):null]})}const tr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"StreamToggleRefetchQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"StreamToggle_data"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"StreamToggleRefetchQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"4e136f41c0942f253822336dc0c5b291",id:null,metadata:{},name:"StreamToggleRefetchQuery",operationKind:"query",text:`query StreamToggleRefetchQuery(
2112
1930
  $id: GlobalID!
2113
1931
  ) {
2114
1932
  node(id: $id) {
@@ -2123,7 +1941,7 @@ fragment StreamToggle_data on Project {
2123
1941
  streamingLastUpdatedAt
2124
1942
  id
2125
1943
  }
2126
- `}}}();lr.hash="30a8f0bcf1aa6021b2c9a47866f5dc49";const tr={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:lr,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"StreamToggle_data",selections:[{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null};tr.hash="30a8f0bcf1aa6021b2c9a47866f5dc49";function ir(n,a){const l=u.useRef(null);u.useEffect(()=>{l.current=n},[n]),u.useEffect(()=>{function t(){l.current&&l.current()}if(typeof a=="number"){const i=setInterval(t,a);return()=>clearInterval(i)}},[a])}const Cm=2e3;function Fm(n){const{isStreaming:a,setIsStreaming:l,setFetchKey:t}=qn(),[i,r]=D.useRefetchableFragment(tr,n.project),o=u.useRef(i.streamingLastUpdatedAt),c=u.useCallback(()=>{a&&u.startTransition(()=>{r({},{fetchPolicy:"store-and-network"})})},[a,r]),d=i.streamingLastUpdatedAt;return u.useEffect(()=>{d!=null&&(o.current==null||o.current<d)&&(o.current=d,t(`fetch-traces-${d}`))},[t,d]),ir(c,Cm),e(Mn,{labelPlacement:"start",isSelected:a,onChange:()=>{l(!a)},children:"Stream"})}const rr=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},l={defaultValue:50,kind:"LocalArgument",name:"first"},t={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},r={defaultValue:null,kind:"LocalArgument",name:"timeRange"},o=[{kind:"Variable",name:"id",variableName:"id"}],c={kind:"Variable",name:"after",variableName:"after"},d={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},g={kind:"Variable",name:"first",variableName:"first"},f={kind:"Variable",name:"sort",variableName:"sort"},m={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},b=[c,d,g,{kind:"Literal",name:"rootSpansOnly",value:!0},f,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],k={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},S={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},v={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},w={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},L={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},A=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],x={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},T={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[y,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},E={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},R=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}];return{fragment:{argumentDefinitions:[n,a,l,t,i,r],kind:"Fragment",metadata:null,name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[c,d,g,f],kind:"FragmentSpread",name:"TracesTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,l,i,r,t],kind:"Operation",name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[m,{kind:"TypeDiscriminator",abstractKey:"__isNode"},p,{kind:"InlineFragment",selections:[y,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",args:b,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[p,k,y,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},S,v,w,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},L,{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:A,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:A,storageKey:null},x,T,E,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[p,k,y,S,v,w,L,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:R,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:R,storageKey:null},x,T,E],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[m],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:"rootSpans",args:b,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"4e6571e93159d5ab4244d5cc4058a65a",id:null,metadata:{},name:"TracesTableQuery",operationKind:"query",text:`query TracesTableQuery(
1944
+ `}}}();tr.hash="30a8f0bcf1aa6021b2c9a47866f5dc49";const lr={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:tr,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"StreamToggle_data",selections:[{alias:null,args:null,kind:"ScalarField",name:"streamingLastUpdatedAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"Project",abstractKey:null};lr.hash="30a8f0bcf1aa6021b2c9a47866f5dc49";function ir(n,a){const t=u.useRef(null);u.useEffect(()=>{t.current=n},[n]),u.useEffect(()=>{function l(){t.current&&t.current()}if(typeof a=="number"){const i=setInterval(l,a);return()=>clearInterval(i)}},[a])}const ym=2e3;function fm(n){const{isStreaming:a,setIsStreaming:t,setFetchKey:l}=Gn(),[i,r]=I.useRefetchableFragment(lr,n.project),o=u.useRef(i.streamingLastUpdatedAt),c=u.useCallback(()=>{a&&u.startTransition(()=>{r({},{fetchPolicy:"store-and-network"})})},[a,r]),d=i.streamingLastUpdatedAt;return u.useEffect(()=>{d!=null&&(o.current==null||o.current<d)&&(o.current=d,l(`fetch-traces-${d}`))},[l,d]),ir(c,ym),e(zn,{labelPlacement:"start",isSelected:a,onChange:()=>{t(!a)},children:"Stream"})}const rr=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},t={defaultValue:50,kind:"LocalArgument",name:"first"},l={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},r={defaultValue:null,kind:"LocalArgument",name:"timeRange"},o=[{kind:"Variable",name:"id",variableName:"id"}],c={kind:"Variable",name:"after",variableName:"after"},d={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},g={kind:"Variable",name:"first",variableName:"first"},f={kind:"Variable",name:"sort",variableName:"sort"},m={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},k=[c,d,g,{kind:"Literal",name:"rootSpansOnly",value:!0},f,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],S={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},C={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},b={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},T={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},P={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},_=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],x={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},D={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[y,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},A={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},R=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t,l,i,r],kind:"Fragment",metadata:null,name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[c,d,g,f],kind:"FragmentSpread",name:"TracesTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,t,i,r,l],kind:"Operation",name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[m,{kind:"TypeDiscriminator",abstractKey:"__isNode"},p,{kind:"InlineFragment",selections:[y,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",args:k,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[p,S,y,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},C,b,T,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},P,{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:_,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:_,storageKey:null},x,D,A,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[p,S,y,C,b,T,P,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:R,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:R,storageKey:null},x,D,A],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[m],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:"rootSpans",args:k,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"4e6571e93159d5ab4244d5cc4058a65a",id:null,metadata:{},name:"TracesTableQuery",operationKind:"query",text:`query TracesTableQuery(
2127
1945
  $after: String = null
2128
1946
  $filterCondition: String = null
2129
1947
  $first: Int = 50
@@ -2229,16 +2047,16 @@ fragment TracesTable_spans_1XEuU on Project {
2229
2047
  }
2230
2048
  id
2231
2049
  }
2232
- `}}}();rr.hash="69e77ceeea7371be4ec13fc702225150";const sr=function(){var n=["rootSpans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},i={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},d=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],g={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},f={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},m={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},p=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:rr,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"TracesTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"rootSpans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__TracesTable_rootSpans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,t,a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},i,r,o,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},c,{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:d,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:d,storageKey:null},g,f,m,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[l,t,a,i,r,o,c,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:p,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:p,storageKey:null},g,f,m],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},l],type:"Project",abstractKey:null}}();sr.hash="69e77ceeea7371be4ec13fc702225150";const Tl=50;function or(n){const a=[];for(const l of n){const t={...l.span,children:or(l.children)};a.push(t)}return a}function Km(n){const a=u.useRef(null),[l,t]=u.useState({}),[i,r]=u.useState([]),[o,c]=u.useState(""),d=Y(),{fetchKey:g}=qn(),{data:f,loadNext:m,hasNext:p,isLoadingNext:y,refetch:b}=D.usePaginationFragment(sr,n.project),k=an(_=>_.annotationColumnVisibility),S=u.useMemo(()=>Object.keys(k).filter(_=>k[_]),[k]),v=u.useMemo(()=>f.rootSpans.edges.map(({rootSpan:$})=>{const ee=Zo([$,...$.descendants]),[un]=or(ee);return un}),[f]),w=S.map(_=>({header:_,columns:[{header:"label",accessorKey:`${ea}${$e}label${$e}${_}`,cell:({row:$})=>{const ee=$.original.spanAnnotations.find(un=>un.name===_);return ee?ee.label:null}},{header:"score",accessorKey:`${ea}${$e}score${$e}${_}`,cell:({row:$})=>{const ee=$.original.spanAnnotations.find(un=>un.name===_);return ee?ee.score:null}}]})),L=[{header:()=>s(h,{direction:"row",gap:"size-50",children:[e("span",{children:"feedback"}),s(Vn,{children:[e(re,{level:3,weight:"heavy",children:"Feedback"}),e(Fn,{children:"Feedback includes evaluations and human annotations logged via the API or set via the UI."})]})]}),accessorKey:"spanAnnotations",enableSorting:!1,cell:({row:_})=>{const $=_.original.spanAnnotations.length===0&&_.original.documentRetrievalMetrics.length===0;return s(h,{direction:"row",gap:"size-50",wrap:"wrap",children:[_.original.spanAnnotations.map(ee=>e(ia,{annotation:ee,layout:"horizontal",width:"500px",extra:e(Oi,{annotation:ee}),children:e(xn,{annotation:ee,annotationDisplayPreference:"label"})},ee.name)),_.original.documentRetrievalMetrics.map(ee=>s(u.Fragment,{children:[e(De,{name:ee.evaluationName,metric:"ndcg",score:ee.ndcg},"ndcg"),e(De,{name:ee.evaluationName,metric:"precision",score:ee.precision},"precision"),e(De,{name:ee.evaluationName,metric:"hit",score:ee.hit},"hit")]},"doc-evals")),$?"--":null]})}},...w],A=[{id:"select",maxSize:10,header:({table:_})=>e(en,{checked:_.getIsAllRowsSelected(),indeterminate:_.getIsSomeRowsSelected(),onChange:_.getToggleAllRowsSelectedHandler()}),cell:({row:_})=>e(en,{checked:_.getIsSelected(),disabled:!_.getCanSelect(),indeterminate:_.getIsSomeSelected(),onChange:_.getToggleSelectedHandler()})},{header:()=>s(h,{gap:"size-50",direction:"row",alignItems:"center",children:[e(fl,{isExpanded:j.getIsAllRowsExpanded(),onClick:j.getToggleAllRowsExpandedHandler(),"aria-label":"Expand all rows"}),"kind"]}),enableSorting:!1,accessorKey:"spanKind",maxSize:100,cell:_=>e("div",{css:C`
2050
+ `}}}();rr.hash="69e77ceeea7371be4ec13fc702225150";const sr=function(){var n=["rootSpans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},i={alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},d=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],g={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},f={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},m={alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null},p=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:rr,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"TracesTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"rootSpans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__TracesTable_rootSpans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},i,r,o,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},c,{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:d,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:d,storageKey:null},g,f,m,{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"descendants",plural:!0,selections:[t,l,a,i,r,o,c,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:p,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:p,storageKey:null},g,f,m],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},t],type:"Project",abstractKey:null}}();sr.hash="69e77ceeea7371be4ec13fc702225150";const Mt=50;function or(n){const a=[];for(const t of n){const l={...t.span,children:or(t.children)};a.push(l)}return a}function hm(n){const a=u.useRef(null),[t,l]=u.useState({}),[i,r]=u.useState([]),[o,c]=u.useState(""),d=Y(),{fetchKey:g}=Gn(),{data:f,loadNext:m,hasNext:p,isLoadingNext:y,refetch:k}=I.usePaginationFragment(sr,n.project),S=an(E=>E.annotationColumnVisibility),C=u.useMemo(()=>Object.keys(S).filter(E=>S[E]),[S]),b=u.useMemo(()=>f.rootSpans.edges.map(({rootSpan:O})=>{const ee=Yo([O,...O.descendants]),[un]=or(ee);return un}),[f]),T=C.map(E=>({header:E,columns:[{header:"label",accessorKey:`${ta}${$e}label${$e}${E}`,cell:({row:O})=>{const ee=O.original.spanAnnotations.find(un=>un.name===E);return ee?ee.label:null}},{header:"score",accessorKey:`${ta}${$e}score${$e}${E}`,cell:({row:O})=>{const ee=O.original.spanAnnotations.find(un=>un.name===E);return ee?ee.score:null}}]})),P=[{header:()=>s(h,{direction:"row",gap:"size-50",children:[e("span",{children:"feedback"}),s($n,{children:[e(se,{level:3,weight:"heavy",children:"Feedback"}),e(Fn,{children:"Feedback includes evaluations and human annotations logged via the API or set via the UI."})]})]}),accessorKey:"spanAnnotations",enableSorting:!1,cell:({row:E})=>{const O=E.original.spanAnnotations.length===0&&E.original.documentRetrievalMetrics.length===0;return s(h,{direction:"row",gap:"size-50",wrap:"wrap",children:[E.original.spanAnnotations.map(ee=>e(ra,{annotation:ee,layout:"horizontal",width:"500px",extra:e(Oi,{annotation:ee}),children:e(xn,{annotation:ee,annotationDisplayPreference:"label"})},ee.name)),E.original.documentRetrievalMetrics.map(ee=>s(u.Fragment,{children:[e(Ie,{name:ee.evaluationName,metric:"ndcg",score:ee.ndcg},"ndcg"),e(Ie,{name:ee.evaluationName,metric:"precision",score:ee.precision},"precision"),e(Ie,{name:ee.evaluationName,metric:"hit",score:ee.hit},"hit")]},"doc-evals")),O?"--":null]})}},...T],_=[{id:"select",maxSize:10,header:({table:E})=>e(en,{checked:E.getIsAllRowsSelected(),indeterminate:E.getIsSomeRowsSelected(),onChange:E.getToggleAllRowsSelectedHandler()}),cell:({row:E})=>e(en,{checked:E.getIsSelected(),disabled:!E.getCanSelect(),indeterminate:E.getIsSomeSelected(),onChange:E.getToggleSelectedHandler()})},{header:()=>s(h,{gap:"size-50",direction:"row",alignItems:"center",children:[e(xt,{isExpanded:j.getIsAllRowsExpanded(),onClick:j.getToggleAllRowsExpandedHandler(),"aria-label":"Expand all rows"}),"kind"]}),enableSorting:!1,accessorKey:"spanKind",maxSize:100,cell:E=>e("div",{css:v`
2233
2051
  // Since rows are flattened by default,
2234
2052
  // we can use the row.depth property
2235
2053
  // and paddingLeft to visually indicate the depth
2236
2054
  // of the row
2237
- padding-left: ${_.row.depth*2}rem;
2238
- `,children:s(h,{gap:"size-50",children:[_.row.getCanExpand()?e(fl,{isExpanded:_.row.getIsExpanded(),onClick:_.row.getToggleExpandedHandler(),"aria-label":"Expand row"}):null,e(al,{spanKind:_.getValue()})]})})},{header:"name",accessorKey:"name",enableSorting:!1,cell:({getValue:_,row:$})=>{const{traceId:ee}=$.original.context;return e(Ze,{to:`traces/${ee}?selectedSpanNodeId=${$.original.id}`,children:_()})}},{header:"input",accessorKey:"input.value",enableSorting:!1,cell:me},{header:"output",accessorKey:"output.value",enableSorting:!1,cell:me},{header:"metadata",accessorKey:"metadata",enableSorting:!1,cell:me},...L,{header:"start time",accessorKey:"startTime",cell:Fe},{header:"latency",accessorKey:"latencyMs",cell:({getValue:_})=>{const $=_();return $===null||typeof $!="number"?null:e(we,{latencyMs:$})}},{header:"total tokens",minSize:80,accessorKey:"cumulativeTokenCountTotal",cell:({row:_,getValue:$})=>{const ee=$();return ee===null?"--":e(Fa,{tokenCountTotal:ee,tokenCountPrompt:_.original.cumulativeTokenCountPrompt||0,tokenCountCompletion:_.original.cumulativeTokenCountCompletion||0})}},{header:"status",accessorKey:"statusCode",enableSorting:!1,cell:({getValue:_})=>e(Ca,{statusCode:_()})}];u.useEffect(()=>{const _=i[0];u.startTransition(()=>{b({sort:_?ar(_):nr,after:null,first:Tl,filterCondition:o},{fetchPolicy:"store-and-network"})})},[i,b,o,g]);const x=Ke.useCallback(_=>{if(_){const{scrollHeight:$,scrollTop:ee,clientHeight:un}=_;$-ee-un<300&&!y&&p&&m(Tl)}},[p,y,m]),[T,E]=u.useState({}),R=an(_=>_.columnVisibility),j=he({columns:A,data:v,onExpandedChange:E,manualSorting:!0,getSubRows:_=>_.children,state:{sorting:i,expanded:T,columnVisibility:R,rowSelection:l},onRowSelectionChange:t,enableSubRowSelection:!1,onSortingChange:r,getCoreRowModel:ke(),getSortedRowModel:Rn(),getExpandedRowModel:Os(),getRowId:_=>_.id}),ae=j.getRowModel().rows,ie=j.getSelectedRowModel().flatRows,be=ie.map(_=>_.original),Se=u.useCallback(()=>{t({})},[t]),N=ae.length===0,z=j.getAllColumns().filter(_=>_.columns.length===0);return s("div",{css:er,children:[e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:s(h,{direction:"row",gap:"size-100",width:"100%",alignItems:"center",children:[e(Gi,{onValidCondition:c}),e(qi,{columns:z,query:f})]})}),e("div",{css:C`
2055
+ padding-left: ${E.row.depth*2}rem;
2056
+ `,children:s(h,{gap:"size-50",children:[E.row.getCanExpand()?e(xt,{isExpanded:E.row.getIsExpanded(),onClick:E.row.getToggleExpandedHandler(),"aria-label":"Expand row"}):null,e(ot,{spanKind:E.getValue()})]})})},{header:"name",accessorKey:"name",enableSorting:!1,cell:({getValue:E,row:O})=>{const{traceId:ee}=O.original.context;return e(We,{to:`traces/${ee}?selectedSpanNodeId=${O.original.id}`,children:E()})}},{header:"input",accessorKey:"input.value",enableSorting:!1,cell:me},{header:"output",accessorKey:"output.value",enableSorting:!1,cell:me},{header:"metadata",accessorKey:"metadata",enableSorting:!1,cell:me},...P,{header:"start time",accessorKey:"startTime",cell:Fe},{header:"latency",accessorKey:"latencyMs",cell:({getValue:E})=>{const O=E();return O===null||typeof O!="number"?null:e(Ee,{latencyMs:O})}},{header:"total tokens",minSize:80,accessorKey:"cumulativeTokenCountTotal",cell:({row:E,getValue:O})=>{const ee=O();return ee===null?"--":e(Ta,{tokenCountTotal:ee,tokenCountPrompt:E.original.cumulativeTokenCountPrompt||0,tokenCountCompletion:E.original.cumulativeTokenCountCompletion||0})}},{header:"status",accessorKey:"statusCode",enableSorting:!1,cell:({getValue:E})=>e(xa,{statusCode:E()})}];u.useEffect(()=>{const E=i[0];u.startTransition(()=>{k({sort:E?ar(E):nr,after:null,first:Mt,filterCondition:o},{fetchPolicy:"store-and-network"})})},[i,k,o,g]);const x=Ke.useCallback(E=>{if(E){const{scrollHeight:O,scrollTop:ee,clientHeight:un}=E;O-ee-un<300&&!y&&p&&m(Mt)}},[p,y,m]),[D,A]=u.useState({}),R=an(E=>E.columnVisibility),j=ke({columns:_,data:b,onExpandedChange:A,manualSorting:!0,getSubRows:E=>E.children,state:{sorting:i,expanded:D,columnVisibility:R,rowSelection:t},onRowSelectionChange:l,enableSubRowSelection:!1,onSortingChange:r,getCoreRowModel:be(),getSortedRowModel:Nn(),getExpandedRowModel:js(),getRowId:E=>E.id}),ne=j.getRowModel().rows,re=j.getSelectedRowModel().flatRows,Se=re.map(E=>E.original),ve=u.useCallback(()=>{l({})},[l]),z=ne.length===0,V=j.getAllColumns().filter(E=>E.columns.length===0);return s("div",{css:er,children:[e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:s(h,{direction:"row",gap:"size-100",width:"100%",alignItems:"center",children:[e(Gi,{onValidCondition:c}),e(qi,{columns:V,query:f})]})}),e("div",{css:v`
2239
2057
  flex: 1 1 auto;
2240
2058
  overflow: auto;
2241
- `,onScroll:_=>x(_.target),ref:a,children:s("table",{css:jn,children:[e("thead",{children:j.getHeaderGroups().map(_=>e("tr",{children:_.headers.map($=>e("th",{colSpan:$.colSpan,children:$.isPlaceholder?null:s("div",{"data-sortable":$.column.getCanSort(),className:$.column.getCanSort()?"cursor-pointer":"",onClick:$.column.getToggleSortingHandler(),style:{left:$.getStart(),width:$.getSize()},children:[Z($.column.columnDef.header,$.getContext()),$.column.getIsSorted()?e(P,{className:"sort-icon",svg:$.column.getIsSorted()==="asc"?e(I.ArrowUpFilled,{}):e(I.ArrowDownFilled,{})}):null]})},$.id))},_.id))}),N?e(Qi,{projectName:f.name}):e("tbody",{children:ae.map(_=>e("tr",{onClick:()=>d(`traces/${_.original.context.traceId}`),children:_.getVisibleCells().map($=>e("td",{children:Z($.column.columnDef.cell,$.getContext())},$.id))},_.id))})]})}),ie.length?e(Yi,{selectedSpans:be,onClearSelection:Se}):null]})}const xm=C`
2059
+ `,onScroll:E=>x(E.target),ref:a,children:s("table",{css:Hn,children:[e("thead",{children:j.getHeaderGroups().map(E=>e("tr",{children:E.headers.map(O=>e("th",{colSpan:O.colSpan,children:O.isPlaceholder?null:s("div",{"data-sortable":O.column.getCanSort(),className:O.column.getCanSort()?"cursor-pointer":"",onClick:O.column.getToggleSortingHandler(),style:{left:O.getStart(),width:O.getSize()},children:[X(O.column.columnDef.header,O.getContext()),O.column.getIsSorted()?e(w,{className:"sort-icon",svg:O.column.getIsSorted()==="asc"?e(L.ArrowUpFilled,{}):e(L.ArrowDownFilled,{})}):null]})},O.id))},E.id))}),z?e(Qi,{projectName:f.name}):e("tbody",{children:ne.map(E=>e("tr",{onClick:()=>d(`traces/${E.original.context.traceId}`),children:E.getVisibleCells().map(O=>e("td",{children:X(O.column.columnDef.cell,O.getContext())},O.id))},E.id))})]})}),re.length?e(Yi,{selectedSpans:Se,onClearSelection:ve}):null]})}const km=v`
2242
2060
  flex: 1 1 auto;
2243
2061
  display: flex;
2244
2062
  flex-direction: column;
@@ -2264,7 +2082,7 @@ fragment TracesTable_spans_1XEuU on Project {
2264
2082
  }
2265
2083
  }
2266
2084
  }
2267
- `;function Uy(){const{projectId:n}=ln(),{timeRange:a}=Ka();return e(u.Suspense,{fallback:e(fe,{}),children:e(Dm,{projectId:n,timeRange:a})})}const dr=Di;function Dm({projectId:n,timeRange:a}){const l=u.useMemo(()=>({start:a.start.toISOString(),end:a.end.toISOString()}),[a]),t=D.useLazyLoadQuery(xi,{id:n,timeRange:l},{fetchPolicy:"store-and-network"}),[i,r,o]=D.useQueryLoader(dr),c=u.useCallback(d=>{d===1?r({id:n,timeRange:l}):o()},[o,r,n,l]);return s("main",{css:xm,children:[e(om,{project:t.project,extra:s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(Fm,{project:t.project}),e(it,{})]})}),s(Te,{onChange:c,children:[e(J,{name:"Traces",children:({isSelected:d})=>d&&e(xl,{children:e(u.Suspense,{children:e(Km,{project:t.project})})})}),e(J,{name:"Spans",title:"Spans",children:({isSelected:d})=>d&&i&&e(xl,{children:e(u.Suspense,{fallback:e(fe,{}),children:e(Tm,{queryReference:i})})})})]}),e(u.Suspense,{children:e(Pe,{})})]})}function Tm({queryReference:n}){const a=D.usePreloadedQuery(dr,n);return e(vm,{project:a.project})}const cr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],type:"Project",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"projectLoaderQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"projectLoaderQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,t],storageKey:null}]},params:{cacheID:"04c84b5bc2a01477851d347af75dcc11",id:null,metadata:{},name:"projectLoaderQuery",operationKind:"query",text:`query projectLoaderQuery(
2085
+ `;function af(){const{projectId:n}=tn(),{timeRange:a}=Da();return e(u.Suspense,{fallback:e(he,{}),children:e(bm,{projectId:n,timeRange:a})})}const dr=Ti;function bm({projectId:n,timeRange:a}){const t=u.useMemo(()=>({start:a.start.toISOString(),end:a.end.toISOString()}),[a]),l=I.useLazyLoadQuery(xi,{id:n,timeRange:t},{fetchPolicy:"store-and-network"}),[i,r,o]=I.useQueryLoader(dr),c=u.useCallback(d=>{d===1?r({id:n,timeRange:t}):o()},[o,r,n,t]);return s("main",{css:km,children:[e(nm,{project:l.project,extra:s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(fm,{project:l.project}),e(gl,{})]})}),s(Pe,{onChange:c,children:[e(J,{name:"Traces",children:({isSelected:d})=>d&&e(At,{children:e(u.Suspense,{children:e(hm,{project:l.project})})})}),e(J,{name:"Spans",title:"Spans",children:({isSelected:d})=>d&&i&&e(At,{children:e(u.Suspense,{fallback:e(he,{}),children:e(Sm,{queryReference:i})})})})]}),e(u.Suspense,{children:e(_e,{})})]})}function Sm({queryReference:n}){const a=I.usePreloadedQuery(dr,n);return e(pm,{project:a.project})}const cr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],type:"Project",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"projectLoaderQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,l],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"projectLoaderQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,l],storageKey:null}]},params:{cacheID:"04c84b5bc2a01477851d347af75dcc11",id:null,metadata:{},name:"projectLoaderQuery",operationKind:"query",text:`query projectLoaderQuery(
2268
2086
  $id: GlobalID!
2269
2087
  ) {
2270
2088
  project: node(id: $id) {
@@ -2275,36 +2093,36 @@ fragment TracesTable_spans_1XEuU on Project {
2275
2093
  }
2276
2094
  }
2277
2095
  }
2278
- `}}}();cr.hash="3d31e323c06df38ec2eaa6f3adb55e79";async function By(n){const{projectId:a}=n.params;return await D.fetchQuery(xe,cr,{id:a}).toPromise()}function Hy(){const n=Qs(),a=u.useMemo(()=>n instanceof Error&&n.message==="Failed to fetch"?e(Im,{}):e(Lm,{error:n}),[n]);return e("main",{css:C`
2096
+ `}}}();cr.hash="3d31e323c06df38ec2eaa6f3adb55e79";async function tf(n){const{projectId:a}=n.params;return await I.fetchQuery(xe,cr,{id:a}).toPromise()}function lf(){const n=qs(),a=u.useMemo(()=>n instanceof Error&&n.message==="Failed to fetch"?e(vm,{}):e(Cm,{error:n}),[n]);return e("main",{css:v`
2279
2097
  width: 100%;
2280
2098
  height: 100%;
2281
2099
  display: flex;
2282
2100
  flex-direction: column;
2283
2101
  align-items: center;
2284
2102
  justify-content: center;
2285
- `,children:e("section",{css:C`
2103
+ `,children:e("section",{css:v`
2286
2104
  width: 500px;
2287
2105
  /* Add spacing on the bottom so it gets pushed down */
2288
2106
  margin-top: 200px;
2289
2107
  display: flex;
2290
2108
  flex-direction: column;
2291
- `,children:a})})}function Im(){return s(U,{children:[s(h,{direction:"column",width:"100%",alignItems:"center",children:[e(ba,{graphicKey:"not found"}),e("h1",{children:"Server disconnected"})]}),e("p",{children:"We are unable to reach the Phoenix server. Please ensure that Phoenix is running and try again."})]})}function Lm({error:n}){return s(U,{children:[s(h,{direction:"column",width:"100%",alignItems:"center",children:[e(ba,{graphicKey:"error"}),e("h1",{children:"Something went wrong"})]}),e("p",{children:"We strive to do our very best but 🐛 bugs happen. It would mean a lot to us if you could file a an issue. If you feel comfortable, please include the error details below in your issue. We will get back to you as soon as we can."}),e("p",{css:C`
2109
+ `,children:a})})}function vm(){return s(H,{children:[s(h,{direction:"column",width:"100%",alignItems:"center",children:[e(Ca,{graphicKey:"not found"}),e("h1",{children:"Server disconnected"})]}),e("p",{children:"We are unable to reach the Phoenix server. Please ensure that Phoenix is running and try again."})]})}function Cm({error:n}){return s(H,{children:[s(h,{direction:"column",width:"100%",alignItems:"center",children:[e(Ca,{graphicKey:"error"}),e("h1",{children:"Something went wrong"})]}),e("p",{children:"We strive to do our very best but 🐛 bugs happen. It would mean a lot to us if you could file a an issue. If you feel comfortable, please include the error details below in your issue. We will get back to you as soon as we can."}),e("p",{css:v`
2292
2110
  display: flex;
2293
2111
  flex-direction: row;
2294
2112
  justify-content: flex-end;
2295
2113
  gap: var(--px-spacing-med);
2296
- `,children:s("span",{css:C`
2114
+ `,children:s("span",{css:v`
2297
2115
  display: inline-flex;
2298
2116
  flex-direction: row;
2299
2117
  align-items: baseline;
2300
2118
  gap: 0.2em;
2301
- `,children:["💙 the",e(je,{href:"mailto:phoenix-devs@arize.com",children:"phoenix team"})]})}),s("div",{css:C`
2119
+ `,children:["💙 the",e(je,{href:"mailto:phoenix-devs@arize.com",children:"phoenix team"})]})}),s("div",{css:v`
2302
2120
  display: flex;
2303
2121
  flex-direction: row;
2304
2122
  justify-content: flex-end;
2305
2123
  align-items: center;
2306
2124
  gap: var(--px-spacing-med);
2307
- `,children:[e(je,{href:"https://github.com/Arize-ai/phoenix/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBUG%5D",children:"file an issue with us"}),e(M,{variant:"primary",size:"compact",onClick:()=>{window.location.href="/"},children:"Return Home"})]}),s("details",{open:!0,children:[e("summary",{children:"error details"}),e("pre",{css:C`
2125
+ `,children:[e(je,{href:"https://github.com/Arize-ai/phoenix/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBUG%5D",children:"file an issue with us"}),e(N,{variant:"primary",size:"compact",onClick:()=>{window.location.href="/"},children:"Return Home"})]}),s("details",{open:!0,children:[e("summary",{children:"error details"}),e("pre",{css:v`
2308
2126
  white-space: pre-wrap;
2309
2127
  overflow-wrap: break-word;
2310
2128
  overflow: hidden;
@@ -2329,7 +2147,7 @@ fragment TracesTable_spans_1XEuU on Project {
2329
2147
  }
2330
2148
  }
2331
2149
  }
2332
- `}}}();ur.hash="b73d8f3f532a0c6f88863f3c6dd5734f";const Pm=ur;function Gy(){const n=D.useLazyLoadQuery(Pm,{}),{model:{primaryInferences:a,referenceInferences:l,corpusInferences:t}}=n;return e(Yo,{primaryInferences:a,referenceInferences:l??null,corpusInferences:t??null,children:e(Xo,{timeRangeBounds:{start:new Date(a.startTime),end:new Date(a.endTime)},children:e(Pe,{})})})}function Wy(){return e(dm,{children:e(lm,{children:e(Pe,{})})})}function Jy(){return e(ed,{children:e(Pe,{})})}const mr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"}],l={kind:"Variable",name:"timeRange",variableName:"timeRange"},t=[l];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectsPageProjectsQuery",selections:[{args:a,kind:"FragmentSpread",name:"ProjectsPageProjectsFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectsPageProjectsQuery",selections:[{alias:null,args:a,concreteType:"ProjectConnection",kind:"LinkedField",name:"projects",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"project",args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientStartColor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientEndColor",storageKey:null},{alias:null,args:t,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},l],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:t,kind:"ScalarField",name:"tokenCountTotal",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:a,filters:null,handle:"connection",key:"ProjectsPage_projects",kind:"LinkedHandle",name:"projects"}]},params:{cacheID:"ead527a5c3ddda0f6c906c99183edf06",id:null,metadata:{},name:"ProjectsPageProjectsQuery",operationKind:"query",text:`query ProjectsPageProjectsQuery(
2150
+ `}}}();ur.hash="b73d8f3f532a0c6f88863f3c6dd5734f";const Fm=ur;function rf(){const n=I.useLazyLoadQuery(Fm,{}),{model:{primaryInferences:a,referenceInferences:t,corpusInferences:l}}=n;return e(nd,{primaryInferences:a,referenceInferences:t??null,corpusInferences:l??null,children:e(ed,{timeRangeBounds:{start:new Date(a.startTime),end:new Date(a.endTime)},children:e(_e,{})})})}function sf(){return e(am,{children:e(Ju,{children:e(_e,{})})})}function of(){return e(ad,{children:e(_e,{})})}const mr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"}],t={kind:"Variable",name:"timeRange",variableName:"timeRange"},l=[t];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectsPageProjectsQuery",selections:[{args:a,kind:"FragmentSpread",name:"ProjectsPageProjectsFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectsPageProjectsQuery",selections:[{alias:null,args:a,concreteType:"ProjectConnection",kind:"LinkedField",name:"projects",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"project",args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientStartColor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientEndColor",storageKey:null},{alias:null,args:l,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},t],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:l,kind:"ScalarField",name:"tokenCountTotal",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:a,filters:null,handle:"connection",key:"ProjectsPage_projects",kind:"LinkedHandle",name:"projects"}]},params:{cacheID:"ead527a5c3ddda0f6c906c99183edf06",id:null,metadata:{},name:"ProjectsPageProjectsQuery",operationKind:"query",text:`query ProjectsPageProjectsQuery(
2333
2151
  $after: String = null
2334
2152
  $first: Int = 50
2335
2153
  $timeRange: TimeRange
@@ -2361,7 +2179,7 @@ fragment ProjectsPageProjectsFragment_2HEEH6 on Query {
2361
2179
  }
2362
2180
  }
2363
2181
  }
2364
- `}}}();mr.hash="56c501357948255461a24411fb6b5847";const gr=function(){var n=["projects"],a={kind:"Variable",name:"timeRange",variableName:"timeRange"},l=[a];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:50,kind:"LocalArgument",name:"first"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:[],operation:mr}},name:"ProjectsPageProjectsFragment",selections:[{alias:"projects",args:null,concreteType:"ProjectConnection",kind:"LinkedField",name:"__ProjectsPage_projects_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"project",args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientStartColor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientEndColor",storageKey:null},{alias:null,args:l,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},a],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:l,kind:"ScalarField",name:"tokenCountTotal",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null}}();gr.hash="56c501357948255461a24411fb6b5847";const pr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Literal",name:"first",value:50}],l={kind:"Variable",name:"timeRange",variableName:"timeRange"},t=[l];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectsPageQuery",selections:[{args:null,kind:"FragmentSpread",name:"ProjectsPageProjectsFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectsPageQuery",selections:[{alias:null,args:a,concreteType:"ProjectConnection",kind:"LinkedField",name:"projects",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"project",args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientStartColor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientEndColor",storageKey:null},{alias:null,args:t,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},l],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:t,kind:"ScalarField",name:"tokenCountTotal",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"projects(first:50)"},{alias:null,args:a,filters:null,handle:"connection",key:"ProjectsPage_projects",kind:"LinkedHandle",name:"projects"}]},params:{cacheID:"35a420462b10b0f0158d042fd39bfabb",id:null,metadata:{},name:"ProjectsPageQuery",operationKind:"query",text:`query ProjectsPageQuery(
2182
+ `}}}();mr.hash="56c501357948255461a24411fb6b5847";const gr=function(){var n=["projects"],a={kind:"Variable",name:"timeRange",variableName:"timeRange"},t=[a];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:50,kind:"LocalArgument",name:"first"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:[],operation:mr}},name:"ProjectsPageProjectsFragment",selections:[{alias:"projects",args:null,concreteType:"ProjectConnection",kind:"LinkedField",name:"__ProjectsPage_projects_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"project",args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientStartColor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientEndColor",storageKey:null},{alias:null,args:t,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},a],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:t,kind:"ScalarField",name:"tokenCountTotal",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null}}();gr.hash="56c501357948255461a24411fb6b5847";const pr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Literal",name:"first",value:50}],t={kind:"Variable",name:"timeRange",variableName:"timeRange"},l=[t];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectsPageQuery",selections:[{args:null,kind:"FragmentSpread",name:"ProjectsPageProjectsFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectsPageQuery",selections:[{alias:null,args:a,concreteType:"ProjectConnection",kind:"LinkedField",name:"projects",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"project",args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientStartColor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gradientEndColor",storageKey:null},{alias:null,args:l,kind:"ScalarField",name:"traceCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:"latencyMsP50",args:[{kind:"Literal",name:"probability",value:.5},t],kind:"ScalarField",name:"latencyMsQuantile",storageKey:null},{alias:null,args:l,kind:"ScalarField",name:"tokenCountTotal",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"projects(first:50)"},{alias:null,args:a,filters:null,handle:"connection",key:"ProjectsPage_projects",kind:"LinkedHandle",name:"projects"}]},params:{cacheID:"35a420462b10b0f0158d042fd39bfabb",id:null,metadata:{},name:"ProjectsPageQuery",operationKind:"query",text:`query ProjectsPageQuery(
2365
2183
  $timeRange: TimeRange!
2366
2184
  ) {
2367
2185
  ...ProjectsPageProjectsFragment
@@ -2391,7 +2209,7 @@ fragment ProjectsPageProjectsFragment on Query {
2391
2209
  }
2392
2210
  }
2393
2211
  }
2394
- `}}}();pr.hash="c28f5ced0b3ec4b3b8277d0aac29de2d";const wm="https://docs.arize.com/phoenix/tracing/how-to-tracing/setup-tracing";function Am(){const[n,a]=u.useState(null);return s("div",{children:[e(M,{variant:"default",icon:e(P,{svg:e(I.GridOutline,{})}),onClick:()=>{a(e(_m,{}))},children:"New Project"}),e(W,{isDismissable:!0,type:"slideOver",onDismiss:()=>a(null),children:n})]})}function _m(){const[n,a]=u.useState("Python");return e(H,{title:"Create a New Project",size:"L",children:s(F,{padding:"size-400",overflow:"auto",children:[e(F,{paddingBottom:"size-200",children:e(at,{language:n,onChange:a})}),e(F,{paddingBottom:"size-100",children:s(K,{children:["Projects are created when you log your first trace via OpenTelemetry. See the"," ",e(je,{href:wm,children:"documentation"})," ","for a complete guide."]})}),n==="Python"?e(lt,{}):e(tt,{})]})})}const yr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"Query",kind:"LinkedField",name:"clearProject",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectActionMenuClearMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectActionMenuClearMutation",selections:a},params:{cacheID:"63319b4e42b499db2447817f1dc821fb",id:null,metadata:{},name:"ProjectActionMenuClearMutation",operationKind:"mutation",text:`mutation ProjectActionMenuClearMutation(
2212
+ `}}}();pr.hash="c28f5ced0b3ec4b3b8277d0aac29de2d";const Km="https://docs.arize.com/phoenix/tracing/how-to-tracing/setup-tracing";function xm(){const[n,a]=u.useState(null);return s("div",{children:[e(N,{variant:"default",icon:e(w,{svg:e(L.GridOutline,{})}),onClick:()=>{a(e(Tm,{}))},children:"New Project"}),e(W,{isDismissable:!0,type:"slideOver",onDismiss:()=>a(null),children:n})]})}function Tm(){const[n,a]=u.useState("Python");return e(B,{title:"Create a New Project",size:"L",children:s(F,{padding:"size-400",overflow:"auto",children:[e(F,{paddingBottom:"size-200",children:e(cl,{language:n,onChange:a})}),e(F,{paddingBottom:"size-100",children:s(K,{children:["Projects are created when you log your first trace via OpenTelemetry. See the"," ",e(je,{href:Km,children:"documentation"})," ","for a complete guide."]})}),n==="Python"?e(ul,{}):e(ml,{})]})})}const yr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"Query",kind:"LinkedField",name:"clearProject",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectActionMenuClearMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectActionMenuClearMutation",selections:a},params:{cacheID:"63319b4e42b499db2447817f1dc821fb",id:null,metadata:{},name:"ProjectActionMenuClearMutation",operationKind:"mutation",text:`mutation ProjectActionMenuClearMutation(
2395
2213
  $input: ClearProjectInput!
2396
2214
  ) {
2397
2215
  clearProject(input: $input) {
@@ -2412,19 +2230,19 @@ fragment ProjectsPageProjectsFragment on Query {
2412
2230
  __typename
2413
2231
  }
2414
2232
  }
2415
- `}}}();hr.hash="212501fe2d6367ec1503bd7a00c1730f";function Em(n){const{projectId:a}=n,l=u.useRef(null),[t,i]=D.useMutation(hr),{control:r,handleSubmit:o,setError:c,formState:{isValid:d}}=Ie({defaultValues:{endDate:new Date(Date.now()-nd).toISOString().slice(0,16)}}),g=u.useCallback(f=>{const m=js(f.endDate);if(!qs(m))return c("endDate",{message:"Date is not in a valid format"});t({variables:{input:{id:a,endTime:new Date(m).toISOString()}},onCompleted:()=>{n.onComplete()},onError:p=>{alert("Failed to clear project traces: "+p)}})},[t,a,n,c]);return s("form",{onSubmit:o(g),ref:l,children:[s(F,{padding:"size-200",children:[e(K,{color:"danger",children:"You are about to remove all data before the following date. This cannot be undone."}),e(G,{name:"endDate",control:r,rules:{required:"field is required"},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:b,error:k}})=>e(X,{label:"End Date",type:"datetime-local",name:f,description:"The date up to which you want to remove data",errorMessage:k==null?void 0:k.message,validationState:b?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})})]}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(M,{type:"submit",variant:"danger",isDisabled:!d,size:"compact",loading:i,onClick:()=>{var f;(f=l.current)==null||f.requestSubmit()},children:i?"Removing...":"Remove Data"})})})]})}function Rm({projectId:n,projectName:a,onProjectDelete:l,onProjectClear:t,onProjectRemoveData:i}){const[r,o]=u.useState(null),c=a!=="default",[d]=D.useMutation(fr),[g]=D.useMutation(yr),f=u.useCallback(()=>{u.startTransition(()=>{d({variables:{projectId:n}}),l()})},[d,n,l]),m=u.useCallback(()=>{u.startTransition(()=>{g({variables:{input:{id:n}},onCompleted:()=>{t()},onError:k=>{alert("Failed to clear project: "+k)}})})},[g,n,t]),p=u.useCallback(()=>{o(s(H,{size:"S",title:"Delete Project",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:`Are you sure you want to delete project ${a}? This cannot be undone.`})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(M,{variant:"danger",onClick:()=>{f(),o(null)},children:"Delete Project"})})})]}))},[f,a]),y=u.useCallback(()=>{o(s(H,{size:"S",title:"Clear Project",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:`Are you sure you want to clear project ${a}? All traces and evaluations for this project will be deleted. This cannot be undone.`})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(M,{variant:"danger",onClick:()=>{m(),o(null)},children:"Clear"})})})]}))},[m,a]),b=u.useCallback(()=>{o(e(H,{size:"M",title:"Remove Data",children:e(Em,{projectId:n,onComplete:()=>{i(),o(null)}})}))},[i,n]);return s("div",{onClick:k=>{k.preventDefault(),k.stopPropagation()},children:[s(Be,{buttonVariant:"quiet",align:"end",onAction:k=>{switch(k){case"deleteProject":return p();case"clearProject":return y();case"removeProjectData":return b()}},disabledKeys:c?[]:["deleteProject"],children:[e(B,{textValue:"Clear Traces",children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.Refresh,{})}),e(K,{children:"Clear Data"})]})},"clearProject"),e(B,{textValue:"Remove Data",children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.CloseCircleOutline,{})}),e(K,{children:"Remove Data"})]})},"removeProjectData"),c?e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.TrashOutline,{})}),e(K,{children:"Delete"})]})},"deleteProject"):null]}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>o(null),children:r})]})}function Mm(){const n=Sn(l=>l.projectsAutoRefreshEnabled),a=Sn(l=>l.setProjectAutoRefreshEnabled);return e(Mn,{labelPlacement:"start",isSelected:n,onChange:()=>{a(!n)},children:"Auto-Refresh"})}const Nm=1e4,Vm=50;function Zy(){const{timeRange:n}=Ka();return e(u.Suspense,{fallback:e(fe,{}),children:e(zm,{timeRange:n})})}function zm({timeRange:n}){const a=Sn(v=>v.projectsAutoRefreshEnabled),[l,t]=uo(),i=u.useMemo(()=>({start:n.start.toISOString(),end:n.end.toISOString()}),[n]),r=D.useLazyLoadQuery(pr,{timeRange:i}),{data:o,loadNext:c,hasNext:d,isLoadingNext:g,refetch:f}=D.usePaginationFragment(gr,r),m=o.projects.edges.map(v=>v.project),p=u.useRef(null),y=u.useCallback(v=>{if(v){const{scrollHeight:w,scrollTop:L,clientHeight:A}=v;w-L-A<300&&!g&&d&&c(Vm)}},[d,g,c]);ir(()=>{u.startTransition(()=>{f({},{fetchPolicy:"store-and-network"})})},a?Nm:null);const b=u.useCallback(v=>{u.startTransition(()=>{f({},{fetchPolicy:"store-and-network"}),l({variant:"success",title:"Project Deleted",message:`Project ${v} has been deleted.`})})},[l,f]),k=u.useCallback(v=>{u.startTransition(()=>{f({},{fetchPolicy:"store-and-network"}),l({variant:"success",title:"Project Cleared",message:`Project ${v} has been cleared of traces.`})})},[l,f]),S=u.useCallback(v=>{u.startTransition(()=>{f({},{fetchPolicy:"store-and-network"}),l({variant:"success",title:"Project Data Removed",message:`Old data from project ${v} have been removed.`})})},[l,f]);return s("div",{css:C`
2233
+ `}}}();hr.hash="212501fe2d6367ec1503bd7a00c1730f";function Dm(n){const{projectId:a}=n,t=u.useRef(null),[l,i]=I.useMutation(hr),{control:r,handleSubmit:o,setError:c,formState:{isValid:d}}=Ae({defaultValues:{endDate:new Date(Date.now()-td).toISOString().slice(0,16)}}),g=u.useCallback(f=>{const m=Us(f.endDate);if(!Bs(m))return c("endDate",{message:"Date is not in a valid format"});l({variables:{input:{id:a,endTime:new Date(m).toISOString()}},onCompleted:()=>{n.onComplete()},onError:p=>{alert("Failed to clear project traces: "+p)}})},[l,a,n,c]);return s("form",{onSubmit:o(g),ref:t,children:[s(F,{padding:"size-200",children:[e(K,{color:"danger",children:"You are about to remove all data before the following date. This cannot be undone."}),e(Z,{name:"endDate",control:r,rules:{required:"field is required"},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:k,error:S}})=>e(G,{label:"End Date",type:"datetime-local",name:f,description:"The date up to which you want to remove data",errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})})]}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(N,{type:"submit",variant:"danger",isDisabled:!d,size:"compact",loading:i,onClick:()=>{var f;(f=t.current)==null||f.requestSubmit()},children:i?"Removing...":"Remove Data"})})})]})}function Im({projectId:n,projectName:a,onProjectDelete:t,onProjectClear:l,onProjectRemoveData:i}){const[r,o]=u.useState(null),c=a!=="default",[d]=I.useMutation(fr),[g]=I.useMutation(yr),f=u.useCallback(()=>{u.startTransition(()=>{d({variables:{projectId:n}}),t()})},[d,n,t]),m=u.useCallback(()=>{u.startTransition(()=>{g({variables:{input:{id:n}},onCompleted:()=>{l()},onError:S=>{alert("Failed to clear project: "+S)}})})},[g,n,l]),p=u.useCallback(()=>{o(s(B,{size:"S",title:"Delete Project",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:`Are you sure you want to delete project ${a}? This cannot be undone.`})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(N,{variant:"danger",onClick:()=>{f(),o(null)},children:"Delete Project"})})})]}))},[f,a]),y=u.useCallback(()=>{o(s(B,{size:"S",title:"Clear Project",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:`Are you sure you want to clear project ${a}? All traces and evaluations for this project will be deleted. This cannot be undone.`})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(N,{variant:"danger",onClick:()=>{m(),o(null)},children:"Clear"})})})]}))},[m,a]),k=u.useCallback(()=>{o(e(B,{size:"M",title:"Remove Data",children:e(Dm,{projectId:n,onComplete:()=>{i(),o(null)}})}))},[i,n]);return s("div",{onClick:S=>{S.preventDefault(),S.stopPropagation()},children:[s(ln,{buttonVariant:"quiet",align:"end",onAction:S=>{switch(S){case"deleteProject":return p();case"clearProject":return y();case"removeProjectData":return k()}},disabledKeys:c?[]:["deleteProject"],children:[e(U,{textValue:"Clear Traces",children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.Refresh,{})}),e(K,{children:"Clear Data"})]})},"clearProject"),e(U,{textValue:"Remove Data",children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.CloseCircleOutline,{})}),e(K,{children:"Remove Data"})]})},"removeProjectData"),c?e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.TrashOutline,{})}),e(K,{children:"Delete"})]})},"deleteProject"):null]}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>o(null),children:r})]})}function Pm(){const n=bn(t=>t.projectsAutoRefreshEnabled),a=bn(t=>t.setProjectAutoRefreshEnabled);return e(zn,{labelPlacement:"start",isSelected:n,onChange:()=>{a(!n)},children:"Auto-Refresh"})}const Lm=1e4,wm=50;function df(){const{timeRange:n}=Da();return e(u.Suspense,{fallback:e(he,{}),children:e(_m,{timeRange:n})})}function _m({timeRange:n}){const a=bn(b=>b.projectsAutoRefreshEnabled),[t,l]=mo(),i=u.useMemo(()=>({start:n.start.toISOString(),end:n.end.toISOString()}),[n]),r=I.useLazyLoadQuery(pr,{timeRange:i}),{data:o,loadNext:c,hasNext:d,isLoadingNext:g,refetch:f}=I.usePaginationFragment(gr,r),m=o.projects.edges.map(b=>b.project),p=u.useRef(null),y=u.useCallback(b=>{if(b){const{scrollHeight:T,scrollTop:P,clientHeight:_}=b;T-P-_<300&&!g&&d&&c(wm)}},[d,g,c]);ir(()=>{u.startTransition(()=>{f({},{fetchPolicy:"store-and-network"})})},a?Lm:null);const k=u.useCallback(b=>{u.startTransition(()=>{f({},{fetchPolicy:"store-and-network"}),t({variant:"success",title:"Project Deleted",message:`Project ${b} has been deleted.`})})},[t,f]),S=u.useCallback(b=>{u.startTransition(()=>{f({},{fetchPolicy:"store-and-network"}),t({variant:"success",title:"Project Cleared",message:`Project ${b} has been cleared of traces.`})})},[t,f]),C=u.useCallback(b=>{u.startTransition(()=>{f({},{fetchPolicy:"store-and-network"}),t({variant:"success",title:"Project Data Removed",message:`Old data from project ${b} have been removed.`})})},[t,f]);return s("div",{css:v`
2416
2234
  flex: 1 1 auto;
2417
2235
  overflow-y: auto;
2418
2236
  overflow-x: hidden;
2419
2237
  padding-bottom: var(--ac-global-dimension-size-750);
2420
- `,onScroll:v=>y(v.target),ref:p,children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",width:"100%",borderBottomColor:"grey-200",borderBottomWidth:"thin",children:s(h,{direction:"row",justifyContent:"end",alignItems:"center",gap:"size-100",children:[e(Mm,{}),e(Am,{}),e(it,{})]})}),e(F,{padding:"size-200",width:"100%",children:e("ul",{css:C`
2238
+ `,onScroll:b=>y(b.target),ref:p,children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",width:"100%",borderBottomColor:"grey-200",borderBottomWidth:"thin",children:s(h,{direction:"row",justifyContent:"end",alignItems:"center",gap:"size-100",children:[e(Pm,{}),e(xm,{}),e(gl,{})]})}),e(F,{padding:"size-200",width:"100%",children:e("ul",{css:v`
2421
2239
  display: flex;
2422
2240
  flex-direction: row;
2423
2241
  gap: var(--ac-global-dimension-size-200);
2424
2242
  flex-wrap: wrap;
2425
- `,children:m.map(v=>e("li",{children:e(Ze,{to:`/projects/${v.id}`,css:C`
2243
+ `,children:m.map(b=>e("li",{children:e(We,{to:`/projects/${b.id}`,css:v`
2426
2244
  text-decoration: none;
2427
- `,children:e(Om,{project:v,onProjectDelete:()=>b(v.name),onProjectClear:()=>k(v.name),onProjectRemoveData:()=>S(v.name)})})},v.id))})}),t]})}function $m({gradientStartColor:n,gradientEndColor:a}){return e("div",{css:C`
2245
+ `,children:e(Am,{project:b,onProjectDelete:()=>k(b.name),onProjectClear:()=>S(b.name),onProjectRemoveData:()=>C(b.name)})})},b.id))})}),l]})}function Em({gradientStartColor:n,gradientEndColor:a}){return e("div",{css:v`
2428
2246
  border-radius: 50%;
2429
2247
  width: 32px;
2430
2248
  height: 32px;
@@ -2434,7 +2252,7 @@ fragment ProjectsPageProjectsFragment on Query {
2434
2252
  ${a} 84.38%
2435
2253
  );
2436
2254
  flex-shrink: 0;
2437
- `})}function Om({project:n,onProjectDelete:a,onProjectClear:l,onProjectRemoveData:t}){const{endTime:i,traceCount:r,tokenCountTotal:o,latencyMsP50:c,gradientStartColor:d,gradientEndColor:g}=n,f=u.useMemo(()=>i?`Last updated ${Us(new Date(i),new Date,{addSuffix:!0})}`:"No traces uploaded yet.",[i]);return s("div",{css:C`
2255
+ `})}function Am({project:n,onProjectDelete:a,onProjectClear:t,onProjectRemoveData:l}){const{endTime:i,traceCount:r,tokenCountTotal:o,latencyMsP50:c,gradientStartColor:d,gradientEndColor:g}=n,f=u.useMemo(()=>i?`Last updated ${Hs(new Date(i),new Date,{addSuffix:!0})}`:"No traces uploaded yet.",[i]);return s("div",{css:v`
2438
2256
  padding: var(--ac-global-dimension-size-200);
2439
2257
  border: 1px solid var(--ac-global-color-grey-400);
2440
2258
  background-color: var(--ac-global-color-grey-100);
@@ -2448,11 +2266,11 @@ fragment ProjectsPageProjectsFragment on Query {
2448
2266
  display: flex;
2449
2267
  flex-direction: column;
2450
2268
  justify-content: space-between;
2451
- `,children:[s(h,{direction:"row",justifyContent:"space-between",alignItems:"start",children:[s(h,{direction:"row",gap:"size-100",alignItems:"center",minWidth:0,children:[e($m,{gradientStartColor:d,gradientEndColor:g}),s(h,{direction:"column",minWidth:0,children:[e(re,{level:2,css:C`
2269
+ `,children:[s(h,{direction:"row",justifyContent:"space-between",alignItems:"start",children:[s(h,{direction:"row",gap:"size-100",alignItems:"center",minWidth:0,children:[e(Em,{gradientStartColor:d,gradientEndColor:g}),s(h,{direction:"column",minWidth:0,children:[e(se,{level:2,css:v`
2452
2270
  overflow: hidden;
2453
2271
  white-space: nowrap;
2454
2272
  text-overflow: ellipsis;
2455
- `,children:n.name}),e(K,{color:"text-700",textSize:"small",fontStyle:"italic",children:f})]})]}),e(Rm,{projectId:n.id,projectName:n.name,onProjectDelete:a,onProjectClear:l,onProjectRemoveData:t})]}),s(h,{direction:"row",justifyContent:"space-between",children:[s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Total Traces"}),e(K,{textSize:"xlarge",children:bn(r)})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Total Tokens"}),e(K,{textSize:"xlarge",children:bn(o)})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Latency P50"}),c!=null?e(we,{latencyMs:c,textSize:"xlarge"}):e(K,{textSize:"xlarge",children:"--"})]})]})]})}const kr=function(){var n=[{kind:"Literal",name:"first",value:100},{kind:"Literal",name:"sort",value:{col:"createdAt",dir:"desc"}}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"DatasetsPageQuery",selections:[{args:null,kind:"FragmentSpread",name:"DatasetsTable_datasets"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"DatasetsPageQuery",selections:[{alias:null,args:n,concreteType:"DatasetConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"exampleCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"experimentCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:'datasets(first:100,sort:{"col":"createdAt","dir":"desc"})'},{alias:null,args:n,filters:["sort"],handle:"connection",key:"DatasetsTable_datasets",kind:"LinkedHandle",name:"datasets"}]},params:{cacheID:"695b221e981c4795492d79faa7d007e4",id:null,metadata:{},name:"DatasetsPageQuery",operationKind:"query",text:`query DatasetsPageQuery {
2273
+ `,children:n.name}),e(K,{color:"text-700",textSize:"small",fontStyle:"italic",children:f})]})]}),e(Im,{projectId:n.id,projectName:n.name,onProjectDelete:a,onProjectClear:t,onProjectRemoveData:l})]}),s(h,{direction:"row",justifyContent:"space-between",children:[s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Total Traces"}),e(K,{textSize:"xlarge",children:kn(r)})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Total Tokens"}),e(K,{textSize:"xlarge",children:kn(o)})]}),s(h,{direction:"column",flex:"none",children:[e(K,{elementType:"h3",textSize:"medium",color:"text-700",children:"Latency P50"}),c!=null?e(Ee,{latencyMs:c,textSize:"xlarge"}):e(K,{textSize:"xlarge",children:"--"})]})]})]})}const kr=function(){var n=[{kind:"Literal",name:"first",value:100},{kind:"Literal",name:"sort",value:{col:"createdAt",dir:"desc"}}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"DatasetsPageQuery",selections:[{args:null,kind:"FragmentSpread",name:"DatasetsTable_datasets"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"DatasetsPageQuery",selections:[{alias:null,args:n,concreteType:"DatasetConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"exampleCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"experimentCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:'datasets(first:100,sort:{"col":"createdAt","dir":"desc"})'},{alias:null,args:n,filters:["sort"],handle:"connection",key:"DatasetsTable_datasets",kind:"LinkedHandle",name:"datasets"}]},params:{cacheID:"695b221e981c4795492d79faa7d007e4",id:null,metadata:{},name:"DatasetsPageQuery",operationKind:"query",text:`query DatasetsPageQuery {
2456
2274
  ...DatasetsTable_datasets
2457
2275
  }
2458
2276
 
@@ -2477,13 +2295,13 @@ fragment DatasetsTable_datasets on Query {
2477
2295
  }
2478
2296
  }
2479
2297
  }
2480
- `}}}();kr.hash="985853a7939f44c0cefdd1a91472c67e";function Qm(n){const a=n.split(`
2481
- `);return a.length>0?a[0].split(",").map(l=>l.trim()):[]}function jm(n){const{onDatasetCreated:a,onDatasetCreateError:l}=n,[t,i]=u.useState([]),{control:r,handleSubmit:o,resetField:c,formState:{isDirty:d,isValid:g}}=Ie({defaultValues:{name:"Dataset "+new Date().toISOString(),input_keys:[],output_keys:[],metadata_keys:[],description:"",metadata:{}}}),f=u.useCallback(m=>{const p=new FormData;return p.append("file",m.file[0]),p.append("name",m.name),p.append("description",m.description),p.append("metadata",JSON.stringify(m.metadata)),m.input_keys.forEach(y=>{p.append("input_keys[]",y)}),m.output_keys.forEach(y=>{p.append("output_keys[]",y)}),m.metadata_keys.forEach(y=>{p.append("metadata_keys[]",y)}),fetch("/v1/datasets/upload?sync=true",{method:"POST",body:p}).then(y=>{if(!y.ok)throw l(new Error(y.statusText||"Failed to create dataset"));return y.json()}).then(y=>{a({name:m.name,id:y.data.dataset_id})})},[l,a]);return s(ye,{onSubmit:o(f),children:[s("div",{css:C`
2298
+ `}}}();kr.hash="985853a7939f44c0cefdd1a91472c67e";function Rm(n){const a=n.split(`
2299
+ `);return a.length>0?a[0].split(",").map(t=>t.trim()):[]}function Mm(n){const{onDatasetCreated:a,onDatasetCreateError:t}=n,[l,i]=u.useState([]),{control:r,handleSubmit:o,resetField:c,formState:{isDirty:d,isValid:g}}=Ae({defaultValues:{name:"Dataset "+new Date().toISOString(),input_keys:[],output_keys:[],metadata_keys:[],description:"",metadata:{}}}),f=u.useCallback(m=>{const p=new FormData;return p.append("file",m.file[0]),p.append("name",m.name),p.append("description",m.description),p.append("metadata",JSON.stringify(m.metadata)),m.input_keys.forEach(y=>{p.append("input_keys[]",y)}),m.output_keys.forEach(y=>{p.append("output_keys[]",y)}),m.metadata_keys.forEach(y=>{p.append("metadata_keys[]",y)}),fetch("/v1/datasets/upload?sync=true",{method:"POST",body:p}).then(y=>{if(!y.ok)throw t(new Error(y.statusText||"Failed to create dataset"));return y.json()}).then(y=>{a({name:m.name,id:y.data.dataset_id})})},[t,a]);return s(fe,{onSubmit:o(f),children:[s("div",{css:v`
2482
2300
  padding: var(--ac-global-dimension-size-200);
2483
2301
  .ac-dropdown-button {
2484
2302
  width: 100%;
2485
2303
  }
2486
- `,children:[e(G,{name:"name",control:r,rules:{required:"field is required"},render:({field:{onChange:m,onBlur:p,value:y},fieldState:{invalid:b,error:k}})=>e(X,{label:"Dataset Name",description:"The name of the dataset",errorMessage:k==null?void 0:k.message,validationState:b?"invalid":"valid",onChange:m,onBlur:p,value:y.toString()})}),e(G,{name:"description",control:r,render:({field:{onChange:m,onBlur:p,value:y},fieldState:{invalid:b,error:k}})=>e(ka,{label:"description",placeholder:"Description of the dataset",isRequired:!1,height:100,errorMessage:k==null?void 0:k.message,validationState:b?"invalid":"valid",onChange:m,onBlur:p,value:y.toString()})}),e(G,{control:r,name:"file",rules:{required:"CSV file is required"},render:({field:{value:m,onChange:p,...y},fieldState:{invalid:b,error:k}})=>e(la,{label:"CSV file",validationState:b?"invalid":"valid",errorMessage:k==null?void 0:k.message,children:e("input",{...y,onChange:S=>{var w;p(S.target.files),c("input_keys"),c("output_keys"),c("metadata_keys");const v=(w=S.target.files)==null?void 0:w[0];if(v){const L=new FileReader;L.onload=function(A){if(!A.target)return;const x=A.target.result,T=Qm(x);i(T)},L.readAsText(v)}},type:"file",id:"file",accept:".csv"})})}),e(G,{name:"input_keys",control:r,rules:{required:"field is required"},render:({field:{value:m,onChange:p},fieldState:{invalid:y,error:b}})=>e(Ma,{label:"input keys",validationState:y?"invalid":"valid",description:"the columns to use as input",columns:t,selectedColumns:m,onChange:p,errorMessage:b==null?void 0:b.message})}),e(G,{name:"output_keys",control:r,render:({field:{value:m,onChange:p},fieldState:{invalid:y,error:b}})=>e(Ma,{label:"output keys",validationState:y?"invalid":"valid",description:"the columns to use as output",columns:t,selectedColumns:m,onChange:p,errorMessage:b==null?void 0:b.message})}),e(G,{name:"metadata_keys",control:r,render:({field:{value:m,onChange:p},fieldState:{invalid:y,error:b}})=>e(Ma,{label:"metadata keys",validationState:y?"invalid":"valid",description:"the columns to use as metadata",columns:t,selectedColumns:m,onChange:p,errorMessage:b==null?void 0:b.message})})]}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(M,{type:"submit",isDisabled:!g,variant:d?"primary":"default",size:"compact",loading:!1,children:"Create Dataset"})})})]})}function Ma(n){const{columns:a,selectedColumns:l,onChange:t,label:i,validationState:r,description:o,errorMessage:c,...d}=n,g=a.length===0,f=u.useMemo(()=>g?"No columns to select":l.length>0?`${l.join(", ")}`:"No columns selected",[l,g]);return e(la,{label:i,isDisabled:g,validationState:r,description:o,errorMessage:c,children:e(Za,{isDisabled:g,...d,menu:e(na,{selectionMode:"multiple",onSelectionChange:m=>{t(Array.from(m))},selectedKeys:new Set(l),children:a.map(m=>e(B,{children:m},m))}),triggerProps:{placement:"bottom end"},children:f})})}const br=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:{col:"createdAt",dir:"desc"},kind:"LocalArgument",name:"sort"}],a=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"},{kind:"Variable",name:"sort",variableName:"sort"}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DatasetsTableDatasetsQuery",selections:[{args:a,kind:"FragmentSpread",name:"DatasetsTable_datasets"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DatasetsTableDatasetsQuery",selections:[{alias:null,args:a,concreteType:"DatasetConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"exampleCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"experimentCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:a,filters:["sort"],handle:"connection",key:"DatasetsTable_datasets",kind:"LinkedHandle",name:"datasets"}]},params:{cacheID:"5ac1688f54e51f9bb3247c83e23d98fb",id:null,metadata:{},name:"DatasetsTableDatasetsQuery",operationKind:"query",text:`query DatasetsTableDatasetsQuery(
2304
+ `,children:[e(Z,{name:"name",control:r,rules:{required:"field is required"},render:({field:{onChange:m,onBlur:p,value:y},fieldState:{invalid:k,error:S}})=>e(G,{label:"Dataset Name",description:"The name of the dataset",errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",onChange:m,onBlur:p,value:y.toString()})}),e(Z,{name:"description",control:r,render:({field:{onChange:m,onBlur:p,value:y},fieldState:{invalid:k,error:S}})=>e(at,{label:"description",placeholder:"Description of the dataset",isRequired:!1,height:100,errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",onChange:m,onBlur:p,value:y.toString()})}),e(Z,{control:r,name:"file",rules:{required:"CSV file is required"},render:({field:{value:m,onChange:p,...y},fieldState:{invalid:k,error:S}})=>e(On,{label:"CSV file",validationState:k?"invalid":"valid",errorMessage:S==null?void 0:S.message,children:e("input",{...y,onChange:C=>{var T;p(C.target.files),c("input_keys"),c("output_keys"),c("metadata_keys");const b=(T=C.target.files)==null?void 0:T[0];if(b){const P=new FileReader;P.onload=function(_){if(!_.target)return;const x=_.target.result,D=Rm(x);i(D)},P.readAsText(b)}},type:"file",id:"file",accept:".csv"})})}),e(Z,{name:"input_keys",control:r,rules:{required:"field is required"},render:({field:{value:m,onChange:p},fieldState:{invalid:y,error:k}})=>e(za,{label:"input keys",validationState:y?"invalid":"valid",description:"the columns to use as input",columns:l,selectedColumns:m,onChange:p,errorMessage:k==null?void 0:k.message})}),e(Z,{name:"output_keys",control:r,render:({field:{value:m,onChange:p},fieldState:{invalid:y,error:k}})=>e(za,{label:"output keys",validationState:y?"invalid":"valid",description:"the columns to use as output",columns:l,selectedColumns:m,onChange:p,errorMessage:k==null?void 0:k.message})}),e(Z,{name:"metadata_keys",control:r,render:({field:{value:m,onChange:p},fieldState:{invalid:y,error:k}})=>e(za,{label:"metadata keys",validationState:y?"invalid":"valid",description:"the columns to use as metadata",columns:l,selectedColumns:m,onChange:p,errorMessage:k==null?void 0:k.message})})]}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(N,{type:"submit",isDisabled:!g,variant:d?"primary":"default",size:"compact",loading:!1,children:"Create Dataset"})})})]})}function za(n){const{columns:a,selectedColumns:t,onChange:l,label:i,validationState:r,description:o,errorMessage:c,...d}=n,g=a.length===0,f=u.useMemo(()=>g?"No columns to select":t.length>0?`${t.join(", ")}`:"No columns selected",[t,g]);return e(On,{label:i,isDisabled:g,validationState:r,description:o,errorMessage:c,children:e(nt,{isDisabled:g,...d,menu:e(va,{selectionMode:"multiple",onSelectionChange:m=>{l(Array.from(m))},selectedKeys:new Set(t),children:a.map(m=>e(U,{children:m},m))}),triggerProps:{placement:"bottom end"},children:f})})}const br=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:{col:"createdAt",dir:"desc"},kind:"LocalArgument",name:"sort"}],a=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"},{kind:"Variable",name:"sort",variableName:"sort"}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DatasetsTableDatasetsQuery",selections:[{args:a,kind:"FragmentSpread",name:"DatasetsTable_datasets"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DatasetsTableDatasetsQuery",selections:[{alias:null,args:a,concreteType:"DatasetConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"exampleCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"experimentCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:a,filters:["sort"],handle:"connection",key:"DatasetsTable_datasets",kind:"LinkedHandle",name:"datasets"}]},params:{cacheID:"5ac1688f54e51f9bb3247c83e23d98fb",id:null,metadata:{},name:"DatasetsTableDatasetsQuery",operationKind:"query",text:`query DatasetsTableDatasetsQuery(
2487
2305
  $after: String = null
2488
2306
  $first: Int = 100
2489
2307
  $sort: DatasetSort = {col: createdAt, dir: desc}
@@ -2519,10 +2337,10 @@ fragment DatasetsTable_datasets_dWkdd on Query {
2519
2337
  __typename
2520
2338
  }
2521
2339
  }
2522
- `}}}();vr.hash="7066cca7015a7e344b77862b0bdab21c";function qm({datasetId:n,datasetName:a,onDatasetDelete:l,onDatasetDeleteError:t}){const[i,r]=D.useMutation(vr),o=u.useCallback(()=>{u.startTransition(()=>{i({variables:{datasetId:n},onCompleted:()=>{l()},onError:c=>{t(c)}})})},[i,n,l,t]);return s(H,{size:"S",title:"Delete Dataset",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:`Are you sure you want to delete dataset ${a}? This will also delete all associated experiments and traces, and it cannot be undone.`})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(M,{variant:"danger",onClick:()=>{o()},disabled:r,loading:r,children:"Delete Dataset"})})})]})}function Um({datasetName:n,datasetId:a,datasetDescription:l,datasetMetadata:t,onDatasetEdited:i,onDatasetEditError:r}){return e(H,{title:"Edit Dataset",size:"M",children:e(ad,{datasetName:n,datasetId:a,datasetDescription:l,datasetMetadata:t,onDatasetEdited:i,onDatasetEditError:r})})}function Bm(n){const{datasetId:a,datasetName:l,datasetDescription:t,datasetMetadata:i,onDatasetDelete:r,onDatasetDeleteError:o,onDatasetEdit:c,onDatasetEditError:d}=n,[g,f]=u.useState(null),m=u.useCallback(()=>{f(e(qm,{datasetId:a,datasetName:l,onDatasetDelete:()=>{r(),f(null)},onDatasetDeleteError:o}))},[a,l,r,o]),p=u.useCallback(()=>{f(e(Um,{datasetId:a,datasetName:l,datasetDescription:t,datasetMetadata:i,onDatasetEdited:()=>{c(),f(null)},onDatasetEditError:d}))},[t,a,i,l,c,d]);return s("div",{onClick:y=>{y.preventDefault(),y.stopPropagation()},children:[s(Be,{align:"end",buttonSize:"compact",onAction:y=>{switch(y){case"deleteDataset":m();break;case"editDataset":p();break}},children:[e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.TrashOutline,{})}),e(K,{children:"Delete"})]})},"deleteDataset"),e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.Edit2Outline,{})}),e(K,{children:"Edit"})]})},"editDataset")]}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>f(null),children:g})]})}const Il=100;function Hm(n){const a=n.id;if(a!=="createdAt"&&a!=="name")throw new Error("Invalid sort column");return{col:a,dir:n.desc?"desc":"asc"}}function Gm(n){const[a,l]=u.useState([]),t=u.useRef(null),i=Y(),r=oe(),o=ce(),{data:c,loadNext:d,hasNext:g,isLoadingNext:f,refetch:m}=D.usePaginationFragment(Sr,n.query),p=u.useMemo(()=>c.datasets.edges.map(v=>v.node),[c]),y=Ke.useCallback(v=>{if(v){const{scrollHeight:w,scrollTop:L,clientHeight:A}=v;w-L-A<300&&!f&&g&&d(Il)}},[g,f,d]),b=he({columns:[{header:"name",accessorKey:"name",cell:({row:v})=>{const L=v.original.experimentCount>0?`${v.original.id}/experiments`:`${v.original.id}/examples`;return e(Ze,{to:L,children:v.original.name})}},{header:"description",accessorKey:"description",enableSorting:!1},{header:"created at",accessorKey:"createdAt",cell:Fe},{header:"example count",accessorKey:"exampleCount",enableSorting:!1,meta:{textAlign:"right"}},{header:"experiment count",accessorKey:"experimentCount",enableSorting:!1,meta:{textAlign:"right"}},{header:"metadata",accessorKey:"metadata",enableSorting:!1,cell:_n},{header:"",id:"actions",enableSorting:!1,size:10,cell:({row:v})=>e(Bm,{datasetId:v.original.id,datasetName:v.original.name,datasetDescription:v.original.description,datasetMetadata:v.original.metadata,onDatasetEdit:()=>{r({title:"Dataset updated",message:`${v.original.name} has been successfully updated.`}),m({},{fetchPolicy:"store-and-network"})},onDatasetEditError:w=>{o({title:"Dataset update failed",message:w.message})},onDatasetDelete:()=>{r({title:"Dataset deleted",message:`${v.original.name} has been successfully deleted.`}),m({},{fetchPolicy:"store-and-network"})},onDatasetDeleteError:w=>{o({title:"Dataset deletion failed",message:w.message})}})}],data:p,state:{sorting:a},getCoreRowModel:ke(),getSortedRowModel:Rn(),onSortingChange:l,manualSorting:!0});u.useEffect(()=>{const v=a[0];u.startTransition(()=>{m({sort:v?Hm(v):{col:"createdAt",dir:"desc"},after:null,first:Il},{fetchPolicy:"store-and-network"})})},[a,m]);const k=b.getRowModel().rows,S=k.length===0;return e("div",{css:C`
2340
+ `}}}();vr.hash="7066cca7015a7e344b77862b0bdab21c";function Nm({datasetId:n,datasetName:a,onDatasetDelete:t,onDatasetDeleteError:l}){const[i,r]=I.useMutation(vr),o=u.useCallback(()=>{u.startTransition(()=>{i({variables:{datasetId:n},onCompleted:()=>{t()},onError:c=>{l(c)}})})},[i,n,t,l]);return s(B,{size:"S",title:"Delete Dataset",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:`Are you sure you want to delete dataset ${a}? This will also delete all associated experiments and traces, and it cannot be undone.`})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(N,{variant:"danger",onClick:()=>{o()},disabled:r,loading:r,children:"Delete Dataset"})})})]})}function zm({datasetName:n,datasetId:a,datasetDescription:t,datasetMetadata:l,onDatasetEdited:i,onDatasetEditError:r}){return e(B,{title:"Edit Dataset",size:"M",children:e(ld,{datasetName:n,datasetId:a,datasetDescription:t,datasetMetadata:l,onDatasetEdited:i,onDatasetEditError:r})})}function Vm(n){const{datasetId:a,datasetName:t,datasetDescription:l,datasetMetadata:i,onDatasetDelete:r,onDatasetDeleteError:o,onDatasetEdit:c,onDatasetEditError:d}=n,[g,f]=u.useState(null),m=u.useCallback(()=>{f(e(Nm,{datasetId:a,datasetName:t,onDatasetDelete:()=>{r(),f(null)},onDatasetDeleteError:o}))},[a,t,r,o]),p=u.useCallback(()=>{f(e(zm,{datasetId:a,datasetName:t,datasetDescription:l,datasetMetadata:i,onDatasetEdited:()=>{c(),f(null)},onDatasetEditError:d}))},[l,a,i,t,c,d]);return s("div",{onClick:y=>{y.preventDefault(),y.stopPropagation()},children:[s(ln,{align:"end",buttonSize:"compact",onAction:y=>{switch(y){case"deleteDataset":m();break;case"editDataset":p();break}},children:[e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.TrashOutline,{})}),e(K,{children:"Delete"})]})},"deleteDataset"),e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.Edit2Outline,{})}),e(K,{children:"Edit"})]})},"editDataset")]}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>f(null),children:g})]})}const Nt=100;function $m(n){const a=n.id;if(a!=="createdAt"&&a!=="name")throw new Error("Invalid sort column");return{col:a,dir:n.desc?"desc":"asc"}}function Om(n){const[a,t]=u.useState([]),l=u.useRef(null),i=Y(),r=oe(),o=ce(),{data:c,loadNext:d,hasNext:g,isLoadingNext:f,refetch:m}=I.usePaginationFragment(Sr,n.query),p=u.useMemo(()=>c.datasets.edges.map(b=>b.node),[c]),y=Ke.useCallback(b=>{if(b){const{scrollHeight:T,scrollTop:P,clientHeight:_}=b;T-P-_<300&&!f&&g&&d(Nt)}},[g,f,d]),k=ke({columns:[{header:"name",accessorKey:"name",cell:({row:b})=>{const P=b.original.experimentCount>0?`${b.original.id}/experiments`:`${b.original.id}/examples`;return e(We,{to:P,children:b.original.name})}},{header:"description",accessorKey:"description",enableSorting:!1},{header:"created at",accessorKey:"createdAt",cell:Fe},{header:"example count",accessorKey:"exampleCount",enableSorting:!1,meta:{textAlign:"right"}},{header:"experiment count",accessorKey:"experimentCount",enableSorting:!1,meta:{textAlign:"right"}},{header:"metadata",accessorKey:"metadata",enableSorting:!1,cell:An},{header:"",id:"actions",enableSorting:!1,size:10,cell:({row:b})=>e(Vm,{datasetId:b.original.id,datasetName:b.original.name,datasetDescription:b.original.description,datasetMetadata:b.original.metadata,onDatasetEdit:()=>{r({title:"Dataset updated",message:`${b.original.name} has been successfully updated.`}),m({},{fetchPolicy:"store-and-network"})},onDatasetEditError:T=>{o({title:"Dataset update failed",message:T.message})},onDatasetDelete:()=>{r({title:"Dataset deleted",message:`${b.original.name} has been successfully deleted.`}),m({},{fetchPolicy:"store-and-network"})},onDatasetDeleteError:T=>{o({title:"Dataset deletion failed",message:T.message})}})}],data:p,state:{sorting:a},getCoreRowModel:be(),getSortedRowModel:Nn(),onSortingChange:t,manualSorting:!0});u.useEffect(()=>{const b=a[0];u.startTransition(()=>{m({sort:b?$m(b):{col:"createdAt",dir:"desc"},after:null,first:Nt},{fetchPolicy:"store-and-network"})})},[a,m]);const S=k.getRowModel().rows,C=S.length===0;return e("div",{css:v`
2523
2341
  flex: 1 1 auto;
2524
2342
  overflow: auto;
2525
- `,onScroll:v=>y(v.target),ref:t,children:s("table",{css:jn,children:[e("thead",{children:b.getHeaderGroups().map(v=>e("tr",{children:v.headers.map(w=>{var L;return e("th",{colSpan:w.colSpan,children:w.isPlaceholder?null:s("div",{className:w.column.getCanSort()?"cursor-pointer":"",onClick:w.column.getToggleSortingHandler(),style:{textAlign:(L=w.column.columnDef.meta)==null?void 0:L.textAlign},children:[Z(w.column.columnDef.header,w.getContext()),w.column.getIsSorted()?e(P,{className:"sort-icon",svg:w.column.getIsSorted()==="asc"?e(I.ArrowUpFilled,{}):e(I.ArrowDownFilled,{})}):null]})},w.id)})},v.id))}),S?e(Je,{}):e("tbody",{children:k.map(v=>e("tr",{onClick:()=>{const L=v.original.experimentCount>0?`${v.original.id}/experiments`:`${v.original.id}/examples`;i(L)},children:v.getVisibleCells().map(w=>{var L;return e("td",{align:(L=w.column.columnDef.meta)==null?void 0:L.textAlign,children:Z(w.column.columnDef.cell,w.getContext())},w.id)})},v.id))})]})})}function Xy(){return e(u.Suspense,{fallback:e(fe,{}),children:e(Wm,{})})}function Wm(){const[n,a]=u.useState(0),l=D.useLazyLoadQuery(kr,{},{fetchKey:n,fetchPolicy:"store-and-network"}),t=u.useCallback(()=>{a(i=>i+1)},[a]);return s(h,{direction:"column",height:"100%",children:[e(F,{padding:"size-200",borderBottomWidth:"thin",borderBottomColor:"dark",flex:"none",children:s(h,{direction:"row",justifyContent:"space-between",children:[e(re,{level:1,children:"Datasets"}),e(Jm,{onDatasetCreated:t})]})}),e(Gm,{query:l})]})}function Jm({onDatasetCreated:n}){const a=Y(),l=oe(),t=ce(),[i,r]=u.useState(null),o=()=>{r(e(H,{size:"S",title:"New Dataset",children:e(nl,{onDatasetCreated:d=>{l({title:"Dataset created",message:`${d.name} has been successfully created.`,action:{text:"Go to Dataset",onClick:()=>{a(`/datasets/${d.id}`)}}}),r(null),n()},onDatasetCreateError:d=>{t({title:"Dataset creation failed",message:d.message})}})}))},c=()=>{r(e(H,{size:"M",title:"New Dataset from CSV",children:e(jm,{onDatasetCreated:d=>{l({title:"Dataset created",message:`${d.name} has been successfully created.`,action:{text:"Go to Dataset",onClick:()=>{a(`/datasets/${d.id}`)}}}),r(null),n()},onDatasetCreateError:d=>{t({title:"Dataset creation failed",message:d.message})}})}))};return s(U,{children:[s(Be,{buttonText:"Create Dataset",align:"end",icon:e(P,{svg:e(I.DatabaseOutline,{})}),onAction:d=>{switch(d){case"newDataset":o();break;case"datasetFromCSV":c();break}},children:[e(B,{children:"New Dataset"},"newDataset"),e(B,{children:"Dataset from CSV"},"datasetFromCSV")]}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>r(null),children:i})]})}const Cr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"datasetId"}],a=[{kind:"Variable",name:"id",variableName:"datasetId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={kind:"InlineFragment",selections:[{alias:"latestVersions",args:[{kind:"Literal",name:"first",value:1},{kind:"Literal",name:"sort",value:{col:"createdAt",dir:"desc"}}],concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"version",args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'versions(first:1,sort:{"col":"createdAt","dir":"desc"})'}],type:"Dataset",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"datasetStore_latestVersionQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"datasetStore_latestVersionQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,t],storageKey:null}]},params:{cacheID:"d7075240e4dae8871997e57616c05302",id:null,metadata:{},name:"datasetStore_latestVersionQuery",operationKind:"query",text:`query datasetStore_latestVersionQuery(
2343
+ `,onScroll:b=>y(b.target),ref:l,children:s("table",{css:Hn,children:[e("thead",{children:k.getHeaderGroups().map(b=>e("tr",{children:b.headers.map(T=>{var P;return e("th",{colSpan:T.colSpan,children:T.isPlaceholder?null:s("div",{className:T.column.getCanSort()?"cursor-pointer":"",onClick:T.column.getToggleSortingHandler(),style:{textAlign:(P=T.column.columnDef.meta)==null?void 0:P.textAlign},children:[X(T.column.columnDef.header,T.getContext()),T.column.getIsSorted()?e(w,{className:"sort-icon",svg:T.column.getIsSorted()==="asc"?e(L.ArrowUpFilled,{}):e(L.ArrowDownFilled,{})}):null]})},T.id)})},b.id))}),C?e(Ge,{}):e("tbody",{children:S.map(b=>e("tr",{onClick:()=>{const P=b.original.experimentCount>0?`${b.original.id}/experiments`:`${b.original.id}/examples`;i(P)},children:b.getVisibleCells().map(T=>{var P;return e("td",{align:(P=T.column.columnDef.meta)==null?void 0:P.textAlign,children:X(T.column.columnDef.cell,T.getContext())},T.id)})},b.id))})]})})}function cf(){return e(u.Suspense,{fallback:e(he,{}),children:e(Qm,{})})}function Qm(){const[n,a]=u.useState(0),t=I.useLazyLoadQuery(kr,{},{fetchKey:n,fetchPolicy:"store-and-network"}),l=u.useCallback(()=>{a(i=>i+1)},[a]);return s(h,{direction:"column",height:"100%",children:[e(F,{padding:"size-200",borderBottomWidth:"thin",borderBottomColor:"dark",flex:"none",children:s(h,{direction:"row",justifyContent:"space-between",children:[e(se,{level:1,children:"Datasets"}),e(jm,{onDatasetCreated:l})]})}),e(Om,{query:t})]})}function jm({onDatasetCreated:n}){const a=Y(),t=oe(),l=ce(),[i,r]=u.useState(null),o=()=>{r(e(B,{size:"S",title:"New Dataset",children:e(st,{onDatasetCreated:d=>{t({title:"Dataset created",message:`${d.name} has been successfully created.`,action:{text:"Go to Dataset",onClick:()=>{a(`/datasets/${d.id}`)}}}),r(null),n()},onDatasetCreateError:d=>{l({title:"Dataset creation failed",message:d.message})}})}))},c=()=>{r(e(B,{size:"M",title:"New Dataset from CSV",children:e(Mm,{onDatasetCreated:d=>{t({title:"Dataset created",message:`${d.name} has been successfully created.`,action:{text:"Go to Dataset",onClick:()=>{a(`/datasets/${d.id}`)}}}),r(null),n()},onDatasetCreateError:d=>{l({title:"Dataset creation failed",message:d.message})}})}))};return s(H,{children:[s(ln,{buttonText:"Create Dataset",align:"end",icon:e(w,{svg:e(L.DatabaseOutline,{})}),onAction:d=>{switch(d){case"newDataset":o();break;case"datasetFromCSV":c();break}},children:[e(U,{children:"New Dataset"},"newDataset"),e(U,{children:"Dataset from CSV"},"datasetFromCSV")]}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>r(null),children:i})]})}const Cr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"datasetId"}],a=[{kind:"Variable",name:"id",variableName:"datasetId"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={kind:"InlineFragment",selections:[{alias:"latestVersions",args:[{kind:"Literal",name:"first",value:1},{kind:"Literal",name:"sort",value:{col:"createdAt",dir:"desc"}}],concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"version",args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'versions(first:1,sort:{"col":"createdAt","dir":"desc"})'}],type:"Dataset",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"datasetStore_latestVersionQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,l],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"datasetStore_latestVersionQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,l],storageKey:null}]},params:{cacheID:"d7075240e4dae8871997e57616c05302",id:null,metadata:{},name:"datasetStore_latestVersionQuery",operationKind:"query",text:`query datasetStore_latestVersionQuery(
2526
2344
  $datasetId: GlobalID!
2527
2345
  ) {
2528
2346
  dataset: node(id: $datasetId) {
@@ -2541,32 +2359,32 @@ fragment DatasetsTable_datasets_dWkdd on Query {
2541
2359
  }
2542
2360
  }
2543
2361
  }
2544
- `}}}();Cr.hash="a1349b92d8b0c745f5e8039c55b048c7";const Zm=n=>{const a=(l,t)=>({...n,isRefreshingLatestVersion:!1,refreshLatestVersion:async()=>{const i=t();l({isRefreshingLatestVersion:!0});const r=await Xm({datasetId:i.datasetId});l({latestVersion:r,isRefreshingLatestVersion:!1})}});return Bs()(Hs(a))};async function Xm({datasetId:n}){var i;const a=await D.fetchQuery(xe,Cr,{datasetId:n}).toPromise(),l=(i=a==null?void 0:a.dataset.latestVersions)==null?void 0:i.edges;return l&&l.length&&l[0].version||null}const Fr=u.createContext(null);function Ym({children:n,...a}){const[l]=u.useState(()=>Zm(a));return e(Fr.Provider,{value:l,children:n})}function vn(n,a){const l=u.useContext(Fr);if(!l)throw new Error("Missing DatasetContext.Provider in the tree");return ya(l,n,a)}const Kr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"addExamplesToDataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"AddDatasetExampleDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"AddDatasetExampleDialogMutation",selections:a},params:{cacheID:"718cf02ccb39b279132822bf503e51e6",id:null,metadata:{},name:"AddDatasetExampleDialogMutation",operationKind:"mutation",text:`mutation AddDatasetExampleDialogMutation(
2362
+ `}}}();Cr.hash="a1349b92d8b0c745f5e8039c55b048c7";const qm=n=>{const a=(t,l)=>({...n,isRefreshingLatestVersion:!1,refreshLatestVersion:async()=>{const i=l();t({isRefreshingLatestVersion:!0});const r=await Um({datasetId:i.datasetId});t({latestVersion:r,isRefreshingLatestVersion:!1})}});return Gs()(Ws(a))};async function Um({datasetId:n}){var i;const a=await I.fetchQuery(xe,Cr,{datasetId:n}).toPromise(),t=(i=a==null?void 0:a.dataset.latestVersions)==null?void 0:i.edges;return t&&t.length&&t[0].version||null}const Fr=u.createContext(null);function Bm({children:n,...a}){const[t]=u.useState(()=>qm(a));return e(Fr.Provider,{value:t,children:n})}function Sn(n,a){const t=u.useContext(Fr);if(!t)throw new Error("Missing DatasetContext.Provider in the tree");return ba(t,n,a)}const Kr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"addExamplesToDataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"AddDatasetExampleDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"AddDatasetExampleDialogMutation",selections:a},params:{cacheID:"718cf02ccb39b279132822bf503e51e6",id:null,metadata:{},name:"AddDatasetExampleDialogMutation",operationKind:"mutation",text:`mutation AddDatasetExampleDialogMutation(
2545
2363
  $input: AddExamplesToDatasetInput!
2546
2364
  ) {
2547
2365
  addExamplesToDataset(input: $input) {
2548
2366
  __typename
2549
2367
  }
2550
2368
  }
2551
- `}}}();Kr.hash="8d99470f590cd5d28701fa6e3c0330e6";const Na={backgroundColor:"light",borderColor:"light",collapsible:!0,bodyStyle:{padding:0}};function eg(n){const{datasetId:a,onCompleted:l}=n,[t,i]=u.useState(null),[r,o]=D.useMutation(Kr),{control:c,setError:d,handleSubmit:g,formState:{isValid:f}}=Ie({defaultValues:{input:"{}",output:"{}",metadata:"{}"}}),m=u.useCallback(p=>{if(i(null),!Oe(p==null?void 0:p.input))return d("input",{message:"Input must be a valid JSON object"});if(!Oe(p==null?void 0:p.output))return d("output",{message:"Output must be a valid JSON object"});if(!Oe(p==null?void 0:p.metadata))return d("metadata",{message:"Metadata must be a valid JSON object"});r({variables:{input:{datasetId:a,examples:[{input:JSON.parse(p.input),output:JSON.parse(p.output),metadata:JSON.parse(p.metadata)}],datasetVersionDescription:p.description}},onCompleted:()=>{l()},onError:y=>{i(y.message)}})},[r,a,d,l]);return s(H,{size:"L",title:"Add Example",children:[e("div",{css:C`
2369
+ `}}}();Kr.hash="8d99470f590cd5d28701fa6e3c0330e6";const Va={backgroundColor:"light",borderColor:"light",collapsible:!0,bodyStyle:{padding:0}};function Hm(n){const{datasetId:a,onCompleted:t}=n,[l,i]=u.useState(null),[r,o]=I.useMutation(Kr),{control:c,setError:d,handleSubmit:g,formState:{isValid:f}}=Ae({defaultValues:{input:"{}",output:"{}",metadata:"{}"}}),m=u.useCallback(p=>{if(i(null),!Oe(p==null?void 0:p.input))return d("input",{message:"Input must be a valid JSON object"});if(!Oe(p==null?void 0:p.output))return d("output",{message:"Output must be a valid JSON object"});if(!Oe(p==null?void 0:p.metadata))return d("metadata",{message:"Metadata must be a valid JSON object"});r({variables:{input:{datasetId:a,examples:[{input:JSON.parse(p.input),output:JSON.parse(p.output),metadata:JSON.parse(p.metadata)}],datasetVersionDescription:p.description}},onCompleted:()=>{t()},onError:y=>{i(y.message)}})},[r,a,d,t]);return s(B,{size:"L",title:"Add Example",children:[e("div",{css:v`
2552
2370
  overflow-y: auto;
2553
2371
  padding: var(--ac-global-dimension-size-400);
2554
- `,children:e(h,{direction:"row",justifyContent:"center",children:e(F,{width:"900px",paddingStart:"auto",paddingEnd:"auto",children:s(h,{direction:"column",gap:"size-200",children:[t?e(ne,{variant:"danger",children:t}):null,e(G,{control:c,name:"input",render:({field:{onChange:p,onBlur:y,value:b},fieldState:{invalid:k,error:S}})=>s(V,{title:"Input",subTitle:"The input to the LLM, retriever, program, etc.",...Na,children:[k?e(ne,{variant:"danger",banner:!0,children:S==null?void 0:S.message}):null,e(Re,{value:b,onChange:p,onBlur:y})]})}),e(G,{control:c,name:"output",render:({field:{onChange:p,onBlur:y,value:b},fieldState:{invalid:k,error:S}})=>s(V,{title:"Output",subTitle:"The output of the LLM or program to be used as an expected output",...Na,backgroundColor:"green-100",borderColor:"green-700",children:[k?e(ne,{variant:"danger",banner:!0,children:S==null?void 0:S.message}):null,e(Re,{value:b,onChange:p,onBlur:y})]})}),e(G,{control:c,name:"metadata",render:({field:{onChange:p,onBlur:y,value:b},fieldState:{invalid:k,error:S}})=>s(V,{title:"Metadata",subTitle:"All data from the span to use during experimentation or evaluation",...Na,children:[k?e(ne,{variant:"danger",banner:!0,children:S==null?void 0:S.message}):null,e(Re,{value:b,onChange:p,onBlur:y})]})}),e(G,{control:c,name:"description",render:({field:{onChange:p,onBlur:y,value:b},fieldState:{invalid:k,error:S}})=>e(ka,{label:"Version Description",value:b,onChange:p,onBlur:y,errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",placeholder:"A description of the changes made. Will be displayed in the version history.",height:100})})]})})})}),e(F,{padding:"size-200",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",gap:"size-100",children:e(M,{variant:"primary",size:"compact",disabled:!f||o,loading:o,onClick:g(m),children:"Add Example"})})})]})}function ng(n){const{datasetId:a,onAddExampleCompleted:l}=n,[t,i]=u.useState(null),r=u.useCallback(()=>{i(e(eg,{datasetId:a,onCompleted:()=>{l(),i(null)}}))},[a,l]);return s(U,{children:[e(M,{icon:e(P,{svg:e(I.PlusCircleOutline,{})}),size:"compact",variant:"default",onClick:r,children:"Add Example"}),e(W,{isDismissable:!0,onDismiss:()=>{i(null)},children:t})]})}function ag(){const n=vn(i=>i.datasetId),a=vn(i=>i.latestVersion);let l=`${ja}/v1/datasets/${n}/examples`;a&&(l+=`?version-id=${a.id}`);const t=u.useMemo(()=>`import phoenix as px
2372
+ `,children:e(h,{direction:"row",justifyContent:"center",children:e(F,{width:"900px",paddingStart:"auto",paddingEnd:"auto",children:s(h,{direction:"column",gap:"size-200",children:[l?e(te,{variant:"danger",children:l}):null,e(Z,{control:c,name:"input",render:({field:{onChange:p,onBlur:y,value:k},fieldState:{invalid:S,error:C}})=>s($,{title:"Input",subTitle:"The input to the LLM, retriever, program, etc.",...Va,children:[S?e(te,{variant:"danger",banner:!0,children:C==null?void 0:C.message}):null,e(De,{value:k,onChange:p,onBlur:y})]})}),e(Z,{control:c,name:"output",render:({field:{onChange:p,onBlur:y,value:k},fieldState:{invalid:S,error:C}})=>s($,{title:"Output",subTitle:"The output of the LLM or program to be used as an expected output",...Va,backgroundColor:"green-100",borderColor:"green-700",children:[S?e(te,{variant:"danger",banner:!0,children:C==null?void 0:C.message}):null,e(De,{value:k,onChange:p,onBlur:y})]})}),e(Z,{control:c,name:"metadata",render:({field:{onChange:p,onBlur:y,value:k},fieldState:{invalid:S,error:C}})=>s($,{title:"Metadata",subTitle:"All data from the span to use during experimentation or evaluation",...Va,children:[S?e(te,{variant:"danger",banner:!0,children:C==null?void 0:C.message}):null,e(De,{value:k,onChange:p,onBlur:y})]})}),e(Z,{control:c,name:"description",render:({field:{onChange:p,onBlur:y,value:k},fieldState:{invalid:S,error:C}})=>e(at,{label:"Version Description",value:k,onChange:p,onBlur:y,errorMessage:C==null?void 0:C.message,validationState:S?"invalid":"valid",placeholder:"A description of the changes made. Will be displayed in the version history.",height:100})})]})})})}),e(F,{padding:"size-200",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",gap:"size-100",children:e(N,{variant:"primary",size:"compact",disabled:!f||o,loading:o,onClick:g(m),children:"Add Example"})})})]})}function Gm(n){const{datasetId:a,onAddExampleCompleted:t}=n,[l,i]=u.useState(null),r=u.useCallback(()=>{i(e(Hm,{datasetId:a,onCompleted:()=>{t(),i(null)}}))},[a,t]);return s(H,{children:[e(N,{icon:e(w,{svg:e(L.PlusCircleOutline,{})}),size:"compact",variant:"default",onClick:r,children:"Add Example"}),e(W,{isDismissable:!0,onDismiss:()=>{i(null)},children:l})]})}function Wm(){const n=Sn(i=>i.datasetId),a=Sn(i=>i.latestVersion);let t=`${Ha}/v1/datasets/${n}/examples`;a&&(t+=`?version-id=${a.id}`);const l=u.useMemo(()=>`import phoenix as px
2555
2373
  client = px.Client()
2556
2374
  # Get the current dataset version
2557
- dataset = client.get_dataset(id="${n}"${a?`, version_id="${a.id}"`:""})`,[n,a]);return e("div",{css:C`
2375
+ dataset = client.get_dataset(id="${n}"${a?`, version_id="${a.id}"`:""})`,[n,a]);return e("div",{css:v`
2558
2376
  button.ac-dropdown-button {
2559
2377
  min-width: 80px;
2560
2378
  .ac-dropdown-button__text {
2561
2379
  padding-right: 10px;
2562
2380
  }
2563
2381
  }
2564
- `,children:s(tn,{placement:"bottom right",children:[e(Ja,{addonBefore:e(P,{svg:e(I.Code,{})}),children:"Code"}),e(ha,{children:s("section",{css:C`
2382
+ `,children:s(Cn,{placement:"bottom right",children:[e(et,{addonBefore:e(w,{svg:e(L.Code,{})}),children:"Code"}),e(Sa,{children:s("section",{css:v`
2565
2383
  width: 500px;
2566
2384
  .ac-field {
2567
2385
  flex: 1 1 auto;
2568
2386
  }
2569
- `,children:[e(F,{padding:"size-200",children:s(ye,{children:[s(h,{direction:"row",gap:"size-100",alignItems:"end",width:"100%",children:[e(X,{label:"Dataset ID",isReadOnly:!0,value:n}),e(le,{text:n,size:"default"})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(X,{label:"Version ID",isReadOnly:!0,value:(a==null?void 0:a.id)||"No Versions",validationState:a?"valid":"invalid"}),e(le,{text:(a==null?void 0:a.id)||"No Versions",disabled:!a,size:"default"})]})]})}),s(Te,{children:[e(J,{name:"Python",children:e(F,{margin:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"small",children:e(pn,{value:t})})}),e(J,{name:"REST",children:e(F,{padding:"size-200",children:e(ye,{children:s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(X,{label:"URL",isReadOnly:!0,value:l}),e(le,{text:l,size:"default"})]})})})})]})]})})]})})}const xr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"datasetId"}],a=[{kind:"Variable",name:"id",variableName:"datasetId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i=[{kind:"Literal",name:"first",value:100}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DatasetHistoryDialogQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[l,{args:null,kind:"FragmentSpread",name:"DatasetHistoryTable_versions"}],type:"Dataset",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DatasetHistoryDialogQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},t],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"versions(first:100)"},{alias:null,args:i,filters:null,handle:"connection",key:"DatasetHistoryTable_versions",kind:"LinkedHandle",name:"versions"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"df94b4e72c0187fd0fd1c8416af19354",id:null,metadata:{},name:"DatasetHistoryDialogQuery",operationKind:"query",text:`query DatasetHistoryDialogQuery(
2387
+ `,children:[e(F,{padding:"size-200",children:s(fe,{children:[s(h,{direction:"row",gap:"size-100",alignItems:"end",width:"100%",children:[e(G,{label:"Dataset ID",isReadOnly:!0,value:n}),e(ae,{text:n,size:"default"})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(G,{label:"Version ID",isReadOnly:!0,value:(a==null?void 0:a.id)||"No Versions",validationState:a?"valid":"invalid"}),e(ae,{text:(a==null?void 0:a.id)||"No Versions",disabled:!a,size:"default"})]})]})}),s(Pe,{children:[e(J,{name:"Python",children:e(F,{margin:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"small",children:e(pn,{value:l})})}),e(J,{name:"REST",children:e(F,{padding:"size-200",children:e(fe,{children:s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(G,{label:"URL",isReadOnly:!0,value:t}),e(ae,{text:t,size:"default"})]})})})})]})]})})]})})}const xr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"datasetId"}],a=[{kind:"Variable",name:"id",variableName:"datasetId"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i=[{kind:"Literal",name:"first",value:100}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DatasetHistoryDialogQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[t,{args:null,kind:"FragmentSpread",name:"DatasetHistoryTable_versions"}],type:"Dataset",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DatasetHistoryDialogQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},l],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"versions(first:100)"},{alias:null,args:i,filters:null,handle:"connection",key:"DatasetHistoryTable_versions",kind:"LinkedHandle",name:"versions"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"df94b4e72c0187fd0fd1c8416af19354",id:null,metadata:{},name:"DatasetHistoryDialogQuery",operationKind:"query",text:`query DatasetHistoryDialogQuery(
2570
2388
  $datasetId: GlobalID!
2571
2389
  ) {
2572
2390
  dataset: node(id: $datasetId) {
@@ -2598,7 +2416,7 @@ fragment DatasetHistoryTable_versions on Dataset {
2598
2416
  }
2599
2417
  id
2600
2418
  }
2601
- `}}}();xr.hash="7215c18bda690418c5ecbcb3131a288e";const Dr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DatasetHistoryTableVersionsQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:l,kind:"FragmentSpread",name:"DatasetHistoryTable_versions"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DatasetHistoryTableVersionsQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:l,concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},t],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:l,filters:null,handle:"connection",key:"DatasetHistoryTable_versions",kind:"LinkedHandle",name:"versions"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"e8e3a05b4e86c8eaeea98172405fdc7e",id:null,metadata:{},name:"DatasetHistoryTableVersionsQuery",operationKind:"query",text:`query DatasetHistoryTableVersionsQuery(
2419
+ `}}}();xr.hash="7215c18bda690418c5ecbcb3131a288e";const Tr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"DatasetHistoryTableVersionsQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:t,kind:"FragmentSpread",name:"DatasetHistoryTable_versions"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"DatasetHistoryTableVersionsQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:t,concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},l],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:t,filters:null,handle:"connection",key:"DatasetHistoryTable_versions",kind:"LinkedHandle",name:"versions"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"e8e3a05b4e86c8eaeea98172405fdc7e",id:null,metadata:{},name:"DatasetHistoryTableVersionsQuery",operationKind:"query",text:`query DatasetHistoryTableVersionsQuery(
2602
2420
  $after: String = null
2603
2421
  $first: Int = 100
2604
2422
  $id: GlobalID!
@@ -2629,33 +2447,33 @@ fragment DatasetHistoryTable_versions_2HEEH6 on Dataset {
2629
2447
  }
2630
2448
  id
2631
2449
  }
2632
- `}}}();Dr.hash="37e453bc58759a1e89bc5862c460de6b";const Tr=function(){var n=["versions"],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Dr,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"DatasetHistoryTable_versions",selections:[{alias:"versions",args:null,concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"__DatasetHistoryTable_versions_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},a],type:"Dataset",abstractKey:null}}();Tr.hash="37e453bc58759a1e89bc5862c460de6b";const lg=100;function tg(n){const a=u.useRef(null),{data:l,loadNext:t,hasNext:i,isLoadingNext:r}=D.usePaginationFragment(Tr,n.dataset),o=u.useMemo(()=>l.versions.edges.map(m=>m.node),[l]),c=Ke.useCallback(m=>{if(m){const{scrollHeight:p,scrollTop:y,clientHeight:b}=m;p-y-b<300&&!r&&i&&t(lg)}},[i,r,t]),d=he({columns:[{header:"version ID",accessorKey:"id"},{header:"description",accessorKey:"description"},{header:"created at",accessorKey:"createdAt",cell:Fe}],data:o,getCoreRowModel:ke(),getSortedRowModel:Rn()}),g=d.getRowModel().rows,f=g.length===0;return e("div",{css:C`
2450
+ `}}}();Tr.hash="37e453bc58759a1e89bc5862c460de6b";const Dr=function(){var n=["versions"],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Tr,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"DatasetHistoryTable_versions",selections:[{alias:"versions",args:null,concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"__DatasetHistoryTable_versions_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},a],type:"Dataset",abstractKey:null}}();Dr.hash="37e453bc58759a1e89bc5862c460de6b";const Jm=100;function Zm(n){const a=u.useRef(null),{data:t,loadNext:l,hasNext:i,isLoadingNext:r}=I.usePaginationFragment(Dr,n.dataset),o=u.useMemo(()=>t.versions.edges.map(m=>m.node),[t]),c=Ke.useCallback(m=>{if(m){const{scrollHeight:p,scrollTop:y,clientHeight:k}=m;p-y-k<300&&!r&&i&&l(Jm)}},[i,r,l]),d=ke({columns:[{header:"version ID",accessorKey:"id"},{header:"description",accessorKey:"description"},{header:"created at",accessorKey:"createdAt",cell:Fe}],data:o,getCoreRowModel:be(),getSortedRowModel:Nn()}),g=d.getRowModel().rows,f=g.length===0;return e("div",{css:v`
2633
2451
  flex: 1 1 auto;
2634
2452
  overflow: auto;
2635
- `,onScroll:m=>c(m.target),ref:a,children:s("table",{css:We,children:[e("thead",{children:d.getHeaderGroups().map(m=>e("tr",{children:m.headers.map(p=>e("th",{colSpan:p.colSpan,children:p.isPlaceholder?null:s("div",{className:p.column.getCanSort()?"cursor-pointer":"",onClick:p.column.getToggleSortingHandler(),style:{left:p.getStart(),width:p.getSize()},children:[Z(p.column.columnDef.header,p.getContext()),p.column.getIsSorted()?e(P,{className:"sort-icon",svg:p.column.getIsSorted()==="asc"?e(I.ArrowUpFilled,{}):e(I.ArrowDownFilled,{})}):null]})},p.id))},m.id))}),f?e(Je,{}):e("tbody",{children:g.map(m=>e("tr",{children:m.getVisibleCells().map(p=>e("td",{children:Z(p.column.columnDef.cell,p.getContext())},p.id))},m.id))})]})})}function ig(n){const{datasetId:a}=n,l=D.useLazyLoadQuery(xr,{datasetId:a});return e(H,{size:"L",title:"Dataset History",children:e("div",{css:C`
2453
+ `,onScroll:m=>c(m.target),ref:a,children:s("table",{css:He,children:[e("thead",{children:d.getHeaderGroups().map(m=>e("tr",{children:m.headers.map(p=>e("th",{colSpan:p.colSpan,children:p.isPlaceholder?null:s("div",{className:p.column.getCanSort()?"cursor-pointer":"",onClick:p.column.getToggleSortingHandler(),style:{left:p.getStart(),width:p.getSize()},children:[X(p.column.columnDef.header,p.getContext()),p.column.getIsSorted()?e(w,{className:"sort-icon",svg:p.column.getIsSorted()==="asc"?e(L.ArrowUpFilled,{}):e(L.ArrowDownFilled,{})}):null]})},p.id))},m.id))}),f?e(Ge,{}):e("tbody",{children:g.map(m=>e("tr",{children:m.getVisibleCells().map(p=>e("td",{children:X(p.column.columnDef.cell,p.getContext())},p.id))},m.id))})]})})}function Xm(n){const{datasetId:a}=n,t=I.useLazyLoadQuery(xr,{datasetId:a});return e(B,{size:"L",title:"Dataset History",children:e("div",{css:v`
2636
2454
  height: 500px;
2637
- `,children:e(tg,{dataset:l.dataset})})})}function rg(n){const{datasetId:a}=n,[l,t]=u.useState(null);return s(U,{children:[s(Le,{children:[e(M,{variant:"default",icon:e(P,{svg:e(I.ClockOutline,{})}),"aria-label":"Version History",onClick:()=>{t(e(ig,{datasetId:a}))}}),e(An,{children:"Dataset Version History"})]}),e(u.Suspense,{fallback:null,children:e(W,{type:"modal",isDismissable:!0,onDismiss:()=>{t(null)},children:l})})]})}const sg=`pip install arize-phoenix>=${window.Config.platformVersion}`;function og({isAuthEnabled:n}){let a=`import os
2455
+ `,children:e(Zm,{dataset:t.dataset})})})}function Ym(n){const{datasetId:a}=n,[t,l]=u.useState(null);return s(H,{children:[s(we,{children:[e(N,{variant:"default",icon:e(w,{svg:e(L.ClockOutline,{})}),"aria-label":"Version History",onClick:()=>{l(e(Xm,{datasetId:a}))}}),e(En,{children:"Dataset Version History"})]}),e(u.Suspense,{fallback:null,children:e(W,{type:"modal",isDismissable:!0,onDismiss:()=>{l(null)},children:t})})]})}const eg=`pip install arize-phoenix>=${window.Config.platformVersion}`;function ng({isAuthEnabled:n}){let a=`import os
2638
2456
  # Set the phoenix collector endpoint. Commonly http://localhost:6060
2639
2457
  os.environ["PHOENIX_COLLECTOR_ENDPOINT"] = "<your-phoenix-url>"`;return n&&(a+=`
2640
2458
  # Configure access
2641
- os.environ["PHOENIX_API_KEY"] = "<your-api-key>"`),a}const dg=`from phoenix.experiments.types import Example
2459
+ os.environ["PHOENIX_API_KEY"] = "<your-api-key>"`),a}const ag=`from phoenix.experiments.types import Example
2642
2460
  # Define your task
2643
2461
  # Typically should be an LLM call or a call to your application
2644
2462
  def my_task(example: Example) -> str:
2645
2463
  # This is just an example of how to return a JSON serializable value
2646
- return f"Hello {example.input["person"]}"`,cg=`# Define an evaluator. This just an example.
2464
+ return f"Hello {example.input["person"]}"`,tg=`# Define an evaluator. This just an example.
2647
2465
  def exact_match(input, output) -> float:
2648
2466
  return 1.0 if output is f"Hello {input}" else 0.0
2649
2467
 
2650
2468
  # Store the evaluators for later use
2651
- evaluators = [exact_match]`,ug=`# Run an experiment
2469
+ evaluators = [exact_match]`,lg=`# Run an experiment
2652
2470
  from phoenix.experiments import run_experiment
2653
2471
 
2654
- experiment = run_experiment(dataset, my_task, evaluators=evaluators)`;function Ir(){const[n,a]=u.useState(null),l=u.useCallback(()=>{a(e(H,{title:"Run Experiment",size:"XL",children:e(mg,{})}))},[]);return s(U,{children:[e(M,{size:"compact",variant:"default",icon:e(P,{svg:e(I.ExperimentOutline,{})}),onClick:l,children:"Run Experiment"}),e(W,{isDismissable:!0,type:"slideOver",onDismiss:()=>{a(null)},children:n})]})}function mg(){const n=vn(i=>i.datasetName),a=vn(i=>i.latestVersion),l=window.Config.authenticationEnabled,t=u.useMemo(()=>`import phoenix as px
2472
+ experiment = run_experiment(dataset, my_task, evaluators=evaluators)`;function Ir(){const[n,a]=u.useState(null),t=u.useCallback(()=>{a(e(B,{title:"Run Experiment",size:"XL",children:e(ig,{})}))},[]);return s(H,{children:[e(N,{size:"compact",variant:"default",icon:e(w,{svg:e(L.ExperimentOutline,{})}),onClick:t,children:"Run Experiment"}),e(W,{isDismissable:!0,type:"slideOver",onDismiss:()=>{a(null)},children:n})]})}function ig(){const n=Sn(i=>i.datasetName),a=Sn(i=>i.latestVersion),t=window.Config.authenticationEnabled,l=u.useMemo(()=>`import phoenix as px
2655
2473
  # Initialize a phoenix client
2656
2474
  client = px.Client()
2657
2475
  # Get the current dataset version. You can omit the version for the latest.
2658
- dataset = client.get_dataset(name="${n}"${a?`, version_id="${a.id}"`:""})`,[n,a]);return s(F,{padding:"size-400",overflow:"auto",children:[e(F,{paddingBottom:"size-100",children:e(K,{children:"Install Phoenix"})}),e(yn,{children:e(pn,{value:sg})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Point to a running instance of Phoenix"})}),e(yn,{children:e(pn,{value:og({isAuthEnabled:l})})}),e(ld,{children:e(F,{paddingBottom:"size-100",paddingTop:"size-100",children:e(rt,{fallback:s(K,{children:["Your personal API keys can be created and managed on your"," ",e(je,{href:"/profile",children:"Profile"})]}),children:s(K,{children:["System API keys can be created and managed in"," ",e(je,{href:"/settings",children:"Settings"})]})})})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Pull down this dataset"})}),e(yn,{children:e(pn,{value:t})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Define your task"})}),e(yn,{children:e(pn,{value:dg})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Define evaluators"})}),e(yn,{children:e(pn,{value:cg})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Run an experiment"})}),e(yn,{children:e(pn,{value:ug})})]})}function Yy(){const n=Cn(),a=u.useMemo(()=>{const l=n.dataset.latestVersions;return l!=null&&l.edges&&l.edges.length?l.edges[0].version:null},[n]);return e(Ym,{datasetId:n.dataset.id,datasetName:n.dataset.name,latestVersion:a,children:e(u.Suspense,{fallback:e(fe,{}),children:e(pg,{dataset:n.dataset})})})}const gg=C`
2476
+ dataset = client.get_dataset(name="${n}"${a?`, version_id="${a.id}"`:""})`,[n,a]);return s(F,{padding:"size-400",overflow:"auto",children:[e(F,{paddingBottom:"size-100",children:e(K,{children:"Install Phoenix"})}),e(Je,{children:e(pn,{value:eg})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Point to a running instance of Phoenix"})}),e(Je,{children:e(pn,{value:ng({isAuthEnabled:t})})}),e(id,{children:e(F,{paddingBottom:"size-100",paddingTop:"size-100",children:e(pl,{fallback:s(K,{children:["Your personal API keys can be created and managed on your"," ",e(je,{href:"/profile",children:"Profile"})]}),children:s(K,{children:["System API keys can be created and managed in"," ",e(je,{href:"/settings",children:"Settings"})]})})})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Pull down this dataset"})}),e(Je,{children:e(pn,{value:l})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Define your task"})}),e(Je,{children:e(pn,{value:ag})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Define evaluators"})}),e(Je,{children:e(pn,{value:tg})}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",children:e(K,{children:"Run an experiment"})}),e(Je,{children:e(pn,{value:lg})})]})}function uf(){const n=vn(),a=u.useMemo(()=>{const t=n.dataset.latestVersions;return t!=null&&t.edges&&t.edges.length?t.edges[0].version:null},[n]);return e(Bm,{datasetId:n.dataset.id,datasetName:n.dataset.name,latestVersion:a,children:e(u.Suspense,{fallback:e(he,{}),children:e(sg,{dataset:n.dataset})})})}const rg=v`
2659
2477
  flex: 1 1 auto;
2660
2478
  display: flex;
2661
2479
  flex-direction: column;
@@ -2681,7 +2499,7 @@ dataset = client.get_dataset(name="${n}"${a?`, version_id="${a.id}"`:""})`,[n,a]
2681
2499
  }
2682
2500
  }
2683
2501
  }
2684
- `;function pg({dataset:n}){const a=n.id,l=vn(d=>d.refreshLatestVersion),t=oe(),i=Y(),r=u.useCallback(d=>{d===0?i(`/datasets/${a}/experiments`):d===1&&i(`/datasets/${a}/examples`)},[i,a]),c=Gs().pathname.includes("examples")?1:0;return s("main",{css:gg,children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-200",paddingBottom:"size-50",flex:"none",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(h,{direction:"column",justifyContent:"space-between",children:e(h,{direction:"row",gap:"size-200",alignItems:"center",children:s(h,{direction:"column",children:[e(K,{elementType:"h1",textSize:"xlarge",weight:"heavy",children:n.name}),e(K,{color:"text-700",children:n.description||"--"})]})})}),s(h,{direction:"row",gap:"size-100",children:[s(Be,{align:"end",icon:e(P,{svg:e(I.DownloadOutline,{})}),onAction:d=>{switch(d){case"csv":window.open(`/v1/datasets/${n.id}/csv`,"_blank");break;case"openai-ft":window.open(`/v1/datasets/${n.id}/jsonl/openai_ft`,"_blank");break;case"openai-evals":window.open(`/v1/datasets/${n.id}/jsonl/openai_evals`,"_blank");break}},children:[e(B,{children:"Download CSV"},"csv"),e(B,{children:"Download OpenAI Fine-Tuning JSONL"},"openai-ft"),e(B,{children:"Download OpenAI Evals JSONL"},"openai-evals")]}),e(rg,{datasetId:n.id}),e(ag,{}),e(Ir,{}),e(ng,{datasetId:n.id,onAddExampleCompleted:()=>{t({title:"Example added",message:"The example has been added successfully and the version has been updated."}),l()}})]})]})}),s(Te,{onChange:r,defaultIndex:c,children:[e(J,{name:"Experiments",extra:e(Me,{children:n.experimentCount}),children:e(u.Suspense,{children:e(Pe,{})})}),e(J,{name:"Examples",extra:e(Me,{children:n.exampleCount}),children:e(u.Suspense,{children:e(Pe,{})})})]})]})}const Lr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},i={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},t,{alias:null,args:null,kind:"ScalarField",name:"exampleCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"experimentCount",storageKey:null},{alias:"latestVersions",args:[{kind:"Literal",name:"first",value:1},{kind:"Literal",name:"sort",value:{col:"createdAt",dir:"desc"}}],concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"version",args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[l,t,{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'versions(first:1,sort:{"col":"createdAt","dir":"desc"})'}],type:"Dataset",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"datasetLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,i],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"datasetLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,i],storageKey:null}]},params:{cacheID:"5b221627cf7e63f41fbec41027cc0951",id:null,metadata:{},name:"datasetLoaderQuery",operationKind:"query",text:`query datasetLoaderQuery(
2502
+ `;function sg({dataset:n}){const a=n.id,t=Sn(d=>d.refreshLatestVersion),l=oe(),i=Y(),r=u.useCallback(d=>{d===0?i(`/datasets/${a}/experiments`):d===1&&i(`/datasets/${a}/examples`)},[i,a]),c=Js().pathname.includes("examples")?1:0;return s("main",{css:rg,children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-200",paddingBottom:"size-50",flex:"none",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(h,{direction:"column",justifyContent:"space-between",children:e(h,{direction:"row",gap:"size-200",alignItems:"center",children:s(h,{direction:"column",children:[e(K,{elementType:"h1",textSize:"xlarge",weight:"heavy",children:n.name}),e(K,{color:"text-700",children:n.description||"--"})]})})}),s(h,{direction:"row",gap:"size-100",children:[s(ln,{align:"end",icon:e(w,{svg:e(L.DownloadOutline,{})}),onAction:d=>{switch(d){case"csv":window.open(`/v1/datasets/${n.id}/csv`,"_blank");break;case"openai-ft":window.open(`/v1/datasets/${n.id}/jsonl/openai_ft`,"_blank");break;case"openai-evals":window.open(`/v1/datasets/${n.id}/jsonl/openai_evals`,"_blank");break}},children:[e(U,{children:"Download CSV"},"csv"),e(U,{children:"Download OpenAI Fine-Tuning JSONL"},"openai-ft"),e(U,{children:"Download OpenAI Evals JSONL"},"openai-evals")]}),e(Ym,{datasetId:n.id}),e(Wm,{}),e(Ir,{}),e(Gm,{datasetId:n.id,onAddExampleCompleted:()=>{l({title:"Example added",message:"The example has been added successfully and the version has been updated."}),t()}})]})]})}),s(Pe,{onChange:r,defaultIndex:c,children:[e(J,{name:"Experiments",extra:e(Me,{children:n.experimentCount}),children:e(u.Suspense,{children:e(_e,{})})}),e(J,{name:"Examples",extra:e(Me,{children:n.exampleCount}),children:e(u.Suspense,{children:e(_e,{})})})]})]})}const Pr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},i={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},l,{alias:null,args:null,kind:"ScalarField",name:"exampleCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"experimentCount",storageKey:null},{alias:"latestVersions",args:[{kind:"Literal",name:"first",value:1},{kind:"Literal",name:"sort",value:{col:"createdAt",dir:"desc"}}],concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"version",args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'versions(first:1,sort:{"col":"createdAt","dir":"desc"})'}],type:"Dataset",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"datasetLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,i],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"datasetLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,i],storageKey:null}]},params:{cacheID:"5b221627cf7e63f41fbec41027cc0951",id:null,metadata:{},name:"datasetLoaderQuery",operationKind:"query",text:`query datasetLoaderQuery(
2685
2503
  $id: GlobalID!
2686
2504
  ) {
2687
2505
  dataset: node(id: $id) {
@@ -2705,7 +2523,7 @@ dataset = client.get_dataset(name="${n}"${a?`, version_id="${a.id}"`:""})`,[n,a]
2705
2523
  }
2706
2524
  }
2707
2525
  }
2708
- `}}}();Lr.hash="469da2debdebd608c88a6ef83c2540aa";async function ef(n){const{datasetId:a}=n.params;return await D.fetchQuery(xe,Lr,{id:a}).toPromise()}const Pr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"exampleId"}],a=[{kind:"Variable",name:"id",variableName:"exampleId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},i={alias:"latestRevision",args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},t,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},o={alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"span",plural:!1,selections:[l,{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[r],storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[l],storageKey:null}],storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},d=[{kind:"Literal",name:"first",value:100}],g={alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"projectId",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExampleDetailsDialogQuery",selections:[{alias:"example",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[l,i,o],type:"DatasetExample",abstractKey:null},{args:null,kind:"FragmentSpread",name:"ExampleExperimentRunsTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExampleDetailsDialogQuery",selections:[{alias:"example",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[c,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,o,{alias:null,args:d,concreteType:"ExperimentRunConnection",kind:"LinkedField",name:"experimentRuns",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"run",args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},t,g,{alias:null,args:null,concreteType:"ExperimentRunAnnotationConnection",kind:"LinkedField",name:"annotations",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunAnnotationEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"annotation",args:null,concreteType:"ExperimentRunAnnotation",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},g],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[c],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"experimentRuns(first:100)"},{alias:null,args:d,filters:null,handle:"connection",key:"ExampleExperimentRunsTable_experimentRuns",kind:"LinkedHandle",name:"experimentRuns"}],type:"DatasetExample",abstractKey:null}],storageKey:null}]},params:{cacheID:"6fa23dc80c23ecdf48e57d139d76a721",id:null,metadata:{},name:"ExampleDetailsDialogQuery",operationKind:"query",text:`query ExampleDetailsDialogQuery(
2526
+ `}}}();Pr.hash="469da2debdebd608c88a6ef83c2540aa";async function mf(n){const{datasetId:a}=n.params;return await I.fetchQuery(xe,Pr,{id:a}).toPromise()}const Lr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"exampleId"}],a=[{kind:"Variable",name:"id",variableName:"exampleId"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},i={alias:"latestRevision",args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},l,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},o={alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"span",plural:!1,selections:[t,{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[r],storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[t],storageKey:null}],storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},d=[{kind:"Literal",name:"first",value:100}],g={alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"projectId",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExampleDetailsDialogQuery",selections:[{alias:"example",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[t,i,o],type:"DatasetExample",abstractKey:null},{args:null,kind:"FragmentSpread",name:"ExampleExperimentRunsTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExampleDetailsDialogQuery",selections:[{alias:"example",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[c,{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[i,o,{alias:null,args:d,concreteType:"ExperimentRunConnection",kind:"LinkedField",name:"experimentRuns",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"run",args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},l,g,{alias:null,args:null,concreteType:"ExperimentRunAnnotationConnection",kind:"LinkedField",name:"annotations",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunAnnotationEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"annotation",args:null,concreteType:"ExperimentRunAnnotation",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},g],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[c],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"experimentRuns(first:100)"},{alias:null,args:d,filters:null,handle:"connection",key:"ExampleExperimentRunsTable_experimentRuns",kind:"LinkedHandle",name:"experimentRuns"}],type:"DatasetExample",abstractKey:null}],storageKey:null}]},params:{cacheID:"6fa23dc80c23ecdf48e57d139d76a721",id:null,metadata:{},name:"ExampleDetailsDialogQuery",operationKind:"query",text:`query ExampleDetailsDialogQuery(
2709
2527
  $exampleId: GlobalID!
2710
2528
  ) {
2711
2529
  example: node(id: $exampleId) {
@@ -2775,14 +2593,14 @@ fragment ExampleExperimentRunsTableFragment on DatasetExample {
2775
2593
  }
2776
2594
  id
2777
2595
  }
2778
- `}}}();Pr.hash="65b1c049bacc1ef8739c61af32a9414c";const wr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"patchDatasetExamples",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"EditExampleDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"EditExampleDialogMutation",selections:a},params:{cacheID:"7217082d3d3796ecb60481d17133c351",id:null,metadata:{},name:"EditExampleDialogMutation",operationKind:"mutation",text:`mutation EditExampleDialogMutation(
2596
+ `}}}();Lr.hash="65b1c049bacc1ef8739c61af32a9414c";const wr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"patchDatasetExamples",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"EditExampleDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"EditExampleDialogMutation",selections:a},params:{cacheID:"7217082d3d3796ecb60481d17133c351",id:null,metadata:{},name:"EditExampleDialogMutation",operationKind:"mutation",text:`mutation EditExampleDialogMutation(
2779
2597
  $input: PatchDatasetExamplesInput!
2780
2598
  ) {
2781
2599
  patchDatasetExamples(input: $input) {
2782
2600
  __typename
2783
2601
  }
2784
2602
  }
2785
- `}}}();wr.hash="a5e0e601ed24ffaa37a99ba358f960d3";const Va={backgroundColor:"light",borderColor:"light",collapsible:!0,bodyStyle:{padding:0}};function yg(n){const{exampleId:a,onCompleted:l}=n,[t,i]=u.useState(null),[r,o]=D.useMutation(wr),{control:c,setError:d,handleSubmit:g,formState:{isValid:f}}=Ie({defaultValues:n.currentRevision}),m=u.useCallback(p=>{if(i(null),!Oe(p==null?void 0:p.input))return d("input",{message:"Input must be a valid JSON object"});if(!Oe(p==null?void 0:p.output))return d("output",{message:"Output must be a valid JSON object"});if(!Oe(p==null?void 0:p.metadata))return d("metadata",{message:"Metadata must be a valid JSON object"});r({variables:{input:{patches:[{exampleId:a,input:JSON.parse(p.input),output:JSON.parse(p.output),metadata:JSON.parse(p.metadata)}],versionDescription:p.description}},onCompleted:()=>{l()},onError:y=>{i(y.message)}})},[r,a,d,l]);return e(H,{size:"fullscreen",title:`Edit Example: ${a}`,extra:e(M,{variant:"primary",size:"compact",disabled:!f||o,loading:o,onClick:g(m),children:"Save Changes"}),children:e("div",{css:C`
2603
+ `}}}();wr.hash="a5e0e601ed24ffaa37a99ba358f960d3";const $a={backgroundColor:"light",borderColor:"light",collapsible:!0,bodyStyle:{padding:0}};function og(n){const{exampleId:a,onCompleted:t}=n,[l,i]=u.useState(null),[r,o]=I.useMutation(wr),{control:c,setError:d,handleSubmit:g,formState:{isValid:f}}=Ae({defaultValues:n.currentRevision}),m=u.useCallback(p=>{if(i(null),!Oe(p==null?void 0:p.input))return d("input",{message:"Input must be a valid JSON object"});if(!Oe(p==null?void 0:p.output))return d("output",{message:"Output must be a valid JSON object"});if(!Oe(p==null?void 0:p.metadata))return d("metadata",{message:"Metadata must be a valid JSON object"});r({variables:{input:{patches:[{exampleId:a,input:JSON.parse(p.input),output:JSON.parse(p.output),metadata:JSON.parse(p.metadata)}],versionDescription:p.description}},onCompleted:()=>{t()},onError:y=>{i(y.message)}})},[r,a,d,t]);return e(B,{size:"fullscreen",title:`Edit Example: ${a}`,extra:e(N,{variant:"primary",size:"compact",disabled:!f||o,loading:o,onClick:g(m),children:"Save Changes"}),children:e("div",{css:v`
2786
2604
  overflow-y: auto;
2787
2605
  padding: var(--ac-global-dimension-size-400);
2788
2606
  /* Make widths configurable */
@@ -2793,7 +2611,7 @@ fragment ExampleExperimentRunsTableFragment on DatasetExample {
2793
2611
  width: 100%;
2794
2612
  }
2795
2613
  }
2796
- `,children:e(h,{direction:"row",justifyContent:"center",children:e(F,{width:"900px",paddingStart:"auto",paddingEnd:"auto",children:s(h,{direction:"column",gap:"size-200",children:[t?e(ne,{variant:"danger",children:t}):null,e(G,{control:c,name:"input",render:({field:{onChange:p,onBlur:y,value:b},fieldState:{invalid:k,error:S}})=>s(V,{title:"Input",subTitle:"The input to the LLM, retriever, program, etc.",...Va,children:[k?e(ne,{variant:"danger",banner:!0,children:S==null?void 0:S.message}):null,e(Re,{value:b,onChange:p,onBlur:y})]})}),e(G,{control:c,name:"output",render:({field:{onChange:p,onBlur:y,value:b},fieldState:{invalid:k,error:S}})=>s(V,{title:"Output",subTitle:"The output of the LLM or program to be used as an expected output",...Va,backgroundColor:"green-100",borderColor:"green-700",children:[k?e(ne,{variant:"danger",banner:!0,children:S==null?void 0:S.message}):null,e(Re,{value:b,onChange:p,onBlur:y})]})}),e(G,{control:c,name:"metadata",render:({field:{onChange:p,onBlur:y,value:b},fieldState:{invalid:k,error:S}})=>s(V,{title:"Metadata",subTitle:"All data from the span to use during experimentation or evaluation",...Va,children:[k?e(ne,{variant:"danger",banner:!0,children:S==null?void 0:S.message}):null,e(Re,{value:b,onChange:p,onBlur:y})]})}),e(G,{control:c,name:"description",render:({field:{onChange:p,onBlur:y,value:b},fieldState:{invalid:k,error:S}})=>e(ka,{label:"Revision Description",value:b,onChange:p,onBlur:y,errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",placeholder:"A description of the changes made in this revision. Will be displayed in the version history.",height:100})})]})})})})})}function fg(n){const{onCompleted:a,...l}=n,[t,i]=u.useState(null);return s(U,{children:[e(M,{variant:"default",size:"compact",icon:e(P,{svg:e(I.EditOutline,{})}),onClick:()=>i(e(yg,{...l,onCompleted:()=>{i(null),a()}})),children:"Edit Example"}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>i(null),children:t})]})}const Ar=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"projectId",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExampleExperimentRunsTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:l,kind:"FragmentSpread",name:"ExampleExperimentRunsTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExampleExperimentRunsTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:l,concreteType:"ExperimentRunConnection",kind:"LinkedField",name:"experimentRuns",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"run",args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},r,{alias:null,args:null,concreteType:"ExperimentRunAnnotationConnection",kind:"LinkedField",name:"annotations",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunAnnotationEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"annotation",args:null,concreteType:"ExperimentRunAnnotation",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},r],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:l,filters:null,handle:"connection",key:"ExampleExperimentRunsTable_experimentRuns",kind:"LinkedHandle",name:"experimentRuns"}],type:"DatasetExample",abstractKey:null}],storageKey:null}]},params:{cacheID:"2ec7ead16e6df0877bc47db0ed7c7553",id:null,metadata:{},name:"ExampleExperimentRunsTableQuery",operationKind:"query",text:`query ExampleExperimentRunsTableQuery(
2614
+ `,children:e(h,{direction:"row",justifyContent:"center",children:e(F,{width:"900px",paddingStart:"auto",paddingEnd:"auto",children:s(h,{direction:"column",gap:"size-200",children:[l?e(te,{variant:"danger",children:l}):null,e(Z,{control:c,name:"input",render:({field:{onChange:p,onBlur:y,value:k},fieldState:{invalid:S,error:C}})=>s($,{title:"Input",subTitle:"The input to the LLM, retriever, program, etc.",...$a,children:[S?e(te,{variant:"danger",banner:!0,children:C==null?void 0:C.message}):null,e(De,{value:k,onChange:p,onBlur:y})]})}),e(Z,{control:c,name:"output",render:({field:{onChange:p,onBlur:y,value:k},fieldState:{invalid:S,error:C}})=>s($,{title:"Output",subTitle:"The output of the LLM or program to be used as an expected output",...$a,backgroundColor:"green-100",borderColor:"green-700",children:[S?e(te,{variant:"danger",banner:!0,children:C==null?void 0:C.message}):null,e(De,{value:k,onChange:p,onBlur:y})]})}),e(Z,{control:c,name:"metadata",render:({field:{onChange:p,onBlur:y,value:k},fieldState:{invalid:S,error:C}})=>s($,{title:"Metadata",subTitle:"All data from the span to use during experimentation or evaluation",...$a,children:[S?e(te,{variant:"danger",banner:!0,children:C==null?void 0:C.message}):null,e(De,{value:k,onChange:p,onBlur:y})]})}),e(Z,{control:c,name:"description",render:({field:{onChange:p,onBlur:y,value:k},fieldState:{invalid:S,error:C}})=>e(at,{label:"Revision Description",value:k,onChange:p,onBlur:y,errorMessage:C==null?void 0:C.message,validationState:S?"invalid":"valid",placeholder:"A description of the changes made in this revision. Will be displayed in the version history.",height:100})})]})})})})})}function dg(n){const{onCompleted:a,...t}=n,[l,i]=u.useState(null);return s(H,{children:[e(N,{variant:"default",size:"compact",icon:e(w,{svg:e(L.EditOutline,{})}),onClick:()=>i(e(og,{...t,onCompleted:()=>{i(null),a()}})),children:"Edit Example"}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>i(null),children:l})]})}const _r=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"projectId",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExampleExperimentRunsTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:t,kind:"FragmentSpread",name:"ExampleExperimentRunsTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExampleExperimentRunsTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:t,concreteType:"ExperimentRunConnection",kind:"LinkedField",name:"experimentRuns",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"run",args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},r,{alias:null,args:null,concreteType:"ExperimentRunAnnotationConnection",kind:"LinkedField",name:"annotations",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunAnnotationEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"annotation",args:null,concreteType:"ExperimentRunAnnotation",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},r],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:t,filters:null,handle:"connection",key:"ExampleExperimentRunsTable_experimentRuns",kind:"LinkedHandle",name:"experimentRuns"}],type:"DatasetExample",abstractKey:null}],storageKey:null}]},params:{cacheID:"2ec7ead16e6df0877bc47db0ed7c7553",id:null,metadata:{},name:"ExampleExperimentRunsTableQuery",operationKind:"query",text:`query ExampleExperimentRunsTableQuery(
2797
2615
  $after: String = null
2798
2616
  $first: Int = 100
2799
2617
  $id: GlobalID!
@@ -2848,22 +2666,22 @@ fragment ExampleExperimentRunsTableFragment_2HEEH6 on DatasetExample {
2848
2666
  }
2849
2667
  id
2850
2668
  }
2851
- `}}}();Ar.hash="6ca0f938b309407e8c184a1c13d1c52d";const _r=function(){var n=["experimentRuns"],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"projectId",storageKey:null}],storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Ar,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"ExampleExperimentRunsTableFragment",selections:[{alias:"experimentRuns",args:null,concreteType:"ExperimentRunConnection",kind:"LinkedField",name:"__ExampleExperimentRunsTable_experimentRuns_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"run",args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},l,{alias:null,args:null,concreteType:"ExperimentRunAnnotationConnection",kind:"LinkedField",name:"annotations",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunAnnotationEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"annotation",args:null,concreteType:"ExperimentRunAnnotation",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},l],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},a],type:"DatasetExample",abstractKey:null}}();_r.hash="6ca0f938b309407e8c184a1c13d1c52d";const hg=100;function kg(){return e("tbody",{className:"is-empty",children:e("tr",{children:e("td",{colSpan:100,css:n=>C`
2669
+ `}}}();_r.hash="6ca0f938b309407e8c184a1c13d1c52d";const Er=function(){var n=["experimentRuns"],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"projectId",storageKey:null}],storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:_r,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"ExampleExperimentRunsTableFragment",selections:[{alias:"experimentRuns",args:null,concreteType:"ExperimentRunConnection",kind:"LinkedField",name:"__ExampleExperimentRunsTable_experimentRuns_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"run",args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},t,{alias:null,args:null,concreteType:"ExperimentRunAnnotationConnection",kind:"LinkedField",name:"annotations",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunAnnotationEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"annotation",args:null,concreteType:"ExperimentRunAnnotation",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},t],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},a],type:"DatasetExample",abstractKey:null}}();Er.hash="6ca0f938b309407e8c184a1c13d1c52d";const cg=100;function ug(){return e("tbody",{className:"is-empty",children:e("tr",{children:e("td",{colSpan:100,css:n=>v`
2852
2670
  text-align: center;
2853
2671
  padding: ${n.spacing.margin24}px ${n.spacing.margin24}px !important;
2854
- `,children:"No experiments have been run for this example."})})})}const bg=C`
2672
+ `,children:"No experiments have been run for this example."})})})}const mg=v`
2855
2673
  display: flex;
2856
2674
  flex-direction: row;
2857
2675
  align-items: center;
2858
2676
  color: var(--ac-global-color-primary);
2859
2677
  gap: var(--ac-global-dimension-size-50);
2860
- `;function Sg({example:n}){const a=u.useRef(null),l=Y(),{data:t,loadNext:i,hasNext:r,isLoadingNext:o}=D.usePaginationFragment(_r,n),c=u.useMemo(()=>t.experimentRuns.edges.map(y=>{let b=null;return y.run.startTime&&y.run.endTime&&(b=new Date(y.run.endTime).getTime()-new Date(y.run.startTime).getTime()),{...y.run,output:JSON.stringify(y.run.output),latencyMs:b}}),[t]),g=he({columns:[{header:"start time",accessorKey:"startTime",cell:Fe},{header:"output",accessorKey:"output",cell:y=>{var k;const b=(k=y.row.original)==null?void 0:k.error;return b!==null?e(K,{color:"danger",children:b}):e(me,{...y})}},{header:"latency",accessorKey:"latencyMs",cell:({getValue:y})=>{const b=y();return b===null||typeof b!="number"?"--":e(we,{latencyMs:b})}},{header:"evaluations",accessorKey:"annotations",cell:({row:y})=>e(h,{direction:"row",gap:"size-50",wrap:"wrap",children:y.original.annotations.edges.map((b,k)=>{const S=b.annotation;return e(ia,{annotation:S,extra:S.trace&&e(F,{paddingTop:"size-100",children:s("div",{css:bg,children:[e(P,{svg:e(I.InfoOutline,{})}),e("span",{children:"Click to view evaluator trace"})]})}),children:e(xn,{annotation:S,onClick:()=>{S.trace&&l(`/projects/${S.trace.projectId}/traces/${S.trace.traceId}`)}},k)},k)})})},{id:"actions",cell:({row:y})=>{const b=y.original.trace;if(b)return e(M,{variant:"default",size:"compact",icon:e(P,{svg:e(I.Trace,{})}),onClick:()=>{l(`/projects/${b.projectId}/traces/${b.traceId}`)},"aria-label":"view trace"})}}],data:c,getCoreRowModel:ke()}),f=g.getRowModel().rows,m=f.length===0,p=u.useCallback(y=>{if(y){const{scrollHeight:b,scrollTop:k,clientHeight:S}=y;b-k-S<300&&!o&&r&&i(hg)}},[r,o,i]);return e("div",{css:C`
2678
+ `;function gg({example:n}){const a=u.useRef(null),t=Y(),{data:l,loadNext:i,hasNext:r,isLoadingNext:o}=I.usePaginationFragment(Er,n),c=u.useMemo(()=>l.experimentRuns.edges.map(y=>{let k=null;return y.run.startTime&&y.run.endTime&&(k=new Date(y.run.endTime).getTime()-new Date(y.run.startTime).getTime()),{...y.run,output:JSON.stringify(y.run.output),latencyMs:k}}),[l]),g=ke({columns:[{header:"start time",accessorKey:"startTime",cell:Fe},{header:"output",accessorKey:"output",cell:y=>{var S;const k=(S=y.row.original)==null?void 0:S.error;return k!==null?e(K,{color:"danger",children:k}):e(me,{...y})}},{header:"latency",accessorKey:"latencyMs",cell:({getValue:y})=>{const k=y();return k===null||typeof k!="number"?"--":e(Ee,{latencyMs:k})}},{header:"evaluations",accessorKey:"annotations",cell:({row:y})=>e(h,{direction:"row",gap:"size-50",wrap:"wrap",children:y.original.annotations.edges.map((k,S)=>{const C=k.annotation;return e(ra,{annotation:C,extra:C.trace&&e(F,{paddingTop:"size-100",children:s("div",{css:mg,children:[e(w,{svg:e(L.InfoOutline,{})}),e("span",{children:"Click to view evaluator trace"})]})}),children:e(xn,{annotation:C,onClick:()=>{C.trace&&t(`/projects/${C.trace.projectId}/traces/${C.trace.traceId}`)}},S)},S)})})},{id:"actions",cell:({row:y})=>{const k=y.original.trace;if(k)return e(N,{variant:"default",size:"compact",icon:e(w,{svg:e(L.Trace,{})}),onClick:()=>{t(`/projects/${k.projectId}/traces/${k.traceId}`)},"aria-label":"view trace"})}}],data:c,getCoreRowModel:be()}),f=g.getRowModel().rows,m=f.length===0,p=u.useCallback(y=>{if(y){const{scrollHeight:k,scrollTop:S,clientHeight:C}=y;k-S-C<300&&!o&&r&&i(cg)}},[r,o,i]);return e("div",{css:v`
2861
2679
  flex: 1 1 auto;
2862
2680
  overflow: auto;
2863
- `,ref:a,onScroll:y=>p(y.target),children:s("table",{css:jn,children:[e("thead",{children:g.getHeaderGroups().map(y=>e("tr",{children:y.headers.map(b=>e("th",{children:e("div",{children:Z(b.column.columnDef.header,b.getContext())})},b.id))},y.id))}),m?e(kg,{}):e("tbody",{children:f.map(y=>e("tr",{children:y.getVisibleCells().map(b=>e("td",{children:Z(b.column.columnDef.cell,b.getContext())},b.id))},y.id))})]})})}function Er({exampleId:n,onDismiss:a}){const[l,t]=u.useState(0),i=D.useLazyLoadQuery(Pr,{exampleId:n},{fetchKey:l,fetchPolicy:"store-and-network"}),r=u.useMemo(()=>{const p=i.example.latestRevision;return{input:JSON.stringify(p==null?void 0:p.input,null,2),output:JSON.stringify(p==null?void 0:p.output,null,2),metadata:JSON.stringify(p==null?void 0:p.metadata,null,2)}},[i]),o=u.useMemo(()=>{const p=i.example.span;return p?{id:p.id,traceId:p.context.traceId,projectId:p.project.id}:null},[i]),{input:c,output:d,metadata:g}=r,f=Y(),m=oe();return e(W,{type:"slideOver",isDismissable:!0,onDismiss:a,children:e(H,{size:"XL",title:`Example: ${n}`,extra:s(h,{direction:"row",gap:"size-100",children:[o?e(M,{variant:"default",size:"compact",onClick:()=>{f(`/projects/${o.projectId}/traces/${o.traceId}?selectedSpanNodeId=${o.id}`)},children:"View Source Span"}):null,e(fg,{exampleId:n,currentRevision:r,onCompleted:()=>{m({title:"Example updated",message:`Example ${n} has been updated.`}),t(p=>p+1)}})]}),children:s(Xe,{direction:"vertical",autoSaveId:"example-panel-group",children:[e(ue,{defaultSize:200,children:e("div",{css:C`
2681
+ `,ref:a,onScroll:y=>p(y.target),children:s("table",{css:Hn,children:[e("thead",{children:g.getHeaderGroups().map(y=>e("tr",{children:y.headers.map(k=>e("th",{children:e("div",{children:X(k.column.columnDef.header,k.getContext())})},k.id))},y.id))}),m?e(ug,{}):e("tbody",{children:f.map(y=>e("tr",{children:y.getVisibleCells().map(k=>e("td",{children:X(k.column.columnDef.cell,k.getContext())},k.id))},y.id))})]})})}function Ar({exampleId:n,onDismiss:a}){const[t,l]=u.useState(0),i=I.useLazyLoadQuery(Lr,{exampleId:n},{fetchKey:t,fetchPolicy:"store-and-network"}),r=u.useMemo(()=>{const p=i.example.latestRevision;return{input:JSON.stringify(p==null?void 0:p.input,null,2),output:JSON.stringify(p==null?void 0:p.output,null,2),metadata:JSON.stringify(p==null?void 0:p.metadata,null,2)}},[i]),o=u.useMemo(()=>{const p=i.example.span;return p?{id:p.id,traceId:p.context.traceId,projectId:p.project.id}:null},[i]),{input:c,output:d,metadata:g}=r,f=Y(),m=oe();return e(W,{type:"slideOver",isDismissable:!0,onDismiss:a,children:e(B,{size:"XL",title:`Example: ${n}`,extra:s(h,{direction:"row",gap:"size-100",children:[o?e(N,{variant:"default",size:"compact",onClick:()=>{f(`/projects/${o.projectId}/traces/${o.traceId}?selectedSpanNodeId=${o.id}`)},children:"View Source Span"}):null,e(dg,{exampleId:n,currentRevision:r,onCompleted:()=>{m({title:"Example updated",message:`Example ${n} has been updated.`}),l(p=>p+1)}})]}),children:s(Xe,{direction:"vertical",autoSaveId:"example-panel-group",children:[e(ue,{defaultSize:200,children:e("div",{css:v`
2864
2682
  overflow-y: auto;
2865
2683
  height: 100%;
2866
- `,children:e(h,{direction:"row",justifyContent:"center",children:e(F,{width:"900px",paddingStart:"auto",paddingEnd:"auto",paddingTop:"size-200",paddingBottom:"size-200",children:s(h,{direction:"column",gap:"size-200",children:[e(V,{title:"Input",...za,extra:e(le,{text:c}),children:e(fn,{value:c})}),e(V,{title:"Output",...za,extra:e(le,{text:d}),children:e(fn,{value:d})}),e(V,{title:"Metadata",...za,extra:e(le,{text:g}),children:e(fn,{value:g})})]})})})})}),e(Ye,{css:Kn}),e(ue,{defaultSize:100,children:s(h,{direction:"column",height:"100%",children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderBottomColor:"dark",borderBottomWidth:"thin",flex:"none",children:e(re,{level:3,children:"Experiment Runs"})}),e(Sg,{example:i.example})]})})]})})})}const za={backgroundColor:"light",borderColor:"light",variant:"compact",collapsible:!0,bodyStyle:{padding:0}};function nf(){const{exampleId:n,datasetId:a}=ln(),l=Y();return e(Er,{exampleId:n,onDismiss:()=>{l(`/datasets/${a}/examples`)}})}const Rr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i=[{kind:"Literal",name:"first",value:100}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"examplesLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{args:null,kind:"FragmentSpread",name:"ExamplesTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"examplesLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,l,{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"DatasetExampleConnection",kind:"LinkedField",name:"examples",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetExampleEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"example",args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"examples(first:100)"},{alias:null,args:i,filters:["datasetVersionId"],handle:"connection",key:"ExamplesTable_examples",kind:"LinkedHandle",name:"examples"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"7e303fa9a3c09ccd6a3dc1f3dbb2afb3",id:null,metadata:{},name:"examplesLoaderQuery",operationKind:"query",text:`query examplesLoaderQuery(
2684
+ `,children:e(h,{direction:"row",justifyContent:"center",children:e(F,{width:"900px",paddingStart:"auto",paddingEnd:"auto",paddingTop:"size-200",paddingBottom:"size-200",children:s(h,{direction:"column",gap:"size-200",children:[e($,{title:"Input",...Oa,extra:e(ae,{text:c}),children:e(yn,{value:c})}),e($,{title:"Output",...Oa,extra:e(ae,{text:d}),children:e(yn,{value:d})}),e($,{title:"Metadata",...Oa,extra:e(ae,{text:g}),children:e(yn,{value:g})})]})})})})}),e(Ye,{css:Kn}),e(ue,{defaultSize:100,children:s(h,{direction:"column",height:"100%",children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderBottomColor:"dark",borderBottomWidth:"thin",flex:"none",children:e(se,{level:3,children:"Experiment Runs"})}),e(gg,{example:i.example})]})})]})})})}const Oa={backgroundColor:"light",borderColor:"light",variant:"compact",collapsible:!0,bodyStyle:{padding:0}};function gf(){const{exampleId:n,datasetId:a}=tn(),t=Y();return e(Ar,{exampleId:n,onDismiss:()=>{t(`/datasets/${a}/examples`)}})}const Rr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i=[{kind:"Literal",name:"first",value:100}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"examplesLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{args:null,kind:"FragmentSpread",name:"ExamplesTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"examplesLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t,{kind:"InlineFragment",selections:[{alias:null,args:i,concreteType:"DatasetExampleConnection",kind:"LinkedField",name:"examples",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetExampleEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"example",args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"examples(first:100)"},{alias:null,args:i,filters:["datasetVersionId"],handle:"connection",key:"ExamplesTable_examples",kind:"LinkedHandle",name:"examples"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"7e303fa9a3c09ccd6a3dc1f3dbb2afb3",id:null,metadata:{},name:"examplesLoaderQuery",operationKind:"query",text:`query examplesLoaderQuery(
2867
2685
  $id: GlobalID!
2868
2686
  ) {
2869
2687
  dataset: node(id: $id) {
@@ -2896,7 +2714,7 @@ fragment ExamplesTableFragment on Dataset {
2896
2714
  }
2897
2715
  id
2898
2716
  }
2899
- `}}}();Rr.hash="6406bbf43a2e850b384ba9573d8e69de";async function af(n){const{datasetId:a}=n.params;return await D.fetchQuery(xe,Rr,{id:a}).toPromise()}const Mr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"datasetVersionId"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"datasetVersionId",variableName:"datasetVersionId"},{kind:"Variable",name:"first",variableName:"first"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExamplesTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:l,kind:"FragmentSpread",name:"ExamplesTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExamplesTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:l,concreteType:"DatasetExampleConnection",kind:"LinkedField",name:"examples",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetExampleEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"example",args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:l,filters:["datasetVersionId"],handle:"connection",key:"ExamplesTable_examples",kind:"LinkedHandle",name:"examples"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"ca59c018695d41ca01b5f9d453386886",id:null,metadata:{},name:"ExamplesTableQuery",operationKind:"query",text:`query ExamplesTableQuery(
2717
+ `}}}();Rr.hash="6406bbf43a2e850b384ba9573d8e69de";async function pf(n){const{datasetId:a}=n.params;return await I.fetchQuery(xe,Rr,{id:a}).toPromise()}const Mr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"datasetVersionId"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"datasetVersionId",variableName:"datasetVersionId"},{kind:"Variable",name:"first",variableName:"first"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExamplesTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:t,kind:"FragmentSpread",name:"ExamplesTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExamplesTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:t,concreteType:"DatasetExampleConnection",kind:"LinkedField",name:"examples",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetExampleEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"example",args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:t,filters:["datasetVersionId"],handle:"connection",key:"ExamplesTable_examples",kind:"LinkedHandle",name:"examples"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"ca59c018695d41ca01b5f9d453386886",id:null,metadata:{},name:"ExamplesTableQuery",operationKind:"query",text:`query ExamplesTableQuery(
2900
2718
  $after: String = null
2901
2719
  $datasetVersionId: GlobalID
2902
2720
  $first: Int = 100
@@ -2933,7 +2751,7 @@ fragment ExamplesTableFragment_4a6F8Z on Dataset {
2933
2751
  }
2934
2752
  id
2935
2753
  }
2936
- `}}}();Mr.hash="e04e697cdb44ab2dd115f4562211f6a4";const Nr=function(){var n=["examples"],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"datasetVersionId"},{defaultValue:100,kind:"LocalArgument",name:"first"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Mr,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"ExamplesTableFragment",selections:[{alias:"examples",args:[{kind:"Variable",name:"datasetVersionId",variableName:"datasetVersionId"}],concreteType:"DatasetExampleConnection",kind:"LinkedField",name:"__ExamplesTable_examples_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetExampleEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"example",args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},a],type:"Dataset",abstractKey:null}}();Nr.hash="e04e697cdb44ab2dd115f4562211f6a4";const Vr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"deleteDatasetExamples",plural:!1,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"dataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExampleSelectionToolbarDeleteExamplesMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExampleSelectionToolbarDeleteExamplesMutation",selections:a},params:{cacheID:"b63159f3c325b9af3dc469692f9329e5",id:null,metadata:{},name:"ExampleSelectionToolbarDeleteExamplesMutation",operationKind:"mutation",text:`mutation ExampleSelectionToolbarDeleteExamplesMutation(
2754
+ `}}}();Mr.hash="e04e697cdb44ab2dd115f4562211f6a4";const Nr=function(){var n=["examples"],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"datasetVersionId"},{defaultValue:100,kind:"LocalArgument",name:"first"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Mr,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"ExamplesTableFragment",selections:[{alias:"examples",args:[{kind:"Variable",name:"datasetVersionId",variableName:"datasetVersionId"}],concreteType:"DatasetExampleConnection",kind:"LinkedField",name:"__ExamplesTable_examples_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetExampleEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"example",args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},a],type:"Dataset",abstractKey:null}}();Nr.hash="e04e697cdb44ab2dd115f4562211f6a4";const zr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"deleteDatasetExamples",plural:!1,selections:[{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"dataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExampleSelectionToolbarDeleteExamplesMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExampleSelectionToolbarDeleteExamplesMutation",selections:a},params:{cacheID:"b63159f3c325b9af3dc469692f9329e5",id:null,metadata:{},name:"ExampleSelectionToolbarDeleteExamplesMutation",operationKind:"mutation",text:`mutation ExampleSelectionToolbarDeleteExamplesMutation(
2937
2755
  $input: DeleteDatasetExamplesInput!
2938
2756
  ) {
2939
2757
  deleteDatasetExamples(input: $input) {
@@ -2942,15 +2760,15 @@ fragment ExamplesTableFragment_4a6F8Z on Dataset {
2942
2760
  }
2943
2761
  }
2944
2762
  }
2945
- `}}}();Vr.hash="455bf9e5dc4b9cc655095dc829ef7e12";function vg(n){const a=vn(y=>y.refreshLatestVersion),{selectedExamples:l,onExamplesDeleted:t,onClearSelection:i}=n,[r,o]=u.useState(null),c=oe(),d=ce(),[g,f]=D.useMutation(Vr),m=l.length!==1,p=u.useCallback(()=>{g({variables:{input:{exampleIds:l.map(y=>y.id)}},onCompleted:()=>{c({title:"Examples Deleted",message:`${l.length} example${m?"s":""} have been deleted.`}),t(),i(),a()},onError:y=>{d({title:"An error occurred",message:`Failed to delete examples: ${y.message}`})}})},[g,l,c,m,t,i,a,d]);return s("div",{css:C`
2763
+ `}}}();zr.hash="455bf9e5dc4b9cc655095dc829ef7e12";function pg(n){const a=Sn(y=>y.refreshLatestVersion),{selectedExamples:t,onExamplesDeleted:l,onClearSelection:i}=n,[r,o]=u.useState(null),c=oe(),d=ce(),[g,f]=I.useMutation(zr),m=t.length!==1,p=u.useCallback(()=>{g({variables:{input:{exampleIds:t.map(y=>y.id)}},onCompleted:()=>{c({title:"Examples Deleted",message:`${t.length} example${m?"s":""} have been deleted.`}),l(),i(),a()},onError:y=>{d({title:"An error occurred",message:`Failed to delete examples: ${y.message}`})}})},[g,t,c,m,l,i,a,d]);return s("div",{css:v`
2946
2764
  position: absolute;
2947
2765
  bottom: var(--ac-global-dimension-size-400);
2948
2766
  left: 50%;
2949
2767
  transform: translateX(-50%);
2950
- `,children:[e(F,{backgroundColor:"light",padding:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"medium",minWidth:"size-6000",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(K,{children:`${l.length} example${m?"s":""} selected`}),s(h,{direction:"row",gap:"size-100",children:[e(M,{variant:"default",size:"compact",onClick:i,children:"Cancel"}),e(M,{variant:"danger",size:"compact",icon:e(P,{svg:e(I.TrashOutline,{})}),loading:f,disabled:f,onClick:p,children:f?"Deleting...":"Delete Example"+(m?"s":"")})]})]})}),e(W,{onDismiss:()=>{o(null)},children:r})]})}const Cg=100;function Fg({dataset:n}){const a=vn(A=>A.latestVersion),l=u.useRef(null),[t,i]=Ke.useState({}),{data:r,loadNext:o,hasNext:c,isLoadingNext:d,refetch:g}=D.usePaginationFragment(Nr,n);u.useEffect(()=>{u.startTransition(()=>{g({datasetVersionId:(a==null?void 0:a.id)||null},{fetchPolicy:"store-and-network"})})},[a,g]);const f=u.useMemo(()=>r.examples.edges.map(A=>{const x=A.example,T=x.revision;return{id:x.id,input:T.input,output:T.output,metadata:T.metadata}}),[r]),p=he({columns:[{id:"select",header:({table:A})=>e(en,{checked:A.getIsAllRowsSelected(),indeterminate:A.getIsSomeRowsSelected(),onChange:A.getToggleAllRowsSelectedHandler()}),cell:({row:A})=>e(en,{checked:A.getIsSelected(),disabled:!A.getCanSelect(),indeterminate:A.getIsSomeSelected(),onChange:A.getToggleSelectedHandler()})},{header:"example id",accessorKey:"id",cell:({getValue:A,row:x})=>{const T=x.original.id;return e(Ze,{to:`${T}`,children:A()})}},{header:"input",accessorKey:"input",cell:_n},{header:"output",accessorKey:"output",cell:_n},{header:"metadata",accessorKey:"metadata",cell:_n}],data:f,state:{rowSelection:t},onRowSelectionChange:i,getCoreRowModel:ke()}),y=p.getRowModel().rows,b=y.length===0,k=p.getSelectedRowModel().rows,S=k.map(A=>A.original),v=u.useCallback(()=>{i({})},[i]),w=u.useCallback(A=>{if(A){const{scrollHeight:x,scrollTop:T,clientHeight:E}=A;x-T-E<300&&!d&&c&&o(Cg)}},[c,d,o]),L=Y();return s("div",{css:C`
2768
+ `,children:[e(F,{backgroundColor:"light",padding:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"medium",minWidth:"size-6000",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(K,{children:`${t.length} example${m?"s":""} selected`}),s(h,{direction:"row",gap:"size-100",children:[e(N,{variant:"default",size:"compact",onClick:i,children:"Cancel"}),e(N,{variant:"danger",size:"compact",icon:e(w,{svg:e(L.TrashOutline,{})}),loading:f,disabled:f,onClick:p,children:f?"Deleting...":"Delete Example"+(m?"s":"")})]})]})}),e(W,{onDismiss:()=>{o(null)},children:r})]})}const yg=100;function fg({dataset:n}){const a=Sn(_=>_.latestVersion),t=u.useRef(null),[l,i]=Ke.useState({}),{data:r,loadNext:o,hasNext:c,isLoadingNext:d,refetch:g}=I.usePaginationFragment(Nr,n);u.useEffect(()=>{u.startTransition(()=>{g({datasetVersionId:(a==null?void 0:a.id)||null},{fetchPolicy:"store-and-network"})})},[a,g]);const f=u.useMemo(()=>r.examples.edges.map(_=>{const x=_.example,D=x.revision;return{id:x.id,input:D.input,output:D.output,metadata:D.metadata}}),[r]),p=ke({columns:[{id:"select",header:({table:_})=>e(en,{checked:_.getIsAllRowsSelected(),indeterminate:_.getIsSomeRowsSelected(),onChange:_.getToggleAllRowsSelectedHandler()}),cell:({row:_})=>e(en,{checked:_.getIsSelected(),disabled:!_.getCanSelect(),indeterminate:_.getIsSomeSelected(),onChange:_.getToggleSelectedHandler()})},{header:"example id",accessorKey:"id",cell:({getValue:_,row:x})=>{const D=x.original.id;return e(We,{to:`${D}`,children:_()})}},{header:"input",accessorKey:"input",cell:An},{header:"output",accessorKey:"output",cell:An},{header:"metadata",accessorKey:"metadata",cell:An}],data:f,state:{rowSelection:l},onRowSelectionChange:i,getCoreRowModel:be()}),y=p.getRowModel().rows,k=y.length===0,S=p.getSelectedRowModel().rows,C=S.map(_=>_.original),b=u.useCallback(()=>{i({})},[i]),T=u.useCallback(_=>{if(_){const{scrollHeight:x,scrollTop:D,clientHeight:A}=_;x-D-A<300&&!d&&c&&o(yg)}},[c,d,o]),P=Y();return s("div",{css:v`
2951
2769
  flex: 1 1 auto;
2952
2770
  overflow: auto;
2953
- `,ref:l,onScroll:A=>w(A.target),children:[s("table",{css:jn,children:[e("thead",{children:p.getHeaderGroups().map(A=>e("tr",{children:A.headers.map(x=>e("th",{children:e("div",{children:Z(x.column.columnDef.header,x.getContext())})},x.id))},A.id))}),b?e(Je,{}):e("tbody",{children:y.map(A=>e("tr",{onClick:()=>{L(`${A.original.id}`)},children:A.getVisibleCells().map(x=>e("td",{children:Z(x.column.columnDef.cell,x.getContext())},x.id))},A.id))})]}),k.length?e(vg,{selectedExamples:S,onClearSelection:v,onExamplesDeleted:()=>{g({},{fetchPolicy:"store-and-network"})}}):null]})}function lf(){const n=Cn();return s(U,{children:[e(Fg,{dataset:n.dataset})," ",e(u.Suspense,{children:e(Pe,{})})]})}const zr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"annotationName",storageKey:null},r=[{kind:"Literal",name:"first",value:100}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"experimentsLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"InlineFragment",selections:[{args:null,kind:"FragmentSpread",name:"ExperimentsTableFragment"}],type:"Dataset",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"experimentsLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,l,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"experimentAnnotationSummaries",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"minScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"maxScore",storageKey:null}],storageKey:null},{alias:null,args:r,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"errorRate",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"runCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averageRunLatencyMs",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[l],storageKey:null},{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"annotationSummaries",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"experiments(first:100)"},{alias:null,args:r,filters:null,handle:"connection",key:"ExperimentsTable_experiments",kind:"LinkedHandle",name:"experiments"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"91f92395f5df4858554b124deed3f47a",id:null,metadata:{},name:"experimentsLoaderQuery",operationKind:"query",text:`query experimentsLoaderQuery(
2771
+ `,ref:t,onScroll:_=>T(_.target),children:[s("table",{css:Hn,children:[e("thead",{children:p.getHeaderGroups().map(_=>e("tr",{children:_.headers.map(x=>e("th",{children:e("div",{children:X(x.column.columnDef.header,x.getContext())})},x.id))},_.id))}),k?e(Ge,{}):e("tbody",{children:y.map(_=>e("tr",{onClick:()=>{P(`${_.original.id}`)},children:_.getVisibleCells().map(x=>e("td",{children:X(x.column.columnDef.cell,x.getContext())},x.id))},_.id))})]}),S.length?e(pg,{selectedExamples:C,onClearSelection:b,onExamplesDeleted:()=>{g({},{fetchPolicy:"store-and-network"})}}):null]})}function yf(){const n=vn();return s(H,{children:[e(fg,{dataset:n.dataset})," ",e(u.Suspense,{children:e(_e,{})})]})}const Vr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"annotationName",storageKey:null},r=[{kind:"Literal",name:"first",value:100}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"experimentsLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineFragment",selections:[{args:null,kind:"FragmentSpread",name:"ExperimentsTableFragment"}],type:"Dataset",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"experimentsLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"experimentAnnotationSummaries",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"minScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"maxScore",storageKey:null}],storageKey:null},{alias:null,args:r,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"errorRate",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"runCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averageRunLatencyMs",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[t],storageKey:null},{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"annotationSummaries",plural:!0,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:"experiments(first:100)"},{alias:null,args:r,filters:null,handle:"connection",key:"ExperimentsTable_experiments",kind:"LinkedHandle",name:"experiments"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"91f92395f5df4858554b124deed3f47a",id:null,metadata:{},name:"experimentsLoaderQuery",operationKind:"query",text:`query experimentsLoaderQuery(
2954
2772
  $id: GlobalID!
2955
2773
  ) {
2956
2774
  dataset: node(id: $id) {
@@ -3000,7 +2818,7 @@ fragment ExperimentsTableFragment on Dataset {
3000
2818
  }
3001
2819
  id
3002
2820
  }
3003
- `}}}();zr.hash="1461484d9e1232cbb99e1251edabbec3";async function tf(n){const{datasetId:a}=n.params;return await D.fetchQuery(xe,zr,{id:a}).toPromise()}const $r=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"annotationName",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExperimentsTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:l,kind:"FragmentSpread",name:"ExperimentsTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExperimentsTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"experimentAnnotationSummaries",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"minScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"maxScore",storageKey:null}],storageKey:null},{alias:null,args:l,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"errorRate",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"runCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averageRunLatencyMs",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[i],storageKey:null},{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"annotationSummaries",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[t],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:l,filters:null,handle:"connection",key:"ExperimentsTable_experiments",kind:"LinkedHandle",name:"experiments"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"1db5ce5523fa9a472c91d093b0e6160e",id:null,metadata:{},name:"ExperimentsTableQuery",operationKind:"query",text:`query ExperimentsTableQuery(
2821
+ `}}}();Vr.hash="1461484d9e1232cbb99e1251edabbec3";async function ff(n){const{datasetId:a}=n.params;return await I.fetchQuery(xe,Vr,{id:a}).toPromise()}const $r=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"annotationName",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExperimentsTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:t,kind:"FragmentSpread",name:"ExperimentsTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExperimentsTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},i,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"experimentAnnotationSummaries",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"minScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"maxScore",storageKey:null}],storageKey:null},{alias:null,args:t,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"errorRate",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"runCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averageRunLatencyMs",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[i],storageKey:null},{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"annotationSummaries",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[l],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:t,filters:null,handle:"connection",key:"ExperimentsTable_experiments",kind:"LinkedHandle",name:"experiments"}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"1db5ce5523fa9a472c91d093b0e6160e",id:null,metadata:{},name:"ExperimentsTableQuery",operationKind:"query",text:`query ExperimentsTableQuery(
3004
2822
  $after: String = null
3005
2823
  $first: Int = 100
3006
2824
  $id: GlobalID!
@@ -3051,19 +2869,19 @@ fragment ExperimentsTableFragment_2HEEH6 on Dataset {
3051
2869
  }
3052
2870
  id
3053
2871
  }
3054
- `}}}();$r.hash="c7c7580fe40888ceb86a1701fe4eedf4";const Or=function(){var n=["experiments"],a={alias:null,args:null,kind:"ScalarField",name:"annotationName",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:$r,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"ExperimentsTableFragment",selections:[{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"experimentAnnotationSummaries",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"minScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"maxScore",storageKey:null}],storageKey:null},{alias:"experiments",args:null,concreteType:"ExperimentConnection",kind:"LinkedField",name:"__ExperimentsTable_experiments_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"errorRate",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"runCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averageRunLatencyMs",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[l],storageKey:null},{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"annotationSummaries",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},l],type:"Dataset",abstractKey:null}}();Or.hash="c7c7580fe40888ceb86a1701fe4eedf4";function Kg({getValue:n}){const a=n(),l=a!==null?a*100:null,t=u.useMemo(()=>{if(l!==null)return l>=80?"red-1100":l>0?"orange-1100":"green-1100"},[l]);return e(K,{color:t,children:Qa(l)})}const Qr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"ExperimentMutationPayload",kind:"LinkedField",name:"deleteExperiments",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExperimentSelectionToolbarDeleteExperimentsMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExperimentSelectionToolbarDeleteExperimentsMutation",selections:a},params:{cacheID:"3af24cbaf3208c0d5ad1cd9313dd3823",id:null,metadata:{},name:"ExperimentSelectionToolbarDeleteExperimentsMutation",operationKind:"mutation",text:`mutation ExperimentSelectionToolbarDeleteExperimentsMutation(
2872
+ `}}}();$r.hash="c7c7580fe40888ceb86a1701fe4eedf4";const Or=function(){var n=["experiments"],a={alias:null,args:null,kind:"ScalarField",name:"annotationName",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:100,kind:"LocalArgument",name:"first"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:$r,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"ExperimentsTableFragment",selections:[{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"experimentAnnotationSummaries",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"minScore",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"maxScore",storageKey:null}],storageKey:null},{alias:"experiments",args:null,concreteType:"ExperimentConnection",kind:"LinkedField",name:"__ExperimentsTable_experiments_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"errorRate",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"runCount",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"averageRunLatencyMs",storageKey:null},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[t],storageKey:null},{alias:null,args:null,concreteType:"ExperimentAnnotationSummary",kind:"LinkedField",name:"annotationSummaries",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},t],type:"Dataset",abstractKey:null}}();Or.hash="c7c7580fe40888ceb86a1701fe4eedf4";function hg({getValue:n}){const a=n(),t=a!==null?a*100:null,l=u.useMemo(()=>{if(t!==null)return t>=80?"red-1100":t>0?"orange-1100":"green-1100"},[t]);return e(K,{color:l,children:Ba(t)})}const Qr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"ExperimentMutationPayload",kind:"LinkedField",name:"deleteExperiments",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ExperimentSelectionToolbarDeleteExperimentsMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ExperimentSelectionToolbarDeleteExperimentsMutation",selections:a},params:{cacheID:"3af24cbaf3208c0d5ad1cd9313dd3823",id:null,metadata:{},name:"ExperimentSelectionToolbarDeleteExperimentsMutation",operationKind:"mutation",text:`mutation ExperimentSelectionToolbarDeleteExperimentsMutation(
3055
2873
  $input: DeleteExperimentsInput!
3056
2874
  ) {
3057
2875
  deleteExperiments(input: $input) {
3058
2876
  __typename
3059
2877
  }
3060
2878
  }
3061
- `}}}();Qr.hash="4ab310746eb51c6a3fcb799d2c972762";function xg(n){const a=Y(),[l,t]=u.useState(null),[i,r]=D.useMutation(Qr),{datasetId:o,selectedExperiments:c,onClearSelection:d,onExperimentsDeleted:g}=n,f=c.length!==1,m=oe(),p=ce(),y=u.useCallback(()=>{i({variables:{input:{experimentIds:c.map(k=>k.id)}},onCompleted:()=>{m({title:"Examples Deleted",message:`${c.length} experiment${f?"s":""} have been deleted.`}),g(),d()},onError:k=>{p({title:"An error occurred",message:`Failed to delete examples: ${k.message}`})}})},[i,f,p,m,d,g,c]),b=u.useCallback(()=>{t(s(H,{size:"S",title:"Delete Experiments",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:"Are you sure you want to delete these experiments? This will also delete all associated annotations and traces, and it cannot be undone."})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(M,{variant:"danger",onClick:()=>{y(),t(null)},children:"Delete Experiments"})})})]}))},[y]);return s("div",{css:C`
2879
+ `}}}();Qr.hash="4ab310746eb51c6a3fcb799d2c972762";function kg(n){const a=Y(),[t,l]=u.useState(null),[i,r]=I.useMutation(Qr),{datasetId:o,selectedExperiments:c,onClearSelection:d,onExperimentsDeleted:g}=n,f=c.length!==1,m=oe(),p=ce(),y=u.useCallback(()=>{i({variables:{input:{experimentIds:c.map(S=>S.id)}},onCompleted:()=>{m({title:"Examples Deleted",message:`${c.length} experiment${f?"s":""} have been deleted.`}),g(),d()},onError:S=>{p({title:"An error occurred",message:`Failed to delete examples: ${S.message}`})}})},[i,f,p,m,d,g,c]),k=u.useCallback(()=>{l(s(B,{size:"S",title:"Delete Experiments",children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:"Are you sure you want to delete these experiments? This will also delete all associated annotations and traces, and it cannot be undone."})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(h,{direction:"row",justifyContent:"end",children:e(N,{variant:"danger",onClick:()=>{y(),l(null)},children:"Delete Experiments"})})})]}))},[y]);return s("div",{css:v`
3062
2880
  position: absolute;
3063
2881
  bottom: var(--ac-global-dimension-size-400);
3064
2882
  left: 50%;
3065
2883
  transform: translateX(-50%);
3066
- `,children:[e(F,{backgroundColor:"light",padding:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"medium",minWidth:"size-6000",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:"size-100",children:[e(K,{children:`${c.length} experiment${f?"s":""} selected`}),s(h,{direction:"row",gap:"size-100",children:[e(M,{variant:"default",size:"compact",onClick:d,children:"Cancel"}),e(M,{variant:"danger",size:"compact",icon:e(P,{svg:e(I.TrashOutline,{})}),loading:r,disabled:r,onClick:b,children:r?"Deleting...":"Delete"}),e(M,{variant:"primary",size:"compact",onClick:()=>{a(`/datasets/${o}/compare?${c.map(k=>`experimentId=${k.id}`).join("&")}`)},icon:e(P,{svg:e(I.ArrowCompareOutline,{})}),children:"Compare Experiments"})]})]})}),e(W,{onDismiss:()=>{t(null)},children:l})]})}const Dg=100;function Tg(){return e("tbody",{className:"is-empty",children:e("tr",{children:s("td",{colSpan:100,css:C`
2884
+ `,children:[e(F,{backgroundColor:"light",padding:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"medium",minWidth:"size-6000",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:"size-100",children:[e(K,{children:`${c.length} experiment${f?"s":""} selected`}),s(h,{direction:"row",gap:"size-100",children:[e(N,{variant:"default",size:"compact",onClick:d,children:"Cancel"}),e(N,{variant:"danger",size:"compact",icon:e(w,{svg:e(L.TrashOutline,{})}),loading:r,disabled:r,onClick:k,children:r?"Deleting...":"Delete"}),e(N,{variant:"primary",size:"compact",onClick:()=>{a(`/datasets/${o}/compare?${c.map(S=>`experimentId=${S.id}`).join("&")}`)},icon:e(w,{svg:e(L.ArrowCompareOutline,{})}),children:"Compare Experiments"})]})]})}),e(W,{onDismiss:()=>{l(null)},children:t})]})}const bg=100;function Sg(){return e("tbody",{className:"is-empty",children:e("tr",{children:s("td",{colSpan:100,css:v`
3067
2885
  text-align: center;
3068
2886
  padding: var(--ac-global-dimension-size-400) !important;
3069
2887
  .ac-button {
@@ -3071,20 +2889,20 @@ fragment ExperimentsTableFragment_2HEEH6 on Dataset {
3071
2889
  margin-left: auto;
3072
2890
  margin-right: auto;
3073
2891
  }
3074
- `,children:["No experiments for this dataset. To see how to run experiments on a dataset, check out the documentation.",e(Ir,{})]})})})}function Ig({dataset:n}){const a=u.useRef(null),[l,t]=u.useState({}),{data:i,loadNext:r,hasNext:o,isLoadingNext:c,refetch:d}=D.usePaginationFragment(Or,n),g=u.useMemo(()=>i.experiments.edges.map(x=>{const T=x.experiment.annotationSummaries.reduce((E,R)=>(E[R.annotationName]=R,E),{});return{...x.experiment,annotationSummaryMap:T}}),[i.experiments.edges]),f=[{id:"select",header:({table:x})=>e(en,{checked:x.getIsAllRowsSelected(),indeterminate:x.getIsSomeRowsSelected(),onChange:x.getToggleAllRowsSelectedHandler()}),cell:({row:x})=>e(en,{checked:x.getIsSelected(),disabled:!x.getCanSelect(),indeterminate:x.getIsSomeSelected(),onChange:x.getToggleSelectedHandler()})},{header:"name",accessorKey:"name",minSize:200,cell:({getValue:x,row:T})=>{const E=T.original.id,R=T.original.sequenceNumber;return s(h,{direction:"row",gap:"size-100",children:[e(xa,{sequenceNumber:R}),e(Ze,{to:`/datasets/${n.id}/compare?experimentId=${E}`,children:x()})]})}},{header:"description",accessorKey:"description",minSize:300,cell:me},{header:"created at",accessorKey:"createdAt",cell:Fe}],m=i.experimentAnnotationSummaries.map(x=>{const{annotationName:T,minScore:E,maxScore:R}=x;return{header:()=>s(h,{direction:"row",gap:"size-100",wrap:!0,alignItems:"center",justifyContent:"end",children:[e(K,{children:T}),e(td,{annotationName:T})]}),id:`annotation-${T}`,meta:{textAlign:"right"},cell:({row:j})=>{const ae=j.original.annotationSummaryMap[T];return!ae||ae.meanScore==null?e("span",{css:C`
2892
+ `,children:["No experiments for this dataset. To see how to run experiments on a dataset, check out the documentation.",e(Ir,{})]})})})}function vg({dataset:n}){const a=u.useRef(null),[t,l]=u.useState({}),{data:i,loadNext:r,hasNext:o,isLoadingNext:c,refetch:d}=I.usePaginationFragment(Or,n),g=u.useMemo(()=>i.experiments.edges.map(x=>{const D=x.experiment.annotationSummaries.reduce((A,R)=>(A[R.annotationName]=R,A),{});return{...x.experiment,annotationSummaryMap:D}}),[i.experiments.edges]),f=[{id:"select",header:({table:x})=>e(en,{checked:x.getIsAllRowsSelected(),indeterminate:x.getIsSomeRowsSelected(),onChange:x.getToggleAllRowsSelectedHandler()}),cell:({row:x})=>e(en,{checked:x.getIsSelected(),disabled:!x.getCanSelect(),indeterminate:x.getIsSomeSelected(),onChange:x.getToggleSelectedHandler()})},{header:"name",accessorKey:"name",minSize:200,cell:({getValue:x,row:D})=>{const A=D.original.id,R=D.original.sequenceNumber;return s(h,{direction:"row",gap:"size-100",children:[e(Ia,{sequenceNumber:R}),e(We,{to:`/datasets/${n.id}/compare?experimentId=${A}`,children:x()})]})}},{header:"description",accessorKey:"description",minSize:300,cell:me},{header:"created at",accessorKey:"createdAt",cell:Fe}],m=i.experimentAnnotationSummaries.map(x=>{const{annotationName:D,minScore:A,maxScore:R}=x;return{header:()=>s(h,{direction:"row",gap:"size-100",wrap:!0,alignItems:"center",justifyContent:"end",children:[e(K,{children:D}),e(rd,{annotationName:D})]}),id:`annotation-${D}`,meta:{textAlign:"right"},cell:({row:j})=>{const ne=j.original.annotationSummaryMap[D];return!ne||ne.meanScore==null?e("span",{css:v`
3075
2893
  float: right;
3076
- `,children:"--"}):e(Lg,{annotationName:T,value:ae.meanScore,min:E,max:R})}}}),p=[{header:"run count",accessorKey:"runCount",meta:{textAlign:"right"},cell:id},{header:"avg latency",accessorKey:"averageRunLatencyMs",meta:{textAlign:"right"},cell:({getValue:x})=>{const T=x();return T===null||typeof T!="number"?"--":e(we,{latencyMs:T})}},{header:"error rate",accessorKey:"errorRate",meta:{textAlign:"right"},cell:Kg},{header:"metadata",accessorKey:"metadata",minSize:200,cell:_n},{id:"actions",cell:({row:x})=>{const T=x.original.project,E=x.original.metadata;return e(Pg,{projectId:(T==null?void 0:T.id)||null,experimentId:x.original.id,metadata:E})}}],y=he({columns:[...f,...m,...p],data:g,getCoreRowModel:ke(),state:{rowSelection:l},onRowSelectionChange:t}),b=y.getRowModel().rows,k=y.getSelectedRowModel().rows,S=k.map(x=>x.original),v=u.useCallback(()=>{t({})},[t]),w=b.length===0,L=u.useCallback(x=>{if(x){const{scrollHeight:T,scrollTop:E,clientHeight:R}=x;T-E-R<300&&!c&&o&&r(Dg)}},[o,c,r]),A=Y();return s("div",{css:C`
2894
+ `,children:"--"}):e(Cg,{annotationName:D,value:ne.meanScore,min:A,max:R})}}}),p=[{header:"run count",accessorKey:"runCount",meta:{textAlign:"right"},cell:sd},{header:"avg latency",accessorKey:"averageRunLatencyMs",meta:{textAlign:"right"},cell:({getValue:x})=>{const D=x();return D===null||typeof D!="number"?"--":e(Ee,{latencyMs:D})}},{header:"error rate",accessorKey:"errorRate",meta:{textAlign:"right"},cell:hg},{header:"metadata",accessorKey:"metadata",minSize:200,cell:An},{id:"actions",cell:({row:x})=>{const D=x.original.project,A=x.original.metadata;return e(Fg,{projectId:(D==null?void 0:D.id)||null,experimentId:x.original.id,metadata:A})}}],y=ke({columns:[...f,...m,...p],data:g,getCoreRowModel:be(),state:{rowSelection:t},onRowSelectionChange:l}),k=y.getRowModel().rows,S=y.getSelectedRowModel().rows,C=S.map(x=>x.original),b=u.useCallback(()=>{l({})},[l]),T=k.length===0,P=u.useCallback(x=>{if(x){const{scrollHeight:D,scrollTop:A,clientHeight:R}=x;D-A-R<300&&!c&&o&&r(bg)}},[o,c,r]),_=Y();return s("div",{css:v`
3077
2895
  flex: 1 1 auto;
3078
2896
  overflow: auto;
3079
2897
  width: table.getTotalSize();
3080
- `,ref:a,onScroll:x=>L(x.target),children:[s("table",{css:jn,children:[e("thead",{children:y.getHeaderGroups().map(x=>e("tr",{children:x.headers.map(T=>{var E,R;return e("th",{align:(R=(E=T.column.columnDef)==null?void 0:E.meta)==null?void 0:R.textAlign,children:e("div",{children:Z(T.column.columnDef.header,T.getContext())})},T.id)})},x.id))}),w?e(Tg,{}):e("tbody",{children:b.map(x=>e("tr",{onClick:()=>{A(`/datasets/${n.id}/compare?experimentId=${x.original.id}`)},children:x.getVisibleCells().map(T=>e("td",{children:Z(T.column.columnDef.cell,T.getContext())},T.id))},x.id))})]}),k.length?e(xg,{datasetId:n.id,selectedExperiments:S,onClearSelection:v,onExperimentsDeleted:()=>{d({},{fetchPolicy:"store-and-network"})}}):null]})}function Lg({annotationName:n,value:a,min:l,max:t}){const i=et(n),r=u.useMemo(()=>{const o=typeof l=="number"?l:0,c=typeof t=="number"?t:1;if(o===c&&c===a)return 100;const d=c-o||1;return(a-o)/d*100},[a,l,t]);return s(Le,{children:[e(kn,{children:s("div",{css:C`
2898
+ `,ref:a,onScroll:x=>P(x.target),children:[s("table",{css:Hn,children:[e("thead",{children:y.getHeaderGroups().map(x=>e("tr",{children:x.headers.map(D=>{var A,R;return e("th",{align:(R=(A=D.column.columnDef)==null?void 0:A.meta)==null?void 0:R.textAlign,children:e("div",{children:X(D.column.columnDef.header,D.getContext())})},D.id)})},x.id))}),T?e(Sg,{}):e("tbody",{children:k.map(x=>e("tr",{onClick:()=>{_(`/datasets/${n.id}/compare?experimentId=${x.original.id}`)},children:x.getVisibleCells().map(D=>e("td",{children:X(D.column.columnDef.cell,D.getContext())},D.id))},x.id))})]}),S.length?e(kg,{datasetId:n.id,selectedExperiments:C,onClearSelection:b,onExperimentsDeleted:()=>{d({},{fetchPolicy:"store-and-network"})}}):null]})}function Cg({annotationName:n,value:a,min:t,max:l}){const i=ol(n),r=u.useMemo(()=>{const o=typeof t=="number"?t:0,c=typeof l=="number"?l:1;if(o===c&&c===a)return 100;const d=c-o||1;return(a-o)/d*100},[a,t,l]);return s(we,{children:[e(hn,{children:s("div",{css:v`
3081
2899
  float: right;
3082
2900
  --mod-barloader-fill-color: ${i};
3083
2901
  display: flex;
3084
2902
  flex-direction: row;
3085
2903
  align-items: center;
3086
2904
  gap: var(--ac-global-dimension-size-100);
3087
- `,children:[wn(a),e(mo,{width:"40px",value:r,"aria-label":"where the mean score lands between overall min max"})]})}),e(aa,{children:s(F,{width:"size-2400",children:[e(re,{level:3,weight:"heavy",children:n}),s(h,{direction:"column",children:[s(h,{justifyContent:"space-between",children:[e(K,{weight:"heavy",textSize:"small",children:"Mean Score"}),e(K,{textSize:"small",children:wn(a)})]}),s(h,{justifyContent:"space-between",children:[e(K,{weight:"heavy",textSize:"small",children:"All Experiments Min"}),e(K,{textSize:"small",children:wn(l)})]}),s(h,{justifyContent:"space-between",children:[e(K,{weight:"heavy",textSize:"small",children:"All Experiments Max"}),e(K,{textSize:"small",children:wn(t)})]}),s(h,{justifyContent:"space-between",children:[e(K,{weight:"heavy",textSize:"small",children:"Mean Score Percentile"}),e(K,{textSize:"small",children:nt(r)})]})]})]})})]})}function Pg(n){const{projectId:a}=n,l=Y(),[t,i]=u.useState(null),r=oe();return s("div",{onClick:o=>{o.preventDefault(),o.stopPropagation()},children:[s(Be,{buttonSize:"compact",align:"end",disabledKeys:a?[]:["GO_TO_EXPERIMENT_RUN_TRACES"],onAction:o=>{switch(o){case"GO_TO_EXPERIMENT_RUN_TRACES":return l(`/projects/${a}`);case"VIEW_METADATA":{i(e(H,{title:"Metadata",onDismiss:()=>i(null),children:e(fn,{value:JSON.stringify(n.metadata,null,2)})}));break}case"COPY_EXPERIMENT_ID":{Ws(n.experimentId),r({title:"Copied",message:"The experiment ID has been copied to your clipboard"});break}default:Ce()}},children:[e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.Trace,{})}),e(K,{children:"View run traces"})]})},"GO_TO_EXPERIMENT_RUN_TRACES"),e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.InfoOutline,{})}),e(K,{children:"View metadata"})]})},"VIEW_METADATA"),e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.ClipboardCopy,{})}),e(K,{children:"Copy experiment ID"})]})},"COPY_EXPERIMENT_ID")]}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>{i(null)},children:t})]})}function rf(){const n=Cn();return s(U,{children:[e(Ig,{dataset:n.dataset}),e(u.Suspense,{children:e(Pe,{})})]})}const jr=function(){var n={defaultValue:null,kind:"LocalArgument",name:"datasetId"},a={defaultValue:null,kind:"LocalArgument",name:"experimentIds"},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"projectId",storageKey:null}],storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={alias:"comparisons",args:[{kind:"Variable",name:"experimentIds",variableName:"experimentIds"}],concreteType:"ExperimentComparison",kind:"LinkedField",name:"compareExperiments",plural:!0,selections:[{alias:null,args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"example",plural:!1,selections:[l,{alias:null,args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:"referenceOutput",args:null,kind:"ScalarField",name:"output",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"RunComparisonItem",kind:"LinkedField",name:"runComparisonItems",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"experimentId",storageKey:null},{alias:null,args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"runs",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},t,{alias:null,args:null,concreteType:"ExperimentRunAnnotationConnection",kind:"LinkedField",name:"annotations",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunAnnotationEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"annotation",args:null,concreteType:"ExperimentRunAnnotation",kind:"LinkedField",name:"node",plural:!1,selections:[l,i,{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},t],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},o=[{kind:"Variable",name:"id",variableName:"datasetId"}],c={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[l,i,{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Dataset",abstractKey:null};return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"ExperimentCompareTableQuery",selections:[r,{alias:"dataset",args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,c],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"ExperimentCompareTableQuery",selections:[r,{alias:"dataset",args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,c],storageKey:null}]},params:{cacheID:"97e80c617426f75b81affa68e276b3d8",id:null,metadata:{},name:"ExperimentCompareTableQuery",operationKind:"query",text:`query ExperimentCompareTableQuery(
2905
+ `,children:[_n(a),e(go,{width:"40px",value:r,"aria-label":"where the mean score lands between overall min max"})]})}),e(ia,{children:s(F,{width:"size-2400",children:[e(se,{level:3,weight:"heavy",children:n}),s(h,{direction:"column",children:[s(h,{justifyContent:"space-between",children:[e(K,{weight:"heavy",textSize:"small",children:"Mean Score"}),e(K,{textSize:"small",children:_n(a)})]}),s(h,{justifyContent:"space-between",children:[e(K,{weight:"heavy",textSize:"small",children:"All Experiments Min"}),e(K,{textSize:"small",children:_n(t)})]}),s(h,{justifyContent:"space-between",children:[e(K,{weight:"heavy",textSize:"small",children:"All Experiments Max"}),e(K,{textSize:"small",children:_n(l)})]}),s(h,{justifyContent:"space-between",children:[e(K,{weight:"heavy",textSize:"small",children:"Mean Score Percentile"}),e(K,{textSize:"small",children:dl(r)})]})]})]})})]})}function Fg(n){const{projectId:a}=n,t=Y(),[l,i]=u.useState(null),r=oe();return s("div",{onClick:o=>{o.preventDefault(),o.stopPropagation()},children:[s(ln,{buttonSize:"compact",align:"end",disabledKeys:a?[]:["GO_TO_EXPERIMENT_RUN_TRACES"],onAction:o=>{switch(o){case"GO_TO_EXPERIMENT_RUN_TRACES":return t(`/projects/${a}`);case"VIEW_METADATA":{i(e(B,{title:"Metadata",onDismiss:()=>i(null),children:e(yn,{value:JSON.stringify(n.metadata,null,2)})}));break}case"COPY_EXPERIMENT_ID":{Zs(n.experimentId),r({title:"Copied",message:"The experiment ID has been copied to your clipboard"});break}default:ye()}},children:[e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.Trace,{})}),e(K,{children:"View run traces"})]})},"GO_TO_EXPERIMENT_RUN_TRACES"),e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.InfoOutline,{})}),e(K,{children:"View metadata"})]})},"VIEW_METADATA"),e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.ClipboardCopy,{})}),e(K,{children:"Copy experiment ID"})]})},"COPY_EXPERIMENT_ID")]}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>{i(null)},children:l})]})}function hf(){const n=vn();return s(H,{children:[e(vg,{dataset:n.dataset}),e(u.Suspense,{children:e(_e,{})})]})}const jr=function(){var n={defaultValue:null,kind:"LocalArgument",name:"datasetId"},a={defaultValue:null,kind:"LocalArgument",name:"experimentIds"},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"projectId",storageKey:null}],storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={alias:"comparisons",args:[{kind:"Variable",name:"experimentIds",variableName:"experimentIds"}],concreteType:"ExperimentComparison",kind:"LinkedField",name:"compareExperiments",plural:!0,selections:[{alias:null,args:null,concreteType:"DatasetExample",kind:"LinkedField",name:"example",plural:!1,selections:[t,{alias:null,args:null,concreteType:"DatasetExampleRevision",kind:"LinkedField",name:"revision",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"input",storageKey:null},{alias:"referenceOutput",args:null,kind:"ScalarField",name:"output",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"RunComparisonItem",kind:"LinkedField",name:"runComparisonItems",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"experimentId",storageKey:null},{alias:null,args:null,concreteType:"ExperimentRun",kind:"LinkedField",name:"runs",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"output",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"error",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},l,{alias:null,args:null,concreteType:"ExperimentRunAnnotationConnection",kind:"LinkedField",name:"annotations",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentRunAnnotationEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"annotation",args:null,concreteType:"ExperimentRunAnnotation",kind:"LinkedField",name:"node",plural:!1,selections:[t,i,{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"explanation",storageKey:null},l],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},o=[{kind:"Variable",name:"id",variableName:"datasetId"}],c={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[t,i,{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Dataset",abstractKey:null};return{fragment:{argumentDefinitions:[n,a],kind:"Fragment",metadata:null,name:"ExperimentCompareTableQuery",selections:[r,{alias:"dataset",args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,c],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,n],kind:"Operation",name:"ExperimentCompareTableQuery",selections:[r,{alias:"dataset",args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,c],storageKey:null}]},params:{cacheID:"97e80c617426f75b81affa68e276b3d8",id:null,metadata:{},name:"ExperimentCompareTableQuery",operationKind:"query",text:`query ExperimentCompareTableQuery(
3088
2906
  $experimentIds: [GlobalID!]!
3089
2907
  $datasetId: GlobalID!
3090
2908
  ) {
@@ -3142,7 +2960,7 @@ fragment ExperimentsTableFragment_2HEEH6 on Dataset {
3142
2960
  }
3143
2961
  }
3144
2962
  }
3145
- `}}}();jr.hash="e6132b301f6d80be7f5c5b0653e25178";const $a={backgroundColor:"light",borderColor:"light",variant:"compact",collapsible:!0,bodyStyle:{padding:0}},wg=C`
2963
+ `}}}();jr.hash="e6132b301f6d80be7f5c5b0653e25178";const Qa={backgroundColor:"light",borderColor:"light",variant:"compact",collapsible:!0,bodyStyle:{padding:0}},Kg=v`
3146
2964
  flex: 1 1 auto;
3147
2965
  overflow: auto;
3148
2966
  // Make sure the table fills up the remaining space
@@ -3152,7 +2970,7 @@ fragment ExperimentsTableFragment_2HEEH6 on Dataset {
3152
2970
  vertical-align: top;
3153
2971
  }
3154
2972
  }
3155
- `,qr=C`
2973
+ `,qr=v`
3156
2974
  position: relative;
3157
2975
  min-height: 75px;
3158
2976
  .controls {
@@ -3169,40 +2987,40 @@ fragment ExperimentsTableFragment_2HEEH6 on Dataset {
3169
2987
  border-color: var(--ac-global-color-primary);
3170
2988
  }
3171
2989
  }
3172
- `,Ur=C`
2990
+ `,Ur=v`
3173
2991
  position: absolute;
3174
2992
  top: -23px;
3175
2993
  right: 0px;
3176
2994
  display: flex;
3177
2995
  flex-direction: row;
3178
2996
  gap: var(--ac-global-dimension-static-size-100);
3179
- `,Ag=C`
2997
+ `,xg=v`
3180
2998
  display: flex;
3181
2999
  flex-direction: row;
3182
3000
  align-items: center;
3183
3001
  color: var(--ac-global-color-primary);
3184
3002
  gap: var(--ac-global-dimension-size-50);
3185
- `;function _g(n){const{datasetId:a,experimentIds:l,displayFullText:t}=n,i=D.useLazyLoadQuery(jr,{experimentIds:l,datasetId:a}),r=u.useMemo(()=>{var S,v;return((v=(S=i.dataset)==null?void 0:S.experiments)==null?void 0:v.edges.reduce((w,L)=>(w[L.experiment.id]={...L.experiment},w),{}))||{}},[i]),o=u.useMemo(()=>i.comparisons.map(S=>{const v=S.runComparisonItems.reduce((w,L)=>(w[L.experimentId]=L,w),{});return{...S,id:S.example.id,input:S.example.revision.input,referenceOutput:S.example.revision.referenceOutput,runComparisonMap:v}}),[i]),[c,d]=u.useState(null),g=u.useMemo(()=>[{header:"input",accessorKey:"input",minWidth:500,cell:({row:S})=>s("div",{css:qr,children:[e(cl,{children:e(tl,{json:S.original.input,disableTitle:!0,space:t?2:0})}),e("div",{className:"controls",css:Ur,children:s(Le,{children:[e(M,{variant:"default",size:"compact","aria-label":"View example details",icon:e(P,{svg:e(I.ExpandOutline,{})}),onClick:()=>{u.startTransition(()=>{d(e(u.Suspense,{children:e(Er,{exampleId:S.original.example.id,onDismiss:()=>{d(null)}})}))})}}),e(An,{children:"View Example"})]})})]})},{header:"reference output",accessorKey:"referenceOutput",minWidth:500,cell:t?Vg:_n}],[t]),f=u.useMemo(()=>l.map(S=>({header:()=>{var L,A;const v=(L=r[S])==null?void 0:L.name,w=((A=r[S])==null?void 0:A.sequenceNumber)||0;return s(h,{direction:"row",gap:"size-100",wrap:!0,children:[e(xa,{sequenceNumber:w}),e(K,{children:v})]})},accessorKey:S,minSize:500,cell:({row:v})=>{var j,ae;const w=v.original.runComparisonMap[S],L=(w==null?void 0:w.runs.length)||0;if(L===0)return e(Ll,{});if(L>1)return e(K,{color:"warning",children:`${L} runs`});const A=w==null?void 0:w.runs[0];let x=null;const T=(j=A==null?void 0:A.trace)==null?void 0:j.traceId,E=(ae=A==null?void 0:A.trace)==null?void 0:ae.projectId;T&&E&&(x=s(Le,{children:[e(M,{variant:"default",className:"trace-button",size:"compact","aria-label":"View run trace",icon:e(P,{svg:e(I.Trace,{})}),onClick:ie=>{ie.preventDefault(),ie.stopPropagation(),u.startTransition(()=>{d(e(Wr,{traceId:T,projectId:E,title:"Experiment Run Trace"}))})}}),e(An,{children:"View Trace"})]}));const R=s(U,{children:[s(Le,{children:[e(M,{variant:"default",className:"expand-button",size:"compact","aria-label":"View example run details",icon:e(P,{svg:e(I.ExpandOutline,{})}),onClick:ie=>{ie.preventDefault(),ie.stopPropagation(),u.startTransition(()=>{d(e(zg,{selectedExample:v.original,datasetId:a,experimentInfoById:r}))})}}),e(An,{children:"View run details"})]}),x]});return A?e(Ng,{controls:R,children:e(Mg,{...A,displayFullText:t,setDialog:d})}):e(Ll,{})}})),[l,r,a,t]),m=u.useMemo(()=>[...g,...f,{id:"tail",minSize:500}],[g,f]),p=he({columns:m,data:o,getCoreRowModel:ke(),columnResizeMode:"onChange"}),y=Ke.useMemo(()=>{const S=p.getFlatHeaders(),v={};for(let w=0;w<S.length;w++){const L=S[w];v[`--header-${L.id}-size`]=L.getSize(),v[`--col-${L.column.id}-size`]=L.column.getSize()}return v},[p.getState().columnSizingInfo,p.getState().columnSizing]),k=p.getRowModel().rows.length===0;return s("div",{css:wg,children:[s("table",{css:S=>C(We(S),rd),style:{...y,width:p.getTotalSize(),minWidth:"100%"},children:[e("thead",{children:p.getHeaderGroups().map(S=>e("tr",{children:S.headers.map(v=>s("th",{style:{width:`calc(var(--header-${v==null?void 0:v.id}-size) * 1px)`},children:[e("div",{children:Z(v.column.columnDef.header,v.getContext())}),e("div",{onMouseDown:v.getResizeHandler(),onTouchStart:v.getResizeHandler(),className:`resizer ${v.column.getIsResizing()?"isResizing":""}`})]},v.id))},S.id))}),k?e(Je,{}):p.getState().columnSizingInfo.isResizingColumn?e(Eg,{table:p}):e(Br,{table:p})]}),e(W,{isDismissable:!0,type:"slideOver",onDismiss:()=>{d(null)},children:c})]})}function Br({table:n}){return e("tbody",{children:n.getRowModel().rows.map(a=>e("tr",{children:a.getVisibleCells().map(l=>e("td",{style:{width:`calc(var(--col-${l.column.id}-size) * 1px)`},children:Z(l.column.columnDef.cell,l.getContext())},l.id))},a.id))})}const Eg=Ke.memo(Br,(n,a)=>n.table.options.data===a.table.options.data);function Rg(n){const{datasetId:a,exampleId:l}=n,t=Y();return e("div",{onClick:i=>{i.preventDefault(),i.stopPropagation()},children:e(Be,{buttonSize:"compact",align:"end",onAction:i=>{switch(i){case"gotoExample":return t(`/datasets/${a}/examples/${l}`);default:Ce()}},children:e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.ExternalLinkOutline,{})}),e(K,{children:"Go to example"})]})},"gotoExample")})})}function Mg(n){const{output:a,error:l,startTime:t,endTime:i,annotations:r,displayFullText:o,setDialog:c}=n;if(l)return e(Hr,{error:l});const d=r!=null&&r.edges.length?r.edges.map(g=>g.annotation):[];return s(h,{direction:"column",gap:"size-100",height:"100%",justifyContent:"space-between",children:[e(cl,{children:e(tl,{json:a,disableTitle:!0,space:o?2:0})}),s("ul",{css:C`
3003
+ `;function Tg(n){const{datasetId:a,experimentIds:t,displayFullText:l}=n,i=I.useLazyLoadQuery(jr,{experimentIds:t,datasetId:a}),r=u.useMemo(()=>{var C,b;return((b=(C=i.dataset)==null?void 0:C.experiments)==null?void 0:b.edges.reduce((T,P)=>(T[P.experiment.id]={...P.experiment},T),{}))||{}},[i]),o=u.useMemo(()=>i.comparisons.map(C=>{const b=C.runComparisonItems.reduce((T,P)=>(T[P.experimentId]=P,T),{});return{...C,id:C.example.id,input:C.example.revision.input,referenceOutput:C.example.revision.referenceOutput,runComparisonMap:b}}),[i]),[c,d]=u.useState(null),g=u.useMemo(()=>[{header:"input",accessorKey:"input",minWidth:500,cell:({row:C})=>s("div",{css:qr,children:[e(ht,{children:e(ct,{json:C.original.input,disableTitle:!0,space:l?2:0})}),e("div",{className:"controls",css:Ur,children:s(we,{children:[e(N,{variant:"default",size:"compact","aria-label":"View example details",icon:e(w,{svg:e(L.ExpandOutline,{})}),onClick:()=>{u.startTransition(()=>{d(e(u.Suspense,{children:e(Ar,{exampleId:C.original.example.id,onDismiss:()=>{d(null)}})}))})}}),e(En,{children:"View Example"})]})})]})},{header:"reference output",accessorKey:"referenceOutput",minWidth:500,cell:l?wg:An}],[l]),f=u.useMemo(()=>t.map(C=>({header:()=>{var P,_;const b=(P=r[C])==null?void 0:P.name,T=((_=r[C])==null?void 0:_.sequenceNumber)||0;return s(h,{direction:"row",gap:"size-100",wrap:!0,children:[e(Ia,{sequenceNumber:T}),e(K,{children:b})]})},accessorKey:C,minSize:500,cell:({row:b})=>{var j,ne;const T=b.original.runComparisonMap[C],P=(T==null?void 0:T.runs.length)||0;if(P===0)return e(zt,{});if(P>1)return e(K,{color:"warning",children:`${P} runs`});const _=T==null?void 0:T.runs[0];let x=null;const D=(j=_==null?void 0:_.trace)==null?void 0:j.traceId,A=(ne=_==null?void 0:_.trace)==null?void 0:ne.projectId;D&&A&&(x=s(we,{children:[e(N,{variant:"default",className:"trace-button",size:"compact","aria-label":"View run trace",icon:e(w,{svg:e(L.Trace,{})}),onClick:re=>{re.preventDefault(),re.stopPropagation(),u.startTransition(()=>{d(e(Wr,{traceId:D,projectId:A,title:"Experiment Run Trace"}))})}}),e(En,{children:"View Trace"})]}));const R=s(H,{children:[s(we,{children:[e(N,{variant:"default",className:"expand-button",size:"compact","aria-label":"View example run details",icon:e(w,{svg:e(L.ExpandOutline,{})}),onClick:re=>{re.preventDefault(),re.stopPropagation(),u.startTransition(()=>{d(e(_g,{selectedExample:b.original,datasetId:a,experimentInfoById:r}))})}}),e(En,{children:"View run details"})]}),x]});return _?e(Lg,{controls:R,children:e(Pg,{..._,displayFullText:l,setDialog:d})}):e(zt,{})}})),[t,r,a,l]),m=u.useMemo(()=>[...g,...f,{id:"tail",minSize:500}],[g,f]),p=ke({columns:m,data:o,getCoreRowModel:be(),columnResizeMode:"onChange"}),y=Ke.useMemo(()=>{const C=p.getFlatHeaders(),b={};for(let T=0;T<C.length;T++){const P=C[T];b[`--header-${P.id}-size`]=P.getSize(),b[`--col-${P.column.id}-size`]=P.column.getSize()}return b},[p.getState().columnSizingInfo,p.getState().columnSizing]),S=p.getRowModel().rows.length===0;return s("div",{css:Kg,children:[s("table",{css:C=>v(He(C),od),style:{...y,width:p.getTotalSize(),minWidth:"100%"},children:[e("thead",{children:p.getHeaderGroups().map(C=>e("tr",{children:C.headers.map(b=>s("th",{style:{width:`calc(var(--header-${b==null?void 0:b.id}-size) * 1px)`},children:[e("div",{children:X(b.column.columnDef.header,b.getContext())}),e("div",{onMouseDown:b.getResizeHandler(),onTouchStart:b.getResizeHandler(),className:`resizer ${b.column.getIsResizing()?"isResizing":""}`})]},b.id))},C.id))}),S?e(Ge,{}):p.getState().columnSizingInfo.isResizingColumn?e(Dg,{table:p}):e(Br,{table:p})]}),e(W,{isDismissable:!0,type:"slideOver",onDismiss:()=>{d(null)},children:c})]})}function Br({table:n}){return e("tbody",{children:n.getRowModel().rows.map(a=>e("tr",{children:a.getVisibleCells().map(t=>e("td",{style:{width:`calc(var(--col-${t.column.id}-size) * 1px)`},children:X(t.column.columnDef.cell,t.getContext())},t.id))},a.id))})}const Dg=Ke.memo(Br,(n,a)=>n.table.options.data===a.table.options.data);function Ig(n){const{datasetId:a,exampleId:t}=n,l=Y();return e("div",{onClick:i=>{i.preventDefault(),i.stopPropagation()},children:e(ln,{buttonSize:"compact",align:"end",onAction:i=>{switch(i){case"gotoExample":return l(`/datasets/${a}/examples/${t}`);default:ye()}},children:e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.ExternalLinkOutline,{})}),e(K,{children:"Go to example"})]})},"gotoExample")})})}function Pg(n){const{output:a,error:t,startTime:l,endTime:i,annotations:r,displayFullText:o,setDialog:c}=n;if(t)return e(Hr,{error:t});const d=r!=null&&r.edges.length?r.edges.map(g=>g.annotation):[];return s(h,{direction:"column",gap:"size-100",height:"100%",justifyContent:"space-between",children:[e(ht,{children:e(ct,{json:a,disableTitle:!0,space:o?2:0})}),s("ul",{css:v`
3186
3004
  display: flex;
3187
3005
  flex-direction: row;
3188
3006
  gap: var(--ac-global-dimension-static-size-100);
3189
3007
  align-items: center;
3190
3008
  flex-wrap: wrap;
3191
- `,children:[e("li",{children:e(Gr,{startTime:t,endTime:i})},"run-latency"),d.map(g=>e("li",{children:e(ia,{annotation:g,extra:g.trace&&e(F,{paddingTop:"size-100",children:s("div",{css:Ag,children:[e(P,{svg:e(I.InfoOutline,{})}),e("span",{children:"Click to view evaluator trace"})]})}),children:e(xn,{annotation:g,onClick:()=>{const f=g.trace;f&&u.startTransition(()=>{c(e(Wr,{traceId:f.traceId,projectId:f.projectId,title:`Evaluator Trace: ${g.name}`}))})}})})},g.id))]})]})}function Ng(n){return s("div",{css:qr,children:[n.children,e("div",{css:Ur,className:"controls",children:n.controls})]})}function Hr({error:n}){return s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(P,{svg:e(I.AlertCircleOutline,{}),color:"danger"}),e(K,{color:"danger",children:n})]})}function Gr({startTime:n,endTime:a}){const l=u.useMemo(()=>{let t=null;return n&&a&&(t=new Date(a).getTime()-new Date(n).getTime()),t},[n,a]);return l===null?null:e(we,{latencyMs:l})}function Ll(){return s(h,{direction:"row",gap:"size-50",children:[e(P,{svg:e(I.MinusCircleOutline,{}),color:"grey-800"}),e(K,{color:"text-700",children:"not run"})]})}function Vg({getValue:n}){const a=n();return e(cl,{children:e(tl,{json:a,space:2})})}function cl({children:n}){return e("div",{css:C`
3009
+ `,children:[e("li",{children:e(Gr,{startTime:l,endTime:i})},"run-latency"),d.map(g=>e("li",{children:e(ra,{annotation:g,extra:g.trace&&e(F,{paddingTop:"size-100",children:s("div",{css:xg,children:[e(w,{svg:e(L.InfoOutline,{})}),e("span",{children:"Click to view evaluator trace"})]})}),children:e(xn,{annotation:g,onClick:()=>{const f=g.trace;f&&u.startTransition(()=>{c(e(Wr,{traceId:f.traceId,projectId:f.projectId,title:`Evaluator Trace: ${g.name}`}))})}})})},g.id))]})]})}function Lg(n){return s("div",{css:qr,children:[n.children,e("div",{css:Ur,className:"controls",children:n.controls})]})}function Hr({error:n}){return s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(w,{svg:e(L.AlertCircleOutline,{}),color:"danger"}),e(K,{color:"danger",children:n})]})}function Gr({startTime:n,endTime:a}){const t=u.useMemo(()=>{let l=null;return n&&a&&(l=new Date(a).getTime()-new Date(n).getTime()),l},[n,a]);return t===null?null:e(Ee,{latencyMs:t})}function zt(){return s(h,{direction:"row",gap:"size-50",children:[e(w,{svg:e(L.MinusCircleOutline,{}),color:"grey-800"}),e(K,{color:"text-700",children:"not run"})]})}function wg({getValue:n}){const a=n();return e(ht,{children:e(ct,{json:a,space:2})})}function ht({children:n}){return e("div",{css:v`
3192
3010
  max-height: 300px;
3193
3011
  overflow-y: auto;
3194
- `,children:n})}function zg({selectedExample:n,datasetId:a,experimentInfoById:l}){return e(H,{title:`Comparing Experiments for Example: ${n.id}`,size:"fullscreen",extra:e(Rg,{datasetId:a,exampleId:n.id}),children:s(Xe,{direction:"vertical",autoSaveId:"example-compare-panel-group",children:[e(ue,{defaultSize:100,children:e("div",{css:C`
3012
+ `,children:n})}function _g({selectedExample:n,datasetId:a,experimentInfoById:t}){return e(B,{title:`Comparing Experiments for Example: ${n.id}`,size:"fullscreen",extra:e(Ig,{datasetId:a,exampleId:n.id}),children:s(Xe,{direction:"vertical",autoSaveId:"example-compare-panel-group",children:[e(ue,{defaultSize:100,children:e("div",{css:v`
3195
3013
  overflow-y: auto;
3196
3014
  height: 100%;
3197
- `,children:e(F,{overflow:"hidden",padding:"size-200",children:s(h,{direction:"row",gap:"size-200",flex:"1 1 auto",children:[e(F,{width:"50%",children:e(V,{title:"Input",...$a,bodyStyle:{padding:0,maxHeight:"300px",overflowY:"auto"},extra:e(le,{text:JSON.stringify(n.input)}),children:e(fn,{value:JSON.stringify(n.input,null,2)})})}),e(F,{width:"50%",children:e(V,{title:"Reference Output",...$a,extra:e(le,{text:JSON.stringify(n.input)}),bodyStyle:{padding:0,maxHeight:"300px",overflowY:"auto"},children:e(fn,{value:JSON.stringify(n.referenceOutput,null,2)})})})]})})})}),e(Ye,{css:Kn}),e(ue,{defaultSize:200,children:s(h,{direction:"column",height:"100%",children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderBottomColor:"dark",borderBottomWidth:"thin",flex:"none",children:e(re,{level:2,children:"Experiments"})}),e("div",{css:C`
3015
+ `,children:e(F,{overflow:"hidden",padding:"size-200",children:s(h,{direction:"row",gap:"size-200",flex:"1 1 auto",children:[e(F,{width:"50%",children:e($,{title:"Input",...Qa,bodyStyle:{padding:0,maxHeight:"300px",overflowY:"auto"},extra:e(ae,{text:JSON.stringify(n.input)}),children:e(yn,{value:JSON.stringify(n.input,null,2)})})}),e(F,{width:"50%",children:e($,{title:"Reference Output",...Qa,extra:e(ae,{text:JSON.stringify(n.input)}),bodyStyle:{padding:0,maxHeight:"300px",overflowY:"auto"},children:e(yn,{value:JSON.stringify(n.referenceOutput,null,2)})})})]})})})}),e(Ye,{css:Kn}),e(ue,{defaultSize:200,children:s(h,{direction:"column",height:"100%",children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderBottomColor:"dark",borderBottomWidth:"thin",flex:"none",children:e(se,{level:2,children:"Experiments"})}),e("div",{css:v`
3198
3016
  overflow-y: auto;
3199
3017
  height: 100%;
3200
3018
  padding: var(--ac-global-dimension-static-size-200);
3201
- `,children:e("ul",{css:C`
3019
+ `,children:e("ul",{css:v`
3202
3020
  display: flex;
3203
3021
  flex-direction: column;
3204
3022
  gap: var(--ac-global-dimension-static-size-200);
3205
- `,children:n.runComparisonItems.map(t=>{const i=l[t.experimentId];return e("li",{children:e(V,{...$a,title:i==null?void 0:i.name,titleExtra:e(xa,{sequenceNumber:(i==null?void 0:i.sequenceNumber)||0}),children:e("ul",{children:t.runs.map((r,o)=>{var c;return e("li",{children:s(h,{direction:"row",children:[e(F,{flex:!0,children:r.error?e(F,{padding:"size-200",children:e(Hr,{error:r.error})}):e(fn,{value:JSON.stringify(r.output,null,2)})}),s(In,{width:"size-3000",children:[e(Gr,{startTime:r.startTime,endTime:r.endTime}),e("ul",{css:C`
3023
+ `,children:n.runComparisonItems.map(l=>{const i=t[l.experimentId];return e("li",{children:e($,{...Qa,title:i==null?void 0:i.name,titleExtra:e(Ia,{sequenceNumber:(i==null?void 0:i.sequenceNumber)||0}),children:e("ul",{children:l.runs.map((r,o)=>{var c;return e("li",{children:s(h,{direction:"row",children:[e(F,{flex:!0,children:r.error?e(F,{padding:"size-200",children:e(Hr,{error:r.error})}):e(yn,{value:JSON.stringify(r.output,null,2)})}),s(Pn,{width:"size-3000",children:[e(Gr,{startTime:r.startTime,endTime:r.endTime}),e("ul",{css:v`
3206
3024
  margin-top: var(
3207
3025
  --ac-global-dimension-static-size-100
3208
3026
  );
@@ -3213,12 +3031,12 @@ fragment ExperimentsTableFragment_2HEEH6 on Dataset {
3213
3031
  gap: var(
3214
3032
  --ac-global-dimension-static-size-100
3215
3033
  );
3216
- `,children:(c=r.annotations)==null?void 0:c.edges.map(d=>e("li",{children:e(xn,{annotation:d.annotation})},d.annotation.id))})]})]})},o)})})})},t.experimentId)})})})]})})]})})}function Wr({traceId:n,projectId:a,title:l}){const t=Y();return e(H,{title:l,size:"fullscreen",extra:e(M,{variant:"default",onClick:()=>t(`/projects/${a}/traces/${n}`),children:"View Trace in Project"}),children:e(dl,{traceId:n,projectId:a})})}const Jr={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ExperimentMultiSelector__experiments",selections:[{alias:null,args:null,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Dataset",abstractKey:null};Jr.hash="1aa376b1e9425f49268ac231dc2c0412";function $g(n){const{dataset:a,selectedExperimentIds:l,onChange:t,label:i,validationState:r,description:o,errorMessage:c,...d}=n,g=D.useFragment(Jr,a),f=u.useMemo(()=>g.experiments.edges.map(y=>y.experiment),[g]),m=f.length===0,p=u.useMemo(()=>{if(m)return"No experiments";const y=l.length;return y>0?`${y} experiment${y>1?"s":""}`:"No experiments selected"},[l,m]);return e(la,{label:i,isDisabled:m,validationState:r,description:o,errorMessage:c,children:e(Za,{isDisabled:m,...d,menu:e(na,{selectionMode:"multiple",onSelectionChange:y=>{t(Array.from(y))},selectedKeys:new Set(l),children:f.map(y=>e(B,{textValue:y.name,children:s(h,{direction:"column",gap:"size-50",children:[s(h,{direction:"row",gap:"size-100",children:[e(xa,{sequenceNumber:y.sequenceNumber}),e(K,{children:y.name})]}),e(K,{textSize:"small",color:"text-700",children:new Date(y.createdAt).toLocaleString()})]})},y.id))}),triggerProps:{placement:"bottom start"},children:p})})}function sf(){const n=Cn(),[a,l]=u.useState(!1),[t,i]=fa(),r=t.getAll("experimentId"),o=r.length>0;return s("main",{css:C`
3034
+ `,children:(c=r.annotations)==null?void 0:c.edges.map(d=>e("li",{children:e(xn,{annotation:d.annotation})},d.annotation.id))})]})]})},o)})})})},l.experimentId)})})})]})})]})})}function Wr({traceId:n,projectId:a,title:t}){const l=Y();return e(B,{title:t,size:"fullscreen",extra:e(N,{variant:"default",onClick:()=>l(`/projects/${a}/traces/${n}`),children:"View Trace in Project"}),children:e(ft,{traceId:n,projectId:a})})}const Jr={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ExperimentMultiSelector__experiments",selections:[{alias:null,args:null,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Dataset",abstractKey:null};Jr.hash="1aa376b1e9425f49268ac231dc2c0412";function Eg(n){const{dataset:a,selectedExperimentIds:t,onChange:l,label:i,validationState:r,description:o,errorMessage:c,...d}=n,g=I.useFragment(Jr,a),f=u.useMemo(()=>g.experiments.edges.map(y=>y.experiment),[g]),m=f.length===0,p=u.useMemo(()=>{if(m)return"No experiments";const y=t.length;return y>0?`${y} experiment${y>1?"s":""}`:"No experiments selected"},[t,m]);return e(On,{label:i,isDisabled:m,validationState:r,description:o,errorMessage:c,children:e(nt,{isDisabled:m,...d,menu:e(va,{selectionMode:"multiple",onSelectionChange:y=>{l(Array.from(y))},selectedKeys:new Set(t),children:f.map(y=>e(U,{textValue:y.name,children:s(h,{direction:"column",gap:"size-50",children:[s(h,{direction:"row",gap:"size-100",children:[e(Ia,{sequenceNumber:y.sequenceNumber}),e(K,{children:y.name})]}),e(K,{textSize:"small",color:"text-700",children:new Date(y.createdAt).toLocaleString()})]})},y.id))}),triggerProps:{placement:"bottom start"},children:p})})}function kf(){const n=vn(),[a,t]=u.useState(!1),[l,i]=la(),r=l.getAll("experimentId"),o=r.length>0;return s("main",{css:v`
3217
3035
  height: 100%;
3218
3036
  display: flex;
3219
3037
  flex-direction: column;
3220
3038
  overflow: hidden;
3221
- `,children:[e(F,{padding:"size-200",borderBottomColor:"dark",borderBottomWidth:"thin",flex:"none",children:s(h,{direction:"column",gap:"size-100",children:[e(re,{level:1,children:"Compare Experiments"}),s(h,{direction:"row",justifyContent:"space-between",alignItems:"end",children:[e($g,{dataset:n.dataset,selectedExperimentIds:r,label:"experiments",onChange:c=>{u.startTransition(()=>{t.delete("experimentId"),c.forEach(d=>{t.append("experimentId",d)}),i(t)})}}),e(Mn,{onChange:c=>{l(c)},defaultSelected:!1,labelPlacement:"start",children:"Full Text"})]})]})}),o?e(u.Suspense,{fallback:e(fe,{}),children:e(_g,{datasetId:n.dataset.id,experimentIds:r,displayFullText:a})}):e(F,{padding:"size-200",children:e(ne,{variant:"info",title:"No Experiment Selected",children:"Please select one or more experiments."})})]})}const Zr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"experimentCompareLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"InlineFragment",selections:[t,{args:null,kind:"FragmentSpread",name:"ExperimentMultiSelector__experiments"}],type:"Dataset",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"experimentCompareLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,{kind:"InlineFragment",selections:[t,{alias:null,args:null,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[l,t,{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"7e89f99f940098a21985137aae870de7",id:null,metadata:{},name:"experimentCompareLoaderQuery",operationKind:"query",text:`query experimentCompareLoaderQuery(
3039
+ `,children:[e(F,{padding:"size-200",borderBottomColor:"dark",borderBottomWidth:"thin",flex:"none",children:s(h,{direction:"column",gap:"size-100",children:[e(se,{level:1,children:"Compare Experiments"}),s(h,{direction:"row",justifyContent:"space-between",alignItems:"end",children:[e(Eg,{dataset:n.dataset,selectedExperimentIds:r,label:"experiments",onChange:c=>{u.startTransition(()=>{l.delete("experimentId"),c.forEach(d=>{l.append("experimentId",d)}),i(l)})}}),e(zn,{onChange:c=>{t(c)},defaultSelected:!1,labelPlacement:"start",children:"Full Text"})]})]})}),o?e(u.Suspense,{fallback:e(he,{}),children:e(Tg,{datasetId:n.dataset.id,experimentIds:r,displayFullText:a})}):e(F,{padding:"size-200",children:e(te,{variant:"info",title:"No Experiment Selected",children:"Please select one or more experiments."})})]})}const Zr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"experimentCompareLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineFragment",selections:[l,{args:null,kind:"FragmentSpread",name:"ExperimentMultiSelector__experiments"}],type:"Dataset",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"experimentCompareLoaderQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,{kind:"InlineFragment",selections:[l,{alias:null,args:null,concreteType:"ExperimentConnection",kind:"LinkedField",name:"experiments",plural:!1,selections:[{alias:null,args:null,concreteType:"ExperimentEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"experiment",args:null,concreteType:"Experiment",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,{alias:null,args:null,kind:"ScalarField",name:"sequenceNumber",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Dataset",abstractKey:null}],storageKey:null}]},params:{cacheID:"7e89f99f940098a21985137aae870de7",id:null,metadata:{},name:"experimentCompareLoaderQuery",operationKind:"query",text:`query experimentCompareLoaderQuery(
3222
3040
  $id: GlobalID!
3223
3041
  ) {
3224
3042
  dataset: node(id: $id) {
@@ -3244,7 +3062,7 @@ fragment ExperimentMultiSelector__experiments on Dataset {
3244
3062
  }
3245
3063
  }
3246
3064
  }
3247
- `}}}();Zr.hash="fa02088830fd16688f0f2fba9a0009eb";async function of(n){const{datasetId:a}=n.params;return await D.fetchQuery(xe,Zr,{id:a}).toPromise()}const Xr=function(){var n={defaultValue:null,kind:"LocalArgument",name:"description"},a={defaultValue:null,kind:"LocalArgument",name:"expiresAt"},l={defaultValue:null,kind:"LocalArgument",name:"name"},t=[{fields:[{kind:"Variable",name:"description",variableName:"description"},{kind:"Variable",name:"expiresAt",variableName:"expiresAt"},{kind:"Variable",name:"name",variableName:"name"}],kind:"ObjectValue",name:"input"}],i={alias:null,args:null,kind:"ScalarField",name:"jwt",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},o={alias:null,args:null,concreteType:"SystemApiKey",kind:"LinkedField",name:"apiKey",plural:!1,selections:[r],storageKey:null};return{fragment:{argumentDefinitions:[n,a,l],kind:"Fragment",metadata:null,name:"APIKeysCardCreateSystemAPIKeyMutation",selections:[{alias:null,args:t,concreteType:"CreateSystemApiKeyMutationPayload",kind:"LinkedField",name:"createSystemApiKey",plural:!1,selections:[i,{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"SystemAPIKeysTableFragment"}],storageKey:null},o],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[l,n,a],kind:"Operation",name:"APIKeysCardCreateSystemAPIKeyMutation",selections:[{alias:null,args:t,concreteType:"CreateSystemApiKeyMutationPayload",kind:"LinkedField",name:"createSystemApiKey",plural:!1,selections:[i,{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:null,concreteType:"SystemApiKey",kind:"LinkedField",name:"systemApiKeys",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null}],storageKey:null},o],storageKey:null}]},params:{cacheID:"799e8f0a627c6ae06e2a87c051d299d0",id:null,metadata:{},name:"APIKeysCardCreateSystemAPIKeyMutation",operationKind:"mutation",text:`mutation APIKeysCardCreateSystemAPIKeyMutation(
3065
+ `}}}();Zr.hash="fa02088830fd16688f0f2fba9a0009eb";async function bf(n){const{datasetId:a}=n.params;return await I.fetchQuery(xe,Zr,{id:a}).toPromise()}const Xr=function(){var n={defaultValue:null,kind:"LocalArgument",name:"description"},a={defaultValue:null,kind:"LocalArgument",name:"expiresAt"},t={defaultValue:null,kind:"LocalArgument",name:"name"},l=[{fields:[{kind:"Variable",name:"description",variableName:"description"},{kind:"Variable",name:"expiresAt",variableName:"expiresAt"},{kind:"Variable",name:"name",variableName:"name"}],kind:"ObjectValue",name:"input"}],i={alias:null,args:null,kind:"ScalarField",name:"jwt",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},o={alias:null,args:null,concreteType:"SystemApiKey",kind:"LinkedField",name:"apiKey",plural:!1,selections:[r],storageKey:null};return{fragment:{argumentDefinitions:[n,a,t],kind:"Fragment",metadata:null,name:"APIKeysCardCreateSystemAPIKeyMutation",selections:[{alias:null,args:l,concreteType:"CreateSystemApiKeyMutationPayload",kind:"LinkedField",name:"createSystemApiKey",plural:!1,selections:[i,{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"SystemAPIKeysTableFragment"}],storageKey:null},o],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[t,n,a],kind:"Operation",name:"APIKeysCardCreateSystemAPIKeyMutation",selections:[{alias:null,args:l,concreteType:"CreateSystemApiKeyMutationPayload",kind:"LinkedField",name:"createSystemApiKey",plural:!1,selections:[i,{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:null,concreteType:"SystemApiKey",kind:"LinkedField",name:"systemApiKeys",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null}],storageKey:null},o],storageKey:null}]},params:{cacheID:"799e8f0a627c6ae06e2a87c051d299d0",id:null,metadata:{},name:"APIKeysCardCreateSystemAPIKeyMutation",operationKind:"mutation",text:`mutation APIKeysCardCreateSystemAPIKeyMutation(
3248
3066
  $name: String!
3249
3067
  $description: String = null
3250
3068
  $expiresAt: DateTime = null
@@ -3269,7 +3087,7 @@ fragment SystemAPIKeysTableFragment on Query {
3269
3087
  expiresAt
3270
3088
  }
3271
3089
  }
3272
- `}}}();Xr.hash="a6f84fa9e14f363d2e7317d3d6507590";const Yr=function(){var n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null};return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"APIKeysCardQuery",selections:[{args:null,kind:"FragmentSpread",name:"SystemAPIKeysTableFragment"},{args:null,kind:"FragmentSpread",name:"UserAPIKeysTableFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"APIKeysCardQuery",selections:[{alias:null,args:null,concreteType:"SystemApiKey",kind:"LinkedField",name:"systemApiKeys",plural:!0,selections:[n,a,l,t,i],storageKey:null},{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"userApiKeys",plural:!0,selections:[n,a,l,t,i,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"a8cfba9eaaac34bc497efaacbff45c05",id:null,metadata:{},name:"APIKeysCardQuery",operationKind:"query",text:`query APIKeysCardQuery {
3090
+ `}}}();Xr.hash="a6f84fa9e14f363d2e7317d3d6507590";const Yr=function(){var n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null};return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"APIKeysCardQuery",selections:[{args:null,kind:"FragmentSpread",name:"SystemAPIKeysTableFragment"},{args:null,kind:"FragmentSpread",name:"UserAPIKeysTableFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"APIKeysCardQuery",selections:[{alias:null,args:null,concreteType:"SystemApiKey",kind:"LinkedField",name:"systemApiKeys",plural:!0,selections:[n,a,t,l,i],storageKey:null},{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"userApiKeys",plural:!0,selections:[n,a,t,l,i,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"a8cfba9eaaac34bc497efaacbff45c05",id:null,metadata:{},name:"APIKeysCardQuery",operationKind:"query",text:`query APIKeysCardQuery {
3273
3091
  ...SystemAPIKeysTableFragment
3274
3092
  ...UserAPIKeysTableFragment
3275
3093
  }
@@ -3317,7 +3135,7 @@ fragment SystemAPIKeysTableFragment on Query {
3317
3135
  expiresAt
3318
3136
  }
3319
3137
  }
3320
- `}};ns.hash="de0fc04de739f0adfcbdeaff28b16265";const as={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:[],operation:ns}},name:"SystemAPIKeysTableFragment",selections:[{alias:null,args:null,concreteType:"SystemApiKey",kind:"LinkedField",name:"systemApiKeys",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};as.hash="de0fc04de739f0adfcbdeaff28b16265";function Og({query:n}){const[a,l]=D.useRefetchableFragment(as,n),t=ce(),i=oe(),[r]=D.useMutation(es),o=u.useCallback(p=>{r({variables:{input:{id:p}},onCompleted:()=>{i({title:"System key deleted",message:"The system key has been deleted and is no longer active."}),u.startTransition(()=>{l({},{fetchPolicy:"network-only"})})},onError:y=>{t({title:"Error deleting system key",message:y.message})}})},[r,t,i,l]),c=u.useMemo(()=>[...a.systemApiKeys],[a]),d=u.useMemo(()=>[{header:"Name",accessorKey:"name"},{header:"Description",accessorKey:"description",cell:me},{header:"Created At",accessorKey:"createdAt",cell:Fe},{header:"Expires At",accessorKey:"expiresAt",cell:Fe},{header:"",accessorKey:"id",size:10,cell:({row:y})=>e(h,{direction:"row",justifyContent:"end",width:"100%",children:e(il,{handleDelete:()=>{o(y.original.id)}})}),meta:{textAlign:"right"}}],[o]),g=he({columns:d,data:c,getCoreRowModel:ke()}),f=g.getRowModel().rows,m=g.getRowModel().rows.length===0;return s("table",{css:We,children:[e("thead",{children:g.getHeaderGroups().map(p=>e("tr",{children:p.headers.map(y=>e("th",{colSpan:y.colSpan,children:y.isPlaceholder?null:s("div",{className:y.column.getCanSort()?"cursor-pointer":"",onClick:y.column.getToggleSortingHandler(),style:{left:y.getStart(),width:y.getSize()},children:[Z(y.column.columnDef.header,y.getContext()),y.column.getIsSorted()?e(P,{className:"sort-icon",svg:y.column.getIsSorted()==="asc"?e(I.ArrowUpFilled,{}):e(I.ArrowDownFilled,{})}):null]})},y.id))},p.id))}),m?e(Je,{message:"No Keys"}):e("tbody",{children:f.map(p=>e("tr",{children:p.getVisibleCells().map(y=>e("td",{children:Z(y.column.columnDef.cell,y.getContext())},y.id))},p.id))})]})}const ls=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DeleteApiKeyMutationPayload",kind:"LinkedField",name:"deleteUserApiKey",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"apiKeyId",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"UserAPIKeysTableDeleteAPIKeyMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"UserAPIKeysTableDeleteAPIKeyMutation",selections:a},params:{cacheID:"d137498515ff43864f5525b3c1847376",id:null,metadata:{},name:"UserAPIKeysTableDeleteAPIKeyMutation",operationKind:"mutation",text:`mutation UserAPIKeysTableDeleteAPIKeyMutation(
3138
+ `}};ns.hash="de0fc04de739f0adfcbdeaff28b16265";const as={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:[],operation:ns}},name:"SystemAPIKeysTableFragment",selections:[{alias:null,args:null,concreteType:"SystemApiKey",kind:"LinkedField",name:"systemApiKeys",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};as.hash="de0fc04de739f0adfcbdeaff28b16265";function Ag({query:n}){const[a,t]=I.useRefetchableFragment(as,n),l=ce(),i=oe(),[r]=I.useMutation(es),o=u.useCallback(p=>{r({variables:{input:{id:p}},onCompleted:()=>{i({title:"System key deleted",message:"The system key has been deleted and is no longer active."}),u.startTransition(()=>{t({},{fetchPolicy:"network-only"})})},onError:y=>{l({title:"Error deleting system key",message:y.message})}})},[r,l,i,t]),c=u.useMemo(()=>[...a.systemApiKeys],[a]),d=u.useMemo(()=>[{header:"Name",accessorKey:"name"},{header:"Description",accessorKey:"description",cell:me},{header:"Created At",accessorKey:"createdAt",cell:Fe},{header:"Expires At",accessorKey:"expiresAt",cell:Fe},{header:"",accessorKey:"id",size:10,cell:({row:y})=>e(h,{direction:"row",justifyContent:"end",width:"100%",children:e(ut,{handleDelete:()=>{o(y.original.id)}})}),meta:{textAlign:"right"}}],[o]),g=ke({columns:d,data:c,getCoreRowModel:be()}),f=g.getRowModel().rows,m=g.getRowModel().rows.length===0;return s("table",{css:He,children:[e("thead",{children:g.getHeaderGroups().map(p=>e("tr",{children:p.headers.map(y=>e("th",{colSpan:y.colSpan,children:y.isPlaceholder?null:s("div",{className:y.column.getCanSort()?"cursor-pointer":"",onClick:y.column.getToggleSortingHandler(),style:{left:y.getStart(),width:y.getSize()},children:[X(y.column.columnDef.header,y.getContext()),y.column.getIsSorted()?e(w,{className:"sort-icon",svg:y.column.getIsSorted()==="asc"?e(L.ArrowUpFilled,{}):e(L.ArrowDownFilled,{})}):null]})},y.id))},p.id))}),m?e(Ge,{message:"No Keys"}):e("tbody",{children:f.map(p=>e("tr",{children:p.getVisibleCells().map(y=>e("td",{children:X(y.column.columnDef.cell,y.getContext())},y.id))},p.id))})]})}const ts=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DeleteApiKeyMutationPayload",kind:"LinkedField",name:"deleteUserApiKey",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"apiKeyId",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"UserAPIKeysTableDeleteAPIKeyMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"UserAPIKeysTableDeleteAPIKeyMutation",selections:a},params:{cacheID:"d137498515ff43864f5525b3c1847376",id:null,metadata:{},name:"UserAPIKeysTableDeleteAPIKeyMutation",operationKind:"mutation",text:`mutation UserAPIKeysTableDeleteAPIKeyMutation(
3321
3139
  $input: DeleteApiKeyInput!
3322
3140
  ) {
3323
3141
  deleteUserApiKey(input: $input) {
@@ -3325,7 +3143,7 @@ fragment SystemAPIKeysTableFragment on Query {
3325
3143
  apiKeyId
3326
3144
  }
3327
3145
  }
3328
- `}}}();ls.hash="9b1d898d1d9858016bed85000ce3906e";const ts={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"UserAPIKeysTableQuery",selections:[{args:null,kind:"FragmentSpread",name:"UserAPIKeysTableFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"UserAPIKeysTableQuery",selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"userApiKeys",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"e70d413b072841dff8565a332590a549",id:null,metadata:{},name:"UserAPIKeysTableQuery",operationKind:"query",text:`query UserAPIKeysTableQuery {
3146
+ `}}}();ts.hash="9b1d898d1d9858016bed85000ce3906e";const ls={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"UserAPIKeysTableQuery",selections:[{args:null,kind:"FragmentSpread",name:"UserAPIKeysTableFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"UserAPIKeysTableQuery",selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"userApiKeys",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"e70d413b072841dff8565a332590a549",id:null,metadata:{},name:"UserAPIKeysTableQuery",operationKind:"query",text:`query UserAPIKeysTableQuery {
3329
3147
  ...UserAPIKeysTableFragment
3330
3148
  }
3331
3149
 
@@ -3341,7 +3159,7 @@ fragment UserAPIKeysTableFragment on Query {
3341
3159
  }
3342
3160
  }
3343
3161
  }
3344
- `}};ts.hash="c2b3a579bcb0ba915523ecb35cae3b44";const is={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:[],operation:ts}},name:"UserAPIKeysTableFragment",selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"userApiKeys",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};is.hash="c2b3a579bcb0ba915523ecb35cae3b44";const Pl=70;function Qg({query:n}){const[a,l]=D.useRefetchableFragment(is,n),t=ce(),i=oe(),[r]=D.useMutation(ls),o=u.useCallback(p=>{r({variables:{input:{id:p}},onCompleted:()=>{i({title:"User key deleted",message:"The user key has been deleted and is no longer active."}),u.startTransition(()=>{l({},{fetchPolicy:"network-only"})})},onError:y=>{t({title:"Error deleting user key",message:y.message})}})},[r,t,i,l]),c=u.useMemo(()=>[...a.userApiKeys],[a]),d=u.useMemo(()=>[{header:"Name",accessorKey:"name",size:100,cell:me},{header:"Description",accessorKey:"description",cell:me},{header:"Created At",accessorKey:"createdAt",size:Pl,cell:Fe},{header:"Expires At",accessorKey:"expiresAt",size:Pl,cell:Fe},{header:"User",size:120,accessorKey:"user.email",cell:me},{header:"",accessorKey:"id",size:10,cell:({row:y})=>e(h,{direction:"row",justifyContent:"end",width:"100%",children:e(il,{handleDelete:()=>{o(y.original.id)}})}),meta:{textAlign:"right"}}],[o]),g=he({columns:d,data:c,getCoreRowModel:ke()}),f=g.getRowModel().rows,m=g.getRowModel().rows.length===0;return s("table",{css:We,children:[e("thead",{children:g.getHeaderGroups().map(p=>e("tr",{children:p.headers.map(y=>e("th",{colSpan:y.colSpan,children:y.isPlaceholder?null:s("div",{className:y.column.getCanSort()?"cursor-pointer":"",onClick:y.column.getToggleSortingHandler(),style:{left:y.getStart(),width:y.getSize()},children:[Z(y.column.columnDef.header,y.getContext()),y.column.getIsSorted()?e(P,{className:"sort-icon",svg:y.column.getIsSorted()==="asc"?e(I.ArrowUpFilled,{}):e(I.ArrowDownFilled,{})}):null]})},y.id))},p.id))}),m?e(Je,{message:"No Keys"}):e("tbody",{children:f.map(p=>e("tr",{children:p.getVisibleCells().map(y=>e("td",{children:Z(y.column.columnDef.cell,y.getContext())},y.id))},p.id))})]})}function jg(){const n=D.useLazyLoadQuery(Yr,{},{fetchPolicy:"network-only"});return s(Te,{children:[e(J,{title:"System Keys",name:"System Keys",children:e(Og,{query:n})}),e(J,{title:"User Keys",name:"User Keys",children:e(Qg,{query:n})})]})}function qg(){const[n,a]=u.useState(null),l=ce(),t=d=>{a(e(st,{jwt:d}))},[i,r]=D.useMutation(Xr),o=u.useCallback(d=>{i({variables:{...d,expiresAt:d.expiresAt||null},onCompleted:g=>{t(g.createSystemApiKey.jwt)},onError:g=>{l({title:"Error creating system key",message:g.message})}})},[i,l]),c=()=>{a(e(ot,{onSubmit:o,isCommitting:r,defaultName:"System"}))};return s("div",{children:[e(Wa,{title:"API Keys",variant:"compact",extra:e(M,{variant:"default",size:"compact",icon:e(P,{svg:e(I.PlusCircleOutline,{})}),onClick:c,children:"System Key"}),children:e(u.Suspense,{fallback:e(F,{padding:"size-100",children:e(fe,{})}),children:e(jg,{})})}),e(W,{onDismiss:()=>{a(null)},children:n})]})}const rs={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"UsersCardQuery",selections:[{args:null,kind:"FragmentSpread",name:"UsersTable_users"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"UsersCardQuery",selections:[{alias:null,args:null,concreteType:"UserConnection",kind:"LinkedField",name:"users",plural:!1,selections:[{alias:null,args:null,concreteType:"UserEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"user",args:null,concreteType:"User",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"authMethod",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null},{alias:null,args:null,concreteType:"UserRole",kind:"LinkedField",name:"role",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"926faf98cad4bc437a919677347e277c",id:null,metadata:{},name:"UsersCardQuery",operationKind:"query",text:`query UsersCardQuery {
3162
+ `}};ls.hash="c2b3a579bcb0ba915523ecb35cae3b44";const is={argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:[],operation:ls}},name:"UserAPIKeysTableFragment",selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"userApiKeys",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};is.hash="c2b3a579bcb0ba915523ecb35cae3b44";const Vt=70;function Rg({query:n}){const[a,t]=I.useRefetchableFragment(is,n),l=ce(),i=oe(),[r]=I.useMutation(ts),o=u.useCallback(p=>{r({variables:{input:{id:p}},onCompleted:()=>{i({title:"User key deleted",message:"The user key has been deleted and is no longer active."}),u.startTransition(()=>{t({},{fetchPolicy:"network-only"})})},onError:y=>{l({title:"Error deleting user key",message:y.message})}})},[r,l,i,t]),c=u.useMemo(()=>[...a.userApiKeys],[a]),d=u.useMemo(()=>[{header:"Name",accessorKey:"name",size:100,cell:me},{header:"Description",accessorKey:"description",cell:me},{header:"Created At",accessorKey:"createdAt",size:Vt,cell:Fe},{header:"Expires At",accessorKey:"expiresAt",size:Vt,cell:Fe},{header:"User",size:120,accessorKey:"user.email",cell:me},{header:"",accessorKey:"id",size:10,cell:({row:y})=>e(h,{direction:"row",justifyContent:"end",width:"100%",children:e(ut,{handleDelete:()=>{o(y.original.id)}})}),meta:{textAlign:"right"}}],[o]),g=ke({columns:d,data:c,getCoreRowModel:be()}),f=g.getRowModel().rows,m=g.getRowModel().rows.length===0;return s("table",{css:He,children:[e("thead",{children:g.getHeaderGroups().map(p=>e("tr",{children:p.headers.map(y=>e("th",{colSpan:y.colSpan,children:y.isPlaceholder?null:s("div",{className:y.column.getCanSort()?"cursor-pointer":"",onClick:y.column.getToggleSortingHandler(),style:{left:y.getStart(),width:y.getSize()},children:[X(y.column.columnDef.header,y.getContext()),y.column.getIsSorted()?e(w,{className:"sort-icon",svg:y.column.getIsSorted()==="asc"?e(L.ArrowUpFilled,{}):e(L.ArrowDownFilled,{})}):null]})},y.id))},p.id))}),m?e(Ge,{message:"No Keys"}):e("tbody",{children:f.map(p=>e("tr",{children:p.getVisibleCells().map(y=>e("td",{children:X(y.column.columnDef.cell,y.getContext())},y.id))},p.id))})]})}function Mg(){const n=I.useLazyLoadQuery(Yr,{},{fetchPolicy:"network-only"});return s(Pe,{children:[e(J,{title:"System Keys",name:"System Keys",children:e(Ag,{query:n})}),e(J,{title:"User Keys",name:"User Keys",children:e(Rg,{query:n})})]})}function Ng(){const[n,a]=u.useState(null),t=ce(),l=d=>{a(e(yl,{jwt:d}))},[i,r]=I.useMutation(Xr),o=u.useCallback(d=>{i({variables:{...d,expiresAt:d.expiresAt||null},onCompleted:g=>{l(g.createSystemApiKey.jwt)},onError:g=>{t({title:"Error creating system key",message:g.message})}})},[i,t]),c=()=>{a(e(fl,{onSubmit:o,isCommitting:r,defaultName:"System"}))};return s("div",{children:[e(Ya,{title:"API Keys",variant:"compact",extra:e(N,{variant:"default",size:"compact",icon:e(w,{svg:e(L.PlusCircleOutline,{})}),onClick:c,children:"System Key"}),children:e(u.Suspense,{fallback:e(F,{padding:"size-100",children:e(he,{})}),children:e(Mg,{})})}),e(W,{onDismiss:()=>{a(null)},children:n})]})}const rs={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"UsersCardQuery",selections:[{args:null,kind:"FragmentSpread",name:"UsersTable_users"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"UsersCardQuery",selections:[{alias:null,args:null,concreteType:"UserConnection",kind:"LinkedField",name:"users",plural:!1,selections:[{alias:null,args:null,concreteType:"UserEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"user",args:null,concreteType:"User",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"authMethod",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null},{alias:null,args:null,concreteType:"UserRole",kind:"LinkedField",name:"role",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"926faf98cad4bc437a919677347e277c",id:null,metadata:{},name:"UsersCardQuery",operationKind:"query",text:`query UsersCardQuery {
3345
3163
  ...UsersTable_users
3346
3164
  }
3347
3165
 
@@ -3372,7 +3190,7 @@ fragment UsersTable_users on Query {
3372
3190
  }
3373
3191
  }
3374
3192
  }
3375
- `}}}();ss.hash="97d1aefa41e8831e57b6bb0d1a078a7c";function Ug({onNewUserCreated:n,onNewUserCreationError:a,onDismiss:l}){const[t,i]=D.useMutation(ss),r=u.useCallback(o=>{t({variables:{input:{email:o.email,username:o.username,password:o.password,role:o.role}},onCompleted:c=>{n(c.createUser.user.email)},onError:c=>{a(c)}})},[t,n,a]);return e(W,{onDismiss:l,isDismissable:!0,type:"modal",isKeyboardDismissDisabled:!0,children:e(H,{title:"Add user",children:e(sd,{onSubmit:r,isSubmitting:i})})})}const os={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"UsersTableQuery",selections:[{args:null,kind:"FragmentSpread",name:"UsersTable_users"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"UsersTableQuery",selections:[{alias:null,args:null,concreteType:"UserConnection",kind:"LinkedField",name:"users",plural:!1,selections:[{alias:null,args:null,concreteType:"UserEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"user",args:null,concreteType:"User",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"authMethod",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null},{alias:null,args:null,concreteType:"UserRole",kind:"LinkedField",name:"role",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"d3f85064b63f026a47a8ef139638b933",id:null,metadata:{},name:"UsersTableQuery",operationKind:"query",text:`query UsersTableQuery {
3193
+ `}}}();ss.hash="97d1aefa41e8831e57b6bb0d1a078a7c";function zg({onNewUserCreated:n,onNewUserCreationError:a,onDismiss:t}){const[l,i]=I.useMutation(ss),r=u.useCallback(o=>{l({variables:{input:{email:o.email,username:o.username,password:o.password,role:o.role}},onCompleted:c=>{n(c.createUser.user.email)},onError:c=>{a(c)}})},[l,n,a]);return e(W,{onDismiss:t,isDismissable:!0,type:"modal",isKeyboardDismissDisabled:!0,children:e(B,{title:"Add user",children:e(dd,{onSubmit:r,isSubmitting:i})})})}const os={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"UsersTableQuery",selections:[{args:null,kind:"FragmentSpread",name:"UsersTable_users"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"UsersTableQuery",selections:[{alias:null,args:null,concreteType:"UserConnection",kind:"LinkedField",name:"users",plural:!1,selections:[{alias:null,args:null,concreteType:"UserEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"user",args:null,concreteType:"User",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"authMethod",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null},{alias:null,args:null,concreteType:"UserRole",kind:"LinkedField",name:"role",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"d3f85064b63f026a47a8ef139638b933",id:null,metadata:{},name:"UsersTableQuery",operationKind:"query",text:`query UsersTableQuery {
3376
3194
  ...UsersTable_users
3377
3195
  }
3378
3196
 
@@ -3398,32 +3216,32 @@ fragment UsersTable_users on Query {
3398
3216
  ) {
3399
3217
  deleteUsers(input: $input)
3400
3218
  }
3401
- `}}}();cs.hash="a718ceab0ec0a7d461f6cd5e5b178a1f";function Bg({userId:n,onDeleted:a,onClose:l}){const[t,i]=D.useMutation(cs),r=oe(),o=ce(),c=u.useCallback(()=>{t({variables:{input:{userIds:[n]}},onCompleted:()=>{r({title:"User deleted",message:"User has been deleted."}),a(),l()},onError:d=>{o({title:"Failed to delete user",message:d.message})}})},[t,o,r,l,a,n]);return s(H,{title:"Delete User",isDismissable:!0,onDismiss:l,children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:"Are you sure you want to delete this user? This action cannot be undone."})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:s(h,{direction:"row",justifyContent:"end",gap:"size-100",children:[e(M,{variant:"default",onClick:l,children:"Cancel"}),e(M,{variant:"danger",onClick:()=>{c()},disabled:i,children:"Delete user"})]})})]})}const us=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"UserMutationPayload",kind:"LinkedField",name:"patchUser",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ResetPasswordDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ResetPasswordDialogMutation",selections:a},params:{cacheID:"6ccff8dd53d97eeb41f656bcd2758da1",id:null,metadata:{},name:"ResetPasswordDialogMutation",operationKind:"mutation",text:`mutation ResetPasswordDialogMutation(
3219
+ `}}}();cs.hash="a718ceab0ec0a7d461f6cd5e5b178a1f";function Vg({userId:n,onDeleted:a,onClose:t}){const[l,i]=I.useMutation(cs),r=oe(),o=ce(),c=u.useCallback(()=>{l({variables:{input:{userIds:[n]}},onCompleted:()=>{r({title:"User deleted",message:"User has been deleted."}),a(),t()},onError:d=>{o({title:"Failed to delete user",message:d.message})}})},[l,o,r,t,a,n]);return s(B,{title:"Delete User",isDismissable:!0,onDismiss:t,children:[e(F,{padding:"size-200",children:e(K,{color:"danger",children:"Are you sure you want to delete this user? This action cannot be undone."})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:s(h,{direction:"row",justifyContent:"end",gap:"size-100",children:[e(N,{variant:"default",onClick:t,children:"Cancel"}),e(N,{variant:"danger",onClick:()=>{c()},disabled:i,children:"Delete user"})]})})]})}const us=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"UserMutationPayload",kind:"LinkedField",name:"patchUser",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ResetPasswordDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ResetPasswordDialogMutation",selections:a},params:{cacheID:"6ccff8dd53d97eeb41f656bcd2758da1",id:null,metadata:{},name:"ResetPasswordDialogMutation",operationKind:"mutation",text:`mutation ResetPasswordDialogMutation(
3402
3220
  $input: PatchUserInput!
3403
3221
  ) {
3404
3222
  patchUser(input: $input) {
3405
3223
  __typename
3406
3224
  }
3407
3225
  }
3408
- `}}}();us.hash="85b22da61ec094c28e97db2759622b69";const Wn=4;function Hg({userId:n,onClose:a}){const l=ce(),t=oe(),[i,r]=D.useMutation(us),{control:o,handleSubmit:c,formState:{isDirty:d}}=Ie({defaultValues:{newPassword:"",confirmPassword:""}}),g=u.useCallback(f=>{i({variables:{input:{userId:n,newPassword:f.newPassword}},onCompleted:()=>{t({title:"Password reset",message:"Users password has been reset."}),a()},onError:m=>{l({title:"Failed to reset password",message:m.message})}})},[i,l,t,a,n]);return e(H,{title:"Reset Password",isDismissable:!0,onDismiss:a,children:e(ye,{children:s(F,{padding:"size-200",children:[e(G,{name:"newPassword",control:o,rules:{required:"Password is required",minLength:{value:Wn,message:`Password must be at least ${Wn} characters`}},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:b,error:k}})=>e(X,{label:"New Password",type:"password",isRequired:!0,description:`Password must be at least ${Wn} characters`,name:f,errorMessage:k==null?void 0:k.message,validationState:b?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})}),e(G,{name:"confirmPassword",control:o,rules:{required:"Password is required",minLength:{value:Wn,message:`Password must be at least ${Wn} characters`},validate:(f,m)=>f===m.newPassword||"Passwords do not match"},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:b,error:k}})=>e(X,{label:"Confirm Password",isRequired:!0,type:"password",description:"Confirm the new password",name:f,errorMessage:k==null?void 0:k.message,validationState:b?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})}),e(F,{paddingTop:"size-200",children:e(h,{direction:"row",gap:"size-100",justifyContent:"end",children:e(M,{variant:d?"primary":"default",type:"submit",disabled:r,onClick:c(g),children:r?"Resetting...":"Reset Password"})})})]})})})}function Gg(n){return n==="LOCAL"}function Wg(n){const{userId:a,onUserDeleted:l,authMethod:t}=n,[i,r]=u.useState(null),o=u.useCallback(()=>{r(e(Bg,{userId:a,onClose:()=>r(null),onDeleted:()=>{l(),r(null)}}))},[a,l]),c=u.useCallback(()=>{r(e(Hg,{userId:a,onClose:()=>r(null)}))},[a]),d=u.useMemo(()=>{const g=e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.TrashOutline,{})}),e(K,{children:"Delete"})]})},"deleteUser"),f=e(B,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(P,{svg:e(I.Refresh,{})}),e(K,{children:"Reset Password"})]})},"resetPassword"),m=[g];return Gg(t)&&m.push(f),m},[t]);return s("div",{onClick:g=>{g.preventDefault(),g.stopPropagation()},children:[e(Be,{align:"end","aria-label":"User Actions",buttonSize:"compact",onAction:g=>{switch(g){case"deleteUser":o();break;case"resetPassword":c();break}},children:d}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>r(null),children:i})]})}const ms=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"UserMutationPayload",kind:"LinkedField",name:"patchUser",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"UserRoleChangeDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"UserRoleChangeDialogMutation",selections:a},params:{cacheID:"44e970c967f83a0b7a6bd1cbafc3a936",id:null,metadata:{},name:"UserRoleChangeDialogMutation",operationKind:"mutation",text:`mutation UserRoleChangeDialogMutation(
3226
+ `}}}();us.hash="85b22da61ec094c28e97db2759622b69";const Yn=4;function $g({userId:n,onClose:a}){const t=ce(),l=oe(),[i,r]=I.useMutation(us),{control:o,handleSubmit:c,formState:{isDirty:d}}=Ae({defaultValues:{newPassword:"",confirmPassword:""}}),g=u.useCallback(f=>{i({variables:{input:{userId:n,newPassword:f.newPassword}},onCompleted:()=>{l({title:"Password reset",message:"Users password has been reset."}),a()},onError:m=>{t({title:"Failed to reset password",message:m.message})}})},[i,t,l,a,n]);return e(B,{title:"Reset Password",isDismissable:!0,onDismiss:a,children:e(fe,{children:s(F,{padding:"size-200",children:[e(Z,{name:"newPassword",control:o,rules:{required:"Password is required",minLength:{value:Yn,message:`Password must be at least ${Yn} characters`}},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:k,error:S}})=>e(G,{label:"New Password",type:"password",isRequired:!0,description:`Password must be at least ${Yn} characters`,name:f,errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})}),e(Z,{name:"confirmPassword",control:o,rules:{required:"Password is required",minLength:{value:Yn,message:`Password must be at least ${Yn} characters`},validate:(f,m)=>f===m.newPassword||"Passwords do not match"},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:k,error:S}})=>e(G,{label:"Confirm Password",isRequired:!0,type:"password",description:"Confirm the new password",name:f,errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})}),e(F,{paddingTop:"size-200",children:e(h,{direction:"row",gap:"size-100",justifyContent:"end",children:e(N,{variant:d?"primary":"default",type:"submit",disabled:r,onClick:c(g),children:r?"Resetting...":"Reset Password"})})})]})})})}function Og(n){return n==="LOCAL"}function Qg(n){const{userId:a,onUserDeleted:t,authMethod:l}=n,[i,r]=u.useState(null),o=u.useCallback(()=>{r(e(Vg,{userId:a,onClose:()=>r(null),onDeleted:()=>{t(),r(null)}}))},[a,t]),c=u.useCallback(()=>{r(e($g,{userId:a,onClose:()=>r(null)}))},[a]),d=u.useMemo(()=>{const g=e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.TrashOutline,{})}),e(K,{children:"Delete"})]})},"deleteUser"),f=e(U,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(w,{svg:e(L.Refresh,{})}),e(K,{children:"Reset Password"})]})},"resetPassword"),m=[g];return Og(l)&&m.push(f),m},[l]);return s("div",{onClick:g=>{g.preventDefault(),g.stopPropagation()},children:[e(ln,{align:"end","aria-label":"User Actions",buttonSize:"compact",onAction:g=>{switch(g){case"deleteUser":o();break;case"resetPassword":c();break}},children:d}),e(W,{type:"modal",isDismissable:!0,onDismiss:()=>r(null),children:i})]})}const ms=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"UserMutationPayload",kind:"LinkedField",name:"patchUser",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"UserRoleChangeDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"UserRoleChangeDialogMutation",selections:a},params:{cacheID:"44e970c967f83a0b7a6bd1cbafc3a936",id:null,metadata:{},name:"UserRoleChangeDialogMutation",operationKind:"mutation",text:`mutation UserRoleChangeDialogMutation(
3409
3227
  $input: PatchUserInput!
3410
3228
  ) {
3411
3229
  patchUser(input: $input) {
3412
3230
  __typename
3413
3231
  }
3414
3232
  }
3415
- `}}}();ms.hash="468eff05b42e39b55f9aa5b9a7d2c483";function Jg({userId:n,email:a,currentRole:l,newRole:t,onRoleChanged:i,onClose:r}){const[o,c]=D.useMutation(ms),d=oe(),g=ce(),f=u.useCallback(()=>{o({variables:{input:{userId:n,newRole:t}},onCompleted:()=>{d({title:"Role Changed",message:"Users role has been changed."}),i(),r()},onError:m=>{g({title:"Failed to delete user",message:m.message})}})},[o,t,g,d,r,i,n]);return s(H,{title:"Confirm role change",children:[e(F,{padding:"size-200",children:s(K,{children:[`Are you sure you want to change the role for ${a} from `," ",e("b",{children:qa(l)})," to"," ",e("b",{children:qa(t)}),"?"]})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:s(h,{direction:"row",justifyContent:"end",gap:"size-100",children:[e(M,{variant:"default",onClick:r,children:"Cancel"}),e(M,{variant:"primary",onClick:()=>{f()},disabled:c,children:"Change role"})]})})]})}const Zg=55,Xg=C`
3233
+ `}}}();ms.hash="468eff05b42e39b55f9aa5b9a7d2c483";function jg({userId:n,email:a,currentRole:t,newRole:l,onRoleChanged:i,onClose:r}){const[o,c]=I.useMutation(ms),d=oe(),g=ce(),f=u.useCallback(()=>{o({variables:{input:{userId:n,newRole:l}},onCompleted:()=>{d({title:"Role Changed",message:"Users role has been changed."}),i(),r()},onError:m=>{g({title:"Failed to delete user",message:m.message})}})},[o,l,g,d,r,i,n]);return s(B,{title:"Confirm role change",children:[e(F,{padding:"size-200",children:s(K,{children:[`Are you sure you want to change the role for ${a} from `," ",e("b",{children:Ga(t)})," to"," ",e("b",{children:Ga(l)}),"?"]})}),e(F,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:s(h,{direction:"row",justifyContent:"end",gap:"size-100",children:[e(N,{variant:"default",onClick:r,children:"Cancel"}),e(N,{variant:"primary",onClick:()=>{f()},disabled:c,children:"Change role"})]})})]})}const qg=55,Ug=v`
3416
3234
  text-decoration: none;
3417
3235
  color: var(--ac-global-color-grey-600);
3418
3236
  font-size: 12px;
3419
3237
  &:hover {
3420
3238
  text-decoration: underline;
3421
3239
  }
3422
- `,Yg=C`
3423
- height: ${Zg}px;
3424
- `,wl=n=>n.email==="admin@localhost"||n.username==="admin";function ep({query:n}){const[a,l]=u.useState(null),[t,i]=D.useRefetchableFragment(ds,n),r=u.useMemo(()=>t.users.edges.map(({user:m})=>({id:m.id,email:m.email,username:m.username,profilePictureUrl:m.profilePictureUrl,createdAt:m.createdAt,role:m.role.name,authMethod:m.authMethod})),[t]),o=u.useCallback(()=>{u.startTransition(()=>{i({},{fetchPolicy:"network-only"})})},[i]),c=u.useMemo(()=>[{header:"user",accessorKey:"username",cell:({row:m})=>s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(dt,{name:m.original.username,profilePictureUrl:m.original.profilePictureUrl,size:20}),e("span",{children:m.original.username}),e("a",{href:`mailto:${m.original.email}`,css:Xg,children:m.original.email})]})},{header:"method",accessorKey:"authMethod",size:10,cell:({row:m})=>m.original.authMethod.toLowerCase()},{header:"role",accessorKey:"role",cell:({row:m})=>wl(m.original)?qa(m.original.role):e(dd,{includeLabel:!1,onChange:p=>{p!==m.original.role&&l(e(Jg,{onClose:()=>l(null),onRoleChanged:o,currentRole:m.original.role,newRole:p,email:m.original.email,userId:m.original.id}))},role:od(m.original.role)?m.original.role:void 0})},{header:"created at",accessorKey:"createdAt",cell:Fe},{header:"",accessorKey:"id",size:10,cell:({row:m})=>wl(m.original)?null:e(h,{direction:"row",justifyContent:"end",width:"100%",children:e(Wg,{userId:m.original.id,onUserDeleted:o,authMethod:m.original.authMethod})}),meta:{textAlign:"right"}}],[o]),d=he({columns:c,data:r,getCoreRowModel:ke(),getSortedRowModel:Rn()}),g=d.getRowModel().rows,f=d.getRowModel().rows.length===0;return s("table",{css:We,children:[e("thead",{children:d.getHeaderGroups().map(m=>e("tr",{children:m.headers.map(p=>e("th",{colSpan:p.colSpan,children:p.isPlaceholder?null:s("div",{className:p.column.getCanSort()?"cursor-pointer":"",onClick:p.column.getToggleSortingHandler(),style:{left:p.getStart(),width:p.getSize()},children:[Z(p.column.columnDef.header,p.getContext()),p.column.getIsSorted()?e(P,{className:"sort-icon",svg:p.column.getIsSorted()==="asc"?e(I.ArrowUpFilled,{}):e(I.ArrowDownFilled,{})}):null]})},p.id))},m.id))}),f?e(Je,{}):e("tbody",{children:g.map(m=>e("tr",{css:Yg,children:m.getVisibleCells().map(p=>e("td",{children:Z(p.column.columnDef.cell,p.getContext())},p.id))},m.id))}),e(W,{onDismiss:()=>l(null),isDismissable:!0,type:"modal",children:a})]})}function np(){const[n,a]=u.useState(0),[l,t]=u.useState(null),i=oe(),r=ce(),o=D.useLazyLoadQuery(rs,{},{fetchKey:n,fetchPolicy:"store-and-network"});return s(V,{title:"Users",variant:"compact",bodyStyle:{padding:0,overflowX:"auto"},extra:e(M,{onClick:()=>{t(e(Ug,{onDismiss:()=>{t(null)},onNewUserCreated:c=>{t(null),i({title:"User added",message:`User ${c} has been added.`}),a(d=>d+1)},onNewUserCreationError:c=>{r({title:"Error adding user",message:c.message})}}))},variant:"default",size:"compact",icon:e(P,{svg:e(I.PlusCircleOutline,{})}),children:"Add User"}),children:[e(u.Suspense,{fallback:e(F,{padding:"size-200",children:e(fe,{})}),children:e(ep,{query:o})}),e(W,{onDismiss:()=>{t(null)},children:l})]})}const ap=C`
3240
+ `,Bg=v`
3241
+ height: ${qg}px;
3242
+ `,$t=n=>n.email==="admin@localhost"||n.username==="admin";function Hg({query:n}){const[a,t]=u.useState(null),[l,i]=I.useRefetchableFragment(ds,n),r=u.useMemo(()=>l.users.edges.map(({user:m})=>({id:m.id,email:m.email,username:m.username,profilePictureUrl:m.profilePictureUrl,createdAt:m.createdAt,role:m.role.name,authMethod:m.authMethod})),[l]),o=u.useCallback(()=>{u.startTransition(()=>{i({},{fetchPolicy:"network-only"})})},[i]),c=u.useMemo(()=>[{header:"user",accessorKey:"username",cell:({row:m})=>s(h,{direction:"row",gap:"size-50",alignItems:"center",children:[e(hl,{name:m.original.username,profilePictureUrl:m.original.profilePictureUrl,size:20}),e("span",{children:m.original.username}),e("a",{href:`mailto:${m.original.email}`,css:Ug,children:m.original.email})]})},{header:"method",accessorKey:"authMethod",size:10,cell:({row:m})=>m.original.authMethod.toLowerCase()},{header:"role",accessorKey:"role",cell:({row:m})=>$t(m.original)?Ga(m.original.role):e(ud,{includeLabel:!1,onChange:p=>{p!==m.original.role&&t(e(jg,{onClose:()=>t(null),onRoleChanged:o,currentRole:m.original.role,newRole:p,email:m.original.email,userId:m.original.id}))},role:cd(m.original.role)?m.original.role:void 0})},{header:"created at",accessorKey:"createdAt",cell:Fe},{header:"",accessorKey:"id",size:10,cell:({row:m})=>$t(m.original)?null:e(h,{direction:"row",justifyContent:"end",width:"100%",children:e(Qg,{userId:m.original.id,onUserDeleted:o,authMethod:m.original.authMethod})}),meta:{textAlign:"right"}}],[o]),d=ke({columns:c,data:r,getCoreRowModel:be(),getSortedRowModel:Nn()}),g=d.getRowModel().rows,f=d.getRowModel().rows.length===0;return s("table",{css:He,children:[e("thead",{children:d.getHeaderGroups().map(m=>e("tr",{children:m.headers.map(p=>e("th",{colSpan:p.colSpan,children:p.isPlaceholder?null:s("div",{className:p.column.getCanSort()?"cursor-pointer":"",onClick:p.column.getToggleSortingHandler(),style:{left:p.getStart(),width:p.getSize()},children:[X(p.column.columnDef.header,p.getContext()),p.column.getIsSorted()?e(w,{className:"sort-icon",svg:p.column.getIsSorted()==="asc"?e(L.ArrowUpFilled,{}):e(L.ArrowDownFilled,{})}):null]})},p.id))},m.id))}),f?e(Ge,{}):e("tbody",{children:g.map(m=>e("tr",{css:Bg,children:m.getVisibleCells().map(p=>e("td",{children:X(p.column.columnDef.cell,p.getContext())},p.id))},m.id))}),e(W,{onDismiss:()=>t(null),isDismissable:!0,type:"modal",children:a})]})}function Gg(){const[n,a]=u.useState(0),[t,l]=u.useState(null),i=oe(),r=ce(),o=I.useLazyLoadQuery(rs,{},{fetchKey:n,fetchPolicy:"store-and-network"});return s($,{title:"Users",variant:"compact",bodyStyle:{padding:0,overflowX:"auto"},extra:e(N,{onClick:()=>{l(e(zg,{onDismiss:()=>{l(null)},onNewUserCreated:c=>{l(null),i({title:"User added",message:`User ${c} has been added.`}),a(d=>d+1)},onNewUserCreationError:c=>{r({title:"Error adding user",message:c.message})}}))},variant:"default",size:"compact",icon:e(w,{svg:e(L.PlusCircleOutline,{})}),children:"Add User"}),children:[e(u.Suspense,{fallback:e(F,{padding:"size-200",children:e(he,{})}),children:e(Hg,{query:o})}),e(W,{onDismiss:()=>{l(null)},children:t})]})}const Wg=v`
3425
3243
  overflow-y: auto;
3426
- `,lp=C`
3244
+ `,Jg=v`
3427
3245
  padding: var(--ac-global-dimension-size-400);
3428
3246
  max-width: 1000px;
3429
3247
  min-width: 500px;
@@ -3431,12 +3249,12 @@ fragment UsersTable_users on Query {
3431
3249
  width: 100%;
3432
3250
  margin-left: auto;
3433
3251
  margin-right: auto;
3434
- `,tp=C`
3252
+ `,Zg=v`
3435
3253
  .ac-field {
3436
3254
  // Hacky solution to make the text fields fill the remaining space
3437
3255
  width: calc(100% - var(--ac-global-dimension-size-600));
3438
3256
  }
3439
- `;function df(){return e("main",{css:ap,children:e("div",{css:lp,children:s(h,{direction:"column",gap:"size-200",width:"100%",children:[e(V,{title:"Platform Settings",variant:"compact",children:s("form",{css:tp,children:[s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(X,{label:"Hostname",value:ja,isReadOnly:!0,description:"Connect to Phoenix over HTTP"}),e(Oa,{text:ja})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(X,{label:"Platform Version",isReadOnly:!0,value:ua,description:"The version of the Phoenix server"}),e(Oa,{text:ua})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",justifyContent:"center",children:[e(X,{label:"Python Version",isReadOnly:!0,value:`pip install 'arize-phoenix==${ua}'`,description:"The version of the Python client library to use to connect to this Phoenix"}),e(Oa,{text:ua})]})]})}),e(rt,{children:s(U,{children:[e(qg,{}),e(np,{})]})})]})})})}function Oa(n){return e(F,{paddingBottom:"19px",children:e(le,{text:n.text,size:"default"})})}const Al=window.Config.basename,_l={width:"100%",height:"100%",border:"none",backgroundColor:"white"};function cf(){return s("div",{css:C`
3257
+ `;function Sf(){return e("main",{css:Wg,children:e("div",{css:Jg,children:s(h,{direction:"column",gap:"size-200",width:"100%",children:[e($,{title:"Platform Settings",variant:"compact",children:s("form",{css:Zg,children:[s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(G,{label:"Hostname",value:Ha,isReadOnly:!0,description:"Connect to Phoenix over HTTP"}),e(ja,{text:Ha})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",children:[e(G,{label:"Platform Version",isReadOnly:!0,value:ma,description:"The version of the Phoenix server"}),e(ja,{text:ma})]}),s(h,{direction:"row",gap:"size-100",alignItems:"end",justifyContent:"center",children:[e(G,{label:"Python Version",isReadOnly:!0,value:`pip install 'arize-phoenix==${ma}'`,description:"The version of the Python client library to use to connect to this Phoenix"}),e(ja,{text:ma})]})]})}),e(pl,{children:s(H,{children:[e(Ng,{}),e(Gg,{})]})})]})})})}function ja(n){return e(F,{paddingBottom:"19px",children:e(ae,{text:n.text,size:"default"})})}const Ot=window.Config.basename,Qt={width:"100%",height:"100%",border:"none",backgroundColor:"white"};function vf(){return s("div",{css:v`
3440
3258
  display: flex;
3441
3259
  flex-direction: column;
3442
3260
  flex: 1 1 auto;
@@ -3449,7 +3267,7 @@ fragment UsersTable_users on Query {
3449
3267
  flex: 1 1 auto;
3450
3268
  height: 100%;
3451
3269
  }
3452
- `,children:[e(ne,{variant:"info",banner:!0,icon:e(P,{svg:e(I.InfoFilled,{})}),children:"These APIs are under active development and are subject to change."}),s(Te,{children:[e(J,{name:"REST",children:({isSelected:n})=>n&&e("iframe",{src:`${Al}/docs`,style:_l})}),e(J,{name:"GraphQL",children:({isSelected:n})=>n&&e("iframe",{src:`${Al}/graphql`,style:_l})})]})]})}function Ia({children:n}){return s("main",{css:C`
3270
+ `,children:[e(te,{variant:"info",banner:!0,icon:e(w,{svg:e(L.InfoFilled,{})}),children:"These APIs are under active development and are subject to change."}),s(Pe,{children:[e(J,{name:"REST",children:({isSelected:n})=>n&&e("iframe",{src:`${Ot}/docs`,style:Qt})}),e(J,{name:"GraphQL",children:({isSelected:n})=>n&&e("iframe",{src:`${Ot}/graphql`,style:Qt})})]})]})}function wa({children:n}){return s("main",{css:v`
3453
3271
  padding-top: 200px;
3454
3272
  width: 100%;
3455
3273
  height: 100vh;
@@ -3463,7 +3281,7 @@ fragment UsersTable_users on Query {
3463
3281
  flex-direction: column;
3464
3282
  justify-content: space-between;
3465
3283
  box-sizing: border-box;
3466
- `,children:[e(F,{borderColor:"light",borderWidth:"thin",width:"size-5000",padding:"size-400",backgroundColor:"dark",marginStart:"auto",marginEnd:"auto",borderRadius:"medium",children:n}),s("footer",{css:C`
3284
+ `,children:[e(F,{borderColor:"light",borderWidth:"thin",width:"size-5000",padding:"size-400",backgroundColor:"dark",marginStart:"auto",marginEnd:"auto",borderRadius:"medium",children:n}),s("footer",{css:v`
3467
3285
  display: flex;
3468
3286
  justify-content: center;
3469
3287
  padding: var(--ac-global-dimension-size-400);
@@ -3477,7 +3295,7 @@ fragment UsersTable_users on Query {
3477
3295
  text-decoration: underline;
3478
3296
  }
3479
3297
  }
3480
- `,children:[e("a",{href:"https://docs.arize.com/phoenix",children:"Documentation"}),"|",e("a",{href:"https://join.slack.com/t/arize-ai/shared_invite/zt-1px8dcmlf-fmThhDFD_V_48oU7ALan4Q",children:"Community"}),"|",e("a",{href:"https://twitter.com/ArizePhoenix",children:"Social"}),"|",e("a",{href:"https://github.com/Arize-ai/phoenix",children:"GitHub"}),"|",e("a",{href:"https://github.com/Arize-ai/phoenix/releases",children:`arize-phoenix v${window.Config.platformVersion}`})]})]})}function ip(n){const a=Y(),{initialError:l,onSubmit:t}=n,[i,r]=u.useState(l),[o,c]=u.useState(!1),d=u.useCallback(async m=>{t==null||t(),r(null),c(!0);try{const y=await fetch("/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(!y.ok){const b=y.status===429?"Too many requests. Please try again later.":"Invalid login";r(b);return}}catch{r("Invalid login");return}finally{c(()=>!1)}const p=cd();a(p)},[a,t,r]),{control:g,handleSubmit:f}=Ie({defaultValues:{email:"",password:""}});return s(U,{children:[i?s(F,{paddingBottom:"size-100",children:[e(ne,{variant:"danger",children:i})," "]}):null,s(ye,{children:[e(G,{name:"email",control:g,render:({field:{onChange:m,value:p}})=>e(X,{label:"Email",name:"email",isRequired:!0,type:"email",onChange:m,value:p,placeholder:"your email address"})}),s("div",{css:C`
3298
+ `,children:[e("a",{href:"https://docs.arize.com/phoenix",children:"Documentation"}),"|",e("a",{href:"https://join.slack.com/t/arize-ai/shared_invite/zt-1px8dcmlf-fmThhDFD_V_48oU7ALan4Q",children:"Community"}),"|",e("a",{href:"https://twitter.com/ArizePhoenix",children:"Social"}),"|",e("a",{href:"https://github.com/Arize-ai/phoenix",children:"GitHub"}),"|",e("a",{href:"https://github.com/Arize-ai/phoenix/releases",children:`arize-phoenix v${window.Config.platformVersion}`})]})]})}function Xg(n){const a=Y(),{initialError:t,onSubmit:l}=n,[i,r]=u.useState(t),[o,c]=u.useState(!1),d=u.useCallback(async m=>{l==null||l(),r(null),c(!0);try{const y=await fetch("/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(!y.ok){const k=y.status===429?"Too many requests. Please try again later.":"Invalid login";r(k);return}}catch{r("Invalid login");return}finally{c(()=>!1)}const p=md();a(p)},[a,l,r]),{control:g,handleSubmit:f}=Ae({defaultValues:{email:"",password:""}});return s(H,{children:[i?s(F,{paddingBottom:"size-100",children:[e(te,{variant:"danger",children:i})," "]}):null,s(fe,{children:[e(Z,{name:"email",control:g,render:({field:{onChange:m,value:p}})=>e(G,{label:"Email",name:"email",isRequired:!0,type:"email",onChange:m,value:p,placeholder:"your email address"})}),s("div",{css:v`
3481
3299
  position: relative;
3482
3300
  a {
3483
3301
  position: absolute;
@@ -3486,13 +3304,13 @@ fragment UsersTable_users on Query {
3486
3304
  top: var(--ac-global-dimension-size-50);
3487
3305
  font-size: 12px;
3488
3306
  }
3489
- `,children:[e(G,{name:"password",control:g,render:({field:{onChange:m,value:p}})=>e(X,{label:"Password",name:"password",type:"password",isRequired:!0,onChange:m,value:p,placeholder:"your password",onKeyDown:y=>{y.key==="Enter"&&f(d)()}})}),e(Ze,{to:"/forgot-password",children:"Forgot your password?"})]}),e("div",{css:C`
3307
+ `,children:[e(Z,{name:"password",control:g,render:({field:{onChange:m,value:p}})=>e(G,{label:"Password",name:"password",type:"password",isRequired:!0,onChange:m,value:p,placeholder:"your password",onKeyDown:y=>{y.key==="Enter"&&f(d)()}})}),e(We,{to:"/forgot-password",children:"Forgot your password?"})]}),e("div",{css:v`
3490
3308
  margin-top: var(--ac-global-dimension-size-200);
3491
3309
  margin-bottom: var(--ac-global-dimension-size-50);
3492
3310
  button {
3493
3311
  width: 100%;
3494
3312
  }
3495
- `,children:e(M,{variant:"primary",loading:o,onClick:f(d),children:"Login"})})]})]})}const rp=C`
3313
+ `,children:e(N,{variant:"primary",loading:o,onClick:f(d),children:"Login"})})]})]})}const Yg=v`
3496
3314
  button {
3497
3315
  width: 100%;
3498
3316
  }
@@ -3512,7 +3330,7 @@ fragment UsersTable_users on Query {
3512
3330
  }
3513
3331
  }
3514
3332
  }
3515
- `;function sp({idpName:n,idpDisplayName:a,returnUrl:l}){return e("form",{action:`/oauth2/${n}/login${l?`?returnUrl=${l}`:""}`,method:"post",css:rp,"data-provider":n,children:s(M,{variant:"default",type:"submit",icon:e(op,{idpName:n}),children:["Login with ",a]})})}function op({idpName:n}){return n==="github"||n==="google"||n==="microsoft_entra_id"||n.startsWith("aws")?e("i",{children:e("div",{css:C`
3333
+ `;function ep({idpName:n,idpDisplayName:a,returnUrl:t}){return e("form",{action:`/oauth2/${n}/login${t?`?returnUrl=${t}`:""}`,method:"post",css:Yg,"data-provider":n,children:s(N,{variant:"default",type:"submit",icon:e(np,{idpName:n}),children:["Login with ",a]})})}function np({idpName:n}){return n==="github"||n==="google"||n==="microsoft_entra_id"||n.startsWith("aws")?e("i",{children:e("div",{css:v`
3516
3334
  display: inline-block;
3517
3335
  width: 20px;
3518
3336
  height: 20px;
@@ -3533,51 +3351,51 @@ fragment UsersTable_users on Query {
3533
3351
  &[data-provider^="aws"] {
3534
3352
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='400' height='334' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M236.578 94.824c-9.683.765-20.854 1.502-32.021 3.006-17.12 2.211-34.24 5.219-48.386 11.907-27.544 11.208-46.163 35.053-46.163 70.114 0 44.018 28.298 66.354 64.026 66.354 11.93 0 21.606-1.466 30.522-3.71 14.156-4.481 26.07-12.67 40.209-27.596 8.192 11.205 10.413 16.428 24.575 28.338 3.725 1.502 7.448 1.502 10.413-.742 8.932-7.458 24.561-20.873 32.773-28.33 3.71-3.012 2.955-7.463.739-11.204-8.198-10.435-16.381-19.401-16.381-39.506V96.324c0-28.359 2.214-54.453-18.614-73.822C261.147 6.815 234.34.86 213.5.86h-8.947c-37.965 2.247-78.169 18.635-87.122 65.629-1.462 5.955 3.012 8.198 5.989 8.962l41.677 5.224c4.471-.773 6.691-4.491 7.432-8.233 3.74-16.388 17.136-24.583 32.024-26.087h2.998c8.905 0 18.586 3.743 23.813 11.168 5.932 8.965 5.21 20.904 5.21 31.339v5.961h.004v.001zm0 43.278c0 17.162.723 30.571-8.195 45.461-5.208 10.437-14.141 17.154-23.827 19.4-1.481 0-3.698.766-5.947.766-16.371 0-26.077-12.673-26.077-31.334 0-23.856 14.159-35.056 32.023-40.277 9.687-2.241 20.86-2.982 32.021-2.982v8.966h.002z'/%3E%3Cpath d='M373.71 315.303c18.201-15.398 25.89-43.349 26.29-57.939v-2.44c0-3.255-.803-5.661-1.6-6.88-3.646-4.445-30.369-8.523-53.402-1.627-6.468 2.045-12.146 4.865-17.396 8.507-4.051 2.854-3.238 6.464.802 6.08 4.447-.823 10.126-1.208 16.594-2.048 14.159-1.18 30.742-1.592 34.784 3.662 5.642 6.87-6.468 36.868-11.749 49.838-1.593 4.065 2.03 5.696 5.677 2.847z' fill='%23FE9900'/%3E%3Cpath d='M2.008 257.364c52.17 47.404 120.925 75.775 197.791 75.775 47.725 0 102.727-13.381 145.199-38.899 5.676-3.27 11.316-6.912 16.565-10.952 7.286-5.25.817-13.38-6.463-10.147-3.229 1.215-6.873 2.857-10.103 4.066-46.539 18.248-95.441 26.76-140.762 26.76-72.008 0-141.56-19.87-197.786-52.684-5.259-2.822-8.907 2.428-4.441 6.081z' fill='%23FE9900'/%3E%3C/svg%3E");
3535
3353
  }
3536
- `,"data-provider":n})}):null}function ul(){return s("svg",{width:"253",height:"63",viewBox:"0 0 682 169",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s("g",{clipPath:"url(#clip0_290_1904)",children:[e("path",{d:"M147.458 105.593C147.022 103.63 146.028 101.824 144.492 100.222C143.901 99.6064 143.244 99.0233 142.529 98.4978C142.184 98.2432 141.815 98.005 141.437 97.7669C140.969 97.4712 140.484 97.192 139.95 96.921C137.995 95.9191 136.328 94.909 134.866 93.825C134.274 93.3897 133.699 92.9299 133.157 92.4535C131.851 91.312 130.972 90.3348 130.315 89.3C130.102 88.9715 129.913 88.6102 129.732 88.2653C129.658 88.1175 129.543 87.9943 129.412 87.8957C129.173 87.7233 128.869 87.6494 128.565 87.6986C128.097 87.789 127.736 88.1667 127.678 88.6431C127.637 89.0126 127.637 89.4068 127.687 89.8092C127.719 90.0474 127.588 90.2773 127.366 90.3758C127.317 90.4005 127.259 90.4087 127.21 90.4169C126.898 90.4498 126.619 90.6222 126.438 90.885C126.257 91.1478 126.208 91.4681 126.282 91.7719C126.348 92.0347 126.438 92.2236 126.512 92.3714L126.578 92.5028C126.627 92.5931 126.676 92.6917 126.726 92.782C126.873 93.0612 127.021 93.3405 127.202 93.6033C127.547 94.1042 127.933 94.6052 128.393 95.1389C128.541 95.3114 128.565 95.5578 128.459 95.7549C128.352 95.952 128.13 96.0669 127.908 96.0341C125.321 95.681 122.996 95.0979 120.836 94.3013C120.59 94.211 120.335 94.1206 120.097 94.0221C118.158 93.2009 121.658 89.7189 123.259 87.247C130.282 76.4479 131.736 64.0802 131.794 51.5647C131.851 39.4681 130.545 27.5357 128.138 15.7593V15.7429C126.569 5.87173 125.239 2.168 124.401 0.796558C124.22 0.435219 124.023 0.205276 123.818 0.0985162C123.588 -0.0575166 123.465 0.0163937 123.465 0.0163937C123.013 0.0328182 122.495 0.435219 121.871 1.08399C119.251 3.83509 119.399 7.11178 120.122 10.5363C123.432 26.0903 125.921 41.7346 124.787 57.7157C124.007 68.7365 121.953 79.3468 114.248 87.9779C113.789 88.4952 113.287 88.9798 112.786 89.4725C112.211 90.0391 111.316 91.1396 110.651 90.6797C109.764 90.0638 110.552 88.7991 110.831 88.1421C115.341 77.5729 116.639 66.5275 115.949 55.1453C115.932 54.8825 115.908 54.6197 115.891 54.3569V54.3405C115.883 54.1269 115.858 53.9298 115.842 53.7245C115.727 52.2217 115.587 50.7189 115.398 49.2242C113.46 31.1655 111.127 29.9911 111.127 29.9911C110.971 29.8515 110.782 29.7448 110.528 29.6955C109.304 29.4409 108.638 30.5167 108.096 31.3297C105.648 34.9924 106.733 38.8932 107.521 42.753C110.289 56.2703 110.33 69.6645 105.583 82.8124C105.147 84.0113 104.63 85.1775 104.08 86.3272C103.496 87.5508 103.119 89.0783 101.131 88.4213C99.2662 87.8054 99.7918 86.3929 100.03 85.1036C100.654 81.8269 101.155 78.542 101.467 75.2489V75.2653C101.509 74.9368 101.525 74.6247 101.55 74.3127C101.599 73.746 101.632 73.1712 101.665 72.6045C101.689 72.1282 101.714 71.6601 101.739 71.2002C101.747 70.9621 101.763 70.7321 101.763 70.494C102.141 60.0562 100.383 55.3095 99.7179 53.9052C99.644 53.7328 99.5619 53.5767 99.4715 53.4371C98.7815 52.4024 97.6398 52.5256 96.6541 53.5028C94.8388 55.2931 93.8367 57.4118 94.2967 60.0808C95.6438 67.8496 94.8552 75.5445 93.4096 83.1983C93.2124 84.2249 92.7524 86.0973 90.5593 85.6127C89.0644 85.2842 88.7194 84.6437 88.6372 83.3461C88.6537 82.3689 88.6372 81.3916 88.6044 80.4144C88.6044 80.3897 88.6044 80.3651 88.6044 80.3405C88.6044 80.2009 88.588 80.0612 88.588 79.9299C88.588 79.8559 88.5797 79.7902 88.5715 79.7245C88.5058 78.3942 88.399 77.0556 88.2347 75.717C88.2183 75.5856 88.1937 75.4624 88.1773 75.331C87.3394 67.7921 86.247 67.0612 86.247 67.0612C85.5488 66.1497 84.4563 66.3057 83.5117 67.2419C81.6964 69.0322 80.7764 71.1427 81.1543 73.8199C81.4336 75.7745 81.3596 75.175 81.5568 76.8831C81.7128 77.7618 81.8771 79.3632 81.8935 79.8724C81.8525 80.324 81.7375 80.7182 81.4582 81.0139C80.53 82.0076 79.0351 80.9892 77.9015 80.5211C55.9209 71.4302 37.1108 58.6683 20.691 42.523C14.2513 35.945 3.25273 22.6329 3.25273 22.6329C2.84203 22.1566 2.33276 21.8856 1.55243 22.2223C0.114982 22.8383 0.156052 24.6778 0.0246278 26.2217C-0.23822 29.3177 1.42101 31.5597 3.21987 33.662C28.0179 62.5856 58.2783 83.3708 94.8059 93.7675L101.377 95.5085C101.451 95.5249 101.533 95.5496 101.607 95.566C101.624 95.566 101.632 95.566 101.64 95.5742L107.299 97.077L107.456 97.1181C107.267 97.1756 107.061 97.2167 106.839 97.2577C100.613 98.4895 88.2923 96.223 78.3944 93.9153C73.4988 92.8888 68.6854 91.6405 63.9788 90.1541C63.7653 90.0884 63.642 90.0556 63.642 90.0556C45.3577 84.2331 28.6093 74.7972 13.9556 60.4093C12.5674 59.0461 11.286 57.5761 10.0211 56.0897C8.86289 54.71 6.47262 51.8275 5.643 50.8338C5.55265 50.7024 5.45408 50.5875 5.35551 50.4807C5.10909 50.2261 4.80517 50.0619 4.36983 50.1604C3.3513 50.3986 3.05559 51.4498 2.86667 52.3367C2.1192 55.9008 3.25273 58.8983 5.65122 61.5755C20.6582 78.3942 39.4929 89.1358 60.6439 96.1819C72.6528 100.181 85.0067 102.612 97.6069 104.164C90.0911 106.595 82.3617 107.334 74.5667 107.137C59.4775 106.759 45.3248 103.138 32.0264 96.6746C27.1226 94.1535 22.5556 91.3449 21.3564 90.5894C20.6664 90.1213 19.9518 89.8338 19.2454 90.3758C17.9229 91.4024 18.8347 93.2009 19.2618 94.6051C20.075 97.307 21.956 99.1712 24.3956 100.46C46.0641 111.917 68.9401 116.499 93.2946 112.434C95.7588 112.023 98.0998 111.572 100.679 110.701C96.6048 114.224 91.89 116.524 86.9369 118.339C71.6835 123.915 56.5287 123.693 41.4314 119.915C36.5851 118.618 30.9668 116.507 30.9668 116.507C30.1536 116.154 29.3486 116.031 28.7243 116.926C27.6237 118.503 28.5847 120.145 29.5375 121.632C31.7882 125.138 36.1416 125.483 39.5832 126.674C40.7578 127.052 37.5544 129.187 36.5276 129.975C31.5335 133.794 26.6462 137.284 21.6767 140.98L18.424 143.378C17.8654 143.764 17.3726 144.199 17.6272 145.004C17.9229 145.915 18.8675 146.08 19.7875 146.268C23.3442 147.008 26.3833 145.825 29.1925 143.723C35.2134 139.214 41.3493 134.837 47.2387 130.156C49.4811 128.374 51.5182 128.522 54.582 129.31C46.9183 135.083 39.7475 140.495 32.5685 145.899C25.2827 151.376 17.9969 156.854 10.711 162.323L5.89764 165.888C5.82371 165.937 5.758 165.986 5.69229 166.044L5.61836 166.093C5.20766 166.421 4.90374 166.791 4.9941 167.267C5.19123 168.351 6.4644 168.622 7.50758 168.803C11.8117 169.542 14.4813 167.924 17.4219 165.715C32.1496 154.661 46.9266 143.682 61.5721 132.521C64.8577 130.016 68.2337 128.604 72.9731 129.138C68.9401 132.152 65.0631 135.051 61.2436 137.908L50.8611 145.587C50.7871 145.636 50.7132 145.694 50.6475 145.751C50.0972 146.186 49.7111 146.695 49.9247 147.451C50.3189 148.822 51.97 148.987 53.3745 149.2C55.9537 149.586 58.1387 148.675 60.1675 147.164C61.3339 146.293 62.5085 145.439 63.6831 144.593L79.5361 132.004C79.5361 132.004 83.2817 129.327 87.6187 126.871C88.0048 126.633 88.3908 126.387 88.7851 126.148C88.9494 126.075 89.3601 125.886 89.9843 125.59C90.4525 125.352 90.9207 125.114 91.3807 124.892C92.0625 124.547 92.851 124.128 93.7381 123.644C96.2927 122.584 103.611 119.168 109.657 112.73C112.532 110.512 116.581 107.613 119.735 106.217H119.752C119.99 106.111 120.228 106.012 120.458 105.93C120.458 105.93 120.475 105.93 120.483 105.922C120.639 105.864 120.787 105.815 120.935 105.766L121.337 105.61C122.479 105.289 124.335 105.166 124.582 107.679C124.623 108.295 124.615 108.927 124.541 109.593C124.491 110.093 124.393 110.627 124.319 111.054C124.245 111.465 124.417 111.876 124.746 112.122C124.795 112.163 124.853 112.196 124.91 112.22C125.346 112.434 125.871 112.335 126.2 111.974C126.323 111.834 126.446 111.703 126.569 111.572C128.122 109.937 129.699 108.804 131.375 108.114C133.822 107.104 136.303 107.096 138.94 108.106C140.197 108.582 141.379 109.239 142.554 110.102C143.055 110.471 143.556 110.882 144.057 111.334C144.353 111.605 144.648 111.9 144.911 112.163L144.952 112.204L145.166 112.418C145.166 112.418 145.248 112.491 145.289 112.524C145.536 112.705 145.856 112.779 146.168 112.713C146.529 112.631 146.825 112.376 146.957 112.032C146.981 111.966 147.006 111.9 147.031 111.834C147.778 109.617 147.934 107.581 147.499 105.593H147.458Z",fill:"url(#paint0_linear_290_1904)"}),e("path",{d:"M120.113 94.0303C120.195 94.0632 120.269 94.096 120.351 94.1207C120.269 94.0878 120.187 94.0632 120.113 94.0303Z",fill:"#FEDBB5"}),e("path",{d:"M111.283 87.1238C111.283 87.1238 111.267 87.1567 111.267 87.1731C111.267 87.1567 111.283 87.1402 111.283 87.1238Z",fill:"#FEDBB5"}),e("path",{d:"M123.383 87.1074C123.383 87.1074 123.358 87.1487 123.341 87.1652C123.358 87.1487 123.366 87.1239 123.383 87.1074Z",fill:"#FEDBB5"}),e("path",{d:"M104.104 86.3354C103.965 86.6229 103.841 86.9267 103.71 87.2142C103.85 86.9267 103.973 86.6229 104.104 86.3354Z",fill:"#FEDBB5"}),e("path",{d:"M89.0233 84.7422C89.0233 84.7422 89.0233 84.7505 89.0316 84.7588C89.0316 84.7588 89.0316 84.7505 89.0233 84.7422Z",fill:"#FEDBB5"}),e("path",{d:"M89.0644 84.7998C89.1876 84.964 89.3437 85.1118 89.5408 85.235C89.3437 85.1118 89.1876 84.9722 89.0644 84.7998ZM89.0644 84.7833C89.0644 84.7833 89.0644 84.7833 89.0644 84.7915C89.0644 84.7915 89.0644 84.7915 89.0644 84.7833ZM89.0562 84.7751C89.0562 84.7751 89.0562 84.7751 89.0562 84.7833C89.0562 84.7833 89.0562 84.7833 89.0562 84.7751ZM88.6947 83.3626C88.6947 83.3626 88.6947 83.3708 88.6947 83.379C88.6947 83.379 88.6947 83.3708 88.6947 83.3626ZM79.1665 81.0878C79.1665 81.0878 79.1829 81.0878 79.1829 81.096C79.6429 81.2931 80.1029 81.4492 80.53 81.4492C80.7107 81.4492 80.8832 81.4245 81.0393 81.3588C80.875 81.4245 80.7025 81.4492 80.53 81.4492C80.0947 81.4492 79.6265 81.2849 79.1665 81.0878ZM88.629 79.6507C88.629 79.6507 88.629 79.6507 88.629 79.6589C88.629 79.6589 88.629 79.6589 88.629 79.6507Z",fill:"#E5B4A6"}),e("path",{d:"M120.36 94.1206C120.36 94.1206 120.434 94.1535 120.475 94.1617C120.475 94.1617 120.401 94.1289 120.36 94.1206ZM110.273 89.8749C110.273 90.187 110.38 90.4662 110.684 90.6797C110.79 90.7536 110.905 90.7865 111.029 90.7865C111.209 90.7865 111.398 90.7126 111.595 90.5894C111.406 90.7126 111.218 90.7865 111.029 90.7865C110.905 90.7865 110.79 90.7536 110.684 90.6797C110.38 90.4744 110.273 90.187 110.273 89.8749ZM110.914 88.0189C110.914 88.0189 110.881 88.1011 110.864 88.1421C110.881 88.1011 110.897 88.06 110.914 88.0189ZM111.226 87.2798C111.127 87.5262 111.02 87.7726 110.914 88.0189C111.02 87.7726 111.119 87.5262 111.226 87.2798ZM111.267 87.1731C111.267 87.1731 111.234 87.2388 111.226 87.2798C111.242 87.247 111.259 87.2141 111.267 87.1731ZM123.341 87.1731C123.341 87.1731 123.341 87.1813 123.333 87.1895C123.333 87.1895 123.333 87.1813 123.341 87.1731ZM123.391 87.0992C123.391 87.0992 123.391 87.1074 123.382 87.1156C123.382 87.1156 123.382 87.1074 123.391 87.0992ZM111.308 87.0992C111.308 87.0992 111.3 87.132 111.291 87.1402C111.291 87.1238 111.3 87.1074 111.308 87.0992ZM99.8001 86.7707C99.8001 87.4769 100.079 88.0928 101.155 88.446C101.484 88.5527 101.771 88.602 102.026 88.602C102.93 88.602 103.365 87.9615 103.71 87.2306C103.357 87.9697 102.921 88.602 102.026 88.602C101.78 88.602 101.492 88.5527 101.155 88.446C100.088 88.0928 99.8001 87.4769 99.8001 86.7707ZM92.7689 84.9886C92.4486 85.4074 91.9722 85.7195 91.2575 85.7195C91.1836 85.7195 91.1097 85.7195 91.0358 85.7113C91.1097 85.7113 91.1836 85.7195 91.2575 85.7195C91.9722 85.7195 92.4486 85.4157 92.7689 84.9886ZM106.651 79.7081C106.651 79.7081 106.651 79.7081 106.642 79.7081C106.322 80.7511 105.985 81.8023 105.616 82.8452C105.993 81.8023 106.338 80.7593 106.659 79.7081M94.1571 79.1251C93.9846 80.2748 93.7875 81.4163 93.5739 82.566C93.7875 81.4245 93.9846 80.2748 94.1571 79.1251ZM122.191 73.6311C120.623 78.7884 118.175 83.65 114.29 88.0025C113.83 88.5199 113.329 89.0044 112.828 89.4972C113.329 89.0126 113.821 88.5199 114.29 88.0025C118.175 83.65 120.623 78.7884 122.2 73.6311",fill:"#E5B4A6"}),e("path",{opacity:"0.4",d:"M2.20136 22.0745C2.00423 22.0745 1.79066 22.1238 1.55246 22.2223C0.53392 22.6658 0.254644 23.7252 0.139648 24.8503C5.61017 32.0196 27.213 58.4548 61.1943 76.5875C61.1943 76.5875 94.4692 94.1453 127.933 96.0423C125.346 95.6892 123.021 95.1061 120.861 94.3095C120.729 94.2602 120.606 94.2192 120.475 94.1699C108.318 91.542 97.9519 88.2571 90.6168 85.6292C90.7565 85.662 90.8961 85.6784 91.0193 85.6949C90.8879 85.6867 90.7401 85.662 90.5922 85.6292C90.1486 85.5306 89.8037 85.4074 89.5408 85.2432C83.7417 83.1244 80.0454 81.4984 79.1583 81.096C78.7312 80.9153 78.3123 80.6936 77.9344 80.5376C55.9538 71.4466 37.1437 58.6848 20.7239 42.5395C14.2513 35.945 3.25275 22.633 3.25275 22.633C2.97348 22.3045 2.6367 22.0745 2.20136 22.0745Z",fill:"url(#paint1_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M4.62448 50.1358C4.55056 50.1358 4.46842 50.144 4.37806 50.1687C3.35953 50.4068 3.06382 51.458 2.8749 52.3449C2.84204 52.5009 2.80919 52.6652 2.78455 52.8212C19.7711 75.832 42.5732 85.235 42.5732 85.235C65.3341 95.952 84.0128 98.12 95.3892 98.12C100.096 98.12 103.554 97.7505 105.533 97.463C104.63 97.5616 103.636 97.6109 102.568 97.6109C95.8984 97.6109 86.362 95.7795 78.4026 93.9235C73.5071 92.897 68.6937 91.6488 63.987 90.1623C63.7735 90.0966 63.6503 90.0638 63.6503 90.0638C45.3659 84.2413 28.6176 74.8054 13.9638 60.4175C12.5756 59.0543 11.2942 57.5843 10.0293 56.0979C8.87112 54.7182 6.48084 51.8357 5.65123 50.8421C5.56088 50.7107 5.46231 50.5957 5.36374 50.4889C5.16661 50.2836 4.9284 50.1358 4.62448 50.1358Z",fill:"url(#paint2_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M20.0669 90.1049C19.7958 90.1049 19.5247 90.187 19.2537 90.4005C18.1037 91.2874 18.6458 92.7738 19.0812 94.0632C27.5991 99.2287 47.132 109.289 70.2626 109.289C79.0023 109.289 88.243 107.86 97.607 104.189C90.8469 106.382 83.9061 107.195 76.9077 107.195C76.1274 107.195 75.3471 107.186 74.5667 107.162C59.4776 106.784 45.3249 103.162 32.0264 96.6993C27.1227 94.1781 22.5557 91.3695 21.3565 90.614C20.9293 90.3266 20.5022 90.1049 20.0669 90.1049Z",fill:"url(#paint3_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M99.1759 111.949C95.4632 114.791 91.2987 116.762 86.937 118.355C78.7559 121.344 70.5994 122.666 62.4675 122.666C55.4363 122.666 48.4298 121.681 41.4315 119.932C36.5852 118.634 30.9668 116.524 30.9668 116.524C30.6136 116.368 30.2604 116.261 29.9237 116.261C29.4883 116.261 29.0776 116.442 28.7326 116.951C28.2234 117.682 28.1577 118.429 28.3219 119.168C33.6939 121.665 45.2181 126.099 59.2723 126.099C71.4536 126.099 85.5406 122.765 99.1759 111.949Z",fill:"url(#paint4_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M62.9356 129.368C49.7358 129.368 39.7557 126.699 38.4908 126.346C38.8604 126.452 39.2218 126.567 39.5833 126.69C40.7579 127.068 37.5544 129.203 36.5276 129.992C32.8396 132.817 29.2008 135.461 25.5537 138.138H36.7576C40.2897 135.527 43.8052 132.907 47.2387 130.172C48.5119 129.154 49.7275 128.768 51.0993 128.768C52.1342 128.768 53.2678 128.99 54.582 129.335C46.9184 135.108 39.7475 140.52 32.5685 145.924C28.3711 149.077 24.1738 152.231 19.9764 155.384H31.246C41.3821 147.804 51.51 140.216 61.5721 132.546C63.8967 130.78 66.2623 129.557 69.1208 129.179C67.0016 129.318 64.9316 129.376 62.9439 129.376L62.9356 129.368Z",fill:"url(#paint5_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M60.5782 138.409H71.47L79.5115 132.02C79.5115 132.02 83.2571 129.343 87.5941 126.888C87.9801 126.649 88.3662 126.403 88.7605 126.165C88.9248 126.091 89.3354 125.902 89.9597 125.606C90.4279 125.368 90.8961 125.13 91.3561 124.908C92.0625 124.547 92.8921 124.112 93.8121 123.603C86.0499 126.855 78.0987 128.44 70.739 129.056C70.8375 129.056 70.9443 129.056 71.0429 129.056C71.6589 129.056 72.2996 129.088 72.965 129.162C68.9319 132.176 65.0549 135.075 61.2354 137.933L60.5782 138.418V138.409Z",fill:"url(#paint6_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M88.6701 83.3544C88.6865 82.3771 88.6701 81.3999 88.6373 80.4226V80.3487C88.6373 80.2091 88.6208 80.0695 88.6208 79.9381L88.6044 79.7328C88.5633 78.9115 88.4976 78.0903 88.4237 77.2609C85.8281 76.1687 83.3803 74.7726 81.1215 73.1301C81.1379 73.3601 81.1461 73.59 81.179 73.8364C81.4582 75.7909 81.3843 75.1914 81.5814 76.8995C81.7375 77.7783 81.9018 79.3797 81.9182 79.8888C81.8771 80.3405 81.7621 80.7347 81.4829 81.0303C81.1954 81.3342 80.8586 81.4491 80.4972 81.4491C80.0619 81.4491 79.5937 81.2849 79.1337 81.0878C79.9961 81.4738 83.7007 83.108 89.5408 85.2432C88.9165 84.8572 88.7194 84.2742 88.6619 83.3626L88.6701 83.3544Z",fill:"url(#paint7_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M131.022 64.885C128.59 68.2685 125.6 71.2331 122.175 73.6146C120.606 78.7719 118.158 83.6336 114.273 87.9861C113.813 88.5035 113.312 88.988 112.811 89.4807C112.326 89.9488 111.628 90.8029 111.02 90.8029C110.897 90.8029 110.782 90.77 110.675 90.6961C109.788 90.0802 110.577 88.8155 110.856 88.1585C112.31 84.7505 113.427 81.2931 114.257 77.7865C111.825 78.698 109.271 79.3386 106.634 79.6999C106.314 80.7429 105.977 81.794 105.607 82.837C105.172 84.036 104.655 85.2021 104.104 86.3518C103.62 87.3702 103.275 88.602 102.018 88.602C101.771 88.602 101.484 88.5527 101.147 88.446C99.2827 87.83 99.8084 86.4175 100.047 85.1282C100.367 83.4201 100.663 81.7119 100.909 79.9956C98.5927 79.9217 96.3256 79.626 94.1325 79.1168C93.9271 80.4883 93.6889 81.8515 93.4261 83.2148C93.2536 84.1263 92.8675 85.7113 91.2412 85.7113C91.044 85.7113 90.8305 85.6867 90.6005 85.6374C97.9356 88.2735 108.293 91.5584 120.458 94.1863C120.335 94.1371 120.22 94.096 120.105 94.0467C118.167 93.2255 121.666 89.7435 123.268 87.2716C127.777 80.3323 129.987 72.7523 131.005 64.8932L131.022 64.885Z",fill:"url(#paint8_linear_290_1904)"}),e("path",{opacity:"0.5",d:"M129.206 102.497C127.687 102.497 126.151 102.645 124.647 102.916C124.36 102.965 124.081 102.99 123.818 102.99C123.391 102.99 122.988 102.924 122.61 102.809C122.668 102.883 122.734 102.957 122.791 103.039C123.448 103.959 123.793 104.961 123.925 106.004C124.089 106.184 124.229 106.406 124.344 106.694C124.344 106.694 124.344 106.694 124.344 106.71C124.344 106.71 124.344 106.71 124.344 106.718C124.344 106.718 124.344 106.718 124.344 106.726C124.344 106.726 124.344 106.726 124.344 106.735C124.344 106.735 124.344 106.735 124.344 106.743C124.344 106.743 124.344 106.743 124.344 106.751C124.344 106.751 124.344 106.751 124.344 106.759C124.344 106.759 124.344 106.759 124.344 106.768V106.784C124.344 106.784 124.344 106.784 124.344 106.792C124.344 106.792 124.344 106.792 124.344 106.8C124.344 106.8 124.344 106.8 124.344 106.809C124.344 106.809 124.344 106.809 124.344 106.817C124.344 106.817 124.344 106.817 124.344 106.825C124.344 106.825 124.344 106.833 124.344 106.841C124.344 106.841 124.344 106.841 124.344 106.858C124.344 106.858 124.344 106.858 124.344 106.866C124.344 106.866 124.344 106.866 124.344 106.874C124.344 106.874 124.344 106.874 124.344 106.882C124.344 106.882 124.344 106.883 124.344 106.891C124.344 106.891 124.344 106.891 124.344 106.899C124.344 106.899 124.344 106.899 124.344 106.907C124.344 106.907 124.344 106.907 124.344 106.915C124.344 106.915 124.344 106.915 124.344 106.924C124.344 106.924 124.344 106.924 124.344 106.932C124.344 106.932 124.344 106.932 124.344 106.94C124.344 106.94 124.344 106.94 124.344 106.948C124.344 106.948 124.344 106.948 124.344 106.965C124.344 106.965 124.344 106.973 124.344 106.981C124.344 106.981 124.344 106.989 124.344 106.997V107.014C124.344 107.014 124.344 107.022 124.344 107.03C124.344 107.03 124.344 107.039 124.344 107.047C124.344 107.047 124.344 107.055 124.344 107.063C124.344 107.063 124.344 107.071 124.344 107.08C124.344 107.08 124.344 107.088 124.344 107.096C124.344 107.096 124.344 107.104 124.344 107.112C124.344 107.112 124.344 107.121 124.344 107.129C124.344 107.145 124.344 107.162 124.344 107.178C124.344 107.178 124.344 107.186 124.344 107.195C124.344 107.195 124.344 107.227 124.344 107.244C124.344 107.244 124.344 107.252 124.344 107.26V107.277C124.344 107.277 124.344 107.301 124.344 107.31C124.344 107.31 124.344 107.318 124.344 107.326V107.342V107.359C124.36 107.597 124.368 107.843 124.368 108.09C124.368 108.476 124.344 108.87 124.302 109.272C124.253 109.773 124.155 110.307 124.081 110.734C124.072 110.8 124.064 110.865 124.064 110.923C124.064 111.268 124.229 111.588 124.508 111.793L124.672 111.892C124.828 111.966 124.992 112.007 125.157 112.007C125.461 112.007 125.748 111.884 125.962 111.654C126.085 111.514 126.208 111.383 126.331 111.251C127.884 109.617 129.461 108.484 131.136 107.794C132.369 107.285 133.601 107.03 134.857 107.03C136.114 107.03 137.387 107.285 138.702 107.786C139.958 108.262 141.141 108.919 142.316 109.781C142.817 110.151 143.318 110.562 143.819 111.013C144.115 111.284 144.41 111.58 144.673 111.843L144.714 111.884L144.928 112.097L145.051 112.204C145.232 112.335 145.453 112.409 145.675 112.418C144.632 110.192 143.318 108.123 141.461 106.513C137.946 103.466 133.51 102.177 129.001 102.177",fill:"url(#paint9_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M128.779 87.6905L128.582 87.7069C128.114 87.7972 127.752 88.175 127.695 88.6513C127.654 89.0208 127.654 89.415 127.703 89.8174C127.72 89.9488 127.687 90.072 127.629 90.1706C129.51 92.9627 133.584 97.9065 139.769 99.7789C139.769 99.7789 149.331 104.78 146.916 112.032L146.99 111.834C147.737 109.617 147.893 107.581 147.458 105.593C147.022 103.63 146.029 101.824 144.492 100.222C143.901 99.6064 143.244 99.0234 142.529 98.4978C142.184 98.2432 141.815 98.0051 141.437 97.7669C140.969 97.4713 140.484 97.192 139.95 96.921C137.995 95.9191 136.328 94.909 134.866 93.825C134.274 93.3898 133.699 92.9299 133.157 92.4536C131.851 91.3121 130.972 90.3348 130.315 89.3001C130.102 88.9716 129.913 88.6102 129.732 88.2653C129.658 88.1175 129.543 87.9943 129.412 87.8958C129.231 87.7562 129.001 87.6823 128.763 87.6823",fill:"url(#paint10_linear_290_1904)"}),e("path",{opacity:"0.5",d:"M116.647 107.893L118.586 106.768L126.734 95.8535C126.734 95.8535 122.274 95.0076 120.122 94.0303C120.122 94.0303 117.887 104.222 109.632 112.738L112.672 110.488C113.887 109.634 114.988 108.903 116.647 107.893Z",fill:"url(#paint11_linear_290_1904)"}),e("path",{d:"M209.416 49.9962H230.197C245.221 49.9962 252.104 57.7157 252.104 73.5818V81.4409C252.104 97.307 245.221 105.027 230.197 105.027H218.123V148.264H209.416V49.9962ZM230.197 97.0196C239.323 97.0196 243.397 92.9463 243.397 81.8598V73.0152C243.397 62.0682 239.323 57.8553 230.197 57.8553H218.123V97.0196H230.197Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M284.114 49.9962H292.821V93.0941H319.64V49.9962H328.346V148.256H319.64V100.953H292.821V148.256H284.114V49.9962Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M362.451 125.656V72.5963C362.451 57.0177 370.312 48.5919 384.497 48.5919C398.683 48.5919 406.544 57.0177 406.544 72.5963V125.656C406.544 141.234 398.683 149.66 384.497 149.66C370.312 149.66 362.451 141.234 362.451 125.656ZM397.829 126.214V72.0297C397.829 61.5016 393.056 56.451 384.489 56.451C375.922 56.451 371.15 61.5016 371.15 72.0297V126.214C371.15 136.742 375.922 141.653 384.489 141.653C393.056 141.653 397.829 136.742 397.829 126.214Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M440.796 49.9962H480.108V57.8553H449.503V93.0859H474.638V100.945H449.503V140.249H480.108V148.248H440.796V49.9962Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M511.56 49.9962H523.076L548.629 125.935V49.9962H556.769V148.256H547.504L519.56 64.458V148.256H511.56V49.9962Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M592.007 49.9962H600.714V148.256H592.007V49.9962Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M651.674 98.1447L632.437 49.9962H641.702L657.144 89.0209L672.726 49.9962H681.154L661.917 98.1447L681.992 148.256H672.726L656.438 106.989L640.01 148.256H631.591L651.666 98.1447H651.674Z",fill:"var(--ac-global-text-color-900)"})]}),s("defs",{children:[s("linearGradient",{id:"paint0_linear_290_1904",x1:"22.0956",y1:"10.3474",x2:"97.4433",y2:"140.879",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#14BAB6"}),e("stop",{offset:"0.5",stopColor:"#00ADEE"}),e("stop",{offset:"1",stopColor:"#0095C4"})]}),s("linearGradient",{id:"paint1_linear_290_1904",x1:"95.422",y1:"114.807",x2:"31.8741",y2:"4.70214",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint2_linear_290_1904",x1:"76.6695",y1:"114.126",x2:"30.8746",y2:"34.7951",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint3_linear_290_1904",x1:"70.3612",y1:"119.915",x2:"44.7991",y2:"75.6384",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint4_linear_290_1904",x1:"71.4208",y1:"128.85",x2:"55.5071",y2:"101.279",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint5_linear_290_1904",x1:"44.5363",y1:"126.346",x2:"44.5363",y2:"155.384",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"0.03",stopColor:"#231F20",stopOpacity:"0.9"}),e("stop",{offset:"0.22",stopColor:"#231F20",stopOpacity:"0.4"}),e("stop",{offset:"0.42",stopColor:"#231F20",stopOpacity:"0.1"}),e("stop",{offset:"0.65",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint6_linear_290_1904",x1:"77.1952",y1:"123.603",x2:"77.1952",y2:"138.409",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"1",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint7_linear_290_1904",x1:"84.3413",y1:"85.235",x2:"84.3413",y2:"73.1301",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"0.03",stopColor:"#231F20",stopOpacity:"0.95"}),e("stop",{offset:"0.51",stopColor:"#231F20",stopOpacity:"0.26"}),e("stop",{offset:"0.81",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint8_linear_290_1904",x1:"110.815",y1:"94.1699",x2:"110.815",y2:"64.885",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"0.18",stopColor:"#231F20",stopOpacity:"0.48"}),e("stop",{offset:"0.38",stopColor:"#231F20",stopOpacity:"0.12"}),e("stop",{offset:"0.58",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint9_linear_290_1904",x1:"138.077",y1:"117.246",x2:"127.969",y2:"99.7278",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"1",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint10_linear_290_1904",x1:"146.226",y1:"112.434",x2:"131.084",y2:"86.1931",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint11_linear_290_1904",x1:"106.889",y1:"107.999",x2:"128.941",y2:"95.2581",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"0.31",stopColor:"#231F20",stopOpacity:"0.5"}),e("stop",{offset:"0.67",stopColor:"#231F20",stopOpacity:"0.13"}),e("stop",{offset:"1",stopColor:"#231F20",stopOpacity:"0"})]}),e("clipPath",{id:"clip0_290_1904",children:e("rect",{width:"682",height:"169",fill:"white"})})]})]})}const dp=C`
3354
+ `,"data-provider":n})}):null}function kt(){return s("svg",{width:"253",height:"63",viewBox:"0 0 682 169",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s("g",{clipPath:"url(#clip0_290_1904)",children:[e("path",{d:"M147.458 105.593C147.022 103.63 146.028 101.824 144.492 100.222C143.901 99.6064 143.244 99.0233 142.529 98.4978C142.184 98.2432 141.815 98.005 141.437 97.7669C140.969 97.4712 140.484 97.192 139.95 96.921C137.995 95.9191 136.328 94.909 134.866 93.825C134.274 93.3897 133.699 92.9299 133.157 92.4535C131.851 91.312 130.972 90.3348 130.315 89.3C130.102 88.9715 129.913 88.6102 129.732 88.2653C129.658 88.1175 129.543 87.9943 129.412 87.8957C129.173 87.7233 128.869 87.6494 128.565 87.6986C128.097 87.789 127.736 88.1667 127.678 88.6431C127.637 89.0126 127.637 89.4068 127.687 89.8092C127.719 90.0474 127.588 90.2773 127.366 90.3758C127.317 90.4005 127.259 90.4087 127.21 90.4169C126.898 90.4498 126.619 90.6222 126.438 90.885C126.257 91.1478 126.208 91.4681 126.282 91.7719C126.348 92.0347 126.438 92.2236 126.512 92.3714L126.578 92.5028C126.627 92.5931 126.676 92.6917 126.726 92.782C126.873 93.0612 127.021 93.3405 127.202 93.6033C127.547 94.1042 127.933 94.6052 128.393 95.1389C128.541 95.3114 128.565 95.5578 128.459 95.7549C128.352 95.952 128.13 96.0669 127.908 96.0341C125.321 95.681 122.996 95.0979 120.836 94.3013C120.59 94.211 120.335 94.1206 120.097 94.0221C118.158 93.2009 121.658 89.7189 123.259 87.247C130.282 76.4479 131.736 64.0802 131.794 51.5647C131.851 39.4681 130.545 27.5357 128.138 15.7593V15.7429C126.569 5.87173 125.239 2.168 124.401 0.796558C124.22 0.435219 124.023 0.205276 123.818 0.0985162C123.588 -0.0575166 123.465 0.0163937 123.465 0.0163937C123.013 0.0328182 122.495 0.435219 121.871 1.08399C119.251 3.83509 119.399 7.11178 120.122 10.5363C123.432 26.0903 125.921 41.7346 124.787 57.7157C124.007 68.7365 121.953 79.3468 114.248 87.9779C113.789 88.4952 113.287 88.9798 112.786 89.4725C112.211 90.0391 111.316 91.1396 110.651 90.6797C109.764 90.0638 110.552 88.7991 110.831 88.1421C115.341 77.5729 116.639 66.5275 115.949 55.1453C115.932 54.8825 115.908 54.6197 115.891 54.3569V54.3405C115.883 54.1269 115.858 53.9298 115.842 53.7245C115.727 52.2217 115.587 50.7189 115.398 49.2242C113.46 31.1655 111.127 29.9911 111.127 29.9911C110.971 29.8515 110.782 29.7448 110.528 29.6955C109.304 29.4409 108.638 30.5167 108.096 31.3297C105.648 34.9924 106.733 38.8932 107.521 42.753C110.289 56.2703 110.33 69.6645 105.583 82.8124C105.147 84.0113 104.63 85.1775 104.08 86.3272C103.496 87.5508 103.119 89.0783 101.131 88.4213C99.2662 87.8054 99.7918 86.3929 100.03 85.1036C100.654 81.8269 101.155 78.542 101.467 75.2489V75.2653C101.509 74.9368 101.525 74.6247 101.55 74.3127C101.599 73.746 101.632 73.1712 101.665 72.6045C101.689 72.1282 101.714 71.6601 101.739 71.2002C101.747 70.9621 101.763 70.7321 101.763 70.494C102.141 60.0562 100.383 55.3095 99.7179 53.9052C99.644 53.7328 99.5619 53.5767 99.4715 53.4371C98.7815 52.4024 97.6398 52.5256 96.6541 53.5028C94.8388 55.2931 93.8367 57.4118 94.2967 60.0808C95.6438 67.8496 94.8552 75.5445 93.4096 83.1983C93.2124 84.2249 92.7524 86.0973 90.5593 85.6127C89.0644 85.2842 88.7194 84.6437 88.6372 83.3461C88.6537 82.3689 88.6372 81.3916 88.6044 80.4144C88.6044 80.3897 88.6044 80.3651 88.6044 80.3405C88.6044 80.2009 88.588 80.0612 88.588 79.9299C88.588 79.8559 88.5797 79.7902 88.5715 79.7245C88.5058 78.3942 88.399 77.0556 88.2347 75.717C88.2183 75.5856 88.1937 75.4624 88.1773 75.331C87.3394 67.7921 86.247 67.0612 86.247 67.0612C85.5488 66.1497 84.4563 66.3057 83.5117 67.2419C81.6964 69.0322 80.7764 71.1427 81.1543 73.8199C81.4336 75.7745 81.3596 75.175 81.5568 76.8831C81.7128 77.7618 81.8771 79.3632 81.8935 79.8724C81.8525 80.324 81.7375 80.7182 81.4582 81.0139C80.53 82.0076 79.0351 80.9892 77.9015 80.5211C55.9209 71.4302 37.1108 58.6683 20.691 42.523C14.2513 35.945 3.25273 22.6329 3.25273 22.6329C2.84203 22.1566 2.33276 21.8856 1.55243 22.2223C0.114982 22.8383 0.156052 24.6778 0.0246278 26.2217C-0.23822 29.3177 1.42101 31.5597 3.21987 33.662C28.0179 62.5856 58.2783 83.3708 94.8059 93.7675L101.377 95.5085C101.451 95.5249 101.533 95.5496 101.607 95.566C101.624 95.566 101.632 95.566 101.64 95.5742L107.299 97.077L107.456 97.1181C107.267 97.1756 107.061 97.2167 106.839 97.2577C100.613 98.4895 88.2923 96.223 78.3944 93.9153C73.4988 92.8888 68.6854 91.6405 63.9788 90.1541C63.7653 90.0884 63.642 90.0556 63.642 90.0556C45.3577 84.2331 28.6093 74.7972 13.9556 60.4093C12.5674 59.0461 11.286 57.5761 10.0211 56.0897C8.86289 54.71 6.47262 51.8275 5.643 50.8338C5.55265 50.7024 5.45408 50.5875 5.35551 50.4807C5.10909 50.2261 4.80517 50.0619 4.36983 50.1604C3.3513 50.3986 3.05559 51.4498 2.86667 52.3367C2.1192 55.9008 3.25273 58.8983 5.65122 61.5755C20.6582 78.3942 39.4929 89.1358 60.6439 96.1819C72.6528 100.181 85.0067 102.612 97.6069 104.164C90.0911 106.595 82.3617 107.334 74.5667 107.137C59.4775 106.759 45.3248 103.138 32.0264 96.6746C27.1226 94.1535 22.5556 91.3449 21.3564 90.5894C20.6664 90.1213 19.9518 89.8338 19.2454 90.3758C17.9229 91.4024 18.8347 93.2009 19.2618 94.6051C20.075 97.307 21.956 99.1712 24.3956 100.46C46.0641 111.917 68.9401 116.499 93.2946 112.434C95.7588 112.023 98.0998 111.572 100.679 110.701C96.6048 114.224 91.89 116.524 86.9369 118.339C71.6835 123.915 56.5287 123.693 41.4314 119.915C36.5851 118.618 30.9668 116.507 30.9668 116.507C30.1536 116.154 29.3486 116.031 28.7243 116.926C27.6237 118.503 28.5847 120.145 29.5375 121.632C31.7882 125.138 36.1416 125.483 39.5832 126.674C40.7578 127.052 37.5544 129.187 36.5276 129.975C31.5335 133.794 26.6462 137.284 21.6767 140.98L18.424 143.378C17.8654 143.764 17.3726 144.199 17.6272 145.004C17.9229 145.915 18.8675 146.08 19.7875 146.268C23.3442 147.008 26.3833 145.825 29.1925 143.723C35.2134 139.214 41.3493 134.837 47.2387 130.156C49.4811 128.374 51.5182 128.522 54.582 129.31C46.9183 135.083 39.7475 140.495 32.5685 145.899C25.2827 151.376 17.9969 156.854 10.711 162.323L5.89764 165.888C5.82371 165.937 5.758 165.986 5.69229 166.044L5.61836 166.093C5.20766 166.421 4.90374 166.791 4.9941 167.267C5.19123 168.351 6.4644 168.622 7.50758 168.803C11.8117 169.542 14.4813 167.924 17.4219 165.715C32.1496 154.661 46.9266 143.682 61.5721 132.521C64.8577 130.016 68.2337 128.604 72.9731 129.138C68.9401 132.152 65.0631 135.051 61.2436 137.908L50.8611 145.587C50.7871 145.636 50.7132 145.694 50.6475 145.751C50.0972 146.186 49.7111 146.695 49.9247 147.451C50.3189 148.822 51.97 148.987 53.3745 149.2C55.9537 149.586 58.1387 148.675 60.1675 147.164C61.3339 146.293 62.5085 145.439 63.6831 144.593L79.5361 132.004C79.5361 132.004 83.2817 129.327 87.6187 126.871C88.0048 126.633 88.3908 126.387 88.7851 126.148C88.9494 126.075 89.3601 125.886 89.9843 125.59C90.4525 125.352 90.9207 125.114 91.3807 124.892C92.0625 124.547 92.851 124.128 93.7381 123.644C96.2927 122.584 103.611 119.168 109.657 112.73C112.532 110.512 116.581 107.613 119.735 106.217H119.752C119.99 106.111 120.228 106.012 120.458 105.93C120.458 105.93 120.475 105.93 120.483 105.922C120.639 105.864 120.787 105.815 120.935 105.766L121.337 105.61C122.479 105.289 124.335 105.166 124.582 107.679C124.623 108.295 124.615 108.927 124.541 109.593C124.491 110.093 124.393 110.627 124.319 111.054C124.245 111.465 124.417 111.876 124.746 112.122C124.795 112.163 124.853 112.196 124.91 112.22C125.346 112.434 125.871 112.335 126.2 111.974C126.323 111.834 126.446 111.703 126.569 111.572C128.122 109.937 129.699 108.804 131.375 108.114C133.822 107.104 136.303 107.096 138.94 108.106C140.197 108.582 141.379 109.239 142.554 110.102C143.055 110.471 143.556 110.882 144.057 111.334C144.353 111.605 144.648 111.9 144.911 112.163L144.952 112.204L145.166 112.418C145.166 112.418 145.248 112.491 145.289 112.524C145.536 112.705 145.856 112.779 146.168 112.713C146.529 112.631 146.825 112.376 146.957 112.032C146.981 111.966 147.006 111.9 147.031 111.834C147.778 109.617 147.934 107.581 147.499 105.593H147.458Z",fill:"url(#paint0_linear_290_1904)"}),e("path",{d:"M120.113 94.0303C120.195 94.0632 120.269 94.096 120.351 94.1207C120.269 94.0878 120.187 94.0632 120.113 94.0303Z",fill:"#FEDBB5"}),e("path",{d:"M111.283 87.1238C111.283 87.1238 111.267 87.1567 111.267 87.1731C111.267 87.1567 111.283 87.1402 111.283 87.1238Z",fill:"#FEDBB5"}),e("path",{d:"M123.383 87.1074C123.383 87.1074 123.358 87.1487 123.341 87.1652C123.358 87.1487 123.366 87.1239 123.383 87.1074Z",fill:"#FEDBB5"}),e("path",{d:"M104.104 86.3354C103.965 86.6229 103.841 86.9267 103.71 87.2142C103.85 86.9267 103.973 86.6229 104.104 86.3354Z",fill:"#FEDBB5"}),e("path",{d:"M89.0233 84.7422C89.0233 84.7422 89.0233 84.7505 89.0316 84.7588C89.0316 84.7588 89.0316 84.7505 89.0233 84.7422Z",fill:"#FEDBB5"}),e("path",{d:"M89.0644 84.7998C89.1876 84.964 89.3437 85.1118 89.5408 85.235C89.3437 85.1118 89.1876 84.9722 89.0644 84.7998ZM89.0644 84.7833C89.0644 84.7833 89.0644 84.7833 89.0644 84.7915C89.0644 84.7915 89.0644 84.7915 89.0644 84.7833ZM89.0562 84.7751C89.0562 84.7751 89.0562 84.7751 89.0562 84.7833C89.0562 84.7833 89.0562 84.7833 89.0562 84.7751ZM88.6947 83.3626C88.6947 83.3626 88.6947 83.3708 88.6947 83.379C88.6947 83.379 88.6947 83.3708 88.6947 83.3626ZM79.1665 81.0878C79.1665 81.0878 79.1829 81.0878 79.1829 81.096C79.6429 81.2931 80.1029 81.4492 80.53 81.4492C80.7107 81.4492 80.8832 81.4245 81.0393 81.3588C80.875 81.4245 80.7025 81.4492 80.53 81.4492C80.0947 81.4492 79.6265 81.2849 79.1665 81.0878ZM88.629 79.6507C88.629 79.6507 88.629 79.6507 88.629 79.6589C88.629 79.6589 88.629 79.6589 88.629 79.6507Z",fill:"#E5B4A6"}),e("path",{d:"M120.36 94.1206C120.36 94.1206 120.434 94.1535 120.475 94.1617C120.475 94.1617 120.401 94.1289 120.36 94.1206ZM110.273 89.8749C110.273 90.187 110.38 90.4662 110.684 90.6797C110.79 90.7536 110.905 90.7865 111.029 90.7865C111.209 90.7865 111.398 90.7126 111.595 90.5894C111.406 90.7126 111.218 90.7865 111.029 90.7865C110.905 90.7865 110.79 90.7536 110.684 90.6797C110.38 90.4744 110.273 90.187 110.273 89.8749ZM110.914 88.0189C110.914 88.0189 110.881 88.1011 110.864 88.1421C110.881 88.1011 110.897 88.06 110.914 88.0189ZM111.226 87.2798C111.127 87.5262 111.02 87.7726 110.914 88.0189C111.02 87.7726 111.119 87.5262 111.226 87.2798ZM111.267 87.1731C111.267 87.1731 111.234 87.2388 111.226 87.2798C111.242 87.247 111.259 87.2141 111.267 87.1731ZM123.341 87.1731C123.341 87.1731 123.341 87.1813 123.333 87.1895C123.333 87.1895 123.333 87.1813 123.341 87.1731ZM123.391 87.0992C123.391 87.0992 123.391 87.1074 123.382 87.1156C123.382 87.1156 123.382 87.1074 123.391 87.0992ZM111.308 87.0992C111.308 87.0992 111.3 87.132 111.291 87.1402C111.291 87.1238 111.3 87.1074 111.308 87.0992ZM99.8001 86.7707C99.8001 87.4769 100.079 88.0928 101.155 88.446C101.484 88.5527 101.771 88.602 102.026 88.602C102.93 88.602 103.365 87.9615 103.71 87.2306C103.357 87.9697 102.921 88.602 102.026 88.602C101.78 88.602 101.492 88.5527 101.155 88.446C100.088 88.0928 99.8001 87.4769 99.8001 86.7707ZM92.7689 84.9886C92.4486 85.4074 91.9722 85.7195 91.2575 85.7195C91.1836 85.7195 91.1097 85.7195 91.0358 85.7113C91.1097 85.7113 91.1836 85.7195 91.2575 85.7195C91.9722 85.7195 92.4486 85.4157 92.7689 84.9886ZM106.651 79.7081C106.651 79.7081 106.651 79.7081 106.642 79.7081C106.322 80.7511 105.985 81.8023 105.616 82.8452C105.993 81.8023 106.338 80.7593 106.659 79.7081M94.1571 79.1251C93.9846 80.2748 93.7875 81.4163 93.5739 82.566C93.7875 81.4245 93.9846 80.2748 94.1571 79.1251ZM122.191 73.6311C120.623 78.7884 118.175 83.65 114.29 88.0025C113.83 88.5199 113.329 89.0044 112.828 89.4972C113.329 89.0126 113.821 88.5199 114.29 88.0025C118.175 83.65 120.623 78.7884 122.2 73.6311",fill:"#E5B4A6"}),e("path",{opacity:"0.4",d:"M2.20136 22.0745C2.00423 22.0745 1.79066 22.1238 1.55246 22.2223C0.53392 22.6658 0.254644 23.7252 0.139648 24.8503C5.61017 32.0196 27.213 58.4548 61.1943 76.5875C61.1943 76.5875 94.4692 94.1453 127.933 96.0423C125.346 95.6892 123.021 95.1061 120.861 94.3095C120.729 94.2602 120.606 94.2192 120.475 94.1699C108.318 91.542 97.9519 88.2571 90.6168 85.6292C90.7565 85.662 90.8961 85.6784 91.0193 85.6949C90.8879 85.6867 90.7401 85.662 90.5922 85.6292C90.1486 85.5306 89.8037 85.4074 89.5408 85.2432C83.7417 83.1244 80.0454 81.4984 79.1583 81.096C78.7312 80.9153 78.3123 80.6936 77.9344 80.5376C55.9538 71.4466 37.1437 58.6848 20.7239 42.5395C14.2513 35.945 3.25275 22.633 3.25275 22.633C2.97348 22.3045 2.6367 22.0745 2.20136 22.0745Z",fill:"url(#paint1_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M4.62448 50.1358C4.55056 50.1358 4.46842 50.144 4.37806 50.1687C3.35953 50.4068 3.06382 51.458 2.8749 52.3449C2.84204 52.5009 2.80919 52.6652 2.78455 52.8212C19.7711 75.832 42.5732 85.235 42.5732 85.235C65.3341 95.952 84.0128 98.12 95.3892 98.12C100.096 98.12 103.554 97.7505 105.533 97.463C104.63 97.5616 103.636 97.6109 102.568 97.6109C95.8984 97.6109 86.362 95.7795 78.4026 93.9235C73.5071 92.897 68.6937 91.6488 63.987 90.1623C63.7735 90.0966 63.6503 90.0638 63.6503 90.0638C45.3659 84.2413 28.6176 74.8054 13.9638 60.4175C12.5756 59.0543 11.2942 57.5843 10.0293 56.0979C8.87112 54.7182 6.48084 51.8357 5.65123 50.8421C5.56088 50.7107 5.46231 50.5957 5.36374 50.4889C5.16661 50.2836 4.9284 50.1358 4.62448 50.1358Z",fill:"url(#paint2_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M20.0669 90.1049C19.7958 90.1049 19.5247 90.187 19.2537 90.4005C18.1037 91.2874 18.6458 92.7738 19.0812 94.0632C27.5991 99.2287 47.132 109.289 70.2626 109.289C79.0023 109.289 88.243 107.86 97.607 104.189C90.8469 106.382 83.9061 107.195 76.9077 107.195C76.1274 107.195 75.3471 107.186 74.5667 107.162C59.4776 106.784 45.3249 103.162 32.0264 96.6993C27.1227 94.1781 22.5557 91.3695 21.3565 90.614C20.9293 90.3266 20.5022 90.1049 20.0669 90.1049Z",fill:"url(#paint3_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M99.1759 111.949C95.4632 114.791 91.2987 116.762 86.937 118.355C78.7559 121.344 70.5994 122.666 62.4675 122.666C55.4363 122.666 48.4298 121.681 41.4315 119.932C36.5852 118.634 30.9668 116.524 30.9668 116.524C30.6136 116.368 30.2604 116.261 29.9237 116.261C29.4883 116.261 29.0776 116.442 28.7326 116.951C28.2234 117.682 28.1577 118.429 28.3219 119.168C33.6939 121.665 45.2181 126.099 59.2723 126.099C71.4536 126.099 85.5406 122.765 99.1759 111.949Z",fill:"url(#paint4_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M62.9356 129.368C49.7358 129.368 39.7557 126.699 38.4908 126.346C38.8604 126.452 39.2218 126.567 39.5833 126.69C40.7579 127.068 37.5544 129.203 36.5276 129.992C32.8396 132.817 29.2008 135.461 25.5537 138.138H36.7576C40.2897 135.527 43.8052 132.907 47.2387 130.172C48.5119 129.154 49.7275 128.768 51.0993 128.768C52.1342 128.768 53.2678 128.99 54.582 129.335C46.9184 135.108 39.7475 140.52 32.5685 145.924C28.3711 149.077 24.1738 152.231 19.9764 155.384H31.246C41.3821 147.804 51.51 140.216 61.5721 132.546C63.8967 130.78 66.2623 129.557 69.1208 129.179C67.0016 129.318 64.9316 129.376 62.9439 129.376L62.9356 129.368Z",fill:"url(#paint5_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M60.5782 138.409H71.47L79.5115 132.02C79.5115 132.02 83.2571 129.343 87.5941 126.888C87.9801 126.649 88.3662 126.403 88.7605 126.165C88.9248 126.091 89.3354 125.902 89.9597 125.606C90.4279 125.368 90.8961 125.13 91.3561 124.908C92.0625 124.547 92.8921 124.112 93.8121 123.603C86.0499 126.855 78.0987 128.44 70.739 129.056C70.8375 129.056 70.9443 129.056 71.0429 129.056C71.6589 129.056 72.2996 129.088 72.965 129.162C68.9319 132.176 65.0549 135.075 61.2354 137.933L60.5782 138.418V138.409Z",fill:"url(#paint6_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M88.6701 83.3544C88.6865 82.3771 88.6701 81.3999 88.6373 80.4226V80.3487C88.6373 80.2091 88.6208 80.0695 88.6208 79.9381L88.6044 79.7328C88.5633 78.9115 88.4976 78.0903 88.4237 77.2609C85.8281 76.1687 83.3803 74.7726 81.1215 73.1301C81.1379 73.3601 81.1461 73.59 81.179 73.8364C81.4582 75.7909 81.3843 75.1914 81.5814 76.8995C81.7375 77.7783 81.9018 79.3797 81.9182 79.8888C81.8771 80.3405 81.7621 80.7347 81.4829 81.0303C81.1954 81.3342 80.8586 81.4491 80.4972 81.4491C80.0619 81.4491 79.5937 81.2849 79.1337 81.0878C79.9961 81.4738 83.7007 83.108 89.5408 85.2432C88.9165 84.8572 88.7194 84.2742 88.6619 83.3626L88.6701 83.3544Z",fill:"url(#paint7_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M131.022 64.885C128.59 68.2685 125.6 71.2331 122.175 73.6146C120.606 78.7719 118.158 83.6336 114.273 87.9861C113.813 88.5035 113.312 88.988 112.811 89.4807C112.326 89.9488 111.628 90.8029 111.02 90.8029C110.897 90.8029 110.782 90.77 110.675 90.6961C109.788 90.0802 110.577 88.8155 110.856 88.1585C112.31 84.7505 113.427 81.2931 114.257 77.7865C111.825 78.698 109.271 79.3386 106.634 79.6999C106.314 80.7429 105.977 81.794 105.607 82.837C105.172 84.036 104.655 85.2021 104.104 86.3518C103.62 87.3702 103.275 88.602 102.018 88.602C101.771 88.602 101.484 88.5527 101.147 88.446C99.2827 87.83 99.8084 86.4175 100.047 85.1282C100.367 83.4201 100.663 81.7119 100.909 79.9956C98.5927 79.9217 96.3256 79.626 94.1325 79.1168C93.9271 80.4883 93.6889 81.8515 93.4261 83.2148C93.2536 84.1263 92.8675 85.7113 91.2412 85.7113C91.044 85.7113 90.8305 85.6867 90.6005 85.6374C97.9356 88.2735 108.293 91.5584 120.458 94.1863C120.335 94.1371 120.22 94.096 120.105 94.0467C118.167 93.2255 121.666 89.7435 123.268 87.2716C127.777 80.3323 129.987 72.7523 131.005 64.8932L131.022 64.885Z",fill:"url(#paint8_linear_290_1904)"}),e("path",{opacity:"0.5",d:"M129.206 102.497C127.687 102.497 126.151 102.645 124.647 102.916C124.36 102.965 124.081 102.99 123.818 102.99C123.391 102.99 122.988 102.924 122.61 102.809C122.668 102.883 122.734 102.957 122.791 103.039C123.448 103.959 123.793 104.961 123.925 106.004C124.089 106.184 124.229 106.406 124.344 106.694C124.344 106.694 124.344 106.694 124.344 106.71C124.344 106.71 124.344 106.71 124.344 106.718C124.344 106.718 124.344 106.718 124.344 106.726C124.344 106.726 124.344 106.726 124.344 106.735C124.344 106.735 124.344 106.735 124.344 106.743C124.344 106.743 124.344 106.743 124.344 106.751C124.344 106.751 124.344 106.751 124.344 106.759C124.344 106.759 124.344 106.759 124.344 106.768V106.784C124.344 106.784 124.344 106.784 124.344 106.792C124.344 106.792 124.344 106.792 124.344 106.8C124.344 106.8 124.344 106.8 124.344 106.809C124.344 106.809 124.344 106.809 124.344 106.817C124.344 106.817 124.344 106.817 124.344 106.825C124.344 106.825 124.344 106.833 124.344 106.841C124.344 106.841 124.344 106.841 124.344 106.858C124.344 106.858 124.344 106.858 124.344 106.866C124.344 106.866 124.344 106.866 124.344 106.874C124.344 106.874 124.344 106.874 124.344 106.882C124.344 106.882 124.344 106.883 124.344 106.891C124.344 106.891 124.344 106.891 124.344 106.899C124.344 106.899 124.344 106.899 124.344 106.907C124.344 106.907 124.344 106.907 124.344 106.915C124.344 106.915 124.344 106.915 124.344 106.924C124.344 106.924 124.344 106.924 124.344 106.932C124.344 106.932 124.344 106.932 124.344 106.94C124.344 106.94 124.344 106.94 124.344 106.948C124.344 106.948 124.344 106.948 124.344 106.965C124.344 106.965 124.344 106.973 124.344 106.981C124.344 106.981 124.344 106.989 124.344 106.997V107.014C124.344 107.014 124.344 107.022 124.344 107.03C124.344 107.03 124.344 107.039 124.344 107.047C124.344 107.047 124.344 107.055 124.344 107.063C124.344 107.063 124.344 107.071 124.344 107.08C124.344 107.08 124.344 107.088 124.344 107.096C124.344 107.096 124.344 107.104 124.344 107.112C124.344 107.112 124.344 107.121 124.344 107.129C124.344 107.145 124.344 107.162 124.344 107.178C124.344 107.178 124.344 107.186 124.344 107.195C124.344 107.195 124.344 107.227 124.344 107.244C124.344 107.244 124.344 107.252 124.344 107.26V107.277C124.344 107.277 124.344 107.301 124.344 107.31C124.344 107.31 124.344 107.318 124.344 107.326V107.342V107.359C124.36 107.597 124.368 107.843 124.368 108.09C124.368 108.476 124.344 108.87 124.302 109.272C124.253 109.773 124.155 110.307 124.081 110.734C124.072 110.8 124.064 110.865 124.064 110.923C124.064 111.268 124.229 111.588 124.508 111.793L124.672 111.892C124.828 111.966 124.992 112.007 125.157 112.007C125.461 112.007 125.748 111.884 125.962 111.654C126.085 111.514 126.208 111.383 126.331 111.251C127.884 109.617 129.461 108.484 131.136 107.794C132.369 107.285 133.601 107.03 134.857 107.03C136.114 107.03 137.387 107.285 138.702 107.786C139.958 108.262 141.141 108.919 142.316 109.781C142.817 110.151 143.318 110.562 143.819 111.013C144.115 111.284 144.41 111.58 144.673 111.843L144.714 111.884L144.928 112.097L145.051 112.204C145.232 112.335 145.453 112.409 145.675 112.418C144.632 110.192 143.318 108.123 141.461 106.513C137.946 103.466 133.51 102.177 129.001 102.177",fill:"url(#paint9_linear_290_1904)"}),e("path",{opacity:"0.4",d:"M128.779 87.6905L128.582 87.7069C128.114 87.7972 127.752 88.175 127.695 88.6513C127.654 89.0208 127.654 89.415 127.703 89.8174C127.72 89.9488 127.687 90.072 127.629 90.1706C129.51 92.9627 133.584 97.9065 139.769 99.7789C139.769 99.7789 149.331 104.78 146.916 112.032L146.99 111.834C147.737 109.617 147.893 107.581 147.458 105.593C147.022 103.63 146.029 101.824 144.492 100.222C143.901 99.6064 143.244 99.0234 142.529 98.4978C142.184 98.2432 141.815 98.0051 141.437 97.7669C140.969 97.4713 140.484 97.192 139.95 96.921C137.995 95.9191 136.328 94.909 134.866 93.825C134.274 93.3898 133.699 92.9299 133.157 92.4536C131.851 91.3121 130.972 90.3348 130.315 89.3001C130.102 88.9716 129.913 88.6102 129.732 88.2653C129.658 88.1175 129.543 87.9943 129.412 87.8958C129.231 87.7562 129.001 87.6823 128.763 87.6823",fill:"url(#paint10_linear_290_1904)"}),e("path",{opacity:"0.5",d:"M116.647 107.893L118.586 106.768L126.734 95.8535C126.734 95.8535 122.274 95.0076 120.122 94.0303C120.122 94.0303 117.887 104.222 109.632 112.738L112.672 110.488C113.887 109.634 114.988 108.903 116.647 107.893Z",fill:"url(#paint11_linear_290_1904)"}),e("path",{d:"M209.416 49.9962H230.197C245.221 49.9962 252.104 57.7157 252.104 73.5818V81.4409C252.104 97.307 245.221 105.027 230.197 105.027H218.123V148.264H209.416V49.9962ZM230.197 97.0196C239.323 97.0196 243.397 92.9463 243.397 81.8598V73.0152C243.397 62.0682 239.323 57.8553 230.197 57.8553H218.123V97.0196H230.197Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M284.114 49.9962H292.821V93.0941H319.64V49.9962H328.346V148.256H319.64V100.953H292.821V148.256H284.114V49.9962Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M362.451 125.656V72.5963C362.451 57.0177 370.312 48.5919 384.497 48.5919C398.683 48.5919 406.544 57.0177 406.544 72.5963V125.656C406.544 141.234 398.683 149.66 384.497 149.66C370.312 149.66 362.451 141.234 362.451 125.656ZM397.829 126.214V72.0297C397.829 61.5016 393.056 56.451 384.489 56.451C375.922 56.451 371.15 61.5016 371.15 72.0297V126.214C371.15 136.742 375.922 141.653 384.489 141.653C393.056 141.653 397.829 136.742 397.829 126.214Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M440.796 49.9962H480.108V57.8553H449.503V93.0859H474.638V100.945H449.503V140.249H480.108V148.248H440.796V49.9962Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M511.56 49.9962H523.076L548.629 125.935V49.9962H556.769V148.256H547.504L519.56 64.458V148.256H511.56V49.9962Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M592.007 49.9962H600.714V148.256H592.007V49.9962Z",fill:"var(--ac-global-text-color-900)"}),e("path",{d:"M651.674 98.1447L632.437 49.9962H641.702L657.144 89.0209L672.726 49.9962H681.154L661.917 98.1447L681.992 148.256H672.726L656.438 106.989L640.01 148.256H631.591L651.666 98.1447H651.674Z",fill:"var(--ac-global-text-color-900)"})]}),s("defs",{children:[s("linearGradient",{id:"paint0_linear_290_1904",x1:"22.0956",y1:"10.3474",x2:"97.4433",y2:"140.879",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#14BAB6"}),e("stop",{offset:"0.5",stopColor:"#00ADEE"}),e("stop",{offset:"1",stopColor:"#0095C4"})]}),s("linearGradient",{id:"paint1_linear_290_1904",x1:"95.422",y1:"114.807",x2:"31.8741",y2:"4.70214",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint2_linear_290_1904",x1:"76.6695",y1:"114.126",x2:"30.8746",y2:"34.7951",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint3_linear_290_1904",x1:"70.3612",y1:"119.915",x2:"44.7991",y2:"75.6384",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint4_linear_290_1904",x1:"71.4208",y1:"128.85",x2:"55.5071",y2:"101.279",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint5_linear_290_1904",x1:"44.5363",y1:"126.346",x2:"44.5363",y2:"155.384",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"0.03",stopColor:"#231F20",stopOpacity:"0.9"}),e("stop",{offset:"0.22",stopColor:"#231F20",stopOpacity:"0.4"}),e("stop",{offset:"0.42",stopColor:"#231F20",stopOpacity:"0.1"}),e("stop",{offset:"0.65",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint6_linear_290_1904",x1:"77.1952",y1:"123.603",x2:"77.1952",y2:"138.409",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"1",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint7_linear_290_1904",x1:"84.3413",y1:"85.235",x2:"84.3413",y2:"73.1301",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"0.03",stopColor:"#231F20",stopOpacity:"0.95"}),e("stop",{offset:"0.51",stopColor:"#231F20",stopOpacity:"0.26"}),e("stop",{offset:"0.81",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint8_linear_290_1904",x1:"110.815",y1:"94.1699",x2:"110.815",y2:"64.885",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"0.18",stopColor:"#231F20",stopOpacity:"0.48"}),e("stop",{offset:"0.38",stopColor:"#231F20",stopOpacity:"0.12"}),e("stop",{offset:"0.58",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint9_linear_290_1904",x1:"138.077",y1:"117.246",x2:"127.969",y2:"99.7278",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"1",stopColor:"#231F20",stopOpacity:"0"})]}),s("linearGradient",{id:"paint10_linear_290_1904",x1:"146.226",y1:"112.434",x2:"131.084",y2:"86.1931",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#FDFDFE",stopOpacity:"0"}),e("stop",{offset:"0.11",stopColor:"#FDFDFE",stopOpacity:"0.17"}),e("stop",{offset:"0.3",stopColor:"#FDFDFE",stopOpacity:"0.42"}),e("stop",{offset:"0.47",stopColor:"#FDFDFE",stopOpacity:"0.63"}),e("stop",{offset:"0.64",stopColor:"#FDFDFE",stopOpacity:"0.79"}),e("stop",{offset:"0.78",stopColor:"#FDFDFE",stopOpacity:"0.9"}),e("stop",{offset:"0.91",stopColor:"#FDFDFE",stopOpacity:"0.97"}),e("stop",{offset:"1",stopColor:"#FDFDFE"})]}),s("linearGradient",{id:"paint11_linear_290_1904",x1:"106.889",y1:"107.999",x2:"128.941",y2:"95.2581",gradientUnits:"userSpaceOnUse",children:[e("stop",{stopColor:"#231F20"}),e("stop",{offset:"0.31",stopColor:"#231F20",stopOpacity:"0.5"}),e("stop",{offset:"0.67",stopColor:"#231F20",stopOpacity:"0.13"}),e("stop",{offset:"1",stopColor:"#231F20",stopOpacity:"0"})]}),e("clipPath",{id:"clip0_290_1904",children:e("rect",{width:"682",height:"169",fill:"white"})})]})]})}const ap=v`
3537
3355
  text-align: center;
3538
3356
  margin-top: var(--ac-global-dimension-size-200);
3539
3357
  margin-bottom: var(--ac-global-dimension-size-200);
3540
3358
  color: var(--ac-global-text-color-700);
3541
- `,cp=C`
3359
+ `,tp=v`
3542
3360
  display: flex;
3543
3361
  flex-direction: column;
3544
3362
  gap: var(--ac-global-dimension-size-100);
3545
3363
  flex-wrap: wrap;
3546
3364
  justify-content: center;
3547
- `;function uf(){const n=window.Config.oAuth2Idps,a=n.length>0,[l,t]=fa(),i=l.get("returnUrl"),r=l.get("message");return s(Ia,{children:[e(h,{direction:"column",gap:"size-200",alignItems:"center",children:e(F,{paddingBottom:"size-200",children:e(ul,{})})}),r&&e(F,{paddingBottom:"size-100",children:e(ne,{variant:"success",children:r})}),e(ip,{initialError:l.get("error"),onSubmit:()=>{t(o=>{const c=new URLSearchParams(o);return c.delete("message"),c.delete("error"),c})}}),a&&s(U,{children:[e("div",{css:dp,children:"or"}),e("ul",{css:cp,children:n.map(o=>e("li",{children:e(sp,{idpName:o.name,idpDisplayName:o.displayName,returnUrl:i},o.name)},o.name))})]})]})}const gs=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"UserMutationPayload",kind:"LinkedField",name:"patchViewer",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ResetPasswordFormMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ResetPasswordFormMutation",selections:a},params:{cacheID:"d09af5e3a2a3d10f117373e25bef11e6",id:null,metadata:{},name:"ResetPasswordFormMutation",operationKind:"mutation",text:`mutation ResetPasswordFormMutation(
3365
+ `;function Cf(){const n=window.Config.oAuth2Idps,a=n.length>0,[t,l]=la(),i=t.get("returnUrl"),r=t.get("message");return s(wa,{children:[e(h,{direction:"column",gap:"size-200",alignItems:"center",children:e(F,{paddingBottom:"size-200",children:e(kt,{})})}),r&&e(F,{paddingBottom:"size-100",children:e(te,{variant:"success",children:r})}),e(Xg,{initialError:t.get("error"),onSubmit:()=>{l(o=>{const c=new URLSearchParams(o);return c.delete("message"),c.delete("error"),c})}}),a&&s(H,{children:[e("div",{css:ap,children:"or"}),e("ul",{css:tp,children:n.map(o=>e("li",{children:e(ep,{idpName:o.name,idpDisplayName:o.displayName,returnUrl:i},o.name)},o.name))})]})]})}const gs=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"UserMutationPayload",kind:"LinkedField",name:"patchViewer",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ResetPasswordFormMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ResetPasswordFormMutation",selections:a},params:{cacheID:"d09af5e3a2a3d10f117373e25bef11e6",id:null,metadata:{},name:"ResetPasswordFormMutation",operationKind:"mutation",text:`mutation ResetPasswordFormMutation(
3548
3366
  $input: PatchViewerInput!
3549
3367
  ) {
3550
3368
  patchViewer(input: $input) {
3551
3369
  __typename
3552
3370
  }
3553
3371
  }
3554
- `}}}();gs.hash="f8f5c30b0e00c17cdda7557c73c3c2d3";const Jn=4;function up(){const n=Y(),a=ce(),[l,t]=D.useMutation(gs),{control:i,handleSubmit:r}=Ie({defaultValues:{currentPassword:"",newPassword:"",confirmPassword:""}}),o=u.useCallback(c=>{l({variables:{input:{currentPassword:c.currentPassword,newPassword:c.newPassword}},onCompleted:()=>{const d=ct({path:"/login",searchParams:{message:"Password has been reset."}});n(d)},onError:d=>{a({title:"Failed to reset password",message:d.message})}})},[l,n,a]);return s(ye,{onSubmit:r(o),children:[e(G,{name:"currentPassword",control:i,rules:{required:"the current is required"},render:({field:{name:c,onChange:d,onBlur:g,value:f},fieldState:{invalid:m,error:p}})=>e(X,{label:"Old Password",type:"password",name:c,isRequired:!0,description:"The current password",errorMessage:p==null?void 0:p.message,validationState:m?"invalid":"valid",onChange:d,onBlur:g,value:f})}),e(G,{name:"newPassword",control:i,rules:{required:"Password is required",minLength:{value:Jn,message:`Password must be at least ${Jn} characters`},validate:(c,d)=>c!==d.currentPassword||"New password must be different"},render:({field:{name:c,onChange:d,onBlur:g,value:f},fieldState:{invalid:m,error:p}})=>e(X,{label:"New Password",type:"password",isRequired:!0,description:`Password must be at least ${Jn} characters`,name:c,errorMessage:p==null?void 0:p.message,validationState:m?"invalid":"valid",onChange:d,onBlur:g,defaultValue:f})}),e(G,{name:"confirmPassword",control:i,rules:{required:"Password is required",minLength:{value:Jn,message:`Password must be at least ${Jn} characters`},validate:(c,d)=>c===d.newPassword||"Passwords do not match"},render:({field:{name:c,onChange:d,onBlur:g,value:f},fieldState:{invalid:m,error:p}})=>e(X,{label:"Confirm Password",isRequired:!0,type:"password",description:"Confirm the new password",name:c,errorMessage:p==null?void 0:p.message,validationState:m?"invalid":"valid",onChange:d,onBlur:g,defaultValue:f})}),e(F,{paddingTop:"size-200",children:s("div",{css:C`
3372
+ `}}}();gs.hash="f8f5c30b0e00c17cdda7557c73c3c2d3";const ea=4;function lp(){const n=Y(),a=ce(),[t,l]=I.useMutation(gs),{control:i,handleSubmit:r}=Ae({defaultValues:{currentPassword:"",newPassword:"",confirmPassword:""}}),o=u.useCallback(c=>{t({variables:{input:{currentPassword:c.currentPassword,newPassword:c.newPassword}},onCompleted:()=>{const d=kl({path:"/login",searchParams:{message:"Password has been reset."}});n(d)},onError:d=>{a({title:"Failed to reset password",message:d.message})}})},[t,n,a]);return s(fe,{onSubmit:r(o),children:[e(Z,{name:"currentPassword",control:i,rules:{required:"the current is required"},render:({field:{name:c,onChange:d,onBlur:g,value:f},fieldState:{invalid:m,error:p}})=>e(G,{label:"Old Password",type:"password",name:c,isRequired:!0,description:"The current password",errorMessage:p==null?void 0:p.message,validationState:m?"invalid":"valid",onChange:d,onBlur:g,value:f})}),e(Z,{name:"newPassword",control:i,rules:{required:"Password is required",minLength:{value:ea,message:`Password must be at least ${ea} characters`},validate:(c,d)=>c!==d.currentPassword||"New password must be different"},render:({field:{name:c,onChange:d,onBlur:g,value:f},fieldState:{invalid:m,error:p}})=>e(G,{label:"New Password",type:"password",isRequired:!0,description:`Password must be at least ${ea} characters`,name:c,errorMessage:p==null?void 0:p.message,validationState:m?"invalid":"valid",onChange:d,onBlur:g,defaultValue:f})}),e(Z,{name:"confirmPassword",control:i,rules:{required:"Password is required",minLength:{value:ea,message:`Password must be at least ${ea} characters`},validate:(c,d)=>c===d.newPassword||"Passwords do not match"},render:({field:{name:c,onChange:d,onBlur:g,value:f},fieldState:{invalid:m,error:p}})=>e(G,{label:"Confirm Password",isRequired:!0,type:"password",description:"Confirm the new password",name:c,errorMessage:p==null?void 0:p.message,validationState:m?"invalid":"valid",onChange:d,onBlur:g,defaultValue:f})}),e(F,{paddingTop:"size-200",children:s("div",{css:v`
3555
3373
  display: flex;
3556
3374
  flex-direction: row;
3557
3375
  gap: var(--ac-global-dimension-size-200);
3558
3376
  & > * {
3559
3377
  width: 50%;
3560
3378
  }
3561
- `,children:[e(M,{variant:"default",onClick:()=>{n(-1)},children:"Cancel"}),e(M,{variant:"primary",type:"submit",disabled:t,children:t?"Resetting...":"Reset Password"})]})})]})}function mf(){return s(Ia,{children:[e(h,{direction:"column",gap:"size-200",alignItems:"center",children:e(F,{paddingBottom:"size-200",children:e(ul,{})})}),e(up,{})]})}const Zn=4,mp="An error occurred. Please try resetting again.";function gp({resetToken:n}){const a=Y(),[l,t]=u.useState(null),[i,r]=u.useState(!1),o=u.useCallback(async({resetToken:f,newPassword:m})=>{t(null),r(!0);try{const p=await fetch("/auth/password-reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:f,password:m})});if(!p.ok){const y=await p.text();t(y);return}}catch{t(mp);return}finally{r(()=>!1)}a(`/login?message=${encodeURIComponent("Password has been reset.")}`)},[t,a]),{control:c,handleSubmit:d,formState:{isDirty:g}}=Ie({defaultValues:{resetToken:n,newPassword:"",confirmPassword:""}});return s(U,{children:[l?e(F,{paddingBottom:"size-100",children:e(ne,{variant:"danger",children:l})}):null,s(ye,{onSubmit:d(o),children:[e(G,{name:"newPassword",control:c,rules:{required:"Password is required",minLength:{value:Zn,message:`Password must be at least ${Zn} characters`}},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:b,error:k}})=>e(X,{label:"New Password",type:"password",isRequired:!0,description:`Password must be at least ${Zn} characters`,name:f,errorMessage:k==null?void 0:k.message,validationState:b?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})}),e(G,{name:"confirmPassword",control:c,rules:{required:"Password is required",minLength:{value:Zn,message:`Password must be at least ${Zn} characters`},validate:(f,m)=>f===m.newPassword||"Passwords do not match"},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:b,error:k}})=>e(X,{label:"Confirm Password",isRequired:!0,type:"password",description:"Confirm the new password",name:f,errorMessage:k==null?void 0:k.message,validationState:b?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})}),e("div",{css:C`
3379
+ `,children:[e(N,{variant:"default",onClick:()=>{n(-1)},children:"Cancel"}),e(N,{variant:"primary",type:"submit",disabled:l,children:l?"Resetting...":"Reset Password"})]})})]})}function Ff(){return s(wa,{children:[e(h,{direction:"column",gap:"size-200",alignItems:"center",children:e(F,{paddingBottom:"size-200",children:e(kt,{})})}),e(lp,{})]})}const na=4,ip="An error occurred. Please try resetting again.";function rp({resetToken:n}){const a=Y(),[t,l]=u.useState(null),[i,r]=u.useState(!1),o=u.useCallback(async({resetToken:f,newPassword:m})=>{l(null),r(!0);try{const p=await fetch("/auth/password-reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:f,password:m})});if(!p.ok){const y=await p.text();l(y);return}}catch{l(ip);return}finally{r(()=>!1)}a(`/login?message=${encodeURIComponent("Password has been reset.")}`)},[l,a]),{control:c,handleSubmit:d,formState:{isDirty:g}}=Ae({defaultValues:{resetToken:n,newPassword:"",confirmPassword:""}});return s(H,{children:[t?e(F,{paddingBottom:"size-100",children:e(te,{variant:"danger",children:t})}):null,s(fe,{onSubmit:d(o),children:[e(Z,{name:"newPassword",control:c,rules:{required:"Password is required",minLength:{value:na,message:`Password must be at least ${na} characters`}},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:k,error:S}})=>e(G,{label:"New Password",type:"password",isRequired:!0,description:`Password must be at least ${na} characters`,name:f,errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})}),e(Z,{name:"confirmPassword",control:c,rules:{required:"Password is required",minLength:{value:na,message:`Password must be at least ${na} characters`},validate:(f,m)=>f===m.newPassword||"Passwords do not match"},render:({field:{name:f,onChange:m,onBlur:p,value:y},fieldState:{invalid:k,error:S}})=>e(G,{label:"Confirm Password",isRequired:!0,type:"password",description:"Confirm the new password",name:f,errorMessage:S==null?void 0:S.message,validationState:k?"invalid":"valid",onChange:m,onBlur:p,defaultValue:y})}),e("div",{css:v`
3562
3380
  margin-top: var(--ac-global-dimension-size-200);
3563
3381
  margin-bottom: var(--ac-global-dimension-size-50);
3564
3382
  button {
3565
3383
  width: 100%;
3566
3384
  }
3567
- `,children:e(M,{variant:g?"primary":"default",type:"submit",disabled:i,children:i?"Resetting...":"Reset Password"})})]})]})}function gf(){const n=Y(),[a]=fa(),l=a.get("token");return l?s(Ia,{children:[e(h,{direction:"column",gap:"size-200",alignItems:"center",children:e(F,{paddingBottom:"size-200",children:e(ul,{})})}),e(gp,{resetToken:l}),e(F,{paddingTop:"size-200",children:e(h,{direction:"column",alignItems:"center",justifyContent:"center",children:e(Ze,{to:"/login",children:"Back to Login"})})})]}):(n("/login"),null)}const ps=function(){var n=[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"resetPasswordLoaderQuery",selections:n,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"resetPasswordLoaderQuery",selections:n},params:{cacheID:"c97389cd896f3e1746d0adf67c759462",id:null,metadata:{},name:"resetPasswordLoaderQuery",operationKind:"query",text:`query resetPasswordLoaderQuery {
3385
+ `,children:e(N,{variant:g?"primary":"default",type:"submit",disabled:i,children:i?"Resetting...":"Reset Password"})})]})]})}function Kf(){const n=Y(),[a]=la(),t=a.get("token");return t?s(wa,{children:[e(h,{direction:"column",gap:"size-200",alignItems:"center",children:e(F,{paddingBottom:"size-200",children:e(kt,{})})}),e(rp,{resetToken:t}),e(F,{paddingTop:"size-200",children:e(h,{direction:"column",alignItems:"center",justifyContent:"center",children:e(We,{to:"/login",children:"Back to Login"})})})]}):(n("/login"),null)}const ps=function(){var n=[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"resetPasswordLoaderQuery",selections:n,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"resetPasswordLoaderQuery",selections:n},params:{cacheID:"c97389cd896f3e1746d0adf67c759462",id:null,metadata:{},name:"resetPasswordLoaderQuery",operationKind:"query",text:`query resetPasswordLoaderQuery {
3568
3386
  viewer {
3569
3387
  id
3570
3388
  email
3571
3389
  }
3572
3390
  }
3573
- `}}}();ps.hash="ccd75708c3ba7c1b283f7858dfa8d20e";async function pf(){const n=await D.fetchQuery(xe,ps,{}).toPromise();return n!=null&&n.viewer?n:Pn("/login")}function pp({onResetSent:n}){const[a,l]=u.useState(null),[t,i]=u.useState(!1),r=u.useCallback(async d=>{l(null),i(!0);try{const g=await fetch("/auth/password-reset-email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(!g.ok){const f=await g.text();l(f);return}n()}finally{i(()=>!1)}},[n,l]),{control:o,handleSubmit:c}=Ie({defaultValues:{email:""}});return s(U,{children:[a?e(F,{paddingBottom:"size-100",children:e(ne,{variant:"danger",children:a})}):null,s(ye,{onSubmit:c(r),children:[e(G,{name:"email",control:o,render:({field:{onChange:d,value:g}})=>e(X,{label:"Email",name:"email",isRequired:!0,type:"email",onChange:d,value:g,placeholder:"your email address",description:"Enter the email address associated with your account."})}),e("div",{css:C`
3391
+ `}}}();ps.hash="ccd75708c3ba7c1b283f7858dfa8d20e";async function xf(){const n=await I.fetchQuery(xe,ps,{}).toPromise();return n!=null&&n.viewer?n:wn("/login")}function sp({onResetSent:n}){const[a,t]=u.useState(null),[l,i]=u.useState(!1),r=u.useCallback(async d=>{t(null),i(!0);try{const g=await fetch("/auth/password-reset-email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(!g.ok){const f=await g.text();t(f);return}n()}finally{i(()=>!1)}},[n,t]),{control:o,handleSubmit:c}=Ae({defaultValues:{email:""}});return s(H,{children:[a?e(F,{paddingBottom:"size-100",children:e(te,{variant:"danger",children:a})}):null,s(fe,{onSubmit:c(r),children:[e(Z,{name:"email",control:o,render:({field:{onChange:d,value:g}})=>e(G,{label:"Email",name:"email",isRequired:!0,type:"email",onChange:d,value:g,placeholder:"your email address",description:"Enter the email address associated with your account."})}),e("div",{css:v`
3574
3392
  margin-top: var(--ac-global-dimension-size-200);
3575
3393
  margin-bottom: var(--ac-global-dimension-size-50);
3576
3394
  button {
3577
3395
  width: 100%;
3578
3396
  }
3579
- `,children:e(M,{variant:"primary",type:"submit",loading:t,children:"Send"})})]})]})}function yf(){const[n,a]=u.useState(!1),l=n?s(h,{direction:"column",alignItems:"center",justifyContent:"center",gap:"size-100",children:[e(re,{level:1,children:"Check your email"}),e("p",{children:"Thanks! If an account with that email address exists, we sent you a link to reset your password."})]}):s(U,{children:[s(h,{direction:"column",alignItems:"center",justifyContent:"center",gap:"size-100",children:[e(re,{level:1,children:"Forgot Password"}),e("p",{children:`Enter the email address associated with your account and we'll send you
3580
- a link to reset your password.`})]}),e(pp,{onResetSent:()=>a(!0)})]});return e(Ia,{children:s("div",{css:C`
3397
+ `,children:e(N,{variant:"primary",type:"submit",loading:l,children:"Send"})})]})]})}function Tf(){const[n,a]=u.useState(!1),t=n?s(h,{direction:"column",alignItems:"center",justifyContent:"center",gap:"size-100",children:[e(se,{level:1,children:"Check your email"}),e("p",{children:"Thanks! If an account with that email address exists, we sent you a link to reset your password."})]}):s(H,{children:[s(h,{direction:"column",alignItems:"center",justifyContent:"center",gap:"size-100",children:[e(se,{level:1,children:"Forgot Password"}),e("p",{children:`Enter the email address associated with your account and we'll send you
3398
+ a link to reset your password.`})]}),e(sp,{onResetSent:()=>a(!0)})]});return e(wa,{children:s("div",{css:v`
3581
3399
  & a {
3582
3400
  text-align: center;
3583
3401
  width: 100%;
@@ -3585,7 +3403,7 @@ fragment UsersTable_users on Query {
3585
3403
  text-align: center;
3586
3404
  padding-top: var(--ac-global-dimension-size-200);
3587
3405
  }
3588
- `,children:[l,e(h,{direction:"column",alignItems:"center",justifyContent:"center",gap:"size-200",children:e(Ze,{to:"/login",children:"Back to Login"})})]})})}const ys=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{kind:"Variable",name:"input",variableName:"input"}],l={alias:null,args:null,kind:"ScalarField",name:"jwt",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ViewerAPIKeysCreateUserAPIKeyMutation",selections:[{alias:null,args:a,concreteType:"CreateUserApiKeyMutationPayload",kind:"LinkedField",name:"createUserApiKey",plural:!1,selections:[l,{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKey",plural:!1,selections:[t,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"APIKeysTableFragment"}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ViewerAPIKeysCreateUserAPIKeyMutation",selections:[{alias:null,args:a,concreteType:"CreateUserApiKeyMutationPayload",kind:"LinkedField",name:"createUserApiKey",plural:!1,selections:[l,{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKey",plural:!1,selections:[t,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKeys",plural:!0,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null},t],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"572bf0f64678128defccf833e6a5d4ce",id:null,metadata:{},name:"ViewerAPIKeysCreateUserAPIKeyMutation",operationKind:"mutation",text:`mutation ViewerAPIKeysCreateUserAPIKeyMutation(
3406
+ `,children:[t,e(h,{direction:"column",alignItems:"center",justifyContent:"center",gap:"size-200",children:e(We,{to:"/login",children:"Back to Login"})})]})})}const ys=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{kind:"Variable",name:"input",variableName:"input"}],t={alias:null,args:null,kind:"ScalarField",name:"jwt",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ViewerAPIKeysCreateUserAPIKeyMutation",selections:[{alias:null,args:a,concreteType:"CreateUserApiKeyMutationPayload",kind:"LinkedField",name:"createUserApiKey",plural:!1,selections:[t,{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKey",plural:!1,selections:[l,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"APIKeysTableFragment"}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ViewerAPIKeysCreateUserAPIKeyMutation",selections:[{alias:null,args:a,concreteType:"CreateUserApiKeyMutationPayload",kind:"LinkedField",name:"createUserApiKey",plural:!1,selections:[t,{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKey",plural:!1,selections:[l,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKeys",plural:!0,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null},l],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"572bf0f64678128defccf833e6a5d4ce",id:null,metadata:{},name:"ViewerAPIKeysCreateUserAPIKeyMutation",operationKind:"mutation",text:`mutation ViewerAPIKeysCreateUserAPIKeyMutation(
3589
3407
  $input: CreateUserApiKeyInput!
3590
3408
  ) {
3591
3409
  createUserApiKey(input: $input) {
@@ -3609,7 +3427,7 @@ fragment APIKeysTableFragment on User {
3609
3427
  }
3610
3428
  id
3611
3429
  }
3612
- `}}}();ys.hash="28061ae008e197468be6fd5f2775ccb0";const fs=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{kind:"Variable",name:"input",variableName:"input"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"apiKeyId",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"APIKeysTableDeleteAPIKeyMutation",selections:[{alias:null,args:a,concreteType:"DeleteApiKeyMutationPayload",kind:"LinkedField",name:"deleteUserApiKey",plural:!1,selections:[l,t,{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"UserAPIKeysTableFragment"}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"APIKeysTableDeleteAPIKeyMutation",selections:[{alias:null,args:a,concreteType:"DeleteApiKeyMutationPayload",kind:"LinkedField",name:"deleteUserApiKey",plural:!1,selections:[l,t,{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"userApiKeys",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"f28a00e7a6eb2e18b1f8b31c8231c2b7",id:null,metadata:{},name:"APIKeysTableDeleteAPIKeyMutation",operationKind:"mutation",text:`mutation APIKeysTableDeleteAPIKeyMutation(
3430
+ `}}}();ys.hash="28061ae008e197468be6fd5f2775ccb0";const fs=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{kind:"Variable",name:"input",variableName:"input"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"apiKeyId",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"APIKeysTableDeleteAPIKeyMutation",selections:[{alias:null,args:a,concreteType:"DeleteApiKeyMutationPayload",kind:"LinkedField",name:"deleteUserApiKey",plural:!1,selections:[t,l,{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"UserAPIKeysTableFragment"}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"APIKeysTableDeleteAPIKeyMutation",selections:[{alias:null,args:a,concreteType:"DeleteApiKeyMutationPayload",kind:"LinkedField",name:"deleteUserApiKey",plural:!1,selections:[t,l,{alias:null,args:null,concreteType:"Query",kind:"LinkedField",name:"query",plural:!1,selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"userApiKeys",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"f28a00e7a6eb2e18b1f8b31c8231c2b7",id:null,metadata:{},name:"APIKeysTableDeleteAPIKeyMutation",operationKind:"mutation",text:`mutation APIKeysTableDeleteAPIKeyMutation(
3613
3431
  $input: DeleteApiKeyInput!
3614
3432
  ) {
3615
3433
  deleteUserApiKey(input: $input) {
@@ -3633,7 +3451,7 @@ fragment UserAPIKeysTableFragment on Query {
3633
3451
  }
3634
3452
  }
3635
3453
  }
3636
- `}}}();fs.hash="3a505d9d13944798a57fc873ddf0992d";const hs=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"APIKeysTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"APIKeysTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"APIKeysTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKeys",plural:!0,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null}],type:"User",abstractKey:null}],storageKey:null}]},params:{cacheID:"e677b5974fa137ac3a26acde353767d8",id:null,metadata:{},name:"APIKeysTableQuery",operationKind:"query",text:`query APIKeysTableQuery(
3454
+ `}}}();fs.hash="3a505d9d13944798a57fc873ddf0992d";const hs=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"}],a=[{kind:"Variable",name:"id",variableName:"id"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"APIKeysTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"APIKeysTableFragment"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"APIKeysTableQuery",selections:[{alias:null,args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKeys",plural:!0,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null}],type:"User",abstractKey:null}],storageKey:null}]},params:{cacheID:"e677b5974fa137ac3a26acde353767d8",id:null,metadata:{},name:"APIKeysTableQuery",operationKind:"query",text:`query APIKeysTableQuery(
3637
3455
  $id: GlobalID!
3638
3456
  ) {
3639
3457
  node(id: $id) {
@@ -3654,16 +3472,16 @@ fragment APIKeysTableFragment on User {
3654
3472
  }
3655
3473
  id
3656
3474
  }
3657
- `}}}();hs.hash="6c32098d55e4cba859dcec73f3ccd28c";const ks=function(){var n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:hs,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"APIKeysTableFragment",selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKeys",plural:!0,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null},n],type:"User",abstractKey:null}}();ks.hash="6c32098d55e4cba859dcec73f3ccd28c";const El=70;function yp({query:n}){const[a,l]=D.useRefetchableFragment(ks,n),t=oe(),[i]=D.useMutation(fs),r=u.useCallback(m=>{i({variables:{input:{id:m}},onCompleted:()=>{t({title:"API key deleted",message:"The key has been deleted and is no longer active."}),u.startTransition(()=>{l({},{fetchPolicy:"network-only"})})}})},[i,t,l]),o=u.useMemo(()=>[...a.apiKeys],[a]),c=u.useMemo(()=>[{header:"Name",accessorKey:"name",size:100,cell:me},{header:"Description",accessorKey:"description",cell:me},{header:"Created At",accessorKey:"createdAt",size:El,cell:Fe},{header:"Expires At",accessorKey:"expiresAt",size:El,cell:Fe},{header:"",accessorKey:"id",size:10,cell:({row:p})=>e(h,{direction:"row",justifyContent:"end",width:"100%",children:e(il,{handleDelete:()=>{r(p.original.id)}})}),meta:{textAlign:"right"}}],[r]),d=he({columns:c,data:o,getCoreRowModel:ke()}),g=d.getRowModel().rows,f=d.getRowModel().rows.length===0;return s("table",{css:We,children:[e("thead",{children:d.getHeaderGroups().map(m=>e("tr",{children:m.headers.map(p=>e("th",{colSpan:p.colSpan,children:p.isPlaceholder?null:s("div",{className:p.column.getCanSort()?"cursor-pointer":"",onClick:p.column.getToggleSortingHandler(),style:{left:p.getStart(),width:p.getSize()},children:[Z(p.column.columnDef.header,p.getContext()),p.column.getIsSorted()?e(P,{className:"sort-icon",svg:p.column.getIsSorted()==="asc"?e(I.ArrowUpFilled,{}):e(I.ArrowDownFilled,{})}):null]})},p.id))},m.id))}),f?e(Je,{message:"No Keys"}):e("tbody",{children:g.map(m=>e("tr",{children:m.getVisibleCells().map(p=>e("td",{children:Z(p.column.columnDef.cell,p.getContext())},p.id))},m.id))})]})}function fp({viewer:n}){const[a,l]=u.useState(null),t=ce(),[i,r]=D.useMutation(ys),o=u.useCallback(c=>{i({variables:{input:{...c,expiresAt:c.expiresAt||null}},onCompleted:d=>{l(e(st,{jwt:d.createUserApiKey.jwt}))},onError:d=>{t({title:"Error creating API key",message:d.message})}})},[i,t]);return s(V,{title:"API Keys",variant:"compact",bodyStyle:{padding:0},extra:e(M,{variant:"default",size:"compact",icon:e(P,{svg:e(I.PlusCircleOutline,{})}),onClick:()=>l(e(ot,{onSubmit:o,isCommitting:r})),children:"New Key"}),children:[e(yp,{query:n}),e(W,{onDismiss:()=>{l(null)},children:a})]})}const bs=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"UserMutationPayload",kind:"LinkedField",name:"patchViewer",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ViewerProfileCardMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ViewerProfileCardMutation",selections:a},params:{cacheID:"03f161df42c71b5924a8ee665e01cdce",id:null,metadata:{},name:"ViewerProfileCardMutation",operationKind:"mutation",text:`mutation ViewerProfileCardMutation(
3475
+ `}}}();hs.hash="6c32098d55e4cba859dcec73f3ccd28c";const ks=function(){var n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[],kind:"Fragment",metadata:{refetch:{connection:null,fragmentPathInResult:["node"],operation:hs,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"APIKeysTableFragment",selections:[{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKeys",plural:!0,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null},n],type:"User",abstractKey:null}}();ks.hash="6c32098d55e4cba859dcec73f3ccd28c";const jt=70;function op({query:n}){const[a,t]=I.useRefetchableFragment(ks,n),l=oe(),[i]=I.useMutation(fs),r=u.useCallback(m=>{i({variables:{input:{id:m}},onCompleted:()=>{l({title:"API key deleted",message:"The key has been deleted and is no longer active."}),u.startTransition(()=>{t({},{fetchPolicy:"network-only"})})}})},[i,l,t]),o=u.useMemo(()=>[...a.apiKeys],[a]),c=u.useMemo(()=>[{header:"Name",accessorKey:"name",size:100,cell:me},{header:"Description",accessorKey:"description",cell:me},{header:"Created At",accessorKey:"createdAt",size:jt,cell:Fe},{header:"Expires At",accessorKey:"expiresAt",size:jt,cell:Fe},{header:"",accessorKey:"id",size:10,cell:({row:p})=>e(h,{direction:"row",justifyContent:"end",width:"100%",children:e(ut,{handleDelete:()=>{r(p.original.id)}})}),meta:{textAlign:"right"}}],[r]),d=ke({columns:c,data:o,getCoreRowModel:be()}),g=d.getRowModel().rows,f=d.getRowModel().rows.length===0;return s("table",{css:He,children:[e("thead",{children:d.getHeaderGroups().map(m=>e("tr",{children:m.headers.map(p=>e("th",{colSpan:p.colSpan,children:p.isPlaceholder?null:s("div",{className:p.column.getCanSort()?"cursor-pointer":"",onClick:p.column.getToggleSortingHandler(),style:{left:p.getStart(),width:p.getSize()},children:[X(p.column.columnDef.header,p.getContext()),p.column.getIsSorted()?e(w,{className:"sort-icon",svg:p.column.getIsSorted()==="asc"?e(L.ArrowUpFilled,{}):e(L.ArrowDownFilled,{})}):null]})},p.id))},m.id))}),f?e(Ge,{message:"No Keys"}):e("tbody",{children:g.map(m=>e("tr",{children:m.getVisibleCells().map(p=>e("td",{children:X(p.column.columnDef.cell,p.getContext())},p.id))},m.id))})]})}function dp({viewer:n}){const[a,t]=u.useState(null),l=ce(),[i,r]=I.useMutation(ys),o=u.useCallback(c=>{i({variables:{input:{...c,expiresAt:c.expiresAt||null}},onCompleted:d=>{t(e(yl,{jwt:d.createUserApiKey.jwt}))},onError:d=>{l({title:"Error creating API key",message:d.message})}})},[i,l]);return s($,{title:"API Keys",variant:"compact",bodyStyle:{padding:0},extra:e(N,{variant:"default",size:"compact",icon:e(w,{svg:e(L.PlusCircleOutline,{})}),onClick:()=>t(e(fl,{onSubmit:o,isCommitting:r})),children:"New Key"}),children:[e(op,{query:n}),e(W,{onDismiss:()=>{t(null)},children:a})]})}const bs=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"UserMutationPayload",kind:"LinkedField",name:"patchViewer",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ViewerProfileCardMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ViewerProfileCardMutation",selections:a},params:{cacheID:"03f161df42c71b5924a8ee665e01cdce",id:null,metadata:{},name:"ViewerProfileCardMutation",operationKind:"mutation",text:`mutation ViewerProfileCardMutation(
3658
3476
  $input: PatchViewerInput!
3659
3477
  ) {
3660
3478
  patchViewer(input: $input) {
3661
3479
  __typename
3662
3480
  }
3663
3481
  }
3664
- `}}}();bs.hash="4a11ca65151d84fe95f636763c91dc68";function hp(){const{viewer:n,refetchViewer:a}=ut(),l=ce(),t=oe(),[i,r]=D.useMutation(bs),o=Y(),{control:c,handleSubmit:d,formState:{isDirty:g},reset:f}=Ie({defaultValues:{username:(n==null?void 0:n.username)||""}}),m=u.useCallback(p=>{i({variables:{input:{newUsername:p.username}},onCompleted:()=>{t({title:"Profile updated",message:"Your profile has been updated"}),f({username:p.username}),a()},onError:y=>{l({title:"Failed update profile",message:y.message})}})},[i,t,f,a,l]);return n?s(V,{title:"Profile",variant:"compact",bodyStyle:{padding:0},extra:n.authMethod==="LOCAL"&&e(M,{variant:"default",size:"compact",onClick:()=>{o("/reset-password")},children:"Reset Password"}),children:[e(F,{paddingTop:"size-200",paddingStart:"size-200",paddingEnd:"size-200",children:s(h,{direction:"row",gap:"size-200",alignItems:"center",children:[e(dt,{name:n.username||n.email,profilePictureUrl:n.profilePictureUrl}),s(h,{direction:"column",gap:"size-50",children:[e(re,{level:2,weight:"heavy",children:n.username||n.email}),e(K,{children:n.role.name.toLocaleLowerCase()})]})]})}),e(F,{children:s(ye,{onSubmit:d(m),children:[s(F,{padding:"size-200",children:[e(X,{label:"Email",value:n.email,isReadOnly:!0}),e(G,{name:"username",control:c,rules:{required:"A username is required as it needs to be unique"},render:({field:{name:p,onChange:y,onBlur:b,value:k},fieldState:{invalid:S,error:v}})=>e(X,{label:"Username",isRequired:!0,description:"A unique username",name:p,errorMessage:v==null?void 0:v.message,validationState:S?"invalid":"valid",onChange:y,onBlur:b,defaultValue:k})})]}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderTopColor:"dark",borderTopWidth:"thin",children:e(h,{direction:"row",gap:"size-100",justifyContent:"end",children:e(M,{variant:g?"primary":"default",size:"compact",disabled:!g,onClick:()=>{d(m)()},children:r?"Saving...":"Save"})})})]})})]}):null}const kp=C`
3482
+ `}}}();bs.hash="4a11ca65151d84fe95f636763c91dc68";function cp(){const{viewer:n,refetchViewer:a}=bl(),t=ce(),l=oe(),[i,r]=I.useMutation(bs),o=Y(),{control:c,handleSubmit:d,formState:{isDirty:g},reset:f}=Ae({defaultValues:{username:(n==null?void 0:n.username)||""}}),m=u.useCallback(p=>{i({variables:{input:{newUsername:p.username}},onCompleted:()=>{l({title:"Profile updated",message:"Your profile has been updated"}),f({username:p.username}),a()},onError:y=>{t({title:"Failed update profile",message:y.message})}})},[i,l,f,a,t]);return n?s($,{title:"Profile",variant:"compact",bodyStyle:{padding:0},extra:n.authMethod==="LOCAL"&&e(N,{variant:"default",size:"compact",onClick:()=>{o("/reset-password")},children:"Reset Password"}),children:[e(F,{paddingTop:"size-200",paddingStart:"size-200",paddingEnd:"size-200",children:s(h,{direction:"row",gap:"size-200",alignItems:"center",children:[e(hl,{name:n.username||n.email,profilePictureUrl:n.profilePictureUrl}),s(h,{direction:"column",gap:"size-50",children:[e(se,{level:2,weight:"heavy",children:n.username||n.email}),e(K,{children:n.role.name.toLocaleLowerCase()})]})]})}),e(F,{children:s(fe,{onSubmit:d(m),children:[s(F,{padding:"size-200",children:[e(G,{label:"Email",value:n.email,isReadOnly:!0}),e(Z,{name:"username",control:c,rules:{required:"A username is required as it needs to be unique"},render:({field:{name:p,onChange:y,onBlur:k,value:S},fieldState:{invalid:C,error:b}})=>e(G,{label:"Username",isRequired:!0,description:"A unique username",name:p,errorMessage:b==null?void 0:b.message,validationState:C?"invalid":"valid",onChange:y,onBlur:k,defaultValue:S})})]}),e(F,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderTopColor:"dark",borderTopWidth:"thin",children:e(h,{direction:"row",gap:"size-100",justifyContent:"end",children:e(N,{variant:g?"primary":"default",size:"compact",disabled:!g,onClick:()=>{d(m)()},children:r?"Saving...":"Save"})})})]})})]}):null}const up=v`
3665
3483
  overflow-y: auto;
3666
- `,bp=C`
3484
+ `,mp=v`
3667
3485
  padding: var(--ac-global-dimension-size-400);
3668
3486
  max-width: 800px;
3669
3487
  min-width: 500px;
@@ -3671,11 +3489,11 @@ fragment APIKeysTableFragment on User {
3671
3489
  width: 100%;
3672
3490
  margin-left: auto;
3673
3491
  margin-right: auto;
3674
- `;function ff(){const{viewer:n}=ut();return n?e("main",{css:kp,children:e("div",{css:bp,children:s(h,{direction:"column",gap:"size-200",children:[e(hp,{}),e(fp,{viewer:n})]})})}):null}const Ss=u.createContext(null);function Sp({children:n,...a}){const[l]=u.useState(()=>ud(a));return e(Ss.Provider,{value:l,children:n})}function q(n,a){const l=Ke.useContext(Ss);if(!l)throw new Error("Missing PlaygroundContext.Provider in the tree");return ya(l,n,a)}const vp=4,Cp={user:["user","human"],ai:["assistant","bot","ai"],system:["system"],tool:["tool"]},Fp="Unable to parse span input messages, expected messages which include a role and content.",Kp="Unable to parse span output messages, expected messages which include a role and content.",xp="Unable to parse span output expected output.value to be present.",Dp="Unable to parse span attributes, attributes must be valid JSON.",Tp="Unable to parse model name, expected llm.model_name to be present.",Rl={AZURE_OPENAI:[],ANTHROPIC:["claude"],OPENAI:["gpt","o1"]},Ip={OPENAI:"OPENAI_API_KEY",ANTHROPIC:"ANTHROPIC_API_KEY",AZURE_OPENAI:"AZURE_OPENAI_API_KEY"};function Lp(){const n=q(t=>Array.from(new Set(t.instances.map(i=>i.model.provider)))),a=Ua(t=>t.setCredential),l=Ua(t=>t);return e("div",{css:C`
3492
+ `;function Df(){const{viewer:n}=bl();return n?e("main",{css:up,children:e("div",{css:mp,children:s(h,{direction:"column",gap:"size-200",children:[e(cp,{}),e(dp,{viewer:n})]})})}):null}const Ss=u.createContext(null);function gp({children:n,...a}){const[t]=u.useState(()=>gd(a));return e(Ss.Provider,{value:t,children:n})}function q(n,a){const t=Ke.useContext(Ss);if(!t)throw new Error("Missing PlaygroundContext.Provider in the tree");return ba(t,n,a)}const pp=4,yp={user:["user","human"],ai:["assistant","bot","ai"],system:["system"],tool:["tool"]},fp="Unable to parse span input messages, expected messages which include a role and content.",hp="Unable to parse span output messages, expected messages which include a role and content.",kp="Unable to parse span output expected output.value to be present.",bp="Unable to parse span attributes, attributes must be valid JSON.",Sp="Unable to parse model config, expected llm.model_name to be present.",vp="Unable to parse model config, expected llm.invocation_parameters json string to be present.",Cp="Unable to parse tools, expected tools to be an array of valid OpenAI tools.",qt={AZURE_OPENAI:[],ANTHROPIC:["claude"],OPENAI:["gpt","o1"]},Fp={OPENAI:"OPENAI_API_KEY",ANTHROPIC:"ANTHROPIC_API_KEY",AZURE_OPENAI:"AZURE_OPENAI_API_KEY"};function Kp(){const n=q(l=>Array.from(new Set(l.instances.map(i=>i.model.provider)))),a=Wa(l=>l.setCredential),t=Wa(l=>l);return e("div",{css:v`
3675
3493
  .ac-dropdown-button {
3676
3494
  min-width: 0px;
3677
3495
  }
3678
- `,children:s(tn,{placement:"bottom",children:[e(Ja,{size:"compact",children:"API Keys"}),e(ha,{children:e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-100",children:[e(re,{level:2,weight:"heavy",children:"API Keys"}),e(K,{color:"text-700",children:"API keys are stored in your browser and used to communicate with their respective API's."}),e(ye,{children:n.map(t=>{const i=Ip[t];return e(X,{label:i,type:"password",isRequired:!0,onChange:r=>{a({provider:t,value:r})},value:l[t]},t)})})]})})})]})})}const Pp=O.object({function:O.object({name:O.string(),arguments:O.string()}).partial()}).partial(),vs=O.object({[se.message]:O.object({[ve.role]:O.string(),[ve.content]:O.string(),[ve.tool_calls]:O.array(Pp).optional()})}),wp=O.object({[se.llm]:O.object({[_e.input_messages]:O.array(vs)})}),Ap=O.object({[se.llm]:O.object({[_e.output_messages]:O.array(vs)})}),_p=O.object({[se.output]:O.object({value:O.string()})}),Cs=mt()(O.enum(["user","ai","system","tool"])),Ep=mt()(O.object({id:O.number(),role:Cs,content:O.string()})),Rp=O.array(Ep),Mp=O.object({[se.llm]:O.object({[_e.model_name]:O.string()})});function Fs(n){return Cs.safeParse(n).success}function Np(n){if(Fs(n))return n;for(const[a,l]of Object.entries(Cp))if(l.includes(n))return a;return pd}function Ks(n){return n.map(({message:a})=>({id:Da(),role:Np(a.role),content:a.content}))}function Vp(n){const a=wp.safeParse(n);return a.success?{messageParsingErrors:[],messages:Ks(a.data.llm.input_messages)}:{messageParsingErrors:[Fp],messages:null}}function zp(n){const a=[],l=Ap.safeParse(n);if(l.success)return{output:Ks(l.data.llm.output_messages),outputParsingErrors:a};a.push(Kp);const t=_p.safeParse(n);return t.success?{output:t.data.output.value,outputParsingErrors:a}:(a.push(xp),{output:void 0,outputParsingErrors:a})}function $p(n){for(const a of Object.keys(Rl))if(Rl[a].some(t=>n.includes(t)))return a;return gd}function Op(n){const{success:a,data:l}=Mp.safeParse(n);return a?{modelConfig:{modelName:l.llm.model_name,provider:$p(l.llm.model_name)},parsingErrors:[]}:{modelConfig:null,parsingErrors:[Tp]}}function Qp(n){const a=md(),{json:l,parseError:t}=ll(n.attributes);if(t)return{playgroundInstance:a,parsingErrors:[Dp]};const{messages:i,messageParsingErrors:r}=Vp(l),{output:o,outputParsingErrors:c}=zp(l),{modelConfig:d,parsingErrors:g}=Op(l);return{playgroundInstance:{...a,model:d??a.model,template:i!=null?{__type:"chat",messages:i}:a.template,output:o},parsingErrors:[...r,...c,...g]}}const jp=n=>Rp.safeParse(n).success,qp=({instances:n,templateLanguage:a})=>{const l=new Set,t=yd(a);return n.forEach(i=>{switch(i.template.__type){case"chat":{i.template.messages.forEach(o=>{(o.content==null?[]:t.extractVariables(o.content)).forEach(d=>{l.add(d)})});break}case"text_completion":{t.extractVariables(i.template.prompt).forEach(c=>{l.add(c)});break}default:Ce()}}),Array.from(l)},Up=()=>{const{instances:n,templateLanguage:a}=q(t=>({instances:t.instances,templateLanguage:t.templateLanguage}));return u.useMemo(()=>qp({instances:n,templateLanguage:a}),[n,a])},xs=()=>{const n=Up(),a=q(t=>fd(t.input)?t.input.variablesValueCache:{}),l=u.useMemo(()=>n.reduce((t,i)=>(t[i]=a[i]||"",t),{}),[n,a]);return{variableKeys:n,variablesMap:l}},Bp={lineNumbers:!1,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1,bracketMatching:!1,syntaxHighlighting:!1},Hp=[ft.lineWrapping],Gp=({label:n,value:a,onChange:l})=>{const{theme:t}=zn();return e(la,{label:n,children:e(yn,{width:"100%",children:e(sa,{theme:t==="light"?Ad:oa,basicSetup:Bp,value:a,extensions:Hp,onChange:l})})})};function Wp(){const{variableKeys:n,variablesMap:a}=xs(),l=q(i=>i.setVariableValue),t=q(i=>i.templateLanguage);if(n.length===0){let i="";switch(t){case"F_STRING":{i="{input name}";break}case"MUSTACHE":{i="{{input name}}";break}default:Ce()}return e(F,{padding:"size-100",children:e(h,{direction:"column",justifyContent:"center",alignItems:"center",children:s(K,{color:"text-700",children:["Add variable inputs to your prompt using"," ",e(K,{color:"text-900",children:i})," within your prompt template."]})})})}return e(h,{direction:"column",gap:"size-200",width:"100%",children:n.map((i,r)=>e(Gp,{label:i,value:a[i],onChange:o=>l(i,o)},r))})}function Jp(){const n=q(l=>l.inputMode),a=q(l=>l.setInputMode);return s(Ol,{value:n,variant:"inline-button",size:"compact",onChange:l=>{(l==="manual"||l==="dataset")&&a(l)},children:[e(ga,{label:"manual",value:"manual",children:"Manual"}),e(ga,{label:"Dataset",value:"dataset",children:"Dataset"})]})}const Ds=function(){var n={defaultValue:null,kind:"LocalArgument",name:"apiKey"},a={defaultValue:null,kind:"LocalArgument",name:"invocationParameters"},l={defaultValue:null,kind:"LocalArgument",name:"messages"},t={defaultValue:null,kind:"LocalArgument",name:"model"},i={defaultValue:null,kind:"LocalArgument",name:"templateOptions"},r={defaultValue:null,kind:"LocalArgument",name:"tools"},o={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c=[{alias:null,args:[{fields:[{kind:"Variable",name:"apiKey",variableName:"apiKey"},{kind:"Variable",name:"invocationParameters",variableName:"invocationParameters"},{kind:"Variable",name:"messages",variableName:"messages"},{kind:"Variable",name:"model",variableName:"model"},{kind:"Variable",name:"template",variableName:"templateOptions"},{kind:"Variable",name:"tools",variableName:"tools"}],kind:"ObjectValue",name:"input"}],concreteType:null,kind:"LinkedField",name:"chatCompletion",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"content",storageKey:null}],type:"TextChunk",abstractKey:null},{kind:"InlineFragment",selections:[o,{alias:null,args:null,concreteType:"FunctionCallChunk",kind:"LinkedField",name:"function",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"arguments",storageKey:null}],storageKey:null}],type:"ToolCallChunk",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"span",plural:!1,selections:[o],storageKey:null}],type:"FinishedChatCompletion",abstractKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[n,a,l,t,i,r],kind:"Fragment",metadata:null,name:"PlaygroundOutputSubscription",selections:c,type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[l,t,a,r,i,n],kind:"Operation",name:"PlaygroundOutputSubscription",selections:c},params:{cacheID:"54f42285c230d77abe27c047dc37e700",id:null,metadata:{},name:"PlaygroundOutputSubscription",operationKind:"subscription",text:`subscription PlaygroundOutputSubscription(
3496
+ `,children:s(Cn,{placement:"bottom",children:[e(et,{size:"compact",children:"API Keys"}),e(Sa,{children:e(F,{padding:"size-200",children:s(fe,{onSubmit:()=>{},children:[e(se,{level:2,weight:"heavy",children:"API Keys"}),e(K,{color:"text-700",children:"API keys are stored in your browser and used to communicate with their respective API's."}),e(h,{direction:"column",gap:"size-100",children:n.map(l=>{const i=Fp[l];return e(G,{label:i,type:"password",isRequired:!0,onChange:r=>{a({provider:l,value:r})},value:t[l]},l)})})]})})})]})})}const bt=M.object({type:M.literal("function").describe("The type of the tool"),function:M.object({name:M.string().describe("The name of the function"),description:M.string().optional().describe("A description of the function"),parameters:M.object({type:M.literal("object"),properties:M.record(M.object({type:M.enum(["string","number","boolean","object","array","null","integer"]).describe("The type of the parameter"),description:M.string().optional().describe("A description of the parameter"),enum:M.array(M.string()).optional().describe("The allowed values")}).passthrough()).describe("A map of parameter names to their definitions"),required:M.array(M.string()).optional().describe("The required parameters"),additionalProperties:M.boolean().optional().describe("Whether or not additional properties are allowed in the schema"),strict:M.boolean().optional().describe("Whether or not the arguments should exactly match the function definition, only supported for OpenAI models")}).passthrough().describe("The parameters that the function accepts")}).passthrough().describe("The function definition")}).passthrough(),xp=Bt(bt,{removeAdditionalStrategy:"passthrough"}),vs=M.object({id:M.string().describe("The ID of the tool call"),function:M.object({name:M.string().describe("The name of the function"),arguments:M.union([M.record(M.unknown()).optional(),M.string()]).describe("The arguments for the function")}).describe("The function that is being called").passthrough()}),Cs=M.array(vs),Tp=Bt(Cs,{removeAdditionalStrategy:"passthrough"}),Dp=M.object({tool_call:M.object({id:M.string().optional(),function:M.object({name:M.string(),arguments:M.string()}).partial()}).partial()}).partial(),Fs=M.object({[le.message]:M.object({[Ce.role]:M.string(),[Ce.content]:M.string().optional(),[Ce.tool_calls]:M.array(Dp).optional()})}),Ip=M.object({[le.llm]:M.object({[Te.input_messages]:M.array(Fs)})}),Pp=M.object({[le.llm]:M.object({[Te.output_messages]:M.array(Fs)})}),Lp=M.object({[le.output]:M.object({value:M.string()})}),Ks=mt()(M.enum(["user","ai","system","tool"])),wp=mt()(M.object({id:M.number(),role:Ks,content:M.string().optional(),toolCallId:M.string().optional(),toolCalls:M.array(vs).optional()})),_p=M.array(wp),ka=mt()(M.object({temperature:M.coerce.number().optional(),topP:M.coerce.number().optional(),maxTokens:M.coerce.number().optional(),stop:M.array(M.string()).optional(),seed:M.coerce.number().optional(),maxCompletionTokens:M.coerce.number().optional()})),Ep=M.string().transform(n=>{const{json:a}=Tn(n);return Sl(a)?ka.passthrough().transform(t=>({...t,...Object.fromEntries(Object.entries(t).map(([l,i])=>[l.replace(/_([a-z])/g,(r,o)=>o.toUpperCase()),i]))})).parse(a):null}).transform((n,a)=>{const t=ka.safeParse(n);return t.success?t.data:(t.error.issues.forEach(l=>{a.addIssue(l)}),M.NEVER)}).default("{}"),Ap=M.object({[le.llm]:M.object({[Te.model_name]:M.string()})}),Rp=M.object({[le.llm]:M.object({[Te.invocation_parameters]:Ep})}),Mp=M.string().transform((n,a)=>{const{json:t}=Tn(n);return t==null||!Sl(t)?(a.addIssue({code:M.ZodIssueCode.custom,message:"The tool JSON schema must be a valid JSON object"}),M.NEVER):t}).transform((n,a)=>{const{data:t,success:l}=bt.safeParse(n);return l?t:(a.addIssue({code:M.ZodIssueCode.custom,message:"The tool JSON schema must be a valid OpenAI tool schema"}),M.NEVER)}),Np=M.object({[le.llm]:M.object({[Te.tools]:M.array(M.object({[le.tool]:M.object({[pa.json_schema]:Mp})}).optional()).optional()}).optional()}).optional(),qa=ka.omit({maxCompletionTokens:!0}),ga=ka.pick({maxCompletionTokens:!0}),Ua={OPENAI:{default:qa,"o1-preview":ga,"o1-preview-2024-09-12":ga,"o1-mini":ga,"o1-mini-2024-09-12":ga},AZURE_OPENAI:{default:qa},ANTHROPIC:{default:qa}};function xs(n){return Ks.safeParse(n).success}function zp(n){if(xs(n))return n;for(const[a,t]of Object.entries(yp))if(t.includes(n))return a;return fd}function Vp(n){if(n!=null)return n.map(({tool_call:a})=>{var t,l;return a==null?null:{id:a.id??"",function:{name:((t=a.function)==null?void 0:t.name)??"",arguments:((l=a.function)==null?void 0:l.arguments)??{}}}}).filter(a=>a!=null)}function Ts(n){return n.map(({message:a})=>({id:Pa(),role:zp(a.role),content:a.content,toolCalls:Vp(a.tool_calls)}))}function $p(n){const a=Ip.safeParse(n);return a.success?{messageParsingErrors:[],messages:Ts(a.data.llm.input_messages)}:{messageParsingErrors:[fp],messages:null}}function Op(n){const a=[],t=Pp.safeParse(n);if(t.success)return{output:Ts(t.data.llm.output_messages),outputParsingErrors:a};a.push(hp);const l=Lp.safeParse(n);return l.success?{output:l.data.output.value,outputParsingErrors:a}:(a.push(kp),{output:void 0,outputParsingErrors:a})}function Qp(n){for(const a of Object.keys(qt))if(qt[a].some(l=>n.includes(l)))return a;return vl}function jp(n){const{success:a,data:t}=Ap.safeParse(n);if(a){const{success:l,data:i}=Rp.safeParse(n),r=[];return l||r.push(vp),{modelConfig:{modelName:t.llm.model_name,provider:Qp(t.llm.model_name),invocationParameters:l?i.llm.invocation_parameters:{}},parsingErrors:r}}return{modelConfig:null,parsingErrors:[Sp]}}function qp(n){var a;return(((a=n==null?void 0:n.llm)==null?void 0:a.tools)??[]).map(t=>(t==null?void 0:t.tool)==null?null:{id:yd(),definition:t.tool.json_schema}).filter(t=>t!=null)}function Up(n){var l;const{data:a,success:t}=Np.safeParse(n);return t?((l=a==null?void 0:a.llm)==null?void 0:l.tools)==null?{tools:null,parsingErrors:[]}:{tools:qp(a),parsingErrors:[]}:{tools:null,parsingErrors:[Cp]}}function Bp(n){const a=pd(),{json:t,parseError:l}=Tn(n.attributes);if(l)return{playgroundInstance:{...a,spanId:(n==null?void 0:n.id)??null},parsingErrors:[bp]};const{messages:i,messageParsingErrors:r}=$p(t),{output:o,outputParsingErrors:c}=Op(t),{modelConfig:d,parsingErrors:g}=jp(t),{tools:f,parsingErrors:m}=Up(t);return{playgroundInstance:{...a,model:d??a.model,template:i!=null?{__type:"chat",messages:i}:a.template,output:o,spanId:n.id,tools:f??a.tools},parsingErrors:[...r,...c,...g,...m]}}const Hp=n=>_p.safeParse(n).success,Gp=({instances:n,templateLanguage:a})=>{const t=new Set,l=hd(a);return n.forEach(i=>{switch(i.template.__type){case"chat":{i.template.messages.forEach(o=>{(o.content==null?[]:l.extractVariables(o.content)).forEach(d=>{t.add(d)})});break}case"text_completion":{l.extractVariables(i.template.prompt).forEach(c=>{t.add(c)});break}default:ye()}}),Array.from(t)},Ds=({modelProvider:n,modelName:a})=>{if(!(n in Ua))return Ua[vl].default;const l=Ua[n];return a in l?l[a]:l.default},Wp=()=>{const{instances:n,templateLanguage:a}=q(l=>({instances:l.instances,templateLanguage:l.templateLanguage}));return u.useMemo(()=>Gp({instances:n,templateLanguage:a}),[n,a])},Is=()=>{const n=Wp(),a=q(l=>kd(l.input)?l.input.variablesValueCache:{}),t=u.useMemo(()=>n.reduce((l,i)=>(l[i]=a[i]||"",l),{}),[n,a]);return{variableKeys:n,variablesMap:t}},Jp={lineNumbers:!1,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1,bracketMatching:!1,syntaxHighlighting:!1},Zp=[xl.lineWrapping],Xp=({label:n,value:a,onChange:t})=>{const{theme:l}=Qn();return e(On,{label:n,children:e(Je,{width:"100%",children:e(oa,{theme:l==="light"?Nd:da,basicSetup:Jp,value:a,extensions:Zp,onChange:t})})})};function Yp(){const{variableKeys:n,variablesMap:a}=Is(),t=q(i=>i.setVariableValue),l=q(i=>i.templateLanguage);if(n.length===0){let i="";switch(l){case"F_STRING":{i="{input name}";break}case"MUSTACHE":{i="{{input name}}";break}default:ye()}return e(F,{padding:"size-100",children:e(h,{direction:"column",justifyContent:"center",alignItems:"center",children:s(K,{color:"text-700",children:["Add variable inputs to your prompt using"," ",e(K,{color:"text-900",children:i})," within your prompt template."]})})})}return e(h,{direction:"column",gap:"size-200",width:"100%",children:n.map((i,r)=>e(Xp,{label:i,value:a[i],onChange:o=>t(i,o)},r))})}function ey(){const n=q(t=>t.inputMode),a=q(t=>t.setInputMode);return s(tt,{value:n,variant:"inline-button",size:"compact",onChange:t=>{(t==="manual"||t==="dataset")&&a(t)},children:[e(Rn,{label:"manual",value:"manual",children:"Manual"}),e(Rn,{label:"Dataset",value:"dataset",children:"Dataset"})]})}const Ps=function(){var n={defaultValue:null,kind:"LocalArgument",name:"apiKey"},a={defaultValue:null,kind:"LocalArgument",name:"invocationParameters"},t={defaultValue:null,kind:"LocalArgument",name:"messages"},l={defaultValue:null,kind:"LocalArgument",name:"model"},i={defaultValue:null,kind:"LocalArgument",name:"templateOptions"},r={defaultValue:null,kind:"LocalArgument",name:"tools"},o={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c=[{alias:null,args:[{fields:[{kind:"Variable",name:"apiKey",variableName:"apiKey"},{kind:"Variable",name:"invocationParameters",variableName:"invocationParameters"},{kind:"Variable",name:"messages",variableName:"messages"},{kind:"Variable",name:"model",variableName:"model"},{kind:"Variable",name:"template",variableName:"templateOptions"},{kind:"Variable",name:"tools",variableName:"tools"}],kind:"ObjectValue",name:"input"}],concreteType:null,kind:"LinkedField",name:"chatCompletion",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"content",storageKey:null}],type:"TextChunk",abstractKey:null},{kind:"InlineFragment",selections:[o,{alias:null,args:null,concreteType:"FunctionCallChunk",kind:"LinkedField",name:"function",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"arguments",storageKey:null}],storageKey:null}],type:"ToolCallChunk",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"span",plural:!1,selections:[o],storageKey:null}],type:"FinishedChatCompletion",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"message",storageKey:null}],type:"ChatCompletionSubscriptionError",abstractKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t,l,i,r],kind:"Fragment",metadata:null,name:"PlaygroundOutputSubscription",selections:c,type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[t,l,a,r,i,n],kind:"Operation",name:"PlaygroundOutputSubscription",selections:c},params:{cacheID:"96dec42dd14805e9b1adc1c112321064",id:null,metadata:{},name:"PlaygroundOutputSubscription",operationKind:"subscription",text:`subscription PlaygroundOutputSubscription(
3679
3497
  $messages: [ChatCompletionMessageInput!]!
3680
3498
  $model: GenerativeModelInput!
3681
3499
  $invocationParameters: InvocationParameters!
@@ -3700,9 +3518,12 @@ fragment APIKeysTableFragment on User {
3700
3518
  id
3701
3519
  }
3702
3520
  }
3521
+ ... on ChatCompletionSubscriptionError {
3522
+ message
3523
+ }
3703
3524
  }
3704
3525
  }
3705
- `}}}();Ds.hash="2ee0074ffec630990e0c4bc90b17a86a";const Ts=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[l],storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null}],type:"Span",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"RunMetadataFooterQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"RunMetadataFooterQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,t],storageKey:null}]},params:{cacheID:"bee4b51bd781a58c87fd283a966776f6",id:null,metadata:{},name:"RunMetadataFooterQuery",operationKind:"query",text:`query RunMetadataFooterQuery(
3526
+ `}}}();Ps.hash="c29d5c7acf3f5090b92480ce34101fa6";const Ls=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[t],storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null}],type:"Span",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"RunMetadataFooterQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,l],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"RunMetadataFooterQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t,l],storageKey:null}]},params:{cacheID:"bee4b51bd781a58c87fd283a966776f6",id:null,metadata:{},name:"RunMetadataFooterQuery",operationKind:"query",text:`query RunMetadataFooterQuery(
3706
3527
  $spanId: GlobalID!
3707
3528
  ) {
3708
3529
  span: node(id: $spanId) {
@@ -3723,10 +3544,10 @@ fragment APIKeysTableFragment on User {
3723
3544
  }
3724
3545
  }
3725
3546
  }
3726
- `}}}();Ts.hash="c89cb87e785645bbf42e3eadbacc4fc0";function Zp({traceId:n,projectId:a,title:l}){const t=Y();return e(H,{title:l,size:"fullscreen",extra:e(M,{variant:"default",onClick:()=>t(`/projects/${a}/traces/${n}`),children:"View Trace in Project"}),children:e(dl,{traceId:n,projectId:a})})}function Xp({spanId:n}){const[a,l]=u.useState(null),t=D.useLazyLoadQuery(Ts,{spanId:n});if(!t.span||!t.span.project||!t.span.context)return null;const{project:i,context:{traceId:r}}=t.span;return s(F,{borderTopColor:"light",borderTopWidth:"thin",paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",children:[s(h,{direction:"row",gap:"size-200",justifyContent:"space-between",children:[s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Fa,{tokenCountTotal:t.span.tokenCountTotal||0,tokenCountPrompt:t.span.tokenCountPrompt||0,tokenCountCompletion:t.span.tokenCountCompletion||0}),e(we,{latencyMs:t.span.latencyMs||0})]}),e(M,{size:"compact",variant:"default",icon:e(P,{svg:e(I.Trace,{})}),onClick:()=>{u.startTransition(()=>{l(e(u.Suspense,{children:e(Zp,{traceId:r,projectId:i.id,title:"Playground Trace"})}))})},children:"View Trace"})]}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>l(null),children:a})]})}function Yp({index:n,title:a}){return s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(gt,{index:n}),e("span",{children:a})]})}function Ha({message:n}){const{role:a,content:l,toolCalls:t}=n,i=ol(a);return s(V,{title:a,...i,variant:"compact",children:[l!=null&&e(h,{direction:"column",alignItems:"start",children:l}),t&&t.length>0?t.map(r=>s("pre",{css:C`
3547
+ `}}}();Ls.hash="c89cb87e785645bbf42e3eadbacc4fc0";function ny({traceId:n,projectId:a,title:t}){const l=Y();return e(B,{title:t,size:"fullscreen",extra:e(N,{variant:"default",onClick:()=>l(`/projects/${a}/traces/${n}`),children:"View Trace in Project"}),children:e(ft,{traceId:n,projectId:a})})}function ay({spanId:n}){const[a,t]=u.useState(null),l=I.useLazyLoadQuery(Ls,{spanId:n});if(!l.span||!l.span.project||!l.span.context)return null;const{project:i,context:{traceId:r}}=l.span;return s(F,{borderTopColor:"light",borderTopWidth:"thin",paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",children:[s(h,{direction:"row",gap:"size-200",justifyContent:"space-between",children:[s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Ta,{tokenCountTotal:l.span.tokenCountTotal||0,tokenCountPrompt:l.span.tokenCountPrompt||0,tokenCountCompletion:l.span.tokenCountCompletion||0}),e(Ee,{latencyMs:l.span.latencyMs||0})]}),s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(N,{size:"compact",variant:"default",icon:e(w,{svg:e(L.EditOutline,{})}),onClick:()=>t(e(il,{spanNodeId:n,projectId:i.id})),children:"Annotate"}),e(N,{size:"compact",variant:"default",icon:e(w,{svg:e(L.Trace,{})}),onClick:()=>{u.startTransition(()=>{t(e(u.Suspense,{children:e(ny,{traceId:r,projectId:i.id,title:"Playground Trace"})}))})},children:"View Trace"})]})]}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>t(null),children:a})]})}function ty({index:n,title:a}){return s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Cl,{index:n}),e("span",{children:a})]})}function Za({message:n}){const{role:a,content:t,toolCalls:l}=n,i=yt(a),{mode:r}=bd();return s($,{title:a,...i,variant:"compact",extra:e(Ne,{}),children:[t!=null&&e(h,{direction:"column",alignItems:"start",children:r==="text"?t:e(F,{overflow:"auto",maxWidth:"100%",children:e(Bn,{children:t})})}),l&&l.length>0?l.map(o=>s("pre",{css:v`
3727
3548
  text-wrap: wrap;
3728
3549
  margin: var(--ac-global-dimension-static-size-100) 0;
3729
- `,children:[r.function.name,"(",JSON.stringify(JSON.parse(r.function.arguments),null,2),")"]},r.id)):null]})}function ey(n){const a=n.playgroundInstanceId,l=q(c=>c.instances.find(d=>d.id===a)),t=q(c=>c.instances.findIndex(d=>d.id===a));if(!l)throw new Error(`Playground instance ${a} not found`);const i=l.activeRunId,r=i!==null,o=u.useMemo(()=>r?e(ty,{playgroundInstanceId:a},i):jp(l.output)?l.output.map((d,g)=>e(Ha,{message:d},g)):typeof l.output=="string"?e(Ha,{message:{id:Da(),content:l.output,role:"ai"}}):"click run to see output",[r,l.output,a,i]);return s(V,{title:e(Yp,{index:t,title:"Output"}),collapsible:!0,variant:"compact",bodyStyle:{padding:0},children:[e(F,{padding:"size-200",children:o}),e(u.Suspense,{children:l.spanId?e(Xp,{spanId:l.spanId}):null})]})}function ny({params:n,runId:a,onNext:l,onCompleted:t,onFailed:i}){const r=u.useMemo(()=>({subscription:Ds,variables:n,onNext:o=>{o&&l(o)},onCompleted:()=>{t()},onError:o=>{i(o)}}),[a]);return D.useSubscription(r)}function ay(n){return{content:n.content,role:ly(n.role)}}function ly(n){switch(n){case"system":return"SYSTEM";case"user":return"USER";case"tool":return"TOOL";case"ai":return"AI";default:Ce()}}function ty(n){const a=q(k=>k.instances),l=Ua(k=>k),t=a.find(k=>k.id===n.playgroundInstanceId),i=q(k=>k.updateInstance),r=q(k=>k.templateLanguage),{variablesMap:o}=xs(),c=q(k=>k.markPlaygroundInstanceComplete),d=ce();if(!t)throw new Error("No instance found");if(typeof t.activeRunId!="number")throw new Error("No message found");if(t.template.__type!=="chat")throw new Error("We only support chat templates for now");const[g,f]=u.useState(void 0),[m,p]=u.useState([]),y=t.model.provider==="AZURE_OPENAI"?{endpoint:t.model.endpoint,apiVersion:t.model.apiVersion}:{},b={};return t.tools.length&&(b.toolChoice=t.toolChoice),ny({params:{messages:t.template.messages.map(ay),model:{providerKey:t.model.provider,name:t.model.modelName||"",...y},invocationParameters:b,templateOptions:{variables:o,language:r},tools:t.tools.length?t.tools.map(k=>k.definition):void 0,apiKey:l[t.model.provider]},runId:t.activeRunId,onNext:k=>{const S=k.chatCompletion;S.__typename==="TextChunk"?f(v=>(v||"")+S.content):S.__typename==="ToolCallChunk"?p(v=>{let w=!1;const L=v.map(A=>A.id===S.id?(w=!0,{...A,function:{...A.function,arguments:A.function.arguments+S.function.arguments}}):A);return w||L.push({id:S.id,function:{name:S.function.name,arguments:S.function.arguments}}),L}):S.__typename==="FinishedChatCompletion"&&i({instanceId:n.playgroundInstanceId,patch:{spanId:S.span.id}})},onCompleted:()=>{c(n.playgroundInstanceId)},onFailed:()=>{c(n.playgroundInstanceId),i({instanceId:n.playgroundInstanceId,patch:{activeRunId:null}}),d({title:"Failed to get output",message:"Please try again."})}}),!g&&(m.length===0||t.isRunning)?s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(P,{svg:e(I.LoadingOutline,{})}),"Running..."]}):e(Ha,{message:{id:Da(),content:g,role:"ai",toolCalls:m}})}function iy(){const n=q(l=>l.runPlaygroundInstances),a=q(l=>l.instances.some(t=>t.isRunning));return e(M,{variant:"primary",disabled:a,icon:e(P,{svg:e(I.PlayCircleOutline,{})}),loading:a,size:"compact",onClick:()=>{n()},children:a?"Running...":"Run"})}function ry(){const n=q(l=>l.streaming),a=q(l=>l.setStreaming);return e(Mn,{labelPlacement:"start",isSelected:n,onChange:()=>{a(!n)},children:"Stream"})}const Is=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"providerKey"}],a=[{kind:"Variable",name:"providerKey",variableName:"providerKey"}],l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ModelConfigButtonDialogQuery",selections:[{args:null,kind:"FragmentSpread",name:"ModelProviderPickerFragment"},{args:a,kind:"FragmentSpread",name:"ModelPickerFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ModelConfigButtonDialogQuery",selections:[{alias:null,args:null,concreteType:"GenerativeProvider",kind:"LinkedField",name:"modelProviders",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},l],storageKey:null},{alias:null,args:[{fields:a,kind:"ObjectValue",name:"input"}],concreteType:"GenerativeModel",kind:"LinkedField",name:"models",plural:!0,selections:[l],storageKey:null}]},params:{cacheID:"8e6ad232aae761280ca29a0571fe7c23",id:null,metadata:{},name:"ModelConfigButtonDialogQuery",operationKind:"query",text:`query ModelConfigButtonDialogQuery(
3550
+ `,children:[o.function.name,"(",JSON.stringify(typeof o.function.arguments=="string"?JSON.parse(o.function.arguments):o.function.arguments,null,2),")"]},o.id)):null]})}function ly(n){const a=n.playgroundInstanceId,t=q(c=>c.instances.find(d=>d.id===a)),l=q(c=>c.instances.findIndex(d=>d.id===a));if(!t)throw new Error(`Playground instance ${a} not found`);const i=t.activeRunId,r=i!==null,o=u.useMemo(()=>r?e(oy,{playgroundInstanceId:a},i):Hp(t.output)?t.output.map((d,g)=>e(Za,{message:d},g)):typeof t.output=="string"?e(Za,{message:{id:Pa(),content:t.output,role:"ai"}}):"click run to see output",[r,t.output,a,i]);return s($,{title:e(ty,{index:l,title:"Output"}),collapsible:!0,variant:"compact",bodyStyle:{padding:0},children:[e(F,{padding:"size-200",children:e(Le,{children:o})}),e(u.Suspense,{children:t.spanId?e(ay,{spanId:t.spanId}):null})]})}function iy({params:n,runId:a,onNext:t,onCompleted:l,onFailed:i}){const r=u.useMemo(()=>({subscription:Ps,variables:n,onNext:o=>{o&&t(o)},onCompleted:()=>{l()},onError:o=>{i(o)}}),[a]);return I.useSubscription(r)}function ry(n){return{content:n.content,role:sy(n.role),toolCalls:n.toolCalls,toolCallId:n.toolCallId}}function sy(n){switch(n){case"system":return"SYSTEM";case"user":return"USER";case"tool":return"TOOL";case"ai":return"AI";default:ye()}}function oy(n){const a=q(b=>b.instances),t=Wa(b=>b),l=a.find(b=>b.id===n.playgroundInstanceId),i=q(b=>b.updateInstance),r=q(b=>b.templateLanguage),{variablesMap:o}=Is(),c=q(b=>b.markPlaygroundInstanceComplete),d=ce();if(!l)throw new Error("No instance found");if(typeof l.activeRunId!="number")throw new Error("No message found");if(l.template.__type!=="chat")throw new Error("We only support chat templates for now");const[g,f]=u.useState(void 0),[m,p]=u.useState([]),y=l.model.provider==="AZURE_OPENAI"?{endpoint:l.model.endpoint,apiVersion:l.model.apiVersion}:{},k=Ds({modelProvider:l.model.provider,modelName:l.model.modelName||"default"});let S={...l.model.invocationParameters};return k.safeParse(S).success||(S=l.model.invocationParameters),l.tools.length&&(S.toolChoice=l.toolChoice),iy({params:{messages:l.template.messages.map(ry),model:{providerKey:l.model.provider,name:l.model.modelName||"",...y},invocationParameters:S,templateOptions:{variables:o,language:r},tools:l.tools.length?l.tools.map(b=>b.definition):void 0,apiKey:t[l.model.provider]},runId:l.activeRunId,onNext:b=>{const T=b.chatCompletion;T.__typename==="TextChunk"?f(P=>(P||"")+T.content):T.__typename==="ToolCallChunk"?p(P=>{let _=!1;const x=P.map(D=>D.id===T.id?(_=!0,{...D,function:{...D.function,arguments:D.function.arguments+T.function.arguments}}):D);return _||x.push({id:T.id,function:{name:T.function.name,arguments:T.function.arguments}}),x}):T.__typename==="FinishedChatCompletion"?i({instanceId:n.playgroundInstanceId,patch:{spanId:T.span.id}}):T.__typename==="ChatCompletionSubscriptionError"&&(c(n.playgroundInstanceId),i({instanceId:n.playgroundInstanceId,patch:{isRunning:!1}}),d({title:"Chat completion failed",message:T.message}))},onCompleted:()=>{c(n.playgroundInstanceId)},onFailed:b=>{console.error(b),c(n.playgroundInstanceId),i({instanceId:n.playgroundInstanceId,patch:{activeRunId:null}}),d({title:"Failed to get output",message:"Please try again."})}}),l.isRunning?s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(w,{svg:e(L.LoadingOutline,{})}),"Running..."]}):g||m.length?e(Za,{message:{id:Pa(),content:g,role:"ai",toolCalls:m}}):""}function dy(){const n=q(t=>t.runPlaygroundInstances),a=q(t=>t.instances.some(l=>l.isRunning));return e(N,{variant:"primary",disabled:a,icon:e(w,{svg:e(L.PlayCircleOutline,{})}),loading:a,size:"compact",onClick:()=>{n()},children:a?"Running...":"Run"})}function cy(){const n=q(t=>t.streaming),a=q(t=>t.setStreaming);return e(zn,{labelPlacement:"start",isSelected:n,onChange:()=>{a(!n)},children:"Stream"})}const ws=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"providerKey"}],a=[{kind:"Variable",name:"providerKey",variableName:"providerKey"}],t={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ModelConfigButtonDialogQuery",selections:[{args:null,kind:"FragmentSpread",name:"ModelProviderPickerFragment"},{args:a,kind:"FragmentSpread",name:"ModelPickerFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ModelConfigButtonDialogQuery",selections:[{alias:null,args:null,concreteType:"GenerativeProvider",kind:"LinkedField",name:"modelProviders",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},t],storageKey:null},{alias:null,args:[{fields:a,kind:"ObjectValue",name:"input"}],concreteType:"GenerativeModel",kind:"LinkedField",name:"models",plural:!0,selections:[t],storageKey:null}]},params:{cacheID:"8e6ad232aae761280ca29a0571fe7c23",id:null,metadata:{},name:"ModelConfigButtonDialogQuery",operationKind:"query",text:`query ModelConfigButtonDialogQuery(
3730
3551
  $providerKey: GenerativeProviderKey!
3731
3552
  ) {
3732
3553
  ...ModelProviderPickerFragment
@@ -3745,16 +3566,30 @@ fragment ModelProviderPickerFragment on Query {
3745
3566
  name
3746
3567
  }
3747
3568
  }
3748
- `}}}();Is.hash="c9b38e766093b2378047d22b01ef0fbf";const Ls={argumentDefinitions:[{defaultValue:"OPENAI",kind:"LocalArgument",name:"providerKey"}],kind:"Fragment",metadata:null,name:"ModelPickerFragment",selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"providerKey",variableName:"providerKey"}],kind:"ObjectValue",name:"input"}],concreteType:"GenerativeModel",kind:"LinkedField",name:"models",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};Ls.hash="1e660ad77ce19db1c1bbe8698a661b4f";function sy({query:n,onChange:a,...l}){const t=D.useFragment(Ls,n);return e(Nn,{label:"Model","data-testid":"model-picker",selectedKey:l.modelName??void 0,"aria-label":"model picker",placeholder:"Select a model",onSelectionChange:i=>{typeof i=="string"&&a(i)},width:"100%",...l,children:t.models.map(({name:i})=>e(B,{children:i},i))})}const Ps={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ModelProviderPickerFragment",selections:[{alias:null,args:null,concreteType:"GenerativeProvider",kind:"LinkedField",name:"modelProviders",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};Ps.hash="c83e86a2772127916f7387dca27b74ce";function oy(n){return n==="OPENAI"||n==="AZURE_OPENAI"||n==="ANTHROPIC"}function dy({onChange:n,query:a,...l}){const t=D.useFragment(Ps,a);return e(Nn,{label:"Provider","data-testid":"model-provider-picker",selectedKey:l.provider??void 0,"aria-label":"Model Provider",placeholder:"Select a provider",onSelectionChange:i=>{const r=i;oy(r)&&n(r)},width:"100%",...l,children:t.modelProviders.map(i=>e(B,{children:i.name},i.key))})}function cy({instance:n}){const a=q(t=>t.updateModel),l=u.useCallback(({configKey:t,value:i})=>{a({instanceId:n.id,model:{...n.model,[t]:i}})},[n.id,n.model,a]);return s(U,{children:[e(X,{label:"Deployment Name",value:n.model.modelName??"",onChange:t=>{l({configKey:"modelName",value:t})}}),e(X,{label:"Endpoint",value:n.model.endpoint??"",onChange:t=>{l({configKey:"endpoint",value:t})}}),e(Nn,{label:"API Version",selectedKey:n.model.apiVersion??void 0,"aria-label":"api version picker",placeholder:"Select an AzureOpenAi API Version",onSelectionChange:t=>{typeof t=="string"&&l({configKey:"apiVersion",value:t})},children:kd.map(t=>e(B,{children:t},t))})]})}function uy(n){const[a,l]=u.useState(null),t=q(i=>i.instances.find(r=>r.id===n.playgroundInstanceId));if(!t)throw new Error(`Playground instance ${n.playgroundInstanceId} not found`);return s(u.Fragment,{children:[e(M,{variant:"default",size:"compact",onClick:()=>{u.startTransition(()=>{l(e(H,{title:"Model Configuration",size:"M",children:e(u.Suspense,{children:e(my,{...n})})}))})},children:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(K,{weight:"heavy",children:hd[t.model.provider]}),e(K,{children:t.model.modelName||"--"})]})}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>{l(null)},children:a})]})}function my(n){const{playgroundInstanceId:a}=n,l=q(o=>o.updateModel),t=q(o=>o.instances.find(c=>c.id===a));if(!t)throw new Error(`Playground instance ${n.playgroundInstanceId} not found`);const i=D.useLazyLoadQuery(Is,{providerKey:t.model.provider}),r=u.useCallback(o=>{l({instanceId:a,model:{provider:t.model.provider,modelName:o}})},[t.model.provider,a,l]);return e(F,{padding:"size-200",children:s(ye,{children:[e(dy,{provider:t.model.provider,query:i,onChange:o=>{l({instanceId:a,model:{provider:o,modelName:null}})}}),t.model.provider==="AZURE_OPENAI"?e(cy,{instance:t}):e(sy,{modelName:t.model.modelName,provider:t.model.provider,query:i,onChange:r})]})})}const gy=C`
3569
+ `}}}();ws.hash="c9b38e766093b2378047d22b01ef0fbf";const uy=({field:n,value:a,onChange:t})=>{switch(n){case"temperature":return typeof a!="number"&&a!==void 0?null:e(vt,{label:"Temperature",value:a,step:.1,minValue:0,maxValue:2,onChange:l=>t(l)});case"topP":return typeof a!="number"&&a!==void 0?null:e(vt,{label:"Top P",value:a,step:.1,minValue:0,maxValue:1,onChange:l=>t(l)});case"maxCompletionTokens":return e(G,{label:"Max Completion Tokens",value:(a==null?void 0:a.toString())||"",type:"number",onChange:l=>t(Number(l))});case"maxTokens":return e(G,{label:"Max Tokens",value:(a==null?void 0:a.toString())||"",type:"number",onChange:l=>t(Number(l))});case"stop":return!Array.isArray(a)&&a!==void 0?null:e(G,{label:"Stop",defaultValue:(a==null?void 0:a.join(", "))||"",onChange:l=>t(l.split(/, */g))});case"seed":return e(G,{label:"Seed",value:(a==null?void 0:a.toString())||"",type:"number",onChange:l=>t(Number(l))});default:return null}},my=({model:n,onChange:a})=>{const{invocationParameters:t,provider:l,modelName:i}=n,r=Ds({modelProvider:l,modelName:i||"default"}),o=Object.keys(r.shape).map(c=>{const d=c,g=t[d];return e(uy,{field:d,value:g===null?void 0:g,onChange:f=>a(d,f)},d)});return e(h,{direction:"column",gap:"size-200",children:o})},_s={argumentDefinitions:[{defaultValue:"OPENAI",kind:"LocalArgument",name:"providerKey"}],kind:"Fragment",metadata:null,name:"ModelPickerFragment",selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"providerKey",variableName:"providerKey"}],kind:"ObjectValue",name:"input"}],concreteType:"GenerativeModel",kind:"LinkedField",name:"models",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};_s.hash="1e660ad77ce19db1c1bbe8698a661b4f";function gy({query:n,onChange:a,...t}){const l=I.useFragment(_s,n);return e(Vn,{label:"Model","data-testid":"model-picker",selectedKey:t.modelName??void 0,"aria-label":"model picker",placeholder:"Select a model",onSelectionChange:i=>{typeof i=="string"&&a(i)},width:"100%",...t,children:l.models.map(({name:i})=>e(U,{children:i},i))})}const Es={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ModelProviderPickerFragment",selections:[{alias:null,args:null,concreteType:"GenerativeProvider",kind:"LinkedField",name:"modelProviders",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};Es.hash="c83e86a2772127916f7387dca27b74ce";function py(n){return n==="OPENAI"||n==="AZURE_OPENAI"||n==="ANTHROPIC"}function yy({onChange:n,query:a,...t}){const l=I.useFragment(Es,a);return e(Vn,{label:"Provider","data-testid":"model-provider-picker",selectedKey:t.provider??void 0,"aria-label":"Model Provider",placeholder:"Select a provider",onSelectionChange:i=>{const r=i;py(r)&&n(r)},width:"100%",...t,children:l.modelProviders.map(i=>e(U,{children:i.name},i.key))})}function fy({instance:n}){const a=q(l=>l.updateModel),t=u.useCallback(({configKey:l,value:i})=>{a({instanceId:n.id,model:{...n.model,[l]:i}})},[n.id,n.model,a]);return s(H,{children:[e(G,{label:"Deployment Name",value:n.model.modelName??"",onChange:l=>{t({configKey:"modelName",value:l})}}),e(G,{label:"Endpoint",value:n.model.endpoint??"",onChange:l=>{t({configKey:"endpoint",value:l})}}),e(Vn,{label:"API Version",selectedKey:n.model.apiVersion??void 0,"aria-label":"api version picker",placeholder:"Select an AzureOpenAi API Version",onSelectionChange:l=>{typeof l=="string"&&t({configKey:"apiVersion",value:l})},children:vd.map(l=>e(U,{children:l},l))})]})}function hy(n){const[a,t]=u.useState(null),l=q(i=>i.instances.find(r=>r.id===n.playgroundInstanceId));if(!l)throw new Error(`Playground instance ${n.playgroundInstanceId} not found`);return s(u.Fragment,{children:[e(N,{variant:"default",size:"compact",onClick:()=>{u.startTransition(()=>{t(e(B,{title:"Model Configuration",size:"M",children:e(u.Suspense,{children:e(ky,{...n})})}))})},children:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(K,{weight:"heavy",children:Sd[l.model.provider]}),e(K,{children:l.model.modelName||"--"})]})}),e(W,{type:"slideOver",isDismissable:!0,onDismiss:()=>{t(null)},children:a})]})}function ky(n){const{playgroundInstanceId:a}=n,t=q(c=>c.updateModel),l=q(c=>c.instances.find(d=>d.id===a));if(!l)throw new Error(`Playground instance ${n.playgroundInstanceId} not found`);const i=I.useLazyLoadQuery(ws,{providerKey:l.model.provider}),r=u.useCallback(c=>{t({instanceId:a,model:{provider:l.model.provider,modelName:c}})},[l.model.provider,a,t]),o=u.useCallback((c,d)=>{t({instanceId:a,model:{...l.model,invocationParameters:{...l.model.invocationParameters,[c]:d}}})},[l.model,a,t]);return e(F,{padding:"size-200",overflow:"auto",children:s(fe,{children:[e(yy,{provider:l.model.provider,query:i,onChange:c=>{t({instanceId:a,model:{provider:c,modelName:null}})}}),l.model.provider==="AZURE_OPENAI"?e(fy,{instance:l}):e(gy,{modelName:l.model.modelName,provider:l.model.provider,query:i,onChange:r}),e(my,{model:l.model,onChange:o})]})})}function by({playgroundInstanceId:n,toolCalls:a,templateMessages:t,messageId:l}){const i=q(d=>d.updateInstance),[r,o]=u.useState(()=>JSON.stringify(a,null,2)),c=u.useCallback(d=>{o(d);const{json:g}=Tn(d);if(g==null)return;const{success:f}=Cs.safeParse(g);f&&i({instanceId:n,patch:{template:{__type:"chat",messages:t.map(m=>l===m.id?{...m,toolCalls:g}:m)}}})},[l,n,t,i]);return e(De,{value:r,jsonSchema:Tp,onChange:c})}function Sy(n){return n==="text"||n==="toolCalls"}function vy({messageMode:n,onChange:a}){return s(tt,{defaultValue:n,variant:"inline-button",size:"compact",onChange:t=>{if(Sy(t))a(t);else throw new Error(`Unknown message mode: ${t}`)},children:[e(Rn,{label:"text input",value:"text",children:e(w,{svg:e(L.MessageSquareOutline,{})})}),e(Rn,{label:"tool calling",value:"toolCalls",children:e(w,{svg:e(L.Code,{})})})]})}const Cy=v`
3749
3570
  .ac-field-label {
3750
3571
  display: none;
3751
3572
  }
3752
- `;function py({role:n,includeLabel:a=!0,onChange:l}){return s(Nn,{selectedKey:n,css:a?void 0:gy,label:"Role","data-testid":"messages-role-picker","aria-label":"Role for the chat message",size:"compact",onSelectionChange:t=>{if(!Fs(t))throw new Error(`Invalid chat message role: ${t}`);l(t)},children:[e(B,{children:"System"},"system"),e(B,{children:"User"},"user"),e(B,{children:"AI"},"ai")]})}const ws=O.object({type:O.literal("function").describe("The type of the tool"),function:O.object({name:O.string().describe("The name of the function"),description:O.string().optional().describe("A description of the function"),parameters:O.object({type:O.literal("object"),properties:O.record(O.object({type:O.enum(["string","number","boolean","object","array","null","integer"]).describe("The type of the parameter"),description:O.string().optional().describe("A description of the parameter"),enum:O.array(O.string()).optional().describe("The allowed values")}).passthrough()).describe("A map of parameter names to their definitions"),required:O.array(O.string()).optional().describe("The required parameters"),additionalProperties:O.boolean().optional().describe("Whether or not additional properties are allowed in the schema"),strict:O.boolean().optional().describe("Whether or not the arguments should exactly match the function definition, only supported for OpenAI models")}).passthrough().describe("The parameters that the function accepts")}).passthrough().describe("The function definition")}).passthrough(),yy=Js(ws,{removeAdditionalStrategy:"passthrough"});function fy({playgroundInstanceId:n,tool:a,instanceTools:l}){var c;const t=q(d=>d.updateInstance),[i,r]=u.useState(JSON.stringify(a.definition,null,2)),o=u.useCallback(d=>{r(d);const{json:g}=ll(d);if(g==null)return;const{success:f}=ws.safeParse(g);f&&t({instanceId:n,patch:{tools:l.map(m=>m.id===a.id?{...m,definition:g}:m)}})},[l,n,a.id,t]);return e(V,{collapsible:!0,backgroundColor:"yellow-100",borderColor:"yellow-700",variant:"compact",title:((c=a.definition.function)==null?void 0:c.name)??"Tool",bodyStyle:{padding:0},extra:s(h,{direction:"row",gap:"size-100",children:[e(le,{text:i}),e(M,{"aria-label":"Delete tool",icon:e(P,{svg:e(I.TrashOutline,{})}),variant:"default",size:"compact",onClick:()=>{t({instanceId:n,patch:{tools:l.filter(d=>d.id!==a.id),toolChoice:void 0}})}})]}),children:e(Re,{value:i,onChange:o,jsonSchema:yy})},a.id)}function hy(n){const a=n.playgroundInstanceId,l=q(o=>o.instances.find(c=>c.id===n.playgroundInstanceId)),t=q(o=>o.updateInstance);if(l==null)throw new Error(`Playground instance ${a} not found`);const{tools:i}=l;if(i==null)throw new Error(`Playground instance ${a} does not have tools`);const r=u.useMemo(()=>i.map(o=>{var c;return(c=o.definition.function)==null?void 0:c.name}).filter(o=>o!=null),[i]);return e(Ee,{arrowPosition:"start",children:e(de,{id:"tools",title:"Tools",titleExtra:e(Me,{variant:"light",children:i.length}),children:e(F,{padding:"size-200",children:s(h,{direction:"column",gap:"size-200",children:[e(ye,{children:e(bd,{choice:l.toolChoice,onChange:o=>{t({instanceId:a,patch:{toolChoice:o}})},toolNames:r})}),i.map(o=>e(fy,{playgroundInstanceId:a,tool:o,instanceTools:l.tools},o.id))]})})})})}const As=1,ky=As+1;function by(n){const a=n.playgroundInstanceId,l=q(g=>g.templateLanguage),t=q(g=>g.instances),i=q(g=>g.updateInstance),r=t.find(g=>g.id===a);if(!r)throw new Error(`Playground instance ${a} not found`);const o=r.tools.length>0,{template:c}=r;if(c.__type!=="chat")throw new Error(`Invalid template type ${c.__type}`);const d=Zs(ml(io),ml(to,{coordinateGetter:lo}));return s(eo,{sensors:d,onDragEnd:({active:g,over:f})=>{if(!f||g.id===f.id)return;const m=c.messages.findIndex(b=>b.id===g.id),p=c.messages.findIndex(b=>b.id===f.id),y=Xs(c.messages,m,p);i({instanceId:a,patch:{template:{__type:"chat",messages:y}}})},children:[e(Ys,{items:c.messages,children:e("ul",{css:C`
3573
+ `;function Fy({role:n,includeLabel:a=!0,onChange:t}){return s(Vn,{selectedKey:n,css:a?void 0:Cy,label:"Role","data-testid":"messages-role-picker","aria-label":"Role for the chat message",size:"compact",onSelectionChange:l=>{if(!xs(l))throw new Error(`Invalid chat message role: ${l}`);t(l)},children:[e(U,{children:"System"},"system"),e(U,{children:"User"},"user"),e(U,{children:"AI"},"ai"),e(U,{children:"Tool"},"tool")]})}const Ky=400;function xy({playgroundInstanceId:n,tool:a,instanceTools:t}){var c;const l=q(d=>d.updateInstance),[i,r]=u.useState(JSON.stringify(a.definition,null,2)),o=u.useCallback(d=>{r(d);const{json:g}=Tn(d);if(g==null)return;const{success:f}=bt.safeParse(g);f&&l({instanceId:n,patch:{tools:t.map(m=>m.id===a.id?{...m,definition:g}:m)}})},[t,n,a.id,l]);return e($,{collapsible:!0,backgroundColor:"yellow-100",borderColor:"yellow-700",variant:"compact",title:s(h,{direction:"row",gap:"size-100",children:[e(dt,{spanKind:"tool"}),e(K,{children:((c=a.definition.function)==null?void 0:c.name)??"Tool"})]}),bodyStyle:{padding:0},extra:s(h,{direction:"row",gap:"size-100",children:[e(ae,{text:i}),e(N,{"aria-label":"Delete tool",icon:e(w,{svg:e(L.TrashOutline,{})}),variant:"default",size:"compact",onClick:()=>{l({instanceId:n,patch:{tools:t.filter(d=>d.id!==a.id),toolChoice:void 0}})}})]}),children:e(Cd,{preInitializationMinHeight:Ky,children:e(De,{value:i,onChange:o,jsonSchema:xp})})})}function Ty(n){const a=n.playgroundInstanceId,t=q(o=>o.instances.find(c=>c.id===n.playgroundInstanceId)),l=q(o=>o.updateInstance);if(t==null)throw new Error(`Playground instance ${a} not found`);const{tools:i}=t;if(i==null)throw new Error(`Playground instance ${a} does not have tools`);const r=u.useMemo(()=>i.map(o=>{var c;return(c=o.definition.function)==null?void 0:c.name}).filter(o=>o!=null),[i]);return e(Re,{arrowPosition:"start",children:e(de,{id:"tools",title:"Tools",titleExtra:e(Me,{variant:"light",children:i.length}),children:e(F,{padding:"size-200",children:s(h,{direction:"column",children:[e(fe,{children:e(Fd,{choice:t.toolChoice,onChange:o=>{l({instanceId:a,patch:{toolChoice:o}})},toolNames:r})}),e(h,{direction:"column",gap:"size-200",children:i.map(o=>e(xy,{playgroundInstanceId:a,tool:o,instanceTools:t.tools},o.id))})]})})})})}const As=1,Dy=As+1;function Iy(n){const a=n.playgroundInstanceId,t=q(g=>g.templateLanguage),l=q(g=>g.instances),i=q(g=>g.updateInstance),r=l.find(g=>g.id===a);if(!r)throw new Error(`Playground instance ${a} not found`);const o=r.tools.length>0,{template:c}=r;if(c.__type!=="chat")throw new Error(`Invalid template type ${c.__type}`);const d=Xs(St(ro),St(io,{coordinateGetter:lo}));return s(no,{sensors:d,onDragEnd:({active:g,over:f})=>{if(!f||g.id===f.id)return;const m=c.messages.findIndex(k=>k.id===g.id),p=c.messages.findIndex(k=>k.id===f.id),y=Ys(c.messages,m,p);i({instanceId:a,patch:{template:{__type:"chat",messages:y}}})},children:[e(eo,{items:c.messages,children:e("ul",{css:v`
3753
3574
  display: flex;
3754
3575
  flex-direction: column;
3755
3576
  gap: var(--ac-global-dimension-size-200);
3756
3577
  padding: var(--ac-global-dimension-size-200);
3757
- `,children:c.messages.map((g,f)=>e(Sy,{playgroundInstanceId:a,templateLanguage:l,template:c,message:g,index:f},g.id))})}),e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderColor:"dark",borderTopWidth:"thin",borderBottomWidth:o?"thin":void 0,children:s(h,{direction:"row",justifyContent:"end",gap:"size-100",children:[e(M,{variant:"default","aria-label":"add tool",size:"compact",icon:e(P,{svg:e(I.PlusOutline,{})}),onClick:()=>{i({instanceId:a,patch:{tools:[...r.tools,Sd(r.tools.length+1)]}})},children:"Tool"}),e(M,{variant:"default","aria-label":"add message",size:"compact",icon:e(P,{svg:e(I.PlusOutline,{})}),onClick:()=>{i({instanceId:a,patch:{template:{__type:"chat",messages:[...c.messages,{id:Da(),role:"user",content:""}]}}})},children:"Message"})]})}),o?e(hy,{...n}):null]})}function Sy({playgroundInstanceId:n,templateLanguage:a,template:l,message:t}){const i=q(b=>b.updateInstance),{attributes:r,listeners:o,setNodeRef:c,transform:d,transition:g,setActivatorNodeRef:f,isDragging:m}=no({id:t.id}),p=ol(t.role),y={transform:ao.Translate.toString(d),transition:g,zIndex:m?ky:As};return e("li",{ref:c,style:y,children:e(V,{collapsible:!0,variant:"compact",bodyStyle:{padding:0},...p,title:e(py,{includeLabel:!1,role:t.role,onChange:b=>{i({instanceId:n,patch:{template:{__type:"chat",messages:l.messages.map(k=>k.id===t.id?{...k,role:b}:k)}}})}}),extra:s(h,{direction:"row",gap:"size-100",children:[t.content!=null&&e(le,{text:t.content}),e(M,{"aria-label":"Delete message",icon:e(P,{svg:e(I.TrashOutline,{})}),variant:"default",size:"compact",onClick:()=>{i({instanceId:n,patch:{template:{__type:"chat",messages:l.messages.filter(b=>b.id!==t.id)}}})}}),e(vd,{ref:f,listeners:o,attributes:r})]}),children:e("div",{children:e(Cd,{height:"100%",value:t.content,"aria-label":"Message content",templateLanguage:a,onChange:b=>{i({instanceId:n,patch:{template:{__type:"chat",messages:l.messages.map(k=>k.id===t.id?{...k,content:b}:k)}}})}})})})})}function vy(n){const a=n.playgroundInstanceId,l=q(o=>o.instances),t=l.find(o=>o.id===a),i=l.findIndex(o=>o.id===a);if(!t)throw new Error(`Playground instance ${a} not found`);const{template:r}=t;return e(V,{title:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(gt,{index:i}),e("span",{children:"Prompt"})]}),collapsible:!0,variant:"compact",bodyStyle:{padding:0},extra:s(h,{direction:"row",gap:"size-100",children:[e(uy,{...n}),l.length>1?e(Cy,{...n}):null]}),children:r.__type==="chat"?e(by,{...n}):"Completion Template"})}function Cy(n){const a=q(l=>l.deleteInstance);return s(Le,{children:[e(kn,{children:e(M,{variant:"default",size:"compact",icon:e(P,{svg:e(I.TrashOutline,{})}),onClick:()=>{a(n.playgroundInstanceId)}})}),e(An,{children:e(Fn,{children:"Delete this instance of the playground"})})]})}function Fy(){const n=q(l=>l.templateLanguage),a=q(l=>l.setTemplateLanguage);return s(Ol,{value:n,variant:"inline-button","aria-label":"Template Language",size:"compact",onChange:l=>{Fd(l)&&a(l)},children:[e(ga,{label:"Mustache",value:hl.Mustache,children:"Mustache"}),e(ga,{label:"F-String",value:hl.FString,children:"F-String"})]})}function _s(n){const a=Ta("playgroundNonStreaming");return e(Sp,{...n,children:s(h,{direction:"column",height:"100%",children:[e(F,{borderBottomColor:"dark",borderBottomWidth:"thin",padding:"size-200",flex:"none",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(re,{level:1,children:"Playground"}),s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[a?e(ry,{}):null,e(Lp,{}),e(iy,{})]})]})}),e(Ty,{})]})})}function Ky(){const n=q(l=>l.addInstance),a=q(l=>l.instances.length);return e("div",{onClick:l=>{l.stopPropagation()},children:e(M,{variant:"default",size:"compact","aria-label":"add prompt",icon:e(P,{svg:e(I.PlusCircleOutline,{})}),disabled:a>=vp,onClick:()=>{n()},children:"Prompt"})})}const xy=C`
3578
+ `,children:c.messages.map((g,f)=>e(Ly,{playgroundInstanceId:a,templateLanguage:t,template:c,message:g,index:f},g.id))})}),e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderColor:"dark",borderTopWidth:"thin",borderBottomWidth:o?"thin":void 0,children:s(h,{direction:"row",justifyContent:"end",gap:"size-100",children:[e(N,{variant:"default","aria-label":"add tool",size:"compact",icon:e(w,{svg:e(L.PlusOutline,{})}),onClick:()=>{i({instanceId:a,patch:{tools:[...r.tools,Kd(r.tools.length+1)]}})},children:"Tool"}),e(N,{variant:"default","aria-label":"add message",size:"compact",icon:e(w,{svg:e(L.PlusOutline,{})}),onClick:()=>{i({instanceId:a,patch:{template:{__type:"chat",messages:[...c.messages,{id:Pa(),role:"user",content:""}]}}})},children:"Message"})]})}),o?e(Ty,{...n}):null]})}function Py({message:n,updateMessage:a,templateLanguage:t,playgroundInstanceId:l,template:i,messageMode:r}){return r==="toolCalls"?e(F,{paddingTop:"size-100",paddingStart:"size-250",paddingEnd:"size-250",paddingBottom:"size-200",children:e(On,{label:"Tool Calls",children:e(Je,{width:"100%",children:e(by,{playgroundInstanceId:l,toolCalls:n.toolCalls,templateMessages:i.messages,messageId:n.id})})})}):n.role==="tool"?s(fe,{onSubmit:o=>{o.preventDefault()},children:[e(F,{paddingStart:"size-200",paddingEnd:"size-200",paddingTop:"size-200",paddingBottom:"size-200",borderColor:"yellow-700",borderBottomWidth:"thin",children:e(G,{value:n.toolCallId,onChange:o=>a({toolCallId:o}),"aria-label":"Tool Call ID",addonBefore:"Tool Call ID"})}),e(De,{value:n.content==null||n.content===""?"{}":n.content,"aria-label":"tool message content",height:"100%",onChange:o=>a({content:o}),onBlur:()=>{if(n.content==null)return;const{json:o}=Tn(n.content);a({content:JSON.stringify(o,null,2)})}})]}):e("div",{css:v`
3579
+ & .cm-content {
3580
+ padding-left: var(--ac-global-dimension-size-250);
3581
+ padding-right: var(--ac-global-dimension-size-250);
3582
+ }
3583
+ & .cm-line {
3584
+ padding-left: 0;
3585
+ padding-right: 0;
3586
+ }
3587
+ `,children:e(Dd,{height:"100%",value:n.content,"aria-label":"Message content",templateLanguage:t,onChange:o=>a({content:o})})})}function Ly({playgroundInstanceId:n,templateLanguage:a,template:t,message:l}){const i=q(T=>T.updateInstance),{attributes:r,listeners:o,setNodeRef:c,transform:d,transition:g,setActivatorNodeRef:f,isDragging:m}=ao({id:l.id}),p=yt(l.role),y={transform:to.Translate.toString(d),transition:g,zIndex:m?Dy:As},k=l.toolCalls!=null&&l.toolCalls.length>0,[S,C]=u.useState(k?"toolCalls":"text"),b=u.useCallback(T=>{i({instanceId:n,patch:{template:{__type:"chat",messages:t.messages.map(P=>P.id===l.id?{...P,...T}:P)}}})},[l.id,n,t.messages,i]);return e("li",{ref:c,style:y,children:e($,{collapsible:!0,variant:"compact",bodyStyle:{padding:0},...p,title:e(Fy,{includeLabel:!1,role:l.role,onChange:T=>{let P=l.toolCalls;T!=="ai"&&(P=void 0,C("text")),i({instanceId:n,patch:{template:{__type:"chat",messages:t.messages.map(_=>_.id===l.id?{..._,role:T,toolCalls:P}:_)}}})}}),extra:s(h,{direction:"row",gap:"size-100",children:[l.role==="ai"&&e(vy,{messageMode:S,onChange:T=>{switch(C(T),T){case"text":b({content:"",toolCalls:void 0});break;case"toolCalls":b({content:"",toolCalls:[xd()]});break;default:ye()}}}),e(ae,{text:S==="toolCalls"?JSON.stringify(l.toolCalls):l.content??""}),e(N,{"aria-label":"Delete message",icon:e(w,{svg:e(L.TrashOutline,{})}),variant:"default",size:"compact",onClick:()=>{i({instanceId:n,patch:{template:{__type:"chat",messages:t.messages.filter(T=>T.id!==l.id)}}})}}),e(Td,{ref:f,listeners:o,attributes:r})]}),children:e("div",{children:e(Py,{message:l,messageMode:S,playgroundInstanceId:n,template:t,templateLanguage:a,updateMessage:b})})})})}function wy(n){const a=n.playgroundInstanceId,t=q(o=>o.instances),l=t.find(o=>o.id===a),i=t.findIndex(o=>o.id===a);if(!l)throw new Error(`Playground instance ${a} not found`);const{template:r}=l;return e($,{title:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Cl,{index:i}),e("span",{children:"Prompt"})]}),collapsible:!0,variant:"compact",bodyStyle:{padding:0},extra:s(h,{direction:"row",gap:"size-100",children:[e(hy,{...n}),t.length>1?e(_y,{...n}):null]}),children:r.__type==="chat"?e(Iy,{...n}):"Completion Template"})}function _y(n){const a=q(t=>t.deleteInstance);return s(we,{children:[e(hn,{children:e(N,{variant:"default",size:"compact",icon:e(w,{svg:e(L.TrashOutline,{})}),onClick:()=>{a(n.playgroundInstanceId)}})}),e(En,{children:e(Fn,{children:"Delete this instance of the playground"})})]})}function Ey(){const n=q(t=>t.templateLanguage),a=q(t=>t.setTemplateLanguage);return s(tt,{value:n,variant:"inline-button","aria-label":"Template Language",size:"compact",onChange:t=>{Id(t)&&a(t)},children:[e(Rn,{label:"Mustache",value:Tt.Mustache,children:"Mustache"}),e(Rn,{label:"F-String",value:Tt.FString,children:"F-String"})]})}const Ay=v`
3588
+ display: flex;
3589
+ overflow: hidden;
3590
+ flex-direction: column;
3591
+ height: 100%;
3592
+ `;function Rs(n){const a=La("playgroundNonStreaming"),[,t]=la();return u.useEffect(()=>{t(l=>(l.delete("selectedSpanNodeId"),l),{replace:!0})},[t]),e(gp,{...n,children:s("div",{css:Ay,children:[e(F,{borderBottomColor:"dark",borderBottomWidth:"thin",padding:"size-200",flex:"none",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(se,{level:1,children:"Playground"}),s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[a?e(cy,{}):null,e(Kp,{}),e(dy,{})]})]})}),e(zy,{})]})})}function Ry(){const n=q(t=>t.addInstance),a=q(t=>t.instances.length);return e("div",{onClick:t=>{t.stopPropagation()},children:e(N,{variant:"default",size:"compact","aria-label":"add prompt",icon:e(w,{svg:e(L.PlusCircleOutline,{})}),disabled:a>=pp,onClick:()=>{n()},children:"Prompt"})})}const My=v`
3758
3593
  display: flex;
3759
3594
  flex-direction: column;
3760
3595
  height: 100%;
@@ -3767,6 +3602,8 @@ fragment ModelProviderPickerFragment on Query {
3767
3602
  flex: 1 1 auto;
3768
3603
  & > .ac-accordion-item {
3769
3604
  height: 100%;
3605
+ display: flex;
3606
+ flex-direction: column;
3770
3607
  overflow: hidden;
3771
3608
  flex: 1 1 auto;
3772
3609
  .ac-accordion-itemContent {
@@ -3782,12 +3619,10 @@ fragment ModelProviderPickerFragment on Query {
3782
3619
  }
3783
3620
  }
3784
3621
  }
3785
- `,Dy=C`
3786
- display: flex;
3787
- flex-direction: column;
3622
+ `,Ny=v`
3788
3623
  height: 100%;
3789
3624
  overflow: auto;
3790
- `;function Ty(){const n=Ta("playgroundWithDatasets"),a=q(i=>i.instances),t=a.length===1;return s(Xe,{direction:t?"horizontal":"vertical",autoSaveId:t?"playground-horizontal":"playground-vertical",children:[e(ue,{children:e("div",{css:xy,children:e(Ee,{arrowPosition:"start",size:"L",children:e(de,{title:"Prompts",id:"prompts",extra:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Fy,{}),e(Ky,{})]}),children:e(F,{height:"100%",padding:"size-200",paddingBottom:"size-900",children:e(h,{direction:"row",gap:"size-200",children:a.map(i=>e(F,{flex:"1 1 0px",children:e(vy,{playgroundInstanceId:i.id},i.id)},i.id))})})})})})}),e(Ye,{css:Kn}),e(ue,{children:e("div",{css:Dy,children:s(Ee,{arrowPosition:"start",size:"L",children:[e(de,{title:"Inputs",id:"input",extra:n?e(Jp,{}):null,children:e(F,{padding:"size-200",children:e(Wp,{})})}),e(de,{title:"Output",id:"output",children:e(F,{padding:"size-200",height:"100%",children:e(h,{direction:"row",gap:"size-200",children:a.map((i,r)=>e(F,{flex:"1 1 0px",children:e(ey,{playgroundInstanceId:i.id},r)},r))})})})]})})})]})}function hf(){return e(_s,{})}function kf(){const n=Cn(),a=u.useMemo(()=>n.span.__typename==="Span"?n.span:null,[n.span]);if(!a)throw new Error("Span not found");const{playgroundInstance:l,parsingErrors:t}=u.useMemo(()=>Qp(a),[a]);return s(h,{direction:"column",height:"100%",children:[e(Iy,{span:a,parsingErrors:t}),e(_s,{instances:[l]})]})}function Iy({span:n,parsingErrors:a}){const l=Y(),t=a&&a.length>0,[i,r]=u.useState(!0),[o,c]=u.useState(t);return s(h,{direction:"column",gap:"size-50",children:[i&&e(ne,{variant:"info",title:"LLM Span Replay",banner:!0,dismissable:!0,onDismissClick:()=>{r(!1)},extra:e(M,{variant:"default",icon:e(P,{svg:e(I.ArrowBack,{})}),onClick:()=>{l(`/projects/${n.project.id}/traces/${n.context.traceId}?selectedSpanNodeId=${n.id}`)},children:"Back to Trace"}),children:`Replay and iterate on your LLM call from your ${n.project.name} project`}),o&&t&&e(ne,{variant:"warning",banner:!0,dismissable:!0,onDismissClick:()=>{c(!1)},title:"The following errors occurred when parsing span attributes:",children:e("ul",{children:a.map(d=>e("li",{children:d},d))})})]})}const Es=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null},r={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"attributes",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"spanPlaygroundPageLoaderQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"InlineFragment",selections:[t,i,r,o],type:"Span",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"spanPlaygroundPageLoaderQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,{kind:"TypeDiscriminator",abstractKey:"__isNode"},t,{kind:"InlineFragment",selections:[i,r,o],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"d1df608d16a0a1d1451bcbac7dcfc853",id:null,metadata:{},name:"spanPlaygroundPageLoaderQuery",operationKind:"query",text:`query spanPlaygroundPageLoaderQuery(
3625
+ `;function zy(){const n=La("playgroundWithDatasets"),a=q(i=>i.instances),l=a.length===1;return s(Xe,{direction:l?"horizontal":"vertical",autoSaveId:l?"playground-horizontal":"playground-vertical",children:[e(ue,{children:e("div",{css:My,children:e(Re,{arrowPosition:"start",size:"L",children:e(de,{title:"Prompts",id:"prompts",extra:s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Ey,{}),e(Ry,{})]}),children:e(F,{height:"100%",padding:"size-200",children:e(h,{direction:"row",gap:"size-200",children:a.map(i=>e(F,{flex:"1 1 0px",children:e(wy,{playgroundInstanceId:i.id},i.id)},i.id))})})})})})}),e(Ye,{css:Kn}),e(ue,{children:e("div",{css:Ny,children:s(Re,{arrowPosition:"start",size:"L",children:[e(de,{title:"Inputs",id:"input",extra:n?e(ey,{}):null,children:e(F,{padding:"size-200",height:"100%",children:e(Yp,{})})}),e(de,{title:"Output",id:"output",children:e(F,{padding:"size-200",height:"100%",children:e(h,{direction:"row",gap:"size-200",children:a.map((i,r)=>e(F,{flex:"1 1 0px",children:e(ly,{playgroundInstanceId:i.id},r)},r))})})})]})})})]})}function If(){return e(Rs,{})}function Pf(){const n=vn(),a=u.useMemo(()=>n.span.__typename==="Span"?n.span:null,[n.span]);if(!a)throw new Error("Span not found");const{playgroundInstance:t,parsingErrors:l}=u.useMemo(()=>Bp(a),[a]);return s(h,{direction:"column",height:"100%",children:[e(Vy,{span:a,parsingErrors:l}),e(Rs,{instances:[t]},a.id)]})}function Vy({span:n,parsingErrors:a}){const t=Y(),l=a&&a.length>0,[i,r]=u.useState(!0),[o,c]=u.useState(l);return s(h,{direction:"column",gap:"size-50",children:[i&&e(te,{variant:"info",title:"LLM Span Replay",banner:!0,dismissable:!0,onDismissClick:()=>{r(!1)},extra:e(N,{variant:"default",icon:e(w,{svg:e(L.ArrowBack,{})}),onClick:()=>{t(`/projects/${n.project.id}/traces/${n.context.traceId}?selectedSpanNodeId=${n.id}`)},children:"Back to Trace"}),children:`Replay and iterate on your LLM call from your ${n.project.name} project`}),o&&l&&e(te,{variant:"warning",banner:!0,dismissable:!0,onDismissClick:()=>{c(!1)},title:"The following errors occurred when parsing span attributes:",children:e("ul",{children:a.map(d=>e("li",{children:d},d))})})]})}const Ms=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"spanId"}],a=[{kind:"Variable",name:"id",variableName:"spanId"}],t={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null},r={alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"attributes",storageKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"spanPlaygroundPageLoaderQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineFragment",selections:[l,i,r,o],type:"Span",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"spanPlaygroundPageLoaderQuery",selections:[{alias:"span",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"TypeDiscriminator",abstractKey:"__isNode"},l,{kind:"InlineFragment",selections:[i,r,o],type:"Span",abstractKey:null}],storageKey:null}]},params:{cacheID:"d1df608d16a0a1d1451bcbac7dcfc853",id:null,metadata:{},name:"spanPlaygroundPageLoaderQuery",operationKind:"query",text:`query spanPlaygroundPageLoaderQuery(
3791
3626
  $spanId: GlobalID!
3792
3627
  ) {
3793
3628
  span: node(id: $spanId) {
@@ -3808,7 +3643,7 @@ fragment ModelProviderPickerFragment on Query {
3808
3643
  id
3809
3644
  }
3810
3645
  }
3811
- `}}}();Es.hash="d2fd0049ebec80d3b18827b327a91319";async function bf(n){const{spanId:a}=n.params;if(!a||typeof a!="string")throw new Error("Invalid spanId");return await D.fetchQuery(xe,Es,{spanId:a}).toPromise()}function Sf(){const n=Cn();return e(Kd,{query:n,children:e(Pe,{})})}const Rs=function(){var n={alias:null,args:null,kind:"ScalarField",name:"passwordNeedsReset",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null};return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"authenticatedRootLoaderQuery",selections:[{args:null,kind:"FragmentSpread",name:"ViewerContext_viewer"},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"viewer",plural:!1,selections:[n],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"authenticatedRootLoaderQuery",selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"viewer",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null},{alias:null,args:null,concreteType:"UserRole",kind:"LinkedField",name:"role",plural:!1,selections:[l],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"authMethod",storageKey:null},{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKeys",plural:!0,selections:[a,l,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null},n],storageKey:null}]},params:{cacheID:"d63c6184305079deb38a6f6235ba88e6",id:null,metadata:{},name:"authenticatedRootLoaderQuery",operationKind:"query",text:`query authenticatedRootLoaderQuery {
3646
+ `}}}();Ms.hash="d2fd0049ebec80d3b18827b327a91319";async function Lf(n){const{spanId:a}=n.params;if(!a||typeof a!="string")throw new Error("Invalid spanId");return await I.fetchQuery(xe,Ms,{spanId:a}).toPromise()}function wf(){const n=vn();return e(Pd,{query:n,children:e(_e,{})})}const Ns=function(){var n={alias:null,args:null,kind:"ScalarField",name:"passwordNeedsReset",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null};return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"authenticatedRootLoaderQuery",selections:[{args:null,kind:"FragmentSpread",name:"ViewerContext_viewer"},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"viewer",plural:!1,selections:[n],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"authenticatedRootLoaderQuery",selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"viewer",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null},{alias:null,args:null,concreteType:"UserRole",kind:"LinkedField",name:"role",plural:!1,selections:[t],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"authMethod",storageKey:null},{alias:null,args:null,concreteType:"UserApiKey",kind:"LinkedField",name:"apiKeys",plural:!0,selections:[a,t,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"expiresAt",storageKey:null}],storageKey:null},n],storageKey:null}]},params:{cacheID:"d63c6184305079deb38a6f6235ba88e6",id:null,metadata:{},name:"authenticatedRootLoaderQuery",operationKind:"query",text:`query authenticatedRootLoaderQuery {
3812
3647
  ...ViewerContext_viewer
3813
3648
  viewer {
3814
3649
  passwordNeedsReset
@@ -3839,4 +3674,4 @@ fragment ViewerContext_viewer on Query {
3839
3674
  ...APIKeysTableFragment
3840
3675
  }
3841
3676
  }
3842
- `}}}();Rs.hash="d30a68846023740517243e9394be73a8";async function vf(){var a;const n=await D.fetchQuery(xe,Rs,{}).toPromise();if((a=n==null?void 0:n.viewer)!=null&&a.passwordNeedsReset){const l=ct({path:"/reset-password"});return Pn(l)}return n}export{Sf as A,bf as B,cf as C,Qy as D,Hy as E,yf as F,df as G,My as H,Ry as I,Ey as J,uf as L,Gy as M,ff as P,mf as R,kf as S,Wy as T,gf as a,vf as b,Ny as c,zy as d,jy as e,$y as f,Oy as g,Vy as h,Jy as i,Zy as j,Uy as k,qy as l,Xy as m,ef as n,Yy as o,By as p,rf as q,pf as r,tf as s,lf as t,Qd as u,af as v,nf as w,of as x,sf as y,hf as z};
3677
+ `}}}();Ns.hash="d30a68846023740517243e9394be73a8";async function _f(){var a;const n=await I.fetchQuery(xe,Ns,{}).toPromise();if((a=n==null?void 0:n.viewer)!=null&&a.passwordNeedsReset){const t=kl({path:"/reset-password"});return wn(t)}return n}export{wf as A,Lf as B,vf as C,Yy as D,lf as E,Tf as F,Sf as G,Hy as H,By as I,Uy as J,Cf as L,rf as M,Df as P,Ff as R,Pf as S,sf as T,Kf as a,_f as b,Gy as c,Jy as d,ef as e,Zy as f,Xy as g,Wy as h,of as i,df as j,af as k,nf as l,cf as m,mf as n,uf as o,tf as p,hf as q,xf as r,ff as s,yf as t,Hd as u,pf as v,gf as w,bf as x,kf as y,If as z};