Typhoon Lupit weakens to extratropical cyclone over western