import{a as f}from"/build/_shared/chunk-ZB4ZKAO3.js";import"/build/_shared/chunk-W2OMR23Y.js";import{a as b}from"/build/_shared/chunk-NID5ZFDO.js";import"/build/_shared/chunk-WL3EVROT.js";import"/build/_shared/chunk-J7ISLRHM.js";import"/build/_shared/chunk-WHOMLFI6.js";import{a as M}from"/build/_shared/chunk-YGINDR4A.js";import{a as d}from"/build/_shared/chunk-ANUO2FWR.js";import"/build/_shared/chunk-EBHCYYOH.js";import{a as P}from"/build/_shared/chunk-BPD542OA.js";import"/build/_shared/chunk-GYJW4R24.js";import"/build/_shared/chunk-VX2L2R2M.js";import"/build/_shared/chunk-ZH5DBAIE.js";import{a as x}from"/build/_shared/chunk-PAEG26CW.js";import"/build/_shared/chunk-F4G4S474.js";import{B as v,C as m,u as l}from"/build/_shared/chunk-XIQ3C74K.js";import{a as A}from"/build/_shared/chunk-5TRFQBKG.js";import"/build/_shared/chunk-T6T2AEVA.js";import{a as g}from"/build/_shared/chunk-LR6G3KVW.js";import{d as e}from"/build/_shared/chunk-G5WX4PPA.js";var y=e(A(),1);v();var L=e(M(),1);var t=e(m(),1),E=({experiments:r,totalCount:o,currentPage:n,totalPages:a})=>(0,t.jsx)(P,{breadcrumbs:[{label:"Experiments"}],subtitle:()=>(0,t.jsxs)(d,{children:["Run experiments from your codebase to validate your system."," ",(0,t.jsx)(b,{to:g.external.docs.experiments,children:"Experiments Docs."})]}),children:(0,t.jsx)(f,{experiments:r,totalCount:o,currentPage:n,totalPages:a})});var D=e(m(),1),q=x(async({request:r,api:o,params:n})=>{let a=n.envId,{searchParams:p}=new URL(r.url),s=parseInt(p.get("page")||"1"),i=20,h=(s-1)*i,{experiments:k,totalCount:u}=await o.experiment.experimentControllerGetPaginatedExperimentsForEnvironment({envId:a,take:i.toString(),skip:h.toString()}),F=Math.ceil(u/i),S=k.map(c=>({...c,createdAt:(0,L.default)(c.createdAt).format("MMM D YY / h:mm:ss a")}));return(0,y.json)({experiments:S,totalCount:u,currentPage:s,totalPages:F})});function C(){let{experiments:r,totalCount:o,currentPage:n,totalPages:a}=l();return(0,D.jsx)(E,{experiments:r,totalCount:o,currentPage:n,totalPages:a})}export{C as default};
