{"version":3,"sources":["jsdelivr-header.js","/npm/badgen@3.2.3/src/index.ts","/npm/badgen@3.2.3/src/calc-text-width.ts","/npm/badgen@3.2.3/src/color-presets.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,itzBCNA,EAAA,GAAA,EAAA,EAAA,CAAA,OAAA,IAAA,EAAA,UAAA,IAAA,IAAA,OAAA,QAAA,EAAA,GCEA,IAAM,EAA6B,IAE7B,EAAY,IAChB,IAAM,EAAgB,EAAe,IAErC,MAAO,KAAK,MACV,IAAI,EAAQ,EACR,EAAY,EACZ,EAAI,EAAK,OACb,KAAO,KACL,EAAY,EAAe,EAAK,GAAG,cACnC,QAAuB,IAAd,EAA0B,EAAgB,EAErD,OAAO,EACT,EAGW,EAAa,EAAU,GCnB7B,EAAQ,CACb,MAAO,MACP,KAAM,MACN,IAAK,MACL,OAAQ,MACR,OAAQ,MACR,OAAQ,MACR,KAAM,MACN,KAAM,MACN,KAAM,MACN,KAAM,MACN,MAAO,UFQF,SAAA,GACL,MAAA,EACA,QAAA,EACA,OAAA,EACA,MAAA,EAAQ,OACR,MAAA,EACA,KAAA,EACA,UAAA,EAAY,GACZ,WAAA,EAAa,MACb,MAAA,EAAQ,IAKR,GAHA,EAA6B,iBAAX,EAAqB,6BAEvC,OAAkB,IAAV,EAAsB,EAAU,KACzB,EACb,OAAO,EAAK,CAAE,OAAA,EAAQ,MAAA,EAAO,MAAA,EAAO,MAAA,IAGtC,EAAQ,EAAa,IAAU,EAC/B,EAAa,EAAa,IAAe,EACzC,GAAwB,GAExB,IAAM,EAAgB,EAAQ,MAAA,KAAO,OAAS,EAAY,GAAK,EAAY,GAAM,EAC3E,EAAc,EAAQ,EAAgB,GAAM,GAC5C,EAAc,EAAQ,EAAU,GAAS,EACzC,EAAc,EAAU,GACxB,EAAc,EAAc,IAAM,EAClC,EAAc,EAAc,IAC5B,EAAQ,EAAc,EACtB,EAAQ,EAAO,8CAAgD,GAE/D,EAAa,EAAiB,GA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,oCACa,gKAIV,mBAAwB,iEACpB,0BACC,0BAAoC,gCACpC,8BAAwC,8KAGpB,iCAA2C,kDAC3C,MAAgB,0BAGvD,CAEA,SAAA,EAAmB,GACjB,OAAO,EACJ,QAAQ,UAAW,SACnB,QAAQ,UAAW,QACnB,QAAQ,UAAW,QACnB,QAAQ,UAAW,UACnB,QAAQ,UAAW,SACxB,CAOA,SAAA,EAA0B,GACxB,IAAM,EAAa,uDACf,EAAS,GAEb,QAAS,EAAI,EAAG,EAAI,EAAQ,IAC1B,GAAU,EAAW,OAAO,KAAK,MAAsB,GAAhB,KAAK,WAG9C,OAAO,CACT,CAEA,SAAA,GAA+B,MAAA,EAAO,OAAA,IAEpC,OADoB,EAAQ,GAAG,MAAY,IACtB,CACvB,CAEA,SAAA,EAAqB,EAAoB,GACvC,IAAK,EAAW,MAAM,IAAI,UAAU,EACtC,CAQsB,iBAAX,SACT,OAAO,OAAS","file":"/npm/badgen@3.2.3/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/badgen@3.2.3/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","export { Verdana110 as calcWidth } from './calc-text-width'\nimport { Verdana110 as calcWidth } from './calc-text-width'\nimport colorPresets from './color-presets'\n\nexport type StyleOption = 'flat' | 'classic'\nexport type ColorPreset = keyof typeof colorPresets\n\nexport interface BadgenOptions {\n  status: string;\n  subject?: string;\n  color?: ColorPreset;\n  label?: string;\n  labelColor?: string\n  style?: StyleOption;\n  icon?: string;\n  iconWidth?: number;\n  scale?: number\n}\n\nexport function badgen ({\n  label,\n  subject,\n  status,\n  color = 'blue',\n  style,\n  icon,\n  iconWidth = 13,\n  labelColor = '555',\n  scale = 1\n}: BadgenOptions) {\n  typeAssert(typeof status === 'string', '<status> must be string')\n\n  label = label === undefined ? subject : label // subject is deprecated\n  if (!label && !icon) {\n    return bare({ status, color, style, scale })\n  }\n\n  color = colorPresets[color] || color\n  labelColor = colorPresets[labelColor] || labelColor\n  iconWidth = iconWidth * 10\n\n  const iconSpanWidth = icon ? (label?.length ? iconWidth + 30 : iconWidth - 18) : 0\n  const sbTextStart = icon ? (iconSpanWidth + 50) : 50\n  const sbTextWidth = label ? calcWidth(label) : 0\n  const stTextWidth = calcWidth(status)\n  const sbRectWidth = sbTextWidth + 100 + iconSpanWidth\n  const stRectWidth = stTextWidth + 100\n  const width = sbRectWidth + stRectWidth\n  const xlink = icon ? ' xmlns:xlink=\"http://www.w3.org/1999/xlink\"' : ''\n\n  const gradientId = generateRandomID(5)\n  const maskId = generateRandomID(5)\n\n  label = label ? sanitize(label) : ''\n  status = sanitize(status)\n  color = sanitize(color)\n  labelColor = sanitize(labelColor)\n  icon = icon ? sanitize(icon) : icon\n  const accessibleText = createAccessibleText({label, status})\n\n  if (style === 'flat') {\n    return `<svg width=\"${scale * width / 10}\" height=\"${scale * 20}\" viewBox=\"0 0 ${width} 200\" xmlns=\"http://www.w3.org/2000/svg\"${xlink} role=\"img\" aria-label=\"${accessibleText}\">\n  <title>${accessibleText}</title>\n  <g>\n    <rect fill=\"#${labelColor}\" width=\"${sbRectWidth}\" height=\"200\"/>\n    <rect fill=\"#${color}\" x=\"${sbRectWidth}\" width=\"${stRectWidth}\" height=\"200\"/>\n  </g>\n  <g aria-hidden=\"true\" fill=\"#fff\" text-anchor=\"start\" font-family=\"Verdana,DejaVu Sans,sans-serif\" font-size=\"110\">\n    <text x=\"${sbTextStart + 10}\" y=\"148\" textLength=\"${sbTextWidth}\" fill=\"#000\" opacity=\"0.1\">${label}</text>\n    <text x=\"${sbTextStart}\" y=\"138\" textLength=\"${sbTextWidth}\">${label}</text>\n    <text x=\"${sbRectWidth + 55}\" y=\"148\" textLength=\"${stTextWidth}\" fill=\"#000\" opacity=\"0.1\">${status}</text>\n    <text x=\"${sbRectWidth + 45}\" y=\"138\" textLength=\"${stTextWidth}\">${status}</text>\n  </g>\n  ${icon ? `<image x=\"40\" y=\"35\" width=\"${iconWidth}\" height=\"132\" xlink:href=\"${icon}\"/>` : ''}\n</svg>`\n  }\n\n  return `<svg width=\"${scale * width / 10}\" height=\"${scale * 20}\" viewBox=\"0 0 ${width} 200\" xmlns=\"http://www.w3.org/2000/svg\"${xlink} role=\"img\" aria-label=\"${accessibleText}\">\n  <title>${accessibleText}</title>\n  <linearGradient id=\"${gradientId}\" x2=\"0\" y2=\"100%\">\n    <stop offset=\"0\" stop-opacity=\".1\" stop-color=\"#EEE\"/>\n    <stop offset=\"1\" stop-opacity=\".1\"/>\n  </linearGradient>\n  <mask id=\"${maskId}\"><rect width=\"${width}\" height=\"200\" rx=\"30\" fill=\"#FFF\"/></mask>\n  <g mask=\"url(#${maskId})\">\n    <rect width=\"${sbRectWidth}\" height=\"200\" fill=\"#${labelColor}\"/>\n    <rect width=\"${stRectWidth}\" height=\"200\" fill=\"#${color}\" x=\"${sbRectWidth}\"/>\n    <rect width=\"${width}\" height=\"200\" fill=\"url(#${gradientId})\"/>\n  </g>\n  <g aria-hidden=\"true\" fill=\"#fff\" text-anchor=\"start\" font-family=\"Verdana,DejaVu Sans,sans-serif\" font-size=\"110\">\n    <text x=\"${sbTextStart + 10}\" y=\"148\" textLength=\"${sbTextWidth}\" fill=\"#000\" opacity=\"0.25\">${label}</text>\n    <text x=\"${sbTextStart}\" y=\"138\" textLength=\"${sbTextWidth}\">${label}</text>\n    <text x=\"${sbRectWidth + 55}\" y=\"148\" textLength=\"${stTextWidth}\" fill=\"#000\" opacity=\"0.25\">${status}</text>\n    <text x=\"${sbRectWidth + 45}\" y=\"138\" textLength=\"${stTextWidth}\">${status}</text>\n  </g>\n  ${icon ? `<image x=\"40\" y=\"35\" width=\"${iconWidth}\" height=\"130\" xlink:href=\"${icon}\"/>` : ''}\n</svg>`\n}\n\nfunction bare ({ status, color = 'blue', style, scale = 1 }: BadgenOptions) {\n  typeAssert(typeof status === 'string', '<status> must be string')\n  color = colorPresets[color] || color || colorPresets.blue\n\n  const stTextWidth = calcWidth(status)\n  const stRectWidth = stTextWidth + 115\n\n  const gradientId = generateRandomID(5)\n  const maskId = generateRandomID(5)\n\n  status = sanitize(status)\n  color = sanitize(color)\n\n  if (style === 'flat') {\n    return `<svg width=\"${scale * stRectWidth / 10}\" height=\"${scale * 20}\" viewBox=\"0 0 ${stRectWidth} 200\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-label=\"${status}\">\n  <title>${status}</title>\n  <g>\n    <rect fill=\"#${color}\" x=\"0\" width=\"${stRectWidth}\" height=\"200\"/>\n  </g>\n  <g aria-hidden=\"true\" fill=\"#fff\" text-anchor=\"start\" font-family=\"Verdana,DejaVu Sans,sans-serif\" font-size=\"110\">\n    <text x=\"65\" y=\"148\" textLength=\"${stTextWidth}\" fill=\"#000\" opacity=\"0.1\">${status}</text>\n    <text x=\"55\" y=\"138\" textLength=\"${stTextWidth}\">${status}</text>\n  </g>\n</svg>`\n  }\n\n  return `<svg width=\"${scale * stRectWidth / 10}\" height=\"${scale * 20}\" viewBox=\"0 0 ${stRectWidth} 200\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-label=\"${status}\">\n  <title>${status}</title>\n  <linearGradient id=\"${gradientId}\" x2=\"0\" y2=\"100%\">\n    <stop offset=\"0\" stop-opacity=\".1\" stop-color=\"#EEE\"/>\n    <stop offset=\"1\" stop-opacity=\".1\"/>\n  </linearGradient>\n  <mask id=\"${maskId}\"><rect width=\"${stRectWidth}\" height=\"200\" rx=\"30\" fill=\"#FFF\"/></mask>\n  <g mask=\"url(#${maskId})\">\n    <rect width=\"${stRectWidth}\" height=\"200\" fill=\"#${color}\" x=\"0\"/>\n    <rect width=\"${stRectWidth}\" height=\"200\" fill=\"url(#${gradientId})\"/>\n  </g>\n  <g aria-hidden=\"true\" fill=\"#fff\" text-anchor=\"start\" font-family=\"Verdana,DejaVu Sans,sans-serif\" font-size=\"110\">\n    <text x=\"65\" y=\"148\" textLength=\"${stTextWidth}\" fill=\"#000\" opacity=\"0.25\">${status}</text>\n    <text x=\"55\" y=\"138\" textLength=\"${stTextWidth}\">${status}</text>\n  </g>\n</svg>`\n}\n\nfunction sanitize (str: string): string {\n  return str\n    .replace(/\\u0026/g, '&amp;')\n    .replace(/\\u003C/g, '&lt;')\n    .replace(/\\u003E/g, '&gt;')\n    .replace(/\\u0022/g, '&quot;')\n    .replace(/\\u0027/g, '&apos;')\n}\n\ninterface AccessibleTextProps {\n  status: string;\n  label?: string;\n}\n\nfunction generateRandomID(length: number): string {\n  const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n  let result = '';\n\n  for (let i = 0; i < length; i++) {\n    result += characters.charAt(Math.floor(Math.random() * characters.length));\n  }\n\n  return result;\n}\n\nfunction createAccessibleText({label, status}: AccessibleTextProps): string {\n  const labelPrefix = label ? `${label}: ` : '';\n  return labelPrefix + status;\n}\n\nfunction typeAssert (assertion: boolean, message: string): void {\n  if (!assertion) throw new TypeError(message)\n}\n\ndeclare global {\n  interface Window {\n    badgen: typeof badgen;\n  }\n}\n\nif (typeof window === 'object') {\n  window.badgen = badgen\n}\n","// import widthsVerdana110 from './widths-verdana-110.json'\n// @ts-ignore\nconst widthsVerdana110: number[] = require('./widths-verdana-110.json')\n\nconst calcWidth = (charWidthTable: number[]) => {\n  const fallbackWidth = charWidthTable[64] // Width as \"@\" for overflows\n\n  return ([...text]) => {\n    let total = 0\n    let charWidth = 0\n    let i = text.length\n    while (i--) {\n      charWidth = charWidthTable[text[i].charCodeAt()]\n      total += charWidth === undefined ? fallbackWidth : charWidth\n    }\n    return total\n  }\n}\n\nexport const Verdana110 = calcWidth(widthsVerdana110)\n","export default {\n  green: '3C1',\n  blue: '08C',\n  red: 'E43',\n  yellow: 'DB1',\n  orange: 'F73',\n  purple: '94E',\n  pink: 'E5B',\n  grey: '999',\n  gray: '999',\n  cyan: '1BC',\n  black: '2A2A2A'\n} as Record<string, string>\n"]}