What does 次第だ means at the end of a sentence?


I have studied that 次第 can be used to say "as soon as" and "depending on",
however these two meaning do not seem to fit when it is at the end of the
sentence. According to my book, in this case, it has the meaning of わけだ. I
guessed it means "because" and gives the idea of explaning why something was
done. Did I understand it correctly?




The position is not very important. 次第だ/です at the end of a sentence can mean
"depends on" or "as soon as". 次第 in the middle of a sentence can refer to a
reason.

  * 成功するかどうかは彼女次第だ。  
Whether we will succeed **depends on** her.

  * いつメールを送るか？ 原稿が完成次第だ。  
When to send a mail? **As soon as** the manuscript is finished!

  * というわけで相談している次第です。  
So that is why I'm consulting you.

  * そんな次第で明日は休みます。  
Thus, I'll take a day off tomorrow.

One of the basic meanings of 次第 is "order/course/turn (of events)", and by
extension, "reason". See the fifth definition
[here](https://jisho.org/search/%E6%AC%A1%E7%AC%AC).

