@tscaps/engine 0.1.1 → 0.3.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 (657) hide show
  1. package/README.md +48 -10
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/modules/bidi/BidiAnalyzer.d.ts +23 -0
  7. package/dist/modules/bidi/BidiAnalyzer.d.ts.map +1 -0
  8. package/dist/modules/bidi/BidiAnalyzer.js +2 -0
  9. package/dist/modules/bidi/BidiAnalyzer.js.map +1 -0
  10. package/dist/modules/bidi/BidiCharacterClassifier.d.ts +13 -0
  11. package/dist/modules/bidi/BidiCharacterClassifier.d.ts.map +1 -0
  12. package/dist/modules/bidi/BidiCharacterClassifier.js +2 -0
  13. package/dist/modules/bidi/BidiCharacterClassifier.js.map +1 -0
  14. package/dist/modules/bidi/BidiJsAnalyzer.d.ts +14 -0
  15. package/dist/modules/bidi/BidiJsAnalyzer.d.ts.map +1 -0
  16. package/dist/modules/bidi/BidiJsAnalyzer.js +19 -0
  17. package/dist/modules/bidi/BidiJsAnalyzer.js.map +1 -0
  18. package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts +8 -0
  19. package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts.map +1 -0
  20. package/dist/modules/bidi/BidiJsCharacterClassifier.js +19 -0
  21. package/dist/modules/bidi/BidiJsCharacterClassifier.js.map +1 -0
  22. package/dist/modules/bidi/CursiveScriptDetector.d.ts +12 -0
  23. package/dist/modules/bidi/CursiveScriptDetector.d.ts.map +1 -0
  24. package/dist/modules/bidi/CursiveScriptDetector.js +20 -0
  25. package/dist/modules/bidi/CursiveScriptDetector.js.map +1 -0
  26. package/dist/modules/bidi/HorizontalSide.d.ts +18 -0
  27. package/dist/modules/bidi/HorizontalSide.d.ts.map +1 -0
  28. package/dist/modules/bidi/HorizontalSide.js +3 -0
  29. package/dist/modules/bidi/HorizontalSide.js.map +1 -0
  30. package/dist/modules/bidi/HorizontalSideResolver.d.ts +21 -0
  31. package/dist/modules/bidi/HorizontalSideResolver.d.ts.map +1 -0
  32. package/dist/modules/bidi/HorizontalSideResolver.js +27 -0
  33. package/dist/modules/bidi/HorizontalSideResolver.js.map +1 -0
  34. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts +24 -0
  35. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts.map +1 -0
  36. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js +34 -0
  37. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js.map +1 -0
  38. package/dist/modules/bidi/TextDirection.d.ts +9 -0
  39. package/dist/modules/bidi/TextDirection.d.ts.map +1 -0
  40. package/dist/modules/bidi/TextDirection.js +2 -0
  41. package/dist/modules/bidi/TextDirection.js.map +1 -0
  42. package/dist/modules/bidi/TextDirectionDetector.d.ts +12 -0
  43. package/dist/modules/bidi/TextDirectionDetector.d.ts.map +1 -0
  44. package/dist/modules/bidi/TextDirectionDetector.js +2 -0
  45. package/dist/modules/bidi/TextDirectionDetector.js.map +1 -0
  46. package/dist/modules/bidi/WordFragment.d.ts +34 -0
  47. package/dist/modules/bidi/WordFragment.d.ts.map +1 -0
  48. package/dist/modules/bidi/WordFragment.js +2 -0
  49. package/dist/modules/bidi/WordFragment.js.map +1 -0
  50. package/dist/modules/bidi/WordFragmenter.d.ts +43 -0
  51. package/dist/modules/bidi/WordFragmenter.d.ts.map +1 -0
  52. package/dist/modules/bidi/WordFragmenter.js +112 -0
  53. package/dist/modules/bidi/WordFragmenter.js.map +1 -0
  54. package/dist/modules/bidi/index.d.ts +14 -0
  55. package/dist/modules/bidi/index.d.ts.map +1 -0
  56. package/dist/modules/bidi/index.js +8 -0
  57. package/dist/modules/bidi/index.js.map +1 -0
  58. package/dist/modules/css/CssBlockSealer.d.ts +30 -0
  59. package/dist/modules/css/CssBlockSealer.d.ts.map +1 -0
  60. package/dist/modules/css/CssBlockSealer.js +64 -0
  61. package/dist/modules/css/CssBlockSealer.js.map +1 -0
  62. package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts +13 -0
  63. package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts.map +1 -0
  64. package/dist/modules/css/CssCustomPropertyDefinitionScanner.js +24 -0
  65. package/dist/modules/css/CssCustomPropertyDefinitionScanner.js.map +1 -0
  66. package/dist/modules/css/CssFilterReferenceScanner.d.ts +15 -0
  67. package/dist/modules/css/CssFilterReferenceScanner.d.ts.map +1 -0
  68. package/dist/modules/css/CssFilterReferenceScanner.js +22 -0
  69. package/dist/modules/css/CssFilterReferenceScanner.js.map +1 -0
  70. package/dist/modules/css/CssFragmentParser.d.ts +53 -0
  71. package/dist/modules/css/CssFragmentParser.d.ts.map +1 -0
  72. package/dist/modules/css/CssFragmentParser.js +127 -0
  73. package/dist/modules/css/CssFragmentParser.js.map +1 -0
  74. package/dist/modules/css/CssKeyframeNamespacer.d.ts +21 -0
  75. package/dist/modules/css/CssKeyframeNamespacer.d.ts.map +1 -0
  76. package/dist/modules/css/CssKeyframeNamespacer.js +48 -0
  77. package/dist/modules/css/CssKeyframeNamespacer.js.map +1 -0
  78. package/dist/modules/css/CssKeyframesScanner.d.ts +29 -0
  79. package/dist/modules/css/CssKeyframesScanner.d.ts.map +1 -0
  80. package/dist/modules/css/CssKeyframesScanner.js +102 -0
  81. package/dist/modules/css/CssKeyframesScanner.js.map +1 -0
  82. package/dist/modules/css/CssLayer.d.ts +20 -0
  83. package/dist/modules/css/CssLayer.d.ts.map +1 -0
  84. package/dist/modules/css/CssLayer.js +21 -0
  85. package/dist/modules/css/CssLayer.js.map +1 -0
  86. package/dist/modules/css/CssScoper.d.ts +31 -2
  87. package/dist/modules/css/CssScoper.d.ts.map +1 -1
  88. package/dist/modules/css/CssScoper.js +168 -79
  89. package/dist/modules/css/CssScoper.js.map +1 -1
  90. package/dist/modules/css/CssSelectorClassScanner.d.ts +25 -0
  91. package/dist/modules/css/CssSelectorClassScanner.d.ts.map +1 -0
  92. package/dist/modules/css/CssSelectorClassScanner.js +91 -0
  93. package/dist/modules/css/CssSelectorClassScanner.js.map +1 -0
  94. package/dist/modules/css/CssVarReferenceScanner.d.ts +16 -0
  95. package/dist/modules/css/CssVarReferenceScanner.d.ts.map +1 -0
  96. package/dist/modules/css/CssVarReferenceScanner.js +27 -0
  97. package/dist/modules/css/CssVarReferenceScanner.js.map +1 -0
  98. package/dist/modules/css/index.d.ts +9 -0
  99. package/dist/modules/css/index.d.ts.map +1 -1
  100. package/dist/modules/css/index.js +9 -0
  101. package/dist/modules/css/index.js.map +1 -1
  102. package/dist/modules/document/CssClass.d.ts +20 -0
  103. package/dist/modules/document/CssClass.d.ts.map +1 -0
  104. package/dist/modules/document/CssClass.js +21 -0
  105. package/dist/modules/document/CssClass.js.map +1 -0
  106. package/dist/modules/document/CssVariable.d.ts +21 -6
  107. package/dist/modules/document/CssVariable.d.ts.map +1 -1
  108. package/dist/modules/document/CssVariable.js +27 -5
  109. package/dist/modules/document/CssVariable.js.map +1 -1
  110. package/dist/modules/document/DataAttribute.d.ts +26 -0
  111. package/dist/modules/document/DataAttribute.d.ts.map +1 -0
  112. package/dist/modules/document/DataAttribute.js +27 -0
  113. package/dist/modules/document/DataAttribute.js.map +1 -0
  114. package/dist/modules/document/Decoration.d.ts +42 -0
  115. package/dist/modules/document/Decoration.d.ts.map +1 -0
  116. package/dist/modules/document/Decoration.js +52 -0
  117. package/dist/modules/document/Decoration.js.map +1 -0
  118. package/dist/modules/document/Document.d.ts.map +1 -1
  119. package/dist/modules/document/Document.js +0 -3
  120. package/dist/modules/document/Document.js.map +1 -1
  121. package/dist/modules/document/DocumentEditor.d.ts +51 -9
  122. package/dist/modules/document/DocumentEditor.d.ts.map +1 -1
  123. package/dist/modules/document/DocumentEditor.js +118 -26
  124. package/dist/modules/document/DocumentEditor.js.map +1 -1
  125. package/dist/modules/document/DocumentNodeId.d.ts +23 -0
  126. package/dist/modules/document/DocumentNodeId.d.ts.map +1 -0
  127. package/dist/modules/document/DocumentNodeId.js +31 -0
  128. package/dist/modules/document/DocumentNodeId.js.map +1 -0
  129. package/dist/modules/document/Line.d.ts +10 -7
  130. package/dist/modules/document/Line.d.ts.map +1 -1
  131. package/dist/modules/document/Line.js +13 -25
  132. package/dist/modules/document/Line.js.map +1 -1
  133. package/dist/modules/document/Section.d.ts +1 -8
  134. package/dist/modules/document/Section.d.ts.map +1 -1
  135. package/dist/modules/document/Section.js +4 -35
  136. package/dist/modules/document/Section.js.map +1 -1
  137. package/dist/modules/document/Segment.d.ts +24 -14
  138. package/dist/modules/document/Segment.d.ts.map +1 -1
  139. package/dist/modules/document/Segment.js +41 -23
  140. package/dist/modules/document/Segment.js.map +1 -1
  141. package/dist/modules/document/Word.d.ts +21 -8
  142. package/dist/modules/document/Word.d.ts.map +1 -1
  143. package/dist/modules/document/Word.js +34 -35
  144. package/dist/modules/document/Word.js.map +1 -1
  145. package/dist/modules/document/index.d.ts +5 -2
  146. package/dist/modules/document/index.d.ts.map +1 -1
  147. package/dist/modules/document/index.js +4 -1
  148. package/dist/modules/document/index.js.map +1 -1
  149. package/dist/modules/effect/CarryQuotesEffect.d.ts +1 -7
  150. package/dist/modules/effect/CarryQuotesEffect.d.ts.map +1 -1
  151. package/dist/modules/effect/CarryQuotesEffect.js +17 -30
  152. package/dist/modules/effect/CarryQuotesEffect.js.map +1 -1
  153. package/dist/modules/effect/GapFreeEffect.d.ts +15 -0
  154. package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -1
  155. package/dist/modules/effect/GapFreeEffect.js +29 -4
  156. package/dist/modules/effect/GapFreeEffect.js.map +1 -1
  157. package/dist/modules/effect/RemovePunctuationEffect.d.ts +10 -2
  158. package/dist/modules/effect/RemovePunctuationEffect.d.ts.map +1 -1
  159. package/dist/modules/effect/RemovePunctuationEffect.js +26 -6
  160. package/dist/modules/effect/RemovePunctuationEffect.js.map +1 -1
  161. package/dist/modules/effect/SmartLowercaseEffect.d.ts +7 -6
  162. package/dist/modules/effect/SmartLowercaseEffect.d.ts.map +1 -1
  163. package/dist/modules/effect/SmartLowercaseEffect.js +11 -7
  164. package/dist/modules/effect/SmartLowercaseEffect.js.map +1 -1
  165. package/dist/modules/pipeline/RenderPipelineBuilder.d.ts +3 -3
  166. package/dist/modules/pipeline/RenderPipelineBuilder.d.ts.map +1 -1
  167. package/dist/modules/pipeline/RenderPipelineBuilder.js +13 -8
  168. package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -1
  169. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts +19 -25
  170. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -1
  171. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +43 -717
  172. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -1
  173. package/dist/modules/rendering/HorizontalPlacementResolver.d.ts +27 -0
  174. package/dist/modules/rendering/HorizontalPlacementResolver.d.ts.map +1 -0
  175. package/dist/modules/rendering/HorizontalPlacementResolver.js +31 -0
  176. package/dist/modules/rendering/HorizontalPlacementResolver.js.map +1 -0
  177. package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +10 -5
  178. package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -1
  179. package/dist/modules/rendering/index.d.ts +16 -8
  180. package/dist/modules/rendering/index.d.ts.map +1 -1
  181. package/dist/modules/rendering/index.js +8 -2
  182. package/dist/modules/rendering/index.js.map +1 -1
  183. package/dist/modules/rendering/styles/BaselineCssComposer.d.ts +41 -0
  184. package/dist/modules/rendering/styles/BaselineCssComposer.d.ts.map +1 -0
  185. package/dist/modules/rendering/styles/BaselineCssComposer.js +64 -0
  186. package/dist/modules/rendering/styles/BaselineCssComposer.js.map +1 -0
  187. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts +7 -0
  188. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts.map +1 -0
  189. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js +35 -0
  190. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js.map +1 -0
  191. package/dist/modules/rendering/styles/FrozenFrameCss.d.ts +28 -0
  192. package/dist/modules/rendering/styles/FrozenFrameCss.d.ts.map +1 -0
  193. package/dist/modules/rendering/styles/FrozenFrameCss.js +28 -0
  194. package/dist/modules/rendering/styles/FrozenFrameCss.js.map +1 -0
  195. package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts +20 -0
  196. package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts.map +1 -0
  197. package/dist/modules/rendering/styles/InlineStyleEmitter.js +44 -0
  198. package/dist/modules/rendering/styles/InlineStyleEmitter.js.map +1 -0
  199. package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.d.ts +15 -0
  200. package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.d.ts.map +1 -0
  201. package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.js +33 -0
  202. package/dist/modules/rendering/styles/SegmentPaddingCssRuleBuilder.js.map +1 -0
  203. package/dist/modules/rendering/{VideoFrameLayerClass.d.ts → styles/VideoFrameLayerBaselineCss.d.ts} +3 -10
  204. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.d.ts.map +1 -0
  205. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js +15 -0
  206. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js.map +1 -0
  207. package/dist/modules/rendering/subtitle/AbstractAnim.d.ts +13 -0
  208. package/dist/modules/rendering/subtitle/AbstractAnim.d.ts.map +1 -0
  209. package/dist/modules/rendering/subtitle/AbstractAnim.js +2 -0
  210. package/dist/modules/rendering/subtitle/AbstractAnim.js.map +1 -0
  211. package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts +20 -0
  212. package/dist/modules/rendering/subtitle/ActiveRenderSession.d.ts.map +1 -0
  213. package/dist/modules/rendering/subtitle/ActiveRenderSession.js +31 -0
  214. package/dist/modules/rendering/subtitle/ActiveRenderSession.js.map +1 -0
  215. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts +21 -0
  216. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts.map +1 -0
  217. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js +46 -0
  218. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js.map +1 -0
  219. package/dist/modules/rendering/subtitle/AnimationProbe.d.ts +39 -0
  220. package/dist/modules/rendering/subtitle/AnimationProbe.d.ts.map +1 -0
  221. package/dist/modules/rendering/subtitle/AnimationProbe.js +203 -0
  222. package/dist/modules/rendering/subtitle/AnimationProbe.js.map +1 -0
  223. package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts +15 -0
  224. package/dist/modules/rendering/subtitle/AssetGroupBuilder.d.ts.map +1 -0
  225. package/dist/modules/rendering/subtitle/AssetGroupBuilder.js +26 -0
  226. package/dist/modules/rendering/subtitle/AssetGroupBuilder.js.map +1 -0
  227. package/dist/modules/rendering/subtitle/BatchPlan.d.ts +32 -0
  228. package/dist/modules/rendering/subtitle/BatchPlan.d.ts.map +1 -0
  229. package/dist/modules/rendering/subtitle/BatchPlan.js +2 -0
  230. package/dist/modules/rendering/subtitle/BatchPlan.js.map +1 -0
  231. package/dist/modules/rendering/subtitle/BatchPlanner.d.ts +32 -0
  232. package/dist/modules/rendering/subtitle/BatchPlanner.d.ts.map +1 -0
  233. package/dist/modules/rendering/subtitle/BatchPlanner.js +93 -0
  234. package/dist/modules/rendering/subtitle/BatchPlanner.js.map +1 -0
  235. package/dist/modules/rendering/subtitle/PreparedStyle.d.ts +36 -0
  236. package/dist/modules/rendering/subtitle/PreparedStyle.d.ts.map +1 -0
  237. package/dist/modules/rendering/subtitle/PreparedStyle.js +2 -0
  238. package/dist/modules/rendering/subtitle/PreparedStyle.js.map +1 -0
  239. package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts +31 -0
  240. package/dist/modules/rendering/subtitle/PreparedStyleFactory.d.ts.map +1 -0
  241. package/dist/modules/rendering/subtitle/PreparedStyleFactory.js +91 -0
  242. package/dist/modules/rendering/subtitle/PreparedStyleFactory.js.map +1 -0
  243. package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.d.ts +13 -0
  244. package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.d.ts.map +1 -0
  245. package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.js +24 -0
  246. package/dist/modules/rendering/subtitle/SegmentPaintRegionCache.js.map +1 -0
  247. package/dist/modules/rendering/{SegmentPaintRegionResolver.d.ts → subtitle/SegmentPaintRegionResolver.d.ts} +1 -1
  248. package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.d.ts.map +1 -0
  249. package/dist/modules/rendering/{SegmentPaintRegionResolver.js → subtitle/SegmentPaintRegionResolver.js} +7 -4
  250. package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js.map +1 -0
  251. package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.d.ts +45 -0
  252. package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.d.ts.map +1 -0
  253. package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.js +50 -0
  254. package/dist/modules/rendering/subtitle/SegmentSubtreeDecomposer.js.map +1 -0
  255. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts +108 -0
  256. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts.map +1 -0
  257. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js +246 -0
  258. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js.map +1 -0
  259. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts +40 -0
  260. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts.map +1 -0
  261. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js +132 -0
  262. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js.map +1 -0
  263. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts +48 -0
  264. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts.map +1 -0
  265. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js +143 -0
  266. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js.map +1 -0
  267. package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts +17 -0
  268. package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.d.ts.map +1 -0
  269. package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js +58 -0
  270. package/dist/modules/rendering/subtitle/SpriteSheetSizeProber.js.map +1 -0
  271. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts +20 -0
  272. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts.map +1 -0
  273. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js +30 -0
  274. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js.map +1 -0
  275. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts +42 -0
  276. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts.map +1 -0
  277. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js +121 -0
  278. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js.map +1 -0
  279. package/dist/modules/rendering/types/AlignmentConfig.d.ts +33 -0
  280. package/dist/modules/rendering/types/AlignmentConfig.d.ts.map +1 -0
  281. package/dist/modules/rendering/types/AlignmentConfig.js +3 -0
  282. package/dist/modules/rendering/types/AlignmentConfig.js.map +1 -0
  283. package/dist/modules/rendering/types/BoxEdges.d.ts.map +1 -0
  284. package/dist/modules/rendering/types/BoxEdges.js.map +1 -0
  285. package/dist/modules/rendering/types/DecorationPlacementSide.d.ts +8 -0
  286. package/dist/modules/rendering/types/DecorationPlacementSide.d.ts.map +1 -0
  287. package/dist/modules/rendering/types/DecorationPlacementSide.js +2 -0
  288. package/dist/modules/rendering/types/DecorationPlacementSide.js.map +1 -0
  289. package/dist/modules/rendering/types/ElementRenderOverrides.d.ts +23 -0
  290. package/dist/modules/rendering/types/ElementRenderOverrides.d.ts.map +1 -0
  291. package/dist/modules/rendering/types/ElementRenderOverrides.js +52 -0
  292. package/dist/modules/rendering/types/ElementRenderOverrides.js.map +1 -0
  293. package/dist/modules/rendering/types/InlineStyleMap.d.ts.map +1 -0
  294. package/dist/modules/rendering/types/InlineStyleMap.js.map +1 -0
  295. package/dist/modules/rendering/{RenderingConfig.d.ts → types/RenderingConfig.d.ts} +8 -1
  296. package/dist/modules/rendering/types/RenderingConfig.d.ts.map +1 -0
  297. package/dist/modules/rendering/types/RenderingConfig.js.map +1 -0
  298. package/dist/modules/rendering/types/ScopedRenderOverride.d.ts +24 -0
  299. package/dist/modules/rendering/types/ScopedRenderOverride.d.ts.map +1 -0
  300. package/dist/modules/rendering/types/ScopedRenderOverride.js.map +1 -0
  301. package/dist/modules/rendering/types/VideoFrameSource.d.ts.map +1 -0
  302. package/dist/modules/rendering/types/VideoFrameSource.js.map +1 -0
  303. package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.d.ts +33 -0
  304. package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.d.ts.map +1 -0
  305. package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.js +100 -0
  306. package/dist/modules/splitting/BoundaryScoreLimitByCharsSegmentSplitter.js.map +1 -0
  307. package/dist/modules/splitting/FixedTailLineSplitter.d.ts +29 -0
  308. package/dist/modules/splitting/FixedTailLineSplitter.d.ts.map +1 -0
  309. package/dist/modules/splitting/FixedTailLineSplitter.js +43 -0
  310. package/dist/modules/splitting/FixedTailLineSplitter.js.map +1 -0
  311. package/dist/modules/splitting/index.d.ts +4 -0
  312. package/dist/modules/splitting/index.d.ts.map +1 -1
  313. package/dist/modules/splitting/index.js +2 -0
  314. package/dist/modules/splitting/index.js.map +1 -1
  315. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts +53 -0
  316. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts.map +1 -0
  317. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js +133 -0
  318. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js.map +1 -0
  319. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts +20 -0
  320. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts.map +1 -0
  321. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js +31 -0
  322. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js.map +1 -0
  323. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts +21 -0
  324. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts.map +1 -0
  325. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js +33 -0
  326. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js.map +1 -0
  327. package/dist/modules/subtitle-file/SubtitleCue.d.ts +18 -0
  328. package/dist/modules/subtitle-file/SubtitleCue.d.ts.map +1 -0
  329. package/dist/modules/subtitle-file/SubtitleCue.js +20 -0
  330. package/dist/modules/subtitle-file/SubtitleCue.js.map +1 -0
  331. package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts +38 -0
  332. package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts.map +1 -0
  333. package/dist/modules/subtitle-file/SubtitleCueBuilder.js +106 -0
  334. package/dist/modules/subtitle-file/SubtitleCueBuilder.js.map +1 -0
  335. package/dist/modules/subtitle-file/SubtitleFileJob.d.ts +17 -0
  336. package/dist/modules/subtitle-file/SubtitleFileJob.d.ts.map +1 -0
  337. package/dist/modules/subtitle-file/SubtitleFileJob.js +2 -0
  338. package/dist/modules/subtitle-file/SubtitleFileJob.js.map +1 -0
  339. package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts +36 -0
  340. package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts.map +1 -0
  341. package/dist/modules/subtitle-file/SubtitleFileSerializer.js +44 -0
  342. package/dist/modules/subtitle-file/SubtitleFileSerializer.js.map +1 -0
  343. package/dist/modules/subtitle-file/SubtitleGranularity.d.ts +11 -0
  344. package/dist/modules/subtitle-file/SubtitleGranularity.d.ts.map +1 -0
  345. package/dist/modules/subtitle-file/SubtitleGranularity.js +2 -0
  346. package/dist/modules/subtitle-file/SubtitleGranularity.js.map +1 -0
  347. package/dist/modules/subtitle-file/SubtitleRow.d.ts +11 -0
  348. package/dist/modules/subtitle-file/SubtitleRow.d.ts.map +1 -0
  349. package/dist/modules/subtitle-file/SubtitleRow.js +14 -0
  350. package/dist/modules/subtitle-file/SubtitleRow.js.map +1 -0
  351. package/dist/modules/subtitle-file/SubtitleToken.d.ts +13 -0
  352. package/dist/modules/subtitle-file/SubtitleToken.d.ts.map +1 -0
  353. package/dist/modules/subtitle-file/SubtitleToken.js +15 -0
  354. package/dist/modules/subtitle-file/SubtitleToken.js.map +1 -0
  355. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts +19 -0
  356. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts.map +1 -0
  357. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js +24 -0
  358. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js.map +1 -0
  359. package/dist/modules/subtitle-file/Timecode.d.ts +20 -0
  360. package/dist/modules/subtitle-file/Timecode.d.ts.map +1 -0
  361. package/dist/modules/subtitle-file/Timecode.js +32 -0
  362. package/dist/modules/subtitle-file/Timecode.js.map +1 -0
  363. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts +22 -0
  364. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts.map +1 -0
  365. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js +57 -0
  366. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js.map +1 -0
  367. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts +21 -0
  368. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts.map +1 -0
  369. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js +39 -0
  370. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js.map +1 -0
  371. package/dist/modules/subtitle-file/index.d.ts +10 -0
  372. package/dist/modules/subtitle-file/index.d.ts.map +1 -0
  373. package/dist/modules/subtitle-file/index.js +8 -0
  374. package/dist/modules/subtitle-file/index.js.map +1 -0
  375. package/dist/modules/svg-filter/SvgFilter.d.ts +8 -1
  376. package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -1
  377. package/dist/modules/svg-filter/SvgFilter.js +9 -1
  378. package/dist/modules/svg-filter/SvgFilter.js.map +1 -1
  379. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +1 -0
  380. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -1
  381. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +9 -1
  382. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -1
  383. package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts +44 -0
  384. package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts.map +1 -0
  385. package/dist/modules/svg-filter/SvgFilterDefsRenderer.js +47 -0
  386. package/dist/modules/svg-filter/SvgFilterDefsRenderer.js.map +1 -0
  387. package/dist/modules/svg-filter/index.d.ts +2 -0
  388. package/dist/modules/svg-filter/index.d.ts.map +1 -1
  389. package/dist/modules/svg-filter/index.js +1 -0
  390. package/dist/modules/svg-filter/index.js.map +1 -1
  391. package/dist/modules/tagging/PauseTagger.d.ts +24 -0
  392. package/dist/modules/tagging/PauseTagger.d.ts.map +1 -0
  393. package/dist/modules/tagging/PauseTagger.js +42 -0
  394. package/dist/modules/tagging/PauseTagger.js.map +1 -0
  395. package/dist/modules/tagging/RegexTagger.js +1 -1
  396. package/dist/modules/tagging/RegexTagger.js.map +1 -1
  397. package/dist/modules/tagging/SpanTagger.js +1 -1
  398. package/dist/modules/tagging/SpanTagger.js.map +1 -1
  399. package/dist/modules/tagging/StructureTagger.d.ts +1 -2
  400. package/dist/modules/tagging/StructureTagger.d.ts.map +1 -1
  401. package/dist/modules/tagging/StructureTagger.js +12 -11
  402. package/dist/modules/tagging/StructureTagger.js.map +1 -1
  403. package/dist/modules/tagging/WordlistTagger.js +1 -1
  404. package/dist/modules/tagging/WordlistTagger.js.map +1 -1
  405. package/dist/modules/tagging/index.d.ts +2 -0
  406. package/dist/modules/tagging/index.d.ts.map +1 -1
  407. package/dist/modules/tagging/index.js +1 -0
  408. package/dist/modules/tagging/index.js.map +1 -1
  409. package/dist/modules/tags/AndTagCondition.d.ts +10 -0
  410. package/dist/modules/tags/AndTagCondition.d.ts.map +1 -0
  411. package/dist/modules/tags/AndTagCondition.js +14 -0
  412. package/dist/modules/tags/AndTagCondition.js.map +1 -0
  413. package/dist/modules/tags/HasTagCondition.d.ts +10 -0
  414. package/dist/modules/tags/HasTagCondition.d.ts.map +1 -0
  415. package/dist/modules/tags/HasTagCondition.js +18 -0
  416. package/dist/modules/tags/HasTagCondition.js.map +1 -0
  417. package/dist/modules/tags/NotTagCondition.d.ts +10 -0
  418. package/dist/modules/tags/NotTagCondition.d.ts.map +1 -0
  419. package/dist/modules/tags/NotTagCondition.js +14 -0
  420. package/dist/modules/tags/NotTagCondition.js.map +1 -0
  421. package/dist/modules/tags/OrTagCondition.d.ts +10 -0
  422. package/dist/modules/tags/OrTagCondition.d.ts.map +1 -0
  423. package/dist/modules/tags/OrTagCondition.js +14 -0
  424. package/dist/modules/tags/OrTagCondition.js.map +1 -0
  425. package/dist/modules/{document/Tag.d.ts → tags/StructureTag.d.ts} +4 -10
  426. package/dist/modules/tags/StructureTag.d.ts.map +1 -0
  427. package/dist/modules/{document/Tag.js → tags/StructureTag.js} +4 -19
  428. package/dist/modules/tags/StructureTag.js.map +1 -0
  429. package/dist/modules/tags/Tag.d.ts +8 -0
  430. package/dist/modules/tags/Tag.d.ts.map +1 -0
  431. package/dist/modules/tags/Tag.js +16 -0
  432. package/dist/modules/tags/Tag.js.map +1 -0
  433. package/dist/modules/tags/TagCondition.d.ts +12 -0
  434. package/dist/modules/tags/TagCondition.d.ts.map +1 -0
  435. package/dist/modules/tags/TagCondition.js +2 -0
  436. package/dist/modules/tags/TagCondition.js.map +1 -0
  437. package/dist/modules/tags/TagConditionParser.d.ts +21 -0
  438. package/dist/modules/tags/TagConditionParser.d.ts.map +1 -0
  439. package/dist/modules/tags/TagConditionParser.js +75 -0
  440. package/dist/modules/tags/TagConditionParser.js.map +1 -0
  441. package/dist/modules/tags/index.d.ts +9 -0
  442. package/dist/modules/tags/index.d.ts.map +1 -0
  443. package/dist/modules/tags/index.js +8 -0
  444. package/dist/modules/tags/index.js.map +1 -0
  445. package/dist/modules/transcription/AudioDecoder.d.ts +9 -4
  446. package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -1
  447. package/dist/modules/transcription/BatchedMonoResampler.d.ts +45 -0
  448. package/dist/modules/transcription/BatchedMonoResampler.d.ts.map +1 -0
  449. package/dist/modules/transcription/BatchedMonoResampler.js +116 -0
  450. package/dist/modules/transcription/BatchedMonoResampler.js.map +1 -0
  451. package/dist/modules/transcription/CacheStorageModelFileCache.d.ts +38 -0
  452. package/dist/modules/transcription/CacheStorageModelFileCache.d.ts.map +1 -0
  453. package/dist/modules/transcription/CacheStorageModelFileCache.js +86 -0
  454. package/dist/modules/transcription/CacheStorageModelFileCache.js.map +1 -0
  455. package/dist/modules/transcription/CueDocumentBuilder.d.ts +40 -0
  456. package/dist/modules/transcription/CueDocumentBuilder.d.ts.map +1 -0
  457. package/dist/modules/transcription/CueDocumentBuilder.js +77 -0
  458. package/dist/modules/transcription/CueDocumentBuilder.js.map +1 -0
  459. package/dist/modules/transcription/CueParseResult.d.ts +16 -0
  460. package/dist/modules/transcription/CueParseResult.d.ts.map +1 -0
  461. package/dist/modules/transcription/CueParseResult.js +2 -0
  462. package/dist/modules/transcription/CueParseResult.js.map +1 -0
  463. package/dist/modules/transcription/CueTextTokenizer.d.ts +10 -0
  464. package/dist/modules/transcription/CueTextTokenizer.d.ts.map +1 -0
  465. package/dist/modules/transcription/CueTextTokenizer.js +21 -0
  466. package/dist/modules/transcription/CueTextTokenizer.js.map +1 -0
  467. package/dist/modules/transcription/CueTimecodeReader.d.ts +19 -0
  468. package/dist/modules/transcription/CueTimecodeReader.d.ts.map +1 -0
  469. package/dist/modules/transcription/CueTimecodeReader.js +45 -0
  470. package/dist/modules/transcription/CueTimecodeReader.js.map +1 -0
  471. package/dist/modules/transcription/CueWordReader.d.ts +12 -0
  472. package/dist/modules/transcription/CueWordReader.d.ts.map +1 -0
  473. package/dist/modules/transcription/CueWordReader.js +2 -0
  474. package/dist/modules/transcription/CueWordReader.js.map +1 -0
  475. package/dist/modules/transcription/EstimatedCueWordReader.d.ts +16 -0
  476. package/dist/modules/transcription/EstimatedCueWordReader.d.ts.map +1 -0
  477. package/dist/modules/transcription/EstimatedCueWordReader.js +17 -0
  478. package/dist/modules/transcription/EstimatedCueWordReader.js.map +1 -0
  479. package/dist/modules/transcription/LogitsProcessorListFactory.d.ts +43 -0
  480. package/dist/modules/transcription/LogitsProcessorListFactory.d.ts.map +1 -0
  481. package/dist/modules/transcription/LogitsProcessorListFactory.js +72 -0
  482. package/dist/modules/transcription/LogitsProcessorListFactory.js.map +1 -0
  483. package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts +27 -0
  484. package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts.map +1 -0
  485. package/dist/modules/transcription/MediaBunnyAudioDecoder.js +76 -0
  486. package/dist/modules/transcription/MediaBunnyAudioDecoder.js.map +1 -0
  487. package/dist/modules/transcription/ModelFileCache.d.ts +20 -0
  488. package/dist/modules/transcription/ModelFileCache.d.ts.map +1 -0
  489. package/dist/modules/transcription/ModelFileCache.js +2 -0
  490. package/dist/modules/transcription/ModelFileCache.js.map +1 -0
  491. package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts +18 -0
  492. package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts.map +1 -0
  493. package/dist/modules/transcription/ModelFileCacheUnavailableError.js +18 -0
  494. package/dist/modules/transcription/ModelFileCacheUnavailableError.js.map +1 -0
  495. package/dist/modules/transcription/SrtTranscriber.d.ts +24 -15
  496. package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -1
  497. package/dist/modules/transcription/SrtTranscriber.js +32 -90
  498. package/dist/modules/transcription/SrtTranscriber.js.map +1 -1
  499. package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts +22 -0
  500. package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts.map +1 -0
  501. package/dist/modules/transcription/SubtitleFileUnreadableError.js +22 -0
  502. package/dist/modules/transcription/SubtitleFileUnreadableError.js.map +1 -0
  503. package/dist/modules/transcription/TimestampedCueWordReader.d.ts +27 -0
  504. package/dist/modules/transcription/TimestampedCueWordReader.d.ts.map +1 -0
  505. package/dist/modules/transcription/TimestampedCueWordReader.js +52 -0
  506. package/dist/modules/transcription/TimestampedCueWordReader.js.map +1 -0
  507. package/dist/modules/transcription/Transcriber.d.ts +13 -0
  508. package/dist/modules/transcription/Transcriber.d.ts.map +1 -1
  509. package/dist/modules/transcription/TransformersRuntime.d.ts +50 -0
  510. package/dist/modules/transcription/TransformersRuntime.d.ts.map +1 -0
  511. package/dist/modules/transcription/TransformersRuntime.js +79 -0
  512. package/dist/modules/transcription/TransformersRuntime.js.map +1 -0
  513. package/dist/modules/transcription/VttTranscriber.d.ts +46 -0
  514. package/dist/modules/transcription/VttTranscriber.d.ts.map +1 -0
  515. package/dist/modules/transcription/VttTranscriber.js +80 -0
  516. package/dist/modules/transcription/VttTranscriber.js.map +1 -0
  517. package/dist/modules/transcription/WhisperChunkStitcher.d.ts +51 -0
  518. package/dist/modules/transcription/WhisperChunkStitcher.d.ts.map +1 -0
  519. package/dist/modules/transcription/WhisperChunkStitcher.js +101 -0
  520. package/dist/modules/transcription/WhisperChunkStitcher.js.map +1 -0
  521. package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts +16 -0
  522. package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts.map +1 -0
  523. package/dist/modules/transcription/WhisperDeviceUnavailableError.js +16 -0
  524. package/dist/modules/transcription/WhisperDeviceUnavailableError.js.map +1 -0
  525. package/dist/modules/transcription/WhisperInferenceFailedError.d.ts +16 -0
  526. package/dist/modules/transcription/WhisperInferenceFailedError.d.ts.map +1 -0
  527. package/dist/modules/transcription/WhisperInferenceFailedError.js +16 -0
  528. package/dist/modules/transcription/WhisperInferenceFailedError.js.map +1 -0
  529. package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts +61 -0
  530. package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts.map +1 -0
  531. package/dist/modules/transcription/WhisperInferenceProgressTracker.js +102 -0
  532. package/dist/modules/transcription/WhisperInferenceProgressTracker.js.map +1 -0
  533. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts +38 -0
  534. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts.map +1 -0
  535. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js +94 -0
  536. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js.map +1 -0
  537. package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts +15 -0
  538. package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts.map +1 -0
  539. package/dist/modules/transcription/WhisperModelLoadFailedError.js +15 -0
  540. package/dist/modules/transcription/WhisperModelLoadFailedError.js.map +1 -0
  541. package/dist/modules/transcription/WhisperTranscriber.d.ts +106 -7
  542. package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -1
  543. package/dist/modules/transcription/WhisperTranscriber.js +312 -25
  544. package/dist/modules/transcription/WhisperTranscriber.js.map +1 -1
  545. package/dist/modules/transcription/WhisperWindowCoverage.d.ts +79 -0
  546. package/dist/modules/transcription/WhisperWindowCoverage.d.ts.map +1 -0
  547. package/dist/modules/transcription/WhisperWindowCoverage.js +129 -0
  548. package/dist/modules/transcription/WhisperWindowCoverage.js.map +1 -0
  549. package/dist/modules/transcription/WordTimingEstimator.d.ts +14 -0
  550. package/dist/modules/transcription/WordTimingEstimator.d.ts.map +1 -0
  551. package/dist/modules/transcription/WordTimingEstimator.js +33 -0
  552. package/dist/modules/transcription/WordTimingEstimator.js.map +1 -0
  553. package/dist/modules/transcription/index.d.ts +9 -2
  554. package/dist/modules/transcription/index.d.ts.map +1 -1
  555. package/dist/modules/transcription/index.js +6 -1
  556. package/dist/modules/transcription/index.js.map +1 -1
  557. package/dist/modules/video/RenderJob.d.ts +17 -0
  558. package/dist/modules/video/RenderJob.d.ts.map +1 -1
  559. package/dist/modules/video/RenderTimeMap.d.ts +50 -0
  560. package/dist/modules/video/RenderTimeMap.d.ts.map +1 -0
  561. package/dist/modules/video/RenderTimeMap.js +90 -0
  562. package/dist/modules/video/RenderTimeMap.js.map +1 -0
  563. package/dist/modules/video/index.d.ts +8 -1
  564. package/dist/modules/video/index.d.ts.map +1 -1
  565. package/dist/modules/video/index.js +4 -0
  566. package/dist/modules/video/index.js.map +1 -1
  567. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts +102 -0
  568. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts.map +1 -0
  569. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js +207 -0
  570. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js.map +1 -0
  571. package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts +12 -52
  572. package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts.map +1 -1
  573. package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js +25 -190
  574. package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js.map +1 -1
  575. package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts +7 -0
  576. package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts.map +1 -1
  577. package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js +2 -2
  578. package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js.map +1 -1
  579. package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts +2 -0
  580. package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts.map +1 -1
  581. package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js +8 -2
  582. package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js.map +1 -1
  583. package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts +3 -0
  584. package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts.map +1 -1
  585. package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js +9 -2
  586. package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js.map +1 -1
  587. package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts +7 -0
  588. package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts.map +1 -1
  589. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +4 -2
  590. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -1
  591. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +33 -23
  592. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -1
  593. package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts +9 -2
  594. package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts.map +1 -1
  595. package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts +5 -2
  596. package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts.map +1 -1
  597. package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js +8 -2
  598. package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js.map +1 -1
  599. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts +35 -0
  600. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.d.ts.map +1 -0
  601. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js +69 -0
  602. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js.map +1 -0
  603. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.d.ts +23 -0
  604. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.d.ts.map +1 -0
  605. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.js +23 -0
  606. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainterFactory.js.map +1 -0
  607. package/dist/modules/video/mediabunny/painter/FramePainter.d.ts +46 -0
  608. package/dist/modules/video/mediabunny/painter/FramePainter.d.ts.map +1 -0
  609. package/dist/modules/video/mediabunny/painter/FramePainter.js +2 -0
  610. package/dist/modules/video/mediabunny/painter/FramePainter.js.map +1 -0
  611. package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts +24 -0
  612. package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts.map +1 -0
  613. package/dist/modules/video/mediabunny/painter/TopLayerSource.js +2 -0
  614. package/dist/modules/video/mediabunny/painter/TopLayerSource.js.map +1 -0
  615. package/package.json +13 -10
  616. package/dist/modules/document/Tag.d.ts.map +0 -1
  617. package/dist/modules/document/Tag.js.map +0 -1
  618. package/dist/modules/rendering/AlignmentConfig.d.ts +0 -21
  619. package/dist/modules/rendering/AlignmentConfig.d.ts.map +0 -1
  620. package/dist/modules/rendering/AlignmentConfig.js +0 -2
  621. package/dist/modules/rendering/AlignmentConfig.js.map +0 -1
  622. package/dist/modules/rendering/BoxEdges.d.ts.map +0 -1
  623. package/dist/modules/rendering/BoxEdges.js.map +0 -1
  624. package/dist/modules/rendering/ElementRenderOverrides.d.ts +0 -15
  625. package/dist/modules/rendering/ElementRenderOverrides.d.ts.map +0 -1
  626. package/dist/modules/rendering/ElementRenderOverrides.js +0 -24
  627. package/dist/modules/rendering/ElementRenderOverrides.js.map +0 -1
  628. package/dist/modules/rendering/InlineStyleMap.d.ts.map +0 -1
  629. package/dist/modules/rendering/InlineStyleMap.js.map +0 -1
  630. package/dist/modules/rendering/RenderingConfig.d.ts.map +0 -1
  631. package/dist/modules/rendering/RenderingConfig.js.map +0 -1
  632. package/dist/modules/rendering/ScopedRenderOverride.d.ts +0 -19
  633. package/dist/modules/rendering/ScopedRenderOverride.d.ts.map +0 -1
  634. package/dist/modules/rendering/ScopedRenderOverride.js.map +0 -1
  635. package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts.map +0 -1
  636. package/dist/modules/rendering/SegmentPaintRegionResolver.js.map +0 -1
  637. package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts +0 -58
  638. package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts.map +0 -1
  639. package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js +0 -132
  640. package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js.map +0 -1
  641. package/dist/modules/rendering/VideoFrameLayerClass.d.ts.map +0 -1
  642. package/dist/modules/rendering/VideoFrameLayerClass.js +0 -21
  643. package/dist/modules/rendering/VideoFrameLayerClass.js.map +0 -1
  644. package/dist/modules/rendering/VideoFrameSource.d.ts.map +0 -1
  645. package/dist/modules/rendering/VideoFrameSource.js.map +0 -1
  646. package/dist/modules/transcription/BrowserAudioDecoder.d.ts +0 -13
  647. package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +0 -1
  648. package/dist/modules/transcription/BrowserAudioDecoder.js +0 -34
  649. package/dist/modules/transcription/BrowserAudioDecoder.js.map +0 -1
  650. /package/dist/modules/rendering/{BoxEdges.d.ts → types/BoxEdges.d.ts} +0 -0
  651. /package/dist/modules/rendering/{BoxEdges.js → types/BoxEdges.js} +0 -0
  652. /package/dist/modules/rendering/{InlineStyleMap.d.ts → types/InlineStyleMap.d.ts} +0 -0
  653. /package/dist/modules/rendering/{InlineStyleMap.js → types/InlineStyleMap.js} +0 -0
  654. /package/dist/modules/rendering/{RenderingConfig.js → types/RenderingConfig.js} +0 -0
  655. /package/dist/modules/rendering/{ScopedRenderOverride.js → types/ScopedRenderOverride.js} +0 -0
  656. /package/dist/modules/rendering/{VideoFrameSource.d.ts → types/VideoFrameSource.d.ts} +0 -0
  657. /package/dist/modules/rendering/{VideoFrameSource.js → types/VideoFrameSource.js} +0 -0
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Consumes mediabunny {@link AudioSample}s in source order, downmixes
3
+ * each to mono, and writes resampled frames into a caller-owned target
4
+ * buffer at monotonically increasing offsets.
5
+ *
6
+ * Batches source-rate frames in a fixed-size internal buffer so the
7
+ * whole track never sits in memory at once. Each full batch is
8
+ * resampled through a fresh `OfflineAudioContext` and copied straight
9
+ * into the target — a track of any length peaks at one batch worth of
10
+ * source-rate PCM plus the target buffer, instead of the full-track
11
+ * source-rate buffer the collect-then-resample approach needed. On a
12
+ * 60-minute 48 kHz mono source that is ~5.7 MB per batch instead of
13
+ * ~690 MB across the whole run.
14
+ *
15
+ * The source sample rate is discovered on the first appended sample —
16
+ * `AudioSample.sampleRate` is stable across a single mediabunny track.
17
+ * The target sample rate is fixed at construction. When the two match
18
+ * the batch bypasses `OfflineAudioContext` and is copied verbatim.
19
+ *
20
+ * The target buffer is written up to its own capacity; any tail beyond
21
+ * that is silently discarded, so the caller's pre-size determines the
22
+ * ceiling. `flush` returns the actual number of frames written and the
23
+ * caller can `subarray(0, written)` to trim any pre-sizing slack.
24
+ */
25
+ export class BatchedMonoResampler {
26
+ target;
27
+ targetSampleRate;
28
+ static BATCH_SECONDS = 30;
29
+ batch = new Float32Array(0);
30
+ batchFrames = 0;
31
+ sourceSampleRate = 0;
32
+ channelScratch = new Float32Array(0);
33
+ targetOffset = 0;
34
+ constructor(target, targetSampleRate) {
35
+ this.target = target;
36
+ this.targetSampleRate = targetSampleRate;
37
+ }
38
+ async append(sample) {
39
+ if (this.sourceSampleRate === 0)
40
+ this.initFromFirstSample(sample);
41
+ const frames = sample.numberOfFrames;
42
+ if (frames === 0)
43
+ return;
44
+ this.ensureBatchCapacityFor(this.batchFrames + frames);
45
+ this.mixSampleIntoBatch(sample, this.batchFrames);
46
+ this.batchFrames += frames;
47
+ if (this.batchFrames >= this.batch.length)
48
+ await this.emitBatch();
49
+ }
50
+ async flush() {
51
+ if (this.batchFrames > 0)
52
+ await this.emitBatch();
53
+ return this.targetOffset;
54
+ }
55
+ initFromFirstSample(sample) {
56
+ this.sourceSampleRate = sample.sampleRate;
57
+ this.batch = new Float32Array(this.sourceSampleRate * BatchedMonoResampler.BATCH_SECONDS);
58
+ }
59
+ ensureBatchCapacityFor(needed) {
60
+ if (this.batch.length >= needed)
61
+ return;
62
+ const grown = new Float32Array(needed);
63
+ grown.set(this.batch.subarray(0, this.batchFrames));
64
+ this.batch = grown;
65
+ }
66
+ async emitBatch() {
67
+ const source = this.batch.subarray(0, this.batchFrames);
68
+ const resampled = this.sourceSampleRate === this.targetSampleRate
69
+ ? source
70
+ : await this.resampleBatch(source);
71
+ this.writeIntoTarget(resampled);
72
+ this.batchFrames = 0;
73
+ }
74
+ async resampleBatch(source) {
75
+ const targetFrames = Math.max(1, Math.ceil(source.length * this.targetSampleRate / this.sourceSampleRate));
76
+ const ctx = new OfflineAudioContext(1, targetFrames, this.targetSampleRate);
77
+ const buffer = ctx.createBuffer(1, source.length, this.sourceSampleRate);
78
+ buffer.getChannelData(0).set(source);
79
+ const node = ctx.createBufferSource();
80
+ node.buffer = buffer;
81
+ node.connect(ctx.destination);
82
+ node.start();
83
+ const rendered = await ctx.startRendering();
84
+ return rendered.getChannelData(0);
85
+ }
86
+ writeIntoTarget(source) {
87
+ const room = this.target.length - this.targetOffset;
88
+ if (room <= 0)
89
+ return;
90
+ const writeLen = Math.min(source.length, room);
91
+ this.target.set(source.subarray(0, writeLen), this.targetOffset);
92
+ this.targetOffset += writeLen;
93
+ }
94
+ mixSampleIntoBatch(sample, writeOffset) {
95
+ const frames = sample.numberOfFrames;
96
+ const channels = sample.numberOfChannels;
97
+ const target = this.batch.subarray(writeOffset, writeOffset + frames);
98
+ if (channels <= 1) {
99
+ sample.copyTo(target, { planeIndex: 0, format: 'f32-planar' });
100
+ return;
101
+ }
102
+ if (this.channelScratch.length < frames)
103
+ this.channelScratch = new Float32Array(frames);
104
+ const scratch = this.channelScratch.subarray(0, frames);
105
+ sample.copyTo(target, { planeIndex: 0, format: 'f32-planar' });
106
+ for (let channel = 1; channel < channels; channel += 1) {
107
+ sample.copyTo(scratch, { planeIndex: channel, format: 'f32-planar' });
108
+ for (let frame = 0; frame < frames; frame += 1)
109
+ target[frame] += scratch[frame];
110
+ }
111
+ const inverseChannels = 1 / channels;
112
+ for (let frame = 0; frame < frames; frame += 1)
113
+ target[frame] *= inverseChannels;
114
+ }
115
+ }
116
+ //# sourceMappingURL=BatchedMonoResampler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchedMonoResampler.js","sourceRoot":"","sources":["../../../src/modules/transcription/BatchedMonoResampler.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,oBAAoB;IAWZ;IACA;IAVX,MAAM,CAAU,aAAa,GAAG,EAAE,CAAC;IAEnC,KAAK,GAAiB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1C,WAAW,GAAG,CAAC,CAAC;IAChB,gBAAgB,GAAG,CAAC,CAAC;IACrB,cAAc,GAAiB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IACnD,YAAY,GAAG,CAAC,CAAC;IAEzB,YACmB,MAAoB,EACpB,gBAAwB;QADxB,WAAM,GAAN,MAAM,CAAc;QACpB,qBAAgB,GAAhB,gBAAgB,CAAQ;IACxC,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,MAAmB;QAC9B,IAAI,IAAI,CAAC,gBAAgB,KAAK,CAAC;YAAE,I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E,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YACtE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;gBAAE,MAAM,CAAC,KAAK,CAAE,IAAI,OAAO,CAAC,KAAK,CAAE,CAAC;QACpF,CAAC;QACD,MAAM,eAAe,GAAG,CAAC,GAAG,QAAQ,CAAC;QACrC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;YAAE,MAAM,CAAC,KAAK,CAAE,IAAI,eAAe,CAAC;IACpF,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { ModelFileCache } from '../transcription/ModelFileCache';
2
+ /**
3
+ * Keeps model files in the browser's Cache Storage.
4
+ *
5
+ * Browsers refuse this write far more often than one would expect —
6
+ * an origin over its quota, a private window, a page outside a secure
7
+ * context — and every refusal costs the next run a full re-download of
8
+ * hundreds of megabytes with nothing on screen to explain it. The
9
+ * refusal is therefore handed to `onKeepFailure` instead of being
10
+ * swallowed, while the run in flight carries on regardless: the files
11
+ * are already in memory and the transcription does not need them kept.
12
+ *
13
+ * Only the first refusal of an instance's lifetime is announced. A
14
+ * model is several files and the condition behind a refusal applies to
15
+ * all of them, so the rest would say the same thing again.
16
+ */
17
+ export declare class CacheStorageModelFileCache implements ModelFileCache {
18
+ private readonly onKeepFailure;
19
+ private static readonly CACHE_NAME;
20
+ private opening;
21
+ private failureAnnounced;
22
+ /**
23
+ * @param onKeepFailure Called at most once per instance, with the
24
+ * refusal that stopped a file from being kept.
25
+ */
26
+ constructor(onKeepFailure: (error: unknown) => void);
27
+ match(key: string): Promise<Response | undefined>;
28
+ put(key: string, response: Response): Promise<void>;
29
+ private announce;
30
+ /**
31
+ * Resolves to `null` when this runtime has no Cache Storage at all,
32
+ * which is a standing condition rather than a transient one — hence
33
+ * the single attempt, reused by every later call.
34
+ */
35
+ private open;
36
+ private openOnce;
37
+ }
38
+ //# sourceMappingURL=CacheStorageModelFileCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheStorageModelFileCache.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CacheStorageModelFileCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAG5E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,0BAA2B,YAAW,cAAc;IAcnD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAT1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAwB;IAE1D,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;OAGG;gBAC0B,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAE9D,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IAYjD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAazD,OAAO,CAAC,QAAQ;IAMhB;;;;OAIG;IACH,OAAO,CAAC,IAAI;YAKE,QAAQ;CAUvB"}
@@ -0,0 +1,86 @@
1
+ import { ModelFileCacheUnavailableError } from '../transcription/ModelFileCacheUnavailableError';
2
+ /**
3
+ * Keeps model files in the browser's Cache Storage.
4
+ *
5
+ * Browsers refuse this write far more often than one would expect —
6
+ * an origin over its quota, a private window, a page outside a secure
7
+ * context — and every refusal costs the next run a full re-download of
8
+ * hundreds of megabytes with nothing on screen to explain it. The
9
+ * refusal is therefore handed to `onKeepFailure` instead of being
10
+ * swallowed, while the run in flight carries on regardless: the files
11
+ * are already in memory and the transcription does not need them kept.
12
+ *
13
+ * Only the first refusal of an instance's lifetime is announced. A
14
+ * model is several files and the condition behind a refusal applies to
15
+ * all of them, so the rest would say the same thing again.
16
+ */
17
+ export class CacheStorageModelFileCache {
18
+ onKeepFailure;
19
+ // The name transformers.js opens by default. Matching it keeps the
20
+ // files downloaded by earlier versions, which used the library's own
21
+ // caching, readable by this one.
22
+ static CACHE_NAME = 'transformers-cache';
23
+ opening = null;
24
+ failureAnnounced = false;
25
+ /**
26
+ * @param onKeepFailure Called at most once per instance, with the
27
+ * refusal that stopped a file from being kept.
28
+ */
29
+ constructor(onKeepFailure) {
30
+ this.onKeepFailure = onKeepFailure;
31
+ }
32
+ async match(key) {
33
+ const cache = await this.open();
34
+ if (!cache)
35
+ return undefined;
36
+ try {
37
+ return await cache.match(key);
38
+ }
39
+ catch {
40
+ // A cache that cannot be read is indistinguishable from one that
41
+ // never held the file: both mean it has to be downloaded.
42
+ return undefined;
43
+ }
44
+ }
45
+ async put(key, response) {
46
+ const cache = await this.open();
47
+ if (!cache) {
48
+ this.announce(new ModelFileCacheUnavailableError('Cache Storage is not exposed in this context'));
49
+ return;
50
+ }
51
+ try {
52
+ await cache.put(key, response);
53
+ }
54
+ catch (error) {
55
+ this.announce(error);
56
+ }
57
+ }
58
+ announce(error) {
59
+ if (this.failureAnnounced)
60
+ return;
61
+ this.failureAnnounced = true;
62
+ this.onKeepFailure(error);
63
+ }
64
+ /**
65
+ * Resolves to `null` when this runtime has no Cache Storage at all,
66
+ * which is a standing condition rather than a transient one — hence
67
+ * the single attempt, reused by every later call.
68
+ */
69
+ open() {
70
+ this.opening ??= this.openOnce();
71
+ return this.opening;
72
+ }
73
+ async openOnce() {
74
+ if (typeof caches === 'undefined')
75
+ return null;
76
+ try {
77
+ return await caches.open(CacheStorageModelFileCache.CACHE_NAME);
78
+ }
79
+ catch {
80
+ // Opening is refused outright in some privacy modes. There is
81
+ // nothing to fall back to, and `put` reports the consequence.
82
+ return null;
83
+ }
84
+ }
85
+ }
86
+ //# sourceMappingURL=CacheStorageModelFileCache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheStorageModelFileCache.js","sourceRoot":"","sources":["../../../src/modules/transcription/CacheStorageModelFileCache.ts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AG,IAAI,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACK,IAAI;QACV,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QAC/C,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;QAClE,CAAC;QAAC,MAAM,CAAC;YACP,8DAA8D;YAC9D,8DAA8D;YAC9D,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { CueParseResult } from '../transcription/CueParseResult';
2
+ import type { CueTimecodeReader } from '../transcription/CueTimecodeReader';
3
+ import type { CueWordReader } from '../transcription/CueWordReader';
4
+ /**
5
+ * Builds a Document from the cue blocks of a caption file: blank lines
6
+ * separate cues, a `-->` line states the range, and everything below it
7
+ * is the text. Each cue becomes one Segment holding one Line.
8
+ *
9
+ * A counter or identifier above the range line is ignored, since
10
+ * neither says anything the Document keeps. A cue whose text is empty
11
+ * is dropped. How the text becomes timed words is the reader's business
12
+ * and the only thing that differs between formats.
13
+ *
14
+ * A block carrying no range line is skipped and handed back in the
15
+ * result rather than ending the read. This is what the WebVTT parser
16
+ * algorithm prescribes, and it is the only behaviour that serves
17
+ * someone holding a file they did not write: one stray blank line
18
+ * inside a cue, or one paragraph of prose at the end, would otherwise
19
+ * cost them every cue in the file. Deciding whether the remainder is
20
+ * worth using belongs to the caller, which is why the count of what
21
+ * was lost travels with it.
22
+ *
23
+ * A file where every block was skipped is refused outright: what is
24
+ * left is not a thin transcript, it is no transcript, and returning
25
+ * one would say the file was silent rather than unreadable. A file
26
+ * with no blocks at all is not refused — there is nothing in it to
27
+ * misread.
28
+ *
29
+ * A malformed *timecode* still throws. That block announced its
30
+ * intent to state a time and got it wrong, so placing its text
31
+ * anywhere would be a guess.
32
+ */
33
+ export declare class CueDocumentBuilder {
34
+ private readonly timecodeReader;
35
+ constructor(timecodeReader: CueTimecodeReader);
36
+ build(source: string, wordReader: CueWordReader): CueParseResult;
37
+ private splitIntoBlocks;
38
+ private buildSegment;
39
+ }
40
+ //# sourceMappingURL=CueDocumentBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueDocumentBuilder.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueDocumentBuilder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,iBAAiB;IAE9D,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,GAAG,cAAc;IAgBhE,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,YAAY;CAkBrB"}
@@ -0,0 +1,77 @@
1
+ import { Document } from '../document/Document';
2
+ import { Line } from '../document/Line';
3
+ import { Section } from '../document/Section';
4
+ import { Segment } from '../document/Segment';
5
+ import { SubtitleFileUnreadableError } from '../transcription/SubtitleFileUnreadableError';
6
+ const BOM_RE = /^\uFEFF/;
7
+ /**
8
+ * Builds a Document from the cue blocks of a caption file: blank lines
9
+ * separate cues, a `-->` line states the range, and everything below it
10
+ * is the text. Each cue becomes one Segment holding one Line.
11
+ *
12
+ * A counter or identifier above the range line is ignored, since
13
+ * neither says anything the Document keeps. A cue whose text is empty
14
+ * is dropped. How the text becomes timed words is the reader's business
15
+ * and the only thing that differs between formats.
16
+ *
17
+ * A block carrying no range line is skipped and handed back in the
18
+ * result rather than ending the read. This is what the WebVTT parser
19
+ * algorithm prescribes, and it is the only behaviour that serves
20
+ * someone holding a file they did not write: one stray blank line
21
+ * inside a cue, or one paragraph of prose at the end, would otherwise
22
+ * cost them every cue in the file. Deciding whether the remainder is
23
+ * worth using belongs to the caller, which is why the count of what
24
+ * was lost travels with it.
25
+ *
26
+ * A file where every block was skipped is refused outright: what is
27
+ * left is not a thin transcript, it is no transcript, and returning
28
+ * one would say the file was silent rather than unreadable. A file
29
+ * with no blocks at all is not refused — there is nothing in it to
30
+ * misread.
31
+ *
32
+ * A malformed *timecode* still throws. That block announced its
33
+ * intent to state a time and got it wrong, so placing its text
34
+ * anywhere would be a guess.
35
+ */
36
+ export class CueDocumentBuilder {
37
+ timecodeReader;
38
+ constructor(timecodeReader) {
39
+ this.timecodeReader = timecodeReader;
40
+ }
41
+ build(source, wordReader) {
42
+ const skippedBlocks = [];
43
+ const segments = this.splitIntoBlocks(source)
44
+ .map((block) => this.buildSegment(block, wordReader, skippedBlocks))
45
+ .filter((segment) => segment !== null);
46
+ if (segments.length === 0 && skippedBlocks.length > 0) {
47
+ throw new SubtitleFileUnreadableError(`None of the ${skippedBlocks.length} block(s) in the file carried a timecode line`);
48
+ }
49
+ return {
50
+ document: new Document({ sections: [new Section({ segments, kind: '' })] }),
51
+ skippedBlocks,
52
+ };
53
+ }
54
+ splitIntoBlocks(source) {
55
+ const normalized = source.replace(BOM_RE, '').replace(/\r\n?/g, '\n').trim();
56
+ if (normalized.length === 0)
57
+ return [];
58
+ return normalized.split(/\n{2,}/);
59
+ }
60
+ buildSegment(block, wordReader, skippedBlocks) {
61
+ const lines = block.split('\n').map((line) => line.trim()).filter((line) => line.length > 0);
62
+ if (lines.length === 0)
63
+ return null;
64
+ const rangeAt = lines.findIndex((line) => this.timecodeReader.isRangeLine(line));
65
+ if (rangeAt === -1) {
66
+ skippedBlocks.push(block);
67
+ return null;
68
+ }
69
+ const range = this.timecodeReader.readRange(lines[rangeAt]);
70
+ const text = lines.slice(rangeAt + 1).join(' ');
71
+ const words = wordReader.read(text, range.startSeconds, range.endSeconds);
72
+ if (words.length === 0)
73
+ return null;
74
+ return new Segment({ lines: [new Line({ words })] });
75
+ }
76
+ }
77
+ //# sourceMappingURL=CueDocumentBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueDocumentBuilder.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueDocumentBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AAEjG,MAAM,MAAM,GAAG,SAAS,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,kBAAkB;IACA;IAA7B,YAA6B,cAAiC;QAAjC,mBAAc,GAAd,cAAc,CAAmB;IAAG,CAAC;IAElE,KAAK,CAAC,MAAc,EAAE,UAAyB;QAC7C,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;aAC1C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;aACnE,MAAM,CAAC,CAAC,OAAO,EAAsB,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;QAC7D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,2BAA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AC,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC1E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ import type { Document } from '../document/Document';
2
+ /**
3
+ * What reading a caption file produced: the cues that could be read,
4
+ * and the blocks that could not.
5
+ *
6
+ * The two travel together because a caption file is rarely all right
7
+ * or all wrong. A reader that returned only the document would leave
8
+ * its caller unable to tell a file that was fully understood from one
9
+ * that was mostly understood.
10
+ */
11
+ export interface CueParseResult {
12
+ readonly document: Document;
13
+ /** Verbatim text of every block that carried no timecode. */
14
+ readonly skippedBlocks: readonly string[];
15
+ }
16
+ //# sourceMappingURL=CueParseResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueParseResult.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueParseResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAE5B,6DAA6D;IAC7D,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CueParseResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueParseResult.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueParseResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Reduces the text of one cue to the words it says.
3
+ *
4
+ * Markup is dropped, runs of whitespace collapse, and a cue that turns
5
+ * out to hold nothing but markup yields no words at all.
6
+ */
7
+ export declare class CueTextTokenizer {
8
+ tokenize(text: string): ReadonlyArray<string>;
9
+ }
10
+ //# sourceMappingURL=CueTextTokenizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueTextTokenizer.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueTextTokenizer.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,qBAAa,gBAAgB;IAE3B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;CAM9C"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Markup a caption file may wrap its text in: WebVTT's angle-bracket
3
+ * tags and the brace-delimited overrides SubRip files sometimes carry
4
+ * from SubStation. None of it survives into a word.
5
+ */
6
+ const MARKUP = /<[^>]+>|\{[^}]+\}/g;
7
+ /**
8
+ * Reduces the text of one cue to the words it says.
9
+ *
10
+ * Markup is dropped, runs of whitespace collapse, and a cue that turns
11
+ * out to hold nothing but markup yields no words at all.
12
+ */
13
+ export class CueTextTokenizer {
14
+ tokenize(text) {
15
+ return text
16
+ .replace(MARKUP, '')
17
+ .split(/\s+/)
18
+ .filter((token) => token.length > 0);
19
+ }
20
+ }
21
+ //# sourceMappingURL=CueTextTokenizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueTextTokenizer.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueTextTokenizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAE3B,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI;aACR,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;aACnB,KAAK,CAAC,KAAK,CAAC;aACZ,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ /** Half-open range a cue occupies, in seconds. */
2
+ export interface CueTimeRange {
3
+ readonly startSeconds: number;
4
+ readonly endSeconds: number;
5
+ }
6
+ /**
7
+ * Reads the timecodes a caption file states its timings with.
8
+ *
9
+ * Positions are returned in seconds. A malformed timecode throws rather
10
+ * than resolving to zero, so a file that cannot be trusted is refused
11
+ * instead of silently landing every caption at the start.
12
+ */
13
+ export declare class CueTimecodeReader {
14
+ isRangeLine(line: string): boolean;
15
+ readRange(line: string): CueTimeRange;
16
+ readPosition(timecode: string): number;
17
+ private toSeconds;
18
+ }
19
+ //# sourceMappingURL=CueTimecodeReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueTimecodeReader.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueTimecodeReader.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAYD;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAE5B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIlC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAWrC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAMtC,OAAO,CAAC,SAAS;CAalB"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * A position written `HH:MM:SS,mmm` or `HH:MM:SS.mmm`. SubRip settled
3
+ * on the comma and WebVTT on the dot, and both are accepted either way
4
+ * because files in the wild mix them. WebVTT also allows the hour to be
5
+ * left out, so it is optional.
6
+ */
7
+ const POSITION = String.raw `(?:(\d{1,3}):)?(\d{2}):(\d{2})[,.](\d{1,3})`;
8
+ const RANGE_LINE = new RegExp(`^${POSITION}\\s*-->\\s*${POSITION}`);
9
+ const POSITION_ONLY = new RegExp(`^${POSITION}$`);
10
+ /**
11
+ * Reads the timecodes a caption file states its timings with.
12
+ *
13
+ * Positions are returned in seconds. A malformed timecode throws rather
14
+ * than resolving to zero, so a file that cannot be trusted is refused
15
+ * instead of silently landing every caption at the start.
16
+ */
17
+ export class CueTimecodeReader {
18
+ isRangeLine(line) {
19
+ return RANGE_LINE.test(line);
20
+ }
21
+ readRange(line) {
22
+ const match = RANGE_LINE.exec(line);
23
+ if (match === null)
24
+ throw new Error(`Malformed cue timecode: ${JSON.stringify(line)}`);
25
+ const startSeconds = this.toSeconds(match[1], match[2], match[3], match[4]);
26
+ const endSeconds = this.toSeconds(match[5], match[6], match[7], match[8]);
27
+ if (endSeconds < startSeconds) {
28
+ throw new Error(`Cue timecode ends before it starts: ${JSON.stringify(line)}`);
29
+ }
30
+ return { startSeconds, endSeconds };
31
+ }
32
+ readPosition(timecode) {
33
+ const match = POSITION_ONLY.exec(timecode);
34
+ if (match === null)
35
+ throw new Error(`Malformed timecode: ${JSON.stringify(timecode)}`);
36
+ return this.toSeconds(match[1], match[2], match[3], match[4]);
37
+ }
38
+ toSeconds(hours, minutes, seconds, milliseconds) {
39
+ return (Number(hours ?? 0) * 3600 +
40
+ Number(minutes) * 60 +
41
+ Number(seconds) +
42
+ Number(milliseconds.padEnd(3, '0')) / 1000);
43
+ }
44
+ }
45
+ //# sourceMappingURL=CueTimecodeReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueTimecodeReader.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueTimecodeReader.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA,6CAA6C,CAAC;AACzE,MAAM,UAAU,GAAG,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Q,CAAC,EAAE,CAAC,CAAC;QACvF,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAE,EAAE,KAAK,CAAC,CAAC,CAAE,EAAE,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC;IACnE,CAAC;IAEO,SAAS,CACf,KAAyB,EACzB,OAAe,EACf,OAAe,EACf,YAAoB;QAEpB,OAAO,CACL,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI;YACzB,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;YACpB,MAAM,CAAC,OAAO,CAAC;YACf,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAC3C,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import type { Word } from '../document/Word';
2
+ /**
3
+ * Turns the text of one cue into the words it holds, timed.
4
+ *
5
+ * Implementations differ in how much the file told them: some formats
6
+ * time nothing below the cue and leave the words to be guessed at,
7
+ * others mark when each word is spoken and can be taken at their word.
8
+ */
9
+ export interface CueWordReader {
10
+ read(text: string, startSeconds: number, endSeconds: number): ReadonlyArray<Word>;
11
+ }
12
+ //# sourceMappingURL=CueWordReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueWordReader.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/CueWordReader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;CACnF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CueWordReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CueWordReader.js","sourceRoot":"","sources":["../../../src/modules/transcription/CueWordReader.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import type { Word } from '../document/Word';
2
+ import type { CueTextTokenizer } from '../transcription/CueTextTokenizer';
3
+ import type { CueWordReader } from '../transcription/CueWordReader';
4
+ import type { WordTimingEstimator } from '../transcription/WordTimingEstimator';
5
+ /**
6
+ * Reads a cue from a format that times nothing below the cue itself.
7
+ * The words are known, when each is spoken is not, so the cue's own
8
+ * window is shared out among them.
9
+ */
10
+ export declare class EstimatedCueWordReader implements CueWordReader {
11
+ private readonly tokenizer;
12
+ private readonly estimator;
13
+ constructor(tokenizer: CueTextTokenizer, estimator: WordTimingEstimator);
14
+ read(text: string, startSeconds: number, endSeconds: number): ReadonlyArray<Word>;
15
+ }
16
+ //# sourceMappingURL=EstimatedCueWordReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EstimatedCueWordReader.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/EstimatedCueWordReader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEtF;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,aAAa;IAExD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,SAAS,EAAE,gBAAgB,EAC3B,SAAS,EAAE,mBAAmB;IAGjD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;CAGlF"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Reads a cue from a format that times nothing below the cue itself.
3
+ * The words are known, when each is spoken is not, so the cue's own
4
+ * window is shared out among them.
5
+ */
6
+ export class EstimatedCueWordReader {
7
+ tokenizer;
8
+ estimator;
9
+ constructor(tokenizer, estimator) {
10
+ this.tokenizer = tokenizer;
11
+ this.estimator = estimator;
12
+ }
13
+ read(text, startSeconds, endSeconds) {
14
+ return this.estimator.spread(this.tokenizer.tokenize(text), startSeconds, endSeconds);
15
+ }
16
+ }
17
+ //# sourceMappingURL=EstimatedCueWordReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EstimatedCueWordReader.js","sourceRoot":"","sources":["../../../src/modules/transcription/EstimatedCueWordReader.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IAEd;IACA;IAFnB,YACmB,SAA2B,EAC3B,SAA8B;QAD9B,cAAS,GAAT,SAAS,CAAkB;QAC3B,cAAS,GAAT,SAAS,CAAqB;IAC9C,CAAC;IAEJ,IAAI,CAAC,IAAY,EAAE,YAAoB,EAAE,UAAkB;QACzD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IACxF,CAAC;CACF"}