import { safeLocalStorage } from "@scalar/helpers/object/local-storage";
//#region src/v2/helpers/storage.ts
var CURRENT_PATH_KEY = "scalar.currentPath";
var TELEMETRY_KEY = "scalar.telemetry";
/**
* Handles persistence of the active workspace ID in localStorage.
*
* Usage example:
* ```ts
* // Set the active workspace id
* workspaceStorage.setActiveWorkspaceId('workspace-1');
*
* // Get the currently active workspace id
* const id = workspaceStorage.getActiveWorkspaceId();
* ```
*/
var workspaceStorage = {
	setCurrentPath: (path) => {
		if (path === "/") return;
		safeLocalStorage().setItem(CURRENT_PATH_KEY, path);
	},
	getLastPath: () => {
		return safeLocalStorage().getItem(CURRENT_PATH_KEY);
	},
	setTelemetry: (enabled) => {
		safeLocalStorage().setItem(TELEMETRY_KEY, String(enabled));
	},
	getTelemetry: () => {
		const value = safeLocalStorage().getItem(TELEMETRY_KEY);
		if (value === null) return null;
		return value === "true";
	}
};
//#endregion
export { workspaceStorage };

//# sourceMappingURL=storage.js.map