{"version":3,"sources":["jsdelivr-header.js","/npm/tabletop-enums@0.0.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,MAAQ,QAAQ,uBAEhB,UAAY,EAEZ,kBAAqB,GACjB,EAAM,SAAS,KAAK,IACjB,CAAC,KAAM,EAAM,KAAM,YAAa,EAAM,gBAI7C,gBAAkB,CAAC,EAAO,EAAU,IACnC,EATW,GAUZ,QAAQ,MAAM,wBACP,CAAC,GAGU,mBAAV,EACD,kBAAkB,GAGrB,OAAO,KAAK,GAAO,QAAO,CAAC,EAAU,KACzC,EAAS,GAAO,gBAAgB,EAAM,GAAM,EAAQ,GAC7C,IACP,CAAC,GAGP,OAAO,QAAU,CACd,YACA,SAAU,gBAAgB","file":"/npm/tabletop-enums@0.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/tabletop-enums@0.0.2/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 enums = require(\"./tabletop-enums.js\");\n\nconst MAX_DEPTH = 5;\n\nconst enumToObjectArray = (array) => {\n   return array.values().map((value) => {\n      return {type: value.type, description: value.description};\n   });\n};\n\nconst enumsToLiterals = (enums, counter = 1) => {\n   if (counter > MAX_DEPTH) {\n      console.error(`Max depth ${MAX_DEPTH} reached!`);\n      return {};\n   }\n\n   if (typeof enums === \"function\") {\n      return enumToObjectArray(enums);\n   }\n\n   return Object.keys(enums).reduce((literals, key) => {\n      literals[key] = enumsToLiterals(enums[key], counter+1);\n      return literals\n   }, {});\n};\n\nmodule.exports = {\n   enums,\n   literals: enumsToLiterals(enums)\n};\n"]}