AlkantarClanX12
Current Path : /home/thanudqk/thepball.com/wp-content/plugins/wp-smushit/app/assets/js/ |
Current File : /home/thanudqk/thepball.com/wp-content/plugins/wp-smushit/app/assets/js/smush-rd.min.js.map |
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./_src/js/frontend/resize-detection.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","SmushIRS","bar","document","getElementById","toggle","images","bigger","smaller","strings","window","wp_smush_resize_vars","init","this","process","addEventListener","handleToggleClick","icon","querySelector","classList","add","remove","detectImages","length","style","display","generateMarkup","toggleDivs","shouldSkipImage","image","contains","getAttribute","clientWidth","clientHeight","naturalWidth","naturalHeight","getTooltipText","props","tooltipText","bigger_width","bigger_height","large_image","smaller_width","smaller_height","small_image","replace","real_width","real_height","type","forEach","index","item","createElement","tooltip","setAttribute","class","e","highlightImage","innerHTML","computed_width","computed_height","appendChild","div","removeSelection","el","getElementsByClassName","currentTarget","dataset","scrollIntoView","behavior","block","inline","opacity","setTimeout","items","Array","from","getElementsByTagName","imgType","imageClass","push","src","refresh","id","elements"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAM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HA,IAAM4E,EAAWjF,SAAS8D,uBACzB,oBAEOmB,EAAS7D,OAAS,GACzB6D,EAAU,GAAI/D,SAGfR,KAAKC,YAOPJ,OAAOK,iBAAkB,oBAAoB,kBAAMd,EAASW,UAC5DF,OAAOK,iBAAkB,cAAc,kBAAMd,EAASiF,aAhWvD","file":"smush-rd.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 25);\n","/**\n * Image resize detection (IRD).\n *\n * Show all wrongly scaled images with a highlighted border and resize box.\n *\n * Made in pure JS.\n * DO NOT ADD JQUERY SUPPORT!!!\n *\n * @since 2.9\n */\n( function() {\n\t'use strict';\n\n\tconst SmushIRS = {\n\t\tbar: document.getElementById( 'smush-image-bar' ),\n\t\ttoggle: document.getElementById( 'smush-image-bar-toggle' ),\n\t\timages: {\n\t\t\tbigger: [],\n\t\t\tsmaller: [],\n\t\t},\n\t\tstrings: window.wp_smush_resize_vars,\n\n\t\t/**\n\t\t * Init scripts.\n\t\t */\n\t\tinit() {\n\t\t\t/**\n\t\t\t * Make sure these are set, before we proceed.\n\t\t\t */\n\t\t\tif ( ! this.bar ) {\n\t\t\t\tthis.bar = document.getElementById( 'smush-image-bar' );\n\t\t\t}\n\t\t\tif ( ! this.toggle ) {\n\t\t\t\tthis.toggle = document.getElementById(\n\t\t\t\t\t'smush-image-bar-toggle'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.process();\n\n\t\t\t// Register the event handler after everything is done.\n\t\t\tthis.toggle.addEventListener(\n\t\t\t\t'click',\n\t\t\t\tthis.handleToggleClick.bind( this )\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Do image processing.\n\t\t */\n\t\tprocess() {\n\t\t\tconst icon = this.toggle.querySelector( 'i' );\n\n\t\t\ticon.classList.add( 'sui-icon-loader' );\n\t\t\ticon.classList.remove( 'sui-icon-info' );\n\n\t\t\tthis.detectImages();\n\n\t\t\tif ( ! this.images.bigger.length && ! this.images.smaller.length ) {\n\t\t\t\tthis.toggle.classList.add( 'smush-toggle-success' );\n\t\t\t\tdocument.getElementById(\n\t\t\t\t\t'smush-image-bar-notice'\n\t\t\t\t).style.display = 'block';\n\t\t\t\tdocument.getElementById(\n\t\t\t\t\t'smush-image-bar-notice-desc'\n\t\t\t\t).style.display = 'none';\n\t\t\t} else {\n\t\t\t\tthis.toggle.classList.remove( 'smush-toggle-success' );\n\t\t\t\tdocument.getElementById(\n\t\t\t\t\t'smush-image-bar-notice'\n\t\t\t\t).style.display = 'none';\n\t\t\t\tdocument.getElementById(\n\t\t\t\t\t'smush-image-bar-notice-desc'\n\t\t\t\t).style.display = 'block';\n\t\t\t\tthis.generateMarkup( 'bigger' );\n\t\t\t\tthis.generateMarkup( 'smaller' );\n\t\t\t}\n\n\t\t\tthis.toggleDivs();\n\n\t\t\ticon.classList.remove( 'sui-icon-loader' );\n\t\t\ticon.classList.add( 'sui-icon-info' );\n\t\t},\n\n\t\t/**\n\t\t * Various checks to see if the image should be processed.\n\t\t *\n\t\t * @param {Object} image\n\t\t * @return {boolean} Should skip image or not.\n\t\t */\n\t\tshouldSkipImage( image ) {\n\t\t\t// Skip avatars.\n\t\t\tif ( image.classList.contains( 'avatar' ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Skip images from Smush CDN with auto-resize feature.\n\t\t\tif (\n\t\t\t\t'string' === typeof image.getAttribute( 'no-resize-detection' )\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Skip 1x1px images.\n\t\t\tif (\n\t\t\t\timage.clientWidth === image.clientHeight &&\n\t\t\t\t1 === image.clientWidth\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Skip 1x1px placeholders.\n\t\t\tif (\n\t\t\t\timage.naturalWidth === image.naturalHeight &&\n\t\t\t\t1 === image.naturalWidth\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If width attribute is not set, do not continue.\n\t\t\treturn null === image.clientWidth || null === image.clientHeight;\n\t\t},\n\n\t\t/**\n\t\t * Get tooltip text.\n\t\t *\n\t\t * @param {Object} props\n\t\t * @return {string} Tooltip.\n\t\t */\n\t\tgetTooltipText( props ) {\n\t\t\tlet tooltipText = '';\n\n\t\t\tif ( props.bigger_width || props.bigger_height ) {\n\t\t\t\t/** @param {string} strings.large_image */\n\t\t\t\ttooltipText = this.strings.large_image;\n\t\t\t} else if ( props.smaller_width || props.smaller_height ) {\n\t\t\t\t/** @param {string} strings.small_image */\n\t\t\t\ttooltipText = this.strings.small_image;\n\t\t\t}\n\n\t\t\treturn tooltipText\n\t\t\t\t.replace( 'width', props.real_width )\n\t\t\t\t.replace( 'height', props.real_height );\n\t\t},\n\n\t\t/**\n\t\t * Generate markup.\n\t\t *\n\t\t * @param {string} type Accepts: 'bigger' or 'smaller'.\n\t\t */\n\t\tgenerateMarkup( type ) {\n\t\t\tthis.images[ type ].forEach( ( image, index ) => {\n\t\t\t\tconst item = document.createElement( 'div' ),\n\t\t\t\t\ttooltip = this.getTooltipText( image.props );\n\n\t\t\t\titem.setAttribute(\n\t\t\t\t\t'class',\n\t\t\t\t\t'smush-resize-box smush-tooltip smush-tooltip-constrained'\n\t\t\t\t);\n\t\t\t\titem.setAttribute( 'data-tooltip', tooltip );\n\t\t\t\titem.setAttribute( 'data-image', image.class );\n\t\t\t\titem.addEventListener( 'click', ( e ) =>\n\t\t\t\t\tthis.highlightImage( e )\n\t\t\t\t);\n\n\t\t\t\titem.innerHTML = `\n\t\t\t\t\t<div class=\"smush-image-info\">\n\t\t\t\t\t\t<span>${ index + 1 }</span>\n\t\t\t\t\t\t<span class=\"smush-tag\">${ image.props.computed_width } x ${\n\t\t\t\t\timage.props.computed_height\n\t\t\t\t}px</span>\n\t\t\t\t\t\t<i class=\"smush-front-icons smush-front-icon-arrows-in\" aria-hidden=\"true\"> </i>\n\t\t\t\t\t\t<span class=\"smush-tag smush-tag-success\">${ image.props.real_width } × ${\n\t\t\t\t\timage.props.real_height\n\t\t\t\t}px</span>\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"smush-image-description\">${ tooltip }</div>\n\t\t\t\t`;\n\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById( 'smush-image-bar-items-' + type )\n\t\t\t\t\t.appendChild( item );\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Show/hide sections based on images.\n\t\t */\n\t\ttoggleDivs() {\n\t\t\tconst types = [ 'bigger', 'smaller' ];\n\t\t\ttypes.forEach( ( type ) => {\n\t\t\t\tconst div = document.getElementById(\n\t\t\t\t\t'smush-image-bar-items-' + type\n\t\t\t\t);\n\t\t\t\tif ( 0 === this.images[ type ].length ) {\n\t\t\t\t\tdiv.style.display = 'none';\n\t\t\t\t} else {\n\t\t\t\t\tdiv.style.display = 'block';\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Scroll the selected image into view and highlight it.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thighlightImage( e ) {\n\t\t\tthis.removeSelection();\n\n\t\t\tconst el = document.getElementsByClassName(\n\t\t\t\te.currentTarget.dataset.image\n\t\t\t);\n\t\t\tif ( 'undefined' !== typeof el[ 0 ] ) {\n\t\t\t\t// Display description box.\n\t\t\t\te.currentTarget.classList.toggle( 'show-description' );\n\n\t\t\t\t// Scroll and flash image.\n\t\t\t\tel[ 0 ].scrollIntoView( {\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'center',\n\t\t\t\t\tinline: 'nearest',\n\t\t\t\t} );\n\t\t\t\tel[ 0 ].style.opacity = '0.5';\n\t\t\t\tsetTimeout( () => {\n\t\t\t\t\tel[ 0 ].style.opacity = '1';\n\t\t\t\t}, 1000 );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle click on the toggle item.\n\t\t */\n\t\thandleToggleClick() {\n\t\t\tthis.bar.classList.toggle( 'closed' );\n\t\t\tthis.toggle.classList.toggle( 'closed' );\n\t\t\tthis.removeSelection();\n\t\t},\n\n\t\t/**\n\t\t * Remove selected items.\n\t\t */\n\t\tremoveSelection() {\n\t\t\tconst items = document.getElementsByClassName( 'show-description' );\n\t\t\tif ( items.length > 0 ) {\n\t\t\t\tArray.from( items ).forEach( ( div ) =>\n\t\t\t\t\tdiv.classList.remove( 'show-description' )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Function to highlight all scaled images.\n\t\t *\n\t\t * Add yellow border and then show one small box to\n\t\t * resize the images as per the required size, on fly.\n\t\t */\n\t\tdetectImages() {\n\t\t\tconst images = document.getElementsByTagName( 'img' );\n\t\t\tfor ( const image of images ) {\n\t\t\t\tif ( this.shouldSkipImage( image ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Get defined width and height.\n\t\t\t\tconst props = {\n\t\t\t\t\treal_width: image.clientWidth,\n\t\t\t\t\treal_height: image.clientHeight,\n\t\t\t\t\tcomputed_width: image.naturalWidth,\n\t\t\t\t\tcomputed_height: image.naturalHeight,\n\t\t\t\t\tbigger_width: image.clientWidth * 1.5 < image.naturalWidth,\n\t\t\t\t\tbigger_height:\n\t\t\t\t\t\timage.clientHeight * 1.5 < image.naturalHeight,\n\t\t\t\t\tsmaller_width: image.clientWidth > image.naturalWidth,\n\t\t\t\t\tsmaller_height: image.clientHeight > image.naturalHeight,\n\t\t\t\t};\n\n\t\t\t\t// In case image is in correct size, do not continue.\n\t\t\t\tif (\n\t\t\t\t\t! props.bigger_width &&\n\t\t\t\t\t! props.bigger_height &&\n\t\t\t\t\t! props.smaller_width &&\n\t\t\t\t\t! props.smaller_height\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst imgType =\n\t\t\t\t\t\tprops.bigger_width || props.bigger_height\n\t\t\t\t\t\t\t? 'bigger'\n\t\t\t\t\t\t\t: 'smaller',\n\t\t\t\t\timageClass =\n\t\t\t\t\t\t'smush-image-' + ( this.images[ imgType ].length + 1 );\n\n\t\t\t\t// Fill the images arrays.\n\t\t\t\tthis.images[ imgType ].push( {\n\t\t\t\t\tsrc: image,\n\t\t\t\t\tprops,\n\t\t\t\t\tclass: imageClass,\n\t\t\t\t} );\n\n\t\t\t\t/**\n\t\t\t\t * Add class to original image.\n\t\t\t\t * Can't add two classes in single add(), because no support in IE11.\n\t\t\t\t * image.classList.add('smush-detected-img', imageClass);\n\t\t\t\t */\n\t\t\t\timage.classList.add( 'smush-detected-img' );\n\t\t\t\timage.classList.add( imageClass );\n\t\t\t}\n\t\t}, // End detectImages()\n\n\t\t/**\n\t\t * Allows refreshing the list. A good way is to refresh on lazyload actions.\n\t\t *\n\t\t * @since 3.6.0\n\t\t */\n\t\trefresh() {\n\t\t\t// Clear out classes on DOM.\n\t\t\tfor ( let id in this.images.bigger ) {\n\t\t\t\tif ( this.images.bigger.hasOwnProperty( id ) ) {\n\t\t\t\t\tthis.images.bigger[ id ].src.classList.remove(\n\t\t\t\t\t\t'smush-detected-img'\n\t\t\t\t\t);\n\t\t\t\t\tthis.images.bigger[ id ].src.classList.remove(\n\t\t\t\t\t\t'smush-image-' + ++id\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( let id in this.images.smaller ) {\n\t\t\t\tif ( this.images.smaller.hasOwnProperty( id ) ) {\n\t\t\t\t\tthis.images.smaller[ id ].src.classList.remove(\n\t\t\t\t\t\t'smush-detected-img'\n\t\t\t\t\t);\n\t\t\t\t\tthis.images.smaller[ id ].src.classList.remove(\n\t\t\t\t\t\t'smush-image-' + ++id\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.images = {\n\t\t\t\tbigger: [],\n\t\t\t\tsmaller: [],\n\t\t\t};\n\n\t\t\t// This might be overkill - there will probably never be a situation when there are less images than on\n\t\t\t// initial page load.\n\t\t\tconst elements = document.getElementsByClassName(\n\t\t\t\t'smush-resize-box'\n\t\t\t);\n\t\t\twhile ( elements.length > 0 ) {\n\t\t\t\telements[ 0 ].remove();\n\t\t\t}\n\n\t\t\tthis.process();\n\t\t},\n\t}; // End WP_Smush_IRS\n\n\t/**\n\t * After page load, initialize toggle event.\n\t */\n\twindow.addEventListener( 'DOMContentLoaded', () => SmushIRS.init() );\n\twindow.addEventListener( 'lazyloaded', () => SmushIRS.refresh() );\n} )();\n"],"sourceRoot":""}