| EQUITY, LONG-TERM INCENTIVE COMPENSATION PLANS AND NON-CONTROLLING INTEREST - Share-based Compensation Expense (Details) - USD ($) $ in Thousands | 3 Months Ended | 6 Months Ended | |||
|---|---|---|---|---|---|
| Dec. 31, 2021 | Dec. 31, 2020 | Dec. 31, 2021 | Dec. 31, 2020 | Jun. 30, 2021 | |
| Stock-based compensation expense | |||||
| Stock-based compensation expense | $ 27,766 | $ 26,827 | $ 52,982 | $ 53,819 | |
| Stock-based compensation capitalized as inventory | 7,400 | 7,400 | $ 8,000 | ||
| Costs of revenues | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | 4,094 | 4,104 | 7,932 | 7,771 | |
| R&D | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | 4,901 | 5,225 | 9,595 | 10,696 | |
| SG&A | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | $ 18,771 | $ 17,498 | $ 35,455 | $ 35,352 | |
| X | ||||||||||
| 
- Definition Stock Based Compensation Capitalized As Inventory No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of expense for award under share-based payment arrangement. Excludes amount capitalized. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Line items represent financial concepts included in a table. These concepts are used to disclose reportable information associated with domain members defined in one or many axes to the table. No definition available. 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 |