import{n as r,t as f,p as y,O as c,q as p,R as l}from"./zkSKlUqt.js";const v="$s";function d(...e){const i=typeof e[e.length-1]=="string"?e.pop():void 0;typeof e[0]!="string"&&e.unshift(i);const[s,n]=e;if(!s||typeof s!="string")throw new TypeError("[nuxt] [useState] key must be a string: "+s);if(n!==void 0&&typeof n!="function")throw new Error("[nuxt] [useState] init must be a function: "+n);const t=v+s,a=r(),o=f(a.payload.state,t);if(o.value===void 0&&n){const u=n();if(y(u))return a.payload.state[t]=u,u;o.value=u}return o}const S=async(e,i={},s={})=>{const n=`${JSON.stringify(i)}${e}`,t=d(`${n}-state`),a=c();if(p(()=>{t.value&&t.value.id&&l(t.value.id,o=>t.value=o,s)}),!t.value){const{data:o}=await a.get(`cdn/stories/${e}`,i);t.value=o.story}return t};export{S as u};
