CONDENSED CONSOLIDATED STATEMENTS OF MEZZANIE EQUITY AND STOCKHOLDERS' EQUITY (DEFICIT) - USD ($) shares in Thousands, $ in Millions | Total | Series G Redeemable Convertible Preferred Stock | Redeemable Non-Controlling Interest | Redeemable Convertible Preferred Stock | Redeemable Convertible Preferred StockSeries G Redeemable Convertible Preferred Stock | Common Stock | Additional Paid-In Capital | Additional Paid-In CapitalSeries G Redeemable Convertible Preferred Stock | Accumulated Other Comprehensive Loss | Accumulated Deficit |
Mezzanine Equity, Amount at Dec. 31, 2017 | | | $ 0 | $ 12,210 | | | | | | |
Mezzanine Equity, Shares at Dec. 31, 2017 | | | | 863,305 | | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | |
Issuance of Series G redeemable convertible preferred stock, net of issuance costs | | | | $ 1,500 | | | | | | |
Issuance of Series G redeemable convertible preferred stock, net of issuance costs (in shares) | | | | 30,755 | | | | | | |
Mezzanine Equity, Amount at Mar. 31, 2018 | | | 0 | $ 13,710 | | | | | | |
Mezzanine Equity, Shares at Mar. 31, 2018 | | | | 894,060 | | | | | | |
Stockholders' equity, beginning balance at Dec. 31, 2017 | $ (8,557) | | | | | $ 0 | $ 320 | | $ (3) | $ (8,874) |
Shares, outstanding at Dec. 31, 2017 | | | | | | 443,394 | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | |
Exercise of common stock warrants | 1 | | | | | $ 0 | 1 | | | |
Exercise of common stock warrants (in shares) | | | | | | 31 | | | | |
Repurchase of outstanding shares | 5 | | | | | $ 0 | | | | 5 |
Repurchase of outstanding stock (in shares) | | | | | | (1,707) | | | | |
Issuance of common stock from stock option exercise and restricted stock awards | 15 | | | | | $ 0 | 15 | | | |
Issuance of common stock from stock option exercise and restricted stock awards (in shares) | | | | | | 7,689 | | | | |
Repurchase of unvested early-exercised stock options | 0 | | | | | $ 0 | | | | |
Repurchase of unvested early-exercised stock options (in shares) | | | | | | (1) | | | | |
Reclassification of early-exercised stock options from liability, net | 1 | | | | | | 1 | | | |
Stock-based compensation | 17 | | | | | | 17 | | | |
Issuance and repayment of employee loans collateralized by outstanding common stock | (1) | | | | | | | | | (1) |
Issuance of common stock as consideration for investment and acquisition | 52 | | | | | $ 0 | 52 | | | |
Issuance of common stock as consideration for investment and acquisition (in shares) | | | | | | 1,528 | | | | |
Foreign currency translation adjustment | (7) | | | | | | | | (7) | |
Net income (loss) | 3,748 | | | | | | | | | 3,748 |
Stockholders' equity, ending balance at Mar. 31, 2018 | (4,726) | | | | | $ 0 | 406 | | (10) | (5,122) |
Shares, outstanding at Mar. 31, 2018 | | | | | | 450,934 | | | | |
Mezzanine Equity, Amount at Dec. 31, 2017 | | | 0 | $ 12,210 | | | | | | |
Mezzanine Equity, Shares at Dec. 31, 2017 | | | | 863,305 | | | | | | |
Mezzanine Equity, Amount at Jun. 30, 2018 | | | 0 | $ 13,673 | | | | | | |
Mezzanine Equity, Shares at Jun. 30, 2018 | | | | 893,301 | | | | | | |
Stockholders' equity, beginning balance at Dec. 31, 2017 | (8,557) | | | | | $ 0 | 320 | | (3) | (8,874) |
Shares, outstanding at Dec. 31, 2017 | | | | | | 443,394 | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | |
Unrealized gain (loss) on available-for-sale securities | 39 | | | | | | | | | |
Foreign currency translation adjustment | (65) | | | | | | | | | |
Net income (loss) | 2,870 | | | | | | | | | |
Stockholders' equity, ending balance at Jun. 30, 2018 | (5,508) | | | | | $ 0 | 514 | | (29) | (5,993) |
Shares, outstanding at Jun. 30, 2018 | | | | | | 453,252 | | | | |
Mezzanine Equity, Amount at Mar. 31, 2018 | | | 0 | $ 13,710 | | | | | | |
Mezzanine Equity, Shares at Mar. 31, 2018 | | | | 894,060 | | | | | | |
Mezzanine Equity, Amount at Jun. 30, 2018 | | | 0 | $ 13,673 | | | | | | |
Mezzanine Equity, Shares at Jun. 30, 2018 | | | | 893,301 | | | | | | |
Stockholders' equity, beginning balance at Mar. 31, 2018 | (4,726) | | | | | $ 0 | 406 | | (10) | (5,122) |
Shares, outstanding at Mar. 31, 2018 | | | | | | 450,934 | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | |
Repurchase of outstanding shares | 7 | $ 4 | | $ 0 | $ (37) | $ 0 | | $ 4 | | 7 |
Repurchase of outstanding stock (in shares) | | | | (5) | (754) | (287) | | | | |
Exercise of stock options | 0 | | | | | $ 0 | | | | |
Exercise of stock options (in shares) | | | | | | 129 | | | | |
Repurchase of unvested early-exercised stock options | 0 | | | | | $ 0 | | | | |
Repurchase of unvested early-exercised stock options (in shares) | | | | | | (129) | | | | |
Reclassification of early-exercised stock options from liability, net | 1 | | | | | | 1 | | | |
Stock-based compensation | 11 | | | | | | 11 | | | |
Issuance and repayment of employee loans collateralized by outstanding common stock | (1) | | | | | | (1) | | | |
Unrealized gain (loss) on available-for-sale securities | 39 | | | | | | | | 39 | |
Issuance of common stock as consideration for investment and acquisition | 93 | | | | | $ 0 | 93 | | | |
Issuance of common stock as consideration for investment and acquisition (in shares) | | | | | | 2,605 | | | | |
Foreign currency translation adjustment | (58) | | | | | | | | (58) | |
Net income (loss) | (878) | | | | | | | | | (878) |
Stockholders' equity, ending balance at Jun. 30, 2018 | $ (5,508) | | | | | $ 0 | 514 | | (29) | (5,993) |
Shares, outstanding at Jun. 30, 2018 | | | | | | 453,252 | | | | |
Mezzanine Equity, Amount at Dec. 31, 2018 | | | 0 | $ 14,177 | | | | | | |
Mezzanine Equity, Shares at Dec. 31, 2018 | 903,607 | | | 903,607 | | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | |
Mezzanine equity, net loss | | | (4) | | | | | | | |
Mezzanine Equity, Amount at Mar. 31, 2019 | | | (4) | $ 14,224 | | | | | | |
Mezzanine Equity, Shares at Mar. 31, 2019 | | | | 904,530 | | | | | | |
Stockholders' equity, beginning balance at Dec. 31, 2018 | $ (7,385) | | | | | $ 0 | 668 | | (188) | (7,865) |
Shares, outstanding at Dec. 31, 2018 | 457,189 | | | | | 457,189 | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | |
Exercise of common stock warrants | | | | $ 45 | | | | | | |
Exercise of common stock warrants (in shares) | | | | 923 | | | | | | |
Lapsing of repurchase option related to Series E redeemable convertible preferred stock issued to a non-employee service provider | | | | $ 2 | | | | | | |
Lapsing of repurchase option related to Series E redeemable convertible preferred stock issued to a non-employee service provider (in shares) | | | | 0 | | | | | | |
Repurchase of outstanding shares | $ 0 | | | | | $ 0 | | | | |
Repurchase of outstanding stock (in shares) | | | | | | (1) | | | | |
Exercise of stock options | 4 | | | | | $ 0 | 4 | | | |
Exercise of stock options (in shares) | | | | | | 677 | | | | |
Repurchase of unvested early-exercised stock options | 0 | | | | | $ 0 | | | | |
Repurchase of unvested early-exercised stock options (in shares) | | | | | | (32) | | | | |
Stock-based compensation | 10 | | | | | | 10 | | | |
Unrealized gain (loss) on available-for-sale securities | (4) | | | | | | | | (4) | |
Foreign currency translation adjustment | (54) | | | | | | | | (54) | |
Net income (loss) | (1,012) | | | | | | | | | (1,012) |
Stockholders' equity, ending balance at Mar. 31, 2019 | $ (8,432) | | | | | $ 0 | 682 | | (246) | (8,868) |
Shares, outstanding at Mar. 31, 2019 | | | | | | 457,833 | | | | |
Mezzanine Equity, Amount at Dec. 31, 2018 | | | 0 | $ 14,177 | | | | | | |
Mezzanine Equity, Shares at Dec. 31, 2018 | 903,607 | | | 903,607 | | | | | | |
Mezzanine Equity, Amount at Jun. 30, 2019 | | | (14) | $ 0 | | | | | | |
Mezzanine Equity, Shares at Jun. 30, 2019 | 0 | | | 0 | | | | | | |
Stockholders' equity, beginning balance at Dec. 31, 2018 | $ (7,385) | | | | | $ 0 | 668 | | (188) | (7,865) |
Shares, outstanding at Dec. 31, 2018 | 457,189 | | | | | 457,189 | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | |
Unrealized gain (loss) on available-for-sale securities | $ 4 | | | | | | | | | |
Foreign currency translation adjustment | 17 | | | | | | | | | |
Net income (loss) | (6,248) | | | | | | | | | |
Stockholders' equity, ending balance at Jun. 30, 2019 | $ 15,922 | | | | | $ 0 | 30,193 | | (167) | (14,104) |
Shares, outstanding at Jun. 30, 2019 | 1,697,614 | | | | | 1,697,614 | | | | |
Mezzanine Equity, Amount at Mar. 31, 2019 | | | (4) | $ 14,224 | | | | | | |
Mezzanine Equity, Shares at Mar. 31, 2019 | | | | 904,530 | | | | | | |
Increase (Decrease) in Temporary Equity [Roll Forward] | | | | | | | | | | |
Mezzanine equity, net loss | | | (10) | | | | | | | |
Mezzanine Equity, Amount at Jun. 30, 2019 | | | $ (14) | $ 0 | | | | | | |
Mezzanine Equity, Shares at Jun. 30, 2019 | 0 | | | 0 | | | | | | |
Stockholders' equity, beginning balance at Mar. 31, 2019 | $ (8,432) | | | | | $ 0 | 682 | | (246) | (8,868) |
Shares, outstanding at Mar. 31, 2019 | | | | | | 457,833 | | | | |
Increase (Decrease) in Stockholders' Equity [Roll Forward] | | | | | | | | | | |
Lapsing of repurchase option related to Series E redeemable convertible preferred stock issued to a non-employee service provider | 3 | | | | | | 3 | | | |
Conversion of warrant to common stock in connection with initial public offering (in shares) | | | | | | 150 | | | | |
Conversion of warrant to common stock in connection with initial public offering | 6 | | | | | $ 0 | 6 | | | |
Conversion of convertible notes to common stock in connection with initial public offering | 4,229 | | | | | 0 | 4,229 | | | |
Exercise of stock options | 1 | | | | | $ 0 | 1 | | | |
Exercise of stock options (in shares) | | | | | | 501 | | | | |
Stock-based compensation | 3,943 | | | | | | 3,943 | | | |
Unrealized gain (loss) on available-for-sale securities | 8 | | | | | | | | 8 | |
Foreign currency translation adjustment | 71 | | | | | | | | 71 | |
Issuance of common stock in connection with initial public offering, net of offering costs | 7,973 | | | | | $ 0 | 7,973 | | | |
Issuance of common stock in connection with initial public offering, net of offering cost (in shares) | | | | | | 180,000 | | | | |
Conversion of redeemable convertible preferred stock to common stock in connection with initial public offering | 14,224 | | | $ (14,224) | | $ 0 | 14,224 | | | |
Conversion of redeemable convertible preferred stock to common stock in connection with initial public offering (in shares) | | | | (904,530) | | 904,530 | | | | |
Issuance of common stock related to private placement | 500 | | | | | $ 0 | 500 | | | |
Issuance of common stock related to private placement (in shares) | | | | | | 11,111 | | | | |
Issuance of common stock for settlement of RSUs | 0 | | | | | $ 0 | | | | |
Issuance of common stock for settlement of restricted stock units (RSUs) (in shares) | | | | | | 80,015 | | | | |
Shares withheld related to net share settlement | (1,368) | | | | | $ 0 | (1,368) | | | |
Shares withheld related to net share settlement (in shares) | | | | | | (30,504) | | | | |
Net income (loss) | (5,236) | | | | | | | | | (5,236) |
Stockholders' equity, ending balance at Jun. 30, 2019 | $ 15,922 | | | | | $ 0 | $ 30,193 | | $ (167) | $ (14,104) |
Shares, outstanding at Jun. 30, 2019 | 1,697,614 | | | | | 1,697,614 | | | | |