{
  "version": 3,
  "sources": ["../src/main.ts"],
  "sourcesContent": ["/**\n * Validates an Iranian National Code (Code Melli).\n *\n * The validation is based on the official algorithm:\n * 1. The code must be 10 digits.\n * 2. The last digit is a check digit.\n * 3. A weighted sum of the first 9 digits is calculated.\n * 4. The remainder of the sum divided by 11 is compared with the check digit based on a specific rule.\n *\n * @param str The Iranian National Code to validate.\n * @returns `true` if the national code is valid, `false` otherwise.\n *\n * @example\n * ```ts\n * console.log(isValidIranianNationalCode('0018550152')); // true\n * console.log(isValidIranianNationalCode('0018550153')); // false\n * console.log(isValidIranianNationalCode('12345')); // false\n * ```\n */\nexport function isValidIranianNationalCode(str: string): boolean {\n  if (!/^\\d{10}$/.test(str)) return false;\n\n  const check = +str[9];\n  const sum = str.split('').slice(0, 9).reduce((acc, x, i) => acc + +x * (10 - i), 0) % 11;\n\n  return sum < 2 ? check === sum : check + sum === 11;\n}\n"],
  "mappings": ";qqBAAA,iJAmBO,SAAS,2BAA2B,IAAsB,CAC/D,GAAI,CAAC,WAAW,KAAK,GAAG,EAAG,MAAO,OAElC,MAAM,MAAQ,CAAC,IAAI,CAAC,EACpB,MAAM,IAAM,IAAI,MAAM,EAAE,EAAE,MAAM,EAAG,CAAC,EAAE,OAAO,CAAC,IAAK,EAAG,IAAM,KAAM,CAAC,GAAK,GAAK,GAAI,CAAC,EAAI,GAEtF,OAAO,IAAM,EAAI,QAAU,IAAM,MAAQ,MAAQ,EACnD",
  "names": []
}
