次第で (outcome depends on the factor)
次第だ (sentence-final; "it's entirely up to…")
次第では (variant with は for contrast/emphasis)
The grammar pattern 次第だ / 次第で expresses that something depends on a particular factor. It conveys the idea that the outcome or result changes based on the preceding noun. It is similar to saying "it depends on ~" or "depending on ~" in English.
When しだい次第だ comes at the end of a sentence, it states that the outcome hinges entirely on the noun that precedes it.
This usage emphasizes that the preceding noun is the decisive factor.
When しだい次第で is used mid-sentence, it connects to the following clause and means "depending on ~", indicating that something will vary or change according to the preceding factor.
A related form is 次第では, which adds a nuance of "in certain cases depending on ~", suggesting that under some conditions a particular outcome may arise.