I think it will end up being Miami. They need him the most, even if they don't have the most.
It'll be Miami unless another team offers more than Miami can. It'll be hard negotiating, but in the end, Miami will make the best offer they have to until they don't have anything else to throw in but Bam... and they won't offer Bam.