Despite Iran’s military and leadership being battered badly, Iran is likely willing to outlast the US. Many Iranians, even one’s who do not like the regime, may see the US and Israel as trying to destroy Iran, and may support fighting and not giving in to Trump’s demands. Iran has aggressive goals of its own–to convince the gulf states that the US isn’t there to protect them, but to act aggressively toward Iran, and to reject US protection in the future.
Iran’s regime is fighting for its life. The US is fighting for potential security benefits. The US is likely to give up first even if its military is winning the war. Iran will likely get nukes now, because of this attack.