import{H as R,r as b,I as x,J as E,z as T,K as k,a as H,L as w,M,N as S,O as D,g as z,P as V,Q as j,R as K,e as p,f as c,h as B,j as F,S as I,T as N,l as v,m as L}from"./CAOuqjJ0.js";import{b as J}from"./52JYfeIs.js";const Q=s=>s==="defer"||s===!1;function U(...s){var C;const o=typeof s[s.length-1]=="string"?s.pop():void 0;typeof s[0]!="string"&&s.unshift(o);let[a,d,e={}]=s;if(typeof a!="string")throw new TypeError("[nuxt] [asyncData] key must be a string.");if(typeof d!="function")throw new TypeError("[nuxt] [asyncData] handler must be a function.");const t=M(),f=d,_=()=>null,y=()=>t.isHydrating?t.payload.data[a]:t.static.data[a];e.server=e.server??!0,e.default=e.default??_,e.getCachedData=e.getCachedData??y,e.lazy=e.lazy??!1,e.immediate=e.immediate??!0,e.deep=e.deep??R.deep,e.dedupe=e.dedupe??"cancel";const h=()=>e.getCachedData(a,t)!=null;if(!t._asyncData[a]||!e.immediate){(C=t.payload._errors)[a]??(C[a]=null);const i=e.deep?b:x;t._asyncData[a]={data:i(e.getCachedData(a,t)??e.default()),pending:b(!h()),error:E(t.payload._errors,a),status:b("idle")}}const n={...t._asyncData[a]};n.refresh=n.execute=(i={})=>{if(t._asyncDataPromises[a]){if(Q(i.dedupe??e.dedupe))return t._asyncDataPromises[a];t._asyncDataPromises[a].cancelled=!0}if((i._initial||t.isHydrating&&i._initial!==!1)&&h())return Promise.resolve(e.getCachedData(a,t));n.pending.value=!0,n.status.value="pending";const u=new Promise((l,r)=>{try{l(f(t))}catch(g){r(g)}}).then(async l=>{if(u.cancelled)return t._asyncDataPromises[a];let r=l;e.transform&&(r=await e.transform(l)),e.pick&&(r=q(r,e.pick)),t.payload.data[a]=r,n.data.value=r,n.error.value=null,n.status.value="success"}).catch(l=>{if(u.cancelled)return t._asyncDataPromises[a];n.error.value=S(l),n.data.value=D(e.default()),n.status.value="error"}).finally(()=>{u.cancelled||(n.pending.value=!1,delete t._asyncDataPromises[a])});return t._asyncDataPromises[a]=u,t._asyncDataPromises[a]},n.clear=()=>$(t,a);const m=()=>n.refresh({_initial:!0}),O=e.server!==!1&&t.payload.serverRendered;{const i=z();if(i&&!i._nuxtOnBeforeMountCbs){i._nuxtOnBeforeMountCbs=[];const r=i._nuxtOnBeforeMountCbs;T(()=>{r.forEach(g=>{g()}),r.splice(0,r.length)}),k(()=>r.splice(0,r.length))}O&&t.isHydrating&&(n.error.value||h())?(n.pending.value=!1,n.status.value=n.error.value?"error":"success"):i&&(t.payload.serverRendered&&t.isHydrating||e.lazy)&&e.immediate?i._nuxtOnBeforeMountCbs.push(m):e.immediate&&m();const u=V();if(e.watch){const r=H(e.watch,()=>n.refresh());u&&w(r)}const l=t.hook("app:data:refresh",async r=>{(!r||r.includes(a))&&await n.refresh()});u&&w(l)}const P=Promise.resolve(t._asyncDataPromises[a]).then(()=>n);return Object.assign(P,n),P}function $(s,o){o in s.payload.data&&(s.payload.data[o]=void 0),o in s.payload._errors&&(s.payload._errors[o]=null),s._asyncData[o]&&(s._asyncData[o].data.value=void 0,s._asyncData[o].error.value=null,s._asyncData[o].pending.value=!1,s._asyncData[o].status.value="idle"),o in s._asyncDataPromises&&(s._asyncDataPromises[o].cancelled=!0,s._asyncDataPromises[o]=void 0)}function q(s,o){const a={};for(const d of o)a[d]=s[d];return a}const G={class:"main navcont"},W={key:0},X={class:"errnotion"},Y=c("h5",null,"This page does not exist",-1),Z={key:1,class:"notionblog"},A=c("br",null,null,-1),ee={key:2,class:"navcont"},ae=c("div",{class:"flex-center"},[c("br"),c("br"),c("br"),c("br"),c("div",{class:"loader"}),c("br"),c("h6",{class:"center"},"Loading")],-1),te=[ae],oe={__name:"[activity]",async setup(s){var _;let o,a;const{$notion:d}=M(),e=j();console.log(e.params.activity);const t=(_=J.find(y=>y.notion==e.params.activity))==null?void 0:_.notion,{data:f}=([o,a]=K(()=>U("notion",()=>d.getPageBlocks(t))),o=await o,a(),o);return(y,h)=>{const n=N("router-link"),m=N("NotionRenderer");return v(),p("main",G,[D(f)=="TypeError: Failed to fetch"?(v(),p("div",W,[c("div",X,[Y,B(n,{to:"/"},{default:F(()=>[L(" ← Back ")]),_:1})])])):I("",!0),D(f)?(v(),p("div",Z,[B(m,{blockMap:D(f),fullPage:"",prism:"",katex:""},null,8,["blockMap"]),A])):(v(),p("div",ee,te))])}}};export{oe as default};