Income taxes - Assessing realizability of deferred tax assets (Details) - USD ($) $ in Thousands |
Dec. 31, 2018 |
Dec. 31, 2017 |
|---|---|---|
| Federal | ||
| Net operating loss carryforwards | ||
| The amount of gross unrealized net operating loss carryforwards | $ 124,637 | $ 82,461 |
| State | ||
| Net operating loss carryforwards | ||
| The amount of gross unrealized net operating loss carryforwards | 121,091 | 73,934 |
| Foreign | ||
| Net operating loss carryforwards | ||
| The amount of gross unrealized net operating loss carryforwards | $ 11,642 | $ 10,811 |