Thanks for reaching out on this forum! This sounds like a challenging situation to be in and must be more frustrating to deal with being in year 12.
I've also been in similar situations where I feel excluded with friends that I deem as my 'closest'. I think taking a few days to sit with your emotions is helpful. Give yourself permission to feel irritated, annoyed, upset, and lonely. But then reflect on your friendships and ask yourself: " do my friends make me more happy or sad?" and " do my friendships reflect what is important for me?".
Remember that you get decide how much people's rejection affects you - do your friends deserve that much power to make you feel like this?
It is helpful to evaluate whether your friends are really worth your time and investment. If you find yourself feeling more upset than happy with your best friends, they might not really be your best friends after all!
If you're comfortable with it, try talking about this with your parents, a sibling, or other close, trustworthy friends. Reaching out to someone to discuss your feelings will not only help alleviate some emotional burden, but also make you feel connected in what I'm sure is a tough and confusing time for you.
Wishing you all the best x