Stock-Based Compensation (Tables)
   | 
12 Months Ended | 
Dec. 31, 2023  | 
| Share-Based Payment Arrangement [Abstract] | 
 
 | 
| Schedule of stock-based compensation expense of consolidated statements | 
Stock-based compensation expense is included in the following line items in the accompanying consolidated statements of operations for the years ended:
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
 | 
December 31, | 
 
| (in thousands) | 
 | 
2023 | 
 | 
2022 | 
 | 
2021 | 
 
| Costs of goods sold | 
 | 
$ | 
796  | 
 | 
 | 
$ | 
215  | 
 | 
 | 
$ | 
157  | 
 | 
 
| Sales and marketing | 
 | 
2,982  | 
 | 
 | 
2,341  | 
 | 
 | 
2,905  | 
 | 
 
| Research and development | 
 | 
3,875  | 
 | 
 | 
2,640  | 
 | 
 | 
1,923  | 
 | 
 
| General and administrative | 
 | 
6,764  | 
 | 
 | 
10,395  | 
 | 
 | 
5,934  | 
 | 
 
| Total stock-based compensation expense | 
 | 
$ | 
14,418  | 
 | 
 | 
$ | 
15,591  | 
 | 
 | 
$ | 
10,919  | 
 | 
 
 
 
 | 
| Schedule of weighted-average assumptions for options granted | 
 The following weighted-average assumptions were used in the calculation of fair value for stock options granted for the following periods: 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
 | 
 | 
Year Ended December 31, | 
 
 | 
 | 
2023 | 
 | 
2022 | 
 | 
2021 | 
 
| Expected term (in years) | 
 | 
5.40 | 
 | 
6.01 | 
 | 
5.88 | 
 
| Expected volatility | 
 | 
59.32  | 
% | 
 | 
61.17  | 
% | 
 | 
58.38  | 
% | 
 
| Risk free interest rate | 
 | 
3.52  | 
% | 
 | 
2.31  | 
% | 
 | 
1.02  | 
% | 
 
| Expected dividends | 
 | 
—  | 
% | 
 | 
—  | 
% | 
 | 
—  | 
% | 
 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
  
The following are the weighted average assumptions used in the valuation of ESPP options for the years ended December 31: 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
 | 
 | 
December 31, | 
 
 | 
 | 
 | 
 
 | 
 | 
2023 | 
 | 
2022 | 
 | 
2021 | 
 
| Expected term (in years) | 
 | 
0.5 | 
 | 
0.5 | 
 | 
0.5 | 
 
| Expected volatility | 
 | 
53.6  | 
% | 
 | 
66.5  | 
% | 
 | 
48.0  | 
% | 
 
| Risk-free interest rate | 
 | 
5.1  | 
% | 
 | 
1.1  | 
% | 
 | 
0.1  | 
% | 
 
| Expected dividends | 
 | 
—  | 
% | 
 | 
—  | 
% | 
 | 
—  | 
% | 
 
  
 | 
| Schedule of stock option activity | 
 The following table summarizes the Company's stock option activity for the year ended December 31, 2023: 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
 | 
Options | 
 | 
Weighted Average Exercise Price | 
 | 
Weighted Average Remaining Contractual Life (Years) | 
 | 
Aggregate Intrinsic Value              (in thousands) | 
 
| Outstanding at December 31, 2022 | 
3,894,856  | 
 | 
 | 
$ | 
14.38  | 
 | 
 | 
6.78 | 
 | 
$ | 
2,783  | 
 | 
 
Granted (1)
  | 
1,393,464  | 
 | 
 | 
$ | 
7.88  | 
 | 
 | 
 | 
 | 
 | 
 
| Forfeited | 
(740,319) | 
 | 
 | 
$ | 
13.09  | 
 | 
 | 
 | 
 | 
 | 
 
| Exercised | 
(175,758) | 
 | 
 | 
$ | 
5.94  | 
 | 
 | 
 | 
 | 
 | 
 
| Outstanding at December 31, 2023 | 
4,372,243  | 
 | 
 | 
$ | 
12.87  | 
 | 
 | 
6.43 | 
 | 
$ | 
87  | 
 | 
 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
| Exercisable at December 31, 2023 | 
2,281,681  | 
 | 
 | 
$ | 
16.33  | 
 | 
 | 
4.26 | 
 | 
$ | 
0  | 
 | 
 
  
(1) Options granted include 215,800 inducement shares. in accordance with Nasdaq Listing Rule 5635(c)(4).
 | 
| Schedule of stock unit activity | 
 The following table summarizes the activity for restricted stock units for the indicated periods: 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
 | 
Outstanding Restricted Stock Units | 
 
 | 
Stock Units | 
 | 
Weighted Average Fair Value at Date of Grant per Share | 
 | 
Weighted Average Remaining Vesting Life (Years) | 
 | 
Aggregate Intrinsic Value (in thousands)  | 
 
| Unvested December 31, 2022 | 
1,861,106  | 
 | 
 | 
$ | 
11.13  | 
 | 
 | 
1.60 | 
 | 
$ | 
18,574  | 
 | 
 
Granted (1)
  | 
1,359,500  | 
 | 
 | 
$ | 
8.10  | 
 | 
 | 
 | 
 | 
 | 
 
| Released | 
(324,731) | 
 | 
 | 
$ | 
16.23  | 
 | 
 | 
 | 
 | 
 | 
 
| Forfeited | 
(560,645) | 
 | 
 | 
$ | 
9.70  | 
 | 
 | 
 | 
 | 
 | 
 
| Unvested December 31, 2023 | 
2,335,230  | 
 | 
 | 
$ | 
9.00  | 
 | 
 | 
1.39 | 
 | 
$ | 
15,950  | 
 | 
 
  
(1) RSU granted include 112,500 inducements shares. in accordance with Nasdaq Listing Rule 5635(c)(4). 
 
The following table summarizes the activity for performance stock units for the indicated periods: 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 
 | 
Outstanding Performance Stock Units | 
 
 | 
Stock Units | 
 | 
Weighted Average Fair Value at Date of Grant per Share | 
 | 
Weighted Average Remaining Vesting Life (Years) | 
 | 
Aggregate Intrinsic Value (in thousands)  | 
 
| Unvested December 31, 2022 | 
1,112,031  | 
 | 
 | 
$ | 
15.90  | 
 | 
 | 
1.86 | 
 | 
$ | 
11,098  | 
 | 
 
| Granted | 
747,870  | 
 | 
 | 
8.29  | 
 | 
 | 
 | 
 | 
 | 
 
| Released | 
(41,833) | 
 | 
 | 
12.00  | 
 | 
 | 
 | 
 | 
 | 
 
| Forfeited | 
(560,656) | 
 | 
 | 
15.46  | 
 | 
 | 
 | 
 | 
 | 
 
| Unvested December 31, 2023 | 
1,257,412  | 
 | 
 | 
$ | 
11.69  | 
 | 
 | 
1.76 | 
 | 
$ | 
8,588  | 
 | 
 
  
 |