{"version":3,"sources":["scripts/modernizr.js"],"names":["scriptGlobalObject","document","tests","ModernizrProto","_version","_config","classPrefix","enableClasses","enableJSClass","usePrefixes","_q","on","test","cb","self","this","setTimeout","addTest","name","fn","options","push","addAsyncTest","Modernizr","classes","prototype","is","obj","type","hasOwnProp","_hasOwnProperty","featureNames","feature","aliasIdx","result","nameIdx","featureNameSplit","featureIdx","docElement","documentElement","isSVG","nodeName","toLowerCase","setClasses","reJS","className","baseVal","RegExp","replace","length","join","key","split","last","Boolean","_trigger","hasOwnProperty","call","object","property","constructor","_l","res","cbs","i","webpTests","uri","webp","shift","image","Image","addResult","event","width","onerror","onload","src","e","aliases","window"],"mappings":"AAyBA,CAAA,SAAWA,EAA4BC,GACnC,IAAIC,EAAQ,GAQRC,EAAiB,CACjBC,SAAU,SAIVC,QAAS,CACLC,YAAa,GACbC,cAAe,CAAA,EACfC,cAAe,CAAA,EACfC,YAAa,CAAA,CACjB,EAGAC,GAAI,GAGJC,GAAI,SAAUC,EAAMC,GAOhB,IAAIC,EAAOC,KACXC,WAAW,WACPH,EAAGC,EAAKF,EAAK,CACjB,EAAG,CAAC,CACR,EAEAK,QAAS,SAAUC,EAAMC,EAAIC,GACzBlB,EAAMmB,KAAK,CAAEH,KAAMA,EAAMC,GAAIA,EAAIC,QAASA,CAAQ,CAAC,CACvD,EAEAE,aAAc,SAAUH,GACpBjB,EAAMmB,KAAK,CAAEH,KAAM,KAAMC,GAAIA,CAAG,CAAC,CACrC,CACJ,EAGII,EAAY,aAOZC,GANJD,EAAUE,UAAYtB,EAItBoB,EAAY,IAAIA,EAEF,IAWd,SAASG,EAAGC,EAAKC,GACb,OAAO,OAAOD,IAAQC,CAC1B,CA8EA,IA2DIC,EAGIC,EAnIAC,EACAC,EACAC,EACAC,EACAC,EAEAC,EAEKC,EA6DTC,EAAarC,EAASsC,gBAQtBC,EAA8C,QAAtCF,EAAWG,SAASC,YAAY,EAW5C,SAASC,EAAWnB,GAChB,IAUQoB,EAVJC,EAA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AWY,EAAQZ,QAAQ0D,SAAW9C,EAAQZ,QAAQ0D,QAAQ7B,OAEtE,IAAKhB,EAAW,EAAGA,EAAWD,EAAQZ,QAAQ0D,QAAQ7B,OAAQhB,CAAQ,GAClEF,EAAaV,KAAKW,EAAQZ,QAAQ0D,QAAQ7C,GAAUS,YAAY,CAAC,EAS7E,IAHAR,EAASR,EAAGM,EAAQb,GAAI,UAAU,EAAIa,EAAQb,GAAG,EAAIa,EAAQb,GAGxDgB,EAAU,EAAGA,EAAUJ,EAAakB,OAAQd,CAAO,GAUpB,KAFhCC,EAPcL,EAAaI,GAOIiB,MAAM,GAAG,GAEnBH,OACjB1B,EAAUa,EAAiB,IAAMF,GAI5BX,EAAUa,EAAiB,MAC3Bb,CAAAA,EAAUa,EAAiB,KAASb,EAAUa,EAAiB,cAAekB,WAE/E/B,EAAUa,EAAiB,IAAM,IAAIkB,QAAQ/B,EAAUa,EAAiB,GAAG,GAG/Eb,EAAUa,EAAiB,IAAIA,EAAiB,IAAMF,GAG1DV,EAAQH,MAAMa,EAAS,GAAK,OAASE,EAAiBc,KAAK,GAAG,CAAC,CAEvE,CAmfRP,EAAWnB,CAAO,EAElB,OAAOrB,EAAec,QACtB,OAAOd,EAAemB,aAGtB,IAAK,IAAI0C,EAAI,EAAGA,EAAIzC,EAAUb,GAAGuC,OAAQe,CAAC,GACtCzC,EAAUb,GAAGsD,GAAG,EAIpBhE,EAAmBuB,UAAYA,CAClC,EAAEwD,QAAQA,OAAQ9E,SAAQ","file":"index.js","sourcesContent":["/*!\n * modernizr v3.11.4\n * Build https://modernizr.com/download?-webp-webpalpha-webpanimation-webplossless_webp_lossless-setclasses-dontmin\n *\n * Copyright (c)\n * Faruk Ates\n * Paul Irish\n * Alex Sexton\n * Ryan Seddon\n * Patrick Kettner\n * Stu Cox\n * Richard Herrera\n * Veeck\n\n * MIT License\n */\n\n/*\n * Modernizr tests which native CSS3 and HTML5 features are available in the\n * current UA and makes the results available to you in two ways: as properties on\n * a global `Modernizr` object, and as classes on the `` element. This\n * information allows you to progressively enhance your pages with a granular level\n * of control over the experience.\n */\n\n(function (scriptGlobalObject, window, document, undefined) {\n var tests = [];\n\n /**\n * ModernizrProto is the constructor for Modernizr\n *\n * @class\n * @access public\n */\n var ModernizrProto = {\n _version: '3.11.4',\n\n // Any settings that don't work as separate modules\n // can go in here as configuration.\n _config: {\n classPrefix: '',\n enableClasses: true,\n enableJSClass: true,\n usePrefixes: true,\n },\n\n // Queue of tests\n _q: [],\n\n // Stub these for people who are listening\n on: function (test, cb) {\n // I don't really think people should do this, but we can\n // safe guard it a bit.\n // -- NOTE:: this gets WAY overridden in src/addTest for actual async tests.\n // This is in case people listen to synchronous tests. I would leave it out,\n // but the code to *disallow* sync tests in the real version of this\n // function is actually larger than this.\n var self = this;\n setTimeout(function () {\n cb(self[test]);\n }, 0);\n },\n\n addTest: function (name, fn, options) {\n tests.push({ name: name, fn: fn, options: options });\n },\n\n addAsyncTest: function (fn) {\n tests.push({ name: null, fn: fn });\n },\n };\n\n // Fake some of Object.create so we can force non test results to be non \"own\" properties.\n var Modernizr = function () {};\n Modernizr.prototype = ModernizrProto;\n\n // Leak modernizr globally when you `require` it rather than force it here.\n // Overwrite name so constructor name is nicer :D\n Modernizr = new Modernizr();\n\n var classes = [];\n\n /**\n * is returns a boolean if the typeof an obj is exactly type.\n *\n * @access private\n * @function is\n * @param {*} obj - A thing we want to check the type of\n * @param {string} type - A string to compare the typeof against\n * @returns {boolean} true if the typeof the first parameter is exactly the specified type, false otherwise\n */\n function is(obj, type) {\n return typeof obj === type;\n }\n\n /**\n * Run through all tests and detect their support in the current UA.\n *\n * @access private\n * @returns {void}\n */\n function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n\n for (var featureIdx in tests) {\n if (tests.hasOwnProperty(featureIdx)) {\n featureNames = [];\n feature = tests[featureIdx];\n // run the test, throw the return value into the Modernizr,\n // then based on that boolean, define an appropriate className\n // and push it into an array of classes we'll join later.\n //\n // If there is no name, it's an 'async' test that is run,\n // but not directly added to the object. That should\n // be done with a post-run addTest call.\n if (feature.name) {\n featureNames.push(feature.name.toLowerCase());\n\n if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n // Add all the aliases into the names list\n for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n }\n }\n }\n\n // Run the test, or use the raw value if it's not a function\n result = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\n // Set each of the names on the Modernizr object\n for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n featureName = featureNames[nameIdx];\n // Support dot properties as sub tests. We don't do checking to make sure\n // that the implied parent tests have been added. You must call them in\n // order (either in the test, or make the parent test a dependency).\n //\n // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n // hashtag famous last words\n featureNameSplit = featureName.split('.');\n\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = result;\n } else {\n // cast to a Boolean, if not one already or if it doesnt exist yet (like inputtypes)\n if (\n !Modernizr[featureNameSplit[0]] ||\n (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean))\n ) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n }\n\n classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n }\n }\n }\n }\n /**\n * docElement is a convenience wrapper to grab the root element of the document\n *\n * @access private\n * @returns {HTMLElement|SVGElement} The root element of the document\n */\n var docElement = document.documentElement;\n\n /**\n * A convenience helper to check if the document we are running in is an SVG document\n *\n * @access private\n * @returns {boolean}\n */\n var isSVG = docElement.nodeName.toLowerCase() === 'svg';\n\n /**\n * setClasses takes an array of class names and adds them to the root element\n *\n * @access private\n * @function setClasses\n * @param {string[]} classes - Array of class names\n */\n // Pass in an and array of class names, e.g.:\n // ['no-webp', 'borderradius', ...]\n function setClasses(classes) {\n var className = docElement.className;\n var classPrefix = Modernizr._config.classPrefix || '';\n\n if (isSVG) {\n className = className.baseVal;\n }\n\n // Change `no-js` to `js` (independently of the `enableClasses` option)\n // Handle classPrefix on this too\n if (Modernizr._config.enableJSClass) {\n var reJS = new RegExp('(^|\\\\s)' + classPrefix + 'no-js(\\\\s|$)');\n className = className.replace(reJS, '$1' + classPrefix + 'js$2');\n }\n\n if (Modernizr._config.enableClasses) {\n // Add the new classes\n if (classes.length > 0) {\n className += ' ' + classPrefix + classes.join(' ' + classPrefix);\n }\n if (isSVG) {\n docElement.className.baseVal = className;\n } else {\n docElement.className = className;\n }\n }\n }\n\n /**\n * hasOwnProp is a shim for hasOwnProperty that is needed for Safari 2.0 support\n *\n * @author kangax\n * @access private\n * @function hasOwnProp\n * @param {object} object - The object to check for a property\n * @param {string} property - The property to check for\n * @returns {boolean}\n */\n\n // hasOwnProperty shim by kangax needed for Safari 2.0 support\n var hasOwnProp;\n\n (function () {\n var _hasOwnProperty = {}.hasOwnProperty;\n /* istanbul ignore else */\n /* we have no way of testing IE 5.5 or safari 2,\n * so just assume the else gets hit */\n if (!is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined')) {\n hasOwnProp = function (object, property) {\n return _hasOwnProperty.call(object, property);\n };\n } else {\n hasOwnProp = function (object, property) {\n /* yes, this can give false positives/negatives, but most of the time we don't care about those */\n return property in object && is(object.constructor.prototype[property], 'undefined');\n };\n }\n })();\n\n // _l tracks listeners for async tests, as well as tests that execute after the initial run\n ModernizrProto._l = {};\n\n /**\n * Modernizr.on is a way to listen for the completion of async tests. Being\n * asynchronous, they may not finish before your scripts run. As a result you\n * will get a possibly false negative `undefined` value.\n *\n * @memberOf Modernizr\n * @name Modernizr.on\n * @access public\n * @function on\n * @param {string} feature - String name of the feature detect\n * @param {Function} cb - Callback function returning a Boolean - true if feature is supported, false if not\n * @returns {void}\n * @example\n *\n * ```js\n * Modernizr.on('flash', function( result ) {\n * if (result) {\n * // the browser has flash\n * } else {\n * // the browser does not have flash\n * }\n * });\n * ```\n */\n ModernizrProto.on = function (feature, cb) {\n // Create the list of listeners if it doesn't exist\n if (!this._l[feature]) {\n this._l[feature] = [];\n }\n\n // Push this test on to the listener list\n this._l[feature].push(cb);\n\n // If it's already been resolved, trigger it on next tick\n if (Modernizr.hasOwnProperty(feature)) {\n // Next Tick\n setTimeout(function () {\n Modernizr._trigger(feature, Modernizr[feature]);\n }, 0);\n }\n };\n\n /**\n * _trigger is the private function used to signal test completion and run any\n * callbacks registered through [Modernizr.on](#modernizr-on)\n *\n * @memberOf Modernizr\n * @name Modernizr._trigger\n * @access private\n * @function _trigger\n * @param {string} feature - string name of the feature detect\n * @param {Function|boolean} [res] - A feature detection function, or the boolean =\n * result of a feature detection function\n * @returns {void}\n */\n ModernizrProto._trigger = function (feature, res) {\n if (!this._l[feature]) {\n return;\n }\n\n var cbs = this._l[feature];\n\n // Force async\n setTimeout(function () {\n var i, cb;\n for (i = 0; i < cbs.length; i++) {\n cb = cbs[i];\n cb(res);\n }\n }, 0);\n\n // Don't trigger these again\n delete this._l[feature];\n };\n\n /**\n * addTest allows you to define your own feature detects that are not currently\n * included in Modernizr (under the covers it's the exact same code Modernizr\n * uses for its own [feature detections](https://github.com/Modernizr/Modernizr/tree/master/feature-detects)).\n * Just like the official detects, the result\n * will be added onto the Modernizr object, as well as an appropriate className set on\n * the html element when configured to do so\n *\n * @memberOf Modernizr\n * @name Modernizr.addTest\n * @optionName Modernizr.addTest()\n * @optionProp addTest\n * @access public\n * @function addTest\n * @param {string|object} feature - The string name of the feature detect, or an\n * object of feature detect names and test\n * @param {Function|boolean} test - Function returning true if feature is supported,\n * false if not. Otherwise a boolean representing the results of a feature detection\n * @returns {object} the Modernizr object to allow chaining\n * @example\n *\n * The most common way of creating your own feature detects is by calling\n * `Modernizr.addTest` with a string (preferably just lowercase, without any\n * punctuation), and a function you want executed that will return a boolean result\n *\n * ```js\n * Modernizr.addTest('itsTuesday', function() {\n * var d = new Date();\n * return d.getDay() === 2;\n * });\n * ```\n *\n * When the above is run, it will set Modernizr.itstuesday to `true` when it is tuesday,\n * and to `false` every other day of the week. One thing to notice is that the names of\n * feature detect functions are always lowercased when added to the Modernizr object. That\n * means that `Modernizr.itsTuesday` will not exist, but `Modernizr.itstuesday` will.\n *\n *\n * Since we only look at the returned value from any feature detection function,\n * you do not need to actually use a function. For simple detections, just passing\n * in a statement that will return a boolean value works just fine.\n *\n * ```js\n * Modernizr.addTest('hasjquery', 'jQuery' in window);\n * ```\n *\n * Just like before, when the above runs `Modernizr.hasjquery` will be true if\n * jQuery has been included on the page. Not using a function saves a small amount\n * of overhead for the browser, as well as making your code much more readable.\n *\n * Finally, you also have the ability to pass in an object of feature names and\n * their tests. This is handy if you want to add multiple detections in one go.\n * The keys should always be a string, and the value can be either a boolean or\n * function that returns a boolean.\n *\n * ```js\n * var detects = {\n * 'hasjquery': 'jQuery' in window,\n * 'itstuesday': function() {\n * var d = new Date();\n * return d.getDay() === 2;\n * }\n * }\n *\n * Modernizr.addTest(detects);\n * ```\n *\n * There is really no difference between the first methods and this one, it is\n * just a convenience to let you write more readable code.\n */\n function addTest(feature, test) {\n if (typeof feature === 'object') {\n for (var key in feature) {\n if (hasOwnProp(feature, key)) {\n addTest(key, feature[key]);\n }\n }\n } else {\n feature = feature.toLowerCase();\n var featureNameSplit = feature.split('.');\n var last = Modernizr[featureNameSplit[0]];\n\n // Again, we don't check for parent test existence. Get that right, though.\n if (featureNameSplit.length === 2) {\n last = last[featureNameSplit[1]];\n }\n\n if (typeof last !== 'undefined') {\n // we're going to quit if you're trying to overwrite an existing test\n // if we were to allow it, we'd do this:\n // var re = new RegExp(\"\\\\b(no-)?\" + feature + \"\\\\b\");\n // docElement.className = docElement.className.replace( re, '' );\n // but, no rly, stuff 'em.\n return Modernizr;\n }\n\n test = typeof test === 'function' ? test() : test;\n\n // Set the value (this is the magic, right here).\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = test;\n } else {\n // cast to a Boolean, if not one already\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = test;\n }\n\n // Set a single class (either `feature` or `no-feature`)\n setClasses([(!!test && test !== false ? '' : 'no-') + featureNameSplit.join('-')]);\n\n // Trigger the event\n Modernizr._trigger(feature, test);\n }\n\n return Modernizr; // allow chaining.\n }\n\n // After all the tests are run, add self to the Modernizr prototype\n Modernizr._q.push(function () {\n ModernizrProto.addTest = addTest;\n });\n\n /*!\n{\n \"name\": \"Webp\",\n \"async\": true,\n \"property\": \"webp\",\n \"caniuse\": \"webp\",\n \"tags\": [\"image\"],\n \"builderAliases\": [\"img_webp\"],\n \"authors\": [\"Krister Kari\", \"@amandeep\", \"Rich Bradshaw\", \"Ryan Seddon\", \"Paul Irish\"],\n \"notes\": [{\n \"name\": \"Webp Info\",\n \"href\": \"https://developers.google.com/speed/webp/\"\n }, {\n \"name\": \"Chromium blog - Chrome 32 Beta: Animated WebP images and faster Chrome for Android touch input\",\n \"href\": \"https://blog.chromium.org/2013/11/chrome-32-beta-animated-webp-images-and.html\"\n }, {\n \"name\": \"Webp Lossless Spec\",\n \"href\": \"https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification\"\n }, {\n \"name\": \"Article about WebP support\",\n \"href\": \"https://optimus.keycdn.com/support/webp-support/\"\n }, {\n \"name\": \"Chromium WebP announcement\",\n \"href\": \"https://blog.chromium.org/2011/11/lossless-and-transparency-encoding-in.html?m=1\"\n }]\n}\n!*/\n /* DOC\nTests for lossy, non-alpha webp support.\n\nTests for all forms of webp support (lossless, lossy, alpha, and animated)..\n\n Modernizr.webp // Basic support (lossy)\n Modernizr.webp.lossless // Lossless\n Modernizr.webp.alpha // Alpha (both lossy and lossless)\n Modernizr.webp.animation // Animated WebP\n\n*/\n\n Modernizr.addAsyncTest(function () {\n var webpTests = [\n {\n uri: 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=',\n name: 'webp',\n },\n {\n uri: 'data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==',\n name: 'webp.alpha',\n },\n {\n uri: 'data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA',\n name: 'webp.animation',\n },\n {\n uri: 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=',\n name: 'webp.lossless',\n },\n ];\n\n var webp = webpTests.shift();\n function test(name, uri, cb) {\n var image = new Image();\n\n function addResult(event) {\n // if the event is from 'onload', check the see if the image's width is\n // 1 pixel (which indicates support). otherwise, it fails\n\n var result = event && event.type === 'load' ? image.width === 1 : false;\n var baseTest = name === 'webp';\n\n // if it is the base test, and the result is false, just set a literal false\n // rather than use the Boolean constructor\n addTest(name, baseTest && result ? new Boolean(result) : result);\n\n if (cb) {\n cb(event);\n }\n }\n\n image.onerror = addResult;\n image.onload = addResult;\n\n image.src = uri;\n }\n\n // test for webp support in general\n test(webp.name, webp.uri, function (e) {\n // if the webp test loaded, test everything else.\n if (e && e.type === 'load') {\n for (var i = 0; i < webpTests.length; i++) {\n test(webpTests[i].name, webpTests[i].uri);\n }\n }\n });\n });\n\n /*!\n{\n \"name\": \"Webp Alpha\",\n \"async\": true,\n \"property\": \"webpalpha\",\n \"aliases\": [\"webp-alpha\"],\n \"tags\": [\"image\"],\n \"authors\": [\"Krister Kari\", \"Rich Bradshaw\", \"Ryan Seddon\", \"Paul Irish\"],\n \"notes\": [{\n \"name\": \"WebP Info\",\n \"href\": \"https://developers.google.com/speed/webp/\"\n }, {\n \"name\": \"Article about WebP support\",\n \"href\": \"https://optimus.keycdn.com/support/webp-support/\"\n }, {\n \"name\": \"Chromium WebP announcement\",\n \"href\": \"https://blog.chromium.org/2011/11/lossless-and-transparency-encoding-in.html?m=1\"\n }]\n}\n!*/\n /* DOC\nTests for transparent webp support.\n*/\n\n Modernizr.addAsyncTest(function () {\n var image = new Image();\n\n image.onerror = function () {\n addTest('webpalpha', false, { aliases: ['webp-alpha'] });\n };\n\n image.onload = function () {\n addTest('webpalpha', image.width === 1, { aliases: ['webp-alpha'] });\n };\n\n image.src =\n 'data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==';\n });\n\n /*!\n{\n \"name\": \"Webp Animation\",\n \"async\": true,\n \"property\": \"webpanimation\",\n \"aliases\": [\"webp-animation\"],\n \"tags\": [\"image\"],\n \"authors\": [\"Krister Kari\", \"Rich Bradshaw\", \"Ryan Seddon\", \"Paul Irish\"],\n \"notes\": [{\n \"name\": \"WebP Info\",\n \"href\": \"https://developers.google.com/speed/webp/\"\n }, {\n \"name\": \"Chromium blog - Chrome 32 Beta: Animated WebP images and faster Chrome for Android touch input\",\n \"href\": \"https://blog.chromium.org/2013/11/chrome-32-beta-animated-webp-images-and.html\"\n }]\n}\n!*/\n /* DOC\nTests for animated webp support.\n*/\n\n Modernizr.addAsyncTest(function () {\n var image = new Image();\n\n image.onerror = function () {\n addTest('webpanimation', false, { aliases: ['webp-animation'] });\n };\n\n image.onload = function () {\n addTest('webpanimation', image.width === 1, { aliases: ['webp-animation'] });\n };\n\n image.src =\n 'data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA';\n });\n\n /*!\n{\n \"name\": \"Webp Lossless\",\n \"async\": true,\n \"property\": [\"webplossless\", \"webp-lossless\"],\n \"tags\": [\"image\"],\n \"authors\": [\"@amandeep\", \"Rich Bradshaw\", \"Ryan Seddon\", \"Paul Irish\"],\n \"notes\": [{\n \"name\": \"Webp Info\",\n \"href\": \"https://developers.google.com/speed/webp/\"\n }, {\n \"name\": \"Webp Lossless Spec\",\n \"href\": \"https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification\"\n }]\n}\n!*/\n /* DOC\nTests for non-alpha lossless webp support.\n*/\n\n Modernizr.addAsyncTest(function () {\n var image = new Image();\n\n image.onerror = function () {\n addTest('webplossless', false, { aliases: ['webp-lossless'] });\n };\n\n image.onload = function () {\n addTest('webplossless', image.width === 1, { aliases: ['webp-lossless'] });\n };\n\n image.src = 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=';\n });\n\n // Run each test\n testRunner();\n\n // Remove the \"no-js\" class if it exists\n setClasses(classes);\n\n delete ModernizrProto.addTest;\n delete ModernizrProto.addAsyncTest;\n\n // Run the things that are supposed to run after the tests\n for (var i = 0; i < Modernizr._q.length; i++) {\n Modernizr._q[i]();\n }\n\n // Leak Modernizr namespace\n scriptGlobalObject.Modernizr = Modernizr;\n})(window, window, document);\n"]}