# -*- coding: utf-8 -*-
from __future__ import annotations

import os

from .constants import DEFAULT_WORKSPACE_MODE, WorkspaceMode


def get_workspace_mode(default: str | None = None) -> WorkspaceMode:
    return WorkspaceMode(os.getenv(
        'HOTPOCKET_WORKSPACE_MODE',
        (
            default
            if default is not None
            else DEFAULT_WORKSPACE_MODE
        ),
    ))
