How do stunned and delay interact?

Character A takes the delay free action at the start of their turn, planning to act later. Afterwards, before Character A has acted, Big Bad Monster B inflicts stunned 3 upon Character A. Can Character A take the rest of their actions normally, as per delay? Would they still get 3 actions? Would they have to delay until their initiative spot, thus losing all the actions from the delay AND three actions on top of that?

What if it was slowed 3? Does that change anything? (This might be a different question, but stunned and slowed seemed similar enough that I kept them together).

I am aware of If a PC becomes stunned on their turn, do they lose the rest of their actions without losing any stunned value?, but that deals with stunned happening on Character A’s turn, not while they are delaying.