import{i as e,h as a,c as s,a as t,b as n,t as l,e as r,F as i,s as u,f as o,o as c,N as m,af as p,q as v,A as d}from"./index-mtICtCH6.js";import{u as f}from"./experiment-C9fiIMV8.js";import{F as x}from"./FuncBar-DxBJntCU.js";const b={key:0,class:"w-full border p-6 rounded-lg bg-default"},g={class:"flex items-center justify-between border-b pb-4 mb-5"},h={class:"text-xl font-semibold border-none basis-1/4"},w={key:0,class:"px-6 py-4 bg-higher rounded max-h-[60vh] overflow-y-auto"},y={key:1,class:"w-full flex flex-wrap justify-center pt-10"},q={class:"font-semibold w-full text-center pt-10"},j={__name:"EnvRequirements",setup(j){const k=f(),$=e();a.get(`/experiment/${k.id}/requirements`).then((({data:e})=>{$.value=e.requirements})).catch((()=>{$.value=[]}));const C=e(""),F=e=>{C.value=e.toLowerCase().trim()},L=s((()=>$.value.map((e=>{const a=""!==C.value&&e.toLowerCase().includes(C.value);return{isTarget:a,value:a?T(e,C.value):e}}))));function T(e,a){let s=e.split(new RegExp(`(${a})`,"i"));return s=s.filter((e=>""!==e)),s}return(e,a)=>{var s;const f=d;return $.value?(c(),t("div",b,[n("div",g,[n("h1",h,l(e.$t("experiment.env.title.dependencies")),1),r(x,{class:"basis-1/3",onInput:F,content:null==(s=$.value)?void 0:s.join("\n"),filename:"requirements.txt",placeholder:e.$t("experiment.func-bar.placeholder.requirements")},null,8,["content","placeholder"])]),0!==$.value.length&&""!==$.value[0]?(c(),t("div",w,[(c(!0),t(i,null,u(L.value,(e=>(c(),t("p",{key:e},[m(n("span",null,l(e.value),513),[[p,!e.isTarget]]),m(n("span",null,[(c(!0),t(i,null,u(e.value,(e=>(c(),t("span",{key:e,class:v(e.toLowerCase()===C.value?" bg-warning-dimmest":"")},l(e),3)))),128))],512),[[p,e.isTarget]])])))),128))])):(c(),t("div",y,[r(f,{class:"magnifier",icon:"search"}),n("div",q,l(e.$t("experiment.env.empty.requirements")),1)]))])):o("",!0)}}};export{j as default};
