function isIpad(mockUserAgent, mockDevicePlatform, mockDeviceTouchPoints) {
  var userAgent = mockUserAgent || window.navigator.userAgent;
  var platform = mockDevicePlatform || window.navigator.platform;
  var maxTouchPoints = mockDeviceTouchPoints || window.navigator.maxTouchPoints || 0;
  return (platform === 'iPad' || platform === 'MacIntel') && maxTouchPoints > 0 && /Macintosh|Intel|iPad|ipad/i.test(userAgent) && !window.MSStream;
}
Detect ipad devices.
 @param {string} mockUserAgent - Allow passing a mock user agent for testing.
 @param {string} mockDevicePlatform - Allow passing a mock device platform for testing.
 @param {string} mockDeviceTouchPoints - Allow passing a mock device touch points for testing.