@gmb/bitmark-parser-generator 1.35.0 → 2.0.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 (290) hide show
  1. package/dist/browser/bitmark-parser-generator.min.js +1 -1
  2. package/dist/browser/bundle-report.html +2 -2
  3. package/dist/cjs/BitmarkParserGenerator.js +8 -3
  4. package/dist/cjs/BitmarkParserGenerator.js.map +1 -1
  5. package/dist/cjs/ast/Ast.js +1 -0
  6. package/dist/cjs/ast/Ast.js.map +1 -1
  7. package/dist/cjs/ast/BaseBuilder.js +91 -54
  8. package/dist/cjs/ast/BaseBuilder.js.map +1 -1
  9. package/dist/cjs/ast/Builder.js +776 -389
  10. package/dist/cjs/ast/Builder.js.map +1 -1
  11. package/dist/cjs/ast/ResourceBuilder.js +516 -252
  12. package/dist/cjs/ast/ResourceBuilder.js.map +1 -1
  13. package/dist/cjs/ast/rules/NodeValidator.js +61 -22
  14. package/dist/cjs/ast/rules/NodeValidator.js.map +1 -1
  15. package/dist/cjs/breakscaping/Breakscape.js +96 -71
  16. package/dist/cjs/breakscaping/Breakscape.js.map +1 -1
  17. package/dist/cjs/config/raw/bits.js +14 -5
  18. package/dist/cjs/config/raw/bits.js.map +1 -1
  19. package/dist/cjs/config/raw/properties.js +7 -2
  20. package/dist/cjs/config/raw/properties.js.map +1 -1
  21. package/dist/cjs/generated/build-info.js +1 -1
  22. package/dist/cjs/generated/build-info.js.map +1 -1
  23. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js +1 -0
  24. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
  25. package/dist/cjs/generator/AstWalkerGenerator.js +4 -1
  26. package/dist/cjs/generator/AstWalkerGenerator.js.map +1 -1
  27. package/dist/cjs/generator/bitmark/BitmarkGenerator.js +959 -338
  28. package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +1 -1
  29. package/dist/cjs/generator/json/JsonGenerator.js +308 -1982
  30. package/dist/cjs/generator/json/JsonGenerator.js.map +1 -1
  31. package/dist/cjs/generator/text/TextGenerator.js +26 -8
  32. package/dist/cjs/generator/text/TextGenerator.js.map +1 -1
  33. package/dist/cjs/index.js.map +1 -1
  34. package/dist/cjs/model/ast/NodeType.js +27 -8
  35. package/dist/cjs/model/ast/NodeType.js.map +1 -1
  36. package/dist/cjs/model/config/enum/PropertyConfigKey.js +1 -0
  37. package/dist/cjs/model/config/enum/PropertyConfigKey.js.map +1 -1
  38. package/dist/cjs/model/enum/BitType.js +1 -2
  39. package/dist/cjs/model/enum/BitType.js.map +1 -1
  40. package/dist/cjs/model/enum/PropertyFormat.js +3 -1
  41. package/dist/cjs/model/enum/PropertyFormat.js.map +1 -1
  42. package/dist/cjs/model/enum/TextFormat.js +1 -1
  43. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +9 -3
  44. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
  45. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +49 -131
  46. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
  47. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
  48. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +7 -31
  49. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
  50. package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +255 -0
  51. package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -0
  52. package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +2 -1
  53. package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
  54. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +175 -129
  55. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
  56. package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +8 -2
  57. package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
  58. package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +61 -0
  59. package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +1 -0
  60. package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +11 -5
  61. package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
  62. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +21 -17
  63. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
  64. package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +50 -0
  65. package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -0
  66. package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +2 -15
  67. package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +1 -1
  68. package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +2 -4
  69. package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
  70. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +4 -1
  71. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
  72. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +2 -4
  73. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +1 -1
  74. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +5 -5
  75. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
  76. package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +5 -6
  77. package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
  78. package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +23 -7
  79. package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
  80. package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +5 -5
  81. package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +1 -1
  82. package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +3 -2
  83. package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
  84. package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +19 -8
  85. package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
  86. package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +4 -6
  87. package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +1 -1
  88. package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +4 -5
  89. package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
  90. package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +14 -5
  91. package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
  92. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +37 -21
  93. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +1 -1
  94. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +3 -2
  95. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
  96. package/dist/cjs/parser/json/JsonParser.js +73 -765
  97. package/dist/cjs/parser/json/JsonParser.js.map +1 -1
  98. package/dist/cjs/parser/text/TextParser.js +61 -2
  99. package/dist/cjs/parser/text/TextParser.js.map +1 -1
  100. package/dist/cjs/utils/BitUtils.js +15 -13
  101. package/dist/cjs/utils/BitUtils.js.map +1 -1
  102. package/dist/esm/BitmarkParserGenerator.js +8 -3
  103. package/dist/esm/BitmarkParserGenerator.js.map +1 -1
  104. package/dist/esm/ast/Ast.js +1 -0
  105. package/dist/esm/ast/Ast.js.map +1 -1
  106. package/dist/esm/ast/BaseBuilder.js +91 -54
  107. package/dist/esm/ast/BaseBuilder.js.map +1 -1
  108. package/dist/esm/ast/Builder.js +776 -389
  109. package/dist/esm/ast/Builder.js.map +1 -1
  110. package/dist/esm/ast/ResourceBuilder.js +516 -252
  111. package/dist/esm/ast/ResourceBuilder.js.map +1 -1
  112. package/dist/esm/ast/rules/NodeValidator.js +61 -22
  113. package/dist/esm/ast/rules/NodeValidator.js.map +1 -1
  114. package/dist/esm/breakscaping/Breakscape.js +96 -71
  115. package/dist/esm/breakscaping/Breakscape.js.map +1 -1
  116. package/dist/esm/config/raw/bits.js +14 -5
  117. package/dist/esm/config/raw/bits.js.map +1 -1
  118. package/dist/esm/config/raw/properties.js +7 -2
  119. package/dist/esm/config/raw/properties.js.map +1 -1
  120. package/dist/esm/generated/build-info.js +1 -1
  121. package/dist/esm/generated/build-info.js.map +1 -1
  122. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js +1 -0
  123. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
  124. package/dist/esm/generator/AstWalkerGenerator.js +4 -1
  125. package/dist/esm/generator/AstWalkerGenerator.js.map +1 -1
  126. package/dist/esm/generator/bitmark/BitmarkGenerator.js +959 -338
  127. package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +1 -1
  128. package/dist/esm/generator/json/JsonGenerator.js +308 -1982
  129. package/dist/esm/generator/json/JsonGenerator.js.map +1 -1
  130. package/dist/esm/generator/text/TextGenerator.js +26 -8
  131. package/dist/esm/generator/text/TextGenerator.js.map +1 -1
  132. package/dist/esm/index.js.map +1 -1
  133. package/dist/esm/model/ast/NodeType.js +27 -8
  134. package/dist/esm/model/ast/NodeType.js.map +1 -1
  135. package/dist/esm/model/config/enum/PropertyConfigKey.js +1 -0
  136. package/dist/esm/model/config/enum/PropertyConfigKey.js.map +1 -1
  137. package/dist/esm/model/enum/BitType.js +1 -2
  138. package/dist/esm/model/enum/BitType.js.map +1 -1
  139. package/dist/esm/model/enum/PropertyFormat.js +3 -1
  140. package/dist/esm/model/enum/PropertyFormat.js.map +1 -1
  141. package/dist/esm/model/enum/TextFormat.js +1 -1
  142. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +9 -3
  143. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
  144. package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +49 -131
  145. package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
  146. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
  147. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +7 -31
  148. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
  149. package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +252 -0
  150. package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +1 -0
  151. package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +2 -1
  152. package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
  153. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +175 -129
  154. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
  155. package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +8 -2
  156. package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
  157. package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +58 -0
  158. package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +1 -0
  159. package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +11 -5
  160. package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
  161. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +21 -17
  162. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
  163. package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +47 -0
  164. package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +1 -0
  165. package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +2 -15
  166. package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +1 -1
  167. package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +2 -4
  168. package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
  169. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +4 -1
  170. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
  171. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +2 -4
  172. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +1 -1
  173. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +5 -5
  174. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
  175. package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +5 -6
  176. package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +1 -1
  177. package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +23 -7
  178. package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
  179. package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +5 -5
  180. package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +1 -1
  181. package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +3 -2
  182. package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
  183. package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +19 -8
  184. package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
  185. package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +4 -6
  186. package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +1 -1
  187. package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +4 -5
  188. package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +1 -1
  189. package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +14 -5
  190. package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
  191. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +37 -21
  192. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +1 -1
  193. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +3 -2
  194. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
  195. package/dist/esm/parser/json/JsonParser.js +73 -765
  196. package/dist/esm/parser/json/JsonParser.js.map +1 -1
  197. package/dist/esm/parser/text/TextParser.js +61 -2
  198. package/dist/esm/parser/text/TextParser.js.map +1 -1
  199. package/dist/esm/utils/BitUtils.js +15 -13
  200. package/dist/esm/utils/BitUtils.js.map +1 -1
  201. package/dist/types/BitmarkParserGenerator.d.ts +8 -0
  202. package/dist/types/BitmarkParserGenerator.d.ts.map +1 -1
  203. package/dist/types/ast/Ast.d.ts.map +1 -1
  204. package/dist/types/ast/BaseBuilder.d.ts +31 -21
  205. package/dist/types/ast/BaseBuilder.d.ts.map +1 -1
  206. package/dist/types/ast/Builder.d.ts +279 -441
  207. package/dist/types/ast/Builder.d.ts.map +1 -1
  208. package/dist/types/ast/ResourceBuilder.d.ts +177 -164
  209. package/dist/types/ast/ResourceBuilder.d.ts.map +1 -1
  210. package/dist/types/ast/rules/NodeValidator.d.ts +3 -2
  211. package/dist/types/ast/rules/NodeValidator.d.ts.map +1 -1
  212. package/dist/types/breakscaping/Breakscape.d.ts +6 -5
  213. package/dist/types/breakscaping/Breakscape.d.ts.map +1 -1
  214. package/dist/types/config/raw/bits.d.ts.map +1 -1
  215. package/dist/types/config/raw/properties.d.ts.map +1 -1
  216. package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts.map +1 -1
  217. package/dist/types/generator/AstWalkerGenerator.d.ts.map +1 -1
  218. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +89 -55
  219. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +1 -1
  220. package/dist/types/generator/json/JsonGenerator.d.ts +88 -108
  221. package/dist/types/generator/json/JsonGenerator.d.ts.map +1 -1
  222. package/dist/types/generator/text/TextGenerator.d.ts +14 -2
  223. package/dist/types/generator/text/TextGenerator.d.ts.map +1 -1
  224. package/dist/types/index.d.ts +2 -2
  225. package/dist/types/index.d.ts.map +1 -1
  226. package/dist/types/model/ast/NodeType.d.ts +48 -16
  227. package/dist/types/model/ast/NodeType.d.ts.map +1 -1
  228. package/dist/types/model/ast/Nodes.d.ts +64 -440
  229. package/dist/types/model/ast/Nodes.d.ts.map +1 -1
  230. package/dist/types/model/config/enum/ConfigKey.d.ts +2 -0
  231. package/dist/types/model/config/enum/ConfigKey.d.ts.map +1 -1
  232. package/dist/types/model/config/enum/PropertyConfigKey.d.ts +3 -0
  233. package/dist/types/model/config/enum/PropertyConfigKey.d.ts.map +1 -1
  234. package/dist/types/model/enum/BitType.d.ts +2 -4
  235. package/dist/types/model/enum/BitType.d.ts.map +1 -1
  236. package/dist/types/model/enum/PropertyFormat.d.ts +4 -2
  237. package/dist/types/model/enum/PropertyFormat.d.ts.map +1 -1
  238. package/dist/types/model/enum/PropertyTag.d.ts +2 -0
  239. package/dist/types/model/enum/PropertyTag.d.ts.map +1 -1
  240. package/dist/types/model/json/BitJson.d.ts +32 -20
  241. package/dist/types/model/json/BitJson.d.ts.map +1 -1
  242. package/dist/types/model/json/BodyBitJson.d.ts +16 -12
  243. package/dist/types/model/json/BodyBitJson.d.ts.map +1 -1
  244. package/dist/types/model/json/ResourceJson.d.ts +2 -22
  245. package/dist/types/model/json/ResourceJson.d.ts.map +1 -1
  246. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts +3 -2
  247. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +1 -1
  248. package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts +2 -15
  249. package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +1 -1
  250. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +83 -71
  251. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts.map +1 -1
  252. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts +2 -2
  253. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts.map +1 -1
  254. package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts +37 -0
  255. package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts.map +1 -0
  256. package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts.map +1 -1
  257. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts +2 -2
  258. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts.map +1 -1
  259. package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts.map +1 -1
  260. package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts +15 -0
  261. package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts.map +1 -0
  262. package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts.map +1 -1
  263. package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts.map +1 -1
  264. package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts +16 -0
  265. package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts.map +1 -0
  266. package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts.map +1 -1
  267. package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts.map +1 -1
  268. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts.map +1 -1
  269. package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts.map +1 -1
  270. package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts.map +1 -1
  271. package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts.map +1 -1
  272. package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts.map +1 -1
  273. package/dist/types/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.d.ts.map +1 -1
  274. package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts.map +1 -1
  275. package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts +2 -2
  276. package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts.map +1 -1
  277. package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.d.ts.map +1 -1
  278. package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts.map +1 -1
  279. package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts +5 -2
  280. package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts.map +1 -1
  281. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts +1 -1
  282. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts.map +1 -1
  283. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts.map +1 -1
  284. package/dist/types/parser/json/JsonParser.d.ts +9 -72
  285. package/dist/types/parser/json/JsonParser.d.ts.map +1 -1
  286. package/dist/types/parser/text/TextParser.d.ts +16 -1
  287. package/dist/types/parser/text/TextParser.d.ts.map +1 -1
  288. package/dist/types/utils/BitUtils.d.ts +8 -8
  289. package/dist/types/utils/BitUtils.d.ts.map +1 -1
  290. package/package.json +1 -1
@@ -0,0 +1,255 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BodyContentProcessor = void 0;
4
+ const Breakscape_1 = require("../../../../breakscaping/Breakscape");
5
+ const BodyBitType_1 = require("../../../../model/enum/BodyBitType");
6
+ const TextFormat_1 = require("../../../../model/enum/TextFormat");
7
+ const StringUtils_1 = require("../../../../utils/StringUtils");
8
+ const TextParser_1 = require("../../../text/TextParser");
9
+ const BitmarkPegParserValidator_1 = require("../BitmarkPegParserValidator");
10
+ const ContentProcessorUtils_1 = require("./ContentProcessorUtils");
11
+ const textParser = new TextParser_1.TextParser();
12
+ class BodyContentProcessor {
13
+ process(context, contentDepth, bitType, textFormat, _tagsConfig, _target, bodyParts, isCardBody) {
14
+ const bodyBits = [];
15
+ let finalBody;
16
+ let finalBodyString;
17
+ //
18
+ const trimmedBodyParts = bodyParts.length > 0 ? this.trimBodyParts(bodyParts) : undefined;
19
+ const validatedBodyParts = isCardBody
20
+ ? trimmedBodyParts
21
+ : BitmarkPegParserValidator_1.BitmarkPegParserValidator.checkBody(context, contentDepth, bitType, textFormat, trimmedBodyParts);
22
+ // If the text format is JSON, check the body is valid JSON
23
+ // In this case, the body will already have been 'squashed' so will not contain any parsed inline body tags
24
+ if (textFormat === TextFormat_1.TextFormat.json && validatedBodyParts) {
25
+ finalBody = validatedBodyParts.reduce((acc, val) => {
26
+ var _a;
27
+ if (val.type === BodyBitType_1.BodyBitType.text && val.data) {
28
+ const bodyTextVal = val;
29
+ return (acc + ((_a = bodyTextVal.data.bodyText) !== null && _a !== void 0 ? _a : ''));
30
+ }
31
+ return acc;
32
+ }, '');
33
+ try {
34
+ finalBody = JSON.parse(finalBody);
35
+ }
36
+ catch (e) {
37
+ finalBody = null;
38
+ context.addError(`Body JSON is invalid.`);
39
+ }
40
+ }
41
+ else {
42
+ // Standard body
43
+ let bodyTextStr = '';
44
+ let plainBodyTextStr = '';
45
+ let bodyStr = '';
46
+ let placeholderIndex = 0;
47
+ // Function for creating the placeholder keys
48
+ const createPlaceholderKey = (i) => `[!${i}]`;
49
+ // Loop the text bodyParts creating full body text with the correct placeholders
50
+ //
51
+ // fullBodyTextStr:
52
+ // - is created and passed into the text parser to create the body text AST
53
+ // - has placeholders inserted into 'fullBodyTextStr' in the format [!0] to allow the text parser to identify
54
+ // where the body bits should be inserted.
55
+ //
56
+ if (validatedBodyParts) {
57
+ for (let i = 0; i < validatedBodyParts.length; i++) {
58
+ const bodyPart = validatedBodyParts[i];
59
+ const isText = bodyPart.type === BodyBitType_1.BodyBitType.text;
60
+ if (isText) {
61
+ const asText = bodyPart;
62
+ const bodyTextPart = asText.data.bodyText;
63
+ // Append the text part to the full text body
64
+ if (asText.data.isPlain) {
65
+ plainBodyTextStr = Breakscape_1.Breakscape.concatenate(plainBodyTextStr, bodyTextPart);
66
+ }
67
+ else {
68
+ bodyTextStr = Breakscape_1.Breakscape.concatenate(bodyTextStr, bodyTextPart);
69
+ }
70
+ bodyStr = Breakscape_1.Breakscape.concatenate(bodyStr, bodyTextPart);
71
+ }
72
+ else {
73
+ const placeholderKey = createPlaceholderKey(placeholderIndex);
74
+ // Append the placeholder to the full text body
75
+ bodyTextStr = Breakscape_1.Breakscape.concatenate(bodyTextStr, placeholderKey);
76
+ // Add the body bit to the body bits
77
+ bodyBits.push(bodyPart);
78
+ placeholderIndex++;
79
+ }
80
+ }
81
+ }
82
+ // Create the body text AST
83
+ const isBitmarkText = textFormat === TextFormat_1.TextFormat.bitmarkMinusMinus || textFormat === TextFormat_1.TextFormat.bitmarkPlusPlus;
84
+ const parsedBodyText = isBitmarkText
85
+ ? textParser.toAst(bodyTextStr, {
86
+ //
87
+ textFormat,
88
+ })
89
+ : Breakscape_1.Breakscape.unbreakscape(bodyTextStr, {
90
+ textFormat: TextFormat_1.TextFormat.text,
91
+ });
92
+ const parserPlainText = Breakscape_1.Breakscape.unbreakscape(plainBodyTextStr, {
93
+ textFormat: TextFormat_1.TextFormat.text,
94
+ });
95
+ // Newlines will have been lost from the end of bodyTextStr, and start of plainBodyTextStr
96
+ // Count then and add them back when merging
97
+ const newlines = StringUtils_1.StringUtils.countOccurrencesAtEnd(bodyTextStr, '\n') +
98
+ StringUtils_1.StringUtils.countOccurrencesAtStart(plainBodyTextStr, '\n');
99
+ finalBody = ContentProcessorUtils_1.ContentProcessorUtils.concatenatePlainTextWithAstTexts(parsedBodyText, newlines, parserPlainText);
100
+ finalBodyString = Breakscape_1.Breakscape.unbreakscape(bodyStr, {
101
+ textFormat,
102
+ }).trim();
103
+ const finalBodyIsAst = Array.isArray(finalBody);
104
+ const bodyAst = finalBodyIsAst ? finalBody : undefined;
105
+ // Loop the body parts again to create the body bits:
106
+ // - The body bits are inserted into body AST, replacing the placeholders created by the text parser
107
+ if (bodyAst && validatedBodyParts) {
108
+ placeholderIndex = 0;
109
+ for (let i = 0; i < validatedBodyParts.length; i++) {
110
+ const bodyPart = validatedBodyParts[i];
111
+ // Skip text body parts as they are handled above
112
+ const isText = bodyPart.type === BodyBitType_1.BodyBitType.text;
113
+ if (isText)
114
+ continue;
115
+ const bodyBit = bodyPart;
116
+ let bodyBitJson;
117
+ switch (bodyPart.type) {
118
+ case BodyBitType_1.BodyBitType.gap: {
119
+ // const gap = bodyBit as Gap;
120
+ // bodyBitJson = this.createGapJson(gap);
121
+ bodyBitJson = bodyBit;
122
+ break;
123
+ }
124
+ case BodyBitType_1.BodyBitType.mark: {
125
+ // const mark = bodyBit as Mark;
126
+ // bodyBitJson = this.createMarkJson(mark);
127
+ bodyBitJson = bodyBit;
128
+ break;
129
+ }
130
+ case BodyBitType_1.BodyBitType.select: {
131
+ // const select = bodyBit as SelectJson;
132
+ // bodyBitJson = this.createSelectJson(select);
133
+ bodyBitJson = bodyBit;
134
+ break;
135
+ }
136
+ case BodyBitType_1.BodyBitType.highlight: {
137
+ // const highlight = bodyBit as Highlight;
138
+ // bodyBitJson = this.createHighlightJson(highlight);
139
+ bodyBitJson = bodyBit;
140
+ break;
141
+ }
142
+ }
143
+ // Add the gap to the placeholders
144
+ if (bodyBitJson) {
145
+ // Insert the body bit into the body AST
146
+ this.replacePlaceholderWithBodyBit(bodyAst, bodyBitJson, placeholderIndex);
147
+ }
148
+ placeholderIndex++;
149
+ }
150
+ }
151
+ } // Standard body
152
+ // Return the body in the target
153
+ return {
154
+ body: finalBody,
155
+ bodyBits: bodyBits.length > 0 ? bodyBits : undefined,
156
+ bodyString: finalBodyString,
157
+ };
158
+ }
159
+ buildBodyText(bodyTextPart, isPlain) {
160
+ const bodyText = {
161
+ type: BodyBitType_1.BodyBitType.text,
162
+ data: {
163
+ bodyText: bodyTextPart,
164
+ isPlain,
165
+ },
166
+ };
167
+ return bodyText;
168
+ }
169
+ /**
170
+ * Walk the body AST to find the placeholder and replace it with the body bit.
171
+ *
172
+ * @param bodyAst the body AST
173
+ * @param bodyBitJson the body bit json to insert at the placeholder position
174
+ * @param index the index of the placeholder to replace
175
+ */
176
+ replacePlaceholderWithBodyBit(bodyAst, bodyBitJson, index) {
177
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
178
+ const walkRecursive = (node, parent, parentKey) => {
179
+ if (Array.isArray(node)) {
180
+ // Walk the array of nodes
181
+ for (let i = 0; i < node.length; i++) {
182
+ const child = node[i];
183
+ const done = walkRecursive(child, node, i);
184
+ if (done)
185
+ return true;
186
+ }
187
+ }
188
+ else {
189
+ if (node.type === 'bit' && node.index === index) {
190
+ // Found the placeholder, replace it with the body bit
191
+ parent[parentKey] = bodyBitJson;
192
+ return true;
193
+ }
194
+ if (node.content) {
195
+ // Walk the child content
196
+ const done = walkRecursive(node.content, node, 'content');
197
+ if (done)
198
+ return true;
199
+ }
200
+ }
201
+ return false;
202
+ };
203
+ walkRecursive(bodyAst, null, null);
204
+ }
205
+ /**
206
+ * Trim the body parts, removing any whitespace only parts at start and end of body
207
+ *
208
+ * @param parts the body parts to trim
209
+ * @returns the trimmed body parts
210
+ */
211
+ trimBodyParts(parts) {
212
+ // Trim start
213
+ let foundText = false;
214
+ let trimmedParts = parts.reduce((acc, part) => {
215
+ const text = part;
216
+ if (!foundText && text.type === BodyBitType_1.BodyBitType.text) {
217
+ const t = text.data.bodyText.trimStart();
218
+ if (t) {
219
+ foundText = true;
220
+ text.data.bodyText = t;
221
+ acc.push(text);
222
+ }
223
+ }
224
+ else {
225
+ // Not body text, so add it
226
+ foundText = true;
227
+ acc.push(part);
228
+ }
229
+ return acc;
230
+ }, []);
231
+ // Trim end
232
+ foundText = false;
233
+ trimmedParts = trimmedParts.reduceRight((acc, part) => {
234
+ const text = part;
235
+ if (!foundText && text.type === BodyBitType_1.BodyBitType.text) {
236
+ const t = text.data.bodyText.trimEnd();
237
+ if (t) {
238
+ foundText = true;
239
+ text.data.bodyText = t;
240
+ acc.unshift(text);
241
+ }
242
+ }
243
+ else {
244
+ // Not body text, so add it
245
+ foundText = true;
246
+ acc.unshift(part);
247
+ }
248
+ return acc;
249
+ }, []);
250
+ return trimmedParts;
251
+ }
252
+ }
253
+ const instance = new BodyContentProcessor();
254
+ exports.BodyContentProcessor = instance;
255
+ //# sourceMappingURL=BodyContentProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BodyContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/BodyContentProcessor.ts"],"names":[],"mappings":";;;AAAA,oEAAiE;AAMjE,oEAAiE;AACjE,kEAA+E;AAE/E,+DAA4D;AAC5D,yDAAsD;AAEtD,4EAAyE;AAEzE,mEAAgE;AAUhE,MAAM,UAAU,GAAG,IAAI,uBAAU,EAAE,CAAC;AAEpC,MAAM,oBAAoB;IACjB,OAAO,CACZ,OAAgC,EAChC,YAA8B,EAC9B,OAAoB,EACpB,UAA0B,EAC1B,WAAmC,EACnC,OAAkC,EAClC,SAAqB,EACrB,UAAmB;QAEnB,MAAM,QAAQ,GAAkB,EAAE,CAAC;QACnC,IAAI,SAAyC,CAAC;QAC9C,IAAI,eAAmC,CAAC;QACxC,EAAE;QACF,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1F,MAAM,kBAAkB,GAAG,UAAU;YACnC,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,qDAAyB,CAAC,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;QAEtG,2DAA2D;QAC3D,2GAA2G;QAC3G,IAAI,UAAU,KAAK,uBAAU,CAAC,IAAI,IAAI,kBAAkB,EAAE,CAAC;YACzD,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;;gBACjD,IAAI,GAAG,CAAC,IAAI,KAAK,yBAAW,CAAC,IAAI,IAAI,GA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BACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;oBACvB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,2BAA2B;gBAC3B,SAAS,GAAG,IAAI,CAAC;gBACjB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAgB,CAAC,CAAC;QAErB,WAAW;QACX,SAAS,GAAG,KAAK,CAAC;QAClB,YAAY,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACpD,MAAM,IAAI,GAAG,IAAgB,CAAC;YAC9B,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,yBAAW,CAAC,IAAI,EAAE,CAAC;gBACjD,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAuB,CAAC;gBAC5D,IAAI,CAAC,EAAE,CAAC;oBACN,SAAS,GAAG,IAAI,CAAC;oBACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;oBACvB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,2BAA2B;gBAC3B,SAAS,GAAG,IAAI,CAAC;gBACjB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAgB,CAAC,CAAC;QAErB,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,IAAI,oBAAoB,EAAE,CAAC;AACvB,wCAAoB"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bookChainContentProcessor = bookChainContentProcessor;
4
+ const Breakscape_1 = require("../../../../breakscaping/Breakscape");
4
5
  const StringUtils_1 = require("../../../../utils/StringUtils");
5
6
  const BitmarkPegParserTypes_1 = require("../BitmarkPegParserTypes");
6
7
  // const builder = new Builder();
@@ -23,7 +24,7 @@ function buildBook(context, _contentDepth, bitType, textFormat, tagsConfig, cont
23
24
  context.debugPrint('book TAGS', tags);
24
25
  const { reference, referenceEnd } = tags;
25
26
  // Extract the book from the content tag
26
- const book = StringUtils_1.StringUtils.trimmedString(content.value);
27
+ const book = Breakscape_1.Breakscape.unbreakscape(StringUtils_1.StringUtils.trimmedString(content.value));
27
28
  return {
28
29
  book,
29
30
  reference,
@@ -1 +1 @@
1
- {"version":3,"file":"BookChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.ts"],"names":[],"mappings":";;AAiES,8DAAyB;AA7DlC,+DAA4D;AAE5D,oEAMkC;AAElC,iCAAiC;AAEjC,SAAS,yBAAyB,CAChC,OAAgC,EAChC,YAA8B,EAC9B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;IAEjC,IAAI,YAAY,KAAK,uCAAe,CAAC,KAAK,EAAE,CAAC;QAC3C,aAAa;IACf,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxF,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACxB,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAChB,OAAgC,EAChC,aAA+B,EAC/B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB;IAMnB,IAAI,OAAO,CAAC,mBAAmB;QAAE,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAE7E,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,uCAAe,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEhH,IAAI,OAAO,CAAC,gBAAgB;QAAE,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAEpE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEzC,wCAAwC;IACxC,MAAM,IAAI,GAAG,yBAAW,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAsB,CAAC;IAE3E,OAAO;QACL,IAAI;QACJ,SAAS;QACT,YAAY;KACb,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"BookChainContentProcessor.js","sourceRoot":"","sources":["../../../../../../src/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.ts"],"names":[],"mappings":";;AAkES,8DAAyB;AAlElC,oEAAiE;AAKjE,+DAA4D;AAE5D,oEAMkC;AAElC,iCAAiC;AAEjC,SAAS,yBAAyB,CAChC,OAAgC,EAChC,YAA8B,EAC9B,OAAoB,EACpB,UAA0B,EAC1B,UAAkC,EAClC,OAAmB,EACnB,MAAiC;IAEjC,IAAI,YAAY,KAAK,uCAAe,CAAC,KAAK,EAAE,CAAC;QAC3C,aAAa;IACf,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxF,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACxB,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAClC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,SAAS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