Entity information:
Income Taxes

The provision for income taxes consists of the following (in thousands):
 
Year Ended December 31,
 
2017
 
2016
 
2015
Current provision:
 
 
 
 
 
Federal
$
(445
)
 
$
(55
)
 
$
682

State
137

 
135

 
211

Foreign
9,512

 
5,097

 
6,125

 
9,204

 
5,177

 
7,018

Deferred provision:
 
 
 
 
 
Federal
(5,934
)
 
(4,462
)
 

State
(886
)
 
(746
)
 

Foreign
(2,258
)
 
1,784

 
(1,604
)
 
(9,078
)
 
(3,424
)
 
(1,604
)
Provision for income taxes
$
126

 
$
1,753

 
$
5,414


 
The components of loss before provision for income taxes by U.S. and foreign jurisdictions were as follows (in thousands):
 
Year Ended December 31,
 
2017
 
2016
 
2015
United States
$
(80,636
)
 
$
(432,631
)
 
$
(150,593
)
Foreign
(68,368
)
 
(17,420
)
 
(42,419
)
Total
$
(149,004
)
 
$
(450,051
)
 
$
(193,012
)

 
The effective income tax rate differs from the federal statutory income tax rate applied to the loss before provision for income taxes due to the following (in thousands): 
 
Year Ended December 31,
 
2017
 
2016
 
2015
Tax computed at U.S. federal statutory rate
$
(50,661
)
 
$
(153,017
)
 
$
(65,624
)
State taxes, net of federal benefit
64

 
37

 
53

Tax rate differential for international subsidiaries
29,312

 
10,910

 
18,681

Stock-based compensation
(116,953
)
 
(27,133
)
 
13,597

Tax credits
(21,038
)
 
(16,452
)
 
(11,961
)
Other
7,337

 
7,850

 
2,865

Valuation allowance
152,065

 
179,558

 
47,803

Provision for income taxes
$
126

 
$
1,753

 
$
5,414



Significant components of our deferred tax assets are shown below (in thousands). A valuation allowance has been recognized to offset our deferred tax assets, as necessary, by the amount of any tax benefits that, based on evidence, are not expected to be realized.

 
December 31,
 
2017
 
2016
Deferred tax assets:
 
 
 
Net operating loss carryforwards
$
518,620

 
$
640,312

Accrued expenses
10,613

 
10,424

Credit carryforwards
75,879

 
50,559

Stock-based compensation
35,782

 
46,530

Note hedge
35,181

 
20,520

Other
14,771

 
13,733

Total deferred tax assets
690,846

 
782,078

Less valuation allowance
(614,177
)
 
(728,870
)
 
76,669

 
53,208

Deferred tax liabilities:
 
 
 
Depreciation and amortization
(20,708
)
 
(18,914
)
Convertible notes
(43,616
)
 
(23,605
)
Other
(1,759
)
 

Net deferred tax assets
$
10,586

 
$
10,689


 
On December 22, 2017, the 2017 Tax Cuts and Jobs Act (the Tax Act) was enacted into law and significantly changed how the U.S. imposes income tax on multinational corporations. Changes include, but are not limited to, a reduction of the corporate income tax rate from 35% to 21%, a transition tax on accumulated foreign earnings and a transition from a worldwide to a territorial tax system. We are required to recognize the effect of the Tax Act in the period of enactment, such as remeasuring our U.S. deferred tax assets and liabilities as well as reassessing the net realizability of our deferred tax assets and liabilities. The provisional amount related to the remeasurement of certain deferred tax assets and liabilities, based on the rates at which they are expected to reverse in the future, was $264.4 million and is offset by our valuation allowance. We have a cumulative deficit in foreign earnings. Accordingly, we estimated the transition tax did not have a material effect on our tax expense as of December 31, 2017.

In December 2017, the SEC staff issued Staff Accounting Bulletin No. 118, Income Tax Accounting Implications of the Tax Cuts and Jobs Act (SAB 118), which allows us to record provisional amounts during a measurement period not to extend more than one year beyond the Tax Act enactment date. Since the Tax Act was passed late in the fourth quarter of 2017, and ongoing guidance and accounting interpretation are expected over the next 12 months, we consider the accounting for deferred tax remeasurements, the impact of the transition of U.S. international taxation from a worldwide tax system to a territorial system and other provisions to be incomplete due to the forthcoming guidance and our ongoing analysis. We expect to complete our analysis within the measurement period in accordance with SAB 118.

As of December 31, 2017, we had U.S. federal net operating loss and federal tax credit carryforwards of approximately $2.1 billion and $56.6 million, respectively. The federal net operating loss carryforwards and federal tax credits will begin to expire in 2024 if not utilized. In addition, we had state net operating loss and state tax credit carryforwards of approximately $1.2 billion and $48.0 million, respectively. The state net operating loss will begin to expire in 2018 if not utilized, and the tax effected amount due to expire in 2018 is immaterial. State tax credits can be carried forward indefinitely. Utilization of our net operating loss and credit carryforwards may be subject to annual limitation due to the ownership change limitations provided by the Internal Revenue Code and similar state provisions. Such an annual limitation could result in the expiration of the net operating loss and tax credit carryforwards before utilization.
 
We maintain a full valuation allowance against our U.S. deferred tax assets as of December 31, 2017. We regularly assess the need for a valuation allowance against our deferred tax assets. In making that assessment, we consider both positive and negative evidence related to the likelihood of realization of the deferred tax assets to determine, based on the weight of available evidence, whether it is more likely than not that some or all of the deferred tax assets will not be realized. Due to cumulative losses over recent years and based on all available evidence, we have determined that it is more likely than not that net deferred tax assets in the United States will not be realized. We have determined that $10.6 million related to deferred tax assets in certain foreign jurisdictions are realizable since the foreign entities have cumulative income and expected future income. We remeasured the U.S. non-current assets and liabilities at the applicable tax rate of 21% in accordance with the Tax Act. The valuation allowance decreased $114.7 million during the year ended December 31, 2017. This change is primarily attributable to a decrease in the deferred tax balance of $264.4 million due to the reduction in the U.S. income tax rate, offset by increases in deferred tax assets primarily related to net operating losses. We will continue to assess the likelihood of realization of the deferred tax assets in each of the applicable jurisdictions in future periods and will adjust the valuation allowance accordingly.

Prior to the enactment of the Tax Act, we considered earnings from foreign operations to be indefinitely reinvested outside of the United States. We are currently evaluating whether to change our indefinite reinvestment assertion in light of the Tax Act and consider that assessment to be incomplete as permitted under guidance issued by the SEC. We expect to reach a final determination within the measurement period in accordance with SAB 118 as described above.

A reconciliation of the beginning and ending balance of total unrecognized tax benefits is as follows (in thousands):
 
Year Ended December 31,
 
2017
 
2016
 
2015
Balance, beginning period
$
18,440

 
$
11,737

 
$
9,158

Tax positions taken in prior period:
 
 
 
 
 
Gross increases
398

 
1,122

 
2

Gross decreases

 
(50
)
 
(1,017
)
Tax positions taken in current period:
 
 
 
 
 
Gross increases
8,810

 
5,673

 
3,768

Gross decreases

 

 
(73
)
Lapse of statute of limitations

 
(42
)
 
(101
)
Balance, end of period
$
27,648

 
$
18,440

 
$
11,737


 
As of December 31, 2017, we had gross unrecognized tax benefits of approximately $27.6 million, of which $4.8 million would impact the effective tax rate, if recognized. We recognize accrued interest and penalties related to unrecognized tax benefits as income tax expense. Accrued interest and penalties included in our liability related to unrecognized tax benefits were $0.5 million and $0.4 million at December 31, 2017 and 2016, respectively. The amount of unrecognized tax benefits could be reduced upon expiration of the applicable statutes of limitations. The potential reduction in unrecognized tax benefits during the next 12 months is not expected to be material. Interest and penalties accrued on these uncertain tax positions will be released upon the expiration of the statutes of limitations and these amounts are also not material.
 
We are subject to taxation in the United States and foreign jurisdictions. As of December 31, 2017, our tax years 2004 to 2016 remain subject to examination in most jurisdictions.
 
There are differing interpretations of tax laws and regulations, and as a result, disputes may arise with tax authorities involving issues of the timing and amount of deductions and allocations of income among various tax jurisdictions. We periodically evaluate our exposures associated with our tax filing positions. We believe that adequate amounts have been reserved for any adjustments that may ultimately result from these examinations, and we do not anticipate a significant impact to our gross unrecognized tax benefits within the next 12 months related to these years. Although the timing of the resolution, settlement, and closure of any audit is highly uncertain, it is reasonably possible that the balance of gross unrecognized tax benefits could significantly change in the next 12 months. However, given the number of years that remain subject to examination, we are unable to estimate the full range of possible adjustments to the balance of gross unrecognized tax benefits.