reconstruct an array in JS [duplicate]

How can I reconstruct the array1 to the array2. Could you please help me using map/reduce.
Thank you very much for your helps!

const array1 = [
{Count: 35,
Items: [
{Id:1, Category:'Account', Count:10, class:'A'},
{Id:2, Category:'Account', Count:5, class:'B'},
{Id:3, Category:'Account', Count:20, class:'B'},
]},
{Count: 75,
Items: [
{Id:1, Category:'Logout', Count:25, class:'A'},
{Id:2, Category:'Logout', Count:30, class:'B'},
{Id:3, Category:'Logout', Count:20, class:'C'},
]},
{Count: 85,
Items: [
{Id:1, Category:'Login', Count:10, class:'A'},
{Id:2, Category:'Login', Count:25, class:'B'},
{Id:3, Category:'Login', Count:50, class:'C'},
]}
]

const array2 = [
{name: 'Account', data: [10,5,20]},
{name: 'Logout', data: [25,30,20]},
{name: 'Login', data: [10,25,50]},
]