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