California’s U.S. Senate race is a classic example of an “unintended consequence.”

When California voters passed the 2010 ballot measure that established the state’s “top-two” primary system, they were promised the chance to elect moderate Republican and Democratic candidates.

The theory was that regardless of their political party affiliations, to get enough votes to land in one of the “top-two” primary spots and progress to the general election, candidates must appeal to all California voters, not just their parties’ hard-core bases. The “top-two” system’s goal was to shed the extremes in favor of the middle.

While that might be happening, what also has occurred is that two candidates from the same party have ended up competing against each other in some really nasty general election local races. The November campaign to fill retiring Sen. Barbara Boxer’s Senate seat is the first time one of these intraparty battles is being waged in a statewide race.

The “unintended consequence” is that party bosses, rather than California voters, may decide the outcome of the Senate race.

Democrat Kamala Harris, the current state attorney general and former San Francisco district attorney, faces veteran Democratic Congresswoman Loretta Sanchez of Orange County.

In February, Democratic Party bosses voted to endorse Harris. That has meant that the state party is throwing its money and considerable resources to Harris, leaving Sanchez empty-handed.

But don’t count Sanchez out. She has spunk and guts. Recall her scrappy 1996 campaign to unseated long-time flame-throwing conservative Congressman “B-1” Bob Dornan. And during her nearly 20 years in Congress, she has bucked the liberal wing of her party with her business-friendly, moderate votes. As a member of the “Blue Dog Coalition,” she often has reached across the aisle to work with Republicans.

While these are qualities voters might find appealing, they no doubt are why the Democratic Party elite are shunning her and trying to ensure the election of the more “progressive” Harris. In response, Sanchez is trying to cobble together a coalition of moderate and conservative Latino voters, and Republicans.

Although Sanchez has been endorsed by Republican North San Diego County Congressman Darrell Issa, former Congressman Buck McKeon, R-Santa Clarita, former Republican Los Angeles Mayor Richard Riordan, and her libertarian-leaning hometown newspaper, The Orange County Register, Republican lawmakers generally are sitting out the race — pouting because their party has no candidate competing.

But many of her Republican congressional colleagues concede she is the better candidate. Rep. Doug LaMalfa, R-Richvale, recently told The Los Angeles Times that Sanchez would be “infinitely easier” for Republicans to work with. He said her views about agriculture and water access demonstrate she understands rural issues.

In an attempt to rile up Democrats and Latinos by tying Sanchez to Republican presidential candidate Donald Trump, Harris’ campaign calls these lukewarm supporters “Trump-esque” Republicans.

But Trump, who brags about contributing to politicians in exchange for favorable treatment, also is tainting Harris’ campaign. He contributed to Harris’ past attorney general campaigns. And Sanchez is quick to note that Attorney General Harris’ response to consumer fraud complaints involving Trump University was lacking.

Meanwhile, voters seem to have been left on the sidelines of this intraparty fight, with party leaders expecting them to just go along with their hand-picked choice for Senate.

The Californian hopes they won’t. California’s next senator should have political courage. She should be willing to work with people in both political parties. She should have a business-friendly, moderate voting record. And she should have demonstrated that she gives a hoot about the entire state, including rural counties, like Kern.

She should be Loretta Sanchez.

Outbrain