{"version":3,"file":"./build/block-library/blocks/file/view.min.js","mappings":"yBAMO,MAyCDA,EAAwBC,IAC7B,IAAIC,EACJ,IACCA,EAAK,IAAIC,OAAOC,cAAeH,EAG/B,CAFC,MAAQI,GACTH,OAAKI,CACL,CACD,OAAOJ,CAAP,EAOiD,MACjD,GAtDKC,OAAOI,UAAUC,UAAUC,QAAS,SAAY,GAKhDN,OAAOI,UAAUC,UAAUC,QAAS,YAAe,GAMvDN,OAAOI,UAAUC,UAAUC,QAAS,cAAiB,GACrDN,OAAOI,UAAUG,gBACjBP,OAAOI,UAAUG,eAAiB,IAO7BP,OAAOC,eAAiB,kBAAmBD,UAE/CH,EAAqB,iBACrBA,EAAqB,eA+BQ,CAC9B,MAAMW,EAASC,SAASC,uBACvB,wBAEDC,MAAMC,KAAMJ,GAASK,SAAWC,IAC/BA,EAAMC,MAAMC,QAAU,MAAtB,GAED,GChEFC,E","sources":["webpack://wp/./packages/block-library/build-module/file/@wordpress/block-library/src/file/utils.js","webpack://wp/./packages/block-library/build-module/file/@wordpress/block-library/src/file/view.js"],"sourcesContent":["/**\n * Uses a combination of user agent matching and feature detection to determine whether\n * the current browser supports rendering PDFs inline.\n *\n * @return {boolean} Whether or not the browser supports inline PDFs.\n */\nexport const browserSupportsPdfs = () => {\n\t// Most mobile devices include \"Mobi\" in their UA.\n\tif ( window.navigator.userAgent.indexOf( 'Mobi' ) > -1 ) {\n\t\treturn false;\n\t}\n\n\t// Android tablets are the noteable exception.\n\tif ( window.navigator.userAgent.indexOf( 'Android' ) > -1 ) {\n\t\treturn false;\n\t}\n\n\t// iPad pretends to be a Mac.\n\tif (\n\t\twindow.navigator.userAgent.indexOf( 'Macintosh' ) > -1 &&\n\t\twindow.navigator.maxTouchPoints &&\n\t\twindow.navigator.maxTouchPoints > 2\n\t) {\n\t\treturn false;\n\t}\n\n\t// IE only supports PDFs when there's an ActiveX object available for it.\n\tif (\n\t\t!! ( window.ActiveXObject || 'ActiveXObject' in window ) &&\n\t\t! (\n\t\t\tcreateActiveXObject( 'AcroPDF.PDF' ) ||\n\t\t\tcreateActiveXObject( 'PDF.PdfCtrl' )\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\n/**\n * Helper function for creating ActiveX objects, catching any errors that are thrown\n * when it's generated.\n *\n * @param {string} type The name of the ActiveX object to create.\n * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.\n */\nconst createActiveXObject = ( type ) => {\n\tlet ax;\n\ttry {\n\t\tax = new window.ActiveXObject( type );\n\t} catch ( e ) {\n\t\tax = undefined;\n\t}\n\treturn ax;\n};\n\n/**\n * Hides all .wp-block-file__embed elements on the document. This function is only intended\n * to be run on the front-end, it may have weird side effects running in the block editor.\n */\nexport const hidePdfEmbedsOnUnsupportedBrowsers = () => {\n\tif ( ! browserSupportsPdfs() ) {\n\t\tconst embeds = document.getElementsByClassName(\n\t\t\t'wp-block-file__embed'\n\t\t);\n\t\tArray.from( embeds ).forEach( ( embed ) => {\n\t\t\tembed.style.display = 'none';\n\t\t} );\n\t}\n};\n","/**\n * Internal dependencies\n */\nimport { hidePdfEmbedsOnUnsupportedBrowsers } from './utils';\n\nhidePdfEmbedsOnUnsupportedBrowsers();\n"],"names":["createActiveXObject","type","ax","window","ActiveXObject","e","undefined","navigator","userAgent","indexOf","maxTouchPoints","embeds","document","getElementsByClassName","Array","from","forEach","embed","style","display","hidePdfEmbedsOnUnsupportedBrowsers"],"sourceRoot":""}