MERRIMACK, N.H. — Brookstone, the retailer of gadgets such as virtual keyboards and personal drones, sought bankruptcy protection to pursue a sale to Spencer Spirit Holdings as online competitors cut into its business and consumers spend less on non-essentials.

Brookstone, which was taken private in 2005 by a group including Singapore’s Temasek Holdings Pte, listed debt and assets of as much as $500 million each in Chapter 11 documents filed Thursday in U.S. Bankruptcy Court in Wilmington, Del.

The Merrimack, N.H.-based company said in a statement before seeking court protection that it was negotiating a sale with novelty gift retailer Spencer that would keep Brookstone operating and retain current employees.

Brookstone, known for products such as $4,600 massage chairs and $3,000 “Pac Man” arcade systems, was plagued by the same afflictions that sank Sharper Image in 2008.

Online merchants such as Amazon.com now offer products that once made the two companies the leaders in the hard-to-find item market, Robert Del Genio, managing member at turnaround and restructuring firm CDG Group, said in a phone interview before the bankruptcy filing.

“Sharper Image and Brookstone were places that you went to for unique products. Now you can find it on the Web,” said Del Genio, whose firm managed Sharper Image in its bankruptcy, which ended in liquidation. “That was their niche.”

Brookstone’s sales fell 7.3 percent to $88.3 million in the quarter ended Sept. 28 from the same period a year earlier, resulting in a net loss of $18.1 million, the company said in a Nov. 5 statement.

As online competition increased, the recession made consumers more pragmatic, according to Del Genio.

Brookstone customers aren’t ultra-rich and, while the chain offered unique products, they were discretionary, he said. “People are more conscious about how they spend their money.”

In January, the company hired financial adviser Jefferies Group and law firm K&L Gates to help restructure its debt, two people with knowledge of the situation said.

Brookstone was taken private nine years ago in a $422 million deal backed by Temasek, Singapore’s state-owned investment company, along with OSIM International and JW Childs Associates. Singapore-based OSIM, Asia’s biggest maker of massage chairs, sells its products through Brookstone stores.

Brookstone started as a catalog business in 1965, offering “hard-to-find tools” before opening its first store in 1973 in Peterborough, N.H., according to its website. It has 240 locations in the U.S. and Puerto Rico, mostly in shopping malls and airports.

Spencer operates 644 stores in the U.S. and Canada selling novelty and pop-culture gifts. It also runs more than 1,000 seasonal Halloween stores under the Spirit brand.