You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.4 KiB

1 year ago
  1. "use strict";
  2. (self["__WordPressPrivateInteractivityAPI__"] = self["__WordPressPrivateInteractivityAPI__"] || []).push([[81],{
  3. /***/ 149:
  4. /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
  5. // EXTERNAL MODULE: ./node_modules/@wordpress/interactivity/src/index.js + 15 modules
  6. var src = __webpack_require__(754);
  7. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils/index.js
  8. /**
  9. * Uses a combination of user agent matching and feature detection to determine whether
  10. * the current browser supports rendering PDFs inline.
  11. *
  12. * @return {boolean} Whether or not the browser supports inline PDFs.
  13. */
  14. const browserSupportsPdfs = () => {
  15. // Most mobile devices include "Mobi" in their UA.
  16. if (window.navigator.userAgent.indexOf('Mobi') > -1) {
  17. return false;
  18. }
  19. // Android tablets are the noteable exception.
  20. if (window.navigator.userAgent.indexOf('Android') > -1) {
  21. return false;
  22. }
  23. // iPad pretends to be a Mac.
  24. if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
  25. return false;
  26. }
  27. // IE only supports PDFs when there's an ActiveX object available for it.
  28. if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) {
  29. return false;
  30. }
  31. return true;
  32. };
  33. /**
  34. * Helper function for creating ActiveX objects, catching any errors that are thrown
  35. * when it's generated.
  36. *
  37. * @param {string} type The name of the ActiveX object to create.
  38. * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.
  39. */
  40. const createActiveXObject = type => {
  41. let ax;
  42. try {
  43. ax = new window.ActiveXObject(type);
  44. } catch (e) {
  45. ax = undefined;
  46. }
  47. return ax;
  48. };
  49. ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/view.js
  50. /**
  51. * WordPress dependencies
  52. */
  53. /**
  54. * Internal dependencies
  55. */
  56. (0,src/* store */.h)({
  57. selectors: {
  58. core: {
  59. file: {
  60. hasPdfPreview: browserSupportsPdfs
  61. }
  62. }
  63. }
  64. });
  65. /***/ })
  66. },
  67. /******/ function(__webpack_require__) { // webpackRuntimeModules
  68. /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
  69. /******/ var __webpack_exports__ = (__webpack_exec__(149));
  70. /******/ }
  71. ]);