import{d as y,u as z,aK as V,o as O,R as S,a as s,w as a,b as o,e as i,f as u,g as c,t as d,h as p,n as x,_ as m,j as g,a4 as T,i as U,aL as $,a6 as j,a7 as B}from"./index-CWMhB7z4.js";const N={class:"flex flex-col gap-3"},C={class:"grid grid-cols-2 gap-3 items-start"},M={class:"flex items-start gap-2"},D=y({name:"ShwfedHttpRequestBatchActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const l=z(_,"modelValue"),v=V(()=>{}),r=t=>j(v,t)??t,n=t=>B(v,t);function k(t){const e={...l.value};t.length===0?delete e.messageExpression:e.messageExpression=t,l.value=e}function E(t){const e={...l.value};t.length===0?delete e.resultExpression:e.resultExpression=t,l.value=e}function b(t){const e={...l.value};t.length===0?Reflect.deleteProperty(e,"before"):e.before=t,l.value=e}function h(t){const e={...l.value};!t||t.length===0?delete e.markdown:e.markdown=t,l.value=e}function w(t){const e={...l.value};t?e.continueOnError=!0:delete e.continueOnError,l.value=e}return(t,e)=>(O(),S("div",N,[s(o(m),{orientation:"vertical"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":l.value.expression,multiline:"",placeholder:"例：range(1, 10).map(i, http.post('/api/foo').body({ id: i }))","result-type":"list",class:"min-h-16","onUpdate:modelValue":e[0]||(e[0]=f=>l.value={...l.value,expression:f})},null,8,["model-value"])]),_:1}),g("div",C,[s(o(m),{orientation:"vertical",class:"min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("before")),1)]),_:2},[n("before")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(T,{triggers:l.value.before??[],"onUpdate:triggers":e[1]||(e[1]=f=>b(f))},null,8,["triggers"])]),_:1}),s(o(m),{orientation:"vertical",class:"min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("markdown")),1)]),_:2},[n("markdown")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("markdown"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(U),{markdown:"","model-value":l.value.markdown,"onUpdate:modelValue":h},null,8,["model-value"])]),_:1})]),s(o(m),{orientation:"horizontal"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("continueOnError")),1)]),_:2},[n("continueOnError")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("continueOnError"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o($),{"model-value":l.value.continueOnError??!1,"onUpdate:modelValue":w},null,8,["model-value"])]),_:1}),g("div",M,[s(o(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("messageExpression")),1)]),_:2},[n("messageExpression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":l.value.messageExpression??"",placeholder:"例：string(jsons.size()) + ' 条已处理'","result-type":"string","extra-vars":{jsons:{type:"list",label:"HTTP 响应体列表（已解析 JSON，仅成功项）"}},"onUpdate:modelValue":k},null,8,["model-value"])]),_:1}),s(o(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":l.value.resultExpression??"",placeholder:"例：json.code == 0","result-type":"bool","extra-vars":{json:{type:"dyn",label:"HTTP 响应体（已解析 JSON），当前这一条响应"}},"onUpdate:modelValue":E},null,8,["model-value"])]),_:1})])]))}});export{D as default};
