%PDF- %PDF-
Direktori : /var/www/html/itworks/wp-content/plugins/wp-smushit/app/assets/js/ |
Current File : /var/www/html/itworks/wp-content/plugins/wp-smushit/app/assets/js/smush-blocks.min.js.map |
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./_src/js/smush/blocks.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","__webpack_exports__","smushStats","fetchProps","wp","i18n","__","createHigherOrderComponent","compose","Fragment","element","InspectorControls","editor","PanelBody","components","id","stats","smush_vars","strings","gb","select_image","React","createElement","className","style","display","size","savings","keys","sizes","filter","item","percent","map","toUpperCase","bytes","units","Math","abs","u","length","toFixed","humanFileSize","props","image","api","models","Media","attributes","smushData","smush","fetch","attribute","done","img","setAttributes","setTimeout","JSON","stringify","smushStatsControl","BlockEdit","isSelected","title","hooks","addFilter"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EA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AuBlB,EAAMK,WAAWjC,GACjG,OACOM,MAAAC,cAACb,EAAD,KACIY,MAAAC,cAACsC,EAAejB,IAK5B,IAAIM,EAAYN,EAAMK,WAAWE,MAGjC,OAFA/C,EAAWwC,GAGPtB,MAAAC,cAACb,EAAD,KACIY,MAAAC,cAACsC,EAAejB,GAChBtB,MAAAC,cAACX,EAAD,KACIU,MAAAC,cAACT,EAAD,CAAWiD,MAAQ7C,WAAWC,QAAQC,GAAGH,OACrDd,EAAYyC,EAAMK,WAAWjC,GAAIkC,QAMtC,wBAEH7C,GAAG2D,MAAMC,UAAW,mBAAoB,8BAA+BL","file":"smush-blocks.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 = 22);\n","/**\n * BLOCK: extend image block\n */\nconst { __ } = wp.i18n,\n\t { createHigherOrderComponent } = wp.compose,\n\t { Fragment } = wp.element,\n { InspectorControls } = wp.editor,\n\t { PanelBody } = wp.components;\n\n/**\n * Transform bytes to human readable format.\n *\n * @param {int} bytes\n * @returns {string}\n */\nfunction humanFileSize( bytes ) {\n\tconst thresh = 1024,\n\t\tunits = ['kB','MB','GB','TB'];\n\n\tif ( Math.abs( bytes ) < thresh ) {\n\t\treturn bytes + ' B';\n\t}\n\n\tlet u = -1;\n\tdo {\n\t\tbytes /= thresh;\n\t\t++u;\n\t} while ( Math.abs( bytes ) >= thresh && u < units.length - 1 );\n\n\treturn bytes.toFixed( 1 ) + ' ' + units[u];\n}\n\n/**\n * Generate Smush stats table.\n *\n * @param {int} id\n * @param {object} stats\n * @returns {*}\n */\nexport function smushStats( id, stats ) {\n\tif ( 'undefined' === typeof stats ) {\n\t\treturn smush_vars.strings.gb.select_image;\n\t} else if ( 'string' === typeof stats ) {\n return stats;\n\t}\n\n\treturn (\n\t\t<div id=\"smush-stats\" className=\"sui-smush-media smush-stats-wrapper hidden\" style={ { display: 'block' } }>\n\t\t\t<table className=\"wp-smush-stats-holder\">\n\t\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th className=\"smush-stats-header\">{ smush_vars.strings.gb.size }</th>\n\t\t\t\t\t<th className=\"smush-stats-header\">{ smush_vars.strings.gb.savings }</th>\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t{ Object.keys( stats.sizes ).filter( item => 0 < stats.sizes[item].percent ).map( ( item, i ) => (\n\t\t\t\t\t<tr key={ i }>\n\t\t\t\t\t\t<td>{ item.toUpperCase() }</td>\n\t\t\t\t\t\t<td>{ humanFileSize( stats.sizes[item].bytes ) } ( { stats.sizes[item].percent }% )</td>\n\t\t\t\t\t</tr>)\n\t\t\t\t) }\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t);\n}\n\n/**\n * Fetch image data. If image is Smushing, update in 3 seconds.\n *\n * @todo this could be optimized not to query so much.\n */\nexport function fetchProps( props ) {\n let image = new wp.api.models.Media( { id: props.attributes.id } ),\n smushData = props.attributes.smush;\n\n image.fetch( { attribute: 'smush' } ).done( function ( img ) {\n if ( 'string' === typeof img.smush ) {\n props.setAttributes( { smush: img.smush } );\n setTimeout( () => fetch( props ), 3000 );\n } else if ( 'undefined' !== typeof img.smush && (\n 'undefined' === typeof smushData || JSON.stringify( smushData ) !== JSON.stringify( img.smush )\n ) ) {\n props.setAttributes( { smush: img.smush } );\n }\n });\n}\n\n/**\n * Modify the block’s edit component.\n * Receives the original block BlockEdit component and returns a new wrapped component.\n */\nconst smushStatsControl = createHigherOrderComponent( ( BlockEdit ) => {\n return ( props ) => {\n // If not image block or not selected, return unmodified block.\n if ( 'core/image' !== props.name || ! props.isSelected || 'undefined' === typeof props.attributes.id ) {\n \treturn (\n <Fragment>\n <BlockEdit { ...props } />\n\t\t\t\t</Fragment>\n\t\t\t);\n }\n\n let smushData = props.attributes.smush;\n fetchProps(props);\n\n return (\n <Fragment>\n <BlockEdit { ...props } />\n <InspectorControls>\n <PanelBody title={ smush_vars.strings.gb.stats }>\n\t\t\t\t\t\t{ smushStats( props.attributes.id, smushData ) }\n </PanelBody>\n </InspectorControls>\n </Fragment>\n );\n };\n}, \"withInspectorControl\" );\n\nwp.hooks.addFilter( 'editor.BlockEdit', 'wp-smush/smush-data-control', smushStatsControl );\n"],"sourceRoot":""}