;(function () {
	var map = { wps: 'word', word: 'word', et: 'et' }

	function getCustomerData(type, field) {
		var maptype = map[type]
		if (!window.hasOwnProperty('setting')) return null
		if (field === undefined) return window.setting[maptype]
		else
			return !!window.setting[maptype] ? window.setting[maptype][field] : null
	}
	function getCustomerTitle(type) {
		return getCustomerData(type, 'title')
	}

	function getCustomerDir(type) {
		return getCustomerData(type, 'tmpdir')
	}

	function getCustomerHeart(type) {
		return getCustomerData(type, 'heart')
	}

	window.OACustomer = Object.assign({}, window.OACustomer, {
		getCustomerTitle,
		getCustomerDir,
		getCustomerHeart,
		getCustomerData,
	})
})()
