1import{r as e,t}from"./safeStorage-C7WjHKJ3.js";var n=`spm:session-persistence`;function r(){return t(n,`local`)===`session`?`session`:`local`}function i(t){e(n,t)}function a(e){return e.endsWith(`-auth-token`)}function o(e){if(typeof window>`u`)return null;try{return e===`session`?window.sessionStorage:window.localStorage}catch{return null}}function s(e,t){try{return o(e)?.getItem(t)??null}catch{return null}}function c(e,t,n){try{o(e)?.setItem(t,n)}catch{}}function l(e,t){try{o(e)?.removeItem(t)}catch{}}function u(){if(typeof window>`u`)return!1;for(let e of[`local`,`session`]){let t=o(e);if(t)try{for(let e=0;e<t.length;e++){let n=t.key(e);if(!n||!a(n))continue;let r=t.getItem(n);if(r)try{let e=JSON.parse(r);if(typeof e.refresh_token==`string`&&e.refresh_token.length>0)return!0}catch{return!0}}}catch{}}return!1}function d(){return{getItem(e){if(!a(e))return s(`local`,e);let t=r(),n=t===`local`?`session`:`local`;return s(t,e)??s(n,e)},setItem(e,t){if(!a(e)){c(`local`,e,t);return}let n=r(),i=n===`local`?`session`:`local`;c(n,e,t),l(i,e)},removeItem(e){l(`local`,e),a(e)&&l(`session`,e)}}}export{d as createAuthStorage,r as getSessionPersistence,u as hasStoredSession,i as setSessionPersistence};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.