import{l as v}from"./index-8HslT92O.js";import{d as c,aA as P,a7 as A,aB as b,a8 as U,M as H}from"./app-QjDgb7aF.js";import{b as J,E as f,j as k,g as B,i as a,k as n,q as y,J as u,p as M,F as O,H as T,a as s,f as _}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const j={class:"_formRoot"},q={class:"_formBlock"},F={key:0,class:"_formBlock"},G=J({__name:"api-console",setup(I){const r=s("{}"),p=s(""),V=s([]),d=s(!1),i=s(""),m=s(!0);c("endpoints").then(t=>{V.value=t});function g(){d.value=!0;const t=v.parse(r.value);c(p.value,t,t.i||(m.value?void 0:null)).then(e=>{d.value=!1,i.value=v.stringify(e,null,2)},e=>{d.value=!1,i.value=v.stringify(e,null,2)})}function C(){c("endpoint",{endpoint:p.value},m.value?void 0:null).then(t=>{const e={};for(const l of t.params)e[l.name]=l.type==="String"?"":l.type==="Number"?0:l.type==="Boolean"?!1:l.type==="Array"?[]:l.type==="Object"?{}:null;r.value=v.stringify(e,null,2)})}const S=_(()=>[]),N=_(()=>[]);return P({title:"API console",icon:"ph-terminal-window ph-bold ph-lg"}),(t,e)=>{const l=f("MkPageHeader"),x=f("MkEllipsis"),E=f("MkSpacer"),w=f("MkStickyContainer");return k(),B(w,null,{header:a(()=>[n(l,{actions:S.value,tabs:N.value},null,8,["actions","tabs"])]),default:a(()=>[n(E,{"content-max":700},{default:a(()=>[y("div",j,[y("div",q,[n(A,{modelValue:p.value,"onUpdate:modelValue":[e[0]||(e[0]=o=>p.value=o),e[1]||(e[1]=o=>C())],datalist:V.value,class:"_formBlock"},{label:a(()=>[...e[5]||(e[5]=[u("Endpoint",-1)])]),_:1},8,["modelValue","datalist"]),n(b,{modelValue:r.value,"onUpdate:modelValue":e[2]||(e[2]=o=>r.value=o),class:"_formBlock",code:""},{label:a(()=>[...e[6]||(e[6]=[u("Params (JSON or JSON5)",-1)])]),_:1},8,["modelValue"]),n(U,{modelValue:m.value,"onUpdate:modelValue":e[3]||(e[3]=o=>m.value=o),class:"_formBlock"},{default:a(()=>[...e[7]||(e[7]=[u(" With credential ",-1)])]),_:1},8,["modelValue"]),n(H,{class:"_formBlock",primary:"",disabled:d.value,onClick:g},{default:a(()=>[d.value?(k(),B(x,{key:0})):(k(),M(O,{key:1},[e[8]||(e[8]=y("i",{class:"ph-paper-plane-tilt ph-bold ph-lg"},null,-1)),e[9]||(e[9]=u(" Send",-1))],64))]),_:1},8,["disabled"])]),i.value?(k(),M("div",F,[n(b,{modelValue:i.value,"onUpdate:modelValue":e[4]||(e[4]=o=>i.value=o),code:"",readonly:"",tall:""},{label:a(()=>[...e[10]||(e[10]=[u("Response",-1)])]),_:1},8,["modelValue"])])):T("",!0)])]),_:1})]),_:1})}}});export{G as default};
//# sourceMappingURL=api-console-C6z4RtTE.js.map
