import{_ as e,c as a,a as l,o as t,b as s,e as n,N as o,S as c,af as u,t as d,v as r,w as i,E as p,x as f,ah as m,m as w,A as x,ap as g}from"./index-Dj1dnKzO.js";const h={class:"w-full flex justify-between gap-5"},v={class:"flex items-center w-full"},y={class:"flex items-center px-4"},b={class:"w-3 flex-shrink-0 flex-col flex ml-2"},_={class:"flex gap-3"},V=e({__name:"FuncBar",props:{content:{type:String,default:""},filename:{type:String,default:"swanlab.file"},placeholder:{type:String,default:"Search..."},targets:{type:Array,default:()=>[]},modelValue:{type:Number,default:1}},emits:["input","download","update:modelValue"],setup(e,{emit:V}){const k=e,S=V,C=a({get:()=>k.modelValue,set(e){e<1?S("update:modelValue",1):e>k.targets.length?S("update:modelValue",k.targets.length):S("update:modelValue",e)}}),j=e=>{S("input",e)},A=()=>{m(k.content),w.success(x("experiment.func-bar.copy-success"))},F=()=>{g(k.content,k.filename)};return(a,m)=>{var w,x;const g=r,V=f;return t(),l("div",h,[s("div",v,[n(c,{onInput:j,placeholder:e.placeholder,class:"max-w-[400px]"},null,8,["placeholder"]),o(s("div",y,[s("span",null,d(C.value)+" / "+d(null==(w=e.targets)?void 0:w.length),1),s("div",b,[n(g,{icon:"down",class:"w-full h-3 -rotate-180 -mb-1",onClick:m[0]||(m[0]=e=>C.value++)}),n(g,{icon:"down",class:"w-full aspect-square",onClick:m[1]||(m[1]=e=>C.value--)})])],512),[[u,null==(x=e.targets)?void 0:x.length]])]),s("div",_,[n(V,{hollow:"",onClick:A},{default:i((()=>[n(g,{icon:"copy",class:"icon"}),p(" "+d(a.$t("experiment.func-bar.copy")),1)])),_:1}),n(V,{hollow:"",onClick:F},{default:i((()=>[n(g,{icon:"download",class:"icon"}),p(" "+d(a.$t("experiment.func-bar.download")),1)])),_:1})])])}}},[["__scopeId","data-v-2c15ccb6"]]);export{V as F};
