@tscaps/engine 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +349 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.d.ts +5 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.js +41 -0
- package/dist/modules/css/BrowserCssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/CssMinifier.d.ts +12 -0
- package/dist/modules/css/CssMinifier.d.ts.map +1 -0
- package/dist/modules/css/CssMinifier.js +47 -0
- package/dist/modules/css/CssMinifier.js.map +1 -0
- package/dist/modules/css/CssResourceEmbedder.d.ts +4 -0
- package/dist/modules/css/CssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/CssResourceEmbedder.js +2 -0
- package/dist/modules/css/CssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/CssScoper.d.ts +16 -0
- package/dist/modules/css/CssScoper.d.ts.map +1 -0
- package/dist/modules/css/CssScoper.js +109 -0
- package/dist/modules/css/CssScoper.js.map +1 -0
- package/dist/modules/css/NoopCssResourceEmbedder.d.ts +12 -0
- package/dist/modules/css/NoopCssResourceEmbedder.d.ts.map +1 -0
- package/dist/modules/css/NoopCssResourceEmbedder.js +13 -0
- package/dist/modules/css/NoopCssResourceEmbedder.js.map +1 -0
- package/dist/modules/css/index.d.ts +6 -0
- package/dist/modules/css/index.d.ts.map +1 -0
- package/dist/modules/css/index.js +5 -0
- package/dist/modules/css/index.js.map +1 -0
- package/dist/modules/document/CssVariable.d.ts +46 -0
- package/dist/modules/document/CssVariable.d.ts.map +1 -0
- package/dist/modules/document/CssVariable.js +47 -0
- package/dist/modules/document/CssVariable.js.map +1 -0
- package/dist/modules/document/Document.d.ts +43 -0
- package/dist/modules/document/Document.d.ts.map +1 -0
- package/dist/modules/document/Document.js +86 -0
- package/dist/modules/document/Document.js.map +1 -0
- package/dist/modules/document/DocumentEditor.d.ts +111 -0
- package/dist/modules/document/DocumentEditor.d.ts.map +1 -0
- package/dist/modules/document/DocumentEditor.js +555 -0
- package/dist/modules/document/DocumentEditor.js.map +1 -0
- package/dist/modules/document/Letter.d.ts +17 -0
- package/dist/modules/document/Letter.d.ts.map +1 -0
- package/dist/modules/document/Letter.js +17 -0
- package/dist/modules/document/Letter.js.map +1 -0
- package/dist/modules/document/Line.d.ts +31 -0
- package/dist/modules/document/Line.d.ts.map +1 -0
- package/dist/modules/document/Line.js +94 -0
- package/dist/modules/document/Line.js.map +1 -0
- package/dist/modules/document/LineState.d.ts +6 -0
- package/dist/modules/document/LineState.d.ts.map +1 -0
- package/dist/modules/document/LineState.js +7 -0
- package/dist/modules/document/LineState.js.map +1 -0
- package/dist/modules/document/NarrationPace.d.ts +20 -0
- package/dist/modules/document/NarrationPace.d.ts.map +1 -0
- package/dist/modules/document/NarrationPace.js +60 -0
- package/dist/modules/document/NarrationPace.js.map +1 -0
- package/dist/modules/document/Section.d.ts +45 -0
- package/dist/modules/document/Section.d.ts.map +1 -0
- package/dist/modules/document/Section.js +94 -0
- package/dist/modules/document/Section.js.map +1 -0
- package/dist/modules/document/Segment.d.ts +40 -0
- package/dist/modules/document/Segment.d.ts.map +1 -0
- package/dist/modules/document/Segment.js +85 -0
- package/dist/modules/document/Segment.js.map +1 -0
- package/dist/modules/document/Tag.d.ts +24 -0
- package/dist/modules/document/Tag.d.ts.map +1 -0
- package/dist/modules/document/Tag.js +37 -0
- package/dist/modules/document/Tag.js.map +1 -0
- package/dist/modules/document/TimeFragment.d.ts +11 -0
- package/dist/modules/document/TimeFragment.d.ts.map +1 -0
- package/dist/modules/document/TimeFragment.js +29 -0
- package/dist/modules/document/TimeFragment.js.map +1 -0
- package/dist/modules/document/Word.d.ts +40 -0
- package/dist/modules/document/Word.d.ts.map +1 -0
- package/dist/modules/document/Word.js +114 -0
- package/dist/modules/document/Word.js.map +1 -0
- package/dist/modules/document/WordState.d.ts +6 -0
- package/dist/modules/document/WordState.d.ts.map +1 -0
- package/dist/modules/document/WordState.js +7 -0
- package/dist/modules/document/WordState.js.map +1 -0
- package/dist/modules/document/index.d.ts +14 -0
- package/dist/modules/document/index.d.ts.map +1 -0
- package/dist/modules/document/index.js +14 -0
- package/dist/modules/document/index.js.map +1 -0
- package/dist/modules/effect/CarryQuotesEffect.d.ts +47 -0
- package/dist/modules/effect/CarryQuotesEffect.d.ts.map +1 -0
- package/dist/modules/effect/CarryQuotesEffect.js +181 -0
- package/dist/modules/effect/CarryQuotesEffect.js.map +1 -0
- package/dist/modules/effect/Effect.d.ts +16 -0
- package/dist/modules/effect/Effect.d.ts.map +1 -0
- package/dist/modules/effect/Effect.js +2 -0
- package/dist/modules/effect/Effect.js.map +1 -0
- package/dist/modules/effect/GapFreeEffect.d.ts +24 -0
- package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -0
- package/dist/modules/effect/GapFreeEffect.js +67 -0
- package/dist/modules/effect/GapFreeEffect.js.map +1 -0
- package/dist/modules/effect/RemovePunctuationEffect.d.ts +21 -0
- package/dist/modules/effect/RemovePunctuationEffect.d.ts.map +1 -0
- package/dist/modules/effect/RemovePunctuationEffect.js +52 -0
- package/dist/modules/effect/RemovePunctuationEffect.js.map +1 -0
- package/dist/modules/effect/SmartLowercaseEffect.d.ts +21 -0
- package/dist/modules/effect/SmartLowercaseEffect.d.ts.map +1 -0
- package/dist/modules/effect/SmartLowercaseEffect.js +45 -0
- package/dist/modules/effect/SmartLowercaseEffect.js.map +1 -0
- package/dist/modules/effect/SmartPunctuationEffect.d.ts +25 -0
- package/dist/modules/effect/SmartPunctuationEffect.d.ts.map +1 -0
- package/dist/modules/effect/SmartPunctuationEffect.js +68 -0
- package/dist/modules/effect/SmartPunctuationEffect.js.map +1 -0
- package/dist/modules/effect/index.d.ts +7 -0
- package/dist/modules/effect/index.d.ts.map +1 -0
- package/dist/modules/effect/index.js +6 -0
- package/dist/modules/effect/index.js.map +1 -0
- package/dist/modules/pipeline/PipelineProgress.d.ts +30 -0
- package/dist/modules/pipeline/PipelineProgress.d.ts.map +1 -0
- package/dist/modules/pipeline/PipelineProgress.js +2 -0
- package/dist/modules/pipeline/PipelineProgress.js.map +1 -0
- package/dist/modules/pipeline/RenderPipeline.d.ts +105 -0
- package/dist/modules/pipeline/RenderPipeline.d.ts.map +1 -0
- package/dist/modules/pipeline/RenderPipeline.js +232 -0
- package/dist/modules/pipeline/RenderPipeline.js.map +1 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts +143 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.d.ts.map +1 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.js +317 -0
- package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -0
- package/dist/modules/pipeline/index.d.ts +6 -0
- package/dist/modules/pipeline/index.d.ts.map +1 -0
- package/dist/modules/pipeline/index.js +3 -0
- package/dist/modules/pipeline/index.js.map +1 -0
- package/dist/modules/profiling/Profiler.d.ts +115 -0
- package/dist/modules/profiling/Profiler.d.ts.map +1 -0
- package/dist/modules/profiling/Profiler.js +316 -0
- package/dist/modules/profiling/Profiler.js.map +1 -0
- package/dist/modules/profiling/index.d.ts +2 -0
- package/dist/modules/profiling/index.d.ts.map +1 -0
- package/dist/modules/profiling/index.js +2 -0
- package/dist/modules/profiling/index.js.map +1 -0
- package/dist/modules/rendering/AlignmentConfig.d.ts +21 -0
- package/dist/modules/rendering/AlignmentConfig.d.ts.map +1 -0
- package/dist/modules/rendering/AlignmentConfig.js +2 -0
- package/dist/modules/rendering/AlignmentConfig.js.map +1 -0
- package/dist/modules/rendering/BoxEdges.d.ts +8 -0
- package/dist/modules/rendering/BoxEdges.d.ts.map +1 -0
- package/dist/modules/rendering/BoxEdges.js +2 -0
- package/dist/modules/rendering/BoxEdges.js.map +1 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.d.ts +12 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.js +31 -0
- package/dist/modules/rendering/BrowserOverlayFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts +57 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +775 -0
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/ElementRenderOverrides.d.ts +15 -0
- package/dist/modules/rendering/ElementRenderOverrides.d.ts.map +1 -0
- package/dist/modules/rendering/ElementRenderOverrides.js +24 -0
- package/dist/modules/rendering/ElementRenderOverrides.js.map +1 -0
- package/dist/modules/rendering/InlineStyleMap.d.ts +9 -0
- package/dist/modules/rendering/InlineStyleMap.d.ts.map +1 -0
- package/dist/modules/rendering/InlineStyleMap.js +2 -0
- package/dist/modules/rendering/InlineStyleMap.js.map +1 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.d.ts +20 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.d.ts.map +1 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.js +36 -0
- package/dist/modules/rendering/LayeredSubtitleFrame.js.map +1 -0
- package/dist/modules/rendering/OverlayFrameRenderer.d.ts +27 -0
- package/dist/modules/rendering/OverlayFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/OverlayFrameRenderer.js +2 -0
- package/dist/modules/rendering/OverlayFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/RenderingConfig.d.ts +22 -0
- package/dist/modules/rendering/RenderingConfig.d.ts.map +1 -0
- package/dist/modules/rendering/RenderingConfig.js +2 -0
- package/dist/modules/rendering/RenderingConfig.js.map +1 -0
- package/dist/modules/rendering/ScopedRenderOverride.d.ts +19 -0
- package/dist/modules/rendering/ScopedRenderOverride.d.ts.map +1 -0
- package/dist/modules/rendering/ScopedRenderOverride.js +2 -0
- package/dist/modules/rendering/ScopedRenderOverride.js.map +1 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts +41 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.d.ts.map +1 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.js +47 -0
- package/dist/modules/rendering/SegmentPaintRegionResolver.js.map +1 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts +58 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.d.ts.map +1 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js +132 -0
- package/dist/modules/rendering/SegmentSubtreeHtmlBuilder.js.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +111 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.js +2 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.js.map +1 -0
- package/dist/modules/rendering/VideoFrameLayerClass.d.ts +21 -0
- package/dist/modules/rendering/VideoFrameLayerClass.d.ts.map +1 -0
- package/dist/modules/rendering/VideoFrameLayerClass.js +21 -0
- package/dist/modules/rendering/VideoFrameLayerClass.js.map +1 -0
- package/dist/modules/rendering/VideoFrameSource.d.ts +29 -0
- package/dist/modules/rendering/VideoFrameSource.d.ts.map +1 -0
- package/dist/modules/rendering/VideoFrameSource.js +2 -0
- package/dist/modules/rendering/VideoFrameSource.js.map +1 -0
- package/dist/modules/rendering/index.d.ts +14 -0
- package/dist/modules/rendering/index.d.ts.map +1 -0
- package/dist/modules/rendering/index.js +6 -0
- package/dist/modules/rendering/index.js.map +1 -0
- package/dist/modules/splitting/BalancedLineSplitter.d.ts +24 -0
- package/dist/modules/splitting/BalancedLineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BalancedLineSplitter.js +81 -0
- package/dist/modules/splitting/BalancedLineSplitter.js.map +1 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.d.ts +31 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.js +99 -0
- package/dist/modules/splitting/BalancedPixelWidthLineSplitter.js.map +1 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.d.ts +19 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.js +38 -0
- package/dist/modules/splitting/BoundarySegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.d.ts +8 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.js +12 -0
- package/dist/modules/splitting/CompositeSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.d.ts +56 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.d.ts.map +1 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.js +197 -0
- package/dist/modules/splitting/DomProbeCanvasTextMeasurer.js.map +1 -0
- package/dist/modules/splitting/GraphemeWordSplitter.d.ts +11 -0
- package/dist/modules/splitting/GraphemeWordSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/GraphemeWordSplitter.js +12 -0
- package/dist/modules/splitting/GraphemeWordSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.d.ts +15 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.js +64 -0
- package/dist/modules/splitting/LimitByCharsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.d.ts +30 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.js +66 -0
- package/dist/modules/splitting/LimitByScaledCharsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.d.ts +12 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.js +25 -0
- package/dist/modules/splitting/LimitByWordsSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/LineSplitter.d.ts +10 -0
- package/dist/modules/splitting/LineSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/LineSplitter.js +2 -0
- package/dist/modules/splitting/LineSplitter.js.map +1 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.d.ts +24 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.js +43 -0
- package/dist/modules/splitting/PauseBasedSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/SegmentSplitter.d.ts +10 -0
- package/dist/modules/splitting/SegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/SegmentSplitter.js +2 -0
- package/dist/modules/splitting/SegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.d.ts +17 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.js +46 -0
- package/dist/modules/splitting/SpeakerChangeSegmentSplitter.js.map +1 -0
- package/dist/modules/splitting/TextMeasurer.d.ts +15 -0
- package/dist/modules/splitting/TextMeasurer.d.ts.map +1 -0
- package/dist/modules/splitting/TextMeasurer.js +2 -0
- package/dist/modules/splitting/TextMeasurer.js.map +1 -0
- package/dist/modules/splitting/WordSplitter.d.ts +8 -0
- package/dist/modules/splitting/WordSplitter.d.ts.map +1 -0
- package/dist/modules/splitting/WordSplitter.js +2 -0
- package/dist/modules/splitting/WordSplitter.js.map +1 -0
- package/dist/modules/splitting/index.d.ts +24 -0
- package/dist/modules/splitting/index.d.ts.map +1 -0
- package/dist/modules/splitting/index.js +12 -0
- package/dist/modules/splitting/index.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.js +28 -0
- package/dist/modules/svg-filter/SvgFilter.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterBundle.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilterBundle.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterBundle.js +20 -0
- package/dist/modules/svg-filter/SvgFilterBundle.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.d.ts +16 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.js +25 -0
- package/dist/modules/svg-filter/SvgFilterDefinitions.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +21 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +50 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.d.ts +17 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.js +27 -0
- package/dist/modules/svg-filter/SvgFilterLengthResolver.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScope.d.ts +18 -0
- package/dist/modules/svg-filter/SvgFilterScope.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScope.js +28 -0
- package/dist/modules/svg-filter/SvgFilterScope.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.d.ts +52 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.js +2 -0
- package/dist/modules/svg-filter/SvgFilterScopeProvider.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScoper.d.ts +60 -0
- package/dist/modules/svg-filter/SvgFilterScoper.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterScoper.js +58 -0
- package/dist/modules/svg-filter/SvgFilterScoper.js.map +1 -0
- package/dist/modules/svg-filter/index.d.ts +10 -0
- package/dist/modules/svg-filter/index.d.ts.map +1 -0
- package/dist/modules/svg-filter/index.js +8 -0
- package/dist/modules/svg-filter/index.js.map +1 -0
- package/dist/modules/tagging/RegexTagger.d.ts +11 -0
- package/dist/modules/tagging/RegexTagger.d.ts.map +1 -0
- package/dist/modules/tagging/RegexTagger.js +32 -0
- package/dist/modules/tagging/RegexTagger.js.map +1 -0
- package/dist/modules/tagging/SpanTagger.d.ts +25 -0
- package/dist/modules/tagging/SpanTagger.d.ts.map +1 -0
- package/dist/modules/tagging/SpanTagger.js +73 -0
- package/dist/modules/tagging/SpanTagger.js.map +1 -0
- package/dist/modules/tagging/StructureTagger.d.ts +20 -0
- package/dist/modules/tagging/StructureTagger.d.ts.map +1 -0
- package/dist/modules/tagging/StructureTagger.js +74 -0
- package/dist/modules/tagging/StructureTagger.js.map +1 -0
- package/dist/modules/tagging/Tagger.d.ts +5 -0
- package/dist/modules/tagging/Tagger.d.ts.map +1 -0
- package/dist/modules/tagging/Tagger.js +5 -0
- package/dist/modules/tagging/Tagger.js.map +1 -0
- package/dist/modules/tagging/WordlistTagger.d.ts +11 -0
- package/dist/modules/tagging/WordlistTagger.d.ts.map +1 -0
- package/dist/modules/tagging/WordlistTagger.js +31 -0
- package/dist/modules/tagging/WordlistTagger.js.map +1 -0
- package/dist/modules/tagging/index.d.ts +6 -0
- package/dist/modules/tagging/index.d.ts.map +1 -0
- package/dist/modules/tagging/index.js +6 -0
- package/dist/modules/tagging/index.js.map +1 -0
- package/dist/modules/transcription/AudioDecoder.d.ts +11 -0
- package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/AudioDecoder.js +2 -0
- package/dist/modules/transcription/AudioDecoder.js.map +1 -0
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts +13 -0
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/BrowserAudioDecoder.js +34 -0
- package/dist/modules/transcription/BrowserAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/PassthroughTranscriber.d.ts +20 -0
- package/dist/modules/transcription/PassthroughTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/PassthroughTranscriber.js +23 -0
- package/dist/modules/transcription/PassthroughTranscriber.js.map +1 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.d.ts +12 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.js +14 -0
- package/dist/modules/transcription/PreDecodedAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts +33 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.js +111 -0
- package/dist/modules/transcription/SrtTranscriber.js.map +1 -0
- package/dist/modules/transcription/Transcriber.d.ts +23 -0
- package/dist/modules/transcription/Transcriber.d.ts.map +1 -0
- package/dist/modules/transcription/Transcriber.js +2 -0
- package/dist/modules/transcription/Transcriber.js.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts +44 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.js +162 -0
- package/dist/modules/transcription/WhisperTranscriber.js.map +1 -0
- package/dist/modules/transcription/index.d.ts +8 -0
- package/dist/modules/transcription/index.d.ts.map +1 -0
- package/dist/modules/transcription/index.js +6 -0
- package/dist/modules/transcription/index.js.map +1 -0
- package/dist/modules/video/RenderJob.d.ts +95 -0
- package/dist/modules/video/RenderJob.d.ts.map +1 -0
- package/dist/modules/video/RenderJob.js +2 -0
- package/dist/modules/video/RenderJob.js.map +1 -0
- package/dist/modules/video/VideoRenderer.d.ts +5 -0
- package/dist/modules/video/VideoRenderer.d.ts.map +1 -0
- package/dist/modules/video/VideoRenderer.js +2 -0
- package/dist/modules/video/VideoRenderer.js.map +1 -0
- package/dist/modules/video/index.d.ts +33 -0
- package/dist/modules/video/index.d.ts.map +1 -0
- package/dist/modules/video/index.js +17 -0
- package/dist/modules/video/index.js.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts +69 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js +206 -0
- package/dist/modules/video/mediabunny/MediaBunnyVideoRenderer.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.d.ts +24 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.js +2 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts +20 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.js +2 -0
- package/dist/modules/video/mediabunny/audio/AudioTrackBridgeFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.d.ts +11 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js +32 -0
- package/dist/modules/video/mediabunny/audio/DefaultAudioTrackBridgeFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.d.ts +12 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.js +14 -0
- package/dist/modules/video/mediabunny/audio/DiscardAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts +28 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js +52 -0
- package/dist/modules/video/mediabunny/audio/PassthroughAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts +25 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js +52 -0
- package/dist/modules/video/mediabunny/audio/TranscodeAudioTrackBridge.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.d.ts +32 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.js +60 -0
- package/dist/modules/video/mediabunny/caption/BatchedSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.d.ts +27 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.js +72 -0
- package/dist/modules/video/mediabunny/caption/ComposedSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.d.ts +32 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.js +2 -0
- package/dist/modules/video/mediabunny/caption/SubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.d.ts +25 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.js +37 -0
- package/dist/modules/video/mediabunny/caption/VideoBoundSubtitleLayerSource.js.map +1 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts +32 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.js +2 -0
- package/dist/modules/video/mediabunny/codec/CodecPolicy.js.map +1 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.d.ts +59 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.js +110 -0
- package/dist/modules/video/mediabunny/codec/DefaultCodecPolicy.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.d.ts +27 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.js +44 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoder.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.d.ts +10 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.js +15 -0
- package/dist/modules/video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.d.ts +29 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.js +2 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoder.js.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.d.ts +16 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.js +2 -0
- package/dist/modules/video/mediabunny/encoder/VideoTrackEncoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +25 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +74 -0
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.d.ts +26 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.js +147 -0
- package/dist/modules/video/mediabunny/frame/CustomWebCodecsVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.d.ts +12 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.js +25 -0
- package/dist/modules/video/mediabunny/frame/DefaultVideoFrameDecoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts +30 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.js +2 -0
- package/dist/modules/video/mediabunny/frame/FrameCompositor.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.d.ts +44 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.js +334 -0
- package/dist/modules/video/mediabunny/frame/HtmlVideoElementVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts +10 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js +17 -0
- package/dist/modules/video/mediabunny/frame/LayeredFrameCompositor.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.d.ts +30 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.js +2 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.d.ts +22 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.js +2 -0
- package/dist/modules/video/mediabunny/frame/VideoFrameDecoderFactory.js.map +1 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.d.ts +17 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.js +48 -0
- package/dist/modules/video/mediabunny/frame/WebCodecsVideoFrameDecoder.js.map +1 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.d.ts +11 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.js +22 -0
- package/dist/modules/video/mediabunny/output/MediaBunnyOutputTargetBuilder.js.map +1 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.d.ts +27 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.d.ts.map +1 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.js +2 -0
- package/dist/modules/video/mediabunny/output/OutputTargetBuilder.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { WhisperTranscriber } from '../transcription/WhisperTranscriber';
|
|
2
|
+
import { BrowserAudioDecoder } from '../transcription/BrowserAudioDecoder';
|
|
3
|
+
import { GraphemeWordSplitter } from '../splitting/GraphemeWordSplitter';
|
|
4
|
+
import { CompositeSegmentSplitter } from '../splitting/CompositeSegmentSplitter';
|
|
5
|
+
import { BoundarySegmentSplitter } from '../splitting/BoundarySegmentSplitter';
|
|
6
|
+
import { LimitByScaledCharsSegmentSplitter } from '../splitting/LimitByScaledCharsSegmentSplitter';
|
|
7
|
+
import { StructureTagger } from '../tagging/StructureTagger';
|
|
8
|
+
import { BrowserSubtitleFrameRenderer } from '../rendering/BrowserSubtitleFrameRenderer';
|
|
9
|
+
import { BrowserOverlayFrameRenderer } from '../rendering/BrowserOverlayFrameRenderer';
|
|
10
|
+
import { BrowserCssResourceEmbedder } from '../css/BrowserCssResourceEmbedder';
|
|
11
|
+
import { MediaBunnyVideoRenderer } from '../video/mediabunny/MediaBunnyVideoRenderer';
|
|
12
|
+
import { DefaultCodecPolicy } from '../video/mediabunny/codec/DefaultCodecPolicy';
|
|
13
|
+
import { DefaultVideoFrameDecoderFactory } from '../video/mediabunny/frame/DefaultVideoFrameDecoderFactory';
|
|
14
|
+
import { MediaBunnyCanvasVideoTrackEncoderFactory } from '../video/mediabunny/encoder/MediaBunnyCanvasVideoTrackEncoderFactory';
|
|
15
|
+
import { DefaultAudioTrackBridgeFactory } from '../video/mediabunny/audio/DefaultAudioTrackBridgeFactory';
|
|
16
|
+
import { MediaBunnyOutputTargetBuilder } from '../video/mediabunny/output/MediaBunnyOutputTargetBuilder';
|
|
17
|
+
import { LayeredFrameCompositor } from '../video/mediabunny/frame/LayeredFrameCompositor';
|
|
18
|
+
import { BatchedSubtitleLayerSource } from '../video/mediabunny/caption/BatchedSubtitleLayerSource';
|
|
19
|
+
import { VideoBoundSubtitleLayerSource } from '../video/mediabunny/caption/VideoBoundSubtitleLayerSource';
|
|
20
|
+
import { ComposedSubtitleLayerSource } from '../video/mediabunny/caption/ComposedSubtitleLayerSource';
|
|
21
|
+
import { RenderPipeline } from '../pipeline/RenderPipeline';
|
|
22
|
+
const DEFAULT_SEGMENT_SPLITTER_CONFIG = {
|
|
23
|
+
separators: ['.', '?', '!'],
|
|
24
|
+
maxChars: 40,
|
|
25
|
+
minChars: 10,
|
|
26
|
+
scale: 1,
|
|
27
|
+
};
|
|
28
|
+
const DEFAULT_LINE_SPLITTER_CONFIG = {
|
|
29
|
+
maxLines: 2,
|
|
30
|
+
minLines: 1,
|
|
31
|
+
maxWidthRatio: 0.8,
|
|
32
|
+
};
|
|
33
|
+
const DEFAULT_ALIGNMENT = {
|
|
34
|
+
verticalAlign: 'bottom',
|
|
35
|
+
verticalOffset: 0.85,
|
|
36
|
+
horizontalAlign: 'center',
|
|
37
|
+
horizontalOffset: 0.5,
|
|
38
|
+
};
|
|
39
|
+
const DEFAULT_RENDERING = {
|
|
40
|
+
splitWordsIntoLetters: false,
|
|
41
|
+
videoFrame: { required: false, jpegQuality: 1 },
|
|
42
|
+
padding: null,
|
|
43
|
+
};
|
|
44
|
+
const DEFAULT_SUBTITLE_CSS = `
|
|
45
|
+
.segment {
|
|
46
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
font-size: 5cqh;
|
|
49
|
+
color: #ffffff;
|
|
50
|
+
text-align: center;
|
|
51
|
+
line-height: 1.2;
|
|
52
|
+
text-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.7);
|
|
53
|
+
}
|
|
54
|
+
.line { display: block; }
|
|
55
|
+
.word { display: inline-block; margin: 0 0.15em; }
|
|
56
|
+
`;
|
|
57
|
+
const DEFAULT_SUBTITLE_STYLE = {
|
|
58
|
+
css: DEFAULT_SUBTITLE_CSS,
|
|
59
|
+
inlineStyles: {},
|
|
60
|
+
alignment: DEFAULT_ALIGNMENT,
|
|
61
|
+
rendering: DEFAULT_RENDERING,
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Fluent assembler that produces a {@link RenderPipeline} preloaded with
|
|
65
|
+
* sensible defaults for every stage of the render flow: an in-browser
|
|
66
|
+
* Whisper transcriber, a sentence + scaled-char segment splitter, a
|
|
67
|
+
* pixel-balanced line splitter (built lazily once output size is known),
|
|
68
|
+
* the structural tagger, no semantic taggers, no effects, and a
|
|
69
|
+
* MediaBunny-backed video renderer.
|
|
70
|
+
*
|
|
71
|
+
* Every `with*` method narrows one slot and leaves the rest at their
|
|
72
|
+
* defaults; defaults stay in place until explicitly replaced. The only
|
|
73
|
+
* required input is the source video — `build` throws otherwise.
|
|
74
|
+
*
|
|
75
|
+
* Two granularities for styling: single-style callers shape the default
|
|
76
|
+
* via `withCss`/`withAlignment`/`withRenderingConfig`/`withInlineStyles`
|
|
77
|
+
* (or replace it wholesale with `withSubtitleStyle`); multi-kind callers
|
|
78
|
+
* pass a full per-kind map through `withSubtitleStyles`. The default
|
|
79
|
+
* line splitter only fits the single-style path — `withSubtitleStyles`
|
|
80
|
+
* disables it unless the caller also supplies their own splitter.
|
|
81
|
+
*
|
|
82
|
+
* Tweaking the default splitters' parameters without rebuilding them
|
|
83
|
+
* goes through the symmetric `withDefaultSegmentSplitterConfig` /
|
|
84
|
+
* `withDefaultLineSplitterConfig`.
|
|
85
|
+
*/
|
|
86
|
+
export class RenderPipelineBuilder {
|
|
87
|
+
video = null;
|
|
88
|
+
transcriber = null;
|
|
89
|
+
transcriberOptions = undefined;
|
|
90
|
+
segmentSplitter = null;
|
|
91
|
+
defaultSegmentSplitterConfig = { ...DEFAULT_SEGMENT_SPLITTER_CONFIG };
|
|
92
|
+
lineSplitter = null;
|
|
93
|
+
defaultLineSplitterConfig = { ...DEFAULT_LINE_SPLITTER_CONFIG };
|
|
94
|
+
wordSplitter = null;
|
|
95
|
+
semanticTaggers = [];
|
|
96
|
+
effects = [];
|
|
97
|
+
style = DEFAULT_SUBTITLE_STYLE;
|
|
98
|
+
explicitStyles = null;
|
|
99
|
+
outputFormat = undefined;
|
|
100
|
+
quality = undefined;
|
|
101
|
+
outputResolution = undefined;
|
|
102
|
+
outputStream = undefined;
|
|
103
|
+
overlayHtml = undefined;
|
|
104
|
+
onAudioDiscarded = undefined;
|
|
105
|
+
confirmFallbackDecoder = undefined;
|
|
106
|
+
videoRenderer = null;
|
|
107
|
+
subtitleFrameRenderer = null;
|
|
108
|
+
overlayFrameRenderer = null;
|
|
109
|
+
cssResourceEmbedder = null;
|
|
110
|
+
withInputVideo(video) {
|
|
111
|
+
this.video = video;
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
withTranscriber(transcriber) {
|
|
115
|
+
this.transcriber = transcriber;
|
|
116
|
+
return this;
|
|
117
|
+
}
|
|
118
|
+
withTranscriberOptions(options) {
|
|
119
|
+
this.transcriberOptions = options;
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
withSegmentSplitter(splitter) {
|
|
123
|
+
this.segmentSplitter = splitter;
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
withDefaultSegmentSplitterConfig(partial) {
|
|
127
|
+
this.defaultSegmentSplitterConfig = { ...this.defaultSegmentSplitterConfig, ...partial };
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
withLineSplitter(splitter) {
|
|
131
|
+
this.lineSplitter = splitter;
|
|
132
|
+
return this;
|
|
133
|
+
}
|
|
134
|
+
withDefaultLineSplitterConfig(partial) {
|
|
135
|
+
this.defaultLineSplitterConfig = { ...this.defaultLineSplitterConfig, ...partial };
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
withWordSplitter(splitter) {
|
|
139
|
+
this.wordSplitter = splitter;
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
addTagger(tagger) {
|
|
143
|
+
this.semanticTaggers.push(tagger);
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
withTaggers(taggers) {
|
|
147
|
+
this.semanticTaggers = [...taggers];
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
addEffect(effect) {
|
|
151
|
+
this.effects.push(effect);
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
withEffects(effects) {
|
|
155
|
+
this.effects = [...effects];
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
withCss(css) {
|
|
159
|
+
this.style = { ...this.style, css };
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
withAlignment(alignment) {
|
|
163
|
+
this.style = { ...this.style, alignment };
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
withRenderingConfig(rendering) {
|
|
167
|
+
this.style = { ...this.style, rendering };
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
withInlineStyles(inlineStyles) {
|
|
171
|
+
this.style = { ...this.style, inlineStyles };
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
/** Replaces the single-style default wholesale; subsequent style atajos layer on top of this. */
|
|
175
|
+
withSubtitleStyle(style) {
|
|
176
|
+
this.style = style;
|
|
177
|
+
return this;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Switches to the multi-kind mode: the supplied map is passed to the
|
|
181
|
+
* video renderer as-is, the single-style default is no longer used,
|
|
182
|
+
* and the default line splitter is disabled (callers in this mode
|
|
183
|
+
* must supply their own via `withLineSplitter` if they want one).
|
|
184
|
+
*/
|
|
185
|
+
withSubtitleStyles(styles) {
|
|
186
|
+
this.explicitStyles = styles;
|
|
187
|
+
return this;
|
|
188
|
+
}
|
|
189
|
+
withOutputFormat(format) {
|
|
190
|
+
this.outputFormat = format;
|
|
191
|
+
return this;
|
|
192
|
+
}
|
|
193
|
+
withOutputResolution(width, height) {
|
|
194
|
+
this.outputResolution = { width, height };
|
|
195
|
+
return this;
|
|
196
|
+
}
|
|
197
|
+
withQuality(quality) {
|
|
198
|
+
this.quality = quality;
|
|
199
|
+
return this;
|
|
200
|
+
}
|
|
201
|
+
withOutputStream(stream) {
|
|
202
|
+
this.outputStream = stream;
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
withOverlayHtml(html) {
|
|
206
|
+
this.overlayHtml = html;
|
|
207
|
+
return this;
|
|
208
|
+
}
|
|
209
|
+
withOnAudioDiscarded(callback) {
|
|
210
|
+
this.onAudioDiscarded = callback;
|
|
211
|
+
return this;
|
|
212
|
+
}
|
|
213
|
+
withConfirmFallbackDecoder(callback) {
|
|
214
|
+
this.confirmFallbackDecoder = callback;
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
withVideoRenderer(renderer) {
|
|
218
|
+
this.videoRenderer = renderer;
|
|
219
|
+
return this;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Feeds the default MediaBunny video renderer. Ignored if a full
|
|
223
|
+
* `VideoRenderer` was supplied via `withVideoRenderer`.
|
|
224
|
+
*/
|
|
225
|
+
withSubtitleFrameRenderer(renderer) {
|
|
226
|
+
this.subtitleFrameRenderer = renderer;
|
|
227
|
+
return this;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Feeds the default MediaBunny video renderer. Ignored if a full
|
|
231
|
+
* `VideoRenderer` was supplied via `withVideoRenderer`.
|
|
232
|
+
*/
|
|
233
|
+
withOverlayFrameRenderer(renderer) {
|
|
234
|
+
this.overlayFrameRenderer = renderer;
|
|
235
|
+
return this;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Feeds the default subtitle frame renderer. Ignored if a full
|
|
239
|
+
* `SubtitleFrameRenderer` or `VideoRenderer` was supplied.
|
|
240
|
+
*/
|
|
241
|
+
withCssResourceEmbedder(embedder) {
|
|
242
|
+
this.cssResourceEmbedder = embedder;
|
|
243
|
+
return this;
|
|
244
|
+
}
|
|
245
|
+
/** Materialises the pipeline. Throws if no input video has been supplied. */
|
|
246
|
+
build() {
|
|
247
|
+
if (this.video === null) {
|
|
248
|
+
throw new Error('RenderPipelineBuilder: input video is required (call withInputVideo)');
|
|
249
|
+
}
|
|
250
|
+
return new RenderPipeline(this.buildConfig(this.video));
|
|
251
|
+
}
|
|
252
|
+
buildConfig(video) {
|
|
253
|
+
const wordSplitter = this.wordSplitter ?? new GraphemeWordSplitter();
|
|
254
|
+
const cssResourceEmbedder = this.cssResourceEmbedder ?? new BrowserCssResourceEmbedder();
|
|
255
|
+
const videoRenderer = this.videoRenderer ?? this.buildDefaultVideoRenderer(cssResourceEmbedder, wordSplitter);
|
|
256
|
+
return {
|
|
257
|
+
video,
|
|
258
|
+
transcriber: this.transcriber ?? this.buildDefaultTranscriber(),
|
|
259
|
+
transcriberOptions: this.transcriberOptions,
|
|
260
|
+
segmentSplitter: this.segmentSplitter ?? this.buildDefaultSegmentSplitter(),
|
|
261
|
+
lineSplitter: this.lineSplitter,
|
|
262
|
+
defaultLineSplitterConfig: this.defaultLineSplitterConfig,
|
|
263
|
+
structureTagger: new StructureTagger(),
|
|
264
|
+
semanticTaggers: [...this.semanticTaggers],
|
|
265
|
+
effects: [...this.effects],
|
|
266
|
+
defaultStyle: this.style,
|
|
267
|
+
explicitStyles: this.explicitStyles,
|
|
268
|
+
videoRenderer,
|
|
269
|
+
outputFormat: this.outputFormat,
|
|
270
|
+
quality: this.quality,
|
|
271
|
+
outputResolution: this.outputResolution,
|
|
272
|
+
outputStream: this.outputStream,
|
|
273
|
+
overlayHtml: this.overlayHtml,
|
|
274
|
+
onAudioDiscarded: this.onAudioDiscarded,
|
|
275
|
+
confirmFallbackDecoder: this.confirmFallbackDecoder,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
buildDefaultTranscriber() {
|
|
279
|
+
return new WhisperTranscriber(new BrowserAudioDecoder());
|
|
280
|
+
}
|
|
281
|
+
buildDefaultSegmentSplitter() {
|
|
282
|
+
const config = this.defaultSegmentSplitterConfig;
|
|
283
|
+
return new CompositeSegmentSplitter([
|
|
284
|
+
new BoundarySegmentSplitter({ separators: [...config.separators] }),
|
|
285
|
+
new LimitByScaledCharsSegmentSplitter({
|
|
286
|
+
maxChars: config.maxChars,
|
|
287
|
+
minChars: config.minChars,
|
|
288
|
+
scale: config.scale,
|
|
289
|
+
}),
|
|
290
|
+
]);
|
|
291
|
+
}
|
|
292
|
+
buildDefaultVideoRenderer(cssResourceEmbedder, wordSplitter) {
|
|
293
|
+
return new MediaBunnyVideoRenderer({
|
|
294
|
+
subtitleLayer: this.buildDefaultSubtitleLayerSource(cssResourceEmbedder, wordSplitter),
|
|
295
|
+
overlayRenderer: this.overlayFrameRenderer ?? new BrowserOverlayFrameRenderer(),
|
|
296
|
+
codecPolicy: new DefaultCodecPolicy(),
|
|
297
|
+
videoFrameDecoderFactory: new DefaultVideoFrameDecoderFactory(),
|
|
298
|
+
videoTrackEncoderFactory: new MediaBunnyCanvasVideoTrackEncoderFactory(),
|
|
299
|
+
audioTrackBridgeFactory: new DefaultAudioTrackBridgeFactory(),
|
|
300
|
+
outputTargetBuilder: new MediaBunnyOutputTargetBuilder(),
|
|
301
|
+
frameCompositor: new LayeredFrameCompositor(),
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
buildDefaultSubtitleLayerSource(cssResourceEmbedder, wordSplitter) {
|
|
305
|
+
return new ComposedSubtitleLayerSource(new BatchedSubtitleLayerSource(this.resolveSubtitleFrameRenderer(cssResourceEmbedder, wordSplitter)), new VideoBoundSubtitleLayerSource(this.resolveSubtitleFrameRenderer(cssResourceEmbedder, wordSplitter)));
|
|
306
|
+
}
|
|
307
|
+
// Each layer source gets its own subtitle frame renderer when the
|
|
308
|
+
// builder owns the default: the two sources hold independent open()
|
|
309
|
+
// state that would clash on a shared instance. A consumer-supplied
|
|
310
|
+
// renderer is reused as-is — sharing is then the consumer's call.
|
|
311
|
+
resolveSubtitleFrameRenderer(cssResourceEmbedder, wordSplitter) {
|
|
312
|
+
if (this.subtitleFrameRenderer !== null)
|
|
313
|
+
return this.subtitleFrameRenderer;
|
|
314
|
+
return new BrowserSubtitleFrameRenderer(cssResourceEmbedder, wordSplitter);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=RenderPipelineBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderPipelineBuilder.js","sourceRoot":"","sources":["../../../src/modules/pipeline/RenderPipelineBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAIjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,sDAAsD,CAAC;AAEzG,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAE/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAK7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AASrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,EAAE,wCAAwC,EAAE,MAAM,4EAA4E,CAAC;AACtI,OAAO,EAAE,8BAA8B,EAAE,MAAM,gEAAgE,CAAC;AAChH,OAAO,EAAE,6BAA6B,EAAE,MAAM,gEAAgE,CAAC;AAC/G,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,0BA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AAwB,EAAE,IAAI,+BAA+B,EAAE;YAC/D,wBAAwB,EAAE,IAAI,wCAAwC,EAAE;YACxE,uBAAuB,EAAE,IAAI,8BAA8B,EAAE;YAC7D,mBAAmB,EAAE,IAAI,6BAA6B,EAAE;YACxD,eAAe,EAAE,IAAI,sBAAsB,EAAE;SAC9C,CAAC,CAAC;IACL,CAAC;IAEO,+BAA+B,CACrC,mBAAwC,EACxC,YAA0B;QAE1B,OAAO,IAAI,2BAA2B,CACpC,IAAI,0BAA0B,CAAC,IAAI,CAAC,4BAA4B,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC,EACpG,IAAI,6BAA6B,CAAC,IAAI,CAAC,4BAA4B,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC,CACxG,CAAC;IACJ,CAAC;IAED,kEAAkE;IAClE,oEAAoE;IACpE,mEAAmE;IACnE,kEAAkE;IAC1D,4BAA4B,CAClC,mBAAwC,EACxC,YAA0B;QAE1B,IAAI,IAAI,CAAC,qBAAqB,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,qBAAqB,CAAC;QAC3E,OAAO,IAAI,4BAA4B,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { RenderPipeline } from '../pipeline/RenderPipeline';
|
|
2
|
+
export type { RenderPipelineConfig, OutputResolution, DefaultLineSplitterRuntimeConfig, } from '../pipeline/RenderPipeline';
|
|
3
|
+
export { RenderPipelineBuilder } from '../pipeline/RenderPipelineBuilder';
|
|
4
|
+
export type { DefaultSegmentSplitterConfig, DefaultLineSplitterConfig, } from '../pipeline/RenderPipelineBuilder';
|
|
5
|
+
export type { PipelineProgressEvent, PipelineProgressListener } from '../pipeline/PipelineProgress';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/pipeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,gCAAgC,GACjC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,YAAY,EACV,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,yCAAyC,CAAC;AACjD,YAAY,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/pipeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAMlE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
type AnyCtor = abstract new (...args: never[]) => unknown;
|
|
2
|
+
export declare class Profiler {
|
|
3
|
+
/**
|
|
4
|
+
* Master switch. While `false`, {@link record} and {@link time} are no-ops
|
|
5
|
+
* (timing source is not even read), so manual `profiler.time(...)` calls
|
|
6
|
+
* can be left in production code at zero cost. The various `wrap` methods
|
|
7
|
+
* flip this to `true` automatically.
|
|
8
|
+
*/
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
/** Sample `performance.memory.usedJSHeapSize` around each call. Chrome-only. */
|
|
11
|
+
measureMemory: boolean;
|
|
12
|
+
private readonly samples;
|
|
13
|
+
private readonly memDeltas;
|
|
14
|
+
private readonly memSamples;
|
|
15
|
+
private readonly originals;
|
|
16
|
+
private readonly warnOverMs;
|
|
17
|
+
private readonly maxSamplesPerLabel;
|
|
18
|
+
constructor(opts?: ProfilerOptions);
|
|
19
|
+
/**
|
|
20
|
+
* Wraps `target` in a `Proxy` that times every method call. The returned
|
|
21
|
+
* value is a stand-in for `target`: pass it where you would have passed
|
|
22
|
+
* the original. The original instance keeps working unchanged.
|
|
23
|
+
*/
|
|
24
|
+
wrap<T extends object>(target: T, opts?: WrapOptions): T;
|
|
25
|
+
/**
|
|
26
|
+
* Replaces every method on `Klass.prototype` with a timed version. All
|
|
27
|
+
* instances — past and future — pick up the instrumentation, because the
|
|
28
|
+
* prototype lookup is dynamic. Use {@link restoreClass} to undo.
|
|
29
|
+
*/
|
|
30
|
+
wrapClass(Klass: AnyCtor, opts?: WrapOptions): void;
|
|
31
|
+
/**
|
|
32
|
+
* Restores a class previously instrumented via {@link wrapClass} to its
|
|
33
|
+
* original prototype methods.
|
|
34
|
+
*/
|
|
35
|
+
restoreClass(Klass: AnyCtor): void;
|
|
36
|
+
/**
|
|
37
|
+
* Wraps every class exported by a module namespace (`import * as M from '...'`).
|
|
38
|
+
* Returns the list of class names that were instrumented, for quick sanity
|
|
39
|
+
* checks. The namespace object itself is not mutated — only the prototypes
|
|
40
|
+
* of the classes it references.
|
|
41
|
+
*/
|
|
42
|
+
wrapNamespace(ns: Record<string, unknown>, opts?: NamespaceWrapOptions): string[];
|
|
43
|
+
/** Times an arbitrary function — sync or async. Escape hatch for non-method code. */
|
|
44
|
+
time<T>(label: string, fn: () => T): T;
|
|
45
|
+
/** Records a manual measurement. Useful for instrumenting points that aren't whole methods. */
|
|
46
|
+
record(label: string, durationMs: number, deltaBytes?: number | null): void;
|
|
47
|
+
/** Builds an aggregated report from the samples collected so far. */
|
|
48
|
+
report(): ProfilerReport;
|
|
49
|
+
/** Pretty-prints the report as a sortable `console.table`. */
|
|
50
|
+
printReport(opts?: PrintOptions): void;
|
|
51
|
+
reset(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the V8 JS heap size in bytes (Chrome only). Note: this is the JS
|
|
54
|
+
* isolate's used heap only — it excludes WebCodecs buffers, decoded bitmap
|
|
55
|
+
* caches, and other native memory held by the renderer process.
|
|
56
|
+
*
|
|
57
|
+
* When the runtime was started with `--js-flags="--expose-gc"`, this forces
|
|
58
|
+
* a synchronous full GC before reading so what's left is the actually-retained
|
|
59
|
+
* portion. Without that flag, returns the heap as-is.
|
|
60
|
+
*/
|
|
61
|
+
snapshotHeap(): number | null;
|
|
62
|
+
private wrapMethod;
|
|
63
|
+
private startMem;
|
|
64
|
+
private endMem;
|
|
65
|
+
}
|
|
66
|
+
export interface ProfilerOptions {
|
|
67
|
+
/** Sample `performance.memory.usedJSHeapSize` around each call. Chrome-only, noisy without `--expose-gc`. */
|
|
68
|
+
measureMemory?: boolean;
|
|
69
|
+
/** Log a console warning when a single call exceeds this duration. */
|
|
70
|
+
warnOverMs?: number;
|
|
71
|
+
/** Keep at most this many duration samples per label, to bound memory of the profiler itself. */
|
|
72
|
+
maxSamplesPerLabel?: number;
|
|
73
|
+
}
|
|
74
|
+
export interface WrapOptions {
|
|
75
|
+
/** Label prefix used in the report. Defaults to the class or constructor name. */
|
|
76
|
+
name?: string;
|
|
77
|
+
/** Only instrument method names matching the regex / predicate. */
|
|
78
|
+
include?: RegExp | ((methodName: string) => boolean);
|
|
79
|
+
/** Skip method names matching the regex / predicate. Evaluated after `include`. */
|
|
80
|
+
exclude?: RegExp | ((methodName: string) => boolean);
|
|
81
|
+
/** Walk the prototype chain past `Klass.prototype` and instrument inherited methods too. */
|
|
82
|
+
includeInherited?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface NamespaceWrapOptions extends WrapOptions {
|
|
85
|
+
/** Restrict which exported names to treat as instrumentable classes. */
|
|
86
|
+
classFilter?: RegExp | ((className: string) => boolean);
|
|
87
|
+
}
|
|
88
|
+
export interface MethodStat {
|
|
89
|
+
label: string;
|
|
90
|
+
count: number;
|
|
91
|
+
totalMs: number;
|
|
92
|
+
meanMs: number;
|
|
93
|
+
minMs: number;
|
|
94
|
+
maxMs: number;
|
|
95
|
+
p50Ms: number;
|
|
96
|
+
p95Ms: number;
|
|
97
|
+
p99Ms: number;
|
|
98
|
+
/** Sum over all calls of (heapAfter - heapBefore). `null` when memory measurement is off or unavailable. */
|
|
99
|
+
totalDeltaBytes: number | null;
|
|
100
|
+
}
|
|
101
|
+
export interface ProfilerReport {
|
|
102
|
+
stats: MethodStat[];
|
|
103
|
+
totalCalls: number;
|
|
104
|
+
totalMs: number;
|
|
105
|
+
}
|
|
106
|
+
export interface PrintOptions {
|
|
107
|
+
/** Column to sort rows by, descending. Defaults to `totalMs`. */
|
|
108
|
+
sortBy?: 'totalMs' | 'meanMs' | 'count' | 'maxMs' | 'p95Ms' | 'p99Ms';
|
|
109
|
+
/** Show only the first N rows after sorting. */
|
|
110
|
+
top?: number;
|
|
111
|
+
}
|
|
112
|
+
/** Default instance — share across modules to aggregate a single report. */
|
|
113
|
+
export declare const profiler: Profiler;
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=Profiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Profiler.d.ts","sourceRoot":"","sources":["../../../src/modules/profiling/Profiler.ts"],"names":[],"mappings":"AAyBA,KAAK,OAAO,GAAG,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC;AAE1D,qBAAa,QAAQ;IACnB;;;;;OAKG;IACH,OAAO,UAAS;IAChB,gFAAgF;IAChF,aAAa,EAAE,OAAO,CAAC;IAEvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IACvD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IACvD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0D;IACpF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;gBAEhC,IAAI,GAAE,eAAoB;IAMtC;;;;OAIG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,GAAE,WAAgB,GAAG,CAAC;IA4B5D;;;;OAIG;IACH,SAAS,CAAC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