mw.widgets.CategorySelector can have duplicate categories entered, which is not supposed to happen.
The problem is that we're checking for duplicates before canonicalizing the title. So, if there's already "Category:Foo" in the input, and the user inputs "foo", "Category:Foo" and "Category:foo" are not equal; "Category:foo" is added and canonicalized to "Category:Foo"; and now we have it twice.