@gmb/bitmark-parser-generator 3.34.0 → 3.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (904) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/bitmark-parser-generator.min.js +1 -1
  3. package/dist/browser/bundle-report.html +2 -2
  4. package/dist/index.cjs +33650 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +7733 -0
  7. package/dist/index.d.ts +7733 -0
  8. package/dist/index.js +33590 -0
  9. package/dist/index.js.map +1 -0
  10. package/package.json +106 -90
  11. package/dist/cjs/BitmarkParserGenerator.js +0 -776
  12. package/dist/cjs/BitmarkParserGenerator.js.map +0 -1
  13. package/dist/cjs/ast/Ast.js +0 -220
  14. package/dist/cjs/ast/Ast.js.map +0 -1
  15. package/dist/cjs/ast/BaseBuilder.js +0 -193
  16. package/dist/cjs/ast/BaseBuilder.js.map +0 -1
  17. package/dist/cjs/ast/Builder.js +0 -1781
  18. package/dist/cjs/ast/Builder.js.map +0 -1
  19. package/dist/cjs/ast/ResourceBuilder.js +0 -963
  20. package/dist/cjs/ast/ResourceBuilder.js.map +0 -1
  21. package/dist/cjs/ast/rules/NodeValidator.js +0 -184
  22. package/dist/cjs/ast/rules/NodeValidator.js.map +0 -1
  23. package/dist/cjs/ast/writer/FileWriter.js +0 -119
  24. package/dist/cjs/ast/writer/FileWriter.js.map +0 -1
  25. package/dist/cjs/ast/writer/StreamWriter.js +0 -89
  26. package/dist/cjs/ast/writer/StreamWriter.js.map +0 -1
  27. package/dist/cjs/ast/writer/StringWriter.js +0 -115
  28. package/dist/cjs/ast/writer/StringWriter.js.map +0 -1
  29. package/dist/cjs/ast/writer/Writer.js +0 -3
  30. package/dist/cjs/ast/writer/Writer.js.map +0 -1
  31. package/dist/cjs/breakscaping/Breakscape.js +0 -80
  32. package/dist/cjs/breakscaping/Breakscape.js.map +0 -1
  33. package/dist/cjs/breakscaping/BreakscapeLoop.js +0 -305
  34. package/dist/cjs/breakscaping/BreakscapeLoop.js.map +0 -1
  35. package/dist/cjs/breakscaping/BreakscapeOptions.js +0 -3
  36. package/dist/cjs/breakscaping/BreakscapeOptions.js.map +0 -1
  37. package/dist/cjs/breakscaping/BreakscapeRegex.js +0 -213
  38. package/dist/cjs/breakscaping/BreakscapeRegex.js.map +0 -1
  39. package/dist/cjs/breakscaping/RegexConfigs.js +0 -38
  40. package/dist/cjs/breakscaping/RegexConfigs.js.map +0 -1
  41. package/dist/cjs/config/Config.js +0 -352
  42. package/dist/cjs/config/Config.js.map +0 -1
  43. package/dist/cjs/config/ConfigHydrator.js +0 -161
  44. package/dist/cjs/config/ConfigHydrator.js.map +0 -1
  45. package/dist/cjs/config/raw/bits.js +0 -2615
  46. package/dist/cjs/config/raw/bits.js.map +0 -1
  47. package/dist/cjs/config/raw/cardSets.js +0 -549
  48. package/dist/cjs/config/raw/cardSets.js.map +0 -1
  49. package/dist/cjs/config/raw/groups.js +0 -1182
  50. package/dist/cjs/config/raw/groups.js.map +0 -1
  51. package/dist/cjs/config/raw/properties.js +0 -1006
  52. package/dist/cjs/config/raw/properties.js.map +0 -1
  53. package/dist/cjs/config/raw/resources.js +0 -103
  54. package/dist/cjs/config/raw/resources.js.map +0 -1
  55. package/dist/cjs/config/raw/tags.js +0 -48
  56. package/dist/cjs/config/raw/tags.js.map +0 -1
  57. package/dist/cjs/generated/build-info.js +0 -13
  58. package/dist/cjs/generated/build-info.js.map +0 -1
  59. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js +0 -3168
  60. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js.map +0 -1
  61. package/dist/cjs/generated/parser/text/text-peggy-parser.js +0 -9659
  62. package/dist/cjs/generated/parser/text/text-peggy-parser.js.map +0 -1
  63. package/dist/cjs/generator/AstWalkerGenerator.js +0 -86
  64. package/dist/cjs/generator/AstWalkerGenerator.js.map +0 -1
  65. package/dist/cjs/generator/Generator.js +0 -3
  66. package/dist/cjs/generator/Generator.js.map +0 -1
  67. package/dist/cjs/generator/bitmark/BitmarkFileGenerator.js +0 -49
  68. package/dist/cjs/generator/bitmark/BitmarkFileGenerator.js.map +0 -1
  69. package/dist/cjs/generator/bitmark/BitmarkGenerator.js +0 -2601
  70. package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +0 -1
  71. package/dist/cjs/generator/bitmark/BitmarkStringGenerator.js +0 -51
  72. package/dist/cjs/generator/bitmark/BitmarkStringGenerator.js.map +0 -1
  73. package/dist/cjs/generator/json/JsonFileGenerator.js +0 -53
  74. package/dist/cjs/generator/json/JsonFileGenerator.js.map +0 -1
  75. package/dist/cjs/generator/json/JsonGenerator.js +0 -1584
  76. package/dist/cjs/generator/json/JsonGenerator.js.map +0 -1
  77. package/dist/cjs/generator/json/JsonObjectGenerator.js +0 -51
  78. package/dist/cjs/generator/json/JsonObjectGenerator.js.map +0 -1
  79. package/dist/cjs/generator/json/JsonStringGenerator.js +0 -50
  80. package/dist/cjs/generator/json/JsonStringGenerator.js.map +0 -1
  81. package/dist/cjs/generator/text/TextGenerator.js +0 -1199
  82. package/dist/cjs/generator/text/TextGenerator.js.map +0 -1
  83. package/dist/cjs/index.js +0 -79
  84. package/dist/cjs/index.js.map +0 -1
  85. package/dist/cjs/info/InfoBuilder.js +0 -43
  86. package/dist/cjs/info/InfoBuilder.js.map +0 -1
  87. package/dist/cjs/init/init.js +0 -15
  88. package/dist/cjs/init/init.js.map +0 -1
  89. package/dist/cjs/model/ast/BreakscapedString.js +0 -3
  90. package/dist/cjs/model/ast/BreakscapedString.js.map +0 -1
  91. package/dist/cjs/model/ast/NodeType.js +0 -557
  92. package/dist/cjs/model/ast/NodeType.js.map +0 -1
  93. package/dist/cjs/model/ast/Nodes.js +0 -3
  94. package/dist/cjs/model/ast/Nodes.js.map +0 -1
  95. package/dist/cjs/model/ast/StardardString.js +0 -3
  96. package/dist/cjs/model/ast/StardardString.js.map +0 -1
  97. package/dist/cjs/model/ast/TextNodes.js +0 -3
  98. package/dist/cjs/model/ast/TextNodes.js.map +0 -1
  99. package/dist/cjs/model/config/AbstractTagConfig.js +0 -18
  100. package/dist/cjs/model/config/AbstractTagConfig.js.map +0 -1
  101. package/dist/cjs/model/config/BitConfig.js +0 -72
  102. package/dist/cjs/model/config/BitConfig.js.map +0 -1
  103. package/dist/cjs/model/config/CardSetConfig.js +0 -26
  104. package/dist/cjs/model/config/CardSetConfig.js.map +0 -1
  105. package/dist/cjs/model/config/CardVariantConfig.js +0 -32
  106. package/dist/cjs/model/config/CardVariantConfig.js.map +0 -1
  107. package/dist/cjs/model/config/MarkupTagConfig.js +0 -41
  108. package/dist/cjs/model/config/MarkupTagConfig.js.map +0 -1
  109. package/dist/cjs/model/config/PropertyTagConfig.js +0 -50
  110. package/dist/cjs/model/config/PropertyTagConfig.js.map +0 -1
  111. package/dist/cjs/model/config/ResourceTagConfig.js +0 -42
  112. package/dist/cjs/model/config/ResourceTagConfig.js.map +0 -1
  113. package/dist/cjs/model/config/ResourcesConfig.js +0 -31
  114. package/dist/cjs/model/config/ResourcesConfig.js.map +0 -1
  115. package/dist/cjs/model/config/TagConfig.js +0 -3
  116. package/dist/cjs/model/config/TagConfig.js.map +0 -1
  117. package/dist/cjs/model/config/TagsConfig.js +0 -3
  118. package/dist/cjs/model/config/TagsConfig.js.map +0 -1
  119. package/dist/cjs/model/config/TagsConfigWithInfo.js +0 -3
  120. package/dist/cjs/model/config/TagsConfigWithInfo.js.map +0 -1
  121. package/dist/cjs/model/config/_Config.js +0 -3
  122. package/dist/cjs/model/config/_Config.js.map +0 -1
  123. package/dist/cjs/model/config/enum/CardSetConfigKey.js +0 -28
  124. package/dist/cjs/model/config/enum/CardSetConfigKey.js.map +0 -1
  125. package/dist/cjs/model/config/enum/ConfigKey.js +0 -29
  126. package/dist/cjs/model/config/enum/ConfigKey.js.map +0 -1
  127. package/dist/cjs/model/config/enum/GroupConfigKey.js +0 -57
  128. package/dist/cjs/model/config/enum/GroupConfigKey.js.map +0 -1
  129. package/dist/cjs/model/config/enum/GroupConfigType.js +0 -14
  130. package/dist/cjs/model/config/enum/GroupConfigType.js.map +0 -1
  131. package/dist/cjs/model/config/enum/PropertyConfigKey.js +0 -215
  132. package/dist/cjs/model/config/enum/PropertyConfigKey.js.map +0 -1
  133. package/dist/cjs/model/config/enum/ResourceConfigKey.js +0 -40
  134. package/dist/cjs/model/config/enum/ResourceConfigKey.js.map +0 -1
  135. package/dist/cjs/model/config/enum/TagConfigKey.js +0 -26
  136. package/dist/cjs/model/config/enum/TagConfigKey.js.map +0 -1
  137. package/dist/cjs/model/enum/BitTagType.js +0 -13
  138. package/dist/cjs/model/enum/BitTagType.js.map +0 -1
  139. package/dist/cjs/model/enum/BitType.js +0 -576
  140. package/dist/cjs/model/enum/BitType.js.map +0 -1
  141. package/dist/cjs/model/enum/BitmarkGeneratorOutput.js +0 -2
  142. package/dist/cjs/model/enum/BitmarkGeneratorOutput.js.map +0 -1
  143. package/dist/cjs/model/enum/BitmarkParserType.js +0 -9
  144. package/dist/cjs/model/enum/BitmarkParserType.js.map +0 -1
  145. package/dist/cjs/model/enum/BitmarkVersion.js +0 -12
  146. package/dist/cjs/model/enum/BitmarkVersion.js.map +0 -1
  147. package/dist/cjs/model/enum/BodyBitType.js +0 -14
  148. package/dist/cjs/model/enum/BodyBitType.js.map +0 -1
  149. package/dist/cjs/model/enum/BodyTextFormat.js +0 -14
  150. package/dist/cjs/model/enum/BodyTextFormat.js.map +0 -1
  151. package/dist/cjs/model/enum/CardSetVersion.js +0 -10
  152. package/dist/cjs/model/enum/CardSetVersion.js.map +0 -1
  153. package/dist/cjs/model/enum/Count.js +0 -9
  154. package/dist/cjs/model/enum/Count.js.map +0 -1
  155. package/dist/cjs/model/enum/DeprecatedTextFormat.js +0 -9
  156. package/dist/cjs/model/enum/DeprecatedTextFormat.js.map +0 -1
  157. package/dist/cjs/model/enum/ExampleType.js +0 -11
  158. package/dist/cjs/model/enum/ExampleType.js.map +0 -1
  159. package/dist/cjs/model/enum/PropertyAstKey.js +0 -18
  160. package/dist/cjs/model/enum/PropertyAstKey.js.map +0 -1
  161. package/dist/cjs/model/enum/PropertyFormat.js +0 -14
  162. package/dist/cjs/model/enum/PropertyFormat.js.map +0 -1
  163. package/dist/cjs/model/enum/PropertyJsonKey.js +0 -14
  164. package/dist/cjs/model/enum/PropertyJsonKey.js.map +0 -1
  165. package/dist/cjs/model/enum/PropertyTag.js +0 -8
  166. package/dist/cjs/model/enum/PropertyTag.js.map +0 -1
  167. package/dist/cjs/model/enum/ResourceJsonKey.js +0 -27
  168. package/dist/cjs/model/enum/ResourceJsonKey.js.map +0 -1
  169. package/dist/cjs/model/enum/ResourceTag.js +0 -37
  170. package/dist/cjs/model/enum/ResourceTag.js.map +0 -1
  171. package/dist/cjs/model/enum/Tag.js +0 -21
  172. package/dist/cjs/model/enum/Tag.js.map +0 -1
  173. package/dist/cjs/model/enum/TextFormat.js +0 -16
  174. package/dist/cjs/model/enum/TextFormat.js.map +0 -1
  175. package/dist/cjs/model/enum/TextLocation.js +0 -15
  176. package/dist/cjs/model/enum/TextLocation.js.map +0 -1
  177. package/dist/cjs/model/enum/TextMarkType.js +0 -54
  178. package/dist/cjs/model/enum/TextMarkType.js.map +0 -1
  179. package/dist/cjs/model/enum/TextNodeType.js +0 -35
  180. package/dist/cjs/model/enum/TextNodeType.js.map +0 -1
  181. package/dist/cjs/model/enum/TextSection.js +0 -18
  182. package/dist/cjs/model/enum/TextSection.js.map +0 -1
  183. package/dist/cjs/model/info/enum/InfoFormat.js +0 -11
  184. package/dist/cjs/model/info/enum/InfoFormat.js.map +0 -1
  185. package/dist/cjs/model/info/enum/InfoType.js +0 -12
  186. package/dist/cjs/model/info/enum/InfoType.js.map +0 -1
  187. package/dist/cjs/model/json/BitJson.js +0 -3
  188. package/dist/cjs/model/json/BitJson.js.map +0 -1
  189. package/dist/cjs/model/json/BitWrapperJson.js +0 -3
  190. package/dist/cjs/model/json/BitWrapperJson.js.map +0 -1
  191. package/dist/cjs/model/json/BodyBitJson.js +0 -3
  192. package/dist/cjs/model/json/BodyBitJson.js.map +0 -1
  193. package/dist/cjs/model/json/ParserJson.js +0 -3
  194. package/dist/cjs/model/json/ParserJson.js.map +0 -1
  195. package/dist/cjs/model/json/ResourceJson.js +0 -3
  196. package/dist/cjs/model/json/ResourceJson.js.map +0 -1
  197. package/dist/cjs/model/parser/ParserData.js +0 -3
  198. package/dist/cjs/model/parser/ParserData.js.map +0 -1
  199. package/dist/cjs/model/parser/ParserError.js +0 -3
  200. package/dist/cjs/model/parser/ParserError.js.map +0 -1
  201. package/dist/cjs/model/parser/ParserInfo.js +0 -3
  202. package/dist/cjs/model/parser/ParserInfo.js.map +0 -1
  203. package/dist/cjs/model/parser/ParserLocation.js +0 -3
  204. package/dist/cjs/model/parser/ParserLocation.js.map +0 -1
  205. package/dist/cjs/model/parser/ParserLocationRange.js +0 -3
  206. package/dist/cjs/model/parser/ParserLocationRange.js.map +0 -1
  207. package/dist/cjs/model/parser/TagValidationData.js +0 -3
  208. package/dist/cjs/model/parser/TagValidationData.js.map +0 -1
  209. package/dist/cjs/parser/bitmark/BitmarkParser.js +0 -25
  210. package/dist/cjs/parser/bitmark/BitmarkParser.js.map +0 -1
  211. package/dist/cjs/parser/bitmark/peg/BitmarkPegParser.js +0 -7
  212. package/dist/cjs/parser/bitmark/peg/BitmarkPegParser.js.map +0 -1
  213. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +0 -614
  214. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +0 -1
  215. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +0 -716
  216. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +0 -1
  217. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js +0 -69
  218. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js.map +0 -1
  219. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +0 -745
  220. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js.map +0 -1
  221. package/dist/cjs/parser/bitmark/peg/PeggyGrammarLocation.js +0 -82
  222. package/dist/cjs/parser/bitmark/peg/PeggyGrammarLocation.js.map +0 -1
  223. package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +0 -260
  224. package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +0 -1
  225. package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +0 -50
  226. package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +0 -1
  227. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +0 -885
  228. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +0 -1
  229. package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +0 -27
  230. package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +0 -1
  231. package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +0 -61
  232. package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +0 -1
  233. package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +0 -63
  234. package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +0 -1
  235. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +0 -161
  236. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +0 -1
  237. package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +0 -55
  238. package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +0 -1
  239. package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +0 -31
  240. package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +0 -1
  241. package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +0 -59
  242. package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +0 -1
  243. package/dist/cjs/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js +0 -16
  244. package/dist/cjs/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js.map +0 -1
  245. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js +0 -29
  246. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js.map +0 -1
  247. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +0 -20
  248. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +0 -1
  249. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +0 -45
  250. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +0 -1
  251. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +0 -44
  252. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +0 -1
  253. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js +0 -11
  254. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +0 -1
  255. package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +0 -57
  256. package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +0 -1
  257. package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +0 -158
  258. package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +0 -1
  259. package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +0 -37
  260. package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +0 -1
  261. package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +0 -24
  262. package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +0 -1
  263. package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +0 -163
  264. package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +0 -1
  265. package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +0 -27
  266. package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +0 -1
  267. package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +0 -28
  268. package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +0 -1
  269. package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +0 -53
  270. package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +0 -1
  271. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +0 -203
  272. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +0 -1
  273. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +0 -24
  274. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +0 -1
  275. package/dist/cjs/parser/json/JsonParser.js +0 -270
  276. package/dist/cjs/parser/json/JsonParser.js.map +0 -1
  277. package/dist/cjs/parser/text/TextParser.js +0 -148
  278. package/dist/cjs/parser/text/TextParser.js.map +0 -1
  279. package/dist/cjs/parser/text/peg/TextPegParser.js +0 -7
  280. package/dist/cjs/parser/text/peg/TextPegParser.js.map +0 -1
  281. package/dist/cjs/utils/ArrayUtils.js +0 -43
  282. package/dist/cjs/utils/ArrayUtils.js.map +0 -1
  283. package/dist/cjs/utils/BitUtils.js +0 -75
  284. package/dist/cjs/utils/BitUtils.js.map +0 -1
  285. package/dist/cjs/utils/BooleanUtils.js +0 -62
  286. package/dist/cjs/utils/BooleanUtils.js.map +0 -1
  287. package/dist/cjs/utils/FileUtils.js +0 -75
  288. package/dist/cjs/utils/FileUtils.js.map +0 -1
  289. package/dist/cjs/utils/NumberUtils.js +0 -62
  290. package/dist/cjs/utils/NumberUtils.js.map +0 -1
  291. package/dist/cjs/utils/ObjectUtils.js +0 -417
  292. package/dist/cjs/utils/ObjectUtils.js.map +0 -1
  293. package/dist/cjs/utils/StringUtils.js +0 -183
  294. package/dist/cjs/utils/StringUtils.js.map +0 -1
  295. package/dist/cjs/utils/UrlUtils.js +0 -37
  296. package/dist/cjs/utils/UrlUtils.js.map +0 -1
  297. package/dist/cjs/utils/env/Env.js +0 -131
  298. package/dist/cjs/utils/env/Env.js.map +0 -1
  299. package/dist/cjs/utils/env/Environment.js +0 -15
  300. package/dist/cjs/utils/env/Environment.js.map +0 -1
  301. package/dist/cjs/utils/env/Os.js +0 -14
  302. package/dist/cjs/utils/env/Os.js.map +0 -1
  303. package/dist/cjs/utils/env/Version.js +0 -12
  304. package/dist/cjs/utils/env/Version.js.map +0 -1
  305. package/dist/cjs/utils/env/userAgent.js +0 -88
  306. package/dist/cjs/utils/env/userAgent.js.map +0 -1
  307. package/dist/cjs/utils/polyfill/fs.js +0 -14
  308. package/dist/cjs/utils/polyfill/fs.js.map +0 -1
  309. package/dist/esm/BitmarkParserGenerator.js +0 -735
  310. package/dist/esm/BitmarkParserGenerator.js.map +0 -1
  311. package/dist/esm/ast/Ast.js +0 -217
  312. package/dist/esm/ast/Ast.js.map +0 -1
  313. package/dist/esm/ast/BaseBuilder.js +0 -190
  314. package/dist/esm/ast/BaseBuilder.js.map +0 -1
  315. package/dist/esm/ast/Builder.js +0 -1775
  316. package/dist/esm/ast/Builder.js.map +0 -1
  317. package/dist/esm/ast/ResourceBuilder.js +0 -960
  318. package/dist/esm/ast/ResourceBuilder.js.map +0 -1
  319. package/dist/esm/ast/rules/NodeValidator.js +0 -181
  320. package/dist/esm/ast/rules/NodeValidator.js.map +0 -1
  321. package/dist/esm/ast/writer/FileWriter.js +0 -80
  322. package/dist/esm/ast/writer/FileWriter.js.map +0 -1
  323. package/dist/esm/ast/writer/StreamWriter.js +0 -83
  324. package/dist/esm/ast/writer/StreamWriter.js.map +0 -1
  325. package/dist/esm/ast/writer/StringWriter.js +0 -112
  326. package/dist/esm/ast/writer/StringWriter.js.map +0 -1
  327. package/dist/esm/ast/writer/Writer.js +0 -2
  328. package/dist/esm/ast/writer/Writer.js.map +0 -1
  329. package/dist/esm/breakscaping/Breakscape.js +0 -77
  330. package/dist/esm/breakscaping/Breakscape.js.map +0 -1
  331. package/dist/esm/breakscaping/BreakscapeLoop.js +0 -302
  332. package/dist/esm/breakscaping/BreakscapeLoop.js.map +0 -1
  333. package/dist/esm/breakscaping/BreakscapeOptions.js +0 -2
  334. package/dist/esm/breakscaping/BreakscapeOptions.js.map +0 -1
  335. package/dist/esm/breakscaping/BreakscapeRegex.js +0 -177
  336. package/dist/esm/breakscaping/BreakscapeRegex.js.map +0 -1
  337. package/dist/esm/breakscaping/RegexConfigs.js +0 -35
  338. package/dist/esm/breakscaping/RegexConfigs.js.map +0 -1
  339. package/dist/esm/config/Config.js +0 -349
  340. package/dist/esm/config/Config.js.map +0 -1
  341. package/dist/esm/config/ConfigHydrator.js +0 -158
  342. package/dist/esm/config/ConfigHydrator.js.map +0 -1
  343. package/dist/esm/config/raw/bits.js +0 -2612
  344. package/dist/esm/config/raw/bits.js.map +0 -1
  345. package/dist/esm/config/raw/cardSets.js +0 -546
  346. package/dist/esm/config/raw/cardSets.js.map +0 -1
  347. package/dist/esm/config/raw/groups.js +0 -1179
  348. package/dist/esm/config/raw/groups.js.map +0 -1
  349. package/dist/esm/config/raw/properties.js +0 -1003
  350. package/dist/esm/config/raw/properties.js.map +0 -1
  351. package/dist/esm/config/raw/resources.js +0 -100
  352. package/dist/esm/config/raw/resources.js.map +0 -1
  353. package/dist/esm/config/raw/tags.js +0 -45
  354. package/dist/esm/config/raw/tags.js.map +0 -1
  355. package/dist/esm/generated/build-info.js +0 -10
  356. package/dist/esm/generated/build-info.js.map +0 -1
  357. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js +0 -3163
  358. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js.map +0 -1
  359. package/dist/esm/generated/parser/text/text-peggy-parser.js +0 -9654
  360. package/dist/esm/generated/parser/text/text-peggy-parser.js.map +0 -1
  361. package/dist/esm/generator/AstWalkerGenerator.js +0 -83
  362. package/dist/esm/generator/AstWalkerGenerator.js.map +0 -1
  363. package/dist/esm/generator/Generator.js +0 -2
  364. package/dist/esm/generator/Generator.js.map +0 -1
  365. package/dist/esm/generator/bitmark/BitmarkFileGenerator.js +0 -46
  366. package/dist/esm/generator/bitmark/BitmarkFileGenerator.js.map +0 -1
  367. package/dist/esm/generator/bitmark/BitmarkGenerator.js +0 -2598
  368. package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +0 -1
  369. package/dist/esm/generator/bitmark/BitmarkStringGenerator.js +0 -48
  370. package/dist/esm/generator/bitmark/BitmarkStringGenerator.js.map +0 -1
  371. package/dist/esm/generator/json/JsonFileGenerator.js +0 -50
  372. package/dist/esm/generator/json/JsonFileGenerator.js.map +0 -1
  373. package/dist/esm/generator/json/JsonGenerator.js +0 -1578
  374. package/dist/esm/generator/json/JsonGenerator.js.map +0 -1
  375. package/dist/esm/generator/json/JsonObjectGenerator.js +0 -48
  376. package/dist/esm/generator/json/JsonObjectGenerator.js.map +0 -1
  377. package/dist/esm/generator/json/JsonStringGenerator.js +0 -47
  378. package/dist/esm/generator/json/JsonStringGenerator.js.map +0 -1
  379. package/dist/esm/generator/text/TextGenerator.js +0 -1196
  380. package/dist/esm/generator/text/TextGenerator.js.map +0 -1
  381. package/dist/esm/index.js +0 -49
  382. package/dist/esm/index.js.map +0 -1
  383. package/dist/esm/info/InfoBuilder.js +0 -40
  384. package/dist/esm/info/InfoBuilder.js.map +0 -1
  385. package/dist/esm/init/init.js +0 -13
  386. package/dist/esm/init/init.js.map +0 -1
  387. package/dist/esm/model/ast/BreakscapedString.js +0 -2
  388. package/dist/esm/model/ast/BreakscapedString.js.map +0 -1
  389. package/dist/esm/model/ast/NodeType.js +0 -554
  390. package/dist/esm/model/ast/NodeType.js.map +0 -1
  391. package/dist/esm/model/ast/Nodes.js +0 -2
  392. package/dist/esm/model/ast/Nodes.js.map +0 -1
  393. package/dist/esm/model/ast/StardardString.js +0 -2
  394. package/dist/esm/model/ast/StardardString.js.map +0 -1
  395. package/dist/esm/model/ast/TextNodes.js +0 -2
  396. package/dist/esm/model/ast/TextNodes.js.map +0 -1
  397. package/dist/esm/model/config/AbstractTagConfig.js +0 -15
  398. package/dist/esm/model/config/AbstractTagConfig.js.map +0 -1
  399. package/dist/esm/model/config/BitConfig.js +0 -69
  400. package/dist/esm/model/config/BitConfig.js.map +0 -1
  401. package/dist/esm/model/config/CardSetConfig.js +0 -23
  402. package/dist/esm/model/config/CardSetConfig.js.map +0 -1
  403. package/dist/esm/model/config/CardVariantConfig.js +0 -29
  404. package/dist/esm/model/config/CardVariantConfig.js.map +0 -1
  405. package/dist/esm/model/config/MarkupTagConfig.js +0 -38
  406. package/dist/esm/model/config/MarkupTagConfig.js.map +0 -1
  407. package/dist/esm/model/config/PropertyTagConfig.js +0 -47
  408. package/dist/esm/model/config/PropertyTagConfig.js.map +0 -1
  409. package/dist/esm/model/config/ResourceTagConfig.js +0 -39
  410. package/dist/esm/model/config/ResourceTagConfig.js.map +0 -1
  411. package/dist/esm/model/config/ResourcesConfig.js +0 -28
  412. package/dist/esm/model/config/ResourcesConfig.js.map +0 -1
  413. package/dist/esm/model/config/TagConfig.js +0 -2
  414. package/dist/esm/model/config/TagConfig.js.map +0 -1
  415. package/dist/esm/model/config/TagsConfig.js +0 -2
  416. package/dist/esm/model/config/TagsConfig.js.map +0 -1
  417. package/dist/esm/model/config/TagsConfigWithInfo.js +0 -2
  418. package/dist/esm/model/config/TagsConfigWithInfo.js.map +0 -1
  419. package/dist/esm/model/config/_Config.js +0 -2
  420. package/dist/esm/model/config/_Config.js.map +0 -1
  421. package/dist/esm/model/config/enum/CardSetConfigKey.js +0 -25
  422. package/dist/esm/model/config/enum/CardSetConfigKey.js.map +0 -1
  423. package/dist/esm/model/config/enum/ConfigKey.js +0 -26
  424. package/dist/esm/model/config/enum/ConfigKey.js.map +0 -1
  425. package/dist/esm/model/config/enum/GroupConfigKey.js +0 -53
  426. package/dist/esm/model/config/enum/GroupConfigKey.js.map +0 -1
  427. package/dist/esm/model/config/enum/GroupConfigType.js +0 -11
  428. package/dist/esm/model/config/enum/GroupConfigType.js.map +0 -1
  429. package/dist/esm/model/config/enum/PropertyConfigKey.js +0 -211
  430. package/dist/esm/model/config/enum/PropertyConfigKey.js.map +0 -1
  431. package/dist/esm/model/config/enum/ResourceConfigKey.js +0 -36
  432. package/dist/esm/model/config/enum/ResourceConfigKey.js.map +0 -1
  433. package/dist/esm/model/config/enum/TagConfigKey.js +0 -22
  434. package/dist/esm/model/config/enum/TagConfigKey.js.map +0 -1
  435. package/dist/esm/model/enum/BitTagType.js +0 -10
  436. package/dist/esm/model/enum/BitTagType.js.map +0 -1
  437. package/dist/esm/model/enum/BitType.js +0 -573
  438. package/dist/esm/model/enum/BitType.js.map +0 -1
  439. package/dist/esm/model/enum/BitmarkGeneratorOutput.js +0 -2
  440. package/dist/esm/model/enum/BitmarkGeneratorOutput.js.map +0 -1
  441. package/dist/esm/model/enum/BitmarkParserType.js +0 -6
  442. package/dist/esm/model/enum/BitmarkParserType.js.map +0 -1
  443. package/dist/esm/model/enum/BitmarkVersion.js +0 -8
  444. package/dist/esm/model/enum/BitmarkVersion.js.map +0 -1
  445. package/dist/esm/model/enum/BodyBitType.js +0 -11
  446. package/dist/esm/model/enum/BodyBitType.js.map +0 -1
  447. package/dist/esm/model/enum/BodyTextFormat.js +0 -11
  448. package/dist/esm/model/enum/BodyTextFormat.js.map +0 -1
  449. package/dist/esm/model/enum/CardSetVersion.js +0 -7
  450. package/dist/esm/model/enum/CardSetVersion.js.map +0 -1
  451. package/dist/esm/model/enum/Count.js +0 -6
  452. package/dist/esm/model/enum/Count.js.map +0 -1
  453. package/dist/esm/model/enum/DeprecatedTextFormat.js +0 -6
  454. package/dist/esm/model/enum/DeprecatedTextFormat.js.map +0 -1
  455. package/dist/esm/model/enum/ExampleType.js +0 -8
  456. package/dist/esm/model/enum/ExampleType.js.map +0 -1
  457. package/dist/esm/model/enum/PropertyAstKey.js +0 -15
  458. package/dist/esm/model/enum/PropertyAstKey.js.map +0 -1
  459. package/dist/esm/model/enum/PropertyFormat.js +0 -11
  460. package/dist/esm/model/enum/PropertyFormat.js.map +0 -1
  461. package/dist/esm/model/enum/PropertyJsonKey.js +0 -11
  462. package/dist/esm/model/enum/PropertyJsonKey.js.map +0 -1
  463. package/dist/esm/model/enum/PropertyTag.js +0 -5
  464. package/dist/esm/model/enum/PropertyTag.js.map +0 -1
  465. package/dist/esm/model/enum/ResourceJsonKey.js +0 -24
  466. package/dist/esm/model/enum/ResourceJsonKey.js.map +0 -1
  467. package/dist/esm/model/enum/ResourceTag.js +0 -34
  468. package/dist/esm/model/enum/ResourceTag.js.map +0 -1
  469. package/dist/esm/model/enum/Tag.js +0 -18
  470. package/dist/esm/model/enum/Tag.js.map +0 -1
  471. package/dist/esm/model/enum/TextFormat.js +0 -13
  472. package/dist/esm/model/enum/TextFormat.js.map +0 -1
  473. package/dist/esm/model/enum/TextLocation.js +0 -12
  474. package/dist/esm/model/enum/TextLocation.js.map +0 -1
  475. package/dist/esm/model/enum/TextMarkType.js +0 -51
  476. package/dist/esm/model/enum/TextMarkType.js.map +0 -1
  477. package/dist/esm/model/enum/TextNodeType.js +0 -32
  478. package/dist/esm/model/enum/TextNodeType.js.map +0 -1
  479. package/dist/esm/model/enum/TextSection.js +0 -15
  480. package/dist/esm/model/enum/TextSection.js.map +0 -1
  481. package/dist/esm/model/info/enum/InfoFormat.js +0 -8
  482. package/dist/esm/model/info/enum/InfoFormat.js.map +0 -1
  483. package/dist/esm/model/info/enum/InfoType.js +0 -9
  484. package/dist/esm/model/info/enum/InfoType.js.map +0 -1
  485. package/dist/esm/model/json/BitJson.js +0 -2
  486. package/dist/esm/model/json/BitJson.js.map +0 -1
  487. package/dist/esm/model/json/BitWrapperJson.js +0 -2
  488. package/dist/esm/model/json/BitWrapperJson.js.map +0 -1
  489. package/dist/esm/model/json/BodyBitJson.js +0 -2
  490. package/dist/esm/model/json/BodyBitJson.js.map +0 -1
  491. package/dist/esm/model/json/ParserJson.js +0 -2
  492. package/dist/esm/model/json/ParserJson.js.map +0 -1
  493. package/dist/esm/model/json/ResourceJson.js +0 -2
  494. package/dist/esm/model/json/ResourceJson.js.map +0 -1
  495. package/dist/esm/model/parser/ParserData.js +0 -2
  496. package/dist/esm/model/parser/ParserData.js.map +0 -1
  497. package/dist/esm/model/parser/ParserError.js +0 -2
  498. package/dist/esm/model/parser/ParserError.js.map +0 -1
  499. package/dist/esm/model/parser/ParserInfo.js +0 -2
  500. package/dist/esm/model/parser/ParserInfo.js.map +0 -1
  501. package/dist/esm/model/parser/ParserLocation.js +0 -2
  502. package/dist/esm/model/parser/ParserLocation.js.map +0 -1
  503. package/dist/esm/model/parser/ParserLocationRange.js +0 -2
  504. package/dist/esm/model/parser/ParserLocationRange.js.map +0 -1
  505. package/dist/esm/model/parser/TagValidationData.js +0 -2
  506. package/dist/esm/model/parser/TagValidationData.js.map +0 -1
  507. package/dist/esm/parser/bitmark/BitmarkParser.js +0 -22
  508. package/dist/esm/parser/bitmark/BitmarkParser.js.map +0 -1
  509. package/dist/esm/parser/bitmark/peg/BitmarkPegParser.js +0 -4
  510. package/dist/esm/parser/bitmark/peg/BitmarkPegParser.js.map +0 -1
  511. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +0 -611
  512. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +0 -1
  513. package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +0 -713
  514. package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +0 -1
  515. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js +0 -59
  516. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js.map +0 -1
  517. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +0 -742
  518. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js.map +0 -1
  519. package/dist/esm/parser/bitmark/peg/PeggyGrammarLocation.js +0 -79
  520. package/dist/esm/parser/bitmark/peg/PeggyGrammarLocation.js.map +0 -1
  521. package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +0 -257
  522. package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +0 -1
  523. package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +0 -48
  524. package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +0 -1
  525. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +0 -883
  526. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +0 -1
  527. package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +0 -25
  528. package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +0 -1
  529. package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +0 -58
  530. package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +0 -1
  531. package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +0 -61
  532. package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +0 -1
  533. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +0 -159
  534. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +0 -1
  535. package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +0 -52
  536. package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +0 -1
  537. package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +0 -29
  538. package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +0 -1
  539. package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +0 -57
  540. package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +0 -1
  541. package/dist/esm/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js +0 -14
  542. package/dist/esm/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js.map +0 -1
  543. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js +0 -27
  544. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js.map +0 -1
  545. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +0 -18
  546. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +0 -1
  547. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +0 -43
  548. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +0 -1
  549. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +0 -42
  550. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +0 -1
  551. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js +0 -9
  552. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +0 -1
  553. package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +0 -55
  554. package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +0 -1
  555. package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +0 -156
  556. package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +0 -1
  557. package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +0 -35
  558. package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +0 -1
  559. package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +0 -22
  560. package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +0 -1
  561. package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +0 -160
  562. package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +0 -1
  563. package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +0 -25
  564. package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +0 -1
  565. package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +0 -26
  566. package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +0 -1
  567. package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +0 -50
  568. package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +0 -1
  569. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +0 -201
  570. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +0 -1
  571. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +0 -22
  572. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +0 -1
  573. package/dist/esm/parser/json/JsonParser.js +0 -267
  574. package/dist/esm/parser/json/JsonParser.js.map +0 -1
  575. package/dist/esm/parser/text/TextParser.js +0 -145
  576. package/dist/esm/parser/text/TextParser.js.map +0 -1
  577. package/dist/esm/parser/text/peg/TextPegParser.js +0 -4
  578. package/dist/esm/parser/text/peg/TextPegParser.js.map +0 -1
  579. package/dist/esm/utils/ArrayUtils.js +0 -40
  580. package/dist/esm/utils/ArrayUtils.js.map +0 -1
  581. package/dist/esm/utils/BitUtils.js +0 -72
  582. package/dist/esm/utils/BitUtils.js.map +0 -1
  583. package/dist/esm/utils/BooleanUtils.js +0 -59
  584. package/dist/esm/utils/BooleanUtils.js.map +0 -1
  585. package/dist/esm/utils/FileUtils.js +0 -36
  586. package/dist/esm/utils/FileUtils.js.map +0 -1
  587. package/dist/esm/utils/NumberUtils.js +0 -59
  588. package/dist/esm/utils/NumberUtils.js.map +0 -1
  589. package/dist/esm/utils/ObjectUtils.js +0 -411
  590. package/dist/esm/utils/ObjectUtils.js.map +0 -1
  591. package/dist/esm/utils/StringUtils.js +0 -180
  592. package/dist/esm/utils/StringUtils.js.map +0 -1
  593. package/dist/esm/utils/UrlUtils.js +0 -34
  594. package/dist/esm/utils/UrlUtils.js.map +0 -1
  595. package/dist/esm/utils/env/Env.js +0 -127
  596. package/dist/esm/utils/env/Env.js.map +0 -1
  597. package/dist/esm/utils/env/Environment.js +0 -12
  598. package/dist/esm/utils/env/Environment.js.map +0 -1
  599. package/dist/esm/utils/env/Os.js +0 -11
  600. package/dist/esm/utils/env/Os.js.map +0 -1
  601. package/dist/esm/utils/env/Version.js +0 -9
  602. package/dist/esm/utils/env/Version.js.map +0 -1
  603. package/dist/esm/utils/env/userAgent.js +0 -86
  604. package/dist/esm/utils/env/userAgent.js.map +0 -1
  605. package/dist/esm/utils/polyfill/fs.js +0 -10
  606. package/dist/esm/utils/polyfill/fs.js.map +0 -1
  607. package/dist/types/BitmarkParserGenerator.d.ts +0 -478
  608. package/dist/types/BitmarkParserGenerator.d.ts.map +0 -1
  609. package/dist/types/ast/Ast.d.ts +0 -137
  610. package/dist/types/ast/Ast.d.ts.map +0 -1
  611. package/dist/types/ast/BaseBuilder.d.ts +0 -64
  612. package/dist/types/ast/BaseBuilder.d.ts.map +0 -1
  613. package/dist/types/ast/Builder.d.ts +0 -692
  614. package/dist/types/ast/Builder.d.ts.map +0 -1
  615. package/dist/types/ast/ResourceBuilder.d.ts +0 -384
  616. package/dist/types/ast/ResourceBuilder.d.ts.map +0 -1
  617. package/dist/types/ast/rules/NodeValidator.d.ts +0 -28
  618. package/dist/types/ast/rules/NodeValidator.d.ts.map +0 -1
  619. package/dist/types/ast/writer/FileWriter.d.ts +0 -37
  620. package/dist/types/ast/writer/FileWriter.d.ts.map +0 -1
  621. package/dist/types/ast/writer/StreamWriter.d.ts +0 -29
  622. package/dist/types/ast/writer/StreamWriter.d.ts.map +0 -1
  623. package/dist/types/ast/writer/StringWriter.d.ts +0 -30
  624. package/dist/types/ast/writer/StringWriter.d.ts.map +0 -1
  625. package/dist/types/ast/writer/Writer.d.ts +0 -72
  626. package/dist/types/ast/writer/Writer.d.ts.map +0 -1
  627. package/dist/types/breakscaping/Breakscape.d.ts +0 -44
  628. package/dist/types/breakscaping/Breakscape.d.ts.map +0 -1
  629. package/dist/types/breakscaping/BreakscapeLoop.d.ts +0 -142
  630. package/dist/types/breakscaping/BreakscapeLoop.d.ts.map +0 -1
  631. package/dist/types/breakscaping/BreakscapeOptions.d.ts +0 -30
  632. package/dist/types/breakscaping/BreakscapeOptions.d.ts.map +0 -1
  633. package/dist/types/breakscaping/BreakscapeRegex.d.ts +0 -96
  634. package/dist/types/breakscaping/BreakscapeRegex.d.ts.map +0 -1
  635. package/dist/types/breakscaping/RegexConfigs.d.ts +0 -35
  636. package/dist/types/breakscaping/RegexConfigs.d.ts.map +0 -1
  637. package/dist/types/config/Config.d.ts +0 -115
  638. package/dist/types/config/Config.d.ts.map +0 -1
  639. package/dist/types/config/ConfigHydrator.d.ts +0 -16
  640. package/dist/types/config/ConfigHydrator.d.ts.map +0 -1
  641. package/dist/types/config/raw/bits.d.ts +0 -4
  642. package/dist/types/config/raw/bits.d.ts.map +0 -1
  643. package/dist/types/config/raw/cardSets.d.ts +0 -4
  644. package/dist/types/config/raw/cardSets.d.ts.map +0 -1
  645. package/dist/types/config/raw/groups.d.ts +0 -4
  646. package/dist/types/config/raw/groups.d.ts.map +0 -1
  647. package/dist/types/config/raw/properties.d.ts +0 -4
  648. package/dist/types/config/raw/properties.d.ts.map +0 -1
  649. package/dist/types/config/raw/resources.d.ts +0 -4
  650. package/dist/types/config/raw/resources.d.ts.map +0 -1
  651. package/dist/types/config/raw/tags.d.ts +0 -4
  652. package/dist/types/config/raw/tags.d.ts.map +0 -1
  653. package/dist/types/generated/build-info.d.ts +0 -8
  654. package/dist/types/generated/build-info.d.ts.map +0 -1
  655. package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts +0 -12
  656. package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts.map +0 -1
  657. package/dist/types/generated/parser/text/text-peggy-parser.d.ts +0 -12
  658. package/dist/types/generated/parser/text/text-peggy-parser.d.ts.map +0 -1
  659. package/dist/types/generator/AstWalkerGenerator.d.ts +0 -32
  660. package/dist/types/generator/AstWalkerGenerator.d.ts.map +0 -1
  661. package/dist/types/generator/Generator.d.ts +0 -6
  662. package/dist/types/generator/Generator.d.ts.map +0 -1
  663. package/dist/types/generator/bitmark/BitmarkFileGenerator.d.ts +0 -41
  664. package/dist/types/generator/bitmark/BitmarkFileGenerator.d.ts.map +0 -1
  665. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +0 -401
  666. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +0 -1
  667. package/dist/types/generator/bitmark/BitmarkStringGenerator.d.ts +0 -31
  668. package/dist/types/generator/bitmark/BitmarkStringGenerator.d.ts.map +0 -1
  669. package/dist/types/generator/json/JsonFileGenerator.d.ts +0 -45
  670. package/dist/types/generator/json/JsonFileGenerator.d.ts.map +0 -1
  671. package/dist/types/generator/json/JsonGenerator.d.ts +0 -357
  672. package/dist/types/generator/json/JsonGenerator.d.ts.map +0 -1
  673. package/dist/types/generator/json/JsonObjectGenerator.d.ts +0 -32
  674. package/dist/types/generator/json/JsonObjectGenerator.d.ts.map +0 -1
  675. package/dist/types/generator/json/JsonStringGenerator.d.ts +0 -30
  676. package/dist/types/generator/json/JsonStringGenerator.d.ts.map +0 -1
  677. package/dist/types/generator/text/TextGenerator.d.ts +0 -228
  678. package/dist/types/generator/text/TextGenerator.d.ts.map +0 -1
  679. package/dist/types/index.d.ts +0 -50
  680. package/dist/types/index.d.ts.map +0 -1
  681. package/dist/types/info/InfoBuilder.d.ts +0 -18
  682. package/dist/types/info/InfoBuilder.d.ts.map +0 -1
  683. package/dist/types/init/init.d.ts +0 -4
  684. package/dist/types/init/init.d.ts.map +0 -1
  685. package/dist/types/model/ast/BreakscapedString.d.ts +0 -4
  686. package/dist/types/model/ast/BreakscapedString.d.ts.map +0 -1
  687. package/dist/types/model/ast/NodeType.d.ts +0 -1093
  688. package/dist/types/model/ast/NodeType.d.ts.map +0 -1
  689. package/dist/types/model/ast/Nodes.d.ts +0 -268
  690. package/dist/types/model/ast/Nodes.d.ts.map +0 -1
  691. package/dist/types/model/ast/StardardString.d.ts +0 -4
  692. package/dist/types/model/ast/StardardString.d.ts.map +0 -1
  693. package/dist/types/model/ast/TextNodes.d.ts +0 -130
  694. package/dist/types/model/ast/TextNodes.d.ts.map +0 -1
  695. package/dist/types/model/config/AbstractTagConfig.d.ts +0 -24
  696. package/dist/types/model/config/AbstractTagConfig.d.ts.map +0 -1
  697. package/dist/types/model/config/BitConfig.d.ts +0 -48
  698. package/dist/types/model/config/BitConfig.d.ts.map +0 -1
  699. package/dist/types/model/config/CardSetConfig.d.ts +0 -14
  700. package/dist/types/model/config/CardSetConfig.d.ts.map +0 -1
  701. package/dist/types/model/config/CardVariantConfig.d.ts +0 -16
  702. package/dist/types/model/config/CardVariantConfig.d.ts.map +0 -1
  703. package/dist/types/model/config/MarkupTagConfig.d.ts +0 -17
  704. package/dist/types/model/config/MarkupTagConfig.d.ts.map +0 -1
  705. package/dist/types/model/config/PropertyTagConfig.d.ts +0 -23
  706. package/dist/types/model/config/PropertyTagConfig.d.ts.map +0 -1
  707. package/dist/types/model/config/ResourceTagConfig.d.ts +0 -18
  708. package/dist/types/model/config/ResourceTagConfig.d.ts.map +0 -1
  709. package/dist/types/model/config/ResourcesConfig.d.ts +0 -14
  710. package/dist/types/model/config/ResourcesConfig.d.ts.map +0 -1
  711. package/dist/types/model/config/TagConfig.d.ts +0 -5
  712. package/dist/types/model/config/TagConfig.d.ts.map +0 -1
  713. package/dist/types/model/config/TagsConfig.d.ts +0 -5
  714. package/dist/types/model/config/TagsConfig.d.ts.map +0 -1
  715. package/dist/types/model/config/TagsConfigWithInfo.d.ts +0 -9
  716. package/dist/types/model/config/TagsConfigWithInfo.d.ts.map +0 -1
  717. package/dist/types/model/config/_Config.d.ts +0 -119
  718. package/dist/types/model/config/_Config.d.ts.map +0 -1
  719. package/dist/types/model/config/enum/CardSetConfigKey.d.ts +0 -43
  720. package/dist/types/model/config/enum/CardSetConfigKey.d.ts.map +0 -1
  721. package/dist/types/model/config/enum/ConfigKey.d.ts +0 -578
  722. package/dist/types/model/config/enum/ConfigKey.d.ts.map +0 -1
  723. package/dist/types/model/config/enum/GroupConfigKey.d.ts +0 -144
  724. package/dist/types/model/config/enum/GroupConfigKey.d.ts.map +0 -1
  725. package/dist/types/model/config/enum/GroupConfigType.d.ts +0 -16
  726. package/dist/types/model/config/enum/GroupConfigType.d.ts.map +0 -1
  727. package/dist/types/model/config/enum/PropertyConfigKey.d.ts +0 -618
  728. package/dist/types/model/config/enum/PropertyConfigKey.d.ts.map +0 -1
  729. package/dist/types/model/config/enum/ResourceConfigKey.d.ts +0 -87
  730. package/dist/types/model/config/enum/ResourceConfigKey.d.ts.map +0 -1
  731. package/dist/types/model/config/enum/TagConfigKey.d.ts +0 -51
  732. package/dist/types/model/config/enum/TagConfigKey.d.ts.map +0 -1
  733. package/dist/types/model/enum/BitTagType.d.ts +0 -15
  734. package/dist/types/model/enum/BitTagType.d.ts.map +0 -1
  735. package/dist/types/model/enum/BitType.d.ts +0 -1143
  736. package/dist/types/model/enum/BitType.d.ts.map +0 -1
  737. package/dist/types/model/enum/BitmarkGeneratorOutput.d.ts +0 -1
  738. package/dist/types/model/enum/BitmarkGeneratorOutput.d.ts.map +0 -1
  739. package/dist/types/model/enum/BitmarkParserType.d.ts +0 -7
  740. package/dist/types/model/enum/BitmarkParserType.d.ts.map +0 -1
  741. package/dist/types/model/enum/BitmarkVersion.d.ts +0 -12
  742. package/dist/types/model/enum/BitmarkVersion.d.ts.map +0 -1
  743. package/dist/types/model/enum/BodyBitType.d.ts +0 -25
  744. package/dist/types/model/enum/BodyBitType.d.ts.map +0 -1
  745. package/dist/types/model/enum/BodyTextFormat.d.ts +0 -17
  746. package/dist/types/model/enum/BodyTextFormat.d.ts.map +0 -1
  747. package/dist/types/model/enum/CardSetVersion.d.ts +0 -11
  748. package/dist/types/model/enum/CardSetVersion.d.ts.map +0 -1
  749. package/dist/types/model/enum/Count.d.ts +0 -7
  750. package/dist/types/model/enum/Count.d.ts.map +0 -1
  751. package/dist/types/model/enum/DeprecatedTextFormat.d.ts +0 -7
  752. package/dist/types/model/enum/DeprecatedTextFormat.d.ts.map +0 -1
  753. package/dist/types/model/enum/ExampleType.d.ts +0 -13
  754. package/dist/types/model/enum/ExampleType.d.ts.map +0 -1
  755. package/dist/types/model/enum/PropertyAstKey.d.ts +0 -22
  756. package/dist/types/model/enum/PropertyAstKey.d.ts.map +0 -1
  757. package/dist/types/model/enum/PropertyFormat.d.ts +0 -19
  758. package/dist/types/model/enum/PropertyFormat.d.ts.map +0 -1
  759. package/dist/types/model/enum/PropertyJsonKey.d.ts +0 -10
  760. package/dist/types/model/enum/PropertyJsonKey.d.ts.map +0 -1
  761. package/dist/types/model/enum/PropertyTag.d.ts +0 -419
  762. package/dist/types/model/enum/PropertyTag.d.ts.map +0 -1
  763. package/dist/types/model/enum/ResourceJsonKey.d.ts +0 -45
  764. package/dist/types/model/enum/ResourceJsonKey.d.ts.map +0 -1
  765. package/dist/types/model/enum/ResourceTag.d.ts +0 -63
  766. package/dist/types/model/enum/ResourceTag.d.ts.map +0 -1
  767. package/dist/types/model/enum/Tag.d.ts +0 -33
  768. package/dist/types/model/enum/Tag.d.ts.map +0 -1
  769. package/dist/types/model/enum/TextFormat.d.ts +0 -17
  770. package/dist/types/model/enum/TextFormat.d.ts.map +0 -1
  771. package/dist/types/model/enum/TextLocation.d.ts +0 -16
  772. package/dist/types/model/enum/TextLocation.d.ts.map +0 -1
  773. package/dist/types/model/enum/TextMarkType.d.ts +0 -93
  774. package/dist/types/model/enum/TextMarkType.d.ts.map +0 -1
  775. package/dist/types/model/enum/TextNodeType.d.ts +0 -53
  776. package/dist/types/model/enum/TextNodeType.d.ts.map +0 -1
  777. package/dist/types/model/enum/TextSection.d.ts +0 -27
  778. package/dist/types/model/enum/TextSection.d.ts.map +0 -1
  779. package/dist/types/model/info/enum/InfoFormat.d.ts +0 -13
  780. package/dist/types/model/info/enum/InfoFormat.d.ts.map +0 -1
  781. package/dist/types/model/info/enum/InfoType.d.ts +0 -15
  782. package/dist/types/model/info/enum/InfoType.d.ts.map +0 -1
  783. package/dist/types/model/json/BitJson.d.ts +0 -479
  784. package/dist/types/model/json/BitJson.d.ts.map +0 -1
  785. package/dist/types/model/json/BitWrapperJson.d.ts +0 -8
  786. package/dist/types/model/json/BitWrapperJson.d.ts.map +0 -1
  787. package/dist/types/model/json/BodyBitJson.d.ts +0 -81
  788. package/dist/types/model/json/BodyBitJson.d.ts.map +0 -1
  789. package/dist/types/model/json/ParserJson.d.ts +0 -12
  790. package/dist/types/model/json/ParserJson.d.ts.map +0 -1
  791. package/dist/types/model/json/ResourceJson.d.ts +0 -244
  792. package/dist/types/model/json/ResourceJson.d.ts.map +0 -1
  793. package/dist/types/model/parser/ParserData.d.ts +0 -11
  794. package/dist/types/model/parser/ParserData.d.ts.map +0 -1
  795. package/dist/types/model/parser/ParserError.d.ts +0 -17
  796. package/dist/types/model/parser/ParserError.d.ts.map +0 -1
  797. package/dist/types/model/parser/ParserInfo.d.ts +0 -10
  798. package/dist/types/model/parser/ParserInfo.d.ts.map +0 -1
  799. package/dist/types/model/parser/ParserLocation.d.ts +0 -6
  800. package/dist/types/model/parser/ParserLocation.d.ts.map +0 -1
  801. package/dist/types/model/parser/ParserLocationRange.d.ts +0 -10
  802. package/dist/types/model/parser/ParserLocationRange.d.ts.map +0 -1
  803. package/dist/types/model/parser/TagValidationData.d.ts +0 -24
  804. package/dist/types/model/parser/TagValidationData.d.ts.map +0 -1
  805. package/dist/types/parser/bitmark/BitmarkParser.d.ts +0 -21
  806. package/dist/types/parser/bitmark/BitmarkParser.d.ts.map +0 -1
  807. package/dist/types/parser/bitmark/peg/BitmarkPegParser.d.ts +0 -8
  808. package/dist/types/parser/bitmark/peg/BitmarkPegParser.d.ts.map +0 -1
  809. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts +0 -108
  810. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +0 -1
  811. package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts +0 -137
  812. package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +0 -1
  813. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +0 -333
  814. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts.map +0 -1
  815. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts +0 -186
  816. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts.map +0 -1
  817. package/dist/types/parser/bitmark/peg/PeggyGrammarLocation.d.ts +0 -61
  818. package/dist/types/parser/bitmark/peg/PeggyGrammarLocation.d.ts.map +0 -1
  819. package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts +0 -37
  820. package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts.map +0 -1
  821. package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts +0 -5
  822. package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts.map +0 -1
  823. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts +0 -7
  824. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts.map +0 -1
  825. package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts +0 -5
  826. package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts.map +0 -1
  827. package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts +0 -15
  828. package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts.map +0 -1
  829. package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts +0 -5
  830. package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts.map +0 -1
  831. package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts +0 -4
  832. package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts.map +0 -1
  833. package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts +0 -14
  834. package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts.map +0 -1
  835. package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts +0 -6
  836. package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts.map +0 -1
  837. package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts +0 -5
  838. package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts.map +0 -1
  839. package/dist/types/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.d.ts +0 -4
  840. package/dist/types/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.d.ts.map +0 -1
  841. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.d.ts +0 -5
  842. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.d.ts.map +0 -1
  843. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts +0 -5
  844. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts.map +0 -1
  845. package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts +0 -6
  846. package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts.map +0 -1
  847. package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts +0 -5
  848. package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts.map +0 -1
  849. package/dist/types/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.d.ts +0 -4
  850. package/dist/types/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.d.ts.map +0 -1
  851. package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts +0 -5
  852. package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts.map +0 -1
  853. package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts +0 -5
  854. package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts.map +0 -1
  855. package/dist/types/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.d.ts +0 -5
  856. package/dist/types/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.d.ts.map +0 -1
  857. package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts +0 -5
  858. package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts.map +0 -1
  859. package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts +0 -14
  860. package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts.map +0 -1
  861. package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.d.ts +0 -5
  862. package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.d.ts.map +0 -1
  863. package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts +0 -5
  864. package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts.map +0 -1
  865. package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts +0 -11
  866. package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts.map +0 -1
  867. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts +0 -6
  868. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts.map +0 -1
  869. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts +0 -4
  870. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts.map +0 -1
  871. package/dist/types/parser/json/JsonParser.d.ts +0 -59
  872. package/dist/types/parser/json/JsonParser.d.ts.map +0 -1
  873. package/dist/types/parser/text/TextParser.d.ts +0 -55
  874. package/dist/types/parser/text/TextParser.d.ts.map +0 -1
  875. package/dist/types/parser/text/peg/TextPegParser.d.ts +0 -8
  876. package/dist/types/parser/text/peg/TextPegParser.d.ts.map +0 -1
  877. package/dist/types/utils/ArrayUtils.d.ts +0 -25
  878. package/dist/types/utils/ArrayUtils.d.ts.map +0 -1
  879. package/dist/types/utils/BitUtils.d.ts +0 -30
  880. package/dist/types/utils/BitUtils.d.ts.map +0 -1
  881. package/dist/types/utils/BooleanUtils.d.ts +0 -30
  882. package/dist/types/utils/BooleanUtils.d.ts.map +0 -1
  883. package/dist/types/utils/FileUtils.d.ts +0 -12
  884. package/dist/types/utils/FileUtils.d.ts.map +0 -1
  885. package/dist/types/utils/NumberUtils.d.ts +0 -47
  886. package/dist/types/utils/NumberUtils.d.ts.map +0 -1
  887. package/dist/types/utils/ObjectUtils.d.ts +0 -197
  888. package/dist/types/utils/ObjectUtils.d.ts.map +0 -1
  889. package/dist/types/utils/StringUtils.d.ts +0 -77
  890. package/dist/types/utils/StringUtils.d.ts.map +0 -1
  891. package/dist/types/utils/UrlUtils.d.ts +0 -7
  892. package/dist/types/utils/UrlUtils.d.ts.map +0 -1
  893. package/dist/types/utils/env/Env.d.ts +0 -39
  894. package/dist/types/utils/env/Env.d.ts.map +0 -1
  895. package/dist/types/utils/env/Environment.d.ts +0 -21
  896. package/dist/types/utils/env/Environment.d.ts.map +0 -1
  897. package/dist/types/utils/env/Os.d.ts +0 -19
  898. package/dist/types/utils/env/Os.d.ts.map +0 -1
  899. package/dist/types/utils/env/Version.d.ts +0 -10
  900. package/dist/types/utils/env/Version.d.ts.map +0 -1
  901. package/dist/types/utils/env/userAgent.d.ts +0 -11
  902. package/dist/types/utils/env/userAgent.d.ts.map +0 -1
  903. package/dist/types/utils/polyfill/fs.d.ts +0 -6
  904. package/dist/types/utils/polyfill/fs.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/model/enum/BitType.ts","../src/model/enum/Count.ts","../src/model/enum/ExampleType.ts","../src/model/enum/Tag.ts","../src/model/enum/TagFormat.ts","../src/model/enum/TextFormat.ts","../src/model/config/enum/CardSetConfigKey.ts","../src/model/config/enum/GroupConfigType.ts","../src/model/enum/BitTagConfigKeyType.ts","../src/model/config/AbstractTagConfig.ts","../src/model/config/MarkupTagConfig.ts","../src/model/config/PropertyTagConfig.ts","../src/model/config/ResourceTagConfig.ts","../src/model/config/CardVariantConfig.ts","../src/model/config/CardSetConfig.ts","../src/model/config/BitConfig.ts","../src/model/config/enum/ConfigKey.ts","../src/model/enum/GroupKey.ts","../src/model/enum/PropertyKey.ts","../src/model/enum/ResourceKey.ts","../src/model/enum/ResourceType.ts","../src/utils/StringUtils.ts","../src/model/config/ResourcesConfig.ts","../src/utils/ObjectUtils.ts","../src/config/raw/cardSets.ts","../src/config/raw/groups.ts","../src/config/ConfigHydrator.ts","../src/config/raw/bits.ts","../src/config/Config.ts","../src/generated/package_info.ts","../src/utils/env/Environment.ts","../src/utils/env/Os.ts","../src/utils/env/userAgent.ts","../src/utils/env/Version.ts","../src/utils/env/Env.ts","../src/init/init.ts","../src/model/enum/BodyBitType.ts","../src/model/enum/TextMarkType.ts","../src/model/enum/TextNodeType.ts","../src/model/ast/NodeType.ts","../src/ast/Ast.ts","../src/model/enum/TextLocation.ts","../src/model/enum/BodyTextFormat.ts","../src/breakscaping/RegexConfigs.ts","../src/breakscaping/BreakscapeRegex.ts","../src/breakscaping/Breakscape.ts","../src/model/enum/DeprecatedTextFormat.ts","../src/utils/ArrayUtils.ts","../src/generator/text/TextGenerator.ts","../src/model/enum/BitmarkVersion.ts","../src/generator/AstWalkerGenerator.ts","../src/generated/parser/text/text-peggy-parser.js","../src/parser/text/peg/TextPegParser.ts","../src/parser/text/TextParser.ts","../src/utils/BooleanUtils.ts","../src/utils/NumberUtils.ts","../src/ast/BaseBuilder.ts","../src/utils/BitUtils.ts","../src/utils/UrlUtils.ts","../src/ast/rules/NodeValidator.ts","../src/ast/ResourceBuilder.ts","../src/ast/Builder.ts","../src/ast/writer/StringWriter.ts","../src/BitmarkParserGenerator.ts","../src/model/enum/CardSetVersion.ts","../src/generator/bitmark/BitmarkGenerator.ts","../src/generator/bitmark/BitmarkStringGenerator.ts","../src/generator/json/JsonGenerator.ts","../src/generator/json/JsonObjectGenerator.ts","../src/info/InfoBuilder.ts","../src/model/enum/BitmarkParserType.ts","../src/model/info/enum/InfoFormat.ts","../src/model/info/enum/InfoType.ts","../src/parser/json/JsonParser.ts","../src/parser/bitmark/peg/BitmarkPegParserTypes.ts","../src/parser/bitmark/peg/PeggyGrammarLocation.ts","../src/parser/bitmark/peg/BitmarkPegParserHelper.ts","../src/parser/bitmark/peg/BitmarkPegParserValidator.ts","../src/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.ts","../src/parser/bitmark/peg/contentProcessors/BodyContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/CardContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/FooterContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.ts","../src/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.ts","../src/parser/bitmark/peg/BitmarkPegParserProcessor.ts","../src/generated/parser/bitmark/bitmark-peggy-parser.js","../src/parser/bitmark/peg/BitmarkPegParser.ts","../src/parser/bitmark/BitmarkParser.ts","../src/ast/writer/FileWriter.ts","../src/ast/writer/StreamWriter.ts","../src/generator/bitmark/BitmarkFileGenerator.ts","../src/generator/json/JsonFileGenerator.ts","../src/info/ConfigBuilder.ts","../src/generator/json/JsonStringGenerator.ts","../src/index.ts"],"sourcesContent":["import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst BitType = superenum({\n _error: '_error', // Used for error handling to indicate a bit type that is not supported or a bit parse error\n _comment: '_comment', // Used to indicate a bit is commented out\n _standard: '_standard', // Not to be used as a bit, but as a base for other bit types\n aiPrompt: 'ai-prompt',\n anchor: 'anchor',\n appAiPrompt: 'app-ai-prompt',\n appBitmarkFromEditor: 'app-bitmark-from-editor',\n appBitmarkFromJavascript: 'app-bitmark-from-javascript',\n appCodeCell: 'app-code-cell',\n appCodeEditor: 'app-code-editor',\n appCodeIde: 'app-code-ide',\n appCreateBitsFromImage: 'app-create-bits-from-image',\n appFlashcards: 'app-flashcards',\n appFlashcardsLearn: 'app-flashcards-learn',\n appFlashcardsQuiz: 'app-flashcards-quiz',\n appGetScreenshot: 'app-get-screenshot',\n appLink: 'app-link',\n article: 'article',\n articleAi: 'article-ai',\n articleAlt: 'article-alt',\n articleAttachment: 'article-attachment',\n articleEmbed: 'article-embed',\n articleLink: 'article-link',\n articleResponsive: 'article-responsive',\n articleResponsiveAlt: 'article-responsive-alt',\n assignment: 'assignment',\n assignmentList: 'assignment-list',\n audio: 'audio',\n audioEmbed: 'audio-embed',\n audioLink: 'audio-link',\n audioTranscript: 'audio-transcript',\n bitAlias: 'bit-alias',\n bitBookEnding: 'bit-book-ending',\n bitBookSummary: 'bit-book-summary',\n bitmarkExample: 'bitmark-example',\n blogArticle: 'blog-article',\n book: 'book',\n bookAcknowledgements: 'book-acknowledgements',\n bookAddendum: 'book-addendum',\n bookAfterword: 'book-afterword',\n bookAlias: 'book-alias',\n bookAppendix: 'book-appendix',\n bookArticle: 'book-article',\n bookAutherBio: 'book-author-bio',\n bookBibliography: 'book-bibliography',\n bookClose: 'book-close',\n bookComingSoon: 'book-coming-soon',\n bookConclusion: 'book-conclusion',\n bookCopyright: 'book-copyright',\n bookCopyrightPermissions: 'book-copyright-permissions',\n bookCover: 'book-cover',\n bookDedication: 'book-dedication',\n bookDiff: 'book-diff',\n bookEnd: 'book-end',\n bookEndnotes: 'book-endnotes',\n bookEpigraph: 'book-epigraph',\n bookEpilogue: 'book-epilogue',\n bookForword: 'book-foreword',\n bookFrontispiece: 'book-frontispiece',\n bookImprint: 'book-imprint',\n bookIncitingIncident: 'book-inciting-incident',\n bookIntroduction: 'book-introduction',\n bookLink: 'book-link',\n bookLinkNext: 'book-link-next',\n bookLinkPrev: 'book-link-prev',\n bookListOfContributors: 'book-list-of-contributors',\n bookNotes: 'book-notes',\n bookPostscript: 'book-postscript',\n bookPreface: 'book-preface',\n bookPrologue: 'book-prologue',\n bookReadMore: 'book-read-more',\n bookReference: 'book-reference',\n bookReferenceList: 'book-reference-list',\n bookRequestForABookReview: 'book-request-for-a-book-review',\n bookSummary: 'book-summary',\n bookTeaser: 'book-teaser',\n bookTitle: 'book-title',\n botActionAnnounce: 'bot-action-announce',\n botActionRatingNumber: 'bot-action-rating-number',\n botActionRemind: 'bot-action-remind',\n botActionResponse: 'bot-action-response',\n botActionSave: 'bot-action-save',\n botActionSend: 'bot-action-send',\n botActionTrueFalse: 'bot-action-true-false',\n botInterview: 'bot-interview',\n browserImage: 'browser-image',\n bug: 'bug',\n bugAlt: 'bug-alt',\n bugCollapsible: 'bug-collapsible',\n buttonCopyText: 'button-copy-text',\n callToAction: 'call-to-action',\n callToActionBookNow: 'call-to-action-book-now',\n callToActionContact: 'call-to-action-contact',\n callToActionCreateAccount: 'call-to-action-create-account',\n callToActionDownload: 'call-to-action-download',\n callToActionGetNow: 'call-to-action-get-now',\n callToActionGetOffer: 'call-to-action-get-offer',\n callToActionJoin: 'call-to-action-join',\n callToActionLearnMore: 'call-to-action-learn-more',\n callToActionMail: 'call-to-action-mail',\n callToActionSeeMore: 'call-to-action-see-more',\n callToActionShopNow: 'call-to-action-shop-now',\n callToActionStartNow: 'call-to-action-start-now',\n callToActionSubscribe: 'call-to-action-subscribe',\n callToActionWatch: 'call-to-action-watch',\n card1: 'card-1',\n chapter: 'chapter',\n chapterSubjectMatter: 'chapter-subject-matter',\n chat: 'chat',\n checklist: 'checklist',\n cloze: 'cloze',\n clozeAndMultipleChoiceText: 'cloze-and-multiple-choice-text',\n clozeInstructionGrouped: 'cloze-instruction-grouped',\n clozeList: 'cloze-list',\n clozeSeveral: 'cloze-several',\n clozeSolutionGrouped: 'cloze-solution-grouped',\n coachAudioTranscript: 'coach-audio-transcript',\n coachCallToActionChecklist: 'coach-call-to-action-checklist',\n coachCallToActionCloze: 'coach-call-to-action-cloze',\n coachCallToActionClozeAndMultipleChoiceText:\n 'coach-call-to-action-cloze-and-multiple-choice-text',\n coachCallToActionEssay: 'coach-call-to-action-essay',\n coachCallToActionMultipleChoiceText: 'coach-call-to-action-multiple-choice-text',\n coachHomeRules: 'coach-home-rules',\n coachSelfReflectionCloze: 'coach-self-reflection-cloze',\n coachSelfReflectionEssay: 'coach-self-reflection-essay',\n coachSelfReflectionMultipleChoice: 'coach-self-reflection-multiple-choice',\n coachSelfReflectionMultipleChoice1: 'coach-self-reflection-multiple-choice-1',\n coachSelfReflectionMultipleChoiceText: 'coach-self-reflection-multiple-choice-text',\n coachSelfReflectionMultipleResponse: 'coach-self-reflection-multiple-response',\n coachSelfReflectionMultipleResponse1: 'coach-self-reflection-multiple-response-1',\n coachSelfReflectionRating: 'coach-self-reflection-rating',\n coachVideoTranscript: 'coach-video-transcript',\n code: 'code',\n codeRuntime: 'code-runtime',\n collapsible: 'collapsible',\n conclusion: 'conclusion',\n conclusionAlt: 'conclusion-alt',\n consoleLog: 'console-log',\n container: 'container',\n containerAccordionTabs: 'container-accordion-tabs',\n containerBits2: 'container-bits-2',\n containerCards: 'container-cards',\n containerCarousel: 'container-carousel',\n containerCookRecipe: 'container-cook-recipe',\n containerFolder: 'container-folder',\n containerFolderAll: 'container-folder-all',\n containerGallery: 'container-gallery',\n containerGrid: 'container-grid',\n containerGroup: 'container-group',\n containerNewsArticle: 'container-news-article',\n containerNowrap: 'container-nowrap',\n containerNowrapStretch: 'container-nowrap-stretch',\n containerPreview: 'container-preview',\n containerScroller: 'container-scroller',\n containerSlides: 'container-slides',\n containerStack: 'container-stack',\n containerTabs: 'container-tabs',\n containerWrap: 'container-wrap',\n conversationLeft1: 'conversation-left-1',\n conversationLeft1Scream: 'conversation-left-1-scream',\n conversationLeft1Thought: 'conversation-left-1-thought',\n conversationRight1: 'conversation-right-1',\n conversationRight1Scream: 'conversation-right-1-scream',\n conversationRight1Thought: 'conversation-right-1-thought',\n clozeAndMultipleChoiceTextConversationLeft1: 'cloze-and-multiple-choice-text-conversation-left-1',\n clozeAndMultipleChoiceTextConversationLeft1Scream:\n 'cloze-and-multiple-choice-text-conversation-left-1-scream',\n clozeAndMultipleChoiceTextConversationLeft1Thought:\n 'cloze-and-multiple-choice-text-conversation-left-1-thought',\n clozeAndMultipleChoiceTextConversationRight1:\n 'cloze-and-multiple-choice-text-conversation-right-1',\n clozeAndMultipleChoiceTextConversationRight1Scream:\n 'cloze-and-multiple-choice-text-conversation-right-1-scream',\n clozeAndMultipleChoiceTextConversationRight1Thought:\n 'cloze-and-multiple-choice-text-conversation-right-1-thought',\n cookArrangement: 'cook-arrangement',\n cookIngredients: 'cook-ingredients',\n cookInsert: 'cook-insert',\n cookNoteOnQuantity: 'cook-note-on-quantity',\n cookPersonalRecommendation: 'cook-personal-recommendation',\n cookPlate: 'cook-plate',\n cookPracticeAdvise: 'cook-practice-advise',\n cookPreparation: 'cook-preparation',\n cookRecommendation: 'cook-recommendation',\n cookRemark: 'cook-remark',\n cookSideDish: 'cook-side-dish',\n cookSideDrink: 'cook-side-drink',\n cookStep: 'cook-step',\n cookTimer: 'cook-timer',\n cookVariation: 'cook-variation',\n correction: 'correction',\n danger: 'danger',\n dangerAlt: 'danger-alt',\n dangerCollapsible: 'danger-collapsible',\n definitionList: 'definition-list',\n definitionTerm: 'definition-term',\n deleted: 'deleted',\n details: 'details',\n details1: 'details-1',\n detailsImage: 'details-image',\n diff: 'diff',\n document: 'document',\n documentDownload: 'document-download',\n documentEmbed: 'document-embed',\n documentLink: 'document-link',\n documentUpload: 'document-upload',\n editorial: 'editorial',\n editorNote: 'editor-note',\n essay: 'essay',\n example: 'example',\n exampleAlt: 'example-alt',\n exampleCollapsible: 'example-collapsible',\n exampleList: 'example-list',\n extractorAiChat: 'extractor-ai-chat',\n extractorBlock: 'extractor-block',\n extractorConfiguration: 'extractor-configuration',\n extractorInformation: 'extractor-information',\n extractorPage: 'extractor-page',\n extractorPageCollapsible: 'extractor-page-collapsible',\n extractorPageFooter: 'extractor-page-footer',\n extractorPageFooterCollapsible: 'extractor-page-footer-collapsible',\n extractorPageHeader: 'extractor-page-header',\n extractorPageHeaderCollapsible: 'extractor-page-header-collapsible',\n extractorPageNumber: 'extractor-page-number',\n extractorPageNumberCollapsible: 'extractor-page-number-collapsible',\n extractorPageWithBlocks: 'extractor-page-with-blocks',\n extractorPageWithBlocksCollapsible: 'extractor-page-with-blocks-collapsible',\n extractorRepeatedText: 'extractor-repeated-text',\n featured: 'featured',\n feedback: 'feedback',\n figure: 'figure',\n flashcard: 'flashcard',\n flashcard1: 'flashcard-1',\n focusImage: 'focus-image',\n footNote: 'foot-note',\n formula: 'formula',\n gapText: 'gap-text',\n gapTextInstructionGrouped: 'gap-text-instruction-grouped',\n glossaryTerm: 'glossary-term',\n groupBorn: 'group-born',\n groupDied: 'group-died',\n handInAudio: 'hand-in-audio',\n handInContact: 'hand-in-contact',\n handInDocument: 'hand-in-document',\n handInFeedbackExpert: 'hand-in-feedback-expert',\n handInFeedbackSelf: 'hand-in-feedback-self',\n handInFile: 'hand-in-file',\n handInLocation: 'hand-in-location',\n handInPhoto: 'hand-in-photo',\n handInScan: 'hand-in-scan',\n handInSubmit: 'hand-in-submit',\n handInVideo: 'hand-in-video',\n handInVoice: 'hand-in-voice',\n help: 'help',\n helpAlt: 'help-alt',\n highlightText: 'highlight-text',\n hint: 'hint',\n hintAlt: 'hint-alt',\n hintCollapsible: 'hint-collapsible',\n image: 'image',\n imageBanner: 'image-banner',\n imageFigure: 'image-figure',\n imageFigureAlt: 'image-figure-alt',\n imageLandscape: 'image-landscape',\n imageLink: 'image-link',\n imageMood: 'image-mood',\n imageOnDevice: 'image-on-device',\n imagePortrait: 'image-portrait',\n imagePrototype: 'image-prototype',\n imageResponsive: 'image-responsive',\n imageScreenshot: 'image-screenshot',\n imageSeparator: 'image-separator',\n imageSeparatorAlt: 'image-separator-alt',\n imagesLogoGrave: 'images-logo-grave',\n imageStyled: 'image-styled',\n imageSuperWide: 'image-super-wide',\n imageZoom: 'image-zoom',\n indexTerm: 'index-term',\n info: 'info',\n infoAlt: 'info-alt',\n infoCollapsible: 'info-collapsible',\n internalLink: 'internal-link',\n interview: 'interview',\n interviewInstructionGrouped: 'interview-instruction-grouped',\n langAudioScript: 'lang-audio-script',\n langEnablingLanguageSkills: 'lang-enabling-language-skills',\n langEnglishAroundWorld: 'lang-english-around-world',\n langExtraActivity: 'lang-extra-activity',\n langGoodToKnow: 'lang-good-to-know',\n langHomework: 'lang-homework',\n langLearningGoal: 'lang-learning-goal',\n langLearningOutcomes: 'lang-learning-outcomes',\n langLearningStrategy: 'lang-learning-strategy',\n langLevelDown: 'lang-level-down',\n langLevelUp: 'lang-level-up',\n langLifeSkillIcon: 'lang-life-skill-icon',\n langLifeSkills: 'lang-life-skills',\n langLikeALocal: 'lang-like-a-local',\n langMaterial: 'lang-material',\n langTeacherNote: 'lang-teacher-note',\n langTeacherPronunciation: 'lang-teacher-pronunciation',\n langUsefulPhrases: 'lang-useful-phrases',\n langVideoScript: 'lang-video-script',\n langVocabulary: 'lang-vocabulary',\n learningDocumentationFeedback: 'learning-documentation-feedback',\n learningPathBook: 'learning-path-book',\n learningPathBotTraining: 'learning-path-bot-training',\n learningPathClassroomEvent: 'learning-path-classroom-event',\n learningPathClassroomTraining: 'learning-path-classroom-training',\n learningPathClosing: 'learning-path-closing',\n learningPathExternalLink: 'learning-path-external-link',\n learningPathFeedback: 'learning-path-feedback',\n learningPathLearningGoal: 'learning-path-learning-goal',\n learningPathLti: 'learning-path-lti',\n learningPathSign: 'learning-path-sign',\n learningPathStep: 'learning-path-step',\n learningPathVideoCall: 'learning-path-video-call',\n leAssignment: 'le-assignment',\n leClassroomEvent: 'le-classroom-event',\n leCompletion: 'le-completion',\n leExternalLink: 'le-external-link',\n leFinishingTask: 'le-finishing-task',\n leFollowUpTask: 'le-follow-up-task',\n leMultiDayEvent: 'le-multi-day-event',\n legend: 'legend',\n leDocumentDownload: 'le-document-download',\n leLearningObjectives: 'le-learning-objectives',\n leLearningStep: 'le-learning-step',\n leListenAudioEmbed: 'le-listen-audio-embed',\n lePreparationTask: 'le-preparation-task',\n leRead: 'le-read',\n leReadBook: 'le-read-book',\n leTask: 'le-task',\n leTodo: 'le-todo',\n leVideoCall: 'le-video-call',\n leWatchVideoEmbed: 'le-watch-video-embed',\n lifeSkillSticker: 'life-skill-sticker',\n list: 'list',\n listItem: 'list-item',\n mark: 'mark',\n match: 'match',\n matchAll: 'match-all',\n matchAllReverse: 'match-all-reverse',\n matchAudio: 'match-audio',\n matchMatrix: 'match-matrix',\n matchPicture: 'match-picture',\n matchReverse: 'match-reverse',\n matchSolutionGrouped: 'match-solution-grouped',\n message: 'message',\n metalevelExplanation: 'metalevel-explanation',\n metaSearchDefaultTerms: 'meta-search-default-terms',\n metaSearchDefaultTopics: 'meta-search-default-topics',\n milestone: 'milestone',\n module: 'module',\n moduleProduct: 'module-product',\n multipleChoice: 'multiple-choice',\n multipleChoice1: 'multiple-choice-1',\n multipleChoiceText: 'multiple-choice-text',\n multipleResponse: 'multiple-response',\n multipleResponse1: 'multiple-response-1',\n newspaperArticle: 'newspaper-article',\n note: 'note',\n noteAi: 'note-ai',\n noteAlt: 'note-alt',\n notebookArticle: 'notebook-article',\n noteCollapsible: 'note-collapsible',\n output: 'output',\n page: 'page',\n pageAcademy: 'page-academy',\n pageArticle: 'page-article',\n pageArticleAlt: 'page-article-alt',\n pageArticleResponsive: 'page-article-responsive',\n pageBanner: 'page-banner',\n pageBuyButton: 'page-buy-button',\n pageBuyButtonAlt: 'page-buy-button-alt',\n pageBuyButtonPromotion: 'page-buy-button-promotion',\n pageCategory: 'page-category',\n pageCollapsible: 'page-collapsible',\n pageContainer: 'page-container',\n pageContainerFolder: 'page-container-folder',\n pageContainerGroup: 'page-container-group',\n pageContainerNowrap: 'page-container-nowrap',\n pageContainerNowrapStretch: 'page-container-nowrap-stretch',\n pageContainerWrap: 'page-container-wrap',\n pageCoverImage: 'page-cover-image',\n pageFooter: 'page-footer',\n pageHero: 'page-hero',\n pageOpenBook: 'page-open-book',\n pageOpenBookList: 'page-open-book-list',\n pagePerson: 'page-person',\n pageProduct: 'page-product',\n pageProductList: 'page-product-list',\n pageProductVideo: 'page-product-video',\n pageProductVideoList: 'page-product-video-list',\n pagePromotion: 'page-promotion',\n pageSectionFolder: 'page-section-folder',\n pageShopInShop: 'page-shop-in-shop',\n pageSpecial: 'page-special',\n pageSubpage: 'page-subpage',\n pageSubscribe: 'page-subscribe',\n parameters: 'parameters',\n photo: 'photo',\n platformPath: 'platform-path',\n preparationNote: 'preparation-note',\n pronunciationTable: 'pronunciation-table',\n prototypeImages: 'prototype-images',\n qAndA: 'q-and-a',\n qAndACard: 'q-and-a-card',\n question1: 'question-1',\n quote: 'quote',\n rating: 'rating',\n recipe: 'recipe',\n recordAudio: 'record-audio',\n recordVideo: 'record-video',\n releaseNote: 'release-note',\n releaseNotesSummary: 'release-notes-summary',\n remark: 'remark',\n remarkAlt: 'remark-alt',\n remarkCollapsible: 'remark-collapsible',\n reviewApprovedNote: 'review-approved-note',\n reviewAuthorNote: 'review-author-note',\n reviewCustomerNote: 'review-customer-note',\n reviewNote: 'review-note',\n reviewRequestForReviewNote: 'review-request-for-review-note',\n reviewReviewerNote: 'review-reviewer-note',\n sampleSolution: 'sample-solution',\n scorm: 'scorm',\n screenshot: 'screenshot',\n selfAssessment: 'self-assessment',\n separator: 'separator',\n separatorAlt: 'separator-alt',\n sequence: 'sequence',\n sideNote: 'side-note',\n sideNoteCollapsible: 'side-note-collapsible',\n smartStandardArticleNonNormative: 'smart-standard-article-non-normative',\n smartStandardArticleNonNormativeCollapsible: 'smart-standard-article-non-normative-collapsible',\n smartStandardArticleNormative: 'smart-standard-article-normative',\n smartStandardArticleNormativeCollapsible: 'smart-standard-article-normative-collapsible',\n smartStandardExampleNonNormative: 'smart-standard-example-non-normative',\n smartStandardExampleNonNormativeCollapsible: 'smart-standard-example-non-normative-collapsible',\n smartStandardExampleNormative: 'smart-standard-example-normative',\n smartStandardExampleNormativeCollapsible: 'smart-standard-example-normative-collapsible',\n smartStandardFormula: 'smart-standard-formula',\n smartStandardFormulaNonNormative: 'smart-standard-formula-non-normative',\n smartStandardFormulaNormative: 'smart-standard-formula-normative',\n smartStandardImageFigureNonNormative: 'smart-standard-image-figure-non-normative',\n smartStandardImageFigureNonNormativeCollapsible:\n 'smart-standard-image-figure-non-normative-collapsible',\n smartStandardImageFigureNormative: 'smart-standard-image-figure-normative',\n smartStandardImageFigureNormativeCollapsible: 'smart-standard-image-figure-normative-collapsible',\n smartStandardLegend: 'smart-standard-legend',\n smartStandardLegendNonNormative: 'smart-standard-legend-non-normative',\n smartStandardLegendNormative: 'smart-standard-legend-normative',\n smartStandardList: 'smart-standard-list',\n smartStandardListCollapsible: 'smart-standard-list-collapsible',\n smartStandardListItem: 'smart-standard-list-item',\n smartStandardListItemCollapsible: 'smart-standard-list-item-collapsible',\n smartStandardNoteNonNormative: 'smart-standard-note-non-normative',\n smartStandardNoteNonNormativeCollapsible: 'smart-standard-note-non-normative-collapsible',\n smartStandardNoteNormative: 'smart-standard-note-normative',\n smartStandardNoteNormativeCollapsible: 'smart-standard-note-normative-collapsible',\n smartStandardRemarkLegend: 'smart-standard-remark-legend',\n smartStandardRemarkLegendNonNormative: 'smart-standard-remark-legend-non-normative',\n smartStandardRemarkLegendNormative: 'smart-standard-remark-legend-normative',\n smartStandardRemarkFormula: 'smart-standard-remark-formula',\n smartStandardRemarkFormulaNonNormative: 'smart-standard-remark-formula-non-normative',\n smartStandardRemarkFormulaNormative: 'smart-standard-remark-formula-normative',\n smartStandardRemarkNonNormative: 'smart-standard-remark-non-normative',\n smartStandardRemarkNonNormativeCollapsible: 'smart-standard-remark-non-normative-collapsible',\n smartStandardRemarkNormative: 'smart-standard-remark-normative',\n smartStandardRemarkNormativeCollapsible: 'smart-standard-remark-normative-collapsible',\n smartStandardRemarkTableImageNonNormative: 'smart-standard-remark-table-image-non-normative',\n smartStandardRemarkTableImageNonNormativeCollapsible:\n 'smart-standard-remark-table-image-non-normative-collapsible',\n smartStandardRemarkTableImageNormative: 'smart-standard-remark-table-image-normative',\n smartStandardRemarkTableImageNormativeCollapsible:\n 'smart-standard-remark-table-image-normative-collapsible',\n smartStandardRemarkTableNonNormative: 'smart-standard-remark-table-non-normative',\n smartStandardRemarkTableNonNormativeCollapsible:\n 'smart-standard-remark-table-non-normative-collapsible',\n smartStandardRemarkTableNormative: 'smart-standard-remark-table-normative',\n smartStandardRemarkTableNormativeCollapsible: 'smart-standard-remark-table-normative-collapsible',\n smartStandardTableImageNonNormative: 'smart-standard-table-image-non-normative',\n smartStandardTableImageNonNormativeCollapsible:\n 'smart-standard-table-image-non-normative-collapsible',\n smartStandardTableImageNormative: 'smart-standard-table-image-normative',\n smartStandardTableImageNormativeCollapsible: 'smart-standard-table-image-normative-collapsible',\n smartStandardTableNonNormative: 'smart-standard-table-non-normative',\n smartStandardTableNonNormativeCollapsible: 'smart-standard-table-non-normative-collapsible',\n smartStandardTableNormative: 'smart-standard-table-normative',\n smartStandardTableNormativeCollapsible: 'smart-standard-table-normative-collapsible',\n standardArticleNonNormative: 'standard-article-non-normative',\n standardArticleNormative: 'standard-article-normative',\n standardExampleNonNormative: 'standard-example-non-normative',\n standardExampleNormative: 'standard-example-normative',\n standardImageFigureNonNormative: 'standard-image-figure-non-normative',\n standardImageFigureNormative: 'standard-image-figure-normative',\n standardList: 'standard-list',\n standardListItem: 'standard-list-item',\n standardNoteNonNormative: 'standard-note-non-normative',\n standardNoteNormative: 'standard-note-normative',\n standardRemarkNonNormative: 'standard-remark-non-normative',\n standardRemarkNormative: 'standard-remark-normative',\n standardRemarkTableImageNonNormative: 'standard-remark-table-image-non-normative',\n standardRemarkTableImageNormative: 'standard-remark-table-image-normative',\n standardRemarkTableNonNormative: 'standard-remark-table-non-normative',\n standardRemarkTableNormative: 'standard-remark-table-normative',\n standardTableImageNonNormative: 'standard-table-image-non-normative',\n standardTableImageNormative: 'standard-table-image-normative',\n standardTableNonNormative: 'standard-table-non-normative',\n standardTableNormative: 'standard-table-normative',\n statement: 'statement',\n stdout: 'stdout',\n step: 'step',\n stepImageScreenshot: 'step-image-screenshot',\n stepImageScreenshotWithPointer: 'step-image-screenshot-with-pointer',\n sticker: 'sticker',\n stickyNote: 'sticky-note',\n stillImageFilm: 'still-image-film',\n stillImageFilmEmbed: 'still-image-film-embed',\n stillImageFilmLink: 'still-image-film-link',\n summary: 'summary',\n summaryAi: 'summary-ai',\n survey: 'survey',\n survey1: 'survey-1',\n surveyAnonymous: 'survey-anonymous',\n surveyAnonymous1: 'survey-anonymous-1',\n surveyMatrix: 'survey-matrix',\n surveyMatrixMe: 'survey-matrix-me',\n surveyRating: 'survey-rating',\n surveyRatingDisplay: 'survey-rating-display',\n surveyRatingOnce: 'survey-rating-once',\n table: 'table',\n tableAlt: 'table-alt',\n tableImage: 'table-image',\n tableImageAlt: 'table-image-alt',\n takePicture: 'take-picture',\n toc: 'toc',\n tocChapter: 'toc-chapter',\n tocInline: 'toc-inline',\n tocResource: 'toc-resource',\n tocContent: 'toc-content',\n trueFalse: 'true-false',\n trueFalse1: 'true-false-1',\n vendorAmcharts5Chart: 'vendor-amcharts-5-chart',\n vendorDatadogDashboardEmbed: 'vendor-datadog-dashboard-embed',\n vendorFormbricksEmbed: 'vendor-formbricks-embed',\n vendorFormbricksLink: 'vendor-formbricks-link',\n vendorFormbricksEmbedAnonymous: 'vendor-formbricks-embed-anonymous',\n vendorFormbricksLinkAnonymous: 'vendor-formbricks-link-anonymous',\n vendorHighchartsChart: 'vendor-highcharts-chart',\n vendorIframelyCard: 'vendor-iframely-card',\n vendorIframelyEmbed: 'vendor-iframely-embed',\n vendorIframelyPreview: 'vendor-iframely-preview',\n vendorIframelyPreviewMini: 'vendor-iframely-preview-mini',\n vendorJupyterCellCode: 'vendor-jupyter-cell-code',\n vendorJupyterCellMarkdown: 'vendor-jupyter-cell-markdown',\n vendorJupyterCellRaw: 'vendor-jupyter-cell-raw',\n vendorJupyterIpynb: 'vendor-jupyter-ipynb',\n vendorJupyterOutput: 'vendor-jupyter-output',\n vendorPadletEmbed: 'vendor-padlet-embed',\n vendorStripePricingTable: 'vendor-stripe-pricing-table',\n vendorStripePricingTableExternal: 'vendor-stripe-pricing-table-external',\n video: 'video',\n videoEmbed: 'video-embed',\n videoEmbedLandscape: 'video-embed-landscape',\n videoEmbedPortrait: 'video-embed-portrait',\n videoLandscape: 'video-landscape',\n videoLink: 'video-link',\n videoLinkLandscape: 'video-link-landscape',\n videoLinkPortrait: 'video-link-portrait',\n videoPortrait: 'video-portrait',\n videoTranscript: 'video-transcript',\n warning: 'warning',\n warningAlt: 'warning-alt',\n warningCollapsible: 'warning-collapsible',\n websiteLink: 'website-link',\n workbookArticle: 'workbook-article',\n});\n\nexport type BitTypeType = EnumType<typeof BitType>;\n\nexport { BitType };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst Count = superenum({\n infinity: 'infinity',\n});\n\nexport type CountType = EnumType<typeof Count> | number;\n\nexport { Count };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst ExampleType = superenum({\n none: 'none', // Example is not allowed\n string: 'string', // Example is a string value\n boolean: 'boolean', // Example is a boolean value\n});\n\nexport type ExampleTypeType = EnumType<typeof ExampleType>;\n\nexport { ExampleType };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst tags = {\n tag_title: '#',\n tag_anchor: '▼',\n tag_reference: '►',\n tag_property: '@',\n tag_item: '%',\n tag_instruction: '!',\n tag_hint: '?',\n tag_true: '+',\n tag_false: '-',\n tag_sampleSolution: '$',\n tag_gap: '_',\n tag_mark: '=',\n tag_resource: '&',\n} as const;\n\nconst Tag = superenum(tags);\n\nexport type TagType = EnumType<typeof Tag>;\n\nexport { Tag, tags };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst TagFormat = superenum({\n none: 'none', // The property does not have a value\n plainText: 'plainText', // If the value of the property is treated as a trimmed plain text string\n bitmarkText: 'bitmarkText', // If the value of the property is treated as a bitmark+\n number: 'number', // If the value is treated as a number\n boolean: 'boolean', // If the value is treated as a boolean\n invertedBoolean: 'invertedBoolean', // If the value is treated as a boolean with the value inverted (e.g. isLongAnswer ==> isShortAnswer = false)\n});\n\nexport type TagFormatType = EnumType<typeof TagFormat>;\n\nexport { TagFormat as TagFormat };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst TextFormat = superenum({\n // plain text\n plainText: 'text',\n latex: 'latex', // LaTeX code, alias for text\n json: 'json', // json, alias for text\n xml: 'xml', // xml, alias for text\n\n // bitmarkText\n // bitmarkText in the body is bitmark++ and bitmarkText in a tag is bitmark+\n bitmarkText: 'bitmark++',\n});\n\nexport type TextFormatType = EnumType<typeof TextFormat>;\n\nexport { TextFormat };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst CardSetConfigKey = superenum({\n flashcard: 'flashcard',\n definitionList: 'definitionList',\n elements: 'elements',\n statements: 'statements',\n quiz: 'quiz',\n feedback: 'feedback',\n questions: 'questions',\n matchPairs: 'matchPairs',\n matchAudioPairs: 'matchAudioPairs',\n matchImagePairs: 'matchImagePairs',\n matchMatrix: 'matchMatrix',\n table: 'table',\n pronunciationTable: 'pronunciationTable',\n botActionResponses: 'botActionResponses',\n exampleBitList: 'exampleBitList',\n clozeList: 'clozeList',\n ingredients: 'ingredients',\n // DEPRECATED - TO BE REMOVED IN THE FUTURE\n // captionDefinitionsList: 'captionDefinitionsList',\n bookReferenceList: 'bookReferenceList',\n});\n\nexport type CardSetConfigKeyType = EnumType<typeof CardSetConfigKey>;\n\nexport { CardSetConfigKey };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\n/**\n * Type of group config\n */\nconst GroupConfigType = superenum({\n standard: 'standard', // Any ordinary group\n resource: 'resource', // A resource group\n comboResource: 'comboResource', // A combo resource group\n});\n\nexport type GroupConfigTypeType = EnumType<typeof GroupConfigType>;\n\nexport { GroupConfigType };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst BitTagConfigKeyType = superenum({\n unknown: 'unknown', // Unknown tag type, used for error handling\n\n tag: 'tag', // A standard tag\n property: 'property', // A property tag\n resource: 'resource', // A resource tag\n\n //\n group: 'group', // A reusable group of tags\n});\n\nexport type BitTagConfigKeyTypeType = EnumType<typeof BitTagConfigKeyType>;\n\nexport { BitTagConfigKeyType };\n","import { type BitTagConfigKeyTypeType } from '../enum/BitTagConfigKeyType.ts';\nimport { type CountType } from '../enum/Count.ts';\nimport type { ConfigKeyType } from './enum/ConfigKey.ts';\nimport { type TagsConfig } from './TagsConfig.ts';\n\nabstract class AbstractTagConfig {\n readonly type: BitTagConfigKeyTypeType;\n readonly configKey: ConfigKeyType;\n readonly tag: string;\n readonly maxCount: CountType; // Default: 1\n readonly minCount: number; // Default: 0\n readonly chain?: TagsConfig;\n\n readonly jsonKey?: string; // If the json key is different from the tag\n\n readonly deprecated?: string; // Deprecated version\n\n public constructor(\n type: BitTagConfigKeyTypeType,\n configKey: ConfigKeyType,\n tag: string,\n maxCount: CountType,\n minCount: number,\n chain: TagsConfig | undefined,\n jsonKey: string | undefined,\n deprecated: string | undefined,\n ) {\n this.type = type;\n this.configKey = configKey;\n this.tag = tag;\n this.maxCount = maxCount;\n this.minCount = minCount;\n this.chain = chain;\n this.jsonKey = jsonKey;\n this.deprecated = deprecated;\n }\n}\n\nexport { AbstractTagConfig };\n","import { BitTagConfigKeyType, type BitTagConfigKeyTypeType } from '../enum/BitTagConfigKeyType.ts';\nimport { type CountType } from '../enum/Count.ts';\nimport { type TagType } from '../enum/Tag.ts';\nimport { AbstractTagConfig } from './AbstractTagConfig.ts';\nimport type { ConfigKeyType } from './enum/ConfigKey.ts';\nimport { type TagsConfig } from './TagsConfig.ts';\n\ninterface ToStringOptions {\n includeChains?: boolean;\n includeConfigs?: boolean;\n}\n\nclass MarkupTagConfig extends AbstractTagConfig {\n readonly type: BitTagConfigKeyTypeType = BitTagConfigKeyType.tag;\n\n public constructor(\n configKey: ConfigKeyType,\n tag: TagType,\n maxCount: CountType,\n minCount: number,\n chain: TagsConfig | undefined,\n // jsonKey?: PropertyJsonKeyType | ResourceJsonKeyType|undefined,\n // astKey?: PropertyAstKeyType|undefined,\n deprecated: string | undefined,\n ) {\n super(\n BitTagConfigKeyType.tag,\n configKey,\n tag,\n maxCount,\n minCount,\n chain,\n undefined,\n deprecated,\n );\n\n // TODO\n }\n\n public toString(options?: ToStringOptions): string {\n const opts = Object.assign({}, options);\n\n let s = `TAG[${this.tag}`;\n if (opts.includeConfigs) {\n if (this.deprecated != null) s += `, deprecated=${this.deprecated}`;\n if (this.maxCount != null) s += `, max=${this.maxCount}`;\n if (this.minCount != null) s += `, min=${this.minCount}`;\n }\n s += ']';\n\n if (this.chain && opts.includeChains) {\n s += `\\n|__`;\n let first = true;\n for (const tag of Object.values(this.chain)) {\n if (!first) s += ` `;\n s += `${tag.toString(opts)}`;\n first = false;\n }\n }\n\n return s;\n }\n}\n\nexport { MarkupTagConfig };\n","import { BitTagConfigKeyType, type BitTagConfigKeyTypeType } from '../enum/BitTagConfigKeyType.ts';\nimport { Count, type CountType } from '../enum/Count.ts';\nimport { type TagFormatType } from '../enum/TagFormat.ts';\nimport { AbstractTagConfig } from './AbstractTagConfig.ts';\nimport type { ConfigKeyType } from './enum/ConfigKey.ts';\nimport { type TagsConfig } from './TagsConfig.ts';\n\ninterface ToStringOptions {\n includeChains?: boolean;\n includeConfigs?: boolean;\n}\n\nclass PropertyTagConfig extends AbstractTagConfig {\n readonly type: BitTagConfigKeyTypeType = BitTagConfigKeyType.property;\n\n readonly array?: boolean; // If the property is treated as an array rather than a single value\n readonly format?: TagFormatType; // How the property is formatted\n readonly defaultValue?: string; // The default value of the property - this value can be omitted from the markup\n\n public constructor(\n configKey: ConfigKeyType,\n tag: string,\n maxCount: CountType,\n minCount: number,\n chain: TagsConfig | undefined,\n jsonKey: string | undefined,\n format: TagFormatType | undefined,\n defaultValue: string | undefined,\n deprecated: string | undefined,\n ) {\n super(\n BitTagConfigKeyType.property,\n configKey,\n tag,\n maxCount,\n minCount,\n chain,\n jsonKey,\n deprecated,\n );\n\n this.array = maxCount === Count.infinity || maxCount > 1;\n this.format = format;\n this.defaultValue = defaultValue;\n }\n\n public toString(options?: ToStringOptions): string {\n const opts = Object.assign({}, options);\n\n let s = `PTY[${this.tag}`;\n if (opts.includeConfigs) {\n if (this.deprecated != null) s += `, deprecated=${this.deprecated}`;\n if (this.maxCount != null) s += `, max=${this.maxCount}`;\n if (this.minCount != null) s += `, min=${this.minCount}`;\n if (this.array != null) s += `, arr=${this.array}`;\n if (this.format != null) s += `, fmt=${this.format}`;\n if (this.defaultValue != null) s += `, def=${this.defaultValue}`;\n if (this.jsonKey != null) s += `, json=${this.jsonKey}`;\n }\n s += ']';\n\n if (this.chain && opts.includeChains) {\n s += `\\n|__`;\n let first = true;\n for (const tag of Object.values(this.chain)) {\n if (!first) s += ` `;\n s += `${tag.toString(opts)}`;\n first = false;\n }\n }\n\n return s;\n }\n}\n\nexport { PropertyTagConfig };\n","import { BitTagConfigKeyType, type BitTagConfigKeyTypeType } from '../enum/BitTagConfigKeyType.ts';\nimport { type CountType } from '../enum/Count.ts';\nimport { AbstractTagConfig } from './AbstractTagConfig.ts';\nimport type { ConfigKeyType } from './enum/ConfigKey.ts';\nimport { type TagsConfig } from './TagsConfig.ts';\n\ninterface ToStringOptions {\n includeChains?: boolean;\n includeConfigs?: boolean;\n}\n\nclass ResourceTagConfig extends AbstractTagConfig {\n readonly type: BitTagConfigKeyTypeType = BitTagConfigKeyType.resource;\n\n public constructor(\n configKey: ConfigKeyType,\n tag: string,\n maxCount: CountType,\n minCount: number,\n chain: TagsConfig | undefined,\n jsonKey: string | undefined,\n deprecated: string | undefined,\n ) {\n super(\n BitTagConfigKeyType.resource,\n configKey,\n tag,\n maxCount,\n minCount,\n chain,\n jsonKey,\n deprecated,\n );\n\n // TODO\n }\n\n public toString(options?: ToStringOptions): string {\n const opts = Object.assign({}, options);\n\n let s = `RES[${this.tag}`;\n if (opts.includeConfigs) {\n if (this.deprecated != null) s += `, deprecated=${this.deprecated}`;\n if (this.maxCount != null) s += `, max=${this.maxCount}`;\n if (this.minCount != null) s += `, min=${this.minCount}`;\n if (this.jsonKey != null) s += `, json=${this.jsonKey}`;\n }\n s += ']';\n\n if (this.chain && opts.includeChains) {\n s += `\\n|__`;\n let first = true;\n for (const tag of Object.values(this.chain)) {\n if (!first) s += ` `;\n s += `${tag.toString(opts)}`;\n first = false;\n }\n }\n\n return s;\n }\n}\n\nexport { ResourceTagConfig };\n","import { type CountType } from '../enum/Count.ts';\nimport { type TagsConfig } from './TagsConfig.ts';\n\ninterface ToStringOptions {\n includeChains?: boolean;\n includeConfigs?: boolean;\n}\n\nclass CardVariantConfig {\n tags: TagsConfig;\n bodyAllowed?: boolean; // Default: true\n bodyRequired?: boolean; // Default: false\n repeatCount?: CountType; // Default: 1\n\n public constructor(\n tags: TagsConfig,\n bodyAllowed?: boolean,\n bodyRequired?: boolean,\n repeatCount?: CountType,\n ) {\n this.tags = tags;\n this.bodyAllowed = bodyAllowed == null ? true : bodyAllowed;\n this.bodyRequired = bodyRequired;\n this.repeatCount = repeatCount;\n }\n\n public toString(options?: ToStringOptions): string {\n const opts = Object.assign({}, options);\n\n let s = '';\n\n // Flags\n const flags: string[] = [];\n if (this.bodyAllowed) flags.push('bodyAllowed');\n if (this.bodyRequired) flags.push('bodyRequired');\n if (this.repeatCount != null) flags.push(`repeatCount=${this.repeatCount}`);\n s += `[Flags]\\n${flags.join(', ')}`;\n\n // Tags\n s += `\\n\\n[Tags]`;\n\n for (const tag of Object.values(this.tags)) {\n s += `\\n${tag.toString(opts)}`;\n }\n\n return s;\n }\n}\n\nexport { CardVariantConfig };\n","import { CardVariantConfig } from './CardVariantConfig.ts';\nimport { type CardSetConfigKeyType } from './enum/CardSetConfigKey.ts';\n\ninterface ToStringOptions {\n includeChains?: boolean;\n includeConfigs?: boolean;\n}\n\nclass CardSetConfig {\n readonly configKey: CardSetConfigKeyType;\n readonly variants: CardVariantConfig[][];\n\n public constructor(configKey: CardSetConfigKeyType, variants: CardVariantConfig[][]) {\n this.configKey = configKey;\n this.variants = variants;\n }\n\n public toString(options?: ToStringOptions): string {\n const opts = Object.assign({}, options);\n\n let s = '';\n\n let sideNo = 0;\n let variantNo = 0;\n for (const sides of this.variants) {\n for (const variant of sides) {\n s += `[Card - Side ${sideNo}, Variant ${variantNo}]`;\n s += `\\n${variant.toString(opts)}`;\n variantNo++;\n }\n sideNo++;\n }\n\n return s;\n }\n}\n\nexport { CardSetConfig };\n","import { type BitTypeType } from '../enum/BitType.ts';\nimport { Count } from '../enum/Count.ts';\nimport { type ExampleTypeType } from '../enum/ExampleType.ts';\nimport { type TextFormatType } from '../enum/TextFormat.ts';\nimport { CardSetConfig } from './CardSetConfig.ts';\nimport type { ConfigKeyType } from './enum/ConfigKey.ts';\nimport { type TagsConfig } from './TagsConfig.ts';\n\ninterface ToStringOptions {\n includeChains?: boolean;\n includeConfigs?: boolean;\n}\n\nclass BitConfig {\n readonly since: string; // Supported since version\n readonly bitType: BitTypeType;\n readonly inheritedBitTypes: BitTypeType[]; // Bit inheritance tree (array for order)\n readonly inheritedBitTypesSet: Set<BitTypeType>; // Bit inheritance tree (set for faster lookup)\n readonly textFormatDefault: TextFormatType; // Default text format\n readonly tags: TagsConfig = {};\n readonly cardSet?: CardSetConfig;\n readonly quizBit?: boolean; // True if the bit is a quiz bit\n readonly deprecated?: string; // Deprecated version\n readonly bodyAllowed?: boolean; // Default: true\n readonly bodyRequired?: boolean; // Default: false\n readonly footerAllowed?: boolean; // Default: true\n readonly footerRequired?: boolean; // Default: false\n readonly resourceAttachmentAllowed?: boolean; // Default: true\n readonly rootExampleType?: ExampleTypeType;\n readonly comboResourceConfigKey?: ConfigKeyType;\n\n public constructor(config: {\n since: string;\n bitType: BitTypeType;\n inheritedBitTypes: BitTypeType[];\n textFormatDefault: TextFormatType;\n tags: TagsConfig;\n cardSet: CardSetConfig | undefined;\n quizBit: boolean | undefined;\n deprecated: string | undefined;\n bodyAllowed: boolean | undefined;\n bodyRequired: boolean | undefined;\n footerAllowed: boolean | undefined;\n footerRequired: boolean | undefined;\n resourceAttachmentAllowed: boolean | undefined;\n rootExampleType: ExampleTypeType | undefined;\n comboResourceConfigKey: ConfigKeyType | undefined;\n }) {\n const {\n since,\n bitType,\n inheritedBitTypes,\n textFormatDefault,\n tags,\n cardSet,\n quizBit,\n deprecated,\n bodyAllowed,\n bodyRequired,\n footerAllowed,\n footerRequired,\n resourceAttachmentAllowed,\n rootExampleType,\n comboResourceConfigKey,\n } = config;\n this.since = since;\n this.bitType = bitType;\n this.inheritedBitTypes = inheritedBitTypes;\n this.inheritedBitTypesSet = new Set(inheritedBitTypes);\n this.textFormatDefault = textFormatDefault;\n this.tags = tags;\n this.cardSet = cardSet;\n this.quizBit = quizBit;\n this.deprecated = deprecated;\n this.bodyAllowed = bodyAllowed == null ? true : bodyAllowed;\n this.bodyRequired = bodyRequired;\n this.footerAllowed = footerAllowed == null ? true : footerAllowed;\n this.footerRequired = footerRequired;\n this.resourceAttachmentAllowed =\n resourceAttachmentAllowed == null ? true : resourceAttachmentAllowed;\n this.rootExampleType = rootExampleType;\n this.comboResourceConfigKey = comboResourceConfigKey;\n }\n\n public toString(options?: ToStringOptions): string {\n const opts = Object.assign({}, options);\n\n let s = `[Bit]\\n${this.bitType}`;\n\n // Aliases\n if (this.inheritedBitTypes.length > 0) {\n s += `\\n\\n[Inheritance]`;\n\n s += `\\n${this.inheritedBitTypes.join(' => ')}`;\n }\n\n // Default text format\n s += `\\n\\n[Default text format]\\n${this.textFormatDefault}`;\n\n // Flags\n const flags: string[] = [];\n if (this.since != null) flags.push(`since=${this.since}`);\n if (this.deprecated != null) flags.push(`deprecated=${this.deprecated}`);\n if (this.bodyAllowed) flags.push('bodyAllowed');\n if (this.bodyRequired) flags.push('bodyRequired');\n if (this.footerAllowed) flags.push('footerAllowed');\n if (this.footerRequired) flags.push('footerRequired');\n if (this.resourceAttachmentAllowed) flags.push('resourceAttachmentAllowed');\n if (this.rootExampleType != null) flags.push(`rootExampleType=${this.rootExampleType}`);\n if (this.comboResourceConfigKey != null)\n flags.push(`comboResourceConfigKey=${this.comboResourceConfigKey}`);\n s += `\\n\\n[Flags]\\n${flags.join(', ')}`;\n\n // Tags\n s += `\\n\\n[Tags]`;\n\n for (const tag of Object.values(this.tags)) {\n if (tag.maxCount === Count.infinity || tag.maxCount > 0) {\n s += `\\n${tag.toString(opts)}`;\n }\n }\n\n // Cards\n if (this.cardSet) {\n s += `\\n\\n${this.cardSet.toString(opts)}`;\n }\n\n return s;\n }\n}\n\nexport { BitConfig };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nimport {\n BitTagConfigKeyType,\n type BitTagConfigKeyTypeType,\n} from '../../enum/BitTagConfigKeyType.ts';\nimport { groupKeys } from '../../enum/GroupKey.ts';\nimport { propertyKeys } from '../../enum/PropertyKey.ts';\nimport { resourceKeys } from '../../enum/ResourceKey.ts';\nimport { ResourceType, type ResourceTypeType } from '../../enum/ResourceType.ts';\nimport { tags } from '../../enum/Tag.ts';\n\n/**\n * Config keys for tags, resources, properties, and groups.\n *\n * Each type has a different prefix so there are no conflicts:\n * - Resources: `&`\n * - Properties: `@`\n * - Groups: `group_`\n * - Tags: <none>\n *\n */\nconst ConfigKey = superenum({\n // Internal\n _unknown: '_unknown',\n\n // Tags\n ...tags,\n\n // Resources\n ...resourceKeys,\n\n // Properties\n ...propertyKeys,\n\n // Groups\n ...groupKeys,\n});\n\nexport type ConfigKeyType = EnumType<typeof ConfigKey>;\n\nfunction typeFromConfigKey(tagKey: ConfigKeyType): BitTagConfigKeyTypeType {\n if (!tagKey) return BitTagConfigKeyType.unknown;\n\n if (tagKey.startsWith('@')) return BitTagConfigKeyType.property;\n if (tagKey.startsWith('&')) return BitTagConfigKeyType.resource;\n if (tagKey.startsWith('group_')) return BitTagConfigKeyType.group;\n\n return BitTagConfigKeyType.tag;\n}\n\nfunction configKeyToPropertyType(configKey: string): string {\n return configKey.replace(/^@/, '');\n}\n\nfunction configKeyToResourceType(configKey: string): ResourceTypeType {\n return ResourceType.fromKey(configKey.replace(/^&/, '')) as ResourceTypeType;\n}\n\nexport { ConfigKey, configKeyToPropertyType, configKeyToResourceType, typeFromConfigKey };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst groupKeys = {\n group_standardAllBits: 'group_standardAllBits',\n group_standardItemLeadInstructionHint: 'group_standardItemLeadInstructionHint',\n group_standardExample: 'group_standardExample',\n group_standardTags: 'group_standardTags',\n group_imageSource: 'group_imageSource',\n group_technicalTerm: 'group_technicalTerm',\n group_person: 'group_person',\n group_gap: 'group_gap',\n group_trueFalse: 'group_trueFalse',\n group_markConfig: 'group_markConfig',\n group_mark: 'group_mark',\n group_bookCommon: 'group_bookCommon',\n group_learningPathCommon: 'group_learningPathCommon',\n group_quizCommon: 'group_quizCommon',\n group_resourceBitTags: 'group_resourceBitTags',\n group_resourceCommon: 'group_resourceCommon',\n group_resourceImageCommon: 'group_resourceImageCommon',\n group_resourceAudioCommon: 'group_resourceAudioCommon',\n group_resourceVideoCommon: 'group_resourceVideoCommon',\n group_resourceIcon: 'group_resourceIcon', // Alias for image\n group_resourceImage: 'group_resourceImage',\n group_resourceImageEmbed: 'group_resourceImageEmbed',\n group_resourceImageLink: 'group_resourceImageLink',\n group_resourceImageResponsive: 'group_resourceImageResponsive', // Combo resource\n group_resourceImagePortrait: 'group_resourceImagePortrait',\n group_resourceImageLandscape: 'group_resourceImageLandscape',\n group_resourceAudio: 'group_resourceAudio',\n group_resourceAudioEmbed: 'group_resourceAudioEmbed',\n group_resourceAudioLink: 'group_resourceAudioLink',\n group_resourceVideo: 'group_resourceVideo',\n group_resourceVideoEmbed: 'group_resourceVideoEmbed',\n group_resourceVideoLink: 'group_resourceVideoLink',\n group_resourceStillImageFilm: 'group_resourceStillImageFilm', // Combo resource\n group_resourceStillImageFilmEmbed: 'group_resourceStillImageFilmEmbed',\n group_resourceStillImageFilmLink: 'group_resourceStillImageFilmLink',\n group_resourceArticle: 'group_resourceArticle',\n group_resourceArticleEmbed: 'group_resourceArticleEmbed',\n group_resourceArticleLink: 'group_resourceArticleLink',\n group_resourceDocument: 'group_resourceDocument',\n group_resourceDocumentEmbed: 'group_resourceDocumentEmbed',\n group_resourceDocumentLink: 'group_resourceDocumentLink',\n group_resourceDocumentDownload: 'group_resourceDocumentDownload',\n group_resourceAppLink: 'group_resourceAppLink',\n group_resourceWebsiteLink: 'group_resourceWebsiteLink',\n} as const;\n\nconst GroupKey = superenum(groupKeys);\n\nexport type GroupKeyType = EnumType<typeof GroupKey>;\n\nexport { GroupKey, groupKeys };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst propertyKeys = {\n property_action: '@action',\n property_activityType: '@activityType',\n property_additionalSolutions: '@additionalSolutions',\n property_ageRange: '@ageRange',\n property_aiGenerated: '@aiGenerated',\n property_analyticsTag: '@analyticsTag',\n property_allowedBit: '@allowedBit',\n property_allowSubtitles: '@allowSubtitles',\n property_alt: '@alt',\n property_altLangTag: '@altLangTag',\n property_author: '@author',\n property_autoplay: '@autoplay',\n property_availableClassifications: '@availableClassifications',\n property_blockId: '@blockId',\n property_book: '@book',\n property_bookAlias: '@bookAlias',\n property_bookDiff: '@bookDiff',\n property_bot: '@bot',\n property_bubbleTag: '@bubbleTag',\n property_buttonCaption: '@buttonCaption',\n property_callToActionUrl: '@callToActionUrl',\n property_caption: '@caption',\n property_categoryTag: '@categoryTag',\n property_chatWithBook: '@chatWithBook',\n property_chatWithBookBrainKey: '@chatWithBookBrainKey',\n property_citationStyle: '@citationStyle',\n property_classification: '@classification',\n property_codeLineNumbers: '@codeLineNumbers',\n property_codeMinimap: '@codeMinimap',\n property_color: '@color',\n property_colorTag: '@colorTag',\n property_computerLanguage: '@computerLanguage',\n property_content2Buy: '@content2Buy',\n property_copyright: '@copyright',\n property_coverColor: '@coverColor',\n property_coverImage: '@coverImage',\n property_customerExternalId: '@customerExternalId',\n property_customerId: '@customerId',\n property_date: '@date',\n property_dateEnd: '@dateEnd',\n property_decimalPlaces: '@decimalPlaces',\n property_deeplink: '@deeplink',\n property_disableCalculation: '@disableCalculation',\n property_disableFeedback: '@disableFeedback',\n property_diffTo: '@diffTo',\n property_diffOp: '@diffOp',\n property_diffRef: '@diffRef',\n property_diffContext: '@diffContext',\n property_diffTime: '@diffTime',\n property_duration: '@duration',\n property_emphasis: '@emphasis',\n property_example: '@example',\n property_externalId: '@externalId',\n property_externalLink: '@externalLink',\n property_externalLinkText: '@externalLinkText',\n property_feedbackEngine: '@feedbackEngine',\n property_feedbackType: '@feedbackType',\n property_flashcardSet: '@flashcardSet',\n property_focusX: '@focusX',\n property_focusY: '@focusY',\n property_format: '@format',\n property_handInAcceptFileType: '@handInAcceptFileType',\n property_handInRequirement: '@handInRequirement',\n property_handInInstruction: '@handInInstruction',\n property_hasBookNavigation: '@hasBookNavigation',\n property_hasMarkAsDone: '@hasMarkAsDone',\n property_height: '@height',\n property_icon: '@icon',\n property_iconTag: '@iconTag',\n property_id: '@id',\n property_imageFirst: '@imageFirst',\n property_imageSource: '@imageSource',\n property_index: '@index',\n property_internalComment: '@internalComment',\n property_isCaseSensitive: '@isCaseSensitive',\n property_isInfoOnly: '@isInfoOnly',\n property_isPublic: '@isPublic',\n property_isTemplate: '@isTemplate',\n property_isTemplateStripTheme: '@isTemplateStripTheme',\n property_isTracked: '@isTracked',\n property_jupyterExecutionCount: '@jupyterExecutionCount',\n property_jupyterId: '@jupyterId',\n property_kind: '@kind',\n property_label: '@label',\n property_labelFalse: '@labelFalse',\n property_labelTrue: '@labelTrue',\n property_lang: '@lang',\n property_language: '@language',\n property_layer: '@layer',\n property_layerRole: '@layerRole',\n property_levelCEFRp: '@levelCEFRp',\n property_levelCEFR: '@levelCEFR',\n property_levelILR: '@levelILR',\n property_levelACTFL: '@levelACTFL',\n property_license: '@license',\n property_list: '@list',\n property_listItemIndent: '@listItemIndent',\n property_location: '@location',\n property_machineTranslated: '@machineTranslated',\n property_mailingList: '@mailingList',\n // property_markConfig: '@markConfig',\n property_maxCreatedBits: '@maxCreatedBits',\n property_maxDisplayLevel: '@maxDisplayLevel',\n property_maxTocChapterLevel: '@maxTocChapterLevel',\n property_mockupId: '@mockupId',\n property_mute: '@mute',\n property_padletId: '@padletId',\n property_pageNo: '@pageNo',\n property_partialAnswer: '@partialAnswer',\n property_partner: '@partner', // Deprecated, replaced by person\n property_person: '@person',\n property_path: '@path',\n property_pointerLeft: '@pointerLeft',\n property_pointerTop: '@pointerTop',\n property_posterImage: '@posterImage',\n property_page: '@page',\n property_processHandIn: '@processHandIn',\n property_processHandInLocation: '@processHandInLocation',\n property_product: '@product',\n property_productFolder: '@productFolder',\n property_productId: '@productId',\n // property_productList: '@productList',\n property_productVideo: '@productVideo',\n // property_productVideoList: '@productVideoList',\n property_progress: '@progress',\n property_mark: '@mark',\n property_reference: '@reference',\n property_sampleSolution: '@sampleSolution',\n property_title: '@title',\n property_publications: '@publications',\n property_publisher: '@publisher',\n property_publisherName: '@publisherName',\n property_quizCountItems: '@quizCountItems',\n property_quizStrikethroughSolutions: '@quizStrikethroughSolutions',\n property_quotedPerson: '@quotedPerson',\n property_ratingLevelEnd: '@ratingLevelEnd',\n property_ratingLevelSelected: '@ratingLevelSelected',\n property_ratingLevelStart: '@ratingLevelStart',\n property_reaction: '@reaction',\n property_reasonableNumOfChars: '@reasonableNumOfChars',\n property_reductionTag: '@reductionTag',\n property_refAuthor: '@refAuthor',\n property_refBookTitle: '@refBookTitle',\n property_refPublisher: '@refPublisher',\n property_refPublicationYear: '@refPublicationYear',\n property_releaseDate: '@releaseDate',\n property_releaseKind: '@releaseKind',\n property_releaseVersion: '@releaseVersion',\n property_resolved: '@resolved',\n property_resolvedBy: '@resolvedBy',\n property_resolvedDate: '@resolvedDate',\n property_revealSolutions: '@revealSolutions',\n property_scormSource: '@scormSource',\n property_search: '@search',\n property_searchIndex: '@searchIndex',\n property_servings: '@servings',\n property_showInIndex: '@showInIndex',\n property_showSubtitles: '@showSubtitles',\n property_siteName: '@siteName',\n property_size: '@size',\n property_slug: '@slug',\n property_spaceId: '@spaceId',\n property_src1x: '@src1x',\n property_src2x: '@src2x',\n property_src3x: '@src3x',\n property_src4x: '@src4x',\n property_stripePricingTableId: '@stripePricingTableId',\n property_stripePublishableKey: '@stripePublishableKey',\n property_subject: '@subject',\n property_subtype: '@subtype',\n property_tableAutoWidth: '@tableAutoWidth',\n property_tableFixedHeader: '@tableFixedHeader',\n property_tableHeaderWhitespaceNoWrap: '@tableHeaderWhitespaceNoWrap',\n property_tableHeight: '@tableHeight',\n property_tablePagination: '@tablePagination',\n property_tablePaginationLimit: '@tablePaginationLimit',\n property_tableResizableColumns: '@tableResizableColumns',\n property_tableColumnMinWidth: '@tableColumnMinWidth',\n property_tableSearch: '@tableSearch',\n property_tableSort: '@tableSort',\n property_tableWhitespaceNoWrap: '@tableWhitespaceNoWrap',\n property_tag: '@tag',\n property_target: '@target',\n property_technicalTerm: '@technicalTerm',\n property_textReference: '@textReference',\n property_theme: '@theme',\n property_thumbImage: '@thumbImage',\n property_toc: '@toc',\n property_tocResource: '@tocResource',\n property_tocContent: '@tocContent',\n property_topicTag: '@topicTag',\n property_trim: '@trim',\n property_unit: '@unit',\n property_unitAbbr: '@unitAbbr',\n property_vendorDashboardId: '@vendorDashboardId',\n property_vendorSurveyId: '@vendorSurveyId',\n property_vendorUrl: '@vendorUrl',\n property_videoCallLink: '@videoCallLink',\n property_width: '@width',\n property_x: '@x',\n property_y: '@y',\n property_zoomDisabled: '@zoomDisabled',\n} as const;\n\nconst PropertyKey = superenum(propertyKeys);\n\nexport type PropertyKeyType = EnumType<typeof PropertyKey>;\n\nexport { PropertyKey, propertyKeys };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst resourceKeys = {\n resource_image: '&image',\n resource_imageResponsive: '&imageResponsive',\n resource_imagePortrait: '&imagePortrait',\n resource_imageLandscape: '&imageLandscape',\n resource_imageEmbed: '&imageEmbed',\n resource_imageLink: '&imageLink',\n resource_audio: '&audio',\n resource_audioEmbed: '&audioEmbed',\n resource_audioLink: '&audioLink',\n resource_video: '&video',\n resource_videoEmbed: '&videoEmbed',\n resource_videoLink: '&videoLink',\n resource_stillImageFilm: '&stillImageFilm',\n resource_stillImageFilmEmbed: '&stillImageFilmEmbed',\n resource_stillImageFilmLink: '&stillImageFilmLink',\n resource_article: '&article',\n resource_articleEmbed: '&articleEmbed',\n resource_articleLink: '&articleLink',\n resource_document: '&document',\n resource_documentEmbed: '&documentEmbed',\n resource_documentLink: '&documentLink',\n resource_documentDownload: '&documentDownload',\n resource_appLink: '&appLink',\n resource_websiteLink: '&websiteLink',\n\n resource_icon: '&icon',\n resource_backgroundWallpaper: '&backgroundWallpaper',\n resource_imagePlaceholder: '&imagePlaceholder',\n} as const;\n\nconst ResourceKey = superenum(resourceKeys);\n\nexport type ResourceKeyType = EnumType<typeof ResourceKey>;\n\nexport { ResourceKey, resourceKeys };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nimport { StringUtils } from '../../utils/StringUtils.ts';\nimport type { ConfigKeyType } from '../config/enum/ConfigKey.ts';\n\nconst ResourceType = superenum({\n unknown: 'unknown',\n\n image: 'image',\n imageResponsive: 'image-responsive',\n imagePortrait: 'image-portrait',\n imageLandscape: 'image-landscape',\n imageEmbed: 'image-embed',\n imageLink: 'image-link',\n audio: 'audio',\n audioEmbed: 'audio-embed',\n audioLink: 'audio-link',\n video: 'video',\n videoEmbed: 'video-embed',\n videoLink: 'video-link',\n stillImageFilm: 'still-image-film',\n stillImageFilmEmbed: 'still-image-film-embed',\n stillImageFilmLink: 'still-image-film-link',\n article: 'article',\n articleEmbed: 'article-embed',\n articleLink: 'article-link',\n document: 'document',\n documentEmbed: 'document-embed',\n documentLink: 'document-link',\n documentDownload: 'document-download',\n appLink: 'app-link',\n websiteLink: 'website-link',\n\n // Aliases for image\n icon: 'icon',\n backgroundWallpaper: 'backgroundWallpaper',\n imagePlaceholder: 'imagePlaceholder',\n});\n\nexport type ResourceTypeType = EnumType<typeof ResourceType>;\n\nfunction resourceTypeToConfigKey(type: ResourceTypeType): ConfigKeyType {\n return `&${StringUtils.kebabToCamel(type)}` as ConfigKeyType;\n}\n\nexport { ResourceType, resourceTypeToConfigKey };\n","class StringUtils {\n /**\n * Check if an object is a string.\n *\n * @param obj - The object to check.\n * @returns true if the object is a string, otherwise false.\n */\n isString(obj: unknown): boolean {\n return typeof obj === 'string' || obj instanceof String;\n }\n\n /**\n * Pass any value and convert it to a string.\n *\n * @param str the value to convert to a string\n * @returns the string or an empty string if the value is undefined\n */\n string(str: unknown | undefined): string {\n return str ? `${str}` : '';\n }\n\n /**\n * Pass any value and convert it to a trimmed string.\n *\n * @param str the value to convert to a trimmed string\n * @returns the trimmed string or an empty string if the value is undefined\n */\n trimmedString(str: unknown | undefined): string {\n return this.string(str).trim();\n }\n\n /**\n * Count the occurrences of a substring in a string.\n *\n * @param str the string to search\n * @param subStr the substring to search for\n * @returns the number of occurrences of the substring in the string\n */\n countOccurrences(str: string, subStr: string): number {\n return str.split(subStr).length - 1;\n }\n\n /**\n * Count the occurrences of a substring at the start of a string.\n *\n * @param str the string to search\n * @param subStr the substring to search for\n * @returns the number of occurrences of the substring at the start of the string\n */\n countOccurrencesAtStart(str: string, subStr: string): number {\n let count = 0;\n while (str.startsWith(subStr)) {\n count++;\n str = str.substring(subStr.length);\n }\n\n return count;\n }\n\n /**\n * Count the occurrences of a substring at the end of a string.\n *\n * @param str the string to search\n * @param subStr the substring to search for\n * @returns the number of occurrences of the substring at the end of the string\n */\n countOccurrencesAtEnd(str: string, subStr: string): number {\n let count = 0;\n while (str.endsWith(subStr)) {\n count++;\n str = str.substring(0, str.length - subStr.length);\n }\n\n return count;\n }\n\n /**\n * Split a string using a set of placeholders, returning an array of strings and placeholders.\n *\n * e.g.\n * str = \"This {0} a {1} with lots {2} placeholders\"\n * placeholders = [\"{0}\", \"{1}\", \"{2}\"]\n *\n * return = [\"This \", \"{0}\", \" a \", \"{1}\", \" with lots \", \"{2}\", \" placeholders\"]\n *\n * @param str\n * @param placeholders\n */\n splitPlaceholders(str: string, placeholders: string[]): string[] {\n let res: string[] = [str];\n\n // Split all texts in texts (with key) and return new text array with key inserted at the split points\n const splitTexts = (texts: string[], key: string): string[] => {\n const newTexts: string[] = [];\n for (const text of texts) {\n const tParts = text.split(key);\n for (let i = 0, len = tParts.length; i < len; i++) {\n const tPart = tParts[i];\n const lastIndex = i === len - 1;\n newTexts.push(tPart);\n if (!lastIndex) {\n newTexts.push(key);\n }\n }\n }\n return newTexts;\n };\n\n for (const p of placeholders) {\n res = splitTexts(res, p);\n }\n\n return res;\n }\n\n /**\n * Return the first line of text to a specified maximum width.\n * @argument str The string to be truncated.\n * @argument width The maximum width of the wrapped text in characters.\n * @returns A string containing the first line, possibly truncated.\n */\n firstLine(str: string, width?: number): string {\n const result: string = str;\n\n if (width == null) width = str.length;\n if (width < 1 || str == null || str.length <= width) return result;\n\n const strs = str.split(`\\n`);\n if (strs.length > 0) {\n return strs[0].substring(0, width);\n }\n\n return result;\n }\n\n /**\n * Wraps the provided string input to a specified maximum width.\n * @argument str The string to be wrapped.\n * @argument width The maximum width of the wrapped text in characters.\n * @returns A string array containing all lines.\n */\n wordWrap(str: string, width: number): string[] {\n const result: string[] = [];\n\n if (width < 1 || str == null || str.length <= width) return result;\n\n const len = str.length;\n const rangeMax = len - width; // we don't need to split after this position\n let rangeStart = 0;\n let subString: string;\n while (rangeStart < rangeMax) {\n let subLength: number;\n const rangeEnd = rangeStart + width;\n // First test for newlines in this range. If so, don't split on word break but on the newline.\n const ixNewLine = str.indexOf('\\n', rangeStart);\n if (ixNewLine > -1 && ixNewLine > rangeStart && ixNewLine < rangeEnd) {\n subLength = ixNewLine - rangeStart;\n subString = str.substr(rangeStart, subLength);\n rangeStart = rangeStart + subLength + 1;\n result.push(subString);\n continue;\n }\n // No newlines. Find the last wordbreak in the range.\n const ix = str.lastIndexOf(' ', rangeEnd); // find the last word break\n let rangeStartNext = 0;\n if (ix > -1 && ix != rangeStart - 1) {\n subLength = ix - rangeStart;\n if (subLength > 0) {\n rangeStartNext = rangeStart + subLength + 1; // +1 to skip the whitespace\n }\n //else { // not needed anymore because of the maxPos check\n // sub = str.substr(pos);\n // newPos = len + 1;\n //}\n } else {\n // The range has no whitespace.\n subLength = width;\n rangeStartNext = rangeStart + width;\n }\n subString = str.substr(rangeStart, subLength);\n rangeStart = rangeStartNext;\n result.push(subString.trim());\n }\n // Add the remainder\n if (rangeStart < len) {\n subString = str.substr(rangeStart);\n result.push(subString);\n }\n\n return result;\n }\n\n /**\n * Convert a kebab-case string to camelCase.\n *\n * @param str the string to convert\n * @returns the camelCase version of the string\n */\n kebabToCamel(str: string): string {\n return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());\n }\n}\n\nconst stringUtils = new StringUtils();\n\nexport { stringUtils as StringUtils };\n","import { type CountType } from '../enum/Count.ts';\nimport type { ConfigKeyType } from './enum/ConfigKey.ts';\nimport { type TagsConfig } from './TagsConfig.ts';\n\nclass ResourcesConfig {\n readonly tags: TagsConfig;\n readonly resourceAttachmentAllowed: boolean;\n readonly resourceAttachmentConfigKey: string | undefined;\n readonly comboResourceConfigKeysMap: Map<ConfigKeyType, ConfigKeyType[]>;\n\n public constructor(\n tags: TagsConfig,\n resourceAttachmentAllowed: boolean | undefined,\n resourceAttachmentConfigKey: ConfigKeyType | undefined,\n comboResourceConfigKeysMap: Map<ConfigKeyType, ConfigKeyType[]>,\n ) {\n this.tags = tags;\n this.resourceAttachmentAllowed = resourceAttachmentAllowed ?? false;\n this.resourceAttachmentConfigKey = resourceAttachmentConfigKey;\n this.comboResourceConfigKeysMap = comboResourceConfigKeysMap;\n }\n\n public getCountsMin(): Map<ConfigKeyType, number> {\n const counts: Map<ConfigKeyType, number> = new Map();\n for (const r of Object.values(this.tags)) {\n if (r.minCount != null) {\n counts.set(r.configKey, r.minCount);\n }\n }\n return counts;\n }\n\n public getCountsMax(): Map<ConfigKeyType, CountType> {\n const counts: Map<ConfigKeyType, CountType> = new Map();\n for (const r of Object.values(this.tags)) {\n if (r.maxCount != null) {\n counts.set(r.configKey, r.maxCount);\n }\n }\n return counts;\n }\n}\n\nexport { ResourcesConfig };\n","export interface GetFilenamesSyncOptions {\n match?: RegExp;\n recursive?: boolean;\n maxDepth?: number;\n}\n\ninterface RemoveUnwantedPropertiesOptions {\n ignoreAllUndefined?: boolean;\n ignoreUndefined?: string[];\n ignoreAllFalse?: boolean;\n ignoreFalse?: string[];\n ignoreAllEmptyString?: boolean;\n ignoreEmptyString?: string[];\n ignoreAllEmptyArrays?: boolean;\n ignoreEmptyArrays?: string[];\n ignoreAllEmptyObjects?: boolean;\n ignoreEmptyObjects?: string[];\n}\n\nclass ObjectUtils {\n /**\n * Check if a variable is a function\n *\n * @param val\n * @returns true if a function\n */\n isFunction(val: unknown) {\n return Object.prototype.toString.call(val) === '[object Function]';\n }\n\n /**\n * Check if a variable is an array\n *\n * @param val\n * @returns true if a array\n */\n isArray(val: unknown) {\n return Array.isArray(val); // Object.prototype.toString.call(val) === '[object Array]';\n }\n\n /**\n * Check if a variable is a date\n *\n * @param val\n * @returns true if a date\n */\n isDate(val: unknown) {\n return Object.prototype.toString.call(val) === '[object Date]';\n }\n\n /**\n * Check if a variable is a object\n *\n * @param val\n * @returns true if an object\n */\n isObject(val: unknown) {\n return Object.prototype.toString.call(val) === '[object Object]';\n }\n\n /**\n * Check if a variable is a value (i.e. a number)\n *\n * @param val\n * @returns true if a value\n */\n isValue(val: unknown) {\n return !this.isObject(val) && !this.isArray(val);\n }\n\n /**\n * Get the value of a property in a plain JS object\n * using a path string or array.\n *\n * @param obj the object to get a property from\n * @param path the path to the property to set as a dotted string or array or a mix of both\n * @returns the value of the property, or undefined if the property does not exist\n */\n getViaPath(obj: unknown, path: string | string[]): unknown {\n if (!obj) return undefined;\n if (!path) return undefined;\n if (!Array.isArray(path)) path = [path]; // Ensure path is an array\n\n // Split dotted paths\n path = path.flatMap((p) => p.split('.'));\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let node = obj as any;\n\n for (const key of path) {\n if (node == null) return undefined;\n node = node[key];\n }\n\n return node;\n }\n\n /**\n * Set the value of a property in a plain JS object\n * using a path string or array.\n *\n * @param obj the object to modify\n * @param path the path to the property to set as a dotted string or array or a mix of both\n * @param value the value to set\n * @param create - if true, create plain objects in the path if they do not exist\n * @returns true if the value was set, false if the value was not set\n */\n setViaPath(obj: unknown, path: string | string[], value: unknown, create?: boolean): boolean {\n if (!obj) return false;\n if (!path) return false;\n if (!Array.isArray(path)) path = [path]; // Ensure path is an array\n\n // Split dotted paths\n path = path.flatMap((p) => p.split('.'));\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let node = obj as any;\n\n for (let i = 0; i < path.length - 1; i++) {\n const key = path[i];\n if (node[key] == undefined) {\n if (create) {\n node[key] = {};\n } else {\n return false;\n }\n }\n node = node[key];\n }\n\n node[path[path.length - 1]] = value;\n return true;\n }\n\n /**\n * Return an array of the objects at the end of the paths\n * specified in the path array.\n *\n * e.g.\n *\n * const obj = obj = {\n * a: {\n * b: {\n * c: 1,\n * },\n * },\n * d: [{ e: 2 }, { f: 3 }],\n * g: [{ h: [{ i: 4 }] }, { h: [{ i: 5 }, { i: 6 }] }, { h: [{ i: 7 }] }],\n * }\n *\n * objectUtils.flatMapPath(obj, ['a']);\n * [{ b: { c: 1 }]\n *\n * objectUtils.flatMapPath(obj, ['a', 'b']);\n * [{ c: 1 }]\n *\n * objectUtils.flatMapPath(obj, ['a', 'b', 'c']);\n * [1]\n *\n * objectUtils.flatMapPath(obj, ['d']);\n * [{ e: 2 }, { f: 3 }]\n *\n * objectUtils.flatMapPath(obj, ['d', 'e']);\n * [2]\n *\n * objectUtils.flatMapPath(obj, ['g']);\n * [{ h: [{ i: 4 }] }, { h: [{ i: 5 }, { i: 6 }] }, { h: [{ i: 7 }] }]\n *\n * objectUtils.flatMapPath(obj, ['g', 'h']);\n * [{ i: 4 }, { i: 5 }, { i: 6 }, { i: 7 }]\n *\n * objectUtils.flatMapPath(obj, ['g', 'h', 'i']);\n * [4, 5, 6, 7]\n *\n * @param obj\n * @param path\n * @returns\n */\n flatMapPath(obj: unknown, path: string | string[]): unknown[] {\n if (!obj) return [];\n if (!path) return [];\n if (!Array.isArray(path)) path = [path]; // Ensure path is an array\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const node = obj as any;\n\n const key = path.shift();\n if (key == null) return node;\n const data = node[key];\n\n if (!data) return [];\n if (Array.isArray(data)) {\n return data.flatMap((d) => this.flatMapPath(d, path.slice()));\n } else {\n return [this.flatMapPath(data, path)].flat();\n }\n }\n\n // testFlatMapPath() {\n // const obj = {\n // a: {\n // b: {\n // c: 1,\n // },\n // },\n // d: [{ e: 2 }, { f: 3 }],\n // g: [{ h: [{ i: 4 }] }, { h: [{ i: 5 }, { i: 6 }] }, { h: [{ i: 4 }] }],\n // };\n\n // console.log(this.flatMapPath(obj, 'a')); // [{ b: { c: 1 }]\n // console.log(this.flatMapPath(obj, ['a', 'b'])); // [{ c: 1 }]\n // console.log(this.flatMapPath(obj, ['a', 'b', 'c'])); // [1]\n // console.log(this.flatMapPath(obj, ['d'])); // [{ e: 2 }, { f: 3 }]\n // console.log(this.flatMapPath(obj, ['d', 'e'])); // [2]\n // console.log(this.flatMapPath(obj, ['g'])); // [{ h: [{ i: 4 }] }, { h: [{ i: 5 }, { i: 6 }] }, { h: [{ i: 4 }] }]\n // console.log(this.flatMapPath(obj, ['g', 'h'])); // [{ i: 4 }, { i: 5 }, { i: 6 }, { i: 4 }]\n // console.log(this.flatMapPath(obj, ['g', 'h', 'i'])); // [4, 5, 6, 4]\n // }\n\n /**\n * Order the properties of a plain JS object.\n * The original properties are removed, and re-added in the new order.\n * Any non-specified properties are dropped.\n *\n * NOTE: The JS spec does not specifiy an order for property iteration, but all major JS engines including V8 which\n * is used by NodeJS and Chrome do have a specific iteration order which is defined by the order properties are\n * added to an object. Many applications rely on this iteration order.\n *\n * @param obj - object with properties to re-order\n * @param order - array of property keys in the desired order.\n */\n orderProperties<T>(obj: T, order: string[]): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const objAsAny = obj as any;\n const props = Object.assign({}, objAsAny);\n for (const k of Object.keys(objAsAny)) {\n delete objAsAny[k];\n }\n for (const k of order) {\n if (Object.prototype.hasOwnProperty.call(props, k)) {\n objAsAny[k] = props[k];\n }\n }\n }\n\n /**\n * Remove any keys whose value is 'undefined' from a plain JS object\n *\n * @param obj plain JS object\n * @param excludeKeys keys to be excluded from removal\n */\n removeUndefinedProperties(obj: unknown, excludeKeys?: string[]): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const objAsAny = obj as any;\n\n for (const [k, v] of Object.entries(objAsAny)) {\n if (excludeKeys && excludeKeys.indexOf(k) >= 0) continue;\n\n if (v == undefined) {\n delete objAsAny[k];\n }\n }\n }\n\n /**\n * Remove any keys whose value is 'false' from a plain JS object\n *\n * @param obj plain JS object\n * @param excludeKeys keys to be excluded from removal\n */\n removeFalseProperties(obj: unknown, excludeKeys?: string[]): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const objAsAny = obj as any;\n\n for (const [k, v] of Object.entries(objAsAny)) {\n if (excludeKeys && excludeKeys.indexOf(k) >= 0) continue;\n\n if (v === false) {\n delete objAsAny[k];\n }\n }\n }\n\n /**\n * Remove any keys whose value is '' from a plain JS object\n *\n * @param obj plain JS object\n * @param excludeKeys keys to be excluded from removal\n */\n removeEmptyStringProperties(obj: unknown, excludeKeys?: string[]): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const objAsAny = obj as any;\n\n for (const [k, v] of Object.entries(objAsAny)) {\n if (excludeKeys && excludeKeys.indexOf(k) >= 0) continue;\n\n if (v === '') {\n delete objAsAny[k];\n }\n }\n }\n\n /**\n * Remove any keys whose value is '[]' from a plain JS object\n *\n * @param obj plain JS object\n * @param excludeKeys keys to be excluded from removal\n */\n removeEmptyArrayProperties(obj: unknown, excludeKeys?: string[]): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const objAsAny = obj as any;\n\n for (const [k, v] of Object.entries(objAsAny)) {\n if (excludeKeys && excludeKeys.indexOf(k) >= 0) continue;\n\n if (Array.isArray(v) && v.length === 0) {\n delete objAsAny[k];\n }\n }\n }\n\n /**\n * Remove any keys whose value is '{}' from a plain JS object\n *\n * @param obj plain JS object\n * @param excludeKeys keys to be excluded from removal\n */\n removeEmptyObjectProperties(obj: unknown, excludeKeys?: string[]): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const objAsAny = obj as any;\n\n for (const [k, v] of Object.entries(objAsAny)) {\n if (excludeKeys && excludeKeys.indexOf(k) >= 0) continue;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (this.isObject(v) && Object.keys(v as any).length === 0) {\n delete objAsAny[k];\n }\n }\n }\n\n /**\n * Remove any unwanted properties from a plain JS object\n *\n * @param obj plain JS object\n * @param excludeKeys keys to be excluded from removal\n */\n removeUnwantedProperties(obj: unknown, options?: RemoveUnwantedPropertiesOptions): void {\n options = Object.assign({}, options);\n\n if (!options.ignoreAllUndefined) this.removeUndefinedProperties(obj, options.ignoreUndefined);\n if (!options.ignoreAllFalse) this.removeFalseProperties(obj, options.ignoreFalse);\n if (!options.ignoreAllEmptyString)\n this.removeEmptyStringProperties(obj, options.ignoreEmptyString);\n if (!options.ignoreAllEmptyArrays)\n this.removeEmptyArrayProperties(obj, options.ignoreEmptyArrays);\n if (!options.ignoreAllEmptyObjects)\n this.removeEmptyObjectProperties(obj, options.ignoreEmptyObjects);\n }\n\n /**\n * Extract a single value from a plain JS object\n *\n * If the item at the key is not an array, the item is returned.\n * If the object at the key is an array, the last item in the array is returned.\n *\n * @param obj\n * @param key\n * @returns a non-array value, or undefined if the key does not exist\n */\n extractSingleValue(obj: unknown, key: string): unknown | undefined {\n if (!obj) return undefined;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const objAsAny = obj as any;\n\n if (objAsAny[key] == undefined) return undefined;\n\n let value = objAsAny[key];\n if (Array.isArray(value)) {\n if (value.length === 0) return undefined;\n value = value[value.length - 1];\n }\n\n return value;\n }\n\n /**\n * Deep merge two or more objects or arrays.\n * (c) 2023 Chris Ferdinandi, MIT License, https://gomakethings.com\n * TypeScript version (c) 2023 RA Sewell\n *\n * @param objs The arrays or objects to merge\n * @returns The merged arrays or objects\n */\n public deepMerge<T>(...objs: unknown[]): T {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _deepMerge(...objs: any[]) {\n /**\n * Get the object type\n */\n function getType(obj: unknown) {\n return Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();\n }\n\n /**\n * Deep merge two objects\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function mergeObj(clone: any, obj: any) {\n for (const [key, value] of Object.entries(obj)) {\n const type = getType(value);\n if (\n clone[key] !== undefined &&\n getType(clone[key]) === type &&\n ['array', 'object'].includes(type)\n ) {\n clone[key] = _deepMerge(clone[key], value);\n } else {\n clone[key] = structuredClone(value);\n }\n }\n }\n\n // Create a clone of the first item in the objs array\n let clone = structuredClone(objs.shift());\n\n // Loop through each item\n for (const obj of objs) {\n // Get the object type\n const type = getType(obj);\n\n // If the current item isn't the same type as the clone, replace it\n if (getType(clone) !== type) {\n clone = structuredClone(obj);\n continue;\n }\n\n // Otherwise, merge\n if (type === 'array') {\n clone = [...clone, ...structuredClone(obj)];\n } else if (type === 'object') {\n mergeObj(clone, obj);\n } else {\n clone = obj;\n }\n }\n\n return clone;\n }\n\n return _deepMerge(...objs) as T;\n }\n}\n\nconst objectUtils = new ObjectUtils();\n\nexport { objectUtils as ObjectUtils };\n","import { type _CardSetsConfig } from '../../model/config/_Config.ts';\nimport { CardSetConfigKey } from '../../model/config/enum/CardSetConfigKey.ts';\nimport { ConfigKey } from '../../model/config/enum/ConfigKey.ts';\nimport { Count } from '../../model/enum/Count.ts';\nimport { TagFormat } from '../../model/enum/TagFormat.ts';\n\nconst CARDSETS: _CardSetsConfig = {\n [CardSetConfigKey.definitionList]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.group_resourceIcon,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.flashcard]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.group_resourceIcon,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.elements]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.statements]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.tag_true,\n maxCount: 1,\n },\n {\n key: ConfigKey.tag_false,\n maxCount: 1,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n bodyAllowed: false,\n },\n ],\n ],\n },\n [CardSetConfigKey.quiz]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.group_trueFalse,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n bodyAllowed: false,\n },\n ],\n ],\n },\n [CardSetConfigKey.feedback]: {\n variants: [\n // Side 1\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_trueFalse,\n },\n {\n key: ConfigKey.tag_title,\n },\n ],\n bodyAllowed: false,\n },\n ],\n // Side 2\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.property_reasonableNumOfChars,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n {\n key: ConfigKey.tag_title,\n },\n ],\n bodyAllowed: true,\n },\n ],\n ],\n },\n [CardSetConfigKey.questions]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.property_reasonableNumOfChars,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.tag_sampleSolution,\n },\n {\n key: ConfigKey.property_sampleSolution,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_additionalSolutions,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_partialAnswer,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n // matchPairs\n // TODO: We actually need to allow for different card configurations, because titles are valid on the first card only.\n // For now we allow them to be valid on all cards, but we need to change this.\n\n [CardSetConfigKey.matchPairs]: {\n variants: [\n // Side 1\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.property_isCaseSensitive,\n format: TagFormat.boolean,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.matchAudioPairs]: {\n variants: [\n // Side 1\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.resource_audio,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.matchImagePairs]: {\n variants: [\n // Side 1\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.resource_image,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.matchMatrix]: {\n variants: [\n // Side 1\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.property_isCaseSensitive,\n format: TagFormat.boolean,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.table]: {\n variants: [\n // Side 1\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.tag_title,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.pronunciationTable]: {\n variants: [\n // Side 1\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.resource_audio,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.botActionResponses]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.property_reaction,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n },\n ],\n ],\n },\n [CardSetConfigKey.clozeList]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.group_standardTags,\n },\n {\n key: ConfigKey.group_gap,\n },\n ],\n },\n ],\n ],\n },\n [CardSetConfigKey.exampleBitList]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.group_standardTags,\n },\n {\n key: ConfigKey.tag_title,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n [CardSetConfigKey.ingredients]: {\n variants: [\n [\n {\n tags: [\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.group_trueFalse,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.property_unit,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_unitAbbr,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_decimalPlaces,\n format: TagFormat.number,\n defaultValue: '1',\n },\n {\n key: ConfigKey.property_disableCalculation,\n format: TagFormat.boolean,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n // DEPRECATED - TO BE REMOVED IN THE FUTURE\n // [CardSetConfigKey._captionDefinitionsList]: {\n // variants: [\n // // Side 1\n // [\n // // Variant 1..N\n // {\n // tags: [\n // {\n // type: BitTagType.tag,\n // configKey: TagConfigKey.title,\n // },\n // ],\n // repeatCount: Count.infinity,\n // },\n // ],\n // ],\n // },\n [CardSetConfigKey.bookReferenceList]: {\n variants: [\n // Side 1\n [\n // Variant 1..N\n {\n tags: [\n {\n key: ConfigKey.group_standardTags,\n },\n {\n key: ConfigKey.property_refAuthor,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_refBookTitle,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_refPublisher,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_refPublicationYear,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_citationStyle,\n format: TagFormat.plainText,\n },\n ],\n repeatCount: Count.infinity,\n },\n ],\n ],\n },\n};\n\nexport { CARDSETS as CARDS };\n","import { type _GroupsConfig } from '../../model/config/_Config.ts';\nimport { ConfigKey } from '../../model/config/enum/ConfigKey.ts';\nimport { GroupConfigType } from '../../model/config/enum/GroupConfigType.ts';\nimport { Count } from '../../model/enum/Count.ts';\nimport { TagFormat } from '../../model/enum/TagFormat.ts';\n\nconst GROUPS: _GroupsConfig = {\n [ConfigKey.group_standardAllBits]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_id,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_customerId,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_externalId,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_isTemplate,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_isTemplateStripTheme,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_aiGenerated,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_machineTranslated,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_searchIndex,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_analyticsTag,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_categoryTag,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_topicTag,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_altLangTag,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_feedbackEngine,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_feedbackType,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_disableFeedback,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_diffTo,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_diffOp,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_diffRef,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_diffContext,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_diffTime,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_ageRange,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_lang,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_publisher,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_publisherName,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_theme,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_target,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_tag,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_reductionTag,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_bubbleTag,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_levelCEFRp,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_levelCEFR,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_levelILR,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_levelACTFL,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_icon,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_iconTag,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_colorTag,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.tag_anchor,\n },\n {\n key: ConfigKey.property_search,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_showInIndex,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_layer,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_layerRole,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n ],\n },\n [ConfigKey.group_standardItemLeadInstructionHint]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.tag_item,\n chain: [\n {\n key: ConfigKey.tag_item,\n maxCount: 3,\n },\n ],\n },\n {\n key: ConfigKey.tag_instruction,\n },\n {\n key: ConfigKey.tag_hint,\n },\n ],\n },\n [ConfigKey.group_standardExample]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_example,\n format: TagFormat.plainText,\n },\n ],\n },\n [ConfigKey.group_standardTags]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.group_standardAllBits,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n },\n [ConfigKey.group_imageSource]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_imageSource,\n format: TagFormat.plainText,\n chain: [\n {\n key: ConfigKey.property_mockupId,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_size,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_format,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_trim,\n format: TagFormat.boolean,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_technicalTerm]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_technicalTerm,\n format: TagFormat.plainText,\n chain: [\n {\n key: ConfigKey.property_lang,\n format: TagFormat.plainText,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_person]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_person,\n format: TagFormat.plainText,\n chain: [\n {\n key: ConfigKey.property_title,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.group_resourceImage,\n },\n ],\n },\n {\n // Deprecated (parter renamed to person)\n key: ConfigKey.property_partner,\n format: TagFormat.plainText,\n chain: [\n {\n key: ConfigKey.property_title,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.group_resourceImage,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_gap]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.tag_gap,\n maxCount: Count.infinity,\n chain: [\n {\n key: ConfigKey.tag_gap,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n {\n key: ConfigKey.property_isCaseSensitive,\n format: TagFormat.boolean,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_trueFalse]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.tag_true,\n maxCount: Count.infinity,\n chain: [\n {\n key: ConfigKey.tag_true,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.tag_false,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n },\n {\n key: ConfigKey.tag_false,\n maxCount: Count.infinity,\n chain: [\n {\n key: ConfigKey.tag_true,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.tag_false,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.group_standardItemLeadInstructionHint,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_markConfig]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_mark,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n chain: [\n {\n key: ConfigKey.property_color,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_emphasis,\n format: TagFormat.plainText,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_mark]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.tag_mark,\n maxCount: Count.infinity,\n chain: [\n {\n key: ConfigKey.property_mark,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.group_standardExample,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_bookCommon]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_language,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_customerExternalId,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_spaceId,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_kind,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_hasMarkAsDone,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_processHandIn,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_processHandInLocation,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_isPublic,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_isTemplate,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_isTemplateStripTheme,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_chatWithBook,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_chatWithBookBrainKey,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.tag_title,\n maxCount: 2,\n },\n {\n key: ConfigKey.property_subtype,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_coverImage,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_coverColor,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_subject,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_author,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_publications,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_duration,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_maxTocChapterLevel,\n format: TagFormat.number,\n },\n ],\n },\n [ConfigKey.group_learningPathCommon]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_action,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_duration,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_date,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_dateEnd,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_location,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_list,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_textReference,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_isTracked,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_isInfoOnly,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_deeplink,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_book,\n format: TagFormat.plainText,\n chain: [\n {\n key: ConfigKey.tag_reference,\n maxCount: 2,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_quizCommon]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_revealSolutions,\n format: TagFormat.boolean,\n // defaultValue: 'false',\n },\n ],\n },\n //\n // Resource groups\n //\n [ConfigKey.group_resourceBitTags]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.resource_imagePlaceholder,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n maxCount: 1,\n },\n ],\n },\n //\n // Common resource properties\n //\n [ConfigKey.group_resourceCommon]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.property_license,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_copyright,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_caption,\n format: TagFormat.bitmarkText,\n },\n {\n key: ConfigKey.property_showInIndex,\n format: TagFormat.boolean,\n defaultValue: 'false',\n },\n {\n key: ConfigKey.property_search,\n format: TagFormat.plainText,\n },\n ],\n },\n [ConfigKey.group_resourceImageCommon]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n {\n key: ConfigKey.property_src1x,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_src2x,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_src3x,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_src4x,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_width,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_height,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_alt,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_zoomDisabled,\n format: TagFormat.boolean,\n },\n ],\n },\n [ConfigKey.group_resourceAudioCommon]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n {\n key: ConfigKey.property_duration,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_mute,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_autoplay,\n format: TagFormat.boolean,\n },\n ],\n },\n [ConfigKey.group_resourceVideoCommon]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n {\n key: ConfigKey.property_width,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_height,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_duration,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_mute,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_autoplay,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_allowSubtitles,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_showSubtitles,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_alt,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_posterImage,\n format: TagFormat.plainText,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n },\n {\n key: ConfigKey.property_src1x,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_src2x,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_src3x,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_src4x,\n format: TagFormat.plainText,\n },\n ],\n },\n //\n // Single resources\n //\n [ConfigKey.group_resourceIcon]: {\n type: GroupConfigType.standard,\n tags: [\n {\n key: ConfigKey.resource_icon,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceImage]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_image,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceImagePortrait]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_imagePortrait,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceImageLandscape]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_imageLandscape,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceImageEmbed]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_imageEmbed,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceImageLink]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_imageLink,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceAudio]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_audio,\n chain: [\n {\n key: ConfigKey.group_resourceAudioCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceAudioEmbed]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_audioEmbed,\n chain: [\n {\n key: ConfigKey.group_resourceAudioCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceAudioLink]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_audioLink,\n chain: [\n {\n key: ConfigKey.group_resourceAudioCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceVideo]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_video,\n chain: [\n {\n key: ConfigKey.group_resourceVideoCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceVideoEmbed]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_videoEmbed,\n chain: [\n {\n key: ConfigKey.group_resourceVideoCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceVideoLink]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_videoLink,\n chain: [\n {\n key: ConfigKey.group_resourceVideoCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceStillImageFilmEmbed]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_stillImageFilmEmbed,\n chain: [\n {\n key: ConfigKey.group_resourceVideoCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceStillImageFilmLink]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_stillImageFilmLink,\n chain: [\n {\n key: ConfigKey.group_resourceVideoCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceArticle]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_article,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceArticleEmbed]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_articleEmbed,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceArticleLink]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_articleLink,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceDocument]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_document,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceDocumentEmbed]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_documentEmbed,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceDocumentLink]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_documentLink,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceDocumentDownload]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_documentDownload,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceAppLink]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_appLink,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n [ConfigKey.group_resourceWebsiteLink]: {\n type: GroupConfigType.resource,\n tags: [\n {\n key: ConfigKey.resource_websiteLink,\n chain: [\n {\n key: ConfigKey.group_resourceCommon,\n },\n ],\n },\n ],\n },\n //\n // Combo resources - these are resources made up of a combination of multiple resources.\n //\n [ConfigKey.group_resourceStillImageFilm]: {\n type: GroupConfigType.comboResource,\n comboResourceConfigKey: ConfigKey.resource_stillImageFilm,\n tags: [\n {\n key: ConfigKey.group_resourceImage,\n maxCount: 1,\n minCount: 1,\n },\n {\n key: ConfigKey.group_resourceAudio,\n maxCount: 1,\n minCount: 1,\n },\n ],\n },\n [ConfigKey.group_resourceImageResponsive]: {\n type: GroupConfigType.comboResource,\n comboResourceConfigKey: ConfigKey.resource_imageResponsive,\n tags: [\n {\n key: ConfigKey.group_resourceImagePortrait,\n maxCount: 1,\n minCount: 1,\n },\n {\n key: ConfigKey.group_resourceImageLandscape,\n maxCount: 1,\n minCount: 1,\n },\n ],\n },\n};\n\nexport { GROUPS };\n","import { type _CardVariantConfig, type _TagInfoConfig } from '../model/config/_Config.ts';\nimport { CardSetConfig } from '../model/config/CardSetConfig.ts';\nimport { CardVariantConfig } from '../model/config/CardVariantConfig.ts';\nimport { type CardSetConfigKeyType } from '../model/config/enum/CardSetConfigKey.ts';\nimport { ConfigKey, typeFromConfigKey } from '../model/config/enum/ConfigKey.ts';\nimport { MarkupTagConfig } from '../model/config/MarkupTagConfig.ts';\nimport { PropertyTagConfig } from '../model/config/PropertyTagConfig.ts';\nimport { ResourceTagConfig } from '../model/config/ResourceTagConfig.ts';\nimport { type TagsConfig } from '../model/config/TagsConfig.ts';\nimport { type TagsConfigWithInfo } from '../model/config/TagsConfigWithInfo.ts';\nimport { BitTagConfigKeyType } from '../model/enum/BitTagConfigKeyType.ts';\nimport { Tag } from '../model/enum/Tag.ts';\nimport { CARDS } from './raw/cardSets.ts';\nimport { GROUPS } from './raw/groups.ts';\n\nconst MAX_COUNT_DEFAULT = 1;\nconst MIN_COUNT_DEFAULT = 0;\n\nclass ConfigHydrator {\n public hydrateTagsConfig(_tags: _TagInfoConfig[]): TagsConfigWithInfo {\n const tagsWithInfo: TagsConfigWithInfo = {\n tags: {},\n };\n\n for (const t of _tags) {\n let expandedTags: TagsConfigWithInfo | undefined;\n const type = typeFromConfigKey(t.key);\n\n switch (type) {\n case BitTagConfigKeyType.tag:\n expandedTags = this.hydrateTagConfig(t);\n break;\n\n case BitTagConfigKeyType.property:\n expandedTags = this.hydratePropertyTagConfig(t);\n break;\n\n case BitTagConfigKeyType.resource:\n expandedTags = this.hydrateResourceTagConfig(t);\n break;\n\n case BitTagConfigKeyType.group:\n expandedTags = this.hydrateTagGroupConfig(t);\n break;\n\n default:\n throw new Error(`Unknown tag type for config key '${t.key}'`);\n }\n\n if (expandedTags) {\n tagsWithInfo.tags = {\n ...tagsWithInfo.tags,\n ...expandedTags.tags,\n };\n\n tagsWithInfo.info = Object.assign(tagsWithInfo.info ?? {}, expandedTags.info);\n }\n }\n\n return tagsWithInfo;\n }\n\n public hydrateCardSetConfig(\n _cardSet: CardSetConfigKeyType | undefined,\n ): CardSetConfig | undefined {\n if (!_cardSet) return undefined;\n const _cardSetConfig = CARDS[_cardSet];\n if (!_cardSetConfig) throw new Error(`No config found for card set config key '${_cardSet}'`);\n\n const variants: CardVariantConfig[][] = [];\n\n for (const _variants of _cardSetConfig.variants) {\n const variantsOfSide = [];\n for (const _variant of _variants) {\n const v = this.hydrateCardVariantConfig(_variant);\n variantsOfSide.push(v);\n }\n variants.push(variantsOfSide);\n }\n\n const cardSetConfig = new CardSetConfig(_cardSet, variants);\n\n return cardSetConfig;\n }\n\n private hydrateTagConfig(_tag: _TagInfoConfig): TagsConfigWithInfo {\n const { key: _configKey, maxCount, minCount, chain: _chain, deprecated } = _tag;\n const configKey = ConfigKey.fromValue(_configKey) || ConfigKey._unknown;\n if (!configKey) throw new Error(`No tag key found for config key '${configKey}'`);\n const tag = Tag.fromValue(configKey);\n if (!tag) throw new Error(`No tag found for tag config key '${configKey}'`);\n\n let chain: TagsConfig | undefined;\n\n if (_chain) {\n chain = this.hydrateTagsConfig(_chain).tags;\n }\n\n const hydratedTag = new MarkupTagConfig(\n configKey,\n tag,\n maxCount ?? MAX_COUNT_DEFAULT,\n minCount ?? MIN_COUNT_DEFAULT,\n chain,\n deprecated,\n );\n\n return {\n tags: {\n [configKey]: hydratedTag,\n },\n };\n }\n\n private hydratePropertyTagConfig(_tag: _TagInfoConfig): TagsConfigWithInfo {\n const {\n key: _configKey,\n maxCount,\n minCount,\n chain: _chain,\n deprecated,\n format,\n defaultValue,\n jsonKey,\n } = _tag;\n const configKey = ConfigKey.fromValue(_configKey) || ConfigKey._unknown;\n if (!configKey) throw new Error(`No property key found for config key '${configKey}'`);\n const tag = _configKey.substring(1); // Remove the '@' prefix from the config key\n\n let chain: TagsConfig | undefined;\n\n if (_chain) {\n chain = this.hydrateTagsConfig(_chain).tags;\n }\n\n const hydratedTag = new PropertyTagConfig(\n configKey,\n tag,\n maxCount ?? MAX_COUNT_DEFAULT,\n minCount ?? MIN_COUNT_DEFAULT,\n chain,\n jsonKey,\n format,\n defaultValue,\n deprecated,\n );\n\n return {\n tags: {\n [configKey]: hydratedTag,\n },\n };\n }\n\n private hydrateResourceTagConfig(_tag: _TagInfoConfig): TagsConfigWithInfo {\n const { key: _configKey, maxCount, minCount, chain: _chain, deprecated, jsonKey } = _tag;\n const configKey = ConfigKey.fromValue(_configKey) || ConfigKey._unknown;\n if (!configKey) throw new Error(`No resource key found for config key '${configKey}'`);\n const tag = _configKey.substring(1); // Remove the '&' prefix from the config key\n\n let chain: TagsConfig | undefined;\n\n if (_chain) {\n chain = this.hydrateTagsConfig(_chain).tags;\n }\n\n const hydratedTag = new ResourceTagConfig(\n configKey,\n tag,\n maxCount ?? MAX_COUNT_DEFAULT,\n minCount ?? MIN_COUNT_DEFAULT,\n chain,\n jsonKey,\n deprecated,\n );\n\n return {\n tags: {\n [configKey]: hydratedTag,\n },\n };\n }\n\n private hydrateTagGroupConfig(_tag: _TagInfoConfig): TagsConfigWithInfo {\n const { key: _configKey } = _tag;\n const configKey = ConfigKey.fromValue(_configKey) || ConfigKey._unknown;\n if (!configKey) throw new Error(`No group key found for config key '${configKey}'`);\n const _groupConfig = GROUPS[configKey];\n if (!_groupConfig) throw new Error(`No config found for group config key '${_configKey}'`);\n const { tags: _tags } = _groupConfig;\n\n const tags = this.hydrateTagsConfig(_tags).tags;\n\n // Apply the groups min/max to the first tag in the group (overriding the default value)\n const tagValues = Object.values(tags);\n if (tagValues.length > 0) {\n const firstTag = tagValues[0];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const firstTagAny = firstTag as any;\n firstTagAny.maxCount = _tag.maxCount ?? firstTag.maxCount;\n firstTagAny.minCount = _tag.minCount ?? firstTag.minCount;\n }\n\n return {\n tags,\n info: {\n comboResourceConfigKey: _groupConfig.comboResourceConfigKey,\n },\n };\n }\n\n private hydrateCardVariantConfig(_variant: _CardVariantConfig): CardVariantConfig {\n const { tags: _tags, bodyAllowed, bodyRequired, repeatCount } = _variant;\n\n const tags = this.hydrateTagsConfig(_tags);\n\n const cardSetConfig = new CardVariantConfig(tags.tags, bodyAllowed, bodyRequired, repeatCount);\n\n return cardSetConfig;\n }\n}\n\nconst instance = new ConfigHydrator();\n\nexport { instance as ConfigHydrator };\n","import { type _BitsConfig } from '../../model/config/_Config.ts';\nimport { CardSetConfigKey } from '../../model/config/enum/CardSetConfigKey.ts';\nimport { ConfigKey } from '../../model/config/enum/ConfigKey.ts';\nimport { BitType } from '../../model/enum/BitType.ts';\nimport { Count } from '../../model/enum/Count.ts';\nimport { ExampleType } from '../../model/enum/ExampleType.ts';\nimport { TagFormat } from '../../model/enum/TagFormat.ts';\nimport { TextFormat } from '../../model/enum/TextFormat.ts';\n\nconst BITS: _BitsConfig = {\n [BitType._error]: {\n since: '1.3.0',\n tags: [],\n },\n\n [BitType._comment]: {\n since: '1.4.12',\n tags: [],\n },\n\n [BitType._standard]: {\n since: '3.2.0',\n tags: [\n {\n key: ConfigKey.group_standardTags,\n },\n ],\n },\n\n [BitType.appFlashcards]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.property_flashcardSet,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n ],\n rootExampleType: ExampleType.string,\n },\n [BitType.appFlashcardsQuiz]: { since: '1.3.0', baseBitType: BitType.appFlashcards },\n [BitType.appFlashcardsLearn]: { since: '1.3.0', baseBitType: BitType.appFlashcards },\n [BitType.appLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceAppLink,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.article]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.tag_title,\n },\n ],\n },\n [BitType.articleAlt]: { since: '1.15.0', baseBitType: BitType.article },\n [BitType.articleResponsive]: {\n since: '1.21.0',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_imageFirst,\n format: TagFormat.boolean,\n defaultValue: 'true',\n },\n ],\n },\n [BitType.articleResponsiveAlt]: { since: '2.0.0', baseBitType: BitType.articleResponsive },\n [BitType.standardArticleNormative]: { since: '1.16.0', baseBitType: BitType.article },\n [BitType.standardArticleNonNormative]: { since: '1.16.0', baseBitType: BitType.article },\n [BitType.smartStandardArticleNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardArticleNormative,\n },\n [BitType.smartStandardArticleNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardArticleNonNormative,\n },\n [BitType.smartStandardArticleNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardArticleNormative,\n },\n [BitType.smartStandardArticleNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardArticleNonNormative,\n },\n [BitType.statement]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.pageArticle]: { since: '1.15.0', baseBitType: BitType.article },\n [BitType.pageArticleAlt]: { since: '1.15.0', baseBitType: BitType.article },\n [BitType.pageArticleResponsive]: {\n since: '1.21.0',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_imageFirst,\n format: TagFormat.boolean,\n defaultValue: 'true',\n },\n ],\n },\n [BitType.buttonCopyText]: {\n since: '1.4.3',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.callToAction]: {\n since: '1.15.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_callToActionUrl,\n format: TagFormat.plainText,\n minCount: 1,\n },\n ],\n },\n [BitType.callToActionSubscribe]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionContact]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionJoin]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionMail]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionLearnMore]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionSeeMore]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionWatch]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionStartNow]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionGetOffer]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionBookNow]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionShopNow]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionGetNow]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionDownload]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.callToActionCreateAccount]: { since: '1.15.0', baseBitType: BitType.callToAction },\n [BitType.appBitmarkFromJavascript]: {\n since: '1.4.5',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_maxCreatedBits,\n format: TagFormat.number,\n },\n ],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.appBitmarkFromEditor]: { since: '1.4.5', baseBitType: BitType.appBitmarkFromJavascript },\n [BitType.articleEmbed]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceArticleEmbed,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.articleLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceArticleLink,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.audio]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceAudio,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.audioEmbed]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceAudioEmbed,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.audioLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceAudioLink,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.bitAlias]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.tag_reference,\n },\n {\n key: ConfigKey.tag_anchor,\n },\n ],\n },\n [BitType.diff]: {\n since: '3.13.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_diffTo,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.book]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_bookCommon,\n },\n ],\n },\n [BitType.bookEnd]: { since: '3.27.0', baseBitType: BitType.article },\n [BitType.bookAcknowledgements]: { since: '1.17.0', baseBitType: BitType.article },\n [BitType.bookAddendum]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookAfterword]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookAppendix]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookArticle]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookAutherBio]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookBibliography]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookComingSoon]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookConclusion]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookCopyright]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookCopyrightPermissions]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookDedication]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookEndnotes]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookEpigraph]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookEpilogue]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookForword]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookFrontispiece]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookImprint]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookIncitingIncident]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookIntroduction]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookListOfContributors]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookNotes]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookPostscript]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookPreface]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookPrologue]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookReadMore]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookReferenceList]: {\n //\n since: '3.2.0',\n baseBitType: BitType._standard,\n cardSet: CardSetConfigKey.bookReferenceList,\n },\n [BitType.bookRequestForABookReview]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookSummary]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookTeaser]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookTitle]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bookCover]: {\n since: '3.27.0',\n baseBitType: BitType.image,\n tags: [\n {\n key: ConfigKey.tag_title,\n maxCount: 2, // title & subtitle\n },\n {\n key: ConfigKey.property_coverColor,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.bookAlias]: {\n since: '1.4.3',\n baseBitType: BitType.book,\n tags: [\n {\n key: ConfigKey.property_bookAlias,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n ],\n },\n [BitType.bookDiff]: {\n since: '3.10.0',\n baseBitType: BitType.book,\n tags: [\n {\n key: ConfigKey.property_bookDiff,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.bookClose]: {\n since: '1.18.0',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.bookReference]: {\n since: '2.2.0',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_refAuthor,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_refBookTitle,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_refPublisher,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_refPublicationYear,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_citationStyle,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.botActionResponse]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [],\n cardSet: CardSetConfigKey.botActionResponses,\n },\n [BitType.botActionSend]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_date,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.browserImage]: {\n since: '1.3.0',\n baseBitType: BitType.image,\n tags: [\n {\n key: ConfigKey.property_focusX,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_focusY,\n format: TagFormat.number,\n },\n ],\n },\n [BitType.card1]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n ],\n },\n [BitType.question1]: { since: '1.3.0', baseBitType: BitType.card1 },\n [BitType.survey1]: { since: '1.3.0', baseBitType: BitType.card1 },\n [BitType.surveyAnonymous1]: { since: '1.3.0', baseBitType: BitType.card1 },\n [BitType.chapter]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.tag_anchor,\n },\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.property_toc,\n format: TagFormat.boolean,\n defaultValue: 'true',\n },\n {\n key: ConfigKey.property_progress,\n format: TagFormat.boolean,\n defaultValue: 'true',\n },\n ],\n },\n [BitType.clozeAndMultipleChoiceText]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.group_gap,\n },\n {\n key: ConfigKey.group_trueFalse,\n },\n ],\n },\n [BitType.coachCallToActionClozeAndMultipleChoiceText]: {\n since: '1.3.0',\n baseBitType: BitType.clozeAndMultipleChoiceText,\n },\n [BitType.cloze]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.property_isCaseSensitive,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_quizCountItems,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_quizStrikethroughSolutions,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_additionalSolutions,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.group_gap,\n },\n ],\n },\n [BitType.clozeInstructionGrouped]: { since: '1.3.0', baseBitType: BitType.cloze },\n [BitType.clozeSolutionGrouped]: { since: '1.3.0', baseBitType: BitType.cloze },\n [BitType.clozeSeveral]: { since: '3.5.0', baseBitType: BitType.cloze },\n [BitType.gapText]: { since: '1.5.15', baseBitType: BitType.cloze },\n [BitType.gapTextInstructionGrouped]: {\n since: '1.5.15',\n baseBitType: BitType.clozeInstructionGrouped,\n },\n [BitType.coachSelfReflectionCloze]: { since: '1.3.0', baseBitType: BitType.cloze },\n [BitType.coachCallToActionCloze]: { since: '1.3.0', baseBitType: BitType.cloze },\n [BitType.clozeList]: {\n since: '1.4.13',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n ],\n cardSet: CardSetConfigKey.clozeList,\n },\n [BitType.code]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_computerLanguage,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_codeLineNumbers,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_codeMinimap,\n format: TagFormat.boolean,\n },\n ],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.formula]: {\n since: '1.35.0',\n baseBitType: BitType._standard,\n tags: [],\n textFormatDefault: TextFormat.latex,\n },\n [BitType.smartStandardFormula]: { since: '3.11.0', baseBitType: BitType.formula },\n [BitType.smartStandardFormulaNonNormative]: { since: '3.11.0', baseBitType: BitType.formula },\n [BitType.smartStandardFormulaNormative]: { since: '3.11.0', baseBitType: BitType.formula },\n [BitType.smartStandardRemarkFormula]: { since: '3.11.0', baseBitType: BitType.formula },\n [BitType.smartStandardRemarkFormulaNonNormative]: {\n since: '3.11.0',\n baseBitType: BitType.formula,\n },\n [BitType.smartStandardRemarkFormulaNormative]: { since: '3.11.0', baseBitType: BitType.formula },\n [BitType.appCodeCell]: { since: '1.4.3', baseBitType: BitType.code },\n [BitType.appCodeEditor]: { since: '1.4.3', baseBitType: BitType.code },\n [BitType.appCodeIde]: { since: '1.4.3', baseBitType: BitType.code },\n [BitType.codeRuntime]: { since: '1.4.3', baseBitType: BitType.code },\n [BitType.consoleLog]: { since: '1.4.3', baseBitType: BitType.code },\n [BitType.output]: { since: '1.4.3', baseBitType: BitType.code },\n [BitType.stdout]: { since: '1.4.3', baseBitType: BitType.code },\n [BitType.step]: { since: '1.5.1', baseBitType: BitType.article },\n [BitType.stepImageScreenshot]: { since: '1.5.1', baseBitType: BitType.image },\n [BitType.stepImageScreenshotWithPointer]: {\n since: '1.5.1',\n baseBitType: BitType.image,\n tags: [\n {\n key: ConfigKey.property_pointerTop,\n format: TagFormat.plainText,\n minCount: 1,\n maxCount: 1,\n },\n {\n key: ConfigKey.property_pointerLeft,\n format: TagFormat.plainText,\n minCount: 1,\n maxCount: 1,\n },\n ],\n },\n [BitType.milestone]: { since: '1.20.0', baseBitType: BitType.step },\n [BitType.conversationLeft1]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_person,\n },\n ],\n },\n [BitType.conversationLeft1Scream]: { since: '1.3.0', baseBitType: BitType.conversationLeft1 },\n [BitType.conversationLeft1Thought]: { since: '1.3.0', baseBitType: BitType.conversationLeft1 },\n [BitType.conversationRight1]: { since: '1.3.0', baseBitType: BitType.conversationLeft1 },\n [BitType.conversationRight1Scream]: { since: '1.3.0', baseBitType: BitType.conversationLeft1 },\n [BitType.conversationRight1Thought]: { since: '1.3.0', baseBitType: BitType.conversationLeft1 },\n [BitType.clozeAndMultipleChoiceTextConversationLeft1]: {\n since: '1.3.0',\n baseBitType: BitType.conversationLeft1,\n },\n [BitType.clozeAndMultipleChoiceTextConversationLeft1Scream]: {\n since: '1.3.0',\n baseBitType: BitType.conversationLeft1,\n },\n [BitType.clozeAndMultipleChoiceTextConversationLeft1Thought]: {\n since: '1.3.0',\n baseBitType: BitType.conversationLeft1,\n },\n [BitType.clozeAndMultipleChoiceTextConversationRight1]: {\n since: '1.3.0',\n baseBitType: BitType.conversationLeft1,\n },\n [BitType.clozeAndMultipleChoiceTextConversationRight1Scream]: {\n since: '1.3.0',\n baseBitType: BitType.conversationLeft1,\n },\n [BitType.clozeAndMultipleChoiceTextConversationRight1Thought]: {\n since: '1.3.0',\n baseBitType: BitType.conversationLeft1,\n },\n [BitType.cookPreparation]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookStep]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookIngredients]: {\n since: '1.5.16',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_technicalTerm,\n },\n {\n key: ConfigKey.property_servings,\n format: TagFormat.number,\n chain: [\n {\n key: ConfigKey.property_unit,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_unitAbbr,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_decimalPlaces,\n format: TagFormat.number,\n defaultValue: '1',\n },\n {\n key: ConfigKey.property_disableCalculation,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.tag_hint,\n },\n ],\n },\n ],\n cardSet: CardSetConfigKey.ingredients,\n },\n [BitType.recipe]: { since: '1.5.24', baseBitType: BitType.cookIngredients },\n [BitType.cookRemark]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookVariation]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookInsert]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookNoteOnQuantity]: { since: '3.27.0', baseBitType: BitType.article },\n [BitType.cookArrangement]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookPracticeAdvise]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookPlate]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookRecommendation]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookPersonalRecommendation]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookSideDrink]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookSideDish]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.cookTimer]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.document]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceDocument,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.documentDownload]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceDocumentDownload,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.leDocumentDownload]: { since: '3.18.0', baseBitType: BitType.documentDownload },\n [BitType.documentEmbed]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceDocumentEmbed,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.documentLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceDocumentLink,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.essay]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.property_reasonableNumOfChars,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_sampleSolution,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_additionalSolutions,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_partialAnswer,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_reference,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n ],\n rootExampleType: ExampleType.string,\n },\n [BitType.coachSelfReflectionEssay]: { since: '1.3.0', baseBitType: BitType.essay },\n [BitType.coachCallToActionEssay]: { since: '1.3.0', baseBitType: BitType.essay },\n [BitType.example]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.tag_title,\n },\n ],\n rootExampleType: ExampleType.string,\n },\n [BitType.exampleAlt]: { since: '1.16.0', baseBitType: BitType.example },\n [BitType.standardExampleNormative]: { since: '1.16.0', baseBitType: BitType.example },\n [BitType.standardExampleNonNormative]: { since: '1.16.0', baseBitType: BitType.example },\n [BitType.smartStandardExampleNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardExampleNormative,\n },\n [BitType.smartStandardExampleNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardExampleNonNormative,\n },\n [BitType.smartStandardExampleNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardExampleNormative,\n },\n [BitType.smartStandardExampleNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardExampleNonNormative,\n },\n [BitType.appAiPrompt]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.aiPrompt]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.articleAi]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.articleAttachment]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.assignment]: { since: '1.3.0', baseBitType: BitType.essay },\n [BitType.audioTranscript]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bitmarkExample]: { since: '1.3.0', baseBitType: BitType.example },\n [BitType.blogArticle]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bug]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.bugAlt]: { since: '1.16.0', baseBitType: BitType.bug },\n [BitType.checklist]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.coachAudioTranscript]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.coachCallToActionChecklist]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.coachHomeRules]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.coachVideoTranscript]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.correction]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.danger]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.dangerAlt]: { since: '1.16.0', baseBitType: BitType.article },\n [BitType.definitionTerm]: { since: '1.34.0', baseBitType: BitType.article },\n [BitType.deleted]: { since: '3.9.0', baseBitType: BitType.article },\n [BitType.details1]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.details]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.qAndA]: { since: '3.5.0', baseBitType: BitType.article },\n [BitType.editorial]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.editorNote]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.featured]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.glossaryTerm]: { since: '1.33.0', baseBitType: BitType.article },\n [BitType.help]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.helpAlt]: { since: '1.16.0', baseBitType: BitType.help },\n [BitType.hint]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.hintAlt]: { since: '1.16.0', baseBitType: BitType.hint },\n [BitType.indexTerm]: { since: '1.33.0', baseBitType: BitType.article },\n [BitType.info]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.infoAlt]: { since: '1.16.0', baseBitType: BitType.info },\n [BitType.langLearningOutcomes]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langEnablingLanguageSkills]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langLifeSkills]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langEnglishAroundWorld]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langGoodToKnow]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langLearningGoal]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langLearningStrategy]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langLikeALocal]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langMaterial]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langUsefulPhrases]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langLevelDown]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langLevelUp]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langExtraActivity]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langVideoScript]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langAudioScript]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langVocabulary]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langHomework]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langTeacherNote]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.langTeacherPronunciation]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.list]: { since: '1.22.0', baseBitType: BitType.article },\n [BitType.standardList]: { since: '1.22.0', baseBitType: BitType.article },\n [BitType.smartStandardList]: { since: '1.28.0', baseBitType: BitType.standardList },\n [BitType.smartStandardListCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardList,\n },\n [BitType.message]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.newspaperArticle]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.note]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.noteAlt]: { since: '1.16.0', baseBitType: BitType.note },\n [BitType.standardNoteNormative]: { since: '1.16.0', baseBitType: BitType.note },\n [BitType.standardNoteNonNormative]: { since: '1.16.0', baseBitType: BitType.note },\n [BitType.smartStandardNoteNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardNoteNormative,\n },\n [BitType.smartStandardNoteNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardNoteNonNormative,\n },\n [BitType.smartStandardNoteNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardNoteNormative,\n },\n [BitType.smartStandardNoteNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardNoteNonNormative,\n },\n [BitType.noteAi]: { since: '1.3.0', baseBitType: BitType.note },\n [BitType.notebookArticle]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.preparationNote]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.releaseNotesSummary]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.remark]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.remarkAlt]: { since: '1.16.0', baseBitType: BitType.remark },\n [BitType.standardRemarkNormative]: { since: '1.16.0', baseBitType: BitType.article },\n [BitType.standardRemarkNonNormative]: { since: '1.16.0', baseBitType: BitType.article },\n [BitType.smartStandardRemarkNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardRemarkNormative,\n },\n [BitType.smartStandardRemarkNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardRemarkNonNormative,\n },\n [BitType.smartStandardRemarkNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardRemarkNormative,\n },\n [BitType.smartStandardRemarkNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardRemarkNonNormative,\n },\n [BitType.selfAssessment]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.separator]: { since: '1.4.15', baseBitType: BitType.article },\n [BitType.separatorAlt]: { since: '1.16.0', baseBitType: BitType.separator },\n [BitType.sticker]: { since: '1.5.28', baseBitType: BitType.article },\n [BitType.sideNote]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.summary]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.summaryAi]: { since: '1.3.0', baseBitType: BitType.summary },\n [BitType.videoTranscript]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.warning]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.warningAlt]: { since: '1.16.0', baseBitType: BitType.warning },\n [BitType.workbookArticle]: { since: '1.3.0', baseBitType: BitType.article },\n [BitType.collapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.sideNoteCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.infoCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.remarkCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.warningCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.dangerCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.noteCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.exampleCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.hintCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.bugCollapsible]: { since: '1.21.0', baseBitType: BitType.article },\n [BitType.platformPath]: {\n since: '3.14.1',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_path,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.container]: {\n since: '1.9.0',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_allowedBit,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n ],\n },\n [BitType.containerWrap]: { since: '1.9.0', baseBitType: BitType.container },\n [BitType.containerNowrap]: { since: '1.9.0', baseBitType: BitType.container },\n [BitType.containerNowrapStretch]: { since: '1.9.0', baseBitType: BitType.container },\n [BitType.containerGroup]: { since: '1.9.0', baseBitType: BitType.container },\n [BitType.containerFolder]: { since: '1.9.0', baseBitType: BitType.container },\n [BitType.containerCarousel]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerCards]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerGrid]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerStack]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerSlides]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerGallery]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerScroller]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerTabs]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerAccordionTabs]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerFolderAll]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerBits2]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerCookRecipe]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerNewsArticle]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.containerPreview]: { since: '1.11.0', baseBitType: BitType.container },\n [BitType.pageContainer]: { since: '1.9.0', baseBitType: BitType.container },\n [BitType.pageContainerWrap]: { since: '1.9.0', baseBitType: BitType.pageContainer },\n [BitType.pageContainerNowrap]: { since: '1.9.0', baseBitType: BitType.pageContainer },\n [BitType.pageContainerNowrapStretch]: { since: '1.9.0', baseBitType: BitType.pageContainer },\n [BitType.pageContainerFolder]: { since: '1.9.0', baseBitType: BitType.pageContainer },\n [BitType.pageContainerGroup]: { since: '1.9.0', baseBitType: BitType.pageContainer },\n [BitType.metalevelExplanation]: { since: '1.10.0', baseBitType: BitType.article },\n [BitType.module]: {\n since: '1.5.26',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_hasBookNavigation,\n format: TagFormat.boolean,\n defaultValue: 'true',\n },\n {\n key: ConfigKey.property_productId,\n format: TagFormat.plainText,\n minCount: 1,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_duration,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.moduleProduct]: {\n since: '1.9.0',\n baseBitType: BitType.module,\n tags: [\n {\n key: ConfigKey.property_productId,\n format: TagFormat.plainText,\n minCount: 1,\n maxCount: Count.infinity,\n },\n ],\n },\n [BitType.exampleList]: {\n since: '1.4.13',\n baseBitType: BitType.example,\n cardSet: CardSetConfigKey.exampleBitList,\n rootExampleType: ExampleType.string,\n },\n [BitType.extractorPage]: { since: '1.5.17', baseBitType: BitType.image },\n [BitType.extractorPageCollapsible]: { since: '1.30.0', baseBitType: BitType.extractorPage },\n [BitType.extractorPageWithBlocks]: { since: '1.5.21', baseBitType: BitType.image },\n [BitType.extractorPageWithBlocksCollapsible]: {\n since: '1.30.0',\n baseBitType: BitType.extractorPageWithBlocks,\n },\n [BitType.extractorConfiguration]: {\n since: '1.7.1',\n baseBitType: BitType._standard,\n tags: [],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.extractorInformation]: {\n since: '3.8.0',\n baseBitType: BitType._standard,\n tags: [],\n textFormatDefault: TextFormat.json,\n },\n [BitType.extractorAiChat]: { since: '3.19.0', baseBitType: BitType._standard },\n [BitType.extractorBlock]: {\n since: '1.5.16',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_blockId,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_pageNo,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_x,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_y,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_width,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_height,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_index,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_classification,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_availableClassifications,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.group_resourceImage,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.extractorRepeatedText]: { since: '1.5.21', baseBitType: BitType.article },\n [BitType.extractorPageNumber]: { since: '1.5.21', baseBitType: BitType.article },\n [BitType.extractorPageNumberCollapsible]: {\n since: '1.30.0',\n baseBitType: BitType.extractorPageNumber,\n },\n [BitType.extractorPageHeader]: { since: '1.5.21', baseBitType: BitType.article },\n [BitType.extractorPageHeaderCollapsible]: {\n since: '1.30.0',\n baseBitType: BitType.extractorPageHeader,\n },\n [BitType.extractorPageFooter]: { since: '1.5.21', baseBitType: BitType.article },\n [BitType.extractorPageFooterCollapsible]: {\n since: '1.30.0',\n baseBitType: BitType.extractorPageFooter,\n },\n [BitType.pageOpenBook]: {\n since: '1.5.10',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_book,\n format: TagFormat.plainText,\n chain: [\n {\n key: ConfigKey.tag_reference,\n maxCount: 2,\n },\n ],\n },\n {\n /* Allow incorrectly chained reference tag */\n key: ConfigKey.tag_reference,\n },\n {\n key: ConfigKey.property_buttonCaption,\n },\n ],\n },\n [BitType.pageOpenBookList]: {\n since: '2.1.0',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_book,\n maxCount: Count.infinity,\n chain: [\n {\n key: ConfigKey.tag_reference,\n maxCount: 2,\n },\n ],\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pageSubscribe]: {\n since: '1.5.10',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_mailingList,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.assignmentList]: { since: '1.4.13', baseBitType: BitType.exampleList },\n [BitType.pageFooter]: {\n since: '1.4.13',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n ],\n cardSet: CardSetConfigKey.exampleBitList,\n },\n [BitType.legend]: {\n since: '3.12.0',\n baseBitType: BitType._standard,\n tags: [],\n cardSet: CardSetConfigKey.definitionList,\n },\n [BitType.smartStandardLegend]: { since: '3.12.0', baseBitType: BitType.legend },\n [BitType.smartStandardLegendNonNormative]: { since: '3.12.0', baseBitType: BitType.legend },\n [BitType.smartStandardLegendNormative]: { since: '3.12.0', baseBitType: BitType.legend },\n [BitType.smartStandardRemarkLegend]: { since: '3.12.0', baseBitType: BitType.legend },\n [BitType.smartStandardRemarkLegendNonNormative]: { since: '3.12.0', baseBitType: BitType.legend },\n [BitType.smartStandardRemarkLegendNormative]: { since: '3.12.0', baseBitType: BitType.legend },\n [BitType.definitionList]: {\n since: '1.34.0',\n baseBitType: BitType._standard,\n tags: [],\n cardSet: CardSetConfigKey.definitionList,\n },\n [BitType.metaSearchDefaultTerms]: {\n since: '3.12.0',\n baseBitType: BitType._standard,\n tags: [],\n cardSet: CardSetConfigKey.definitionList,\n },\n [BitType.metaSearchDefaultTopics]: {\n since: '3.12.0',\n baseBitType: BitType.metaSearchDefaultTerms,\n },\n [BitType.flashcard]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n ],\n cardSet: CardSetConfigKey.flashcard,\n },\n [BitType.flashcard1]: { since: '1.3.0', baseBitType: BitType.flashcard },\n [BitType.qAndACard]: { since: '3.25.0', baseBitType: BitType.flashcard1 },\n [BitType.focusImage]: {\n since: '1.3.0',\n baseBitType: BitType.image,\n tags: [\n {\n key: ConfigKey.property_focusX,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_focusY,\n format: TagFormat.number,\n },\n ],\n },\n [BitType.highlightText]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.group_trueFalse,\n },\n ],\n },\n [BitType.image]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.resource_backgroundWallpaper,\n chain: [\n {\n key: ConfigKey.group_resourceImageCommon,\n },\n ],\n },\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceImage,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.appCreateBitsFromImage]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.appGetScreenshot]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.detailsImage]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.figure]: {\n since: '1.3.0',\n baseBitType: BitType.image,\n cardSet: CardSetConfigKey.definitionList,\n },\n [BitType.imageBanner]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.imageFigure]: {\n since: '1.3.0',\n baseBitType: BitType.image,\n cardSet: CardSetConfigKey.definitionList,\n },\n [BitType.imageFigureAlt]: { since: '1.16.0', baseBitType: BitType.imageFigure },\n [BitType.standardImageFigureNormative]: { since: '1.16.0', baseBitType: BitType.imageFigure },\n [BitType.standardImageFigureNonNormative]: { since: '1.16.0', baseBitType: BitType.imageFigure },\n [BitType.smartStandardImageFigureNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardImageFigureNormative,\n },\n [BitType.smartStandardImageFigureNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardImageFigureNonNormative,\n },\n [BitType.smartStandardImageFigureNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardImageFigureNormative,\n },\n [BitType.smartStandardImageFigureNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardImageFigureNonNormative,\n },\n [BitType.imageLandscape]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.imageMood]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.imagePortrait]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.imagePrototype]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.imageSeparator]: { since: '1.4.15', baseBitType: BitType.image },\n [BitType.imageSeparatorAlt]: { since: '1.16.0', baseBitType: BitType.imageSeparator },\n [BitType.imageScreenshot]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.imageStyled]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.imageSuperWide]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.imageZoom]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.langLifeSkillIcon]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.lifeSkillSticker]: { since: '1.3.0', baseBitType: BitType.image },\n [BitType.pageBanner]: {\n since: '1.4.3',\n baseBitType: BitType.image,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pageHero]: { since: '1.11.0', baseBitType: BitType.pageBanner },\n [BitType.screenshot]: { since: '1.3.0', deprecated: '1.4.0', baseBitType: BitType.image },\n [BitType.tableImage]: {\n since: '1.5.15',\n baseBitType: BitType.image,\n tags: [\n {\n key: ConfigKey.property_caption,\n format: TagFormat.bitmarkText,\n },\n ],\n },\n [BitType.tableImageAlt]: { since: '1.16.0', baseBitType: BitType.tableImage },\n [BitType.standardTableImageNormative]: { since: '1.16.0', baseBitType: BitType.tableImage },\n [BitType.standardTableImageNonNormative]: { since: '1.16.0', baseBitType: BitType.tableImage },\n [BitType.standardRemarkTableImageNormative]: { since: '1.17.0', baseBitType: BitType.tableImage },\n [BitType.standardRemarkTableImageNonNormative]: {\n since: '1.17.0',\n baseBitType: BitType.tableImage,\n },\n [BitType.smartStandardTableImageNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardTableImageNormative,\n },\n [BitType.smartStandardTableImageNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardTableImageNonNormative,\n },\n [BitType.smartStandardRemarkTableImageNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardRemarkTableImageNormative,\n },\n [BitType.smartStandardRemarkTableImageNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardRemarkTableImageNonNormative,\n },\n [BitType.smartStandardTableImageNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardTableImageNormative,\n },\n [BitType.smartStandardTableImageNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardTableImageNonNormative,\n },\n [BitType.smartStandardRemarkTableImageNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardRemarkTableImageNormative,\n },\n [BitType.smartStandardRemarkTableImageNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardRemarkTableImageNonNormative,\n },\n [BitType.imageLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceImageLink,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.imageOnDevice]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceImage,\n },\n {\n key: ConfigKey.group_imageSource,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.imageResponsive]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n // Combo resource\n\n key: ConfigKey.group_resourceImageResponsive,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.imagesLogoGrave]: {\n since: '1.5.11',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n // Image resource\n\n key: ConfigKey.group_resourceImage,\n minCount: 1,\n maxCount: Count.infinity,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.prototypeImages]: {\n since: '1.6.1',\n baseBitType: BitType.imagesLogoGrave,\n },\n [BitType.internalLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.tag_reference,\n },\n ],\n },\n [BitType.interview]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.property_reasonableNumOfChars,\n format: TagFormat.number,\n },\n ],\n cardSet: CardSetConfigKey.questions,\n },\n [BitType.interviewInstructionGrouped]: { since: '1.3.0', baseBitType: BitType.interview },\n [BitType.botInterview]: { since: '1.3.0', baseBitType: BitType.interview },\n [BitType.learningPathBook]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_learningPathCommon,\n },\n ],\n },\n [BitType.bookLink]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.bookLinkNext]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.bookLinkPrev]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.learningPathClassroomEvent]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.learningPathClassroomTraining]: {\n since: '1.3.0',\n baseBitType: BitType.learningPathBook,\n },\n [BitType.learningPathClosing]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.learningPathFeedback]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.learningPathLearningGoal]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.learningPathLti]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.learningPathSign]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.learningPathStep]: { since: '1.3.0', baseBitType: BitType.learningPathBook },\n [BitType.learningPathBotTraining]: {\n since: '1.3.0',\n baseBitType: BitType.learningPathBook,\n tags: [\n {\n key: ConfigKey.property_bot,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.learningPathExternalLink]: {\n since: '1.3.0',\n baseBitType: BitType.learningPathBook,\n tags: [\n {\n key: ConfigKey.property_externalLink,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_externalLinkText,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.learningPathVideoCall]: {\n since: '1.3.0',\n baseBitType: BitType.learningPathBook,\n tags: [\n {\n key: ConfigKey.property_videoCallLink,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.leLearningObjectives]: {\n since: '1.25.0',\n baseBitType: BitType.learningPathLearningGoal,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.leVideoCall]: {\n since: '1.25.0',\n baseBitType: BitType.learningPathVideoCall,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.leClassroomEvent]: {\n since: '1.25.0',\n baseBitType: BitType.learningPathClassroomEvent,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.leMultiDayEvent]: { since: '3.32.0', baseBitType: BitType.leClassroomEvent },\n [BitType.leCompletion]: {\n since: '1.25.0',\n baseBitType: BitType.learningPathClosing,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.leExternalLink]: {\n since: '1.25.0',\n baseBitType: BitType.learningPathExternalLink,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.leReadBook]: {\n since: '1.25.0',\n baseBitType: BitType.learningPathBook,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.leLearningStep]: {\n since: '1.25.0',\n baseBitType: BitType.learningPathStep,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.lePreparationTask]: {\n since: '1.26.0',\n baseBitType: BitType.learningPathBook,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.leRead]: { since: '1.27.0', baseBitType: BitType.lePreparationTask },\n [BitType.leTask]: { since: '1.27.0', baseBitType: BitType.lePreparationTask },\n [BitType.leTodo]: { since: '1.27.0', baseBitType: BitType.lePreparationTask },\n [BitType.leFollowUpTask]: { since: '1.27.0', baseBitType: BitType.lePreparationTask },\n [BitType.leFinishingTask]: { since: '1.27.0', baseBitType: BitType.lePreparationTask },\n [BitType.leAssignment]: { since: '1.27.0', baseBitType: BitType.lePreparationTask },\n [BitType.leWatchVideoEmbed]: {\n since: '1.27.0',\n baseBitType: BitType.learningPathBook,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceVideoEmbed,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.leListenAudioEmbed]: {\n since: '1.27.0',\n baseBitType: BitType.learningPathBook,\n tags: [\n {\n key: ConfigKey.property_activityType,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceAudioEmbed,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n\n [BitType.listItem]: {\n since: '1.22.0',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_listItemIndent,\n format: TagFormat.number,\n defaultValue: '0',\n },\n ],\n },\n [BitType.standardListItem]: { since: '1.22.0', baseBitType: BitType.listItem },\n [BitType.smartStandardListItem]: { since: '1.28.0', baseBitType: BitType.standardListItem },\n [BitType.smartStandardListItemCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardListItem,\n },\n [BitType.mark]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.group_markConfig,\n },\n {\n key: ConfigKey.group_mark,\n },\n ],\n },\n [BitType.match]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.property_isCaseSensitive,\n format: TagFormat.boolean,\n },\n ],\n cardSet: CardSetConfigKey.matchPairs,\n },\n [BitType.matchAll]: { since: '1.3.0', baseBitType: BitType.match },\n [BitType.matchReverse]: { since: '1.3.0', baseBitType: BitType.match },\n [BitType.matchAllReverse]: { since: '1.3.0', baseBitType: BitType.match },\n [BitType.matchSolutionGrouped]: { since: '1.3.0', baseBitType: BitType.match },\n [BitType.matchMatrix]: {\n since: '1.3.0',\n baseBitType: BitType.match,\n cardSet: CardSetConfigKey.matchMatrix,\n },\n [BitType.matchAudio]: {\n since: '1.3.0',\n baseBitType: BitType.match,\n cardSet: CardSetConfigKey.matchAudioPairs,\n },\n [BitType.matchPicture]: {\n since: '1.3.0',\n baseBitType: BitType.match,\n cardSet: CardSetConfigKey.matchImagePairs,\n },\n [BitType.feedback]: {\n since: '3.13.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_reasonableNumOfChars,\n format: TagFormat.number,\n },\n ],\n cardSet: CardSetConfigKey.feedback,\n },\n [BitType.learningDocumentationFeedback]: { since: '3.13.0', baseBitType: BitType.feedback },\n [BitType.handInFeedbackExpert]: { since: '3.30.0', baseBitType: BitType.feedback },\n [BitType.handInFeedbackSelf]: { since: '3.30.0', baseBitType: BitType.feedback },\n [BitType.multipleChoice1]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.group_trueFalse,\n },\n ],\n },\n [BitType.coachSelfReflectionMultipleChoice1]: {\n since: '1.3.0',\n baseBitType: BitType.multipleChoice1,\n },\n [BitType.multipleChoice]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.group_trueFalse,\n }, // This is actually for multiple-choice-1, but we support it here as well (as many bits are wrong)\n ],\n cardSet: CardSetConfigKey.quiz,\n },\n [BitType.coachSelfReflectionMultipleChoice]: {\n since: '1.3.0',\n baseBitType: BitType.multipleChoice,\n },\n [BitType.multipleChoiceText]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.group_trueFalse,\n },\n ],\n },\n [BitType.coachCallToActionMultipleChoiceText]: {\n since: '1.3.0',\n baseBitType: BitType.multipleChoiceText,\n },\n [BitType.coachSelfReflectionMultipleChoiceText]: {\n since: '1.3.0',\n baseBitType: BitType.multipleChoiceText,\n },\n [BitType.multipleResponse1]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.group_trueFalse,\n },\n ],\n },\n [BitType.coachSelfReflectionMultipleResponse1]: {\n since: '1.3.0',\n baseBitType: BitType.multipleResponse1,\n },\n [BitType.multipleResponse]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.group_trueFalse,\n }, // This is actually for multiple-response-1, but we support it here as well (as many bits are wrong)\n ],\n cardSet: CardSetConfigKey.quiz,\n },\n [BitType.coachSelfReflectionMultipleResponse]: {\n since: '1.3.0',\n baseBitType: BitType.multipleResponse,\n },\n [BitType.page]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.property_thumbImage,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pageCollapsible]: { since: '1.30.0', baseBitType: BitType.page },\n [BitType.pageCoverImage]: { since: '1.22.0', baseBitType: BitType.page },\n [BitType.pageBuyButton]: {\n since: '1.4.3',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_content2Buy,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pageBuyButtonAlt]: { since: '1.31.0', baseBitType: BitType.pageBuyButton },\n [BitType.pageBuyButtonPromotion]: { since: '1.5.11', baseBitType: BitType.pageBuyButton },\n [BitType.pageSubpage]: {\n since: '1.6.6',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_page,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pageShopInShop]: { since: '1.6.6', baseBitType: BitType.pageSubpage },\n [BitType.pageCategory]: { since: '1.6.6', baseBitType: BitType.pageSubpage },\n [BitType.pageAcademy]: { since: '1.6.6', baseBitType: BitType.pageSubpage },\n [BitType.pagePromotion]: { since: '1.6.6', baseBitType: BitType.pageSubpage },\n [BitType.pageSpecial]: { since: '1.6.6', baseBitType: BitType.pageSubpage },\n [BitType.pagePerson]: {\n since: '1.5.16',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.group_person,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pageProduct]: {\n since: '1.4.17',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_product,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pageProductList]: {\n since: '1.4.17',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_slug,\n },\n // NOTE: Only one of productVideo or productVideoList should be used, not both - TODO: fix when know which one!\n {\n key: ConfigKey.property_product,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n // {\n // key: ConfigKey.property_productList,\n // format: TagFormat.plainText,\n // maxCount: Count.infinity,\n // },\n ],\n },\n [BitType.pageProductVideo]: {\n since: '1.4.17',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_productVideo,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pageProductVideoList]: {\n since: '1.4.17',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n // NOTE: Only one of productVideo or productVideoList should be used, not both - TODO: fix when know which one!\n {\n key: ConfigKey.property_productVideo,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n // {\n // key: ConfigKey.property_productVideoList,\n // format: TagFormat.plainText,\n // maxCount: Count.infinity,\n // },\n ],\n },\n [BitType.pageSectionFolder]: {\n since: '1.4.17',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_slug,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_productFolder,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.photo]: {\n since: '1.3.0',\n baseBitType: BitType.image,\n },\n [BitType.quote]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_quotedPerson,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.rating]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [],\n },\n [BitType.coachSelfReflectionRating]: { since: '1.3.0', baseBitType: BitType.rating },\n [BitType.releaseNote]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_releaseVersion,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_releaseKind,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_releaseDate,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.reviewNote]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.tag_title,\n },\n {\n key: ConfigKey.property_resolved,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_resolvedDate,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_resolvedBy,\n format: TagFormat.plainText,\n },\n ],\n rootExampleType: ExampleType.string,\n },\n [BitType.reviewAuthorNote]: { since: '1.3.0', baseBitType: BitType.reviewNote },\n [BitType.reviewCustomerNote]: {\n //\n since: '3.5.0',\n baseBitType: BitType.reviewNote,\n },\n [BitType.reviewReviewerNote]: { since: '1.3.0', baseBitType: BitType.reviewNote },\n [BitType.reviewRequestForReviewNote]: { since: '1.3.0', baseBitType: BitType.reviewNote },\n [BitType.reviewApprovedNote]: { since: '1.3.0', baseBitType: BitType.reviewNote },\n [BitType.sampleSolution]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n // Not sure if these are actually valid here, but include them as they are in the test bit.\n {\n key: ConfigKey.tag_anchor,\n },\n {\n key: ConfigKey.tag_reference,\n },\n ],\n },\n\n [BitType.sequence]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n ],\n cardSet: CardSetConfigKey.elements,\n rootExampleType: ExampleType.boolean,\n },\n [BitType.stillImageFilm]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n // Combo resource\n\n key: ConfigKey.group_resourceStillImageFilm,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.stillImageFilmEmbed]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceStillImageFilmEmbed,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.stillImageFilmLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceStillImageFilmLink,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.surveyAnonymous]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [],\n },\n [BitType.survey]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [],\n },\n [BitType.surveyMatrix]: {\n since: '1.6.2',\n baseBitType: BitType.image,\n tags: [\n {\n key: ConfigKey.property_pointerTop,\n format: TagFormat.plainText,\n minCount: 1,\n maxCount: 1,\n },\n {\n key: ConfigKey.property_pointerLeft,\n format: TagFormat.plainText,\n minCount: 1,\n maxCount: 1,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n minCount: 1,\n maxCount: 1,\n },\n ],\n },\n [BitType.surveyMatrixMe]: { since: '1.6.2', baseBitType: BitType.surveyMatrix },\n [BitType.surveyRating]: {\n since: '1.6.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_ratingLevelStart,\n format: TagFormat.number,\n chain: [\n {\n key: ConfigKey.property_label,\n format: TagFormat.bitmarkText,\n },\n ],\n },\n {\n key: ConfigKey.property_ratingLevelEnd,\n format: TagFormat.number,\n chain: [\n {\n key: ConfigKey.property_label,\n format: TagFormat.bitmarkText,\n },\n ],\n },\n {\n key: ConfigKey.property_ratingLevelSelected,\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.surveyRatingOnce]: {\n since: '1.6.0',\n baseBitType: BitType.surveyRating,\n },\n [BitType.surveyRatingDisplay]: {\n since: '1.6.0',\n baseBitType: BitType.surveyRating,\n },\n [BitType.scorm]: {\n since: '1.5.11',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_scormSource,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_posterImage,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.pronunciationTable]: {\n since: '3.1.0',\n baseBitType: BitType._standard,\n tags: [],\n cardSet: CardSetConfigKey.pronunciationTable,\n },\n [BitType.table]: {\n since: '1.5.19',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_caption,\n format: TagFormat.bitmarkText,\n },\n {\n key: ConfigKey.property_tableFixedHeader,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_tableHeaderWhitespaceNoWrap,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_tableSearch,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_tableSort,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_tablePagination,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_tablePaginationLimit,\n format: TagFormat.number,\n defaultValue: '0',\n },\n {\n key: ConfigKey.property_tableHeight,\n format: TagFormat.number,\n defaultValue: '0',\n },\n {\n key: ConfigKey.property_tableWhitespaceNoWrap,\n format: TagFormat.boolean,\n // defaultValue: 'true',\n },\n {\n key: ConfigKey.property_tableAutoWidth,\n format: TagFormat.boolean,\n // defaultValue: 'true',\n },\n {\n key: ConfigKey.property_tableResizableColumns,\n format: TagFormat.boolean,\n },\n {\n key: ConfigKey.property_tableColumnMinWidth,\n format: TagFormat.number,\n },\n ],\n cardSet: CardSetConfigKey.table,\n },\n [BitType.tableAlt]: { since: '1.16.0', baseBitType: BitType.table },\n [BitType.standardTableNormative]: { since: '1.16.0', baseBitType: BitType.table },\n [BitType.standardTableNonNormative]: { since: '1.16.0', baseBitType: BitType.table },\n [BitType.standardRemarkTableNormative]: { since: '1.17.0', baseBitType: BitType.table },\n [BitType.standardRemarkTableNonNormative]: { since: '1.17.0', baseBitType: BitType.table },\n [BitType.smartStandardTableNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardTableNormative,\n },\n [BitType.smartStandardTableNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardTableNonNormative,\n },\n [BitType.smartStandardRemarkTableNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardRemarkTableNormative,\n },\n [BitType.smartStandardRemarkTableNonNormative]: {\n since: '1.28.0',\n baseBitType: BitType.standardRemarkTableNonNormative,\n },\n [BitType.smartStandardTableNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardTableNormative,\n },\n [BitType.smartStandardTableNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardTableNonNormative,\n },\n [BitType.smartStandardRemarkTableNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardRemarkTableNormative,\n },\n [BitType.smartStandardRemarkTableNonNormativeCollapsible]: {\n since: '1.28.0',\n baseBitType: BitType.smartStandardRemarkTableNonNormative,\n },\n [BitType.parameters]: { since: '1.18.0', baseBitType: BitType.table },\n [BitType.toc]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [],\n },\n [BitType.tocChapter]: {\n since: '1.5.5',\n baseBitType: BitType.toc,\n tags: [\n {\n key: ConfigKey.property_maxDisplayLevel,\n format: TagFormat.number,\n },\n ],\n },\n [BitType.tocInline]: {\n since: '3.24.0',\n baseBitType: BitType.toc,\n tags: [\n {\n key: ConfigKey.property_maxTocChapterLevel,\n format: TagFormat.number,\n },\n ],\n },\n [BitType.tocResource]: {\n since: '3.31.0',\n baseBitType: BitType.toc,\n tags: [\n {\n key: ConfigKey.property_tocResource,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.tocContent]: {\n since: '3.31.0',\n baseBitType: BitType.toc,\n tags: [\n {\n key: ConfigKey.property_tocContent,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.anchor]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.bitBookEnding]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.bitBookSummary]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.botActionAnnounce]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.botActionRatingNumber]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.botActionRemind]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.botActionSave]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.botActionTrueFalse]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.chapterSubjectMatter]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.chat]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.conclusion]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.conclusionAlt]: { since: '1.16.0', baseBitType: BitType.conclusion },\n [BitType.documentUpload]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.footNote]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.groupBorn]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.groupDied]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.recordAudio]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.recordVideo]: { since: '1.5.24', baseBitType: BitType._standard },\n [BitType.stickyNote]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.takePicture]: { since: '1.3.0', baseBitType: BitType._standard },\n [BitType.handInAudio]: { since: '1.5.15', baseBitType: BitType._standard },\n [BitType.handInContact]: { since: '1.5.15', baseBitType: BitType._standard },\n [BitType.handInDocument]: { since: '1.5.15', baseBitType: BitType._standard },\n [BitType.handInFile]: {\n //\n since: '3.2.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_handInAcceptFileType,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n ],\n },\n [BitType.handInLocation]: { since: '1.5.15', baseBitType: BitType._standard },\n [BitType.handInPhoto]: { since: '1.5.15', baseBitType: BitType._standard },\n [BitType.handInScan]: { since: '1.5.15', baseBitType: BitType._standard },\n [BitType.handInSubmit]: {\n //\n since: '3.2.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.property_handInRequirement,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n },\n {\n key: ConfigKey.property_handInInstruction,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_buttonCaption,\n format: TagFormat.plainText,\n },\n ],\n },\n [BitType.handInVideo]: { since: '1.5.15', baseBitType: BitType._standard },\n [BitType.handInVoice]: { since: '1.5.15', baseBitType: BitType._standard },\n [BitType.trueFalse1]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.property_labelTrue,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_labelFalse,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.tag_true,\n },\n {\n key: ConfigKey.tag_false,\n },\n ],\n rootExampleType: ExampleType.boolean,\n },\n\n [BitType.trueFalse]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n quizBit: true,\n tags: [\n {\n key: ConfigKey.group_quizCommon,\n },\n {\n key: ConfigKey.property_labelTrue,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_labelFalse,\n format: TagFormat.plainText,\n },\n ],\n cardSet: CardSetConfigKey.statements,\n },\n [BitType.vendorAmcharts5Chart]: {\n since: '1.5.8',\n baseBitType: BitType.code,\n tags: [],\n textFormatDefault: TextFormat.json,\n },\n [BitType.vendorDatadogDashboardEmbed]: {\n since: '3.12.0',\n baseBitType: BitType.code,\n tags: [\n {\n key: ConfigKey.property_vendorDashboardId,\n format: TagFormat.plainText,\n },\n ],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.vendorFormbricksEmbed]: {\n since: '3.8.0',\n baseBitType: BitType.code,\n tags: [\n {\n key: ConfigKey.property_vendorSurveyId,\n format: TagFormat.plainText,\n },\n ],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.vendorFormbricksEmbedAnonymous]: {\n since: '3.9.0',\n baseBitType: BitType.vendorFormbricksEmbed,\n },\n [BitType.vendorFormbricksLink]: {\n since: '3.8.0',\n baseBitType: BitType.code,\n tags: [\n {\n key: ConfigKey.property_vendorSurveyId,\n format: TagFormat.plainText,\n },\n ],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.vendorFormbricksLinkAnonymous]: {\n since: '3.9.0',\n baseBitType: BitType.vendorFormbricksLink,\n },\n [BitType.vendorHighchartsChart]: {\n since: '1.5.28',\n baseBitType: BitType.vendorAmcharts5Chart,\n },\n [BitType.vendorIframelyEmbed]: {\n since: '1.5.10',\n baseBitType: BitType.code,\n tags: [\n {\n key: ConfigKey.property_width, // Same as image\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_height, // Same as image\n format: TagFormat.number,\n },\n {\n key: ConfigKey.property_vendorUrl,\n format: TagFormat.plainText,\n },\n ],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.vendorIframelyCard]: { since: '1.5.10', baseBitType: BitType.vendorIframelyEmbed },\n [BitType.vendorIframelyPreview]: { since: '1.5.10', baseBitType: BitType.vendorIframelyEmbed },\n [BitType.vendorIframelyPreviewMini]: {\n since: '1.5.10',\n baseBitType: BitType.vendorIframelyEmbed,\n },\n [BitType.vendorJupyterOutput]: {\n since: '1.4.3',\n baseBitType: BitType.code,\n tags: [\n {\n key: ConfigKey.property_jupyterId,\n format: TagFormat.plainText,\n },\n {\n key: ConfigKey.property_jupyterExecutionCount,\n format: TagFormat.number,\n },\n ],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.vendorJupyterCellCode]: { since: '1.4.3', baseBitType: BitType.vendorJupyterOutput },\n [BitType.vendorJupyterCellMarkdown]: { since: '1.4.3', baseBitType: BitType.vendorJupyterOutput },\n [BitType.vendorJupyterCellRaw]: { since: '1.4.3', baseBitType: BitType.vendorJupyterOutput },\n [BitType.vendorJupyterIpynb]: { since: '1.4.3', baseBitType: BitType.vendorJupyterOutput },\n [BitType.vendorPadletEmbed]: {\n since: '1.3.0',\n baseBitType: BitType.code,\n tags: [\n {\n key: ConfigKey.property_padletId,\n format: TagFormat.plainText,\n },\n ],\n textFormatDefault: TextFormat.plainText,\n },\n [BitType.vendorStripePricingTable]: {\n since: '1.20.0',\n baseBitType: BitType.article,\n tags: [\n {\n key: ConfigKey.property_stripePricingTableId,\n format: TagFormat.plainText,\n minCount: 1,\n },\n {\n key: ConfigKey.property_stripePublishableKey,\n format: TagFormat.plainText,\n minCount: 1,\n },\n ],\n },\n [BitType.vendorStripePricingTableExternal]: {\n since: '3.13.0',\n baseBitType: BitType.vendorStripePricingTable,\n },\n\n [BitType.video]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceVideo,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.videoLandscape]: { since: '1.3.0', baseBitType: BitType.video },\n [BitType.videoPortrait]: { since: '1.3.0', baseBitType: BitType.video },\n [BitType.videoEmbed]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceVideoEmbed,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.videoEmbedLandscape]: { since: '1.3.0', baseBitType: BitType.videoEmbed },\n [BitType.videoEmbedPortrait]: { since: '1.3.0', baseBitType: BitType.videoEmbed },\n [BitType.videoLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceVideoLink,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n [BitType.videoLinkLandscape]: { since: '1.3.0', baseBitType: BitType.videoLink },\n [BitType.videoLinkPortrait]: { since: '1.3.0', baseBitType: BitType.videoLink },\n [BitType.websiteLink]: {\n since: '1.3.0',\n baseBitType: BitType._standard,\n tags: [\n {\n key: ConfigKey.group_resourceBitTags,\n },\n {\n key: ConfigKey.group_resourceWebsiteLink,\n minCount: 1,\n },\n ],\n resourceAttachmentAllowed: false,\n },\n};\n\nexport { BITS };\n","import { type _BitConfig, type _PropertiesConfig } from '../model/config/_Config.ts';\nimport { BitConfig } from '../model/config/BitConfig.ts';\nimport type { CardVariantConfig } from '../model/config/CardVariantConfig.ts';\nimport { ConfigKey, type ConfigKeyType } from '../model/config/enum/ConfigKey.ts';\nimport { GroupConfigType } from '../model/config/enum/GroupConfigType.ts';\nimport { ResourcesConfig } from '../model/config/ResourcesConfig.ts';\nimport { ResourceTagConfig } from '../model/config/ResourceTagConfig.ts';\nimport { type TagConfig } from '../model/config/TagConfig.ts';\nimport { type TagsConfig } from '../model/config/TagsConfig.ts';\nimport { BitTagConfigKeyType } from '../model/enum/BitTagConfigKeyType.ts';\nimport { BitType, type BitTypeType } from '../model/enum/BitType.ts';\nimport { Count } from '../model/enum/Count.ts';\nimport type { ResourceKeyType } from '../model/enum/ResourceKey.ts';\nimport { resourceTypeToConfigKey, type ResourceTypeType } from '../model/enum/ResourceType.ts';\nimport { TagFormat } from '../model/enum/TagFormat.ts';\nimport { TextFormat } from '../model/enum/TextFormat.ts';\nimport { ObjectUtils } from '../utils/ObjectUtils.ts';\nimport { ConfigHydrator } from './ConfigHydrator.ts';\nimport { BITS } from './raw/bits.ts';\nimport { GROUPS } from './raw/groups.ts';\n\nexport interface ComboResources {\n [configKey: string]: TagsConfig;\n}\n\nclass Config {\n public bitLevelMin = 1;\n public bitLevelMax = 7;\n private bitCache: Map<BitTypeType, BitConfig> = new Map();\n private allResourcesCache: TagsConfig | undefined;\n private comboResourcesCache: Map<ConfigKeyType, TagsConfig | undefined> = new Map();\n\n constructor() {\n //\n }\n\n /**\n * Return the bitType given a bit type that may be invalid\n *\n * If the bit type is not found, the _error bit type will be returned.\n *\n * @param bitType bit type in (may be invalid)\n * @returns valid bitType, or _error if the bit type is invalid\n */\n public getBitType(bitType: BitTypeType | string | undefined): BitTypeType {\n if (bitType?.startsWith('|')) bitType = bitType.substring(1);\n return BitType.fromValue(bitType) ?? BitType._error;\n }\n\n /**\n * Check if a bit type is and instance of the given root bit type.\n *\n * @param bitType the bit type\n * @param baseBitType the root bit type or types to check\n */\n public isOfBitType(\n bitType: BitTypeType | undefined,\n baseBitType: BitTypeType | BitTypeType[],\n ): boolean {\n if (!bitType) return false;\n if (bitType === baseBitType) return true;\n const bitConfig = this.getBitConfig(bitType);\n if (!bitConfig) return false;\n\n if (Array.isArray(baseBitType)) {\n for (const bt of baseBitType) {\n if (bitConfig.inheritedBitTypesSet.has(bt)) return true;\n }\n return false;\n }\n\n return bitConfig.inheritedBitTypesSet.has(baseBitType);\n }\n\n /**\n * Return true if the bit type is commented.\n *\n * @param bitType bit type in (may be invalid)\n * @returns true if the bit type is commented\n */\n public isBitTypeCommented(bitType: string | undefined): boolean {\n return !!bitType?.startsWith('|');\n }\n\n /**\n * Get the configuration for a bit.\n *\n * @param bitType\n * @returns the bit configuration\n */\n public getBitConfig(bitType: BitTypeType): BitConfig {\n let bitConfig = this.bitCache.get(bitType);\n if (!bitConfig) {\n const throwNotFoundError = () => {\n throw new Error(`No config found for bit: ${bitType}`);\n };\n\n // Get the bit configs, following the inheritance tree\n const inheritedBitTypes: BitTypeType[] = [];\n const _bitConfigTree: _BitConfig[] = [];\n let bitTypeCurrent: BitTypeType | undefined = bitType;\n while (bitTypeCurrent) {\n const _bitConfig: _BitConfig = BITS[bitTypeCurrent];\n if (!_bitConfig) throwNotFoundError();\n\n inheritedBitTypes.push(bitTypeCurrent);\n _bitConfigTree.push(_bitConfig);\n bitTypeCurrent = _bitConfig.baseBitType;\n }\n\n // Reverse the tree so that the root is first\n _bitConfigTree.reverse();\n\n // Loop the tree, merging the configs\n const _mergedBitConfig: _BitConfig = _bitConfigTree.reduce((acc, cur) => {\n acc = ObjectUtils.deepMerge(acc, cur);\n return acc;\n }, {} as _BitConfig);\n\n // Extract the root config\n const {\n since,\n textFormatDefault,\n quizBit,\n tags: _tags,\n cardSet: _cardSet,\n deprecated,\n bodyAllowed,\n bodyRequired,\n footerAllowed,\n footerRequired,\n resourceAttachmentAllowed,\n rootExampleType,\n } = _mergedBitConfig;\n\n // All bits have the internal comment property, so add it to the tags\n _tags?.push({\n key: ConfigKey.property_internalComment,\n format: TagFormat.plainText,\n maxCount: Count.infinity,\n minCount: 0,\n });\n\n // Hydrate the configuration\n const zeroCountAllResourcesTags = this.getAllResourcesTagsWithZeroCounts();\n const bitTags = ConfigHydrator.hydrateTagsConfig(_tags ?? []);\n const cardSet = ConfigHydrator.hydrateCardSetConfig(_cardSet);\n\n // Merge the allResourcesTags with the bitTags *in the correct order*\n const comboResourceConfigKey = bitTags.info?.comboResourceConfigKey;\n const tags = {\n ...bitTags.tags,\n };\n for (const [k, v] of Object.entries(zeroCountAllResourcesTags)) {\n if (!tags[k]) tags[k] = v;\n }\n\n // Create the bit config\n bitConfig = new BitConfig({\n since,\n bitType,\n inheritedBitTypes,\n textFormatDefault: textFormatDefault ?? TextFormat.bitmarkText,\n tags,\n cardSet,\n quizBit,\n deprecated,\n bodyAllowed,\n bodyRequired,\n footerAllowed,\n footerRequired,\n resourceAttachmentAllowed,\n rootExampleType,\n comboResourceConfigKey,\n });\n\n // Add to cache\n this.bitCache.set(bitType, bitConfig);\n }\n\n return bitConfig;\n }\n\n /**\n * Look up the tag configuration by tag (rather than by config key).\n *\n * @param bitType\n * @param key the configKey to look up - if undefined, will return undefined\n * @returns\n */\n public getTagConfigForTag(\n tagsConfig: TagsConfig | undefined,\n key: ConfigKeyType | undefined,\n ): TagConfig | undefined {\n if (!tagsConfig) return undefined;\n\n // // Search the properties in the bit config for the matching tag.\n // for (const [, t] of Object.entries(tagsConfig)) {\n // if (t.tag === tag) {\n // return t;\n // }\n // }\n\n // return undefined;\n\n // Now a map lookup since the tag now has the & / @ prefix\n return tagsConfig[key as string];\n }\n\n /**\n * Look up the tag configuration for a cardSet variant.\n *\n * @param bitType\n * @param sideNo\n * @param variantNo\n * @param tag\n * @param parentTagConfig\n * @returns\n */\n public getTagsConfigForCardSet(\n bitType: BitTypeType,\n sideNo: number,\n variantNo: number,\n ): TagsConfig | undefined {\n const variantConfig = this.getCardSetVariantConfig(bitType, sideNo, variantNo);\n if (!variantConfig) return undefined;\n\n return variantConfig.tags;\n }\n\n /**\n * Get the configuration for a particular card side and variant\n * (checking for infinitely repeating variants)\n *\n * @param config all variant configurations\n * @param sideNo side index\n * @param variantNo variant index\n *\n * @returns the config if found, otherwise undefined\n */\n public getCardSetVariantConfig(\n bitType: BitTypeType,\n sideNo: number,\n variantNo: number,\n ): CardVariantConfig | undefined {\n let ret: CardVariantConfig | undefined;\n\n const bitConfig = this.getBitConfig(bitType);\n if (!bitConfig) return undefined;\n const variants = bitConfig.cardSet?.variants;\n if (!variants) return undefined;\n\n const sideIdx = Math.min(sideNo, variants.length - 1);\n const variant = variants[sideIdx];\n\n // Check for variant\n const maxVariantIndex = variant.length - 1;\n if (variantNo > maxVariantIndex) {\n ret = variant[maxVariantIndex];\n // Fix: Always assume infinite repeat count\n // if (ret.repeatCount !== Count.infinity) return undefined;\n } else {\n ret = variant[variantNo];\n }\n\n return ret;\n }\n\n /**\n * Get the resource configuration for a bit.\n *\n * The configuration returned potentially depends on the resourceTypeAttachment which can change the allowed\n * count of the resource (or comboResource) it matches.\n *\n * The function is a bit complicated, but it is actually just manipulating the configuration into a format that\n * the rest of the app can use easily.\n *\n * @param bitType\n * @param resourceTypeAttachment the resource type specified in the bit header\n * @returns the definitive resource configuration for the bit\n */\n // TODO - this will need fixing.\n public getBitResourcesConfig(\n bitType: BitTypeType,\n resourceTypeAttachment: ResourceTypeType | undefined,\n ): ResourcesConfig {\n let finalResourceTags: TagsConfig = {};\n const comboResourceConfigKeysMap: Map<ConfigKeyType, ConfigKeyType[]> = new Map();\n const configKeyResourceAttachment = resourceTypeAttachment\n ? resourceTypeToConfigKey(resourceTypeAttachment)\n : undefined;\n\n const bitConfig = this.getBitConfig(bitType);\n\n // Filter out the resource tags\n const resourceTags: TagsConfig = {};\n for (const [k, v] of Object.entries(bitConfig.tags)) {\n if (v.type === BitTagConfigKeyType.resource) {\n resourceTags[k] = v;\n }\n }\n\n // Work out the potential combo resource type, which is either fixed by the bit type, or comes from the bit header\n const comboResourceConfigKey =\n bitConfig.comboResourceConfigKey ??\n (bitConfig.resourceAttachmentAllowed ? configKeyResourceAttachment : undefined);\n\n if (comboResourceConfigKey) {\n // The comboResourceConfigKey might be a combo resource. Build the comborResourceTagTypesMap\n const comboResourcesMap: Map<ConfigKeyType, TagConfig> = new Map();\n\n // The resource type attachment might be a combo resource - handle it\n const comboResource = this.getComboResource(comboResourceConfigKey);\n if (comboResource) {\n // Extract the resource types from the combo resource\n const comboResourceTagConfigs = Object.values(comboResource).filter((t) => {\n return t.type === BitTagConfigKeyType.resource;\n });\n const comboResourceTypes = comboResourceTagConfigs.map((t) => t.configKey);\n\n // Combine into a map for easy lookup\n comboResourceTypes.forEach((type) => {\n const tags = comboResourceTagConfigs.find((t) => t.configKey === type);\n if (tags) comboResourcesMap.set(type, tags);\n });\n\n // If the resource tag is a combo resource tag, then add it to the comboResourceConfigKeysMap\n const comboResourceConfigKeys = this.getComboResourceConfigKeys(comboResourceConfigKey);\n if (comboResourceConfigKeys && comboResourceConfigKeys.length > 0) {\n comboResourceConfigKeysMap.set(comboResourceConfigKey, comboResourceConfigKeys);\n }\n }\n\n // If the resource is an attachment...\n // Modify the count for the resource that matched the resource type attachment\n // (create a copy so as not to modify the original configuration)\n if (resourceTypeAttachment) {\n for (const [k, tag] of Object.entries(resourceTags)) {\n // Check if the tag matches the resource type attachment or the comboResource\n const singleTagMatch = comboResourceConfigKey === tag.configKey;\n const comboTagMatch = comboResourcesMap\n ? comboResourcesMap.has(tag.configKey as ResourceKeyType)\n : false;\n\n if (singleTagMatch) {\n // Single tag match for a resource specified in the bit header\n const newTag = new ResourceTagConfig(\n tag.configKey,\n tag.tag,\n 1,\n 1,\n tag.chain,\n tag.jsonKey,\n tag.deprecated,\n );\n finalResourceTags[k] = newTag;\n } else if (comboTagMatch) {\n // Combo resource tag match for a resource specified in the bit header\n if (comboResourcesMap) {\n const newTag = comboResourcesMap.get(tag.configKey as ResourceKeyType);\n if (newTag) finalResourceTags[k] = newTag;\n }\n } else {\n finalResourceTags[k] = tag;\n }\n }\n } else {\n // Combo resource, but not a resource type attachement\n finalResourceTags = resourceTags;\n }\n } else {\n // No combo resource and no resource type attachment\n finalResourceTags = resourceTags;\n }\n\n const resourcesConfig = new ResourcesConfig(\n finalResourceTags,\n bitConfig.resourceAttachmentAllowed,\n configKeyResourceAttachment,\n comboResourceConfigKeysMap,\n );\n\n return resourcesConfig;\n }\n\n /**\n * Get the resourceType tags for a combo resource.\n *\n * @param configKeyResourceAttachment\n * @returns resourceTypes for the combo resource (or undefined if not a combo resource)\n */\n private getComboResourceConfigKeys(\n configKeyResourceAttachment: ConfigKeyType | undefined,\n ): ConfigKeyType[] | undefined {\n const comboResource = this.getComboResource(configKeyResourceAttachment);\n if (comboResource) {\n const comboResourceTypes = Object.values(comboResource)\n .filter((t) => {\n return t.type === BitTagConfigKeyType.resource;\n })\n .map((t) => t.configKey);\n\n return comboResourceTypes;\n }\n return undefined;\n }\n\n /**\n * Get the tags for a combo resource.\n *\n * Combo resources are resources that contain more than one resource, such as still-image-film.\n * These resources require special handling in the code and therefore also special configuration.\n *\n * @returns TagsConfig for the combo resource or undefined if not found\n */\n private getComboResource(resourceConfigKey: ConfigKeyType | undefined): TagsConfig | undefined {\n if (!resourceConfigKey) return undefined;\n\n let comboResourcesTags = this.comboResourcesCache.get(resourceConfigKey);\n if (!comboResourcesTags) {\n // Filter for all the resource groups and hydrate the tags\n comboResourcesTags = {};\n Object.values(GROUPS)\n .filter(\n (g) =>\n g.type === GroupConfigType.comboResource &&\n g.comboResourceConfigKey === resourceConfigKey,\n )\n .forEach((g) => {\n comboResourcesTags = {\n ...comboResourcesTags,\n ...ConfigHydrator.hydrateTagsConfig(g.tags).tags,\n };\n });\n\n // Add to cache\n if (Object.keys(comboResourcesTags).length === 0) comboResourcesTags = undefined;\n this.comboResourcesCache.set(resourceConfigKey, comboResourcesTags);\n }\n\n return comboResourcesTags;\n }\n\n /**\n * Get the tags for all resources with 0 max/min counts.\n *\n * This is required so that any bit can parse all resources correctly. It is necessary to parse all resources\n * for any bit because of the requirement to add excess resources to the 'parser' output.\n *\n * NOTE: These are not used for validation, only for parsing. They will be overridden for individual bits for\n * validation.\n *\n * @returns TagsConfig for all resources\n */\n private getAllResourcesTagsWithZeroCounts(): TagsConfig {\n let allResourcesTags = this.allResourcesCache;\n if (!allResourcesTags) {\n // Filter for all the resource groups and hydrate the tags\n allResourcesTags = {};\n Object.values(GROUPS)\n .filter((g) => g.type === GroupConfigType.resource)\n .forEach((g) => {\n allResourcesTags = {\n ...allResourcesTags,\n ...ConfigHydrator.hydrateTagsConfig(g.tags).tags,\n };\n });\n\n // Ensure the minimum and maximum counts are all set to 0\n // We only use this config to understand how to parse, not to validate\n for (const tag of Object.values(allResourcesTags)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const tagAny = tag as any;\n tagAny.maxCount = 0;\n tagAny.minCount = 0;\n }\n\n // Add to cache\n this.allResourcesCache = allResourcesTags;\n }\n\n return allResourcesTags;\n }\n}\n\nconst instance = new Config();\n\nexport { instance as Config };\n","// This file is automatically generated. DO NOT EDIT.\n\n/* eslint-disable */\n\nexport const PACKAGE_INFO = {\n \"name\": \"@gmb/bitmark-parser-generator\",\n \"version\": \"3.36.0\",\n \"author\": \"Get More Brain Ltd\",\n \"license\": \"ISC\",\n \"description\": \"A bitmark parser and generator using Peggy.js\"\n};\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst Environment = superenum({\n unknown: '',\n node: 'node',\n chrome: 'chrome',\n safari: 'safari',\n firefox: 'firefox',\n edge: 'edge',\n ie: 'ie',\n});\n\nexport type EnvironmentType = EnumType<typeof Environment>;\n\nexport { Environment };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst Os = superenum({\n unknown: '',\n macos: 'macos',\n windows: 'windows',\n linux: 'linux',\n android: 'android',\n ios: 'ios',\n});\n\nexport type OsType = EnumType<typeof Os>;\n\nexport { Os };\n","import { Environment, type EnvironmentType } from './Environment.ts';\nimport { Os, type OsType } from './Os.ts';\n\nexport interface UserAgentInfo {\n browser: EnvironmentType;\n browserVersion?: string;\n os: OsType;\n osVersion?: string;\n}\n\ninterface TokenizedUserAgent {\n keys: Set<string>;\n versions: {\n [key: string]: string;\n };\n}\n\nfunction parseUserAgent(): UserAgentInfo | undefined {\n if (typeof window === 'undefined' || !window.navigator || !window.navigator.userAgent)\n return undefined;\n\n const uai: UserAgentInfo = {\n browser: Environment.unknown,\n os: Os.unknown,\n };\n\n const userAgent = window.navigator.userAgent;\n const tua = tokenizeUserAgent(userAgent);\n\n // const containsIphoneIpadIpod = tua.keys.has('iphone') || tua.keys.has('ipad') || tua.keys.has('ipod');\n // const containsMobi = tua.keys.has('mobi');\n const containsFirefox = tua.keys.has('firefox');\n // const containsSeamonkey = tua.keys.has('seamonkey');\n const containsChrome = tua.keys.has('chrome');\n const containsChromium = tua.keys.has('chromium');\n const containsSafari = tua.keys.has('safari');\n // const containsOperaOPR = tua.keys.has('opera') || tua.keys.has('opr');\n // const containsTridentMSIE = tua.keys.has('trident') || tua.keys.has('msie');\n const containsMacintosh = tua.keys.has('macintosh');\n\n const isSafari = containsSafari && !containsChrome && !containsChromium;\n const isChrome = containsChrome;\n // const isChromium = containsChromium && !containsChrome;\n const isFirefox = containsFirefox;\n // const isSeamonkey = containsSeamonkey && !containsFirefox;\n // const isOpera = containsOperaOPR;\n // const isIE = containsTridentMSIE;\n // const isMobileOrTablet = containsMobi;\n // const isIOS = containsIphoneIpadIpod;\n const isMacOS = containsMacintosh;\n\n // Browser\n if (isSafari) {\n uai.browser = Environment.safari;\n uai.browserVersion = tua.versions.version;\n } else if (isChrome) {\n uai.browser = Environment.chrome;\n uai.browserVersion = tua.versions.chrome;\n } else if (isFirefox) {\n uai.browser = Environment.firefox;\n uai.browserVersion = tua.versions.firefox;\n }\n\n // OS\n if (isMacOS) {\n uai.os = Os.macos;\n uai.osVersion = tua.versions.x;\n }\n\n return uai;\n}\n\nfunction tokenizeUserAgent(userAgent: string): TokenizedUserAgent {\n const rawKeys = userAgent\n .toLowerCase()\n .split(new RegExp('[ /,;()]', 'g'))\n .reduce((acc, val) => {\n if (val) acc.push(val);\n return acc;\n }, [] as string[]);\n\n const tua: TokenizedUserAgent = {\n keys: new Set(),\n versions: {},\n };\n\n let prevRawKey = '';\n for (let i = 0, len = rawKeys.length; i < len; i++) {\n const rawKey = rawKeys[i];\n\n let isNumber = false;\n for (let i = 0; i <= 9; i++) {\n if (rawKey.startsWith(`${i}`)) {\n isNumber = true;\n break;\n }\n }\n if (isNumber) {\n tua.versions[prevRawKey] = rawKey.replace('_', '.');\n } else {\n tua.keys.add(rawKey);\n }\n prevRawKey = rawKey;\n }\n\n return tua;\n}\n\nexport { parseUserAgent };\n","export interface Version {\n full: string;\n major: string;\n minor: string;\n patch: string;\n build: string;\n}\n\nconst EMPTY_VERSION: Version = {\n full: '',\n major: '',\n minor: '',\n patch: '',\n build: '',\n};\n\nexport { EMPTY_VERSION };\n","import { Environment, type EnvironmentType } from './Environment.ts';\nimport { Os, type OsType } from './Os.ts';\nimport { parseUserAgent, type UserAgentInfo } from './userAgent.ts';\nimport { EMPTY_VERSION, type Version } from './Version.ts';\n\ndeclare const process: {\n env: { [key: string]: string };\n version?: string;\n versions?: { [key: string]: string };\n};\n\nclass Env {\n public bootTimestamp: number;\n public app: string;\n public appVersion: Version;\n public environment: EnvironmentType;\n public environmentVersion: Version;\n public os: OsType;\n public osVersion: Version;\n public isBrowser: boolean;\n public isNode: boolean;\n public isCI: boolean;\n public NODE_ENV: string;\n\n // public username: string;\n // public usergroup: string;\n // public uid: number;\n // public gid: number;\n // public homedir: string;\n // public shell: string;\n\n private userAgentInfo: UserAgentInfo | undefined;\n\n constructor() {\n Object.defineProperty(this, 'userAgentInfo', {\n value: parseUserAgent(),\n enumerable: false,\n });\n this.bootTimestamp = Date.now();\n this.app = '';\n this.appVersion = EMPTY_VERSION;\n this.environment = this.getEnvironment();\n this.environmentVersion = this.getEnvironmentVersion();\n this.isBrowser = this.getIsBrowser();\n this.isNode = this.environment === Environment.node;\n this.isCI = this.getIsCI();\n this.NODE_ENV = this.getNodeEnv();\n this.os = this.getOs();\n this.osVersion = this.getOsVersion();\n }\n\n public init(app: string, version: string): void {\n this.app = app;\n this.appVersion = this.parseMMBVersion(version);\n }\n\n get upTimestamp(): number {\n return Date.now() - this.bootTimestamp;\n }\n\n private getEnvironment(): EnvironmentType {\n if (this.userAgentInfo) {\n return this.userAgentInfo.browser;\n } else if (typeof process !== 'undefined') {\n if (process.versions !== undefined) {\n if (process.versions.node) return Environment.node;\n }\n }\n\n return Environment.unknown;\n }\n\n private getEnvironmentVersion(): Version {\n if (this.userAgentInfo) {\n return this.parseMMBVersion(this.userAgentInfo.browserVersion);\n } else if (typeof process !== 'undefined') {\n return this.parseMMBVersion(process.version);\n }\n return EMPTY_VERSION;\n }\n\n private getOs(): OsType {\n if (this.userAgentInfo) {\n return this.userAgentInfo.os;\n } else if (typeof process !== 'undefined') {\n if (process.versions !== undefined) {\n if (process.versions.node) return Os.unknown;\n }\n }\n\n return Os.unknown;\n }\n\n private getOsVersion(): Version {\n if (this.userAgentInfo) {\n return this.parseMMBVersion(this.userAgentInfo.osVersion);\n } else if (typeof process !== 'undefined') {\n return this.parseMMBVersion('');\n }\n return EMPTY_VERSION;\n }\n\n private getIsBrowser(): boolean {\n return !!(\n typeof window !== 'undefined' &&\n typeof document !== 'undefined' &&\n typeof navigator !== 'undefined' &&\n navigator.userAgent\n );\n }\n\n private getIsCI(): boolean {\n return !!(typeof process !== 'undefined' && process.env && process.env.CI);\n }\n\n private getNodeEnv(): string {\n return (typeof process !== 'undefined' && process.env && process.env.NODE_ENV) || '';\n }\n\n /**\n * TODO:\n * Parse Senver 2.0 ?? https://semver.org/\n * and X.Y.Z.B using regex\n *\n * @param version\n */\n private parseMMBVersion(version?: string): Version {\n if (!version) return EMPTY_VERSION;\n\n // Remove leading v\n if (version.startsWith('v')) {\n version = version.substring(1);\n }\n\n // Parse major/minor/build\n const s = version.split('.', 1000);\n let major = '';\n let minor = '';\n let build = '';\n let patch = '';\n for (let i = 0, len = s.length; i < len; i++) {\n const v = s[i];\n if (i === 0) major = v;\n else if (i === 1) minor = v;\n else if (i === 2) patch = v;\n else if (i === 3) build = v;\n }\n\n return {\n full: version,\n major,\n minor,\n patch,\n build,\n };\n }\n}\n\nconst env = new Env();\nconst initEnv = env.init.bind(env);\n\nexport { env, initEnv };\n","import '../config/Config.ts';\n\nimport { PACKAGE_INFO } from '../generated/package_info.ts';\nimport { initEnv } from '../utils/env/Env.ts';\n\nlet initialised = false;\n\n// Initialise the application\nfunction init(): void {\n if (initialised) return;\n\n initEnv(PACKAGE_INFO.name, PACKAGE_INFO.version);\n\n initialised = true;\n}\n\nexport { init };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst BodyBitTypeRaw = {\n text: 'text',\n gap: 'gap',\n mark: 'mark',\n select: 'select',\n highlight: 'highlight',\n} as const;\n\nconst BodyBitType = superenum(BodyBitTypeRaw);\n\nexport type BodyBitTypeKeys = keyof typeof BodyBitTypeRaw;\nexport type BodyBitTypeType = EnumType<typeof BodyBitType>;\n\nexport { BodyBitType };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst TextMarkType = superenum({\n // Styles\n bold: 'bold',\n light: 'light',\n italic: 'italic',\n highlight: 'highlight',\n\n // Inline only styles\n strike: 'strike',\n subscript: 'subscript',\n superscript: 'superscript',\n ins: 'ins',\n del: 'del',\n underline: 'underline',\n doubleUnderline: 'doubleUnderline',\n circle: 'circle',\n languageEmRed: 'languageEmRed',\n languageEmOrange: 'languageEmOrange',\n languageEmYellow: 'languageEmYellow',\n languageEmGreen: 'languageEmGreen',\n languageEmBlue: 'languageEmBlue',\n languageEmPurple: 'languageEmPurple',\n languageEmPink: 'languageEmPink',\n languageEmBrown: 'languageEmBrown',\n languageEmBlack: 'languageEmBlack',\n languageEmWhite: 'languageEmWhite',\n languageEmGray: 'languageEmGray',\n languageEm: 'languageEm',\n userUnderline: 'userUnderline',\n userDoubleUnderline: 'userDoubleUnderline',\n userStrike: 'userStrike',\n userCircle: 'userCircle',\n userHighlight: 'userHighlight',\n notranslate: 'notranslate',\n\n // Attribute chain\n link: 'link',\n ref: 'ref',\n xref: 'xref',\n extref: 'extref',\n footnote: 'footnote',\n footnoteStar: 'footnote*',\n symbol: 'symbol',\n var: 'var',\n code: 'code',\n timer: 'timer',\n duration: 'duration',\n color: 'color',\n comment: 'comment',\n});\n\nexport type TextMarkTypeType = EnumType<typeof TextMarkType>;\n\nexport { TextMarkType };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst TextNodeType = superenum({\n // Text\n text: 'text',\n\n // Blocks\n hardBreak: 'hardBreak',\n paragraph: 'paragraph',\n heading: 'heading',\n section: 'section',\n noBulletList: 'noBulletList',\n bulletList: 'bulletList',\n orderedList: 'orderedList',\n orderedListRoman: 'orderedListRoman',\n orderedListRomanLower: 'orderedListRomanLower',\n letteredList: 'letteredList',\n letteredListLower: 'letteredListLower',\n taskList: 'taskList',\n listItem: 'listItem',\n taskItem: 'taskItem',\n image: 'image',\n imageInline: 'imageInline',\n codeBlock: 'codeBlock',\n\n // Inline blocks\n latex: 'latex',\n\n // Body bits\n gap: 'gap',\n select: 'select',\n highlight: 'highlight',\n mark: 'mark',\n});\n\nexport type TextNodeTypeType = EnumType<typeof TextNodeType>;\n\nexport { TextNodeType };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\n/**\n * Defines the type of a node in the AST.\n * All valid node types should be defined here.\n *\n * Nodes not defined here will not be walked by the AST walker.\n *\n * @enum\n */\nconst NodeType = superenum({\n unknown: 'unknown', // unknown\n\n action: 'action',\n actionValue: 'actionValue',\n activityType: 'activityType',\n activityTypeValue: 'activityTypeValue',\n additionalSolutions: 'additionalSolutions',\n additionalSolutionsValue: 'additionalSolutionsValue',\n ageRange: 'ageRange',\n ageRangeValue: 'ageRangeValue',\n aiGenerated: 'aiGenerated',\n aiGeneratedValue: 'aiGeneratedValue',\n alias: 'alias', // bit type (alias)\n alignment: 'alignment',\n allowedBit: 'allowedBit',\n allowedBitValue: 'allowedBitValue',\n alt: 'alt',\n alternativeAnswers: 'alternativeAnswers',\n alternativeAnswersValue: 'alternativeAnswersValue',\n alternativeDefinitions: 'alternativeDefinitions',\n alternativeDefinitionsValue: 'alternativeDefinitionsValue',\n altLangTag: 'altLangTag',\n altLangTagValue: 'altLangTagValue',\n analyticsTag: 'analyticsTag',\n analyticsTagValue: 'analyticsTagValue',\n anchor: 'anchor',\n answer: 'answer',\n appLink: 'appLink',\n attrs: 'attrs',\n audio: 'audio',\n audioEmbed: 'audioEmbed',\n audioLink: 'audioLink',\n author: 'author',\n authorValue: 'authorValue',\n availableClassifications: 'availableClassifications',\n availableClassificationsValue: 'availableClassificationsValue',\n avatarImage: 'avatarImage',\n backgroundWallpaper: 'backgroundWallpaper',\n backgroundWallpaperValue: 'backgroundWallpaperValue',\n bitLevel: 'bitLevel', // bit level\n bitmarkAst: 'bitmarkAst', // bitmarkAst\n bitmarkVersion: 'bitmarkVersion',\n bits: 'bits', // bits\n bitsValue: 'bitsValue', // bit\n bitType: 'bitType', // bit type\n blockId: 'blockId',\n blockIdValue: 'blockIdValue',\n body: 'body',\n bodyValue: 'bodyValue',\n bodyBit: 'bodyBit',\n bodyBits: 'bodyBits',\n bodyJson: 'bodyJson',\n bodyParts: 'bodyParts',\n bodyPartsValue: 'bodyPartsValue',\n bodyPartText: 'bodyPartText',\n bodyText: 'bodyText',\n book: 'book',\n bookValue: 'bookValue',\n bookAlias: 'bookAlias',\n bookAliasValue: 'bookAliasValue',\n bookDiff: 'bookDiff',\n bookDiffValue: 'bookDiffValue',\n bot: 'bot',\n botResponses: 'botResponses',\n botResponsesValue: 'botResponsesValue',\n botValue: 'botValue',\n bubbleTag: 'bubbleTag',\n bubbleTagValue: 'bubbleTagValue',\n buttonCaption: 'buttonCaption',\n buttonCaptionValue: 'buttonCaptionValue',\n callToActionUrl: 'callToActionUrl',\n callToActionUrlValue: 'callToActionUrlValue',\n caption: 'caption',\n captionDefinitionList: 'captionDefinitionList',\n captionValue: 'captionValue',\n cardBits: 'cardBits',\n cardBitsValue: 'cardBitsValue',\n cardNode: 'cardNode',\n categoryTag: 'categoryTag',\n categoryTagValue: 'categoryTagValue',\n cells: 'cells',\n cellsValue: 'cellsValue',\n chatWithBook: 'chatWithBook',\n chatWithBookValue: 'chatWithBookValue',\n chatWithBookBrainKey: 'chatWithBookBrainKey',\n chatWithBookBrainKeyValue: 'chatWithBookBrainKeyValue',\n checked: 'checked',\n choice: 'choice',\n choices: 'choices',\n choicesValue: 'choicesValue',\n class: 'class',\n classification: 'classification',\n classificationValue: 'classificationValue',\n codeLineNumbers: 'codeLineNumbers',\n codeLineNumbersValue: 'codeLineNumbersValue',\n codeMinimap: 'codeMinimap',\n codeMinimapValue: 'codeMinimapValue',\n color: 'color',\n colorTag: 'colorTag',\n colorTagValue: 'colorTagValue',\n column: 'column',\n columns: 'columns',\n columnsValue: 'columnsValue',\n comment: 'comment',\n commentedBitType: 'commentedBitType',\n computerLanguage: 'computerLanguage',\n computerLanguageValue: 'computerLanguageValue',\n content: 'contentValue',\n content2Buy: 'content2Buy',\n contentValue: 'contentValue',\n contentValueValue: 'contentValueValue',\n copyright: 'copyright',\n coverColor: 'coverColor',\n coverColorValue: 'coverColorValue',\n coverImage: 'coverImage',\n coverImageValue: 'coverImageValue',\n customerExternalId: 'customerExternalId',\n customerId: 'customerId',\n customerIdValue: 'customerIdValue',\n data: 'data',\n dataValue: 'dataValue',\n dataValueValue: 'dataValueValue',\n date: 'date',\n dateEnd: 'dateEnd',\n dateEndValue: 'dateEndValue',\n dateValue: 'dateValue',\n decimalPlaces: 'decimalPlaces',\n deeplink: 'deeplink',\n deeplinkValue: 'deeplinkValue',\n definition: 'definition',\n definitions: 'definitions',\n definitionsValue: 'definitionsValue',\n // description: 'description',\n // descriptions: 'descriptions',\n disableCalculation: 'disableCalculation',\n disableFeedback: 'disableFeedback',\n disableFeedbackValue: 'disableFeedbackValue',\n diffTo: 'diffTo',\n diffToValue: 'diffToValue',\n diffOp: 'diffOp',\n diffOpValue: 'diffOpValue',\n diffRef: 'diffRef',\n diffRefValue: 'diffRefValue',\n diffContext: 'diffContext',\n diffContextValue: 'diffContextValue',\n diffTime: 'diffTime',\n diffTimeValue: 'diffTimeValue',\n document: 'document',\n documentDownload: 'documentDownload',\n documentEmbed: 'documentEmbed',\n documentLink: 'documentLink',\n duration: 'duration',\n durationValue: 'durationValue',\n elements: 'elements',\n elementsValue: 'elementsValue',\n emphasis: 'emphasis',\n end: 'end',\n errors: 'errors',\n errorsValue: 'errorsValue',\n example: 'example',\n exampleValue: 'exampleValue',\n externalId: 'externalId',\n externalIdValue: 'externalIdValue',\n externalLink: 'externalLink',\n externalLinkText: 'externalLinkText',\n extraProperties: 'extraProperties',\n feedbacks: 'feedbacks',\n feedbacksValue: 'feedbacksValue',\n feedback: 'feedback',\n feedbackEngine: 'feedbackEngine',\n feedbackEngineValue: 'feedbackEngineValue',\n feedbackType: 'feedbackType',\n flashcards: 'flashcards',\n flashcardSet: 'flashcardSet',\n flashcardSetValue: 'flashcardSetValue',\n flashcardsValue: 'flashcardsValue',\n focusX: 'focusX',\n focusXValue: 'focusXValue',\n focusY: 'focusY',\n focusYValue: 'focusYValue',\n footer: 'footer',\n footerText: 'footerText',\n forKeys: 'forKeys',\n format: 'format',\n forValues: 'forValues',\n forValuesValue: 'forValuesValue',\n gap: 'gap',\n handInAcceptFileType: 'handInAcceptFileType',\n handInAcceptFileTypeValue: 'handInAcceptFileTypeValue',\n handInRequirement: 'handInRequirement',\n handInRequirementValue: 'handInRequirementValue',\n handInInstruction: 'handInInstruction',\n handInInstructionValue: 'handInInstructionValue',\n hasBookNavigation: 'hasBookNavigation',\n hasBookNavigationValue: 'hasBookNavigationValue',\n hasMarkAsDone: 'hasMarkAsDone',\n hasMarkAsDoneValue: 'hasMarkAsDoneValue',\n heading: 'heading',\n height: 'height',\n heightValue: 'heightValue',\n highlight: 'highlight',\n hint: 'hint',\n href: 'href',\n icon: 'icon',\n iconTag: 'iconTag',\n iconTagValue: 'iconTagValue',\n iconValue: 'iconValue',\n id: 'id',\n idValue: 'idValue',\n image: 'image',\n imageFirst: 'imageFirst',\n imageFirstValue: 'imageFirstValue',\n imageLandscape: 'imageLandscape',\n imageLink: 'imageLink',\n imagePlaceholder: 'imagePlaceholder',\n imagePlaceholderValue: 'imagePlaceholderValue',\n imagePortrait: 'imagePortrait',\n imageSource: 'imageSource',\n index: 'index',\n indexValue: 'indexValue',\n ingredients: 'ingredients',\n ingredientsValue: 'ingredientsValue',\n instruction: 'instruction',\n internalComment: 'internalComment',\n internalCommentValue: 'internalCommentValue',\n isCaseSensitive: 'isCaseSensitive',\n isCommented: 'isCommented',\n isCorrect: 'isCorrect',\n __isDefaultExample: '__isDefaultExample',\n isExample: 'isExample',\n isInfoOnly: 'isInfoOnly',\n isInfoOnlyValue: 'isInfoOnlyValue',\n isPlain: 'isPlain',\n isPublic: 'isPublic',\n isPublicValue: 'isPublicValue',\n isTemplate: 'isTemplate',\n isTemplateValue: 'isTemplateValue',\n isTemplateStripTheme: 'isTemplateStripTheme',\n isTemplateStripThemeValue: 'isTemplateStripThemeValue',\n isTracked: 'isTracked',\n isTrackedValue: 'isTrackedValue',\n item: 'item',\n itemLead: 'itemLead',\n jupyterExecutionCount: 'jupyterExecutionCount',\n jupyterExecutionCountValue: 'jupyterExecutionCountValue',\n jupyterId: 'jupyterId',\n jupyterIdValue: 'jupyterIdValue',\n key: 'key',\n keyAudio: 'keyAudio',\n keyImage: 'keyImage',\n kind: 'kind',\n kindValue: 'kindValue',\n label: 'label',\n labelFalse: 'labelFalse',\n labelFalseValue: 'labelFalseValue',\n labelTrue: 'labelTrue',\n labelTrueValue: 'labelTrueValue',\n lang: 'lang',\n language: 'language',\n languageValue: 'languageValue',\n langValue: 'langValue',\n layer: 'layer',\n layerValue: 'layerValue',\n layerRole: 'layerRole',\n layerRoleValue: 'layerRoleValue',\n lead: 'lead',\n level: 'level',\n levelACTFL: 'levelACTFL',\n levelACTFLValue: 'levelACTFLValue',\n levelCEFR: 'levelCEFR',\n levelCEFRp: 'levelCEFRp',\n levelCEFRpValue: 'levelCEFRpValue',\n levelCEFRValue: 'levelCEFRValue',\n levelILR: 'levelILR',\n levelILRValue: 'levelILRValue',\n license: 'license',\n line: 'line',\n list: 'list',\n listItemIndent: 'listItemIndent',\n listItemIndentValue: 'listItemIndentValue',\n listValue: 'listValue',\n location: 'location',\n locationValue: 'locationValue',\n machineTranslated: 'machineTranslated',\n machineTranslatedValue: 'machineTranslatedValue',\n mailingList: 'mailingList',\n marginNumber: 'marginNumber',\n mark: 'mark',\n markConfig: 'markConfig',\n markConfigValue: 'markConfigValue',\n marks: 'marks',\n marksValue: 'marksValue',\n markup: 'markup', // bitmark markup\n matrix: 'matrix',\n matrixValue: 'matrixValue',\n maxCreatedBits: 'maxCreatedBits',\n maxCreatedBitsValue: 'maxCreatedBitsValue',\n maxDisplayLevel: 'maxDisplayLevel',\n maxDisplayLevelValue: 'maxDisplayLevelValue',\n maxTocChapterLevel: 'maxTocChapterLevel',\n maxTocChapterLevelValue: 'maxTocChapterLevelValue',\n tocResource: 'tocResource',\n tocResourceValue: 'tocResourceValue',\n tocContent: 'tocContent',\n tocContentValue: 'tocContentValue',\n message: 'message',\n mockupId: 'mockupId',\n name: 'name',\n offset: 'offset',\n options: 'options',\n optionsValue: 'optionsValue',\n original: 'original',\n padletId: 'padletId',\n padletIdValue: 'padletIdValue',\n page: 'page',\n pageNo: 'pageNo',\n pageNoValue: 'pageNoValue',\n pageNumber: 'pageNumber',\n pageValue: 'pageValue',\n pairs: 'pairs',\n pairsValue: 'pairsValue',\n parent: 'parent',\n parser: 'parser',\n partialAnswer: 'partialAnswer',\n partialAnswerValue: 'partialAnswerValue',\n person: 'person',\n path: 'path',\n pathValue: 'pathValue',\n pointerLeft: 'pointerLeft',\n pointerLeftValue: 'pointerLeftValue',\n pointerTop: 'pointerTop',\n pointerTopValue: 'pointerTopValue',\n posterImage: 'posterImage',\n posterImageValue: 'posterImageValue',\n postfix: 'postfix',\n prefix: 'prefix',\n processHandIn: 'processHandIn',\n processHandInValue: 'processHandInValue',\n processHandInLocation: 'processHandInLocation',\n processHandInLocationValue: 'processHandInLocationValue',\n product: 'product',\n productFolder: 'productFolder',\n productFolderValue: 'productFolderValue',\n productId: 'productId',\n productIdValue: 'productIdValue',\n productList: 'productList',\n productListValue: 'productListValue',\n productValue: 'productValue',\n productVideo: 'productVideo',\n productVideoList: 'productVideoList',\n productVideoListValue: 'productVideoListValue',\n productVideoValue: 'productVideoValue',\n progress: 'progress',\n progressValue: 'progressValue',\n pronunciationTable: 'pronunciationTable',\n properties: 'properties',\n property: 'property',\n propertyKey: 'propertyKey',\n propertyValue: 'propertyValue',\n propertyValues: 'propertyValues',\n provider: 'provider',\n publications: 'publications',\n publicationsValue: 'publicationsValue',\n publisher: 'publisher',\n publisherName: 'publisherName',\n publisherNameValue: 'publisherNameValue',\n publisherValue: 'publisherValue',\n quantity: 'quantity',\n question: 'question',\n questions: 'questions',\n questionsValue: 'questionsValue',\n quizCountItems: 'quizCountItems',\n quizCountItemsValue: 'quizCountItemsValue',\n quizStrikethroughSolutions: 'quizStrikethroughSolutions',\n quizStrikethroughSolutionsValue: 'quizStrikethroughSolutionsValue',\n quizzes: 'quizzes',\n quizzesValue: 'quizzesValue',\n quotedPerson: 'quotedPerson',\n ratingLevelEnd: 'ratingLevelEnd',\n ratingLevelSelected: 'ratingLevelSelected',\n ratingLevelSelectedValue: 'ratingLevelSelectedValue',\n ratingLevelStart: 'ratingLevelStart',\n reaction: 'reaction',\n reason: 'reason',\n reasonableNumOfChars: 'reasonableNumOfChars',\n reasonableNumOfCharsValue: 'reasonableNumOfCharsValue',\n reductionTag: 'reductionTag',\n reductionTagValue: 'reductionTagValue',\n refAuthor: 'refAuthor',\n refBookTitle: 'refBookTitle',\n reference: 'reference',\n referenceEnd: 'referenceEnd',\n referenceProperty: 'referenceProperty',\n referencePropertyValue: 'referencePropertyValue',\n refPublisher: 'refPublisher',\n refPublicationYear: 'refPublicationYear',\n citationStyle: 'citationStyle',\n citationStyleValue: 'citationStyleValue',\n releaseDate: 'releaseDate',\n releaseDateValue: 'releaseDateValue',\n releaseKind: 'releaseKind',\n releaseKindValue: 'releaseKindValue',\n releaseVersion: 'releaseVersion',\n releaseVersionValue: 'releaseVersionValue',\n resolved: 'resolved',\n resolvedBy: 'resolvedBy',\n resolvedByValue: 'resolvedByValue',\n resolvedDate: 'resolvedDate',\n resolvedDateValue: 'resolvedDateValue',\n resolvedValue: 'resolvedValue',\n resources: 'resources',\n resourcesValue: 'resourcesValue',\n resourceType: 'resourceType',\n response: 'response',\n responses: 'responses',\n responsesValue: 'responsesValue',\n revealSolutions: 'revealSolutions',\n root: 'root', // bit type (root)\n sampleSolution: 'sampleSolution',\n sampleSolutionValue: 'sampleSolutionValue',\n scormSource: 'scormSource',\n scormSourceValue: 'scormSourceValue',\n search: 'search',\n searchValue: 'searchValue',\n searchIndex: 'searchIndex',\n searchIndexValue: 'searchIndexValue',\n section: 'section',\n select: 'select',\n servings: 'servings',\n servingsValue: 'servingsValue',\n showInIndex: 'showInIndex',\n showInIndexValue: 'showInIndexValue',\n size: 'size',\n slug: 'slug',\n slugValue: 'slugValue',\n solution: 'solution',\n solutions: 'solutions',\n solutionsValue: 'solutionsValue',\n spaceId: 'spaceId',\n spaceIdValue: 'spaceIdValue',\n src: 'src',\n src1x: 'src1x',\n src2x: 'src2x',\n src3x: 'src3x',\n src4x: 'src4x',\n start: 'start',\n statement: 'statement',\n statements: 'statements',\n statementsValue: 'statementsValue',\n statementText: 'statementText',\n stillImageFilmEmbed: 'stillImageFilmEmbed',\n stillImageFilmLink: 'stillImageFilmLink',\n stripePricingTableId: 'stripePricingTableId',\n stripePricingTableIdValue: 'stripePricingTableIdValue',\n stripePublishableKey: 'stripePublishableKey',\n stripePublishableKeyValue: 'stripePublishableKeyValue',\n subject: 'subject',\n subjectValue: 'subjectValue',\n subtitle: 'subtitle',\n subtype: 'subtype',\n subtypeValue: 'subtypeValue',\n table: 'table',\n tableAutoWidth: 'tableAutoWidth',\n tableAutoWidthValue: 'tableAutoWidthValue',\n tableFixedHeader: 'tableFixedHeader',\n tableFixedHeaderValue: 'tableFixedHeaderValue',\n tableHeaderWhitespaceNoWrap: 'tableHeaderWhitespaceNoWrap',\n tableHeaderWhitespaceNoWrapValue: 'tableHeaderWhitespaceNoWrapValue',\n tableHeight: 'tableHeight',\n tableHeightValue: 'tableHeightValue',\n tablePagination: 'tablePagination',\n tablePaginationLimit: 'tablePaginationLimit',\n tablePaginationLimitValue: 'tablePaginationLimitValue',\n tablePaginationValue: 'tablePaginationValue',\n tableResizableColumns: 'tableResizableColumns',\n tableResizableColumnsValue: 'tableResizableColumnsValue',\n tableColumnMinWidth: 'tableColumnMinWidth',\n tableColumnMinWidthValue: 'tableColumnMinWidthValue',\n tableSearch: 'tableSearch',\n tableSearchValue: 'tableSearchValue',\n tableSort: 'tableSort',\n tableSortValue: 'tableSortValue',\n tableWhitespaceNoWrap: 'tableWhitespaceNoWrap',\n tableWhitespaceNoWrapValue: 'tableWhitespaceNoWrapValue',\n tag: 'tag',\n tagValue: 'tagValue',\n target: 'target',\n targetValue: 'targetValue',\n technicalTerm: 'technicalTerm',\n technicalTermValue: 'technicalTermValue',\n term: 'term',\n text: 'text',\n textAlign: 'textAlign',\n textAst: 'textAst',\n textAstValue: 'textAstValue',\n textFormat: 'textFormat',\n textReference: 'textReference',\n textReferenceValue: 'textReferenceValue',\n texts: 'texts',\n textsValue: 'textsValue',\n theme: 'theme',\n themeValue: 'themeValue',\n thumbImage: 'thumbImage',\n thumbImageValue: 'thumbImageValue',\n thumbnails: 'thumbnails',\n thumbnailsValue: 'thumbnailsValue',\n title: 'title',\n toc: 'toc',\n tocValue: 'tocValue',\n topicTag: 'topicTag',\n topicTagValue: 'topicTagValue',\n trim: 'trim',\n type: 'type',\n __typeAlias: '__typeAlias',\n unit: 'unit',\n unitAbbr: 'unitAbbr',\n url: 'url',\n value: 'value',\n values: 'values',\n valuesValue: 'valuesValue',\n vendorDashboardId: 'vendorDashboardId',\n vendorDashboardIdValue: 'vendorDashboardIdValue',\n vendorSurveyId: 'vendorSurveyId',\n vendorSurveyIdValue: 'vendorSurveyIdValue',\n vendorUrl: 'vendorUrl',\n vendorUrlValue: 'vendorUrlValue',\n version: 'version',\n video: 'video',\n videoCallLink: 'videoCallLink',\n videoCallLinkValue: 'videoCallLinkValue',\n videoEmbed: 'videoEmbed',\n videoLink: 'videoLink',\n warnings: 'warnings',\n warningsValue: 'warningsValue',\n websiteLink: 'websiteLink',\n width: 'width',\n widthValue: 'widthValue',\n x: 'x',\n xValue: 'xValue',\n y: 'y',\n yValue: 'yValue',\n zoomDisabled: 'zoomDisabled',\n});\n\nexport type NodeTypeType = EnumType<typeof NodeType>;\n\nexport { NodeType };\n","import { init } from '../init/init.ts';\nimport { type BitmarkAst, type Node } from '../model/ast/Nodes.ts';\nimport { NodeType, type NodeTypeType } from '../model/ast/NodeType.ts';\nimport { StringUtils } from '../utils/StringUtils.ts';\n\n/**\n * AST tree node information\n */\nexport interface NodeInfo {\n /**\n * Child index of the node\n */\n index: number;\n /**\n * Node key\n */\n key: NodeTypeType;\n /**\n * Node value (if any)\n */\n value?: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n}\n\n/**\n * Callbacks for walking the AST\n */\nexport interface AstWalkCallbacks<C = undefined> {\n /**\n * Called when a branch node is entered\n *\n * @param node - this node info\n * @param route - route to this node from the root\n * @returns\n */\n enter?: (node: NodeInfo, route: NodeInfo[], context: C) => void | boolean;\n\n /**\n * Called when between child nodes\n *\n * @param node - this node info (the parent of the children in leftNode / rightNode)\n * @param leftNode - the left (previous) child node info\n * @param rightNode - the right (next) child node info\n * @param route\n * @returns\n */\n between?: (\n node: NodeInfo,\n leftNode: NodeInfo,\n rightNode: NodeInfo,\n route: NodeInfo[],\n context: C,\n ) => void | boolean;\n\n /**\n * Called when a branch node is exited\n * @param node - this node info\n * @param route - route to this node from the root\n * @returns\n */\n exit?: (node: NodeInfo, route: NodeInfo[], context: C) => void;\n\n /**\n * Called when a leaf node is entered\n * @param node - this node info\n * @param route - route to this node from the root\n * @returns\n */\n leaf?: (node: NodeInfo, route: NodeInfo[], context: C) => void;\n}\n\n/**\n * An AST (Abstract Syntax Tree) implementation for the bitmark language\n */\nclass Ast {\n constructor() {\n // Ensure init has been called - this is not the best place, but there is no standard entry point\n init();\n }\n\n /**\n * Walk bitmark AST, decending each branch and calling callbacks when entering, leaving, and when in between child\n * nodes.\n *\n * Walking the tree can be used to convert it to another format (e.g. bitmark markup or JSON or text) or for analysis.\n *\n * The tree is navigated from root to leaf, decending each branch greedily.\n *\n * e.g. for the tree:\n * ```\n * A\n * |__B1\n * | |__C1\n * | |__C2\n * |__B2\n * |__C3\n *\n * Enter A1\n * Enter B1\n * Leaf C1\n * Betwe B1 (C1, C2)\n * Leaf C2\n * Exit B1\n * Betwe A1 (B1, B2)\n * Enter B2\n * Leaf C3\n * Exit B2\n * Exit A1\n * ```\n *\n * @param context - context object to pass to callbacks\n * @param ast - bitmark / text AST\n * @param type - type of AST to walk (i.e. NodeType.bitmarkAst, NodeType.textAst)\n * @param callbacks - set of callbacks to call while walking the tree\n */\n walk<C>(ast: Node, type: NodeTypeType, callbacks: AstWalkCallbacks<C>, context: C): void {\n this.walkRecursive(ast, [{ index: 0, key: type, value: ast }], callbacks, context);\n }\n\n /**\n * Convert a route to a unique key that describes that route.\n *\n * For the route A1 -> B4 -> C2 the route key would be A1_B4_C2\n *\n * @param route - the tree path from the root to the curent node\n * @returns\n */\n getRouteKey(route: NodeInfo[]): string {\n return route.reduce((acc, val, idx) => {\n if (+val.key !== val.index) {\n acc += `${val.key}`;\n if (idx < route.length - 1) {\n acc += '_';\n }\n }\n return acc;\n }, '');\n }\n\n /**\n * Print an AST to the console.\n * Useful for debug / development purposes\n *\n * @param ast - AST\n * @param rootKey - root node key\n */\n printTree(ast: Node, rootKey: NodeTypeType = NodeType.bitmarkAst): void {\n this.walkRecursive(\n ast,\n [{ index: 0, key: rootKey, value: ast }],\n {\n enter: (_node: NodeInfo, route: NodeInfo[]): boolean => {\n console.log('Enter: ' + this.getRouteKey(route));\n\n // Stop traversing the tree if the last node is bodyJson\n if (route[route.length - 1].key === NodeType.bodyJson) return false;\n\n return true;\n },\n between: (_node: NodeInfo, _left: NodeInfo, _right: NodeInfo, route: NodeInfo[]) => {\n console.log('Between: ' + this.getRouteKey(route));\n },\n exit: (_node: NodeInfo, route: NodeInfo[]) => {\n console.log('Exit: ' + this.getRouteKey(route));\n },\n leaf: (_node: NodeInfo, route: NodeInfo[]) => {\n console.log('Leaf: ' + this.getRouteKey(route));\n },\n },\n undefined,\n );\n }\n\n /**\n * Preprocess bitmark AST into a standard format (BitmarkAst object) from bitmark AST either as a string\n * or a plain JS object\n *\n * @param ast - bitmark AST as a string or a plain JS object\n * @returns bitmark AST in a standard format (BitmarkAst object)\n */\n preprocessAst(ast: string | unknown): BitmarkAst | undefined {\n if (StringUtils.isString(ast)) {\n const str = ast as string;\n try {\n ast = JSON.parse(str);\n } catch (_e) {\n // Failed to parse JSON, return empty array\n return undefined;\n }\n }\n\n if (this.isAst(ast)) {\n return ast as BitmarkAst;\n }\n return undefined;\n }\n\n /**\n * Check if a plain JS object is valid AST\n *\n * @param ast - a plain JS object that might be AST\n * @returns true if AST, otherwise false\n */\n isAst(ast: unknown): boolean {\n if (Object.prototype.hasOwnProperty.call(ast, 'bits')) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (Array.isArray((ast as any).bits)) return true;\n }\n return false;\n }\n\n private walkRecursive<C>(\n node: Node,\n route: NodeInfo[],\n callbacks: AstWalkCallbacks<C>,\n context: C,\n ): void {\n const { enter, between, exit, leaf } = callbacks;\n\n const parentKey = route[route.length - 1].key;\n const isValue = this.isValue(node);\n const isBranch = !isValue;\n const nodeInfo = route[route.length - 1];\n\n // Call the enter callback for the node before walking children\n if (isBranch) {\n if (enter) {\n const res = enter(nodeInfo, route, context);\n // If return is false, stop walking this node\n if (res === false) return;\n }\n } else {\n if (leaf) leaf(nodeInfo, route, context);\n }\n\n // Walk child nodes\n if (isBranch) {\n const isArray = this.isArray(node);\n const keys = Object.keys(node);\n for (let i = 0, len = keys.length; i < len; i++) {\n const key = keys[i];\n const lastChild = i === len - 1;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nodeAsAny = node as any;\n const child = nodeAsAny[key];\n\n if (child != null) {\n const childNodeInfo: NodeInfo = {\n key: this.getAstKey(key, parentKey, isArray),\n index: i,\n value: child,\n };\n\n const r = route.slice();\n r.push(childNodeInfo);\n this.walkRecursive(child, r, callbacks, context);\n\n if (!lastChild) {\n const nextKey = keys[i + 1];\n const nextChild = nodeAsAny[nextKey];\n const nextChildNodeInfo: NodeInfo = {\n key: this.getAstKey(nextKey, parentKey, isArray),\n index: i + 1,\n value: nextChild,\n };\n\n // Call the between callback when between children\n if (between) {\n const res = between(nodeInfo, childNodeInfo, nextChildNodeInfo, route, context);\n // If return is false, stop looping children\n if (res === false) break;\n }\n }\n }\n }\n }\n\n // Call the exit callback for the node before walking children\n if (isBranch) {\n if (exit) exit(nodeInfo, route, context);\n }\n }\n\n private getAstKey(key: string, parentKey: string, isParentArray: boolean): NodeTypeType {\n let astKey = key;\n\n if (isParentArray && parentKey) {\n astKey = `${parentKey}Value`;\n }\n\n // return astKey;\n return NodeType.fromKey(astKey) || (`unknown(${astKey})` as NodeTypeType);\n // return AstNodeType.fromKey(astKey) || AstNodeType.unknown;\n }\n\n private isArray(x: unknown): boolean {\n return Array.isArray(x);\n // return Object.prototype.toString.call(x) === '[object Array]';\n }\n\n private isObject(x: unknown): boolean {\n return Object.prototype.toString.call(x) === '[object Object]';\n }\n\n private isValue(x: unknown): boolean {\n return !this.isObject(x) && !this.isArray(x);\n }\n}\n\nexport { Ast };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\n/**\n * The location of text.\n *\n * The location of the text affects how breakscaping is applied.\n */\nconst TextLocation = superenum({\n tag: 'tag',\n body: 'body',\n});\n\nexport type TextLocationType = EnumType<typeof TextLocation>;\n\nexport { TextLocation };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst BodyTextFormat = superenum({\n plainText: 'text', // plain text\n latex: 'latex', // LaTeX code\n json: 'json', // json\n xml: 'xml', // xml\n\n // bitmark++ text\n bitmarkPlusPlus: 'bitmark++',\n});\n\nexport type BodyTextFormatType = EnumType<typeof BodyTextFormat>;\n\nexport { BodyTextFormat };\n","/**\n * Centralized regex and replacer constants for breakscape and unbreakscape.\n * Extracted from breakscape-regex.ts to simplify core logic.\n */\n\nexport const REGEX_MARKS = /([*`_!=])(?=\\1)/; // BM_TAG: $1^ --BODY: $1^ ++BODY: $1^\nexport const REGEX_BLOCKS = /^(\\|)(code[\\s]*|code:|image:|[\\s]*$)/; // ++BODY: $2^$3\nexport const REGEX_TITLE_BLOCKS = /^([#]{1,3})([^\\S\\r\\n]+)/; // ++BODY: $4^$5\nexport const REGEX_LIST_BLOCKS = /^(•)([0-9]+[iI]*|[a-zA-Z]{1}|_|\\+|-|)([^\\S\\r\\n]+)/; // ++BODY: $6^$7$8\nexport const REGEX_START_OF_TAG = /(\\[)([.@#▼►%!?+\\-$_=&])/; // --BODY: $2^$3 ++BODY: $9^$10\nexport const REGEX_FOOTER_DIVIDER = /^(~)(~~~[ \\t]*)$/; // --BODY: $4^$5 ++BODY: $11^$12\nexport const REGEX_PLAIN_TEXT_DIVIDER = /^(\\$)(\\$\\$\\$[ \\t]*)$/; // --BODY: $6^$7 ++BODY: $13^$14\nexport const REGEX_END_OF_TAG = /(\\^*])/; // BM_TAG: ^$2 PLAIN_TAG: ^$1\nexport const REGEX_BIT_START = /^(\\[)(\\^*)(\\.)/; // PLAIN_BODY: $1^$2$3\nexport const REGEX_HATS = /(\\^+)/; // BM_TAG: $3^ PLAIN_TAG: $2^ --BODY: ^$8 ++BODY: $15^ // Must be last\n\nexport const BREAKSCAPE_BITMARK_TAG_REGEX_SOURCE = `${REGEX_MARKS.source}|${REGEX_END_OF_TAG.source}|${REGEX_HATS.source}`;\nexport const BREAKSCAPE_PLAIN_TAG_REGEX_SOURCE = `${REGEX_END_OF_TAG.source}|${REGEX_HATS.source}`;\nexport const BREAKSCAPE_BITMARK_BODY_REGEX_SOURCE = `${REGEX_MARKS.source}|${REGEX_BLOCKS.source}|${REGEX_TITLE_BLOCKS.source}|${REGEX_LIST_BLOCKS.source}|${REGEX_START_OF_TAG.source}|${REGEX_FOOTER_DIVIDER.source}|${REGEX_PLAIN_TEXT_DIVIDER.source}|${REGEX_HATS.source}`;\nexport const BREAKSCAPE_PLAIN_BODY_REGEX_SOURCE = `${REGEX_BIT_START.source}`;\n\nexport const BREAKSCAPE_BITMARK_TAG_REGEX = new RegExp(BREAKSCAPE_BITMARK_TAG_REGEX_SOURCE, 'gm');\nexport const BREAKSCAPE_BITMARK_TAG_REGEX_REPLACER = '$1$3^$2';\n\nexport const BREAKSCAPE_PLAIN_TAG_REGEX = new RegExp(BREAKSCAPE_PLAIN_TAG_REGEX_SOURCE, 'gm');\nexport const BREAKSCAPE_PLAIN_TAG_REGEX_REPLACER = '$2^$1';\n\nexport const BREAKSCAPE_BITMARK_BODY_REGEX = new RegExp(BREAKSCAPE_BITMARK_BODY_REGEX_SOURCE, 'gm');\nexport const BREAKSCAPE_BITMARK_BODY_REGEX_REPLACER = '$1$2$4$6$9$11$13$15^$3$5$7$8$10$12$14';\n\nexport const BREAKSCAPE_PLAIN_BODY_REGEX = new RegExp(BREAKSCAPE_PLAIN_BODY_REGEX_SOURCE, 'gm');\nexport const BREAKSCAPE_PLAIN_BODY_REGEX_REPLACER = '$1^$2$3';\n\nexport const BREAKSCAPE_V2_BODY_REGEX = new RegExp('^(?:(\\\\[)(\\\\^*)(\\\\.))|(\\\\^+)', 'gm');\nexport const BREAKSCAPE_V2_BODY_REGEX_REPLACER = '$1$4^$2$3';\n\nexport const UNBREAKSCAPE_REGEX = new RegExp('\\\\^([\\\\^]*)', 'gm');\nexport const UNBREAKSCAPE_REGEX_REPLACER = '$1';\n\nexport const UNBREAKSCAPE_PLAIN_IN_BODY_REGEX = new RegExp('^(\\\\[)\\\\^(\\\\^*)(\\\\.)', 'gm');\nexport const UNBREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER = '$1$2$3';\n\nexport const BREAKSCAPE_CODE_REGEX = new RegExp('^(\\\\||•|#)', 'gm');\nexport const BREAKSCAPE_CODE_REGEX_REPLACER = '$1^';\n","/**\n * breakscape.ts\n * ------------------------------------------------------------\n * Breakscaping for bitmark text.\n * (c) 2025 — MIT / public domain\n */\n\nimport { PACKAGE_INFO } from '../generated/package_info.ts';\nimport { BodyTextFormat, type BodyTextFormatType } from '../model/enum/BodyTextFormat.ts';\nimport { TextLocation, type TextLocationType } from '../model/enum/TextLocation.ts';\nimport type { BreakscapeOptions } from './BreakscapeOptions.ts';\nimport * as RC from './RegexConfigs.ts';\n\n// default options\nconst DEF = {\n format: BodyTextFormat.bitmarkPlusPlus,\n location: TextLocation.body,\n v2: false,\n} as const;\n\n/**\n * Check if an object is a string.\n *\n * @param obj - The object to check.\n * @returns true if the object is a string, otherwise false.\n */\nfunction isString(obj: unknown): boolean {\n return typeof obj === 'string' || obj instanceof String;\n}\n\n/**\n * For breakscaping, select the correct regex and replacer for the text format, location, and v2 flag.\n */\nfunction selectBreakscapeRegexAndReplacer(\n textFormat: BodyTextFormatType,\n textLocation: TextLocationType,\n v2 = false,\n): { regex: RegExp; replacer: string } {\n if (textLocation === TextLocation.tag) {\n if (!v2 && textFormat === BodyTextFormat.bitmarkPlusPlus) {\n return {\n regex: RC.BREAKSCAPE_BITMARK_TAG_REGEX,\n replacer: RC.BREAKSCAPE_BITMARK_TAG_REGEX_REPLACER,\n };\n }\n return {\n regex: RC.BREAKSCAPE_PLAIN_TAG_REGEX,\n replacer: RC.BREAKSCAPE_PLAIN_TAG_REGEX_REPLACER,\n };\n } else {\n if (textFormat === BodyTextFormat.bitmarkPlusPlus) {\n if (v2) {\n return {\n regex: RC.BREAKSCAPE_V2_BODY_REGEX,\n replacer: RC.BREAKSCAPE_V2_BODY_REGEX_REPLACER,\n };\n }\n return {\n regex: RC.BREAKSCAPE_BITMARK_BODY_REGEX,\n replacer: RC.BREAKSCAPE_BITMARK_BODY_REGEX_REPLACER,\n };\n }\n return {\n regex: RC.BREAKSCAPE_PLAIN_BODY_REGEX,\n replacer: RC.BREAKSCAPE_PLAIN_BODY_REGEX_REPLACER,\n };\n }\n}\n\n/**\n * For unbreakscaping, select the correct regex and replacer for the text format and location.\n */\nfunction selectUnbreakscapeRegexAndReplacer(\n textFormat: BodyTextFormatType,\n textLocation: TextLocationType,\n): { regex: RegExp; replacer: string } {\n const isPlain = textFormat !== BodyTextFormat.bitmarkPlusPlus;\n if (textLocation === TextLocation.body && isPlain) {\n return {\n regex: RC.UNBREAKSCAPE_PLAIN_IN_BODY_REGEX,\n replacer: RC.UNBREAKSCAPE_PLAIN_IN_BODY_REGEX_REPLACER,\n };\n }\n return {\n regex: RC.UNBREAKSCAPE_REGEX,\n replacer: RC.UNBREAKSCAPE_REGEX_REPLACER,\n };\n}\n\n// -----------------------------------------------------------------------------\n// ╭──────────────────────────────────────────────────────────────────────────╮\n// │ 2. PUBLIC API │\n// ╰──────────────────────────────────────────────────────────────────────────╯\nclass Breakscape {\n public readonly EMPTY_STRING = '' as string;\n\n /**\n * Escapes special characters in bitmark text by adding caret (^) characters.\n *\n * This method processes text to prevent special characters from being interpreted\n * as bitmark markup. It handles various scenarios including:\n * - Tag triggers after '[' characters\n * - Paired punctuation marks\n * - Hat characters (^)\n * - End-of-tag brackets\n * - Beginning-of-line markers\n *\n * IMPORTANT: Breakscaping differs depending on the bit text format, and if the text will\n * be used in a tag or in the body of a bitmark. The default is bitmark++ in the body.\n * If the text is to be used in a tag, or is not bitmark++, you must specify the textFormat\n * and textLocation options.\n *\n * @param val - The input to breakscape. Can be a string, array of strings, null, or undefined.\n * @param opts - Optional configuration for the breakscape operation.\n * @returns The breakscaped result with the same type as the input.\n *\n * @example\n * ```typescript\n * const breakscape = new Breakscape();\n *\n * // Single string\n * breakscape.breakscape('[.hello]'); // Returns '[^.hello]'\n *\n * // Array of strings\n * breakscape.breakscape(['[.hello]', '[.world]']); // Returns ['[^.hello]', '[^.world]']\n *\n * // With options\n * breakscape.breakscape('[.hello]', {\n * textFormat: TextFormat.bitmark++,\n * textLocation: TextLocation.body\n * });\n * ```\n */\n breakscape(val: string, opts?: BreakscapeOptions): string;\n breakscape(val: string[], opts?: BreakscapeOptions): string[];\n breakscape(val: undefined | null, opts?: BreakscapeOptions): undefined;\n breakscape(\n val: string | string[] | undefined | null,\n opts: BreakscapeOptions = {},\n ): string | string[] | undefined {\n if (val == null) return undefined;\n const options = Object.assign({}, DEF, opts);\n if (Array.isArray(val)) {\n return val.map((v) => this.breakscape(v, options)) as string[];\n }\n\n // If an unrecognized type is passed, return it as is (e.g. true, false, 0, 1, etc.)\n if (!isString(val)) return val as string | undefined;\n\n const { regex, replacer } = selectBreakscapeRegexAndReplacer(\n options.format,\n options.location,\n options.v2,\n );\n let str = val;\n str = str.replace(regex, replacer);\n return str;\n }\n\n /**\n * Unbreakscape a string or an array of strings.\n * If the input is an array, a new array will be returned.\n *\n * @param val input value\n * @param opts options for unbreakscaping\n * @returns the input value with any strings unbreakscaped.\n */\n unbreakscape(val: string, opts?: BreakscapeOptions): string;\n unbreakscape(val: string[], opts?: BreakscapeOptions): string[];\n unbreakscape(val: undefined | null, opts?: BreakscapeOptions): undefined;\n unbreakscape(\n val: string | string[] | undefined | null,\n opts: BreakscapeOptions = {},\n ): string | string[] | undefined {\n if (val == null) return undefined;\n const options = Object.assign({}, DEF, opts);\n if (Array.isArray(val)) {\n return val.map((v) => this.unbreakscape(v, options)) as string[];\n }\n\n // If an unrecognized type is passed, return it as is (e.g. true, false, 0, 1, etc.)\n if (!isString(val)) return val as string | undefined;\n\n const { regex, replacer } = selectUnbreakscapeRegexAndReplacer(\n options.format,\n options.location,\n );\n let str = val;\n str = str.replace(regex, replacer);\n return str;\n }\n\n /**\n * Breakscape a code string or an array of code strings.\n * If the input is an array, a new array will be returned.\n *\n * @param val input value\n * @param modifyArray if true, the original array will be modified rather than a copy being made\n * @returns the input value with any strings breakscaped\n */\n public breakscapeCode<T extends unknown | unknown[] | undefined>(\n val: T,\n options?: BreakscapeOptions,\n ): T extends string ? string : T extends string[] ? string[] : undefined {\n type R = T extends string ? string : T extends string[] ? string[] : undefined;\n\n if (val == null) return val as unknown as R;\n\n const opts = Object.assign({}, DEF, options);\n\n const breakscapeStr = (str: string) => {\n if (!str) return str;\n return str.replace(RC.BREAKSCAPE_CODE_REGEX, RC.BREAKSCAPE_CODE_REGEX_REPLACER);\n };\n\n if (Array.isArray(val)) {\n const newVal: unknown[] = opts.inPlaceArray ? val : [val.length];\n for (let i = 0, len = val.length; i < len; i++) {\n const v = val[i];\n if (isString(v)) {\n val[i] = breakscapeStr(v);\n }\n }\n val = newVal as T;\n } else if (isString(val)) {\n val = breakscapeStr(val as string) as T;\n }\n\n return val as unknown as R;\n }\n\n /**\n * Gets the version of the breakscape library.\n *\n * @returns The current version string of the library.\n *\n * @example\n * ```typescript\n * const breakscape = new Breakscape();\n * console.log(breakscape.version()); // e.g., \"1.0.0\"\n * ```\n */\n version(): string {\n return PACKAGE_INFO.version;\n }\n\n /**\n * Gets the license information for the breakscape library.\n *\n * @returns The license string for the library.\n *\n * @example\n * ```typescript\n * const breakscape = new Breakscape();\n * console.log(breakscape.license()); // e.g., \"MIT\"\n * ```\n */\n license(): string {\n return PACKAGE_INFO.license;\n }\n}\n\nexport { Breakscape };\n","import { type BreakscapedString } from '../model/ast/BreakscapedString.ts';\nimport { TextFormat } from '../model/enum/TextFormat.ts';\nimport { TextLocation } from '../model/enum/TextLocation.ts';\nimport { type BreakscapeOptions } from './BreakscapeOptions.ts';\nimport { Breakscape as BreakscapeImpl } from './BreakscapeRegex.ts';\n\n/**\n * Utility class for breakscaping strings.\n *\n * For the implementation of breakscaping, see:\n * https://github.com/getMoreBrain/bitmark-breakscape\n *\n */\n\nconst DEFAULT_BREAKSCAPE_OPTIONS: BreakscapeOptions = {\n format: TextFormat.bitmarkText,\n location: TextLocation.body,\n inPlaceArray: false,\n v2: false,\n};\n\nconst externalBreakscape = new BreakscapeImpl();\n\nclass Breakscape {\n public readonly EMPTY_STRING = '' as BreakscapedString;\n\n /**\n * Breakscape a string or an array of strings.\n * If the input is an array, a new array will be returned.\n *\n * @param val input value\n * @param options options for breakscaping\n * @param modifyArray\n * @returns the input value with any strings breakscaped.\n */\n public breakscape<T extends string | string[] | undefined>(\n val: T,\n options: BreakscapeOptions,\n ): T extends string ? BreakscapedString : T extends string[] ? BreakscapedString[] : undefined {\n type R = T extends string\n ? BreakscapedString\n : T extends string[]\n ? BreakscapedString[]\n : undefined;\n\n const opts = Object.assign({}, DEFAULT_BREAKSCAPE_OPTIONS, options);\n\n return externalBreakscape.breakscape(val as BreakscapedString, {\n format: opts.format,\n location: opts.location,\n inPlaceArray: opts.inPlaceArray,\n v2: opts.v2,\n }) as R;\n }\n\n /**\n * Unbreakscape a string or an array of strings.\n * If the input is an array, a new array will be returned.\n *\n * @param val input value\n * @param modifyArray if true, the original array will be modified rather than a copy being made\n * @returns the input value with any strings unbreakscaped.\n */\n public unbreakscape<T extends BreakscapedString | BreakscapedString[] | undefined>(\n val: T,\n options: BreakscapeOptions,\n ): T extends BreakscapedString ? string : T extends BreakscapedString[] ? string[] : undefined {\n type R = T extends BreakscapedString\n ? string\n : T extends BreakscapedString[]\n ? string[]\n : undefined;\n\n const opts = Object.assign({}, DEFAULT_BREAKSCAPE_OPTIONS, options);\n\n return externalBreakscape.unbreakscape(val as BreakscapedString, opts) as R;\n }\n\n /**\n * Breakscape a code string or an array of code strings.\n * If the input is an array, a new array will be returned.\n *\n * @param val input value\n * @param modifyArray if true, the original array will be modified rather than a copy being made\n * @returns the input value with any strings breakscaped\n */\n public breakscapeCode<T extends unknown | unknown[] | undefined>(\n val: T,\n options?: BreakscapeOptions,\n ): T extends string ? BreakscapedString : T extends string[] ? BreakscapedString[] : undefined {\n type R = T extends string\n ? BreakscapedString\n : T extends string[]\n ? BreakscapedString[]\n : undefined;\n\n const opts = Object.assign({}, DEFAULT_BREAKSCAPE_OPTIONS, options);\n\n return externalBreakscape.breakscapeCode(val as BreakscapedString, opts) as R;\n }\n\n /**\n * Concatenate two breakscaped strings.\n *\n * @param s1 first string\n * @param s2 second string\n * @returns the concatenated string\n */\n public concatenate(s1: BreakscapedString, s2: BreakscapedString): BreakscapedString {\n return (s1 + s2) as BreakscapedString;\n }\n}\n\nconst instance = new Breakscape();\n\nexport { instance as Breakscape };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst DeprecatedTextFormat = superenum({\n bitmarkMinusMinus: 'bitmark--', // bitmark-- text format, deprecated\n});\n\nexport type DeprecatedTextFormatType = EnumType<typeof DeprecatedTextFormat>;\n\nexport { DeprecatedTextFormat };\n","class ArrayUtils {\n /**\n * Convert a value to an array, unless it is already an array.\n *\n * This function is useful for handling parameters that can be a single value or an array of values.\n *\n * @param val input value\n * @returns the input value if it is an array, otherwise a new array containing the input value\n */\n asArray<T>(val: T | T[] | undefined): T[] | undefined {\n if (val == null) return undefined;\n if (Array.isArray(val)) return val;\n return [val];\n }\n\n /**\n * Convert an array or value to a value, unless it is already a value.\n * The first item in the array will be selected\n *\n * This function is useful for handling parameters that can be a single value or an array of values.\n *\n * @param val input value\n * @param last if true, the last item in the array will be selected, rather than the first\n * @returns the input value if it is not an array, otherwise the first item in the array\n */\n asSingle<T>(val: T | T[] | undefined, last?: boolean): T | undefined {\n if (val == null) return undefined;\n if (Array.isArray(val)) {\n if (val.length > 0) return last ? val[val.length - 1] : val[0];\n return undefined;\n }\n return val;\n }\n}\n\nconst instance = new ArrayUtils();\n\nexport { instance as ArrayUtils };\n","import { type EnumType } from '@ncoderz/superenum';\n\nimport { Ast, type NodeInfo } from '../../ast/Ast.ts';\nimport { Breakscape } from '../../breakscaping/Breakscape.ts';\nimport { type BreakscapeOptions } from '../../breakscaping/BreakscapeOptions.ts';\nimport { type BreakscapedString } from '../../model/ast/BreakscapedString.ts';\nimport { type Bit } from '../../model/ast/Nodes.ts';\nimport { NodeType } from '../../model/ast/NodeType.ts';\nimport {\n type CodeBlockTextNode,\n type CommentMark,\n type ExtRefMark,\n type FootnoteMark,\n type HeadingTextNode,\n type ImageInlineTextNode,\n type ImageTextNode,\n type LatexTextNode,\n type LinkMark,\n type ListTextNode,\n type MediaAttributes,\n type RefMark,\n type SectionTextNode,\n type SymbolMark,\n type TaskItemTextNode,\n type TextAst,\n type TextMark,\n type TextNode,\n type XRefMark,\n} from '../../model/ast/TextNodes.ts';\nimport {\n BitmarkVersion,\n type BitmarkVersionType,\n DEFAULT_BITMARK_VERSION,\n} from '../../model/enum/BitmarkVersion.ts';\nimport { type BitTypeType } from '../../model/enum/BitType.ts';\nimport { TextFormat, type TextFormatType } from '../../model/enum/TextFormat.ts';\nimport { TextLocation, type TextLocationType } from '../../model/enum/TextLocation.ts';\nimport { TextMarkType, type TextMarkTypeType } from '../../model/enum/TextMarkType.ts';\nimport { TextNodeType, type TextNodeTypeType } from '../../model/enum/TextNodeType.ts';\nimport { type BodyBitJson, type BodyBitsJson } from '../../model/json/BodyBitJson.ts';\nimport { StringUtils } from '../../utils/StringUtils.ts';\nimport { AstWalkerGenerator } from '../AstWalkerGenerator.ts';\n\nconst DEFAULT_OPTIONS: TextOptions = {\n bodyBitCallback: undefined,\n debugGenerationInline: false,\n};\n\nconst FIRST_PARAGRAPH_CONTENT_DEPTH = 3;\n\nconst BOLD_HALF_MARK = '*';\nconst LIGHT_HALF_MARK = '`';\nconst ITALIC_HALF_MARK = '_';\nconst HIGHLIGHT_HALF_MARK = '!';\nconst INLINE_HALF_MARK = '=';\n\nconst BOLD_MARK = BOLD_HALF_MARK + BOLD_HALF_MARK;\nconst LIGHT_MARK = LIGHT_HALF_MARK + LIGHT_HALF_MARK;\nconst ITALIC_MARK = ITALIC_HALF_MARK + ITALIC_HALF_MARK;\nconst HIGHLIGHT_MARK = HIGHLIGHT_HALF_MARK + HIGHLIGHT_HALF_MARK;\nconst INLINE_MARK = INLINE_HALF_MARK + INLINE_HALF_MARK;\n\nconst ALL_HALF_MARKS = [\n BOLD_HALF_MARK,\n LIGHT_HALF_MARK,\n ITALIC_HALF_MARK,\n HIGHLIGHT_HALF_MARK,\n INLINE_HALF_MARK,\n];\n\nconst ALL_TAG_OPENING_ENDS = '@#▼►%!?+-$_=&';\n\nconst HEADING_TAG = '#';\n\nconst STANDARD_MARKS: { [key: string]: string } = {\n [TextMarkType.bold]: BOLD_MARK,\n [TextMarkType.light]: LIGHT_MARK,\n [TextMarkType.italic]: ITALIC_MARK,\n [TextMarkType.highlight]: HIGHLIGHT_MARK,\n};\n\nconst STANDARD_MARK_TYPES: TextMarkTypeType[] = [\n TextMarkType.bold,\n TextMarkType.light,\n TextMarkType.italic,\n TextMarkType.highlight,\n];\nconst INLINE_MARK_TYPES: TextMarkTypeType[] = [\n TextMarkType.strike,\n TextMarkType.subscript,\n TextMarkType.superscript,\n TextMarkType.ins,\n TextMarkType.del,\n TextMarkType.underline,\n TextMarkType.doubleUnderline,\n TextMarkType.circle,\n TextMarkType.languageEmRed,\n TextMarkType.languageEmOrange,\n TextMarkType.languageEmYellow,\n TextMarkType.languageEmGreen,\n TextMarkType.languageEmBlue,\n TextMarkType.languageEmPurple,\n TextMarkType.languageEmPink,\n TextMarkType.languageEmBrown,\n TextMarkType.languageEmBlack,\n TextMarkType.languageEmWhite,\n TextMarkType.languageEmGray,\n TextMarkType.languageEm,\n TextMarkType.userUnderline,\n TextMarkType.userDoubleUnderline,\n TextMarkType.userStrike,\n TextMarkType.userCircle,\n TextMarkType.userHighlight,\n TextMarkType.notranslate,\n //\n TextMarkType.link,\n TextMarkType.ref,\n TextMarkType.xref,\n TextMarkType.extref,\n TextMarkType.footnote,\n TextMarkType.footnoteStar,\n TextMarkType.symbol,\n TextMarkType.var,\n TextMarkType.code,\n TextMarkType.timer,\n TextMarkType.duration,\n TextMarkType.color,\n TextMarkType.comment,\n];\n\n// Regex explanation:\n// - Match newline or carriage return + newline\nconst INDENTATION_REGEX = new RegExp(/(\\n|\\r\\n)/, 'g');\n\nconst LINK_REGEX = new RegExp(/https?:\\/\\/|mailto:(.*)/, 'g');\nconst LINK_BREAKSCAPE_REGEX = new RegExp(/\\]/, 'g');\n\n/**\n * Text generation options\n */\nexport interface TextOptions {\n /**\n * Callback for writing text\n *\n * If set, the callback will be called, rather than writing to the output string\n */\n writeCallback?: WriteCallback;\n\n /**\n * Callback for rendering body bits\n */\n bodyBitCallback?: BodyBitCallback;\n\n /**\n * [development only]\n * Generate debug information in the output.\n */\n debugGenerationInline?: boolean;\n}\n\nexport type GenerateOptions = {\n plainTextDividerAllowed?: boolean;\n noBreakscaping?: boolean;\n};\n\nconst Stage = {\n enter: 'enter',\n between: 'between',\n exit: 'exit',\n};\n\nexport type StageType = EnumType<typeof Stage>;\n\nexport type WriteCallback = (s: string) => void;\nexport type BodyBitCallback = (bodyBit: BodyBitJson, index: number, route: NodeInfo[]) => string;\n\ninterface MediaAttributeOptions {\n ignoreAttributes?: Set<string>;\n}\n\n/**\n * Generate text from a bitmark text AST\n */\nclass TextGenerator extends AstWalkerGenerator<TextAst, BreakscapedString> {\n protected ast = new Ast();\n private bitmarkVersion: BitmarkVersionType;\n private options: TextOptions;\n\n // State\n private generateOptions: GenerateOptions = {};\n private textFormat: TextFormatType = TextFormat.bitmarkText;\n private textLocation: TextLocationType = TextLocation.body;\n private writerText = '';\n private nodeIndex = 0;\n private currentIndent = 0;\n private prevIndent = 0;\n private indentationStringCache = '';\n private inParagraph = false;\n private inHeading = false;\n private inCodeBlock = false;\n private exitedCodeBlock = false;\n private inBulletList = false;\n private inInline = false;\n private textDepth = 0;\n private placeholderIndex = 0;\n private placeholders: BodyBitsJson = {};\n\n // For pre-text\n private rootParagraphNodeContentIndex = 0;\n private previousRootParagraphContextType: TextNodeTypeType = TextNodeType.text;\n private inPreText = false;\n private thisNodeIsPreText = false;\n private preTextIndexTemp = -1;\n private havePreText = false;\n private preTextIndex = -1;\n\n /**\n * Generate text from a bitmark text AST\n *\n * @param bitmarkVersion - bitmark version, use null to use latest version\n * @param options - text generation options\n */\n constructor(bitmarkVersion?: BitmarkVersionType, options?: TextOptions) {\n super();\n\n this.bitmarkVersion = BitmarkVersion.fromValue(bitmarkVersion) ?? DEFAULT_BITMARK_VERSION;\n this.options = {\n ...DEFAULT_OPTIONS,\n ...options,\n };\n\n this.debugGenerationInline = this.options.debugGenerationInline ?? false;\n\n // Set defaults according to bitmark version\n if (this.bitmarkVersion === BitmarkVersion.v2) {\n //\n } else {\n //\n }\n\n this.enter = this.enter.bind(this);\n this.between = this.between.bind(this);\n this.exit = this.exit.bind(this);\n this.leaf = this.leaf.bind(this);\n }\n\n /**\n * Generate text from a bitmark text AST\n *\n * @param ast bitmark text AST\n */\n public async generate(\n ast: TextAst,\n textFormat: TextFormatType,\n textLocation: TextLocationType,\n options?: GenerateOptions,\n ): Promise<BreakscapedString> {\n return this.generateSync(ast, textFormat, textLocation, options);\n }\n\n /**\n * Generate text from a bitmark text AST synchronously\n *\n * @param ast bitmark text AST\n */\n public generateSync(\n ast: TextAst,\n textFormat: TextFormatType,\n textLocation: TextLocationType,\n options?: GenerateOptions,\n ): BreakscapedString {\n this.generateOptions = Object.assign({}, options);\n\n this.validateGenerateOptions(ast);\n\n if (!this.generateOptions.plainTextDividerAllowed) {\n // Normal case with no pre-text - need only walk once\n\n // Reset the state\n this.resetState(textFormat, textLocation);\n\n // Walk the text AST - this 1st walk is to determine if there is pre-text\n this.walkAndWrite(ast);\n } else {\n // Plain text divider is allowed. We need to walk the text AST twice:\n // 1. To determine if there is pre-text\n // 2. To generate the text\n\n // Save and clear the write callback / body bit callback for the first walk as we don't want to write the text\n const writeCallback = this.options.writeCallback;\n const bodyBitCallback = this.options.bodyBitCallback;\n this.options.writeCallback = undefined;\n this.options.bodyBitCallback = undefined;\n\n // Reset the state\n this.resetState(textFormat, textLocation);\n\n // Walk the text AST - this 1st walk is to determine if there is pre-text\n this.walkAndWrite(ast);\n\n // Restore the write callback\n this.options.writeCallback = writeCallback;\n this.options.bodyBitCallback = bodyBitCallback;\n\n // Reset the state, preserving havePreText / preTextIndex from the first walk\n const havePreText = this.havePreText;\n const pti = this.preTextIndex;\n this.resetState(textFormat, textLocation);\n this.havePreText = havePreText;\n this.preTextIndex = pti;\n\n // Walk the text AST - this is the 2nd walk to generate the text\n this.walkAndWrite(ast);\n }\n\n return this.writerText as BreakscapedString;\n }\n\n public getPlaceholders(): BodyBitsJson {\n return this.placeholders;\n }\n\n private resetState(textFormat: TextFormatType, textLocation: TextLocationType): void {\n this.printed = false;\n\n this.textFormat = textFormat ?? TextFormat.bitmarkText;\n this.textLocation = textLocation;\n this.writerText = '';\n this.nodeIndex = 0;\n this.currentIndent = 0;\n this.prevIndent = 0;\n this.indentationStringCache = '';\n this.inParagraph = false;\n this.inHeading = false;\n this.inCodeBlock = false;\n this.exitedCodeBlock = false;\n this.inBulletList = false;\n this.inInline = false;\n this.textDepth = 0;\n this.placeholderIndex = 0;\n this.placeholders = {};\n\n // For pre-text\n this.rootParagraphNodeContentIndex = 0;\n this.previousRootParagraphContextType = TextNodeType.hardBreak;\n this.inPreText = false;\n this.thisNodeIsPreText = false;\n this.preTextIndexTemp = -1;\n this.havePreText = false;\n this.preTextIndex = -1;\n }\n\n private walkAndWrite(ast: TextAst): void {\n // Walk the bitmark AST\n this.ast.walk(ast, NodeType.textAst, this, undefined);\n }\n\n //\n // NODE HANDLERS\n //\n\n // * -> textAstValue\n\n protected enter_textAstValue(node: NodeInfo, route: NodeInfo[]): void | false {\n return this.handleEnterNode(node.value, route);\n }\n\n protected between_textAstValue(\n node: NodeInfo,\n left: NodeInfo,\n right: NodeInfo,\n route: NodeInfo[],\n ): void | false {\n return this.handleBetweenNode(node.value, left, right, route);\n }\n\n protected exit_textAstValue(node: NodeInfo, route: NodeInfo[]): void | false {\n return this.handleExitNode(node.value, route);\n }\n\n // * -> contentValue\n\n protected enter_contentValue(node: NodeInfo, route: NodeInfo[]): void | false {\n return this.handleEnterContentValueNode(node, route);\n }\n\n protected between_contentValue(\n node: NodeInfo,\n left: NodeInfo,\n right: NodeInfo,\n route: NodeInfo[],\n ): void {\n this.handleBetweenContentValueNode(node, left, right, route);\n }\n\n protected exit_contentValue(node: NodeInfo, route: NodeInfo[]): void | false {\n this.handleExitContentValueNode(node, route);\n }\n\n // * -> contentValueValue\n\n protected enter_contentValueValue(node: NodeInfo, route: NodeInfo[]): void | false {\n return this.handleEnterNode(node.value, route);\n }\n\n protected between_contentValueValue(\n node: NodeInfo,\n left: NodeInfo,\n right: NodeInfo,\n route: NodeInfo[],\n ): void {\n this.handleBetweenNode(node.value, left, right, route);\n }\n\n protected exit_contentValueValue(node: NodeInfo, route: NodeInfo[]): void | false {\n return this.handleExitNode(node.value, route);\n }\n\n // END NODE HANDLERS\n\n protected handleEnterNode(node: TextNode, route: NodeInfo[]): void | false {\n this.handleEnterNodePreTextCheck(node, route);\n\n this.handleIndent(node);\n\n switch (node.type) {\n case TextNodeType.paragraph:\n this.inParagraph = true;\n this.writeParagraph(node);\n break;\n\n case TextNodeType.hardBreak:\n this.writeHardBreak(node);\n break;\n\n case TextNodeType.text:\n this.writeMarks(node, Stage.enter);\n this.writeText(node);\n this.writeMarks(node, Stage.between);\n if (this.textDepth === 0) {\n this.inInline = true;\n }\n this.textDepth++;\n break;\n\n case TextNodeType.heading:\n this.writeHeading(node as HeadingTextNode);\n this.inHeading = true;\n break;\n\n case TextNodeType.section:\n this.writeSection(node as SectionTextNode);\n break;\n\n case TextNodeType.listItem:\n case TextNodeType.taskItem:\n this.writeBullet(node, route);\n break;\n\n case TextNodeType.image:\n this.writeImage(node as ImageTextNode);\n break;\n\n case TextNodeType.imageInline:\n this.writeImage(node as ImageTextNode);\n break;\n\n case TextNodeType.codeBlock:\n this.inCodeBlock = true;\n this.writeCodeBlock(node as CodeBlockTextNode);\n break;\n\n case TextNodeType.latex:\n this.writeLatex(node as LatexTextNode);\n break;\n\n case TextNodeType.noBulletList:\n case TextNodeType.bulletList:\n case TextNodeType.orderedList:\n case TextNodeType.orderedListRoman:\n case TextNodeType.orderedListRomanLower:\n case TextNodeType.letteredList:\n case TextNodeType.letteredListLower:\n case TextNodeType.taskList:\n this.inBulletList = true;\n break;\n\n case TextNodeType.gap:\n case TextNodeType.select:\n case TextNodeType.highlight:\n case TextNodeType.mark:\n this.writeBodyBit(node, route);\n // Stop parsing the body bit\n return false;\n default:\n // Ignore unknown type\n }\n\n // Clear exited flags\n this.exitedCodeBlock = false;\n }\n\n protected handleBetweenNode(\n node: TextNode,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n switch (node.type) {\n default:\n // Ignore unknown type\n }\n }\n\n protected handleExitNode(node: TextNode, _route: NodeInfo[]): void | false {\n switch (node.type) {\n case TextNodeType.text:\n this.textDepth--;\n if (this.textDepth === 0) {\n this.inInline = false;\n }\n this.writeMarks(node, Stage.exit);\n break;\n\n case TextNodeType.paragraph:\n // if (this.textFormat !== TextFormat.bitmarkText) {\n // Paragraph Block type node, write 1x newline\n // Except:\n // - for bitmark-- where we don't write newlines for the single wrapping block\n this.writeNL();\n // }\n this.inParagraph = false;\n break;\n\n case TextNodeType.heading:\n this.inHeading = false;\n\n case TextNodeType.section:\n case TextNodeType.image:\n if (!this.inParagraph) {\n // Block type nodes, write 2x newline\n this.writeNL();\n this.writeNL();\n }\n break;\n\n case TextNodeType.codeBlock:\n // CodeBlock type node, write 2x newline\n this.writeNL();\n this.writeNL();\n this.inCodeBlock = false;\n this.exitedCodeBlock = true;\n break;\n\n case TextNodeType.noBulletList:\n case TextNodeType.bulletList:\n case TextNodeType.orderedList:\n case TextNodeType.orderedListRoman:\n case TextNodeType.orderedListRomanLower:\n case TextNodeType.letteredList:\n case TextNodeType.letteredListLower:\n case TextNodeType.taskList:\n // List Block type nodes, write a newline only if there is no indent\n if (this.currentIndent <= 1) {\n this.writeNL();\n // Exit 'inBulletList' state only if not in a nested list\n this.inBulletList = false;\n }\n break;\n\n default:\n // Ignore unknown type\n }\n\n this.handleDedent(node);\n\n // Increment the node index for the next node\n this.nodeIndex++;\n }\n\n protected handleIndent(node: TextNode) {\n switch (node.type) {\n case TextNodeType.noBulletList:\n case TextNodeType.bulletList:\n case TextNodeType.orderedList:\n case TextNodeType.orderedListRoman:\n case TextNodeType.orderedListRomanLower:\n case TextNodeType.letteredList:\n case TextNodeType.letteredListLower:\n case TextNodeType.taskList:\n this.currentIndent++;\n break;\n\n default:\n // Ignore unknown type\n }\n }\n\n protected handleDedent(node: TextNode) {\n switch (node.type) {\n case TextNodeType.noBulletList:\n case TextNodeType.bulletList:\n case TextNodeType.orderedList:\n case TextNodeType.orderedListRoman:\n case TextNodeType.orderedListRomanLower:\n case TextNodeType.letteredList:\n case TextNodeType.letteredListLower:\n case TextNodeType.taskList:\n this.currentIndent--;\n break;\n\n default:\n // Ignore unknown type\n }\n }\n\n protected handleEnterContentValueNode(_node: NodeInfo, route: NodeInfo[]): void | false {\n if (route.length === FIRST_PARAGRAPH_CONTENT_DEPTH) {\n this.thisNodeIsPreText = true;\n this.inPreText = false;\n this.previousRootParagraphContextType = TextNodeType.hardBreak;\n }\n }\n\n protected handleBetweenContentValueNode(\n _node: NodeInfo,\n left: NodeInfo,\n _right: NodeInfo,\n route: NodeInfo[],\n ): void {\n if (route.length === FIRST_PARAGRAPH_CONTENT_DEPTH) {\n const leftNode = left.value as TextNode;\n this.updatePreTextState();\n\n this.thisNodeIsPreText = true;\n this.previousRootParagraphContextType = leftNode.type;\n this.rootParagraphNodeContentIndex++;\n }\n }\n\n protected handleExitContentValueNode(_node: NodeInfo, route: NodeInfo[]): void | false {\n if (route.length === FIRST_PARAGRAPH_CONTENT_DEPTH) {\n this.updatePreTextState();\n\n this.thisNodeIsPreText = false;\n if (this.generateOptions.plainTextDividerAllowed && this.inPreText) {\n this.havePreText = true;\n this.preTextIndex = this.preTextIndexTemp;\n }\n this.inPreText = false;\n }\n }\n\n private updatePreTextState(): void {\n if (\n !this.inPreText &&\n this.thisNodeIsPreText &&\n this.previousRootParagraphContextType === TextNodeType.hardBreak\n ) {\n // Enter pre-text if this node could be pre-text, and the previous node was a hard break\n this.inPreText = true;\n this.preTextIndexTemp = this.rootParagraphNodeContentIndex;\n } else if (this.inPreText && !this.thisNodeIsPreText) {\n this.inPreText = false;\n this.preTextIndexTemp = -1;\n }\n }\n\n protected handleEnterNodePreTextCheck(node: TextNode, route: NodeInfo[]) {\n const firstParagraphContent = route.length === 4;\n\n // If this is the first paragraph content node, check for pre-text, otherwise cannot be pre-text\n if (firstParagraphContent) {\n // If in pre-text, and this node is a hard break, stay in pre-text\n if (this.inPreText && node.type === TextNodeType.hardBreak) return;\n\n // If this node is text, then we might be in pre-text\n if (node.type === TextNodeType.text) return;\n }\n\n // Any other node and we are not in pre-text any longer\n this.thisNodeIsPreText = false;\n }\n\n /**\n * Check if a text node has a link mark, and if so, return the href\n *\n * @param node the node to check for a link mark\n * @returns the href, or false if no link mark\n */\n protected getLinkHref(node: TextNode): string | false {\n if (node.type === TextNodeType.text && node.marks) {\n const href = node.marks.reduce((acc, mark) => {\n if (mark.type === TextMarkType.link) {\n const linkMark = mark as LinkMark;\n const href = linkMark.attrs?.href;\n if (href) return href;\n }\n return acc;\n }, '');\n\n if (href) return href;\n }\n\n return false;\n }\n\n /**\n * Get the current indentation string\n * @returns\n */\n protected getIndentationString(): string {\n // Return the cached indent if indent hasn't changed\n if (this.currentIndent === this.prevIndent) return this.indentationStringCache;\n\n let s = '';\n for (let i = 1; i < this.currentIndent; i++) s += '\\t';\n // for (let i = 1; i < this.currentIndent; i++) s += '_';\n\n this.indentationStringCache = s;\n this.prevIndent = this.currentIndent;\n\n return s;\n }\n\n //\n // WRITE FUNCTIONS\n //\n\n protected writeBodyBit(node: TextNode, route: NodeInfo[]) {\n const placeholder = `[!${this.placeholderIndex}]`;\n this.placeholders[placeholder] = node as unknown as BodyBitJson;\n\n if (this.options.bodyBitCallback) {\n const bodyBit = this.options.bodyBitCallback(\n node as unknown as BodyBitJson,\n this.placeholderIndex,\n route,\n );\n this.write(bodyBit);\n } else {\n // Write placeholder to the text\n this.write(placeholder);\n }\n\n this.placeholderIndex++;\n }\n\n protected writeText(node: TextNode): void {\n if (node.text == null) return;\n\n // Handle normal text\n const codeBreakscaping = this.inCodeBlock;\n\n // Get the text\n let s: string = node.text;\n\n // If the node has a single link mark, and the mark is the same (without protocol) as the text, write the link\n // instead of the text. This is a special case.\n const linkText = this.getLinkText(node);\n if (linkText) s = linkText;\n\n // Breakscape the text\n if (linkText) {\n // Only breakscape ] in links (done in getLinkText)\n s = linkText;\n } else {\n if (!codeBreakscaping) {\n s = this.breakscape(s, {\n format: this.textFormat,\n location: this.textLocation,\n });\n } else {\n s = this.breakscape(s, {\n format: this.textFormat,\n location: this.textLocation,\n });\n }\n }\n\n // Apply any required indentation\n if (this.currentIndent > 1) {\n const indentationString = this.getIndentationString();\n s = s.replace(INDENTATION_REGEX, `$1${indentationString}`);\n }\n\n // If have pre-text, and this is the correct index, write the plain text divider\n if (this.havePreText && this.rootParagraphNodeContentIndex === this.preTextIndex) {\n // Write the plain text divider\n this.writePlainTextDivider();\n this.writeNL();\n }\n if (this.havePreText && this.rootParagraphNodeContentIndex >= this.preTextIndex) {\n // Write the text as pre-text\n const s = this.breakscape(node.text, {\n format: TextFormat.plainText,\n location: this.textLocation, // Must be body for pre-text\n });\n this.write(s);\n } else {\n // Write the text\n this.write(s);\n }\n\n // Handle pre-text check\n if (this.currentIndent > 1 || codeBreakscaping) {\n this.thisNodeIsPreText = false; // Not pre-text if indented or in code block\n }\n if (!this.inPreText && node.text === s) {\n this.thisNodeIsPreText = false; // No-breakscaping, so don't enter pre-text\n }\n }\n\n /**\n * Check if a node is a link node and if so and the node has only the link mark, and the link without the\n * protocol is the same as the text, return true. Otherwise return false.\n *\n * @param node\n * @returns true if a simple link, otherwise false\n */\n protected isSimpleLink(node: TextNode): boolean {\n if (node.text == null) return false;\n if (node.marks?.length !== 1) return false;\n\n const href = this.getLinkHref(node);\n if (href) {\n // Get the text part of the link\n const hrefText = href.replace(LINK_REGEX, '$1');\n return hrefText === node.text;\n }\n return false;\n }\n\n /**\n * Get the link text if the node is a link, otherwise return false\n *\n * @param node\n * @returns\n */\n protected getLinkText(node: TextNode): string | false {\n if (node.text == null) return false;\n\n const href = this.getLinkHref(node);\n if (href) {\n let res: string;\n // Get the text part of the link\n const hrefText = href.replace(LINK_REGEX, '$1');\n if (hrefText === node.text) {\n // Return the link as the text\n res = href;\n } else {\n res = node.text;\n }\n res = (res ?? '').replace(LINK_BREAKSCAPE_REGEX, '^]'); // Link breakscaping\n return res;\n }\n return false;\n }\n\n /**\n * If the existing written text ends with a half-mark, and the new text starts with the same half-mark, insert a\n * breakscape ^ between them to break the sequence.\n *\n * Only applies to bitmark version > 2\n *\n * @param s\n */\n protected getInterTextBreakscape(s: string): string {\n if (this.bitmarkVersion === BitmarkVersion.v2) return '';\n if (this.textFormat === TextFormat.plainText) return '';\n\n const lastChar = this.writerText.slice(-1);\n const firstChar = s.slice(0, 1);\n\n // If the last char is a half-mark, and the first char is the same half-mark, insert a breakscape\n if (lastChar === firstChar && ALL_HALF_MARKS.indexOf(lastChar) !== -1) {\n return '^';\n }\n\n // If in the body and the first char is a bit tag start, and the last char is the second part of the tag,\n // insert a breakscape\n if (this.textLocation === TextLocation.body) {\n if (lastChar === '[' && ALL_TAG_OPENING_ENDS.indexOf(firstChar) !== -1) {\n return '^';\n }\n }\n\n // Normal case, no breakscape\n return '';\n }\n\n // protected getHrefTextFromHref\n\n protected validateGenerateOptions(ast: TextNode[]): void {\n // Validate plain text divider allowed\n if (this.generateOptions.plainTextDividerAllowed) {\n // Check there is only one node in the AST, and that it is a paragraph\n if (ast.length !== 1) {\n this.generateOptions.plainTextDividerAllowed = false;\n } else if (ast.length === 1 && ast[0].type !== TextNodeType.paragraph) {\n this.generateOptions.plainTextDividerAllowed = false;\n }\n }\n }\n\n /**\n * Write the marks for the node.\n *\n * All marks need to be considered at once, because if there are multiple marks, they need to be written in\n * a combined manner.\n *\n * e.g. if there are bold and italic marks, they need to be written as\n *\n * ==the text==|bold|italic|\n * rather than\n * **__the text__**\n * or\n * **__the text**__\n *\n * @param node the text node\n * @param start true if starting (before) the text, false if ending (after) the text\n */\n protected writeMarks(node: TextNode, stage: StageType): void {\n if (node.marks) {\n // If this is a mark within inline text, or a heading, only inline marks are allowed\n const forceSingleMark = !!(this.inInline || this.inHeading);\n\n // If node has marks, it cannot be a pre-text node\n this.thisNodeIsPreText = false;\n\n // Empty marks occur when the inline mark has no attributes - write an inline mark with no attributes\n const emptyMarks = node.marks.length === 0;\n if (emptyMarks) {\n // Write the mark start / end around the text\n this.writeMarkTextWrapper(INLINE_MARK);\n return;\n }\n\n // Single marks are only valid if there is only one mark for this text\n // They are only used in inline / heading marks since bitmark-- was dropped.\n const singleMark = node.marks.length === 1 && forceSingleMark;\n\n // Get the correct mark start / end\n const markStartEnd = node.marks.reduce(\n (acc, mark) => {\n if (acc) return acc;\n if (STANDARD_MARK_TYPES.indexOf(mark.type) !== -1) {\n if (singleMark) return STANDARD_MARKS[mark.type];\n return INLINE_MARK;\n } else if (INLINE_MARK_TYPES.indexOf(mark.type) !== -1) {\n return INLINE_MARK;\n } else {\n // Do nothing (NOTE: link is handled in writeText)\n }\n return acc;\n },\n undefined as string | undefined,\n );\n\n // Check the special case of a simple link mark\n const isSimpleLinkMark = this.isSimpleLink(node);\n\n const haveMark = markStartEnd != null && !isSimpleLinkMark;\n\n if (haveMark) {\n // Write the mark start / end around the text (==)\n if (stage == Stage.enter || stage == Stage.between) {\n this.writeMarkTextWrapper(markStartEnd);\n }\n\n // Write the inline/comment mark if not entering (|<mark content>)\n if (stage == Stage.between) {\n for (const mark of node.marks) {\n if (STANDARD_MARK_TYPES.indexOf(mark.type) !== -1) {\n if (!singleMark) {\n this.writeInlineMarkStartEnd();\n this.writeInlineMark(mark);\n }\n } else if (TextMarkType.comment === mark.type) {\n this.writeInlineMarkStartEnd();\n this.writeCommentMark(mark as CommentMark);\n } else if (TextMarkType.link === mark.type) {\n this.writeInlineMarkStartEnd();\n this.writeLinkMark(mark as LinkMark);\n } else if (TextMarkType.ref === mark.type) {\n this.writeInlineMarkStartEnd();\n this.writeRefMark(mark as RefMark);\n } else if (TextMarkType.xref === mark.type) {\n this.writeInlineMarkStartEnd();\n this.writeXRefMark(mark as XRefMark);\n } else if (TextMarkType.extref === mark.type) {\n this.writeInlineMarkStartEnd();\n this.writeExtRefMark(mark as ExtRefMark);\n } else if (TextMarkType.footnote === mark.type) {\n this.writeInlineMarkStartEnd();\n this.writeFootnoteMark(mark as FootnoteMark);\n } else if (TextMarkType.footnoteStar === mark.type) {\n this.writeInlineMarkStartEnd();\n this.writeFootnoteStarMark(mark as FootnoteMark);\n } else if (TextMarkType.symbol === mark.type) {\n this.writeInlineMarkStartEnd();\n this.writeSymbolMark(mark as SymbolMark);\n } else if (INLINE_MARK_TYPES.indexOf(mark.type) !== -1) {\n this.writeInlineMarkStartEnd();\n this.writeInlineMark(mark);\n } else {\n // Do nothing\n }\n }\n }\n\n // Write the inline/comment mark end when exiting (|)\n if (stage == Stage.exit) {\n let inlineMarkWritten = false;\n for (const mark of node.marks) {\n if (STANDARD_MARK_TYPES.indexOf(mark.type) !== -1) {\n if (!singleMark) {\n inlineMarkWritten = true;\n }\n } else if (\n TextMarkType.comment === mark.type ||\n TextMarkType.link === mark.type ||\n TextMarkType.ref === mark.type ||\n TextMarkType.xref === mark.type ||\n TextMarkType.footnote === mark.type ||\n TextMarkType.footnoteStar === mark.type ||\n INLINE_MARK_TYPES.indexOf(mark.type) !== -1\n ) {\n inlineMarkWritten = true;\n } else {\n // Do nothing (NOTE: link is handled in writeText)\n }\n }\n // Write the mark end\n if (inlineMarkWritten) this.writeInlineMarkStartEnd();\n }\n }\n }\n }\n\n protected writeParagraph(node: TextNode): void {\n // Write paragraph marker for bitmark++\n if (this.textFormat === TextFormat.bitmarkText) {\n // Do not write a paragraph marker when in a bullet list\n if (this.inBulletList) return;\n\n // Do not write a paragraph marker for the first node if it is a paragraph - it is implicit\n // (unless it is empty, or an empty string)\n // This is a nasty look-ahead but otherwise the entire paragraph block would need to be written before\n // determining if it is the first node and if it is empty\n const nodeContentLength = node.content?.length ?? 0;\n if (this.nodeIndex === 0) {\n if (nodeContentLength === 1) {\n const isTextNode = node.content?.[0].type === TextNodeType.text;\n const text = node.content?.[0].text ?? '';\n if (!isTextNode || text !== '') return;\n }\n if (nodeContentLength > 1) return;\n }\n\n this.write('|');\n this.writeNL();\n if (this.exitedCodeBlock) {\n // Write an extra newline after a code block\n this.writeNL();\n }\n }\n }\n\n protected writeHardBreak(_node: TextNode): void {\n this.writeNL();\n\n // Apply any required indentation (when in list)\n if (this.currentIndent > 1) {\n const indentationString = this.getIndentationString();\n this.write(indentationString);\n }\n }\n\n protected writeHeading(node: HeadingTextNode): void {\n let s = '';\n const level = node.attrs?.level ?? 1;\n for (let i = 0; i < +level; i++) s += HEADING_TAG;\n\n s += ' ';\n\n // Write the heading tag\n this.write(s);\n }\n\n protected writeSection(node: SectionTextNode): void {\n let s = '';\n if (node.section) {\n s = `|${node.section}: `;\n } else {\n s = '|';\n }\n\n // Write the section tag\n this.write(s);\n }\n\n protected writeBullet(node: TextNode, route: NodeInfo[]) {\n // if (node.attrs == null || !node.attrs.start) return;\n // const attrs = node.attrs;\n\n // const s = `|code:${attrs.language}\\n`;\n\n // Add indentation\n let bullet = this.getIndentationString();\n const listParent = this.getParentNode(route, 2);\n const listParentNode: ListTextNode | undefined = listParent?.value;\n const listType = listParentNode?.type;\n const start = listParentNode?.attrs?.start ?? 1;\n\n // Add bullet\n if (listType === TextNodeType.bulletList) {\n bullet += '• ';\n } else if (listType === TextNodeType.noBulletList) {\n bullet += '•_ ';\n } else if (listType === TextNodeType.orderedList) {\n bullet += `•${start} `;\n } else if (listType === TextNodeType.orderedListRoman) {\n bullet += `•${start}I `;\n } else if (listType === TextNodeType.orderedListRomanLower) {\n bullet += `•${start}i `;\n } else if (listType === TextNodeType.letteredList) {\n bullet += '•A ';\n } else if (listType === TextNodeType.letteredListLower) {\n bullet += '•a ';\n } else if (listType === TextNodeType.taskList) {\n const taskList = node as TaskItemTextNode;\n const checked = taskList.attrs?.checked ?? false;\n bullet += checked ? '•+ ' : '•- ';\n }\n if (bullet) this.write(bullet);\n }\n\n protected writeImage(node: ImageTextNode | ImageInlineTextNode): void {\n if (node.attrs == null || !node.attrs.src) return;\n const attrs = node.attrs;\n\n const inlineImage = node.type === TextNodeType.imageInline;\n\n const mediaAttrs = this.getMediaAttrs(inlineImage ? 'imageInline' : 'image', attrs, {\n ignoreAttributes: inlineImage ? new Set(['alt', 'zoomDisabled', 'title']) : undefined,\n });\n\n let s = '';\n if (inlineImage) {\n s = `==${attrs.alt ?? ''}==`;\n }\n s += mediaAttrs ? `|${mediaAttrs}|` : '';\n\n // Write the text\n this.write(s);\n }\n\n protected writeCodeBlock(node: CodeBlockTextNode): void {\n if (node.attrs == null || !node.attrs.language) return;\n const attrs = node.attrs;\n\n const s = `|code:${attrs.language}\\n`;\n\n // Write the text\n this.write(s);\n }\n\n protected writeLatex(node: LatexTextNode): void {\n if (node.attrs == null || !node.attrs.formula) return;\n const attrs = node.attrs;\n\n const formula = this.breakscape(attrs.formula, {\n format: this.textFormat,\n location: this.textLocation,\n });\n\n const s = `==${formula}==|latex|`;\n\n // Write the text\n this.write(s);\n }\n\n protected writeMarkTextWrapper(s: string) {\n if (s) this.write(s);\n }\n\n protected writeInlineMark(mark: TextMark) {\n let s = `${mark.type}`;\n if (mark.attrs) {\n for (const [k, v] of Object.entries(mark.attrs)) {\n if (\n (k === 'language' && v !== 'plain text') ||\n k === 'color' ||\n k === 'name' ||\n k === 'duration'\n ) {\n s = `${s}:${v}`;\n }\n }\n }\n this.write(s);\n }\n\n protected writeCommentMark(mark: CommentMark) {\n const comment = mark.comment || '';\n\n const s = `#${comment}`;\n this.write(s);\n }\n\n protected writeLinkMark(mark: LinkMark) {\n const href = mark.attrs?.href || '';\n\n // Apply link breakscaping\n const linkText = (href ?? '').replace(LINK_BREAKSCAPE_REGEX, '^]');\n\n const s = `link:${linkText}`;\n this.write(s);\n }\n\n protected writeRefMark(mark: RefMark) {\n const ref = mark.attrs?.reference ?? '';\n\n const s = `►${ref}`;\n this.write(s);\n }\n\n protected writeXRefMark(mark: XRefMark) {\n const xref = mark.attrs?.xref ?? '';\n const ref = mark.attrs?.reference ?? '';\n\n let s = `xref:${xref}`;\n if (ref) s += `|►${ref}`;\n this.write(s);\n }\n\n protected writeExtRefMark(mark: ExtRefMark) {\n const extref = mark.attrs?.extref ?? '';\n const refs = mark.attrs?.references ?? [];\n const provider = mark.attrs?.provider ?? '';\n\n let s = `extref:${extref}`;\n for (const ref of refs) {\n s += `|►${ref ?? ''}`;\n }\n s += `|provider:${provider}`;\n\n this.write(s);\n }\n\n protected writeFootnoteMark(_mark: FootnoteMark) {\n const s = `footnote:`;\n this.write(s);\n }\n\n protected writeFootnoteStarMark(_mark: FootnoteMark) {\n const s = `footnote*:`;\n this.write(s);\n }\n\n protected writeSymbolMark(mark: SymbolMark) {\n if (mark.attrs == null) return;\n const attrs = mark.attrs;\n\n const mediaAttrs = this.getMediaAttrs('symbol', attrs);\n const s = mediaAttrs ?? '';\n\n // Write the text\n this.write(s);\n }\n\n protected writeInlineMarkStartEnd() {\n this.write('|');\n }\n\n protected writePlainTextDivider(): void {\n this.write('==== text ====');\n }\n\n protected writeString(s?: string): void {\n if (s != null) this.write(`${s}`);\n }\n\n protected writeNL(): void {\n if (this.options.debugGenerationInline) {\n this.write('\\\\n');\n return;\n }\n this.write('\\n');\n }\n\n protected writeInlineDebug(\n key: string,\n state: { open?: boolean; close?: boolean; single?: boolean },\n ) {\n let tag = key;\n if (state.open) {\n tag = `<${key}>`;\n } else if (state.close) {\n tag = `</${key}>`;\n } else if (state.single) {\n tag = `<${key} />`;\n }\n\n this.writeString(tag);\n }\n\n protected getMediaAttrs(\n mediaType: string,\n attrs: MediaAttributes,\n options?: MediaAttributeOptions,\n ): string | undefined {\n if (!mediaType) return undefined;\n\n const opts = Object.assign({}, options);\n const ignoreAttributes = opts.ignoreAttributes ?? new Set();\n\n let s = `${mediaType}:${attrs?.src ?? ''}`;\n\n // Loop and write the attributes (except src, as written above)\n const entries = Object.entries(attrs).filter(([k, _v]) => k !== 'src');\n\n for (let i = 0; i < entries.length; i++) {\n const [k, v] = entries[i];\n\n // Ignore certain attributes\n if (ignoreAttributes.has(k)) continue;\n\n switch (k) {\n case 'textAlign':\n if (v !== 'left') s += `|captionAlign:${v}`;\n break;\n case 'alignment':\n if (v !== 'center') if (v) s += `|alignment:${v}`;\n break;\n case 'title':\n if (v) s += `|caption:${v}`;\n break;\n case 'class':\n if (v !== 'center') if (v) s += `|align:${v}`;\n break;\n case 'comment':\n if (v) s += `|#${v}`;\n break;\n case '':\n // This case handles reverse of strange behaviour in the text parser when a key is empty\n if (StringUtils.isString(v)) s += `|:${v}`;\n else s += `|`;\n break;\n case 'zoomDisabled':\n if (!v) s += '|zoomDisabled:false';\n break;\n case 'alt':\n case 'width':\n case 'height':\n default:\n if (k && v) s += `|${k}:${v}`;\n break;\n }\n }\n\n return s;\n }\n\n //\n // Helper functions\n //\n\n protected breakscape(s: string, options: BreakscapeOptions): string {\n if (this.generateOptions.noBreakscaping) return s;\n return Breakscape.breakscape(s, options);\n }\n\n protected getBitType(route: NodeInfo[]): BitTypeType | undefined {\n for (const node of route) {\n if (node.key === NodeType.bitsValue) {\n const n = node.value as Bit;\n return n?.bitType;\n }\n }\n\n return undefined;\n }\n\n //\n // Writer interface\n //\n\n /**\n * Writes a string value to the output.\n * @param value - The string value to be written.\n */\n write(value: string): this {\n // Handle case where the already written text, combined with this text, would create an unwanted control\n // sequence, e.g. old* **new**. In this case, a ^ is inserted to break the sequence.\n value = this.getInterTextBreakscape(value) + value;\n\n if (this.options.writeCallback) {\n this.options.writeCallback(value);\n }\n this.writerText += value;\n\n // for debugging console.log(this.writerText);\n\n return this;\n }\n\n /**\n * Writes a new line to the output. The line is indented automatically. The line is ended with the endOfLineString.\n * @param value - The line to write. When omitted, only the endOfLineString is written.\n */\n writeLine(value?: string): this {\n this.write(`${value}\\n`);\n return this;\n }\n\n /**\n * Writes a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString.\n * @param values - The lines to write.\n * @param delimiter - An optional delimiter to be written at the end of each line, except for the last one.\n */\n writeLines(values: string[], delimiter?: string): this {\n for (const value of values) {\n this.write(`${value}${delimiter ?? ''}\\n`);\n }\n return this;\n }\n\n /**\n * Writes a single whitespace character to the output.\n */\n writeWhiteSpace(): this {\n this.write(' ');\n return this;\n }\n}\n\nexport { TextGenerator };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst BitmarkVersion = superenum({\n v2: 2,\n v3: 3,\n});\n\nexport type BitmarkVersionType = EnumType<typeof BitmarkVersion>;\n\nconst DEFAULT_BITMARK_VERSION = BitmarkVersion.v3;\n\nexport { BitmarkVersion, DEFAULT_BITMARK_VERSION };\n","import { Ast, type AstWalkCallbacks, type NodeInfo } from '../ast/Ast.ts';\nimport { type Generator } from './Generator.ts';\n\n/**\n * Generator that walks bitmark AST.\n *\n * The implementation should implement functions with the correct naming, and these will be called when\n * walking the AST:\n *\n * enter_<nodeKey>() - called when entering a branch node\n * between_<nodeKey>() - called when between child nodes\n * exit_<nodeKey>() - called when exiting a branch node\n * leaf_<nodeKey>() - called when entering a leaf node\n */\nabstract class AstWalkerGenerator<AstType, R, Context = undefined>\n implements Generator<AstType, R>, AstWalkCallbacks<Context>\n{\n protected ast = new Ast();\n\n // Debugging\n protected debugGenerationInline = false;\n protected printed = false;\n\n public abstract generate(ast: AstType, param1?: unknown, param2?: unknown): Promise<R>;\n\n public abstract generateSync(ast: AstType, param1?: unknown, param2?: unknown): R;\n\n enter(node: NodeInfo, route: NodeInfo[], context: Context): boolean | void {\n let res: boolean | void = void 0;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gen = this as any;\n const funcName = `enter_${node.key}`;\n\n if (!this.printed) {\n this.printed = true;\n }\n\n if (this.debugGenerationInline) this.writeInlineDebug(node.key, { open: true });\n\n if (typeof gen[funcName] === 'function') {\n res = gen[funcName](node, route, context);\n }\n\n return res;\n }\n\n between(\n node: NodeInfo,\n left: NodeInfo,\n right: NodeInfo,\n route: NodeInfo[],\n context: Context,\n ): boolean | void {\n let res: boolean | void = void 0;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gen = this as any;\n const funcName = `between_${node.key}`;\n\n if (this.debugGenerationInline) this.writeInlineDebug(node.key, { single: true });\n\n if (typeof gen[funcName] === 'function') {\n res = gen[funcName](node, left, right, route, context);\n }\n\n return res;\n }\n\n exit(node: NodeInfo, route: NodeInfo[], context: Context): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gen = this as any;\n const funcName = `exit_${node.key}`;\n\n if (this.debugGenerationInline) this.writeInlineDebug(node.key, { close: true });\n\n if (typeof gen[funcName] === 'function') {\n gen[funcName](node, route, context);\n }\n }\n\n leaf(node: NodeInfo, route: NodeInfo[], context: Context): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gen = this as any;\n const funcName = `leaf_${node.key}`;\n\n if (this.debugGenerationInline) this.writeInlineDebug(node.key, { open: true });\n\n if (typeof gen[funcName] === 'function') {\n gen[funcName](node, route, context);\n }\n\n if (this.debugGenerationInline) this.writeInlineDebug(node.key, { close: true });\n }\n\n //\n // HELPER FUNCTIONS\n //\n\n protected getParentNode(route: NodeInfo[], nodesBack = 1): NodeInfo | undefined {\n // if (route.length > nodesBack + 1) {\n // return route[route.length - nodesBack - 1];\n // }\n if (route.length > nodesBack) {\n return route[route.length - nodesBack - 1];\n }\n\n return undefined;\n }\n //\n // WRITER FUNCTIONS\n //\n\n protected abstract writeInlineDebug(\n key: string,\n state: { open?: boolean; close?: boolean; single?: boolean },\n ): void;\n}\n\nexport { AstWalkerGenerator };\n","// @generated by Peggy 5.0.5.\n//\n// https://peggyjs.org/\n\nimport { Breakscape } from \"../../../breakscaping/Breakscape.ts\";\n\n\n\n\nconst VERSION = \"8.34.3\"\n\n//Parser peggy.js\n\n// parser options (parameter when running parser):\n// allowedStartRules: [\"bitmarkPlusPlus\", \"bitmarkPlus\", \"bitmarkMinusMinus\", \"bitmarkPlusString\", \"bitmarkMinusMinusString\"]\n\n// The start rules ending in \"String\" are for internal use only.\n// The public rules return a full StyledText object. This means things got consitent to handle. However, this means, there is always at least one block (a paragraph in case of bitmark+ and bitmark--) present.\n\n// Todos\n\n// - JSON for color\n\n// - LaTeX embed\n// The formula == \\\\left( x | y \\\\right) ==|latex| is inline.\n\n/*\n\nEmpty StyledString\n\n[{ \"type\": \"text\", \"text\": \"\" }] // NOK - TipTap Error\n[{ \"type\": \"text\"}] // NOK - TipTap Error\n[] - OK\n\nEmpty StyledText\n\n[{ \"type\": \"paragraph\", \"content\": [] }] // OK\n[{ \"type\": \"paragraph\" }] // OK\n[] // OK - preferred\n\n*/\n\n/*\n\n# Hallo\n\nHier kommt...\n\nAlex\n\n|\n\n## Vorhang auf!\n\n• Eins\n• Zwei\n\t•1 Num 1 ==inline code==|code:javascript|\n\t•1 Num 2\n\tSecond Line\n• Three\n\t•A Sub Three\n\t•A More Sub Three\n\n\n•+ Milk\n•+ Cheese\n•- Wine\n\n\n|image:https://apple.com|width:300|height: 400|\n\ntext ==alt text of the inline image==|image:https://img.io/img.svg|width:400|height:200|#comment| more text\n\n|code: javascript\n\nlet a = 3\nlet b = 4\n\nlet c = a + b\n\n|^code: js\n\n\n|\n\nDas war's ==1==|footnote:So long and **thanks for all the fish**|\n\n */\n\n\n\n\n\n// global initializer\n// global utility functions\n\n\nfunction s(_string) {\n return _string ?? \"\"\n}\n\nfunction legacyContextAwarewUnbreakscape(_str) {\n\tlet u_ = _str || \"\"\n\n\tfunction replacer(match, p1, offset, string, groups) {\n \t\treturn match.replace(\"^\", \"\");\n\t}\n\n let re_ = new RegExp( /=\\^(\\^*)(?==)|\\*\\^(\\^*)(?=\\*)|_\\^(\\^*)(?=_)|`\\^(\\^*)(?=`)|!\\^(\\^*)(?=!)|\\[\\^(\\^*)|•\\^(\\^*)|#\\^(\\^*)|\\|\\^(\\^*)|\\|\\^(\\^*)/, \"g\") // RegExp( /([\\[*_`!])\\^(?!\\^)/, \"g\")\n\n u_ = u_.replace(re_, replacer)\n\n return u_\n}\n\nfunction unbreakscape(str) {\n if (typeof str !== 'string') return null;\n // return str.replace(/\\^+/g, run => run.slice(1));\n\n return Breakscape.unbreakscape(str);\n}\n\nfunction removeTempParsingParent(obj) {\n if (obj && typeof obj === 'object') {\n delete obj._tempParsingParent; // Remove temp property if exists\n delete obj._tempListStart; // Remove temp property if exists\n\n Object.keys(obj).forEach(key => {\n // Recursively call the function for all sub-objects\n removeTempParsingParent(obj[key]);\n });\n }\n}\n\n// function cleanEmptyTextNodes(node) {\n// debugger;\n// if (Array.isArray(node)) {\n// return node.map(cleanEmptyTextNodes);\n// }\n// if (node !== null && typeof node === 'object') {\n// const hasType = Object.prototype.hasOwnProperty.call(node, 'type');\n// const hasContent = Object.prototype.hasOwnProperty.call(node, 'content');\n// const result = {};\n\n// for (const [key, value] of Object.entries(node)) {\n// if (key === 'content' && hasType && hasContent && Array.isArray(value)) {\n// // filter out items where item.text === \"\"\n// const filtered = value.filter(item =>\n// !(item && typeof item === 'object' && 'text' in item && item.text === '')\n// );\n// result[key] = filtered.map(cleanEmptyTextNodes);\n\n// } else if (Array.isArray(value)) {\n// result[key] = value.map(cleanEmptyTextNodes);\n\n// } else {\n// result[key] = cleanEmptyTextNodes(value);\n// }\n// }\n\n// return result;\n// }\n// return node;\n// }\n\n/**\n * RAS 2025-05-22\n * Fixes / features\n * - Handles arrays or objects as input (including root array) - main reason for change\n * - Modifies in-place rather than copying array.\n * - Removed some unnecessary checks - will work fine without them\n */\nfunction cleanEmptyTextNodes(root) {\n const isEmptyTextNode = (n) => n && n.type === \"text\" && !n.text;\n\n // Recursively walk 'content' arrays\n function cleanContentArray(arr) {\n for (let i = arr.length - 1; i >= 0; i--) {\n const item = arr[i];\n\n if (isEmptyTextNode(item)) {\n // drop the empty text node\n arr.splice(i, 1);\n } else if (item && Array.isArray(item.content)) {\n // recurse into `content` array\n cleanContentArray(item.content);\n }\n // Any other shape is ignored.\n }\n }\n\n if (Array.isArray(root)) {\n cleanContentArray(root);\n } else if (root && Array.isArray(root.content)) {\n cleanContentArray(root.content);\n }\n\n return root;\n}\n\nfunction bitmarkPlusPlus(_str) {\n\n // if (parser) {\n // \treturn parser.parse(_str, { startRule: \"bitmarkPlusPlus\" })\n // } else {\n // // embedded in Get More Brain\n // return parse(_str, { startRule: \"bitmarkPlusPlus\" })\n // }\n if (typeof parser !== 'undefined') {\n \treturn parser.parse(_str, { startRule: \"bitmarkPlusPlus\" })\n }\n return peg$parse(_str, { startRule: \"bitmarkPlusPlus\" })\n}\n\nfunction bitmarkPlusString(_str) {\n\n // if (parser) {\n // \treturn parser.parse(_str, { startRule: \"bitmarkPlusString\" })\n // } else {\n // // embedded in Get More Brain\n // return parse(_str, { startRule: \"bitmarkPlusString\" })\n // }\n if (typeof parser !== 'undefined') {\n return parser.parse(_str, { startRule: \"bitmarkPlusString\" })\n }\n return peg$parse(_str, { startRule: \"bitmarkPlusString\" })\n}\n\nfunction bitmarkMinusMinusString(_str) {\n\n // if (parser) {\n // \treturn parser.parse(_str, { startRule: \"bitmarkMinusMinusString\" })\n // } else {\n // // embedded in Get More Brain\n // return parse(_str, { startRule: \"bitmarkMinusMinusString\" })\n // }\n if (typeof parser !== 'undefined') {\n \treturn parser.parse(_str, { startRule: \"bitmarkMinusMinusString\" })\n }\n return peg$parse(_str, { startRule: \"bitmarkMinusMinusString\" })\n}\n\n\nclass peg$SyntaxError extends SyntaxError {\n constructor(message, expected, found, location) {\n super(message);\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n }\n\n format(sources) {\n let str = \"Error: \" + this.message;\n if (this.location) {\n let src = null;\n const st = sources.find(s => s.source === this.location.source);\n if (st) {\n src = st.text.split(/\\r\\n|\\n|\\r/g);\n }\n const s = this.location.start;\n const offset_s = (this.location.source && (typeof this.location.source.offset === \"function\"))\n ? this.location.source.offset(s)\n : s;\n const loc = this.location.source + \":\" + offset_s.line + \":\" + offset_s.column;\n if (src) {\n const e = this.location.end;\n const filler = \"\".padEnd(offset_s.line.toString().length, \" \");\n const line = src[s.line - 1];\n const last = s.line === e.line ? e.column : line.length + 1;\n const hatLen = (last - s.column) || 1;\n str += \"\\n --> \" + loc + \"\\n\"\n + filler + \" |\\n\"\n + offset_s.line + \" | \" + line + \"\\n\"\n + filler + \" | \" + \"\".padEnd(s.column - 1, \" \")\n + \"\".padEnd(hatLen, \"^\");\n } else {\n str += \"\\n at \" + loc;\n }\n }\n return str;\n }\n\n static buildMessage(expected, found) {\n function hex(ch) {\n return ch.codePointAt(0).toString(16).toUpperCase();\n }\n\n const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, \"unicode\")\n ? new RegExp(\"[\\\\p{C}\\\\p{Mn}\\\\p{Mc}]\", \"gu\")\n : null;\n function unicodeEscape(s) {\n if (nonPrintable) {\n return s.replace(nonPrintable, ch => \"\\\\u{\" + hex(ch) + \"}\");\n }\n return s;\n }\n\n function literalEscape(s) {\n return unicodeEscape(s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, \"\\\\\\\"\")\n .replace(/\\0/g, \"\\\\0\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/[\\x00-\\x0F]/g, ch => \"\\\\x0\" + hex(ch))\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, ch => \"\\\\x\" + hex(ch)));\n }\n\n function classEscape(s) {\n return unicodeEscape(s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\]/g, \"\\\\]\")\n .replace(/\\^/g, \"\\\\^\")\n .replace(/-/g, \"\\\\-\")\n .replace(/\\0/g, \"\\\\0\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/[\\x00-\\x0F]/g, ch => \"\\\\x0\" + hex(ch))\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, ch => \"\\\\x\" + hex(ch)));\n }\n\n const DESCRIBE_EXPECTATION_FNS = {\n literal(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n class(expectation) {\n const escapedParts = expectation.parts.map(\n part => (Array.isArray(part)\n ? classEscape(part[0]) + \"-\" + classEscape(part[1])\n : classEscape(part))\n );\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts.join(\"\") + \"]\" + (expectation.unicode ? \"u\" : \"\");\n },\n\n any() {\n return \"any character\";\n },\n\n end() {\n return \"end of input\";\n },\n\n other(expectation) {\n return expectation.description;\n },\n };\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n const descriptions = expected.map(describeExpectation);\n descriptions.sort();\n\n if (descriptions.length > 0) {\n let j = 1;\n for (let i = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n }\n}\n\nfunction peg$parse(input, options) {\n options = options !== undefined ? options : {};\n\n const peg$FAILED = {};\n const peg$source = options.grammarSource;\n\n const peg$startRuleFunctions = {\n version: peg$parseversion,\n bitmarkPlusPlus: peg$parsebitmarkPlusPlus,\n bitmarkPlus: peg$parsebitmarkPlus,\n bitmarkMinusMinus: peg$parsebitmarkMinusMinus,\n bitmarkPlusString: peg$parsebitmarkPlusString,\n bitmarkMinusMinusString: peg$parsebitmarkMinusMinusString,\n };\n let peg$startRuleFunction = peg$parseversion;\n\n const peg$c0 = \"|\";\n const peg$c1 = \"### \";\n const peg$c2 = \"## \";\n const peg$c3 = \"# \";\n const peg$c4 = \"code\";\n const peg$c5 = \":\";\n const peg$c6 = \"bitmark++\";\n const peg$c7 = \"bitmark--\";\n const peg$c8 = \"JavaScript\";\n const peg$c9 = \"\\u2022 \";\n const peg$c10 = \"\\u2022_ \";\n const peg$c11 = \"\\u2022\";\n const peg$c12 = \" \";\n const peg$c13 = \"I \";\n const peg$c14 = \"i \";\n const peg$c15 = \"\\u2022A \";\n const peg$c16 = \"\\u2022a \";\n const peg$c17 = \"\\u2022+ \";\n const peg$c18 = \"\\u2022- \";\n const peg$c19 = \"\\t\";\n const peg$c20 = \"image\";\n const peg$c21 = \"#\";\n const peg$c22 = \"@\";\n const peg$c23 = \"width\";\n const peg$c24 = \"height\";\n const peg$c25 = \"alignment\";\n const peg$c26 = \"captionAlign\";\n const peg$c27 = \"left\";\n const peg$c28 = \"center\";\n const peg$c29 = \"right\";\n const peg$c30 = \"alt\";\n const peg$c31 = \"caption\";\n const peg$c32 = \"zoomDisabled\";\n const peg$c33 = \"true\";\n const peg$c34 = \"false\";\n const peg$c35 = \"=\";\n const peg$c36 = \"|latex|\";\n const peg$c37 = \"|imageInline:\";\n const peg$c38 = \"alignmentVertical\";\n const peg$c39 = \"size\";\n const peg$c40 = \"top\";\n const peg$c41 = \"middle\";\n const peg$c42 = \"bottom\";\n const peg$c43 = \"baseline\";\n const peg$c44 = \"sub\";\n const peg$c45 = \"super\";\n const peg$c46 = \"text-bottom\";\n const peg$c47 = \"text-top\";\n const peg$c48 = \"line-height\";\n const peg$c49 = \"font-height\";\n const peg$c50 = \"explicit\";\n const peg$c51 = \"link:\";\n const peg$c52 = \"extref:\";\n const peg$c53 = \"provider:\";\n const peg$c54 = \"xref:\";\n const peg$c55 = \"\\u25BA\";\n const peg$c56 = \"symbol:\";\n const peg$c57 = \"footnote:\";\n const peg$c58 = \"footnote*:\";\n const peg$c59 = \"var:\";\n const peg$c60 = \"code:\";\n const peg$c61 = \"timer\";\n const peg$c62 = \"timer:\";\n const peg$c63 = \"duration:\";\n const peg$c64 = \"P\";\n const peg$c65 = \"color:\";\n const peg$c66 = \"|\\u25BA\";\n const peg$c67 = \"bold\";\n const peg$c68 = \"italic\";\n const peg$c69 = \"light\";\n const peg$c70 = \"highlight\";\n const peg$c71 = \"strike\";\n const peg$c72 = \"subscript\";\n const peg$c73 = \"superscript\";\n const peg$c74 = \"ins\";\n const peg$c75 = \"del\";\n const peg$c76 = \"underline\";\n const peg$c77 = \"doubleUnderline\";\n const peg$c78 = \"circle\";\n const peg$c79 = \"languageEmRed\";\n const peg$c80 = \"languageEmOrange\";\n const peg$c81 = \"languageEmYellow\";\n const peg$c82 = \"languageEmGreen\";\n const peg$c83 = \"languageEmBlue\";\n const peg$c84 = \"languageEmPurple\";\n const peg$c85 = \"languageEmPink\";\n const peg$c86 = \"languageEmBrown\";\n const peg$c87 = \"languageEmBlack\";\n const peg$c88 = \"languageEmWhite\";\n const peg$c89 = \"languageEmGray\";\n const peg$c90 = \"languageEm\";\n const peg$c91 = \"userUnderline\";\n const peg$c92 = \"userDoubleUnderline\";\n const peg$c93 = \"userStrike\";\n const peg$c94 = \"userCircle\";\n const peg$c95 = \"userHighlight\";\n const peg$c96 = \"notranslate\";\n const peg$c97 = \"aqua\";\n const peg$c98 = \"black\";\n const peg$c99 = \"blue\";\n const peg$c100 = \"brown\";\n const peg$c101 = \"fuchsia\";\n const peg$c102 = \"lightgrey\";\n const peg$c103 = \"gray\";\n const peg$c104 = \"darkgray\";\n const peg$c105 = \"green\";\n const peg$c106 = \"lime\";\n const peg$c107 = \"magenta\";\n const peg$c108 = \"maroon\";\n const peg$c109 = \"navy\";\n const peg$c110 = \"olive\";\n const peg$c111 = \"orange\";\n const peg$c112 = \"pink\";\n const peg$c113 = \"purple\";\n const peg$c114 = \"red\";\n const peg$c115 = \"silver\";\n const peg$c116 = \"teal\";\n const peg$c117 = \"violet\";\n const peg$c118 = \"white\";\n const peg$c119 = \"yellow\";\n const peg$c120 = \"*\";\n const peg$c121 = \"_\";\n const peg$c122 = \"`\";\n const peg$c123 = \"!\";\n const peg$c124 = \"[!\";\n const peg$c125 = \"]\";\n const peg$c126 = \"\\n\";\n const peg$c127 = \"\\r\\n\";\n const peg$c128 = \"http\";\n const peg$c129 = \"s\";\n const peg$c130 = \"://\";\n const peg$c131 = \"mailto:\";\n\n const peg$r0 = /^[ \\t]/;\n const peg$r1 = /^[0-9]/;\n const peg$r2 = /^[\\r\\u2028-\\u2029]/;\n const peg$r3 = /^[^\\n\\r\\u2028\\u2029]/;\n const peg$r4 = /^[!#-;=?-[\\]-_a-{}-~]/;\n\n const peg$e0 = peg$anyExpectation();\n const peg$e1 = peg$otherExpectation(\"StyledText\");\n const peg$e2 = peg$literalExpectation(\"|\", false);\n const peg$e3 = peg$literalExpectation(\"### \", false);\n const peg$e4 = peg$literalExpectation(\"## \", false);\n const peg$e5 = peg$literalExpectation(\"# \", false);\n const peg$e6 = peg$literalExpectation(\"code\", false);\n const peg$e7 = peg$classExpectation([\" \", \"\\t\"], false, false, false);\n const peg$e8 = peg$literalExpectation(\":\", false);\n const peg$e9 = peg$literalExpectation(\"bitmark++\", false);\n const peg$e10 = peg$literalExpectation(\"bitmark--\", false);\n const peg$e11 = peg$literalExpectation(\"JavaScript\", false);\n const peg$e12 = peg$literalExpectation(\"\\u2022 \", false);\n const peg$e13 = peg$literalExpectation(\"\\u2022_ \", false);\n const peg$e14 = peg$literalExpectation(\"\\u2022\", false);\n const peg$e15 = peg$classExpectation([[\"0\", \"9\"]], false, false, false);\n const peg$e16 = peg$literalExpectation(\" \", false);\n const peg$e17 = peg$literalExpectation(\"I \", false);\n const peg$e18 = peg$literalExpectation(\"i \", false);\n const peg$e19 = peg$literalExpectation(\"\\u2022A \", false);\n const peg$e20 = peg$literalExpectation(\"\\u2022a \", false);\n const peg$e21 = peg$literalExpectation(\"\\u2022+ \", false);\n const peg$e22 = peg$literalExpectation(\"\\u2022- \", false);\n const peg$e23 = peg$literalExpectation(\"\\t\", false);\n const peg$e24 = peg$literalExpectation(\"image\", false);\n const peg$e25 = peg$literalExpectation(\"#\", false);\n const peg$e26 = peg$literalExpectation(\"@\", false);\n const peg$e27 = peg$literalExpectation(\"width\", false);\n const peg$e28 = peg$literalExpectation(\"height\", false);\n const peg$e29 = peg$literalExpectation(\"alignment\", false);\n const peg$e30 = peg$literalExpectation(\"captionAlign\", false);\n const peg$e31 = peg$literalExpectation(\"left\", false);\n const peg$e32 = peg$literalExpectation(\"center\", false);\n const peg$e33 = peg$literalExpectation(\"right\", false);\n const peg$e34 = peg$literalExpectation(\"alt\", false);\n const peg$e35 = peg$literalExpectation(\"caption\", false);\n const peg$e36 = peg$literalExpectation(\"zoomDisabled\", false);\n const peg$e37 = peg$literalExpectation(\"true\", false);\n const peg$e38 = peg$literalExpectation(\"false\", false);\n const peg$e39 = peg$literalExpectation(\"=\", false);\n const peg$e40 = peg$literalExpectation(\"|latex|\", false);\n const peg$e41 = peg$literalExpectation(\"|imageInline:\", false);\n const peg$e42 = peg$literalExpectation(\"alignmentVertical\", false);\n const peg$e43 = peg$literalExpectation(\"size\", false);\n const peg$e44 = peg$literalExpectation(\"top\", false);\n const peg$e45 = peg$literalExpectation(\"middle\", false);\n const peg$e46 = peg$literalExpectation(\"bottom\", false);\n const peg$e47 = peg$literalExpectation(\"baseline\", false);\n const peg$e48 = peg$literalExpectation(\"sub\", false);\n const peg$e49 = peg$literalExpectation(\"super\", false);\n const peg$e50 = peg$literalExpectation(\"text-bottom\", false);\n const peg$e51 = peg$literalExpectation(\"text-top\", false);\n const peg$e52 = peg$literalExpectation(\"line-height\", false);\n const peg$e53 = peg$literalExpectation(\"font-height\", false);\n const peg$e54 = peg$literalExpectation(\"explicit\", false);\n const peg$e55 = peg$literalExpectation(\"link:\", false);\n const peg$e56 = peg$literalExpectation(\"extref:\", false);\n const peg$e57 = peg$literalExpectation(\"provider:\", false);\n const peg$e58 = peg$literalExpectation(\"xref:\", false);\n const peg$e59 = peg$literalExpectation(\"\\u25BA\", false);\n const peg$e60 = peg$literalExpectation(\"symbol:\", false);\n const peg$e61 = peg$literalExpectation(\"footnote:\", false);\n const peg$e62 = peg$literalExpectation(\"footnote*:\", false);\n const peg$e63 = peg$literalExpectation(\"var:\", false);\n const peg$e64 = peg$literalExpectation(\"code:\", false);\n const peg$e65 = peg$literalExpectation(\"timer\", false);\n const peg$e66 = peg$literalExpectation(\"timer:\", false);\n const peg$e67 = peg$literalExpectation(\"duration:\", false);\n const peg$e68 = peg$literalExpectation(\"P\", false);\n const peg$e69 = peg$literalExpectation(\"color:\", false);\n const peg$e70 = peg$literalExpectation(\"|\\u25BA\", false);\n const peg$e71 = peg$literalExpectation(\"bold\", false);\n const peg$e72 = peg$literalExpectation(\"italic\", false);\n const peg$e73 = peg$literalExpectation(\"light\", false);\n const peg$e74 = peg$literalExpectation(\"highlight\", false);\n const peg$e75 = peg$literalExpectation(\"strike\", false);\n const peg$e76 = peg$literalExpectation(\"subscript\", false);\n const peg$e77 = peg$literalExpectation(\"superscript\", false);\n const peg$e78 = peg$literalExpectation(\"ins\", false);\n const peg$e79 = peg$literalExpectation(\"del\", false);\n const peg$e80 = peg$literalExpectation(\"underline\", false);\n const peg$e81 = peg$literalExpectation(\"doubleUnderline\", false);\n const peg$e82 = peg$literalExpectation(\"circle\", false);\n const peg$e83 = peg$literalExpectation(\"languageEmRed\", false);\n const peg$e84 = peg$literalExpectation(\"languageEmOrange\", false);\n const peg$e85 = peg$literalExpectation(\"languageEmYellow\", false);\n const peg$e86 = peg$literalExpectation(\"languageEmGreen\", false);\n const peg$e87 = peg$literalExpectation(\"languageEmBlue\", false);\n const peg$e88 = peg$literalExpectation(\"languageEmPurple\", false);\n const peg$e89 = peg$literalExpectation(\"languageEmPink\", false);\n const peg$e90 = peg$literalExpectation(\"languageEmBrown\", false);\n const peg$e91 = peg$literalExpectation(\"languageEmBlack\", false);\n const peg$e92 = peg$literalExpectation(\"languageEmWhite\", false);\n const peg$e93 = peg$literalExpectation(\"languageEmGray\", false);\n const peg$e94 = peg$literalExpectation(\"languageEm\", false);\n const peg$e95 = peg$literalExpectation(\"userUnderline\", false);\n const peg$e96 = peg$literalExpectation(\"userDoubleUnderline\", false);\n const peg$e97 = peg$literalExpectation(\"userStrike\", false);\n const peg$e98 = peg$literalExpectation(\"userCircle\", false);\n const peg$e99 = peg$literalExpectation(\"userHighlight\", false);\n const peg$e100 = peg$literalExpectation(\"notranslate\", false);\n const peg$e101 = peg$literalExpectation(\"aqua\", false);\n const peg$e102 = peg$literalExpectation(\"black\", false);\n const peg$e103 = peg$literalExpectation(\"blue\", false);\n const peg$e104 = peg$literalExpectation(\"brown\", false);\n const peg$e105 = peg$literalExpectation(\"fuchsia\", false);\n const peg$e106 = peg$literalExpectation(\"lightgrey\", false);\n const peg$e107 = peg$literalExpectation(\"gray\", false);\n const peg$e108 = peg$literalExpectation(\"darkgray\", false);\n const peg$e109 = peg$literalExpectation(\"green\", false);\n const peg$e110 = peg$literalExpectation(\"lime\", false);\n const peg$e111 = peg$literalExpectation(\"magenta\", false);\n const peg$e112 = peg$literalExpectation(\"maroon\", false);\n const peg$e113 = peg$literalExpectation(\"navy\", false);\n const peg$e114 = peg$literalExpectation(\"olive\", false);\n const peg$e115 = peg$literalExpectation(\"orange\", false);\n const peg$e116 = peg$literalExpectation(\"pink\", false);\n const peg$e117 = peg$literalExpectation(\"purple\", false);\n const peg$e118 = peg$literalExpectation(\"red\", false);\n const peg$e119 = peg$literalExpectation(\"silver\", false);\n const peg$e120 = peg$literalExpectation(\"teal\", false);\n const peg$e121 = peg$literalExpectation(\"violet\", false);\n const peg$e122 = peg$literalExpectation(\"white\", false);\n const peg$e123 = peg$literalExpectation(\"yellow\", false);\n const peg$e124 = peg$literalExpectation(\"*\", false);\n const peg$e125 = peg$literalExpectation(\"_\", false);\n const peg$e126 = peg$literalExpectation(\"`\", false);\n const peg$e127 = peg$literalExpectation(\"!\", false);\n const peg$e128 = peg$literalExpectation(\"[!\", false);\n const peg$e129 = peg$literalExpectation(\"]\", false);\n const peg$e130 = peg$otherExpectation(\"Line Terminator\");\n const peg$e131 = peg$literalExpectation(\"\\n\", false);\n const peg$e132 = peg$literalExpectation(\"\\r\\n\", false);\n const peg$e133 = peg$classExpectation([\"\\r\", [\"\\u2028\", \"\\u2029\"]], false, false, false);\n const peg$e134 = peg$classExpectation([\"\\n\", \"\\r\", \"\\u2028\", \"\\u2029\"], true, false, false);\n const peg$e135 = peg$literalExpectation(\"http\", false);\n const peg$e136 = peg$literalExpectation(\"s\", false);\n const peg$e137 = peg$literalExpectation(\"://\", false);\n const peg$e138 = peg$literalExpectation(\"mailto:\", false);\n const peg$e139 = peg$classExpectation([\"!\", [\"#\", \";\"], \"=\", [\"?\", \"[\"], [\"]\", \"_\"], [\"a\", \"{\"], [\"}\", \"~\"]], false, false, false);\n\n function peg$f0() { return VERSION }\n function peg$f1(b) { const cleaned_ = cleanEmptyTextNodes({ ...b }); return cleaned_ }\n function peg$f2(b) { let lb_ = { ...b }; removeTempParsingParent(lb_); const cleaned_ = cleanEmptyTextNodes(lb_); return cleaned_ }\n function peg$f3(b) { return { ...b } }\n function peg$f4(b) { return { ...b } }\n function peg$f5(b) { const cleaned_ = cleanEmptyTextNodes({ ...b }); return cleaned_ }\n function peg$f6() { return [] }\n function peg$f7(h, t) { return { type: \"heading\", content: bitmarkPlusString(t), attrs: { level: h.length - 1 } } }\n function peg$f8(t) { return t }\n function peg$f9(h, b) { return { ...h, content: b } }\n function peg$f10() { return { type: \"codeBlock\", language: \"\" } }\n function peg$f11(l) { return { type: \"codeBlock\", attrs: { language: l.trim().toLowerCase() } } }\n function peg$f12(c) { return [{ type: \"text\", text: unbreakscape(c.trim())}] }\n function peg$f13(t) { return t }\n function peg$f14(c, bl) { return { ...c, content: bl, attrs: {} } }\n function peg$f15(c, bl) { return { ...c, content: bl, attrs: {} } }\n function peg$f16(c, bl) { let start = bl[0]._tempListStart; return { ...c, attrs: { start }, content: bl } }\n function peg$f17(c, bl) { let start = bl[0]._tempListStart; return { ...c, attrs: { start }, content: bl } }\n function peg$f18(c, bl) { let start = bl[0]._tempListStart; return { ...c, attrs: { start }, content: bl } }\n function peg$f19(c, bl) { return { ...c, content: bl, attrs: {} } }\n function peg$f20(c, bl) { return { ...c, content: bl, attrs: {} } }\n function peg$f21(c, bl) { return { ...c, content: bl, attrs: {} } }\n function peg$f22() { return { type: \"bulletList\" } }\n function peg$f23() { return { type: \"noBulletList\" } }\n function peg$f24() { return { type: \"orderedList\" } }\n function peg$f25() { return { type: \"orderedListRoman\" } }\n function peg$f26() { return { type: \"orderedListRomanLower\" } }\n function peg$f27() { return { type: \"letteredList\" } }\n function peg$f28() { return { type: \"letteredListLower\" } }\n function peg$f29() { return { type: \"taskList\" } }\n function peg$f30(lt, listItem, lines, c) { return c }\n function peg$f31(lt, listItem, lines, children) {\n\n let _tempParsingParent = 'bulletList'\n\n const matchOrdered = lt.match(/•([0-9]+)([Ii]?) /)\n\n let start = 1\n\n if (matchOrdered) {\n _tempParsingParent = 'orderedList'\n if (matchOrdered.length > 1) {\n start = Number(matchOrdered[1])\n }\n\n if (matchOrdered.length > 2) {\n let roman = matchOrdered[2]\n\t\t\tif ('I' == roman) {\n\t\t\t\t_tempParsingParent = 'orderedListRoman'\n\t\t\t}\n\t\t\tif ('i' == roman) {\n\t\t\t\t_tempParsingParent = 'orderedListRomanLower'\n\t\t\t}\n }\n }\n\n if ('•_ ' == lt) {\n _tempParsingParent = 'noBulletList'\n }\n if ('•A ' == lt) {\n _tempParsingParent = 'letteredList'\n }\n\t if ('•a ' == lt) {\n _tempParsingParent = 'letteredListLower'\n }\n if ('•+ ' == lt || '•- ' == lt ) {\n _tempParsingParent = 'taskList'\n }\n\n\t let li = (listItem + lines.join(\"\")).trim()\n\n let item = {\n \ttype: \"paragraph\",\n\t\t attrs: {},\n\t\t content: bitmarkPlusString(li)\n }\n\n\t let content = [item]\n\n if (children && children[0] && children[0]._tempParsingParent) {\n\n let sublist = {\n type: children[0]._tempParsingParent,\n attrs: { start },\n content: children\n }\n\n if (sublist.type.startsWith(\"orderedList\") || sublist.type.startsWith(\"letteredList\")) {\n\t \tif (children[0]._tempListStart) {\n \tconst start = children[0]._tempListStart\n\t\t\t\tif (start > 1) sublist.attrs.start = start\n }\n }\n\n content.push(sublist)\n }\n\n let t = \"listItem\"\n let attrs = null\n\n if (\"taskList\" == _tempParsingParent) {\n t = \"taskItem\"\n let checked = false\n if ('•+ ' == lt) {\n checked = true\n }\n attrs = { checked }\n }\n\n const _tempListStart = start\n\n if (attrs) {\n return { type: t, attrs, content, _tempParsingParent, _tempListStart }\n } else {\n return { type: t, content, _tempParsingParent, _tempListStart }\n }\n }\n function peg$f32(ll) { return ll }\n function peg$f33(i) { return i.join(\"\") === indent }\n function peg$f34(i) { return i.length > indent.length }\n function peg$f35(i) { indentStack.push(indent); indent = i.join(\"\") }\n function peg$f36() { indent = indentStack.pop(); return true }\n function peg$f37(body) { return { type: \"paragraph\", content: bitmarkPlusString(body.trim()), attrs: { } } }\n function peg$f38(body) { return { type: \"paragraph\", content: bitmarkPlusString(body.trim()), attrs: { } } }\n function peg$f39(body) { return { type: \"paragraph\", content: bitmarkPlusString(body.trim()), attrs: { } } }\n function peg$f40(t) { return t }\n function peg$f41(t, u, ch) {\n\n const chain = Object.assign({}, ...ch)\n\n let imageAlignment_ = chain.alignment || \"center\"; delete chain.alignment\n let textAlign_ = chain.captionAlign || \"left\"; delete chain.captionAlign\n let alt_ = chain.alt || null; delete chain.alt\n let title_ = chain.caption || null; delete chain.caption\n let class_ = chain.align || \"center\"; delete chain.align\n let zoomDisabled_ = chain.zoomDisabled === undefined ? true\n \t: typeof chain.zoomDisabled === 'boolean' ? chain.zoomDisabled\n \t: String(chain.zoomDisabled).toLowerCase() === 'true'; delete chain.zoomDisabled\n\n let image = {\n type: t,\n attrs: {\n alignment: imageAlignment_,\n textAlign: textAlign_,\n src: u,\n alt: unbreakscape(alt_),\n title: unbreakscape(title_),\n class: class_,\n zoomDisabled: zoomDisabled_,\n ...chain\n }\n }\n\n return image\n }\n function peg$f42(ch) { return ch }\n function peg$f43(str) {return { comment: str.trim() } }\n function peg$f44(p, v) { return { [p]: parseInt(v) } }\n function peg$f45(p, v) { return { [p]: v.trim() } }\n function peg$f46(p, v) { return { [p]: v } }\n function peg$f47(p, v) { return { [p]: v } }\n function peg$f48(p) { return { [p]: true } }\n function peg$f49() { return }\n function peg$f50(p) { return { error: 'Found unknown property or invalid value: '+ p } }\n function peg$f51(bs) { return [ { type: 'paragraph', content: bs, attrs: { } } ] }\n function peg$f52(first, more) { const cleaned_ = cleanEmptyTextNodes(first ? [first, ...more.flat()] : more.flat()); return cleaned_ }\n function peg$f53() { return { \"type\": \"hardBreak\" } }\n function peg$f54(t) { return { text: unbreakscape(t), type: \"text\" } }\n function peg$f55(t) { return { index: +t, type: \"bit\" } }\n function peg$f56(t) { return { attrs: { formula: unbreakscape(t)}, type: \"latex\" } }\n function peg$f57(alt, u, ch) { return { attrs: { alt, src: (u.pr + u.t).trim(), ...Object.assign({}, ...ch), zoomDisabled: true }, type: \"imageInline\" } }\n function peg$f58(t, marks) { if (!marks) marks = []; return { marks, text: unbreakscape(t), type: \"text\" } }\n function peg$f59(t) { return { marks: [{type: \"bold\"}], text: unbreakscape(t), type: \"text\" } }\n function peg$f60(t) { return { marks: [{type: \"italic\"}], text: unbreakscape(t), type: \"text\" } }\n function peg$f61(t) { return { marks: [{type: \"light\"}], text: unbreakscape(t), type: \"text\" } }\n function peg$f62(t) { return { marks: [{type: \"highlight\"}], text: unbreakscape(t), type: \"text\" } }\n function peg$f63(u) { return { marks: [{ type: \"link\", attrs: { href: (u.pr + u.t).trim(), target: '_blank' } }], text: u.t, type: \"text\" } }\n function peg$f64(ch) { return ch }\n function peg$f65(ch) { return ch }\n function peg$f66(str) {return { comment: str } }\n function peg$f67(p, v) { return { [p]: parseInt(v) } }\n function peg$f68(p, v) { return { type: \"error\", msg: p + ' must be a positive integer.', found: v } }\n function peg$f69(p, v) { return { [p]: v } }\n function peg$f70(p, v) { return { [p]: v } }\n function peg$f71(str) {return { type: 'link', attrs: { href: str.trim(), target: '_blank' } } }\n function peg$f72(str, rc, p) {return { type: 'extref', attrs: { extref: str.trim(), references: rc, provider: p.trim() } } }\n function peg$f73(str, str2) {return { type: 'xref', attrs: { xref: str.trim(), reference: str2.trim() } } }\n function peg$f74(str) {return { type: 'xref', attrs: { xref: str.trim(), reference: '' } } }\n function peg$f75(str) {return { type: 'ref', attrs: { reference: str.trim() } } }\n function peg$f76(str, ch) {const chain = Object.assign({}, ...ch); return { type: 'symbol', attrs: { src: str.trim(), ...chain } } }\n function peg$f77(str) {return { type: 'footnote', attrs: { content: bitmarkPlusString(str.trim()) } } }\n function peg$f78(str) {return { type: 'footnote*', attrs: { content: bitmarkPlusString(str.trim()) } } }\n function peg$f79(str) {return { type: 'var', attrs: { name: str.trim() } } }\n function peg$f80() {return { type: 'code', attrs: { language: \"plain text\" } } }\n function peg$f81(lang) {return { type: 'code', attrs: { language: lang.trim().toLowerCase() } } }\n function peg$f82() {return { type: 'timer', attrs: { name: \"\" } } }\n function peg$f83(str) {return { type: 'timer', attrs: { name: str.trim() } } }\n function peg$f84(str) {return { type: 'duration', attrs: { duration: str } } }\n function peg$f85(color) {return { type: 'color', attrs: { color } } }\n function peg$f86(style) {return { type: style } }\n function peg$f87(str) {return { type: \"comment\", comment: str } }\n function peg$f88(r) { return r.trim() }\n function peg$f89(bs) { return [ { type: 'paragraph', content: bs, attrs: { } } ] }\n function peg$f90(first, more) { const cleaned_ = cleanEmptyTextNodes(first ? [first, ...more.flat()] : more.flat()); return cleaned_ }\n function peg$f91() { return { \"type\": \"hardBreak\" } }\n function peg$f92(t) { return { text: unbreakscape(t), type: \"text\" } }\n function peg$f93(t) { return { index: +t, type: \"bit\" } }\n function peg$f94(t) { return { marks: [{type: \"bold\"}], text: unbreakscape(t), type: \"text\" } }\n function peg$f95(t) { return { marks: [{type: \"italic\"}], text: unbreakscape(t), type: \"text\" } }\n function peg$f96(t) { return { marks: [{type: \"light\"}], text: unbreakscape(t), type: \"text\" } }\n function peg$f97(t) { return { marks: [{type: \"highlight\"}], text: unbreakscape(t), type: \"text\" } }\n function peg$f98(pr, t) { return { pr, t} }\n let peg$currPos = options.peg$currPos | 0;\n let peg$savedPos = peg$currPos;\n const peg$posDetailsCache = [{ line: 1, column: 1 }];\n let peg$maxFailPos = peg$currPos;\n let peg$maxFailExpected = options.peg$maxFailExpected || [];\n let peg$silentFails = options.peg$silentFails | 0;\n\n let peg$result;\n\n if (options.startRule) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function offset() {\n return peg$savedPos;\n }\n\n function range() {\n return {\n source: peg$source,\n start: peg$savedPos,\n end: peg$currPos,\n };\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== undefined\n ? location\n : peg$computeLocation(peg$savedPos, peg$currPos);\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== undefined\n ? location\n : peg$computeLocation(peg$savedPos, peg$currPos);\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$getUnicode(pos = peg$currPos) {\n const cp = input.codePointAt(pos);\n if (cp === undefined) {\n return \"\";\n }\n return String.fromCodePoint(cp);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text, ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase, unicode) {\n return { type: \"class\", parts, inverted, ignoreCase, unicode };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description };\n }\n\n function peg$computePosDetails(pos) {\n let details = peg$posDetailsCache[pos];\n let p;\n\n if (details) {\n return details;\n } else {\n if (pos >= peg$posDetailsCache.length) {\n p = peg$posDetailsCache.length - 1;\n } else {\n p = pos;\n while (!peg$posDetailsCache[--p]) {}\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column,\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos, offset) {\n const startPosDetails = peg$computePosDetails(startPos);\n const endPosDetails = peg$computePosDetails(endPos);\n\n const res = {\n source: peg$source,\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column,\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column,\n },\n };\n if (offset && peg$source && (typeof peg$source.offset === \"function\")) {\n res.start = peg$source.offset(res.start);\n res.end = peg$source.offset(res.end);\n }\n return res;\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parseversion() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (input.length > peg$currPos) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (input.length > peg$currPos) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n }\n peg$savedPos = s0;\n s1 = peg$f0();\n s0 = s1;\n\n return s0;\n }\n\n function peg$parsebitmarkPlusPlus() {\n let s0, s1;\n\n peg$silentFails++;\n s0 = [];\n s1 = peg$parseBlock();\n if (s1 !== peg$FAILED) {\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n s1 = peg$parseBlock();\n }\n } else {\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parseNoContent();\n }\n peg$silentFails--;\n if (s0 === peg$FAILED) {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n\n return s0;\n }\n\n function peg$parseBlock() {\n let s0, s1;\n\n s0 = peg$currPos;\n s1 = peg$parseTitleBlock();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f1(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseListBlock();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f2(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseImageBlock();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f3(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseCodeBlock();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f4(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseParagraph();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f5(s1);\n }\n s0 = s1;\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseBlockStart() {\n let s0;\n\n s0 = peg$parseTitleTags();\n if (s0 === peg$FAILED) {\n s0 = peg$parseListTags();\n if (s0 === peg$FAILED) {\n s0 = peg$parseImageBlock();\n if (s0 === peg$FAILED) {\n s0 = peg$parseCodeHeader();\n if (s0 === peg$FAILED) {\n s0 = peg$parseExplicitParagraphHeader();\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseBlockTag() {\n let s0;\n\n if (input.charCodeAt(peg$currPos) === 124) {\n s0 = peg$c0;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n\n return s0;\n }\n\n function peg$parseNoContent() {\n let s0, s1;\n\n s0 = peg$currPos;\n s1 = '';\n peg$savedPos = s0;\n s1 = peg$f6();\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseTitleTags() {\n let s0;\n\n if (input.substr(peg$currPos, 4) === peg$c1) {\n s0 = peg$c1;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c2) {\n s0 = peg$c2;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 2) === peg$c3) {\n s0 = peg$c3;\n peg$currPos += 2;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e5); }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseTitleBlock() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$parseTitleTags();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$parsechar();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parsechar();\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseEOL();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseNL();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f7(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseCodeType() {\n let s0;\n\n if (input.substr(peg$currPos, 4) === peg$c4) {\n s0 = peg$c4;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n\n return s0;\n }\n\n function peg$parseCodeTag() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseBlockTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseCodeType();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f8(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseCodeBlock() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseCodeHeader();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseCodeBody();\n peg$savedPos = s0;\n s0 = peg$f9(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseCodeHeader() {\n let s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n s1 = peg$parseCodeTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = [];\n s5 = input.charAt(peg$currPos);\n if (peg$r0.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = input.charAt(peg$currPos);\n if (peg$r0.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n }\n s5 = peg$parseEOL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f10();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseCodeTag();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s2 = peg$c5;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseCodeLanguage();\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n s5 = peg$currPos;\n s6 = [];\n s7 = input.charAt(peg$currPos);\n if (peg$r0.test(s7)) {\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = input.charAt(peg$currPos);\n if (peg$r0.test(s7)) {\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n }\n s7 = peg$parseEOL();\n if (s7 !== peg$FAILED) {\n s6 = [s6, s7];\n s5 = s6;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = input.substring(s4, peg$currPos);\n } else {\n s4 = s5;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f11(s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseCodeLanguage() {\n let s0, s1, s2;\n\n if (input.substr(peg$currPos, 9) === peg$c6) {\n s0 = peg$c6;\n peg$currPos += 9;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 9) === peg$c7) {\n s0 = peg$c7;\n peg$currPos += 9;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 10) === peg$c8) {\n s0 = peg$c8;\n peg$currPos += 10;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parsechar();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parsechar();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n if (s0 === peg$FAILED) {\n s0 = '';\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseCodeBody() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n s3 = peg$parseCodeLine();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseCodeLine();\n }\n s1 = input.substring(s1, peg$currPos);\n peg$savedPos = s0;\n s1 = peg$f12(s1);\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCodeLine() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseBlockStart();\n peg$silentFails--;\n if (s2 === peg$FAILED) {\n s1 = undefined;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = [];\n s5 = peg$parsechar();\n if (s5 !== peg$FAILED) {\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parsechar();\n }\n } else {\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseEOL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f13(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parseNL();\n }\n\n return s0;\n }\n\n function peg$parseBulletListTag() {\n let s0;\n\n if (input.substr(peg$currPos, 2) === peg$c9) {\n s0 = peg$c9;\n peg$currPos += 2;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n\n return s0;\n }\n\n function peg$parseNoBulletListTag() {\n let s0;\n\n if (input.substr(peg$currPos, 3) === peg$c10) {\n s0 = peg$c10;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n\n return s0;\n }\n\n function peg$parseOrderedListTag() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 8226) {\n s2 = peg$c11;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 32) {\n s4 = peg$c12;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseOrderedListRomanTag() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 8226) {\n s2 = peg$c11;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (input.substr(peg$currPos, 2) === peg$c13) {\n s4 = peg$c13;\n peg$currPos += 2;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e17); }\n }\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseOrderedListRomanLowerTag() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 8226) {\n s2 = peg$c11;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (input.substr(peg$currPos, 2) === peg$c14) {\n s4 = peg$c14;\n peg$currPos += 2;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e18); }\n }\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseLetteredListTag() {\n let s0;\n\n if (input.substr(peg$currPos, 3) === peg$c15) {\n s0 = peg$c15;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e19); }\n }\n\n return s0;\n }\n\n function peg$parseLetteredListLowerTag() {\n let s0;\n\n if (input.substr(peg$currPos, 3) === peg$c16) {\n s0 = peg$c16;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e20); }\n }\n\n return s0;\n }\n\n function peg$parseTaskListTag() {\n let s0;\n\n if (input.substr(peg$currPos, 3) === peg$c17) {\n s0 = peg$c17;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e21); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c18) {\n s0 = peg$c18;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e22); }\n }\n }\n\n return s0;\n }\n\n function peg$parseListTags() {\n let s0;\n\n s0 = peg$parseBulletListTag();\n if (s0 === peg$FAILED) {\n s0 = peg$parseNoBulletListTag();\n if (s0 === peg$FAILED) {\n s0 = peg$parseOrderedListTag();\n if (s0 === peg$FAILED) {\n s0 = peg$parseOrderedListRomanTag();\n if (s0 === peg$FAILED) {\n s0 = peg$parseOrderedListRomanLowerTag();\n if (s0 === peg$FAILED) {\n s0 = peg$parseLetteredListTag();\n if (s0 === peg$FAILED) {\n s0 = peg$parseLetteredListLowerTag();\n if (s0 === peg$FAILED) {\n s0 = peg$parseTaskListTag();\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseListBlock() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$parseBulletListContainer();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseBulletListLine();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBulletListLine();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f14(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseNoBulletListContainer();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseBulletListLine();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBulletListLine();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f15(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseOrderedListContainer();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseBulletListLine();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBulletListLine();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f16(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseOrderedListRomanContainer();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseBulletListLine();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBulletListLine();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f17(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseOrderedListRomanLowerContainer();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseBulletListLine();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBulletListLine();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f18(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseLetteredListContainer();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseBulletListLine();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBulletListLine();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f19(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseLetteredListLowerContainer();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseBulletListLine();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBulletListLine();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f20(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseTaskListContainer();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseBulletListLine();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBulletListLine();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f21(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseBulletListContainer() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseBulletListTag();\n peg$silentFails--;\n if (s2 !== peg$FAILED) {\n peg$currPos = s1;\n s1 = undefined;\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f22();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseNoBulletListContainer() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseNoBulletListTag();\n peg$silentFails--;\n if (s2 !== peg$FAILED) {\n peg$currPos = s1;\n s1 = undefined;\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f23();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseOrderedListContainer() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseOrderedListTag();\n peg$silentFails--;\n if (s2 !== peg$FAILED) {\n peg$currPos = s1;\n s1 = undefined;\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f24();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseOrderedListRomanContainer() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseOrderedListRomanTag();\n peg$silentFails--;\n if (s2 !== peg$FAILED) {\n peg$currPos = s1;\n s1 = undefined;\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f25();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseOrderedListRomanLowerContainer() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseOrderedListRomanLowerTag();\n peg$silentFails--;\n if (s2 !== peg$FAILED) {\n peg$currPos = s1;\n s1 = undefined;\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f26();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseLetteredListContainer() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseLetteredListTag();\n peg$silentFails--;\n if (s2 !== peg$FAILED) {\n peg$currPos = s1;\n s1 = undefined;\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f27();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseLetteredListLowerContainer() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseLetteredListLowerTag();\n peg$silentFails--;\n if (s2 !== peg$FAILED) {\n peg$currPos = s1;\n s1 = undefined;\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f28();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseTaskListContainer() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseTaskListTag();\n peg$silentFails--;\n if (s2 !== peg$FAILED) {\n peg$currPos = s1;\n s1 = undefined;\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f29();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseBulletListLine() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8;\n\n s0 = peg$currPos;\n s1 = peg$parseSAMEDENT();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseListTags();\n if (s2 !== peg$FAILED) {\n s3 = peg$currPos;\n s4 = peg$currPos;\n s5 = [];\n s6 = peg$currPos;\n s7 = peg$currPos;\n peg$silentFails++;\n s8 = peg$parseNL();\n peg$silentFails--;\n if (s8 === peg$FAILED) {\n s7 = undefined;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s8 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s8 !== peg$FAILED) {\n s7 = [s7, s8];\n s6 = s7;\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$currPos;\n s7 = peg$currPos;\n peg$silentFails++;\n s8 = peg$parseNL();\n peg$silentFails--;\n if (s8 === peg$FAILED) {\n s7 = undefined;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s8 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s8 !== peg$FAILED) {\n s7 = [s7, s8];\n s6 = s7;\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n }\n s6 = peg$parseNL();\n if (s6 === peg$FAILED) {\n s6 = null;\n }\n s5 = [s5, s6];\n s4 = s5;\n s3 = input.substring(s3, peg$currPos);\n s4 = [];\n s5 = peg$parseListLine();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseListLine();\n }\n s5 = peg$currPos;\n s6 = peg$parseINDENT();\n if (s6 !== peg$FAILED) {\n s7 = [];\n s8 = peg$parseBulletListLine();\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$parseBulletListLine();\n }\n s8 = peg$parseDEDENT();\n if (s8 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f30(s2, s3, s4, s7);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 === peg$FAILED) {\n s5 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f31(s2, s3, s4, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseListLine() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseBlankLine();\n peg$silentFails--;\n if (s2 === peg$FAILED) {\n s1 = undefined;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseSAMEDENT();\n if (s2 !== peg$FAILED) {\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$parseListTags();\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = undefined;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseNL();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s9 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s9 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseNL();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s9 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s9 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n s7 = peg$parseEOL();\n if (s7 !== peg$FAILED) {\n s6 = [s6, s7];\n s5 = s6;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = input.substring(s4, peg$currPos);\n } else {\n s4 = s5;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f32(s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBlankLine() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r0.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r0.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n }\n s2 = peg$parseNL();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseSAMEDENT() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (input.charCodeAt(peg$currPos) === 9) {\n s2 = peg$c19;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (input.charCodeAt(peg$currPos) === 9) {\n s2 = peg$c19;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n }\n peg$savedPos = peg$currPos;\n s2 = peg$f33(s1);\n if (s2) {\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseINDENT() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n peg$silentFails++;\n s1 = peg$currPos;\n s2 = [];\n if (input.charCodeAt(peg$currPos) === 9) {\n s3 = peg$c19;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (input.charCodeAt(peg$currPos) === 9) {\n s3 = peg$c19;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = peg$currPos;\n s3 = peg$f34(s2);\n if (s3) {\n s3 = undefined;\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s1;\n s1 = peg$f35(s2);\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n peg$silentFails--;\n if (s1 !== peg$FAILED) {\n peg$currPos = s0;\n s0 = undefined;\n } else {\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseDEDENT() {\n let s0;\n\n peg$savedPos = peg$currPos;\n s0 = peg$f36();\n if (s0) {\n s0 = undefined;\n } else {\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseParagraph() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseBlockStart();\n peg$silentFails--;\n if (s2 === peg$FAILED) {\n s1 = undefined;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseParagraphBody();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f37(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseExplicitParagraphHeader();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseParagraphBody();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f38(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseExplicitParagraphHeader();\n if (s1 !== peg$FAILED) {\n s2 = '';\n peg$savedPos = s0;\n s0 = peg$f39(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseParagraphBody() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseParagraphLine();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseParagraphLine();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseParagraphLine() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$parseBlockStart();\n peg$silentFails--;\n if (s2 === peg$FAILED) {\n s1 = undefined;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = [];\n s5 = peg$parsechar();\n if (s5 !== peg$FAILED) {\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parsechar();\n }\n } else {\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseEOL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parseNL();\n }\n\n return s0;\n }\n\n function peg$parseExplicitParagraphHeader() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$parseBlockTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = [];\n s5 = input.charAt(peg$currPos);\n if (peg$r0.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = input.charAt(peg$currPos);\n if (peg$r0.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n }\n s5 = peg$parseEOL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseNL();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n s1 = [s1, s2, s3];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseImageType() {\n let s0;\n\n if (input.substr(peg$currPos, 5) === peg$c20) {\n s0 = peg$c20;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e24); }\n }\n\n return s0;\n }\n\n function peg$parseImageTag() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseBlockTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseImageType();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f40(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseImageBlock() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;\n\n s0 = peg$currPos;\n s1 = peg$parseImageTag();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s2 = peg$c5;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 32) {\n s3 = peg$c12;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n s4 = peg$parseUrlHttp();\n if (s4 !== peg$FAILED) {\n s5 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s6 = peg$c12;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n if (input.charCodeAt(peg$currPos) === 32) {\n s6 = peg$c12;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s6 = peg$parseBlockTag();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseMediaChain();\n s8 = peg$currPos;\n s9 = peg$currPos;\n s10 = [];\n s11 = input.charAt(peg$currPos);\n if (peg$r0.test(s11)) {\n peg$currPos++;\n } else {\n s11 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n while (s11 !== peg$FAILED) {\n s10.push(s11);\n s11 = input.charAt(peg$currPos);\n if (peg$r0.test(s11)) {\n peg$currPos++;\n } else {\n s11 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n }\n s11 = peg$parseEOL();\n if (s11 !== peg$FAILED) {\n s10 = [s10, s11];\n s9 = s10;\n } else {\n peg$currPos = s9;\n s9 = peg$FAILED;\n }\n if (s9 !== peg$FAILED) {\n s8 = input.substring(s8, peg$currPos);\n } else {\n s8 = s9;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parseNL();\n if (s9 === peg$FAILED) {\n s9 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f41(s1, s4, s7);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseMediaChain() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseMediaChainItem();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseMediaChainItem();\n }\n peg$savedPos = s0;\n s1 = peg$f42(s1);\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseMediaChainItem() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c21;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e25); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f43(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseMediaSizeTags();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c5;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = input.charAt(peg$currPos);\n if (peg$r1.test(s9)) {\n peg$currPos++;\n } else {\n s9 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = input.charAt(peg$currPos);\n if (peg$r1.test(s9)) {\n peg$currPos++;\n } else {\n s9 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n s5 = input.substring(s5, peg$currPos);\n } else {\n s5 = s6;\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s7 = peg$c12;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (input.charCodeAt(peg$currPos) === 32) {\n s7 = peg$c12;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s7 = peg$parseBlockTag();\n if (s7 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f44(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseMediaTextTags();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c5;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsechar();\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsechar();\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n }\n s5 = input.substring(s5, peg$currPos);\n s6 = peg$parseBlockTag();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f45(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseMediaAlignmentTags();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c5;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s5 = peg$parseMediaAlignment();\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s7 = peg$c12;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (input.charCodeAt(peg$currPos) === 32) {\n s7 = peg$c12;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s7 = peg$parseBlockTag();\n if (s7 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f46(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseMediaBooleanTags();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c5;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s5 = peg$parseBoolean();\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s7 = peg$c12;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (input.charCodeAt(peg$currPos) === 32) {\n s7 = peg$c12;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s7 = peg$parseBlockTag();\n if (s7 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f47(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseMediaBooleanTags();\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s4 = peg$c12;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (input.charCodeAt(peg$currPos) === 32) {\n s4 = peg$c12;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s4 = peg$parseBlockTag();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f48(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseBlockTag();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f49();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f50(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseMediaSizeTags() {\n let s0;\n\n if (input.substr(peg$currPos, 5) === peg$c23) {\n s0 = peg$c23;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e27); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c24) {\n s0 = peg$c24;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e28); }\n }\n }\n\n return s0;\n }\n\n function peg$parseMediaAlignmentTags() {\n let s0;\n\n if (input.substr(peg$currPos, 9) === peg$c25) {\n s0 = peg$c25;\n peg$currPos += 9;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 12) === peg$c26) {\n s0 = peg$c26;\n peg$currPos += 12;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n }\n\n return s0;\n }\n\n function peg$parseMediaAlignment() {\n let s0;\n\n if (input.substr(peg$currPos, 4) === peg$c27) {\n s0 = peg$c27;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c28) {\n s0 = peg$c28;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c29) {\n s0 = peg$c29;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseMediaTextTags() {\n let s0;\n\n if (input.substr(peg$currPos, 3) === peg$c30) {\n s0 = peg$c30;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e34); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 7) === peg$c31) {\n s0 = peg$c31;\n peg$currPos += 7;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e35); }\n }\n }\n\n return s0;\n }\n\n function peg$parseMediaBooleanTags() {\n let s0;\n\n if (input.substr(peg$currPos, 12) === peg$c32) {\n s0 = peg$c32;\n peg$currPos += 12;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n\n return s0;\n }\n\n function peg$parseBoolean() {\n let s0;\n\n if (input.substr(peg$currPos, 4) === peg$c33) {\n s0 = peg$c33;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e37); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c34) {\n s0 = peg$c34;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n }\n\n return s0;\n }\n\n function peg$parsebitmarkPlus() {\n let s0, s1;\n\n peg$silentFails++;\n s0 = peg$currPos;\n s1 = peg$parseInlineTags();\n peg$savedPos = s0;\n s1 = peg$f51(s1);\n s0 = s1;\n peg$silentFails--;\n\n return s0;\n }\n\n function peg$parsebitmarkPlusString() {\n let s0;\n\n peg$silentFails++;\n s0 = peg$parseInlineTags();\n peg$silentFails--;\n\n return s0;\n }\n\n function peg$parseInlineTags() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$parseInlinePlainText();\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = [];\n s3 = peg$parseInlineStyledText();\n if (s3 === peg$FAILED) {\n s3 = peg$parseInlinePlainText();\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseInlineStyledText();\n if (s3 === peg$FAILED) {\n s3 = peg$parseInlinePlainText();\n }\n }\n peg$savedPos = s0;\n s0 = peg$f52(s1, s2);\n\n return s0;\n }\n\n function peg$parseInlinePlainText() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = peg$parseNL();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f53();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parseInlineTagTags();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineStyledText();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s4 = [s4, s5, s6];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n s4 = peg$parseInlineTagTags();\n if (s4 !== peg$FAILED) {\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineStyledText();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parseInlineTagTags();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineStyledText();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s4 = [s4, s5, s6];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n s4 = peg$parseInlineTagTags();\n if (s4 !== peg$FAILED) {\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineStyledText();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f54(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseInlineHalfTag() {\n let s0;\n\n if (input.charCodeAt(peg$currPos) === 61) {\n s0 = peg$c35;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e39); }\n }\n\n return s0;\n }\n\n function peg$parseInlineTag() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseInlineHalfTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseInlineHalfTag();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseInlineStyledText() {\n let s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n s1 = peg$parseBodyBitOpenTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseBodyBitCloseTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f55(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseInlineTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseInlineTag();\n if (s3 !== peg$FAILED) {\n if (input.substr(peg$currPos, 7) === peg$c36) {\n s4 = peg$c36;\n peg$currPos += 7;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f56(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseInlineTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseInlineTag();\n if (s3 !== peg$FAILED) {\n if (input.substr(peg$currPos, 13) === peg$c37) {\n s4 = peg$c37;\n peg$currPos += 13;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e41); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseUrl();\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 124) {\n s6 = peg$c0;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s6 !== peg$FAILED) {\n s7 = peg$parseInlineMediaChain();\n peg$savedPos = s0;\n s0 = peg$f57(s2, s5, s7);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseInlineTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseInlineTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseInlineTag();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseAttrChain();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f58(s2, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseBoldTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBoldTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBoldTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBoldTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f59(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseItalicTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseItalicTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseItalicTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseItalicTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f60(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseLightTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseLightTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseLightTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseLightTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f61(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseHighlightTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseHighlightTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseHighlightTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseHighlightTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f62(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseUrl();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f63(s1);\n }\n s0 = s1;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseInlineTagTags() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseInlineTag();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseInlineHalfTag();\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseInlineHalfTag();\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseLightTag();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseLightHalfTag();\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseLightHalfTag();\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseHighlightTag();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseHighlightHalfTag();\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseHighlightHalfTag();\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseAttrChain() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 124) {\n s1 = peg$c0;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseAttrChainItem();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseAttrChainItem();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f64(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseInlineMediaChain() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseInlineMediaChainItem();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseInlineMediaChainItem();\n }\n peg$savedPos = s0;\n s1 = peg$f65(s1);\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseInlineMediaChainItem() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c21;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e25); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f66(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseMediaSizeTags();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c5;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = input.charAt(peg$currPos);\n if (peg$r1.test(s9)) {\n peg$currPos++;\n } else {\n s9 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = input.charAt(peg$currPos);\n if (peg$r1.test(s9)) {\n peg$currPos++;\n } else {\n s9 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n s5 = input.substring(s5, peg$currPos);\n } else {\n s5 = s6;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseBlockTag();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f67(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseMediaSizeTags();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c5;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsechar();\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsechar();\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n }\n s5 = input.substring(s5, peg$currPos);\n s6 = peg$parseBlockTag();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f68(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (input.substr(peg$currPos, 17) === peg$c38) {\n s2 = peg$c38;\n peg$currPos += 17;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e42); }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c5;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s5 = peg$parseInlineMediaAlignment();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseBlockTag();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f69(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (input.substr(peg$currPos, 4) === peg$c39) {\n s2 = peg$c39;\n peg$currPos += 4;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e43); }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c5;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (input.charCodeAt(peg$currPos) === 32) {\n s5 = peg$c12;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n s5 = peg$parseInlineMediaSize();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseBlockTag();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f70(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseInlineMediaAlignment() {\n let s0;\n\n if (input.substr(peg$currPos, 3) === peg$c40) {\n s0 = peg$c40;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e44); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c41) {\n s0 = peg$c41;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e45); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c42) {\n s0 = peg$c42;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e46); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 8) === peg$c43) {\n s0 = peg$c43;\n peg$currPos += 8;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e47); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c44) {\n s0 = peg$c44;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e48); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c45) {\n s0 = peg$c45;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e49); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 11) === peg$c46) {\n s0 = peg$c46;\n peg$currPos += 11;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e50); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 8) === peg$c47) {\n s0 = peg$c47;\n peg$currPos += 8;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e51); }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseInlineMediaSize() {\n let s0;\n\n if (input.substr(peg$currPos, 11) === peg$c48) {\n s0 = peg$c48;\n peg$currPos += 11;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e52); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 11) === peg$c49) {\n s0 = peg$c49;\n peg$currPos += 11;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e53); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c45) {\n s0 = peg$c45;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e49); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c44) {\n s0 = peg$c44;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e48); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 8) === peg$c50) {\n s0 = peg$c50;\n peg$currPos += 8;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e54); }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseAttrChainItem() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c51) {\n s1 = peg$c51;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e55); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f71(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 7) === peg$c52) {\n s1 = peg$c52;\n peg$currPos += 7;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e56); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseRefsChain();\n s4 = peg$parseBlockTag();\n if (s4 !== peg$FAILED) {\n if (input.substr(peg$currPos, 9) === peg$c53) {\n s5 = peg$c53;\n peg$currPos += 9;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e57); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$currPos;\n s7 = [];\n s8 = peg$currPos;\n s9 = peg$currPos;\n peg$silentFails++;\n s10 = peg$parseBlockTag();\n peg$silentFails--;\n if (s10 === peg$FAILED) {\n s9 = undefined;\n } else {\n peg$currPos = s9;\n s9 = peg$FAILED;\n }\n if (s9 !== peg$FAILED) {\n s10 = peg$parsechar();\n if (s10 !== peg$FAILED) {\n s9 = [s9, s10];\n s8 = s9;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$currPos;\n s9 = peg$currPos;\n peg$silentFails++;\n s10 = peg$parseBlockTag();\n peg$silentFails--;\n if (s10 === peg$FAILED) {\n s9 = undefined;\n } else {\n peg$currPos = s9;\n s9 = peg$FAILED;\n }\n if (s9 !== peg$FAILED) {\n s10 = peg$parsechar();\n if (s10 !== peg$FAILED) {\n s9 = [s9, s10];\n s8 = s9;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n }\n s6 = input.substring(s6, peg$currPos);\n s7 = peg$parseBlockTag();\n if (s7 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f72(s2, s3, s6);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c54) {\n s1 = peg$c54;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e58); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 9658) {\n s4 = peg$c55;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e59); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsechar();\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsechar();\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n }\n s5 = input.substring(s5, peg$currPos);\n s6 = peg$parseBlockTag();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f73(s2, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c54) {\n s1 = peg$c54;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e58); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f74(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 9658) {\n s1 = peg$c55;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e59); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f75(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 7) === peg$c56) {\n s1 = peg$c56;\n peg$currPos += 7;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e60); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseMediaChain();\n peg$savedPos = s0;\n s0 = peg$f76(s2, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 9) === peg$c57) {\n s1 = peg$c57;\n peg$currPos += 9;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e61); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f77(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 10) === peg$c58) {\n s1 = peg$c58;\n peg$currPos += 10;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e62); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f78(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c59) {\n s1 = peg$c59;\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e63); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f79(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c4) {\n s1 = peg$c4;\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBlockTag();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f80();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c60) {\n s1 = peg$c60;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e64); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f81(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c61) {\n s1 = peg$c61;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e65); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBlockTag();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f82();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 6) === peg$c62) {\n s1 = peg$c62;\n peg$currPos += 6;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e66); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f83(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 9) === peg$c63) {\n s1 = peg$c63;\n peg$currPos += 9;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e67); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 80) {\n s4 = peg$c64;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e68); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsechar();\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$currPos;\n s8 = peg$currPos;\n peg$silentFails++;\n s9 = peg$parseBlockTag();\n peg$silentFails--;\n if (s9 === peg$FAILED) {\n s8 = undefined;\n } else {\n peg$currPos = s8;\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsechar();\n if (s9 !== peg$FAILED) {\n s8 = [s8, s9];\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n }\n s5 = input.substring(s5, peg$currPos);\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f84(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 6) === peg$c65) {\n s1 = peg$c65;\n peg$currPos += 6;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e69); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseColor();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f85(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseAlternativeStyleTags();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBlockTag();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f86(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c21;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e25); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBlockTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f87(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseRefsChain() {\n let s0, s1;\n\n s0 = [];\n s1 = peg$parseRef();\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n s1 = peg$parseRef();\n }\n\n return s0;\n }\n\n function peg$parseRef() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c66) {\n s1 = peg$c66;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e70); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n peg$savedPos = s0;\n s0 = peg$f88(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseAlternativeStyleTags() {\n let s0;\n\n if (input.substr(peg$currPos, 4) === peg$c67) {\n s0 = peg$c67;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e71); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c68) {\n s0 = peg$c68;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e72); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c69) {\n s0 = peg$c69;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e73); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 9) === peg$c70) {\n s0 = peg$c70;\n peg$currPos += 9;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e74); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c71) {\n s0 = peg$c71;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e75); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 9) === peg$c72) {\n s0 = peg$c72;\n peg$currPos += 9;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e76); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 11) === peg$c73) {\n s0 = peg$c73;\n peg$currPos += 11;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e77); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c74) {\n s0 = peg$c74;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e78); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c75) {\n s0 = peg$c75;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e79); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 9) === peg$c76) {\n s0 = peg$c76;\n peg$currPos += 9;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e80); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 15) === peg$c77) {\n s0 = peg$c77;\n peg$currPos += 15;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e81); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c78) {\n s0 = peg$c78;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e82); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 13) === peg$c79) {\n s0 = peg$c79;\n peg$currPos += 13;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e83); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 16) === peg$c80) {\n s0 = peg$c80;\n peg$currPos += 16;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e84); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 16) === peg$c81) {\n s0 = peg$c81;\n peg$currPos += 16;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e85); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 15) === peg$c82) {\n s0 = peg$c82;\n peg$currPos += 15;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e86); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 14) === peg$c83) {\n s0 = peg$c83;\n peg$currPos += 14;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e87); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 16) === peg$c84) {\n s0 = peg$c84;\n peg$currPos += 16;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e88); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 14) === peg$c85) {\n s0 = peg$c85;\n peg$currPos += 14;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e89); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 15) === peg$c86) {\n s0 = peg$c86;\n peg$currPos += 15;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e90); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 15) === peg$c87) {\n s0 = peg$c87;\n peg$currPos += 15;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e91); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 15) === peg$c88) {\n s0 = peg$c88;\n peg$currPos += 15;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e92); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 14) === peg$c89) {\n s0 = peg$c89;\n peg$currPos += 14;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e93); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 10) === peg$c90) {\n s0 = peg$c90;\n peg$currPos += 10;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e94); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 13) === peg$c91) {\n s0 = peg$c91;\n peg$currPos += 13;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e95); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 19) === peg$c92) {\n s0 = peg$c92;\n peg$currPos += 19;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e96); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 10) === peg$c93) {\n s0 = peg$c93;\n peg$currPos += 10;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e97); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 10) === peg$c94) {\n s0 = peg$c94;\n peg$currPos += 10;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e98); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 13) === peg$c95) {\n s0 = peg$c95;\n peg$currPos += 13;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e99); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 11) === peg$c96) {\n s0 = peg$c96;\n peg$currPos += 11;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e100); }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseColor() {\n let s0;\n\n if (input.substr(peg$currPos, 4) === peg$c97) {\n s0 = peg$c97;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e101); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c98) {\n s0 = peg$c98;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e102); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c99) {\n s0 = peg$c99;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e103); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c100) {\n s0 = peg$c100;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e104); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 7) === peg$c101) {\n s0 = peg$c101;\n peg$currPos += 7;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e105); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 9) === peg$c102) {\n s0 = peg$c102;\n peg$currPos += 9;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e106); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c103) {\n s0 = peg$c103;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e107); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 8) === peg$c104) {\n s0 = peg$c104;\n peg$currPos += 8;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e108); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c105) {\n s0 = peg$c105;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e109); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c106) {\n s0 = peg$c106;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e110); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 7) === peg$c107) {\n s0 = peg$c107;\n peg$currPos += 7;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e111); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c108) {\n s0 = peg$c108;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e112); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c109) {\n s0 = peg$c109;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e113); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c110) {\n s0 = peg$c110;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e114); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c111) {\n s0 = peg$c111;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e115); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c112) {\n s0 = peg$c112;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e116); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c113) {\n s0 = peg$c113;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e117); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c114) {\n s0 = peg$c114;\n peg$currPos += 3;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e118); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c115) {\n s0 = peg$c115;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e119); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c116) {\n s0 = peg$c116;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e120); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c117) {\n s0 = peg$c117;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e121); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c118) {\n s0 = peg$c118;\n peg$currPos += 5;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e122); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c119) {\n s0 = peg$c119;\n peg$currPos += 6;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e123); }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsebitmarkMinusMinus() {\n let s0, s1;\n\n peg$silentFails++;\n s0 = peg$currPos;\n s1 = peg$parsebitmarkMinusMinusString();\n peg$savedPos = s0;\n s1 = peg$f89(s1);\n s0 = s1;\n peg$silentFails--;\n\n return s0;\n }\n\n function peg$parsebitmarkMinusMinusString() {\n let s0, s1, s2, s3;\n\n peg$silentFails++;\n s0 = peg$currPos;\n s1 = peg$parsePlainText();\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = [];\n s3 = peg$parseStyledText();\n if (s3 === peg$FAILED) {\n s3 = peg$parsePlainText();\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseStyledText();\n if (s3 === peg$FAILED) {\n s3 = peg$parsePlainText();\n }\n }\n peg$savedPos = s0;\n s0 = peg$f90(s1, s2);\n peg$silentFails--;\n\n return s0;\n }\n\n function peg$parsePlainText() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = peg$parseNL();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f91();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parseTagTags();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseStyledText();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s4 = [s4, s5, s6];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n s4 = peg$parseTagTags();\n if (s4 !== peg$FAILED) {\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseStyledText();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parseTagTags();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseStyledText();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parsechar();\n if (s6 !== peg$FAILED) {\n s4 = [s4, s5, s6];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n s4 = peg$parseTagTags();\n if (s4 !== peg$FAILED) {\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseStyledText();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f92(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseBoldHalfTag() {\n let s0;\n\n if (input.charCodeAt(peg$currPos) === 42) {\n s0 = peg$c120;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e124); }\n }\n\n return s0;\n }\n\n function peg$parseItalicHalfTag() {\n let s0;\n\n if (input.charCodeAt(peg$currPos) === 95) {\n s0 = peg$c121;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e125); }\n }\n\n return s0;\n }\n\n function peg$parseLightHalfTag() {\n let s0;\n\n if (input.charCodeAt(peg$currPos) === 96) {\n s0 = peg$c122;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e126); }\n }\n\n return s0;\n }\n\n function peg$parseHighlightHalfTag() {\n let s0;\n\n if (input.charCodeAt(peg$currPos) === 33) {\n s0 = peg$c123;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e127); }\n }\n\n return s0;\n }\n\n function peg$parseBoldTag() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseBoldHalfTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBoldHalfTag();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseItalicTag() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseItalicHalfTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseItalicHalfTag();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseLightTag() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseLightHalfTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseLightHalfTag();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseHighlightTag() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseHighlightHalfTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseHighlightHalfTag();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBodyBitOpenTag() {\n let s0;\n\n if (input.substr(peg$currPos, 2) === peg$c124) {\n s0 = peg$c124;\n peg$currPos += 2;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e128); }\n }\n\n return s0;\n }\n\n function peg$parseBodyBitCloseTag() {\n let s0;\n\n if (input.charCodeAt(peg$currPos) === 93) {\n s0 = peg$c125;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e129); }\n }\n\n return s0;\n }\n\n function peg$parseStyledText() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = peg$parseBodyBitOpenTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseBodyBitCloseTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f93(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseBoldTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBoldTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBoldTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseBoldTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f94(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseItalicTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseItalicTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseItalicTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseItalicTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f95(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseLightTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseLightTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseLightTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseLightTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f96(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseHighlightTag();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseHighlightTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseHighlightTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n s3 = peg$parseHighlightTag();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f97(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseTagTags() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseLightTag();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseLightHalfTag();\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseLightHalfTag();\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseHighlightTag();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseHighlightHalfTag();\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseHighlightHalfTag();\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n\n return s0;\n }\n\n function peg$parseNL() {\n let s0, s1;\n\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 10) {\n s0 = peg$c126;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e131); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 2) === peg$c127) {\n s0 = peg$c127;\n peg$currPos += 2;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e132); }\n }\n if (s0 === peg$FAILED) {\n s0 = input.charAt(peg$currPos);\n if (peg$r2.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e133); }\n }\n }\n }\n peg$silentFails--;\n if (s0 === peg$FAILED) {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e130); }\n }\n\n return s0;\n }\n\n function peg$parsechar() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r3.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e134); }\n }\n\n return s0;\n }\n\n function peg$parseEOL() {\n let s0, s1;\n\n s0 = peg$parseNL();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n peg$silentFails++;\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n peg$silentFails--;\n if (s1 === peg$FAILED) {\n s0 = undefined;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseUrlHttp() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c128) {\n s2 = peg$c128;\n peg$currPos += 4;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e135); }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 115) {\n s3 = peg$c129;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e136); }\n }\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n if (input.substr(peg$currPos, 3) === peg$c130) {\n s4 = peg$c130;\n peg$currPos += 3;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e137); }\n }\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$currPos;\n s7 = peg$currPos;\n peg$silentFails++;\n s8 = peg$parseBlockTag();\n peg$silentFails--;\n if (s8 === peg$FAILED) {\n s7 = undefined;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n s8 = peg$parseUrlChars();\n if (s8 !== peg$FAILED) {\n s7 = [s7, s8];\n s6 = s7;\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$currPos;\n s7 = peg$currPos;\n peg$silentFails++;\n s8 = peg$parseBlockTag();\n peg$silentFails--;\n if (s8 === peg$FAILED) {\n s7 = undefined;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n s8 = peg$parseUrlChars();\n if (s8 !== peg$FAILED) {\n s7 = [s7, s8];\n s6 = s7;\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n }\n s2 = [s2, s3, s4, s5];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseUrl() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c128) {\n s3 = peg$c128;\n peg$currPos += 4;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e135); }\n }\n if (s3 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 115) {\n s4 = peg$c129;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e136); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n if (input.substr(peg$currPos, 3) === peg$c130) {\n s5 = peg$c130;\n peg$currPos += 3;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e137); }\n }\n if (s5 !== peg$FAILED) {\n s3 = [s3, s4, s5];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 === peg$FAILED) {\n if (input.substr(peg$currPos, 7) === peg$c131) {\n s2 = peg$c131;\n peg$currPos += 7;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e138); }\n }\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseUrlChars();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$currPos;\n peg$silentFails++;\n s6 = peg$parseBlockTag();\n peg$silentFails--;\n if (s6 === peg$FAILED) {\n s5 = undefined;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseUrlChars();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n s2 = input.substring(s2, peg$currPos);\n peg$savedPos = s0;\n s0 = peg$f98(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseUrlChars() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r4.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e139); }\n }\n\n return s0;\n }\n\n\n var indentStack = [], indent = \"\"\n\n input = input.trimStart()\n\n peg$result = peg$startRuleFunction();\n\n const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);\n function peg$throw() {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n if (options.peg$library) {\n return /** @type {any} */ ({\n peg$result,\n peg$currPos,\n peg$FAILED,\n peg$maxFailExpected,\n peg$maxFailPos,\n peg$success,\n peg$throw: peg$success ? undefined : peg$throw,\n });\n }\n if (peg$success) {\n return peg$result;\n } else {\n peg$throw();\n }\n}\n\nconst peg$allowedStartRules = [\n \"version\",\n \"bitmarkPlusPlus\",\n \"bitmarkPlus\",\n \"bitmarkMinusMinus\",\n \"bitmarkPlusString\",\n \"bitmarkMinusMinusString\"\n];\n\nexport {\n peg$allowedStartRules as StartRules,\n peg$SyntaxError as SyntaxError,\n peg$parse as parse\n};\n","import { parse as _parse } from '../../../generated/parser/text/text-peggy-parser.js';\nimport { type TextAst } from '../../../model/ast/TextNodes.ts';\n\ninterface ParseOptions {\n startRule?: string;\n}\n\ntype Parse = (str: string, options?: ParseOptions) => TextAst | string;\n\nconst parse: Parse = _parse;\n\nexport { parse };\n","import { type JsonText, type TextAst } from '../../model/ast/TextNodes.ts';\nimport { type TextFormatType } from '../../model/enum/TextFormat.ts';\nimport { TextLocation, type TextLocationType } from '../../model/enum/TextLocation.ts';\nimport { TextNodeType } from '../../model/enum/TextNodeType.ts';\nimport { type BodyBitJson } from '../../model/json/BodyBitJson.ts';\nimport { StringUtils } from '../../utils/StringUtils.ts';\nimport { parse as bitmarkTextParse } from './peg/TextPegParser.ts';\n\nexport interface BitmarkTextParserOptions {\n format: TextFormatType;\n location: TextLocationType;\n}\n\nclass TextParser {\n /**\n * Get the version of the text parser\n */\n version(): string {\n return bitmarkTextParse('', {\n startRule: 'version',\n }) as string;\n }\n\n /**\n * Preprocess bitmark text AST into a standard format (TextAst object) from bitmark text AST either as a string\n * or a plain JS object\n *\n * @param ast - bitmark text AST as a string or a plain JS object\n * @returns bitmark text AST in a standard format (BitmarkAst object)\n */\n preprocessAst(ast: string | unknown): TextAst | undefined {\n if (StringUtils.isString(ast)) {\n const str = ast as string;\n try {\n ast = JSON.parse(str);\n } catch (_e) {\n // Failed to parse JSON, return empty array\n return undefined;\n }\n }\n\n if (this.isAst(ast)) {\n return ast as TextAst;\n }\n return undefined;\n }\n\n /**\n * Check if a plain JS object is valid text AST\n *\n * @param ast - a plain JS object that might be text AST\n * @returns true if text AST, otherwise false\n */\n isAst(ast: unknown): boolean {\n if (Array.isArray(ast)) {\n if (ast.length === 0) return true;\n\n if (Object.prototype.hasOwnProperty.call(ast[0], 'type')) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Convert Bitmark text to text AST.\n *\n * The Bitmark text should be a string.\n * If parsed bitmark text AST is passed to this function, it will be returned as is.\n *\n * @param text - bitmark text\n * @returns bitmark text AST as plain JS object\n */\n toAst(text: string | TextAst | undefined, options: BitmarkTextParserOptions): TextAst {\n // If input is not a string, return it as is\n if (Array.isArray(text)) return text;\n let str = (text as string) ?? '';\n\n // If the str is empty, return an empty array (as otherwise the parser will\n // return an empty paragraph which is unnecessary)\n if (!str) return [];\n\n // Ensure options is an object\n const opts = Object.assign({}, options);\n\n // Set the start rule.\n // The start rule is bitmark++ for the body, and bitmark+ for the tags\n // Otherwise, the start rule is bitmarkMinusMinus\n let startRule = 'bitmarkPlusPlus';\n if (opts.location === TextLocation.tag) {\n startRule = 'bitmarkPlus';\n }\n\n // Always trim the string before parsing (parser handles leading/trailing whitespace inconsistently)\n str = str.trim();\n\n return bitmarkTextParse(str, {\n startRule,\n }) as TextAst;\n }\n\n /**\n * Extract all the body bits from the text AST\n *\n * @param text\n * @returns\n */\n public extractBodyBits(text: JsonText): BodyBitJson[] {\n if (!Array.isArray(text)) return [];\n\n const bodyBits: BodyBitJson[] = [];\n const textAst = text as TextAst;\n for (const node of textAst) {\n switch (node.type) {\n case TextNodeType.gap:\n case TextNodeType.select:\n case TextNodeType.highlight:\n case TextNodeType.mark:\n bodyBits.push(node as BodyBitJson);\n break;\n default: {\n // Recurse into children\n const bits = this.extractBodyBits(node.content as TextAst);\n for (const bit of bits) {\n bodyBits.push(bit);\n }\n }\n }\n }\n\n return bodyBits;\n }\n\n /**\n * Walk all the body bits from the text AST\n *\n * @param text\n * @returns\n */\n public walkBodyBits(\n text: JsonText,\n callback: (parent: TextAst, index: number, bodyBit: BodyBitJson) => void,\n ): void {\n if (!Array.isArray(text)) return;\n\n const textAst = text as TextAst;\n for (let i = 0; i < textAst.length; i++) {\n const node = textAst[i];\n switch (node.type) {\n case TextNodeType.gap:\n case TextNodeType.select:\n case TextNodeType.highlight:\n case TextNodeType.mark:\n callback(textAst, i, node as BodyBitJson);\n break;\n default: {\n // Recurse into children\n this.walkBodyBits(node.content as TextAst, callback);\n }\n }\n }\n }\n}\n\nexport { TextParser };\n","class BooleanUtils {\n /**\n * Check if an object is a boolean.\n *\n * @param val input value\n * @returns the input value if it is an array, otherwise a new array containing the input value\n */\n isBoolean(val: unknown | undefined): boolean {\n if (val === true) return true;\n if (val === false) return true;\n return false;\n }\n\n /**\n * Check if an object is a boolean, or a boolean string.\n *\n * @param val input value\n * @returns the input value if it is an array, otherwise a new array containing the input value\n */\n isBooleanString(val: unknown | undefined): boolean {\n if (this.isBoolean(val)) return true;\n if (val === 'true') return true;\n if (val === 'false') return true;\n return false;\n }\n\n /**\n * Convert a value to a boolean.\n *\n * By default, the return will be false unless the value is truthy (true, \"true\").\n * Setting defaultVal to true will return true unless the value is falsy (false, \"false\").\n *\n * @param val input value\n * @param defaultVal default value to return if val does not match a boolean or 'true' / 'false'\n * @returns val, converted to a boolean\n */\n toBoolean(val: unknown | undefined, defaultVal?: boolean): boolean {\n if (defaultVal) {\n if (val === false) return false;\n if (val === 'false') return false;\n return true;\n } else {\n if (val === true) return true;\n if (val === 'true') return true;\n return false;\n }\n }\n}\n\nconst instance = new BooleanUtils();\n\nexport { instance as BooleanUtils };\n","class NumberUtils {\n /**\n * Convert a value to a number, unless it is already a number.\n *\n * The value returned if conversion cannot be performed defaults to undefined but can be configured\n * via defaultVal.\n *\n * @param val input value\n * @param defaultVal value to return if conversion cannot be performed\n * @returns the input value if it is an array, otherwise a new array containing the input value\n */\n asNumber<T extends number | undefined>(val: unknown | undefined, defaultVal?: T): number | T {\n if (val == null) return (defaultVal ?? undefined) as T;\n const number = +val;\n if (Number.isNaN(number) || !isFinite(number)) return (defaultVal ?? undefined) as T;\n\n return number;\n }\n\n /**\n * Return true if the input value IS or CAN BE converted to a number.\n *\n * e.g.\n * 123 -> true\n * 123.45 -> true\n * '123' -> true\n * '123.45' -> true\n * '-123.45' -> true\n * '+123.45' -> true\n * '0xAc1' -> true\n * '0xAc1' -> true\n * '0b101' -> true\n * '0o701' -> true\n * '1e4' -> true\n * '1e-4' -> true\n * '++1e-4' -> false\n * '7^2' -> false\n * '0xFFG' -> false\n * '0b121' -> false\n * '0o781' -> false\n * '1x10e4' -> false\n * '123abc' -> false\n * 'abc' -> false\n * null -> false\n *\n * @param val input value\n *\n * @returns true if the input value can be converted to a number.\n */\n isNumeric(val: unknown): boolean {\n if (val == null) return false;\n\n const number = +val;\n return !Number.isNaN(number) && isFinite(number);\n }\n}\n\nconst instance = new NumberUtils();\n\nexport { instance as NumberUtils };\n","import { Breakscape } from '../breakscaping/Breakscape.ts';\nimport { Config } from '../config/Config.ts';\nimport { TextGenerator } from '../generator/text/TextGenerator.ts';\nimport { type Property } from '../model/ast/Nodes.ts';\nimport { type JsonText, type TextAst } from '../model/ast/TextNodes.ts';\nimport { BitConfig } from '../model/config/BitConfig.ts';\nimport type { ConfigKeyType } from '../model/config/enum/ConfigKey.ts';\nimport type { PropertyTagConfig } from '../model/config/PropertyTagConfig.ts';\nimport { type BitTypeType } from '../model/enum/BitType.ts';\nimport { TagFormat } from '../model/enum/TagFormat.ts';\nimport { type TextFormatType } from '../model/enum/TextFormat.ts';\nimport { TextLocation, type TextLocationType } from '../model/enum/TextLocation.ts';\nimport { type ExampleJson } from '../model/json/BitJson.ts';\nimport { TextParser } from '../parser/text/TextParser.ts';\nimport { BooleanUtils } from '../utils/BooleanUtils.ts';\nimport { NumberUtils } from '../utils/NumberUtils.ts';\nimport { StringUtils } from '../utils/StringUtils.ts';\n\nexport interface WithExampleJson {\n isExample: boolean;\n example: ExampleJson;\n __defaultExample?: ExampleJson;\n}\n\nexport interface BuildContext {\n bitConfig: BitConfig;\n bitType: BitTypeType;\n textFormat: TextFormatType;\n}\n\nexport interface ToAstPropertyOptions {\n cardSet?: {\n sideNo: number; // Side number of the card set\n variantNo: number; // Variant number of the card set\n };\n}\n\nclass BaseBuilder {\n protected textParser: TextParser;\n protected textGenerator: TextGenerator;\n\n constructor() {\n this.textParser = new TextParser();\n this.textGenerator = new TextGenerator();\n }\n\n /**\n * Convert example to an Example.\n * - If example is set, then the isExample will be true and example with be example as a BreakscapedText.\n * - Else if __isDefaultExample is true, then __isDefaultExample / isExample will both be true.\n * - Else __isDefaultExample / isExample will both be false.\n *\n * @param __isDefaultExample - true if the example is the default value\n * @param example - the example to convert (BreakscapedText, boolean) or undefined if none / default\n * @returns example/__isDefaultExample resolved to an Example object\n */\n protected toExample(\n __isDefaultExample: boolean | undefined,\n example: TextAst | string | boolean | undefined | null,\n defaultExample?: TextAst | string | boolean | undefined | null,\n ): WithExampleJson {\n // Example\n if (example != undefined) {\n let exampleValue: JsonText | boolean | null;\n\n // If the default example is a boolean, then the example should be a boolean\n if (BooleanUtils.isBoolean(defaultExample)) {\n exampleValue = BooleanUtils.toBoolean(example);\n } else {\n exampleValue = example;\n }\n\n return {\n isExample: true,\n example: exampleValue,\n __defaultExample: defaultExample ?? null,\n };\n }\n\n // Default example\n if (__isDefaultExample) {\n return {\n isExample: true,\n example: defaultExample ?? null,\n __defaultExample: defaultExample ?? null,\n };\n }\n\n // Not an example\n return {\n isExample: false,\n example: null,\n __defaultExample: defaultExample ?? null,\n };\n }\n\n /**\n * Convert a raw bitmark property to an AST property.\n *\n * @param key\n * @param value\n * @param options\n * @returns\n */\n protected toAstProperty(\n bitType: BitTypeType,\n key: ConfigKeyType,\n value: unknown | unknown[] | undefined,\n options: ToAstPropertyOptions | undefined,\n ): Property | undefined {\n if (value == null) return undefined;\n\n const bitConfig = Config.getBitConfig(bitType);\n let tagsConfig = bitConfig.tags;\n if (options?.cardSet) {\n const { sideNo, variantNo } = options.cardSet;\n const cardTagsConfig = Config.getTagsConfigForCardSet(bitType, sideNo, variantNo);\n tagsConfig = cardTagsConfig ?? tagsConfig;\n }\n\n const propertyConfig = Config.getTagConfigForTag(tagsConfig, key) as\n | PropertyTagConfig\n | undefined;\n\n // Convert to array or single value if needed\n if (propertyConfig?.array && !Array.isArray(value)) {\n value = [value];\n } else if (!propertyConfig?.array && Array.isArray(value)) {\n value = value[value.length - 1];\n }\n\n // Convert property as needed\n const processValue = (v: unknown): Property | undefined => {\n if (v == null) return undefined;\n const format = propertyConfig?.format ?? TagFormat.plainText;\n switch (format) {\n case TagFormat.plainText:\n // Convert number to string\n if (NumberUtils.asNumber(v) != null) v = `${v}`;\n\n return StringUtils.isString(v) ? StringUtils.trimmedString(v) : undefined;\n\n case TagFormat.number:\n return NumberUtils.asNumber(v);\n\n case TagFormat.boolean:\n return BooleanUtils.toBoolean(v, true);\n\n case TagFormat.invertedBoolean:\n return !BooleanUtils.toBoolean(v, true);\n }\n return v as Property;\n };\n if (Array.isArray(value)) {\n const valueArray = value as unknown[];\n for (let i = 0, len = valueArray.length; i < len; i++) {\n valueArray[i] = processValue(valueArray[i]);\n }\n } else {\n value = processValue(value);\n }\n\n return value as Property;\n }\n\n protected getEmptyTextAst(context: BuildContext): TextAst {\n return this.handleJsonText(context, TextLocation.tag, ' ');\n }\n\n /**\n * Convert the JsonText from the JSON to the AST format:\n * Input:\n * - Bitmark v2: breakscaped string\n * - Bitmark v3: bitmark text JSON (TextAst)\n * Output:\n * - bitmark text JSON (TextAst) with __tag property to indicate item is text\n *\n * In the case of Bitmark v2 type texts, there is nothing to do but cast the type.\n *\n * @param context BuildContext\n * @param textFormat format of TextAst\n * @param textLocation location of the text (body, tag, etc.)\n * @param text JsonText or JsonText[] to convert\n * @returns Breakscaped string or breakscaped string[]\n */\n protected handleJsonText<\n T extends JsonText | JsonText[] | undefined,\n R = T extends JsonText[] ? TextAst[] : TextAst,\n >(context: BuildContext, textLocation: TextLocationType, text: T): R {\n let res: R;\n\n const { textFormat } = context;\n\n if (text == null) {\n res = [] as R;\n } else {\n if (this.textParser.isAst(text)) {\n // Use the text generator to convert the TextAst to breakscaped string\n // this.ast.printTree(text, NodeType.textAst);\n\n res = text as R;\n } else if (Array.isArray(text)) {\n const strArray: TextAst[] = [];\n for (let i = 0, len = text.length; i < len; i++) {\n const t = text[i];\n\n if (this.textParser.isAst(t)) {\n // Use the text generator to convert the TextAst to breakscaped string\n // this.ast.printTree(text, NodeType.textAst);\n strArray[i] = t as TextAst;\n } else if (StringUtils.isString(t)) {\n strArray[i] = this.textParser.toAst(\n Breakscape.breakscape(t as string, {\n format: textFormat,\n location: textLocation,\n }),\n {\n format: textFormat,\n location: textLocation,\n },\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (strArray[i] as any).__tag = 'text';\n } else {\n // Invalid data\n strArray[i] = [];\n }\n }\n // Return the array of TextAst texts\n return strArray as R;\n } else if (StringUtils.isString(text)) {\n // v2 text(?)\n res = this.textParser.toAst(\n Breakscape.breakscape(text as string, {\n format: textFormat,\n location: textLocation,\n v2: true,\n }),\n {\n format: textFormat,\n location: textLocation,\n },\n ) as R;\n } else {\n // Invalid data\n res = [] as R;\n }\n }\n\n // Add the __tag property to indicate this is a text item\n // This is somewhat ugly, but otherwise we would need an AST structure that is not so similar to the JSON\n // resulting in a lot more conversion code\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (res as any).__tag = 'text';\n\n return res;\n }\n\n // /**\n // * Remove any property with a key starting with an underscore.\n // *\n // * @param json\n // */\n // protected removeTemporaryProperties(json: Record<string, unknown> | unknown[]): void {\n // const obj = json as Record<string, unknown>;\n // for (const key in obj) {\n // if (key.startsWith('_')) {\n // delete obj[key];\n // } else if (typeof obj[key] === 'object') {\n // this.removeTemporaryProperties(obj[key] as Record<string, unknown>);\n // }\n // }\n // }\n}\n\nexport { BaseBuilder };\n","import { type WithExampleJson } from '../ast/BaseBuilder.ts';\nimport { type TextAst } from '../model/ast/TextNodes.ts';\nimport { type TextFormatType } from '../model/enum/TextFormat.ts';\nimport { TextLocation } from '../model/enum/TextLocation.ts';\nimport { type ExampleJson } from '../model/json/BitJson.ts';\nimport { TextParser } from '../parser/text/TextParser.ts';\nimport { BooleanUtils } from './BooleanUtils.ts';\n\nconst textParser = new TextParser();\n\nclass BitUtils {\n /**\n * Helper function to fill in the example / isExample of a node based on the values of __isDefaultExample and example.\n * This function if for 'string' examples.\n *\n * @param nodes\n * @param __isDefaultExample\n * @param example\n * @param firstOnly\n * @returns\n */\n fillStringExample(\n textFormat: TextFormatType,\n nodes: WithExampleJson | WithExampleJson[],\n __isDefaultExample: boolean | undefined,\n example: ExampleJson | undefined,\n firstOnly: boolean,\n ) {\n if (!nodes) return;\n if (!Array.isArray(nodes)) nodes = [nodes];\n\n for (const node of nodes) {\n if (!node.isExample) {\n if (__isDefaultExample) {\n node.example = node.__defaultExample as ExampleJson;\n node.isExample = true;\n } else {\n // node.__isDefaultExample = false;\n node.example = (\n example\n ? textParser.toAst(example as TextAst, {\n format: textFormat,\n location: TextLocation.tag,\n })\n : undefined\n ) as ExampleJson;\n }\n if (firstOnly) break;\n }\n }\n }\n\n /**\n * Helper function to fill in the example / isExample of a node based on the values of __isDefaultExample and example.\n * This function if for 'boolean' examples.\n *\n * @param nodes\n * @param __isDefaultExample\n * @param example\n * @param firstCorrectOnly\n * @returns\n */\n fillBooleanExample(\n nodes: WithExampleJson | WithExampleJson[],\n __isDefaultExample: boolean | undefined,\n example: ExampleJson | undefined,\n firstCorrectOnly: boolean,\n ) {\n if (!nodes) return;\n if (!Array.isArray(nodes)) nodes = [nodes];\n\n for (const node of nodes) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!node.isExample && (!firstCorrectOnly || (node as any).isCorrect)) {\n if (__isDefaultExample) {\n node.example = node.__defaultExample as ExampleJson;\n node.isExample = true;\n } else {\n // node.__isDefaultExample = false;\n node.example = BooleanUtils.toBoolean(example);\n }\n if (firstCorrectOnly) break;\n }\n }\n }\n}\n\nconst instance = new BitUtils();\n\nexport { instance as BitUtils };\n","class UrlUtils {\n fileExtensionFromUrl(url: string | undefined): string | undefined {\n let format: string | undefined;\n\n if (url) {\n try {\n const parsedUrl = new URL(url);\n const pathParts = parsedUrl.pathname.split('.');\n if (pathParts.length > 1) {\n format = pathParts[pathParts.length - 1];\n }\n } catch (_e) {\n // will return undefined\n }\n }\n\n return format;\n }\n\n domainFromUrl(url: string | undefined): string | undefined {\n let domain: string | undefined;\n\n if (url) {\n try {\n const parsedUrl = new URL(url);\n domain = parsedUrl.hostname;\n } catch (_e) {\n // will return undefined\n }\n }\n\n return domain;\n }\n}\n\nconst instance = new UrlUtils();\n\nexport { instance as UrlUtils };\n","import { type Bit, type CardBit } from '../../model/ast/Nodes.ts';\nimport { ResourceType } from '../../model/enum/ResourceType.ts';\nimport {\n type AppLinkResourceWrapperJson,\n type ArticleResourceWrapperJson,\n type AudioEmbedResourceWrapperJson,\n type AudioLinkResourceWrapperJson,\n type AudioResourceWrapperJson,\n type DocumentDownloadResourceWrapperJson,\n type DocumentEmbedResourceWrapperJson,\n type DocumentLinkResourceWrapperJson,\n type DocumentResourceWrapperJson,\n type ImageLinkResourceWrapperJson,\n type ImageResourceWrapperJson,\n type ResourceJson,\n type StillImageFilmEmbedResourceWrapperJson,\n type StillImageFilmLinkResourceWrapperJson,\n type StillImageFilmResourceWrapperJson,\n type VideoEmbedResourceWrapperJson,\n type VideoLinkResourceWrapperJson,\n type VideoResourceWrapperJson,\n type WebsiteLinkResourceWrapperJson,\n} from '../../model/json/ResourceJson.ts';\nimport { StringUtils } from '../../utils/StringUtils.ts';\n\n/**\n * Validates a node as the builder level (i.e. when creating AST).\n *\n * This is not really implemented yet.\n * Validation happens in the bitmark parsing, but not when creating the AST.\n * This means that the JSON => bitmark conversion is not well validated yet.\n */\nclass NodeValidator {\n validateBit(bit: Bit | undefined): Bit | undefined {\n if (!bit) return bit;\n\n // TODO\n const ret: Bit | undefined = bit;\n // switch (bit.bitType.root) {\n // case BitType.interview:\n // ret = this.validateInterviewBit(bit);\n // break;\n // }\n\n return ret;\n }\n\n validateCardBit(bit: CardBit | undefined): CardBit | undefined {\n if (!bit) return bit;\n\n const ret: CardBit | undefined = bit;\n // TODO\n\n return ret;\n }\n\n validateResource<T extends ResourceJson>(resource: T | undefined): T | undefined {\n if (!resource) return undefined;\n\n let ret: T | undefined = resource;\n let valid = false;\n\n switch (resource.type) {\n case ResourceType.image:\n // case ResourceTag.imagePortrait:\n // case ResourceTag.imageLandscape:\n valid = !!(resource as ImageResourceWrapperJson).image.src;\n break;\n case ResourceType.imageLink:\n valid = !!(resource as ImageLinkResourceWrapperJson).imageLink.url;\n break;\n case ResourceType.audio:\n valid = !!(resource as AudioResourceWrapperJson).audio.src;\n break;\n case ResourceType.audioEmbed:\n valid = !!(resource as AudioEmbedResourceWrapperJson).audioEmbed.src;\n break;\n case ResourceType.audioLink:\n valid = !!(resource as AudioLinkResourceWrapperJson).audioLink.url;\n break;\n case ResourceType.video:\n valid = !!(resource as VideoResourceWrapperJson).video.src;\n break;\n case ResourceType.videoEmbed:\n valid = !!(resource as VideoEmbedResourceWrapperJson).videoEmbed.url;\n break;\n case ResourceType.videoLink:\n valid = !!(resource as VideoLinkResourceWrapperJson).videoLink.url;\n break;\n case ResourceType.stillImageFilm:\n valid =\n !!(resource as StillImageFilmResourceWrapperJson).image.src &&\n !!(resource as StillImageFilmResourceWrapperJson).audio.src;\n break;\n case ResourceType.stillImageFilmEmbed:\n valid = !!(resource as StillImageFilmEmbedResourceWrapperJson).stillImageFilmEmbed.url;\n break;\n case ResourceType.stillImageFilmLink:\n valid = !!(resource as StillImageFilmLinkResourceWrapperJson).stillImageFilmLink.url;\n break;\n case ResourceType.article:\n valid = !!(resource as ArticleResourceWrapperJson).article.body;\n break;\n case ResourceType.document:\n valid = !!(resource as DocumentResourceWrapperJson).document.url;\n break;\n case ResourceType.documentEmbed:\n valid = !!(resource as DocumentEmbedResourceWrapperJson).documentEmbed.url;\n break;\n case ResourceType.documentLink:\n valid = !!(resource as DocumentLinkResourceWrapperJson).documentLink.url;\n break;\n case ResourceType.documentDownload:\n valid = !!(resource as DocumentDownloadResourceWrapperJson).documentDownload.url;\n break;\n case ResourceType.appLink:\n valid = !!(resource as AppLinkResourceWrapperJson).appLink.url;\n break;\n case ResourceType.websiteLink:\n valid = !!(resource as WebsiteLinkResourceWrapperJson).websiteLink.url;\n break;\n\n default:\n valid = false;\n }\n\n // Note: even if resource is invalid, we still return it as it is used to set the resource attachment type\n // in the bit declaration, and if it is removed completely this cannot be done.\n if (!valid) {\n if (resource.type) {\n ret = {\n type: resource.type,\n // __typeAlias: resource.type,\n } as T;\n }\n }\n\n return ret;\n }\n\n isRequired(val: unknown, name: string) {\n if (val) return;\n throw new Error(`${name} is required but is not set`);\n }\n\n isOneOfRequired(vals: unknown[], names: string[]) {\n if (Array.isArray(vals)) {\n for (const v of vals) {\n if (v) return;\n }\n }\n\n throw new Error(`One of '${names.join(', ')}' is required but none is set`);\n }\n\n isString(val: unknown, name: string) {\n if (StringUtils.isString(val)) return;\n throw new Error(`${name} is required to be a string`);\n }\n\n isNonEmptyString(val: unknown, name: string) {\n if (StringUtils.isString(val) && val !== '') return;\n throw new Error(`${name} is required to be a non-empty string`);\n }\n\n isStringOrBoolean(val: unknown, name: string) {\n if (StringUtils.isString(val)) return;\n if (val === true || val === false) return;\n throw new Error(`${name} is required to be a string or a boolean`);\n }\n\n isNonEmptyStringOrBoolean(val: unknown, name: string) {\n if (StringUtils.isString(val) && val !== '') return;\n if (val === true || val === false) return;\n throw new Error(`${name} is required to be a non-empty string or a boolean`);\n }\n\n isArray(val: unknown, name: string) {\n if (Array.isArray(val)) return;\n throw new Error(`${name} is required to be a array`);\n }\n\n isNonEmptyArray(val: unknown, name: string) {\n if (Array.isArray(val) && val.length > 0) return;\n throw new Error(`${name} is required to be a non-empty array`);\n }\n\n isNumber(val: unknown, name: string) {\n if (Number.isFinite(val)) return;\n throw new Error(`${name} is required to be a number`);\n }\n\n isBoolean(val: unknown, name: string) {\n if (val === true || val === false) return;\n throw new Error(`${name} is required to be a boolean`);\n }\n\n isStringOrNumberOrBooleanOrNullOrUndefined(val: unknown, name: string) {\n if (StringUtils.isString(val)) return;\n if (Number.isFinite(val)) return;\n if (val === true || val === false) return;\n if (val == null) return;\n throw new Error(\n `${name} is required to be a string or a number or a boolean or null or undefined`,\n );\n }\n\n //\n // private\n //\n\n // private validateInterviewBit(bit: Bit): Bit | undefined {\n // // Ensure bit has a questions array as the\n // // ===\n // // ===\n // // must be included in the markup\n // if (!bit.cardNode) {\n // bit.cardNode = {};\n // }\n\n // if (!bit.cardNode.questions) {\n // bit.cardNode.questions = [];\n // }\n\n // return bit;\n // }\n}\n\nconst nodeValidator = new NodeValidator();\n\nexport { nodeValidator as NodeValidator };\n","import { Breakscape } from '../breakscaping/Breakscape.ts';\nimport { Config } from '../config/Config.ts';\nimport { type TextAst } from '../model/ast/TextNodes.ts';\nimport { BitType } from '../model/enum/BitType.ts';\nimport {\n ResourceType,\n resourceTypeToConfigKey,\n type ResourceTypeType,\n} from '../model/enum/ResourceType.ts';\nimport { TextLocation } from '../model/enum/TextLocation.ts';\nimport {\n type AppLinkResourceWrapperJson,\n type ArticleResourceWrapperJson,\n type AudioEmbedResourceWrapperJson,\n type AudioLinkResourceWrapperJson,\n type AudioResourceWrapperJson,\n type DocumentDownloadResourceWrapperJson,\n type DocumentEmbedResourceWrapperJson,\n type DocumentLinkResourceWrapperJson,\n type DocumentResourceWrapperJson,\n type ImageLinkResourceWrapperJson,\n type ImageResourceJson,\n type ImageResourceWrapperJson,\n type ImageResponsiveResourceJson,\n type ResourceDataJson,\n type ResourceJson,\n type StillImageFilmEmbedResourceWrapperJson,\n type StillImageFilmLinkResourceWrapperJson,\n type StillImageFilmResourceJson,\n type VideoEmbedResourceWrapperJson,\n type VideoLinkResourceWrapperJson,\n type VideoResourceWrapperJson,\n type WebsiteLinkResourceWrapperJson,\n} from '../model/json/ResourceJson.ts';\nimport { ObjectUtils } from '../utils/ObjectUtils.ts';\nimport { StringUtils } from '../utils/StringUtils.ts';\nimport { UrlUtils } from '../utils/UrlUtils.ts';\nimport { BaseBuilder, type BuildContext } from './BaseBuilder.ts';\nimport { NodeValidator } from './rules/NodeValidator.ts';\n\n/**\n * Builder to build bitmark Resource AST nodes programmatically\n */\nclass ResourceBuilder extends BaseBuilder {\n /**\n * Build and validate resource JSON object(s) from external resource JSON object(s)\n *\n * Note: a single input resource object can be converted to multiple resource objects\n * (e.g. stillImageFilm -> image + audio)\n *\n * @param bitType\n * @param resource\n * @returns\n */\n public resourceFromResourceJson(\n context: BuildContext,\n resource?: Partial<ResourceJson> | Partial<ResourceJson>[],\n ): ResourceJson | ResourceJson[] | undefined {\n if (!resource) return undefined;\n\n const nodes: ResourceJson[] | undefined = [];\n\n // Convert single resource to array\n if (!Array.isArray(resource)) resource = [resource];\n\n for (const thisResource of resource) {\n // Validate we have a valid resource type\n let type = ResourceType.fromValue(thisResource.type);\n if (!type) return undefined;\n\n // Get the resource key\n const resourceKey = ResourceType.keyFromValue(type);\n if (!resourceKey) return undefined;\n\n // Override original type with type alias if present\n const __typeAlias = ResourceType.fromValue(thisResource.__typeAlias);\n type = __typeAlias ?? type;\n\n let data: ResourceDataJson | undefined;\n\n // TODO: This code should use the config to handle the combo resources. For now the logic is hardcoded\n\n // Handle special cases for multiple resource bits (imageResponsive, stillImageFilm)\n if (type === ResourceType.imageResponsive) {\n const r = thisResource as unknown as ImageResponsiveResourceJson;\n const imagePortraitNode = this.resourceFromResourceDataJson(\n context,\n ResourceType.imagePortrait,\n r.imagePortrait,\n );\n const imageLandscapeNode = this.resourceFromResourceDataJson(\n context,\n ResourceType.imageLandscape,\n r.imageLandscape,\n );\n if (imagePortraitNode) nodes.push(imagePortraitNode);\n if (imageLandscapeNode) nodes.push(imageLandscapeNode);\n } else if (type === ResourceType.stillImageFilm) {\n const r = thisResource as unknown as StillImageFilmResourceJson;\n const imageNode = this.resourceFromResourceDataJson(context, ResourceType.image, r.image);\n const audioNode = this.resourceFromResourceDataJson(context, ResourceType.audio, r.audio);\n if (imageNode) nodes.push(imageNode);\n if (audioNode) nodes.push(audioNode);\n } else {\n // Standard single resource case\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = (thisResource as any)[resourceKey];\n\n if (!data) return undefined;\n\n const node = this.resourceFromResourceDataJson(context, type, data);\n if (node) nodes.push(node);\n }\n }\n\n if (nodes.length === 0) return undefined;\n if (nodes.length === 1) return nodes[0];\n return nodes;\n }\n\n public resourceFromResourceDataJson(\n context: BuildContext,\n type: ResourceTypeType,\n data: Partial<ResourceDataJson> | undefined,\n ): ResourceJson | undefined {\n if (!data) return undefined;\n type = ResourceType.fromValue(type) as ResourceTypeType;\n if (!type) return undefined;\n\n const dataAsString: string | undefined = StringUtils.isString(data)\n ? (data as unknown as string)\n : undefined;\n\n // url / src / href / app\n const url = data.url || data.src || data.body || dataAsString;\n\n // Sub resources\n const posterImage = data.posterImage\n ? (\n this.resourceFromResourceDataJson(\n context,\n ResourceType.image,\n data.posterImage,\n ) as ImageResourceWrapperJson\n )?.image\n : undefined;\n const thumbnails = data.thumbnails\n ? data.thumbnails.map((t) => {\n return (\n this.resourceFromResourceDataJson(\n context,\n ResourceType.image,\n t,\n ) as ImageResourceWrapperJson\n )?.image;\n })\n : undefined;\n\n // Resource\n const node = this.resource(context, {\n type,\n\n // Generic (except Article / Document)\n value: url,\n\n // ImageLikeResource / AudioLikeResource / VideoLikeResource / Article / Document\n format: data.format,\n\n // ImageLikeResource\n src1x: data.src1x,\n src2x: data.src2x,\n src3x: data.src3x,\n src4x: data.src4x,\n caption: this.handleJsonText(context, TextLocation.tag, data.caption),\n\n // ImageLikeResource / VideoLikeResource\n width: data.width ?? undefined,\n height: data.height ?? undefined,\n alt: data.alt,\n zoomDisabled: data.zoomDisabled,\n\n // VideoLikeResource\n duration: data.duration,\n mute: data.mute,\n autoplay: data.autoplay,\n allowSubtitles: data.allowSubtitles,\n showSubtitles: data.showSubtitles,\n posterImage,\n thumbnails,\n\n // WebsiteLinkResource\n siteName: undefined, //data.siteName,\n\n // Generic Resource\n license: data.license,\n copyright: data.copyright,\n showInIndex: data.showInIndex,\n search: data.search,\n });\n\n return node;\n }\n\n /**\n * Build resource node\n *\n * @param data - data for the node\n * @returns\n */\n /* private */ resource(\n context: BuildContext,\n data: {\n type: ResourceTypeType;\n\n // Generic part (value of bit tag)\n value?: string; // url / src / href / app / body\n\n // ImageLikeResource / AudioLikeResource / VideoLikeResource / Article / Document\n format?: string;\n\n // ImageLikeResource\n src1x?: string;\n src2x?: string;\n src3x?: string;\n src4x?: string;\n\n // ImageLikeResource / VideoLikeResource\n width?: string;\n height?: string;\n alt?: string;\n zoomDisabled?: boolean;\n\n // VideoLikeResource\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n allowSubtitles?: boolean;\n showSubtitles?: boolean;\n posterImage?: ImageResourceJson;\n thumbnails?: ImageResourceJson[];\n\n // WebsiteLinkResource\n siteName?: string;\n\n // Generic Resource\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n //\n ): ResourceJson | undefined {\n let node: ResourceJson | undefined;\n\n const { type, value: valueIn, format: formatIn, ...rest } = data;\n const finalData = {\n type,\n value: valueIn ?? Breakscape.EMPTY_STRING,\n format: formatIn ?? Breakscape.EMPTY_STRING,\n ...rest,\n };\n\n // Special case for video like tags - build thumbnails from the srcXx properties\n switch (type) {\n case ResourceType.video:\n case ResourceType.videoEmbed:\n case ResourceType.videoLink:\n case ResourceType.stillImageFilmEmbed:\n case ResourceType.stillImageFilmLink: {\n const thumbnailKeys = ['src1x', 'src2x', 'src3x', 'src4x'];\n const thumbnails: ImageResourceJson[] = [];\n for (const k of thumbnailKeys) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const dataAsAny = data as any;\n const value = dataAsAny[k];\n if (value) {\n const image: ImageResourceWrapperJson = this.resource(context, {\n type: ResourceType.image,\n value,\n }) as ImageResourceWrapperJson;\n if (image) thumbnails.push(image.image as ImageResourceJson);\n }\n }\n // Merge with existing thumbnails\n finalData.thumbnails = [...(finalData.thumbnails || []), ...thumbnails];\n }\n }\n\n switch (type) {\n case ResourceType.image:\n case ResourceType.imagePortrait:\n case ResourceType.imageLandscape:\n case ResourceType.backgroundWallpaper:\n case ResourceType.imagePlaceholder:\n case ResourceType.icon:\n node = this.imageResource(context, finalData, type);\n break;\n\n // case ResourceType.imageResponsive: {\n // node = this.imageResponsiveResource({\n // imagePortrait: this.imageResource(\n // finalData.imagePortrait ?? {\n // format: '',\n // value: '',\n // },\n // ),\n // imageLandscape: this.imageResource(\n // finalData.imageLandscape ?? {\n // format: '',\n // value: '',\n // },\n // ),\n // });\n // break;\n // }\n\n case ResourceType.imageLink:\n node = this.imageLinkResource(context, finalData);\n break;\n\n case ResourceType.audio:\n node = this.audioResource(context, finalData);\n break;\n\n case ResourceType.audioEmbed:\n node = this.audioEmbedResource(context, finalData);\n break;\n\n case ResourceType.audioLink:\n node = this.audioLinkResource(context, finalData);\n break;\n\n case ResourceType.video:\n node = this.videoResource(context, finalData);\n break;\n\n case ResourceType.videoEmbed:\n node = this.videoEmbedResource(context, finalData);\n break;\n\n case ResourceType.videoLink:\n node = this.videoLinkResource(context, finalData);\n break;\n\n // case ResourceType.stillImageFilm: {\n // node = this.stillImageFilmResource({\n // image: this.imageResource(context,\n // finalData.image ?? {\n // format: '',\n // value: '',\n // },\n // ),\n // audio: this.audioResource(context,\n // finalData.audio ?? {\n // format: '',\n // value: '',\n // },\n // ),\n // });\n // break;\n // }\n\n case ResourceType.stillImageFilmEmbed:\n node = this.stillImageFilmEmbedResource(context, finalData);\n break;\n\n case ResourceType.stillImageFilmLink:\n node = this.stillImageFilmLinkResource(context, finalData);\n break;\n\n case ResourceType.article:\n node = this.articleResource(context, finalData);\n break;\n\n case ResourceType.document:\n node = this.documentResource(context, finalData);\n break;\n\n case ResourceType.documentEmbed:\n node = this.documentEmbedResource(context, finalData);\n break;\n\n case ResourceType.documentLink:\n node = this.documentLinkResource(context, finalData);\n break;\n\n case ResourceType.documentDownload:\n node = this.documentDownloadResource(context, finalData);\n break;\n\n case ResourceType.appLink:\n node = this.appLinkResource(context, finalData);\n break;\n\n case ResourceType.websiteLink:\n node = this.websiteLinkResource(context, finalData);\n break;\n\n default:\n }\n\n return node;\n }\n\n /**\n * Build imageResource node\n *\n * @param data - data for the node\n * @returns\n */\n imageResource(\n context: BuildContext,\n data: {\n format: string;\n value: string; //src\n src1x?: string;\n src2x?: string;\n src3x?: string;\n src4x?: string;\n width?: string | null;\n height?: string | null;\n alt?: string;\n zoomDisabled?: boolean;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n __typeAlias?: ResourceTypeType,\n ): ImageResourceWrapperJson | undefined {\n const {\n value,\n src1x,\n src2x,\n src3x,\n src4x,\n width,\n height,\n alt,\n zoomDisabled,\n license,\n copyright,\n showInIndex,\n caption,\n search,\n } = data;\n const { bitType } = context;\n let zoomDisabledDefault = false;\n\n if (\n Config.isOfBitType(bitType, [\n BitType.imageSeparator,\n BitType.pageBanner,\n BitType.imagesLogoGrave,\n BitType.prototypeImages,\n ])\n ) {\n zoomDisabledDefault = true;\n }\n\n // NOTE: Node order is important and is defined here\n const node: ImageResourceWrapperJson = {\n type: ResourceType.image,\n __typeAlias: __typeAlias ?? ResourceType.image,\n __configKey: resourceTypeToConfigKey(__typeAlias ?? ResourceType.image),\n image: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n src: value ?? '',\n src1x: (src1x ?? undefined) as string,\n src2x: (src2x ?? undefined) as string,\n src3x: (src3x ?? undefined) as string,\n src4x: (src4x ?? undefined) as string,\n width: (width ?? null) as string,\n height: (height ?? null) as string,\n alt: alt ?? '',\n zoomDisabled: zoomDisabled ?? zoomDisabledDefault,\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.image, {\n ignoreFalse: ['zoomDisabled', 'showInIndex'],\n ignoreEmptyArrays: ['caption'],\n ignoreUndefined: ['width', 'height'],\n ignoreEmptyString: ['src', 'alt', 'license', 'copyright'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build imageLinkResource node\n *\n * @param data - data for the node\n * @returns\n */\n imageLinkResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n src1x?: string;\n src2x?: string;\n src3x?: string;\n src4x?: string;\n width?: string;\n height?: string;\n alt?: string;\n zoomDisabled?: boolean;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): ImageLinkResourceWrapperJson | undefined {\n const {\n value,\n src1x,\n src2x,\n src3x,\n src4x,\n width,\n height,\n alt,\n zoomDisabled,\n license,\n copyright,\n showInIndex,\n caption,\n search,\n } = data;\n\n // NOTE: Node order is important and is defined here\n const node: ImageLinkResourceWrapperJson = {\n type: ResourceType.imageLink,\n __typeAlias: ResourceType.imageLink,\n __configKey: resourceTypeToConfigKey(ResourceType.imageLink),\n imageLink: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n // src: value ?? '',\n url: value ?? '',\n src1x: (src1x ?? undefined) as string,\n src2x: (src2x ?? undefined) as string,\n src3x: (src3x ?? undefined) as string,\n src4x: (src4x ?? undefined) as string,\n width: (width ?? null) as string,\n height: (height ?? null) as string,\n alt: alt ?? '',\n zoomDisabled: zoomDisabled ?? false, // TODO: Default depends on the bit(!)\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.imageLink, {\n ignoreFalse: ['zoomDisabled', 'showInIndex'],\n ignoreEmptyArrays: ['caption'],\n ignoreUndefined: ['width', 'height'],\n ignoreEmptyString: ['url', 'alt', 'license', 'copyright'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build audioResource node\n *\n * @param data - data for the node\n * @returns\n */\n audioResource(\n context: BuildContext,\n data: {\n format: string;\n value: string; // src\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): AudioResourceWrapperJson | undefined {\n const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } =\n data;\n\n // NOTE: Node order is important and is defined here\n const node: AudioResourceWrapperJson = {\n type: ResourceType.audio,\n __typeAlias: ResourceType.audio,\n __configKey: resourceTypeToConfigKey(ResourceType.audio),\n audio: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n src: value ?? '',\n duration: (duration ?? undefined) as number,\n mute: (mute ?? undefined) as boolean,\n autoplay: (autoplay ?? undefined) as boolean,\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.audio, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['src', 'alt', 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build audioEmbedResource node\n *\n * @param data - data for the node\n * @returns\n */\n audioEmbedResource(\n context: BuildContext,\n data: {\n format: string;\n value: string; // src\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): AudioEmbedResourceWrapperJson | undefined {\n const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } =\n data;\n\n // NOTE: Node order is important and is defined here\n const node: AudioEmbedResourceWrapperJson = {\n type: ResourceType.audioEmbed,\n __typeAlias: ResourceType.audioEmbed,\n __configKey: resourceTypeToConfigKey(ResourceType.audioEmbed),\n audioEmbed: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n src: value ?? '',\n duration: (duration ?? undefined) as number,\n mute: (mute ?? undefined) as boolean,\n autoplay: (autoplay ?? undefined) as boolean,\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.audioEmbed, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['src', /*'alt',*/ 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build audioLinkResource node\n *\n * @param data - data for the node\n * @returns\n */\n audioLinkResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): AudioLinkResourceWrapperJson | undefined {\n const { value, duration, mute, autoplay, license, copyright, showInIndex, caption, search } =\n data;\n\n // NOTE: Node order is important and is defined here\n const node: AudioLinkResourceWrapperJson = {\n type: ResourceType.audioLink,\n __typeAlias: ResourceType.audioLink,\n __configKey: resourceTypeToConfigKey(ResourceType.audioLink),\n audioLink: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n // src: value ?? '',\n url: value ?? '',\n duration: (duration ?? undefined) as number,\n mute: (mute ?? undefined) as boolean,\n autoplay: (autoplay ?? undefined) as boolean,\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.audioLink, {\n // ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['url' /*'alt', 'license', 'copyright'*/],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build videoResource node\n *\n * @param data - data for the node\n * @returns\n */\n videoResource(\n context: BuildContext,\n data: {\n format: string;\n value: string; // src\n width?: string;\n height?: string;\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n allowSubtitles?: boolean;\n showSubtitles?: boolean;\n alt?: string;\n posterImage?: ImageResourceJson;\n thumbnails?: ImageResourceJson[];\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): VideoResourceWrapperJson | undefined {\n const {\n value,\n width,\n height,\n duration,\n mute,\n autoplay,\n allowSubtitles,\n showSubtitles,\n alt,\n posterImage,\n thumbnails,\n license,\n copyright,\n showInIndex,\n caption,\n search,\n } = data;\n\n // NOTE: Node order is important and is defined here\n const node: VideoResourceWrapperJson = {\n type: ResourceType.video,\n __typeAlias: ResourceType.video,\n __configKey: resourceTypeToConfigKey(ResourceType.video),\n video: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n src: value ?? '',\n width: (width ?? null) as string,\n height: (height ?? null) as string,\n duration: (duration ?? undefined) as number,\n mute: (mute ?? undefined) as boolean,\n autoplay: (autoplay ?? undefined) as boolean,\n allowSubtitles: (allowSubtitles ?? undefined) as boolean,\n showSubtitles: (showSubtitles ?? undefined) as boolean,\n alt: alt ?? '',\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n // Have sub-chains so must be at end of chain\n posterImage: (posterImage ?? undefined) as ImageResourceJson,\n thumbnails: (thumbnails ?? undefined) as ImageResourceJson[],\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.video, {\n ignoreEmptyArrays: ['caption'],\n ignoreUndefined: ['width', 'height'],\n ignoreEmptyString: ['src', /*'alt',*/ 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build videoEmbedResource node\n *\n * @param data - data for the node\n * @returns\n */\n videoEmbedResource(\n context: BuildContext,\n data: {\n format: string;\n value: string; // src\n width?: string;\n height?: string;\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n allowSubtitles?: boolean;\n showSubtitles?: boolean;\n alt?: string;\n posterImage?: ImageResourceJson;\n thumbnails?: ImageResourceJson[];\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): VideoEmbedResourceWrapperJson | undefined {\n const {\n value,\n width,\n height,\n duration,\n mute,\n autoplay,\n allowSubtitles,\n showSubtitles,\n alt,\n posterImage,\n thumbnails,\n license,\n copyright,\n showInIndex,\n caption,\n search,\n } = data;\n\n // NOTE: Node order is important and is defined here\n const node: VideoEmbedResourceWrapperJson = {\n type: ResourceType.videoEmbed,\n __typeAlias: ResourceType.videoEmbed,\n __configKey: resourceTypeToConfigKey(ResourceType.videoEmbed),\n videoEmbed: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n // src: value ?? '',\n url: value ?? '',\n width: (width ?? null) as string,\n height: (height ?? null) as string,\n duration: (duration ?? undefined) as number,\n mute: (mute ?? undefined) as boolean,\n autoplay: (autoplay ?? undefined) as boolean,\n allowSubtitles: (allowSubtitles ?? undefined) as boolean,\n showSubtitles: (showSubtitles ?? undefined) as boolean,\n alt: alt ?? '',\n posterImage: (posterImage ?? undefined) as ImageResourceJson,\n thumbnails: (thumbnails ?? undefined) as ImageResourceJson[],\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.videoEmbed, {\n ignoreEmptyArrays: ['caption'],\n ignoreUndefined: ['width', 'height'],\n ignoreEmptyString: ['url', /*'alt',*/ 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build videoLinkResource node\n *\n * @param data - data for the node\n * @returns\n */\n videoLinkResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n width?: string;\n height?: string;\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n allowSubtitles?: boolean;\n showSubtitles?: boolean;\n alt?: string;\n posterImage?: ImageResourceJson;\n thumbnails?: ImageResourceJson[];\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): VideoLinkResourceWrapperJson | undefined {\n const {\n value,\n width,\n height,\n duration,\n mute,\n autoplay,\n allowSubtitles,\n showSubtitles,\n alt,\n posterImage,\n thumbnails,\n license,\n copyright,\n showInIndex,\n caption,\n search,\n } = data;\n\n // NOTE: Node order is important and is defined here\n const node: VideoLinkResourceWrapperJson = {\n type: ResourceType.videoLink,\n __typeAlias: ResourceType.videoLink,\n __configKey: resourceTypeToConfigKey(ResourceType.videoLink),\n videoLink: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n // src: value ?? '',\n url: value ?? '',\n width: (width ?? null) as string,\n height: (height ?? null) as string,\n duration: (duration ?? undefined) as number,\n mute: (mute ?? undefined) as boolean,\n autoplay: (autoplay ?? undefined) as boolean,\n allowSubtitles: (allowSubtitles ?? undefined) as boolean,\n showSubtitles: (showSubtitles ?? undefined) as boolean,\n alt: alt ?? '',\n posterImage: (posterImage ?? undefined) as ImageResourceJson,\n thumbnails: (thumbnails ?? undefined) as ImageResourceJson[],\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.videoLink, {\n ignoreEmptyArrays: ['caption'],\n ignoreUndefined: ['width', 'height'],\n ignoreEmptyString: ['url', /*'alt',*/ 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n // /**\n // * Build stillImageFilmResource node\n // *\n // * @param data - data for the node\n // * @returns\n // */\n // stillImageFilmResource(context: BuildContext, data: { image?: ImageResource; audio?: AudioResource }): StillImageFilmResource {\n // const { image, audio } = data;\n\n // // NOTE: Node order is important and is defined here\n // const node: StillImageFilmResource = {\n // type: ResourceType.stillImageFilm,\n // __typeAlias: ResourceType.stillImageFilm,\n // image: image ?? this.imageResource({ format: '', value: '' }),\n // audio: audio ?? this.audioResource({ format: '', value: '' }),\n // };\n\n // // Remove Unset Optionals\n // ObjectUtils.removeUnwantedProperties(node);\n\n // // Validate and correct invalid bits as much as possible\n // return NodeValidator.validateResource(node) ;\n // }\n\n /**\n * Build stillImageFilmEmbedResource node\n *\n * @param data - data for the node\n * @returns\n */\n stillImageFilmEmbedResource(\n context: BuildContext,\n data: {\n format: string;\n value: string; // src\n width?: string;\n height?: string;\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n allowSubtitles?: boolean;\n showSubtitles?: boolean;\n alt?: string;\n posterImage?: ImageResourceJson;\n thumbnails?: ImageResourceJson[];\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): StillImageFilmEmbedResourceWrapperJson | undefined {\n const {\n value,\n width,\n height,\n duration,\n mute,\n autoplay,\n allowSubtitles,\n showSubtitles,\n alt,\n posterImage,\n thumbnails,\n license,\n copyright,\n showInIndex,\n caption,\n search,\n } = data;\n\n // NOTE: Node order is important and is defined here\n const node: StillImageFilmEmbedResourceWrapperJson = {\n type: ResourceType.stillImageFilmEmbed,\n __typeAlias: ResourceType.stillImageFilmEmbed,\n __configKey: resourceTypeToConfigKey(ResourceType.stillImageFilmEmbed),\n stillImageFilmEmbed: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n // src: value ?? '',\n url: value ?? '',\n width: (width ?? null) as string,\n height: (height ?? null) as string,\n duration: (duration ?? undefined) as number,\n mute: (mute ?? undefined) as boolean,\n autoplay: (autoplay ?? undefined) as boolean,\n allowSubtitles: (allowSubtitles ?? undefined) as boolean,\n showSubtitles: (showSubtitles ?? undefined) as boolean,\n alt: alt ?? '',\n posterImage: (posterImage ?? undefined) as ImageResourceJson,\n thumbnails: (thumbnails ?? undefined) as ImageResourceJson[],\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.stillImageFilmEmbed, {\n ignoreEmptyArrays: ['caption'],\n ignoreUndefined: ['width', 'height'],\n ignoreEmptyString: ['url', /*'alt',*/ 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build stillImageFilmLinkResource node\n *\n * @param data - data for the node\n * @returns\n */\n stillImageFilmLinkResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n width?: string;\n height?: string;\n duration?: number; // string?\n mute?: boolean;\n autoplay?: boolean;\n allowSubtitles?: boolean;\n showSubtitles?: boolean;\n alt?: string;\n posterImage?: ImageResourceJson;\n thumbnails?: ImageResourceJson[];\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): StillImageFilmLinkResourceWrapperJson | undefined {\n const {\n value,\n width,\n height,\n duration,\n mute,\n autoplay,\n allowSubtitles,\n showSubtitles,\n alt,\n posterImage,\n thumbnails,\n license,\n copyright,\n showInIndex,\n caption,\n search,\n } = data;\n\n // NOTE: Node order is important and is defined here\n const node: StillImageFilmLinkResourceWrapperJson = {\n type: ResourceType.stillImageFilmLink,\n __typeAlias: ResourceType.stillImageFilmLink,\n __configKey: resourceTypeToConfigKey(ResourceType.stillImageFilmLink),\n stillImageFilmLink: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n // src: value ?? '',\n url: value ?? '',\n width: (width ?? null) as string,\n height: (height ?? null) as string,\n duration: (duration ?? undefined) as number,\n mute: (mute ?? undefined) as boolean,\n autoplay: (autoplay ?? undefined) as boolean,\n allowSubtitles: (allowSubtitles ?? undefined) as boolean,\n showSubtitles: (showSubtitles ?? undefined) as boolean,\n alt: alt ?? '',\n posterImage: (posterImage ?? undefined) as ImageResourceJson,\n thumbnails: (thumbnails ?? undefined) as ImageResourceJson[],\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.stillImageFilmLink, {\n ignoreEmptyArrays: ['caption'],\n ignoreUndefined: ['width', 'height'],\n ignoreEmptyString: ['url', /*'alt',*/ 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build articleResource node\n *\n * @param data - data for the node\n * @returns\n */\n articleResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): ArticleResourceWrapperJson | undefined {\n const { value, license, copyright, showInIndex, caption, search } = data;\n\n // NOTE: Node order is important and is defined here\n const node: ArticleResourceWrapperJson = {\n type: ResourceType.article,\n __typeAlias: ResourceType.article,\n __configKey: resourceTypeToConfigKey(ResourceType.article),\n article: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n body: value ?? '',\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.article, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['body', 'alt', 'license', 'copyright'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build documentResource node\n *\n * @param data - data for the node\n * @returns\n */\n documentResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): DocumentResourceWrapperJson | undefined {\n const { value, license, copyright, showInIndex, caption, search } = data;\n\n // NOTE: Node order is important and is defined here\n const node: DocumentResourceWrapperJson = {\n type: ResourceType.document,\n __typeAlias: ResourceType.document,\n __configKey: resourceTypeToConfigKey(ResourceType.document),\n document: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n url: value ?? '',\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.document, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['url', 'alt', 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build documentEmbedResource node\n *\n * @param data - data for the node\n * @returns\n */\n documentEmbedResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): DocumentEmbedResourceWrapperJson | undefined {\n const { value, license, copyright, showInIndex, caption, search } = data;\n\n // NOTE: Node order is important and is defined here\n const node: DocumentEmbedResourceWrapperJson = {\n type: ResourceType.documentEmbed,\n __typeAlias: ResourceType.documentEmbed,\n __configKey: resourceTypeToConfigKey(ResourceType.documentEmbed),\n documentEmbed: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n url: value ?? '',\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.documentEmbed, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['url', 'alt', 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build documentLinkResource node\n *\n * @param data - data for the node\n * @returns\n */\n documentLinkResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): DocumentLinkResourceWrapperJson | undefined {\n const { value, license, copyright, showInIndex, caption, search } = data;\n\n // NOTE: Node order is important and is defined here\n const node: DocumentLinkResourceWrapperJson = {\n type: ResourceType.documentLink,\n __typeAlias: ResourceType.documentLink,\n __configKey: resourceTypeToConfigKey(ResourceType.documentLink),\n documentLink: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n url: value ?? '',\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.documentLink, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['url', 'alt', 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build documentDownloadResource node\n *\n * @param data - data for the node\n * @returns\n */\n documentDownloadResource(\n context: BuildContext,\n data: {\n format: string;\n value: string;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): DocumentDownloadResourceWrapperJson | undefined {\n const { value, license, copyright, showInIndex, caption, search } = data;\n\n // NOTE: Node order is important and is defined here\n const node: DocumentDownloadResourceWrapperJson = {\n type: ResourceType.documentDownload,\n __typeAlias: ResourceType.documentDownload,\n __configKey: resourceTypeToConfigKey(ResourceType.documentDownload),\n documentDownload: {\n format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n url: value ?? '',\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.documentDownload, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['url', 'alt', 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build appLinkResource node\n *\n * @param data - data for the node\n * @returns\n */\n appLinkResource(\n context: BuildContext,\n data: {\n value: string;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): AppLinkResourceWrapperJson | undefined {\n const { value, license, copyright, showInIndex, caption, search } = data;\n\n // NOTE: Node order is important and is defined here\n const node: AppLinkResourceWrapperJson = {\n type: ResourceType.appLink,\n __typeAlias: ResourceType.appLink,\n __configKey: resourceTypeToConfigKey(ResourceType.appLink),\n appLink: {\n // format: (UrlUtils.fileExtensionFromUrl(value) ?? undefined) as string,\n // provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n provider: undefined as unknown as string,\n url: value ?? '',\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.appLink, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['url', /*'alt',*/ 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n /**\n * Build websiteLinkResource node\n *\n * @param data - data for the node\n * @returns\n */\n websiteLinkResource(\n context: BuildContext,\n data: {\n value: string;\n siteName?: string;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n search?: string;\n },\n ): WebsiteLinkResourceWrapperJson | undefined {\n const { value, /*siteName,*/ license, copyright, showInIndex, caption, search } = data;\n\n // NOTE: Node order is important and is defined here\n const node: WebsiteLinkResourceWrapperJson = {\n type: ResourceType.websiteLink,\n __typeAlias: ResourceType.websiteLink,\n __configKey: resourceTypeToConfigKey(ResourceType.websiteLink),\n websiteLink: {\n // provider: (UrlUtils.domainFromUrl(value) ?? undefined) as string,\n provider: undefined as unknown as string,\n url: value ?? '',\n // siteName,\n license: license ?? '',\n copyright: copyright ?? '',\n showInIndex: showInIndex ?? false,\n caption: this.handleJsonText(context, TextLocation.tag, caption),\n search: (search ?? undefined) as string,\n },\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node.websiteLink, {\n ignoreEmptyArrays: ['caption'],\n ignoreEmptyString: ['url', 'alt', 'license', 'copyright'],\n ignoreFalse: ['showInIndex'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateResource(node);\n }\n\n //\n //\n //\n\n //\n // Private\n //\n}\n\nexport { ResourceBuilder };\n","import { Breakscape } from '../breakscaping/Breakscape.ts';\nimport { Config } from '../config/Config.ts';\nimport { type BreakscapedString } from '../model/ast/BreakscapedString.ts';\nimport {\n type Bit,\n type BitmarkAst,\n type Body,\n type CardBit,\n type CardNode,\n type ExtraProperties,\n type Footer,\n type Property,\n} from '../model/ast/Nodes.ts';\nimport { type JsonText, type TextAst, type TextNode } from '../model/ast/TextNodes.ts';\nimport { ConfigKey } from '../model/config/enum/ConfigKey.ts';\nimport { BitType, type BitTypeType } from '../model/enum/BitType.ts';\nimport { BodyBitType, type BodyBitTypeType } from '../model/enum/BodyBitType.ts';\nimport { DeprecatedTextFormat } from '../model/enum/DeprecatedTextFormat.ts';\nimport { ResourceType, type ResourceTypeType } from '../model/enum/ResourceType.ts';\nimport { TextFormat, type TextFormatType } from '../model/enum/TextFormat.ts';\nimport { TextLocation } from '../model/enum/TextLocation.ts';\nimport {\n type BookJson,\n type BotResponseJson,\n type ChoiceJson,\n type DefinitionListItemJson,\n type ExampleJson,\n type FeedbackChoiceJson,\n type FeedbackJson,\n type FeedbackReasonJson,\n type FlashcardJson,\n type HeadingJson,\n type ImageSourceJson,\n type IngredientJson,\n type MarkConfigJson,\n type MatrixCellJson,\n type MatrixJson,\n type PairJson,\n type PersonJson,\n type PronunciationTableJson,\n type QuestionJson,\n type QuizJson,\n type RatingLevelStartEndJson,\n type ResponseJson,\n type ServingsJson,\n type StatementJson,\n type TableJson,\n type TechnicalTermJson,\n type TextAndIconJson,\n} from '../model/json/BitJson.ts';\nimport {\n type BodyBitJson,\n type GapJson,\n type HighlightJson,\n type HighlightTextJson,\n type MarkJson,\n type SelectJson,\n type SelectOptionJson,\n} from '../model/json/BodyBitJson.ts';\nimport {\n type AudioResourceWrapperJson,\n type ImageResourceWrapperJson,\n type ResourceJson,\n} from '../model/json/ResourceJson.ts';\nimport { type ParserError } from '../model/parser/ParserError.ts';\nimport { type ParserInfo } from '../model/parser/ParserInfo.ts';\nimport { ArrayUtils } from '../utils/ArrayUtils.ts';\nimport { BitUtils } from '../utils/BitUtils.ts';\nimport { BooleanUtils } from '../utils/BooleanUtils.ts';\nimport { env } from '../utils/env/Env.ts';\nimport { NumberUtils } from '../utils/NumberUtils.ts';\nimport { ObjectUtils } from '../utils/ObjectUtils.ts';\nimport { StringUtils } from '../utils/StringUtils.ts';\nimport { BaseBuilder, type BuildContext, type WithExampleJson } from './BaseBuilder.ts';\nimport { ResourceBuilder } from './ResourceBuilder.ts';\nimport { NodeValidator } from './rules/NodeValidator.ts';\n\nexport interface BuildBitOptions {\n cardSet?: {\n sideNo: number; // Side number of the card set\n variantNo: number; // Variant number of the card set\n };\n}\n\n/**\n * Builder to build bitmark AST node programmatically\n */\nclass Builder extends BaseBuilder {\n private resourceBuilder: ResourceBuilder = new ResourceBuilder();\n\n /**\n * Build bitmark node\n *\n * @param data - data for the node\n * @returns\n */\n buildBitmark(data: { bits?: Bit[]; errors?: ParserError[] }): BitmarkAst {\n const { bits, errors } = data;\n\n const node: BitmarkAst = {\n bits,\n errors,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node);\n\n return node;\n }\n\n /**\n * Build bit node\n *\n * @param data - data for the node\n * @returns\n */\n buildBit(\n data: {\n bitType: BitTypeType;\n bitLevel: number;\n textFormat?: TextFormatType;\n resourceType?: ResourceTypeType; // This is optional, it will be inferred from the resource\n isCommented?: boolean;\n id?: string | string[];\n internalComment?: string | string[];\n customerId?: string;\n customerExternalId?: string | string[];\n externalId?: string | string[];\n spaceId?: string | string[];\n padletId?: string;\n jupyterId?: string;\n jupyterExecutionCount?: number;\n isPublic?: boolean;\n isTemplate?: boolean;\n isTemplateStripTheme?: boolean;\n aiGenerated?: boolean;\n machineTranslated?: string;\n searchIndex?: string | string[];\n analyticsTag?: string | string[];\n categoryTag?: string | string[];\n topicTag?: string | string[];\n altLangTag?: string;\n feedbackEngine?: string;\n feedbackType?: string;\n disableFeedback?: boolean;\n diffTo?: string;\n diffOp?: string;\n diffRef?: string;\n diffContext?: string;\n diffTime?: number;\n path?: string;\n releaseVersion?: string;\n releaseKind?: string;\n releaseDate?: string;\n ageRange?: number | number[];\n lang?: string;\n language?: string | string[];\n publisher?: string | string[];\n publisherName?: string;\n theme?: string | string[];\n computerLanguage?: string;\n target?: string | string[];\n slug?: string;\n tag?: string | string[];\n reductionTag?: string | string[];\n bubbleTag?: string | string[];\n levelCEFRp?: string | string[];\n levelCEFR?: string | string[];\n levelILR?: string | string[];\n levelACTFL?: string | string[];\n icon?: string;\n iconTag?: string;\n colorTag?: string | string[];\n flashcardSet?: string | string[];\n subtype?: string;\n bookAlias?: string | string[];\n bookDiff?: string;\n coverImage?: string | string[];\n coverColor?: string;\n publications?: string | string[];\n author?: string | string[];\n subject?: string | string[];\n date?: string;\n dateEnd?: string;\n location?: string;\n kind?: string;\n hasMarkAsDone?: boolean;\n processHandIn?: boolean;\n processHandInLocation?: string;\n chatWithBook?: boolean;\n chatWithBookBrainKey?: string;\n action?: string;\n showInIndex?: boolean;\n refAuthor?: string | string[];\n refBookTitle?: string;\n refPublisher?: string | string[];\n refPublicationYear?: string;\n citationStyle?: string;\n blockId?: string;\n pageNo?: number;\n x?: number;\n y?: number;\n width?: string;\n height?: string;\n index?: number;\n classification?: string;\n availableClassifications?: string | string[];\n allowedBit?: string | string[];\n tableFixedHeader?: boolean;\n tableHeaderWhitespaceNoWrap?: boolean;\n tableSearch?: boolean;\n tableSort?: boolean;\n tablePagination?: boolean;\n tablePaginationLimit?: number;\n tableHeight?: number;\n tableWhitespaceNoWrap?: boolean;\n tableAutoWidth?: boolean;\n tableResizableColumns?: boolean;\n tableColumnMinWidth?: number;\n quizCountItems?: boolean;\n quizStrikethroughSolutions?: boolean;\n codeLineNumbers?: boolean;\n codeMinimap?: boolean;\n stripePricingTableId?: string;\n stripePublishableKey?: string;\n thumbImage?: string;\n scormSource?: string;\n posterImage?: string;\n focusX?: number;\n focusY?: number;\n pointerLeft?: string;\n pointerTop?: string;\n listItemIndent?: number;\n backgroundWallpaper?: Partial<ImageResourceWrapperJson>;\n hasBookNavigation?: boolean;\n duration?: string;\n referenceProperty?: string | string[];\n deeplink?: string | string[];\n externalLink?: string;\n externalLinkText?: string;\n videoCallLink?: string;\n vendorDashboardId?: string;\n vendorSurveyId?: string;\n vendorUrl?: string;\n search?: string;\n bot?: string | string[];\n list?: string | string[];\n layer?: string | string[];\n layerRole?: string | string[];\n textReference?: string;\n isTracked?: boolean;\n isInfoOnly?: boolean;\n imageFirst?: boolean;\n activityType?: string;\n labelTrue?: string;\n labelFalse?: string;\n content2Buy?: string;\n mailingList?: string;\n buttonCaption?: string;\n callToActionUrl?: string;\n caption?: JsonText;\n quotedPerson?: string;\n reasonableNumOfChars?: number;\n resolved?: boolean;\n resolvedDate?: string;\n resolvedBy?: string;\n handInAcceptFileType?: string | string[];\n handInRequirement?: string | string[];\n handInInstruction?: string;\n maxCreatedBits?: number;\n maxDisplayLevel?: number;\n maxTocChapterLevel?: number;\n tocResource?: string | string[];\n tocContent?: string | string[];\n page?: string | string[];\n productId?: string | string[];\n product?: string | string[];\n // productList?: string | string[];\n productVideo?: string | string[];\n // productVideoList?: string | string[];\n productFolder?: string;\n technicalTerm?: Partial<TechnicalTermJson>;\n servings?: Partial<ServingsJson>;\n ratingLevelStart?: Partial<RatingLevelStartEndJson>;\n ratingLevelEnd?: Partial<RatingLevelStartEndJson>;\n ratingLevelSelected?: number;\n partialAnswer?: string;\n book?: string | BookJson[];\n title?: JsonText;\n subtitle?: JsonText;\n level?: number | string;\n toc?: boolean;\n progress?: boolean;\n anchor?: string;\n reference?: string;\n referenceEnd?: string;\n revealSolutions?: boolean;\n isCaseSensitive?: boolean;\n item?: JsonText;\n lead?: JsonText;\n pageNumber?: JsonText;\n marginNumber?: JsonText;\n hint?: JsonText;\n instruction?: JsonText;\n example?: Partial<ExampleJson>;\n imageSource?: Partial<ImageSourceJson>;\n person?: Partial<PersonJson>;\n extraProperties?: {\n [key: string]: unknown | unknown[];\n };\n\n markConfig?: Partial<MarkConfigJson>[];\n imagePlaceholder?: Partial<ImageResourceWrapperJson>;\n resources?: Partial<ResourceJson> | Partial<ResourceJson>[];\n body?: Partial<Body>;\n sampleSolution?: string;\n additionalSolutions?: string | string[];\n heading?: Partial<HeadingJson>;\n elements?: string[];\n flashcards?: Partial<FlashcardJson>[];\n definitions?: Partial<DefinitionListItemJson>[];\n legend?: Partial<DefinitionListItemJson>[];\n statement?: Partial<StatementJson>;\n statements?: Partial<StatementJson>[];\n responses?: Partial<ResponseJson>[];\n quizzes?: Partial<QuizJson>[];\n pairs?: Partial<PairJson>[];\n matrix?: Partial<MatrixJson>[];\n pronunciationTable?: Partial<PronunciationTableJson>;\n table?: Partial<TableJson>;\n choices?: Partial<ChoiceJson>[];\n questions?: Partial<QuestionJson>[];\n botResponses?: Partial<BotResponseJson>[];\n ingredients?: Partial<IngredientJson>[];\n // DEPRECATED - TO BE REMOVED IN THE FUTURE\n // captionDefinitionList?: Partial<CaptionDefinitionListJson>;\n cardBits?: Partial<CardBit>[];\n footer?: Partial<Footer>;\n\n markup?: string;\n parser?: ParserInfo;\n __isDefaultExample?: boolean;\n },\n options?: BuildBitOptions,\n ): Bit | undefined {\n const bitType = data.bitType;\n const bitConfig = Config.getBitConfig(bitType);\n\n // Text Format (accepts deprecated values, and converts them to the new format)\n const deprecatedTextFormat = DeprecatedTextFormat.fromValue(data.textFormat);\n let textFormat = TextFormat.fromValue(data.textFormat) ?? bitConfig.textFormatDefault;\n if (deprecatedTextFormat === DeprecatedTextFormat.bitmarkMinusMinus) {\n textFormat = TextFormat.bitmarkText;\n }\n\n const context: BuildContext = {\n bitConfig,\n bitType,\n textFormat,\n };\n\n // Validate and convert resources, and ensure it is an array\n // const resources = ArrayUtils.asArray(resourcesIn);\n\n // Set the card node data\n const cardNode = this.buildCardNode(context, data);\n\n // Add reasonableNumOfChars to the bit only for essay bits (in other cases it will be pushed down the tree)\n const reasonableNumOfCharsProperty = Config.isOfBitType(data.bitType, BitType.essay)\n ? this.toAstProperty(\n bitType,\n ConfigKey.property_reasonableNumOfChars,\n data.reasonableNumOfChars,\n options,\n )\n : undefined;\n\n const convertedExample = {\n ...this.toExample(data.__isDefaultExample, data.example as TextAst),\n };\n\n // NOTE: Node order is important and is defined here\n const node: Bit = {\n bitType,\n bitLevel: data.bitLevel,\n textFormat,\n resourceType: ResourceType.fromValue(data.resourceType),\n isCommented: data.isCommented,\n\n // Properties\n id: this.toAstProperty(bitType, ConfigKey.property_id, data.id, options),\n internalComment: this.toAstProperty(\n bitType,\n ConfigKey.property_internalComment,\n data.internalComment,\n options,\n ),\n customerId: this.toAstProperty(\n bitType,\n ConfigKey.property_customerId,\n data.customerId,\n options,\n ),\n customerExternalId: this.toAstProperty(\n bitType,\n ConfigKey.property_customerExternalId,\n data.customerExternalId,\n options,\n ),\n externalId: this.toAstProperty(\n bitType,\n ConfigKey.property_externalId,\n data.externalId,\n options,\n ),\n spaceId: this.toAstProperty(bitType, ConfigKey.property_spaceId, data.spaceId, options),\n padletId: this.toAstProperty(bitType, ConfigKey.property_padletId, data.padletId, options),\n jupyterId: this.toAstProperty(bitType, ConfigKey.property_jupyterId, data.jupyterId, options),\n jupyterExecutionCount: this.toAstProperty(\n bitType,\n ConfigKey.property_jupyterExecutionCount,\n data.jupyterExecutionCount,\n options,\n ),\n isPublic: this.toAstProperty(bitType, ConfigKey.property_isPublic, data.isPublic, options),\n isTemplate: this.toAstProperty(\n bitType,\n ConfigKey.property_isTemplate,\n data.isTemplate,\n options,\n ),\n isTemplateStripTheme: this.toAstProperty(\n bitType,\n ConfigKey.property_isTemplateStripTheme,\n data.isTemplateStripTheme,\n options,\n ),\n aiGenerated: this.toAstProperty(\n bitType,\n ConfigKey.property_aiGenerated,\n data.aiGenerated,\n options,\n ),\n machineTranslated: this.toAstProperty(\n bitType,\n ConfigKey.property_machineTranslated,\n data.machineTranslated,\n options,\n ),\n searchIndex: this.toAstProperty(\n bitType,\n ConfigKey.property_searchIndex,\n data.searchIndex,\n options,\n ),\n analyticsTag: this.toAstProperty(\n bitType,\n ConfigKey.property_analyticsTag,\n data.analyticsTag,\n options,\n ),\n categoryTag: this.toAstProperty(\n bitType,\n ConfigKey.property_categoryTag,\n data.categoryTag,\n options,\n ),\n topicTag: this.toAstProperty(bitType, ConfigKey.property_topicTag, data.topicTag, options),\n altLangTag: this.toAstProperty(\n bitType,\n ConfigKey.property_altLangTag,\n data.altLangTag,\n options,\n ),\n feedbackEngine: this.toAstProperty(\n bitType,\n ConfigKey.property_feedbackEngine,\n data.feedbackEngine,\n options,\n ),\n feedbackType: this.toAstProperty(\n bitType,\n ConfigKey.property_feedbackType,\n data.feedbackType,\n options,\n ),\n disableFeedback: this.toAstProperty(\n bitType,\n ConfigKey.property_disableFeedback,\n data.disableFeedback,\n options,\n ),\n diffTo: this.toAstProperty(bitType, ConfigKey.property_diffTo, data.diffTo, options),\n diffOp: this.toAstProperty(bitType, ConfigKey.property_diffOp, data.diffOp, options),\n diffRef: this.toAstProperty(bitType, ConfigKey.property_diffRef, data.diffRef, options),\n diffContext: this.toAstProperty(\n bitType,\n ConfigKey.property_diffContext,\n data.diffContext,\n options,\n ),\n diffTime: this.toAstProperty(bitType, ConfigKey.property_diffTime, data.diffTime, options),\n path: this.toAstProperty(bitType, ConfigKey.property_path, data.path, options),\n releaseVersion: this.toAstProperty(\n bitType,\n ConfigKey.property_releaseVersion,\n data.releaseVersion,\n options,\n ),\n releaseKind: this.toAstProperty(\n bitType,\n ConfigKey.property_releaseKind,\n data.releaseKind,\n options,\n ),\n releaseDate: this.toAstProperty(\n bitType,\n ConfigKey.property_releaseDate,\n data.releaseDate,\n options,\n ),\n book: this.buildBooks(context, data.book),\n ageRange: this.toAstProperty(bitType, ConfigKey.property_ageRange, data.ageRange, options),\n lang: this.toAstProperty(bitType, ConfigKey.property_lang, data.lang, options),\n language: this.toAstProperty(bitType, ConfigKey.property_language, data.language, options),\n publisher: this.toAstProperty(bitType, ConfigKey.property_publisher, data.publisher, options),\n publisherName: this.toAstProperty(\n bitType,\n ConfigKey.property_publisherName,\n data.publisherName,\n options,\n ),\n theme: this.toAstProperty(bitType, ConfigKey.property_theme, data.theme, options),\n computerLanguage: this.toAstProperty(\n bitType,\n ConfigKey.property_computerLanguage,\n data.computerLanguage,\n options,\n ),\n target: this.toAstProperty(bitType, ConfigKey.property_target, data.target, options),\n slug: this.toAstProperty(bitType, ConfigKey.property_slug, data.slug, options),\n tag: this.toAstProperty(bitType, ConfigKey.property_tag, data.tag, options),\n reductionTag: this.toAstProperty(\n bitType,\n ConfigKey.property_reductionTag,\n data.reductionTag,\n options,\n ),\n bubbleTag: this.toAstProperty(bitType, ConfigKey.property_bubbleTag, data.bubbleTag, options),\n levelCEFRp: this.toAstProperty(\n bitType,\n ConfigKey.property_levelCEFRp,\n data.levelCEFRp,\n options,\n ),\n levelCEFR: this.toAstProperty(bitType, ConfigKey.property_levelCEFR, data.levelCEFR, options),\n levelILR: this.toAstProperty(bitType, ConfigKey.property_levelILR, data.levelILR, options),\n levelACTFL: this.toAstProperty(\n bitType,\n ConfigKey.property_levelACTFL,\n data.levelACTFL,\n options,\n ),\n icon: this.toAstProperty(bitType, ConfigKey.property_icon, data.icon, options),\n iconTag: this.toAstProperty(bitType, ConfigKey.property_iconTag, data.iconTag, options),\n colorTag: this.toAstProperty(bitType, ConfigKey.property_colorTag, data.colorTag, options),\n flashcardSet: this.toAstProperty(\n bitType,\n ConfigKey.property_flashcardSet,\n data.flashcardSet,\n options,\n ),\n subtype: this.toAstProperty(bitType, ConfigKey.property_subtype, data.subtype, options),\n bookAlias: this.toAstProperty(bitType, ConfigKey.property_bookAlias, data.bookAlias, options),\n bookDiff: this.toAstProperty(bitType, ConfigKey.property_bookDiff, data.bookDiff, options),\n coverImage: this.toAstProperty(\n bitType,\n ConfigKey.property_coverImage,\n data.coverImage,\n options,\n ),\n coverColor: this.toAstProperty(\n bitType,\n ConfigKey.property_coverColor,\n data.coverColor,\n options,\n ),\n publications: this.toAstProperty(\n bitType,\n ConfigKey.property_publications,\n data.publications,\n options,\n ),\n author: this.toAstProperty(bitType, ConfigKey.property_author, data.author, options),\n subject: this.toAstProperty(bitType, ConfigKey.property_subject, data.subject, options),\n date: this.toAstProperty(bitType, ConfigKey.property_date, data.date, options),\n dateEnd: this.toAstProperty(bitType, ConfigKey.property_dateEnd, data.dateEnd, options),\n location: this.toAstProperty(bitType, ConfigKey.property_location, data.location, options),\n kind: this.toAstProperty(bitType, ConfigKey.property_kind, data.kind, options),\n hasMarkAsDone: this.toAstProperty(\n bitType,\n ConfigKey.property_hasMarkAsDone,\n data.hasMarkAsDone,\n options,\n ),\n processHandIn: this.toAstProperty(\n bitType,\n ConfigKey.property_processHandIn,\n data.processHandIn,\n options,\n ),\n processHandInLocation: this.toAstProperty(\n bitType,\n ConfigKey.property_processHandInLocation,\n data.processHandInLocation,\n options,\n ),\n chatWithBook: this.toAstProperty(\n bitType,\n ConfigKey.property_chatWithBook,\n data.chatWithBook,\n options,\n ),\n chatWithBookBrainKey: this.toAstProperty(\n bitType,\n ConfigKey.property_chatWithBookBrainKey,\n data.chatWithBookBrainKey,\n options,\n ),\n action: this.toAstProperty(bitType, ConfigKey.property_action, data.action, options),\n showInIndex: this.toAstProperty(\n bitType,\n ConfigKey.property_showInIndex,\n data.showInIndex,\n options,\n ),\n refAuthor: this.toAstProperty(bitType, ConfigKey.property_refAuthor, data.refAuthor, options),\n refBookTitle: this.toAstProperty(\n bitType,\n ConfigKey.property_refBookTitle,\n data.refBookTitle,\n options,\n ),\n refPublisher: this.toAstProperty(\n bitType,\n ConfigKey.property_refPublisher,\n data.refPublisher,\n options,\n ),\n refPublicationYear: this.toAstProperty(\n bitType,\n ConfigKey.property_refPublicationYear,\n data.refPublicationYear,\n options,\n ),\n citationStyle: this.toAstProperty(\n bitType,\n ConfigKey.property_citationStyle,\n data.citationStyle,\n options,\n ),\n blockId: this.toAstProperty(bitType, ConfigKey.property_blockId, data.blockId, options),\n pageNo: this.toAstProperty(bitType, ConfigKey.property_pageNo, data.pageNo, options),\n x: this.toAstProperty(bitType, ConfigKey.property_x, data.x, options),\n y: this.toAstProperty(bitType, ConfigKey.property_y, data.y, options),\n width: this.toAstProperty(bitType, ConfigKey.property_width, data.width, options),\n height: this.toAstProperty(bitType, ConfigKey.property_height, data.height, options),\n index: this.toAstProperty(bitType, ConfigKey.property_index, data.index, options),\n classification: this.toAstProperty(\n bitType,\n ConfigKey.property_classification,\n data.classification,\n options,\n ),\n availableClassifications: this.toAstProperty(\n bitType,\n ConfigKey.property_availableClassifications,\n data.availableClassifications,\n options,\n ),\n allowedBit: this.toAstProperty(\n bitType,\n ConfigKey.property_allowedBit,\n data.allowedBit,\n options,\n ),\n tableFixedHeader: this.toAstProperty(\n bitType,\n ConfigKey.property_tableFixedHeader,\n data.tableFixedHeader,\n options,\n ),\n tableHeaderWhitespaceNoWrap: this.toAstProperty(\n bitType,\n ConfigKey.property_tableHeaderWhitespaceNoWrap,\n data.tableHeaderWhitespaceNoWrap,\n options,\n ),\n tableSearch: this.toAstProperty(\n bitType,\n ConfigKey.property_tableSearch,\n data.tableSearch,\n options,\n ),\n tableSort: this.toAstProperty(bitType, ConfigKey.property_tableSort, data.tableSort, options),\n tablePagination: this.toAstProperty(\n bitType,\n ConfigKey.property_tablePagination,\n data.tablePagination,\n options,\n ),\n tablePaginationLimit: this.toAstProperty(\n bitType,\n ConfigKey.property_tablePaginationLimit,\n data.tablePaginationLimit,\n options,\n ),\n tableHeight: this.toAstProperty(\n bitType,\n ConfigKey.property_tableHeight,\n data.tableHeight,\n options,\n ),\n tableWhitespaceNoWrap: this.toAstProperty(\n bitType,\n ConfigKey.property_tableWhitespaceNoWrap,\n data.tableWhitespaceNoWrap,\n options,\n ),\n tableAutoWidth: this.toAstProperty(\n bitType,\n ConfigKey.property_tableAutoWidth,\n data.tableAutoWidth,\n options,\n ),\n tableResizableColumns: this.toAstProperty(\n bitType,\n ConfigKey.property_tableResizableColumns,\n data.tableResizableColumns,\n options,\n ),\n tableColumnMinWidth: this.toAstProperty(\n bitType,\n ConfigKey.property_tableColumnMinWidth,\n data.tableColumnMinWidth,\n options,\n ),\n quizCountItems: this.toAstProperty(\n bitType,\n ConfigKey.property_quizCountItems,\n data.quizCountItems,\n options,\n ),\n quizStrikethroughSolutions: this.toAstProperty(\n bitType,\n ConfigKey.property_quizStrikethroughSolutions,\n data.quizStrikethroughSolutions,\n options,\n ),\n codeLineNumbers: this.toAstProperty(\n bitType,\n ConfigKey.property_codeLineNumbers,\n data.codeLineNumbers,\n options,\n ),\n codeMinimap: this.toAstProperty(\n bitType,\n ConfigKey.property_codeMinimap,\n data.codeMinimap,\n options,\n ),\n stripePricingTableId: this.toAstProperty(\n bitType,\n ConfigKey.property_stripePricingTableId,\n data.stripePricingTableId,\n options,\n ),\n stripePublishableKey: this.toAstProperty(\n bitType,\n ConfigKey.property_stripePublishableKey,\n data.stripePublishableKey,\n options,\n ),\n thumbImage: this.toAstProperty(\n bitType,\n ConfigKey.property_thumbImage,\n data.thumbImage,\n options,\n ),\n scormSource: this.toAstProperty(\n bitType,\n ConfigKey.property_scormSource,\n data.scormSource,\n options,\n ),\n posterImage: this.toAstProperty(\n bitType,\n ConfigKey.property_posterImage,\n data.posterImage,\n options,\n ),\n focusX: this.toAstProperty(bitType, ConfigKey.property_focusX, data.focusX, options),\n focusY: this.toAstProperty(bitType, ConfigKey.property_focusY, data.focusY, options),\n pointerLeft: this.toAstProperty(\n bitType,\n ConfigKey.property_pointerLeft,\n data.pointerLeft,\n options,\n ),\n pointerTop: this.toAstProperty(\n bitType,\n ConfigKey.property_pointerTop,\n data.pointerTop,\n options,\n ),\n listItemIndent: this.toAstProperty(\n bitType,\n ConfigKey.property_listItemIndent,\n data.listItemIndent,\n options,\n ),\n backgroundWallpaper: this.toImageResource(context, data.backgroundWallpaper),\n hasBookNavigation: this.toAstProperty(\n bitType,\n ConfigKey.property_hasBookNavigation,\n data.hasBookNavigation,\n options,\n ),\n duration: this.toAstProperty(bitType, ConfigKey.property_duration, data.duration, options),\n deeplink: this.toAstProperty(bitType, ConfigKey.property_deeplink, data.deeplink, options),\n externalLink: this.toAstProperty(\n bitType,\n ConfigKey.property_externalLink,\n data.externalLink,\n options,\n ),\n externalLinkText: this.toAstProperty(\n bitType,\n ConfigKey.property_externalLinkText,\n data.externalLinkText,\n options,\n ),\n videoCallLink: this.toAstProperty(\n bitType,\n ConfigKey.property_videoCallLink,\n data.videoCallLink,\n options,\n ),\n vendorDashboardId: this.toAstProperty(\n bitType,\n ConfigKey.property_vendorDashboardId,\n data.vendorDashboardId,\n options,\n ),\n vendorSurveyId: this.toAstProperty(\n bitType,\n ConfigKey.property_vendorSurveyId,\n data.vendorSurveyId,\n options,\n ),\n vendorUrl: this.toAstProperty(bitType, ConfigKey.property_vendorUrl, data.vendorUrl, options),\n search: this.toAstProperty(bitType, ConfigKey.property_search, data.search, options),\n list: this.toAstProperty(bitType, ConfigKey.property_list, data.list, options),\n layer: this.toAstProperty(bitType, ConfigKey.property_layer, data.layer, options),\n layerRole: this.toAstProperty(bitType, ConfigKey.property_layerRole, data.layerRole, options),\n textReference: this.toAstProperty(\n bitType,\n ConfigKey.property_textReference,\n data.textReference,\n options,\n ),\n isTracked: this.toAstProperty(bitType, ConfigKey.property_isTracked, data.isTracked, options),\n isInfoOnly: this.toAstProperty(\n bitType,\n ConfigKey.property_isInfoOnly,\n data.isInfoOnly,\n options,\n ),\n imageFirst: this.toAstProperty(\n bitType,\n ConfigKey.property_imageFirst,\n data.imageFirst,\n options,\n ),\n activityType: this.toAstProperty(\n bitType,\n ConfigKey.property_activityType,\n data.activityType,\n options,\n ),\n labelTrue: this.toAstProperty(bitType, ConfigKey.property_labelTrue, data.labelTrue, options),\n labelFalse: this.toAstProperty(\n bitType,\n ConfigKey.property_labelFalse,\n data.labelFalse,\n options,\n ),\n content2Buy: this.toAstProperty(\n bitType,\n ConfigKey.property_content2Buy,\n data.content2Buy,\n options,\n ),\n mailingList: this.toAstProperty(\n bitType,\n ConfigKey.property_mailingList,\n data.mailingList,\n options,\n ),\n buttonCaption: this.toAstProperty(\n bitType,\n ConfigKey.property_buttonCaption,\n data.buttonCaption,\n options,\n ),\n callToActionUrl: this.toAstProperty(\n bitType,\n ConfigKey.property_callToActionUrl,\n data.callToActionUrl,\n options,\n ),\n caption: this.handleJsonText(context, TextLocation.tag, data.caption),\n quotedPerson: this.toAstProperty(\n bitType,\n ConfigKey.property_quotedPerson,\n data.quotedPerson,\n options,\n ),\n reasonableNumOfChars: reasonableNumOfCharsProperty,\n resolved: this.toAstProperty(bitType, ConfigKey.property_resolved, data.resolved, options),\n resolvedDate: this.toAstProperty(\n bitType,\n ConfigKey.property_resolvedDate,\n data.resolvedDate,\n options,\n ),\n resolvedBy: this.toAstProperty(\n bitType,\n ConfigKey.property_resolvedBy,\n data.resolvedBy,\n options,\n ),\n handInAcceptFileType: this.toAstProperty(\n bitType,\n ConfigKey.property_handInAcceptFileType,\n data.handInAcceptFileType,\n options,\n ),\n handInRequirement: this.toAstProperty(\n bitType,\n ConfigKey.property_handInRequirement,\n data.handInRequirement,\n options,\n ),\n handInInstruction: this.toAstProperty(\n bitType,\n ConfigKey.property_handInInstruction,\n data.handInInstruction,\n options,\n ),\n maxCreatedBits: this.toAstProperty(\n bitType,\n ConfigKey.property_maxCreatedBits,\n data.maxCreatedBits,\n options,\n ),\n maxDisplayLevel: this.toAstProperty(\n bitType,\n ConfigKey.property_maxDisplayLevel,\n data.maxDisplayLevel,\n options,\n ),\n maxTocChapterLevel: this.toAstProperty(\n bitType,\n ConfigKey.property_maxTocChapterLevel,\n data.maxTocChapterLevel,\n options,\n ),\n tocResource: this.toAstProperty(\n bitType,\n ConfigKey.property_tocResource,\n data.tocResource,\n options,\n ),\n tocContent: this.toAstProperty(\n bitType,\n ConfigKey.property_tocContent,\n data.tocContent,\n options,\n ),\n page: this.toAstProperty(bitType, ConfigKey.property_page, data.page, options),\n productId: this.toAstProperty(bitType, ConfigKey.property_productId, data.productId, options),\n product: this.toAstProperty(bitType, ConfigKey.property_product, data.product, options),\n // productList: this.toAstProperty(\n // bitType,\n // ConfigKey.property_productList,\n // data.productList,\n // options,\n // ),\n productVideo: this.toAstProperty(\n bitType,\n ConfigKey.property_productVideo,\n data.productVideo,\n options,\n ),\n // productVideoList: this.toAstProperty(\n // bitType,\n // ConfigKey.property_productVideoList,\n // data.productVideoList,\n // options,\n // ),\n productFolder: this.toAstProperty(\n bitType,\n ConfigKey.property_productFolder,\n data.productFolder,\n options,\n ),\n technicalTerm: this.buildTechnicalTerm(context, data.technicalTerm),\n servings: this.buildServings(context, data.servings),\n ratingLevelStart: this.buildRatingLevelStartEnd(context, data.ratingLevelStart),\n ratingLevelEnd: this.buildRatingLevelStartEnd(context, data.ratingLevelEnd),\n ratingLevelSelected: this.toAstProperty(\n bitType,\n ConfigKey.property_ratingLevelSelected,\n data.ratingLevelSelected,\n options,\n ),\n markConfig: this.buildMarkConfigs(context, data.markConfig),\n imageSource: this.buildImageSource(context, data.imageSource),\n person: this.buildPerson(context, data.person),\n bot: this.toAstProperty(bitType, ConfigKey.property_bot, data.bot, options),\n referenceProperty: this.toAstProperty(\n bitType,\n ConfigKey.property_reference,\n data.referenceProperty,\n options,\n ),\n\n // Book data\n title: this.handleJsonText(context, TextLocation.tag, data.title),\n subtitle: this.handleJsonText(context, TextLocation.tag, data.subtitle),\n level: NumberUtils.asNumber(data.level),\n toc: this.toAstProperty(bitType, ConfigKey.property_toc, data.toc, options),\n progress: this.toAstProperty(bitType, ConfigKey.property_progress, data.progress, options),\n anchor: data.anchor,\n reference: data.reference,\n referenceEnd: data.referenceEnd,\n revealSolutions: this.toAstProperty(\n bitType,\n ConfigKey.property_revealSolutions,\n data.revealSolutions,\n options,\n ),\n\n // Item, Lead, Hint, Instruction\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n pageNumber: this.handleJsonText(context, TextLocation.tag, data.pageNumber),\n marginNumber: this.handleJsonText(context, TextLocation.tag, data.marginNumber),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n\n partialAnswer: this.toAstProperty(\n bitType,\n ConfigKey.property_partialAnswer,\n data.partialAnswer,\n options,\n ),\n sampleSolution: this.toAstProperty(\n bitType,\n ConfigKey.property_sampleSolution,\n data.sampleSolution,\n options,\n ),\n additionalSolutions: this.toAstProperty(\n bitType,\n ConfigKey.property_additionalSolutions,\n data.additionalSolutions,\n options,\n ),\n\n // Example\n ...this.toExample(data.__isDefaultExample, data.example as TextAst),\n\n // Person\n\n imagePlaceholder: this.toImageResource(context, data.imagePlaceholder),\n resources: ArrayUtils.asArray(\n this.resourceBuilder.resourceFromResourceJson(context, data.resources),\n ),\n\n // Body, Card, Footer, must be after all other properties except the extraProperties and markup / parser\n body: this.buildBody(context, data.body),\n cardNode,\n footer: this.buildFooter(context, data.footer),\n\n // Must be after other properties/tags in the AST so key clashes are avoided correctly\n extraProperties: this.parseExtraProperties(data.extraProperties),\n\n markup: data.markup,\n parser: data.parser,\n\n // Private properties\n __isDefaultExample: data.__isDefaultExample ?? false,\n };\n\n // Push reasonableNumOfChars down the tree for the interview bits\n if (Config.isOfBitType(node.bitType, BitType.interview)) {\n this.pushDownTree(\n context,\n undefined,\n undefined,\n cardNode,\n 'questions',\n 'reasonableNumOfChars',\n data.reasonableNumOfChars,\n );\n }\n\n // Push reasonableNumOfChars down the tree for the feedback bits\n if (Config.isOfBitType(node.bitType, BitType.feedback)) {\n this.pushDownTree(\n context,\n undefined,\n undefined,\n cardNode,\n ['feedbacks', 'reason'],\n 'reasonableNumOfChars',\n data.reasonableNumOfChars,\n );\n }\n\n // Push isCaseSensitive down the tree for the cloze, match and match-matrix bits\n this.pushDownTree(\n context,\n [node.body, ...(cardNode?.cardBits?.map((cardBit) => cardBit.body) || [])],\n [BodyBitType.gap],\n undefined,\n undefined, //'isCaseSensitive',\n 'isCaseSensitive',\n data.isCaseSensitive ?? true,\n );\n\n this.pushDownTree(\n context,\n undefined,\n undefined,\n cardNode,\n 'pairs',\n 'isCaseSensitive',\n data.isCaseSensitive ?? true,\n );\n this.pushDownTree(\n context,\n undefined,\n undefined,\n cardNode,\n ['matrix', 'cells'],\n 'isCaseSensitive',\n data.isCaseSensitive ?? true,\n );\n\n // If __isDefaultExample is set at the bit level, push the default example down the tree to the relevant nodes\n this.pushExampleDownTree(\n context,\n node.body,\n cardNode,\n node.__isDefaultExample,\n convertedExample.example,\n );\n\n // Set default values\n this.setDefaultBitValues(node);\n\n // Set the 'isExample' flags\n this.setIsExampleFlags(node);\n\n // Add the version to the parser info\n this.addVersionToParserInfo(node);\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreUndefined: ['example'],\n ignoreEmptyArrays: ['item', 'lead', 'pageNumber', 'marginNumber', 'hint', 'instruction'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateBit(node);\n }\n\n /**\n * Build books[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildBooks(\n context: BuildContext,\n data: Partial<BookJson>[] | string | undefined,\n ): BookJson[] | string | undefined {\n if (StringUtils.isString(data)) return data as string;\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildBook(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build choice node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildBook(\n _context: BuildContext,\n data: Partial<BookJson> | undefined,\n ): BookJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: BookJson = {\n book: data.book ?? '',\n reference: data.reference ?? '',\n referenceEnd: (data.referenceEnd ?? undefined) as string,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyString: ['book', 'reference'],\n });\n\n return node;\n }\n\n /**\n * Build feedbackChoices[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildFeedbackChoices(\n context: BuildContext,\n data: Partial<FeedbackChoiceJson>[] | undefined,\n ): FeedbackChoiceJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildFeedbackChoice(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build feedbackChoice node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildFeedbackChoice(\n context: BuildContext,\n data: Partial<FeedbackChoiceJson> | undefined,\n ): FeedbackChoiceJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: FeedbackChoiceJson = {\n choice: data.choice ?? '',\n requireReason: !!data.requireReason,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, true),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item', 'hint', 'instruction'],\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n /**\n * Build feedbackReason node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildFeedbackReason(\n context: BuildContext,\n data: Partial<FeedbackReasonJson> | undefined,\n ): FeedbackReasonJson | undefined {\n if (!data) return undefined;\n\n // Set default example\n // Not __testAst - there is no default example\n const defaultExample = this.handleJsonText(context, TextLocation.tag, 'true');\n\n // NOTE: Node order is important and is defined here\n const node: FeedbackReasonJson = {\n text: data.text ?? '',\n reasonableNumOfChars: (data.reasonableNumOfChars ?? undefined) as number,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, defaultExample),\n __textAst: data.__textAst,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item', 'hint', 'instruction'],\n ignoreUndefined: ['example', 'reasonableNumOfChars'],\n });\n\n return node;\n }\n\n /**\n * Build choice[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildChoices(\n context: BuildContext,\n data: Partial<ChoiceJson>[] | undefined,\n ): ChoiceJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildChoice(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build choice node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildChoice(\n context: BuildContext,\n data: Partial<ChoiceJson> | undefined,\n ): ChoiceJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: ChoiceJson = {\n choice: data.choice ?? '',\n isCorrect: !!data.isCorrect,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item', 'hint', 'instruction'],\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n /**\n * Build response[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildResponses(\n context: BuildContext,\n data: Partial<ResponseJson>[] | undefined,\n ): ResponseJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildResponse(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build response node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildResponse(\n context: BuildContext,\n data: Partial<ResponseJson> | undefined,\n ): ResponseJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: ResponseJson = {\n response: data.response ?? '',\n isCorrect: !!data.isCorrect,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item', 'hint', 'instruction'],\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n /**\n * Build bot response[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildBotResponses(\n context: BuildContext,\n data: Partial<BotResponseJson>[] | undefined,\n ): BotResponseJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.botResponse(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build bot response node\n *\n * @param data - data for the node\n * @returns\n */\n protected botResponse(\n context: BuildContext,\n data: Partial<BotResponseJson> | undefined,\n ): BotResponseJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: BotResponseJson = {\n response: data.response ?? '',\n reaction: data.reaction ?? '',\n feedback: data.feedback ?? '',\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreEmptyString: ['response', 'reaction', 'feedback'],\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item'],\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n /**\n * Build feedbacks[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildFeedbacks(\n context: BuildContext,\n data: Partial<FeedbackJson>[] | undefined,\n ): FeedbackJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildFeedback(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build feedback node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildFeedback(\n context: BuildContext,\n data: Partial<FeedbackJson> | undefined,\n ): FeedbackJson | undefined {\n if (!data) return undefined;\n\n let choices: FeedbackChoiceJson[] | undefined;\n let reason: FeedbackReasonJson | undefined;\n\n if (data.choices) {\n choices = this.buildFeedbackChoices(context, data.choices);\n\n // Push __isDefaultExample down the tree\n // this.pushExampleDownTreeBoolean(context, data.__isDefaultExample, convertedExample.example, true, choices);\n } else {\n // No choices, not a valid feedback\n return undefined;\n }\n\n if (data.reason) {\n reason = this.buildFeedbackReason(context, data.reason);\n }\n\n // NOTE: Node order is important and is defined here\n const node: FeedbackJson = {\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n // isExample: !!data.__defaultExample,\n choices: choices as FeedbackChoiceJson[],\n reason: reason as FeedbackReasonJson, // Might be undefined\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item', 'hint', 'instruction'],\n });\n\n return node;\n }\n\n /**\n * Build quizzes[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildQuizzes(\n context: BuildContext,\n data: Partial<QuizJson>[] | undefined,\n ): QuizJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildQuiz(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build quiz node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildQuiz(\n context: BuildContext,\n data: Partial<QuizJson> | undefined,\n ): QuizJson | undefined {\n if (!data) return undefined;\n\n const convertedExample = {\n ...this.toExample(data.__isDefaultExample, data.__defaultExample),\n };\n\n let choices: ChoiceJson[] | undefined;\n let responses: ResponseJson[] | undefined;\n\n if (data.choices) {\n choices = this.buildChoices(context, data.choices);\n\n // Push __isDefaultExample down the tree\n this.pushExampleDownTreeBoolean(\n context,\n data.__isDefaultExample,\n convertedExample.example,\n true,\n choices,\n );\n } else if (data.responses) {\n responses = this.buildResponses(context, data.responses);\n\n // Push __isDefaultExample down the tree\n this.pushExampleDownTreeBoolean(\n context,\n data.__isDefaultExample,\n convertedExample.example,\n false,\n responses,\n );\n } else {\n // No choices or responses, not a valid quiz\n return undefined;\n }\n\n // NOTE: Node order is important and is defined here\n const node: QuizJson = {\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n isExample: !!data.__defaultExample,\n choices: choices as ChoiceJson[],\n responses: responses as ResponseJson[],\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item', 'hint', 'instruction'],\n });\n\n return node;\n }\n\n /**\n * Build heading node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildHeading(\n _context: BuildContext,\n data: Partial<HeadingJson> | undefined,\n ): HeadingJson | undefined {\n if (!data) return undefined;\n if (data.forKeys == null) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: HeadingJson = {\n forKeys: data.forKeys ?? '',\n forValues: data.forValues ?? data.__forValuesDefault ?? '',\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyString: ['forKeys', 'forValues'],\n ignoreEmptyArrays: ['forValues'],\n });\n\n return node;\n }\n\n /**\n * Build pair[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildPairs(\n context: BuildContext,\n data: Partial<PairJson>[] | undefined,\n ): PairJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildPair(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build pair node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildPair(\n context: BuildContext,\n data: Partial<PairJson> | undefined,\n ): PairJson | undefined {\n if (!data) return undefined;\n\n // Set default example\n const defaultExample =\n Array.isArray(data.__valuesAst) && data.__valuesAst.length > 0 ? data.__valuesAst[0] : null;\n\n // Process the keyAudio and keyImage resources\n const keyAudio = this.resourceBuilder.resourceFromResourceJson(\n context,\n data.keyAudio,\n ) as AudioResourceWrapperJson;\n const keyImage = this.resourceBuilder.resourceFromResourceJson(\n context,\n data.keyImage,\n ) as ImageResourceWrapperJson;\n\n // NOTE: Node order is important and is defined here\n const node: PairJson = {\n key: data.key ?? '',\n keyAudio,\n keyImage,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n isCaseSensitive: data.isCaseSensitive as boolean,\n ...this.toExample(data.__isDefaultExample, data.example, defaultExample),\n values: data.values || [],\n __valuesAst: data.__valuesAst,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item', 'hint', 'instruction', 'values'],\n ignoreUndefined: ['example', 'isCaseSensitive'],\n });\n\n // if (node.key) {\n // delete node.keyAudio;\n // delete node.keyImage;\n // }\n // if (node.keyAudio != null) {\n // delete node.key;\n // delete node.keyImage;\n // }\n // if (node.keyImage != null) {\n // delete node.key;\n // delete node.keyAudio;\n // }\n\n return node;\n }\n\n /**\n * Build matrix[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildMatricies(\n context: BuildContext,\n data: Partial<MatrixJson>[] | undefined,\n ): MatrixJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildMatrix(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build matrix node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildMatrix(\n context: BuildContext,\n data: Partial<MatrixJson> | undefined,\n ): MatrixJson | undefined {\n if (!data) return undefined;\n\n // const convertedExample = {\n // ...this.toExample(__isDefaultExample, example),\n // };\n\n // // Push __isDefaultExample down the tree\n // this.pushExampleDownTreeBoolean(__isDefaultExample, convertedExample.example, true, choices);\n // this.pushExampleDownTreeBoolean(__isDefaultExample, convertedExample.example, false, responses);\n\n let isExample = false;\n\n // Set isExample for matrix based on isExample for cells\n for (const c of data.cells || []) {\n if (data.__isDefaultExample && !c.isExample) {\n c.isExample = true;\n }\n isExample = c.isExample ? true : isExample;\n }\n\n // NOTE: Node order is important and is defined here\n const node: MatrixJson = {\n key: data.key ?? '',\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n isExample,\n cells: (data.cells || [])\n .map((c) => this.buildMatrixCell(context, c))\n .filter((c) => c != null),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['hint', 'item', 'cells'],\n ignoreUndefined: ['isCaseSensitive'],\n });\n\n return node;\n }\n\n /**\n * Build matrixCell node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildMatrixCell(\n context: BuildContext,\n data: Partial<MatrixCellJson> | undefined,\n ): MatrixCellJson | undefined {\n if (!data) return undefined;\n\n // Set default example\n const defaultExample =\n Array.isArray(data.__valuesAst) && data.__valuesAst.length > 0 ? data.__valuesAst[0] : null;\n\n // NOTE: Node order is important and is defined here\n const node: MatrixCellJson = {\n values: data.values || [],\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n isCaseSensitive: data.isCaseSensitive as boolean,\n ...this.toExample(data.__isDefaultExample, data.example, defaultExample),\n __valuesAst: data.__valuesAst,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['instruction', 'item', 'values'],\n ignoreUndefined: ['example', 'isCaseSensitive'],\n });\n\n return node;\n }\n\n /**\n * Build pronunciation table node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildPronunciationTable(\n context: BuildContext,\n dataIn: Partial<PronunciationTableJson> | undefined,\n ): PronunciationTableJson | undefined {\n if (!dataIn) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: PronunciationTableJson = {\n data: (dataIn.data || []).map((row) =>\n (row || []).map((cell) => {\n // Process the audio resource\n const audio = this.resourceBuilder.resourceFromResourceJson(\n context,\n cell.audio,\n ) as AudioResourceWrapperJson;\n\n return {\n title: this.handleJsonText(context, TextLocation.tag, cell.title),\n body: this.handleJsonText(context, TextLocation.tag, cell.body),\n audio,\n };\n }),\n ),\n };\n\n // Remove Unset Optionals\n // ObjectUtils.removeUnwantedProperties(node, {\n // ignoreAllFalse: true,\n // });\n\n return node;\n }\n\n /**\n * Build table node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildTable(\n context: BuildContext,\n dataIn: Partial<TableJson> | undefined,\n ): TableJson | undefined {\n if (!dataIn) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: TableJson = {\n columns: (dataIn.columns || []).map((col) =>\n this.handleJsonText(context, TextLocation.tag, col),\n ),\n data: (dataIn.data || []).map((row) =>\n (row || []).map((cell) => this.handleJsonText(context, TextLocation.tag, cell)),\n ),\n };\n\n // Remove Unset Optionals\n // ObjectUtils.removeUnwantedProperties(node, {\n // ignoreAllFalse: true,\n // });\n\n return node;\n }\n\n /**\n * Build question[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildQuestions(\n context: BuildContext,\n data: Partial<QuestionJson>[] | undefined,\n ): QuestionJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildQuestion(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build question node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildQuestion(\n context: BuildContext,\n data: Partial<QuestionJson> | undefined,\n ): QuestionJson | undefined {\n if (!data) return undefined;\n\n // Set default example\n const defaultExample = data.__sampleSolutionAst;\n\n // NOTE: Node order is important and is defined here\n const node: QuestionJson = {\n question: data.question ?? '',\n partialAnswer: data.partialAnswer ?? '',\n sampleSolution: data.sampleSolution ?? '',\n additionalSolutions: (data.additionalSolutions ?? undefined) as string[],\n reasonableNumOfChars: (data.reasonableNumOfChars ?? undefined) as number,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, defaultExample),\n __sampleSolutionAst: data.__sampleSolutionAst,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: ['item', 'hint', 'instruction'],\n ignoreUndefined: ['example'],\n ignoreEmptyString: ['question', 'partialAnswer', 'sampleSolution'],\n });\n\n return node;\n }\n\n /**\n * Build ingredient[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildIngredients(\n context: BuildContext,\n data: Partial<IngredientJson>[] | undefined,\n ): IngredientJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildIngredient(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build ingredient node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildIngredient(\n context: BuildContext,\n data: Partial<IngredientJson> | undefined,\n ): IngredientJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: IngredientJson = {\n title: this.handleJsonText(context, TextLocation.tag, data.title),\n checked: data.checked ?? false,\n ingredient: this.handleJsonText(context, TextLocation.tag, data.ingredient),\n quantity: data.quantity ?? 0,\n unit: data.unit ?? '',\n unitAbbr: data.unitAbbr ?? '',\n decimalPlaces: data.decimalPlaces ?? 1,\n disableCalculation: data.disableCalculation ?? false,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n // ignoreAllEmptyArrays: true,\n // ignoreUndefined: ['example'],\n ignoreEmptyString: ['item', 'unit'],\n });\n\n return node;\n }\n\n /**\n * Build body node\n * - Handles JSON, Bitmark text, and plain text\n * - body: set to either string, TextAst, or JSON\n * - bodyBits: set to array of BodyBitJson (will be validated and merged into body if it is a string)\n * - placeholders: set to placeholders from v2 JSON when body is a v2 JSON string\n * - bodyString: set to the original string if body is a string (only used for card body)\n *\n * @param data - data for the node\n * @returns\n */\n protected buildBody(context: BuildContext, data: Partial<Body> | undefined): Body | undefined {\n if (!data) return undefined;\n let body: JsonText | unknown | undefined;\n const bodyBits: BodyBitJson[] = [];\n const placeholders = data.placeholders;\n const bodyString = data.bodyString;\n const { textFormat } = context;\n\n // Handle JSON type body\n const handleJsonBody = () => {\n // Attempt to parse a string body as JSON to support the legacy format\n if (typeof data.body === 'string') {\n try {\n body = JSON.parse(data.body);\n } catch (_e) {\n // Could not parse JSON - set body to null\n body = null;\n }\n } else {\n body = data.body;\n }\n };\n\n // Handle Bitmark text type body (both AST v3 and plain text v2)\n const handleBitmarkTextBody = () => {\n let rawBody: TextAst = data.body as TextAst;\n let bodyStr: BreakscapedString | undefined;\n const placeholderNodes: {\n [keyof: string]: BodyBitJson;\n } = {};\n // TODO - process body bits through the correct builders.\n\n if (StringUtils.isString(data.body)) {\n // Body is a string (legacy bitmark v2, or not bitmarkText)\n bodyStr = ((data.body as BreakscapedString) ?? '').trim() as BreakscapedString;\n rawBody = [];\n } else if (Array.isArray(data.body)) {\n // Body is an array (prosemirror like JSON)\n // Already in the correct format\n } else {\n // body is invalid\n rawBody = [];\n }\n\n if (placeholders) {\n for (const [key, val] of Object.entries(placeholders)) {\n // const bit = this.bodyBitToAst(val);\n // placeholderNodes[key] = bit as BodyBit;\n placeholderNodes[key] = val as BodyBitJson;\n }\n }\n\n if (bodyStr) {\n // Bug #7141: Use textFormat for textParser, not always bitmarkText if it is a v2 string body\n // However, only use plain text breakscaping the text from the v2 JSON body\n\n // Special v2 Breakscaping\n bodyStr = Breakscape.breakscape(bodyStr, {\n format: textFormat,\n location: TextLocation.body,\n v2: true,\n });\n\n // Convert placeholders {1} to [!1], etc.\n let index = 0;\n const newPlaceholderNodes: BodyBitJson[] = [];\n for (const [key, val] of Object.entries(placeholderNodes)) {\n if (bodyStr) {\n const newKey = `[!${index}]`;\n bodyStr = bodyStr.replace(`${key}`, newKey) as BreakscapedString;\n newPlaceholderNodes.push(val);\n index++;\n }\n }\n\n // Convert the body string to AST\n rawBody = this.textParser.toAst(bodyStr, {\n format: textFormat,\n location: TextLocation.body,\n });\n\n const replaceBitsRecursive = (bodyText: TextAst) => {\n for (let i = 0, len = bodyText.length; i < len; i++) {\n const bodyPart = bodyText[i];\n if ((bodyPart.type as string) === 'bit') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const index = (bodyPart as any).index as number;\n if (newPlaceholderNodes[index] != null) {\n bodyText[i] = newPlaceholderNodes[index] as TextNode;\n }\n } else {\n if (bodyPart.content) replaceBitsRecursive(bodyPart.content);\n }\n }\n };\n\n // Replace the placeholders with the AST\n replaceBitsRecursive(rawBody);\n }\n\n // Process the body bits to ensure they are valid\n // Walking the body bits will change them, so we should make a copy before processing\n rawBody = structuredClone(rawBody);\n this.textParser.walkBodyBits(rawBody, (parent, index, bodyBit) => {\n // Ensure the body bit is valid\n let parsedBit: BodyBitJson | undefined;\n switch (bodyBit.type) {\n case BodyBitType.gap:\n parsedBit = this.buildGap(context, bodyBit as GapJson);\n break;\n case BodyBitType.mark:\n parsedBit = this.buildMark(context, bodyBit as MarkJson);\n break;\n case BodyBitType.select:\n parsedBit = this.buildSelect(context, bodyBit as SelectJson);\n break;\n case BodyBitType.highlight:\n parsedBit = this.buildHighlight(context, bodyBit as HighlightJson);\n break;\n default:\n // TODO?? Ensure other parts are valid\n }\n if (parsedBit != undefined) {\n parent[index] = parsedBit as TextNode;\n bodyBits.push(parsedBit);\n }\n });\n\n // Set the body\n body = rawBody;\n\n // Mark the body as text\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (body as any).__tag = 'text';\n };\n\n const handlePlainTextBody = () => {\n body = data.body as string;\n };\n\n const isBitmarkText = textFormat === TextFormat.bitmarkText;\n if (textFormat === TextFormat.json) {\n // JSON\n handleJsonBody();\n } else if (isBitmarkText) {\n // Bitmark text (either ast or string)\n handleBitmarkTextBody();\n } else {\n // Text but not bitmark (plain text)\n handlePlainTextBody();\n }\n\n const node: Body = {\n body,\n bodyBits,\n bodyString,\n // Placeholders are only ever parsed into AST, never stored directly\n };\n\n return node;\n }\n\n /**\n * Build footer node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildFooter(\n context: BuildContext,\n data: Partial<Footer> | undefined,\n ): Footer | undefined {\n if (!data) return undefined;\n const node: Footer = {\n footer: this.handleJsonText(context, TextLocation.body, data.footer),\n };\n\n return node;\n }\n\n /**\n * Build gap node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildGap(\n context: BuildContext,\n data: Partial<GapJson> | undefined,\n ): GapJson | undefined {\n if (!data) return undefined;\n\n // Set default example\n const defaultExample =\n Array.isArray(data.__solutionsAst) && data.__solutionsAst.length > 0\n ? data.__solutionsAst[0]\n : null;\n\n // Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)\n data = this.bodyBitCopyFromAttrs(data);\n\n // NOTE: Node order is important and is defined here\n const node: GapJson = {\n type: BodyBitType.gap,\n solutions: data.solutions || [], // Must be before other properties except type\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n isCaseSensitive: data.isCaseSensitive as boolean,\n ...this.toExample(data.__isDefaultExample, data.example, defaultExample),\n __solutionsAst: data.__solutionsAst,\n\n attrs: {},\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreAllEmptyArrays: true,\n ignoreUndefined: ['example', 'isCaseSensitive'],\n });\n\n return node;\n }\n\n /**\n * Build mark configs node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildMarkConfigs(\n context: BuildContext,\n data: Partial<MarkConfigJson>[] | undefined,\n ): MarkConfigJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildMarkConfig(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build mark config node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildMarkConfig(\n _context: BuildContext,\n data: Partial<MarkConfigJson> | undefined,\n ): MarkConfigJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: MarkConfigJson = {\n mark: data.mark ?? 'unknown',\n color: data.color ?? '',\n emphasis: data.emphasis ?? '',\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllEmptyString: true,\n });\n\n return node;\n }\n\n /**\n * Build mark node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildMark(\n context: BuildContext,\n data: Partial<MarkJson> | undefined,\n ): MarkJson | undefined {\n if (!data) return undefined;\n\n // Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)\n data = this.bodyBitCopyFromAttrs(data);\n\n // NOTE: Node order is important and is defined here\n const node: MarkJson = {\n type: BodyBitType.mark,\n solution: data.solution ?? '', // Must be before other properties except type\n mark: data.mark ?? '',\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, true),\n\n attrs: {},\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreAllEmptyArrays: true,\n ignoreUndefined: ['example'],\n ignoreEmptyString: ['solution', 'mark'],\n });\n\n return node;\n }\n\n /**\n * Build select node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildSelect(\n context: BuildContext,\n data: Partial<SelectJson> | undefined,\n ): SelectJson | undefined {\n if (!data) return undefined;\n\n // Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)\n data = this.bodyBitCopyFromAttrs(data);\n\n // NOTE: Node order is important and is defined here\n const node: SelectJson = {\n type: BodyBitType.select,\n options: this.buildSelectOptions(context, data.options) || [], // Must be before other properties except type\n prefix: data.prefix ?? '',\n postfix: data.postfix ?? '',\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(false, undefined, undefined), // Will be set in later\n __hintString: data.__hintString,\n __instructionString: data.__instructionString,\n\n attrs: {},\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreAllEmptyArrays: true,\n ignoreEmptyString: ['prefix', 'postfix'],\n });\n\n return node;\n }\n\n /**\n * Build selectOption[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildSelectOptions(\n context: BuildContext,\n data: Partial<SelectOptionJson>[] | undefined,\n ): SelectOptionJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildSelectOption(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build selectOption node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildSelectOption(\n context: BuildContext,\n data: Partial<SelectOptionJson> | undefined,\n ): SelectOptionJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: SelectOptionJson = {\n text: data.text ?? '', // Must be before other properties except type\n isCorrect: !!data.isCorrect,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreAllEmptyArrays: true,\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n /**\n * Build highlight node\n *\n * @param data - data for the node\n * @returns\n */\n buildHighlight(\n context: BuildContext,\n data: Partial<HighlightJson> | undefined,\n ): HighlightJson | undefined {\n if (!data) return undefined;\n\n // Copy any attributes from 'attrs' to the body bit (data is in 'attrs' when coming from JSON)\n data = this.bodyBitCopyFromAttrs(data);\n\n // NOTE: Node order is important and is defined here\n const node: HighlightJson = {\n type: BodyBitType.highlight,\n texts: this.buildHighlightTexts(context, data.texts) || [], // Must be before other properties except type\n prefix: data.prefix ?? '',\n postfix: data.postfix ?? '',\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(false, undefined, undefined), // Will be set in later\n\n attrs: {},\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreAllEmptyArrays: true,\n ignoreEmptyString: ['prefix', 'postfix'],\n });\n\n return node;\n }\n\n /**\n * Build highlightText[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildHighlightTexts(\n context: BuildContext,\n data: Partial<HighlightTextJson>[] | undefined,\n ): HighlightTextJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildHighlightText(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build highlightText node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildHighlightText(\n context: BuildContext,\n data: Partial<HighlightTextJson> | undefined,\n ): HighlightTextJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: HighlightTextJson = {\n text: data.text ?? '', // Must be before other properties except type\n isCorrect: !!data.isCorrect,\n isHighlighted: !!data.isHighlighted,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreAllEmptyArrays: true,\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n /**\n * Build flashcards node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildFlashcards(\n context: BuildContext,\n data: Partial<FlashcardJson>[] | undefined,\n ): FlashcardJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildFlashcard(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build flashcard node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildFlashcard(\n context: BuildContext,\n data: Partial<FlashcardJson> | undefined,\n ): FlashcardJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: FlashcardJson = {\n question: this.buildTextAndIcon(context, data.question) as TextAndIconJson,\n answer: this.buildTextAndIcon(context, data.answer) as TextAndIconJson,\n alternativeAnswers: (data.alternativeAnswers || [])\n .map((d) => this.buildTextAndIcon(context, d))\n .filter((d) => d != null),\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, true),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: [\n 'question',\n 'answer',\n 'alternativeAnswers',\n 'item',\n 'hint',\n 'instruction',\n ],\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n /**\n * Build definitionListItem[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildDefinitionList(\n context: BuildContext,\n data: Partial<DefinitionListItemJson>[] | undefined,\n ): DefinitionListItemJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data\n .map((d) => this.buildDefinitionListItem(context, d))\n .filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build definitionListItem node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildDefinitionListItem(\n context: BuildContext,\n data: Partial<DefinitionListItemJson> | undefined,\n ): DefinitionListItemJson | undefined {\n if (!data) return undefined;\n\n const { bitType } = context;\n\n const textAsStrings = Config.isOfBitType(bitType, [BitType.metaSearchDefaultTerms]);\n\n // NOTE: Node order is important and is defined here\n const node: DefinitionListItemJson = {\n term: this.buildTextAndIcon(context, data.term, textAsStrings) as TextAndIconJson,\n definition: this.buildTextAndIcon(context, data.definition, textAsStrings) as TextAndIconJson,\n alternativeDefinitions: (data.alternativeDefinitions || [])\n .map((d) => this.buildTextAndIcon(context, d, textAsStrings))\n .filter((d) => d != null),\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, true),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n ignoreEmptyArrays: [\n 'question',\n 'answer',\n 'alternativeDefinitions',\n 'item',\n 'hint',\n 'instruction',\n ],\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n protected buildTextAndIcon(\n context: BuildContext,\n data: Partial<TextAndIconJson> | undefined,\n textAsStrings: boolean = false,\n ): TextAndIconJson | undefined {\n const icon = this.resourceBuilder.resourceFromResourceJson(\n context,\n data?.icon,\n ) as ImageResourceWrapperJson;\n\n // Ensure text is bitmark text\n let text: JsonText = this.handleJsonText(\n context,\n TextLocation.tag,\n data?.text || (data as string),\n );\n\n if (textAsStrings) {\n // Convert the bitmark text to plain text (without breakscaping, as that will happen in the Bitmark Generator)\n text = this.textGenerator\n .generateSync(text as TextAst, TextFormat.plainText, TextLocation.body, {\n noBreakscaping: true,\n })\n .trim();\n }\n\n // NOTE: Node order is important and is defined here\n const node: TextAndIconJson = {\n text,\n icon,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreEmptyArrays: ['text'],\n ignoreUndefined: ['icon'],\n });\n\n return node;\n }\n\n /**\n * Build statement[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildStatements(\n context: BuildContext,\n data: Partial<StatementJson>[] | undefined,\n ): StatementJson[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildStatement(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build statement node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildStatement(\n context: BuildContext,\n data: Partial<StatementJson> | undefined,\n ): StatementJson | undefined {\n if (!data) return undefined;\n\n // NOTE: Node order is important and is defined here\n const node: StatementJson = {\n statement: data.statement ?? '',\n isCorrect: !!data.isCorrect,\n item: this.handleJsonText(context, TextLocation.tag, data.item),\n lead: this.handleJsonText(context, TextLocation.tag, data.lead),\n hint: this.handleJsonText(context, TextLocation.tag, data.hint),\n instruction: this.handleJsonText(context, TextLocation.tag, data.instruction),\n ...this.toExample(data.__isDefaultExample, data.example, !!data.isCorrect),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n // ignoreAllEmptyArrays: true,\n ignoreUndefined: ['example'],\n });\n\n return node;\n }\n\n /**\n * Build (image-on-device) imageSource node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildImageSource(\n _context: BuildContext,\n data: Partial<ImageSourceJson> | undefined,\n ): ImageSourceJson | undefined {\n if (!data) return undefined;\n const { url, mockupId, size, format, trim } = data;\n\n // NOTE: Node order is important and is defined here\n const node: ImageSourceJson = {\n url: url ?? '',\n mockupId: mockupId ?? '',\n size: (size ?? null) as number,\n format: (format ?? null) as string,\n trim: (BooleanUtils.isBoolean(trim) ? trim : null) as boolean,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreFalse: ['trim'],\n ignoreEmptyString: ['url', 'mockupId'],\n ignoreAllUndefined: true,\n });\n\n return node;\n }\n\n /**\n * Build (chat) person node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildPerson(\n context: BuildContext,\n data: Partial<PersonJson> | undefined,\n ): PersonJson | undefined {\n if (!data) return undefined;\n const { name, title, avatarImage } = data;\n // { name: string; title?: string; avatarImage?: ImageResourceJson }\n\n // NOTE: Node order is important and is defined here\n const node: PersonJson = {\n name: name ?? '',\n title: (title ?? undefined) as string,\n avatarImage: this.resourceBuilder.resourceFromResourceJson(\n context,\n avatarImage,\n ) as ImageResourceWrapperJson,\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreEmptyString: ['name'],\n ignoreAllUndefined: true,\n });\n\n return node;\n }\n\n /**\n * Build (cook-ingredients) technicalTerm node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildTechnicalTerm(\n _context: BuildContext,\n data: Partial<TechnicalTermJson> | undefined,\n ): TechnicalTermJson | undefined {\n if (!data) return undefined;\n const { technicalTerm, lang } = data;\n\n // NOTE: Node order is important and is defined here\n const node: TechnicalTermJson = {\n technicalTerm: technicalTerm ?? '',\n lang: lang ?? '',\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreEmptyString: ['technicalTerm'],\n // ignoreAllUndefined: true,\n });\n\n return node;\n }\n\n /**\n * Build (cook-ingredients) servings node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildServings(\n _context: BuildContext,\n data: Partial<ServingsJson> | undefined,\n ): ServingsJson | undefined {\n if (!data) return undefined;\n const { servings, unit, unitAbbr, decimalPlaces, disableCalculation, hint } = data;\n\n // NOTE: Node order is important and is defined here\n const node: ServingsJson = {\n servings: servings ?? 0,\n unit: unit ?? '',\n unitAbbr: unitAbbr ?? '',\n decimalPlaces: decimalPlaces ?? 1,\n disableCalculation: disableCalculation ?? false,\n hint: hint ?? '',\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreEmptyString: ['servings', 'unit'],\n // ignoreAllUndefined: true,\n });\n\n return node;\n }\n\n /**\n * Build (survey-rating) ratingLevelStart / ratingLevelEnd node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildRatingLevelStartEnd(\n context: BuildContext,\n data: Partial<RatingLevelStartEndJson> | undefined,\n ): RatingLevelStartEndJson | undefined {\n if (!data) return undefined;\n const { level, label } = data;\n\n // NOTE: Node order is important and is defined here\n const node: RatingLevelStartEndJson = {\n level: level ?? 0,\n label: this.handleJsonText(context, TextLocation.tag, label),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n // ignoreEmptyArrays: ['servings', 'unit'],\n // ignoreAllUndefined: true,\n });\n\n return node;\n }\n\n // DEPRECATED - TO BE REMOVED IN FUTURE\n // /**\n // * Build captionDefinition node\n // *\n // * @param data - data for the node\n // * @returns\n // */\n // protected buildCaptionDefinition(\n // _context: BuildContext,\n // data: Partial<CaptionDefinitionJson> | undefined,\n // ): CaptionDefinitionJson | undefined {\n // if (!data) return undefined;\n\n // // NOTE: Node order is important and is defined here\n // const node: CaptionDefinitionJson = {\n // // term: this.convertJsonTextToAstText(data.term),\n // // description: this.convertJsonTextToAstText(data.description),\n // term: data.term ?? '',\n // definition: data.definition ?? '',\n // };\n\n // // Remove Unset Optionals\n // ObjectUtils.removeUnwantedProperties(node, {\n // ignoreEmptyString: ['term', 'description'],\n // // ignoreAllUndefined: true,\n // });\n\n // return node;\n // }\n\n // /**\n // * Build captionDefinitionList node\n // *\n // * @param data - data for the node\n // * @returns\n // */\n // protected buildCaptionDefinitionList(\n // context: BuildContext,\n // data: Partial<CaptionDefinitionListJson> | undefined,\n // ): CaptionDefinitionListJson | undefined {\n // if (!data) return undefined;\n\n // // NOTE: Node order is important and is defined here\n // const node: CaptionDefinitionListJson = {\n // columns: data.columns || [],\n // definitions: (data.definitions || [])\n // .map((d) => {\n // return this.buildCaptionDefinition(context, {\n // term: d.term,\n // definition: d.definition,\n // });\n // })\n // .filter((d) => d != null),\n // };\n\n // // Remove Unset Optionals\n // ObjectUtils.removeUnwantedProperties(node, {\n // ignoreAllEmptyArrays: true,\n // });\n\n // return node;\n // }\n\n /**\n * Build card bit[] node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildCardBits(\n context: BuildContext,\n data: Partial<CardBit>[] | undefined,\n ): Bit[] | undefined {\n if (!Array.isArray(data)) return undefined;\n const nodes = data.map((d) => this.buildCardBit(context, d)).filter((d) => d != null);\n return nodes.length > 0 ? nodes : undefined;\n }\n\n /**\n * Build card bit node\n *\n * @param data - data for the node\n * @returns\n */\n protected buildCardBit(\n context: BuildContext,\n data: Partial<CardBit> | undefined,\n ): CardBit | undefined {\n if (!data) return undefined;\n const { bitType, textFormat } = context;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const node = this.buildBit({ ...data, bitType, textFormat } as any, {\n cardSet: {\n sideNo: 0,\n variantNo: 0,\n },\n }) as CardBit;\n\n // // NOTE: Node order is important and is defined here\n // const node: CardBit = {\n // item: this.handleJsonText(data.item),\n // lead: this.handleJsonText(data.lead),\n // hint: this.handleJsonText(data.hint),\n // instruction: this.handleJsonText(data.instruction),\n // ...this.toExample(data.__isDefaultExample, data.example),\n // __isDefaultExample: data.__isDefaultExample ?? false,\n // body: this.buildBody(textFormat, data.body),\n\n // // Must always be last in the AST so key clashes are avoided correctly with other properties\n // extraProperties: this.parseExtraProperties(data.extraProperties),\n // };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node, {\n ignoreAllFalse: true,\n // ignoreEmptyArrays: ['example'],\n ignoreUndefined: ['example'],\n });\n\n // Validate and correct invalid bits as much as possible\n return NodeValidator.validateCardBit(node);\n }\n\n protected toImageResource(\n context: BuildContext,\n data: Partial<ImageResourceWrapperJson> | undefined,\n ): ImageResourceWrapperJson {\n return ArrayUtils.asSingle(\n this.resourceBuilder.resourceFromResourceDataJson(context, ResourceType.image, data?.image),\n ) as ImageResourceWrapperJson;\n }\n\n //\n // Private\n //\n\n private buildCardNode(\n context: BuildContext,\n data: {\n flashcards?: Partial<FlashcardJson>[];\n definitions?: Partial<DefinitionListItemJson>[];\n legend?: Partial<DefinitionListItemJson>[];\n questions?: Partial<QuestionJson>[];\n elements?: string[];\n statement?: Partial<StatementJson>;\n statements?: Partial<StatementJson>[];\n choices?: Partial<ChoiceJson>[];\n responses?: Partial<ResponseJson>[];\n feedbacks?: Partial<FeedbackJson>[];\n quizzes?: Partial<QuizJson>[];\n heading?: Partial<HeadingJson>;\n pairs?: Partial<PairJson>[];\n matrix?: Partial<MatrixJson>[];\n pronunciationTable?: Partial<PronunciationTableJson>;\n table?: Partial<TableJson>;\n botResponses?: Partial<BotResponseJson>[];\n ingredients?: Partial<IngredientJson>[];\n // DEPRECATED - TO BE REMOVED IN FUTURE\n // captionDefinitionList?: Partial<CaptionDefinitionListJson>;\n cardBits?: Partial<CardBit>[];\n },\n ): CardNode | undefined {\n const node: CardNode = {\n heading: this.buildHeading(context, data.heading),\n questions: this.buildQuestions(context, data.questions),\n elements: data.elements,\n flashcards: this.buildFlashcards(context, data.flashcards),\n definitions: this.buildDefinitionList(context, data.definitions ?? data.legend),\n statement: this.buildStatement(context, data.statement),\n statements: this.buildStatements(context, data.statements),\n choices: this.buildChoices(context, data.choices),\n responses: this.buildResponses(context, data.responses),\n feedbacks: this.buildFeedbacks(context, data.feedbacks),\n quizzes: this.buildQuizzes(context, data.quizzes),\n pairs: this.buildPairs(context, data.pairs),\n matrix: this.buildMatricies(context, data.matrix),\n pronunciationTable: this.buildPronunciationTable(context, data.pronunciationTable),\n table: this.buildTable(context, data.table),\n botResponses: this.buildBotResponses(context, data.botResponses),\n ingredients: this.buildIngredients(context, data.ingredients),\n // DEPRECATED - TO BE REMOVED IN FUTURE\n // captionDefinitionList: this.buildCaptionDefinitionList(context, data.captionDefinitionList),\n cardBits: this.buildCardBits(context, data.cardBits),\n };\n\n // Remove Unset Optionals\n ObjectUtils.removeUnwantedProperties(node);\n\n return Object.keys(node).length > 0 ? node : undefined;\n }\n\n /**\n * Copy any attributes from 'attrs' property to the root node (necessary when the input if from JSON)\n * The values in 'attrs' will overwrite any existing values in the node\n *\n * The original object is not modified, a new object is returned\n *\n * @param data\n */\n private bodyBitCopyFromAttrs<T extends Partial<BodyBitJson>>(data: T): T {\n const copy = { ...data };\n // Copy any attributes from 'attrs' to the node (necessary when the input if from JSON)\n if (data.attrs) {\n for (const [key, value] of Object.entries(data.attrs)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (copy as any)[key] = value;\n }\n }\n\n return copy;\n }\n\n /**\n * Set examples down the tree\n *\n * @param body\n * @param cardNode\n * @param __isDefaultExample\n * @param example\n * @returns true if any of the answers has an example, otherwise undefined\n */\n private pushExampleDownTree(\n context: BuildContext,\n body: Body | undefined,\n cardNode: CardNode | undefined,\n __isDefaultExample: boolean | undefined,\n example: ExampleJson | undefined,\n ): void {\n if (__isDefaultExample || example != null) {\n if (cardNode) {\n this.pushExampleDownTreeString(\n context,\n __isDefaultExample,\n example,\n cardNode.pairs as WithExampleJson[],\n );\n this.pushExampleDownTreeBoolean(\n context,\n __isDefaultExample,\n example,\n false,\n cardNode.flashcards as WithExampleJson[],\n );\n this.pushExampleDownTreeBoolean(\n context,\n __isDefaultExample,\n example,\n false,\n cardNode.definitions as WithExampleJson[],\n );\n this.pushExampleDownTreeBoolean(\n context,\n __isDefaultExample,\n example,\n true,\n cardNode.choices as WithExampleJson[],\n );\n this.pushExampleDownTreeBoolean(\n context,\n __isDefaultExample,\n example,\n false,\n cardNode.responses,\n cardNode.statements,\n cardNode.statement,\n );\n if (cardNode.quizzes) {\n for (const quiz of cardNode.quizzes) {\n this.pushExampleDownTreeBoolean(\n context,\n __isDefaultExample,\n example,\n true,\n quiz.choices as WithExampleJson[] | undefined,\n );\n this.pushExampleDownTreeBoolean(\n context,\n __isDefaultExample,\n example,\n false,\n quiz.responses as WithExampleJson[] | undefined,\n );\n }\n }\n if (cardNode.matrix) {\n for (const m of cardNode.matrix) {\n this.pushExampleDownTreeString(context, __isDefaultExample, example, m.cells);\n }\n }\n }\n if (body) {\n this.pushExampleDownTreeBodyBits(context, __isDefaultExample, example, body);\n }\n }\n }\n\n /**\n * Set examples for boolean nodes\n *\n * @param __isDefaultExample\n * @param example\n * @param onlyCorrect\n * @param nodes\n * @returns true if any of the answers has an example, otherwise undefined\n */\n private pushExampleDownTreeBoolean(\n _context: BuildContext,\n __isDefaultExample: boolean | undefined,\n example: ExampleJson | undefined,\n onlyCorrect: boolean,\n ...nodes: (WithExampleJson | WithExampleJson[] | undefined)[]\n ): void {\n if (!__isDefaultExample && example == null) return;\n\n if (Array.isArray(nodes)) {\n for (const ds of nodes) {\n if (ds) {\n const exampleNodes = Array.isArray(ds) ? ds : [ds];\n BitUtils.fillBooleanExample(exampleNodes, __isDefaultExample, example, onlyCorrect);\n }\n }\n }\n }\n\n /**\n * Set examples for string nodes\n *\n * @param __isDefaultExample\n * @param example\n * @param nodes\n * @returns true if any of the answers has an example, otherwise undefined\n */\n private pushExampleDownTreeString(\n context: BuildContext,\n __isDefaultExample: boolean | undefined,\n example: ExampleJson | undefined,\n ...nodes: (WithExampleJson | WithExampleJson[] | undefined)[]\n ): void {\n if (!__isDefaultExample && !example) return;\n\n if (Array.isArray(nodes)) {\n for (const ds of nodes) {\n if (ds) {\n const exampleNodes = Array.isArray(ds) ? ds : [ds];\n BitUtils.fillStringExample(\n context.textFormat,\n exampleNodes,\n __isDefaultExample,\n example,\n false,\n );\n }\n }\n }\n }\n\n private pushExampleDownTreeBodyBits(\n context: BuildContext,\n __isDefaultExample: boolean | undefined,\n example: ExampleJson | undefined,\n body: Body | undefined,\n ): void {\n if (!__isDefaultExample && !example) return;\n const bodyBitsJson = this.textParser.extractBodyBits(body?.body as TextAst);\n\n for (const part of bodyBitsJson) {\n if (part) {\n switch (part.type) {\n case BodyBitType.gap: {\n const gap = part as GapJson;\n BitUtils.fillStringExample(\n context.textFormat,\n [gap],\n __isDefaultExample,\n example,\n false,\n );\n break;\n }\n case BodyBitType.mark: {\n const mark = part as MarkJson;\n BitUtils.fillBooleanExample([mark], __isDefaultExample, example, false);\n break;\n }\n case BodyBitType.select: {\n const select = part as SelectJson;\n BitUtils.fillBooleanExample(select.options, __isDefaultExample, example, true);\n break;\n }\n case BodyBitType.highlight: {\n const highlight = part as HighlightJson;\n BitUtils.fillBooleanExample(highlight.texts, __isDefaultExample, example, true);\n break;\n }\n }\n }\n }\n }\n\n /**\n * Push a value down the tree, without overriding existing values\n *\n * This function is not type safe and should be used with care\n *\n * @param body/body[] set if the value should be passed down the body to the body bits / card body bits\n * @param bodyBitTypes body bit types to push the value down to\n * @param cardNode set if the value should be passed down the card node\n * @param path path for the value\n * @param value the value to push down\n */\n private pushDownTree(\n _context: BuildContext,\n body: Body | CardBit | undefined | (Body | CardBit | undefined)[],\n bodyBitTypes: BodyBitTypeType[] | undefined,\n cardNode: CardNode | undefined,\n cardNodePath: string | string[] | undefined,\n path: string,\n value: unknown,\n ): void {\n if (value === undefined) return;\n\n // Add value to card nodes if required\n if (cardNode && cardNodePath) {\n if (!Array.isArray(cardNodePath)) cardNodePath = [cardNodePath];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data = ObjectUtils.flatMapPath(cardNode, cardNodePath) as any[];\n\n for (const d of data) {\n if (d[path] == null) {\n d[path] = value;\n }\n }\n }\n\n // Add value to body bit types if required\n if (body) {\n const bodyArray: Body[] = (Array.isArray(body) ? body : [body]) as Body[];\n for (const b of bodyArray) {\n if (b && b.body && bodyBitTypes) {\n const bodyBitsJson = this.textParser.extractBodyBits(b.body as TextAst);\n\n if (bodyBitTypes && bodyBitsJson && bodyBitsJson.length > 0) {\n for (const part of bodyBitsJson) {\n if (part) {\n if (bodyBitTypes.indexOf(part.type as BodyBitTypeType) !== -1) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const data = part as any;\n if (data[path] == null) {\n data[path] = value;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n private parseExtraProperties(\n extraProperties: { [key: string]: unknown } | undefined,\n ): ExtraProperties | undefined {\n if (!extraProperties) return undefined;\n\n const entries = Object.entries(extraProperties);\n if (entries.length === 0) return undefined;\n\n const res: ExtraProperties = {};\n\n for (const [key, value] of entries) {\n res[key] = (ArrayUtils.asArray(value) || [value]) as Property;\n }\n\n return res;\n }\n\n /**\n * Set the 'isExample' flags on the bit\n *\n * The flag is set if the bit has an example. The flag is set at each branch level up the tree from\n * where the 'example' exists.\n *\n * @param bit\n */\n private setIsExampleFlags(bit: Bit) {\n // bit.isExample = false;\n\n const checkIsExample = (example: WithExampleJson): boolean => {\n if (!example) return false;\n\n if (/*example.__isDefaultExample ||*/ example.isExample || example.example != undefined) {\n example.isExample = true;\n bit.isExample = true;\n } else {\n if (example === bit) {\n example.isExample = !!bit.isExample;\n } else {\n example.isExample = false;\n }\n }\n return example.isExample;\n };\n\n const { body, cardNode } = bit;\n\n // Body bit level\n const bodyBitsJson = this.textParser.extractBodyBits(body?.body as TextAst);\n\n for (const bodyPart of bodyBitsJson) {\n switch (bodyPart.type) {\n case BodyBitType.gap:\n case BodyBitType.mark: {\n checkIsExample(bodyPart as WithExampleJson);\n break;\n }\n\n case BodyBitType.select: {\n const select = bodyPart as SelectJson;\n let hasExample = false;\n for (const option of select.options) {\n hasExample = checkIsExample(option as WithExampleJson) ? true : hasExample;\n }\n select.isExample = hasExample;\n break;\n }\n\n case BodyBitType.highlight: {\n const highlight = bodyPart as HighlightJson;\n let hasExample = false;\n for (const text of highlight.texts) {\n hasExample = checkIsExample(text as WithExampleJson) ? true : hasExample;\n }\n highlight.isExample = hasExample;\n break;\n }\n }\n }\n\n // Card level\n\n if (cardNode) {\n // flashcards\n for (const v of cardNode.flashcards || []) {\n checkIsExample(v as WithExampleJson);\n }\n\n // definitions\n for (const v of cardNode.definitions || []) {\n checkIsExample(v as WithExampleJson);\n }\n\n // pairs\n for (const v of cardNode.pairs || []) {\n checkIsExample(v as WithExampleJson);\n }\n // matrix\n for (const mx of cardNode.matrix || []) {\n let hasExample = false;\n\n // matrix cell\n for (const v of mx.cells || []) {\n hasExample = checkIsExample(v as WithExampleJson) ? true : hasExample;\n }\n mx.isExample = hasExample;\n }\n // quizzes\n for (const quiz of cardNode.quizzes || []) {\n let hasExample = false;\n\n // responses\n for (const v of quiz.responses || []) {\n hasExample = checkIsExample(v as WithExampleJson) ? true : hasExample;\n }\n // choices\n for (const v of quiz.choices || []) {\n hasExample = checkIsExample(v as WithExampleJson) ? true : hasExample;\n }\n quiz.isExample = hasExample;\n }\n // responses\n for (const v of cardNode.responses || []) {\n checkIsExample(v as WithExampleJson);\n }\n // choices\n for (const v of cardNode.choices || []) {\n checkIsExample(v as WithExampleJson);\n }\n // statements\n for (const v of cardNode.statements || []) {\n checkIsExample(v as WithExampleJson);\n }\n // statement\n checkIsExample(cardNode.statement as WithExampleJson);\n // NO: elements\n // questions\n for (const v of cardNode.questions || []) {\n checkIsExample(v as WithExampleJson);\n }\n }\n\n // Bit level\n\n // statement\n checkIsExample(bit.statement as WithExampleJson);\n // responses\n for (const v of bit.responses || []) {\n checkIsExample(v as WithExampleJson);\n }\n // choices\n for (const v of bit.choices || []) {\n checkIsExample(v as WithExampleJson);\n }\n\n // Bit itself\n checkIsExample(bit as WithExampleJson);\n }\n\n private setDefaultBitValues(bit: Bit) {\n const { bitType } = bit;\n // Set aiGenerated == true for all AI generated bits\n switch (bitType) {\n case BitType.articleAi:\n case BitType.noteAi:\n case BitType.summaryAi:\n bit.aiGenerated = this.toAstProperty(\n bitType,\n ConfigKey.property_aiGenerated,\n true,\n undefined,\n );\n break;\n }\n }\n\n private addVersionToParserInfo(bit: Bit) {\n const parser: ParserInfo = bit.parser ?? {};\n parser.version = env.appVersion.full;\n bit.parser = parser;\n }\n}\n\nexport { Builder };\n","import { type Writer } from './Writer.ts';\n\n/**\n * Writer to write to a string.\n */\nclass StringWriter implements Writer {\n private _buffer: string[] | undefined;\n private _string: string = '';\n public endOfLineString = '\\n';\n private lastWrite = '';\n\n public get isSync() {\n return true;\n }\n\n /**\n * Get the string which has been written.\n *\n * This cannot be called until after close() has resolved its Promise.\n *\n * @returns\n */\n public getString(): string {\n return this._string;\n }\n\n public async open(): Promise<void> {\n this.openSync();\n return Promise.resolve();\n }\n\n public async close(): Promise<void> {\n try {\n this.closeSync();\n } catch (e) {\n return Promise.reject(e);\n }\n return Promise.resolve();\n }\n\n public openSync(): void {\n this._buffer = [];\n this._string = '';\n }\n\n public closeSync(): void {\n if (!this._buffer) {\n throw new Error('open() or openSync() never called');\n }\n this._string = this._buffer.join('');\n this._buffer = [];\n }\n\n public writeLine(value?: string): this {\n if (!this._buffer) return this;\n\n if (value != null) {\n this._buffer.push(value + this.endOfLineString);\n this.lastWrite = value + this.endOfLineString;\n } else {\n this._buffer.push(this.endOfLineString);\n this.lastWrite = this.endOfLineString;\n }\n\n return this;\n }\n\n public writeLines(values: string[], delimiter?: string): this {\n if (!this._buffer) return this;\n if (!values) return this;\n let str = '';\n\n for (let i = 0, len = values.length; i < len; i++) {\n const value = values[i];\n this._buffer.push(value);\n str += value;\n if (delimiter && i < len - 1) {\n this._buffer.push(delimiter);\n str += delimiter;\n }\n this._buffer.push(this.endOfLineString);\n str += this.endOfLineString;\n }\n\n this.lastWrite = str;\n\n return this;\n }\n\n public write(value: string): this {\n if (!this._buffer) return this;\n if (value == null) return this;\n if (value) this.lastWrite = value;\n this._buffer.push(value);\n return this;\n }\n\n public writeWhiteSpace(): this {\n this.write(' ');\n return this;\n }\n\n public getLastWrite(): string {\n return this.lastWrite;\n }\n}\n\nexport { StringWriter };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nimport { Ast } from './ast/Ast.ts';\nimport { Config } from './config/Config.ts';\nimport { type BitmarkOptions } from './generator/bitmark/BitmarkGenerator.ts';\nimport { BitmarkStringGenerator } from './generator/bitmark/BitmarkStringGenerator.ts';\nimport { type JsonOptions } from './generator/json/JsonGenerator.ts';\nimport { JsonObjectGenerator } from './generator/json/JsonObjectGenerator.ts';\n// import { TextFormat, TextFormatType } from './model/enum/TextFormat.ts';\nimport { TextGenerator } from './generator/text/TextGenerator.ts';\nimport { InfoBuilder, type SupportedBit } from './info/InfoBuilder.ts';\nimport { type BitmarkAst } from './model/ast/Nodes.ts';\nimport { BitmarkParserType, type BitmarkParserTypeType } from './model/enum/BitmarkParserType.ts';\nimport { type BitmarkVersionType } from './model/enum/BitmarkVersion.ts';\nimport { InfoFormat, type InfoFormatType } from './model/info/enum/InfoFormat.ts';\nimport { InfoType, type InfoTypeType } from './model/info/enum/InfoType.ts';\nimport { BitmarkParser } from './parser/bitmark/BitmarkParser.ts';\nimport { JsonParser } from './parser/json/JsonParser.ts';\nimport { TextParser } from './parser/text/TextParser.ts';\nimport { env } from './utils/env/Env.ts';\n\n/*\n * NOTE:\n *\n * We want to be able to strip out the NodeJS specific functions from the final bundle.\n * Any code between the comments STRIP:START and STRIP:END will be removed.\n *\n * However, the prettifier will move comments that it does not believe are associated with code.\n *\n * Therefore we have to use some dummy code to prevent it from removing the STRIP stripping comments.\n */\nconst STRIP = 0;\n\n/* STRIP:START */\nSTRIP; // eslint-disable-line @typescript-eslint/no-unused-expressions\n\nimport path from 'node:path';\n\nimport fs from 'fs-extra';\n\nimport { type FileOptions } from './ast/writer/FileWriter.ts';\nimport { Breakscape } from './breakscaping/Breakscape.ts';\nimport { BitmarkFileGenerator } from './generator/bitmark/BitmarkFileGenerator.ts';\nimport { JsonFileGenerator } from './generator/json/JsonFileGenerator.ts';\nimport { ConfigBuilder } from './info/ConfigBuilder.ts';\nimport { type BreakscapedString } from './model/ast/BreakscapedString.ts';\nimport type { _BitConfig, _GroupsConfig } from './model/config/_Config.ts';\nimport { type BodyTextFormatType } from './model/enum/BodyTextFormat.ts';\nimport { TextFormat, type TextFormatType } from './model/enum/TextFormat.ts';\nimport { TextLocation, type TextLocationType } from './model/enum/TextLocation.ts';\n\n/* STRIP:END */\nSTRIP; // eslint-disable-line @typescript-eslint/no-unused-expressions\n\n/**\n * Info options for the parser\n */\nexport interface InfoOptions {\n /**\n * Specify the type of information to return, overriding the default (list)\n * - list: list of supported bits\n * - deprecated: list of deprecated bits\n * - all: list of supported bits and deprecated bits\n * - bit: configuration for a specific bit, or all bits\n */\n type?: InfoTypeType;\n\n /**\n * Specify the bit type to return, overriding the default (all)\n */\n bit?: string;\n\n /**\n * Specify the output format, overriding the default (text)\n */\n outputFormat?: InfoFormatType;\n\n /**\n * Prettify the JSON.\n *\n * If not set or false, JSON will not be prettified.\n * If true, JSON will be prettified with an indent of 2.\n * If a positive integer, JSON will be prettified with an indent of this number.\n *\n * If prettify is set, a string will be returned if possible.\n */\n prettify?: boolean | number;\n}\n\n/**\n * Config generation options for the parser\n */\nexport interface GenerateConfigOptions {\n //\n}\n\n/**\n * Conversion options for bitmark / JSON conversion\n */\nexport interface ConvertOptions {\n /**\n * The version of bitmark to output.\n * If not specified, the version will be 3.\n *\n * Specifying the version will set defaults for other options.\n * - Bitmark v2:\n * - bitmarkOptions.cardSetVersion: 1\n * - jsonOptions.textAsPlainText: true\n * - Bitmark v3:\n * - bitmarkOptions.cardSetVersion: 2\n * - jsonOptions.textAsPlainText: false\n *\n */\n bitmarkVersion?: BitmarkVersionType;\n\n /**\n * Specify the bitmark parser to use, overriding the default\n */\n bitmarkParserType?: BitmarkParserTypeType;\n\n /**\n * Set to force input to be interpreted as a particular format, overriding the auto-detection\n * Auto-detection can fail or open unwanted files for strings that look like paths\n */\n inputFormat?: InputType;\n /**\n * Specify the output format, overriding the default\n */\n outputFormat?: OutputType;\n /**\n * Specify a file to write the output to\n */\n outputFile?: fs.PathLike;\n /**\n * Options for the output file\n */\n fileOptions?: FileOptions;\n /**\n * Options for bitmark generation\n */\n bitmarkOptions?: BitmarkOptions;\n /**\n * Options for JSON generation\n */\n jsonOptions?: JsonOptions;\n}\n\n/**\n * Prettify options for bitmark / JSON prettify / validate\n */\nexport interface UpgradeOptions {\n /**\n * The version of bitmark to output.\n * If not specified, the version will be 3.\n *\n * Specifying the version will set defaults for other options.\n * - Bitmark v2:\n * - bitmarkOptions.cardSetVersion: 1\n * - jsonOptions.textAsPlainText: true\n * - Bitmark v3:\n * - bitmarkOptions.cardSetVersion: 2\n * - jsonOptions.textAsPlainText: false\n *\n */\n bitmarkVersion?: BitmarkVersionType;\n\n /**\n * Specify the bitmark parser to use, overriding the default\n */\n bitmarkParserType?: BitmarkParserTypeType;\n\n /**\n * Set to force input to be interpreted as a particular format, overriding the auto-detection\n * Auto-detection can fail or open unwanted files for strings that look like paths\n */\n inputFormat?: InputType;\n\n /**\n * Specify a file to write the output to\n */\n outputFile?: fs.PathLike;\n\n /**\n * Options for the output file\n */\n fileOptions?: FileOptions;\n\n /**\n * Options for bitmark generation\n */\n bitmarkOptions?: BitmarkOptions;\n\n /**\n * Options for JSON generation\n */\n jsonOptions?: JsonOptions;\n}\n\n/**\n * Conversion options for bitmark text / JSON conversion\n */\nexport interface ConvertTextOptions {\n /**\n * Specify the text format (default: bitmark++)\n */\n textFormat?: BodyTextFormatType;\n\n /**\n * Specify the text location (default: body)\n */\n textLocation?: TextLocationType;\n\n /**\n * Set to force input to be interpreted as a particular format, overriding the auto-detection\n * Auto-detection can fail or open unwanted files for strings that look like paths\n */\n inputFormat?: InputType;\n\n /**\n * Specify a file to write the output to\n */\n outputFile?: fs.PathLike;\n\n /**\n * Options for the output file\n */\n fileOptions?: FileOptions;\n\n /**\n * Options for JSON generation\n */\n jsonOptions?: TextJsonOptions;\n}\n\n/**\n * Create AST options\n */\nexport interface CreateAstOptions {\n /**\n * Set to force input to be interpreted as a particular format, overriding the auto-detection\n * Auto-detection can fail or open unwanted files for strings that look like paths\n */\n inputFormat?: InputType;\n}\n\n/**\n * Breakscape options\n */\nexport interface BreakscapeOptions {\n /**\n * Set to force input to be interpreted as a particular format, overriding the auto-detection\n * Auto-detection can fail or open unwanted files for strings that look like paths\n */\n inputFormat?: InputType;\n\n /**\n * Specify a file to write the output to\n */\n outputFile?: fs.PathLike;\n\n /**\n * Options for the output file\n */\n fileOptions?: FileOptions;\n\n /**\n * Specify the text format (default: bitmark++)\n */\n textFormat?: BodyTextFormatType;\n\n /**\n * Specify the text location (default: body)\n */\n textLocation?: TextLocationType;\n}\n\n/**\n * Unbreakscape options\n */\nexport interface UnbreakscapeOptions {\n /**\n * Set to force input to be interpreted as a particular format, overriding the auto-detection\n * Auto-detection can fail or open unwanted files for strings that look like paths\n */\n inputFormat?: InputType;\n\n /**\n * Specify a file to write the output to\n */\n outputFile?: fs.PathLike;\n\n /**\n * Options for the output file\n */\n fileOptions?: FileOptions;\n\n /**\n * Specify the text format (default: bitmark++)\n */\n textFormat?: BodyTextFormatType;\n\n /**\n * Specify the text location (default: body)\n */\n textLocation?: TextLocationType;\n}\n\n/**\n * Input type enumeration\n */\nconst Input = superenum({\n /**\n * Input is as a string\n */\n string: 'string',\n\n /**\n * Input is as a file path\n */\n file: 'file',\n});\n\nexport type InputType = EnumType<typeof Input>;\n\n/**\n * Output type enumeration\n */\nconst Output = superenum({\n /**\n * Output bitmark string\n */\n bitmark: 'bitmark',\n\n /**\n * Output JSON as a plain JS object, or a file\n */\n json: 'json',\n\n /**\n * Output AST as a plain JS object, or a file\n */\n ast: 'ast',\n});\n\nexport type OutputType = EnumType<typeof Output>;\n\n/**\n * Options for bitmark text JSON generation\n */\nexport interface TextJsonOptions {\n /**\n * Prettify the JSON.\n *\n * If not set or false, JSON will not be prettified.\n * If true, JSON will be prettified with an indent of 2.\n * If a positive integer, JSON will be prettified with an indent of this number.\n *\n * If prettify is set, a string will be returned if possible.\n */\n prettify?: boolean | number;\n\n /**\n * Stringify the JSON.\n *\n * If not set or false, JSON will be returned as a plain JS object.\n * It true, JSON will be stringified.\n *\n * If prettify is set, it will override this setting.\n */\n stringify?: boolean;\n\n /**\n * [development only]\n * Generate debug information in the output.\n */\n debugGenerationInline?: boolean;\n}\n\n/**\n * Bitmark tool for manipulating bitmark in all its formats.\n *\n */\nclass BitmarkParserGenerator {\n protected ast = new Ast();\n protected jsonParser = new JsonParser();\n protected bitmarkParser = new BitmarkParser();\n protected textParser = new TextParser();\n protected textGenerator = new TextGenerator();\n\n /**\n * Get the version of the bitmark-parser-generator library\n */\n public version(): string {\n return env.appVersion.full;\n }\n\n /**\n * Get information about the bitmark-parser-generator library\n */\n public info(options?: InfoOptions): unknown {\n const opts: InfoOptions = Object.assign({}, options);\n const builder = new InfoBuilder();\n let res: unknown;\n const outputString = !opts.outputFormat || opts.outputFormat === InfoFormat.text;\n const outputJson = opts.outputFormat === InfoFormat.json;\n const all = opts.type === InfoType.all;\n const deprecated = opts.type === InfoType.deprecated;\n const includeNonDeprecated = all || !deprecated;\n const includeDeprecated = all || deprecated;\n\n if (opts.type === InfoType.bit) {\n const bitConfigs = builder.getSupportedBitConfigs().filter((b) => {\n if (!opts.bit) return true;\n const bitType = Config.getBitType(opts.bit);\n return bitType === b.bitType;\n });\n if (outputString) {\n res = bitConfigs\n .map((b) =>\n b.toString({\n includeChains: true,\n includeConfigs: true,\n }),\n )\n .join('\\n\\n--------------\\n\\n');\n } else {\n res = bitConfigs;\n }\n } else {\n // List / List Deprecated\n const supportedBits = builder\n .getSupportedBits({\n includeNonDeprecated,\n includeDeprecated,\n })\n .filter((b) => {\n if (!opts.bit) return true;\n const bitType = Config.getBitType(opts.bit);\n if (b.name === bitType) return true;\n });\n if (outputString) {\n res = this.supportedBitsAsString(supportedBits);\n } else {\n res = supportedBits;\n }\n }\n\n if (outputJson) {\n const prettifySpace = opts.prettify === true ? 2 : opts.prettify || undefined;\n res = JSON.stringify(res, null, prettifySpace);\n }\n\n return res;\n }\n\n /**\n * Generate the new configuration for the bitmark parser.\n */\n public async generateConfig(options?: GenerateConfigOptions): Promise<unknown> {\n const opts: GenerateConfigOptions = Object.assign({}, options);\n const builder = new ConfigBuilder();\n // let res: unknown;\n // const outputString = !opts.outputFormat || opts.outputFormat === InfoFormat.text;\n // const outputJson = opts.outputFormat === InfoFormat.json;\n // const all = opts.type === InfoType.all;\n // const deprecated = opts.type === InfoType.deprecated;\n // const includeNonDeprecated = all || !deprecated;\n // const includeDeprecated = all || deprecated;\n\n await builder.build(opts);\n\n return void 0;\n }\n\n /**\n * Convert bitmark from bitmark to JSON, or JSON to bitmark.\n *\n * Input type is detected automatically and may be:\n * - string: bitmark, JSON, or AST\n * - object: JSON or AST\n * - file: bitmark, JSON, or AST\n *\n * Output type is selected automatically based on input type detection:\n * - input(JSON/AST) ==> output(bitmark)\n * - input(bitmark) ==> output(JSON)\n *\n * By default, the result is returned as a string for bitmark, or a plain JS object for JSON/AST.\n *\n * The options can be used to write the output to a file and to set conversion options or override defaults.\n *\n * If both the input and output formats are the same, the input will be validated and rewritten.\n * This feature be used to upgrade bitmark or JSON to the latest version.\n *\n * @param input - bitmark or JSON or AST as a string, JSON or AST as plain JS object, or path to a file containing\n * bitmark, JSON, or AST.\n * @param options - the conversion options\n * @returns Promise that resolves to string if converting to bitmark, a plain JS object if converting to JSON, or\n * void if writing to a file\n * @throws Error if any error occurs\n */\n public async convert(\n input: string | fs.PathLike | unknown,\n options?: ConvertOptions,\n ): Promise<string | unknown | void> {\n let res: string | unknown | void;\n const opts: ConvertOptions = Object.assign({}, options);\n // const fileOptions = Object.assign({}, opts.fileOptions);\n // const bitmarkOptions = Object.assign({}, opts.bitmarkOptions);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n\n const outputFormat = opts.outputFormat;\n const outputBitmark = outputFormat === Output.bitmark;\n const outputJson = outputFormat === Output.json;\n const outputAst = outputFormat === Output.ast;\n const bitmarkParserType = BitmarkParserType.peggy; // Option is no longer used as only Peggy parser supported\n\n let inStr: string = input as string;\n\n // Check if we are trying to write to a file in the browser\n if (env.isBrowser && opts.outputFile) {\n throw new Error('Cannot write to file in browser environment');\n }\n\n // If a file, read the file in\n if (!opts.inputFormat || opts.inputFormat === Input.file) {\n if (env.isNode) {\n if (fs.existsSync(inStr)) {\n inStr = fs.readFileSync(inStr, {\n encoding: 'utf8',\n });\n }\n }\n }\n\n // Preprocess as AST to see if AST\n let ast = this.ast.preprocessAst(inStr);\n const isAst = !!ast;\n\n if (!isAst) {\n // Not AST, so process as JSON to see if we have JSON\n ast = this.jsonParser.toAst(inStr);\n }\n const isJson = !!ast?.bits;\n const isBitmark = !isJson && !isAst; // Assume bitmark since not AST or JSON\n\n // Helper conversion functions\n const bitmarkToBitmark = async (bitmarkStr: string) => {\n // Validate and prettify\n await bitmarkToAst(bitmarkStr);\n await astToBitmark(res as BitmarkAst);\n };\n\n const bitmarkToAst = async (bitmarkStr: string) => {\n res = this.bitmarkParser.toAst(bitmarkStr, {\n parserType: bitmarkParserType,\n });\n };\n\n const bitmarkToJson = async (bitmarkStr: string) => {\n if (bitmarkParserType === BitmarkParserType.peggy) {\n // Convert the bitmark to JSON using the peggy parser (aways true, only peggy parser supported)\n\n // Generate AST from the Bitmark markup\n ast = this.bitmarkParser.toAst(bitmarkStr, {\n parserType: bitmarkParserType,\n });\n\n // Convert the AST to JSON\n if (opts.outputFile) {\n // Write JSON file\n const generator = new JsonFileGenerator(opts.outputFile, opts);\n await generator.generate(ast);\n } else {\n // Generate JSON object\n const generator = new JsonObjectGenerator(opts);\n const json = await generator.generate(ast);\n\n // Return JSON as object or string depending on prettify/stringify option\n res = this.jsonStringifyPrettify(json, jsonOptions);\n }\n }\n };\n\n const astToBitmark = async (astJson: BitmarkAst) => {\n // Convert the AST to bitmark\n if (opts.outputFile) {\n // Write markup file\n const generator = new BitmarkFileGenerator(opts.outputFile, opts);\n await generator.generate(astJson);\n } else {\n // Generate markup string\n const generator = new BitmarkStringGenerator(opts);\n res = await generator.generate(astJson);\n }\n };\n\n const astToAst = async (astJson: BitmarkAst) => {\n // Return JSON as object or string depending on prettify/stringify option\n res = this.jsonStringifyPrettify(astJson, jsonOptions);\n };\n\n const astToJson = async (astJson: BitmarkAst) => {\n // Convert the AST to JSON\n if (opts.outputFile) {\n // Write JSON file\n const generator = new JsonFileGenerator(opts.outputFile, opts);\n await generator.generate(astJson);\n } else {\n // Generate JSON object\n const generator = new JsonObjectGenerator(opts);\n const json = await generator.generate(astJson);\n\n // Return JSON as object or string depending on prettify/stringify option\n res = this.jsonStringifyPrettify(json, jsonOptions);\n }\n };\n\n const jsonToBitmark = async (astJson: BitmarkAst) => {\n // We already have the ast from detecting the input type, so use the AST we already have\n\n // Convert the JSON to bitmark\n if (opts.outputFile) {\n // Write markup file\n const generator = new BitmarkFileGenerator(opts.outputFile, opts);\n await generator.generate(astJson);\n } else {\n // Generate markup string\n const generator = new BitmarkStringGenerator(opts);\n res = await generator.generate(astJson);\n }\n };\n\n const jsonToAst = async (astJson: BitmarkAst) => {\n // We already have the ast from detecting the input type, so just return the AST we already have\n\n // Return JSON as object or string depending on prettify/stringify option\n res = this.jsonStringifyPrettify(astJson, jsonOptions);\n };\n\n const jsonToJson = async (astJson: BitmarkAst) => {\n // Validate and prettify\n await astToJson(astJson);\n };\n\n // Convert\n if (isBitmark) {\n // Input was Bitmark\n if (outputBitmark) {\n // Bitmark ==> Bitmark\n await bitmarkToBitmark(inStr);\n } else if (outputAst) {\n // Bitmark ==> AST\n await bitmarkToAst(inStr);\n } else {\n // Bitmark ==> JSON\n await bitmarkToJson(inStr);\n }\n } else if (isAst) {\n // Input was AST\n ast = ast as BitmarkAst;\n if (outputAst) {\n // AST ==> AST\n await astToAst(ast);\n } else if (outputJson) {\n // AST ==> JSON\n await astToJson(ast);\n } else {\n // AST ==> Bitmark\n await astToBitmark(ast);\n }\n } else {\n // Input was JSON\n ast = ast as BitmarkAst;\n if (outputJson) {\n // JSON ==> JSON\n await jsonToJson(ast);\n } else if (outputAst) {\n // JSON ==> AST\n await jsonToAst(ast);\n } else {\n // JSON ==> Bitmark\n await jsonToBitmark(ast);\n }\n }\n\n return res;\n }\n\n /**\n * Upgrade bitmark or JSON, upgrading to the latest supported syntax, removing unrecognised data in the process.\n *\n * THIS FEATURE SHOULD BE USED WITH CAUTION. IT WILL POTENTIALLY DELETE DATA.\n *\n * Input type is detected automatically and may be:\n * - string: bitmark, JSON\n * - object: JSON\n * - file: bitmark, JSON\n *\n * Output type is the same as the detected input type\n *\n * By default, the result is returned as a string for bitmark, or a plain JS object for JSON.\n *\n * The options can be used to write the output to a file and to set conversion options or override defaults.\n *\n * If both the input and output formats are the same, the input will be validated and rewritten.\n *\n * @param input - bitmark or JSON or AST as a string, JSON or AST as plain JS object, or path to a file containing\n * bitmark, JSON, or AST.\n * @param options - the conversion options\n * @returns Promise that resolves to string if upgrading to bitmark, a plain JS object if converting to JSON, or\n * void if writing to a file\n * @throws Error if any error occurs\n */\n public async upgrade(\n input: string | fs.PathLike | unknown,\n options?: UpgradeOptions,\n ): Promise<string | unknown | void> {\n let res: string | unknown | void;\n const opts: UpgradeOptions = Object.assign({}, options);\n // const fileOptions = Object.assign({}, opts.fileOptions);\n // const bitmarkOptions = Object.assign({}, opts.bitmarkOptions);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n\n const bitmarkParserType = opts.bitmarkParserType;\n\n let inStr: string = input as string;\n\n // Check if we are trying to write to a file in the browser\n if (env.isBrowser && opts.outputFile) {\n throw new Error('Cannot write to file in browser environment');\n }\n\n // If a file, read the file in\n if (!opts.inputFormat || opts.inputFormat === Input.file) {\n if (env.isNode) {\n if (fs.existsSync(inStr)) {\n inStr = fs.readFileSync(inStr, {\n encoding: 'utf8',\n });\n }\n }\n }\n\n // Process as JSON to see if we have JSON\n let ast = this.jsonParser.toAst(inStr);\n\n const isJson = !!ast?.bits;\n const isBitmark = !isJson; // Assume bitmark since not JSON\n\n // Helper conversion functions\n const bitmarkToBitmark = async (bitmarkStr: string) => {\n // Validate and upgrade\n const astJson = this.bitmarkParser.toAst(bitmarkStr, {\n parserType: bitmarkParserType,\n });\n\n // Convert the AST to bitmark\n if (opts.outputFile) {\n // Write markup file\n const generator = new BitmarkFileGenerator(opts.outputFile, opts);\n await generator.generate(astJson);\n } else {\n // Generate markup string\n const generator = new BitmarkStringGenerator(opts);\n res = await generator.generate(astJson);\n }\n };\n\n const jsonToJson = async (astJson: BitmarkAst) => {\n // Validate and upgrade\n\n // Convert the AST to JSON\n if (opts.outputFile) {\n // Write JSON file\n const generator = new JsonFileGenerator(opts.outputFile, opts);\n await generator.generate(astJson);\n } else {\n // Generate JSON object\n const generator = new JsonObjectGenerator(opts);\n const json = await generator.generate(astJson);\n\n // Return JSON as object or string depending on prettify/stringify option\n res = this.jsonStringifyPrettify(json, jsonOptions);\n }\n };\n\n // Validate and Upgrade\n if (isBitmark) {\n // Bitmark ==> Bitmark\n await bitmarkToBitmark(inStr);\n } else {\n // JSON ==> JSON\n ast = ast as BitmarkAst;\n await jsonToJson(ast);\n }\n\n return res;\n }\n\n /**\n * Create a bitmark AST (Abstract Syntax Tree) from bitmark or JSON or AST\n *\n * Input type is detected automatically and may be string, object (JSON or AST), or file\n *\n * @param input the JSON or bitmark to convert to a bitmark AST\n * @param options - the create AST options\n * @returns bitmark AST\n * @throws Error if any error occurs\n */\n public createAst(input: unknown, options?: CreateAstOptions): BitmarkAst {\n let res: BitmarkAst;\n let inStr: string = input as string;\n const opts: CreateAstOptions = Object.assign({}, options);\n\n // If a file, read the file in\n if (!opts.inputFormat || opts.inputFormat === Input.file) {\n if (env.isNode) {\n if (fs.existsSync(inStr)) {\n inStr = fs.readFileSync(inStr, {\n encoding: 'utf8',\n });\n }\n }\n }\n\n // Preprocess as AST to see if AST\n let ast = this.ast.preprocessAst(inStr);\n const isAst = !!ast;\n\n if (!isAst) {\n // Not AST, so process as JSON to see if we have JSON\n ast = this.jsonParser.toAst(inStr);\n }\n const isJson = !!ast?.bits;\n const isBitmark = !isJson && !isAst; // Assume bitmark since not AST or JSON\n\n if (isBitmark) {\n // Bitmark ==> AST\n res = this.bitmarkParser.toAst(inStr);\n } else {\n // JSON / AST ==> AST\n res = ast as BitmarkAst;\n }\n\n return res;\n }\n\n /**\n * Convert bitmark text from JSON, or JSON to bitmark text.\n *\n * Input type is detected automatically and may be:\n * - string: bitmark text or JSON\n * - object: JSON\n * - file: bitmark text or JSON\n *\n * Output type is selected automatically based on input type detection:\n * - input(JSON) ==> output(bitmark text)\n * - input(bitmark text) ==> output(JSON)\n *\n * By default, the result is returned as a string for bitmark text, or a plain JS object for JSON.\n *\n * The options can be used to write the output to a file and to set conversion options or override defaults.\n *\n * @param input - bitmark text or JSON as a string, JSON as plain JS object, or path to a file containing\n * bitmark text or JSON.\n * @param options - the conversion options\n * @returns Promise that resolves to string if converting to bitmark text, a plain JS object if converting to JSON, or\n * void if writing to a file\n * @throws Error if any error occurs\n */\n public async convertText(\n input: string | fs.PathLike | unknown,\n options?: ConvertTextOptions,\n ): Promise<string | unknown | void> {\n let res: string | unknown | void;\n let preRes: string | unknown | void;\n const opts: ConvertTextOptions = Object.assign({}, options);\n const fileOptions = Object.assign({}, opts.fileOptions);\n const jsonOptions = Object.assign({}, opts.jsonOptions);\n const textFormat: TextFormatType =\n TextFormat.fromValue(opts.textFormat) ?? TextFormat.bitmarkText;\n const textLocation = opts.textLocation ?? TextLocation.body;\n\n let inStr: string = input as string;\n\n // Check if we are trying to write to a file in the browser\n if (env.isBrowser && opts.outputFile) {\n throw new Error('Cannot write to file in browser environment');\n }\n\n // If a file, read the file in\n if (!opts.inputFormat || opts.inputFormat === Input.file) {\n if (env.isNode) {\n if (fs.existsSync(inStr)) {\n inStr = fs.readFileSync(inStr, {\n encoding: 'utf8',\n });\n }\n }\n }\n\n // Preprocess as text AST to see if text AST\n const ast = this.textParser.preprocessAst(inStr);\n const isAst = !!ast;\n\n if (!isAst) {\n preRes = this.textParser.toAst(inStr, {\n format: textFormat,\n location: TextLocation.body,\n });\n } else {\n preRes = await this.textGenerator.generate(ast, textFormat, textLocation);\n }\n\n if (opts.outputFile) {\n const output = opts.outputFile.toString();\n let strRes: string = preRes as string;\n if (!isAst) {\n strRes = this.jsonStringifyPrettify(preRes, jsonOptions, true) as string;\n }\n\n // Write JSON to file\n const flag = fileOptions.append ? 'a' : 'w';\n fs.ensureDirSync(path.dirname(output));\n fs.writeFileSync(output, strRes, {\n flag,\n });\n } else {\n if (!isAst) {\n res = this.jsonStringifyPrettify(preRes, jsonOptions) as string;\n } else {\n res = preRes;\n }\n }\n\n return res;\n }\n\n /**\n * Breakscape bitmark text.\n *\n * Input type is detected automatically and may be:\n * - string: text\n * - file: path to a file containing text\n *\n * By default, the result is returned as a string.\n * By default, the text is breakscaped as if it was bitmark text in the body.\n * Use the options to change this behaviour.\n *\n * The options can be used to write the output to a file.\n *\n * @param input - text, or path to a file containing text.\n * @param options - the conversion options\n * @returns breakscaped string, or void if writing to a file\n * @throws Error if any error occurs\n */\n public breakscapeText(input: string, options?: BreakscapeOptions): string | void {\n if (!input) return input;\n\n const opts: BreakscapeOptions = Object.assign({}, options);\n const fileOptions = Object.assign({}, opts.fileOptions);\n const textFormat: TextFormatType =\n TextFormat.fromValue(opts.textFormat) ?? TextFormat.bitmarkText;\n const textLocation = opts.textLocation ?? TextLocation.body;\n\n let inStr: string = input as string;\n\n // Check if we are trying to write to a file in the browser\n if (env.isBrowser && opts.outputFile) {\n throw new Error('Cannot write to file in browser environment');\n }\n\n // If a file, read the file in\n if (!opts.inputFormat || opts.inputFormat === Input.file) {\n if (env.isNode) {\n if (fs.existsSync(inStr)) {\n inStr = fs.readFileSync(inStr, {\n encoding: 'utf8',\n });\n }\n }\n }\n\n // Do the breakscape\n const res = Breakscape.breakscape(inStr, {\n format: textFormat,\n location: textLocation,\n });\n\n if (opts.outputFile) {\n const output = opts.outputFile.toString();\n\n // Write JSON to file\n const flag = fileOptions.append ? 'a' : 'w';\n fs.ensureDirSync(path.dirname(output));\n fs.writeFileSync(output, res, {\n flag,\n });\n } else {\n return res;\n }\n }\n\n /**\n * Unescape (unbreakscape) bitmark text\n *\n * Input type is detected automatically and may be:\n * - string: text\n * - file: path to a file containing text\n *\n * By default, the result is returned as a string.\n * By default, the text is unbreakscaped as if it was bitmark text in the body.\n * Use the options to change this behaviour.\n *\n * The options can be used to write the output to a file.\n *\n * @param input - text, or path to a file containing text.\n * @param options - the conversion options\n * @returns unbreakscaped string, or void if writing to a file\n * @throws Error if any error occurs\n */\n public unbreakscapeText(input: string, options?: UnbreakscapeOptions): string | void {\n if (!input) return input;\n\n const opts: UnbreakscapeOptions = Object.assign({}, options);\n const fileOptions = Object.assign({}, opts.fileOptions);\n const textFormat: TextFormatType =\n TextFormat.fromValue(opts.textFormat) ?? TextFormat.bitmarkText;\n const textLocation = opts.textLocation ?? TextLocation.body;\n\n let inStr: BreakscapedString = input as BreakscapedString;\n\n // Check if we are trying to write to a file in the browser\n if (env.isBrowser && opts.outputFile) {\n throw new Error('Cannot write to file in browser environment');\n }\n\n // If a file, read the file in\n if (!opts.inputFormat || opts.inputFormat === Input.file) {\n if (env.isNode) {\n if (fs.existsSync(inStr)) {\n inStr = fs.readFileSync(inStr, {\n encoding: 'utf8',\n }) as BreakscapedString;\n }\n }\n }\n\n // Do the unbreakscape\n const res = Breakscape.unbreakscape(inStr, {\n format: textFormat,\n location: textLocation,\n });\n\n if (opts.outputFile) {\n const output = opts.outputFile.toString();\n\n // Write JSON to file\n const flag = fileOptions.append ? 'a' : 'w';\n fs.ensureDirSync(path.dirname(output));\n fs.writeFileSync(output, res, {\n flag,\n });\n } else {\n return res;\n }\n\n return;\n }\n\n /**\n * Stringify / prettify a plain JS object to a JSON string, depending on the JSON options\n *\n * @param json\n * @param options\n * @param forceStringify\n * @returns\n */\n private jsonStringifyPrettify = (\n json: unknown,\n options: JsonOptions,\n forceStringify?: boolean,\n ): unknown => {\n const prettifySpace = options.prettify === true ? 2 : options.prettify || undefined;\n const stringify = forceStringify || options.stringify === true || prettifySpace !== undefined;\n\n if (stringify) {\n return JSON.stringify(json, null, prettifySpace);\n }\n return json;\n };\n\n /**\n * Get the supported bits as a formatted strings\n *\n * @param supportedBits\n * @returns\n */\n private supportedBitsAsString(supportedBits: SupportedBit[]): string {\n let res = '';\n\n for (const rootBit of supportedBits) {\n res += `${rootBit.name} (since: ${rootBit.since}`;\n if (rootBit.deprecated) res += `, deprecated: ${rootBit.deprecated}`;\n res += ')\\n';\n }\n\n return res;\n }\n}\n\nexport { BitmarkParserGenerator, Input, Output };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst CardSetVersion = superenum({\n v1: 1,\n v2: 2,\n});\n\nexport type CardSetVersionType = EnumType<typeof CardSetVersion>;\n\nexport { CardSetVersion };\n","import { Ast, type NodeInfo } from '../../ast/Ast.ts';\nimport { StringWriter } from '../../ast/writer/StringWriter.ts';\nimport { type Writer } from '../../ast/writer/Writer.ts';\nimport { Breakscape } from '../../breakscaping/Breakscape.ts';\nimport { Config } from '../../config/Config.ts';\nimport { type BreakscapedString } from '../../model/ast/BreakscapedString.ts';\nimport {\n type Bit,\n type BitmarkAst,\n type Body,\n type BodyPart,\n type Footer,\n} from '../../model/ast/Nodes.ts';\nimport { NodeType } from '../../model/ast/NodeType.ts';\nimport { type JsonText, type TextAst } from '../../model/ast/TextNodes.ts';\nimport {\n configKeyToPropertyType,\n configKeyToResourceType,\n} from '../../model/config/enum/ConfigKey.ts';\nimport type { PropertyTagConfig } from '../../model/config/PropertyTagConfig.ts';\nimport {\n BitmarkVersion,\n type BitmarkVersionType,\n DEFAULT_BITMARK_VERSION,\n} from '../../model/enum/BitmarkVersion.ts';\nimport { BitType, type BitTypeType } from '../../model/enum/BitType.ts';\nimport { BodyBitType } from '../../model/enum/BodyBitType.ts';\nimport { CardSetVersion, type CardSetVersionType } from '../../model/enum/CardSetVersion.ts';\nimport { PropertyKey } from '../../model/enum/PropertyKey.ts';\nimport { ResourceType, type ResourceTypeType } from '../../model/enum/ResourceType.ts';\nimport { TagFormat, type TagFormatType } from '../../model/enum/TagFormat.ts';\nimport { TextFormat, type TextFormatType } from '../../model/enum/TextFormat.ts';\nimport { TextLocation, type TextLocationType } from '../../model/enum/TextLocation.ts';\nimport {\n type BookJson,\n type ChoiceJson,\n type FeedbackChoiceJson,\n type ImageSourceJson,\n type IngredientJson,\n type MarkConfigJson,\n type PersonJson,\n type PronunciationTableCellJson,\n type RatingLevelStartEndJson,\n type ResponseJson,\n type ServingsJson,\n type StatementJson,\n type TechnicalTermJson,\n} from '../../model/json/BitJson.ts';\nimport {\n type BodyBitJson,\n type GapJson,\n type HighlightTextJson,\n type MarkJson,\n type SelectOptionJson,\n} from '../../model/json/BodyBitJson.ts';\nimport {\n type AudioResourceWrapperJson,\n type ImageResourceJson,\n type ImageResourceWrapperJson,\n type ResourceDataJson,\n type ResourceJson,\n} from '../../model/json/ResourceJson.ts';\nimport { BooleanUtils } from '../../utils/BooleanUtils.ts';\nimport { ObjectUtils } from '../../utils/ObjectUtils.ts';\nimport { StringUtils } from '../../utils/StringUtils.ts';\nimport { AstWalkerGenerator } from '../AstWalkerGenerator.ts';\nimport { type GenerateOptions, TextGenerator } from '../text/TextGenerator.ts';\n\nconst DEFAULT_OPTIONS: BitmarkOptions = {\n debugGenerationInline: false,\n};\n\nconst DEFAULT_SPACES_AROUND_VALUES = 1;\nconst MAX_SPACES_AROUND_VALUES = 10;\n\n/**\n * Bitmark generation options\n */\nexport interface BitmarkOptions {\n /**\n * If true, always include bitmark text format even if it is the default for the bit\n * If false, only include bitmark text format if it is not the default for the bit\n */\n\n explicitTextFormat?: boolean;\n\n /**\n * Prettify the JSON in the bitmark body.\n *\n * If not set or false, JSON will not be prettified.\n * If true, JSON will be prettified with an indent of 2.\n * If a positive integer, JSON will be prettified with an indent of this number.\n */\n prettifyJson?: boolean | number;\n\n /**\n * Card set version to generate:\n * 1: === / == / --\n * 2: ++==== / ==== / -- / ~~ / ====++\n */\n cardSetVersion?: CardSetVersionType;\n\n /**\n * The number of spaces to insert around values in the bitmark.\n * If set to true, will use the default of 1 space.\n * If set to false, will not insert any spaces.\n * If set to a number, will insert that many spaces, up to a limit of 10.\n *\n * default: true\n */\n spacesAroundValues?: number | boolean;\n\n /**\n * [development only]\n * Generate debug information in the output.\n */\n debugGenerationInline?: boolean;\n}\n\n/**\n * Bitmark generator options\n */\nexport interface BitmarkGeneratorOptions {\n /**\n * bitmarkVersion - The version of bitmark to output.\n * If not specified, the version will default to 3.\n *\n * Specifying the version will set defaults for other options.\n * - Bitmark v2:\n * - cardSetVersion: 1\n * - Bitmark v3:\n * - cardSetVersion: 2\n */\n bitmarkVersion?: BitmarkVersionType;\n\n /**\n * The options for JSON generation.\n */\n bitmarkOptions?: BitmarkOptions;\n}\n\n/**\n * Generate bitmark markup from a bitmark AST\n *\n * NOTE: Newlines - a newline is written BEFORE each content that requries a newline\n *\n */\nclass BitmarkGenerator extends AstWalkerGenerator<BitmarkAst, void> {\n protected ast = new Ast();\n protected textGenerator: TextGenerator;\n private bitmarkVersion: BitmarkVersionType;\n private options: BitmarkOptions;\n private mainWriter: Writer; // Used for writing the bitmark\n private partWriter: StringWriter; // Used for writing parts which need to be assembled before writing to the main writer\n private writer: Writer; // The current writer being used\n private prettifySpace: number | undefined;\n private spacesAroundValues: number;\n private spacesAroundValuesStr: string;\n\n // State\n private bitType: BitTypeType = BitType._error;\n private textFormat: TextFormatType = TextFormat.bitmarkText;\n private isBodyBitmarkText = false;\n private isCardAllowed = false;\n private firstBit = true;\n private hasCardSet = false;\n private hasFooter = false;\n private inTag = true;\n\n /**\n * Generate bitmark markup from a bitmark AST\n *\n * @param writer - destination for the output\n * @param bitmarkVersion - The version of bitmark to output.\n * If not specified, the version will default to 3.\n *\n * Specifying the version will set defaults for other options.\n * - Bitmark v2:\n * - cardSetVersion: 1\n * - Bitmark v3:\n * - cardSetVersion: 2\n *\n * @param options - bitmark generation options\n */\n constructor(writer: Writer, options?: BitmarkGeneratorOptions) {\n super();\n\n // // Keep TS happy\n // this.inTag;\n\n // Bind callbacks\n this.enter = this.enter.bind(this);\n this.between = this.between.bind(this);\n this.exit = this.exit.bind(this);\n this.leaf = this.leaf.bind(this);\n this.write = this.write.bind(this);\n this.bodyBitCallback = this.bodyBitCallback.bind(this);\n\n // Set options\n this.bitmarkVersion =\n BitmarkVersion.fromValue(options?.bitmarkVersion) ?? DEFAULT_BITMARK_VERSION;\n this.options = {\n ...DEFAULT_OPTIONS,\n ...options?.bitmarkOptions,\n };\n\n this.debugGenerationInline = this.options.debugGenerationInline ?? false;\n\n // Set defaults according to bitmark version\n if (this.bitmarkVersion === BitmarkVersion.v2) {\n if (this.options.cardSetVersion === undefined) {\n this.options.cardSetVersion = CardSetVersion.v1;\n }\n } else {\n if (this.options.cardSetVersion === undefined) {\n this.options.cardSetVersion = CardSetVersion.v2;\n }\n }\n\n // Calculate the prettify space\n this.prettifySpace =\n this.options.prettifyJson === true ? 2 : this.options.prettifyJson || undefined;\n\n // Calculate the spaces around values\n this.spacesAroundValues = this.calcSpacesAroundValues();\n this.spacesAroundValuesStr = ' '.repeat(this.spacesAroundValues);\n\n // Create the text generator\n this.textGenerator = new TextGenerator(this.bitmarkVersion, {\n writeCallback: this.write,\n bodyBitCallback: this.bodyBitCallback,\n debugGenerationInline: this.debugGenerationInline,\n });\n\n this.mainWriter = writer;\n this.partWriter = new StringWriter();\n this.writer = this.mainWriter;\n\n this.generateResourceHandlers();\n this.generatePropertyHandlers();\n }\n\n /**\n * Generate bitmark markup from bitmark AST\n *\n * @param ast bitmark AST\n */\n public async generate(ast: BitmarkAst): Promise<void> {\n // Reset the state\n this.resetState();\n\n // Open the writer\n await this.writer.open();\n\n // Walk the bitmark AST\n this.walkAndWrite(ast);\n\n // Ensure a blank line at end of file\n this.writeLine();\n\n // Close the writer\n await this.writer.close();\n }\n\n /**\n * Generate text from a bitmark text AST synchronously\n *\n * @param ast bitmark text AST\n */\n public generateSync(ast: BitmarkAst): void {\n // Reset the state\n this.resetState();\n\n // Open the writer\n this.writer.openSync();\n\n // Walk the bitmark AST\n this.walkAndWrite(ast);\n\n // Close the writer\n this.writer.closeSync();\n }\n\n private resetState(): void {\n this.bitType = BitType._error;\n this.textFormat = TextFormat.bitmarkText;\n this.isBodyBitmarkText = false;\n this.isCardAllowed = false;\n this.firstBit = true;\n this.hasCardSet = false;\n this.hasFooter = false;\n this.inTag = true;\n this.printed = false;\n }\n\n private walkAndWrite(ast: BitmarkAst): void {\n // Walk the bitmark AST\n this.ast.walk(ast, NodeType.bitmarkAst, this, undefined);\n\n // Ensure a blank line at end of file\n this.writeLine();\n }\n\n //\n // NODE HANDLERS\n //\n\n //\n // Non-Terminal nodes (branches)\n //\n\n // bitmark\n\n // bitmarkAst -> bits -> bitsValue\n\n protected enter_bitsValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n const bit = node.value as Bit;\n\n const bitConfig = Config.getBitConfig(bit.bitType);\n const bitResourcesConfig = Config.getBitResourcesConfig(bit.bitType, bit.resourceType);\n\n // Set state variables\n this.bitType = bit.bitType;\n this.textFormat = bit.textFormat ?? bitConfig.textFormatDefault;\n this.isBodyBitmarkText = this.textFormat === TextFormat.bitmarkText;\n this.isCardAllowed = this.calculateIsCardAllowed();\n\n this.hasCardSet = this.haveValidCardSet(bit);\n this.hasFooter = this.haveValidFooter(bit);\n\n // Separate the bits with 3 newlines\n if (!this.firstBit) {\n this.writeNL();\n this.writeNL();\n this.writeNL();\n }\n\n // Write the bit tag opening\n this.writeOPD(bit.bitLevel);\n\n if (bit.isCommented) this.writeString('|');\n this.writeTagKey(bit.bitType);\n\n if (bit.textFormat) {\n const write = this.isWriteTextFormat(bit.textFormat, bitConfig.textFormatDefault);\n\n if (write) {\n this.writeColon();\n this.writeTagKey(bit.textFormat);\n }\n }\n\n // Use the bitConfig to see if we need to write the resourceType attachment\n let resourceType: ResourceTypeType | undefined;\n if (bitConfig.resourceAttachmentAllowed && bit.resources && bit.resources.length > 0) {\n const comboMap = bitResourcesConfig.comboResourceConfigKeysMap;\n\n if (bitResourcesConfig.comboResourceConfigKeysMap.size > 0) {\n // The resource is a combo resource\n // Extract the resource types from the combo resource\n // NOTE: There should only ever be one combo resource per bit, but the code can handle multiple\n // except for overwriting resourceJson\n for (const comboTagType of comboMap.keys()) {\n resourceType = configKeyToResourceType(comboTagType);\n }\n } else {\n // Get the resourceType from the first resource and write it as the attachment resourceType\n resourceType = bit.resources[0].type;\n }\n }\n\n if (resourceType) {\n this.writeAmpersand();\n this.writeTagKey(resourceType);\n }\n\n this.writeCL();\n // this.writeNL();\n\n // Continue traversal\n return true;\n }\n\n protected exit_bitsValue(_node: NodeInfo, _route: NodeInfo[]): void {\n this.firstBit = false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> internalComment\n\n protected enter_internalComment(node: NodeInfo, route: NodeInfo[]): boolean {\n const internalComment = node.value as BreakscapedString[];\n\n // Ignore values that are not at the bit level as they might be handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n for (let i = 0; i < internalComment.length; i++) {\n const comment = internalComment[i];\n\n this.writeNL();\n this.writeProperty('internalComment', comment, {\n format: TagFormat.plainText,\n array: true,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> labelTrue / labelFalse\n\n protected enter_labelTrue(node: NodeInfo, route: NodeInfo[]): boolean {\n const value = node.value as string | undefined;\n\n // Ignore example that is not at the bit level as it are handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const bit = parent?.value as Bit;\n if (bit) {\n const haveTrue = value != '';\n const haveFalse = bit.labelFalse && bit.labelFalse != '';\n if (haveTrue || haveFalse) {\n this.writeNL();\n }\n if (haveTrue)\n this.writeProperty('labelTrue', value, {\n format: TagFormat.plainText,\n });\n if (haveFalse)\n this.writeProperty('labelFalse', bit.labelFalse, {\n format: TagFormat.plainText,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n protected enter_labelFalse(_node: NodeInfo, _route: NodeInfo[]): boolean {\n // Handled above in enter_labelTrue(), but this function needed to block automatic property handling\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> imageSource\n\n protected enter_imageSource(node: NodeInfo, route: NodeInfo[]): boolean {\n const imageSource = node.value as ImageSourceJson;\n\n // Ignore values that are not at the bit level as they might be handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const { url, mockupId, size, format, trim } = imageSource;\n\n this.writeNL();\n this.writeProperty('imageSource', url, {\n format: TagFormat.plainText,\n });\n if (url) {\n if (mockupId)\n this.writeProperty('mockupId', mockupId, {\n format: TagFormat.plainText,\n });\n if (size)\n this.writeProperty('size', size, {\n format: TagFormat.plainText,\n });\n if (format)\n this.writeProperty('format', format, {\n format: TagFormat.plainText,\n });\n if (BooleanUtils.isBoolean(trim))\n this.writeProperty('trim', trim, {\n format: TagFormat.plainText,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> technicalTerm\n\n protected enter_technicalTerm(node: NodeInfo, route: NodeInfo[]): boolean {\n const nodeValue = node.value as TechnicalTermJson;\n\n // Ignore values that are not at the bit level as they might be handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const { technicalTerm, lang } = nodeValue;\n\n this.writeNL();\n this.writeProperty('technicalTerm', technicalTerm, {\n format: TagFormat.plainText,\n });\n if (lang != null) {\n this.writeProperty('lang', lang, {\n format: TagFormat.plainText,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> servings\n\n protected enter_servings(node: NodeInfo, route: NodeInfo[]): boolean {\n const nodeValue = node.value as ServingsJson;\n\n // Ignore values that are not at the bit level as they might be handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const { servings, unit, unitAbbr, decimalPlaces, disableCalculation, hint } = nodeValue;\n\n this.writeNL();\n this.writeProperty('servings', servings, {\n format: TagFormat.plainText,\n });\n if (unit != null) {\n this.writeProperty('unit', unit, {\n format: TagFormat.plainText,\n });\n }\n if (unitAbbr != null) {\n this.writeProperty('unitAbbr', unitAbbr, {\n format: TagFormat.plainText,\n });\n }\n if (decimalPlaces != null) {\n this.writeProperty('decimalPlaces', decimalPlaces, {\n format: TagFormat.plainText,\n });\n }\n if (disableCalculation != null) {\n this.writeProperty('disableCalculation', disableCalculation, {\n format: TagFormat.plainText,\n });\n }\n if (hint != null) {\n this.writeOPQ();\n this.writeTextOrValue(hint, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> person\n\n protected enter_person(node: NodeInfo, route: NodeInfo[]): boolean {\n const person = node.value as PersonJson;\n\n // Ignore values that are not at the bit level as they might be handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const { name, title, avatarImage } = person;\n\n this.writeNL();\n this.writeProperty('person', name, {\n format: TagFormat.plainText,\n });\n if (title) {\n this.writeProperty('title', title, {\n format: TagFormat.plainText,\n });\n }\n if (avatarImage) {\n this.writeResource(ResourceType.image, avatarImage.image.src);\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions -> definitionsValue -> term -> text\n // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions -> definitionsValue -> definition -> text\n // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions -> definitionsValue -> alternativeDefinitions\n // -> alternativeDefinitionsValue -> text\n // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue -> question -> text\n // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue -> answer -> text\n // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue -> alternativeAnswers ->\n // -> alternativeAnswersValue -> text\n\n protected enter_text(node: NodeInfo, route: NodeInfo[]): boolean {\n const parent = this.getParentNode(route);\n if (\n !parent ||\n (parent.key !== NodeType.term &&\n parent.key !== NodeType.definition &&\n parent.key !== NodeType.alternativeDefinitionsValue &&\n parent.key !== NodeType.question &&\n parent.key !== NodeType.answer &&\n parent.key !== NodeType.alternativeAnswersValue)\n ) {\n return true;\n }\n\n if (node.value) {\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n protected leaf_text(node: NodeInfo, route: NodeInfo[]): boolean {\n const parent = this.getParentNode(route);\n if (\n !parent ||\n (parent.key !== NodeType.term &&\n parent.key !== NodeType.definition &&\n parent.key !== NodeType.alternativeDefinitionsValue &&\n parent.key !== NodeType.question &&\n parent.key !== NodeType.answer &&\n parent.key !== NodeType.alternativeAnswersValue &&\n parent.key !== NodeType.reason)\n ) {\n return true;\n }\n\n if (StringUtils.isString(node.value)) {\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> term -> icon\n // bitmarkAst -> bits -> bitsValue -> * -> definition -> icon\n // bitmarkAst -> bits -> bitsValue -> * -> alternativeDefinitionsValue -> icon\n protected enter_icon(node: NodeInfo, route: NodeInfo[]): boolean {\n const resource = node.value as ImageResourceWrapperJson;\n\n const parent = this.getParentNode(route);\n if (!parent) return true;\n\n if (\n parent.key !== NodeType.term &&\n parent.key !== NodeType.definition &&\n parent.key !== NodeType.alternativeDefinitionsValue &&\n parent.key !== NodeType.question &&\n parent.key !== NodeType.answer &&\n parent.key !== NodeType.alternativeAnswersValue\n ) {\n // Continue traversal of this branch\n return true;\n }\n\n // This is a resource, so handle it with the common code\n this.writeNL();\n this.writeResource(ResourceType.icon, resource.image.src);\n // this.writePropertyStyleResource(ResourceType.icon, resource as ResourceJson);\n\n // Continue traversal of this branch (for the chained properties)\n return true;\n }\n\n protected leaf_iconValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n // Handle as a standard icon property\n this.writeNL();\n this.writeProperty('icon', node.value, {\n format: TagFormat.plainText,\n });\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> ratingLevelStart\n protected enter_ratingLevelStart(node: NodeInfo, route: NodeInfo[]): boolean {\n this.enterRatingLevelStartEndCommon(node, route);\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> ratingLevelEnd\n protected enter_ratingLevelEnd(node: NodeInfo, route: NodeInfo[]): boolean {\n this.enterRatingLevelStartEndCommon(node, route);\n\n // Stop traversal of this branch\n return false;\n }\n\n // Common code for ratingLevelStart and ratingLevelEnd\n protected enterRatingLevelStartEndCommon(node: NodeInfo, route: NodeInfo[]): boolean {\n const n = node.value as RatingLevelStartEndJson;\n\n // Ignore values that are not at the bit level as they might be handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const { level, label } = n;\n const levelKey = node.key === NodeType.ratingLevelStart ? 'ratingLevelStart' : 'ratingLevelEnd';\n\n this.writeNL();\n this.writeProperty(levelKey, level, {\n format: TagFormat.plainText,\n });\n if (label) {\n this.writeProperty('label', label, {\n format: TagFormat.bitmarkText,\n });\n }\n\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> markConfig\n\n protected enter_markConfig(_node: NodeInfo, _route: NodeInfo[]): boolean {\n // Handler so markConfig is not processed by the default property handler\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> markConfig -> markConfigValue\n\n protected enter_markConfigValue(node: NodeInfo, route: NodeInfo[]): boolean {\n const markConfig = node.value as MarkConfigJson;\n\n // Ignore values that are not at the correct level as they might be handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.markConfig) return true;\n\n const { mark, color, emphasis } = markConfig;\n\n if (mark) {\n this.writeNL();\n this.writeProperty('mark', mark, {\n format: TagFormat.plainText,\n });\n if (color) {\n this.writeProperty('color', color, {\n format: TagFormat.plainText,\n });\n }\n if (emphasis) {\n this.writeProperty('emphasis', emphasis, {\n format: TagFormat.plainText,\n });\n }\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> partialAnswer\n\n protected enter_partialAnswer(node: NodeInfo, _route: NodeInfo[]): boolean {\n if (node.value) {\n this.writeNL();\n this.writeProperty('partialAnswer', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> partialAnswer\n\n protected leaf_partialAnswer(node: NodeInfo, _route: NodeInfo[]): boolean {\n if (node.value) {\n this.writeNL();\n this.writeProperty('partialAnswer', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> sampleSolution\n // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> sampleSolution\n\n protected enter_sampleSolution(node: NodeInfo, _route: NodeInfo[]): boolean {\n if (node.value) {\n this.writeNL();\n this.writeProperty('sampleSolution', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n protected leaf_sampleSolution(node: NodeInfo, _route: NodeInfo[]): boolean {\n if (node.value) {\n this.writeNL();\n this.writeProperty('sampleSolution', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> reasonableNumOfChars\n // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> reasonableNumOfChars\n\n protected leaf_reasonableNumOfChars(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeNL();\n this.writeProperty('reasonableNumOfChars', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> additionalSolutions -> additionalSolutionsValue\n\n protected leaf_additionalSolutionsValue(node: NodeInfo, route: NodeInfo[]): void {\n // Ignore values that are not at the bit level as they might be handled elsewhere\n const parent = this.getParentNode(route, 2);\n if (parent?.key !== NodeType.questionsValue) return;\n\n this.writeNL();\n this.writeProperty('additionalSolutions', node.value, {\n format: TagFormat.plainText,\n array: true,\n writeEmpty: true,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> item\n\n protected enter_item(node: NodeInfo, route: NodeInfo[]): boolean {\n const item = node.value as TextAst;\n const parent = this.getParentNode(route);\n if (this.isEmptyText(item)) return false; // Ignore empty\n if (!this.isEmptyText(parent?.value?.lead)) return true; // Will be handled by lead\n if (!this.isEmptyText(parent?.value?.pageNumber)) return true; // Will be handled by pageNumber\n if (!this.isEmptyText(parent?.value?.marginNumber)) return true; // Will be handled by marginNumber\n\n this.writeNL_IfNotChain(route);\n this.writeOPC();\n this.writeTextOrValue(item, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> lead\n\n protected enter_lead(node: NodeInfo, route: NodeInfo[]): boolean {\n const lead = node.value as TextAst;\n const parent = this.getParentNode(route);\n if (this.isEmptyText(lead)) return false; // Ignore empty\n if (!this.isEmptyText(parent?.value?.pageNumber)) return true; // Will be handled by pageNumber\n if (!this.isEmptyText(parent?.value?.marginNumber)) return true; // Will be handled by marginNumber\n\n this.writeNL_IfNotChain(route);\n this.writeOPC();\n this.writeTextOrValue(parent?.value?.item ?? '', TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n this.writeOPC();\n this.writeTextOrValue(lead, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> pageNumber\n\n protected enter_pageNumber(node: NodeInfo, route: NodeInfo[]): boolean {\n const pageNumber = node.value as TextAst;\n const parent = this.getParentNode(route);\n if (this.isEmptyText(pageNumber)) return false; // Ignore empty\n if (!this.isEmptyText(parent?.value?.marginNumber)) return true; // Will be handled by marginNumber\n\n this.writeNL_IfNotChain(route);\n this.writeOPC();\n this.writeTextOrValue(parent?.value?.item ?? '', TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n this.writeOPC();\n this.writeTextOrValue(parent?.value?.lead ?? '', TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n this.writeOPC();\n this.writeTextOrValue(pageNumber ?? '', TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> marginNumber\n\n protected enter_marginNumber(node: NodeInfo, route: NodeInfo[]): boolean {\n const marginNumber = node.value as TextAst;\n const parent = this.getParentNode(route);\n if (this.isEmptyText(marginNumber)) return false; // Ignore empty\n\n this.writeNL_IfNotChain(route);\n this.writeOPC();\n this.writeTextOrValue(parent?.value?.item ?? '', TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n this.writeOPC();\n this.writeTextOrValue(parent?.value?.lead ?? '', TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n this.writeOPC();\n this.writeTextOrValue(\n parent?.value?.pageNumber ?? '',\n TextFormat.bitmarkText,\n TextLocation.tag,\n );\n this.writeCL();\n this.writeOPC();\n this.writeTextOrValue(marginNumber, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> body\n\n protected enter_body(node: NodeInfo, route: NodeInfo[]): boolean {\n // Ignore values that are not at the bit level as they might be handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue && parent?.key !== NodeType.cardBitsValue) return true;\n\n this.inTag = false;\n\n // Always write a NL before the body content if there is any (see Handle body)\n const body = node.value as Body;\n\n // Handle body\n if (this.textFormat === TextFormat.json) {\n const json = body.body ?? null;\n if (Array.isArray(json) || ObjectUtils.isObject(json)) {\n const text = JSON.stringify(json, null, this.prettifySpace);\n if (text) {\n this.writePlainTextDivider();\n this.writeNL();\n this.writeTextOrValue(text, TextFormat.plainText, TextLocation.body);\n }\n }\n } else if (this.isBodyBitmarkText) {\n // handle bitmark text\n const plainTextDividerAllowed = !(this.hasCardSet || this.hasFooter);\n this.writeNL();\n // The text generator will write to the writer\n const b = (Array.isArray(body.body) ? body.body : []) as TextAst;\n this.writeTextOrValue(b, this.textFormat, TextLocation.body, {\n plainTextDividerAllowed,\n });\n } else {\n // handle plain text\n this.writePlainTextDivider();\n this.writeNL();\n const s = (StringUtils.isString(body.body) ? body.body : '') as string;\n this.writeTextOrValue(`${s}`, TextFormat.plainText, TextLocation.body);\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n protected exit_body(_node: NodeInfo, _route: NodeInfo[]): void {\n this.inTag = true;\n }\n\n protected bodyBitCallback(bodyBit: BodyBitJson, _index: number, _route: NodeInfo[]): string {\n // console.log('bodyBitCallback', bodyBit, index, route);\n\n // Walk the body bit AST\n const nodeType = NodeType.fromValue(bodyBit.type) ?? NodeType.bodyBit;\n this.ast.walk(bodyBit, nodeType, this, undefined);\n\n return ''; // Return empty string as we are writing to the writer\n }\n\n // bodyBit -> gap\n\n protected enter_gap(node: NodeInfo, _route: NodeInfo[]): boolean {\n const gap = node.value as GapJson;\n\n if (gap.solutions && gap.solutions.length === 0) {\n // If there are no solutions, we need to write the special cloze gap [_] to indicate this\n this.writeOPU();\n this.writeCL();\n } else {\n for (const solution of gap.solutions) {\n this.writeOPU();\n this.writeTextOrValue(solution, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n\n // Continue traversal\n return true;\n }\n\n // bodyBit -> mark\n\n protected enter_mark(node: NodeInfo, _route: NodeInfo[]): boolean {\n const mark = node.value as MarkJson;\n\n this.writeOPE();\n this.writeTextOrValue(mark.solution, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n\n // Continue traversal\n return true;\n }\n\n // bodyBit -> select\n\n protected enter_select(_node: NodeInfo, _route: NodeInfo[]): boolean {\n // Continue traversal\n return true;\n }\n\n // bodyBit -> highlight\n\n protected enter_highlight(_node: NodeInfo, _route: NodeInfo[]): boolean {\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> footer\n\n protected enter_footer(node: NodeInfo, route: NodeInfo[]): boolean {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const footer = node.value as Footer;\n\n // Handle footer\n if (this.textFormat === TextFormat.json) {\n // Json footer?!\n // Not valid, ignore\n } else if (footer.footer && footer.footer.length > 0) {\n if (this.isBodyBitmarkText) {\n // handle bitmark text\n this.writeNL();\n this.writeTextOrValue('==== footer ====', TextFormat.plainText, TextLocation.body);\n this.writeNL();\n // The text generator will write to the writer\n this.writeTextOrValue(footer.footer, this.textFormat, TextLocation.body, {\n plainTextDividerAllowed: true, // Always allowed for the footer.\n });\n } else {\n // Plain text footer?!\n // Not valid, ignore (plain text cannot have a card set / footer marker, so cannot have a footer!\n }\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> body -> bodyParts -> bodyPartsValue -> data -> solutions\n\n protected enter_solutions(node: NodeInfo, route: NodeInfo[]): boolean {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const solutions = node.value as string[];\n if (solutions && solutions.length === 0) {\n // If there are no solutions, we need to write the special cloze gap [_] to indicate this\n this.writeOPU();\n this.writeCL();\n }\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> body -> bodyParts -> bodyPartsValue -> data -> solution\n\n protected leaf_solution(node: NodeInfo, route: NodeInfo[]): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return;\n\n const solution = node.value as string;\n\n // Ignore values that are not at the correct level as they might be handled elsewhere\n const bodyPartsValue: BodyPart | undefined = this.getParentNode(route, 2)?.value;\n if (bodyPartsValue?.type !== BodyBitType.mark) return;\n\n if (solution) {\n this.writeOPE();\n this.writeTextOrValue(solution, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> body -> bodyBit -> mark -> mark\n\n protected leaf_mark(node: NodeInfo, route: NodeInfo[]): void {\n const root = route[0];\n if (root?.key !== NodeType.mark) return;\n\n const mark = node.value as string;\n\n if (mark) {\n this.writeProperty('mark', mark, {\n format: TagFormat.plainText,\n });\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> body -> bodyParts -> bodyPartsValue -> data -> options -> optionsValue\n\n protected enter_optionsValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n const selectOption = node.value as SelectOptionJson;\n if (selectOption.isCorrect) {\n this.writeOPP();\n } else {\n this.writeOPM();\n }\n this.writeTextOrValue(selectOption.text, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> body -> bodyParts -> bodyPartsValue -> data -> texts -> textsValue\n\n protected enter_textsValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n const highlightText = node.value as HighlightTextJson;\n if (highlightText.isCorrect) {\n this.writeOPP();\n } else {\n this.writeOPM();\n }\n this.writeTextOrValue(highlightText.text, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode\n\n protected enter_cardNode(_node: NodeInfo, _route: NodeInfo[]): boolean {\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return true;\n\n this.writeCardSetStart();\n\n // Continue traversal\n return true;\n }\n\n protected between_cardNode(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetCardDivider();\n }\n\n protected exit_cardNode(_node: NodeInfo, _route: NodeInfo[]): void {\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetEnd();\n if (this.options.cardSetVersion === CardSetVersion.v1) {\n // this.writeNL();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> elements\n\n protected enter_elements(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_elements(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetVariantDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards\n\n protected between_flashcards(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue\n\n protected between_flashcardsValue(\n _node: NodeInfo,\n _left: NodeInfo,\n right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n if (right.key === NodeType.answer) {\n this.writeCardSetSideDivider();\n } else if (right.key === NodeType.alternativeAnswers && right.value?.length !== 0) {\n this.writeCardSetVariantDivider();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue -> alternativeAnswers\n\n protected between_alternativeAnswers(_node: NodeInfo, _route: NodeInfo[]): void {\n this.writeCardSetVariantDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions -> definitionsValue -> alternativeDefintions\n\n protected between_alternativeDefinitions(_node: NodeInfo, _route: NodeInfo[]): void {\n this.writeCardSetVariantDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> statements\n\n protected enter_statements(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_statements(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n const isTrueFalse1 = this.isOfBitType(BitType.trueFalse1);\n\n if (!isTrueFalse1) {\n this.writeCardSetCardDivider();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> statements -> statementsValue\n\n protected enter_statementsValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n const statement = node.value as StatementJson;\n\n this.writeNL();\n if (statement.isCorrect) {\n this.writeOPP();\n } else {\n this.writeOPM();\n }\n this.writeTextOrValue(statement.statement, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> choices -> choicesValue\n // bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes -> quizzesValue -> choices -> choicesValue\n // bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks -> feedbacksValue -> choices -> choicesValue\n\n protected enter_choicesValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n const choice = node.value as ChoiceJson & FeedbackChoiceJson;\n\n this.writeNL();\n if (choice.isCorrect || choice.requireReason) {\n this.writeOPP();\n } else {\n this.writeOPM();\n }\n this.writeTextOrValue(choice.choice, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> responses -> responsesValue\n // bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes -> quizzesValue -> responses -> responsesValue\n\n protected enter_responsesValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n const response = node.value as ResponseJson;\n\n this.writeNL();\n if (response.isCorrect) {\n this.writeOPP();\n } else {\n this.writeOPM();\n }\n this.writeTextOrValue(response.response, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks\n\n protected between_feedbacks(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks -> feedbacksValue -> reason\n\n protected enter_reason(_node: NodeInfo, _route: NodeInfo[]): boolean {\n this.writeCardSetSideDivider();\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes\n\n protected enter_quizzes(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_quizzes(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> heading\n\n protected enter_heading(_node: NodeInfo, _route: NodeInfo[]): boolean | void {\n //\n }\n\n protected between_heading(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetSideDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> heading -> forValues\n\n protected enter_forValues(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_forValues(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetSideDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs\n\n protected enter_pairs(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_pairs(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs -> pairsValue -> keyAudio\n\n protected enter_keyAudio(node: NodeInfo, _route: NodeInfo[]): boolean {\n const resource = node.value as AudioResourceWrapperJson;\n\n // This is a resource, so handle it with the common code\n this.writeNL();\n this.writeResource(ResourceType.audio, resource.audio.src);\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs -> pairsValue -> keyImage\n\n protected enter_keyImage(node: NodeInfo, _route: NodeInfo[]): boolean {\n const resource = node.value as ImageResourceWrapperJson;\n\n // This is a resource, so handle it with the common code\n this.writeNL();\n this.writeResource(ResourceType.image, resource.image.src);\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> matrix\n\n protected enter_matrix(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_matrix(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs -> pairsValue -> values\n // bitmarkAst -> bits -> bitsValue -> cardNode -> matrix -> matrixValue -> cells -> cellsValue -> values\n\n protected enter_values(_node: NodeInfo, _route: NodeInfo[]): void {\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetSideDivider();\n }\n\n protected between_values(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetVariantDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable\n\n protected between_pronunciationTable(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n route: NodeInfo[],\n ): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.cardNode) return;\n\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> table\n\n protected between_table(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n route: NodeInfo[],\n ): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.cardNode) return;\n\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> data\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable -> data\n\n protected between_data(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n route: NodeInfo[],\n ): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.table && parent?.key !== NodeType.pronunciationTable) return;\n\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> columns\n // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList -> columns\n\n protected between_columns(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n route: NodeInfo[],\n ): void {\n const parent = this.getParentNode(route);\n const parentKey = parent?.key;\n if (parentKey !== NodeType.table && parentKey !== NodeType.captionDefinitionList) return;\n\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetSideDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> columns -> columnsValue\n // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList -> columns -> columnsValue\n\n protected leaf_columnsValue(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeNL();\n this.writeOPHASH();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n\n protected enter_columnsValue(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeNL();\n this.writeOPHASH();\n this.writeTextOrValue(node.value, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> data -> dataValue\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable -> data -> dataValue\n\n protected between_dataValue(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n route: NodeInfo[],\n ): void {\n const parent = this.getParentNode(route, 2);\n if (parent?.key !== NodeType.table && parent?.key !== NodeType.pronunciationTable) return;\n\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n this.writeCardSetSideDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> data -> dataValue -> dataValueValue\n\n protected leaf_dataValueValue(node: NodeInfo, route: NodeInfo[]): void {\n const parent = this.getParentNode(route, 3);\n if (parent?.key !== NodeType.table) return;\n\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> data -> dataValue -> dataValueValue\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable -> data -> dataValue -> dataValueValue\n\n protected enter_dataValueValue(node: NodeInfo, route: NodeInfo[]): void | boolean {\n const parent = this.getParentNode(route, 3);\n if (parent?.key !== NodeType.table && parent?.key !== NodeType.pronunciationTable) return;\n\n if (node.value) {\n if (parent?.key === NodeType.pronunciationTable) {\n // Pronunciation Table\n const cell = node.value as PronunciationTableCellJson;\n if (cell.title) {\n this.writeNL();\n this.writeOP();\n this.writeHash();\n this.writeTextOrValue(cell.title, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n }\n if (cell.audio) {\n this.writeNL();\n this.writeResource(ResourceType.audio, cell.audio.audio.src);\n }\n if (cell.body) {\n this.writeNL();\n this.writeTextOrValue(cell.body, this.textFormat, TextLocation.body);\n }\n\n // Stop traversal of this branch\n return false;\n } else {\n // Table\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList\n\n protected between_captionDefinitionList(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n route: NodeInfo[],\n ): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.cardNode) return;\n\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList -> definitions -> definitionsValue -> term\n\n protected leaf_term(node: NodeInfo, route: NodeInfo[]): boolean {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.definitionsValue) return true;\n\n if (node.value) {\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList -> definitions -> definitionsValue -> definition\n\n protected leaf_definition(node: NodeInfo, route: NodeInfo[]): boolean {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.definitionsValue) return true;\n\n if (node.value) {\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList -> definitions\n // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions\n\n protected between_definitions(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n route: NodeInfo[],\n ): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.cardNode && parent?.key !== NodeType.captionDefinitionList) return;\n\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions -> definitionsValue\n\n protected between_definitionsValue(\n _node: NodeInfo,\n _left: NodeInfo,\n right: NodeInfo,\n route: NodeInfo[],\n ): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.definitions) return;\n\n // Ignore cards if not allowed\n if (!this.isCardAllowed) return;\n\n if (right.key === NodeType.definition) {\n this.writeCardSetSideDivider();\n } else if (right.key === NodeType.alternativeDefinitions && right.value?.length > 0) {\n this.writeCardSetVariantDivider();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> questions\n\n protected enter_questions(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_questions(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> ingredients\n\n protected enter_ingredients(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_ingredients(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> ingredients -> ingredientsValue\n\n protected enter_ingredientsValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n const ingredient = node.value as IngredientJson;\n\n if (ingredient.title != null) {\n this.writeNL();\n this.writeOPHASH();\n this.writeTextOrValue(ingredient.title, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n // this.writeNL();\n }\n\n if (ingredient.ingredient != null) {\n this.writeNL();\n\n // [+] / [-]\n if (ingredient.checked) {\n this.writeOPP();\n } else {\n this.writeOPM();\n }\n this.writeCL();\n\n // [!43]\n if (ingredient.quantity != null) {\n this.writeOPB();\n this.writeTextOrValue(`${ingredient.quantity}`, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n\n // [@unit:kilograms]\n if (ingredient.unit != null)\n this.writeProperty('unit', ingredient.unit, {\n format: TagFormat.plainText,\n });\n\n // [@unitAbbr:kg]\n if (ingredient.unitAbbr != null)\n this.writeProperty('unitAbbr', ingredient.unitAbbr, {\n format: TagFormat.plainText,\n });\n\n // [@decimalPlaces:1]\n if (ingredient.decimalPlaces != null)\n this.writeProperty('decimalPlaces', ingredient.decimalPlaces, {\n format: TagFormat.plainText,\n });\n\n // [@disableCalculation]\n if (ingredient.disableCalculation)\n this.writeProperty('disableCalculation', true, {\n format: TagFormat.plainText,\n });\n\n // item\n\n this.writeNL();\n this.writeTextOrValue(ingredient.ingredient, this.textFormat, TextLocation.body);\n }\n\n // Continue traversal of this branch (item, lead, etc)\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> botResponses\n\n protected enter_botResponses(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_botResponses(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> cardBits\n\n protected enter_cardBits(_node: NodeInfo, _route: NodeInfo[]): void {\n //\n }\n\n protected between_cardBits(\n _node: NodeInfo,\n _left: NodeInfo,\n _right: NodeInfo,\n _route: NodeInfo[],\n ): void {\n this.writeCardSetCardDivider();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> botResponses -> botResponsesValue -> response\n\n protected leaf_response(node: NodeInfo, route: NodeInfo[]): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.botResponsesValue) return;\n\n this.writeNL();\n this.writeOPB();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> botResponses -> botResponsesValue -> reaction\n\n protected leaf_reaction(node: NodeInfo, route: NodeInfo[]): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.botResponsesValue) return;\n\n this.writeNL();\n this.writeProperty('reaction', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> botResponses -> botResponsesValue -> feedback\n\n protected leaf_feedback(node: NodeInfo, route: NodeInfo[]): void {\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.botResponsesValue) return;\n\n const feedback = node.value as string;\n if (feedback) {\n this.writeNL();\n this.writeTextOrValue(feedback, this.textFormat, TextLocation.body);\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> backgroundWallpaper\n protected enter_backgroundWallpaper(node: NodeInfo, _route: NodeInfo[]): boolean {\n const resource = node.value as ResourceJson;\n\n // This is a resource, so handle it with the common code\n this.writeNL();\n this.writePropertyStyleResource(node.key, resource);\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> imagePlaceholder\n protected enter_imagePlaceholder(node: NodeInfo, _route: NodeInfo[]): boolean {\n const resource = node.value as ResourceJson;\n\n // This is a resource, so handle it with the common code\n this.writeNL();\n this.writePropertyStyleResource(node.key, resource);\n\n // Continue traversal\n return true;\n }\n\n protected exit_imagePlaceholder(_node: NodeInfo, _route: NodeInfo[]): void {\n // this.writeNL();\n }\n\n // bitmarkAst -> bits -> bitsValue -> posterImage\n // bitmarkAst -> bits -> bitsValue -> resource -> * -> posterImage\n\n protected enter_posterImage(node: NodeInfo, route: NodeInfo[]): boolean {\n const parent = this.getParentNode(route);\n if (parent?.key === NodeType.bitsValue) {\n // Bit poster image\n const posterImage = node.value as string;\n if (posterImage) {\n this.writeProperty('posterImage', posterImage, {\n format: TagFormat.plainText,\n });\n }\n } else {\n // Resource poster image\n const posterImage = node.value as ImageResourceJson;\n if (posterImage && posterImage.src) {\n this.writeProperty('posterImage', posterImage.src, {\n format: TagFormat.plainText,\n });\n }\n }\n\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> resource -> thumbnails\n // [src1x,src2x,src3x,src4x,width,height,alt,zoomDisabled,caption]\n\n protected enter_thumbnails(node: NodeInfo, _route: NodeInfo[]): boolean {\n const thumbnails = node.value as ImageResourceJson[];\n\n if (Array.isArray(thumbnails)) {\n const thumbnailKeys = ['src1x', 'src2x', 'src3x', 'src4x'];\n\n for (let i = 0; i < thumbnails.length; i++) {\n // Can only handle 4 thumbnails\n if (i === thumbnailKeys.length) break;\n const thumbnail = thumbnails[i];\n const key = thumbnailKeys[i];\n this.writeProperty(key, thumbnail.src, {\n format: TagFormat.plainText,\n });\n }\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> bitType\n\n // bitmarkAst -> bits -> bitsValue -> textFormat\n\n // bitmarkAst -> bits -> level\n\n protected leaf_level(node: NodeInfo, route: NodeInfo[]): boolean {\n // Ensure this is at the bit level\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n // Ensure this is a chapter bit\n if (!Config.isOfBitType(this.bitType, [BitType.chapter])) return true;\n\n const level = node.value as number;\n const bit = parent?.value as Bit;\n\n if (level > 0 && bit.title == null) {\n // If the level is set, but there is no title, this is a [.chapter] bit with an empty title.\n // We need to write an empty title tag at the correct level.\n this.writeNL();\n this.writeOP();\n for (let i = 0; i < +level; i++) this.writeHash();\n this.writeCL();\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> title\n\n protected enter_title(node: NodeInfo, route: NodeInfo[]): boolean {\n // Ensure this is at the bit level\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const value = node.value as TextAst;\n const title = value;\n const bit = parent?.value as Bit;\n const level = bit.level || 1;\n\n if (level && title) {\n this.writeNL();\n this.writeOP();\n for (let i = 0; i < +level; i++) this.writeHash();\n this.writeTextOrValue(title, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> subtitle\n\n protected enter_subtitle(node: NodeInfo, route: NodeInfo[]): boolean {\n // Ensure this is at the bit level\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const value = node.value as TextAst;\n const subtitle = value;\n const level = 2;\n if (level && subtitle) {\n this.writeNL();\n this.writeOP();\n for (let i = 0; i < level; i++) this.writeHash();\n this.writeTextOrValue(subtitle, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> book (array)\n // bitmarkAst -> bits -> bitsValue -> book (array) -> bookValue\n\n protected enter_book(_node: NodeInfo, _route: NodeInfo[]): void {\n // Block standard property handling\n }\n\n protected enter_bookValue(node: NodeInfo, _route: NodeInfo[]): boolean {\n const book = node.value as BookJson;\n // const parent = this.getParentNode(route);\n // const bit = parent?.value as Bit;\n\n if (book) {\n this.writeNL();\n this.writeProperty('book', book.book, {\n format: TagFormat.plainText,\n writeEmpty: true,\n });\n if (book.reference) {\n this.writeOPRANGLE();\n this.writeTextOrValue(book.reference, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n\n if (book.referenceEnd) {\n this.writeOPRANGLE();\n this.writeTextOrValue(book.referenceEnd, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> book (single)\n\n protected leaf_book(node: NodeInfo, route: NodeInfo[]): void {\n const parent = this.getParentNode(route);\n const bit = parent?.value as Bit;\n\n if (bit && node.value) {\n this.writeNL();\n this.writeProperty('book', node.value, {\n format: TagFormat.plainText,\n writeEmpty: true,\n });\n if (bit.reference) {\n this.writeOPRANGLE();\n this.writeTextOrValue(bit.reference, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n\n if (bit.referenceEnd) {\n this.writeOPRANGLE();\n this.writeTextOrValue(bit.referenceEnd, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> anchor\n\n protected leaf_anchor(node: NodeInfo, _route: NodeInfo[]): void {\n if (node.value) {\n this.writeNL();\n this.writeOPDANGLE();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> reference\n\n protected leaf_reference(node: NodeInfo, route: NodeInfo[]): void {\n const parent = this.getParentNode(route);\n const bit = parent?.value as Bit;\n\n if (bit && node.value) {\n // Only write reference if it is not chained to 'book'\n if (!bit.book) {\n this.writeNL();\n this.writeOPRANGLE();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n }\n\n // * -> itemLead --> item\n\n // * -> itemLead --> lead\n\n // * -> hint\n\n protected enter_hint(node: NodeInfo, route: NodeInfo[]): boolean {\n const value = node.value as TextAst;\n const text = value;\n if (!this.isEmptyText(text)) {\n this.writeNL_IfNotChain(route);\n this.writeOPQ();\n this.writeTextOrValue(text, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> instruction\n\n protected enter_instruction(node: NodeInfo, route: NodeInfo[]): boolean {\n const value = node.value as TextAst;\n const text = value;\n if (!this.isEmptyText(text)) {\n this.writeNL_IfNotChain(route);\n this.writeOPB();\n this.writeTextOrValue(text, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> lang\n\n protected leaf_lang(node: NodeInfo, _route: NodeInfo[]): void {\n if (!node.value) return;\n\n this.writeNL();\n this.writeProperty('lang', node.value, {\n format: TagFormat.boolean,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> refAuthor\n\n protected enter_refAuthor(node: NodeInfo, _route: NodeInfo[]): void {\n if (!node.value) return;\n\n this.writeNL();\n this.writeProperty('refAuthor', node.value, {\n format: TagFormat.plainText,\n array: true,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> refBookTitle\n\n protected leaf_refBookTitle(node: NodeInfo, _route: NodeInfo[]): void {\n if (!node.value) return;\n\n this.writeNL();\n this.writeProperty('refBookTitle', node.value, {\n format: TagFormat.plainText,\n array: true,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> refPublisher\n\n protected enter_refPublisher(node: NodeInfo, _route: NodeInfo[]): void {\n if (!node.value) return;\n\n this.writeNL();\n this.writeProperty('refPublisher', node.value, {\n format: TagFormat.plainText,\n array: true,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> refPublicationYear\n\n protected leaf_refPublicationYear(node: NodeInfo, _route: NodeInfo[]): void {\n if (!node.value) return;\n\n this.writeNL();\n this.writeProperty('refPublicationYear', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> citationStyle\n\n protected leaf_citationStyle(node: NodeInfo, _route: NodeInfo[]): void {\n if (!node.value) return;\n\n this.writeNL();\n this.writeProperty('citationStyle', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> isExample / example\n\n protected leaf_isExample(node: NodeInfo, route: NodeInfo[]): void {\n const isExample = node.value as boolean | undefined;\n if (!isExample) return;\n\n const parent = this.getParentNode(route);\n const example = parent?.value.example ?? null;\n // const __isDefaultExample = parent?.value.__isDefaultExample ?? false;\n\n if (example != null && example !== '') {\n // Write a newline if not in a chain\n this.writeNL_IfNotChain(route);\n\n this.writeOPA();\n this.writeString('example');\n this.writeColon();\n\n if (example === true) {\n this.writeString(' true ');\n } else if (example === false) {\n this.writeString(' false ');\n } else if (Array.isArray(example)) {\n // TextAst\n this.writeTextOrValue(example, TextFormat.bitmarkText, TextLocation.tag);\n } else {\n // String\n this.writeTextOrValue(example, TextFormat.plainText, TextLocation.tag);\n }\n this.writeCL();\n } else {\n // Don't write example if it is null.\n // this.writeOPA();\n // this.writeString('example');\n // this.writeCL();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> elements -> elementsValue\n\n protected leaf_elementsValue(node: NodeInfo, _route: NodeInfo[]): void {\n if (node.value) {\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> body -> bodyValue -> gap -> solutions -> solution\n // ? -> solutions -> solution\n\n protected leaf_solutionsValue(node: NodeInfo, route: NodeInfo[]): void {\n const parent = this.getParentNode(route, 2);\n if (parent?.key !== NodeType.bitsValue) return;\n\n if (node.value != null) {\n this.writeOPU();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue-> body -> bodyValue -> select -> options -> prefix\n // bitmarkAst -> bits -> bitsValue-> body -> bodyValue -> highlight -> options -> prefix\n\n protected leaf_prefix(node: NodeInfo, _route: NodeInfo[]): void {\n if (node.value) {\n this.writeOPPRE();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue-> body -> bodyValue -> select -> options -> postfix\n // bitmarkAst -> bits -> bitsValue-> body -> bodyValue -> highlight -> options -> postfix\n\n protected leaf_postfix(node: NodeInfo, _route: NodeInfo[]): void {\n if (node.value) {\n this.writeOPPOST();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> isCaseSensitive\n\n protected leaf_isCaseSensitive(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('isCaseSensitive', node.value, {\n format: TagFormat.boolean,\n writeEmpty: true,\n ignoreFalse: false,\n ignoreTrue: true,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> isCorrect\n\n // bitmarkAst -> bits -> bitsValue -> heading -> forKeys\n\n protected leaf_forKeys(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeNL();\n this.writeOPHASH();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n\n // bitmarkAst -> bits -> bitsValue -> heading -> forValues\n\n protected leaf_forValues(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeNL();\n this.writeOPHASH();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n\n // bitmarkAst -> bits -> bitsValue -> heading -> forValuesValue\n\n protected leaf_forValuesValue(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeNL();\n this.writeOPHASH();\n this.writeTextOrValue(node.value, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n }\n\n // bitmarkAst -> bits -> bitsValue -> pairs -> pairsValue -> key\n // bitmarkAst -> bits -> bitsValue -> matrix -> matrixValue -> key\n\n protected leaf_key(node: NodeInfo, _route: NodeInfo[]): void {\n if (node.value) {\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> pairs -> pairsValue -> values -> valuesValue\n // bitmarkAst -> bits -> bitsValue -> matrix -> matrixValue -> cells -> cellsValue -> values -> valuesValue\n\n protected leaf_valuesValue(node: NodeInfo, _route: NodeInfo[]): void {\n if (node.value) {\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> question\n // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue -> question\n\n protected leaf_question(node: NodeInfo, route: NodeInfo[]): void {\n // Ignore responses that are not at the questionsValue level as they are handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.questionsValue && parent?.key !== NodeType.flashcardsValue) return;\n\n if (node.value) {\n this.writeNL();\n this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> statements -> text\n\n // bitmarkAst -> bits -> bitsValue -> resource -> ...\n // bitmarkAst -> bits -> bitsValue -> resource -> posterImage -> ...\n // bitmarkAst -> bits -> bitsValue -> resource -> thumbnails -> thumbnailsValue -> ...\n // [src1x,src2x,src3x,src4x,width,height,alt,zoomDisabled,caption]\n\n protected leaf_src1x(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('src1x', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_src2x(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('src2x', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_src3x(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('src3x', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_src4x(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('src4x', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_width(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('width', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_height(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('height', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_alt(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('alt', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_zoomDisabled(node: NodeInfo, _route: NodeInfo[]): void {\n if (\n Config.isOfBitType(this.bitType, [\n BitType.imageSeparator,\n BitType.pageBanner,\n BitType.imagesLogoGrave,\n BitType.prototypeImages,\n ])\n ) {\n this.writeProperty('zoomDisabled', node.value, {\n format: TagFormat.boolean,\n writeEmpty: true,\n ignoreFalse: false,\n ignoreTrue: true,\n });\n } else {\n this.writeProperty('zoomDisabled', node.value, {\n format: TagFormat.boolean,\n writeEmpty: true,\n ignoreFalse: true,\n ignoreTrue: false,\n });\n }\n }\n\n protected leaf_license(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('license', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_copyright(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('copyright', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_provider(_node: NodeInfo, _route: NodeInfo[]): void {\n // provider is included in the url (it is the domain) and should not be written as a property\n // this.writeProperty('provider', node.value);\n }\n\n protected leaf_showInIndex(node: NodeInfo, route: NodeInfo[]): void {\n if (node.value == null) return;\n\n this.writeNL_IfNotChain(route);\n this.writeProperty('showInIndex', node.value, {\n format: TagFormat.boolean,\n ignoreFalse: true,\n });\n }\n\n protected enter_caption(node: NodeInfo, route: NodeInfo[]): boolean {\n const value = node.value as string;\n\n this.writeNL_IfNotChain(route);\n this.writeProperty('caption', value, {\n format: TagFormat.bitmarkText,\n });\n\n // Stop traversal of this branch\n return false;\n }\n\n protected leaf_search(node: NodeInfo, route: NodeInfo[]): void {\n const value = node.value as string;\n\n if (!value) return;\n\n this.writeNL_IfNotChain(route);\n this.writeProperty('search', value, {\n format: TagFormat.plainText,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> resource -> ...\n // bitmarkAst -> bits -> bitsValue -> resource -> posterImage -> ...\n // bitmarkAst -> bits -> bitsValue -> resource -> thumbnails -> thumbnailsValue -> ...\n // [duration,mute,autoplay,allowSubtitles,showSubtitles]\n\n protected leaf_duration(node: NodeInfo, route: NodeInfo[]): void {\n // If duration is at the bit level write a NL before the property, otherwise it is part of a chain\n const parent = this.getParentNode(route);\n if (parent?.key === NodeType.bitsValue) {\n this.writeNL();\n }\n\n this.writeProperty('duration', node.value, {\n format: TagFormat.plainText,\n });\n }\n\n protected leaf_mute(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('mute', node.value, {\n format: TagFormat.boolean,\n });\n }\n\n protected leaf_autoplay(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('autoplay', node.value, {\n format: TagFormat.boolean,\n });\n }\n\n protected leaf_allowSubtitles(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('allowSubtitles', node.value, {\n format: TagFormat.boolean,\n });\n }\n\n protected leaf_showSubtitles(node: NodeInfo, _route: NodeInfo[]): void {\n this.writeProperty('showSubtitles', node.value, {\n format: TagFormat.boolean,\n });\n }\n\n //\n // Resources\n //\n\n //\n // Generated Node Handlers\n //\n\n /**\n * Generate the handlers for resources, as they are mostly the same, but not quite\n */\n\n protected generateResourceHandlers() {\n for (const tag of ResourceType.keys()) {\n // skip unknown\n if (tag === ResourceType.keyFromValue(ResourceType.unknown)) continue;\n\n const enterFuncName = `enter_${tag}`;\n\n // Skip if the function already exists, allows for custom handlers\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof (this as any)[enterFuncName] === 'function') {\n continue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any)[enterFuncName] = (node: NodeInfo, route: NodeInfo[]): boolean => {\n const resource = node.value as ResourceDataJson | undefined;\n if (resource == null) return false;\n\n // Ignore any property that is not at the bit level as that will be handled by a different handler\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.resourcesValue) return true;\n\n // Get the resource alias\n const alias = ResourceType.fromValue(parent.value.__typeAlias);\n const type = alias ?? ResourceType.fromValue(parent.value.type);\n if (!type) return false;\n\n // url / src / href / app\n const url = resource.url || resource.src || resource.body || '';\n\n // Write the resource\n this.writeNL();\n this.writeResource(type, url);\n\n // Continue traversal\n return true;\n };\n\n // Bind this\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any)[enterFuncName] = (this as any)[enterFuncName].bind(this);\n }\n\n // for (const tag of ResourceTag.keys()) {\n // // skip unknown\n // if (tag === ResourceTag.keyFromValue(ResourceTag.unknown)) continue;\n\n // const enterFuncName = `enter_${tag}`;\n\n // // Skip if the function already exists, allows for custom handlers\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // if (typeof (this as any)[enterFuncName] === 'function') {\n // continue;\n // }\n\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // (this as any)[enterFuncName] = (node: NodeInfo, route: NodeInfo[]): boolean => {\n // const resource = node.value as ResourceDataJson | undefined;\n // if (resource == null) return false;\n\n // // Ignore any property that is not at the bit level as that will be handled by a different handler\n // const parent = this.getParentNode(route);\n // if (parent?.key !== NodeType.resourcesValue) return true;\n\n // // Get the resource alias\n // const alias = ResourceTag.fromValue(parent.value.__typeAlias);\n // const type = alias ?? ResourceTag.fromValue(parent.value.type);\n // if (!type) return false;\n\n // // url / src / href / app\n // const url = resource.url || resource.src || resource.body || '';\n\n // // Write the resource\n // this.writeNL();\n // this.writeResource(type, url);\n\n // // Continue traversal\n // return true;\n // };\n\n // // Bind this\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // (this as any)[enterFuncName] = (this as any)[enterFuncName].bind(this);\n // }\n }\n\n /**\n * Generate the handlers for properties, as they are mostly the same, but not quite\n */\n\n protected generatePropertyHandlers() {\n for (const propertyConfigKey of PropertyKey.values()) {\n const propertyTag = configKeyToPropertyType(propertyConfigKey);\n\n const funcNames = [`enter_${propertyTag}`, `leaf_${propertyTag}`];\n for (const funcName of funcNames) {\n // Skip if the function already exists, allows for custom handlers\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof (this as any)[funcName] === 'function') {\n continue;\n }\n\n // Skip 'example' property as it is non-standard and handled elsewhere\n if (propertyTag === 'example') continue;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any)[funcName] = (node: NodeInfo, route: NodeInfo[]) => {\n const value = node.value as unknown[] | undefined;\n if (value == null) return;\n\n // Ignore any property that is not at the bit level as that will be handled by a different handler\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return;\n\n const bitType = this.getBitType(route);\n if (!bitType) return;\n\n const config = Config.getBitConfig(bitType);\n const propertyConfig = Config.getTagConfigForTag(config.tags, propertyConfigKey) as\n | PropertyTagConfig\n | undefined;\n if (!propertyConfig) return;\n\n // Write the property\n this.writeNL_IfNotChain(route); // Only if NOT in chain\n this.writeProperty(propertyConfig.tag, node.value, {\n format: propertyConfig.format ?? TagFormat.plainText,\n array: propertyConfig.array ?? false,\n writeEmpty: true,\n ignoreFalse: propertyConfig.defaultValue === 'false',\n ignoreTrue: propertyConfig.defaultValue === 'true',\n });\n };\n\n // Bind this\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any)[funcName] = (this as any)[funcName].bind(this);\n }\n }\n\n // const propertiesConfig = Config.getRawPropertiesConfig();\n\n // for (const propertyConfig of Object.values(propertiesConfig)) {\n // const astKey = propertyConfig.astKey ?? propertyConfig.tag;\n\n // const enterFuncName = `enter_${astKey}`;\n\n // // Skip if the function already exists, allows for custom handlers\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // if (typeof (this as any)[enterFuncName] === 'function') {\n // continue;\n // }\n\n // // Skip 'example' property as it is non-standard and handled elsewhere\n // if (astKey === 'example') continue;\n\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // (this as any)[enterFuncName] = (node: NodeInfo, route: NodeInfo[]) => {\n // const value = node.value as unknown[] | undefined;\n // if (value == null) return;\n\n // // Ignore any property that is not at the bit level as that will be handled by a different handler\n // const parent = this.getParentNode(route);\n // if (parent?.key !== NodeType.bitsValue) return;\n\n // // Write the property\n // this.writeNL_IfNotChain(route); // Only if NOT in chain\n // this.writeProperty(propertyConfig.tag, node.value, {\n // format: propertyConfig.format ?? TagFormat.plainText,\n // single: propertyConfig.single ?? false,\n // writeEmpty: true,\n // ignoreFalse: propertyConfig.defaultValue === 'false',\n // ignoreTrue: propertyConfig.defaultValue === 'true',\n // });\n // };\n\n // // Bind this\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // (this as any)[enterFuncName] = (this as any)[enterFuncName].bind(this);\n // }\n }\n\n // END NODE HANDLERS\n\n //\n // UTILITY FUNCTIONS\n //\n\n /**\n * Get the bit type from any node\n *\n * @param route the route to the current node\n * @returns the bit type\n */\n protected getBitType(route: NodeInfo[]): BitTypeType | undefined {\n for (const node of route) {\n if (node.key === NodeType.bitsValue) {\n const n = node.value as Bit;\n return n?.bitType;\n }\n }\n\n return undefined;\n }\n\n /**\n * Check if in a chain.\n *\n * Return false if at the root of the bit or a card bit, otherwise true.\n * This is useful to determine if a newline should be written before certain properties.\n *\n * @param route\n * @returns\n */\n protected isChain(route: NodeInfo[]): boolean {\n const parent = this.getParentNode(route);\n // Root of bit\n if (parent?.key === NodeType.bitsValue) return false;\n\n // Root of card bits\n if (parent?.key === NodeType.cardBitsValue) return false;\n if (parent?.key === NodeType.feedbacksValue) return false;\n if (parent?.key === NodeType.quizzesValue) return false;\n if (parent?.key === NodeType.pairsValue) return false;\n if (parent?.key === NodeType.matrixValue) return false;\n if (parent?.key === NodeType.definitionsValue) return false;\n if (parent?.key === NodeType.questionsValue) return false;\n\n // Root of sub-card bits\n if (parent?.key === NodeType.reason) return false;\n\n return true;\n }\n\n protected haveValidCardSet(bit: Bit): boolean {\n const bitConfig = Config.getBitConfig(bit.bitType);\n if (!bitConfig) return false;\n\n // There is no easy way to determine if a card set is valid, so we will just check if the bit has a card set\n // and if so, assume it is valid.\n\n // This information is used for automatically generating the '==== text ====' divider, so this will not be\n // generated for any bit that has a card set unless this function is improved, however, a bit that has a\n // card set in the configuration does not make any sense without a card set, so this is a reasonable behaviour.\n\n return !!bitConfig.cardSet;\n }\n\n protected haveValidFooter(bit: Bit): boolean {\n const footer = bit.footer;\n if (!footer) return false;\n const textFormat = bit.textFormat;\n\n // Handle footer\n if (textFormat === TextFormat.json) {\n // Json footer?!\n // Not valid, ignore\n return false;\n } else if (footer.footer && footer.footer.length > 0) {\n if (this.isBodyBitmarkText) {\n // handle bitmark text\n return true;\n } else {\n // Plain text footer?!\n // Not valid, ignore (plain text cannot have a card set / footer marker, so cannot have a footer!\n return false;\n }\n }\n return false;\n }\n\n /**\n * Calculate the number of spaces around values from the options.\n *\n * This function should only be called from the constructor.\n * Otherwise use this.spacesAroundValues.\n *\n * @returns\n */\n protected calcSpacesAroundValues(): number {\n const val = this.options.spacesAroundValues;\n let spaces = DEFAULT_SPACES_AROUND_VALUES;\n if (val != null) {\n if (val === true) {\n spaces = DEFAULT_SPACES_AROUND_VALUES;\n } else if (val === false) {\n spaces = 0;\n } else {\n spaces = val;\n }\n }\n spaces = Math.min(Math.max(spaces, 0), MAX_SPACES_AROUND_VALUES);\n\n return spaces;\n }\n\n // END UTILITY FUNCTIONS\n\n //\n // WRITE FUNCTIONS\n //\n\n /**\n * Helper function to write a tag key, breakscaping appropriately.\n * Use only to write a tag key.\n *\n * @param s\n */\n protected writeTagKey<T extends string>(s?: T): void {\n if (s != null) {\n this.write(\n Breakscape.breakscape(`${s}`, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n }),\n );\n }\n }\n\n /**\n * Write text or value, handling:\n * - the format and location (i.e. conversion to text and breakscaping).\n * - the spaces around values (if tag value).\n *\n * @param text\n * @param format\n * @param location\n * @param options\n */\n protected writeTextOrValue(\n text: JsonText,\n format: TextFormatType,\n location: TextLocationType,\n options?: GenerateOptions,\n ) {\n const isTagValue = location === TextLocation.tag;\n const s = typeof text === 'string' ? text : undefined;\n const ast = Array.isArray(text) ? (text as TextAst) : undefined;\n const spaces = isTagValue ? this.spacesAroundValuesStr : '';\n\n // For plain strings use TextFormat.text, otherwise keep the requested format for breakscaping.\n const breakscapeFormat = format === TextFormat.bitmarkText ? format : TextFormat.plainText;\n\n /** Wrap a piece of text in the required padding (only for tag values). */\n const wrap = (content: string) => (isTagValue ? `${spaces}${content}${spaces}` : content);\n\n /**\n * Capture everything written by `action` into `partWriter`,\n * then restore the original writer and return the trimmed text.\n */\n const writeToPartWriter = (action: () => void): string => {\n const originalWriter = this.writer;\n\n this.writer = this.partWriter;\n this.partWriter.openSync();\n\n action();\n\n this.partWriter.closeSync();\n const result = this.partWriter.getString().trim();\n\n this.writer = originalWriter;\n return result;\n };\n\n /* String */\n if (s != null) {\n const writeString = () =>\n this.write(\n Breakscape.breakscape(s, {\n format: breakscapeFormat,\n location,\n }),\n );\n\n if (isTagValue) {\n const written = writeToPartWriter(writeString);\n if (written) this.write(wrap(written));\n } else {\n writeString(); // already writes directly to main writer\n }\n return; // nothing more to do for string input\n }\n\n /* AST */\n if (ast != null) {\n const generateAst = () => this.textGenerator.generateSync(ast, format, location, options);\n\n if (isTagValue) {\n const written = writeToPartWriter(generateAst);\n if (written) this.write(wrap(written));\n } else {\n generateAst();\n }\n }\n }\n\n protected writeString(s?: string): void {\n if (s != null) this.write(`${s}`);\n }\n\n protected writeOPBUL(): void {\n this.write('[•');\n }\n\n protected writeOPESC(): void {\n this.write('[^');\n }\n\n protected writeOPRANGLE(): void {\n this.write('[►');\n }\n\n protected writeOPDANGLE(): void {\n this.write('[▼');\n }\n\n protected writeOPD(level: number): void {\n this.write(`[${'.'.repeat(level)}`);\n }\n\n protected writeOPU(): void {\n this.write('[_');\n }\n\n protected writeOPE(): void {\n this.write('[=');\n }\n\n protected writeOPB(): void {\n this.write('[!');\n }\n\n protected writeOPQ(): void {\n this.write('[?');\n }\n\n protected writeOPA(): void {\n this.write('[@');\n }\n\n protected writeOPP(): void {\n this.write('[+');\n }\n\n protected writeOPM(): void {\n this.write('[-');\n }\n\n protected writeOPS(): void {\n this.write('[\\\\');\n }\n\n protected writeOPR(): void {\n this.write('[*');\n }\n\n protected writeOPC(): void {\n this.write('[%');\n }\n\n protected writeOPAMP(): void {\n this.write('[&');\n }\n\n protected writeOPDOLLAR(): void {\n this.write('[$');\n }\n\n protected writeOPHASH(): void {\n this.write('[#');\n }\n\n protected writeOPPRE(): void {\n this.write(\"['\");\n }\n\n protected writeOPPOST(): void {\n this.write('['); // TODO - not sure what symbol is for postfix\n }\n\n protected writeOP(): void {\n this.write('[');\n }\n\n protected writeCL(): void {\n // HACK to fix breakscaping when string ends with a ^ (must add a space) if\n // options.spacesAroundValues is 0\n if (this.spacesAroundValues === 0) {\n if (this.writer.getLastWrite().endsWith('^')) {\n this.write(' ]');\n } else {\n this.write(']');\n }\n } else {\n this.write(']');\n }\n }\n\n protected writeAmpersand(): void {\n this.write('&');\n }\n\n protected writeColon(): void {\n this.write(':');\n }\n\n // protected writeDoubleColon(): void {\n // this.write('::');\n // }\n\n protected writeHash(): void {\n this.write('#');\n }\n\n protected writeSpacesAroundValues(): void {\n this.write(this.spacesAroundValuesStr);\n }\n\n protected writePlainTextDivider(): void {\n this.writeNL();\n this.write('==== text ====');\n }\n\n protected writeCardSetStart(): void {\n this.writeNL();\n if (this.options.cardSetVersion === CardSetVersion.v1) {\n this.write('===');\n } else {\n this.write('====');\n }\n }\n\n protected writeCardSetEnd(): void {\n this.writeNL();\n if (this.options.cardSetVersion === CardSetVersion.v1) {\n this.write('===');\n } else {\n // this.write('==== footer ===='); // Written by the footer\n }\n }\n\n protected writeCardSetCardDivider(): void {\n this.writeNL();\n if (this.options.cardSetVersion === CardSetVersion.v1) {\n this.write('===');\n } else {\n this.write('====');\n }\n }\n\n protected writeCardSetSideDivider(): void {\n this.writeNL();\n if (this.options.cardSetVersion === CardSetVersion.v1) {\n this.write('==');\n } else {\n this.write('--');\n }\n }\n\n protected writeCardSetVariantDivider(): void {\n this.writeNL();\n if (this.options.cardSetVersion === CardSetVersion.v1) {\n this.write('--');\n } else {\n this.write('++');\n }\n }\n\n protected writeNL_IfNotChain(route: NodeInfo[]): void {\n if (!this.isChain(route)) {\n this.writeNL();\n }\n }\n\n protected writeNL(): void {\n if (this.options.debugGenerationInline) {\n this.write('\\\\n');\n return;\n }\n this.write('\\n');\n }\n\n protected writePropertyStyleResource(\n key: string,\n resource: ResourceJson,\n deprecated_writeAsProperty = false,\n ): boolean | void {\n if (key && resource) {\n const resourceTag = ResourceType.keyFromValue(resource.type) ?? '';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const resourceData = (resource as any)[resourceTag];\n const src = resourceData\n ? resourceData.src || resourceData.url || resourceData.body || ''\n : '';\n\n if (deprecated_writeAsProperty) {\n this.writeOPA();\n } else {\n this.writeOPAMP();\n }\n this.writeTagKey(key);\n this.writeColon();\n this.writeTextOrValue(src, TextFormat.plainText, TextLocation.tag);\n\n if (resource.type === ResourceType.article) {\n // this.writeNL();\n }\n this.writeCL();\n }\n }\n\n protected writeResource(type: ResourceTypeType, value: string): void {\n // const resourceAsArticle = resource as ArticleResource;\n\n if (type) {\n // Standard case\n this.writeOPAMP();\n this.writeTagKey(type);\n this.writeColon();\n this.writeTextOrValue(value, TextFormat.plainText, TextLocation.tag);\n\n if (type === ResourceType.article) {\n // this.writeNL();\n }\n this.writeCL();\n }\n }\n\n protected writeProperty(\n name: string,\n values: unknown | unknown[] | undefined,\n options: {\n format: TagFormatType;\n array?: boolean;\n ignoreFalse?: boolean;\n ignoreTrue?: boolean;\n writeEmpty?: boolean;\n },\n ): void {\n let valuesArray: unknown[];\n\n if (values !== undefined) {\n const isBitmarkText = options.format === TagFormat.bitmarkText;\n\n if (isBitmarkText) {\n // Write bitmark text\n if (!options.writeEmpty && isBitmarkText && this.isEmptyText(values as TextAst)) return;\n this.writeOPA();\n this.writeTagKey(name);\n this.writeColon();\n this.writeTextOrValue(values as TextAst, TextFormat.bitmarkText, TextLocation.tag);\n this.writeCL();\n } else {\n // Write any other property type\n if (!Array.isArray(values)) {\n valuesArray = [values];\n } else {\n valuesArray = values;\n }\n\n if (valuesArray.length > 0) {\n if (!options.array) valuesArray = valuesArray.slice(valuesArray.length - 1);\n\n for (const val of valuesArray) {\n if (val !== undefined) {\n if (options.ignoreFalse && val === false) continue;\n if (options.ignoreTrue && val === true) continue;\n if (!options.writeEmpty && val === '') continue;\n this.writeOPA();\n this.writeTagKey(name);\n this.writeColon();\n this.writeTextOrValue(`${val}`, TextFormat.plainText, TextLocation.tag);\n this.writeCL();\n // propertyIndex++;\n }\n }\n }\n } // isBitmarkText\n }\n }\n\n protected writeInlineDebug(\n key: string,\n state: { open?: boolean; close?: boolean; single?: boolean },\n ) {\n let tag = key;\n if (state.open) {\n tag = `<${key}>`;\n } else if (state.close) {\n tag = `</${key}>`;\n } else if (state.single) {\n tag = `<${key} />`;\n }\n\n this.writeString(tag);\n }\n\n //\n // Helper functions\n //\n\n protected isEmptyText(text: TextAst | undefined): boolean {\n if (!text) return true;\n if (Array.isArray(text)) return text.length === 0;\n return true; // true as not valid TextAst?\n }\n\n protected isWriteTextFormat(bitsValue: string, textFormatDefault: TextFormatType): boolean {\n const isDefault = TextFormat.fromValue(bitsValue) === textFormatDefault;\n const writeFormat = !isDefault || this.options.explicitTextFormat;\n return !!writeFormat;\n }\n\n protected calculateIsCardAllowed(): boolean {\n return this.isBodyBitmarkText && !this.isOfBitType1();\n }\n\n protected isOfBitType1(): boolean {\n return this.isOfBitType([\n BitType.trueFalse1,\n BitType.multipleChoice1,\n BitType.multipleResponse1,\n ]);\n }\n\n protected isOfBitType(baseBitType: BitTypeType | BitTypeType[]): boolean {\n return Config.isOfBitType(this.bitType, baseBitType);\n }\n\n //\n // Writer interface\n //\n\n /**\n * Writes a string value to the output.\n * @param value - The string value to be written.\n */\n write(value: string): this {\n this.writer.write(value);\n return this;\n }\n\n /**\n * Writes a new line to the output. The line is indented automatically. The line is ended with the endOfLineString.\n * @param value - The line to write. When omitted, only the endOfLineString is written.\n */\n writeLine(value?: string): this {\n this.writer.writeLine(value);\n return this;\n }\n\n /**\n * Writes a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString.\n * @param values - The lines to write.\n * @param delimiter - An optional delimiter to be written at the end of each line, except for the last one.\n */\n writeLines(values: string[], delimiter?: string): this {\n this.writer.writeLines(values, delimiter);\n return this;\n }\n\n /**\n * Writes a single whitespace character to the output.\n */\n writeWhiteSpace(): this {\n this.writer.writeWhiteSpace();\n return this;\n }\n}\n\nexport { BitmarkGenerator };\n","import { StringWriter } from '../../ast/writer/StringWriter.ts';\nimport { type BitmarkAst } from '../../model/ast/Nodes.ts';\nimport { type Generator } from '../Generator.ts';\nimport { BitmarkGenerator, type BitmarkGeneratorOptions } from './BitmarkGenerator.ts';\n\n/**\n * Generate bitmark markup from a bitmark AST as a string\n */\nclass BitmarkStringGenerator implements Generator<BitmarkAst, string> {\n private generator: BitmarkGenerator;\n private writer: StringWriter;\n\n /**\n * Generate bitmark markup from a bitmark AST as a string\n *\n * @param bitmarkVersion - bitmark version, use null to use latest version\n * @param options - bitmark generation options\n */\n constructor(options?: BitmarkGeneratorOptions) {\n this.writer = new StringWriter();\n this.generator = new BitmarkGenerator(this.writer, options);\n }\n\n /**\n * Generate bitmark markup from bitmark AST as a string\n *\n * @param ast bitmark AST\n */\n public async generate(ast: BitmarkAst): Promise<string> {\n await this.generator.generate(ast);\n return this.writer.getString();\n }\n\n /**\n * Generate bitmark markup from bitmark AST as a string synchronously\n *\n * @param ast bitmark AST\n */\n public generateSync(ast: BitmarkAst): string {\n this.generator.generateSync(ast);\n return this.writer.getString();\n }\n}\n\nexport { BitmarkStringGenerator };\n","import { Ast, type NodeInfo } from '../../ast/Ast.ts';\nimport { type Writer } from '../../ast/writer/Writer.ts';\nimport { Breakscape } from '../../breakscaping/Breakscape.ts';\nimport { Config } from '../../config/Config.ts';\nimport { type BreakscapedString } from '../../model/ast/BreakscapedString.ts';\nimport { type Bit, type BitmarkAst } from '../../model/ast/Nodes.ts';\nimport { type Example, type ExtraProperties } from '../../model/ast/Nodes.ts';\nimport { type Body, type CardBit } from '../../model/ast/Nodes.ts';\nimport { NodeType, type NodeTypeType } from '../../model/ast/NodeType.ts';\nimport {\n type JsonText,\n type TextAst,\n type TextNode,\n type TextNodeAttibutes,\n} from '../../model/ast/TextNodes.ts';\nimport {\n configKeyToPropertyType,\n configKeyToResourceType,\n} from '../../model/config/enum/ConfigKey.ts';\nimport {\n BitmarkVersion,\n type BitmarkVersionType,\n DEFAULT_BITMARK_VERSION,\n} from '../../model/enum/BitmarkVersion.ts';\nimport { BitType, type BitTypeType } from '../../model/enum/BitType.ts';\nimport { BodyBitType, type BodyBitTypeType } from '../../model/enum/BodyBitType.ts';\nimport { ExampleType } from '../../model/enum/ExampleType.ts';\nimport { PropertyKey } from '../../model/enum/PropertyKey.ts';\nimport { ResourceType, type ResourceTypeType } from '../../model/enum/ResourceType.ts';\nimport { TextFormat, type TextFormatType } from '../../model/enum/TextFormat.ts';\nimport { TextLocation, type TextLocationType } from '../../model/enum/TextLocation.ts';\nimport { TextNodeType } from '../../model/enum/TextNodeType.ts';\nimport {\n type BitJson,\n type BookReferenceJson,\n type ExampleJson,\n type HeadingJson,\n type ListItemJson,\n type MarkConfigJson,\n type StatementJson,\n} from '../../model/json/BitJson.ts';\nimport { type BitWrapperJson } from '../../model/json/BitWrapperJson.ts';\nimport { type BodyBitJson } from '../../model/json/BodyBitJson.ts';\nimport {\n type ImageResourceWrapperJson,\n type ResourceJson,\n type ResourceWrapperJson,\n} from '../../model/json/ResourceJson.ts';\nimport { type ParserInfo } from '../../model/parser/ParserInfo.ts';\nimport { TextParser } from '../../parser/text/TextParser.ts';\nimport { BooleanUtils } from '../../utils/BooleanUtils.ts';\nimport { NumberUtils } from '../../utils/NumberUtils.ts';\nimport { AstWalkerGenerator } from '../AstWalkerGenerator.ts';\nimport { TextGenerator } from '../text/TextGenerator.ts';\n\nconst MOVE_BODY_RECURSION_LIMIT = 5000;\n\nconst DEFAULT_OPTIONS: JsonOptions = {\n // debugGenerationInline: true,\n};\n\n/**\n * JSON output options\n */\nexport interface JsonOptions {\n /**\n * Enable parser warnings.\n *\n * If not set or false, parser warnings will not be included in the output.\n * If true, any parser warnings will be included in the output.\n */\n enableWarnings?: boolean | number;\n\n /**\n * Prettify the JSON.\n *\n * If not set or false, JSON will not be prettified.\n * If true, JSON will be prettified with an indent of 2.\n * If a positive integer, JSON will be prettified with an indent of this number.\n *\n * If prettify is set, a string will be returned if possible.\n */\n prettify?: boolean | number;\n\n /**\n * Stringify the JSON.\n *\n * If not set or false, JSON will be returned as a plain JS object.\n * It true, JSON will be stringified.\n *\n * If prettify is set, it will override this setting.\n */\n stringify?: boolean;\n\n /**\n * Output text as plain text rather than parsed bitmark text\n *\n * If not set, the default for the bitmark version will be used.\n * If false, text will be output as parsed bitmark text.\n * It true, text will be output as plain text strings.\n */\n textAsPlainText?: boolean;\n\n /**\n * Exclude unknown properties in the output.\n *\n * If not set or false, unknown properties will be included in the JSON output.\n * It true, unknown properties will NOT be included in the JSON output.\n *\n */\n excludeUnknownProperties?: boolean;\n\n /**\n * [development only]\n * Generate debug information in the output.\n */\n debugGenerationInline?: boolean;\n}\n\n/**\n * JSON generator options\n */\nexport interface JsonGeneratorOptions {\n /**\n * bitmarkVersion - The version of bitmark to output.\n * If not specified, the version will default to 3.\n *\n * Specifying the version will set defaults for other options.\n * - Bitmark v2:\n * - textAsPlainText: true\n * - Bitmark v3:\n * - textAsPlainText: false\n */\n bitmarkVersion?: BitmarkVersionType;\n\n /**\n * The options for JSON generation.\n */\n jsonOptions?: JsonOptions;\n}\n\ninterface ExampleNode {\n isExample: boolean;\n example?: Example | undefined;\n __isDefaultExample: boolean;\n}\n\ninterface ExampleJsonWrapper {\n isExample: boolean;\n example: ExampleJson;\n}\n\n/**\n * Generate bitmark JSON from a bitmark AST\n *\n *\n */\nclass JsonGenerator extends AstWalkerGenerator<BitmarkAst, void> {\n protected ast = new Ast();\n protected textGenerator: TextGenerator;\n private bitmarkVersion: BitmarkVersionType;\n private textParserVersion: string;\n private textParser = new TextParser();\n\n // TODO - move to context\n private options: JsonOptions;\n private jsonPrettifySpace: number | undefined;\n private writer: Writer;\n\n // State\n private json: Partial<BitWrapperJson>[] = [];\n private bitWrapperJson: Partial<BitWrapperJson> = {};\n private bitJson: Partial<BitJson> = {};\n private textDefault: JsonText = Breakscape.EMPTY_STRING;\n private bodyDefault: JsonText = Breakscape.EMPTY_STRING;\n private bodyJson: JsonText = this.bodyDefault;\n private listItem: ListItemJson | undefined;\n private placeholderIndex = 0;\n\n /**\n * Generate bitmark JSON from a bitmark AST\n *\n * @param writer - destination for the output\n * @param options - JSON generation options\n */\n constructor(writer: Writer, options?: JsonGeneratorOptions) {\n super();\n\n // Bind callbacks\n this.enter = this.enter.bind(this);\n this.between = this.between.bind(this);\n this.exit = this.exit.bind(this);\n this.leaf = this.leaf.bind(this);\n this.bodyBitCallback = this.bodyBitCallback.bind(this);\n\n this.bitmarkVersion =\n BitmarkVersion.fromValue(options?.bitmarkVersion) ?? DEFAULT_BITMARK_VERSION;\n this.textParserVersion = this.textParser.version();\n this.options = {\n ...DEFAULT_OPTIONS,\n ...options?.jsonOptions,\n };\n\n this.debugGenerationInline = this.options.debugGenerationInline ?? false;\n this.jsonPrettifySpace =\n this.options.prettify === true ? 2 : this.options.prettify || undefined;\n\n // Set defaults according to bitmark version\n if (this.bitmarkVersion === BitmarkVersion.v2) {\n if (this.options.textAsPlainText === undefined) {\n this.options.textAsPlainText = true;\n }\n } else {\n if (this.options.textAsPlainText === undefined) {\n this.options.textAsPlainText = false;\n }\n }\n\n // Create the text generator for generating v2 texts\n this.textGenerator = new TextGenerator(BitmarkVersion.v2, {\n // writeCallback: this.write,\n bodyBitCallback: this.bodyBitCallback,\n debugGenerationInline: this.debugGenerationInline,\n });\n\n this.writer = writer;\n\n this.generatePropertyHandlers();\n }\n\n /**\n * Generate bitmark markup from bitmark AST\n *\n * @param ast bitmark AST\n */\n public async generate(ast: BitmarkAst): Promise<void> {\n // Reset the state\n this.resetState();\n\n // Open the writer\n await this.writer.open();\n\n // Walk the bitmark AST\n this.walkAndWrite(ast);\n\n // Write the JSON object to file\n this.write(JSON.stringify(this.json, null, this.jsonPrettifySpace));\n\n // Close the writer\n await this.writer.close();\n }\n\n /**\n * Generate text from a bitmark text AST synchronously\n *\n * @param ast bitmark text AST\n */\n public generateSync(ast: BitmarkAst): void {\n // Reset the state\n this.resetState();\n\n // Open the writer\n this.writer.openSync();\n\n // Walk the bitmark AST\n this.walkAndWrite(ast);\n\n // Close the writer\n this.writer.closeSync();\n }\n\n private resetState(): void {\n this.json = [];\n this.bitWrapperJson = {};\n this.bitJson = {};\n this.textDefault = this.options.textAsPlainText ? Breakscape.EMPTY_STRING : [];\n this.bodyDefault = this.options.textAsPlainText ? Breakscape.EMPTY_STRING : [];\n this.bodyJson = this.bodyDefault;\n this.listItem = undefined;\n this.placeholderIndex = 0;\n\n this.printed = false;\n }\n\n private walkAndWrite(ast: BitmarkAst): void {\n // Walk the bitmark AST\n this.ast.walk(ast, NodeType.bitmarkAst, this, undefined);\n }\n\n //\n // NODE HANDLERS\n //\n\n //\n // Non-Terminal nodes (branches)\n //\n\n // bitmark\n\n protected enter_bitmarkAst(_node: NodeInfo, _route: NodeInfo[]): void {\n // Reset the JSON\n this.json = [];\n }\n\n protected exit_bitmarkAst(_node: NodeInfo, _route: NodeInfo[]): void {\n // Convert all bitmark text to plain text if required\n if (this.options.textAsPlainText) {\n // Convert all bitmark text to plain text\n this.convertAllBitmarkTextsToStringsForPlainText(this.json);\n }\n\n // Walk the entire json object and remove all' '_xxx' properties\n // (which are used to store temporary data during the generation process)\n this.removeTemporaryProperties(this.json);\n }\n\n // bitmarkAst -> bits\n\n // bitmarkAst -> bits -> bitsValue\n\n protected enter_bitsValue(node: NodeInfo, _route: NodeInfo[]): void {\n const bit = node.value as Bit;\n\n // Reset\n this.bitWrapperJson = {\n //\n };\n this.json.push(this.bitWrapperJson);\n\n this.bitJson = this.createBitJson(bit);\n this.bitWrapperJson.bit = this.bitJson as BitJson;\n\n // Handle example at the root level - this is bit dependent; configuration is in the bit metadata\n // There is same logic here to select the correct default value of the example is the default is\n // required, and this is bit depenedent.\n // This is ugly, but it is even uglier if the defaults at set in the AST.\n\n const bitConfig = Config.getBitConfig(bit.bitType);\n const textFormat = this.getTextFormat(_route);\n const hasRootExample = !!bitConfig.rootExampleType;\n const isBoolean = bitConfig.rootExampleType === ExampleType.boolean;\n\n if (hasRootExample) {\n // Calculate the value of the default example\n let defaultExample: string | boolean;\n if (isBoolean) {\n // Boolean example\n defaultExample = true;\n if (Config.isOfBitType(bit.bitType, BitType.trueFalse1)) {\n if (bit.cardNode?.statement?.isCorrect !== undefined) {\n defaultExample = bit.cardNode.statement.isCorrect;\n }\n }\n } else {\n // String example\n // Don't use sampleSolution as the default example for conversation bits\n // See: https://github.com/getMoreBrain/cosmic/issues/7293\n // defaultExample = (ArrayUtils.asSingle(bit.sampleSolution) as string) ?? '';\n defaultExample = 'true';\n }\n\n const exampleRes = this.toExample(bit as ExampleNode, {\n defaultExample,\n isBoolean,\n textFormat,\n });\n this.bitJson.isExample = exampleRes.isExample;\n this.bitJson.example = exampleRes.example;\n } else if (bit.isExample) {\n this.bitJson.isExample = true;\n }\n\n // Reset the placeholder index\n this.placeholderIndex = 0;\n }\n\n protected exit_bitsValue(_node: NodeInfo, _route: NodeInfo[]): void {\n // Move isExample / example to end of bit JSON from beginning\n const isExample = this.bitJson.isExample;\n const example = this.bitJson.example;\n delete this.bitJson.isExample;\n delete this.bitJson.example;\n this.bitJson.isExample = isExample;\n this.bitJson.example = example;\n\n // Clean up the bit JSON, removing any unwanted values\n this.cleanBitJson(this.bitJson);\n }\n\n // bitmarkAst -> bits -> bitsValue -> imageSource\n\n protected enter_imageSource(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> person\n\n protected enter_person(node: NodeInfo, route: NodeInfo[]): boolean {\n const bitType = this.getBitType(route);\n\n let keyOverride = 'person';\n if (Config.isOfBitType(bitType, BitType.conversationLeft1)) {\n // Use the legacy partner property in the JSON for conversation bits, so change to person is backwards compatible\n keyOverride = 'partner';\n }\n\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false, keyOverride });\n }\n\n // bitmarkAst -> bits -> bitsValue -> ratingLevelStart\n\n protected enter_ratingLevelStart(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> ratingLevelEnd\n\n protected enter_ratingLevelEnd(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> productId\n\n protected enter_productId(node: NodeInfo, route: NodeInfo[]): boolean {\n const productIds = node.value as string[];\n\n // Ignore item that is not at the correct level\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return true;\n\n const bitType = this.getBitType(route);\n\n if (bitType === BitType.module) {\n this.addProperty(this.bitJson, 'productId', productIds, { array: true });\n } else if (productIds.length > 0) {\n this.addProperty(this.bitJson, 'productId', productIds[productIds.length - 1], {\n array: false,\n });\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> markConfig\n\n protected enter_markConfig(_node: NodeInfo, _route: NodeInfo[]): boolean {\n // Handler so markConfig is not processed by the default property handler\n // Continue traversal\n return true;\n }\n\n // bitmarkAst -> bits -> bitsValue -> markConfig -> markConfigValue\n\n protected enter_markConfigValue(node: NodeInfo, route: NodeInfo[]): boolean {\n const markJson = node.value as MarkConfigJson;\n\n // Ignore item that is not at the correct level\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.markConfig) return true;\n\n if (!this.bitJson.marks) this.bitJson.marks = [];\n this.bitJson.marks.push(markJson);\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> item\n\n protected enter_item(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> lead\n\n protected enter_lead(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> pageNumber\n\n protected enter_pageNumber(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> marginNumber\n\n protected enter_marginNumber(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> hint\n\n protected enter_hint(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> instruction\n\n protected enter_instruction(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> title\n\n protected enter_title(node: NodeInfo, route: NodeInfo[]): boolean {\n // // Ignore title that are not at the bit or card node level as they are handled elsewhere\n // const parent = this.getParentNode(route);\n // if (parent?.key !== NodeType.bitsValue && parent?.key !== NodeType.cardNode) return;\n\n // this.bitJson.title = node.value;\n return this.standardHandler(node, route, [NodeType.bitsValue, NodeType.cardNode], {\n array: true,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> subtitle\n\n protected enter_subtitle(node: NodeInfo, route: NodeInfo[]): boolean {\n // this.bitJson.subtitle = node.value;\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> caption\n\n protected enter_caption(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> width\n\n protected enter_width(node: NodeInfo, route: NodeInfo[]): boolean {\n let value = node.value as string | number;\n const bitType = this.getBitType(route);\n\n const parent = this.getParentNode(route);\n if (parent?.key === NodeType.bitsValue && Config.isOfBitType(bitType, BitType.extractorBlock)) {\n value = NumberUtils.asNumber(value, 0) ?? 0;\n }\n\n // Add the property\n return this.standardHandler(node, route, undefined, { array: false, valueOverride: value });\n }\n\n // bitmarkAst -> bits -> bitsValue -> height\n\n protected enter_height(node: NodeInfo, route: NodeInfo[]): boolean {\n let value = node.value as string | number;\n const bitType = this.getBitType(route);\n\n const parent = this.getParentNode(route);\n if (parent?.key === NodeType.bitsValue && Config.isOfBitType(bitType, BitType.extractorBlock)) {\n value = NumberUtils.asNumber(value, 0) ?? 0;\n }\n\n // Add the property\n return this.standardHandler(node, route, undefined, { array: false, valueOverride: value });\n }\n\n // bitmarkAst -> bits -> bitsValue -> extraProperties\n\n protected enter_extraProperties(node: NodeInfo, _route: NodeInfo[]): void {\n const extraProperties = node.value as ExtraProperties | undefined;\n\n if (!this.options.excludeUnknownProperties && extraProperties) {\n for (const [key, values] of Object.entries(extraProperties)) {\n let k = key;\n if (Object.prototype.hasOwnProperty.call(this.bitJson, key)) {\n k = `_${key}`;\n }\n this.addProperty(this.bitJson, k, values, { array: true });\n }\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> cardBits -> cardBitsValue\n\n protected enter_cardBitsValue(node: NodeInfo, route: NodeInfo[]): void {\n const cardBit = node.value as CardBit;\n\n // How cardBits are handled depends on the bit type\n const bitType = this.getBitType(route);\n if (!bitType) return;\n\n let listItems: ListItemJson[] | undefined;\n\n if (bitType === BitType.bookReferenceList) {\n if (!this.bitJson.bookReferences) this.bitJson.bookReferences = [];\n const bookReference: Partial<BookReferenceJson> = {};\n\n this.addProperty(bookReference, 'lang', cardBit.lang, { array: false });\n this.addProperty(bookReference, 'refAuthor', cardBit.refAuthor ?? [], { array: true });\n this.addProperty(bookReference, 'refBookTitle', cardBit.refBookTitle ?? [], { array: false });\n this.addProperty(bookReference, 'refPublisher', cardBit.refPublisher ?? [], { array: true });\n this.addProperty(bookReference, 'refPublicationYear', cardBit.refPublicationYear ?? [], {\n array: false,\n });\n this.addProperty(bookReference, 'citationStyle', cardBit.citationStyle ?? [], {\n array: false,\n });\n\n this.bitJson.bookReferences.push(bookReference as BookReferenceJson);\n } else {\n // Create the listItems / sections if not already created\n if (bitType === BitType.pageFooter) {\n if (!this.bitJson.sections) this.bitJson.sections = [];\n listItems = this.bitJson.sections;\n } else {\n if (!this.bitJson.listItems) this.bitJson.listItems = [];\n listItems = this.bitJson.listItems;\n }\n\n // Create this list item\n this.listItem = {\n item: (cardBit.item ?? []) as JsonText,\n lead: (cardBit.lead ?? []) as JsonText,\n hint: (cardBit.hint ?? []) as JsonText,\n instruction: (cardBit.instruction ?? []) as JsonText,\n // ...this.toItemLeadHintInstruction(node.value),\n body: this.bodyDefault,\n };\n\n // Delete unwanted properties\n // const nv = node.value;\n // const li: Partial<ListItemJson> = this.listItem;\n\n listItems.push(this.listItem);\n }\n }\n\n protected exit_cardBitsValue(_node: NodeInfo, _route: NodeInfo[]): void {\n this.listItem = undefined;\n }\n\n // bitmarkAst -> bits -> bitsValue -> body\n\n protected enter_body(node: NodeInfo, route: NodeInfo[]): boolean {\n const value = node.value as Body;\n\n const parent = this.getParentNode(route);\n if (!parent) return false;\n\n const textFormat = this.getTextFormat(route);\n const isBitmarkText = textFormat === TextFormat.bitmarkText;\n\n this.bodyJson = value.body as JsonText;\n\n // Set the correct body property\n if (parent.key === NodeType.bitsValue) {\n // Body is at the bit level\n this.bitJson.body = this.bodyJson;\n\n const bodyIsBitmarkText = isBitmarkText && this.isBitmarkText(this.bodyJson);\n\n // Convert the body to plain text if required\n if (this.options.textAsPlainText && bodyIsBitmarkText) {\n const textBody = this.textGenerator.generateSync(\n this.bodyJson as TextAst,\n textFormat,\n TextLocation.body,\n {\n noBreakscaping: true,\n },\n );\n this.bitJson.body = (textBody ?? '').trim();\n } else if (bodyIsBitmarkText) {\n // If the body is bitmark text, convert the body bits to move their attributes to the attrs property\n this.bitJson.body = this.moveBodyBitPropertiesToAttrs(this.bodyJson as TextAst);\n }\n } else if (parent.key === NodeType.cardBitsValue) {\n // Body is at the list item (card bit) level\n if (this.listItem) this.listItem.body = this.bodyJson;\n }\n\n // Stop traversal of this branch\n return false;\n }\n\n protected bodyBitCallback(bodyBit: BodyBitJson, _index: number, _route: NodeInfo[]): string {\n // console.log('bodyBitCallback', bodyBit, index, route);\n\n const placeholder = `{${this.placeholderIndex}}`;\n this.placeholderIndex++;\n this.bitJson.placeholders = this.bitJson.placeholders ?? {};\n this.bitJson.placeholders[placeholder] = bodyBit;\n\n return placeholder;\n }\n\n /**\n * Move all properties of body bits to the attrs property.\n * This function is called recursively to process all body bits in the body tree.\n *\n * NOTE: Internally, the body bit is stored as it appears in bitmark v2, but in v3 all the properties\n * should be in the `attrs` property. The properies are only moved to 'attrs' for the JSON output\n *\n * The original body bit is not modified.\n * The function returns a new body bit with the properties moved.\n *\n * @param nodes the body to process, or the subtree to process\n * @param recursion leave as default, used for recursion only\n * @returns\n */\n protected moveBodyBitPropertiesToAttrs(nodes: TextAst, recursion: number = 0): TextAst {\n if (recursion === 0) {\n nodes = structuredClone(nodes);\n } else if (recursion > MOVE_BODY_RECURSION_LIMIT) {\n throw new Error('Recursion limit exceeded');\n }\n for (const node of nodes) {\n if (\n node.type !== BodyBitType.text &&\n BodyBitType.values().includes(node.type as BodyBitTypeType)\n ) {\n const bodyBit = node as unknown as BodyBitJson;\n bodyBit.attrs = {} as Record<string, unknown>;\n\n // Move all properties except type to the attrs property\n for (const [key, value] of Object.entries(bodyBit)) {\n if (key === 'type' || key === 'attrs') continue;\n bodyBit.attrs[key] = value;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delete (bodyBit as any)[key];\n }\n } else if (Array.isArray(node.content)) {\n recursion++;\n this.moveBodyBitPropertiesToAttrs(node.content as TextAst, recursion);\n }\n }\n\n return nodes;\n }\n\n // bitmarkAst -> bits -> bitsValue -> footer\n\n protected enter_footer(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, undefined, {\n array: true,\n valueOverride: node.value.footer,\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> elements\n\n protected enter_elements(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, undefined, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards\n\n protected enter_flashcards(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, {\n array: true,\n keyOverride: 'cards',\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions\n\n protected enter_definitions(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> statement\n\n protected enter_statement(node: NodeInfo, route: NodeInfo[]): void {\n const statement = node.value as StatementJson;\n\n // Ignore statement that is not at the cardNode level as it is handled elsewhere\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.cardNode) return;\n\n if (statement) {\n this.bitJson.statement = statement.statement ?? '';\n this.bitJson.isCorrect = statement.isCorrect ?? false;\n this.bitJson.example = statement.example;\n this.bitJson.isExample = statement.isExample;\n }\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> statements -> statementsValue\n\n protected enter_statements(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> choices\n // X bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes -> quizzesValue -> choices\n // X bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks -> feedbacksValue -> choices\n\n protected enter_choices(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> responses\n // X bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes -> quizzesValue -> responses\n\n protected enter_responses(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks\n\n protected enter_feedbacks(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes\n\n protected enter_quizzes(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> heading\n\n protected enter_heading(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, undefined, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs\n\n protected enter_pairs(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> matrix\n\n protected enter_matrix(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable\n\n protected enter_pronunciationTable(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> table\n\n protected enter_table(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> questions\n\n protected enter_questions(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> botResponses\n\n protected enter_botResponses(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, {\n array: true,\n keyOverride: 'responses',\n });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> ingredients -> ingredientsValue\n protected enter_ingredients(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList\n\n protected enter_captionDefinitionList(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.cardNode, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> backgroundWallpaper\n\n protected enter_backgroundWallpaper(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> imagePlaceholder\n\n protected enter_imagePlaceholder(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> resources\n\n protected enter_resources(node: NodeInfo, route: NodeInfo[]): boolean {\n const resources = node.value as ResourceJson[];\n const bitType = this.getBitType(route);\n const resourceType = this.getResourceType(route);\n\n if (!resources || !bitType) return true;\n\n let resourceJson: ResourceJson | undefined;\n\n const bitConfig = Config.getBitConfig(bitType);\n const bitResourcesConfig = Config.getBitResourcesConfig(bitType, resourceType);\n const comboMap = bitResourcesConfig.comboResourceConfigKeysMap;\n\n if (comboMap.size > 0) {\n // The resource is a combo resource\n // Extract the resource types from the combo resource\n // NOTE: There should only ever be one combo resource per bit, but the code can handle multiple\n // except for overwriting resourceJson\n for (const [comboConfigKey, resourceConfigKeys] of comboMap.entries()) {\n // Convert the config key to a ResourceType\n const comboTagType = configKeyToResourceType(comboConfigKey);\n\n // Create the combo resource wrapper\n const wrapper: ResourceWrapperJson = {\n type: comboTagType,\n __typeAlias: comboTagType,\n __configKey: comboConfigKey,\n };\n\n // For each of the resources in this combo resource, find the actual resource and add it to the JSON\n for (const ck of resourceConfigKeys) {\n const r = resources.find((r) => r.__configKey === ck);\n // Extract everything except the type from the resource\n if (r) {\n const tagConfig = Config.getTagConfigForTag(bitConfig.tags, r.__configKey);\n if (tagConfig) {\n const key = tagConfig.jsonKey ?? tagConfig.tag;\n const configKey = tagConfig.configKey ?? r.__configKey;\n const json = r.__configKey === configKey ? r : undefined;\n if (json) {\n for (const [k, v] of Object.entries(json)) {\n if (k !== 'type') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (wrapper as any)[key] = v;\n }\n }\n }\n }\n }\n }\n resourceJson = wrapper as ResourceJson;\n }\n } else if (Config.isOfBitType(bitType, [BitType.imagesLogoGrave, BitType.prototypeImages])) {\n // The resource is a logo-grave / prototpye-images resource\n const images: ImageResourceWrapperJson[] = [];\n for (const r of resources) {\n if (r.type === ResourceType.image) {\n images.push(r);\n }\n }\n if (bitType === BitType.imagesLogoGrave) {\n this.bitJson.logos = images;\n } else {\n this.bitJson.images = images;\n }\n } else {\n // This is a standard resource. If there is more than one resource, use the first one.\n // There should not be more than one because of validation\n if (resources.length >= 1) {\n resourceJson = resources[0]; // this.parseResourceToJson(bitType, resources[0]);\n }\n }\n\n this.bitJson.resource = resourceJson;\n\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> level\n\n protected leaf_level(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> book (array)\n\n protected enter_book(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: true });\n }\n\n // bitmarkAst -> bits -> bitsValue -> book (single)\n\n protected leaf_book(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> anchor\n\n protected leaf_anchor(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> reference\n\n protected leaf_reference(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> referenceEnd\n\n protected leaf_referenceEnd(node: NodeInfo, route: NodeInfo[]): boolean {\n return this.standardHandler(node, route, NodeType.bitsValue, { array: false });\n }\n\n // bitmarkAst -> bits -> bitsValue -> markup\n\n protected leaf_markup(node: NodeInfo, _route: NodeInfo[]): boolean {\n const bitmark = node.value as string | undefined;\n if (bitmark) this.bitWrapperJson.bitmark = bitmark;\n\n // Stop traversal of this branch\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> * -> internalComment\n\n protected enter_internalComment(_node: NodeInfo, _route: NodeInfo[]): boolean {\n // Stop traversal of this branch, handled in enter_parser()\n return false;\n }\n\n // bitmarkAst -> bits -> bitsValue -> parser\n\n protected enter_parser(node: NodeInfo, route: NodeInfo[]): void {\n const parser = node.value as ParserInfo | undefined;\n const bitType = this.getBitType(route);\n const parent = this.getParentNode(route);\n\n if (parser && bitType) {\n const {\n version,\n excessResources: parserExcessResources,\n warnings,\n errors,\n ...parserRest\n } = parser;\n const bitmarkVersion = `${this.bitmarkVersion}`;\n const textParserVersion = this.textParserVersion;\n\n // Parse resources to JSON from AST\n let excessResources: ResourceJson[] | undefined;\n if (Array.isArray(parserExcessResources) && parserExcessResources.length > 0) {\n excessResources = [];\n for (const r of parserExcessResources) {\n excessResources.push(r as ResourceJson);\n }\n }\n\n // Extract internal comments from the AST and add to the parser\n const internalComments = this.getInternalComments(route);\n\n if (parent?.key === NodeType.bitsValue) {\n // Bit level parser information\n this.bitWrapperJson.parser = {\n version,\n bitmarkVersion,\n textParserVersion,\n internalComments,\n ...parserRest,\n warnings,\n errors,\n excessResources,\n };\n\n if (!this.options.enableWarnings) {\n // Remove warnings if not enabled\n delete this.bitWrapperJson.parser.warnings;\n }\n } else {\n // Top level parser information (not specific to a bit)\n // TODO - not sure where this error can be written\n // this.bitWrapperJson.parser = {\n // errors,\n // };\n }\n }\n }\n\n // bitmarkAst -> errors\n\n // protected enter_errors(node: NodeInfo, _route: NodeInfo[],\n // context: Context): void {\n // const errors = node.value as ParserError[] | undefined;\n // if (errors && errors.length > 0) {\n // // Complete bit is invalid\n // // TODO - not sure where this error can be written\n // // this.bitWrapperJson.parser = {\n // // errors,\n // // };\n // }\n // }\n\n //\n // Generated Node Handlers\n //\n\n /**\n * Generate the handlers for properties, as they are mostly the same, but not quite\n */\n protected generatePropertyHandlers() {\n // TODO\n // const propertiesConfig = Config.getRawPropertiesConfig();\n // for (const propertyConfig of Object.values(propertiesConfig)) {\n // const astKey = propertyConfig.astKey ?? propertyConfig.tag;\n // const funcName = `enter_${astKey}`;\n // // Skip if the function already exists, allows for custom handlers\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // if (typeof (this as any)[funcName] === 'function') {\n // continue;\n // }\n // // Skip 'example' property as it is non-standard and handled elsewhere\n // if (astKey === 'example') continue;\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // (this as any)[funcName] = (node: NodeInfo, route: NodeInfo[]) => {\n // const value = node.value as unknown[] | undefined;\n // if (value == null) return;\n // // if (key === 'progress') debugger;\n // // Ignore any property that is not at the bit level as that will be handled by a different handler\n // const parent = this.getParentNode(route);\n // if (parent?.key !== NodeType.bitsValue) return;\n // // Convert key as needed\n // const jsonKey = propertyConfig.jsonKey ?? propertyConfig.tag;\n // // Add the property\n // this.addProperty(this.bitJson, jsonKey, value, { array: !propertyConfig.single });\n // };\n // // Bind this\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // (this as any)[funcName] = (this as any)[funcName].bind(this);\n // }\n\n for (const propertyConfigKey of PropertyKey.values()) {\n const propertyTag = configKeyToPropertyType(propertyConfigKey);\n\n const funcNames = [`enter_${propertyTag}`, `leaf_${propertyTag}`];\n for (const funcName of funcNames) {\n // Skip if the function already exists, allows for custom handlers\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof (this as any)[funcName] === 'function') {\n continue;\n }\n // Skip 'example' property as it is non-standard and handled elsewhere\n if (propertyTag === 'example') continue;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any)[funcName] = (node: NodeInfo, route: NodeInfo[]) => {\n const value = node.value as unknown[] | undefined;\n if (value == null) return;\n // if (key === 'progress') debugger;\n // Ignore any property that is not at the bit level as that will be handled by a different handler\n const parent = this.getParentNode(route);\n if (parent?.key !== NodeType.bitsValue) return;\n // // Convert key as needed\n // const jsonKey = propertyConfig.jsonKey ?? propertyConfig.tag;\n // // Add the property\n // this.addProperty(this.bitJson, jsonKey, value, { array: !propertyConfig.single });\n\n // Add the property\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.bitJson as any)[propertyTag] = value;\n };\n // Bind this\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any)[funcName] = (this as any)[funcName].bind(this);\n }\n }\n }\n\n // // END NODE HANDLERS\n\n //\n // HELPER FUNCTIONS\n //\n\n /**\n * Default handler for properties.\n *\n * @param node the node\n * @param route the route to the node\n * @param parentNodeTypes the parent node types for which to handle the node\n * @returns\n */\n protected standardHandler(\n node: NodeInfo,\n route: NodeInfo[],\n parentNodeTypes: NodeTypeType | NodeTypeType[] | undefined,\n options: {\n array: boolean;\n allowNull?: boolean;\n keyOverride?: string;\n valueOverride?: unknown;\n },\n ): boolean {\n // Ignore items not at the nodeType level\n if (parentNodeTypes) {\n const nodeTypeArray = Array.isArray(parentNodeTypes) ? parentNodeTypes : [parentNodeTypes];\n const parent = this.getParentNode(route);\n if (!parent?.key || !nodeTypeArray.includes(parent?.key)) return true;\n }\n\n // Add the property\n this.addProperty(\n this.bitJson,\n options.keyOverride ?? node.key,\n options.valueOverride ?? node.value,\n options,\n );\n\n // Stop traversal of this branch\n return false;\n }\n\n protected addProperty(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target: any,\n name: string,\n values: unknown | unknown[] | undefined,\n options: {\n array: boolean;\n allowNull?: boolean;\n },\n ): void {\n if (values !== undefined) {\n let finalValue: unknown | unknown[] | undefined;\n if (!Array.isArray(values)) values = [values];\n const valuesArr = values as unknown[];\n\n // if (valuesArr.length > 0) {\n if (!options.array && valuesArr.length >= 1) {\n finalValue = valuesArr[valuesArr.length - 1];\n } else {\n finalValue = valuesArr;\n }\n // }\n\n if (options.allowNull || finalValue != null) {\n target[name] = finalValue;\n }\n }\n }\n\n protected toExample(\n node: ExampleNode,\n options: {\n defaultExample: string | boolean | null;\n isBoolean: boolean;\n textFormat: TextFormatType;\n },\n ): ExampleJsonWrapper {\n const { isExample, example, __isDefaultExample } = node;\n const { defaultExample, isBoolean } = options;\n\n if (!isExample) {\n return {\n isExample: false,\n example: null,\n };\n }\n\n let exampleValue;\n if (__isDefaultExample) {\n exampleValue = isBoolean\n ? BooleanUtils.toBoolean(defaultExample)\n : this.convertBreakscapedStringToJsonText(\n defaultExample as BreakscapedString,\n options.textFormat,\n TextLocation.tag,\n );\n } else {\n exampleValue = isBoolean\n ? BooleanUtils.toBoolean(example)\n : this.convertBreakscapedStringToJsonText(\n example as BreakscapedString,\n options.textFormat,\n TextLocation.tag,\n );\n }\n\n return {\n isExample: true,\n example: exampleValue,\n };\n }\n\n /**\n * Get the bit type from any node\n *\n * @param route the route to the current node\n * @returns the bit type\n */\n protected getBitType(route: NodeInfo[]): BitTypeType | undefined {\n for (const node of route) {\n if (node.key === NodeType.bitsValue) {\n const n = node.value as Bit;\n return n?.bitType;\n }\n }\n\n return undefined;\n }\n\n /**\n * Get the text format from any node\n *\n * @param route the route to the current node\n * @returns the text format\n */\n protected getTextFormat(route: NodeInfo[]): TextFormatType {\n const bitType = this.getBitType(route);\n\n if (bitType) {\n const bitConfig = Config.getBitConfig(bitType);\n for (const node of route) {\n if (node.key === NodeType.bitsValue) {\n const n = node.value as Bit;\n return TextFormat.fromValue(n?.textFormat) ?? bitConfig.textFormatDefault;\n }\n }\n }\n\n return TextFormat.bitmarkText;\n }\n\n /**\n * Get the bit resourceType atttachment from any node\n *\n * @param route the route to the current node\n * @returns the bit type\n */\n protected getResourceType(route: NodeInfo[]): ResourceTypeType | undefined {\n for (const node of route) {\n if (node.key === NodeType.bitsValue) {\n const n = node.value as Bit;\n return n?.resourceType;\n }\n }\n\n return undefined;\n }\n\n /**\n * Get the internal comments from any node\n *\n * @param route the route to the current node\n * @returns the text format\n */\n protected getInternalComments(route: NodeInfo[]): BreakscapedString[] | undefined {\n const bitType = this.getBitType(route);\n\n if (bitType) {\n for (const node of route) {\n if (node.key === NodeType.bitsValue) {\n const n = node.value as Bit;\n return n.internalComment as BreakscapedString[];\n }\n }\n }\n\n return undefined;\n }\n\n /**\n * Convert the text from the AST to the JSON format:\n * Input:\n * - breakscaped string\n * Output:\n * - text: plain text\n * - json: bitmark text JSON\n * - Bitmark v2: breakscaped string\n * - Bitmark v3: bitmark text JSON (TextAst)\n *\n * In the case of Bitmark v2 type texts, there is nothing to do but cast the type.\n *\n * @param text\n * @returns\n */\n protected convertBreakscapedStringToJsonText(\n text: BreakscapedString | undefined,\n format: TextFormatType,\n textLocation: TextLocationType,\n ): JsonText {\n if (!text) return '';\n\n const isBitmarkText = format === TextFormat.bitmarkText;\n\n if (!isBitmarkText) {\n // Not bitmark text, so plain text, so unbreakscape only the start of bit tags\n return text || '';\n }\n\n const asPlainText = this.options.textAsPlainText;\n if (asPlainText) {\n return text || '';\n }\n\n // Use the text parser to parse the text\n const textAst = this.textParser.toAst(text, {\n format,\n location: textLocation,\n });\n\n return textAst;\n }\n\n /**\n * Concatenates a plain JSON text with a JsonText that may be plain (v2) or BitmarkText (v3)\n * Returns the combined text.\n *\n * @param text the text to concatenate\n * @param textPlain the plain text to concatenate\n */\n protected concatenatePlainTextWithJsonTexts(\n text: JsonText,\n extraBreaks: number,\n textPlain: string,\n ): JsonText {\n if (Array.isArray(text)) {\n textPlain = textPlain.trim();\n if (textPlain) {\n const splitText = textPlain.split('\\n');\n const content: TextNode[] = [];\n\n for (let i = 0; i < extraBreaks; i++) {\n content.push({\n type: TextNodeType.hardBreak,\n });\n }\n\n for (let i = 0; i < splitText.length; i++) {\n const t = splitText[i];\n if (t) {\n content.push({\n text: t,\n type: TextNodeType.text,\n });\n }\n // Add a hard break after each paragraph, except the last one\n if (i < splitText.length - 1) {\n content.push({\n type: TextNodeType.hardBreak,\n });\n }\n }\n\n // Add the content to the final paragraph, or create a new one if there none\n const lastNode = text[text.length - 1];\n if (lastNode && lastNode.type === TextNodeType.paragraph) {\n lastNode.content = [...(lastNode.content ?? []), ...content];\n } else {\n text.push({\n type: TextNodeType.paragraph,\n content,\n attrs: {} as TextNodeAttibutes,\n });\n }\n }\n return text;\n }\n\n return `${text ?? ''}${'\\n'.repeat(extraBreaks)}${textPlain ?? ''}`;\n }\n\n /**\n * Check if an object is bitmark text\n * The check looks for a special tag on the array (__tag: 'text')\n *\n * @param obj object that might be bitmark text\n * @returns\n */\n protected isBitmarkText(obj: unknown): boolean {\n if (obj == null) return false;\n if (!Array.isArray(obj)) return false;\n\n // Check for the hidden text tag\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((obj as any).__tag === 'text') return true;\n\n return false;\n }\n\n //\n // WRITE FUNCTIONS\n //\n\n protected writeInlineDebug(\n key: string,\n state: { open?: boolean; close?: boolean; single?: boolean },\n ) {\n let tag = key;\n if (state.open) {\n tag = `<${key}>`;\n } else if (state.close) {\n tag = `</${key}>`;\n } else if (state.single) {\n tag = `<${key} />`;\n }\n\n this.writeString(tag);\n }\n\n protected writeString(s?: string): void {\n if (s != null) this.write(`${s}`);\n }\n\n /**\n * Create a new bit json object.\n * - This function defines the order of the properties in the json.\n *\n * @param bit\n * @returns\n */\n protected createBitJson(bit: Bit): Partial<BitJson> {\n const format: string = bit.textFormat as string;\n\n const bitJson: Partial<BitJson> = {\n type: bit.isCommented ? BitType._comment : bit.bitType,\n originalType: bit.isCommented ? bit.bitType : undefined,\n format,\n bitLevel: bit.bitLevel,\n };\n\n return bitJson;\n }\n\n /**\n * Remove wanted properties from bit json object.\n * - This function defines the defaults for properties in the json.\n *\n * TODO: All these defaults should come from the config and be set in the Builder.\n *\n * @param bit\n * @returns\n */\n protected cleanBitJson(bitJson: Partial<BitJson>): Partial<BitJson> {\n const bitType = Config.getBitType(bitJson.type);\n const bitConfig = Config.getBitConfig(bitType);\n // const textFormat = bitJson.format;\n // const plainText = this.options.textAsPlainText;\n\n // Clear 'originalType' if not set\n if (bitJson.originalType == null) bitJson.originalType = undefined;\n\n // Clear 'item' which may be an empty string if 'lead' was set but item not\n // Only necessary because '.article' does not include a default value for 'item'\n // which is totally inconsistent, but maybe is wanted.\n if (!bitJson.item) bitJson.item = undefined;\n\n // Add default properties to the bit.\n // NOTE: Not all bits have the same default properties.\n // The properties used are a bit random sometimes?\n // It would be better if this functionality was generated from the bit config\n if (Config.isOfBitType(bitType, [BitType._error, BitType._comment])) {\n // Special case for _error and _comment bits\n delete bitJson.format;\n delete bitJson.item;\n delete bitJson.lead;\n delete bitJson.pageNumber;\n delete bitJson.marginNumber;\n delete bitJson.hint;\n delete bitJson.instruction;\n //\n } else {\n let isTopLevelExample = false;\n let isTopLevelExampleValue = false;\n\n // Most bits have these defaults, but there are special cases (not sure if that is by error or design)\n if (Config.isOfBitType(bitType, [BitType.page])) {\n // Bits without item, lead, etc\n if (bitJson.item == null || bitJson.item?.length === 0) delete bitJson.item;\n if (bitJson.lead == null || bitJson.lead?.length === 0) delete bitJson.lead;\n if (bitJson.pageNumber == null || bitJson.pageNumber?.length === 0)\n delete bitJson.pageNumber;\n if (bitJson.marginNumber == null || bitJson.marginNumber?.length === 0)\n delete bitJson.marginNumber;\n if (bitJson.hint == null || bitJson.hint?.length === 0) delete bitJson.hint;\n if (bitJson.instruction == null || bitJson.instruction?.length === 0)\n delete bitJson.instruction;\n } else {\n // Majority of bits\n if (bitJson.item == null) bitJson.item = this.textDefault;\n if (bitJson.lead == null) bitJson.lead = this.textDefault;\n if (bitJson.hint == null) bitJson.hint = this.textDefault;\n if (bitJson.instruction == null) bitJson.instruction = this.textDefault;\n if (bitJson.pageNumber == null) bitJson.pageNumber = this.textDefault;\n if (bitJson.marginNumber == null) bitJson.marginNumber = this.textDefault;\n }\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n\n if (Config.isOfBitType(bitType, [BitType.article])) {\n //\n }\n\n if (Config.isOfBitType(bitType, [BitType.example])) {\n // With 'example' value at the bit level.\n isTopLevelExample = true;\n isTopLevelExampleValue = true;\n }\n\n if (\n Config.isOfBitType(bitType, [\n BitType.multipleChoice1,\n BitType.multipleResponse1,\n BitType.multipleChoiceText,\n BitType.highlightText,\n BitType.gapText,\n BitType.gapTextInstructionGrouped,\n BitType.clozeAndMultipleChoiceText,\n BitType.sequence,\n BitType.mark,\n BitType.flashcard,\n BitType.definitionList,\n ])\n ) {\n // With no 'example' value at the bit level.\n isTopLevelExample = true;\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n }\n\n if (Config.isOfBitType(bitType, [BitType.sequence])) {\n // With 'example' value at the bit level.\n isTopLevelExample = true;\n isTopLevelExampleValue = true;\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n }\n\n if (Config.isOfBitType(bitType, BitType.cloze)) {\n // With no 'example' value at the bit level.\n isTopLevelExample = true;\n\n if (Config.isOfBitType(bitType, BitType.clozeSolutionGrouped)) {\n // Solution grouped\n if (bitJson.quizCountItems == null) bitJson.quizCountItems = true;\n if (bitJson.quizStrikethroughSolutions == null) bitJson.quizStrikethroughSolutions = true;\n } else if (Config.isOfBitType(bitType, BitType.clozeInstructionGrouped)) {\n // Instruction grouped\n if (bitJson.quizCountItems == null) bitJson.quizCountItems = true;\n if (bitJson.quizStrikethroughSolutions == null)\n bitJson.quizStrikethroughSolutions = false;\n }\n }\n\n if (Config.isOfBitType(bitType, [BitType.multipleChoice, BitType.multipleResponse])) {\n // Default with a card (and hence a footer possibility)\n isTopLevelExample = true;\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n if (bitJson.footer == null) bitJson.footer = this.textDefault;\n }\n\n if (Config.isOfBitType(bitType, BitType.essay)) {\n // With 'example' value at the bit level.\n isTopLevelExample = true;\n isTopLevelExampleValue = true;\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n if (bitJson.partialAnswer == null) bitJson.partialAnswer = '';\n // if (bitJson.sampleSolution == null) bitJson.sampleSolution = '';\n }\n\n if (Config.isOfBitType(bitType, BitType.trueFalse1)) {\n // With 'example' value at the bit level.\n isTopLevelExample = true;\n isTopLevelExampleValue = true;\n if (bitJson.isCorrect == null) bitJson.isCorrect = false;\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n }\n\n if (Config.isOfBitType(bitType, BitType.trueFalse)) {\n // With no 'example' value at the bit level.\n isTopLevelExample = true;\n if (bitJson.labelFalse == null) bitJson.labelFalse = '';\n if (bitJson.labelTrue == null) bitJson.labelTrue = '';\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n }\n\n if (Config.isOfBitType(bitType, BitType.chapter)) {\n //\n if (bitJson.toc == null) bitJson.toc = true; // Always set on chapter bits?\n if (bitJson.progress == null) bitJson.progress = true; // Always set on chapter bits\n if (bitJson.level == null) bitJson.level = 1; // Set level 1 if none set (makes no sense, but in ANTLR parser)\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n //\n }\n\n if (Config.isOfBitType(bitType, BitType.interview)) {\n // With no 'example' value at the bit level.\n isTopLevelExample = true;\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n if (bitJson.footer == null) bitJson.footer = this.textDefault;\n if (bitJson.questions == null) bitJson.questions = [];\n }\n\n if (bitType === BitType.matchMatrix) {\n // With no 'example' value at the bit level.\n isTopLevelExample = true;\n }\n\n if (Config.isOfBitType(bitType, BitType.match)) {\n // With no 'example' value at the bit level.\n isTopLevelExample = true;\n if (bitJson.heading == null) bitJson.heading = {} as HeadingJson;\n }\n\n if (Config.isOfBitType(bitType, BitType.learningPathBook)) {\n //\n if (bitJson.isTracked == null) bitJson.isTracked = true;\n if (bitJson.isInfoOnly == null) bitJson.isInfoOnly = false;\n //\n }\n\n if (Config.isOfBitType(bitType, BitType.table)) {\n //\n // if (bitJson.content2Buy == null) bitJson.content2Buy = '';\n if (bitJson.tableFixedHeader == null) bitJson.tableFixedHeader = false;\n if (bitJson.tableHeaderWhitespaceNoWrap == null) bitJson.tableHeaderWhitespaceNoWrap = true;\n if (bitJson.tableSearch == null) bitJson.tableSearch = false;\n if (bitJson.tableSort == null) bitJson.tableSort = false;\n if (bitJson.tablePagination == null) bitJson.tablePagination = false;\n if (bitJson.tablePaginationLimit == null) bitJson.tablePaginationLimit = 0;\n if (bitJson.tableHeight == null) bitJson.tableHeight = 0;\n if (bitJson.tableWhitespaceNoWrap == null) bitJson.tableWhitespaceNoWrap = false;\n if (bitJson.tableAutoWidth == null) bitJson.tableAutoWidth = true;\n if (bitJson.tableResizableColumns == null) bitJson.tableResizableColumns = false;\n if (bitJson.tableColumnMinWidth == null) bitJson.tableColumnMinWidth = 0;\n //\n }\n\n if (Config.isOfBitType(bitType, BitType.bookReference)) {\n //\n if (bitJson.refAuthor == null) bitJson.refAuthor = [];\n if (bitJson.refBookTitle == null) bitJson.refBookTitle = '';\n if (bitJson.refPublisher == null) bitJson.refPublisher = [];\n if (bitJson.refPublicationYear == null) bitJson.refPublicationYear = '';\n //\n }\n\n // Page bits\n if (\n Config.isOfBitType(bitType, [\n BitType.pageBanner,\n BitType.pageBuyButton,\n BitType.pageBuyButtonAlt,\n BitType.pageBuyButtonPromotion,\n BitType.pageFooter,\n BitType.pageOpenBook,\n BitType.pagePerson,\n BitType.pageProduct,\n BitType.pageProductList,\n BitType.pageProductVideo,\n BitType.pageProductVideoList,\n BitType.pageSectionFolder,\n BitType.pageSubscribe,\n BitType.pageSubpage,\n ])\n ) {\n //\n if (bitJson.slug == null) bitJson.slug = '';\n if (bitJson.body == null) bitJson.body = this.bodyDefault;\n\n if (Config.isOfBitType(bitType, BitType.pageBuyButton)) {\n if (bitJson.content2Buy == null) bitJson.content2Buy = '';\n }\n }\n\n // Special case for 'toc-resource' bits\n if (Config.isOfBitType(bitType, BitType.tocResource)) {\n if (bitJson.tocResource == null) bitJson.tocResource = [];\n }\n\n // Special case for 'toc-content' bits\n if (Config.isOfBitType(bitType, BitType.tocContent)) {\n if (bitJson.tocContent == null) bitJson.tocContent = [];\n }\n\n // Special case for 'book' bits\n if (Config.isOfBitType(bitType, BitType.book)) {\n if (bitJson.maxTocChapterLevel == null) bitJson.maxTocChapterLevel = -1;\n if (bitJson.hasMarkAsDone == null) bitJson.hasMarkAsDone = false;\n if (bitJson.processHandIn == null) bitJson.processHandIn = false;\n if (bitJson.isPublic == null) bitJson.isPublic = false;\n if (bitJson.chatWithBook == null) bitJson.chatWithBook = false;\n if (bitJson.chatWithBookBrainKey == null) bitJson.chatWithBookBrainKey = '';\n }\n\n // Special case for 'ai' bits\n if (\n bitType === BitType.articleAi ||\n bitType === BitType.noteAi ||\n bitType === BitType.summaryAi\n ) {\n if (bitJson.aiGenerated == null) bitJson.aiGenerated = true;\n }\n\n // Special case for '-responsive...' bits\n if (Config.isOfBitType(bitType, [BitType.articleResponsive, BitType.pageArticleResponsive])) {\n if (bitJson.imageFirst == null) bitJson.imageFirst = true;\n }\n\n // Special case for 'review-...' bits\n if (Config.isOfBitType(bitType, BitType.reviewNote)) {\n if (bitJson.resolved == null) bitJson.resolved = false;\n if (bitJson.resolvedDate == null) bitJson.resolvedDate = '';\n if (bitJson.resolvedBy == null) bitJson.resolvedBy = '';\n }\n\n // Special case for 'images-logos-grave' / 'prototype-images' / etc bits\n if (Config.isOfBitType(bitType, [BitType.imagesLogoGrave, BitType.prototypeImages])) {\n if (bitType === BitType.imagesLogoGrave) {\n if (bitJson.logos == null) {\n bitJson.logos = [];\n }\n } else {\n if (bitJson.images == null) bitJson.images = [];\n }\n }\n\n // Special case for 'stepImageScreenshotWithPointer' / surveyMatrix / etc bits\n if (\n Config.isOfBitType(bitType, [BitType.stepImageScreenshotWithPointer, BitType.surveyMatrix])\n ) {\n if (bitJson.pointerTop == null) bitJson.pointerTop = '';\n if (bitJson.pointerLeft == null) bitJson.pointerLeft = '';\n if (Config.isOfBitType(bitType, [BitType.surveyMatrix])) {\n if (bitJson.buttonCaption == null) bitJson.buttonCaption = '';\n }\n }\n\n if (Config.isOfBitType(bitType, [BitType.listItem])) {\n if (bitJson.listItemIndent == null) bitJson.listItemIndent = 0;\n }\n\n // Special case for 'survey-rating-*' bits\n if (Config.isOfBitType(bitType, BitType.surveyRating)) {\n //\n if (bitJson.ratingLevelStart == null) {\n bitJson.ratingLevelStart = {\n level: 0,\n };\n }\n if (bitJson.ratingLevelEnd == null) {\n bitJson.ratingLevelEnd = {\n level: 0,\n };\n }\n }\n\n // Special case for 'vendor-stripe-pricing-table' bits\n if (Config.isOfBitType(bitType, BitType.vendorStripePricingTable)) {\n if (bitJson.stripePricingTableId == null) bitJson.stripePricingTableId = '';\n if (bitJson.stripePublishableKey == null) bitJson.stripePublishableKey = '';\n }\n\n // Special case for 'call-to-action' bits\n if (Config.isOfBitType(bitType, BitType.callToAction)) {\n if (bitJson.buttonCaption == null) bitJson.buttonCaption = '';\n if (bitJson.callToActionUrl == null) bitJson.callToActionUrl = '';\n }\n\n // Special case for 'hand-in-file' bits\n if (Config.isOfBitType(bitType, BitType.handInFile)) {\n if (bitJson.handInAcceptFileType == null) bitJson.handInAcceptFileType = [];\n }\n\n // Special case for 'hand-in-submit' bits\n if (Config.isOfBitType(bitType, BitType.handInSubmit)) {\n if (bitJson.handInRequirement == null) bitJson.handInRequirement = [];\n if (bitJson.handInInstruction == null) bitJson.handInInstruction = '';\n if (bitJson.buttonCaption == null) bitJson.buttonCaption = '';\n }\n\n // Special case for 'module' bits\n if (Config.isOfBitType(bitType, BitType.module)) {\n if (bitJson.hasBookNavigation == null) bitJson.hasBookNavigation = true;\n }\n\n // Special case for 'container' bits\n if (Config.isOfBitType(bitType, BitType.container)) {\n if (bitJson.allowedBit == null) bitJson.allowedBit = [];\n }\n\n // Special case for 'quiz' bits\n if (bitConfig.quizBit) {\n if (bitJson.revealSolutions == null) bitJson.revealSolutions = false;\n }\n\n // Special case for 'platform-path' bits\n if (Config.isOfBitType(bitType, BitType.platformPath)) {\n if (bitJson.path == null) bitJson.path = '';\n }\n\n // Remove top level example if it is not required\n if (isTopLevelExample) {\n if (bitJson.isExample == null) bitJson.isExample = false;\n } else {\n // Remove example\n delete bitJson.isExample;\n delete bitJson.example;\n }\n if (isTopLevelExampleValue) {\n if (bitJson.example == null) bitJson.example = null;\n } else {\n // Remove example value\n delete bitJson.example;\n }\n }\n\n return bitJson;\n }\n\n /**\n * Convert any bitmark texts to strings.\n */\n protected convertAllBitmarkTextsToStringsForPlainText(\n json: Record<string, unknown> | unknown[],\n ): void {\n if (!this.options.textAsPlainText) return;\n\n const obj = json as Record<string, unknown>;\n for (const key in obj) {\n const val = obj[key];\n if (this.isBitmarkText(val)) {\n const s = this.textGenerator.generateSync(\n val as TextAst,\n TextFormat.bitmarkText,\n TextLocation.tag,\n {\n noBreakscaping: true,\n },\n );\n obj[key] = (s ?? '').trim();\n } else if (typeof obj[key] === 'object') {\n this.convertAllBitmarkTextsToStringsForPlainText(obj[key] as Record<string, unknown>);\n }\n }\n }\n\n /**\n * Remove any property with a key starting with an double underscore.\n *\n * @param json\n */\n protected removeTemporaryProperties(json: Record<string, unknown> | unknown[]): void {\n const obj = json as Record<string, unknown>;\n for (const key in obj) {\n if (key.startsWith('__')) {\n delete obj[key];\n } else if (typeof obj[key] === 'object') {\n this.removeTemporaryProperties(obj[key] as Record<string, unknown>);\n }\n }\n }\n\n //\n // Writer interface\n //\n\n /**\n * Writes a string value to the output.\n * @param value - The string value to be written.\n */\n write(value: string): this {\n this.writer.write(value);\n return this;\n }\n\n /**\n * Writes a new line to the output. The line is indented automatically. The line is ended with the endOfLineString.\n * @param value - The line to write. When omitted, only the endOfLineString is written.\n */\n writeLine(value?: string): this {\n this.writer.writeLine(value);\n return this;\n }\n\n /**\n * Writes a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString.\n * @param values - The lines to write.\n * @param delimiter - An optional delimiter to be written at the end of each line, except for the last one.\n */\n writeLines(values: string[], delimiter?: string): this {\n this.writer.writeLines(values, delimiter);\n return this;\n }\n\n /**\n * Writes a single whitespace character to the output.\n */\n writeWhiteSpace(): this {\n this.writer.writeWhiteSpace();\n return this;\n }\n}\n\nexport { JsonGenerator };\n","import { StringWriter } from '../../ast/writer/StringWriter.ts';\nimport { type BitmarkAst } from '../../model/ast/Nodes.ts';\nimport { type BitWrapperJson } from '../../model/json/BitWrapperJson.ts';\nimport { type Generator } from '../Generator.ts';\nimport { JsonGenerator, type JsonGeneratorOptions } from './JsonGenerator.ts';\n\n/**\n * Generate bitmark JSON from a bitmark AST as a plain JS object\n *\n */\nclass JsonObjectGenerator implements Generator<BitmarkAst, BitWrapperJson[]> {\n private generator: JsonGenerator;\n private writer: StringWriter;\n\n /**\n * Generate bitmark JSON from a bitmark AST as a string\n *\n * @param options - JSON generation options\n */\n constructor(options?: JsonGeneratorOptions) {\n this.writer = new StringWriter();\n this.generator = new JsonGenerator(this.writer, options);\n }\n\n /**\n * Generate bitmark JSON from bitmark AST as a plain JS object\n *\n * @param ast bitmark AST\n */\n public async generate(ast: BitmarkAst): Promise<BitWrapperJson[]> {\n await this.generator.generate(ast);\n return JSON.parse(this.writer.getString());\n }\n\n /**\n * Generate bitmark JSON from bitmark AST as a plain JS object synchronously\n *\n * @param ast bitmark AST\n */\n public generateSync(ast: BitmarkAst): BitWrapperJson[] {\n this.generator.generateSync(ast);\n return JSON.parse(this.writer.getString());\n }\n}\n\nexport { JsonObjectGenerator };\n","import { Config } from '../config/Config.ts';\nimport { BitConfig } from '../model/config/BitConfig.ts';\nimport { BitType, type BitTypeType } from '../model/enum/BitType.ts';\n\nexport interface SupportedBitsOptions {\n includeNonDeprecated?: boolean; // Default: true\n includeDeprecated?: boolean; // Default: false\n}\n\nexport interface SupportedBit {\n name: BitTypeType;\n since: string;\n deprecated?: string;\n inheritedBitTypes?: BitTypeType[];\n}\n\nclass InfoBuilder {\n public getSupportedBits(options?: SupportedBitsOptions): SupportedBit[] {\n const includeNonDeprecated = options?.includeNonDeprecated ?? true;\n const includeDeprecated = options?.includeDeprecated ?? false;\n const supportedBits: SupportedBit[] = [];\n\n for (const bt of BitType.values()) {\n if (bt === BitType._error || bt === BitType._comment) continue;\n\n const bitType = Config.getBitType(bt);\n const bitConfig = Config.getBitConfig(bitType);\n\n const inheritedBitTypes =\n bitConfig.inheritedBitTypes.length > 0 ? bitConfig.inheritedBitTypes : undefined;\n\n const include =\n (includeNonDeprecated && !bitConfig.deprecated) ||\n (includeDeprecated && bitConfig.deprecated);\n if (include) {\n supportedBits.push({\n name: bt,\n since: bitConfig.since,\n deprecated: bitConfig.deprecated,\n inheritedBitTypes,\n });\n }\n }\n\n return supportedBits;\n }\n\n public getSupportedBitConfigs(): BitConfig[] {\n const res: BitConfig[] = [];\n\n for (const bt of BitType.values()) {\n if (bt === BitType._error || bt === BitType._comment) continue;\n\n const bitType = Config.getBitType(bt);\n const config: BitConfig = Config.getBitConfig(bitType);\n res.push(config);\n }\n\n return res;\n }\n}\n\nexport { InfoBuilder };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst BitmarkParserType = superenum({\n peggy: 'peggy',\n});\n\nexport type BitmarkParserTypeType = EnumType<typeof BitmarkParserType>;\n\nexport { BitmarkParserType };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst InfoFormat = superenum({\n text: 'text',\n json: 'json',\n pojo: 'pojo',\n});\n\nexport type InfoFormatType = EnumType<typeof InfoFormat>;\n\nexport { InfoFormat };\n","import { type EnumType, superenum } from '@ncoderz/superenum';\n\nconst InfoType = superenum({\n list: 'list', // List non-deprecated bits\n deprecated: 'deprecated', // List deprecated bits\n all: 'all', // List all bits\n bit: 'bit', // Get information for a bit\n});\n\nexport type InfoTypeType = EnumType<typeof InfoType>;\n\nexport { InfoType };\n","import { Builder } from '../../ast/Builder.ts';\nimport { Config } from '../../config/Config.ts';\nimport {\n type Bit,\n type BitmarkAst,\n type Body,\n type CardBit,\n type Footer,\n} from '../../model/ast/Nodes.ts';\nimport { type JsonText } from '../../model/ast/TextNodes.ts';\nimport { BitType, type BitTypeType } from '../../model/enum/BitType.ts';\nimport { DeprecatedTextFormat } from '../../model/enum/DeprecatedTextFormat.ts';\nimport { ResourceType, type ResourceTypeType } from '../../model/enum/ResourceType.ts';\nimport { TextFormat, type TextFormatType } from '../../model/enum/TextFormat.ts';\nimport {\n type BitJson,\n type BotResponseJson,\n type ExampleJson,\n type ListItemJson,\n type ResponseJson,\n type StatementJson,\n} from '../../model/json/BitJson.ts';\nimport { type BitWrapperJson } from '../../model/json/BitWrapperJson.ts';\nimport { type BodyBitsJson } from '../../model/json/BodyBitJson.ts';\nimport { type ImageResourceWrapperJson, type ResourceJson } from '../../model/json/ResourceJson.ts';\nimport { StringUtils } from '../../utils/StringUtils.ts';\n\ninterface ReferenceAndReferenceProperty {\n reference?: string;\n referenceProperty?: string | string[];\n}\n\ninterface Example {\n example: ExampleJson;\n}\n\nconst builder = new Builder();\n\n/**\n * A parser for parsing bitmark JSON to bitmark AST\n */\nclass JsonParser {\n /**\n * Convert JSON to AST.\n *\n * The JSON can be a bit or a bitwrapper and can be a string or a plain JS object\n *\n * @param json - bitmark JSON as a string or a plain JS object\n * @returns bitmark AST\n */\n toAst(json: unknown): BitmarkAst {\n const bitWrappers = this.preprocessJson(json);\n const bitsNodes: Bit[] | undefined = [];\n\n for (const bitWrapper of bitWrappers) {\n const { bit, parser } = bitWrapper;\n\n // Transform to AST\n const bitsNode = this.bitToAst(bit, parser?.internalComments);\n if (bitsNode) {\n bitsNodes.push(bitsNode);\n }\n }\n\n const bits = bitsNodes.length > 0 ? { bits: bitsNodes } : {};\n\n const ast = builder.buildBitmark(bits);\n\n return ast;\n }\n\n /**\n * Preprocess bitmark JSON into a standard format (BitWrapperJson[] object) from either a bit or a bitwrapper\n * as a string or a plain JS object\n *\n * @param json - bitmark JSON as a string or a plain JS object\n * @returns bitmark JSON in a standard format (BitWrapperJson[] object)\n */\n preprocessJson(json: string | unknown): BitWrapperJson[] {\n const bitWrappers: BitWrapperJson[] = [];\n\n if (StringUtils.isString(json)) {\n const str = json as string;\n try {\n json = JSON.parse(str);\n } catch (_e) {\n // Failed to parse JSON, return empty array\n return [];\n }\n }\n\n // Helper function to push an item that is either a BitWrapper or a Bit to the BitWrapper array as a BitWrapper\n const pushItemAsBitWrapper = (item: unknown): void => {\n if (this.isBitWrapper(item)) {\n const w = item as BitWrapperJson;\n bitWrappers.push(w);\n } else if (this.isBit(item)) {\n const b = item as BitJson;\n bitWrappers.push(this.bitToBitWrapper(b));\n }\n };\n\n // See if we have an array of bits, or a single bit, or any other known format, and convert that into\n // an array of bits\n if (Array.isArray(json)) {\n for (const item of json) {\n pushItemAsBitWrapper(item);\n }\n } else {\n pushItemAsBitWrapper(json);\n }\n\n return bitWrappers;\n }\n\n /**\n * Check if a plain JS object is valid BitWrapper JSON\n *\n * @param bitWrapper - a plain JS object that might be BitWrapper JSON\n * @returns true if BitWrapper JSON, otherwise false\n */\n isBitWrapper(bitWrapper: unknown): boolean {\n if (Object.prototype.hasOwnProperty.call(bitWrapper, 'bit')) {\n const w = bitWrapper as BitWrapperJson;\n return this.isBit(w.bit);\n }\n return false;\n }\n\n /**\n * Check if a plain JS object is valid Bit JSON\n *\n * @param bitWrapper - a plain JS object that might be Bit JSON\n * @returns true if Bit JSON, otherwise false\n */\n isBit(bit: unknown): boolean {\n if (Object.prototype.hasOwnProperty.call(bit, 'type')) {\n const b = bit as BitJson;\n return Config.getBitType(b.type) !== BitType._error;\n }\n return false;\n }\n\n /**\n * Convert a Bit to BitWrapper\n *\n * @param bit a valid Bit\n * @returns the Bit wrapper in a BitWrapper\n */\n bitToBitWrapper(bit: BitJson): BitWrapperJson {\n return {\n bit,\n };\n }\n\n private bitToAst(bit: BitJson, internalComments: string[] | undefined): Bit | undefined {\n const { statement, reference: referenceBit, ...bitRest } = bit;\n\n const isCommented = bit.type === BitType._comment && bit.originalType !== undefined;\n\n // Bit type\n const bitType = Config.getBitType(isCommented ? bit.originalType : bit.type);\n\n // Get the bit config for the bit type\n const bitConfig = Config.getBitConfig(bitType);\n\n // Text Format\n const deprecatedTextFormat = DeprecatedTextFormat.fromValue(bit.format);\n let _textFormat = TextFormat.fromValue(bit.format) ?? bitConfig.textFormatDefault;\n if (deprecatedTextFormat === DeprecatedTextFormat.bitmarkMinusMinus) {\n _textFormat = TextFormat.bitmarkText;\n }\n\n // Build bit\n const bitNode = builder.buildBit({\n ...bitRest,\n bitType,\n bitLevel: Math.max(Math.min(bit.bitLevel ?? 1, Config.bitLevelMax), Config.bitLevelMin),\n textFormat: bit.format as TextFormatType,\n resourceType: this.getResourceType(bit.resource),\n isCommented,\n internalComment: internalComments,\n ...this.processReference(referenceBit), // reference and referenceProperty\n ...this.parseExample(bit.example),\n person: bit.partner ?? bit.person,\n markConfig: bit.marks,\n resources: this.processResources(bitType, bit.resource, bit.images, bit.logos),\n body: this.processBody(bit.body as JsonText, bit.placeholders),\n flashcards: bit.cards,\n statements: this.processStatements(statement, bit.isCorrect, bit.statements, bit.example),\n responses: this.processResponses(bitType, bit.responses as ResponseJson[]),\n botResponses: this.processBotResponse(bitType, bit.responses as BotResponseJson[]),\n cardBits: this.processListItems(\n bit.listItems ?? bit.sections ?? bit.bookReferences,\n bit.placeholders,\n ),\n footer: this.processFooter(bit.footer),\n });\n\n return bitNode;\n }\n\n private processStatements(\n statement?: string,\n isCorrect?: boolean,\n statements?: Partial<StatementJson>[],\n example?: ExampleJson,\n ): Partial<StatementJson>[] | undefined {\n const nodes: Partial<StatementJson>[] = [];\n\n // Add statement defined in the bit\n if (statement) {\n const node: Partial<StatementJson> = {\n statement: statement ?? '',\n isCorrect: isCorrect ?? false,\n ...this.parseExample(example),\n };\n\n if (node) nodes.push(node);\n }\n\n // add standard statements\n if (Array.isArray(statements)) for (const item of statements) nodes.push(item);\n\n if (nodes.length === 0) return undefined;\n\n return nodes;\n }\n\n private processResponses(\n bitType: BitTypeType,\n responses?: ResponseJson[],\n ): ResponseJson[] | undefined {\n // Return early if bot response as the responses should be interpreted as bot responses\n if (Config.isOfBitType(bitType, BitType.botActionResponse)) return undefined;\n if (!Array.isArray(responses)) return undefined;\n\n return responses;\n }\n\n private processBotResponse(\n bitType: BitTypeType,\n responses?: BotResponseJson[],\n ): BotResponseJson[] | undefined {\n // Return early if NOT bot response as the responses should be interpreted as standard responses\n if (!Config.isOfBitType(bitType, BitType.botActionResponse)) return undefined;\n if (!Array.isArray(responses)) return undefined;\n return responses;\n }\n\n private processListItems(\n listItems: ListItemJson[],\n placeholders: BodyBitsJson,\n ): CardBit[] | undefined {\n const nodes: CardBit[] = [];\n\n if (Array.isArray(listItems)) {\n for (const li of listItems) {\n const node: CardBit = {\n ...li,\n } as CardBit;\n if (node.body) {\n node.body = {\n body: node.body,\n placeholders,\n };\n }\n if (node) nodes.push(node);\n }\n }\n\n if (nodes.length === 0) return undefined;\n\n return nodes;\n }\n\n private getResourceType(resource?: ResourceJson): ResourceTypeType | undefined {\n if (resource) {\n const resourceKey = ResourceType.fromValue(resource.type);\n return resourceKey;\n }\n\n return undefined;\n }\n\n private processResources(\n bitType: BitTypeType,\n resource: ResourceJson | undefined,\n images: ImageResourceWrapperJson[] | undefined,\n logos: ImageResourceWrapperJson[] | undefined,\n ): ResourceJson[] | undefined {\n const nodes: ResourceJson[] | undefined = [];\n\n if (resource) nodes.push(resource);\n\n if (Config.isOfBitType(bitType, [BitType.prototypeImages])) {\n // Add the logo images\n if (Array.isArray(images)) {\n for (const image of images) {\n if (image) nodes.push(image);\n }\n }\n }\n\n if (Config.isOfBitType(bitType, [BitType.imagesLogoGrave])) {\n // Add the logo images\n if (Array.isArray(logos)) {\n for (const image of logos) {\n if (image) nodes.push(image);\n }\n }\n }\n\n return nodes;\n }\n\n private processBody(body: JsonText, placeholders: BodyBitsJson): Body | undefined {\n return {\n body,\n placeholders,\n };\n }\n\n private processFooter(footerText: JsonText): Footer | undefined {\n if (!footerText) return undefined;\n return {\n footer: footerText,\n };\n }\n\n private processReference(reference: string | string[]): ReferenceAndReferenceProperty {\n if (Array.isArray(reference) && reference.length > 0) {\n return {\n reference: undefined,\n referenceProperty: reference,\n };\n }\n\n return {\n reference: reference as string,\n referenceProperty: undefined,\n };\n }\n\n private parseExample(example: ExampleJson | undefined): Example | undefined {\n if (example == null) return undefined;\n if (example === true) return { example: true };\n if (example === false) return { example: false };\n const exampleText =\n StringUtils.isString(example) || Array.isArray(example) ? example : undefined;\n if (exampleText) {\n return { example: exampleText };\n }\n return { example: !!example };\n }\n}\n\nexport { JsonParser };\n","/**\n * BitmarPegParserTypes.ts\n * RA Sewell\n *\n * (c) 2023 Get More Brain AG\n * All rights reserved.\n *\n */\n\nimport { type EnumType, superenum } from '@ncoderz/superenum';\n\nimport { type BreakscapedString } from '../../../model/ast/BreakscapedString.ts';\nimport {\n type Body,\n type CardBit,\n type ExtraProperties,\n type Footer,\n} from '../../../model/ast/Nodes.ts';\nimport { type JsonText, type TextAst } from '../../../model/ast/TextNodes.ts';\nimport { BitConfig } from '../../../model/config/BitConfig.ts';\nimport { type TagsConfig } from '../../../model/config/TagsConfig.ts';\nimport { type BitTypeType } from '../../../model/enum/BitType.ts';\nimport type { ResourceTypeType } from '../../../model/enum/ResourceType.ts';\nimport { Tag } from '../../../model/enum/Tag.ts';\nimport { type TextFormatType } from '../../../model/enum/TextFormat.ts';\nimport {\n type BookJson,\n type BotResponseJson,\n type ChoiceJson,\n type DefinitionListItemJson,\n type ExampleJson,\n type FeedbackChoiceJson,\n type FeedbackJson,\n type FlashcardJson,\n type HeadingJson,\n type ImageSourceJson,\n type IngredientJson,\n type MarkConfigJson,\n type MatrixJson,\n type PairJson,\n type PersonJson,\n type PronunciationTableJson,\n type QuestionJson,\n type QuizJson,\n type RatingLevelStartEndJson,\n type ResponseJson,\n type ServingsJson,\n type StatementJson,\n type TableJson,\n type TechnicalTermJson,\n} from '../../../model/json/BitJson.ts';\nimport { type ImageResourceJson, type ResourceJson } from '../../../model/json/ResourceJson.ts';\nimport { type ParserData } from '../../../model/parser/ParserData.ts';\nimport { type ParserError } from '../../../model/parser/ParserError.ts';\nimport { type ParserInfo } from '../../../model/parser/ParserInfo.ts';\nimport { PeggyGrammarLocation } from './PeggyGrammarLocation.ts';\n\nconst CARD_DIVIDER_V2 = '====';\nconst CARD_SIDE_DIVIDER_V2 = '--';\nconst CARD_VARIANT_DIVIDER_V2 = '++';\n\nconst CARD_DIVIDER_V1 = '===';\nconst CARD_SIDE_DIVIDER_V1 = '==';\nconst CARD_VARIANT_DIVIDER_V1 = '--';\n\nexport interface ParseOptions {\n startRule?: string;\n grammarSource?: PeggyGrammarLocation | unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n tracer?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ParseFunction = (input: string, options?: ParseOptions) => any;\n\nexport interface ParserHelperOptions {\n parse: ParseFunction;\n parserText: () => ParserError['text'];\n parserLocation: () => ParserError['location'];\n}\n\nexport interface SubParserResult<T> {\n value?: T;\n errors?: ParserError[];\n}\n\nexport interface RawTextAndResourceType {\n textFormat?: string;\n resourceType?: string;\n}\n\nexport interface BitHeader {\n bitType: BitTypeType;\n textFormat: TextFormatType;\n resourceType?: ResourceTypeType;\n bitLevel: number;\n isCommented?: boolean;\n}\n\nexport interface TrueFalseValue {\n text: string;\n isCorrect: boolean;\n example?: ExampleJson;\n __isDefaultExample: boolean;\n}\n\nexport interface CardData {\n cardIndex: number;\n cardSideIndex: number;\n cardVariantIndex: number;\n value: string;\n}\n\nexport interface BitContentProcessorResult {\n cardSet?: ParsedCardSet;\n cardBody?: Body;\n cardBodyStr?: string;\n body?: Body;\n footer?: Footer;\n imageSource?: Partial<ImageSourceJson>;\n technicalTerm?: Partial<TechnicalTermJson>;\n servings?: Partial<ServingsJson>;\n ratingLevelStart?: Partial<RatingLevelStartEndJson>;\n ratingLevelEnd?: Partial<RatingLevelStartEndJson>;\n label?: TextAst;\n person?: Partial<PersonJson>;\n propertyTitle?: BreakscapedString;\n trueFalse?: TrueFalseValue[];\n lang?: BreakscapedString;\n example?: ExampleJson;\n isCorrect?: boolean;\n markConfig?: Partial<MarkConfigJson>[];\n solutions?: string[];\n __solutionsAst?: TextAst[];\n statement?: Partial<StatementJson>;\n statements?: Partial<StatementJson>[];\n feedbackChoices?: Partial<FeedbackChoiceJson>[];\n choices?: Partial<ChoiceJson>[];\n responses?: Partial<ResponseJson>[];\n solution?: BreakscapedString;\n mark?: BreakscapedString[];\n title?: { titleAst: TextAst; titleString: string }[];\n // title?: TextAst[];\n // subtitle?: BreakscapedString;\n propertyStyleResources?: { [key: string]: ResourceJson };\n resources?: ResourceJson[];\n itemLead?: TextAst[];\n item?: JsonText;\n itemString?: string;\n lead?: TextAst;\n pageNumber?: TextAst;\n marginNumber?: TextAst;\n instruction?: TextAst;\n __instructionString?: string;\n hint?: TextAst;\n __hintString?: string;\n anchor?: string;\n book?: string | BookJson[];\n reference?: string;\n referenceEnd?: string;\n sampleSolution?: string;\n __sampleSolutionAst?: TextAst;\n additionalSolutions?: string[];\n isCaseSensitive?: boolean;\n reaction?: BreakscapedString;\n license?: string;\n copyright?: string;\n showInIndex?: boolean;\n caption?: TextAst;\n src1x?: string;\n src2x?: string;\n src3x?: string;\n src4x?: string;\n width?: string;\n height?: string;\n alt?: string;\n // duration?: BreakscapedString | BreakscapedString[]; // number? - there is a collision between duration at bit level, and duration in resource.\n mute?: boolean;\n autoplay?: boolean;\n allowSubtitles?: boolean;\n showSubtitles?: boolean;\n posterImage?: /*ImageResourceJson |*/ string;\n siteName?: string;\n imageSourceUrl?: string;\n image?: Partial<ImageResourceJson>;\n mockupId?: BreakscapedString;\n size?: number;\n format?: BreakscapedString;\n unit?: BreakscapedString;\n unitAbbr?: BreakscapedString;\n decimalPlaces?: number;\n disableCalculation?: boolean;\n\n extraProperties?: ExtraProperties;\n internalComments?: BreakscapedString[];\n\n __isDefaultExample?: boolean;\n}\n\nexport interface BitSpecificTitles {\n title?: TextAst;\n titleString?: string;\n subtitle?: TextAst;\n subtitleString?: string;\n level?: number;\n}\n\nexport interface StatementsOrChoicesOrResponses {\n statements?: Partial<StatementJson>[];\n choices?: Partial<ChoiceJson>[];\n responses?: Partial<ResponseJson>[];\n}\n\nexport interface BitSpecificCards {\n sampleSolution?: string; // ??\n elements?: string[];\n flashcards?: Partial<FlashcardJson>[];\n definitions?: Partial<DefinitionListItemJson>[];\n statements?: Partial<StatementJson>[];\n responses?: Partial<ResponseJson>[];\n feedbacks?: Partial<FeedbackJson>[];\n quizzes?: Partial<QuizJson>[];\n heading?: Partial<HeadingJson>;\n pairs?: Partial<PairJson>[];\n matrix?: Partial<MatrixJson>[];\n choices?: Partial<ChoiceJson>[];\n questions?: Partial<QuestionJson>[];\n pronunciationTable?: Partial<PronunciationTableJson>;\n table?: Partial<TableJson>;\n botResponses?: Partial<BotResponseJson>[];\n ingredients?: Partial<IngredientJson>[];\n // DEPRECATED - TO BE REMOVED IN THE FUTURE\n // captionDefinitionList?: Partial<CaptionDefinitionListJson>;\n cardBits?: Partial<CardBit>[];\n internalComments?: string[]; // ??\n}\n\nexport type BitContent = TypeValue | TypeKeyValue;\n\nexport interface TypeValue<T = unknown> extends ParserData {\n type: string;\n value?: T;\n chain?: BitContent[];\n}\n\nexport interface TypeKeyValue<T = unknown> extends ParserData {\n type: string;\n key: string;\n value?: T;\n chain?: BitContent[];\n}\n\nconst TypeKey = superenum({\n // Bit header\n TextFormat: 'TextFormat',\n ResourceType: 'ResourceType',\n\n // Tags (NOTE: ALL TAGS MUST USE THEIR CORRECT BITMARK REPRESENTATION HERE so they work with the rest of the code)\n Title: Tag.tag_title,\n Anchor: Tag.tag_anchor,\n Reference: Tag.tag_reference,\n ItemLead: Tag.tag_item,\n Instruction: Tag.tag_instruction,\n Hint: Tag.tag_hint,\n True: Tag.tag_true,\n False: Tag.tag_false,\n Gap: Tag.tag_gap,\n Mark: Tag.tag_mark,\n SampleSolution: Tag.tag_sampleSolution,\n\n // Generic Tags (converted to specific tags by the BitTagValidator)\n Property: 'Property',\n Resource: 'Resource',\n TagChain: 'TagChain',\n\n // Text\n BodyChar: 'BodyChar',\n BodyText: 'BodyText',\n BodyTextPlain: 'BodyTextPlain',\n\n // Card Set\n CardSet: 'CardSet',\n Card: 'Card',\n CardChar: 'CardChar',\n CardText: 'CardText',\n\n // Chains\n GapChain: 'GapChain',\n TrueFalseChain: 'TrueFalseChain',\n\n // Dividers\n PlainTextDivider: 'PlainTextDivider',\n FooterDivider: 'FooterDivider',\n});\n\nexport type TypeKeyType = EnumType<typeof TypeKey>;\n\nconst ContentDepth = superenum({\n Bit: 'Bit',\n Card: 'Card',\n Chain: 'Chain',\n});\n\nexport type ContentDepthType = EnumType<typeof ContentDepth>;\n\n// Card Set\n\nexport interface UnparsedCardSet {\n cards: UnparsedCard[];\n}\n\nexport interface UnparsedCard {\n sides: UnparsedCardSide[];\n}\n\nexport interface UnparsedCardSide {\n variants: UnparsedCardContent[];\n}\n\ninterface UnparsedCardContent extends ParserData {\n value: string;\n}\n\nexport interface ParsedCardSet {\n cards: ParsedCard[];\n}\n\nexport interface ParsedCard {\n sides: ParsedCardSide[];\n}\n\nexport interface ParsedCardSide {\n variants: ParsedCardContent[];\n}\n\ninterface ParsedCardContent extends ParserData {\n content: BitContent[];\n}\n\nexport interface ProcessedCardSet {\n cards: ProcessedCard[];\n internalComments: BreakscapedString[];\n}\n\nexport interface ProcessedCard {\n no: number;\n sides: ProcessedCardSide[];\n}\n\nexport interface ProcessedCardSide {\n no: number;\n variants: ProcessedCardVariant[];\n}\n\nexport interface ProcessedCardVariant extends ParserData {\n no: number;\n data: BitContentProcessorResult;\n}\n\n// Context\n\nexport interface BitmarkPegParserContext {\n bitConfig: BitConfig;\n bitType: BitTypeType;\n textFormat: TextFormatType;\n resourceType?: ResourceTypeType;\n\n DEBUG_BIT_RAW: boolean;\n DEBUG_BIT_CONTENT_RAW: boolean;\n DEBUG_BIT_CONTENT: boolean;\n DEBUG_BIT_TAGS: boolean;\n DEBUG_BODY: boolean;\n DEBUG_FOOTER: boolean;\n DEBUG_CHAIN_CONTENT: boolean;\n DEBUG_CHAIN_TAGS: boolean;\n DEBUG_CARD_SET_CONTENT: boolean;\n DEBUG_CARD_SET: boolean;\n DEBUG_CARD_TAGS: boolean;\n\n parser: ParserInfo;\n\n parse: ParseFunction;\n bitContentProcessor(\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n data: BitContent[] | undefined,\n ): BitContentProcessorResult;\n splitBitContent(bitContent: BitContent[], types: TypeKeyType[]): BitContent[][];\n addWarning(message: string, parserData?: ParserData, parserDataOriginal?: ParserData): void;\n addError(message: string, parserData?: ParserData, parserDataOriginal?: ParserData): void;\n debugPrint(header: string, data: unknown): void;\n\n // Parser global parse state\n state: object;\n}\n\nexport {\n ContentDepth as BitContentLevel,\n CARD_DIVIDER_V1,\n CARD_DIVIDER_V2,\n CARD_SIDE_DIVIDER_V1,\n CARD_SIDE_DIVIDER_V2,\n CARD_VARIANT_DIVIDER_V1,\n CARD_VARIANT_DIVIDER_V2,\n TypeKey,\n};\n","import { type ParserLocation } from '../../../model/parser/ParserLocation.ts';\nimport { type ParserLocationRange } from '../../../model/parser/ParserLocationRange.ts';\n\n/**\n * Sourced from: https://github.com/peggyjs/peggy/blob/cdf878e4ee59ab9d3e5199abb87ef34a8d7ce642/lib/grammar-location.js\n *\n * Included here to avoid having to import peggy as a dependency, as adding peggy as a dependency significantly\n * increases the size of the browser bundle (by 40kB or nearly double).\n *\n * When used as a grammarSource, allows grammars embedded in larger files to\n * specify their offset. The start location is the first character in the\n * grammar. The first line is often moved to the right by some number of\n * columns, but subsequent lines all start at the first column.\n */\nclass PeggyGrammarLocation {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public source: any;\n public start: ParserLocation;\n\n /**\n * Create an instance.\n *\n * @param {any} source The original grammarSource. Should be a string or\n * have a toString() method.\n * @param {import(\"./peg\").Location} start The starting offset for the\n * grammar in the larger file.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(source: any, start: ParserLocation) {\n this.source = source;\n this.start = start;\n }\n\n /**\n * Coerce to a string.\n *\n * @returns {string} The source, stringified.\n */\n toString(): string {\n return String(this.source);\n }\n\n /**\n * Return a new Location offset from the given location by the start of the\n * grammar.\n *\n * loc The location as if the start of the\n * grammar was the start of the file.\n * The offset location.\n */\n offset(loc: ParserLocation): ParserLocation {\n return {\n line: loc.line + this.start.line - 1,\n column: loc.line === 1 ? loc.column + this.start.column - 1 : loc.column,\n offset: loc.offset + this.start.offset,\n };\n }\n\n /**\n * If the range has a grammarSource that is a GrammarLocation, offset the\n * start of that range by the GrammarLocation.\n *\n * @param range The range to extract from.\n * @returns The offset start if possible, or the\n * original start.\n */\n static offsetStart(range: ParserLocationRange): ParserLocation {\n if (range.source && typeof range.source.offset === 'function') {\n return range.source.offset(range.start);\n }\n return range.start;\n }\n\n /**\n * If the range has a grammarSource that is a GrammarLocation, offset the\n * end of that range by the GrammarLocation.\n *\n * @param range The range to extract from.\n * @returns The offset end if possible, or the\n * original end.\n */\n static offsetEnd(range: ParserLocationRange): ParserLocation {\n if (range.source && typeof range.source.offset === 'function') {\n return range.source.offset(range.end);\n }\n return range.end;\n }\n}\n\nexport { PeggyGrammarLocation };\n","/**\n * BitmarkPegParserProcessor.ts\n * RA Sewell\n *\n * (c) 2023 Get More Brain AG\n * All rights reserved.\n *\n *\n * Debugging and Development\n * -------------------------\n *\n * - To build the parser, run 'yarn build-grammar-bit'\n * - Modify the bitmark in '_simple.bitmark' to test the parser (this will be parsed after building the parser)\n * - To undersand the operation and to help debug and develop, use the DEBUG_XXX flags in the code below\n * and in BitmarkPegParserProcessor.ts\n *\n */\n\nimport '../../../config/Config.ts';\n\nimport { Breakscape } from '../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../model/ast/BreakscapedString.ts';\nimport { type Bit } from '../../../model/ast/Nodes.ts';\nimport { CardSetVersion } from '../../../model/enum/CardSetVersion.ts';\nimport { Tag } from '../../../model/enum/Tag.ts';\nimport { TextFormat } from '../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../model/enum/TextLocation.ts';\nimport { type ParserError } from '../../../model/parser/ParserError.ts';\nimport { type ParserLocation } from '../../../model/parser/ParserLocation.ts';\nimport { StringUtils } from '../../../utils/StringUtils.ts';\nimport {\n type ParsedCard,\n type ParsedCardSet,\n type ParsedCardSide,\n type ParseFunction,\n type SubParserResult,\n type UnparsedCardSet,\n} from './BitmarkPegParserTypes.ts';\nimport {\n type BitContent,\n CARD_DIVIDER_V1,\n CARD_DIVIDER_V2,\n CARD_SIDE_DIVIDER_V1,\n CARD_SIDE_DIVIDER_V2,\n CARD_VARIANT_DIVIDER_V1,\n CARD_VARIANT_DIVIDER_V2,\n type CardData,\n type ParserHelperOptions,\n TypeKey,\n type TypeKeyType,\n type TypeValue,\n} from './BitmarkPegParserTypes.ts';\nimport { PeggyGrammarLocation } from './PeggyGrammarLocation.ts';\n\nconst ENABLE_DEBUG = true;\nconst DEBUG_DATA = true;\nconst DEBUG_DATA_INCLUDE_PARSER = false;\nconst DEBUG_TRACE_RAW_BIT = true;\nconst DEBUG_TRACE_TEXT_FORMAT = false;\nconst DEBUG_TRACE_RESOURCE_TYPE = false;\nconst DEBUG_TRACE_BIT_CONTENT = false;\nconst DEBUG_TRACE_BIT_TAG = false;\nconst DEBUG_TRACE_TAGS = false;\nconst DEBUG_TRACE_PROPERTY_TAGS = false;\nconst DEBUG_TRACE_RESOURCE_TAGS = false;\nconst DEBUG_TRACE_TAGS_CHAIN = false;\nconst DEBUG_TRACE_CARD_SET = false;\nconst DEBUG_TRACE_CARD_SET_START = false;\nconst DEBUG_TRACE_CARD_SET_END = false;\nconst DEBUG_TRACE_CARD_LINE_OR_DIVIDER = false;\nconst DEBUG_TRACE_CARD_CONTENT = false;\nconst DEBUG_TRACE_CARD_TAGS = false;\nconst DEBUG_TRACE_CARD_PARSED = true; // Print the parsed card (will create a lot of output if card value is large)\nconst DEBUG = ENABLE_DEBUG && process.env.BPG_ENV === 'development';\n\nclass BitmarkPegParserHelper {\n private cardIndex = 0;\n private cardSideIndex = 0;\n private cardVariantIndex = 0;\n\n private parse: ParseFunction;\n private parserText: () => ParserError['text'];\n private parserLocation: () => ParserError['location'];\n\n constructor(options: ParserHelperOptions) {\n this.parse = options.parse;\n this.parserText = options.parserText;\n this.parserLocation = options.parserLocation;\n }\n\n //\n // PARSING\n //\n\n handleRawBit(rawBit: string): SubParserResult<Bit> | undefined {\n const rawBitTrimmed = rawBit.trim();\n\n if (DEBUG_TRACE_RAW_BIT) this.debugPrint('RAW BIT', rawBitTrimmed);\n\n // Ignore empty bits (only happens if entire file is empty / whitespace only\n if (!rawBitTrimmed) return undefined;\n\n // Get current parser location\n const location = this.parserLocation()?.start ?? {\n line: 1,\n column: 1,\n offset: 0,\n };\n\n // Parse the raw bit\n const bitParserResult = this.parse(rawBit, {\n startRule: 'bit',\n grammarSource: new PeggyGrammarLocation('bit', location),\n }) as SubParserResult<Bit>;\n\n // Add markup to the bit result\n if (bitParserResult.value) bitParserResult.value.markup = rawBitTrimmed;\n\n return bitParserResult;\n }\n\n handleTextFormat(value: unknown): BitContent {\n if (DEBUG_TRACE_TEXT_FORMAT) this.debugPrint(TypeKey.TextFormat, value);\n return {\n type: TypeKey.TextFormat,\n value,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n handleResourceType(value: unknown): BitContent {\n if (DEBUG_TRACE_RESOURCE_TYPE) this.debugPrint(TypeKey.ResourceType, value);\n return {\n type: TypeKey.ResourceType,\n value,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n handleBitContent(value: unknown): BitContent[] {\n if (DEBUG_TRACE_BIT_CONTENT) this.debugPrint('BitContent', value);\n\n let content = this.reduceToArrayOfTypes(value);\n\n // Merge the BodyChar to BodyText\n content = this.mergeCharToText(content);\n\n return content;\n }\n\n //\n // Bit tags parsing\n //\n\n handleBitTag(value: BitContent): BitContent {\n if (DEBUG_TRACE_BIT_TAG) this.debugPrint('BitTag', value);\n return value;\n }\n\n handleTag(type: TypeKeyType, value: unknown): BitContent {\n if (DEBUG_TRACE_TAGS) this.debugPrint(type, { value });\n\n // if (type === TypeKey.Comment) {\n // debugger;\n // }\n\n return {\n type,\n key: Tag.fromValue(type),\n value,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n handlePropertyTag(key: BreakscapedString, value: unknown): BitContent {\n if (DEBUG_TRACE_PROPERTY_TAGS) this.debugPrint(TypeKey.Property, { key, value });\n\n return {\n type: TypeKey.Property,\n key: `@${Breakscape.unbreakscape(key, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n })}`,\n value,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n handleResourceTag(key: BreakscapedString, value: unknown): BitContent {\n if (DEBUG_TRACE_RESOURCE_TAGS) this.debugPrint(TypeKey.Resource, { key, value });\n\n const uKey = Breakscape.unbreakscape(key, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n });\n const camelKey = StringUtils.kebabToCamel(uKey);\n\n return {\n type: TypeKey.Resource,\n key: `&${camelKey}`,\n value,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n handleTagChain(value: unknown): BitContent[] {\n if (DEBUG_TRACE_TAGS_CHAIN) this.debugPrint('TagsChain', value);\n const content = this.reduceToArrayOfTypes(value);\n let newContent: BitContent[] = content;\n\n if (content.length > 1) {\n const head = content[0];\n head.chain = content.slice(1);\n newContent = [head];\n }\n\n return newContent;\n }\n\n //\n // Divider parsing\n //\n\n // Plain text divider\n handlePlainTextDivider(value: unknown): BitContent {\n value = this.reduceToString(value);\n\n return {\n type: TypeKey.PlainTextDivider,\n value,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n // Footer divider\n handleFooterDivider(value: unknown): BitContent {\n value = this.reduceToString(value);\n\n return {\n type: TypeKey.FooterDivider,\n value,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n //\n // Card parsing\n //\n\n handleCardSet(value: unknown): BitContent {\n if (DEBUG_TRACE_CARD_SET) this.debugPrint(TypeKey.CardSet, value);\n\n // Build card set\n const cards = value as BitContent[];\n const unparsedCardSet: UnparsedCardSet = {\n cards: [],\n };\n const cardSet: ParsedCardSet = {\n cards: [],\n };\n\n if (cards) {\n // Get current parser location\n const parser = {\n text: this.parserText(),\n location: this.parserLocation(),\n };\n\n for (const content of cards) {\n if (!content) continue;\n const { type, value: cardData, parser } = content as TypeValue;\n if (!type || type !== TypeKey.Card) continue;\n const {\n cardIndex,\n cardSideIndex,\n cardVariantIndex: cardContentIndex,\n value,\n } = cardData as CardData;\n\n // Get or create card\n let card = unparsedCardSet.cards[cardIndex];\n if (!card) {\n card = {\n sides: [],\n };\n unparsedCardSet.cards[cardIndex] = card;\n }\n\n // Get or create side\n let side = card.sides[cardSideIndex];\n if (!side) {\n side = {\n variants: [],\n };\n card.sides[cardSideIndex] = side;\n }\n\n // Set variant value\n const variant = side.variants[cardContentIndex];\n if (!variant) {\n side.variants[cardContentIndex] = {\n value,\n parser,\n };\n } else {\n side.variants[cardContentIndex].value += value;\n }\n }\n\n // Remove any completely empty cards\n unparsedCardSet.cards = unparsedCardSet.cards.filter((card) => {\n return card.sides.some((side) => {\n return side.variants.some((variant) => {\n const trimmed = StringUtils.trimmedString(variant.value);\n return trimmed.length !== 0;\n });\n });\n });\n\n // Parse the card data\n for (const unparsedCard of unparsedCardSet.cards) {\n const card = {\n sides: [],\n } as ParsedCard;\n cardSet.cards.push(card);\n for (const unparsedSide of unparsedCard.sides) {\n const side = {\n variants: [],\n } as ParsedCardSide;\n card.sides.push(side);\n for (const unparsedContent of unparsedSide.variants) {\n // Get current parser location\n // It must be modified by the length of the divider to be correct as the text in 'unparsedContent.value'\n // have the divider removed.\n let location: ParserLocation = {\n line: 1,\n column: 1,\n offset: 0,\n };\n if (unparsedContent.parser.location) {\n location = unparsedContent.parser.location.start;\n const text = unparsedContent.parser.text;\n const offsetCorrection = text ? text.length : 0;\n const lineCorrection = 1;\n location.offset += offsetCorrection;\n location.line += lineCorrection;\n }\n\n // Run the parser on the card content\n let content = this.parse(unparsedContent.value, {\n startRule: 'cardContent',\n grammarSource: new PeggyGrammarLocation('card-content', location),\n }) as BitContent[];\n\n content = this.reduceToArrayOfTypes(content);\n\n if (DEBUG_TRACE_CARD_PARSED) this.debugPrint('parsedCardContent', content);\n\n side.variants.push({\n parser,\n content,\n });\n }\n }\n }\n }\n\n return {\n type: TypeKey.CardSet,\n value: cardSet,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n handleCardSetStart() {\n if (DEBUG_TRACE_CARD_SET_START) this.debugPrint('CardSetStart');\n\n this.cardIndex = -1; // Incremented by first card divider to 0 for first card\n this.cardSideIndex = 0;\n this.cardVariantIndex = 0;\n }\n\n handleCardSetEnd() {\n if (DEBUG_TRACE_CARD_SET_END) this.debugPrint('CardSetEnd');\n // console.log('CardSetEnd');\n this.cardIndex = 0;\n this.cardSideIndex = 0;\n this.cardVariantIndex = 0;\n }\n\n handleCards(value: unknown): unknown {\n // console.log('Cards');\n return value;\n }\n\n handleCardLineOrDivider(value: unknown, version: number) {\n if (DEBUG_TRACE_CARD_LINE_OR_DIVIDER) this.debugPrint('CardLineOrDivider', value);\n\n let isCardDivider = false;\n let isSideDivider = false;\n let isVariantDivider = false;\n\n if (Array.isArray(value) && value.length === 2) {\n value = value[0];\n if (version === CardSetVersion.v1) {\n isCardDivider = value === CARD_DIVIDER_V1;\n isSideDivider = value === CARD_SIDE_DIVIDER_V1;\n isVariantDivider = value === CARD_VARIANT_DIVIDER_V1;\n } else {\n isCardDivider = value === CARD_DIVIDER_V2;\n isSideDivider = value === CARD_SIDE_DIVIDER_V2;\n isVariantDivider = value === CARD_VARIANT_DIVIDER_V2;\n }\n }\n\n if (isCardDivider) {\n this.cardIndex++;\n this.cardSideIndex = 0;\n this.cardVariantIndex = 0;\n } else if (isSideDivider) {\n this.cardSideIndex++;\n this.cardVariantIndex = 0;\n // console.log(`Card ${this.cardIndex} Side: ${value}`);\n } else if (isVariantDivider) {\n this.cardVariantIndex++;\n // console.log(`Card ${this.cardIndex}, Side ${this.cardSideIndex}, Variant: ${this.cardVariantIndex}`);\n }\n\n if (this.isType(value, TypeKey.Card)) return value;\n\n return {\n type: TypeKey.Card,\n value: {\n cardIndex: this.cardIndex,\n cardSideIndex: this.cardSideIndex,\n cardVariantIndex: this.cardVariantIndex,\n value: '',\n } as CardData,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n handleCardLine(value: unknown) {\n if (DEBUG_TRACE_CARD_LINE_OR_DIVIDER) {\n this.debugPrint(\n 'CardLine',\n `(Card ${this.cardIndex}, Side ${this.cardSideIndex}, Variant: ${this.cardVariantIndex}): ${value}`,\n );\n }\n\n return {\n type: TypeKey.Card,\n value: {\n cardIndex: this.cardIndex,\n cardSideIndex: this.cardSideIndex,\n cardVariantIndex: this.cardVariantIndex,\n value,\n } as CardData,\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n\n handleCardContent(value: BitContent[]): BitContent[] {\n if (DEBUG_TRACE_CARD_CONTENT) this.debugPrint('CardContent', value);\n\n // Merge the BodyChar to BodyText\n const content = this.mergeCharToText(value);\n\n return content;\n }\n\n handleCardTags(value: unknown): unknown {\n if (DEBUG_TRACE_CARD_TAGS) this.debugPrint('CardTags', value);\n\n return value;\n }\n\n //\n // Util functions\n //\n\n /**\n * Merge types:\n * - BodyChar => BodyText\n * - CardChar => CardText\n *\n * Any adjacent BodyChar or CardChar are merged into a single BodyText or CardText\n *\n * @param bitContent\n */\n private mergeCharToText(bitContent: BitContent[]) {\n const bc: BitContent[] = [];\n let bodyText: TypeValue | undefined;\n let cardText: TypeValue | undefined;\n\n for (const c of bitContent) {\n switch (c.type) {\n case TypeKey.BodyChar: {\n if (bodyText) {\n const val = `${bodyText.value ?? ''}${c.value ?? ''}`;\n bodyText.value = val;\n } else {\n bodyText = {\n type: TypeKey.BodyText,\n value: c.value ?? '',\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n break;\n }\n\n case TypeKey.CardChar: {\n if (cardText) {\n const val = `${cardText.value ?? ''}${c.value ?? ''}`;\n cardText.value = val;\n } else {\n cardText = {\n type: TypeKey.CardText,\n value: c.value ?? '',\n parser: {\n text: this.parserText(),\n location: this.parserLocation(),\n },\n };\n }\n break;\n }\n\n default: {\n if (bodyText) {\n bc.push(bodyText);\n bodyText = undefined;\n }\n if (cardText) {\n bc.push(cardText);\n cardText = undefined;\n }\n bc.push(c);\n }\n }\n }\n\n // Add the last bodyText or cardText\n if (bodyText) bc.push(bodyText);\n if (cardText) bc.push(cardText);\n\n return bc;\n }\n\n /**\n * Returns true if a value is a TypeKeyValue or TypeKey type with a type in the given types\n *\n * @param value The value to check\n * @param validType The type or types to check, or undefined to check for any type\n * @returns True if the value is a TypeKeyValue or TypeKey type with a type in the given types, otherwise False.\n */\n private isType(value: unknown, validType?: TypeKeyType | TypeKeyType[]): boolean {\n if (!value) return false;\n const { type } = value as TypeValue;\n\n if (!validType) {\n return !!TypeKey.fromValue(type as TypeKeyType);\n }\n if (Array.isArray(validType)) {\n return validType.indexOf(type as TypeKeyType) >= 0;\n }\n\n return validType === type;\n }\n\n /**\n * Reduce the data to type objects.\n *\n * The input data can have any structure. It will be reduced to an array of BitContent objects.\n *\n * @param data the data to reduce\n * @param validTypes types include in the reduced data\n * @param recurseIntoTypes set to true to reduce types which have array values\n * @returns an array of BitContent objects reduced from the input data\n */\n private reduceToArrayOfTypes(\n data: unknown,\n validTypes?: TypeKeyType[],\n recurseIntoTypes?: boolean,\n ): BitContent[] {\n if (!Array.isArray(data)) return [];\n\n const res = data.reduce((acc, content, _index) => {\n if (content == null) return acc;\n const { type, value } = content as TypeValue;\n\n if (Array.isArray(content)) {\n // Not a TypeKeyValue - recurse\n const subValues = this.reduceToArrayOfTypes(content, validTypes);\n acc.push(...subValues);\n } else {\n if (!this.isType(content, validTypes)) return acc;\n\n if (recurseIntoTypes && Array.isArray(value)) {\n // Not a TypeKeyValue - recurse\n const subValues = this.reduceToArrayOfTypes(value, validTypes);\n acc.push(...subValues);\n } else if (type) {\n acc.push(content);\n }\n }\n\n return acc;\n }, [] as BitContent[]);\n\n return res;\n }\n\n /**\n * Reduce the data to a string.\n *\n * The input data can have any nested array structure. It will be reduced to a single string.\n *\n * @param data the data to reduce\n * @returns a string concatenated from all the string values in the input data\n */\n private reduceToString(data: unknown): string {\n if (!Array.isArray(data)) return '';\n\n const res = data.reduce((acc, content, _index) => {\n if (content == null) return acc;\n\n if (Array.isArray(content)) {\n // An array - recurse\n const subValue = this.reduceToString(content);\n acc += subValue;\n } else {\n acc += content;\n }\n\n return acc;\n }, [] as BitContent[]);\n\n return res;\n }\n\n /**\n * Print out data for debugging\n *\n * @param header\n * @param data\n */\n private debugPrint(header: string, data?: unknown): void {\n /* STRIP:START */\n if (DEBUG) {\n if (DEBUG_DATA) {\n // Strip 'parser' out of the data, otherwise it is too verbose\n if (!DEBUG_DATA_INCLUDE_PARSER) {\n if (data != undefined) {\n data = JSON.parse(JSON.stringify(data, (k, v) => (k === 'parser' ? undefined : v)));\n }\n }\n\n console.log(`----- TRACE: ${header} -----`);\n console.log(JSON.stringify(data, null, 2));\n console.log(`----- END: ${header} -----`);\n } else {\n console.log(`- TRACE: ${header}`);\n }\n }\n /* STRIP:END */\n }\n}\n\nexport { BitmarkPegParserHelper };\n","/**\n * BitmarkPegParserValidator.ts\n * RA Sewell\n *\n * (c) 2023 Get More Brain AG\n * All rights reserved.\n *\n */\n\nimport { Config } from '../../../config/Config.ts';\nimport { type BreakscapedString } from '../../../model/ast/BreakscapedString.ts';\nimport { type Body, type BodyPart } from '../../../model/ast/Nodes.ts';\nimport { type JsonText } from '../../../model/ast/TextNodes.ts';\nimport { CardSetConfig } from '../../../model/config/CardSetConfig.ts';\nimport { ConfigKey, type ConfigKeyType } from '../../../model/config/enum/ConfigKey.ts';\nimport { type TagsConfig } from '../../../model/config/TagsConfig.ts';\nimport {\n BitTagConfigKeyType,\n type BitTagConfigKeyTypeType,\n} from '../../../model/enum/BitTagConfigKeyType.ts';\nimport { type BitTypeType } from '../../../model/enum/BitType.ts';\nimport { Count, type CountType } from '../../../model/enum/Count.ts';\nimport { type TagType } from '../../../model/enum/Tag.ts';\nimport { type TextFormatType } from '../../../model/enum/TextFormat.ts';\nimport { type ParserData } from '../../../model/parser/ParserData.ts';\nimport { type TagValidationData } from '../../../model/parser/TagValidationData.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type ParsedCardSet,\n TypeKey,\n type TypeKeyType,\n type TypeKeyValue,\n} from './BitmarkPegParserTypes.ts';\n\nconst COMMON_MISTAKE_STRINGS = [\n // Card divider errors\n '----',\n '\\n==\\n',\n '\\n---\\n',\n // Remark errors\n // Comment errors\n];\n\nconst COMMON_STARTS_WITH_MISTAKE_STRINGS = [\n // Card divider errors\n '==\\n',\n '--\\n',\n];\n\nconst COMMON_ENDS_WITH_MISTAKE_STRINGS = [\n // Card divider errors\n '\\n==',\n '\\n--',\n];\n\ninterface WarningInfo {\n invalid?: boolean; // Tag / data is not valid for this bit\n tooMany?: number; // The tag / data has been included too many times (should be at most this many times)\n tooFew?: number; // The tag / data has not been included enough times (should be at least this many times)\n extraProperty?: boolean; // The property is not recognised, but will be included as an extra property\n excessResource?: boolean; // The resource is not allowed, but will be included as an excess resource\n unexpectedCardSet?: boolean; // The card set was not expected for this bit\n unexpectedCardSideVariant?: boolean; // The card side variant is not recognised for the card set\n warning?: string;\n content?: BitContent;\n previousContent?: ParserData | undefined;\n}\n\ninterface ValidateReturn {\n content?: BitContent | undefined;\n warning?: WarningInfo;\n}\n\ninterface ValidateSingleTagReturn {\n validated: BitContent | undefined;\n warning?: WarningInfo;\n}\n\ninterface ValidateChainRecursiveReturn {\n validated: BitContent[];\n remaining?: BitContent; // Tag split off from the chain\n}\n\nclass BitmarkPegParserValidator {\n /**\n * Validate the bit tags and tag chains.\n *\n * Any unknown tag chains will be 'unchained' and processed as individual tags.\n *\n * @param context\n * @param bitType\n * @param resourceType the resource type specified in the bit header\n * @param data the unvalidated bit content from the parser\n *\n * @returns the validated and potentially unchained bit content\n */\n validateBitTags(context: BitmarkPegParserContext, data: BitContent[]): BitContent[] {\n // if (context.DEBUG_BIT_TAG_VALIDATION) context.debugPrint('bit tag validation', data);\n if (!data) return [];\n\n const { bitConfig, bitType, resourceType } = context;\n\n // Get the bit config to check how to parse the bit\n\n const { tags: bitTags, cardSet: cardSetConfig } = bitConfig;\n\n // Insert the resource tags from the resources config (which can depends on the resource type attachment in the bit header).\n const resourcesConfig = Config.getBitResourcesConfig(bitType, resourceType);\n const tags = { ...bitTags, ...resourcesConfig.tags };\n\n // Validate and convert the tag chains\n const res: BitContent[] = this.validateTagChainsRecursive(\n context,\n BitContentLevel.Bit,\n bitType,\n data,\n tags,\n cardSetConfig,\n ).validated;\n\n // TODO: Check the minimum counts\n // const minCount = tagData.minCount == null ? 0 : tagData.minCount;\n\n return res;\n }\n\n /**\n * Check the body of the bit.\n *\n * This function also converts the body to JSON if the text format is JSON.\n *\n * @param context\n * @param bitType\n * @param _contentDepth\n * @param body\n * @returns\n */\n checkBody(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n bitType: BitTypeType,\n _textFormat: TextFormatType,\n bodyParts: BodyPart[] | undefined,\n ): BodyPart[] | undefined {\n if (!bodyParts) return bodyParts;\n\n const { bitConfig } = context;\n\n // Get the bit config to check how to parse the bit\n\n const { bodyAllowed } = bitConfig;\n\n const hasBody = bodyParts.length > 0;\n\n if (hasBody && !bodyAllowed) {\n context.addWarning(`Bit '${bitType}' should not have a body.`);\n }\n\n return bodyParts;\n }\n\n /**\n * Check the body part of the bit.\n *\n * @param context\n * @param _contentDepth\n * @param bitType\n * @param body\n * @returns\n */\n checkBodyPart(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n bodyPart: BreakscapedString,\n ): BreakscapedString {\n if (!bodyPart) return bodyPart;\n\n this.checkBodyForCommonPotentialMistakes(context, contentDepth, bodyPart);\n\n return bodyPart;\n }\n\n /**\n * Check the footer of the bit.\n *\n * @param context\n * @param _contentDepth\n * @param bitType\n * @param body\n * @returns\n */\n checkFooter(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n footer: BreakscapedString,\n ): BreakscapedString {\n if (!footer) return footer;\n\n const { bitConfig, bitType } = context;\n\n // Get the bit config to check how to parse the bit\n const { footerAllowed } = bitConfig;\n\n this.checkBodyForCommonPotentialMistakes(context, contentDepth, footer);\n\n if (!footerAllowed) {\n context.addWarning(`Bit '${bitType}' should not have a footer.`);\n }\n\n return footer;\n }\n\n /**\n * Check the footer of the bit.\n *\n * @param context\n * @param _contentDepth\n * @param bitType\n * @param cardBody\n * @returns\n */\n checkCardBody(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n bitType: BitTypeType,\n cardBody: Body | undefined,\n cardNo: number,\n sideNo: number,\n variantNo: number,\n ): Body | undefined {\n if (!cardBody || !cardBody.body) return cardBody;\n\n const { bitConfig } = context;\n\n // Get the bit config to check how to parse the bit\n if (!bitConfig.cardSet) return cardBody; // Won't happen. Just to make TS happy\n\n const variantConfig = Config.getCardSetVariantConfig(bitType, sideNo, variantNo);\n if (!variantConfig) return cardBody; // Won't happen. Just to make TS happy\n\n const { bodyAllowed } = variantConfig;\n\n const hasBody = (cardBody.bodyString as JsonText).length > 0;\n\n // this.checkBodyForCommonPotentialMistakes(context, contentDepth, bitType, cardBody);\n\n if (hasBody && !bodyAllowed) {\n context.addWarning(\n `Bit '${bitType}' should not have a card body at card:${cardNo + 1}, side:${sideNo + 1}, variant:${\n variantNo + 1\n }.`,\n );\n }\n\n return cardBody;\n }\n\n //\n // Private\n //\n\n /**\n * Validate tag chains as they are encountered, expanding any tag chains that are not valid,\n * so they can be processed as individual tags.\n *\n * @param context\n * @param contentDepth\n * @param bitType\n * @param data\n * @param tags\n * @param cardSetConfig\n */\n private validateTagChainsRecursive(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n bitType: BitTypeType,\n data: BitContent[],\n tags: TagsConfig,\n cardSetConfig?: CardSetConfig,\n chainHeadType?: TypeKeyType,\n ): ValidateChainRecursiveReturn {\n if (!data) {\n return {\n validated: [],\n };\n }\n\n let remaining: BitContent | undefined;\n const dataOrNull: (BitContent | null)[] = [...data];\n\n // Get valid type keys from the tags\n const validTypeKeys = this.convertTagsToTypeKeyMap(context, contentDepth, bitType, tags);\n\n // Helper function for add extra valid type keys\n const addExtraValidTypeKeys = (key: TypeKeyType, maxCount: CountType, minCount: number) => {\n validTypeKeys.set(key, {\n maxCount,\n minCount,\n _type: key as BitTagConfigKeyTypeType,\n _tag: key as TagType,\n _seenCount: 0,\n });\n };\n\n if (contentDepth === BitContentLevel.Bit) {\n // Add the extra valid tags dependent on bit configuration\n if (cardSetConfig) addExtraValidTypeKeys(TypeKey.CardSet, 1, 0);\n\n // These tags are always allowed here, and validated later\n addExtraValidTypeKeys(TypeKey.TextFormat, 1, 0);\n addExtraValidTypeKeys(TypeKey.BodyText, Count.infinity, 0);\n addExtraValidTypeKeys(TypeKey.BodyTextPlain, Count.infinity, 0);\n addExtraValidTypeKeys(TypeKey.PlainTextDivider, Count.infinity, 0);\n addExtraValidTypeKeys(TypeKey.FooterDivider, Count.infinity, 0); // No warning for multiple footers, just ignore\n } else if (contentDepth === BitContentLevel.Card) {\n // These tags are always allowed here, and validated later\n addExtraValidTypeKeys(TypeKey.CardText, Count.infinity, 0);\n }\n\n // const end = data.length;\n for (let i = 0; i < dataOrNull.length; i++) {\n const content = dataOrNull[i];\n if (!content) continue;\n\n const { type, key } = content as TypeKeyValue;\n let typeKey = TypeKey.fromValue(type);\n if (!typeKey) continue; // Should not happen\n\n // Build the final valid type key which is the key for property / resources\n let validTypeKey: TypeKeyType | string | undefined = typeKey;\n if (typeKey === TypeKey.Property || typeKey === TypeKey.Resource) {\n validTypeKey = key;\n }\n\n // Get the tag data for this tag type and key. If not found, the tag is not valid\n let tagData = validTypeKeys.get(validTypeKey);\n\n // Support [@ fallback to [&:\n // See: https://github.com/getMoreBrain/cosmic/issues/7859\n // In the case of a property tag that is not found, convert it to a resource tag and retry\n // Only for specific tags. This is to support legacy tags for a short period and will be removed in the future\n // (support @ instead of & for resources)\n if (!tagData && typeKey === TypeKey.Property) {\n const resourceKey = key.replace(/^@/, '&') as ConfigKeyType;\n if (\n resourceKey === ConfigKey.resource_backgroundWallpaper ||\n resourceKey === ConfigKey.resource_imagePlaceholder\n ) {\n tagData = validTypeKeys.get(resourceKey);\n if (tagData) {\n typeKey = TypeKey.Resource;\n content.type = TypeKey.Resource;\n\n const warningMsg = `Falling back to '[${resourceKey}]' from '[${key}]'. Replace '[${key}]' with '[&${key}]' to avoid this warning.`;\n context.addWarning(warningMsg);\n }\n }\n }\n\n // Validate the single tag\n const { validated: validatedTagContent, warning } = this.validateSingleTag(\n context,\n contentDepth,\n bitType,\n content,\n typeKey,\n tagData,\n cardSetConfig,\n );\n\n // HACK to handle 'chain-within-chain' for [@person] tags (at least to stop the parser splitting the chain)\n if (typeKey === TypeKey.Resource) chainHeadType = TypeKey.Resource;\n\n // Tag is not valid in this position. Either remove it or reprocess by breaking the current chain\n let addWarning = true;\n if (!validatedTagContent) {\n if (contentDepth === BitContentLevel.Chain && chainHeadType !== TypeKey.Resource) {\n // If in a chain and the tag is invalid within the chain then break the chain and re-process the tag as a\n // single tag with the rest of the chain as a chain [excluding resource chains].\n remaining = content;\n const restOfChain = dataOrNull.slice(i + 1);\n if (restOfChain.length > 0) {\n remaining.chain = restOfChain as BitContent[];\n }\n\n // Remove the data from the current chain\n dataOrNull.splice(i);\n\n // Ignore the generated warning from validateSingleTag as the tag will be reprocessed and will then\n // be valid or will generated a warning there\n addWarning = false;\n } else {\n // The tag is not valid, and either this is not a chain or not a resource chain.\n\n // Remove the tag from the data\n dataOrNull.splice(i, 1, null);\n }\n }\n\n // Add the warning generated by validateSingleTag\n if (warning && addWarning) {\n context.addWarning(warning.warning ?? '', warning.content, warning.previousContent);\n }\n\n // If the content does not have a chain, but the validation data does have a chain, and there are still more\n // items in this chain, then the remaining items should be considered a sub-chain and processed as such.\n // Split the remaining items off from the current chain and process them as a separate chain.\n if (\n contentDepth === BitContentLevel.Chain &&\n tagData &&\n tagData.chain &&\n validatedTagContent &&\n !validatedTagContent.chain\n ) {\n const restOfChain = dataOrNull.slice(i + 1);\n if (restOfChain.length > 0) {\n validatedTagContent.chain = restOfChain as BitContent[];\n }\n dataOrNull.splice(i + 1);\n }\n\n // If the content has a chain, but the validation data does not have a chain, then the chain is invalid\n // The chain is split off from the single tag for further processing.\n // This allows non-chained tags to be compressed into a chain without breaking the behaviour, and makes the\n // parser more forgiving.\n if (\n validatedTagContent &&\n Array.isArray(validatedTagContent.chain) &&\n validatedTagContent.chain.length > 0\n ) {\n if (tagData && tagData.chain) {\n const { validated: validatedTagChainContent, remaining: remainingTagChainContent } =\n this.validateTagChainsRecursive(\n context,\n BitContentLevel.Chain,\n bitType,\n validatedTagContent.chain,\n tagData.chain,\n undefined,\n validatedTagContent.type as TypeKeyType,\n );\n if (validatedTagChainContent && validatedTagChainContent.length > 0) {\n validatedTagContent.chain = validatedTagChainContent;\n } else {\n // Tag chain is invalid, remove it\n validatedTagContent.chain = undefined;\n }\n\n // If there is remaining tag chain content to process, insert it into the data\n if (remainingTagChainContent) {\n dataOrNull.splice(i + 1, 0, remainingTagChainContent);\n }\n } else {\n // Tag does not have a chain in the bit config. Split the chain and process as a separate chain.\n // This allows for 'bugs' such as [%item][%lead][!instruction] - instruction still works.\n if (validatedTagContent.type !== TypeKey.Resource) {\n // Build the 'split-off' bit content\n const remainingTagChainContent: BitContent = validatedTagContent.chain[0];\n if (validatedTagContent.chain.length > 1) {\n remainingTagChainContent.chain = validatedTagContent.chain.slice(1);\n }\n dataOrNull.splice(i + 1, 0, remainingTagChainContent);\n // Clear the original chain\n validatedTagContent.chain = undefined;\n }\n }\n }\n }\n\n // Raise warnings for the minimum counts\n for (const data of validTypeKeys.values()) {\n const { minCount, _seenCount } = data;\n if (minCount != null && _seenCount < minCount) {\n const warningMsg = `${this.getTagSignature(data)} is required at least ${minCount} time(s)`;\n context.addWarning(warningMsg);\n }\n }\n\n // Filter all the null's from the validated tags\n const res = dataOrNull.filter((content) => content != null) as BitContent[];\n\n return {\n validated: res,\n remaining,\n };\n }\n\n /**\n * Validate a single bit tag\n *\n * @param context\n * @param contentDepth\n * @param bitType\n * @param content\n * @param typeKey\n * @param tagValidationData\n * @param cardSetConfig\n *\n * @returns validated tag, or undefined if the tag is invalid\n */\n private validateSingleTag(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n bitType: BitTypeType,\n content: BitContent,\n typeKey: TypeKeyType,\n tagValidationData: TagValidationData | undefined,\n cardSetConfig: CardSetConfig | undefined,\n ): ValidateSingleTagReturn {\n // if (context.DEBUG_BIT_TAG_VALIDATION) context.debugPrint('bit tag validation', data);\n\n const { type, key } = content as TypeKeyValue;\n\n const keyStr = tagValidationData\n ? this.getTagSignature(tagValidationData)\n : this.getUnknownTagSignature(type, key);\n const ignoredStr = ' It will be ignored';\n let warningStr = '';\n let validatedContent: BitContent | undefined;\n let warning: WarningInfo | undefined;\n\n // // Get seen data from the seen cache\n // let seen = seenTypeKeys.get(typeKeyPlusKey);\n // if (seen == undefined) {\n // seen = {\n // count: 0,\n // };\n // seenTypeKeys.set(typeKeyPlusKey, seen);\n // }\n\n // let previousContent = seen.previous;\n // seen.count++;\n\n if (tagValidationData) {\n // Increment the seen count for this tag\n tagValidationData._seenCount++;\n\n // This type key is valid. Now check if it's been seen before and if so, how many times\n switch (typeKey) {\n case TypeKey.Property: {\n const { content: c, warning: w } = this.validatePropertyTag(\n context,\n contentDepth,\n bitType,\n tagValidationData,\n content as TypeKeyValue,\n );\n validatedContent = c;\n warning = w;\n break;\n }\n\n case TypeKey.Resource: {\n const { content: c, warning: w } = this.validateResourceTag(\n context,\n contentDepth,\n bitType,\n tagValidationData,\n content as TypeKeyValue,\n );\n validatedContent = c;\n warning = w;\n break;\n }\n\n case TypeKey.CardSet: {\n const { content: c, warning: w } = this.validateCardSet(\n context,\n bitType,\n tagValidationData,\n content as TypeKeyValue,\n cardSetConfig,\n );\n validatedContent = c;\n warning = w;\n break;\n }\n\n default: {\n const { content: c, warning: w } = this.validateStandardTag(\n context,\n contentDepth,\n bitType,\n tagValidationData,\n content as TypeKeyValue,\n );\n validatedContent = c;\n warning = w;\n }\n }\n } else {\n // type is not valid as no tag data exists for it\n switch (typeKey) {\n case TypeKey.Property: {\n // The property is not valid for this bit type, but since we allow extra properties, we will return it as\n // ok but with a warning\n warning = { extraProperty: true };\n if (contentDepth !== BitContentLevel.Chain) {\n validatedContent = content; // Add tag anyway - we don't remove extra properties (unless in chain)\n }\n break;\n }\n\n case TypeKey.Resource: {\n warning = { excessResource: true };\n validatedContent = content; // Add tag anyway, will be added as an excess resource\n break;\n }\n\n default:\n warning = { invalid: true };\n }\n }\n\n // Add a warning if there is one\n if (warning) {\n const previousContent = tagValidationData?._previous;\n\n // TODO - warning and ignore\n if (warning.invalid || warning.excessResource) {\n warningStr = `${keyStr} is not valid here (incorrectly chained?).${ignoredStr}`;\n } else if (warning.tooMany != null) {\n warningStr = `${keyStr} is included more than ${warning.tooMany} time(s).`;\n if (warning.tooMany > 0) warningStr += ' The earlier ones will be ignored';\n // } else if (warning.tooFew != null) {\n // warningStr = `'${type}'${keyStr} is not included enough times(s). It should be included ${warning.tooFew} time(s)`;\n } else if (warning.extraProperty) {\n warningStr = `${keyStr} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`;\n } else if (warning.unexpectedCardSet) {\n warningStr = `${keyStr} is not expected here.${ignoredStr}`;\n } else if (warning.unexpectedCardSideVariant) {\n warningStr = `${keyStr} has a card / side / variant that is not expected here.${ignoredStr}`;\n }\n\n warning.warning = warningStr;\n warning.content = validatedContent;\n warning.previousContent = previousContent;\n }\n\n // Update the seen data\n if (tagValidationData) {\n tagValidationData._previous = content;\n }\n\n return {\n validated: validatedContent,\n warning,\n };\n }\n\n /**\n * Validates a standard bit tag\n *\n * @param context\n * @param bitLevel\n * @param bitType\n * @param tagValidationData\n * @param content\n * @param seen\n *\n * @returns validated tag (plus warning message if one is generated) or undefined if the tag is invalid\n */\n private validateStandardTag(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _bitType: BitTypeType,\n tagValidationData: TagValidationData,\n content: TypeKeyValue,\n ): ValidateReturn {\n // Check if the property is valid for this bit type\n\n const validCount = tagValidationData.maxCount == null ? 1 : tagValidationData.maxCount;\n\n // If validCount is infinity, an infinite number of this type is allowed\n if (validCount !== Count.infinity) {\n if (tagValidationData._seenCount > validCount) {\n return {\n warning: { tooMany: validCount },\n content: content, // Return content anyway when too many, as last wins\n };\n }\n }\n\n // If we get here, the property is valid and can be added\n return {\n content: content,\n };\n }\n\n /**\n * Validates a single property tag\n *\n * @param context\n * @param bitLevel\n * @param bitType\n * @param tagValidationData\n * @param content\n * @param seen\n *\n * @returns validated tag (plus warning message if one is generated) or undefined if the tag is invalid\n */\n private validatePropertyTag(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _bitType: BitTypeType,\n tagValidationData: TagValidationData,\n content: TypeKeyValue,\n ): ValidateReturn {\n // Check if the property is valid for this bit type\n\n const validCount = tagValidationData.maxCount == null ? 1 : tagValidationData.maxCount;\n\n // If validCount is infinity, an infinite number of this type is allowed\n if (validCount !== Count.infinity) {\n if (tagValidationData._seenCount > validCount) {\n return {\n warning: { tooMany: validCount },\n content: content, // Return content anyway when too many, as last wins\n };\n }\n }\n\n // If we get here, the property is valid and can be added\n return {\n content: content,\n };\n }\n\n /**\n * Validates a single resource tag\n *\n * @param context\n * @param bitLevel\n * @param bitType\n * @param tagValidationData\n * @param content\n * @param seen\n *\n * @returns validated tag (plus warning message if one is generated) or undefined if the tag is invalid\n */\n private validateResourceTag(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _bitType: BitTypeType,\n tagValidationData: TagValidationData,\n content: TypeKeyValue,\n ): ValidateReturn {\n // Check if the resource is valid for this bit type\n\n const validCount = tagValidationData.maxCount == null ? 1 : tagValidationData.maxCount;\n\n // If validCount is infinity, an infinite number of this type is allowed\n if (validCount !== Count.infinity) {\n if (tagValidationData._seenCount > validCount) {\n return {\n warning: { tooMany: validCount },\n content: content, // Return content anyway when too many, as last wins\n };\n }\n }\n\n // If we get here, the property is valid and can be added\n return {\n content: content,\n };\n }\n\n /**\n * Validates a card set\n *\n * @param context\n * @param bitLevel\n * @param bitType\n * @param _tagValidationData\n * @param content\n * @param cardSetConfig\n * @param depth recursion depth\n *\n * @returns validated tag (plus warning message if one is generated) or undefined if the tag is invalid\n */\n private validateCardSet(\n context: BitmarkPegParserContext,\n bitType: BitTypeType,\n _tagValidationData: TagValidationData,\n content: TypeKeyValue,\n cardSetConfig: CardSetConfig | undefined,\n ): ValidateReturn {\n // if (context.DEBUG_BIT_TAG_VALIDATION) context.debugPrint('bit tag validation', data);\n\n if (!cardSetConfig || !cardSetConfig.variants || cardSetConfig.variants.length === 0) {\n // Card set exists with no card set config for the bit\n return {\n warning: { unexpectedCardSet: true },\n };\n }\n\n const { value } = content;\n const cardSet = value as ParsedCardSet;\n let warning: WarningInfo | undefined;\n\n // For each of the variants in the card set, validate its contents\n let sideIndex = 0;\n let variantIndex = 0;\n for (const card of cardSet.cards) {\n sideIndex = 0;\n for (const side of card.sides) {\n variantIndex = 0;\n for (const variant of side.variants) {\n const variantContent = variant.content;\n let validatedContent: BitContent[] | undefined;\n const variantConfig = Config.getCardSetVariantConfig(bitType, sideIndex, variantIndex);\n\n if (variantConfig) {\n // Validate the variant against the config\n const res = this.validateTagChainsRecursive(\n context,\n BitContentLevel.Card,\n bitType,\n variantContent,\n variantConfig.tags,\n );\n validatedContent = res.validated;\n } else {\n // TODO - warning!\n warning = {\n unexpectedCardSideVariant: true,\n };\n }\n\n // TODO - add the validated content to the card set, or remove the invalid variant\n if (validatedContent && validatedContent.length > 0) {\n side.variants[variantIndex] = {\n parser: variant.parser,\n content: validatedContent,\n };\n } else {\n // Variant is invalid, remove it\n side.variants[variantIndex] = {\n parser: variant.parser,\n content: [],\n };\n }\n\n variantIndex++;\n }\n sideIndex++;\n }\n }\n\n return {\n content: content,\n warning,\n };\n }\n\n /**\n * Check the body of the bit for patterns which indicate common potential bitmark language mistakes.\n *\n * @param context\n * @param _contentDepth\n * @param bitType\n * @param body\n * @returns\n */\n private checkBodyForCommonPotentialMistakes(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n body: string,\n ): void {\n if (!body) return;\n\n const { bitType } = context;\n\n for (const mistake of COMMON_MISTAKE_STRINGS) {\n if (body.includes(mistake)) {\n context.addWarning(`Bit '${bitType}' might contain a mistake: ${mistake}`);\n }\n }\n\n for (const mistake of COMMON_STARTS_WITH_MISTAKE_STRINGS) {\n if (body.startsWith(mistake)) {\n context.addWarning(`Bit '${bitType}' might contain a mistake: ${mistake}`);\n }\n }\n\n for (const mistake of COMMON_ENDS_WITH_MISTAKE_STRINGS) {\n if (body.endsWith(mistake)) {\n context.addWarning(`Bit '${bitType}' might contain a mistake: ${mistake}`);\n }\n }\n }\n\n /**\n * Convert the tag data configuration to TypeKeys\n *\n * @param context\n * @param _contentDepth\n * @param bitType\n * @param tags\n * @param depth recursion depth\n * @returns\n */\n private convertTagsToTypeKeyMap(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _bitType: BitTypeType,\n tags: TagsConfig,\n ): Map<TypeKeyType | string, TagValidationData> {\n // Using a map here as we might add the 'count' of tags valid at a later stage\n const res = new Map<TypeKeyType | string, TagValidationData>();\n\n // Add the tags\n for (const v of Object.values(tags)) {\n // Save the key in the TagData\n const tagValidationData: TagValidationData = {\n minCount: v.minCount,\n maxCount: v.maxCount,\n isTag: v.type === BitTagConfigKeyType.tag,\n isProperty: v.type === BitTagConfigKeyType.property,\n isResource: v.type === BitTagConfigKeyType.resource,\n chain: v.chain,\n\n // Private\n _configKey: v.configKey,\n _type: v.type,\n _tag: v.tag,\n _seenCount: 0,\n _previous: undefined,\n };\n\n if (tagValidationData.isProperty) {\n res.set(v.configKey, tagValidationData);\n } else if (tagValidationData.isResource) {\n res.set(v.configKey, tagValidationData);\n } else {\n // Take advantage of the same naming convention (dangerous - should be improved)\n const typeKey = TypeKey.fromValue(v.tag);\n if (typeKey) {\n res.set(typeKey, tagValidationData);\n }\n }\n }\n\n return res;\n }\n\n private getTagSignature(tagValidationData: TagValidationData): string {\n switch (tagValidationData._type) {\n case BitTagConfigKeyType.tag:\n case BitTagConfigKeyType.property:\n case BitTagConfigKeyType.resource:\n return `[${tagValidationData._configKey}]`;\n default:\n return `'${tagValidationData._type}' tag '${tagValidationData._tag}'`;\n }\n }\n\n private getUnknownTagSignature(type: string, tag: string): string {\n switch (type) {\n case TypeKey.Property:\n case TypeKey.Resource:\n return `[${tag}]`;\n default:\n return tag ? `'${type}' tag '${tag}'` : `'${type}' tag`;\n }\n }\n}\n\nconst instance = new BitmarkPegParserValidator();\n\nexport { instance as BitmarkPegParserValidator };\n","import {\n type JsonText,\n type TextNode,\n type TextNodeAttibutes,\n} from '../../../../model/ast/TextNodes.ts';\nimport { TextNodeType } from '../../../../model/enum/TextNodeType.ts';\n\nclass ContentProcessorUtils {\n /**\n * Concatenates a plain JSON text with a JsonText that may be plain (v2) or BitmarkText (v3)\n * Returns the combined text.\n *\n * @param text the text to concatenate\n * @param extraBreaks extra breaks to add between concatenated texts\n * @param textPlain the plain text to concatenate\n */\n public concatenatePlainTextWithAstTexts(\n text: JsonText,\n extraBreaks: number,\n textPlain: string,\n ): JsonText {\n if (Array.isArray(text)) {\n textPlain = textPlain && textPlain.trim();\n if (textPlain) {\n const splitText = textPlain.split('\\n');\n const content: TextNode[] = [];\n\n for (let i = 0; i < extraBreaks; i++) {\n content.push({\n type: TextNodeType.hardBreak,\n });\n }\n\n for (let i = 0; i < splitText.length; i++) {\n const t = splitText[i];\n if (t) {\n content.push({\n text: t,\n type: TextNodeType.text,\n });\n }\n // Add a hard break after each paragraph, except the last one\n if (i < splitText.length - 1) {\n content.push({\n type: TextNodeType.hardBreak,\n });\n }\n }\n\n // Add the content to the final paragraph, or create a new one if there none\n const lastNode = text[text.length - 1];\n if (lastNode && lastNode.type === TextNodeType.paragraph) {\n lastNode.content = [...(lastNode.content ?? []), ...content];\n } else {\n text.push({\n type: TextNodeType.paragraph,\n content,\n attrs: {} as TextNodeAttibutes,\n });\n }\n }\n return text;\n }\n\n return `${text ?? ''}${'\\n'.repeat(extraBreaks)}${textPlain ?? ''}`;\n }\n}\n\nconst instance = new ContentProcessorUtils();\nexport { instance as ContentProcessorUtils };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type Body, type BodyPart } from '../../../../model/ast/Nodes.ts';\nimport { type JsonText, type TextAst } from '../../../../model/ast/TextNodes.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { type BitTypeType } from '../../../../model/enum/BitType.ts';\nimport { BodyBitType } from '../../../../model/enum/BodyBitType.ts';\nimport { TextFormat, type TextFormatType } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport {\n type BodyBitJson,\n type GapJson,\n type HighlightJson,\n type MarkJson,\n type SelectJson,\n} from '../../../../model/json/BodyBitJson.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\nimport { BitmarkPegParserValidator } from '../BitmarkPegParserValidator.ts';\nimport { ContentProcessorUtils } from './ContentProcessorUtils.ts';\n\nexport interface BodyText extends BodyPart {\n type: 'text';\n data: {\n bodyText: BreakscapedString;\n isPlain: boolean;\n };\n}\n\nconst textParser = new TextParser();\n\nclass BodyContentProcessor {\n public process(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n bitType: BitTypeType,\n textFormat: TextFormatType,\n _tagsConfig: TagsConfig | undefined,\n _target: BitContentProcessorResult,\n bodyParts: BodyPart[],\n isCardBody: boolean,\n ): Partial<Body> | undefined {\n const bodyBits: BodyBitJson[] = [];\n let finalBody: JsonText | unknown | undefined;\n let finalBodyString: string | undefined;\n //\n const trimmedBodyParts = bodyParts.length > 0 ? this.trimBodyParts(bodyParts) : undefined;\n const validatedBodyParts = isCardBody\n ? trimmedBodyParts\n : BitmarkPegParserValidator.checkBody(\n context,\n contentDepth,\n bitType,\n textFormat,\n trimmedBodyParts,\n );\n\n // If the text format is JSON, check the body is valid JSON\n // In this case, the body will already have been 'squashed' so will not contain any parsed inline body tags\n if (textFormat === TextFormat.json && validatedBodyParts) {\n finalBody = validatedBodyParts.reduce((acc, val) => {\n if (val.type === BodyBitType.text && val.data) {\n const bodyTextVal = val as BodyText;\n return (acc + (bodyTextVal.data.bodyText ?? '')) as string;\n }\n return acc;\n }, '');\n try {\n finalBody = JSON.parse(finalBody as string);\n } catch (_e) {\n finalBody = null;\n context.addError(`Body JSON is invalid.`);\n }\n } else {\n // Standard body\n\n let bodyTextStr: BreakscapedString = '' as BreakscapedString;\n let plainBodyTextStr: BreakscapedString = '' as BreakscapedString;\n let bodyStr: BreakscapedString = '' as BreakscapedString;\n let placeholderIndex = 0;\n\n // Function for creating the placeholder keys\n const createPlaceholderKey = (i: number): BreakscapedString => `[!${i}]` as BreakscapedString;\n\n // Loop the text bodyParts creating full body text with the correct placeholders\n //\n // fullBodyTextStr:\n // - is created and passed into the text parser to create the body text AST\n // - has placeholders inserted into 'fullBodyTextStr' in the format [!0] to allow the text parser to identify\n // where the body bits should be inserted.\n //\n if (validatedBodyParts) {\n for (let i = 0; i < validatedBodyParts.length; i++) {\n const bodyPart = validatedBodyParts[i];\n\n const isText = bodyPart.type === BodyBitType.text;\n\n if (isText) {\n const asText = bodyPart as BodyText;\n const bodyTextPart = asText.data.bodyText;\n\n // Append the text part to the full text body\n if (asText.data.isPlain) {\n plainBodyTextStr = Breakscape.concatenate(plainBodyTextStr, bodyTextPart);\n } else {\n bodyTextStr = Breakscape.concatenate(bodyTextStr, bodyTextPart);\n }\n bodyStr = Breakscape.concatenate(bodyStr, bodyTextPart);\n } else {\n const placeholderKey = createPlaceholderKey(placeholderIndex);\n\n // Append the placeholder to the full text body\n bodyTextStr = Breakscape.concatenate(bodyTextStr, placeholderKey);\n\n // Add the body bit to the body bits\n bodyBits.push(bodyPart as BodyBitJson);\n\n placeholderIndex++;\n }\n }\n }\n\n // Create the body text AST\n const isBitmarkText = textFormat === TextFormat.bitmarkText;\n\n const parsedBodyText: JsonText = isBitmarkText\n ? textParser.toAst(bodyTextStr, {\n //\n format: textFormat,\n location: TextLocation.body,\n })\n : Breakscape.unbreakscape(bodyTextStr, {\n format: TextFormat.plainText,\n location: TextLocation.body,\n });\n\n const parserPlainText: JsonText = Breakscape.unbreakscape(plainBodyTextStr, {\n format: TextFormat.plainText,\n location: TextLocation.body,\n });\n\n // Newlines will have been lost from the end of bodyTextStr, and start of plainBodyTextStr\n // Count then and add them back when merging\n const newlines =\n StringUtils.countOccurrencesAtEnd(bodyTextStr, '\\n') +\n StringUtils.countOccurrencesAtStart(plainBodyTextStr, '\\n');\n\n finalBody = ContentProcessorUtils.concatenatePlainTextWithAstTexts(\n parsedBodyText,\n newlines,\n parserPlainText,\n );\n finalBodyString = Breakscape.unbreakscape(bodyStr, {\n format: textFormat,\n location: TextLocation.body,\n }).trim() as BreakscapedString;\n const finalBodyIsAst = Array.isArray(finalBody);\n const bodyAst = finalBodyIsAst ? (finalBody as TextAst) : undefined;\n\n // Loop the body parts again to create the body bits:\n // - The body bits are inserted into body AST, replacing the placeholders created by the text parser\n if (bodyAst && validatedBodyParts) {\n placeholderIndex = 0;\n for (let i = 0; i < validatedBodyParts.length; i++) {\n const bodyPart = validatedBodyParts[i];\n\n // Skip text body parts as they are handled above\n const isText = bodyPart.type === BodyBitType.text;\n if (isText) continue;\n\n const bodyBit = bodyPart as BodyBitJson;\n let bodyBitJson: BodyBitJson | undefined;\n\n switch (bodyPart.type) {\n case BodyBitType.gap: {\n // const gap = bodyBit as Gap;\n // bodyBitJson = this.createGapJson(gap);\n bodyBitJson = bodyBit as GapJson;\n break;\n }\n\n case BodyBitType.mark: {\n // const mark = bodyBit as Mark;\n // bodyBitJson = this.createMarkJson(mark);\n bodyBitJson = bodyBit as MarkJson;\n break;\n }\n\n case BodyBitType.select: {\n // const select = bodyBit as SelectJson;\n // bodyBitJson = this.createSelectJson(select);\n bodyBitJson = bodyBit as SelectJson;\n break;\n }\n\n case BodyBitType.highlight: {\n // const highlight = bodyBit as Highlight;\n // bodyBitJson = this.createHighlightJson(highlight);\n bodyBitJson = bodyBit as HighlightJson;\n break;\n }\n }\n\n // Add the gap to the placeholders\n if (bodyBitJson) {\n // Insert the body bit into the body AST\n this.replacePlaceholderWithBodyBit(bodyAst, bodyBitJson, placeholderIndex);\n }\n\n placeholderIndex++;\n }\n }\n } // Standard body\n\n // Return the body in the target\n return {\n body: finalBody,\n bodyBits: bodyBits.length > 0 ? bodyBits : undefined,\n bodyString: finalBodyString,\n };\n }\n\n public buildBodyText(bodyTextPart: BreakscapedString, isPlain: boolean): BodyText {\n const bodyText: BodyText = {\n type: BodyBitType.text,\n data: {\n bodyText: bodyTextPart,\n isPlain,\n },\n };\n return bodyText;\n }\n\n /**\n * Walk the body AST to find the placeholder and replace it with the body bit.\n *\n * @param bodyAst the body AST\n * @param bodyBitJson the body bit json to insert at the placeholder position\n * @param index the index of the placeholder to replace\n */\n protected replacePlaceholderWithBodyBit(\n bodyAst: TextAst,\n bodyBitJson: BodyBitJson,\n index: number,\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const walkRecursive = (node: any, parent: any, parentKey: any): boolean => {\n if (Array.isArray(node)) {\n // Walk the array of nodes\n for (let i = 0; i < node.length; i++) {\n const child = node[i];\n const done = walkRecursive(child, node, i);\n if (done) return true;\n }\n } else {\n if (node.type === 'bit' && node.index === index) {\n // Found the placeholder, replace it with the body bit\n parent[parentKey] = bodyBitJson;\n return true;\n }\n if (node.content) {\n // Walk the child content\n const done = walkRecursive(node.content, node, 'content');\n if (done) return true;\n }\n }\n return false;\n };\n\n walkRecursive(bodyAst, null, null);\n }\n\n /**\n * Trim the body parts, removing any whitespace only parts at start and end of body\n *\n * @param parts the body parts to trim\n * @returns the trimmed body parts\n */\n private trimBodyParts(parts: BodyPart[]): BodyPart[] {\n // Trim start\n let foundText = false;\n let trimmedParts: BodyPart[] = parts.reduce((acc, part) => {\n const text = part as BodyText;\n if (!foundText && text.type === BodyBitType.text) {\n const t = text.data.bodyText.trimStart() as BreakscapedString;\n if (t) {\n foundText = true;\n text.data.bodyText = t;\n acc.push(text);\n }\n } else {\n // Not body text, so add it\n foundText = true;\n acc.push(part);\n }\n return acc;\n }, [] as BodyPart[]);\n\n // Trim end\n foundText = false;\n trimmedParts = trimmedParts.reduceRight((acc, part) => {\n const text = part as BodyText;\n if (!foundText && text.type === BodyBitType.text) {\n const t = text.data.bodyText.trimEnd() as BreakscapedString;\n if (t) {\n foundText = true;\n text.data.bodyText = t;\n acc.unshift(text);\n }\n } else {\n // Not body text, so add it\n foundText = true;\n acc.unshift(part);\n }\n return acc;\n }, [] as BodyPart[]);\n\n return trimmedParts;\n }\n}\n\nconst instance = new BodyContentProcessor();\nexport { instance as BodyContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { Config } from '../../../../config/Config.ts';\nimport { type CardBit } from '../../../../model/ast/Nodes.ts';\nimport { type JsonText, type TextAst } from '../../../../model/ast/TextNodes.ts';\nimport { CardSetConfigKey } from '../../../../model/config/enum/CardSetConfigKey.ts';\nimport { BitType, type BitTypeType } from '../../../../model/enum/BitType.ts';\nimport { BodyBitType } from '../../../../model/enum/BodyBitType.ts';\nimport { ResourceType } from '../../../../model/enum/ResourceType.ts';\nimport { type TextFormatType } from '../../../../model/enum/TextFormat.ts';\nimport {\n type BotResponseJson,\n type ChoiceJson,\n type DefinitionListItemJson,\n type ExampleJson,\n type FeedbackChoiceJson,\n type FeedbackJson,\n type FeedbackReasonJson,\n type FlashcardJson,\n type HeadingJson,\n type IngredientJson,\n type MatrixCellJson,\n type MatrixJson,\n type PairJson,\n type PronunciationTableCellJson,\n type PronunciationTableJson,\n type QuestionJson,\n type QuizJson,\n type ResponseJson,\n type StatementJson,\n type TableJson,\n type TextAndIconJson,\n} from '../../../../model/json/BitJson.ts';\nimport { type SelectJson } from '../../../../model/json/BodyBitJson.ts';\nimport {\n type AudioResourceWrapperJson,\n type ImageResourceWrapperJson,\n} from '../../../../model/json/ResourceJson.ts';\nimport { NumberUtils } from '../../../../utils/NumberUtils.ts';\nimport {\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type BitSpecificCards,\n type ParsedCardSet,\n type ProcessedCard,\n type ProcessedCardSet,\n type ProcessedCardSide,\n type ProcessedCardVariant,\n} from '../BitmarkPegParserTypes.ts';\nimport { BitmarkPegParserValidator } from '../BitmarkPegParserValidator.ts';\n\ninterface HeadingData {\n heading: HeadingJson;\n isDefaultExampleCardSet: boolean;\n exampleCardSet: ExampleJson | undefined;\n}\n\nfunction buildCards(\n context: BitmarkPegParserContext,\n bitType: BitTypeType,\n textFormat: TextFormatType,\n parsedCardSet: ParsedCardSet | undefined,\n statementV1: Partial<StatementJson> | undefined,\n statementsV1: Partial<StatementJson>[] | undefined,\n choicesV1: Partial<ChoiceJson>[] | undefined,\n responsesV1: Partial<ResponseJson>[] | undefined,\n): BitSpecificCards {\n const { bitConfig } = context;\n\n if (context.DEBUG_CARD_SET) context.debugPrint('card set', parsedCardSet);\n\n let result: BitSpecificCards = {};\n\n // Process the card contents\n const processedCardSet = processCardSet(context, parsedCardSet);\n\n // Parse the card contents according to the card set type\n\n // Get the bit metadata to check how to parse the card set\n const cardSetType = bitConfig.cardSet?.configKey;\n\n switch (cardSetType) {\n case CardSetConfigKey.flashcard:\n case CardSetConfigKey.definitionList:\n result = parseFlashcardOrDefinitionList(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.elements:\n result = parseElements(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.statements:\n result = parseStatements(context, bitType, processedCardSet, statementV1, statementsV1);\n break;\n\n case CardSetConfigKey.feedback:\n result = parseFeedback(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.quiz:\n result = parseQuiz(context, bitType, processedCardSet, choicesV1, responsesV1);\n break;\n\n case CardSetConfigKey.questions:\n result = parseQuestions(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.matchPairs:\n // ==> heading / pairs\n result = parseMatchPairs(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.matchMatrix:\n // ==> heading / matrix\n result = parseMatchMatrix(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.pronunciationTable:\n result = parsePronunciationTable(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.table:\n // ==> heading / table\n result = parseTable(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.botActionResponses:\n result = parseBotActionResponses(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.ingredients:\n result = parseIngredients(context, bitType, processedCardSet);\n break;\n\n case CardSetConfigKey.clozeList:\n case CardSetConfigKey.exampleBitList:\n case CardSetConfigKey.bookReferenceList:\n result = parseCardBits(context, bitType, textFormat, processedCardSet);\n break;\n\n // DEPRECATED - REMOVE IN THE FUTURE\n // case CardSetConfigKey._captionDefinitionsList:\n // // ==> captionDefinitionsList\n // result = parseCaptionDefinitionsList(context, bitType, processedCardSet);\n // break;\n\n default:\n // Return default empty object\n }\n\n // Add the internal comments\n result.internalComments =\n processedCardSet.internalComments.length > 0 ? processedCardSet.internalComments : undefined;\n\n return result;\n}\n\nfunction processCardSet(\n context: BitmarkPegParserContext,\n parsedCardSet: ParsedCardSet | undefined,\n): ProcessedCardSet {\n const processedCardSet: ProcessedCardSet = {\n cards: [],\n internalComments: [],\n };\n\n // Early return if no card set\n if (!parsedCardSet) return processedCardSet;\n\n const { bitType } = context;\n\n // Process the card contents\n let cardNo = 0;\n let sideNo = 0;\n let variantNo = 0;\n for (const card of parsedCardSet.cards) {\n const processedCard: ProcessedCard = {\n no: cardNo++,\n sides: [],\n };\n processedCardSet.cards.push(processedCard);\n for (const side of card.sides) {\n const processedSide: ProcessedCardSide = {\n no: sideNo++,\n variants: [],\n };\n processedCard.sides.push(processedSide);\n for (const variant of side.variants) {\n const { parser, content } = variant;\n const processedVariant: ProcessedCardVariant = {\n parser,\n no: variantNo++,\n } as ProcessedCardVariant;\n processedSide.variants.push(processedVariant);\n\n const tagsConfig = Config.getTagsConfigForCardSet(bitType, sideNo, variantNo);\n\n const tags = context.bitContentProcessor(BitContentLevel.Card, tagsConfig, content);\n\n if (context.DEBUG_CARD_TAGS) context.debugPrint('card tags', tags);\n\n // Validate the cardBody\n tags.cardBody = BitmarkPegParserValidator.checkCardBody(\n context,\n BitContentLevel.Card,\n bitType,\n tags.cardBody,\n processedCard.no,\n processedSide.no,\n processedVariant.no,\n );\n // Reduce the card body parts to a breakscaped string\n tags.cardBodyStr = tags.cardBody?.bodyString;\n\n processedVariant.data = tags;\n\n // Add any internal comments\n if (tags.internalComments) processedCardSet.internalComments.push(...tags.internalComments);\n }\n variantNo = 0;\n }\n sideNo = 0;\n }\n\n return processedCardSet;\n}\n\nfunction parseFlashcardOrDefinitionList(\n context: BitmarkPegParserContext,\n bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n const flashcards: Partial<FlashcardJson>[] = [];\n const definitions: Partial<DefinitionListItemJson>[] = [];\n let questionStr = '';\n let question: Partial<TextAndIconJson> | undefined;\n let answer: Partial<TextAndIconJson> | undefined;\n let alternativeAnswers: Partial<TextAndIconJson>[] = [];\n let variantIndex = 0;\n let extraTags: BitContentProcessorResult = {};\n let questionVariant: ProcessedCardVariant | undefined;\n const onlyOneCardAllowed = bitType === BitType.flashcard1;\n\n // Extract the heading card if it exists\n const headingData = extractHeadingCard(cardSet);\n\n for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {\n const card = cardSet.cards[cardIdx];\n\n // Skip the headings card if it exists\n if (headingData && cardIdx === 0) continue;\n\n // Reset the question and answers\n question = undefined;\n answer = undefined;\n alternativeAnswers = [];\n variantIndex = 0;\n extraTags = {};\n\n for (const side of card.sides) {\n for (const content of side.variants) {\n const { cardBody, resources, ...tags } = content.data;\n extraTags = {\n ...extraTags,\n ...tags,\n };\n const icon =\n resources && resources.length > 0\n ? (resources[0] as ImageResourceWrapperJson)\n : undefined;\n const text = cardBody?.body as TextAst;\n const str = cardBody?.bodyString ?? '';\n\n if (variantIndex === 0) {\n questionVariant = content;\n questionStr = str;\n question = {\n text,\n icon,\n };\n } else if (variantIndex === 1) {\n answer = {\n text,\n icon,\n };\n } else {\n alternativeAnswers.push({\n text,\n icon: icon,\n });\n }\n variantIndex++;\n }\n }\n\n // Add the flashcard\n if (cardIdx === 0 || !onlyOneCardAllowed) {\n if (Config.isOfBitType(bitType, [BitType.flashcard])) {\n // .flashcard\n // if (question) {\n const fc: Partial<FlashcardJson> = {\n question: question as TextAndIconJson,\n answer: answer as TextAndIconJson,\n alternativeAnswers: alternativeAnswers as TextAndIconJson[],\n ...extraTags,\n };\n if (fc) flashcards.push(fc);\n // } else {\n // context.addWarning('Ignoring card with empty question', questionVariant);\n // }\n } else {\n // .definition-list, etc\n const dl: Partial<DefinitionListItemJson> = {\n term: question as TextAndIconJson,\n definition: answer as TextAndIconJson,\n alternativeDefinitions: alternativeAnswers as TextAndIconJson[],\n ...extraTags,\n };\n if (dl) definitions.push(dl);\n }\n } else {\n // Only one card allowed, add a warning and ignore the card\n context.addWarning(\n `Bit '${bitType}' should only contain one card. Ignore subsequent card: '${questionStr}'`,\n questionVariant,\n );\n break;\n }\n }\n\n return {\n heading: headingData?.heading,\n flashcards: flashcards.length > 0 ? flashcards : undefined,\n definitions: definitions.length > 0 ? definitions : undefined,\n };\n}\n\nfunction parseElements(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n const elements: string[] = [];\n\n for (const card of cardSet.cards) {\n for (const side of card.sides) {\n for (const content of side.variants) {\n const tags = content.data;\n\n // if (tags.cardBody) {\n elements.push(tags.cardBodyStr ?? '');\n // } else {\n // context.addWarning('Ignoring card with empty element', content);\n // }\n }\n }\n }\n\n return {\n elements: elements.length > 0 ? elements : undefined,\n };\n}\n\nfunction parseStatements(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n statementV1: Partial<StatementJson> | undefined,\n statementsV1: Partial<StatementJson>[] | undefined,\n): BitSpecificCards {\n const statements: Partial<StatementJson>[] = [];\n\n for (const card of cardSet.cards) {\n for (const side of card.sides) {\n for (const content of side.variants) {\n const { statements: chainedStatements, statement: _ignore, ...tags } = content.data;\n\n // Re-build the statement, adding any tags that were not in the True/False chain\n // These tags are actually not in the correct place, but we can still interpret them and fix the data.\n // As .true-false only has one statement per card, we can just add the extra tags to the statement.\n if (Array.isArray(chainedStatements)) {\n for (const s of chainedStatements) {\n // if (s.text) {\n const statement: Partial<StatementJson> = {\n statement: s.statement ?? '',\n isCorrect: s.isCorrect,\n item: s.item,\n lead: s.lead,\n hint: s.hint,\n instruction: s.instruction,\n example: s.example,\n ...tags,\n };\n if (statement) statements.push(statement);\n // } else {\n // context.addWarning('Ignoring card with empty statement', content);\n // }\n }\n }\n }\n }\n }\n\n // Add the V1 statement to the end of the statements array to improve backwards compatibility\n if (statementV1) {\n statements.push(statementV1);\n }\n\n // Add the V1 statements to the end of the statements array to improve backwards compatibility\n if (Array.isArray(statementsV1) && statementsV1.length > 0) {\n statements.push(...statementsV1);\n }\n\n return {\n statements: statements.length > 0 ? statements : undefined,\n };\n}\n\nfunction parseFeedback(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n let feedback: Partial<FeedbackJson> | undefined;\n const feedbacks: Partial<FeedbackJson>[] = [];\n\n // Extract the heading card if it exists\n const headingData = extractHeadingCard(cardSet);\n\n for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {\n const card = cardSet.cards[cardIdx];\n\n // Skip the headings card if it exists\n if (headingData && cardIdx === 0) continue;\n\n feedback = undefined;\n\n for (let sideIdx = 0; sideIdx < card.sides.length; sideIdx++) {\n const side = card.sides[sideIdx];\n\n for (const content of side.variants) {\n const tags = content.data;\n\n const { cardBody, cardBodyStr, choices: choiceTags, ...restTags } = tags;\n\n if (sideIdx === 0) {\n // First side (feedback choices)\n\n const choices: Partial<FeedbackChoiceJson>[] = [];\n\n if (choiceTags && choiceTags.length > 0) {\n for (const tf of choiceTags) {\n const { __isDefaultExample, example, ...tfTags } = tf;\n\n const choice: Partial<FeedbackChoiceJson> = {\n choice: tfTags.choice,\n requireReason: tfTags.isCorrect,\n __isDefaultExample,\n example,\n };\n choices.push(choice);\n }\n }\n\n // if (tags.choices || tags.responses) {\n feedback = {\n ...tags,\n choices: choices as FeedbackChoiceJson[],\n };\n if (feedback) feedbacks.push(feedback);\n } else if (sideIdx === 1) {\n // Second side (feedback reason)\n const reason: Partial<FeedbackReasonJson> = {\n text: cardBodyStr ?? '',\n __textAst: cardBody?.body as TextAst,\n ...restTags,\n };\n if (feedback) {\n feedback.reason = reason as FeedbackReasonJson;\n }\n }\n }\n }\n }\n\n return {\n heading: headingData?.heading,\n feedbacks: feedbacks.length > 0 ? feedbacks : undefined,\n };\n}\n\nfunction parseQuiz(\n _context: BitmarkPegParserContext,\n bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n choicesV1: Partial<ChoiceJson>[] | undefined,\n responsesV1: Partial<ResponseJson>[] | undefined,\n): BitSpecificCards {\n const quizzes: Partial<QuizJson>[] = [];\n const insertChoices = Config.isOfBitType(bitType, BitType.multipleChoice);\n const insertResponses = Config.isOfBitType(bitType, BitType.multipleResponse);\n if (!insertChoices && !insertResponses) return {};\n\n let isDefaultExampleCard = false;\n let exampleCard: ExampleJson | undefined;\n\n for (const card of cardSet.cards) {\n isDefaultExampleCard = false;\n exampleCard = undefined;\n\n for (const side of card.sides) {\n for (const content of side.variants) {\n const { __isDefaultExample, example, ...tags } = content.data;\n\n // Example\n isDefaultExampleCard = __isDefaultExample === true ? true : isDefaultExampleCard;\n exampleCard = example ? example : exampleCard;\n\n // Insert choices / responses\n if (tags.trueFalse && tags.trueFalse.length > 0) {\n const responsesOrChoices: (Partial<ChoiceJson> | Partial<ResponseJson>)[] = [];\n\n for (const tf of tags.trueFalse) {\n const { __isDefaultExample: isDefaultExampleTf, example: exampleTf, ...tfTags } = tf;\n const __isDefaultExample = isDefaultExampleTf || isDefaultExampleCard;\n const example = exampleTf || exampleCard;\n\n const response: Partial<ChoiceJson> & Partial<ResponseJson> = {\n isCorrect: tfTags.isCorrect,\n __isDefaultExample,\n example,\n };\n if (insertResponses) response.response = tfTags.text;\n else response.choice = tfTags.text;\n if (response) responsesOrChoices.push(response);\n }\n\n if (insertResponses) tags.responses = responsesOrChoices as Partial<ResponseJson>[];\n else tags.choices = responsesOrChoices as Partial<ChoiceJson>[];\n }\n\n // if (tags.choices || tags.responses) {\n const quiz: Partial<QuizJson> = {\n ...tags,\n choices: tags.choices as ChoiceJson[],\n responses: tags.responses as ResponseJson[],\n __isDefaultExample: isDefaultExampleCard,\n __defaultExample: exampleCard,\n };\n if (quiz) quizzes.push(quiz);\n // } else {\n // context.addWarning('Ignoring card with empty quiz', content);\n // }\n }\n }\n }\n\n // Add a quiz for the V1 choices / responses\n if (insertChoices && Array.isArray(choicesV1) && choicesV1.length > 0) {\n const quiz: Partial<QuizJson> = {\n choices: choicesV1 as ChoiceJson[],\n };\n if (quiz) quizzes.push(quiz);\n }\n if (insertResponses && Array.isArray(responsesV1) && responsesV1.length > 0) {\n const quiz: Partial<QuizJson> = {\n responses: responsesV1 as ResponseJson[],\n };\n if (quiz) quizzes.push(quiz);\n }\n\n return {\n quizzes: quizzes.length > 0 ? quizzes : undefined,\n };\n}\n\nfunction parseQuestions(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n const questions: Partial<QuestionJson>[] = [];\n\n for (const card of cardSet.cards) {\n for (const side of card.sides) {\n for (const content of side.variants) {\n const tags = content.data;\n\n // if (tags.cardBody) {\n const q: Partial<QuestionJson> = {\n question: tags.cardBodyStr ?? '',\n ...tags,\n };\n if (q) questions.push(q);\n // }\n // else {\n // context.addWarning('Ignoring card with empty body text', content);\n // }\n }\n }\n }\n\n return {\n questions: questions.length > 0 ? questions : undefined,\n };\n}\n\nfunction parseMatchPairs(\n _context: BitmarkPegParserContext,\n bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n const pairs: Partial<PairJson>[] = [];\n let pairKey: string | undefined = undefined;\n let pairValues: string[] = [];\n let _pairValuesAst: TextAst[] = [];\n let keyAudio: AudioResourceWrapperJson | undefined = undefined;\n let keyImage: ImageResourceWrapperJson | undefined = undefined;\n let extraTags: BitContentProcessorResult = {};\n let isDefaultExampleCard = false;\n let exampleCard: ExampleJson | undefined;\n // let variant: ProcessedCardVariant | undefined;\n\n // Extract the heading card if it exists\n const headingValuesIsArray = Config.isOfBitType(bitType, BitType.matchMatrix);\n const headingData = extractHeadingCard(cardSet, headingValuesIsArray);\n\n const isDefaultExampleCardSet = headingData?.isDefaultExampleCardSet ?? false;\n let exampleCardSet = headingData?.exampleCardSet;\n\n for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {\n const card = cardSet.cards[cardIdx];\n\n // Skip the headings card if it exists\n if (headingData && cardIdx === 0) continue;\n\n pairKey = undefined;\n pairValues = [];\n _pairValuesAst = [];\n keyAudio = undefined;\n keyImage = undefined;\n extraTags = {};\n isDefaultExampleCard = false;\n exampleCard = undefined;\n\n for (let sideIdx = 0; sideIdx < card.sides.length; sideIdx++) {\n const side = card.sides[sideIdx];\n\n for (const content of side.variants) {\n // variant = content;\n const { cardBody, cardBodyStr, resources, __isDefaultExample, example, ...tags } =\n content.data;\n\n // Example\n isDefaultExampleCard = __isDefaultExample === true ? true : isDefaultExampleCard;\n exampleCard = example ? (example as TextAst) : exampleCard;\n\n if (sideIdx === 0) {\n // First side\n if (Array.isArray(resources) && resources.length > 0) {\n // TODO - should search the correct resource type based on the bit type\n const resource = resources[0];\n // console.log('WARNING: Match card has resource on first side', tags.resource);\n if (resource.type === ResourceType.audio) {\n keyAudio = resource as AudioResourceWrapperJson;\n } else if (resource.type === ResourceType.image) {\n keyImage = resource as ImageResourceWrapperJson;\n }\n } else {\n // If not a heading or resource, it is a pair\n pairKey = cardBodyStr;\n }\n } else {\n // Subsequent sides (pair)\n const value = cardBodyStr ?? '';\n const valueAst = cardBody?.body as TextAst;\n pairValues.push(value);\n _pairValuesAst.push(valueAst);\n if ((isDefaultExampleCardSet || isDefaultExampleCard) && !exampleCard)\n exampleCard = valueAst;\n\n // Fix: https://github.com/getMoreBrain/cosmic/issues/5454\n delete tags.item;\n delete tags.lead;\n }\n\n // Extra tags\n extraTags = {\n ...extraTags,\n ...tags,\n };\n }\n }\n\n // if (pairKey || keyAudio || keyImage) {\n // Calculate final example and __isDefaultExample\n if (isDefaultExampleCard) exampleCardSet = undefined;\n const __isDefaultExample = isDefaultExampleCard || isDefaultExampleCardSet;\n const example = exampleCard || exampleCardSet;\n\n const pair: Partial<PairJson> = {\n key: pairKey ?? '',\n keyAudio,\n keyImage,\n values: pairValues,\n __valuesAst: _pairValuesAst,\n ...extraTags,\n __isDefaultExample,\n example,\n };\n if (pair) pairs.push(pair);\n // } else {\n // context.addWarning('Ignoring card with empty body text', variant);\n // }\n }\n\n return {\n heading: headingData?.heading,\n pairs: pairs.length > 0 ? pairs : undefined,\n };\n}\n\nfunction parseMatchMatrix(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n let matrixKey: string | undefined = undefined;\n let matrixKeyTags: BitContentProcessorResult | undefined = undefined;\n const matrix: Partial<MatrixJson>[] = [];\n let matrixCells: Partial<MatrixCellJson>[] = [];\n let matrixCellValues: string[] = [];\n let _matrixCellValuesAst: TextAst[] = [];\n let matrixCellTags: BitContentProcessorResult = {};\n let isDefaultExampleCard = false;\n let exampleCard: ExampleJson | undefined;\n let isDefaultExampleSide = false;\n let exampleSide: ExampleJson | undefined;\n let isCaseSensitiveMatrix: boolean | undefined;\n let isCaseSensitiveCell: boolean | undefined;\n\n // let keyAudio: AudioResource | undefined = undefined;\n // let keyImage: ImageResource | undefined = undefined;\n // let variant: ProcessedCardVariant | undefined;\n\n // Extract the heading card if it exists\n const headingData = extractHeadingCard(cardSet, true);\n\n const isDefaultExampleCardSet = headingData?.isDefaultExampleCardSet ?? false;\n let exampleCardSet = headingData?.exampleCardSet;\n\n for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {\n const card = cardSet.cards[cardIdx];\n\n // Skip the headings card if it exists\n if (headingData && cardIdx === 0) continue;\n\n matrixKey = undefined;\n matrixKeyTags = undefined;\n // keyAudio = undefined;\n // keyImage = undefined;\n matrixCells = [];\n matrixCellValues = [];\n _matrixCellValuesAst = [];\n isDefaultExampleCard = false;\n exampleCard = undefined;\n isCaseSensitiveMatrix = undefined;\n\n for (let sideIdx = 0; sideIdx < card.sides.length; sideIdx++) {\n const side = card.sides[sideIdx];\n\n matrixCellValues = [];\n _matrixCellValuesAst = [];\n matrixCellTags = {};\n isDefaultExampleSide = false;\n exampleSide = undefined;\n isCaseSensitiveCell = undefined;\n\n for (const content of side.variants) {\n // variant = content;\n const tags = content.data;\n\n const { cardBody, cardBodyStr, __isDefaultExample, example, isCaseSensitive, ...restTags } =\n tags;\n\n // Example\n isDefaultExampleSide = __isDefaultExample === true ? true : isDefaultExampleSide;\n exampleSide = example ? example : exampleSide;\n\n // Merge the tags into the matrix cell tags\n Object.assign(matrixCellTags, restTags);\n\n if (sideIdx === 0) {\n // First side (matrix)\n matrixKey = cardBodyStr;\n matrixKeyTags = restTags;\n isDefaultExampleCard = __isDefaultExample === true ? true : isDefaultExampleCard;\n exampleCard = example ? example : exampleCard;\n isCaseSensitiveMatrix = isCaseSensitive != null ? isCaseSensitive : isCaseSensitiveMatrix;\n } else {\n // Subsequent sides (matrix cell value)\n const value = cardBodyStr ?? Breakscape.EMPTY_STRING;\n const valueAst = cardBody?.body as TextAst;\n matrixCellValues.push(value);\n _matrixCellValuesAst.push(valueAst);\n if ((isDefaultExampleCardSet || isDefaultExampleSide) && !exampleSide)\n exampleSide = valueAst;\n isCaseSensitiveCell = isCaseSensitive != null ? isCaseSensitive : isCaseSensitiveMatrix;\n }\n }\n\n // Finished looping variants, create matrix cell\n if (sideIdx > 0) {\n // Calculate final example and __isDefaultExample\n if (isDefaultExampleSide) exampleCard = exampleCardSet = undefined;\n if (isDefaultExampleCard) exampleCardSet = undefined;\n const __isDefaultExample =\n isDefaultExampleSide || isDefaultExampleCard || isDefaultExampleCardSet;\n const example = exampleSide || exampleCard || exampleCardSet;\n\n const matrixCell: Partial<MatrixCellJson> = {\n values: matrixCellValues,\n __valuesAst: _matrixCellValuesAst,\n ...matrixCellTags,\n __isDefaultExample: __isDefaultExample,\n example,\n isCaseSensitive: isCaseSensitiveCell,\n };\n if (matrixCell) matrixCells.push(matrixCell);\n }\n }\n\n // if (matrixKey) {\n const m: Partial<MatrixJson> = {\n key: matrixKey ?? Breakscape.EMPTY_STRING,\n // item: matrixItem ?? Breakscape.EMPTY_STRING,\n // keyAudio,\n // keyImage,\n cells: matrixCells as MatrixCellJson[],\n ...matrixKeyTags,\n };\n if (m) matrix.push(m);\n // } else {\n // context.addWarning('Ignoring card with empty body text', variant);\n // }\n }\n\n return {\n heading: headingData?.heading,\n matrix: matrix.length > 0 ? matrix : undefined,\n };\n}\n\nfunction parsePronunciationTable(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n const rows: PronunciationTableCellJson[][] = [];\n let rowValues: PronunciationTableCellJson[] = [];\n\n for (const card of cardSet.cards) {\n rowValues = [];\n\n for (const side of card.sides) {\n for (const content of side.variants) {\n // variant = content;\n const tags = content.data;\n\n const { title, cardBody, resources } = tags;\n\n const heading = title && title[1].titleAst;\n const audio: AudioResourceWrapperJson = (\n resources && resources.length > 0\n ? resources.find((r) => r.type === ResourceType.audio)\n : undefined\n ) as AudioResourceWrapperJson;\n\n const value: PronunciationTableCellJson = {\n title: heading ?? [],\n body: (cardBody?.body ?? []) as JsonText,\n audio,\n };\n rowValues.push(value);\n }\n }\n\n rows.push(rowValues);\n }\n\n const table: Partial<PronunciationTableJson> = {\n data: rows,\n };\n\n return { pronunciationTable: table };\n}\n\nfunction parseTable(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n let isHeading = false;\n const columns: JsonText[] = [];\n const rows: JsonText[][] = [];\n let rowValues: JsonText[] = [];\n\n for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {\n const card = cardSet.cards[cardIdx];\n\n isHeading = false;\n rowValues = [];\n\n for (const side of card.sides) {\n for (const content of side.variants) {\n // variant = content;\n const tags = content.data;\n\n const { title, cardBody } = tags;\n\n // Get the 'heading' which is the [#title] at level 1\n // const heading = title && title[1].titleString;\n const heading = title && title[1].titleAst;\n if (cardIdx === 0 && heading != null) isHeading = true;\n\n if (isHeading) {\n columns.push(heading ?? []);\n } else {\n // If not a heading, it is a row cell value\n // const value = cardBodyStr ?? '';\n const value = (cardBody?.body ?? []) as JsonText;\n rowValues.push(value);\n }\n }\n }\n\n if (!isHeading) {\n rows.push(rowValues);\n }\n }\n\n const table: Partial<TableJson> = {\n columns,\n data: rows,\n };\n\n return { table };\n}\n\nfunction parseBotActionResponses(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n const botResponses: Partial<BotResponseJson>[] = [];\n\n for (const card of cardSet.cards) {\n for (const side of card.sides) {\n for (const content of side.variants) {\n const { __instructionString, reaction, cardBodyStr: feedback, ...tags } = content.data;\n\n const botResponse: Partial<BotResponseJson> = {\n response: __instructionString ?? Breakscape.EMPTY_STRING,\n reaction: reaction ?? Breakscape.EMPTY_STRING,\n feedback: feedback ?? Breakscape.EMPTY_STRING,\n ...tags,\n };\n if (botResponse) botResponses.push(botResponse);\n }\n }\n }\n\n return {\n botResponses: botResponses.length > 0 ? botResponses : undefined,\n };\n}\n\nfunction parseIngredients(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n const ingredients: Partial<IngredientJson>[] = [];\n\n for (const card of cardSet.cards) {\n for (const side of card.sides) {\n for (const content of side.variants) {\n const {\n title: titleArray,\n __instructionString,\n unit,\n unitAbbr,\n decimalPlaces,\n disableCalculation,\n cardBodyStr,\n cardBody,\n ...tags\n } = content.data;\n\n // Extract 'title' from title array (if present)\n // Extract 'quantity' from either then unchained instruction, or from the select (otherwise use 0)\n // Extract checked from the select options (if present, otherwise checked is false))\n const title =\n Array.isArray(titleArray) && titleArray.length > 0\n ? titleArray[titleArray.length - 1].titleString\n : undefined;\n let checked = false;\n let quantity: number | undefined = NumberUtils.asNumber(__instructionString);\n if (cardBody && cardBody.bodyBits) {\n const select: SelectJson | undefined = cardBody.bodyBits.find(\n (c) => c.type === BodyBitType.select,\n ) as SelectJson | undefined;\n if (select) {\n quantity = select.__instructionString\n ? NumberUtils.asNumber(select.__instructionString)\n : quantity;\n if (select.options && select.options.length > 0) {\n checked = select.options[0].isCorrect;\n }\n }\n }\n\n const ingredient: Partial<IngredientJson> = {\n title,\n checked,\n // TS compiler very weird. It doesn't recognize that cardBodyStr is a string|undefined, even if cast!\n // Casting to 'any' to avoid the error\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ingredient: cardBodyStr as any,\n quantity,\n unit: unit ?? Breakscape.EMPTY_STRING,\n unitAbbr: unitAbbr ?? Breakscape.EMPTY_STRING,\n decimalPlaces: decimalPlaces ?? 1,\n disableCalculation: disableCalculation,\n ...tags,\n };\n if (ingredient) ingredients.push(ingredient);\n }\n }\n }\n\n return {\n ingredients: ingredients.length > 0 ? ingredients : undefined,\n };\n}\n\n// DEPRECATED - REMOVE IN THE FUTURE\n// function parseCaptionDefinitionsList(\n// _context: BitmarkPegParserContext,\n// _bitType: BitTypeType,\n// cardSet: ProcessedCardSet,\n// ): BitSpecificCards {\n// let isHeading = false;\n// const columns: string[] = [];\n// const rows: string[][] = [];\n// let rowValues: string[] = [];\n\n// for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {\n// const card = cardSet.cards[cardIdx];\n\n// isHeading = false;\n// rowValues = [];\n\n// for (const side of card.sides) {\n// for (const content of side.variants) {\n// // variant = content;\n// const tags = content.data;\n\n// const { title, cardBodyStr } = tags;\n\n// // Get the 'heading' which is the [#title] at level 1\n// const heading = title && title[1].titleString;\n// if (cardIdx === 0 && heading != null) isHeading = true;\n\n// if (isHeading) {\n// columns.push(heading ?? '');\n// } else {\n// // If not a heading, it is a row cell value\n// const value = cardBodyStr ?? '';\n// rowValues.push(value);\n// }\n// }\n// }\n\n// if (!isHeading) {\n// rows.push(rowValues);\n// }\n// }\n\n// const captionDefinitionList: Partial<CaptionDefinitionListJson> | undefined =\n// columns.length > 0\n// ? {\n// heading: columns,\n// definitions: rows\n// .map((row) => {\n// const col: Partial<CaptionDefinitionJson> = {\n// term: row[0],\n// definition: row[1],\n// };\n// return col as CaptionDefinitionJson;\n// })\n// .filter((d) => d != null),\n// }\n// : undefined;\n\n// return { captionDefinitionList };\n// }\n\nfunction parseCardBits(\n _context: BitmarkPegParserContext,\n _bitType: BitTypeType,\n _textFormat: TextFormatType,\n cardSet: ProcessedCardSet,\n): BitSpecificCards {\n const cardBits: Partial<CardBit>[] = [];\n\n for (const card of cardSet.cards) {\n for (const side of card.sides) {\n for (const content of side.variants) {\n const { cardBody: body, ...rest } = content.data;\n\n const cardBit: Partial<CardBit> = {\n body,\n ...rest,\n } as CardBit;\n if (cardBit) cardBits.push(cardBit);\n }\n }\n }\n\n return {\n cardBits: cardBits.length > 0 ? cardBits : undefined,\n };\n}\n\nfunction extractHeadingCard(\n cardSet: ProcessedCardSet,\n valuesIsArray = false,\n): HeadingData | undefined {\n let isHeading = false;\n let heading: Partial<HeadingJson> | undefined;\n let forKeys: string | undefined = undefined;\n const forValues: string[] = [];\n let isDefaultExampleCardSet = false;\n let exampleCardSet: ExampleJson | undefined;\n\n if (cardSet.cards.length === 0) return undefined;\n const card = cardSet.cards[0];\n\n for (let sideIdx = 0; sideIdx < card.sides.length; sideIdx++) {\n const side = card.sides[sideIdx];\n\n if (side.variants.length === 0) continue;\n\n const content = side.variants[0];\n const tags = content.data;\n\n const { title, __isDefaultExample, example } = tags;\n\n // Get the 'heading' which is the [#title] at level 1\n const heading = title && title[1].titleString;\n if (heading != null) isHeading = true;\n\n if (sideIdx === 0) {\n // 1st side\n\n if (isHeading) {\n forKeys = heading;\n isDefaultExampleCardSet = __isDefaultExample === true ? true : isDefaultExampleCardSet;\n exampleCardSet = example ? (example as TextAst) : exampleCardSet;\n }\n } /*if (sideIdx === 1)*/ else {\n // 2nd side\n if (isHeading) {\n forValues.push(heading ?? '');\n isDefaultExampleCardSet = __isDefaultExample === true ? true : isDefaultExampleCardSet;\n exampleCardSet = example ? (example as TextAst) : exampleCardSet;\n }\n }\n }\n\n if (isHeading) {\n let forValuesFinal: string | string[] = forValues;\n if (valuesIsArray) {\n // forValues is an array of values\n forValuesFinal = forValues;\n } else {\n // Standard match, forValues is a single value\n if (forValues.length >= 1) {\n forValuesFinal = forValues[forValues.length - 1];\n } else {\n forValuesFinal = '';\n }\n }\n\n heading = {\n forKeys: forKeys ?? '',\n forValues: forValuesFinal,\n };\n }\n\n return heading\n ? {\n heading: heading as HeadingJson,\n isDefaultExampleCardSet,\n exampleCardSet,\n }\n : undefined;\n}\n\nexport { buildCards };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n TypeKey,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction defaultTagContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { type, value } = content as TypeValue;\n const { textFormat } = context;\n const textParser = new TextParser();\n\n const trimmedStringValue = StringUtils.trimmedString(value) as BreakscapedString;\n\n switch (type) {\n case TypeKey.Instruction: {\n target.instruction = textParser.toAst(trimmedStringValue, {\n format: textFormat,\n location: TextLocation.tag,\n });\n target.__instructionString = Breakscape.unbreakscape(trimmedStringValue, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n break;\n }\n\n case TypeKey.Hint: {\n target.hint = textParser.toAst(trimmedStringValue, {\n format: textFormat,\n location: TextLocation.tag,\n });\n target.__hintString = Breakscape.unbreakscape(trimmedStringValue, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n break;\n }\n\n case TypeKey.Anchor: {\n target.anchor = Breakscape.unbreakscape(trimmedStringValue, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n break;\n }\n\n case TypeKey.Reference: {\n target.reference = Breakscape.unbreakscape(trimmedStringValue, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n break;\n }\n\n // 16.08.2023 Deprecated, but currently still supported\n case TypeKey.SampleSolution: {\n target.sampleSolution = Breakscape.unbreakscape(trimmedStringValue, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n target.__sampleSolutionAst = textParser.toAst(trimmedStringValue, {\n format: textFormat,\n location: TextLocation.tag,\n });\n context.addWarning('[$...] tag is deprecated, use [@sampleSolution:...] instead', content);\n break;\n }\n\n default:\n // Unknown tag\n }\n}\nexport { defaultTagContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type Footer } from '../../../../model/ast/Nodes.ts';\nimport { type JsonText } from '../../../../model/ast/TextNodes.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\nimport { BitmarkPegParserValidator } from '../BitmarkPegParserValidator.ts';\nimport { ContentProcessorUtils } from './ContentProcessorUtils.ts';\n\nexport interface FooterText {\n footerText: BreakscapedString;\n isPlain: boolean;\n}\n\nconst textParser = new TextParser();\n\nclass FooterContentProcessor {\n public process(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n _tagsConfig: TagsConfig | undefined,\n _target: BitContentProcessorResult,\n footer: BreakscapedString,\n footerPlainText: BreakscapedString,\n ): Footer | undefined {\n const { textFormat } = context;\n let finalFooterText: JsonText | undefined;\n\n footer = footer.trimStart() as BreakscapedString;\n footerPlainText = footerPlainText.trimEnd() as BreakscapedString;\n\n // Create the body text AST\n const haveFooter = !!footer.trim();\n const haveFooterPlainText = !!footerPlainText.trim();\n\n // Newlines will be lost from the end of footer, and start of footerPlainText\n // Count then and add them back when merging\n let newLines = 0;\n if (haveFooter && haveFooterPlainText) {\n newLines =\n StringUtils.countOccurrencesAtEnd(footer, '\\n') +\n StringUtils.countOccurrencesAtStart(footerPlainText, '\\n');\n }\n\n if (footer || footerPlainText) {\n const isBitmarkText = textFormat === TextFormat.bitmarkText;\n\n if (footer) {\n footer = BitmarkPegParserValidator.checkFooter(context, contentDepth, footer);\n }\n\n const parsedFooterText: JsonText = isBitmarkText\n ? textParser.toAst(footer, {\n //\n format: textFormat,\n location: TextLocation.body,\n })\n : Breakscape.unbreakscape(footer, {\n format: TextFormat.plainText,\n location: TextLocation.body,\n });\n\n const parsedFooterPlainText = Breakscape.unbreakscape(footerPlainText, {\n format: TextFormat.plainText,\n location: TextLocation.body,\n });\n\n finalFooterText = ContentProcessorUtils.concatenatePlainTextWithAstTexts(\n parsedFooterText,\n newLines,\n parsedFooterPlainText,\n );\n }\n\n // Return the footer in the target\n return finalFooterText ? { footer: finalFooterText } : undefined;\n }\n}\n\nconst instance = new FooterContentProcessor();\nexport { instance as FooterContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nconst textParser = new TextParser();\n\nfunction clozeTagContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { textFormat } = context;\n const { value } = content as TypeValue;\n\n const solutions = target.solutions;\n const solutionsAst = target.__solutionsAst;\n\n if (!solutions || !solutionsAst) return;\n\n if (StringUtils.isString(value)) {\n const trimmedStringValue = StringUtils.trimmedString(value) as BreakscapedString;\n\n solutions.push(\n Breakscape.unbreakscape(trimmedStringValue, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n }),\n );\n\n const solutionAst = textParser.toAst(trimmedStringValue, {\n format: textFormat,\n location: TextLocation.tag,\n });\n solutionsAst.push(solutionAst);\n }\n}\nexport { clozeTagContentProcessor };\n","import { Config } from '../../../../config/Config.ts';\nimport { type BodyPart } from '../../../../model/ast/Nodes.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { BodyBitType } from '../../../../model/enum/BodyBitType.ts';\nimport { Tag } from '../../../../model/enum/Tag.ts';\nimport { type GapJson } from '../../../../model/json/BodyBitJson.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\nimport { clozeTagContentProcessor } from './ClozeTagContentProcessor.ts';\n\nfunction gapChainContentProcessor(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n bodyParts: BodyPart[],\n): void {\n if (contentDepth === BitContentLevel.Chain) {\n clozeTagContentProcessor(context, contentDepth, tagsConfig, content, target);\n } else {\n const gap: Partial<GapJson> | undefined = buildGap(context, contentDepth, tagsConfig, content);\n if (gap) bodyParts.push(gap as BodyPart);\n }\n}\n\nfunction buildGap(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n): Partial<GapJson> | undefined {\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('gap content', content);\n\n const gapConfig = Config.getTagConfigForTag(tagsConfig, Tag.fromValue(content.type));\n\n const chainContent = [content, ...(content.chain ?? [])];\n\n const chainTags = context.bitContentProcessor(\n BitContentLevel.Chain,\n gapConfig?.chain,\n chainContent,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('gap TAGS', chainTags);\n\n const gap: Partial<GapJson> = {\n type: BodyBitType.gap,\n ...chainTags,\n };\n\n return gap;\n}\n\nexport { gapChainContentProcessor };\n","import { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction itemLeadTagContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { textFormat } = context;\n const { value } = content as TypeValue;\n const textParser = new TextParser();\n\n const trimmedStringValue = StringUtils.trimmedString(value) as BreakscapedString;\n\n if (!target.itemLead) target.itemLead = [];\n const text = textParser.toAst(trimmedStringValue, {\n format: textFormat,\n location: TextLocation.tag,\n });\n target.itemLead.push(text);\n}\nexport { itemLeadTagContentProcessor };\n","import { Config } from '../../../../config/Config.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { Tag } from '../../../../model/enum/Tag.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\nimport { itemLeadTagContentProcessor } from './ItemLeadTagContentProcessor.ts';\n\nfunction itemLeadChainContentProcessor(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n if (contentDepth === BitContentLevel.Chain) {\n itemLeadTagContentProcessor(context, contentDepth, tagsConfig, content, target);\n } else {\n buildItemLead(context, contentDepth, tagsConfig, content, target);\n }\n}\n\nfunction buildItemLead(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('item lead content', content);\n\n // Process the chain (lead)\n const itemLeadConfig = Config.getTagConfigForTag(tagsConfig, Tag.fromValue(content.type));\n const chainContent = [content, ...(content.chain ?? [])];\n\n const chainTags = context.bitContentProcessor(\n BitContentLevel.Chain,\n itemLeadConfig?.chain,\n chainContent,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('item lead TAGS', chainTags);\n\n // Set the lead item from the chain\n target.itemLead = chainTags.itemLead;\n}\n\nexport { itemLeadChainContentProcessor };\n","import { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction markTagContentProcessor(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { value } = content as TypeValue;\n\n if (StringUtils.isString(value)) {\n target.solution = StringUtils.trimmedString(value) as BreakscapedString;\n }\n}\nexport { markTagContentProcessor };\n","import { Config } from '../../../../config/Config.ts';\nimport { type BodyPart } from '../../../../model/ast/Nodes.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { BodyBitType } from '../../../../model/enum/BodyBitType.ts';\nimport { Tag } from '../../../../model/enum/Tag.ts';\nimport { type MarkJson } from '../../../../model/json/BodyBitJson.ts';\nimport { ArrayUtils } from '../../../../utils/ArrayUtils.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\nimport { markTagContentProcessor } from './MarkTagContentProcessor.ts';\n\nfunction markChainContentProcessor(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n bodyParts: BodyPart[],\n): void {\n if (contentDepth === BitContentLevel.Chain) {\n markTagContentProcessor(context, BitContentLevel.Chain, content, target);\n } else {\n const mark: Partial<MarkJson> | undefined = buildMark(\n context,\n contentDepth,\n tagsConfig,\n content,\n );\n if (mark) bodyParts.push(mark as BodyPart);\n }\n}\n\nfunction buildMark(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n): Partial<MarkJson> | undefined {\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('mark content', content);\n\n const markConfig = Config.getTagConfigForTag(tagsConfig, Tag.fromValue(content.type));\n\n const tags = context.bitContentProcessor(BitContentLevel.Chain, tagsConfig, [content]);\n const chainTags = context.bitContentProcessor(\n BitContentLevel.Chain,\n markConfig?.chain,\n content.chain,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('mark TAGS', chainTags);\n\n const { solution } = tags;\n const { mark: markType, ...rest } = chainTags;\n\n const mark: Partial<MarkJson> = {\n type: BodyBitType.mark,\n solution: solution ?? '',\n mark: ArrayUtils.asSingle(markType) ?? '',\n ...rest,\n };\n\n return mark;\n}\n\nexport { markChainContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { ConfigKey } from '../../../../model/config/enum/ConfigKey.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { Count } from '../../../../model/enum/Count.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction bookChainContentProcessor(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n if (contentDepth === BitContentLevel.Chain) {\n // Do nothing\n } else {\n buildBook(context, contentDepth, tagsConfig, content, target);\n }\n}\n\nfunction buildBook(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { bitConfig } = context;\n\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('book content', content);\n\n const tags = context.bitContentProcessor(BitContentLevel.Chain, tagsConfig, content.chain);\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('book TAGS', tags);\n\n const { reference, referenceEnd } = tags;\n\n // Extract the book from the content tag\n const book = Breakscape.unbreakscape(\n StringUtils.trimmedString(content.value) as BreakscapedString,\n {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n },\n );\n\n // Get the config for the bit\n const bookConfig = bitConfig.tags[ConfigKey.property_book];\n if (bookConfig && (bookConfig.maxCount === Count.infinity || bookConfig.maxCount > 1)) {\n // Add the book to the list of books\n if (!Array.isArray(target.book)) target.book = [];\n target.book.push({\n book,\n reference: reference ?? '',\n referenceEnd: (referenceEnd ?? undefined) as string,\n });\n return;\n }\n\n // Book should be added at the body level\n target.book = book;\n target.reference = reference;\n target.referenceEnd = referenceEnd;\n}\n\nexport { bookChainContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { Config } from '../../../../config/Config.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { BitType } from '../../../../model/enum/BitType.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { BooleanUtils } from '../../../../utils/BooleanUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TrueFalseValue,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\n// const builder = new Builder();\nconst textParser = new TextParser();\n\nfunction exampleTagContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { bitType } = context;\n const { value } = content as TypeValue;\n const example = value as BreakscapedString | boolean;\n\n // Each bit type handles example tags differently\n if (\n Config.isOfBitType(bitType, [\n BitType.cloze,\n BitType.clozeAndMultipleChoiceText,\n BitType.multipleChoiceText,\n BitType.highlightText,\n BitType.trueFalse,\n BitType.trueFalse1,\n BitType.multipleResponse,\n BitType.multipleResponse1,\n BitType.multipleChoice,\n BitType.multipleChoice1,\n ])\n ) {\n //\n handleGapOrSelectOrTrueFalseExample(context, content, example, target);\n //\n } else if (Config.isOfBitType(bitType, BitType.mark)) {\n // Default only example handling\n handleDefaultOnlyExample(context, content, example, target);\n //\n } else {\n // Standard example handling\n handleStandardStringExample(context, content, example, target);\n //\n }\n}\n\nfunction handleGapOrSelectOrTrueFalseExample(\n context: BitmarkPegParserContext,\n content: BitContent,\n example: BreakscapedString | boolean,\n target: BitContentProcessorResult,\n): void {\n const { bitType, textFormat } = context;\n let trueFalse: TrueFalseValue | undefined;\n\n if (Array.isArray(target.trueFalse) && target.trueFalse.length > 0) {\n trueFalse = target.trueFalse[target.trueFalse.length - 1] ?? undefined;\n }\n\n if (trueFalse) {\n // Example is set on the true/false tag [+...] / [-...]\n if (example === true) {\n trueFalse.__isDefaultExample = true;\n trueFalse.example = !!trueFalse.isCorrect;\n } else {\n if (BooleanUtils.isBooleanString(example)) {\n trueFalse.example = BooleanUtils.toBoolean(example);\n } else {\n // Example is set to a value other than true / false which is not valid in the case of select\n trueFalse.__isDefaultExample = true;\n trueFalse.example = undefined;\n context.addWarning(\n `Only 'true' / 'false' / default are allowed here, using default`,\n content,\n );\n }\n }\n } else if (Array.isArray(target.__solutionsAst) && target.__solutionsAst.length > 0) {\n // Example is set on the gap solution tag [_...]\n if (example === true) {\n // Extract the solution nearest [@example] tag as the example value\n target.example = target.__solutionsAst[target.__solutionsAst.length - 1] ?? undefined;\n } else {\n target.example = example\n ? textParser.toAst(example, {\n format: textFormat,\n location: TextLocation.tag,\n })\n : undefined;\n }\n } else {\n // Example is higher up the chain, so how it is handled depends on the bit type\n if (\n Config.isOfBitType(bitType, [\n BitType.multipleChoiceText,\n BitType.highlightText,\n BitType.trueFalse,\n BitType.trueFalse1,\n BitType.multipleResponse,\n BitType.multipleResponse1,\n ])\n ) {\n // Treat as a standard boolean\n handleStandardBooleanExample(context, content, example, target);\n //\n } else if (\n Config.isOfBitType(bitType, [\n BitType.clozeAndMultipleChoiceText,\n BitType.multipleChoice,\n BitType.multipleChoice1,\n ])\n ) {\n // For these bits, a specific example value higher up the chain makes no sense\n // Set example to default, and raise a warning if any value is set.\n target.__isDefaultExample = true;\n target.example = undefined;\n\n if (example !== true) {\n // Example is set to a value other than true / false which is not valid in the case of select\n context.addWarning(\n `At this level, only default [@example] is allowed, using default`,\n content,\n );\n }\n //\n } else {\n // Treat as a standard string\n handleStandardStringExample(context, content, example, target);\n //\n }\n }\n}\n\nfunction handleDefaultOnlyExample(\n context: BitmarkPegParserContext,\n content: BitContent,\n example: string | boolean,\n target: BitContentProcessorResult,\n): void {\n // This bit can have only default examples - nothing else makes sense\n target.__isDefaultExample = true;\n target.example = undefined;\n\n if (example !== true) {\n // Example is set to a value other than true / false which is not valid in the case of select\n context.addWarning(`Only default [@example] is allowed, using default`, content);\n }\n}\n\nfunction handleStandardBooleanExample(\n context: BitmarkPegParserContext,\n content: BitContent,\n example: BreakscapedString | boolean,\n target: BitContentProcessorResult,\n): void {\n if (example === true) {\n target.__isDefaultExample = true;\n target.example = undefined;\n } else {\n const exampleStr = example\n ? Breakscape.unbreakscape(example, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n })\n : undefined;\n if (BooleanUtils.isBooleanString(exampleStr)) {\n target.example = BooleanUtils.toBoolean(exampleStr);\n } else {\n // Example is set to a value other than true / false which is not valid in the case of select\n target.__isDefaultExample = true;\n target.example = undefined;\n context.addWarning(\n `Only 'true' / 'false' / default are allowed here, using default`,\n content,\n );\n }\n }\n}\n\nfunction handleStandardStringExample(\n context: BitmarkPegParserContext,\n _content: BitContent,\n example: BreakscapedString | boolean,\n target: BitContentProcessorResult,\n): void {\n const { textFormat } = context;\n if (example === true || example === 'true') {\n target.__isDefaultExample = true;\n target.example = undefined;\n } else {\n target.example = example\n ? textParser.toAst(example, { format: textFormat, location: TextLocation.tag })\n : undefined;\n }\n}\n\nexport { exampleTagContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { Config } from '../../../../config/Config.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { ConfigKey } from '../../../../model/config/enum/ConfigKey.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { type ImageSourceJson } from '../../../../model/json/BitJson.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeKeyValue,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction imageSourceChainContentProcessor(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n if (contentDepth === BitContentLevel.Chain) {\n imageSourceTagContentProcessor(context, contentDepth, tagsConfig, content, target);\n } else {\n buildImageSource(context, contentDepth, tagsConfig, content, target);\n }\n}\n\nfunction imageSourceTagContentProcessor(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { value } = content as TypeValue;\n\n // Extract the url from the content tag\n const url = Breakscape.unbreakscape(StringUtils.trimmedString(value) as BreakscapedString, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n\n target.imageSourceUrl = url;\n}\n\nfunction buildImageSource(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('imageSource content', content);\n\n const { key: tag } = content as TypeKeyValue;\n const imageSourceConfig = Config.getTagConfigForTag(tagsConfig, ConfigKey.fromValue(tag));\n\n const tags = context.bitContentProcessor(BitContentLevel.Chain, tagsConfig, [content]);\n const chainTags = context.bitContentProcessor(\n BitContentLevel.Chain,\n imageSourceConfig?.chain,\n content.chain,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('imageSource TAGS', chainTags);\n\n const { imageSourceUrl: url } = tags;\n const { mockupId, ...rest } = chainTags;\n\n if (!url) {\n context.addWarning('[@imageSource] is missing the image url', content);\n }\n if (!mockupId) {\n context.addWarning('[@mockupId:xxx] is missing from [@imageSource]', content);\n }\n\n const imageSource: Partial<ImageSourceJson> = {\n url: url ?? '',\n mockupId: mockupId ?? '',\n ...rest,\n };\n\n target.imageSource = imageSource;\n}\n\nexport { imageSourceChainContentProcessor };\n","import { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction commentTagContentProcessor(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n if (!target.internalComments) return;\n\n const { value } = content as TypeValue;\n\n const internalComment: BreakscapedString | undefined = StringUtils.isString(value)\n ? (StringUtils.trimmedString(value) as BreakscapedString)\n : undefined;\n if (!internalComment) return;\n\n target.internalComments.push(internalComment);\n}\nexport { commentTagContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { Config } from '../../../../config/Config.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { ConfigKey } from '../../../../model/config/enum/ConfigKey.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { type MarkConfigJson } from '../../../../model/json/BitJson.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeKeyValue,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction markConfigChainContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { key: tag } = content as TypeKeyValue;\n\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('mark content', content);\n\n const markConfig = target.markConfig;\n\n if (!markConfig) return;\n\n const markTagConfig = Config.getTagConfigForTag(tagsConfig, ConfigKey.fromValue(tag));\n\n const { mark: _ignoreMark, ...tags } = context.bitContentProcessor(\n BitContentLevel.Chain,\n markTagConfig?.chain,\n content.chain,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('mark TAGS', tags);\n\n // Extract the name from the content tag\n const mark: string = Breakscape.unbreakscape(\n (StringUtils.trimmedString(content.value) ?? 'unknown') as BreakscapedString,\n {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n },\n );\n\n const config: Partial<MarkConfigJson> = {\n mark,\n emphasis: 'underline' as string,\n ...tags,\n };\n\n if (config) markConfig.push(config);\n}\n\nexport { markConfigChainContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { ResourceType } from '../../../../model/enum/ResourceType.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { type PersonJson } from '../../../../model/json/BitJson.ts';\nimport {\n type ImageResourceWrapperJson,\n type ResourceJson,\n} from '../../../../model/json/ResourceJson.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction personChainContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n // const { value } = content as TypeValue;\n\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('person content', content);\n\n const tags = context.bitContentProcessor(BitContentLevel.Chain, tagsConfig, content.chain);\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('person TAGS', tags);\n\n const { propertyTitle, resources } = tags;\n\n // Extract the name from the content tag\n const name = Breakscape.unbreakscape(\n StringUtils.trimmedString(content.value) as BreakscapedString,\n {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n },\n );\n\n // Extract the title from the propertyTitle tag\n const title = StringUtils.trimmedString(propertyTitle);\n\n // Extract avatarImage from the resources\n const avatarImage = extractAvatarImage(context, resources);\n\n const person: Partial<PersonJson> = {\n name,\n title,\n avatarImage,\n };\n\n target.person = person;\n}\n\nfunction extractAvatarImage(\n context: BitmarkPegParserContext,\n resources: ResourceJson[] | undefined,\n): ImageResourceWrapperJson | undefined {\n // Extract avatarImage from the resources\n // Return the actual resource, and add all other resources to excess resources\n let avatarImage: ImageResourceWrapperJson | undefined;\n const excessResources: ResourceJson[] = [];\n\n if (resources) {\n for (const r of resources.reverse()) {\n if (!avatarImage && ResourceType.image === r.type) {\n avatarImage = r;\n } else {\n excessResources.push(r);\n }\n }\n }\n\n if (excessResources.length > 0) {\n // Set the excess resources in the parser info\n context.parser.excessResources = excessResources;\n\n // Add an warning to warn about the excess resources\n context.addWarning(\n `${excessResources.length} excess resource(s) present in the [@person] chain.`,\n );\n }\n\n return avatarImage;\n}\n\nexport { personChainContentProcessor };\n","import { ConfigKey } from '../../../../model/config/enum/ConfigKey.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { type RatingLevelStartEndJson } from '../../../../model/json/BitJson.ts';\nimport { NumberUtils } from '../../../../utils/NumberUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeKeyValue,\n} from '../BitmarkPegParserTypes.ts';\n\nconst textParser = new TextParser();\n\nfunction ratingLevelChainContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { textFormat } = context;\n const { key, value } = content as TypeKeyValue;\n\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('ratingLevel content', content);\n\n const tags = context.bitContentProcessor(BitContentLevel.Chain, tagsConfig, content.chain);\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('ratingLevel TAGS', tags);\n\n const { label } = tags;\n\n // Extract the technicalTerm from the content tag\n const level = NumberUtils.asNumber(value) ?? 0;\n\n const node: Partial<RatingLevelStartEndJson> = {\n level,\n label: label\n ? textParser.toAst(label, { format: textFormat, location: TextLocation.tag })\n : undefined,\n };\n\n switch (key) {\n case ConfigKey.property_ratingLevelStart:\n target.ratingLevelStart = node;\n\n break;\n case ConfigKey.property_ratingLevelEnd:\n target.ratingLevelEnd = node;\n\n break;\n default:\n // Do nothing\n }\n}\n\nexport { ratingLevelChainContentProcessor };\n","import { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { type ServingsJson } from '../../../../model/json/BitJson.ts';\nimport { NumberUtils } from '../../../../utils/NumberUtils.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction servingsChainContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n // const { value } = content as TypeValue;\n\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('servings content', content);\n\n const tags = context.bitContentProcessor(BitContentLevel.Chain, tagsConfig, content.chain);\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('servings TAGS', tags);\n\n const { unit, unitAbbr, decimalPlaces, disableCalculation, __hintString } = tags;\n\n // Extract the servings from the content tag\n const servings = NumberUtils.asNumber(content.value) ?? 1;\n\n const node: Partial<ServingsJson> = {\n servings,\n unit,\n unitAbbr,\n decimalPlaces: decimalPlaces ?? 1,\n disableCalculation,\n hint: __hintString,\n };\n\n target.servings = node;\n}\n\nexport { servingsChainContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { type TechnicalTermJson } from '../../../../model/json/BitJson.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction technicalTermChainContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n // const { value } = content as TypeValue;\n\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('technicalTerm content', content);\n\n const tags = context.bitContentProcessor(BitContentLevel.Chain, tagsConfig, content.chain);\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('technicalTerm TAGS', tags);\n\n const { lang } = tags;\n\n // Extract the technicalTerm from the content tag\n const technicalTerm = Breakscape.unbreakscape(\n StringUtils.trimmedString(content.value) as BreakscapedString,\n {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n },\n );\n\n const node: Partial<TechnicalTermJson> = {\n technicalTerm,\n lang,\n };\n\n target.technicalTerm = node;\n}\n\nexport { technicalTermChainContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { Config } from '../../../../config/Config.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { ConfigKey, configKeyToPropertyType } from '../../../../model/config/enum/ConfigKey.ts';\nimport { PropertyTagConfig } from '../../../../model/config/PropertyTagConfig.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { PropertyKey } from '../../../../model/enum/PropertyKey.ts';\nimport { TagFormat } from '../../../../model/enum/TagFormat.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { BooleanUtils } from '../../../../utils/BooleanUtils.ts';\nimport { NumberUtils } from '../../../../utils/NumberUtils.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeKeyValue,\n} from '../BitmarkPegParserTypes.ts';\nimport { bookChainContentProcessor } from './BookChainContentProcessor.ts';\nimport { exampleTagContentProcessor } from './ExampleTagContentProcessor.ts';\nimport { imageSourceChainContentProcessor } from './ImageSourceChainContentProcessor.ts';\nimport { commentTagContentProcessor as internalCommentTagContentProcessor } from './InternalCommentTagContentProcessor.ts';\nimport { markConfigChainContentProcessor } from './MarkConfigChainContentProcessor.ts';\nimport { personChainContentProcessor } from './PersonChainContentProcessor.ts';\nimport { ratingLevelChainContentProcessor } from './RatingLevelChainContentProcessor.ts';\nimport { servingsChainContentProcessor } from './ServingsChainContentProcessor.ts';\nimport { technicalTermChainContentProcessor } from './TechnicalTermChainContentProcessor.ts';\n\nconst textParser = new TextParser();\n\nfunction propertyContentProcessor(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { value } = content as TypeKeyValue;\n const { key: keyIn } = content as TypeKeyValue;\n const isChain = contentDepth === BitContentLevel.Chain;\n\n // Get the property config for the tag (if it exists)\n const propertyConfig = Config.getTagConfigForTag(tagsConfig, PropertyKey.fromValue(keyIn));\n const configKey = propertyConfig ? propertyConfig.configKey : undefined;\n let property = configKeyToPropertyType(keyIn);\n\n // Handle internal comments\n if (configKey === ConfigKey.property_internalComment) {\n internalCommentTagContentProcessor(context, contentDepth, content, target);\n return;\n }\n\n // Check for chains\n // Generally, the chain will only be present in the correct bit as the data was already validated. The bit type\n // should also be checked here if the property may occur in another bit with a different meaning.\n if (propertyConfig) {\n if (configKey === ConfigKey.property_example) {\n exampleTagContentProcessor(context, contentDepth, content, target);\n return;\n } else if (\n configKey === ConfigKey.property_ratingLevelStart ||\n configKey === ConfigKey.property_ratingLevelEnd\n ) {\n ratingLevelChainContentProcessor(\n context,\n contentDepth,\n propertyConfig.chain,\n content,\n target,\n );\n return;\n } else if (configKey === ConfigKey.property_technicalTerm) {\n technicalTermChainContentProcessor(\n context,\n contentDepth,\n propertyConfig.chain,\n content,\n target,\n );\n return;\n } else if (configKey === ConfigKey.property_servings) {\n servingsChainContentProcessor(context, contentDepth, propertyConfig.chain, content, target);\n return;\n } else if (\n configKey === ConfigKey.property_person ||\n configKey === ConfigKey.property_partner\n ) {\n personChainContentProcessor(context, contentDepth, propertyConfig.chain, content, target);\n return;\n } else if (configKey === ConfigKey.property_imageSource) {\n imageSourceChainContentProcessor(context, contentDepth, tagsConfig, content, target);\n return;\n } else if (configKey === ConfigKey.property_book) {\n bookChainContentProcessor(context, contentDepth, propertyConfig.chain, content, target);\n return;\n } else if (configKey === ConfigKey.property_mark && !isChain) {\n markConfigChainContentProcessor(context, contentDepth, tagsConfig, content, target);\n return;\n } else if (configKey === ConfigKey.property_title && isChain) {\n // Hack the intermediate tag so as not to clash with [#title] tags which are not chained (yet)\n property = 'propertyTitle';\n }\n }\n\n // Helper for building the properties\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const addProperty = (obj: any, tag: string, v: unknown, c: PropertyTagConfig | undefined) => {\n // if (key === 'progress') debugger;\n\n // Convert property as needed\n const processValue = (v: unknown) => {\n if (v == null) return undefined;\n\n if (c) {\n switch (c.format) {\n // case PropertyFormat.string:\n // return StringUtils.isString(v) ? StringUtils.string(v) : undefined;\n\n case TagFormat.plainText:\n return Breakscape.unbreakscape(\n StringUtils.isString(v)\n ? (StringUtils.trimmedString(v) as BreakscapedString)\n : undefined,\n {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n },\n );\n\n case TagFormat.number:\n return NumberUtils.asNumber(\n Breakscape.unbreakscape(v as BreakscapedString, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n }),\n );\n\n case TagFormat.boolean:\n return BooleanUtils.toBoolean(\n Breakscape.unbreakscape(v as BreakscapedString, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n }),\n true,\n );\n\n case TagFormat.invertedBoolean:\n return !BooleanUtils.toBoolean(\n Breakscape.unbreakscape(v as BreakscapedString, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n }),\n true,\n );\n\n case TagFormat.bitmarkText:\n v = StringUtils.isString(v) ? v : '';\n return textParser.toAst(v as BreakscapedString, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n }\n }\n return Breakscape.unbreakscape(v as BreakscapedString, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n });\n };\n\n // Convert property and key as needed\n v = processValue(v);\n\n if (c == null || c.array) {\n if (Object.prototype.hasOwnProperty.call(obj, tag)) {\n const originalValue = obj[tag];\n obj[tag] = [...originalValue, v];\n } else {\n obj[tag] = [v];\n }\n } else {\n obj[tag] = v;\n }\n };\n\n if (propertyConfig) {\n // Known property in correct position\n addProperty(target, property, value, propertyConfig);\n } else {\n // Unknown (extra) property\n addProperty(target.extraProperties, property, value, propertyConfig);\n }\n\n // HACKS: Need to allow properties for different bits and in chains to have different/multiple formats!\n // This is not currently supported by the config system; it would need to be extended to support this.\n // That is a big job, so instead there are just some hacks here for the few cases where it is currently needed :(\n if (configKey === ConfigKey.property_sampleSolution) {\n addProperty(\n target,\n '__sampleSolutionAst',\n value,\n new PropertyTagConfig(\n ConfigKey.property_sampleSolution,\n 'sampleSolution',\n 1,\n 1,\n undefined,\n undefined,\n TagFormat.bitmarkText,\n undefined,\n undefined,\n ),\n );\n }\n}\n\nexport { propertyContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction referenceTagContentProcessor(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n isReferenceEnd: boolean,\n): void {\n const { value } = content as TypeValue;\n\n const trimmedStringValue = StringUtils.trimmedString(value) as BreakscapedString;\n\n if (isReferenceEnd) {\n target.referenceEnd = Breakscape.unbreakscape(trimmedStringValue, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n } else {\n target.reference = Breakscape.unbreakscape(trimmedStringValue, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n });\n }\n}\nexport { referenceTagContentProcessor };\n","import { ResourceBuilder } from '../../../../ast/ResourceBuilder.ts';\nimport { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { Config } from '../../../../config/Config.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { ConfigKey, type ConfigKeyType } from '../../../../model/config/enum/ConfigKey.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { Count } from '../../../../model/enum/Count.ts';\nimport { ResourceType, resourceTypeToConfigKey } from '../../../../model/enum/ResourceType.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport {\n type ImageResourceJson,\n type ImageResourceWrapperJson,\n type ResourceJson,\n} from '../../../../model/json/ResourceJson.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type TypeKeyValue,\n} from '../BitmarkPegParserTypes.ts';\n\n// const builder = new Builder();\nconst resourceBuilder = new ResourceBuilder();\n\n/**\n * Get the valid resource from all the resources on the bit, and add the invalid ones to\n * excess resources\n *\n * @param resourceTypeAttachment the resource type specified in the bit header\n * @param resources the resources on the bit\n */\nfunction buildResources(\n context: BitmarkPegParserContext,\n resourceTypeAttachment: string | undefined,\n resources: ResourceJson[] | undefined,\n): ResourceJson[] | undefined {\n const { bitType } = context;\n const filteredResources: ResourceJson[] = [];\n const excessResources: ResourceJson[] = [];\n\n const validatedResourceTypeAttachemnt = ResourceType.fromValue(resourceTypeAttachment);\n\n // Get the bit configuration for the bit\n const resourcesConfig = Config.getBitResourcesConfig(bitType, validatedResourceTypeAttachemnt);\n const resourceAttachmentAllowed = resourcesConfig.resourceAttachmentAllowed;\n const countsMin = resourcesConfig.getCountsMin(); // Returns a copy, so it can be modified\n const countsMax = resourcesConfig.getCountsMax(); // Returns a copy, so it can be modified\n\n // Find the excess resources and ensure we have the minimum resources\n if (resources) {\n for (const r of resources.reverse()) {\n const configKey = resourceTypeToConfigKey(r.__typeAlias);\n let countMin = countsMin.get(configKey) ?? 0;\n let countMax = countsMax.get(configKey) ?? 0;\n\n // Decrement the minimum count and later ensure it is 0\n countMin = Math.max(0, countMin - 1);\n\n if (countMax === Count.infinity) {\n filteredResources.unshift(r);\n } else if (countMax > 0) {\n // We still have a count left for this resource\n filteredResources.unshift(r);\n countMax--;\n } else {\n excessResources.unshift(r);\n }\n\n // Set the new counts\n countsMin.set(configKey, countMin);\n countsMax.set(configKey, countMax);\n }\n }\n\n // Raise a warning if the resource type is specified in the bit header, but no extra resource attachment is allowed\n if (!resourceAttachmentAllowed && resourceTypeAttachment) {\n const warningMsg = `Resource type [&${resourceTypeAttachment}] is specified in the bit header, but no extra resource is allowed for this bit.`;\n context.addWarning(warningMsg);\n } else if (filteredResources.length === 0 && resourceTypeAttachment) {\n context.addWarning(\n `Resource type [&${resourceTypeAttachment}] is specified in the bit header, but no such a resource is present`,\n );\n }\n\n if (excessResources.length > 0) {\n // Set the excess resources in the parser info\n context.parser.excessResources = excessResources;\n }\n\n return filteredResources;\n}\n\nfunction resourceContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { type: _ignoreType, key, value, chain } = content as TypeKeyValue<BreakscapedString>;\n\n const resources = target.resources;\n\n if (!resources) return;\n\n const configKey = ConfigKey.fromValue(key);\n if (!configKey) return;\n const resourceType = ResourceType.fromKey(configKey.replace(/^&/, '')) ?? ResourceType.unknown;\n\n // Parse the resource chain\n const resourceConfig = Config.getTagConfigForTag(tagsConfig, configKey);\n\n // const { posterImage, ...tags } = context.bitContentProcessor(\n // BitContentLevel.Chain,\n // bitType,\n // textFormat,\n // resourceConfig?.chain,\n // chain,\n // );\n\n // // If the chain contains a poster image, the chain is split at this point, and any tags after the poster image\n // // apply to the poster image, not the original resource.\n // const { originalChain, posterImageChain } = extractPosterImageChain(chain);\n // const posterImageChainConfig = resourceConfig?.chain?.posterImage?.chain;\n\n // // Process the poster image chain\n // const { posterImage: unused, ...posterImageTags } = context.bitContentProcessor(\n // BitContentLevel.Chain,\n // bitType,\n // textFormat,\n // posterImageChainConfig,\n // posterImageChain,\n // );\n // unused;\n\n // // Process the remaining chain\n // const { posterImage, ...tags } = context.bitContentProcessor(\n // BitContentLevel.Chain,\n // bitType,\n // textFormat,\n // resourceConfig?.chain,\n // originalChain,\n // );\n\n // Process the chain\n const { posterImage, ...tags } = context.bitContentProcessor(\n BitContentLevel.Chain,\n resourceConfig?.chain,\n chain,\n );\n\n // Handle the poster image\n let posterImageResource: ImageResourceJson | undefined;\n if (posterImage) {\n // Process the poster image chain\n const { subConfig: posterImageChainConfig, subChain: posterImageChain } = extractSubChain(\n resourceConfig?.chain,\n chain,\n ConfigKey.property_posterImage,\n );\n\n const { posterImage: _unused, ...posterImageTags } = context.bitContentProcessor(\n BitContentLevel.Chain,\n posterImageChainConfig,\n posterImageChain,\n );\n\n // Build the poster image resource\n posterImageResource = (\n resourceBuilder.resource(context, {\n type: ResourceType.image,\n value: posterImage,\n ...posterImageTags,\n }) as ImageResourceWrapperJson\n ).image;\n }\n\n const resource = resourceBuilder.resource(context, {\n type: resourceType,\n value: Breakscape.unbreakscape(value, {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n }),\n posterImage: posterImageResource,\n ...tags,\n });\n if (resource) {\n // Depending on the resource type, add it to the appropriate part of the target\n if (\n configKey === ConfigKey.resource_backgroundWallpaper ||\n configKey === ConfigKey.resource_imagePlaceholder\n ) {\n if (target.propertyStyleResources) target.propertyStyleResources[resourceType] = resource;\n } else {\n resources.push(resource);\n }\n }\n}\n\nfunction extractSubChain(\n config: TagsConfig | undefined,\n chain: BitContent[] | undefined,\n configKey: ConfigKeyType,\n): { subConfig: TagsConfig | undefined; subChain: BitContent[] | undefined } {\n let subConfig: TagsConfig | undefined;\n if (config) {\n subConfig = config[configKey]?.chain;\n }\n\n const subChain = chain?.reduce(\n (acc, c) => {\n if (acc) return acc;\n const tkv = c as TypeKeyValue;\n if (tkv.key === configKey) return tkv.chain;\n return undefined;\n },\n undefined as BitContent[] | undefined,\n );\n\n return { subConfig, subChain };\n}\n\nexport { buildResources, resourceContentProcessor };\n","import { Config } from '../../../../config/Config.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { type TextAst } from '../../../../model/ast/TextNodes.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { BitType, type BitTypeType } from '../../../../model/enum/BitType.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport { TextParser } from '../../../text/TextParser.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type BitSpecificTitles,\n type ContentDepthType,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nconst textParser = new TextParser();\n\nfunction titleTagContentProcessor(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n _tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { textFormat } = context;\n const { value } = content as TypeValue;\n\n const title = target.title;\n\n if (!title) return;\n\n // Parse the title and its level\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const titleValue: { title: string; level: string[] } = value as any;\n const titleText = StringUtils.trimmedString(titleValue.title) as BreakscapedString;\n const level = titleValue.level.length;\n title[level] = {\n //\n titleAst: textParser.toAst(titleText ?? '', {\n format: textFormat,\n location: TextLocation.tag,\n }),\n titleString: titleText ?? '',\n };\n}\n\nfunction buildTitles(\n _context: BitmarkPegParserContext,\n bitType: BitTypeType,\n title: { titleAst: TextAst; titleString: string }[] | undefined,\n): BitSpecificTitles {\n title = title ?? [];\n\n if (Config.isOfBitType(bitType, BitType.chapter)) {\n let t: { titleAst: TextAst; titleString: string } | undefined;\n if (title.length > 0) t = title[title.length - 1];\n\n return {\n title: t?.titleAst ?? [],\n titleString: t?.titleString ?? '',\n level: title.length > 0 ? title.length - 1 : undefined,\n };\n } else {\n return {\n title: title[1]?.titleAst ?? undefined,\n titleString: title[1]?.titleString ?? undefined,\n subtitle: title[2]?.titleAst ?? undefined,\n subtitleString: title[2]?.titleString ?? undefined,\n };\n }\n}\n\nexport { buildTitles, titleTagContentProcessor };\n","import { Breakscape } from '../../../../breakscaping/Breakscape.ts';\nimport { type BreakscapedString } from '../../../../model/ast/BreakscapedString.ts';\nimport { TextFormat } from '../../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../../model/enum/TextLocation.ts';\nimport { StringUtils } from '../../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n TypeKey,\n type TypeValue,\n} from '../BitmarkPegParserTypes.ts';\n\nfunction trueFalseTagContentProcessor(\n _context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n content: BitContent,\n target: BitContentProcessorResult,\n): void {\n const { type, value } = content as TypeValue;\n\n const trueFalse = target.trueFalse;\n\n if (!trueFalse) return;\n\n const trimmedStringValue = Breakscape.unbreakscape(\n StringUtils.trimmedString(value) as BreakscapedString,\n {\n format: TextFormat.bitmarkText,\n location: TextLocation.tag,\n },\n );\n\n trueFalse.push({\n text: trimmedStringValue,\n isCorrect: type === TypeKey.True,\n __isDefaultExample: false,\n });\n}\nexport { trueFalseTagContentProcessor };\n","import { Config } from '../../../../config/Config.ts';\nimport { type BodyPart } from '../../../../model/ast/Nodes.ts';\nimport { type TagsConfig } from '../../../../model/config/TagsConfig.ts';\nimport { BitType } from '../../../../model/enum/BitType.ts';\nimport { BodyBitType } from '../../../../model/enum/BodyBitType.ts';\nimport {\n type ChoiceJson,\n type ResponseJson,\n type StatementJson,\n} from '../../../../model/json/BitJson.ts';\nimport {\n type HighlightJson,\n type HighlightTextJson,\n type SelectJson,\n type SelectOptionJson,\n} from '../../../../model/json/BodyBitJson.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type StatementsOrChoicesOrResponses,\n type TrueFalseValue,\n TypeKey,\n} from '../BitmarkPegParserTypes.ts';\nimport { trueFalseTagContentProcessor } from './TrueFalseTagContentProcessor.ts';\n\nfunction trueFalseChainContentProcessor(\n context: BitmarkPegParserContext,\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n bodyParts: BodyPart[],\n): void {\n if (contentDepth === BitContentLevel.Chain) {\n trueFalseTagContentProcessor(context, BitContentLevel.Chain, content, target);\n } else {\n buildTrueFalse(context, contentDepth, tagsConfig, content, target, bodyParts);\n }\n}\n\nfunction buildTrueFalse(\n context: BitmarkPegParserContext,\n _contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n content: BitContent,\n target: BitContentProcessorResult,\n bodyParts: BodyPart[],\n): void {\n const { bitType } = context;\n const chainContent = [content, ...(content.chain ?? [])];\n\n const statements = target.statements;\n const choices = target.choices;\n const responses = target.responses;\n\n if (!statements || !choices || !responses || !bodyParts) return;\n\n if (Config.isOfBitType(bitType, BitType.trueFalse1)) {\n // Treat as true/false for statement\n target.statement = buildStatement(context, tagsConfig, chainContent);\n } else if (\n Config.isOfBitType(bitType, [\n BitType.trueFalse,\n BitType.multipleChoice,\n BitType.multipleChoice1,\n BitType.multipleResponse,\n BitType.multipleResponse1,\n BitType.feedback,\n ])\n ) {\n // Treat as true/false for choices / responses\n const tf = buildStatementsChoicesResponses(context, tagsConfig, chainContent);\n\n if (tf.statements) statements.push(...tf.statements);\n if (tf.choices) choices.push(...tf.choices);\n if (tf.responses) responses.push(...tf.responses);\n } else if (Config.isOfBitType(bitType, BitType.highlightText)) {\n // Treat as highlight text\n const highlight = buildHighlight(context, tagsConfig, chainContent);\n if (highlight) bodyParts.push(highlight as BodyPart);\n } else {\n // Treat as select\n const select = buildSelect(context, tagsConfig, chainContent);\n if (select) bodyParts.push(select as BodyPart);\n }\n}\n\n/**\n * Build statement for the bit:\n * .trueFalse-1\n *\n * @param bitType\n * @param trueFalseContent\n * @returns\n */\nfunction buildStatement(\n context: BitmarkPegParserContext,\n tagsConfig: TagsConfig | undefined,\n trueFalseContent: BitContent[],\n): Partial<StatementJson> | undefined {\n const { bitType } = context;\n if (!Config.isOfBitType(bitType, BitType.trueFalse1)) return undefined;\n\n if (context.DEBUG_CHAIN_CONTENT)\n context.debugPrint('trueFalse V1 content (statement)', trueFalseContent);\n\n const { trueFalse, ...tags } = context.bitContentProcessor(\n BitContentLevel.Chain,\n tagsConfig,\n trueFalseContent,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('trueFalse V1 tags (statement)', tags);\n\n let statement: Partial<StatementJson> | undefined;\n\n let firstTrueFalse: TrueFalseValue | undefined;\n if (trueFalse && trueFalse.length > 0) {\n firstTrueFalse = trueFalse[0];\n }\n\n if (firstTrueFalse) {\n // Have to remove the statement JSON tag to keep typescript happy\n const { statement: _ignore, ...tagsRest } = tags;\n statement = { ...firstTrueFalse, statement: firstTrueFalse.text, ...tagsRest };\n }\n\n return statement;\n}\n\n/**\n * Build statements / choices / responses for the bits:\n * .multiple-choice, .multiple-choice-1, .mutliple-response, .mutliple-response-1, .trueFalse, etc\n *\n * @param bitType\n * @param trueFalseContent\n * @returns\n */\nfunction buildStatementsChoicesResponses(\n context: BitmarkPegParserContext,\n tagsConfig: TagsConfig | undefined,\n trueFalseContent: BitContent[],\n): StatementsOrChoicesOrResponses {\n const { bitType } = context;\n // NOTE: We handle V1 tags in V2 multiple-choice / multiple-response for maxium backwards compatibility\n const insertStatements = Config.isOfBitType(bitType, BitType.trueFalse);\n const insertChoices = Config.isOfBitType(bitType, [\n BitType.multipleChoice,\n BitType.multipleChoice1,\n BitType.feedback,\n ]);\n const insertResponses = Config.isOfBitType(bitType, [\n BitType.multipleResponse,\n BitType.multipleResponse1,\n ]);\n if (!insertStatements && !insertChoices && !insertResponses) return {};\n\n const statements: Partial<StatementJson>[] = [];\n const choices: Partial<ChoiceJson>[] = [];\n const responses: Partial<ResponseJson>[] = [];\n\n const trueFalseContents = context.splitBitContent(trueFalseContent, [\n TypeKey.True,\n TypeKey.False,\n ]);\n\n if (context.DEBUG_CHAIN_CONTENT) {\n context.debugPrint('trueFalse V1 content (choices/responses)', trueFalseContents);\n }\n\n for (const contents of trueFalseContents) {\n const { trueFalse, ...tags } = context.bitContentProcessor(\n BitContentLevel.Chain,\n tagsConfig,\n contents,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('trueFalse V1 tags (choices/responses)', tags);\n\n let firstTrueFalse: TrueFalseValue | undefined;\n if (trueFalse && trueFalse.length > 0) {\n firstTrueFalse = trueFalse[0];\n }\n\n if (firstTrueFalse) {\n if (insertStatements) {\n // Have to remove the statement JSON tag to keep typescript happy\n const { statement: _ignore, ...tagsRest } = tags;\n\n const statement: Partial<StatementJson> = {\n ...firstTrueFalse,\n statement: firstTrueFalse.text,\n ...tagsRest,\n };\n if (statement) statements.push(statement);\n } else if (insertChoices) {\n const choice = { ...firstTrueFalse, choice: firstTrueFalse.text, ...tags };\n if (choice) choices.push(choice);\n } else if (insertResponses) {\n const response = { ...firstTrueFalse, response: firstTrueFalse.text, ...tags };\n if (response) responses.push(response);\n }\n }\n }\n\n const res: StatementsOrChoicesOrResponses = {};\n if (insertStatements) {\n res.statements = statements;\n } else if (insertChoices) {\n res.choices = choices;\n } else if (insertResponses) {\n res.responses = responses;\n }\n\n return res;\n}\n\nfunction buildHighlight(\n context: BitmarkPegParserContext,\n tagsConfig: TagsConfig | undefined,\n highlightContent: BitContent[],\n): Partial<HighlightJson> | undefined {\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('highlight content', highlightContent);\n\n const { trueFalse, ...tags } = context.bitContentProcessor(\n BitContentLevel.Chain,\n tagsConfig,\n highlightContent,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('highlight TAGS', { trueFalse, ...tags });\n\n const texts: Partial<HighlightTextJson>[] = [];\n if (trueFalse) {\n for (const tf of trueFalse) {\n const ht: Partial<HighlightTextJson> = { ...tf, isHighlighted: false };\n if (ht) texts.push(ht);\n }\n }\n\n const highlight: Partial<HighlightJson> = {\n type: BodyBitType.highlight,\n texts: texts as HighlightTextJson[],\n ...tags,\n };\n\n return highlight;\n}\n\nfunction buildSelect(\n context: BitmarkPegParserContext,\n tagsConfig: TagsConfig | undefined,\n selectContent: BitContent[],\n): Partial<SelectJson> | undefined {\n if (context.DEBUG_CHAIN_CONTENT) context.debugPrint('select content', selectContent);\n\n const { trueFalse, ...tags } = context.bitContentProcessor(\n BitContentLevel.Chain,\n tagsConfig,\n selectContent,\n );\n\n if (context.DEBUG_CHAIN_TAGS) context.debugPrint('select TAGS', { trueFalse, ...tags });\n\n const options: Partial<SelectOptionJson>[] = [];\n if (trueFalse) {\n for (const tf of trueFalse) {\n const so: Partial<SelectOptionJson> = tf;\n if (so) options.push(so);\n }\n }\n\n const select: Partial<SelectJson> = {\n type: BodyBitType.select,\n options: options as SelectOptionJson[],\n ...tags,\n };\n\n return select;\n}\n\nexport { trueFalseChainContentProcessor };\n","/**\n * BitmarkPegParserProcessor.ts\n * RA Sewell\n *\n * (c) 2023 Get More Brain AG\n * All rights reserved.\n *\n * About the parser:\n * -----------------\n *\n * 1. The peggy.js PEG parser is used to parse bitmark markup into a simple AST.\n * 2. The AST can then be walked to generate any output format required.\n * - The default output format is JSON.\n * - The output could also be bitmark, therefore providing a way to prettify / standardise bitmark markup.\n * 3. The parser should not generate a fatal error under any circumstances, because all text is valid bitmark markup.\n * - The only fatal error for a bit is if the bit header tag (e.g. [.cloze:bitmark++]) cannot be parsed. In this\n * case the bit will be ignored and an error will be added at the AST top level. Parsing will continue.\n * - If the parser encounters suspect bitmark it will generate 'warnings' which it will attach to the AST bit level\n * 4. The parser should be as fast as possible, without being overly complicated.\n *\n * Theory of operation:\n * --------------------\n *\n * The parser splits the parse into multiple parses. This makes the parser much easier to write and understand than\n * attempting to parse the entire markup in one pass.\n *\n * It also improves the performance in some cases, because although it means multiple passes over the same data, the\n * comparisions made at each pass are fewer and simpler.\n *\n * The parser has the following parse entry points:\n * - bitmark (external code should use this entry point)\n * - bit\n * - cardContent\n *\n * bitmark:\n *\n * This is the top level entry point for parsing a bitmark. It splits a set of bitmark bits into individual bits, and\n * passes each individual bit to the 'bit' entry point for parsing.\n *\n * bit:\n *\n * This is the top level single-bit parser. It parses the bit header, the top level tags, the body, the inline tags,\n * the card set, and the footer. The content of the card set is not parsed.\n *\n * cardContent:\n *\n * This entry point takes in the text content of each card leaf parsed out by the 'bit' parser and parses the\n * inline bits (true/false, sampleSolution, item, lead, etc tags) to produce the card set specific output for the\n * specific bit type being parsed.\n *\n * Each rule of the parser outputs one or more objects containing a 'type', 'value' and optional 'key' property.\n * The 'type' describes to this helper code what the parsed 'value' represents. If the value is not a single value,\n * but a key/value pair then 'key' will also be set.\n *\n *\n * Debugging and Development\n * -------------------------\n *\n * - To build the parser, run 'yarn build-grammar-bit'\n * - Modify the bitmark in '_simple.bitmark' to test the parser (this will be parsed after building the parser)\n * - To undersand the operation and to help debug and develop, use the DEBUG_XXX flags in the code below.\n * and in BitmarkPegParserHelper.ts\n */\n\nimport { Builder } from '../../../ast/Builder.ts';\nimport { Breakscape } from '../../../breakscaping/Breakscape.ts';\nimport { Config } from '../../../config/Config.ts';\nimport { type BreakscapedString } from '../../../model/ast/BreakscapedString.ts';\nimport { type Bit, type BitmarkAst, type BodyPart } from '../../../model/ast/Nodes.ts';\nimport { type TagsConfig } from '../../../model/config/TagsConfig.ts';\nimport { BitType } from '../../../model/enum/BitType.ts';\nimport { BodyTextFormat } from '../../../model/enum/BodyTextFormat.ts';\nimport { DeprecatedTextFormat } from '../../../model/enum/DeprecatedTextFormat.ts';\nimport { ResourceType } from '../../../model/enum/ResourceType.ts';\nimport { TextFormat } from '../../../model/enum/TextFormat.ts';\nimport { TextLocation } from '../../../model/enum/TextLocation.ts';\nimport { type ParserData } from '../../../model/parser/ParserData.ts';\nimport { type ParserError } from '../../../model/parser/ParserError.ts';\nimport { type ParserInfo } from '../../../model/parser/ParserInfo.ts';\nimport { StringUtils } from '../../../utils/StringUtils.ts';\nimport {\n type BitContent,\n BitContentLevel,\n type BitContentProcessorResult,\n type BitHeader,\n type BitmarkPegParserContext,\n type ContentDepthType,\n type ParsedCardSet,\n type ParseFunction,\n type ParserHelperOptions,\n type RawTextAndResourceType,\n type SubParserResult,\n TypeKey,\n type TypeKeyType,\n type TypeKeyValue,\n type TypeValue,\n} from './BitmarkPegParserTypes.ts';\nimport { BitmarkPegParserValidator } from './BitmarkPegParserValidator.ts';\nimport { BodyContentProcessor } from './contentProcessors/BodyContentProcessor.ts';\nimport { buildCards } from './contentProcessors/CardContentProcessor.ts';\nimport { defaultTagContentProcessor } from './contentProcessors/DefaultTagContentProcessor.ts';\nimport { FooterContentProcessor } from './contentProcessors/FooterContentProcessor.ts';\nimport { gapChainContentProcessor } from './contentProcessors/GapChainContentProcessor.ts';\nimport { itemLeadChainContentProcessor } from './contentProcessors/ItemLeadChainContentProcessor.ts';\nimport { markChainContentProcessor } from './contentProcessors/MarkChainContentProcessor.ts';\nimport { propertyContentProcessor } from './contentProcessors/PropertyContentProcessor.ts';\nimport { referenceTagContentProcessor } from './contentProcessors/ReferenceTagContentProcessor.ts';\nimport {\n buildResources,\n resourceContentProcessor,\n} from './contentProcessors/ResourceContentProcessor.ts';\nimport {\n buildTitles,\n titleTagContentProcessor,\n} from './contentProcessors/TitleTagContentProcessor.ts';\nimport { trueFalseChainContentProcessor } from './contentProcessors/TrueFalseChainContentProcessor.ts';\n\n// Debugging flags for helping develop and debug the parser\nconst ENABLE_DEBUG = true;\nconst DEBUG_DATA = true; // Include data in the debug output\nconst DEBUG_DATA_INCLUDE_PARSER = false; // Include the parser data in the debug output - very very verbose!\nconst DEBUG_BIT_RAW = true; // Print the raw bitmark\nconst DEBUG_BIT_CONTENT_RAW = false; // Print the top level parsed bit content (without chars merged to strings - will create a lot of output)\nconst DEBUG_BIT_CONTENT = true; // Print the top level parsed bit content (with BodyChar / CardChar merged)\nconst DEBUG_BIT_TAGS = true; // Print the tags extracted from the bit parsed content\nconst DEBUG_BODY = true; // Print the final parsed body\nconst DEBUG_FOOTER = true; // Print the final parsed footer\nconst DEBUG_CHAIN_CONTENT = true; // Print the parsed chain content\nconst DEBUG_CHAIN_TAGS = true; // Print the tags extracted from the parsed chain content\nconst DEBUG_CARD_SET_CONTENT = true; // Print the parsed card set content\nconst DEBUG_CARD_SET = true; // Print the card set built from the parsed card set content\nconst DEBUG_CARD_TAGS = true; // Print the tags extracted from the card content\n\n// DO NOT EDIT THIS LINE. Ensures no debug in production in case ENABLE_DEBUG is accidentally left on\nconst DEBUG = ENABLE_DEBUG && process.env.BPG_ENV === 'development';\n\nconst builder = new Builder();\n\nclass BitmarkPegParserProcessor {\n private context: BitmarkPegParserContext;\n private nonFatalWarnings: ParserError[] = [];\n private nonFatalErrors: ParserError[] = [];\n private parser: ParserInfo = {};\n\n private parse: ParseFunction;\n private parserText: () => ParserError['text'];\n private parserLocation: () => ParserError['location'];\n\n constructor(options: ParserHelperOptions) {\n this.parse = options.parse;\n this.parserText = options.parserText;\n this.parserLocation = options.parserLocation;\n\n // The context is used to pass the parser data and functions to the content builders\n this.context = {\n bitConfig: Config.getBitConfig(BitType._error),\n bitType: BitType._error,\n textFormat: TextFormat.bitmarkText,\n\n DEBUG_BIT_RAW,\n DEBUG_BIT_CONTENT_RAW,\n DEBUG_BIT_CONTENT,\n DEBUG_BIT_TAGS,\n DEBUG_BODY,\n DEBUG_FOOTER,\n DEBUG_CHAIN_CONTENT,\n DEBUG_CHAIN_TAGS,\n DEBUG_CARD_SET_CONTENT,\n DEBUG_CARD_SET,\n DEBUG_CARD_TAGS,\n\n parser: this.parser,\n\n parse: this.parse,\n bitContentProcessor: this.bitContentProcessor.bind(this),\n splitBitContent: this.splitBitContent.bind(this),\n addWarning: this.addWarning.bind(this),\n addError: this.addError.bind(this),\n debugPrint: this.debugPrint.bind(this),\n\n state: {\n //\n },\n };\n }\n\n // Build bits\n buildBits(rawBits: SubParserResult<Bit>[]): BitmarkAst {\n const bits: Bit[] = [];\n let errors: ParserError[] = [];\n\n for (const rawBit of rawBits) {\n // Ignore empty bits (only happens if entire file is empty / whitespace only\n if (!rawBit) continue;\n\n const bit = rawBit.value;\n if (bit) {\n // Add the bit to the list of bits\n bits.push(bit);\n } else {\n // TODO - convert error location to master parser location\n\n // If bit is undefined, then there was an error parsing the bit\n errors = errors.concat(rawBit.errors ?? []);\n }\n }\n\n const res = builder.buildBitmark({\n bits,\n errors: errors.length > 0 ? errors : undefined,\n });\n\n return res;\n }\n\n // Build bit\n buildBit(bitHeader: BitHeader, bitContent: BitContent[]): SubParserResult<Bit> {\n const { bitType, textFormat, resourceType, bitLevel, isCommented } = bitHeader;\n\n // Bit type was invalid, so ignore the bit, returning instead the parsing errors\n if (!bitType || Config.isOfBitType(bitType, BitType._error)) return this.invalidBit();\n\n const bitConfig = Config.getBitConfig(bitType);\n\n // Set the bit type, text format, etc in the context\n this.context.bitConfig = bitConfig;\n this.context.bitType = bitType;\n this.context.textFormat = textFormat;\n this.context.resourceType = resourceType;\n\n if (DEBUG_BIT_CONTENT_RAW) this.debugPrint('BIT CONTENT RAW', bitContent);\n\n const isTrueFalseV1 = Config.isOfBitType(bitType, BitType.trueFalse1);\n const isMultipleChoiceV1 = Config.isOfBitType(bitType, BitType.multipleChoice1);\n const isMultipleResponseV1 = Config.isOfBitType(bitType, BitType.multipleResponse1);\n\n if (DEBUG_BIT_CONTENT) this.debugPrint('BIT CONTENT', bitContent);\n\n // Rest the parser state\n this.resetParserState();\n\n // Squash inline body bits for bits / text formats that do not support inline body bits\n bitContent = this.squashUnwantedInlineBodyBits(bitContent);\n\n // Validate the bit tags\n bitContent = BitmarkPegParserValidator.validateBitTags(this.context, bitContent);\n\n // Parse the bit content into a an object with the appropriate keys\n\n const {\n body,\n footer,\n cardSet,\n title,\n statement,\n statements,\n choices,\n responses,\n propertyStyleResources,\n resources,\n posterImage,\n internalComments,\n ...tags\n } = this.bitContentProcessor(BitContentLevel.Bit, bitConfig.tags, bitContent);\n\n if (DEBUG_BIT_TAGS) this.debugPrint('BIT TAGS', tags);\n if (DEBUG_BODY) this.debugPrint('BIT BODY', body);\n if (DEBUG_FOOTER) this.debugPrint('BIT FOOTER', footer);\n\n // Build the titles for the specific bit type\n const titles = buildTitles(this.context, bitType, title);\n\n // Build the card data for the specific bit type\n const bitSpecificCards = buildCards(\n this.context,\n bitType,\n textFormat,\n cardSet,\n statement,\n statements,\n choices,\n responses,\n );\n\n // Build the resources\n const filteredResources = buildResources(this.context, resourceType, resources);\n\n // Build the final internal comments\n const internalComment = [\n ...(internalComments ?? []),\n ...(bitSpecificCards.internalComments ?? []),\n ];\n\n // Build the warnings and errors for the parser object\n const warnings = this.buildBitLevelWarnings();\n const errors = this.buildBitLevelErrors();\n if (warnings) this.parser.warnings = warnings;\n if (errors) this.parser.errors = errors;\n\n // Build the final bit\n const bit = builder.buildBit({\n bitType,\n bitLevel,\n isCommented,\n textFormat,\n resourceType,\n ...titles,\n posterImage: posterImage as string,\n statement: isTrueFalseV1 ? statement : undefined,\n choices: isMultipleChoiceV1 ? choices : undefined,\n responses: isMultipleResponseV1 ? responses : undefined,\n ...tags,\n ...propertyStyleResources,\n resources: filteredResources,\n ...bitSpecificCards,\n body,\n footer,\n internalComment,\n parser: this.parser,\n });\n\n return { value: bit };\n }\n\n // Build bit for data that cannot be parsed\n invalidBit(bitData?: unknown): SubParserResult<Bit> {\n // Create the error is bitData is defined (else it was created when parsing the header)\n if (bitData) this.addError(`Invalid bit`);\n\n // Build the errors\n this.parser.errors = this.buildBitLevelErrors();\n\n // Build the error bit\n const bit = builder.buildBit({\n bitType: Config.getBitType(BitType._error),\n bitLevel: 1,\n parser: this.parser,\n });\n\n return { value: bit };\n }\n\n // Build bit header\n buildBitHeader(\n bitTypeBreakscaped: BreakscapedString,\n bitLevel: number,\n textFormatAndResourceType: RawTextAndResourceType,\n ): BitHeader {\n // Unbreakscape the bit type\n const bitType = Breakscape.unbreakscape(bitTypeBreakscaped, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n });\n\n // Get / check bit type\n const validBitType = Config.getBitType(bitType);\n const commented = Config.isBitTypeCommented(bitType);\n\n if (Config.isOfBitType(validBitType, BitType._error)) {\n this.addError(`Invalid bit type: '${bitType}'`);\n }\n\n const bitConfig = Config.getBitConfig(validBitType);\n\n // Bit level\n if (bitLevel > Config.bitLevelMax) {\n this.addWarning(\n `Bit level of ${bitLevel} too high, setting to max value of ${Config.bitLevelMax}`,\n );\n bitLevel = Config.bitLevelMax;\n } else if (bitLevel < Config.bitLevelMin) {\n this.addWarning(\n `Bit level of ${bitLevel} too low, setting to min value of ${Config.bitLevelMin}`,\n );\n bitLevel = Config.bitLevelMin;\n }\n\n // Text format\n let textFormat = TextFormat.fromValue(textFormatAndResourceType.textFormat);\n const isInvalidTextFormat = textFormatAndResourceType.textFormat && !textFormat;\n if (isInvalidTextFormat) {\n this.addWarning(\n `Invalid text format '${textFormatAndResourceType.textFormat}', defaulting to '${BodyTextFormat.bitmarkPlusPlus}'`,\n );\n }\n\n // Deprecated warning for bitmark--\n const deprecatedTextFormat = DeprecatedTextFormat.fromValue(\n textFormatAndResourceType.textFormat,\n );\n if (deprecatedTextFormat) {\n textFormat = TextFormat.bitmarkText;\n this.addWarning(\n `${deprecatedTextFormat} text format is deprecated. Bit will be parsed as '${BodyTextFormat.bitmarkPlusPlus}'`,\n );\n }\n\n textFormat = textFormat ?? bitConfig.textFormatDefault;\n\n // Resource type\n const resourceType = ResourceType.fromValue(textFormatAndResourceType.resourceType);\n if (textFormatAndResourceType.resourceType && !resourceType) {\n this.addWarning(\n `Invalid resource type '${textFormatAndResourceType.resourceType}', it will be ignored`,\n );\n }\n\n return {\n bitType: validBitType,\n bitLevel,\n textFormat: textFormat ?? bitConfig.textFormatDefault,\n resourceType,\n isCommented: commented,\n };\n }\n\n // Build text and resource type\n buildTextAndResourceType(\n value1: TypeValue | undefined,\n value2: TypeValue | undefined,\n ): RawTextAndResourceType {\n const res: RawTextAndResourceType = {};\n\n const processValue = (value: TypeValue | undefined) => {\n if (value) {\n const val = Breakscape.unbreakscape(StringUtils.string(value.value) as BreakscapedString, {\n format: TextFormat.plainText,\n location: TextLocation.tag,\n });\n if (value.type === TypeKey.TextFormat) {\n // Set text format\n res.textFormat = val;\n } else {\n // Set resource type\n res.resourceType = val;\n }\n }\n };\n processValue(value1);\n processValue(value2);\n\n return res;\n }\n\n /**\n * Reset the parser state\n *\n */\n private resetParserState() {\n this.context.state = {};\n }\n\n /**\n * Process Type/Key/Value data, squashing inline body bits back into text for bits / body text formats that\n * do not support them, and for after the plain text tag '$$$$'.\n *\n * @param data the bit content (Type/Key/Value data)\n * @returns\n */\n private squashUnwantedInlineBodyBits(data: BitContent[]): BitContent[] {\n const result: BitContent[] = [];\n if (!data) return result;\n\n const { textFormat } = this.context;\n\n const isBitmarkText = textFormat === TextFormat.bitmarkText;\n\n // Format: text / latex\n // Body bits are only supported up to the first BodyText tag.\n // Squash the subsequent body bits back into text.\n\n const convertTagToTextRecursive = (tag: BitContent, str = ''): string => {\n const { chain, parser } = tag as TypeKeyValue;\n str += parser.text;\n if (chain) {\n for (const t of chain) {\n str = convertTagToTextRecursive(t, str);\n }\n }\n return str;\n };\n\n // New code: Only tags before the $$$$ tag (or first text if not bitmark--/++) are interpreted as tags\n // all other tags are squashed back to text\n let inPlainText = false;\n for (const content of data) {\n const { type, value } = content as TypeKeyValue;\n const valueStr = (value ?? '') as string;\n let atPlainTextDivider = false;\n\n if (!inPlainText) {\n if (type === TypeKey.BodyText && !isBitmarkText && valueStr && valueStr.trim()) {\n inPlainText = true;\n }\n if (type === TypeKey.PlainTextDivider) {\n inPlainText = true;\n atPlainTextDivider = true;\n }\n }\n\n if (!atPlainTextDivider) {\n if (inPlainText) {\n if (type === TypeKey.BodyText) {\n result.push({ type: TypeKey.BodyTextPlain, value } as TypeValue);\n } else {\n const s = convertTagToTextRecursive(content);\n result.push({ type: TypeKey.BodyTextPlain, value: s } as TypeValue);\n }\n } else {\n result.push(content);\n }\n } else {\n result.push({ type: TypeKey.BodyText, value: '\\n' } as TypeValue);\n }\n }\n\n return result;\n }\n\n /**\n * Process Type/Key/Value data, building the bit parts as AST nodes.\n *\n * @param bitType bit type\n * @param textFormat bit text format type\n * @param contentDepth bit level (in chain, in card etc)\n * @param tagsConfig tags configuration at this parser level (pass undef)\n * @param data the bit content (Type/Key/Value data)\n * @returns\n */\n private bitContentProcessor(\n contentDepth: ContentDepthType,\n tagsConfig: TagsConfig | undefined,\n data: BitContent[] | undefined,\n ): BitContentProcessorResult {\n const result: BitContentProcessorResult = {};\n if (!data) return result;\n\n const { bitType, textFormat } = this.context;\n\n result.title = [];\n result.solutions = [];\n result.__solutionsAst = [];\n result.statements = [];\n result.choices = [];\n result.responses = [];\n result.propertyStyleResources = {};\n result.resources = [];\n result.trueFalse = [];\n result.markConfig = [];\n result.extraProperties = {};\n result.internalComments = [];\n\n let seenReference = false;\n let inFooter = false;\n const bodyParts: BodyPart[] = [];\n let bodyTextPart: BreakscapedString = Breakscape.EMPTY_STRING;\n let footer: BreakscapedString = Breakscape.EMPTY_STRING;\n let bodyPlainText: BreakscapedString = Breakscape.EMPTY_STRING;\n let footerPlainText: BreakscapedString = Breakscape.EMPTY_STRING;\n // let cardBody: BreakscapedString = Breakscape.EMPTY_STRING;\n\n const inBit = contentDepth === BitContentLevel.Bit;\n const inCard = contentDepth === BitContentLevel.Card;\n const inChain = contentDepth === BitContentLevel.Chain;\n\n // Helper for building the body text\n const addBodyText = () => {\n if (bodyTextPart) {\n // Validate the body part\n bodyTextPart = BitmarkPegParserValidator.checkBodyPart(\n this.context,\n contentDepth,\n bodyTextPart,\n );\n\n const bodyText = BodyContentProcessor.buildBodyText(bodyTextPart, false);\n bodyParts.push(bodyText);\n }\n bodyTextPart = Breakscape.EMPTY_STRING;\n };\n\n // Reduce the Type/Key/Value data to a single object that can be used to build the bit\n // let _index = 0;\n for (const content of data) {\n const { type, value } = content as TypeKeyValue;\n\n switch (type) {\n case TypeKey.ItemLead: {\n itemLeadChainContentProcessor(this.context, contentDepth, tagsConfig, content, result);\n break;\n }\n\n case TypeKey.Instruction:\n case TypeKey.Hint:\n case TypeKey.Anchor:\n case TypeKey.SampleSolution:\n defaultTagContentProcessor(this.context, contentDepth, tagsConfig, content, result);\n break;\n\n case TypeKey.Reference:\n referenceTagContentProcessor(\n this.context,\n contentDepth,\n tagsConfig,\n content,\n result,\n seenReference,\n );\n seenReference = true;\n break;\n\n case TypeKey.Title:\n titleTagContentProcessor(this.context, contentDepth, tagsConfig, content, result);\n break;\n\n case TypeKey.Property:\n propertyContentProcessor(this.context, contentDepth, tagsConfig, content, result);\n break;\n\n case TypeKey.Gap: {\n if (!inChain) addBodyText(); // Body bit, so add the body text\n gapChainContentProcessor(\n this.context,\n contentDepth,\n tagsConfig,\n content,\n result,\n bodyParts,\n );\n break;\n }\n\n case TypeKey.Mark: {\n if (!inChain) addBodyText(); // Body bit, so add the body text\n markChainContentProcessor(\n this.context,\n contentDepth,\n tagsConfig,\n content,\n result,\n bodyParts,\n );\n break;\n }\n\n case TypeKey.True:\n case TypeKey.False: {\n if (!inChain) addBodyText(); // Body bit, so add the body text\n trueFalseChainContentProcessor(\n this.context,\n contentDepth,\n tagsConfig,\n content,\n result,\n bodyParts,\n );\n break;\n }\n\n case TypeKey.Resource:\n resourceContentProcessor(this.context, contentDepth, tagsConfig, content, result);\n break;\n\n case TypeKey.CardSet: {\n result.cardSet = value as ParsedCardSet;\n inFooter = true; // After the card set, body lines should be written to the footer rather than the body\n break;\n }\n\n case TypeKey.BodyText:\n case TypeKey.CardText: {\n if (inFooter) {\n footer = Breakscape.concatenate(footer, value as BreakscapedString);\n } else {\n bodyTextPart = Breakscape.concatenate(bodyTextPart, value as BreakscapedString);\n }\n break;\n }\n\n case TypeKey.BodyTextPlain: {\n if (inFooter) {\n footerPlainText = Breakscape.concatenate(footerPlainText, value as BreakscapedString);\n } else {\n bodyPlainText = Breakscape.concatenate(bodyPlainText, value as BreakscapedString);\n }\n break;\n }\n\n case TypeKey.FooterDivider: {\n if (inFooter) {\n // If already in footer, handle the content as if it is footer (body) text\n footer = Breakscape.concatenate(footer, value as BreakscapedString);\n }\n inFooter = true; // After the footer divider, body lines should be written to the footer rather than the body\n break;\n }\n\n default:\n // Unknown tag\n }\n\n // _index++;\n }\n\n // Add the last body text part, and trim the body text parts\n addBodyText();\n\n // Add the plain texts if they exist\n const bodyPlainTextNode = bodyPlainText\n ? BodyContentProcessor.buildBodyText(bodyPlainText, true)\n : undefined;\n if (bodyPlainTextNode) bodyParts.push(bodyPlainTextNode);\n\n // Spread the chained item / lead / etc\n // Set the lead item from the chain\n if (result.itemLead) {\n const l = result.itemLead.length;\n if (l > 0) result.item = result.itemLead[0];\n if (l > 1) result.lead = result.itemLead[1];\n if (l > 2) result.pageNumber = result.itemLead[2];\n if (l > 3) result.marginNumber = result.itemLead[l - 1];\n }\n\n // Validate and build the body (trimmed)\n if (inBit) {\n result.body = BodyContentProcessor.process(\n this.context,\n contentDepth,\n bitType,\n textFormat,\n tagsConfig,\n result,\n bodyParts,\n false,\n );\n // bodyParts.length > 0 ? builder.body({ bodyParts: this.trimBodyParts(bodyParts) }) : undefined;\n // result.body = BitmarkPegParserValidator.checkBody(this.context, contentDepth, bitType, textFormat, result.body);\n } else if (inCard) {\n result.cardBody = BodyContentProcessor.process(\n this.context,\n contentDepth,\n bitType,\n textFormat,\n tagsConfig,\n result,\n bodyParts,\n true,\n );\n // result.cardBody = bodyParts.length > 0 ? builder.body({ bodyParts: this.trimBodyParts(bodyParts) }) : undefined;\n // Card body is validated in CardContentProcessor:processCardSet()\n }\n\n // Validate and build the footer (trimmed)\n // footer = footer.trim() as BreakscapedString;\n // footerPlainText = footerPlainText.trim() as BreakscapedString;\n // if (footer || footerPlainText) {\n // if (footer) {\n // footer = BitmarkPegParserValidator.checkFooter(this.context, contentDepth, bitType, footer);\n // }\n // const footerTexts: FooterText[] = [];\n // const footerNode = footer ? builder.footerText({ text: footer }, false) : undefined;\n // const footerPlainTextNode = footerPlainText ? builder.footerText({ text: footerPlainText }, true) : undefined;\n // if (footerNode) footerTexts.push(footerNode);\n // if (footerPlainTextNode) footerTexts.push(footerPlainTextNode);\n // if (footer) {\n // result.footer =\n // footerTexts.length > 0 ? builder.footer({ footerParts: this.trimFooterTexts(footerTexts) }) : undefined;\n // }\n // }\n result.footer = FooterContentProcessor.process(\n this.context,\n contentDepth,\n tagsConfig,\n result,\n footer,\n footerPlainText,\n );\n\n // // Add card body (validated elsewhere)\n // cardBody = cardBody.trim() as BreakscapedString;\n // if (cardBody) {\n // result.cardBody = cardBody;\n // }\n\n // Remove the extra properties if there are none\n if (Object.keys(result.extraProperties).length === 0) delete result.extraProperties;\n\n // Remove the unwanted empty arrays.\n if (result.title.length === 0) delete result.title;\n if (result.solutions.length === 0) delete result.solutions;\n if (result.statements.length === 0) delete result.statements;\n if (result.choices.length === 0) delete result.choices;\n if (result.responses.length === 0) delete result.responses;\n if (result.trueFalse.length === 0) delete result.trueFalse;\n if (result.markConfig.length === 0) delete result.markConfig;\n if (Object.keys(result.propertyStyleResources).length === 0)\n delete result.propertyStyleResources;\n if (result.resources.length === 0) delete result.resources;\n if (result.internalComments.length === 0) delete result.internalComments;\n\n return result;\n }\n\n private buildBitLevelWarnings(): ParserError[] | undefined {\n let warnings: ParserError[] | undefined;\n if (this.nonFatalWarnings.length > 0) {\n warnings = this.nonFatalWarnings;\n this.nonFatalWarnings = [];\n }\n return warnings;\n }\n\n private buildBitLevelErrors(): ParserError[] | undefined {\n let errors: ParserError[] | undefined;\n if (this.nonFatalErrors.length > 0) {\n errors = this.nonFatalErrors;\n this.nonFatalErrors = [];\n }\n return errors;\n }\n\n /**\n * Split bit content into parts based on the given type keys\n *\n * @param bitContent bit content to split\n * @param types to split on\n */\n private splitBitContent(bitContent: BitContent[], types: TypeKeyType[]): BitContent[][] {\n const parts: BitContent[][] = [];\n let part: BitContent[] = [];\n\n for (const c of bitContent) {\n if (types.includes(c.type as TypeKeyType)) {\n if (part.length > 0) parts.push(part);\n part = [];\n }\n part.push(c);\n }\n\n if (part.length > 0) parts.push(part);\n\n return parts;\n }\n\n //\n // Util functions\n //\n\n /**\n * Add an warning to the list of non-fatal warnings\n * @param message The error message\n * @param parserData Parser data - if not set, the current parser data will be used\n * @param parserDataOriginal Parser data of the original instance of a duplicate error\n */\n private addWarning(message: string, parserData?: ParserData, parserDataOriginal?: ParserData) {\n const warning: ParserError = {\n message,\n text: parserData?.parser.text ?? this.parserText(),\n location: parserData?.parser.location ?? this.parserLocation(),\n original: parserDataOriginal?.parser ?? undefined,\n };\n if (!warning.original) delete warning.original;\n\n this.nonFatalWarnings.push(warning);\n }\n\n /**\n * Add an error to the list of non-fatal errors\n * @param message The error message\n * @param parserData Parser data - if not set, the current parser data will be used\n * @param parserDataOriginal Parser data of the original instance of a duplicate error\n */\n private addError(message: string, parserData?: ParserData, parserDataOriginal?: ParserData) {\n const error: ParserError = {\n message,\n text: parserData?.parser.text ?? this.parserText(),\n location: parserData?.parser.location ?? this.parserLocation(),\n original: parserDataOriginal?.parser ?? undefined,\n };\n if (!error.original) delete error.original;\n\n this.nonFatalErrors.push(error);\n }\n\n /**\n * Print out data for debugging\n *\n * @param header\n * @param data\n */\n private debugPrint(header: string, data: unknown): void {\n /* STRIP:START */\n if (DEBUG) {\n if (DEBUG_DATA) {\n // Strip 'parser' out of the data, otherwise it is too verbose\n if (!DEBUG_DATA_INCLUDE_PARSER) {\n if (data != undefined) {\n data = JSON.parse(JSON.stringify(data, (k, v) => (k === 'parser' ? undefined : v)));\n }\n }\n\n console.log(`===== START: ${header} =====`);\n console.log(JSON.stringify(data, null, 2));\n console.log(`===== END: ${header} =====`);\n } else {\n console.log(`- DEBUG: ${header}`);\n }\n }\n /* STRIP:END */\n }\n}\n\nexport { BitmarkPegParserProcessor };\n","// @generated by Peggy 5.0.5.\n//\n// https://peggyjs.org/\n\nimport { TypeKey } from \"../../../parser/bitmark/peg/BitmarkPegParserTypes.ts\";\nimport { BitmarkPegParserHelper } from \"../../../parser/bitmark/peg/BitmarkPegParserHelper.ts\";\nimport { BitmarkPegParserProcessor } from \"../../../parser/bitmark/peg/BitmarkPegParserProcessor.ts\";\nimport { Breakscape } from \"../../../breakscaping/Breakscape.ts\";\n\n\n // GLOBAL JS\n\n//\n// Global variables\n//\n\n// None\n\n\nclass peg$SyntaxError extends SyntaxError {\n constructor(message, expected, found, location) {\n super(message);\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n }\n\n format(sources) {\n let str = \"Error: \" + this.message;\n if (this.location) {\n let src = null;\n const st = sources.find(s => s.source === this.location.source);\n if (st) {\n src = st.text.split(/\\r\\n|\\n|\\r/g);\n }\n const s = this.location.start;\n const offset_s = (this.location.source && (typeof this.location.source.offset === \"function\"))\n ? this.location.source.offset(s)\n : s;\n const loc = this.location.source + \":\" + offset_s.line + \":\" + offset_s.column;\n if (src) {\n const e = this.location.end;\n const filler = \"\".padEnd(offset_s.line.toString().length, \" \");\n const line = src[s.line - 1];\n const last = s.line === e.line ? e.column : line.length + 1;\n const hatLen = (last - s.column) || 1;\n str += \"\\n --> \" + loc + \"\\n\"\n + filler + \" |\\n\"\n + offset_s.line + \" | \" + line + \"\\n\"\n + filler + \" | \" + \"\".padEnd(s.column - 1, \" \")\n + \"\".padEnd(hatLen, \"^\");\n } else {\n str += \"\\n at \" + loc;\n }\n }\n return str;\n }\n\n static buildMessage(expected, found) {\n function hex(ch) {\n return ch.codePointAt(0).toString(16).toUpperCase();\n }\n\n const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, \"unicode\")\n ? new RegExp(\"[\\\\p{C}\\\\p{Mn}\\\\p{Mc}]\", \"gu\")\n : null;\n function unicodeEscape(s) {\n if (nonPrintable) {\n return s.replace(nonPrintable, ch => \"\\\\u{\" + hex(ch) + \"}\");\n }\n return s;\n }\n\n function literalEscape(s) {\n return unicodeEscape(s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, \"\\\\\\\"\")\n .replace(/\\0/g, \"\\\\0\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/[\\x00-\\x0F]/g, ch => \"\\\\x0\" + hex(ch))\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, ch => \"\\\\x\" + hex(ch)));\n }\n\n function classEscape(s) {\n return unicodeEscape(s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\]/g, \"\\\\]\")\n .replace(/\\^/g, \"\\\\^\")\n .replace(/-/g, \"\\\\-\")\n .replace(/\\0/g, \"\\\\0\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/[\\x00-\\x0F]/g, ch => \"\\\\x0\" + hex(ch))\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, ch => \"\\\\x\" + hex(ch)));\n }\n\n const DESCRIBE_EXPECTATION_FNS = {\n literal(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n class(expectation) {\n const escapedParts = expectation.parts.map(\n part => (Array.isArray(part)\n ? classEscape(part[0]) + \"-\" + classEscape(part[1])\n : classEscape(part))\n );\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts.join(\"\") + \"]\" + (expectation.unicode ? \"u\" : \"\");\n },\n\n any() {\n return \"any character\";\n },\n\n end() {\n return \"end of input\";\n },\n\n other(expectation) {\n return expectation.description;\n },\n };\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n const descriptions = expected.map(describeExpectation);\n descriptions.sort();\n\n if (descriptions.length > 0) {\n let j = 1;\n for (let i = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n }\n}\n\nfunction peg$parse(input, options) {\n options = options !== undefined ? options : {};\n\n const peg$FAILED = {};\n const peg$source = options.grammarSource;\n\n const peg$startRuleFunctions = {\n bitmark: peg$parsebitmark,\n bit: peg$parsebit,\n cardContent: peg$parsecardContent,\n };\n let peg$startRuleFunction = peg$parsebitmark;\n\n const peg$c0 = \"[.\";\n const peg$c1 = \"]\";\n const peg$c2 = \"[\";\n const peg$c3 = \":\";\n const peg$c4 = \"&\";\n const peg$c5 = \"$$$$\";\n const peg$c6 = \"====\";\n const peg$c7 = \"text\";\n const peg$c8 = \"~~~~\";\n const peg$c9 = \"footer\";\n const peg$c10 = \"--\";\n const peg$c11 = \"++\";\n const peg$c12 = \"===\";\n const peg$c13 = \"==\";\n const peg$c14 = \"[@id\";\n const peg$c15 = \"#\";\n const peg$c16 = \"[\\u25BC\";\n const peg$c17 = \"[\\u25BA\";\n const peg$c18 = \"[@\";\n const peg$c19 = \"[%\";\n const peg$c20 = \"[!\";\n const peg$c21 = \"[?\";\n const peg$c22 = \"[+\";\n const peg$c23 = \"[-\";\n const peg$c24 = \"[$\";\n const peg$c25 = \"[_\";\n const peg$c26 = \"[=\";\n const peg$c27 = \"[&\";\n const peg$c28 = \"^]\";\n const peg$c29 = \"id:\";\n const peg$c30 = \".\";\n const peg$c31 = \"\\n\";\n const peg$c32 = \"\\r\\n\";\n\n const peg$r0 = /^[^\\]]/;\n const peg$r1 = /^[^:\\]]/;\n const peg$r2 = /^[^&:\\]]/;\n const peg$r3 = /^[^\\n\\r\\u2028\\u2029]/;\n const peg$r4 = /^[ \\t]/;\n const peg$r5 = /^[\\r\\u2028-\\u2029]/;\n const peg$r6 = /^[ \\t\\n\\r\\u2028\\u2029]/;\n\n const peg$e0 = peg$literalExpectation(\"[.\", false);\n const peg$e1 = peg$classExpectation([\"]\"], true, false, false);\n const peg$e2 = peg$literalExpectation(\"]\", false);\n const peg$e3 = peg$literalExpectation(\"[\", false);\n const peg$e4 = peg$literalExpectation(\":\", false);\n const peg$e5 = peg$literalExpectation(\"&\", false);\n const peg$e6 = peg$anyExpectation();\n const peg$e7 = peg$literalExpectation(\"$$$$\", false);\n const peg$e8 = peg$literalExpectation(\"====\", false);\n const peg$e9 = peg$literalExpectation(\"text\", false);\n const peg$e10 = peg$literalExpectation(\"~~~~\", false);\n const peg$e11 = peg$literalExpectation(\"footer\", false);\n const peg$e12 = peg$literalExpectation(\"--\", false);\n const peg$e13 = peg$literalExpectation(\"++\", false);\n const peg$e14 = peg$literalExpectation(\"===\", false);\n const peg$e15 = peg$literalExpectation(\"==\", false);\n const peg$e16 = peg$literalExpectation(\"[@id\", false);\n const peg$e17 = peg$literalExpectation(\"#\", false);\n const peg$e18 = peg$literalExpectation(\"[\\u25BC\", false);\n const peg$e19 = peg$literalExpectation(\"[\\u25BA\", false);\n const peg$e20 = peg$literalExpectation(\"[@\", false);\n const peg$e21 = peg$literalExpectation(\"[%\", false);\n const peg$e22 = peg$literalExpectation(\"[!\", false);\n const peg$e23 = peg$literalExpectation(\"[?\", false);\n const peg$e24 = peg$literalExpectation(\"[+\", false);\n const peg$e25 = peg$literalExpectation(\"[-\", false);\n const peg$e26 = peg$literalExpectation(\"[$\", false);\n const peg$e27 = peg$literalExpectation(\"[_\", false);\n const peg$e28 = peg$literalExpectation(\"[=\", false);\n const peg$e29 = peg$literalExpectation(\"[&\", false);\n const peg$e30 = peg$literalExpectation(\"^]\", false);\n const peg$e31 = peg$literalExpectation(\"id:\", false);\n const peg$e32 = peg$classExpectation([\":\", \"]\"], true, false, false);\n const peg$e33 = peg$literalExpectation(\".\", false);\n const peg$e34 = peg$classExpectation([\"&\", \":\", \"]\"], true, false, false);\n const peg$e35 = peg$otherExpectation(\"Character\");\n const peg$e36 = peg$classExpectation([\"\\n\", \"\\r\", \"\\u2028\", \"\\u2029\"], true, false, false);\n const peg$e37 = peg$otherExpectation(\"Blank Line\");\n const peg$e38 = peg$classExpectation([\" \", \"\\t\"], false, false, false);\n const peg$e39 = peg$otherExpectation(\"Line Terminator\");\n const peg$e40 = peg$literalExpectation(\"\\n\", false);\n const peg$e41 = peg$literalExpectation(\"\\r\\n\", false);\n const peg$e42 = peg$classExpectation([\"\\r\", [\"\\u2028\", \"\\u2029\"]], false, false, false);\n const peg$e43 = peg$otherExpectation(\"Whitespace, then Line Terminator\");\n const peg$e44 = peg$otherExpectation(\"whitespace\");\n const peg$e45 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\", \"\\u2028\", \"\\u2029\"], false, false, false);\n\n function peg$f0(firstBit, bits) { return processor.buildBits([ firstBit, ...bits]) }\n function peg$f1(bit) { return helper.handleRawBit(bit); }\n function peg$f2(bit) { return bit; }\n function peg$f3(bit) { return helper.handleRawBit(bit); }\n function peg$f4(bitHeader) { return bitHeader; }\n function peg$f5(bit) { return bit }\n function peg$f6(bitHeader, bitContent) { return processor.buildBit(bitHeader, bitContent) }\n function peg$f7(bit) { return processor.invalidBit(bit) }\n function peg$f8(bitLevel, bitType, formatAndResource) { return processor.buildBitHeader(bitType, bitLevel, formatAndResource) }\n function peg$f9(value1, value2) { return processor.buildTextAndResourceType(value1, value2) }\n function peg$f10(value) { return helper.handleTextFormat(value) }\n function peg$f11(value) { return helper.handleResourceType(value) }\n function peg$f12(value) { return helper.handleBitContent(value) }\n function peg$f13(value) { return helper.handleTagChain(value) }\n function peg$f14(value) { return value }\n function peg$f15(value) { return helper.handleBitTag(value) }\n function peg$f16(value) { return { type: TypeKey.BodyChar, value: value } }\n function peg$f17(value) { return helper.handlePlainTextDivider(value); }\n function peg$f18(value) { return helper.handleFooterDivider(value); }\n function peg$f19(value) { return helper.handleCardSet(value[1].flat()); }\n function peg$f20() { helper.handleCardSetStart(); }\n function peg$f21() { helper.handleCardSetEnd(); }\n function peg$f22(value) { return helper.handleCards(value); }\n function peg$f23(value) { return helper.handleCardLineOrDivider(value, 2); }\n function peg$f24(value) { return helper.handleCardLine(value); }\n function peg$f25(value) { return helper.handleCardSet(value[1].flat()); }\n function peg$f26() { helper.handleCardSetStart(); }\n function peg$f27() { helper.handleCardSetEnd(); }\n function peg$f28(value) { return helper.handleCards(value); }\n function peg$f29(value) { return helper.handleCardLineOrDivider(value, 1); }\n function peg$f30(value) { return helper.handleCardLine(value); }\n function peg$f31(value) { return helper.handleCardContent(value); }\n function peg$f32(value) { return { type: TypeKey.CardChar, value: value } }\n function peg$f33(value) { return helper.handlePropertyTag(\"id\", value) }\n function peg$f34(level, title) { return helper.handleTag(TypeKey.Title, { level, title }) }\n function peg$f35(value) { return helper.handleTag(TypeKey.Anchor, value) }\n function peg$f36(value) { return helper.handleTag(TypeKey.Reference, value) }\n function peg$f37(key, value) { return helper.handlePropertyTag(key, value) }\n function peg$f38(value) { return helper.handleTag(TypeKey.ItemLead, value) }\n function peg$f39(value) { return helper.handleTag(TypeKey.Instruction, value) }\n function peg$f40(value) { return helper.handleTag(TypeKey.Hint, value) }\n function peg$f41(value) { return helper.handleTag(TypeKey.True, value) }\n function peg$f42(value) { return helper.handleTag(TypeKey.False, value) }\n function peg$f43(value) { return helper.handleTag(TypeKey.SampleSolution, value) }\n function peg$f44(value) { return helper.handleTag(TypeKey.Gap, value) }\n function peg$f45(value) { return helper.handleTag(TypeKey.Mark, value) }\n function peg$f46(key, value) { return helper.handleResourceTag(key, value); }\n function peg$f47(value) { return value }\n function peg$f48(value) { return value ? value.trim() : '' }\n function peg$f49(value) { return value.length }\n function peg$f50(value) { return value ? value.trim() : null }\n function peg$f51(value) { return value ? value.trim() : '' }\n function peg$f52() { return true }\n let peg$currPos = options.peg$currPos | 0;\n let peg$savedPos = peg$currPos;\n const peg$posDetailsCache = [{ line: 1, column: 1 }];\n let peg$maxFailPos = peg$currPos;\n let peg$maxFailExpected = options.peg$maxFailExpected || [];\n let peg$silentFails = options.peg$silentFails | 0;\n\n let peg$result;\n\n if (options.startRule) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function offset() {\n return peg$savedPos;\n }\n\n function range() {\n return {\n source: peg$source,\n start: peg$savedPos,\n end: peg$currPos,\n };\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== undefined\n ? location\n : peg$computeLocation(peg$savedPos, peg$currPos);\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== undefined\n ? location\n : peg$computeLocation(peg$savedPos, peg$currPos);\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$getUnicode(pos = peg$currPos) {\n const cp = input.codePointAt(pos);\n if (cp === undefined) {\n return \"\";\n }\n return String.fromCodePoint(cp);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text, ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase, unicode) {\n return { type: \"class\", parts, inverted, ignoreCase, unicode };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description };\n }\n\n function peg$computePosDetails(pos) {\n let details = peg$posDetailsCache[pos];\n let p;\n\n if (details) {\n return details;\n } else {\n if (pos >= peg$posDetailsCache.length) {\n p = peg$posDetailsCache.length - 1;\n } else {\n p = pos;\n while (!peg$posDetailsCache[--p]) {}\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column,\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos, offset) {\n const startPosDetails = peg$computePosDetails(startPos);\n const endPosDetails = peg$computePosDetails(endPos);\n\n const res = {\n source: peg$source,\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column,\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column,\n },\n };\n if (offset && peg$source && (typeof peg$source.offset === \"function\")) {\n res.start = peg$source.offset(res.start);\n res.end = peg$source.offset(res.end);\n }\n return res;\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parsebitmark() {\n let s0;\n\n s0 = peg$parseBM_Bitmark();\n\n return s0;\n }\n\n function peg$parseBM_Bitmark() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseWS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseWS();\n }\n s2 = peg$parseBM_FirstBit();\n s3 = peg$parseBM_Bits();\n peg$savedPos = s0;\n s0 = peg$f0(s2, s3);\n\n return s0;\n }\n\n function peg$parseBM_FirstBit() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n s3 = peg$parseBM_BodyLine();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseBM_BodyLine();\n }\n s1 = input.substring(s1, peg$currPos);\n peg$savedPos = s0;\n s1 = peg$f1(s1);\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseBM_Bits() {\n let s0, s1;\n\n s0 = [];\n s1 = peg$parseBM_NL_Bit();\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n s1 = peg$parseBM_NL_Bit();\n }\n\n return s0;\n }\n\n function peg$parseBM_NL_Bit() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseBlankLine();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseBlankLine();\n }\n s2 = peg$parseNL();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n s3 = peg$parseBM_Bit();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f2(s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBM_Bit() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n s3 = peg$parseBM_BitHeader();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseBM_BodyLine();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseBM_BodyLine();\n }\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f3(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseBM_BitHeader() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c0) {\n s1 = peg$c0;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = input.charAt(peg$currPos);\n if (peg$r0.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = input.charAt(peg$currPos);\n if (peg$r0.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s3 = peg$c1;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f4(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBM_BodyLine() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$parseNL();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n s3 = peg$parseBitHeader();\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = [];\n s1 = peg$parseChar();\n if (s1 !== peg$FAILED) {\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n s1 = peg$parseChar();\n }\n } else {\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsebit() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseBlankLine();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseBlankLine();\n }\n s2 = peg$parseBit();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseBlankLine();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseBlankLine();\n }\n peg$savedPos = s0;\n s0 = peg$f5(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBit() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseBitHeader();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBitContent();\n peg$savedPos = s0;\n s0 = peg$f6(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseAnything();\n s1 = input.substring(s1, peg$currPos);\n peg$savedPos = s0;\n s1 = peg$f7(s1);\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseBitHeader() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBit_Level();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseBit_Value();\n s4 = peg$parseTextFormatAndResourceType();\n if (input.charCodeAt(peg$currPos) === 93) {\n s5 = peg$c1;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f8(s2, s3, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseTextFormatAndResourceType() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parseTextFormat();\n if (s1 === peg$FAILED) {\n s1 = peg$parseResourceType();\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseTextFormat();\n if (s2 === peg$FAILED) {\n s2 = peg$parseResourceType();\n }\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f9(s1, s2);\n\n return s0;\n }\n\n function peg$parseTextFormat() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 58) {\n s1 = peg$c3;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBit_Value();\n peg$savedPos = s0;\n s0 = peg$f10(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseResourceType() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 38) {\n s1 = peg$c4;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e5); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBit_Value();\n peg$savedPos = s0;\n s0 = peg$f11(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBitContent() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseDivider();\n if (s2 === peg$FAILED) {\n s2 = peg$parseCardSet_V2();\n if (s2 === peg$FAILED) {\n s2 = peg$parseCardSet_V1();\n if (s2 === peg$FAILED) {\n s2 = peg$parseTagChain();\n if (s2 === peg$FAILED) {\n s2 = peg$parseBodyChar();\n }\n }\n }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseDivider();\n if (s2 === peg$FAILED) {\n s2 = peg$parseCardSet_V2();\n if (s2 === peg$FAILED) {\n s2 = peg$parseCardSet_V1();\n if (s2 === peg$FAILED) {\n s2 = peg$parseTagChain();\n if (s2 === peg$FAILED) {\n s2 = peg$parseBodyChar();\n }\n }\n }\n }\n }\n peg$savedPos = s0;\n s1 = peg$f12(s1);\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseTagChain() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseBitTag();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseChainedBitTag();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseChainedBitTag();\n }\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f13(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseChainedBitTag() {\n let s0, s1;\n\n s0 = peg$currPos;\n s1 = peg$parseBitTag();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f14(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseBitTag() {\n let s0, s1;\n\n s0 = peg$currPos;\n s1 = peg$parseIDTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parsePropertyTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseTitleTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseAnchorTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseReferenceTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseItemLeadTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseInstructionTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseHintTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseGapTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseMarkTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseSampleSolutionTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseTrueTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseFalseTag();\n if (s1 === peg$FAILED) {\n s1 = peg$parseResourceTag();\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f15(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseBodyChar() {\n let s0, s1;\n\n s0 = peg$currPos;\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f16(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseDivider() {\n let s0;\n\n s0 = peg$parseFooterDivider();\n if (s0 === peg$FAILED) {\n s0 = peg$parsePlainTextDivider();\n }\n\n return s0;\n }\n\n function peg$parsePlainTextDividerText() {\n let s0, s1, s2, s3, s4, s5;\n\n if (input.substr(peg$currPos, 4) === peg$c5) {\n s0 = peg$c5;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c6) {\n s1 = peg$c6;\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseWS();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseWS();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c7) {\n s3 = peg$c7;\n peg$currPos += 4;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseWS();\n if (s5 !== peg$FAILED) {\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseWS();\n }\n } else {\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c6) {\n s5 = peg$c6;\n peg$currPos += 4;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s5 !== peg$FAILED) {\n s1 = [s1, s2, s3, s4, s5];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsePlainTextDivider() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseNL();\n if (s2 !== peg$FAILED) {\n s3 = peg$parsePlainTextDividerText();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseWNL();\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f17(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseFooterDividerText() {\n let s0, s1, s2, s3, s4, s5;\n\n if (input.substr(peg$currPos, 4) === peg$c8) {\n s0 = peg$c8;\n peg$currPos += 4;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c6) {\n s1 = peg$c6;\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseWS();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseWS();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n if (input.substr(peg$currPos, 6) === peg$c9) {\n s3 = peg$c9;\n peg$currPos += 6;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseWS();\n if (s5 !== peg$FAILED) {\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseWS();\n }\n } else {\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c6) {\n s5 = peg$c6;\n peg$currPos += 4;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s5 !== peg$FAILED) {\n s1 = [s1, s2, s3, s4, s5];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseFooterDivider() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseNL();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseFooterDividerText();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseWNL();\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f18(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCardSet_V2() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseCardSetStart_V2();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseCards_V2();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseCards_V2();\n }\n s4 = peg$parseCardSetEnd_V2();\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f19(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCardSetStart_V2() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$parseNL();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n s3 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c6) {\n s4 = peg$c6;\n peg$currPos += 4;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseWNL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f20();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseCardSetEnd_V2() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseFooterDividerText();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$parseWEOL();\n peg$silentFails--;\n if (s4 !== peg$FAILED) {\n peg$currPos = s3;\n s3 = undefined;\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f21();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCards_V2() {\n let s0, s1;\n\n s0 = peg$currPos;\n s1 = peg$parseCardLineOrDivider_V2();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f22(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCardLineOrDivider_V2() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c6) {\n s2 = peg$c6;\n peg$currPos += 4;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseWNL();\n if (s3 === peg$FAILED) {\n s3 = peg$parseWEOL();\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c10) {\n s2 = peg$c10;\n peg$currPos += 2;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseWNL();\n if (s3 === peg$FAILED) {\n s3 = peg$parseWEOL();\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c11) {\n s2 = peg$c11;\n peg$currPos += 2;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseWNL();\n if (s3 === peg$FAILED) {\n s3 = peg$parseWEOL();\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = peg$parseCardLine_V2();\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f23(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCardLine_V2() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$currPos;\n s3 = peg$parseFooterDividerText();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseWEOL();\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n peg$silentFails--;\n if (s2 === peg$FAILED) {\n s1 = undefined;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = peg$parseLine();\n s5 = peg$parseNL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n s4 = [];\n s5 = peg$parseChar();\n if (s5 !== peg$FAILED) {\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseChar();\n }\n } else {\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseEOL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f24(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseCardSet_V1() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseCardSetStart_V1();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseCards_V1();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseCards_V1();\n }\n s4 = peg$parseCardSetEnd_V1();\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f25(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCardSetStart_V1() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$parseNL();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n s3 = peg$currPos;\n if (input.substr(peg$currPos, 3) === peg$c12) {\n s4 = peg$c12;\n peg$currPos += 3;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseWNL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f26();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseCardSetEnd_V1() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseFooterDividerText();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$parseWEOL();\n peg$silentFails--;\n if (s4 !== peg$FAILED) {\n peg$currPos = s3;\n s3 = undefined;\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f27();\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCards_V1() {\n let s0, s1;\n\n s0 = peg$currPos;\n s1 = peg$parseCardLineOrDivider_V1();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f28(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCardLineOrDivider_V1() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.substr(peg$currPos, 3) === peg$c12) {\n s2 = peg$c12;\n peg$currPos += 3;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseWNL();\n if (s3 === peg$FAILED) {\n s3 = peg$parseWEOL();\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c13) {\n s2 = peg$c13;\n peg$currPos += 2;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseWNL();\n if (s3 === peg$FAILED) {\n s3 = peg$parseWEOL();\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c10) {\n s2 = peg$c10;\n peg$currPos += 2;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseWNL();\n if (s3 === peg$FAILED) {\n s3 = peg$parseWEOL();\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 === peg$FAILED) {\n s1 = peg$parseCardLine_V1();\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f29(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCardLine_V1() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n s2 = peg$currPos;\n s3 = peg$parseFooterDividerText();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseWEOL();\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n peg$silentFails--;\n if (s2 === peg$FAILED) {\n s1 = undefined;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = peg$parseLine();\n s5 = peg$parseNL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 === peg$FAILED) {\n s3 = peg$currPos;\n s4 = [];\n s5 = peg$parseChar();\n if (s5 !== peg$FAILED) {\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseChar();\n }\n } else {\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseEOL();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f30(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsecardContent() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseTagChain();\n if (s2 === peg$FAILED) {\n s2 = peg$parseCardChar();\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseTagChain();\n if (s2 === peg$FAILED) {\n s2 = peg$parseCardChar();\n }\n }\n peg$savedPos = s0;\n s1 = peg$f31(s1);\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseCardChar() {\n let s0, s1;\n\n s0 = peg$currPos;\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f32(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseIDTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c14) {\n s1 = peg$c14;\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseKeyValueTag_Value();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseTag_Close();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f33(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseTitleTag() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c2;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (input.charCodeAt(peg$currPos) === 35) {\n s3 = peg$c15;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e17); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (input.charCodeAt(peg$currPos) === 35) {\n s3 = peg$c15;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e17); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseTag_Value();\n s4 = peg$parseTag_CloseOrEOF();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f34(s2, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseAnchorTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c16) {\n s1 = peg$c16;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e18); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f35(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseReferenceTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c17) {\n s1 = peg$c17;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e19); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f36(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsePropertyTag() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c18) {\n s1 = peg$c18;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e20); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseKeyValueTag_Key();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseKeyValueTag_Value();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseTag_CloseOrEOF();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f37(s2, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseItemLeadTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c19) {\n s1 = peg$c19;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e21); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f38(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseInstructionTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c20) {\n s1 = peg$c20;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e22); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f39(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseHintTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c21) {\n s1 = peg$c21;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f40(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseTrueTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c22) {\n s1 = peg$c22;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e24); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f41(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseFalseTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c23) {\n s1 = peg$c23;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e25); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f42(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseSampleSolutionTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c24) {\n s1 = peg$c24;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f43(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseGapTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c25) {\n s1 = peg$c25;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e27); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f44(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseMarkTag() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c26) {\n s1 = peg$c26;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e28); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n s3 = peg$parseTag_CloseOrEOF();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f45(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseResourceTag() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c27) {\n s1 = peg$c27;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseKeyValueTag_Key();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseKeyValueTag_Value();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseTag_CloseOrEOF();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f46(s2, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseTag_Value() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n if (input.substr(peg$currPos, 2) === peg$c28) {\n s3 = peg$c28;\n peg$currPos += 2;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s3 === peg$FAILED) {\n s3 = input.charAt(peg$currPos);\n if (peg$r0.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (input.substr(peg$currPos, 2) === peg$c28) {\n s3 = peg$c28;\n peg$currPos += 2;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s3 === peg$FAILED) {\n s3 = input.charAt(peg$currPos);\n if (peg$r0.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n }\n }\n s1 = input.substring(s1, peg$currPos);\n peg$savedPos = s0;\n s1 = peg$f47(s1);\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseKeyValueTag_Key() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c29) {\n s2 = peg$c29;\n peg$currPos += 3;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n peg$silentFails--;\n if (s2 === peg$FAILED) {\n s1 = undefined;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = [];\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = input.charAt(peg$currPos);\n if (peg$r1.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n }\n s2 = input.substring(s2, peg$currPos);\n peg$savedPos = s0;\n s0 = peg$f48(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseTag_Close() {\n let s0;\n\n if (input.charCodeAt(peg$currPos) === 93) {\n s0 = peg$c1;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n\n return s0;\n }\n\n function peg$parseTag_CloseOrEOF() {\n let s0, s1, s2;\n\n if (input.charCodeAt(peg$currPos) === 93) {\n s0 = peg$c1;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseWS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseWS();\n }\n s2 = peg$parseEOF();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseBit_Level() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (input.charCodeAt(peg$currPos) === 46) {\n s2 = peg$c30;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (input.charCodeAt(peg$currPos) === 46) {\n s2 = peg$c30;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f49(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseBit_Value() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = [];\n s3 = input.charAt(peg$currPos);\n if (peg$r2.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e34); }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = input.charAt(peg$currPos);\n if (peg$r2.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e34); }\n }\n }\n s1 = input.substring(s1, peg$currPos);\n peg$savedPos = s0;\n s1 = peg$f50(s1);\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseKeyValueTag_Value() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 58) {\n s1 = peg$c3;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseTag_Value();\n peg$savedPos = s0;\n s0 = peg$f51(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = '';\n peg$savedPos = s0;\n s1 = peg$f52();\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseAnything() {\n let s0, s1;\n\n peg$silentFails++;\n s0 = [];\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n }\n peg$silentFails--;\n\n return s0;\n }\n\n function peg$parseChar() {\n let s0, s1;\n\n peg$silentFails++;\n s0 = input.charAt(peg$currPos);\n if (peg$r3.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n peg$silentFails--;\n if (s0 === peg$FAILED) {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e35); }\n }\n\n return s0;\n }\n\n function peg$parseLine() {\n let s0, s1;\n\n peg$silentFails++;\n s0 = [];\n s1 = peg$parseChar();\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n s1 = peg$parseChar();\n }\n peg$silentFails--;\n\n return s0;\n }\n\n function peg$parseBlankLine() {\n let s0, s1, s2;\n\n peg$silentFails++;\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r4.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r4.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n }\n s2 = peg$parseNL();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$silentFails--;\n if (s0 === peg$FAILED) {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e37); }\n }\n\n return s0;\n }\n\n function peg$parseNL() {\n let s0, s1;\n\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 10) {\n s0 = peg$c31;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s0 === peg$FAILED) {\n if (input.substr(peg$currPos, 2) === peg$c32) {\n s0 = peg$c32;\n peg$currPos += 2;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e41); }\n }\n if (s0 === peg$FAILED) {\n s0 = input.charAt(peg$currPos);\n if (peg$r5.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e42); }\n }\n }\n }\n peg$silentFails--;\n if (s0 === peg$FAILED) {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e39); }\n }\n\n return s0;\n }\n\n function peg$parseWNL() {\n let s0, s1, s2;\n\n peg$silentFails++;\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r4.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r4.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n }\n s2 = peg$parseNL();\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$silentFails--;\n if (s0 === peg$FAILED) {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e43); }\n }\n\n return s0;\n }\n\n function peg$parseWS() {\n let s0, s1;\n\n peg$silentFails++;\n s0 = input.charAt(peg$currPos);\n if (peg$r6.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e45); }\n }\n peg$silentFails--;\n if (s0 === peg$FAILED) {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e44); }\n }\n\n return s0;\n }\n\n function peg$parseEOL() {\n let s0, s1;\n\n s0 = peg$parseNL();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n peg$silentFails++;\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n peg$silentFails--;\n if (s1 === peg$FAILED) {\n s0 = undefined;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseWEOL() {\n let s0, s1;\n\n s0 = peg$parseWNL();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n peg$silentFails++;\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n peg$silentFails--;\n if (s1 === peg$FAILED) {\n s0 = undefined;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseEOF() {\n let s0, s1;\n\n s0 = peg$currPos;\n peg$silentFails++;\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n peg$silentFails--;\n if (s1 === peg$FAILED) {\n s0 = undefined;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n // PER PARSE JS\n\n//\n// Instance variables\n//\n\n// Create the helper instance (low-level helper functions)\nconst helper = new BitmarkPegParserHelper({\n parse: peg$parse,\n parserText: text,\n parserLocation,\n\n});\n\n// Create the processor instance (semantic processor)\nconst processor = new BitmarkPegParserProcessor({\n parse: peg$parse,\n parserText: text,\n parserLocation,\n});\n\n// Function to remove 'source' from Location object\nfunction parserLocation() {\n const l = location();\n if (!l) return l;\n delete l.source;\n\n return l;\n}\n\n// Override peg$computeLocation to force the offset flag when computing location\n// (unfortunately not possible in Peggy yet).\nfunction peg$computeLocation(startPos, endPos, offset) {\n offset = true;\n var startPosDetails = peg$computePosDetails(startPos);\n var endPosDetails = peg$computePosDetails(endPos);\n\n var res = {\n source: peg$source,\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n if (offset && peg$source && (typeof peg$source.offset === \"function\")) {\n res.start = peg$source.offset(res.start);\n res.end = peg$source.offset(res.end);\n }\n return res;\n}\n\n\n peg$result = peg$startRuleFunction();\n\n const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);\n function peg$throw() {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n if (options.peg$library) {\n return /** @type {any} */ ({\n peg$result,\n peg$currPos,\n peg$FAILED,\n peg$maxFailExpected,\n peg$maxFailPos,\n peg$success,\n peg$throw: peg$success ? undefined : peg$throw,\n });\n }\n if (peg$success) {\n return peg$result;\n } else {\n peg$throw();\n }\n}\n\nconst peg$allowedStartRules = [\n \"bitmark\",\n \"bit\",\n \"cardContent\"\n];\n\nexport {\n peg$allowedStartRules as StartRules,\n peg$SyntaxError as SyntaxError,\n peg$parse as parse\n};\n","import { parse as _parse } from '../../../generated/parser/bitmark/bitmark-peggy-parser.js';\nimport { type BitmarkAst } from '../../../model/ast/Nodes.ts';\n\ninterface ParseOptions {\n startRule?: string;\n}\ntype Parse = (str: string, options?: ParseOptions) => BitmarkAst;\n\nconst parse: Parse = _parse;\n\nexport { parse };\n","import { type BitmarkAst } from '../../model/ast/Nodes.ts';\nimport { type BitmarkParserTypeType } from '../../model/enum/BitmarkParserType.ts';\nimport { JsonParser } from '../json/JsonParser.ts';\nimport { parse as bitmarkParse } from './peg/BitmarkPegParser.ts';\n\nexport interface BitmarkParserOptions {\n parserType?: BitmarkParserTypeType;\n}\n\nclass BitmarkParser {\n protected jsonParser = new JsonParser();\n\n /**\n * Convert Bitmark markup to AST.\n *\n * The Bitmark markup should be a string.\n *\n * @param json - bitmark JSON as a string or a plain JS object\n * @param _options - unused\n * @returns bitmark AST\n */\n toAst(bitmark: string, _options?: BitmarkParserOptions): BitmarkAst {\n // const opts = Object.assign({}, options);\n\n return bitmarkParse(bitmark);\n }\n}\n\nexport { BitmarkParser };\n","import path from 'node:path';\n\nimport fs from 'fs-extra';\n\nimport { StreamWriter } from './StreamWriter.ts';\n\n/**\n * Options for file writing\n */\nexport interface FileOptions {\n /**\n * Append to a file if true, otherwise overwrite\n */\n append?: boolean;\n /**\n * Character encoding, defaults to 'utf8'\n */\n encoding?: BufferEncoding;\n}\n\n/**\n * Writer to write to a file.\n */\nclass FileWriter extends StreamWriter {\n private _path: fs.PathLike;\n private _append: boolean;\n private _encoding: BufferEncoding;\n\n /**\n * Create a writer to write to a file.\n *\n * @param path - path of file to write\n * @param options - options for file writing\n */\n constructor(path: fs.PathLike, options?: FileOptions) {\n super();\n const opts = Object.assign({}, options);\n\n this._path = path;\n this._append = !!opts.append;\n this._encoding = opts.encoding ?? 'utf8';\n }\n\n public get path(): fs.PathLike {\n return this._path;\n }\n\n public get append(): boolean {\n return this._append;\n }\n\n public get encoding(): BufferEncoding {\n return this._encoding;\n }\n\n public async open(): Promise<void> {\n return new Promise((resolve, reject) => {\n const flags = this._append ? 'a' : 'w';\n\n fs.ensureDirSync(path.dirname(this._path.toString()));\n\n const stream = fs.createWriteStream(this._path, {\n flags,\n encoding: 'utf8',\n });\n // Set StreamWriter stream\n this.stream = stream;\n\n if (!stream) reject(new Error('stream undefined'));\n\n stream.once('open', (_fd: number) => {\n resolve();\n });\n\n stream.once('error', (e: Error) => {\n reject(e);\n });\n });\n }\n\n public async close(): Promise<void> {\n return new Promise((resolve, reject) => {\n const stream = this.stream as NodeJS.WritableStream;\n if (!stream) reject(new Error('stream not set'));\n\n stream.once('close', (_fd: number) => {\n resolve();\n });\n stream.once('error', (e: Error) => {\n reject(e);\n });\n\n stream.end();\n });\n }\n}\n\nexport { FileWriter };\n","import os from 'os';\n\nimport { type Writer } from './Writer.ts';\n\n/**\n * Writer to write to a stream.\n */\nabstract class StreamWriter implements Writer {\n private _stream: NodeJS.WritableStream | undefined;\n public endOfLineString = os.EOL;\n private lastWrite = '';\n\n public get isSync() {\n return false;\n }\n\n /**\n * Get the current write stream\n */\n public get stream(): NodeJS.WritableStream | undefined {\n return this._stream;\n }\n\n /**\n * Set the current write stream\n */\n public set stream(stream: NodeJS.WritableStream | undefined) {\n this._stream = stream;\n }\n\n abstract open(): Promise<void>;\n\n abstract close(): Promise<void>;\n\n public openSync(): void {\n throw new Error('Sync operation not supported');\n }\n\n public closeSync(): void {\n throw new Error('Sync operation not supported');\n }\n\n public writeLine(value?: string): this {\n if (!this._stream) return this;\n\n if (value != null) {\n this._stream.write(value + this.endOfLineString);\n this.lastWrite = value + this.endOfLineString;\n } else {\n this._stream.write(this.endOfLineString);\n this.lastWrite = this.endOfLineString;\n }\n\n return this;\n }\n\n public writeLines(values: string[], delimiter?: string): this {\n if (!this._stream) return this;\n if (!values) return this;\n let str = '';\n\n for (let i = 0, len = values.length; i < len; i++) {\n const value = values[i];\n this._stream.write(value);\n str += value;\n if (delimiter && i < len - 1) {\n this._stream.write(delimiter);\n str += delimiter;\n }\n this._stream.write(this.endOfLineString);\n str += this.endOfLineString;\n }\n\n this.lastWrite = str;\n\n return this;\n }\n\n public write(value: string): this {\n if (!this._stream) return this;\n if (value == null) return this;\n if (value) this.lastWrite = value;\n this._stream.write(value);\n return this;\n }\n\n public writeWhiteSpace(): this {\n this.write(' ');\n return this;\n }\n\n public getLastWrite(): string {\n return this.lastWrite;\n }\n}\n\nexport { StreamWriter };\n","import fs from 'fs-extra';\n\nimport { type FileOptions, FileWriter } from '../../ast/writer/FileWriter.ts';\nimport { type BitmarkAst } from '../../model/ast/Nodes.ts';\nimport { type Generator } from '../Generator.ts';\nimport { BitmarkGenerator, type BitmarkGeneratorOptions } from './BitmarkGenerator.ts';\n\n/**\n * Bitmark file generator options\n */\nexport interface BitmarkFileGeneratorOptions extends BitmarkGeneratorOptions {\n /**\n * The options for file output.\n */\n fileOptions?: FileOptions;\n}\n\n/**\n * Generate bitmark markup from a bitmark AST as a file\n */\nclass BitmarkFileGenerator implements Generator<BitmarkAst> {\n private generator: BitmarkGenerator;\n\n /**\n * Generate bitmark markup from a bitmark AST as a file\n *\n * @param path - path of file to generate\n * @param options - bitmark generation options\n */\n constructor(path: fs.PathLike, options?: BitmarkFileGeneratorOptions) {\n const writer = new FileWriter(path, options?.fileOptions);\n this.generator = new BitmarkGenerator(writer, options);\n }\n\n /**\n * Generate bitmark markup from bitmark AST as a file\n *\n * @param ast bitmark AST\n */\n public async generate(ast: BitmarkAst): Promise<void> {\n return this.generator.generate(ast);\n }\n\n /**\n * Generate bitmark markup from bitmark AST as a file synchronously\n *\n * @param ast bitmark AST\n */\n public generateSync(_ast: BitmarkAst): string {\n throw new Error('Sync operation not supported');\n }\n}\n\nexport { BitmarkFileGenerator };\n","import fs from 'fs-extra';\n\nimport { type FileOptions, FileWriter } from '../../ast/writer/FileWriter.ts';\nimport { type BitmarkAst } from '../../model/ast/Nodes.ts';\nimport { type Generator } from '../Generator.ts';\nimport { JsonGenerator, type JsonGeneratorOptions } from './JsonGenerator.ts';\n\n/**\n * JSON file generator options\n */\nexport interface JsonFileGeneratorOptions extends JsonGeneratorOptions {\n /**\n * The options for file output.\n */\n fileOptions?: FileOptions;\n}\n\n/**\n * Generate bitmark JSON from a bitmark AST as a file\n *\n * TODO: NOT IMPLEMENTED!\n */\nclass JsonFileGenerator implements Generator<BitmarkAst> {\n private generator: JsonGenerator;\n\n /**\n * Generate bitmark JSON from a bitmark AST as a file\n *\n * @param path - path of file to generate\n * @param bitmarkVersion - bitmark version, use null to use latest version\n * @param fileOptions - file options\n * @param bitmarkOptions - bitmark generation options\n */\n constructor(path: fs.PathLike, options?: JsonFileGeneratorOptions) {\n const writer = new FileWriter(path, options?.fileOptions);\n this.generator = new JsonGenerator(writer, options);\n }\n\n /**\n * Generate bitmark JSON from bitmark AST as a file\n *\n * @param ast bitmark AST\n */\n public async generate(ast: BitmarkAst): Promise<void> {\n return this.generator.generate(ast);\n }\n\n /**\n * Generate bitmark JSON from bitmark AST as a file synchronously\n *\n * @param ast bitmark AST\n */\n public generateSync(_ast: BitmarkAst): string {\n throw new Error('Sync operation not supported');\n }\n}\n\nexport { JsonFileGenerator };\n","// import path from 'node:path';\n\n// import fs from 'fs-extra';\n\n/**\n * Config generation options for the parser\n */\nexport interface GenerateConfigOptions {\n outputDir?: string;\n}\n\nclass ConfigBuilder {\n public async build(_options?: GenerateConfigOptions): Promise<void> {\n // const opts: GenerateConfigOptions = Object.assign({}, options);\n // await this.buildFlat(opts);\n // const bitConfigs: (_BitConfig & { bitType: BitTypeType })[] = [];\n // const groupConfigs: (_GroupsConfig & { key: string })[] = [];\n // for (const bt of BitType.values()) {\n // const bitType = Config.getBitType(bt);\n // const _bitConfig: _BitConfig & { bitType: BitTypeType } = BITS[bitType] as _BitConfig & {\n // bitType: BitTypeType;\n // };\n // if (_bitConfig) {\n // _bitConfig.bitType = bitType;\n // bitConfigs.push(_bitConfig);\n // }\n // // const config: BitConfig = Config.getBitConfig(bitType);\n // // bitConfigs.push(config);\n // }\n // for (const [k, g] of Object.entries(GROUPS)) {\n // const g2 = g as unknown as _GroupsConfig & { key: string };\n // let k2 = k as string;\n // if (k.startsWith('group_')) k2 = k2.substring(6);\n // k2 = '_' + k2;\n // g2.key = k2;\n // groupConfigs.push(g2);\n // }\n // const outputFolder = opts.outputDir ?? 'assets/config';\n // const outputFolderBits = path.join(outputFolder, 'bits');\n // const outputFolderGroups = path.join(outputFolder, 'groups');\n // fs.ensureDirSync(outputFolderBits);\n // fs.ensureDirSync(outputFolderGroups);\n // const fileWrites: Promise<void>[] = [];\n // // BitConfigs\n // for (const b of bitConfigs) {\n // const inherits = [];\n // const tags = [];\n // const tagEntriesTypeOrder = [\n // BitTagConfigKeyType.tag,\n // BitTagConfigKeyType.property,\n // BitTagConfigKeyType.resource,\n // BitTagConfigKeyType.group,\n // BitTagConfigKeyType.unknown,\n // ];\n // const tagEntries = Object.entries(b.tags ?? []).sort((a, b) => {\n // const tagA = a[1];\n // const tagB = b[1];\n // const typeA = typeFromConfigKey(tagA.key);\n // const typeB = typeFromConfigKey(tagB.key);\n // const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);\n // return typeOrder;\n // });\n // if (b.baseBitType) inherits.push(b.baseBitType);\n // for (const [tagKey, tag] of tagEntries) {\n // const tagName = tagKey;\n // let tagKeyPrefix = '';\n // let format = '';\n // let description = '';\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // let chain: any = undefined;\n // const tagType = typeFromConfigKey(tag.key);\n // if (tagType === BitTagConfigKeyType.tag) {\n // if (tagName === '%') {\n // description = 'Item';\n // chain = {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Lead',\n // chain: {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Page number',\n // chain: {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Margin number',\n // },\n // },\n // };\n // } else if (tagName === '!') {\n // description = 'Instruction';\n // } else if (tagName === '?') {\n // description = 'Hint';\n // } else if (tagName === '#') {\n // description = 'Title';\n // } else if (tagName === '##') {\n // description = 'Sub-title';\n // } else if (tagName === '▼') {\n // description = 'Anchor';\n // } else if (tagName === '►') {\n // description = 'Reference';\n // } else if (tagName === '$') {\n // description = 'Sample solution';\n // } else if (tagName === '&') {\n // description = 'Resource';\n // } else if (tagName === '+') {\n // description = 'True statement';\n // } else if (tagName === '-') {\n // description = 'False statement';\n // } else if (tagName === '_') {\n // description = 'Gap';\n // } else if (tagName === '=') {\n // description = 'Mark';\n // }\n // format = 'bitmark--';\n // } else if (tagType === BitTagConfigKeyType.property) {\n // tagKeyPrefix = '@';\n // const resolvedProperty = Config.getTagConfigForTag(tagKey);\n // const property = resolvedProperty as PropertyTagConfig;\n // // format\n // if (property.format === TagFormat.plainText) {\n // format = 'string';\n // } else if (property.format === TagFormat.boolean) {\n // format = 'bool';\n // } else if (property.format === TagFormat.bitmarkText) {\n // format = 'bitmark';\n // } else if (property.format === TagFormat.number) {\n // format = 'number';\n // }\n // } else if (tag.type === BitTagConfigKeyType.resource) {\n // tagKeyPrefix = '&';\n // } else if (tag.type === BitTagConfigKeyType.group) {\n // tagKeyPrefix = '@';\n // let k = tag.key as string;\n // if (k.startsWith('group_')) k = k.substring(6);\n // k = '_' + k;\n // inherits.push(k);\n // continue;\n // }\n // const t = {\n // key: tagKeyPrefix + tagName,\n // format,\n // default: null,\n // alwaysInclude: false,\n // min: tag.minCount == null ? 0 : tag.minCount,\n // max: tag.maxCount == null ? 1 : tag.maxCount,\n // description,\n // chain,\n // // raw: {\n // // ...tag,\n // // },\n // };\n // tags.push(t);\n // }\n // const bitJson = {\n // name: b.bitType,\n // description: '',\n // since: b.since,\n // deprecated: b.deprecated,\n // history: [\n // {\n // version: b.since,\n // changes: ['Initial version'],\n // },\n // ],\n // format: b.textFormatDefault ?? 'bitmark--',\n // bodyAllowed: b.bodyAllowed ?? true,\n // bodyRequired: b.bodyRequired ?? false,\n // footerAllowed: b.footerAllowed ?? true,\n // footerRequired: b.footerRequired ?? false,\n // resourceAttachmentAllowed: b.resourceAttachmentAllowed ?? true,\n // inherits,\n // tags,\n // };\n // const output = path.join(outputFolderBits, `${b.bitType}.jsonc`);\n // const str = JSON.stringify(bitJson, null, 2);\n // fileWrites.push(fs.writeFile(output, str));\n // // const bitType = b.bitType;\n // // const bitType2 = Config.getBitType(bitType);\n // // if (bitType !== bitType2) {\n // // console.log(`BitType: ${bitType} => ${bitType2}`);\n // // }\n // }\n // // GroupConfigs\n // const writeGroupConfigs = (groupConfigs: (_GroupsConfig & { key: string })[]) => {\n // for (const g of groupConfigs) {\n // const inherits = [];\n // const tags = [];\n // // if (g.key == '_resourceImage') debugger;\n // const tagEntriesTypeOrder = [\n // BitTagConfigKeyType.tag,\n // BitTagConfigKeyType.property,\n // BitTagConfigKeyType.resource,\n // BitTagConfigKeyType.group,\n // ];\n // const tagEntries = Object.entries(g.tags ?? []).sort((a, b) => {\n // const tagA = a[1];\n // const tagB = b[1];\n // const typeOrder =\n // tagEntriesTypeOrder.indexOf(tagA.type) - tagEntriesTypeOrder.indexOf(tagB.type);\n // return typeOrder;\n // });\n // for (const [_tagKey, tag] of tagEntries) {\n // let tagName = tag.configKey as string;\n // let tagKeyPrefix = '';\n // let format = '';\n // let description = '';\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // let chain: any = undefined;\n // if (tag.type === BitTagConfigKeyType.tag) {\n // const resolvedTag = TAGS[tag.configKey];\n // tagName = resolvedTag.tag;\n // if (tagName === '%') {\n // description = 'Item';\n // chain = {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Lead',\n // chain: {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Page number',\n // chain: {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Margin number',\n // },\n // },\n // };\n // } else if (tagName === '!') {\n // description = 'Instruction';\n // } else if (tagName === '?') {\n // description = 'Hint';\n // } else if (tagName === '#') {\n // description = 'Title';\n // } else if (tagName === '##') {\n // description = 'Sub-title';\n // } else if (tagName === '▼') {\n // description = 'Anchor';\n // } else if (tagName === '►') {\n // description = 'Reference';\n // } else if (tagName === '$') {\n // description = 'Sample solution';\n // } else if (tagName === '&') {\n // description = 'Resource';\n // } else if (tagName === '+') {\n // description = 'True statement';\n // } else if (tagName === '-') {\n // description = 'False statement';\n // } else if (tagName === '_') {\n // description = 'Gap';\n // } else if (tagName === '=') {\n // description = 'Mark';\n // }\n // format = 'bitmark--';\n // } else if (tag.type === BitTagConfigKeyType.property) {\n // const resolvedProperty = PROPERTIES[tag.configKey];\n // tagName = resolvedProperty.tag;\n // tagKeyPrefix = '@';\n // const property = resolvedProperty as PropertyTagConfig;\n // // format\n // if (property.format === TagFormat.plainText) {\n // format = 'string';\n // } else if (property.format === TagFormat.boolean) {\n // format = 'bool';\n // } else if (property.format === TagFormat.bitmarkText) {\n // format = 'bitmark';\n // } else if (property.format === TagFormat.number) {\n // format = 'number';\n // }\n // } else if (tag.type === BitTagConfigKeyType.resource) {\n // tagKeyPrefix = '&';\n // format = 'string';\n // } else if (tag.type === BitTagConfigKeyType.group) {\n // tagKeyPrefix = '@';\n // let k = tag.configKey as string;\n // if (k.startsWith('group_')) k = k.substring(6);\n // k = '_' + k;\n // inherits.push(k);\n // continue;\n // }\n // const t = {\n // key: tagKeyPrefix + tagName,\n // format,\n // default: null,\n // alwaysInclude: false,\n // min: tag.minCount == null ? 0 : tag.minCount,\n // max: tag.maxCount == null ? 1 : tag.maxCount,\n // description,\n // chain,\n // // raw: {\n // // ...tag,\n // // },\n // };\n // tags.push(t);\n // }\n // const bitJson = {\n // name: g.key,\n // description: '',\n // since: 'UNKNOWN',\n // deprecated: g.deprecated,\n // history: [\n // {\n // version: 'UNKNOWN',\n // changes: ['Initial version'],\n // },\n // ],\n // inherits,\n // tags,\n // // cards: [\n // // {\n // // card: null,\n // // side: 1,\n // // variant: null,\n // // description: '',\n // // tags: [],\n // // },\n // // {\n // // card: null,\n // // side: 2,\n // // variant: 1,\n // // description: '',\n // // tags: [],\n // // },\n // // {\n // // card: null,\n // // side: 2,\n // // variant: null,\n // // description: '',\n // // tags: [],\n // // },\n // // ],\n // };\n // const output = path.join(outputFolderGroups, `${g.key}.jsonc`);\n // const str = JSON.stringify(bitJson, null, 2);\n // fileWrites.push(fs.writeFile(output, str));\n // // const bitType = b.bitType;\n // // const bitType2 = Config.getBitType(bitType);\n // // if (bitType !== bitType2) {\n // // console.log(`BitType: ${bitType} => ${bitType2}`);\n // // }\n // }\n // };\n // writeGroupConfigs(groupConfigs);\n // await Promise.all(fileWrites);\n }\n\n public async buildFlat(_options?: GenerateConfigOptions): Promise<void> {\n // const opts: GenerateConfigOptions = Object.assign({}, options);\n // const bitConfigs: BitConfig[] = [];\n // for (const bt of BitType.values()) {\n // const bitType = Config.getBitType(bt);\n // const _bitConfig = Config.getBitConfig(bitType);\n // if (_bitConfig) {\n // bitConfigs.push(_bitConfig);\n // }\n // }\n // const outputFolder = opts.outputDir ?? 'assets/config';\n // const outputFolderBits = path.join(outputFolder, 'bits_flat');\n // fs.ensureDirSync(outputFolderBits);\n // const fileWrites: Promise<void>[] = [];\n // // BitConfigs\n // for (const b of bitConfigs) {\n // const inherits = [];\n // const tags = [];\n // const tagEntriesTypeOrder = [\n // BitTagConfigKeyType.tag,\n // BitTagConfigKeyType.property,\n // BitTagConfigKeyType.resource,\n // BitTagConfigKeyType.group,\n // BitTagConfigKeyType.unknown,\n // ];\n // const tagEntries = Object.entries(b.tags ?? []).sort((a, b) => {\n // const tagA = a[1];\n // const tagB = b[1];\n // const typeA = typeFromConfigKey(tagA.configKey);\n // const typeB = typeFromConfigKey(tagB.configKey);\n // const typeOrder = tagEntriesTypeOrder.indexOf(typeA) - tagEntriesTypeOrder.indexOf(typeB);\n // return typeOrder;\n // });\n // for (const [tagKey, tag] of tagEntries) {\n // let tagName = tagKey;\n // let tagKeyPrefix = '';\n // let format = '';\n // let description = '';\n // // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // let chain: any = undefined;\n // if (tag.type === BitTagConfigKeyType.tag) {\n // const resolvedTag = TAGS[tag.configKey];\n // tagName = resolvedTag.tag;\n // if (tagName === '%') {\n // description = 'Item';\n // chain = {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Lead',\n // chain: {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Page number',\n // chain: {\n // key: '%',\n // format,\n // min: tag.minCount,\n // max: tag.maxCount,\n // description: 'Margin number',\n // },\n // },\n // };\n // } else if (tagName === '!') {\n // description = 'Instruction';\n // } else if (tagName === '?') {\n // description = 'Hint';\n // } else if (tagName === '#') {\n // description = 'Title';\n // } else if (tagName === '##') {\n // description = 'Sub-title';\n // } else if (tagName === '▼') {\n // description = 'Anchor';\n // } else if (tagName === '►') {\n // description = 'Reference';\n // } else if (tagName === '$') {\n // description = 'Sample solution';\n // } else if (tagName === '&') {\n // description = 'Resource';\n // } else if (tagName === '+') {\n // description = 'True statement';\n // } else if (tagName === '-') {\n // description = 'False statement';\n // } else if (tagName === '_') {\n // description = 'Gap';\n // } else if (tagName === '=') {\n // description = 'Mark';\n // }\n // format = 'bitmark--';\n // } else if (tag.type === BitTagConfigKeyType.property) {\n // const resolvedProperty = PROPERTIES[tag.configKey];\n // tagName = resolvedProperty.tag;\n // tagKeyPrefix = '@';\n // const property = resolvedProperty as PropertyTagConfig;\n // // format\n // if (property.format === TagFormat.plainText) {\n // format = 'string';\n // } else if (property.format === TagFormat.boolean) {\n // format = 'bool';\n // } else if (property.format === TagFormat.bitmarkText) {\n // format = 'bitmark';\n // } else if (property.format === TagFormat.number) {\n // format = 'number';\n // }\n // } else if (tag.type === BitTagConfigKeyType.resource) {\n // tagKeyPrefix = '&';\n // } else if (tag.type === BitTagConfigKeyType.group) {\n // tagKeyPrefix = '@';\n // let k = tag.configKey as string;\n // if (k.startsWith('group_')) k = k.substring(6);\n // k = '_' + k;\n // inherits.push(k);\n // continue;\n // }\n // const t = {\n // key: tagKeyPrefix + tagName,\n // format,\n // default: null,\n // alwaysInclude: false,\n // min: tag.minCount == null ? 0 : tag.minCount,\n // max: tag.maxCount == null ? 1 : tag.maxCount,\n // description,\n // chain,\n // // raw: {\n // // ...tag,\n // // },\n // };\n // tags.push(t);\n // }\n // const bitJson = {\n // name: b.bitType,\n // description: '',\n // since: b.since,\n // deprecated: b.deprecated,\n // history: [\n // {\n // version: b.since,\n // changes: ['Initial version'],\n // },\n // ],\n // format: b.textFormatDefault ?? 'bitmark--',\n // bodyAllowed: b.bodyAllowed ?? true,\n // bodyRequired: b.bodyRequired ?? false,\n // footerAllowed: b.footerAllowed ?? true,\n // footerRequired: b.footerRequired ?? false,\n // resourceAttachmentAllowed: b.resourceAttachmentAllowed ?? true,\n // tags,\n // };\n // const output = path.join(outputFolderBits, `${b.bitType}.jsonc`);\n // const str = JSON.stringify(bitJson, null, 2);\n // fileWrites.push(fs.writeFile(output, str));\n // // const bitType = b.bitType;\n // // const bitType2 = Config.getBitType(bitType);\n // // if (bitType !== bitType2) {\n // // console.log(`BitType: ${bitType} => ${bitType2}`);\n // // }\n // }\n // await Promise.all(fileWrites);\n }\n}\n\nexport { ConfigBuilder };\n","import { StringWriter } from '../../ast/writer/StringWriter.ts';\nimport { type BitmarkAst } from '../../model/ast/Nodes.ts';\nimport { type Generator } from '../Generator.ts';\nimport { JsonGenerator, type JsonGeneratorOptions } from './JsonGenerator.ts';\n\n/**\n * Generate bitmark JSON from a bitmark AST as a string\n */\nclass JsonStringGenerator implements Generator<BitmarkAst, string> {\n private generator: JsonGenerator;\n private writer: StringWriter;\n\n /**\n * Generate bitmark JSON from a bitmark AST as a string\n *\n * @param options - JSON generation options\n */\n constructor(options?: JsonGeneratorOptions) {\n this.writer = new StringWriter();\n this.generator = new JsonGenerator(this.writer, options);\n }\n\n /**\n * Generate bitmark JSON from bitmark AST as a string\n *\n * @param ast bitmark AST\n */\n public async generate(ast: BitmarkAst): Promise<string> {\n await this.generator.generate(ast);\n return this.writer.getString();\n }\n\n /**\n * Generate bitmark JSON from bitmark AST as a string synchronously\n *\n * @param ast bitmark AST\n */\n public generateSync(ast: BitmarkAst): string {\n this.generator.generateSync(ast);\n return this.writer.getString();\n }\n}\n\nexport { JsonStringGenerator };\n","import { init } from './init/init.ts';\n\nexport { Ast } from './ast/Ast.ts';\nexport { Builder } from './ast/Builder.ts';\nexport { ResourceBuilder } from './ast/ResourceBuilder.ts';\nexport { StringWriter } from './ast/writer/StringWriter.ts';\nexport { BitmarkParserGenerator, Input, Output } from './BitmarkParserGenerator.ts';\nexport { BitmarkGenerator } from './generator/bitmark/BitmarkGenerator.ts';\nexport { BitmarkStringGenerator } from './generator/bitmark/BitmarkStringGenerator.ts';\nexport { JsonGenerator } from './generator/json/JsonGenerator.ts';\nexport { JsonStringGenerator } from './generator/json/JsonStringGenerator.ts';\nexport { NodeType } from './model/ast/NodeType.ts';\nexport { BitmarkParserType } from './model/enum/BitmarkParserType.ts';\nexport { BitmarkVersion } from './model/enum/BitmarkVersion.ts';\nexport { BitType } from './model/enum/BitType.ts';\nexport { BodyTextFormat } from './model/enum/BodyTextFormat.ts';\nexport { CardSetVersion } from './model/enum/CardSetVersion.ts';\nexport { InfoFormat } from './model/info/enum/InfoFormat.ts';\nexport { InfoType } from './model/info/enum/InfoType.ts';\nexport { BitmarkParser } from './parser/bitmark/BitmarkParser.ts';\nexport { JsonParser } from './parser/json/JsonParser.ts';\n\n//\n// Direct text parser export\n//\nexport { parse as bitmarkTextParse } from './parser/text/peg/TextPegParser.ts';\n\n//\n// Exports that are stripped out for the browser\n//\n\n/*\n * NOTE:\n *\n * We want to be able to strip out the NodeJS specific functions from the final bundle.\n * Any code between the comments STRIP:START and STRIP:END will be removed.\n *\n * However, the prettifier will move comments that it does not believe are associated with code.\n *\n * Therefore we have to use some dummy code to prevent it from removing the STRIP stripping comments.\n */\nconst STRIP = 0;\n/* STRIP:START */\nSTRIP; // eslint-disable-line @typescript-eslint/no-unused-expressions\n\nexport { FileWriter } from './ast/writer/FileWriter.ts';\nexport { StreamWriter } from './ast/writer/StreamWriter.ts';\nexport { BitmarkFileGenerator } from './generator/bitmark/BitmarkFileGenerator.ts';\nexport { JsonFileGenerator } from './generator/json/JsonFileGenerator.ts';\n\n/* STRIP:END */\nSTRIP; // eslint-disable-line @typescript-eslint/no-unused-expressions\n\n//\n// Type only exports\n//\n\nexport type { AstWalkCallbacks, NodeInfo } from './ast/Ast.ts';\nexport type { FileOptions } from './ast/writer/FileWriter.ts';\nexport { type Writer } from './ast/writer/Writer.ts';\nexport type {\n BreakscapeOptions,\n ConvertOptions,\n ConvertTextOptions,\n CreateAstOptions,\n InfoOptions,\n InputType,\n OutputType,\n UpgradeOptions as PrettifyOptions,\n TextJsonOptions,\n UnbreakscapeOptions,\n UpgradeOptions,\n} from './BitmarkParserGenerator.ts';\nexport type { BitmarkOptions } from './generator/bitmark/BitmarkGenerator.ts';\nexport type { Generator } from './generator/Generator.ts';\nexport type { JsonOptions } from './generator/json/JsonGenerator.ts';\nexport { type BreakscapedString } from './model/ast/BreakscapedString.ts';\nexport type {\n Bit,\n BitmarkAst,\n Body,\n BodyPart,\n CardBit,\n CardNode,\n Example,\n ExtraProperties,\n Footer,\n Node,\n Property,\n} from './model/ast/Nodes.ts';\nexport type { NodeTypeType } from './model/ast/NodeType.ts';\nexport type { JsonText as Text, TextAst } from './model/ast/TextNodes.ts';\nexport type { BitmarkParserTypeType } from './model/enum/BitmarkParserType.ts';\nexport type { BitmarkVersionType } from './model/enum/BitmarkVersion.ts';\nexport type { BitTypeType } from './model/enum/BitType.ts';\nexport type { BodyTextFormatType } from './model/enum/BodyTextFormat.ts';\nexport type { CardSetVersionType } from './model/enum/CardSetVersion.ts';\nexport type { InfoFormatType } from './model/info/enum/InfoFormat.ts';\nexport type { InfoTypeType } from './model/info/enum/InfoType.ts';\nexport type {\n BitJson,\n BookJson,\n BookReferenceJson,\n BotResponseJson,\n ChoiceJson,\n DefinitionListItemJson,\n ExampleJson,\n FeedbackChoiceJson,\n FeedbackJson,\n FeedbackReasonJson,\n FlashcardJson,\n HeadingJson,\n ImageSourceJson,\n IngredientJson,\n ListItemJson,\n MarkConfigJson,\n MatrixCellJson,\n MatrixJson,\n PairJson,\n PersonJson,\n PronunciationTableCellJson,\n PronunciationTableJson,\n QuestionJson,\n QuizJson,\n RatingLevelStartEndJson,\n ResponseJson,\n ServingsJson,\n StatementJson,\n TableJson,\n TechnicalTermJson,\n TextAndIconJson,\n} from './model/json/BitJson.ts';\nexport type { BitWrapperJson } from './model/json/BitWrapperJson.ts';\nexport type {\n BodyBitJson,\n BodyBitsJson,\n GapJson,\n HighlightJson,\n HighlightTextJson,\n MarkJson,\n SelectJson,\n SelectOptionJson,\n} from './model/json/BodyBitJson.ts';\nexport type { ParserJson } from './model/json/ParserJson.ts';\nexport type {\n AppLinkResourceJson,\n AppLinkResourceWrapperJson,\n ArticleResourceJson,\n ArticleResourceWrapperJson,\n AudioEmbedResourceJson,\n AudioEmbedResourceWrapperJson,\n AudioLinkResourceJson,\n AudioLinkResourceWrapperJson,\n AudioResourceJson,\n AudioResourceWrapperJson,\n DocumentDownloadResourceJson,\n DocumentDownloadResourceWrapperJson,\n DocumentEmbedResourceJson,\n DocumentEmbedResourceWrapperJson,\n DocumentLinkResourceJson,\n DocumentLinkResourceWrapperJson,\n DocumentResourceJson,\n DocumentResourceWrapperJson,\n ImageLinkResourceJson,\n ImageLinkResourceWrapperJson,\n ImageResourceJson,\n ImageResourceWrapperJson,\n ResourceDataJson,\n ResourceJson,\n ResourceWrapperJson,\n StillImageFilmEmbedResourceJson,\n StillImageFilmEmbedResourceWrapperJson,\n StillImageFilmLinkResourceJson,\n StillImageFilmLinkResourceWrapperJson,\n StillImageFilmResourceJson,\n StillImageFilmResourceWrapperJson,\n VideoEmbedResourceJson,\n VideoEmbedResourceWrapperJson,\n VideoLinkResourceJson,\n VideoLinkResourceWrapperJson,\n VideoResourceJson,\n VideoResourceWrapperJson,\n WebsiteLinkResourceJson,\n WebsiteLinkResourceWrapperJson,\n} from './model/json/ResourceJson.ts';\n\n// Initialise the application\ninit();\n"],"mappings":";;;;;AAAA,SAAwB,iBAAiB;AAEzC,IAAM,UAAU,UAAU;AAAA,EACxB,QAAQ;AAAA;AAAA,EACR,UAAU;AAAA;AAAA,EACV,WAAW;AAAA;AAAA,EACX,UAAU;AAA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S,IAAI,aAAa;AAC/B,SAAK,YAAY,IAAI,cAAc,KAAK,QAAQ,OAAO;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAa,SAAS,KAAkC;AACtD,UAAM,KAAK,UAAU,SAAS,GAAG;AACjC,WAAO,KAAK,OAAO,UAAU;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,aAAa,KAAyB;AAC3C,SAAK,UAAU,aAAa,GAAG;AAC/B,WAAO,KAAK,OAAO,UAAU;AAAA,EAC/B;AACF;;;ACkJA,KAAK;","names":["superenum","superenum","superenum","superenum","superenum","superenum","superenum","superenum","tags","tags","superenum","superenum","superenum","superenum","superenum","superenum","superenum","tags","path","objs","clone","tags","tags","instance","superenum","superenum","i","superenum","superenum","superenum","superenum","superenum","superenum","Breakscape","instance","superenum","instance","superenum","href","s","instance","instance","s","expected","found","start","location","text","offset","instance","instance","instance","instance","instance","instance","instance","index","path","parser","superenum","superenum","DEFAULT_OPTIONS","instance","DEFAULT_OPTIONS","instance","r","parser","instance","superenum","superenum","superenum","parser","instance","superenum","superenum","instance","parser","value","instance","tags","data","instance","textParser","instance","parser","instance","tags","__isDefaultExample","example","heading","textParser","instance","textParser","instance","textParser","instance","instance","textParser","instance","instance","tags","tags","instance","textParser","instance","instance","tags","instance","tags","tags","instance","textParser","tags","instance","tags","instance","tags","instance","textParser","instance","v","instance","instance","tags","textParser","instance","instance","instance","tags","ENABLE_DEBUG","DEBUG_DATA","DEBUG_DATA_INCLUDE_PARSER","DEBUG","builder","instance","tags","parser","peg$SyntaxError","s","expected","found","peg$parse","location","text","offset","parse","peg$parse","parse","path","fs","path","path","path","superenum","builder","instance","fs","path"]}