Online adaptive shockwave detection and inpainting based on vehicle trajectory data: rigorous algorithm design and theory development