import{A as t,_ as n,z as e,c as r}from"./p-2fd22ed9.js";import{c as a}from"./p-9bfc48ee.js";import"./p-097729d8.js";import{s as o}from"./p-62c3d279.js";import{u as i}from"./p-c7f96882.js";const{state:c,onChange:s}=a({identity:null});s("identity",(a=>{var o;return a?(r.client.setLink(t.from([(o=(t,{headers:n})=>({headers:Object.assign(Object.assign({},n),{authorization:a.token})}),new t((function(t,r){var a=n(t,[]);return new e((function(n){var e;return Promise.resolve(a).then((function(){return o(0,t.getContext())})).then(t.setContext).then((function(){e=r(t).subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)})})).catch(n.error.bind(n)),function(){e&&e.unsubscribe()}}))}))),r.client.link])),window.localStorage.setItem("canAuthenticate","1")):(document.cookie="refreshToken=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;",window.localStorage.removeItem("canAuthenticate")),null})),async function(){if(!window.localStorage.getItem("canAuthenticate"))return;const t=await r.client.mutate({mutation:o(i)});c.identity=t.data.userTokenRefresh}();export{c as a,s as o}