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EpB,EAAS,MAAM,gBAAgB,IAAI,KAAK,KAAK,IAC3C,MAAM,KACJ,EAAI,OACJ,EAAM,QACN,GACE,OAAO,KAAK,IAAK,EAAS,GAC9B,EAAY,MAAM,cAAc,WAAW,KAAK,KAAK,UAEnD,MAAM,EAAQ,EAAS,cAAgB,IAAI,EAAS,eAAe,QAAO,GAAQ,QAAQ,EAAM,EAAQ,CACtG,KAAK,MACA,QAAQ,EAAM,EAAS,CAC5B,KAAK,MACD,OAAO,KAAK,EAAQ,CACxB,KAAK,EACL,OAAQ,IAEV,GAAI,EAAU,EACZ,IAAK,MAAM,KAAQ,EACjB,EAAK,WAAW,EAAM,OAAO,EAAQ,gBAE9B,EAAM,OAAS,GACxB,EAAK,WAAW,EAAO,OAAO,EAAQ,UACxC,IA4BF,EAAY,MAAM,iBAAiB,WAAW,KAAK,KAtBnD,iBACE,MAAM,OACJ,EAAM,SACN,EAAQ,oBACR,SACQ,IACN,IAAa,EAAQ,cACvB,EAAY,SAAS,KAAK,GACjB,GAAY,EAAQ,eAC7B,EAAY,OAAO,KAAK,GAEtB,GAAU,EAAQ,YACpB,EAAY,OAAO,KAAK,GACf,IAAW,EAAQ,aAC5B,EAAY,SAAS,KAAK,GAExB,SACI,EAAoB,EAE9B,GAGuE,GAE3E,CAMA,UAAA,CAAW,GACT,OAAK,KAAK,QAAQ,QAGb,WAAW,KAAK,QAAQ,SAGtB,KAAK,QAAQ,QAFX,KAAK,OAAO,EAAS,QAAQ,SAAU,KAAK,QAAQ,SAHpD,OAAO,EAAS,QAAQ,QAMnC,EAEF,OAAO,QAAU","file":"/npm/stylelint-webpack-plugin@5.1.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/stylelint-webpack-plugin@5.1.0/dist/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","\"use strict\";\n\nconst {\n  isAbsolute,\n  join\n} = require(\"node:path\");\nconst globby = require(\"globby\");\nconst {\n  isMatch\n} = require(\"micromatch\");\nconst linter = require(\"./linter\");\nconst {\n  getOptions\n} = require(\"./options\");\nconst {\n  arrify,\n  parseFiles,\n  parseFoldersToGlobs\n} = require(\"./utils\");\n\n/** @typedef {import('webpack').Compiler} Compiler */\n/** @typedef {import('webpack').Module} Module */\n/** @typedef {import('./options').Options} Options */\n/** @typedef {Partial<{ timestamp:number } | number>} FileSystemInfoEntry */\n\nconst STYLELINT_PLUGIN = \"StylelintWebpackPlugin\";\nlet counter = 0;\nclass StylelintWebpackPlugin {\n  /**\n   * @param {Options=} options options\n   */\n  constructor(options = {}) {\n    this.key = STYLELINT_PLUGIN;\n    this.options = getOptions(options);\n    this.run = this.run.bind(this);\n    this.startTime = Date.now();\n    this.prevTimestamps = new Map();\n  }\n\n  /**\n   * @param {Compiler} compiler compiler\n   * @returns {void}\n   */\n  apply(compiler) {\n    // Generate key for each compilation,\n    // this differentiates one from the other when being cached.\n    this.key = compiler.name || `${this.key}_${counter += 1}`;\n    const context = this.getContext(compiler);\n    const excludeDefault = [\"**/node_modules/**\", String(compiler.options.output.path)];\n    const options = {\n      ...this.options,\n      context,\n      exclude: parseFiles(this.options.exclude || excludeDefault, context),\n      extensions: arrify(this.options.extensions),\n      files: parseFiles(this.options.files || \"\", context)\n    };\n    const wanted = parseFoldersToGlobs(options.files, options.extensions);\n    const exclude = parseFoldersToGlobs(options.exclude);\n\n    // If `lintDirtyModulesOnly` is disabled,\n    // execute the linter on the build\n    if (!this.options.lintDirtyModulesOnly) {\n      compiler.hooks.run.tapPromise(this.key, compiler => this.run(compiler, options, wanted, exclude));\n    }\n    let hasCompilerRunByDirtyModule = this.options.lintDirtyModulesOnly;\n    compiler.hooks.watchRun.tapPromise(this.key, compiler => {\n      if (hasCompilerRunByDirtyModule) {\n        hasCompilerRunByDirtyModule = false;\n        return Promise.resolve();\n      }\n      return this.run(compiler, options, wanted, exclude);\n    });\n  }\n\n  /**\n   * @param {Compiler} compiler compiler\n   * @param {Options} options options\n   * @param {string[]} wanted wanted files\n   * @param {string[]} exclude exclude files\n   */\n  async run(compiler, options, wanted, exclude) {\n    // Do not re-hook\n    const isCompilerHooked = compiler.hooks.thisCompilation.taps.find(({\n      name\n    }) => name === this.key);\n    if (isCompilerHooked) return;\n    compiler.hooks.thisCompilation.tap(this.key, compilation => {\n      const {\n        lint,\n        report,\n        threads\n      } = linter(this.key, options, compilation);\n      compilation.hooks.finishModules.tapPromise(this.key, async () => {\n        /** @type {string[]} */\n        const files = compiler.modifiedFiles ? [...compiler.modifiedFiles].filter(file => isMatch(file, wanted, {\n          dot: true\n        }) && !isMatch(file, exclude, {\n          dot: true\n        })) : globby.sync(wanted, {\n          dot: true,\n          ignore: exclude\n        });\n        if (threads > 1) {\n          for (const file of files) {\n            lint(parseFiles(file, String(options.context)));\n          }\n        } else if (files.length > 0) {\n          lint(parseFiles(files, String(options.context)));\n        }\n      });\n\n      /**\n       * @returns {Promise<void>}\n       */\n      async function processResults() {\n        const {\n          errors,\n          warnings,\n          generateReportAsset\n        } = await report();\n        if (warnings && !options.failOnWarning) {\n          compilation.warnings.push(warnings);\n        } else if (warnings && options.failOnWarning) {\n          compilation.errors.push(warnings);\n        }\n        if (errors && options.failOnError) {\n          compilation.errors.push(errors);\n        } else if (errors && !options.failOnError) {\n          compilation.warnings.push(errors);\n        }\n        if (generateReportAsset) {\n          await generateReportAsset(compilation);\n        }\n      }\n\n      // await and interpret results\n      compilation.hooks.additionalAssets.tapPromise(this.key, processResults);\n    });\n  }\n\n  /**\n   * @param {Compiler} compiler compiler\n   * @returns {string} context\n   */\n  getContext(compiler) {\n    if (!this.options.context) {\n      return String(compiler.options.context);\n    }\n    if (!isAbsolute(this.options.context)) {\n      return join(String(compiler.options.context), this.options.context);\n    }\n    return this.options.context;\n  }\n}\nmodule.exports = StylelintWebpackPlugin;"]}