class a{static isAvailable(){try{if(typeof localStorage>"u")return!1;const t="__storage_test__";return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch{return!1}}static getItem(t,r=null){try{const e=localStorage.getItem(t);return e!==null?e:r}catch(e){return console.error("SafeStorage: Failed to get item",e),r}}static setItem(t,r){try{return localStorage.setItem(t,r),!0}catch{return!1}}static removeItem(t){try{return localStorage.removeItem(t),!0}catch{return!1}}static clear(){try{return localStorage.clear(),!0}catch{return!1}}static get length(){return localStorage?.length||0}static key(t){try{return localStorage.key(t)}catch{return null}}static has(t){try{return localStorage.getItem(t)!==null}catch{return!1}}static setObject(t,r){try{const e=JSON.stringify(r);return a.setItem(t,e)}catch(e){return console.error("SafeStorage: Failed to set object",e),!1}}static getObject(t,r=null){try{const e=a.getItem(t);return e===null?r:JSON.parse(e)}catch(e){return console.error("SafeStorage: Failed to parse stored object",e),r}}}export{a as S}; //# sourceMappingURL=storage-DaZGhURt.js.map