A federal appeals court on Wednesday upheld most of the sweeping gun restrictions enacted in New Jersey since a 2022 Supreme Court decision prompted the state to ban firearms in most public spaces.