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,EAAI,GAExB,GACA","file":"/npm/postcss-purifycss@1.1.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/postcss-purifycss@1.1.0/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","const assert = require('assert');\nconst postcss = require('postcss');\nconst purifyCss = require('purify-css');\n\nmodule.exports = postcss.plugin(\n  'purifycss',\n  ({ content, whitelist, purifyOptions }) => css => {\n    if (!whitelist) whitelist = [];\n\n    assert(\n      Array.isArray(content) && content.every(e => typeof e === 'string'),\n      \"'content' must be an array with String items\"\n    );\n    assert(\n      Array.isArray(whitelist) &&\n        whitelist.every(e => typeof e === 'string' || e instanceof RegExp),\n      \"'whitelist' must be an array with String or RegExp items when provided\"\n    );\n    assert(\n      !purifyOptions ||\n        (typeof purifyOptions === 'object' && !Array.isArray(purifyOptions)),\n      \"'purifyOptions' must be an object when provided\"\n    );\n\n    const ignored = [];\n    const toParse = [];\n    let ignoreNextRules = false;\n    let ignoreNextRule = false;\n\n    whitelist = whitelist.map(e => (e instanceof String ? new RegEx(e) : e));\n\n    css.walk(rule => {\n      if (rule.type === 'atrule') {\n        ignored.push(rule);\n      } else if (rule.type === 'comment') {\n        const text = rule.toString();\n\n        if (/^!?\\s?purifycss:ignore start\\s?$/.test(text)) {\n          // ignore next rules while using comment `/* purifycss:ignore start */`\n          ignoreNextRules = true;\n        } else if (/^!?\\s?purifycss:ignore end\\s?$/.test(text)) {\n          // until `/* purifycss:ignore end */` was found\n          ignoreNextRules = false;\n        } else if (/^!?\\s?purifycss:ignore\\s?$/.test(text)) {\n          // ignore next rule while using comment `/* purifycss:ignore */`\n          ignoreNextRule = true;\n        } else if (!/#\\s?sourceMappingURL=/i.test(text)) {\n          toParse.push(text);\n        }\n      } else if (rule.type === 'rule') {\n        if (\n          ignoreNextRules ||\n          ignoreNextRule ||\n          whitelist.some(r => r.test(rule.selector))\n        ) {\n          if (ignoreNextRule) ignoreNextRule = false;\n\n          ignored.push(rule);\n        } else {\n          toParse.push(rule.toString());\n        }\n      }\n\n      // if last rule\n      if (rule === css.nodes[css.nodes.length - 1]) {\n        purifyCss(content, toParse.join('\\n'), purifyOptions, output => {\n          const parsed = postcss.parse(output);\n          const out = ignored.concat(parsed);\n\n          out.sort((a, b) =>\n            (a.name || a.selector || '').localeCompare(\n              b.name || b.selector || ''\n            )\n          );\n\n          css.replaceWith(out);\n        });\n      }\n    });\n  }\n);\n"]}