Implement a text document editor that supports the following operations: insert(chars) appends characters to the end; delete(k) removes up to k characters from the end (if k exceeds the current length, delete whatever exists); undo_last() undoes the most recent effective operation; redo_last() re-applies the last undone operation. Define an Operation interface with apply(doc) -> doc and rollback_operation() -> Operation to produce the inverse operation for undo/redo. Maintain undo and redo stacks; applying any new operation clears the redo stack. Provide get_current_content() -> str. Handle edge cases such as consecutive deletes, deleting from an empty document, attempting undo/redo when their stacks are empty, and ensuring only effective deletes are recorded for undo. Analyze time and space complexity for each operation and justify your data structure choices. Write unit tests covering: simple undo/redo flows, multiple consecutive deletions, very large deletions that exceed current length, sequences with no insertions, and idempotent redo when no redo is possible.