{"version":3,"sources":["jsdelivr-header.js","/npm/badges@4.40.0/edition-browsers/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,UCLY,WAAY,qBACf,eAQF,SAAS,YAAY,EAAW,EAAS,CAAC,GAC7C,GAAkB,QAAd,EACA,MAAO,iCAIX,MAAM,EAAc,OAAO,GAErB,EAAc,EAAY,GAAQ,OACxC,IAAK,EACD,MAAO,GAEX,MAAM,GAA0C,IAA5B,EAAY,YAAwB,MAAQ,OAGhE,MAFsB,IAAI,kBAA4B,MAAc,MAAgB,IAGxF,QAQO,SAAS,aAAa,EAAM,EAAS,CAAC,EAAG,EAAU,CAAE,gBAAgB,EAAO,eAAe,IAE9F,MAAM,EAAU,GAyChB,OAvCA,EAAK,SAAQ,SAAU,GACnB,IAAI,EAAc,EAOlB,GALI,MAAM,QAAQ,KACd,EAAc,EAAU,GACxB,EAAY,EAAU,IAGR,QAAd,GAEA,GAAI,EAAQ,eACR,WAGH,CAED,MAAM,EAAQ,OAAO,GACrB,IAAI,EAWA,MAAM,IAAI,MAAM,aAAa,oBAT7B,GAAI,EAAQ,gBACR,EAAQ,iBAAmB,EAAM,cACjC,OAEJ,GAAI,EAAQ,eAAiB,EAAM,YAC/B,MAMZ,CAEA,MAAM,EAAc,YAAY,EAAW,GAAa,OACnD,GAGL,EAAQ,KAAK,EACjB,IAEO,EAAQ,KAAK,KACxB","file":"/npm/badges@4.40.0/edition-browsers/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/badges@4.40.0/edition-browsers/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Import\nimport * as badges from './badges.js';\nexport { badges };\n/**\n * Render a specified badge with the appropriate wrapping (div if block badge, span if inline badge)\n * @method renderBadge\n * @param badgeName The name of the badge to render\n * @param config The configuration to pass to the badge render method\n * @return The rendered badge\n */\nexport function renderBadge(badgeName, config = {}) {\n    if (badgeName === '---') {\n        return '<br class=\"badge-separator\" />';\n    }\n    // Fetch\n    // @ts-ignore\n    const badgeMethod = badges[badgeName];\n    // Send the badge value and options to the render method\n    const badgeResult = badgeMethod(config).trim();\n    if (!badgeResult)\n        return '';\n    // We have a result, so let's wrap it\n    const elementName = badgeMethod.badgeInline === false ? 'div' : 'span';\n    const wrappedResult = `<${elementName} class=\"badge-${badgeName}\">${badgeResult}</${elementName}>`;\n    // Done\n    return wrappedResult;\n}\n/**\n * Render specified badges with wrapping\n * @param list The list of badge names to render\n * @param config The configuration to render the badge with\n * @param options An object that defaults to `{filterCategory: false, filterScripts: false}`\n * @return The rendered badges\n */\nexport function renderBadges(list, config = {}, options = { filterCategory: false, filterScripts: true }) {\n    // Prepare\n    const results = [];\n    // Render the badges\n    list.forEach(function (badgeName) {\n        let badgeConfig = config;\n        // Custom Config?\n        if (Array.isArray(badgeName)) {\n            badgeConfig = badgeName[1];\n            badgeName = badgeName[0];\n        }\n        // Seperator?\n        if (badgeName === '---') {\n            // Do not render seperators if we only wanted a single category\n            if (options.filterCategory)\n                return;\n        }\n        // Exists?\n        else {\n            // @ts-ignore\n            const badge = badges[badgeName];\n            if (badge) {\n                // Category?\n                if (options.filterCategory &&\n                    options.filterCategory !== badge.badgeCategory)\n                    return;\n                // Script?\n                if (options.filterScripts && badge.badgeScript)\n                    return;\n            }\n            // Doesn't exist\n            else {\n                throw new Error(`the badge ${badgeName} does not exist`);\n            }\n        }\n        // Render\n        const badgeResult = renderBadge(badgeName, badgeConfig).trim();\n        if (!badgeResult)\n            return;\n        // Rendered successfully, add the result\n        results.push(badgeResult);\n    });\n    // Return\n    return results.join('\\n');\n}\n"]}