Manny Machado is a top trade target this season. (Evan Habeeb/USA Today Sports)

Even before the baseball season began, Orioles shortstop Manny Machado was a top trade target MLB front offices knew would command a high price.

And then Machado did what he does and put up all-star numbers at the plate across the first half of the season — he’s batting .309 with 21 home runs, 60 RBIs and 41 walks — while being the same stalwart defensive presence at short that he was for years at third base.

And yet, Baltimore is not a good ballclub, and the team likely cannot afford to sign Machado this offseason while competing with the Yankees, Dodgers, Phillies and Cubs, big market teams all said to be in the Machado sweepstakes. The Brewers, Diamondbacks, Indians and Braves also have made known their desires to potentially trade for Machado.

It leaves the Orioles, and the coming All-Star Game in a weird spot. Machado would be a “rental” if traded, because he’s an unrestricted free agent at the end of the season and will likely follow the best contract offer. Teams would only get him for 70-some games at best. That means Baltimore has more opportunity to get the best deal if it trades Machado, a move which could come before the All-Star Game, sooner rather than later.

But Orioles ownership has expressed an interest in shipping Machado to the National League, so Baltimore wouldn’t have to face him as frequently. If such a move were to happen before the All-Star Game, for which Machado was elected by fans as the starting American League shortstop, it would alter the game’s lineups and could leave Baltimore without representation in an exhibition being played within its media rights territory.

If Machado is traded to another American League team before the game, he’d wear the jersey of that team, not Baltimore’s.

There is no precedent in MLB’s 88 previous All-Star Games of a player selected by fans switching leagues this soon before the Midsummer Classic.

Major League Baseball does not have a policy for such a scenario, but the nearest example is pitcher Jeff Samardzija’s move from the Cubs to the Athletics in 2014. The right-hander was introduced as a National League all-star but wore a generic All-Star Game uniform and cap and was not eligible to appear in the game.

Carlos Beltran in 2004 was traded from the Royals to the Astros when Houston was still in the National League, but the transaction happened a week before the All-Star Game and Beltran played for the National League. Baseball officials then allowed Kansas City to send another player to the game to replace Beltran.

Each team is entitled to representation at the game, though some teams periodically go without representation because of injuries. If Machado were to be traded, MLB would likely treat the Orioles as a team whose all-star is injured.

Read more from Post Sports

For McLean’s Lauren Shehadi, covering the All-Star Game in D.C. is a ‘full-circle moment’

Cristiano Ronaldo will leave Real Madrid for Juventus

Kobe Bryant ending retirement to play with LeBron James would be ‘dope,’ says Matt Barnes

Ex-Detroit Lions player Brandon Pettigrew arrested after allegedly punching police officer

The most bonkers soccer play of the year didn’t happen at the World Cup

Jay Cutler steals every scene in Kristin Cavallari’s new reality TV show