* refactor handling logic for embeds in app router * fix type checks * add test for withEmbedSsrAppDir * fix