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AO,SAAEC,GAER,GACC,eAAiBA,EAAMC,OACrBD,EAAME,iBACR,IAAuBF,EAAMG,WAAWtC,GAExC,OACCO,MAAAC,cAACf,EAAQ,KACRc,MAAAC,cAAC0B,EAAeC,IAKnB,IAAMI,EAAYJ,EAAMG,WAAWE,MAGnC,OAxCK,SAAqBL,GAC3B,IAAMM,EAAQ,IAAIlD,GAAGmD,IAAIC,OAAOC,MAAO,CAAE5C,GAAImC,EAAMG,WAAWtC,KAC7DuC,EAAYJ,EAAMG,WAAWE,MAE9BC,EAAMI,MAAO,CAAEC,UAAW,UAAYC,MAAM,SAAUC,GAChD,iBAAoBA,EAAIR,MAC5BL,EAAMc,cAAe,CAAET,MAAOQ,EAAIR,aAGlC,IAAuBQ,EAAIR,YACzB,IAAuBD,GACxBW,KAAKC,UAAWZ,KAAgBW,KAAKC,UAAWH,EAAIR,QAErDL,EAAMc,cAAe,CAAET,MAAOQ,EAAIR,OAEpC,GACD,CAsBEY,CAAYjB,GAGX5B,MAAAC,cAACf,EAAQ,KACRc,MAAAC,cAAC0B,EAAeC,GAChB5B,MAAAC,cAACb,EAAiB,KACjBY,MAAAC,cAACX,EAAS,CAACwD,MAAQnD,OAAOC,WAAWC,QAAQC,GAAGJ,OAC7CF,EAAYoC,EAAMG,WAAWtC,GAAIuC,KAKxC,CACD,GAAG,wBAEHhD,GAAG+D,MAAMC,UACR,mBACA,8BACAtB,E","sources":["webpack://wp-smushit/webpack/bootstrap","webpack://wp-smushit/./_src/js/smush/blocks.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","/**\n * BLOCK: extend image block\n */\nconst { createHigherOrderComponent } = wp.compose,\n\t{ Fragment } = wp.element,\n\t{ InspectorControls } = wp.blockEditor,\n\t{ PanelBody } = wp.components;\n\n/**\n * Transform bytes to human readable format.\n *\n * @param {number} bytes\n * @return {string} Readable size 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 {number} id\n * @param {Object} stats\n * @return {*} Smush stats.\n */\nexport function smushStats( id, stats ) {\n\tif ( 'undefined' === typeof stats ) {\n\t\treturn window.smush_vars.strings.gb.select_image;\n\t} else if ( 'string' === typeof stats ) {\n\t\treturn stats;\n\t}\n\n\treturn (\n\t\t
\n\t\t\t\t\t\t\t{ window.smush_vars.strings.gb.size }\n\t\t\t\t\t\t | \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ window.smush_vars.strings.gb.savings }\n\t\t\t\t\t\t | \n\t\t\t\t\t
---|---|
{ item.toUpperCase() } | \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{ humanFileSize(\n\t\t\t\t\t\t\t\t\t\tstats.sizes[ item ].bytes\n\t\t\t\t\t\t\t\t\t) }{ ' ' }\n\t\t\t\t\t\t\t\t\t( { stats.sizes[ item ].percent }% )\n\t\t\t\t\t\t\t\t | \n\t\t\t\t\t\t\t