| Commitments and Contingencies (Tables)
 | 12 Months Ended | 
| Dec. 31, 2018 | 
|---|
| Commitments and Contingencies Disclosure [Abstract] |  | 
| Future Minimum Payments Under Operating Leases | 
As of December 31, 2018, future minimum payments under non-cancelable operating leases, inventory purchase and other obligations are as follows:
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|   | Operating Leases |   | Inventory Purchase Obligations |   | Other Obligations |   | Total |  
|   | (in thousands) |   |   |  
| 2019 | $ | 9,365 | 
 |   | $ | 65,661 | 
 |   | $ | 8,386 | 
 |   | $ | 83,412 | 
 |  
| 2020 | 9,576 | 
 |   | — | 
 |   | 4,424 | 
 |   | 14,000 | 
 |  
| 2021 | 9,286 | 
 |   | — | 
 |   | 693 | 
 |   | 9,979 | 
 |  
| 2022 | 4,511 | 
 |   | — | 
 |   | 425 | 
 |   | 4,936 | 
 |  
| 2023 | 1,205 | 
 |   | — | 
 |   | 447 | 
 |   | 1,652 | 
 |  
| Thereafter | — | 
 |   | — | 
 |   | — | 
 |   | — | 
 |  
| Total minimum payments | $ | 33,943 | 
 |   | $ | 65,661 | 
 |   | $ | 14,375 | 
 |   | $ | 113,979 | 
 |  
As of December 31, 2018, future minimum rental income under non-cancelable subleases are as follows:
 
|  |  
|  |  |  |  |  |  
|   |   | Amount |  
|   |   | (in thousands) |  
| 2019 |   | $ | 3,566 | 
 |  
| 2020 |   | 4,036 | 
 |  
| 2021 |   | 4,057 | 
 |  
| 2022 |   | 782 | 
 |  
| 2023 |   | 291 | 
 |  
| Thereafter |   | — | 
 |  
| Total minimum rental income |   | $ | 12,732 | 
 |  | 
| Future Minimum Payments Under Other Obligations | 
As of December 31, 2018, future minimum payments under non-cancelable operating leases, inventory purchase and other obligations are as follows:
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|   | Operating Leases |   | Inventory Purchase Obligations |   | Other Obligations |   | Total |  
|   | (in thousands) |   |   |  
| 2019 | $ | 9,365 | 
 |   | $ | 65,661 | 
 |   | $ | 8,386 | 
 |   | $ | 83,412 | 
 |  
| 2020 | 9,576 | 
 |   | — | 
 |   | 4,424 | 
 |   | 14,000 | 
 |  
| 2021 | 9,286 | 
 |   | — | 
 |   | 693 | 
 |   | 9,979 | 
 |  
| 2022 | 4,511 | 
 |   | — | 
 |   | 425 | 
 |   | 4,936 | 
 |  
| 2023 | 1,205 | 
 |   | — | 
 |   | 447 | 
 |   | 1,652 | 
 |  
| Thereafter | — | 
 |   | — | 
 |   | — | 
 |   | — | 
 |  
| Total minimum payments | $ | 33,943 | 
 |   | $ | 65,661 | 
 |   | $ | 14,375 | 
 |   | $ | 113,979 | 
 |  | 
| Future Minimum Payments Under Inventory Purchase Obligations | 
As of December 31, 2018, future minimum payments under non-cancelable operating leases, inventory purchase and other obligations are as follows:
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|   | Operating Leases |   | Inventory Purchase Obligations |   | Other Obligations |   | Total |  
|   | (in thousands) |   |   |  
| 2019 | $ | 9,365 | 
 |   | $ | 65,661 | 
 |   | $ | 8,386 | 
 |   | $ | 83,412 | 
 |  
| 2020 | 9,576 | 
 |   | — | 
 |   | 4,424 | 
 |   | 14,000 | 
 |  
| 2021 | 9,286 | 
 |   | — | 
 |   | 693 | 
 |   | 9,979 | 
 |  
| 2022 | 4,511 | 
 |   | — | 
 |   | 425 | 
 |   | 4,936 | 
 |  
| 2023 | 1,205 | 
 |   | — | 
 |   | 447 | 
 |   | 1,652 | 
 |  
| Thereafter | — | 
 |   | — | 
 |   | — | 
 |   | — | 
 |  
| Total minimum payments | $ | 33,943 | 
 |   | $ | 65,661 | 
 |   | $ | 14,375 | 
 |   | $ | 113,979 | 
 |  |