import json
import string


def is_slate_value_empty(data):
    """
    Given a slate value serialized to JSON, return true if it's empty
    """
    try:
       value = json.loads(data)
    except json.JSONDecodeError:
        # if it's not JSON, it's plaintext
        return data == "" or data.isspace()

    doc_text = ""

    for block in value['document']['nodes']:
        doc_text += "".join([text['text'] for text in block['nodes']])

    return all(c.isspace() or c == "" or not (c in string.printable) for c in doc_text)