var PAYMENT_CHANNEL_LIST_CONST = {
	SELECTED_CHANNEL_ID: 'selectedChannelId',
	SELECTED_OPTION_INFO: 'selectedOptionInfo',
	SELECTED_CHANNEL_ITEM_ID: 'selectedChannelItemId',
	SELECTED_EXTERNAL_CHANNEL_ITEM_ID: 'selectedExternalChannelItemId',
	SELECTED_CHANNEL_CATEGORY: 'selectedChannelCategory',
	SELECTED_CHANNEL_COMPONENT: 'selectedChannelComponent',

	LAST_TAPPED_CHANNEL_ID: 'lastTappedChannelId',

	IS_DURING_CHECKOUT: 'isDuringCheckout',
	CHECKOUT_ID: 'checkoutId',
	SAVE_KEY: 'saveKey'
};

var Constants = {
	OfflineDisabledReasons: {
		1: i18n.t('msg_offline_payment_disabled_singular'),
		2: i18n.t('msg_promo_code_no_offline_payment'),
		3: i18n.t('msg_promo_offline_no_multiple_checkouts'),
		4: i18n.t('msg_cod_not_all_supported_logistic'),
		5: i18n.t('msg_order_total_exceed_cod_maximum'),
		6: i18n.t('msg_payment_channel_banned_category'),
		7: i18n.t('msg_total_price_exceed_channel_max'),
		8: i18n.t('msg_total_price_exceed_credit_card_max'),
		9: i18n.t('msg_total_price_below_min_amount'),
		10: i18n.t('msg_buyer_address_not_support_cod'),
		11: i18n.t('msg_payment_option_maintenance'),
		12: i18n.t('msg_cod_temporarily_suspended'),
		13: i18n.t('msg_overseas_products_credit_card_only'),

	},

	PaymentChannelCategory: {
		NONE: 0,
		CYBERSOURCE: 1,
		BANK_TRANSFER: 2,
		OFFLINE_PAYMENT: 3,
		IPAY: 4,
		FREE: 5,
		COD: 6,
		ESUN: 7,
		BILL_PAYMENT: 8,
		AIRPAY_CC: 18,
		SHOPEE_WALLET: 20
	},

	BankTransferMethodKey: {
		NORMAL: 'normal',
		ATM: 'atm_payment',
		ATM_MOBILE: 'mobile_atm_payment',
		ATM_INTERNET: 'internet_atm_payment',
		I_BANKING: 'i_banking_payment'
	},

	CheckAddressShippingChannels: [30001],

	AddressShippingFeeChannels: [30001],

	LogisticChannelCategory: {
		NON_INTEGRATED: 0,
		KERRY: 1,
		HEIMAO: 2,
		SHOPEE_VN: 3,
		JNE: 4,
		RPX: 5,
		NINJAVAN: 6,
		SEVEN: 7,
		FAMILYMART: 8,
		AFTERSHIP: 0,
		GDEX: 10,
		LBC: 12,
		THAI_POST: 13,
		VN_GHN: 14,
		VN_VIETTEL_POST: 15,
		THAI_POST_P2: 16,
		LAST_MILE: 20000000000
	},

	LogisticAddressType: {
		TW_711_BUYER: 1,
		TW_FAMILYMART_BUYER: 2,
		TW_HILIFE_BUYER: 5,
		TW_OKMART_BUYER: 7,
		TW_FAMILYMARTCOLDCHAIN_BUYER: 15,
		TW_SPX_BUYER: 3003,
		TW_SPX_ECO_FRIENDLY_BUYER: 3033,
		TW_SPX_FRESH_BUYER: 3022,
	},

	LogisticChannelId: {
		TW_SPX_ECO_FRIENDLY_BUYER: 30033,
		TW_SPX_FRESH_BUYER: 30022,
	},

	LogisticAddressRegion: {
		NONE: 0,
		MY_EAST: 1,
		MY_WEST: 2
	},

	LogisticChannelOptionFlag: {
		HIGH_VALUE_PRODUCT: 1,
		FAST_SHIPPING: 1<<1
	},

	LogisticDiscountFlag: {
		PERCENTAGE: 0,
		FLAT_RATE: 1,
		FIXED_DEDUCTION: 1<<1,

		SHIPPING_PROOF_CHECK: 1<<12,
		TRACKING_NUMBER_CHECK: 1<<13,

		BUYER_LOCATION_CHECK: 1<<20,
		ORDER_TOTAL_CHECK: 1<<21,

		REBATE_SHIPPING_FEE: 1<<28,
		REBATE_SHIPPING_FIXED_FEE: 1<<29
	},

	LogisticPromotionRuleDiscountFlag: {
		PERCENTAGE: 1<<0,
		FLAT_RATE: 1<<1,
		CAPPED: 1<<2,
		PERCENTAGE_WITH_CAP: 1<<3
	},

	LoadMoreThresholds: {
		PREVIOUS_COMMENTS: 20
	},

	ProtobufCmdErrcode: {
		OK          : 0,
		UNKNOWN     : -1,
		PARAM       : 1,
		PERM        : 2,
		LIMIT       : 3,
		NOTFOUND    : 4,
		EXIST       : 5,
		OUTSTOCK    : 6,
		EXPIRE      : 7,
		INVITATION  : 8,
		BANNED      : 9,
		DUPCMD      : 10,
		DUPLICATE   : 11,
		COUNTRY_RESTRICT : 12,
		DELETED     : 13,
		PROMOTION   : 14,
		FREQUENT    : 15,
		SHADOW_ACC  : 16,
		PRICE_LIMIT : 17,
		PRICERULE   : 18,
		NOT_LOGIN   : 19,
		FRAUD	    : 20
	},

	CssClass: {
		GLOBAL_VERSION_CLASS: 'global-version'
	},

	ShippingChannelID: {
		VN_OFFLINE: 59999
	},

	BridgePopUpButton: {
		OK: 0,
		CANCEL: 1
	},

	DiscountType: {
		RATIO: 'ratio', // Price * ratio
		FIXED: 'fixed', // Price - fixed
		FLAT: 'flat' // Price = flat
	},

	CapitalCityOf: {
		TW: {
			state: '\u53f0\u5317\u5e02', //???
			city: '\u4e2d\u6b63\u5340'   //???
		},
		PH: {
			state: 'Metro Manila',
			city: 'Metro Manila'
		},
		VN: {
			state: 'H\xe0 N\u1ed9i', //Hà N?i
			city: 'Huy\u1ec7n Ba V\xec'//Huy?n Ba Vì
		},
		ID: {
			state: 'DKI JAKARTA',
			city: 'KOTA JAKARTA PUSAT',
			district: 'MENTENG'
		},
		TH: {
			state: '\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14\u0e01\u0e23\u0e38\u0e07\u0e40\u0e17\u0e1e\u0e21\u0e2b\u0e32\u0e19\u0e04\u0e23', // '????????????????????' or Bankok
			city: '\u0e40\u0e02\u0e15\u0e1e\u0e23\u0e30\u0e19\u0e04\u0e23' //????????? or Metropolitan Area
		},
		MY: {
			state: 'Selangor',
			city: 'Kuala Lumpur'
		}
	},

	ListSeparator: {
		SG: ' / ',
		MY: ' / ',
		ID: ' / ',
		TW: '、',
		VN: ', ',
		PH: ', ',

		en: ', ',
		vi: ', ',
		zhHant: '、'
	},

	SentenceSeparator: {
		VN: ', ',
		ID: ', ',
		TW: '，',
		PH: ', ',

		en: ', ',
		vi: ', ',
		zhHant: '，'
	},

	DiscountDisplayType: {
		SHOW_DISCOUNTED_AMOUNT: 1,
		SHOW_DISCOUNT_DELTA: 2
	},

	EmailNotAllowedWhenRequestSubmission: [
		"support@shopeemobilesg.zendesk.com",
		"support@shopee.sg",
		"dispute@shopee.sg",
		"dpo@shopeemobile.com",
		"support@shopeemobilemy.zendesk.com",
		"support@shopee.com.my",
		"dispute@shopee.com.my",
		"support@shopeemobilevn.zendesk.com",
		"support@shopee.vn",
		"dispute@shopee.vn",
		"order@shopee.vn",
		"support@shopeemobileph.zendesk.com",
		"support@shopee.ph",
		"dispute@shopee.ph",
		"support@shopeemobileth.zendesk.com",
		"support@shopee.co.th",
		"dispute@shopee.co.th",
		"support@shopeemobileid.zendesk.com",
		"support@shopee.co.id",
		"dispute@shopee.co.id",
		"seller-info@shopee.co.id",
		"subsidiongkir@shopee.co.id",
		"support@shopeemobiletw.zendesk.com",
		"support@shopee.tw",
		"dispute@shopee.tw"
	],

	MatchTypeIndex: {
		MATCH_SHOP: 1,    //match result by shop id
		MATCH_CATEGORY: 2,    //match result by category id
		MATCH_COLLECTION: 3,    //match result by collection id
		MATCH_HASHTAG: 4,    //match result by hashtag this will use matchtype hashtag field
		MATCH_SHOP_CATE: 5,	//match result by shop categroy id
		MATCH_KEYWORD: 6,    //match result by keyword
		MATCH_ITEM: 7,	//match result by similar item
		MATCH_ATTRIBUTE: 8,	//match attribute id and value
		MATCH_SKU: 9,	//match item and model sku
		MATCH_ADDRESS: 10	//match item by seller pickup address
	},

	OFFICAL_SHOP_POPULAR_CATID: -2,
	OFFICAL_SHOP_ALL_CATID: -1,

	FLASH_SALE_DEFAULT_URL: {
		SG: '/flash_deals/',
		PH: '/flash_deals/',
		ID: '/flash_sales/',
		TW: '/flash_sales/',
		VN: '/flash_sales/',
		MY: '/shocking_sale/',
		TH: '/flash_sales/',
		BR: '/flash_sales/',
		MX: '/flash_sales/',
		CO: '/flash_sales/',
		CL: '/flash_sales/',
		PL: '/okazje_dnia/',
		ES: '/venta_flash/',
		FR: '/promo_flash/',
		IN: '/hot_deals/',
		AR: '/flash_sales/'
	},

	PAID_ADS_LANDING_PAGE: {
		TW: 'http://myads.shopee.tw/',
		ID: 'http://iklanku.shopee.co.id',
		VN: 'http://muatukhoa.shopee.vn',
		TH: 'http://myads.shopee.co.th'
	},

	COUNTRY_NOT_REQUIRE_IC: ['SG', 'MY', 'ID', 'PH'],

	ID_SOM_URL: 'https://shopee.co.id/som1',

	RECOMMENDATION_TYPE: {
		YMAL: 0,
		CATEGORY: 1,
		COUNTRY: 2,
		SIMILAR_ITEM: 3,
		POPULAR: 4,
		DAILY_DISCOVER: 5,
		OFFICIAL_SHOP: 6,
		OFFICIAL_SHOP_POPULAR: 7,
		TRENDING_SEARCHES: 8,
		FROM_SAME_SHOP: 9,
		SHOPPING_CART:10
	},

    ErrorMessages: {
        UNKNOWN: "error_server",
        // Logistic Error Messages
        CONVENIENT_STORE_INVALID: "error_convenient_store_not_available",
        PHONE: "error_phone",
        STORE_NOT_FOUND: "error_no_find_store_by_id",
        STORE_ID_NOT_FOUND: "not_get_storeid",
	SERVER_ERROR: "msg_server_error",

	BUYER_RESELECT_STATUS_INVALID:  'msg_buyer_reselect_status_invalid',
	BUYER_RESELECT_EXPIRED:  'msg_buyer_reselect_expired',
	BUYER_RESELECT_ABNORMAL:  'msg_buyer_reselect_abnormal',
	SELLER_RESELECT_STATUS_INVALID:  'msg_seller_reselect_status_invalid',
	SELLER_RESELECT_EXPIRED:  'msg_seller_reselect_expired',
	SELLER_RESELECT_ABNORMAL:  'msg_seller_reselect_abnormal',
    },

	ADS_AFFILIATION_PARAMS: ['ecid'],

    ADDRESS_SELECTION_REFERRERS: {
        RETURN: 'return',
        DISPUTE: 'dispute',
        OTHERS: 'others'
    },

	APP_IDS: {
		'SG':{'iOS':'959840394', 'Android':'com.shopee.sg'},
		'ID':{'iOS':'959841443', 'Android':'com.shopee.id'},
		'MY':{'iOS':'959841113', 'Android':'com.shopee.my'},
		'PH':{'iOS':'959841854', 'Android':'com.shopee.ph'},
		'TW':{'iOS':'959841107', 'Android':'com.shopee.tw'},
		'TH':{'iOS':'959841453', 'Android':'com.shopee.th'},
		'VN':{'iOS':'959841449', 'Android':'com.shopee.vn'},
		'IR':{'iOS':'', 'Android':'com.shopee.ir'},
		'HK':{'iOS':'', 'Android':'com.shopee.intl'},
		'MM':{'iOS':'', 'Android':'com.shopee.mm'},
		'BR':{'iOS':'1481812175', 'Android':'com.shopee.br'},
		'MX':{'iOS':'1540749085', 'Android':'com.shopee.mx'},
		'AR':{'iOS':'1569763993', 'Android':'com.shopee.ar'},
		'PL':{'iOS':'1569764124', 'Android':'com.shopee.pl'},
		'ES':{'iOS':'1569763855', 'Android':'com.shopee.es'},
		'FR':{'iOS':'1569764159', 'Android':'com.shopee.fr'},
		'IN':{'iOS':'1505678092', 'Android':'com.shopee.in'},
		'CO':{'iOS':'1554257433', 'Android':'com.shopee.co'},
		'CL':{'iOS':'1554257918', 'Android':'com.shopee.cl'}
	},

	DEEP_LINK_CONFIGS: {
		'SG':{'K_URL':'shopeesg://'},
		'MY':{'K_URL':'shopeemy://'},
		'TH':{'K_URL':'shopeeth://'},
		'VN':{'K_URL':'shopeevn://'},
		'PH':{'K_URL':'shopeeph://'},
		'TW':{'K_URL':'shopeetw://'},
		'IR':{'K_URL':'shopeeir://'},
		'HK':{'K_URL':'shopeeintl://'},
		'MM':{'K_URL':'shopeemm://'},
		'ID':{'K_URL':'shopeeid://'},
		'BR':{'K_URL':'shopeebr://'},
		'MX':{'K_URL':'shopeemx://'},
		'AR':{'K_URL':'shopeear://'},
		'PL':{'K_URL':'shopeepl://'},
		'ES':{'K_URL':'shopeees://'},
		'FR':{'K_URL':'shopeefr://'},
		'IN':{'K_URL':'shopeein://'},
		'CO':{'K_URL':'shopeeco://'},
		'CL':{'K_URL':'shopeecl://'},
	}
};

var SEARCH_ENUM = {
	// As same as constant.py
	PAGE_TYPE_ENUM : {
		'CATEGORY_ITEMS': 0,
		'SEARCH_ITEMS': 1,
		'HASHTAG': 2,
		'HASHTAG_SEARCH': 3,
		'SHOP_ITEMS': 4,
		'SHOP_ITEMS_SEARCH': 5,
		'COLLECTION': 6,
		'COLLECTION_SEARCH': 7,
		'ATTRIBUTE': 8,

		// reversed for BI tracking
		'DAILY_DISCOVER': 100,
		'HOME_DAILY_DISCOVER': 101,
		'SHOP_LIKES_TAB': 102,
		'YOU_MAY_ALSO_LIKE': 103,
		'YOU_MAY_ALSO_LIKE_IN_ITEM': 104,
		'POPULAR_PRODUCTS': 105,
		'HOME_POPULAR_PRODUCTS': 106,
		'SIMILAR_PRODUCTS': 107,
		'SIMILAR_PRODUCTS_IN_ITEM': 108,
		'OFFICAL_SHOP_LANDING': 109,
		'OFFICAL_SHOP_LANDING_RECOMMEND_PRODUCTS_SEE_MORE': 110,
		'HOMEPAGE': 111,
		'MAIN_CATEGORY ': 112,
		'FLASHSALE_HOME': 113,
		'FLASHSALE_LANDING': 114,
		'OFFICIAL_SHOP_PAGE_SEARCH': 115,
		'HOME_OFFICIAL_SHOP': 116,
		'TRENDING_SHOPS_LANDING': 117

	},
	SORT_TYPES: {
		SORTBY_POPULAR_DESC  : 1,
		SORTBY_LATEST_DESC   : 2,
		SORTBY_DISTANCE_DESC : 3,
		SORTBY_PRICE_DESC    : 4,
		SORTBY_POPULAR_ASC   : 5,
		SORTBY_LATEST_ASC    : 6,
		SORTBY_DISTANCE_ASC  : 7,
		SORTBY_PRICE_ASC     : 8,
		SORTBY_RELEVANCE     : 9,
		SORTBY_DISCOUNT_ASC  : 10,
		SORTBY_DISCOUNT_DESC : 11,
		SORTBY_SHOP_REVIEW : 12,
		SORTBY_ITEM_SOLD_DESC : 13
	}
};

// This is a list of logistics channels that requires Google Map location info
var MAP_LOGISTICS_DICT = {
	// ID,
	80012: {
		id: 80012,
		name: 'Go-Send Instant'
	},
	80013: {
		id: 80013,
		name: 'Go-Send Sameday'
	},
	80066: {
		id: 80066,
		name: 'Shopee Express'
	},
	88022: {
		id: 88022,
		name: 'Premium Express'
	},
	// MY
	20066: {
		id: 20066,
		name: 'Shopee Express'
	},
	// TH
	78009: {
		id: 78009,
		name: "Ninja Van"
	}
};
var MAP_LOGISTICS_LIST = [];
for (channelid in MAP_LOGISTICS_DICT){
	MAP_LOGISTICS_LIST.push(parseInt(channelid));
}
// This is a list of logistic channels that will check for cod pickup serviceability
var COD_PICKUP_LOGISTICS_LIST = [
	80014  // J&T
];

var SUPPORT_ADDRESS_CHECK_LOGISTICS_DICT = {};// data inside this list is used to post the edit address
var MAP_LOGISTICS_LIST_ENABLED_DICT = {}; // This data is used to sent to backend, please keep the format.
$.map(MAP_LOGISTICS_LIST, function(logisticId) {
	MAP_LOGISTICS_LIST_ENABLED_DICT[logisticId] = {enabled: false};
});

var ADDRESS_FILE_VERSION = '200654';
