Generate link to Manage Checked Out Files from Document Library URL on SharePoint Online

We have some users we have given access to override check-in on document libraries within SharePoint online, but don’t want them to be able to change the configuration of the libraries. Because of this they cannot access the library settings menu, as that requires “Manage Lists” to be included in their permissions, but they can access and use the “Manage files which have no checked in version” if sent a direct link to it. What I’d like is a simple piece of Javascript I could put into a webpart on a single site for these users, that would:

  1. Let them enter the URL of a document library in their site collection(s) in a field
  2. Get the ListID of that library
  3. Generate a link to (<‘SPOL_SITE_URL’>/_layouts/15/ManageCheckedOutFiles.aspx?List=<‘LISTID’>), where SPOL Site URL is extracted from the List url in 1.
  4. Attach the link from 4 to a button captioned “Manage Files Never Checked In” if the ID is known, not how to find the id of the list based on a url.

If you can make 2 a function that takes the URL as a parameter, and returns the ListID that would be great as I can then reuse it in other code. So far all my searches I’ve tried have returned the opposite of getting List URLs when the ID is know, or getting items in the list based on their ID.

Thanks in advance