import{_ as k}from"./state-editor-baqu4p5i.js";import{p as h,J as i,X as t,F as $,ag as N,W as f,Z as a,$ as B,a1 as w,a2 as d,q as b,ai as O,a3 as m,a0 as n,u as F,ac as V,ab as j}from"./vendor/json-editor-vue-ho2zu772.js";import{_ as E}from"./nsection-block-owu5vx1c.js";import{b as G,f as P,_ as R}from"#entry";import{_ as A}from"./help-fab-izt1nioe.js";import"./data-schema-button-euw6cc96.js";import"./nicon-title-n11g9rad.js";import"./vendor/shiki-g7cm1eew.js";import"./vendor/unocss-b6xarsb2.js";const H={key:0,flex:"~ col gap-1"},K={key:1,mt2:"",px4:"",italic:"",op35:""},T=h({__name:"StateGroup",props:{state:{},revision:{},prefix:{default:""}},setup(o){return(e,r)=>{const l=k;return t(),i("div",null,[o.state&&Object.keys(o.state).length>0?(t(),i("div",H,[(t(!0),i($,null,N(o.state,(u,s)=>(t(),f(l,{key:s,revision:o.revision,state:u,name:s.startsWith(o.prefix)?s.slice(o.prefix.length):s},{actions:a(c=>[B(e.$slots,"actions",w({ref_for:!0},c))]),_:3},8,["revision","state","name"]))),128))])):(t(),i("div",K," No data "))])}}}),W=Object.assign(T,{__name:"StateGroup"}),q={},J={class:"markdown-body"};function L(o,e){return t(),i("div",J,[...e[0]||(e[0]=[d("template",null,[d("div",{class:"markdown-body"},[d("h1",null,"State & Async Data"),d("p",null,"// TODO")])],-1)])])}const X=G(q,[["render",L]]),Z={key:0},at=h({__name:"payload",setup(o){const e=P(),r=b(()=>e.value?.nuxt.payload),l=b(()=>e.value?.revision.value);async function u(s){await e.value?.nuxt.hooks.callHookParallel("app:data:refresh",s)}return(s,c)=>{const v=W,p=E,x=R,S=k,g=X,D=A,C=O("tooltip");return t(),i($,null,[F(e)?(t(),i("div",Z,[n(p,{icon:"carbon-data-set",text:"State",description:"Keyed state from `useState`",padding:!1},{default:a(()=>[n(v,{state:r.value.state,revision:l.value,prefix:"$s"},null,8,["state","revision"])]),_:1}),n(p,{icon:"carbon-data-blob",text:"Data",description:"Keyed state from `useAsyncData`",padding:!1},{actions:a(()=>[n(x,{n:"xs primary","self-start":"",icon:"i-carbon-recycle",onClick:c[0]||(c[0]=y=>u())},{default:a(()=>[...c[1]||(c[1]=[j(" Re-fetch all data ",-1)])]),_:1})]),default:a(()=>[n(v,{state:r.value.data,revision:l.value},{actions:a(({isOpen:y,name:_})=>[y&&_?V((t(),f(x,{key:0,title:`Re-fetch '${_}'`,icon:"carbon-recycle",border:!1,onClick:z=>u([_])},null,8,["title","onClick"])),[[C,`Re-fetch '${_}'`,void 0,{bottom:!0}]]):m("",!0)]),_:1},8,["state","revision"])]),_:1}),r.value.functions&&Object.keys(r.value.functions).length?(t(),f(p,{key:0,icon:"carbon-function",text:"Functions",description:"State for functions"},{default:a(()=>[n(S,{"ml--6":"",state:r.value.functions,revision:l.value},null,8,["state","revision"])]),_:1})):m("",!0)])):m("",!0),n(D,null,{default:a(()=>[n(g)]),_:1})],64)}}});export{at as default};
