import{deleteCookie as m,getCookie as u}from"hono/cookie";import{getPathPrefix as p}from"@redocly/theme/core/utils";import{AuthCookieNames as k}from"../../constants/common.js";function C(e){const o=p()||"/";for(const t of Object.values(k))m(e,t,{path:o})}function n(e){try{return decodeURIComponent(e)}catch{return e}}function x(e){const o=new Map,t=e.req.header("cookie")||"";return t&&t.split(";").forEach(c=>{const[a,...s]=c.split("="),r=a?.trim();if(!r)return;const f=s.join("=").trim();try{const i=u(e,r);if(!i)return;o.set(n(r),i)}catch{o.set(n(r),n(f))}}),o}export{C as clearAuthCookies,x as parseCookieHeader,n as safeDecodeURIComponent};
