| FINANCIAL STATEMENT COMPONENTS - Consolidated Statements of Operations (Details) - USD ($) $ in Thousands | 12 Months Ended | ||
|---|---|---|---|
| Jun. 30, 2020 | Jun. 30, 2019 | Jun. 30, 2018 | |
| Other expense (income), net: | |||
| Interest income | $ (21,646) | $ (40,367) | $ (36,869) | 
| Foreign exchange (gains) losses, net | 4,236 | (322) | 708 | 
| Net realized losses (gains) on sale of investments | (297) | 1,294 | 209 | 
| Other | 20,385 | 7,933 | 5,470 | 
| Other expense (income), net | $ 2,678 | $ (31,462) | $ (30,482) | 
| X | ||||||||||
| 
- Definition Other Nonoperating Income (Expense), Miscellaneous No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before tax of foreign currency transaction realized and unrealized gain (loss) recognized in the income statement. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Amount before accretion (amortization) of purchase discount (premium) of interest income on nonoperating securities. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of income (expense) related to nonoperating activities, classified as other. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount of realized gain (loss) on investment. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 |