import{d as f,c as x,o as h,a as i,r as d,n as g,g as w,u as c,e as y,w as C,f as V,G as m,J as u,y as B,C as k,K as _,s as D,E,L as K,m as $}from"./index-CDPBytck.js";import{u as P,T}from"./ReferenceContentLoader-34zh6S1n.js";const A={class:"flex gap-2"},M={class:"flex max-h-8 flex-1"},F=f({__name:"CommandActionForm",props:{loading:{},disabled:{type:Boolean,default:!1}},emits:["submit","cancel","back"],setup(p){const{cx:l}=P();return(t,a)=>(h(),x("form",{class:"flex w-full flex-col gap-3",onKeydown:a[0]||(a[0]=u(m(()=>{},["stop"]),["enter"])),onSubmit:a[1]||(a[1]=m(n=>t.$emit("submit"),["prevent","stop"]))},[i("div",g(w(c(l)("relative flex min-h-20 flex-col rounded"))),[d(t.$slots,"default")],16),i("div",A,[i("div",M,[d(t.$slots,"options")]),y(c(T),{class:"max-h-8 p-0 px-3 text-xs",disabled:t.disabled,loading:t.loading,type:"submit"},{default:C(()=>[d(t.$slots,"submit",{},()=>[a[2]||(a[2]=V("Continue"))])]),_:3},8,["disabled","loading"])])],32))}}),N=["placeholder"],G=f({inheritAttrs:!1,__name:"CommandActionInput",props:{modelValue:{},placeholder:{},autofocus:{type:Boolean}},emits:["update:modelValue","onDelete"],setup(p,{emit:l}){const t=p,a=l,n=B(null);k(()=>_(()=>{t.autofocus||n.value?.focus()}));const r=D({get:()=>t.modelValue??"",set:e=>a("update:modelValue",e)});function v(e){if(e.shiftKey||!e.target)return;e.preventDefault();const o=e.target,s=new Event("submit",{cancelable:!0});o.form?.dispatchEvent(s)}function b(e){r.value===""&&(e.preventDefault(),e.stopPropagation(),a("onDelete",e))}return(e,o)=>E((h(),x("textarea",$({id:"command-action-input",ref_key:"input",ref:n,"onUpdate:modelValue":o[0]||(o[0]=s=>r.value=s),class:"min-h-8 w-full flex-1 resize-none border border-transparent py-1.5 pl-8.5 text-sm outline-none focus:border-b-1",placeholder:t.placeholder??"",wrap:"hard"},e.$attrs,{onKeydown:[o[1]||(o[1]=u(s=>b(s),["delete"])),o[2]||(o[2]=u(s=>v(s),["enter"]))]}),null,16,N)),[[K,r.value]])}});export{G as E,F as h};
