import{b as r}from"./BPHiMHp4.js";async function h(a,n,e){const{callbackUrl:t=window.location.href,redirect:c=!0}={},i=`${`${r??""}/auth/signin/${a}`}?${new URLSearchParams(e)}`,s=await(await fetch(i,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({...n,callbackUrl:t})})).clone().json();{window.location.href=s.url??t,s.url.includes("#")&&window.location.reload();return}}async function u(a){const{callbackUrl:n=window.location.href}=a??{},o=(await(await fetch(`${r??""}/auth/signout`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({callbackUrl:n})})).json()).url??n;window.location.href=o,o.includes("#")&&window.location.reload()}export{h as a,u as s};