She said she doesn't deserve me?

I've been friends with this girl for around 2 years, and around a year ago I got a crush on her, and she knows this because in May, I asked her to prom, but she said no, as she liked another guy. They ended up going to prom together and dated for a while, but I had to tell him to set up the dates and whatever since he didn't actually care about her or do anything. She eventually found out about this, and they broke up once he moved.

Last week, we were walking and we ran into this guy who always used to make her feel uncomfortable, and she suddenly held my hand in hers and we ran away. She apologized for holding my hand without asking, and I noticed her bio said "what if i actually liked holding your hand, am i crazy?"

2 nights ago, we were texting and she confessed how guilty she felt about rejecting me, and admitted that she held my hand to know what it couldve been like had she said yes to me in May. She said she "felt safe" holding my hand and that she liked it, and said she always feels safe talking to me, but said she was still sorting out her feelings. She said she was going to bed before coming back, saying, "even if its not romantically, I love you, okay?"

Just now, she suddenly lost it and started talking about how she felt like a "failure," to the point of confessing how she would dig her nails into her skin to make herself bleed, and how she even nearly attempted suicide. Hearing all of this really hurt and scared me, so I went on a long talk about how much she meant to me and other people, and how I wouldn't be able to forgive myself if something actually ends up happening to her. She responded with "you know i seriously dont deserve someone like you." I asked if I made her happy and she said "of course, don't doubt that for a second." I don't know what she meant when she said she didn't deserve me, and I don't know what else to say to her. Any ideas?
She said she doesn't deserve me?
Post Opinion