1import{d as C,T as M,ai as V,b3 as D,m as R,o as a,c as l,a as x,n as u,t as s,e as o,b,P as k,Q as T,at as z,I as j,j as N,aj as p,f as y,z as K,_ as S}from"./Cn-bPh2x.js";const U={class:"flex flex-col gap-3 tracking-tight leading-none min-w-0"},E={class:"flex flex-col gap-2 min-w-0"},Q=["for"],$={class:"flex flex-col gap-1.5 flex-1 min-w-0 relative"},q={key:0,class:"flex items-start justify-between gap-2"},A=["for"],F={key:0},G={key:0},H={key:1},J={key:0},L=["id","disabled","placeholder","rows","autocomplete","maxlength"],O=["type","inputmode","step","id","disabled","min","max","placeholder","autocomplete"],W={key:2},X={key:0,class:"flex flex-col gap-2 text-left"},Y={key:0,class:"text-grasshopper-900/60 dark:text-content-secondary/60"},Z={key:1,class:"text-[#D02525]"},_=C({__name:"BaseInput",props:p({id:{},label:{},labelPosition:{default:"inside"},placeholder:{},hint:{},message:{},error:{},disabled:{type:Boolean},trailing:{},type:{default:"text"},icon:{},autofocus:{type:Boolean},autocomplete:{},inputMode:{},max:{},min:{},rows:{default:3},step:{},center:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:p(["input","paste","keydown"],["update:modelValue"]),setup(e,{emit:v}){const i=e,w=M(),d=V(e,"modelValue"),m=v,c=D("inputRef"),P=y(()=>{const r=["bg-neutral-960","dark:bg-neutral-800"];return i.disabled?r.push("cursor-not-allowed"):r.push("hover:bg-neutral-920"),i.type==="textarea"?r.push("items-start"):r.push("items-center"),i.error&&r.push("!outline-[#D02525]"),r}),h=y(()=>i.disabled?"text-grasshopper-900/40 dark:text-content-secondary/40":"text-grasshopper-900/60 dark:text-content-secondary"),g=y(()=>i.disabled?"text-grasshopper-900/40 dark:text-content-secondary/40":"text-grasshopper-900/50 dark:text-content-secondary/50"),B=()=>{i.disabled||!c.value||(["date","datetime-local","month"].includes(i.type)&&"showPicker"in c.value?c.value.showPicker():c.value.focus())},f=y(()=>i.id??w);return R(()=>{i.autofocus&&setTimeout(()=>c.value?.focus(),50)}),(r,t)=>{const I=K;return a(),l("div",U,[x("div",E,[e.label&&e.labelPosition==="top"?(a(),l("label",{key:0,class:u(["font-medium",h.value]),for:f.value},s(e.label),11,Q)):o("",!0),x("div",{class:u(["rounded-lg p-4 flex gap-5 transition-colors duration-200 ease-linear focus-within:bg-neutral-960 dark:focus-within:bg-neutral-800 outline outline-2 outline-transparent focus-within:outline-grasshopper-900 dark:focus-within:outline-stroke-primary",P.value]),onClick:B},[x("div",$,[e.labelPosition!=="top"&&e.label||e.labelPosition==="top"&&e.hint&&e.type!=="textarea"?(a(),l("div",q,[e.labelPosition!=="top"&&e.label?(a(),l("label",{key:0,class:u(["font-medium",h.value]),for:f.value},s(e.label),11,A)):o("",!0),x("p",{class:u(["text-[14px] ml-auto",g.value])},[e.type==="textarea"?(a(),l("span",F,[b(s(typeof d.value=="string"?d.value.length:"0"),1),e.max?(a(),l("span",G,"/"+s(e.max),1)):o("",!0)])):e.hint?(a(),l("span",H,s(e.hint),1)):o("",!0)],2)])):o("",!0),e.type==="textarea"&&e.labelPosition==="top"?(a(),l("p",{key:1,class:u(["absolute top-0 right-0 text-[14px] pointer-events-none",g.value])},[b(s(typeof d.value=="string"?d.value.length:"0"),1),e.max?(a(),l("span",J,"/"+s(e.max),1)):o("",!0)],2)):o("",!0),x("div",{class:u(["flex gap-2 flex-1 text-grasshopper-900 dark:text-content-primary laptop:text-[20px]",e.type==="textarea"?"items-start":"items-center"])},[e.type==="textarea"?k((a(),l("textarea",{key:0,ref_key:"inputRef",ref:c,onInput:t[0]||(t[0]=n=>m("input",n.target.value)),onPaste:t[1]||(t[1]=n=>m("paste",n)),onKeydown:t[2]||(t[2]=n=>m("keydown",n)),id:f.value,"onUpdate:modelValue":t[3]||(t[3]=n=>d.value=n),disabled:e.disabled,placeholder:e.placeholder,rows:e.rows,autocomplete:e.autocomplete,maxlength:e.max,class:u([e.labelPosition==="top"&&e.max?"pr-14":"","outline-none flex-1 bg-transparent placeholder:text-grasshopper-900/60 dark:placeholder:text-content-secondary/60 disabled:text-grasshopper-900/40 dark:disabled:text-content-secondary/40 disabled:cursor-not-allowed resize-none"])},null,42,L)),[[T,d.value]]):k((a(),l("input",{key:1,ref_key:"inputRef",ref:c,onInput:t[4]||(t[4]=n=>
1m("input",n.target.value)),onPaste:t[5]||(t[5]=n=>m("paste",n)),onKeydown:t[6]||(t[6]=n=>m("keydown",n)),type:e.type,inputmode:e.inputMode,step:e.step,id:f.value,"onUpdate:modelValue":t[7]||(t[7]=n=>d.value=n),disabled:e.disabled,min:e.min,max:e.max,placeholder:e.placeholder,autocomplete:e.autocomplete,class:u(["hide-calendar-icon outline-none min-w-0 flex-1 bg-transparent placeholder:text-grasshopper-900/60 dark:placeholder:text-content-secondary/60 disabled:text-grasshopper-900/40 dark:disabled:text-content-secondary/40 disabled:cursor-not-allowed",{"text-center center":e.center}])},null,42,O)),[[z,d.value]]),e.trailing?(a(),l("p",W,s(e.trailing),1)):o("",!0)],2)]),j(r.$slots,"icon",{},()=>[e.icon?(a(),N(I,{key:0,name:e.icon,size:"18",class:"flex-shrink-0 text-grasshopper-900/60 dark:text-content-secondary"},null,8,["name"])):o("",!0)],!0)],2)]),e.message||e.error?(a(),l("div",X,[e.message?(a(),l("p",Y,s(e.message),1)):o("",!0),e.error?(a(),l("p",Z,s(e.error),1)):o("",!0)])):o("",!0)])}}}),te=S(_,[["__scopeId","data-v-f2b6fac8"]]);export{te as B};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.