Doxylamine
Doxylamine is one of the many sedating antihistamines used by itself as a short-term sedative. Commonly found in Cough Syrups like Nyquil which also contains Dextromethorphan HBr. Used recreationaly for its heavy sedating effects.
Ted was tripping balls on Nyquil Cherry, which contains Doxylamine, DXM, Acetaminophen, and Alcohol.