@applemusic-like-lyrics/core 0.0.7 → 0.0.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"amll-core.js","sources":["../src/lyric/ttml.ts","../src/bg-render/pixi-renderer.ts","../src/bg-render/index.ts","../src/utils/eq-set.ts","../src/lyric-player/interlude-dots.ts","../src/utils/spring.ts","../src/lyric-player/lyric-line.ts","../src/lyric-player/index.ts"],"sourcesContent":["import { LyricLine, LyricWord } from \"../interfaces\";\n\nconst timeRegexp =\n\t/^(((?<hour>[0-9]+):)?(?<min>[0-9]+):)?(?<sec>[0-9]+([\\.:]([0-9]+))?)/;\nfunction parseTimespan(timeSpan: string): number {\n\tconst matches = timeRegexp.exec(timeSpan);\n\tif (matches) {\n\t\tconst hour = Number(matches.groups?.hour || \"0\");\n\t\tconst min = Number(matches.groups?.min || \"0\");\n\t\tconst sec = Number(matches.groups?.sec.replace(/:/, \".\") || \"0\");\n\t\treturn Math.floor((hour * 3600 + min * 60 + sec) * 1000);\n\t} else {\n\t\tthrow new TypeError(\"时间戳字符串解析失败\");\n\t}\n}\n\nexport function parseTTML(ttmlText: string): LyricLine[] {\n\tconst domParser = new DOMParser();\n\tconst ttmlDoc: XMLDocument = domParser.parseFromString(\n\t\tttmlText,\n\t\t\"application/xml\",\n\t);\n\n\tlet mainAgentId = \"v1\";\n\n\tfor (const agent of ttmlDoc.querySelectorAll(\"ttm\\\\:agent\")) {\n\t\tif (agent.getAttribute(\"type\") === \"person\") {\n\t\t\tconst id = agent.getAttribute(\"xml:id\");\n\t\t\tif (id) {\n\t\t\t\tmainAgentId = id;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst result: LyricLine[] = [];\n\n\tfor (const lineEl of ttmlDoc.querySelectorAll(\"body p[begin][end]\")) {\n\t\tconst line: LyricLine = {\n\t\t\twords: [],\n\t\t\tstartTime: parseTimespan(lineEl.getAttribute(\"begin\") ?? \"0:0\"),\n\t\t\tendTime: parseTimespan(lineEl.getAttribute(\"end\") ?? \"0:0\"),\n\t\t\ttranslatedLyric: \"\",\n\t\t\tromanLyric: \"\",\n\t\t\tisBG: false,\n\t\t\tisDuet: lineEl.getAttribute(\"ttm:agent\") !== mainAgentId,\n\t\t};\n\t\tlet curBGLine: LyricLine | null = null;\n\n\t\tfor (const wordNode of lineEl.childNodes) {\n\t\t\tif (wordNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\tconst word = wordNode.textContent ?? \"\";\n\t\t\t\tif (/^(\\s+)$/.test(word)) {\n\t\t\t\t\tline.words.push({\n\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tline.words.push({\n\t\t\t\t\t\tword: word,\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (wordNode.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\tconst wordEl = wordNode as Element;\n\t\t\t\tconst role = wordEl.getAttribute(\"ttm:role\");\n\n\t\t\t\tif (wordEl.nodeName === \"span\" && role) {\n\t\t\t\t\tif (role === \"x-bg\") {\n\t\t\t\t\t\tconst bgLine: LyricLine = {\n\t\t\t\t\t\t\twords: [],\n\t\t\t\t\t\t\tstartTime: line.startTime,\n\t\t\t\t\t\t\tendTime: line.endTime,\n\t\t\t\t\t\t\ttranslatedLyric: \"\",\n\t\t\t\t\t\t\tromanLyric: \"\",\n\t\t\t\t\t\t\tisBG: true,\n\t\t\t\t\t\t\tisDuet: line.isDuet,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tfor (const wordNode of wordEl.childNodes) {\n\t\t\t\t\t\t\tif (wordNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\t\t\t\t\tconst word = wordNode.textContent ?? \"\";\n\t\t\t\t\t\t\t\tif (/^(\\s+)$/.test(word)) {\n\t\t\t\t\t\t\t\t\tbgLine.words.push({\n\t\t\t\t\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbgLine.words.push({\n\t\t\t\t\t\t\t\t\t\tword: word,\n\t\t\t\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (wordNode.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tconst wordEl = wordNode as Element;\n\t\t\t\t\t\t\t\tconst role = wordEl.getAttribute(\"ttm:role\");\n\t\t\t\t\t\t\t\tif (wordEl.nodeName === \"span\" && role) {\n\t\t\t\t\t\t\t\t\tif (role === \"x-translation\") {\n\t\t\t\t\t\t\t\t\t\tbgLine.translatedLyric = wordEl.innerHTML.trim();\n\t\t\t\t\t\t\t\t\t} else if (role === \"x-roman\") {\n\t\t\t\t\t\t\t\t\t\tbgLine.romanLyric = wordEl.innerHTML.trim();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\twordEl.hasAttribute(\"begin\") &&\n\t\t\t\t\t\t\t\t\twordEl.hasAttribute(\"end\")\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tconst word = {\n\t\t\t\t\t\t\t\t\t\tword: wordNode.textContent,\n\t\t\t\t\t\t\t\t\t\tstartTime: parseTimespan(wordEl.getAttribute(\"begin\")!!),\n\t\t\t\t\t\t\t\t\t\tendTime: parseTimespan(wordEl.getAttribute(\"end\")!!),\n\t\t\t\t\t\t\t\t\t} as LyricWord;\n\t\t\t\t\t\t\t\t\tbgLine.words.push(word);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst firstWord = bgLine.words[0];\n\t\t\t\t\t\tbgLine.startTime = firstWord.startTime;\n\t\t\t\t\t\tif (firstWord?.word.startsWith(\"(\")) {\n\t\t\t\t\t\t\tfirstWord.word = firstWord.word.substring(1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst lastWord = bgLine.words[bgLine.words.length - 1];\n\t\t\t\t\t\tbgLine.endTime = lastWord.endTime;\n\t\t\t\t\t\tif (lastWord?.word.endsWith(\")\")) {\n\t\t\t\t\t\t\tlastWord.word = lastWord.word.substring(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tlastWord.word.length - 1,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurBGLine = bgLine;\n\t\t\t\t\t} else if (role === \"x-translation\") {\n\t\t\t\t\t\tline.translatedLyric = wordEl.innerHTML;\n\t\t\t\t\t} else if (role === \"x-roman\") {\n\t\t\t\t\t\tline.romanLyric = wordEl.innerHTML;\n\t\t\t\t\t}\n\t\t\t\t} else if (wordEl.hasAttribute(\"begin\") && wordEl.hasAttribute(\"end\")) {\n\t\t\t\t\tconst word: LyricWord = {\n\t\t\t\t\t\tword: wordNode.textContent ?? \"\",\n\t\t\t\t\t\tstartTime: parseTimespan(wordEl.getAttribute(\"begin\")!!),\n\t\t\t\t\t\tendTime: parseTimespan(wordEl.getAttribute(\"end\")!!),\n\t\t\t\t\t};\n\t\t\t\t\tline.words.push(word);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tresult.push(line);\n\t\tif (curBGLine) {\n\t\t\t// line.startTime = Math.min(line.startTime, curBGLine.startTime);\n\t\t\t// line.endTime = Math.max(line.endTime, curBGLine.endTime);\n\t\t\t// curBGLine.startTime = line.startTime;\n\t\t\t// curBGLine.endTime = line.endTime;\n\t\t\tresult.push(curBGLine);\n\t\t}\n\t}\n\n\tconsole.log(result);\n\n\treturn result;\n}\n","import { Container } from \"@pixi/display\";\nimport { Application } from \"@pixi/app\";\nimport { BlurFilter } from \"@pixi/filter-blur\";\nimport { ColorMatrixFilter } from \"@pixi/filter-color-matrix\";\nimport { Texture } from \"@pixi/core\";\nimport { Sprite } from \"@pixi/sprite\";\nimport { Disposable } from \"../interfaces\";\n\nclass TimedContainer extends Container {\n\tpublic time = 0;\n}\n\nexport class PixiRenderer implements Disposable {\n\tprivate observer: ResizeObserver;\n\tprivate app: Application;\n\tprivate curContainer?: TimedContainer;\n\tprivate lastContainer: Set<TimedContainer> = new Set();\n\tprivate onTick = (delta: number): void => {\n\t\tfor (const lastContainer of this.lastContainer) {\n\t\t\tlastContainer.alpha = Math.max(0, lastContainer.alpha - delta / 60);\n\t\t\tif (lastContainer.alpha <= 0) {\n\t\t\t\tthis.app.stage.removeChild(lastContainer);\n\t\t\t\tthis.lastContainer.delete(lastContainer);\n\t\t\t}\n\t\t}\n\n\t\tif (this.curContainer) {\n\t\t\tthis.curContainer.alpha = Math.min(\n\t\t\t\t1,\n\t\t\t\tthis.curContainer.alpha + delta / 60,\n\t\t\t);\n\t\t\tconst [s1, s2, s3, s4] = this.curContainer.children as Sprite[];\n\t\t\tconst maxSize = Math.max(this.app.screen.width, this.app.screen.height);\n\t\t\ts1.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts2.position.set(\n\t\t\t\tthis.app.screen.width / 2.5,\n\t\t\t\tthis.app.screen.height / 2.5,\n\t\t\t);\n\t\t\ts3.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts4.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts1.width = maxSize * Math.sqrt(2);\n\t\t\ts1.height = s1.width;\n\t\t\ts2.width = maxSize * 0.8;\n\t\t\ts2.height = s2.width;\n\t\t\ts3.width = maxSize * 0.5;\n\t\t\ts3.height = s3.width;\n\t\t\ts4.width = maxSize * 0.25;\n\t\t\ts4.height = s4.width;\n\n\t\t\tthis.curContainer.time += delta * this.flowSpeed;\n\n\t\t\ts1.rotation += (delta / 1000) * this.flowSpeed;\n\t\t\ts2.rotation -= (delta / 500) * this.flowSpeed;\n\t\t\ts3.rotation += (delta / 1000) * this.flowSpeed;\n\t\t\ts4.rotation -= (delta / 750) * this.flowSpeed;\n\n\t\t\ts3.x =\n\t\t\t\tthis.app.screen.width / 2 +\n\t\t\t\t(this.app.screen.width / 4) *\n\t\t\t\t\tMath.cos((this.curContainer.time / 1000) * 0.75);\n\t\t\ts3.y =\n\t\t\t\tthis.app.screen.height / 2 +\n\t\t\t\t(this.app.screen.width / 4) *\n\t\t\t\t\tMath.cos((this.curContainer.time / 1000) * 0.75);\n\n\t\t\ts4.x =\n\t\t\t\tthis.app.screen.width / 2 +\n\t\t\t\t(this.app.screen.width / 4) * 0.1 +\n\t\t\t\tMath.cos(this.curContainer.time * 0.006 * 0.75);\n\t\t\ts4.y =\n\t\t\t\tthis.app.screen.height / 2 +\n\t\t\t\t(this.app.screen.width / 4) * 0.1 +\n\t\t\t\tMath.cos(this.curContainer.time * 0.006 * 0.75);\n\t\t}\n\t};\n\tprivate flowSpeed = 2;\n\tprivate currerntRenderScale = 0.75;\n\tconstructor(private canvas: HTMLCanvasElement) {\n\t\tconst bounds = canvas.getBoundingClientRect();\n\t\tthis.canvas.width = bounds.width * this.currerntRenderScale;\n\t\tthis.canvas.height = bounds.height * this.currerntRenderScale;\n\t\tthis.observer = new ResizeObserver(() => {\n\t\t\tconst bounds = canvas.getBoundingClientRect();\n\t\t\tthis.canvas.width = Math.max(1, bounds.width);\n\t\t\tthis.canvas.height = Math.max(1, bounds.height);\n\t\t\tthis.app.renderer.resize(\n\t\t\t\tthis.canvas.width * this.currerntRenderScale,\n\t\t\t\tthis.canvas.height * this.currerntRenderScale,\n\t\t\t);\n\t\t\tthis.rebuildFilters();\n\t\t});\n\t\tthis.observer.observe(canvas);\n\t\tthis.app = new Application({\n\t\t\tview: canvas,\n\t\t\tresizeTo: this.canvas,\n\t\t\tpowerPreference: \"low-power\",\n\t\t\tbackgroundAlpha: 0,\n\t\t});\n\t\tthis.rebuildFilters();\n\t\tthis.app.ticker.add(this.onTick);\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 修改背景的流动速度,数字越大越快,默认为 2\n\t * @param speed 背景的流动速度,默认为 2\n\t */\n\tsetFlowSpeed(speed: number) {\n\t\tthis.flowSpeed = speed;\n\t}\n\t/**\n\t * 修改背景的渲染比例,默认是 0.5\n\t *\n\t * 一般情况下这个程度既没有明显瑕疵也不会特别吃性能\n\t * @param scale 背景的渲染比例\n\t */\n\tsetRenderScale(scale: number) {\n\t\tthis.currerntRenderScale = scale;\n\t\tconst bounds = this.canvas.getBoundingClientRect();\n\t\tthis.canvas.width = Math.max(1, bounds.width);\n\t\tthis.canvas.height = Math.max(1, bounds.height);\n\t\tthis.app.renderer.resize(\n\t\t\tthis.canvas.width * this.currerntRenderScale,\n\t\t\tthis.canvas.height * this.currerntRenderScale,\n\t\t);\n\t\tthis.rebuildFilters();\n\t}\n\tprivate rebuildFilters() {\n\t\tconst minBorder = Math.min(this.canvas.width, this.canvas.height);\n\t\tconst c0 = new ColorMatrixFilter();\n\t\tc0.saturate(1.2, false);\n\t\tconst c1 = new ColorMatrixFilter();\n\t\tc1.brightness(0.6, false);\n\t\tconst c2 = new ColorMatrixFilter();\n\t\tc2.contrast(0.3, true);\n\t\tthis.app.stage.filters = [];\n\t\tthis.app.stage.filters.push(new BlurFilter(5, 1));\n\t\tthis.app.stage.filters.push(new BlurFilter(10, 1));\n\t\tthis.app.stage.filters.push(new BlurFilter(20, 2));\n\t\tthis.app.stage.filters.push(new BlurFilter(40, 2));\n\t\tif (minBorder > 512) this.app.stage.filters.push(new BlurFilter(80, 2));\n\t\tif (minBorder > 768) this.app.stage.filters.push(new BlurFilter(160, 4));\n\t\tif (minBorder > 768 * 2)\n\t\t\tthis.app.stage.filters.push(new BlurFilter(320, 4));\n\n\t\tthis.app.stage.filters.push(c0, c1, c2);\n\t\tthis.app.stage.filters.push(new BlurFilter(5, 1));\n\t}\n\t/**\n\t * 修改背景动画帧率,默认是 30 FPS\n\t *\n\t * 如果设置成 0 则会停止动画\n\t * @param fps 目标帧率,默认 30 FPS\n\t */\n\tsetFPS(fps: number) {\n\t\tthis.app.ticker.maxFPS = fps;\n\t}\n\t/**\n\t * 暂停背景动画,画面即便是更新了图片也不会发生变化\n\t */\n\tpause() {\n\t\tthis.app.ticker.stop();\n\t\tthis.app.render();\n\t}\n\t/**\n\t * 恢复播放背景动画\n\t */\n\tresume() {\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 设置背景专辑图片,图片材质加载并设置完成后会返回\n\t * @param albumUrl 图片的目标链接\n\t */\n\tasync setAlbumImage(albumUrl: string) {\n\t\tconst tex = await Texture.fromURL(albumUrl);\n\t\tconst container = new TimedContainer();\n\t\tconst s1 = new Sprite(tex);\n\t\tconst s2 = new Sprite(tex);\n\t\tconst s3 = new Sprite(tex);\n\t\tconst s4 = new Sprite(tex);\n\t\ts1.anchor.set(0.5, 0.5);\n\t\ts2.anchor.set(0.5, 0.5);\n\t\ts3.anchor.set(0.5, 0.5);\n\t\ts4.anchor.set(0.5, 0.5);\n\t\ts1.rotation = Math.random() * Math.PI * 2;\n\t\ts2.rotation = Math.random() * Math.PI * 2;\n\t\ts3.rotation = Math.random() * Math.PI * 2;\n\t\ts4.rotation = Math.random() * Math.PI * 2;\n\t\tcontainer.addChild(s1, s2, s3, s4);\n\t\tif (this.curContainer) this.lastContainer.add(this.curContainer);\n\t\tthis.curContainer = container;\n\t\tthis.app.stage.addChild(this.curContainer);\n\t\tthis.curContainer.alpha = 0;\n\t}\n\n\tdispose() {\n\t\tthis.observer.disconnect();\n\t\tthis.app.ticker.remove(this.onTick);\n\t}\n}\n","/**\n * @fileoverview\n * 一个播放歌词的组件\n * @author SteveXMH\n */\n\nimport type { HasElement, Disposable } from \"../interfaces\";\nimport { PixiRenderer } from \"./pixi-renderer\";\n\nexport class BackgroundRender\n\textends PixiRenderer\n\timplements HasElement, Disposable\n{\n\tprivate element: HTMLCanvasElement;\n\tconstructor() {\n\t\tconst canvas = document.createElement(\"canvas\");\n\t\tsuper(canvas);\n\t\tthis.element = canvas;\n\t\tcanvas.style.pointerEvents = \"none\";\n\t\tcanvas.style.zIndex = \"-1\";\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tdispose() {\n\t\tsuper.dispose();\n\t\tthis.element.remove();\n\t}\n}\n","export const eqSet: <T>(xs: Set<T>, ys: Set<T>) => boolean = (\n\txs,\n\tys,\n): boolean => xs.size === ys.size && [...xs].every((x) => ys.has(x));\n","import { LyricPlayer } from \".\";\nimport type { Disposable, HasElement } from \"../interfaces\";\n\nfunction easeInOutBack(x: number): number {\n\tconst c1 = 1.70158;\n\tconst c2 = c1 * 1.525;\n\n\treturn x < 0.5\n\t\t? (Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2)) / 2\n\t\t: (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2;\n}\n\nconst clamp = (min: number, cur: number, max: number) =>\n\tMath.max(min, Math.min(cur, max));\n\nexport class InterludeDots implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate dot0: HTMLElement = document.createElement(\"span\");\n\tprivate dot1: HTMLElement = document.createElement(\"span\");\n\tprivate dot2: HTMLElement = document.createElement(\"span\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate scale = 1;\n\tprivate lastStyle = \"\";\n\tprivate currentInterlude?: [number, number];\n\tprivate currentTime = 0;\n\tprivate targetBreatheDuration = 1500;\n\tconstructor(private readonly lyricPlayer: LyricPlayer) {\n\t\tthis.element.className = this.lyricPlayer.style.classes.interludeDots;\n\t\tthis.element.appendChild(this.dot0);\n\t\tthis.element.appendChild(this.dot1);\n\t\tthis.element.appendChild(this.dot2);\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(left: number = this.left, top: number = this.top) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.update();\n\t}\n\tsetInterlude(interlude?: [number, number]) {\n\t\tthis.currentInterlude = interlude;\n\t\tthis.currentTime = interlude?.[0] ?? 0;\n\t}\n\tupdate(delta = 0) {\n\t\tthis.currentTime += delta;\n\t\tlet curStyle = \"\";\n\n\t\tcurStyle += `transform:translate(${this.left}px, ${this.top}px)`;\n\n\t\t// 计算缩放大小\n\n\t\tif (this.currentInterlude) {\n\t\t\tconst interludeDuration =\n\t\t\t\tthis.currentInterlude[1] - this.currentInterlude[0];\n\t\t\tconst currentDuration = this.currentTime - this.currentInterlude[0];\n\t\t\tif (currentDuration <= interludeDuration) {\n\t\t\t\tconst breatheDuration =\n\t\t\t\t\tinterludeDuration /\n\t\t\t\t\tMath.ceil(interludeDuration / this.targetBreatheDuration);\n\t\t\t\tlet scale = 1;\n\t\t\t\tlet globalOpacity = 1;\n\n\t\t\t\tscale *=\n\t\t\t\t\tMath.sin(1.5 * Math.PI - (currentDuration / breatheDuration) * 2) /\n\t\t\t\t\t\t10 +\n\t\t\t\t\t1;\n\n\t\t\t\tif (currentDuration < 1000) {\n\t\t\t\t\tscale *= 1 - Math.pow((1000 - currentDuration) / 1000, 2);\n\t\t\t\t}\n\n\t\t\t\tif (currentDuration < 500) {\n\t\t\t\t\tglobalOpacity = 0;\n\t\t\t\t} else if (currentDuration < 1000) {\n\t\t\t\t\tglobalOpacity *= (currentDuration - 500) / 500;\n\t\t\t\t}\n\n\t\t\t\tif (interludeDuration - currentDuration < 750) {\n\t\t\t\t\tscale *=\n\t\t\t\t\t\t1 -\n\t\t\t\t\t\teaseInOutBack(\n\t\t\t\t\t\t\t(750 - (interludeDuration - currentDuration)) / 750 / 2,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (interludeDuration - currentDuration < 375) {\n\t\t\t\t\tglobalOpacity *= clamp(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t(interludeDuration - currentDuration) / 375,\n\t\t\t\t\t\t1,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tscale = Math.max(0, scale);\n\n\t\t\t\tcurStyle += ` scale(${scale})`;\n\n\t\t\t\tconst dot0Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t((currentDuration * 3) / interludeDuration) * 0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\t\t\t\tconst dot1Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t(((currentDuration - interludeDuration / 3) * 3) /\n\t\t\t\t\t\tinterludeDuration) *\n\t\t\t\t\t\t0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\t\t\t\tconst dot2Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t(((currentDuration - (interludeDuration / 3) * 2) * 3) /\n\t\t\t\t\t\tinterludeDuration) *\n\t\t\t\t\t\t0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\n\t\t\t\tthis.dot0.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot0Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t\tthis.dot1.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot1Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t\tthis.dot2.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot2Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t} else {\n\t\t\t\tcurStyle += \" scale(0)\";\n\t\t\t\tthis.dot0.style.opacity = \"0\";\n\t\t\t\tthis.dot1.style.opacity = \"0\";\n\t\t\t\tthis.dot2.style.opacity = \"0\";\n\t\t\t}\n\t\t} else {\n\t\t\tcurStyle += \" scale(0)\";\n\t\t\tthis.dot0.style.opacity = \"0\";\n\t\t\tthis.dot1.style.opacity = \"0\";\n\t\t\tthis.dot2.style.opacity = \"0\";\n\t\t}\n\n\t\tcurStyle += \";\";\n\n\t\tif (this.lastStyle !== curStyle) {\n\t\t\tthis.element.setAttribute(\"style\", curStyle);\n\t\t\tthis.lastStyle = curStyle;\n\t\t}\n\t}\n\tdispose() {\n\t\tthis.element.remove();\n\t}\n}\n","/** MIT License github.com/pushkine/ */\nexport interface SpringParams {\n\tmass: number; // = 1.0\n\tdamping: number; // = 10.0\n\tstiffness: number; // = 100.0\n\tsoft: boolean; // = false\n}\n\ntype seconds = number;\n\nexport class Spring {\n\tprivate currentPosition = 0;\n\tprivate targetPosition = 0;\n\tprivate currentTime = 0;\n\tprivate params: Partial<SpringParams> = {};\n\tprivate currentSolver: (t: seconds) => number;\n\tprivate getV: (t: seconds) => number;\n\tprivate queueParams:\n\t\t| (Partial<SpringParams> & {\n\t\t\t\ttime: number;\n\t\t })\n\t\t| undefined;\n\tprivate queuePosition:\n\t\t| {\n\t\t\t\ttime: number;\n\t\t\t\tposition: number;\n\t\t }\n\t\t| undefined;\n\tconstructor(currentPosition = 0) {\n\t\tthis.targetPosition = currentPosition;\n\t\tthis.currentPosition = this.targetPosition;\n\t\tthis.currentSolver = () => this.targetPosition;\n\t\tthis.getV = () => 0;\n\t}\n\tprivate resetSolver() {\n\t\tconst curV = this.getV(this.currentTime);\n\t\tthis.currentTime = 0;\n\t\tthis.currentSolver = solveSpring(\n\t\t\tthis.currentPosition,\n\t\t\tcurV,\n\t\t\tthis.targetPosition,\n\t\t\t0,\n\t\t\tthis.params,\n\t\t);\n\t\tthis.getV = getVelocity(this.currentSolver);\n\t}\n\tarrived() {\n\t\treturn (\n\t\t\tMath.abs(this.targetPosition - this.currentPosition) < 0.01 &&\n\t\t\tthis.getV(this.currentTime) < 0.01 &&\n\t\t\tthis.queueParams === undefined &&\n\t\t\tthis.queuePosition === undefined\n\t\t);\n\t}\n\tsetPosition(targetPosition: number) {\n\t\tthis.targetPosition = targetPosition;\n\t\tthis.currentPosition = targetPosition;\n\t\tthis.currentSolver = () => this.targetPosition;\n\t\tthis.getV = () => 0;\n\t}\n\tupdate(delta = 0) {\n\t\tthis.currentTime += delta;\n\t\tthis.currentPosition = this.currentSolver(this.currentTime);\n\t\tif (this.queueParams) {\n\t\t\tthis.queueParams.time -= delta;\n\t\t\tif (this.queueParams.time <= 0) {\n\t\t\t\tthis.updateParams({\n\t\t\t\t\t...this.queueParams,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.queuePosition) {\n\t\t\tthis.queuePosition.time -= delta;\n\t\t\tif (this.queuePosition.time <= 0) {\n\t\t\t\tthis.setTargetPosition(this.queuePosition.position);\n\t\t\t}\n\t\t}\n\t\tif (this.arrived()) {\n\t\t\tthis.setPosition(this.targetPosition);\n\t\t}\n\t}\n\tupdateParams(params: Partial<SpringParams>, delay = 0) {\n\t\tif (delay > 0) {\n\t\t\tthis.queueParams = {\n\t\t\t\t...params,\n\t\t\t\ttime: delay,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.params = {\n\t\t\t\t...this.params,\n\t\t\t\t...params,\n\t\t\t};\n\t\t\tthis.resetSolver();\n\t\t}\n\t}\n\tsetTargetPosition(targetPosition: number, delay = 0) {\n\t\tif (delay > 0) {\n\t\t\tthis.queuePosition = {\n\t\t\t\tposition: targetPosition,\n\t\t\t\ttime: delay,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.queuePosition = undefined;\n\t\t\tthis.targetPosition = targetPosition;\n\t\t\tthis.resetSolver();\n\t\t}\n\t}\n\tgetCurrentPosition() {\n\t\treturn this.currentPosition;\n\t}\n}\n\nfunction solveSpring(\n\tfrom: number,\n\tvelocity: number,\n\tto: number,\n\tdelay: seconds = 0,\n\tparams?: Partial<SpringParams>,\n): (t: seconds) => number {\n\tconst soft = params?.soft ?? false;\n\tconst stiffness = params?.stiffness ?? 100;\n\tconst damping = params?.damping ?? 10;\n\tconst mass = params?.mass ?? 1;\n\tconst delta = to - from;\n\tif (soft || 1.0 <= damping / (2.0 * Math.sqrt(stiffness * mass))) {\n\t\tconst angular_frequency = -Math.sqrt(stiffness / mass);\n\t\tconst leftover = -angular_frequency * delta - velocity;\n\t\treturn (t: seconds) => {\n\t\t\tt -= delay;\n\t\t\tif (t < 0) return from;\n\t\t\treturn to - (delta + t * leftover) * Math.E ** (t * angular_frequency);\n\t\t};\n\t} else {\n\t\tconst damping_frequency = Math.sqrt(\n\t\t\t4.0 * mass * stiffness - damping ** 2.0,\n\t\t);\n\t\tconst leftover =\n\t\t\t(damping * delta - 2.0 * mass * velocity) / damping_frequency;\n\t\tconst dfm = (0.5 * damping_frequency) / mass;\n\t\tconst dm = -(0.5 * damping) / mass;\n\t\treturn (t: seconds) => {\n\t\t\tt -= delay;\n\t\t\tif (t < 0) return from;\n\t\t\treturn (\n\t\t\t\tto -\n\t\t\t\t(Math.cos(t * dfm) * delta + Math.sin(t * dfm) * leftover) *\n\t\t\t\t\tMath.E ** (t * dm)\n\t\t\t);\n\t\t};\n\t}\n}\n\nfunction derivative(f: (x: number) => number) {\n\tconst h = 0.001;\n\treturn (x: number) => (f(x + h) - f(x - h)) / (2 * h);\n}\n\nfunction getVelocity(f: (t: seconds) => number): (t: seconds) => number {\n\treturn derivative(f);\n}\n","import { LyricPlayer } from \".\";\nimport { Disposable, HasElement, LyricLine, LyricWord } from \"../interfaces\";\nimport { Spring } from \"../utils/spring\";\n\nconst CJKEXP = /^[\\p{Unified_Ideograph}\\u0800-\\u9FFC]+$/u;\n\ninterface RealWord extends LyricWord {\n\telements: HTMLSpanElement[];\n\telementAnimations: Animation[];\n\twidth: number;\n\theight: number;\n\tshouldEmphasize: boolean;\n}\n\nfunction generateFadeGradient(\n\twidth: number,\n\tbright = \"rgba(0,0,0,1)\",\n\tdark = \"rgba(0,0,0,0.5)\",\n): [string, number, number] {\n\tconst totalAspect = 2 + width;\n\tconst widthInTotal = width / totalAspect;\n\tconst leftPos = (1 - widthInTotal) / 2;\n\treturn [\n\t\t`linear-gradient(to right,${bright} ${leftPos * 100}%,${dark} ${\n\t\t\t(leftPos + widthInTotal) * 100\n\t\t}%)`,\n\t\twidthInTotal,\n\t\ttotalAspect,\n\t];\n}\n\n// 果子在对辉光效果的解释是一种强调(emphasized)效果\n// 条件是一个单词时长大于等于 1s 且长度小于等于 7\nexport function shouldEmphasize(word: LyricWord): boolean {\n\treturn word.endTime - word.startTime >= 1000 && word.word.length <= 7;\n}\n\nexport class LyricLineEl implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate scale = 1;\n\tprivate blur = 0;\n\tprivate delay = 0;\n\tprivate splittedWords: RealWord[] = [];\n\t// 由 LyricPlayer 来设置\n\tlineSize: number[] = [0, 0];\n\treadonly lineTransforms = {\n\t\tposX: new Spring(0),\n\t\tposY: new Spring(0),\n\t\tscale: new Spring(1),\n\t};\n\tconstructor(\n\t\tprivate lyricPlayer: LyricPlayer,\n\t\tprivate lyricLine: LyricLine = {\n\t\t\twords: [],\n\t\t\ttranslatedLyric: \"\",\n\t\t\tromanLyric: \"\",\n\t\t\tstartTime: 0,\n\t\t\tendTime: 0,\n\t\t\tisBG: false,\n\t\t\tisDuet: false,\n\t\t},\n\t) {\n\t\tthis.element.setAttribute(\n\t\t\t\"class\",\n\t\t\tthis.lyricPlayer.style.classes.lyricLine,\n\t\t);\n\t\tif (this.lyricLine.isBG) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t}\n\t\tif (this.lyricLine.isDuet) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine);\n\t\t}\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 歌词行\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 翻译行\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 音译行\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tconst trans = this.element.children[1] as HTMLDivElement;\n\t\tconst roman = this.element.children[2] as HTMLDivElement;\n\t\tmain.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricMainLine);\n\t\ttrans.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricSubLine);\n\t\troman.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricSubLine);\n\t\tthis.rebuildElement();\n\t\tthis.rebuildStyle();\n\t}\n\tprivate isEnabled = false;\n\tenable() {\n\t\tthis.isEnabled = true;\n\t\tthis.element.classList.add(\"active\");\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tword.elementAnimations.forEach((a) => {\n\t\t\t\ta.currentTime = 0;\n\t\t\t\ta.playbackRate = 1;\n\t\t\t\ta.play();\n\t\t\t});\n\t\t});\n\t\tmain.classList.add(\"active\");\n\t}\n\tmeasureSize(): [number, number] {\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"\";\n\t\t\tthis.element.style.visibility = \"hidden\";\n\t\t}\n\t\tconst size: [number, number] = [\n\t\t\tthis.element.clientWidth,\n\t\t\tthis.element.clientHeight,\n\t\t];\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"none\";\n\t\t\tthis.element.style.visibility = \"\";\n\t\t}\n\t\treturn size;\n\t}\n\tdisable() {\n\t\tthis.isEnabled = false;\n\t\tthis.element.classList.remove(\"active\");\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tword.elementAnimations.forEach((a) => {\n\t\t\t\tif (a.id === \"float-word\") {\n\t\t\t\t\ta.playbackRate = -1;\n\t\t\t\t\ta.play();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tmain.classList.remove(\"active\");\n\t}\n\tsetLine(line: LyricLine) {\n\t\tthis.lyricLine = line;\n\t\tif (this.lyricLine.isBG) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t} else {\n\t\t\tthis.element.classList.remove(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t}\n\t\tif (this.lyricLine.isDuet) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine);\n\t\t} else {\n\t\t\tthis.element.classList.remove(\n\t\t\t\tthis.lyricPlayer.style.classes.lyricDuetLine,\n\t\t\t);\n\t\t}\n\t\tthis.rebuildElement();\n\t\tthis.rebuildStyle();\n\t}\n\tgetLine() {\n\t\treturn this.lyricLine;\n\t}\n\tprivate _hide = true;\n\tprivate lastStyle = \"\";\n\tshow() {\n\t\tthis._hide = false;\n\t\tthis.rebuildStyle();\n\t}\n\thide() {\n\t\tthis._hide = true;\n\t\tthis.rebuildStyle();\n\t}\n\trebuildStyle() {\n\t\tif (this._hide) {\n\t\t\tif (this.lastStyle !== \"display:none;transform:translate(0,-10000px);\") {\n\t\t\t\tthis.lastStyle = \"display:none;transform:translate(0,-10000px);\";\n\t\t\t\tthis.element.setAttribute(\n\t\t\t\t\t\"style\",\n\t\t\t\t\t\"display:none;transform:translate(0,-10000px);\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet style = `transform:translate(${this.lineTransforms.posX.getCurrentPosition()}px,${this.lineTransforms.posY.getCurrentPosition()}px) scale(${this.lineTransforms.scale.getCurrentPosition()});`;\n\t\tif (!this.lyricPlayer.getEnableSpring() && this.isInSight) {\n\t\t\tstyle += `transition-delay:${this.delay}ms;`;\n\t\t}\n\t\tstyle += `filter:blur(${Math.min(32, this.blur)}px);`;\n\t\tif (style !== this.lastStyle) {\n\t\t\tthis.lastStyle = style;\n\t\t\tthis.element.setAttribute(\"style\", style);\n\t\t}\n\t}\n\trebuildElement() {\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tconst trans = this.element.children[1] as HTMLDivElement;\n\t\tconst roman = this.element.children[2] as HTMLDivElement;\n\t\tthis.splittedWords = [];\n\t\tthis.lyricLine.words.forEach((word) => {\n\t\t\tif (CJKEXP.test(word.word)) {\n\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t...word,\n\t\t\t\t\twidth: 0,\n\t\t\t\t\theight: 0,\n\t\t\t\t\telements: [],\n\t\t\t\t\telementAnimations: [],\n\t\t\t\t\tshouldEmphasize: shouldEmphasize(word),\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst splited = /^(\\s*)(\\S*)(\\s*)$/.exec(word.word);\n\t\t\t\tif (splited) {\n\t\t\t\t\tif (splited[1].length > 0) {\n\t\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\t\telements: [],\n\t\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\t\tshouldEmphasize: false,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\tword: splited[2],\n\t\t\t\t\t\tstartTime: word.startTime,\n\t\t\t\t\t\tendTime: word.endTime,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\telements: [],\n\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\tshouldEmphasize: shouldEmphasize(word),\n\t\t\t\t\t});\n\t\t\t\t\tif (splited[3].length > 0) {\n\t\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\t\telements: [],\n\t\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\t\tshouldEmphasize: false,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else if (word.word.trim().length > 0) {\n\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\tword: word.word.trim(),\n\t\t\t\t\t\tstartTime: word.startTime,\n\t\t\t\t\t\tendTime: word.endTime,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\telements: [],\n\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\tshouldEmphasize: shouldEmphasize(word),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t// 回收元素以复用\n\t\tconst reusableElements: HTMLElement[] = [];\n\t\tconst reusableTextNodes: Text[] = [];\n\t\tfunction collectNodes(curNode: Node) {\n\t\t\twhile (curNode.firstChild) {\n\t\t\t\tif (curNode.firstChild.nodeType === Node.ELEMENT_NODE)\n\t\t\t\t\treusableElements.push(main.firstChild as HTMLElement);\n\t\t\t\telse if (curNode.firstChild.nodeType === Node.TEXT_NODE)\n\t\t\t\t\treusableTextNodes.push(main.firstChild as Text);\n\t\t\t\tcurNode.removeChild(curNode.firstChild);\n\t\t\t\tcollectNodes(curNode.firstChild);\n\t\t\t}\n\t\t}\n\t\tcollectNodes(main);\n\t\tlet lastWordEl: HTMLSpanElement | null = null;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tif (word.word.trim().length > 0) {\n\t\t\t\tif (word.shouldEmphasize) {\n\t\t\t\t\tconst wordEl =\n\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\twordEl.className = \"emphasize\";\n\t\t\t\t\tword.elements = [wordEl];\n\t\t\t\t\tfor (const c of word.word) {\n\t\t\t\t\t\tconst charEl =\n\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\tcharEl.className = \"\";\n\t\t\t\t\t\tcharEl.innerText = c;\n\t\t\t\t\t\twordEl.appendChild(charEl);\n\t\t\t\t\t\tword.elements.push(charEl);\n\t\t\t\t\t}\n\t\t\t\t\tword.elementAnimations = this.initEmphasizeAnimation(word);\n\t\t\t\t\tconsole.log(word.word, CJKEXP.test(word.word));\n\t\t\t\t\tif (lastWordEl && !CJKEXP.test(word.word)) {\n\t\t\t\t\t\tif (lastWordEl.childElementCount > 0) {\n\t\t\t\t\t\t\tlastWordEl.appendChild(wordEl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst wholeWordEl =\n\t\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\t\twholeWordEl.className = \"\";\n\t\t\t\t\t\t\tlastWordEl.remove();\n\t\t\t\t\t\t\twholeWordEl.appendChild(lastWordEl);\n\t\t\t\t\t\t\twholeWordEl.appendChild(wordEl);\n\t\t\t\t\t\t\tmain.appendChild(wholeWordEl);\n\t\t\t\t\t\t\tlastWordEl = wholeWordEl;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastWordEl = CJKEXP.test(word.word) ? null : wordEl;\n\t\t\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst wordEl =\n\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\twordEl.className = \"\";\n\t\t\t\t\twordEl.innerText = word.word;\n\t\t\t\t\tword.elements = [wordEl];\n\t\t\t\t\tword.elementAnimations.push(this.initFloatAnimation(word, wordEl));\n\t\t\t\t\tif (lastWordEl) {\n\t\t\t\t\t\tif (lastWordEl.childElementCount > 0) {\n\t\t\t\t\t\t\tlastWordEl.appendChild(wordEl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst wholeWordEl =\n\t\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\t\twholeWordEl.className = \"\";\n\t\t\t\t\t\t\tlastWordEl.remove();\n\t\t\t\t\t\t\twholeWordEl.appendChild(lastWordEl);\n\t\t\t\t\t\t\twholeWordEl.appendChild(wordEl);\n\t\t\t\t\t\t\tmain.appendChild(wholeWordEl);\n\t\t\t\t\t\t\tlastWordEl = wholeWordEl;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastWordEl = wordEl;\n\t\t\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (word.word.length > 0) {\n\t\t\t\tconst wordEl = reusableTextNodes.pop() ?? document.createTextNode(\" \");\n\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\tlastWordEl = null;\n\t\t\t} else {\n\t\t\t\tlastWordEl = null;\n\t\t\t}\n\t\t});\n\t\ttrans.innerText = this.lyricLine.translatedLyric;\n\t\troman.innerText = this.lyricLine.romanLyric;\n\t}\n\tprivate initFloatAnimation(word: LyricWord, wordEl: HTMLSpanElement) {\n\t\tconst a = wordEl.animate(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttransform: \"translateY(0px)\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttransform: \"translateY(-3%)\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: Math.max(1000, word.endTime - word.startTime),\n\t\t\t\tdelay: word.startTime - this.lyricLine.startTime,\n\t\t\t\tid: \"float-word\",\n\t\t\t\tcomposite: \"add\",\n\t\t\t\tfill: \"both\",\n\t\t\t},\n\t\t);\n\t\ta.pause();\n\t\treturn a;\n\t}\n\tprivate initEmphasizeAnimation(word: RealWord): Animation[] {\n\t\tconst delay = word.startTime - this.lyricLine.startTime;\n\t\tconst duration = word.endTime - word.startTime;\n\t\treturn word.elements.map((el, i, arr) => {\n\t\t\tif (i === 0) {\n\t\t\t\treturn this.initFloatAnimation(word, el);\n\t\t\t} else {\n\t\t\t\tconst a = el.animate(\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, 0px, 0px)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0 var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 0.5,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, -2%, 20px)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0.2rem var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 1,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, 0px, 0)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0 var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tduration: Math.max(1000, word.endTime - word.startTime),\n\t\t\t\t\t\tdelay: delay + (duration / (arr.length - 1)) * (i - 1),\n\t\t\t\t\t\tid: \"glow-word\",\n\t\t\t\t\t\titerations: 1,\n\t\t\t\t\t\tcomposite: \"replace\",\n\t\t\t\t\t\tfill: \"both\",\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\ta.pause();\n\t\t\t\treturn a;\n\t\t\t}\n\t\t});\n\t}\n\tupdateMaskImage() {\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"\";\n\t\t\tthis.element.style.visibility = \"hidden\";\n\t\t}\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tconst wordEl = word.elements[0];\n\t\t\tif (wordEl) {\n\t\t\t\tword.width = wordEl.clientWidth;\n\t\t\t\tword.height = wordEl.clientHeight;\n\t\t\t\tconst [maskImage, _widthInTotal, totalAspect] = generateFadeGradient(\n\t\t\t\t\t16 / word.width,\n\t\t\t\t\t\"rgba(0,0,0,0.75)\",\n\t\t\t\t\t\"rgba(0,0,0,0.25)\",\n\t\t\t\t);\n\t\t\t\tconst totalAspectStr = `${totalAspect * 100}% 100%`;\n\t\t\t\tif (this.lyricPlayer.supportMaskImage) {\n\t\t\t\t\twordEl.style.maskImage = maskImage;\n\t\t\t\t\twordEl.style.maskOrigin = \"left\";\n\t\t\t\t\twordEl.style.maskSize = totalAspectStr;\n\t\t\t\t} else {\n\t\t\t\t\twordEl.style.webkitMaskImage = maskImage;\n\t\t\t\t\twordEl.style.webkitMaskOrigin = \"left\";\n\t\t\t\t\twordEl.style.webkitMaskSize = totalAspectStr;\n\t\t\t\t}\n\t\t\t\tconst w = word.width + 16;\n\t\t\t\tconst maskPos = `clamp(${-w}px,calc(${-w}px + (var(--amll-player-time) - ${\n\t\t\t\t\tword.startTime\n\t\t\t\t})*${\n\t\t\t\t\tw / Math.abs(word.endTime - word.startTime)\n\t\t\t\t}px),0px) 0px, left top`;\n\t\t\t\t// const maskPos = `clamp(0px,${w}px,${w}px) 0px, left top`;\n\t\t\t\twordEl.style.maskPosition = maskPos;\n\t\t\t\twordEl.style.webkitMaskPosition = maskPos;\n\t\t\t}\n\t\t});\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"none\";\n\t\t\tthis.element.style.visibility = \"\";\n\t\t}\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(\n\t\tleft: number = this.left,\n\t\ttop: number = this.top,\n\t\tscale: number = this.scale,\n\t\topacity = 1,\n\t\tblur = 0,\n\t\tforce = false,\n\t\tdelay = 0,\n\t) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.scale = scale;\n\t\tthis.delay = (delay * 1000) | 0;\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tmain.style.opacity = `${opacity}`;\n\t\tif (force || !this.lyricPlayer.getEnableSpring()) {\n\t\t\tthis.blur = Math.min(32, blur);\n\t\t\tif (force)\n\t\t\t\tthis.element.classList.add(\n\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t);\n\t\t\tthis.lineTransforms.posX.setPosition(left);\n\t\t\tthis.lineTransforms.posY.setPosition(top);\n\t\t\tthis.lineTransforms.scale.setPosition(scale);\n\t\t\tif (!this.lyricPlayer.getEnableSpring()) this.show();\n\t\t\telse this.rebuildStyle();\n\t\t\tif (force)\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tthis.element.classList.remove(\n\t\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t} else {\n\t\t\tthis.lineTransforms.posX.setTargetPosition(left, delay);\n\t\t\tthis.lineTransforms.posY.setTargetPosition(top, delay);\n\t\t\tthis.lineTransforms.scale.setTargetPosition(scale);\n\t\t\tif (this.blur !== Math.min(32, blur)) {\n\t\t\t\tthis.blur = Math.min(32, blur);\n\t\t\t\tthis.element.style.filter = `blur(${Math.min(32, blur)}px)`;\n\t\t\t}\n\t\t}\n\t}\n\tupdate(delta = 0) {\n\t\tif (!this.lyricPlayer.getEnableSpring()) return;\n\t\tthis.lineTransforms.posX.update(delta);\n\t\tthis.lineTransforms.posY.update(delta);\n\t\tthis.lineTransforms.scale.update(delta);\n\t\tif (this.isInSight) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tget isInSight() {\n\t\tconst l = this.lineTransforms.posX.getCurrentPosition();\n\t\tconst t = this.lineTransforms.posY.getCurrentPosition();\n\t\tconst r = l + this.lineSize[0];\n\t\tconst b = t + this.lineSize[1];\n\t\tconst pl = this.lyricPlayer.pos[0];\n\t\tconst pt = this.lyricPlayer.pos[1];\n\t\tconst pr = this.lyricPlayer.pos[0] + this.lyricPlayer.size[0];\n\t\tconst pb = this.lyricPlayer.pos[1] + this.lyricPlayer.size[1];\n\t\treturn !(l > pr || t > pb || r < pl || b < pt);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t}\n}\n","/**\n * @fileoverview\n * 一个播放歌词的组件\n * @author SteveXMH\n */\n\nimport type { Disposable, HasElement, LyricLine } from \"../interfaces\";\nimport { eqSet } from \"../utils/eq-set\";\nimport { SpringParams } from \"../utils/spring\";\nimport { InterludeDots } from \"./interlude-dots\";\nimport { LyricLineEl, shouldEmphasize } from \"./lyric-line\";\nimport { create } from \"jss\";\nimport preset from \"jss-preset-default\";\n\nconst jss = create(preset());\n\n/**\n * 歌词播放组件,本框架的核心组件\n *\n * 尽可能贴切 Apple Music for iPad 的歌词效果设计,且做了力所能及的优化措施\n */\nexport class LyricPlayer extends EventTarget implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate currentTime = 0;\n\tprivate lyricLines: LyricLine[] = [];\n\tprivate processedLines: LyricLine[] = [];\n\tprivate lyricLinesEl: LyricLineEl[] = [];\n\tprivate lyricLinesSize: Map<LyricLineEl, [number, number]> = new Map();\n\tprivate hotLines: Set<number> = new Set();\n\tprivate bufferedLines: Set<number> = new Set();\n\tprivate scrollToIndex = 0;\n\tprivate resizeObserver: ResizeObserver = new ResizeObserver((e) => {\n\t\tconst rect = e[0].contentRect;\n\t\tthis.size[0] = rect.width;\n\t\tthis.size[1] = rect.height;\n\t\tthis.pos[0] = rect.left;\n\t\tthis.pos[1] = rect.top;\n\t\tthis.rebuildStyle();\n\t\tthis.calcLayout(true);\n\t\tthis.lyricLinesEl.forEach((el) => el.updateMaskImage());\n\t});\n\tprivate posXSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 10,\n\t\tstiffness: 100,\n\t};\n\tprivate posYSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 15,\n\t\tstiffness: 100,\n\t};\n\tprivate scaleSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 20,\n\t\tstiffness: 100,\n\t};\n\tprivate enableBlur = true;\n\tprivate interludeDots: InterludeDots;\n\tprivate interludeDotsSize: [number, number] = [0, 0];\n\treadonly supportPlusLighter = CSS.supports(\"mix-blend-mode\", \"plus-lighter\");\n\treadonly supportMaskImage = CSS.supports(\"mask-image\", \"none\");\n\tprivate disableSpring = false;\n\tprivate alignAnchor: \"top\" | \"bottom\" | number = 0.5;\n\treadonly size: [number, number] = [0, 0];\n\treadonly pos: [number, number] = [0, 0];\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tsetEnableSpring(enable = true) {\n\t\tthis.disableSpring = !enable;\n\t\tif (enable) {\n\t\t\tthis.element.classList.remove(this.style.classes.disableSpring);\n\t\t} else {\n\t\t\tthis.element.classList.add(this.style.classes.disableSpring);\n\t\t}\n\t\tthis.calcLayout(true);\n\t}\n\t/**\n\t * 获取当前是否启用了物理弹簧\n\t * @returns 是否启用物理弹簧\n\t */\n\tgetEnableSpring() {\n\t\treturn !this.disableSpring;\n\t}\n\tpublic readonly style = jss.createStyleSheet({\n\t\tlyricPlayer: {\n\t\t\tuserSelect: \"none\",\n\t\t\tpadding: \"1rem\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tfontSize: \"max(5vh, 12px)\",\n\t\t\tfontWeight: \"bold\",\n\t\t\twidth: \"100%\",\n\t\t\theight: \"100%\",\n\t\t\toverflow: \"hidden\",\n\t\t\tmaxWidth: \"100%\",\n\t\t\tmaxHeight: \"100%\",\n\t\t\tzIndex: 1,\n\t\t\tcolor: \"var(--amll-lyric-line-color)\",\n\t\t\tmixBlendMode: \"plus-lighter\",\n\t\t\tcontain: \"strict\",\n\t\t},\n\t\tlyricLine: {\n\t\t\tposition: \"absolute\",\n\t\t\ttransformOrigin: \"left\",\n\t\t\tmaxWidth: \"65%\",\n\t\t\tpadding: \"max(2vh, 1rem) 1rem\",\n\t\t\tcontain: \"content\",\n\t\t\ttransition: \"filter 0.25s\",\n\t\t\tmargin: \"max(2vh, 1rem) -1rem\",\n\t\t},\n\t\t\"@media (max-width: 1024px)\": {\n\t\t\tlyricLine: {\n\t\t\t\tmaxWidth: \"75%\",\n\t\t\t\tpadding: \"max(1vh, 1rem) 1rem\",\n\t\t\t\tmargin: \"0 -1rem\",\n\t\t\t},\n\t\t},\n\t\tlyricDuetLine: {\n\t\t\ttextAlign: \"right\",\n\t\t\ttransformOrigin: \"right\",\n\t\t},\n\t\tlyricBgLine: {\n\t\t\topacity: 0,\n\t\t\tfontSize: \"max(50%, 10px)\",\n\t\t\ttransition: \"opacity 0.25s\",\n\t\t\t\"&.active\": {\n\t\t\t\ttransition: \"opacity 0.25s 0.25s\",\n\t\t\t\topacity: 1,\n\t\t\t},\n\t\t},\n\t\tlyricMainLine: {\n\t\t\ttransition: \"opacity 0.3s 0.25s\",\n\t\t\tmargin: \"-1rem\",\n\t\t\tpadding: \"1rem\",\n\t\t\t\"& span\": {\n\t\t\t\tdisplay: \"inline-block\",\n\t\t\t\tmargin: \"-1rem\",\n\t\t\t\tpadding: \"1rem\",\n\t\t\t},\n\t\t\t\"& > span\": {\n\t\t\t\twhiteSpace: \"pre-wrap\",\n\t\t\t\twordBreak: \"keep-all\",\n\t\t\t\tmaxLines: \"1\",\n\t\t\t\t\"&.emphasize\": {\n\t\t\t\t\tmargin: \"-1rem\",\n\t\t\t\t\tpadding: \"1rem\",\n\t\t\t\t\ttransformStyle: \"preserve-3d\",\n\t\t\t\t\tperspective: \"50vw\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tlyricSubLine: {\n\t\t\tfontSize: \"max(50%, 10px)\",\n\t\t\topacity: 0.5,\n\t\t},\n\t\tdisableSpring: {\n\t\t\t\"& > *\": {\n\t\t\t\ttransition: \"filter 0.25s, transform 0.5s\",\n\t\t\t},\n\t\t},\n\t\tinterludeDots: {\n\t\t\theight: \"min(1rem,2.5vh)\",\n\t\t\ttransformOrigin: \"center\",\n\t\t\twidth: \"fit-content\",\n\t\t\tpadding: \"2.5% 0\",\n\t\t\tposition: \"absolute\",\n\t\t\tdisplay: \"flex\",\n\t\t\tgap: \"0.5rem\",\n\t\t\t\"& > *\": {\n\t\t\t\twidth: \"100%\",\n\t\t\t\tdisplay: \"inline-block\",\n\t\t\t\tborderRadius: \"50%\",\n\t\t\t\taspectRatio: \"1 / 1\",\n\t\t\t\tbackgroundColor: \"var(--amll-lyric-line-color)\",\n\t\t\t\tmarginRight: \"4px\",\n\t\t\t},\n\t\t\t\"&.duet\": {\n\t\t\t\tright: \"1rem\",\n\t\t\t\ttransformOrigin: \"center\",\n\t\t\t},\n\t\t},\n\t\t\"@supports (mix-blend-mode: plus-lighter)\": {\n\t\t\tlyricSubLine: {\n\t\t\t\topacity: 0.3,\n\t\t\t},\n\t\t},\n\t\ttmpDisableTransition: {\n\t\t\ttransition: \"none !important\",\n\t\t},\n\t});\n\tprivate onPageShow = () => {\n\t\tthis.calcLayout(true);\n\t};\n\tconstructor() {\n\t\tsuper();\n\t\tthis.interludeDots = new InterludeDots(this);\n\t\tthis.element.setAttribute(\"class\", this.style.classes.lyricPlayer);\n\t\tif (this.disableSpring) {\n\t\t\tthis.element.classList.add(this.style.classes.disableSpring);\n\t\t}\n\t\tthis.rebuildStyle();\n\t\tthis.resizeObserver.observe(this.element);\n\t\tthis.element.appendChild(this.interludeDots.getElement());\n\t\tthis.style.attach();\n\t\tthis.interludeDots.setTransform(0, 200);\n\t\twindow.addEventListener(\"pageshow\", this.onPageShow);\n\t}\n\t/**\n\t * 获取当前播放时间里是否处于间奏区间\n\t * 如果是则会返回单位为毫秒的始末时间\n\t * 否则返回 undefined\n\t *\n\t * 这个只允许内部调用\n\t * @returns [开始时间,结束时间] 或 undefined 如果不处于间奏区间\n\t */\n\tgetCurrentInterlude(): [number, number] | undefined {\n\t\tif (this.bufferedLines.size > 0) return undefined;\n\t\tconst currentTime = this.currentTime + 20;\n\t\tconst i = this.scrollToIndex;\n\t\tif (i === 0) {\n\t\t\tif (this.processedLines[0]?.startTime) {\n\t\t\t\tif (this.processedLines[0].startTime > currentTime) {\n\t\t\t\t\treturn [0, this.processedLines[0].startTime];\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tthis.processedLines[i]?.endTime &&\n\t\t\tthis.processedLines[i + 1]?.startTime\n\t\t) {\n\t\t\tif (\n\t\t\t\tthis.processedLines[i + 1].startTime > currentTime &&\n\t\t\t\tthis.processedLines[i].endTime < currentTime\n\t\t\t) {\n\t\t\t\treturn [\n\t\t\t\t\tthis.processedLines[i].endTime,\n\t\t\t\t\tthis.processedLines[i + 1].startTime,\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\t/**\n\t * 重建样式\n\t *\n\t * 这个只允许内部调用\n\t */\n\trebuildStyle() {\n\t\tlet style = \"\";\n\t\tstyle += \"--amll-lyric-player-width:\";\n\t\tstyle += this.element.clientWidth;\n\t\tstyle += \"px;\";\n\t\tstyle += \"--amll-lyric-player-height:\";\n\t\tstyle += this.element.clientHeight;\n\t\tstyle += \"px;\";\n\t\tstyle += \"--amll-lyric-line-color:\";\n\t\tstyle += \"#FFFFFF;\";\n\t\tstyle += \"--amll-player-time:\";\n\t\tstyle += this.currentTime;\n\t\tstyle += \";\";\n\t\tthis.element.setAttribute(\"style\", style);\n\t}\n\t/**\n\t * 设置是否启用歌词行的模糊效果\n\t * @param enable 是否启用\n\t */\n\tsetEnableBlur(enable: boolean) {\n\t\tif (this.enableBlur === enable) return;\n\t\tthis.enableBlur = enable;\n\t\tthis.calcLayout();\n\t}\n\t/**\n\t * 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误\n\t * @param lines 歌词数组\n\t */\n\tsetLyricLines(lines: LyricLine[]) {\n\t\tthis.lyricLines = lines;\n\t\tconst timeOffset = 750;\n\t\tthis.processedLines = lines.map((line, i, lines) => {\n\t\t\tif (line.isBG)\n\t\t\t\treturn {\n\t\t\t\t\t...line,\n\t\t\t\t};\n\t\t\telse {\n\t\t\t\tconst lastLine = lines[i - 1];\n\t\t\t\tconst pastLine = lines[i - 2];\n\t\t\t\tif (lastLine?.isBG && pastLine) {\n\t\t\t\t\tif (pastLine.endTime < line.startTime) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\tMath.max(pastLine.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (lastLine?.endTime) {\n\t\t\t\t\tif (lastLine.endTime < line.startTime) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\tMath.max(lastLine?.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...line,\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, i, lines) => {\n\t\t\tconst nextLine = lines[i + 1];\n\t\t\tconst lastWord = line.words[line.words.length - 1];\n\t\t\tif (lastWord && shouldEmphasize(lastWord)) {\n\t\t\t\tif (nextLine) {\n\t\t\t\t\tif (nextLine.startTime > line.endTime) {\n\t\t\t\t\t\tline.endTime = Math.min(line.endTime + 1500, nextLine.startTime);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tline.endTime = line.endTime + 1500;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, i, lines) => {\n\t\t\tif (line.isBG) return;\n\t\t\tconst nextLine = lines[i + 1];\n\t\t\tif (nextLine?.isBG) {\n\t\t\t\tnextLine.startTime = Math.min(nextLine.startTime, line.startTime);\n\t\t\t}\n\t\t});\n\t\tthis.lyricLinesEl.forEach((el) => el.dispose());\n\t\tthis.lyricLinesEl = this.processedLines.map(\n\t\t\t(line) => new LyricLineEl(this, line),\n\t\t);\n\t\tthis.lyricLinesEl.forEach((el) => {\n\t\t\tthis.element.appendChild(el.getElement());\n\t\t\tel.updateMaskImage();\n\t\t});\n\t\tthis.setLinePosXSpringParams({});\n\t\tthis.setLinePosYSpringParams({});\n\t\tthis.setLineScaleSpringParams({});\n\t\tthis.setCurrentTime(0, true);\n\t\tthis.calcLayout(true);\n\t}\n\t/**\n\t * 重新布局定位歌词行的位置,调用完成后再逐帧调用 `update`\n\t * 函数即可让歌词通过动画移动到目标位置。\n\t *\n\t * 此函数还有一个 `reflow` 参数,用于指定是否需要重新计算布局\n\t *\n\t * 因为计算布局必定会导致浏览器重排布局,所以会大幅度影响流畅度和性能,故请只在以下情况下将其​设置为 true:\n\t *\n\t * 1. 歌词页面大小发生改变时(这个组件会自行处理)\n\t * 2. 加载了新的歌词时(不论前后歌词是否完全一样)\n\t * 3. 用户自行跳转了歌曲播放位置(不论距离远近)\n\t *\n\t * @param reflow 是否进行重新布局(重新计算每行歌词大小)\n\t */\n\tcalcLayout(reflow = false) {\n\t\tif (reflow) {\n\t\t\tthis.lyricLinesEl.forEach((el) => {\n\t\t\t\tconst size: [number, number] = el.measureSize();\n\t\t\t\tthis.lyricLinesSize.set(el, size);\n\t\t\t\tel.lineSize = size;\n\t\t\t});\n\t\t\tthis.interludeDotsSize[0] = this.interludeDots.getElement().clientWidth;\n\t\t\tthis.interludeDotsSize[1] = this.interludeDots.getElement().clientHeight;\n\t\t}\n\t\tconst SCALE_ASPECT = 0.95;\n\t\tconst scrollOffset = this.lyricLinesEl\n\t\t\t.slice(0, this.scrollToIndex)\n\t\t\t.reduce(\n\t\t\t\t(acc, el) =>\n\t\t\t\t\tacc + (el.getLine().isBG ? 0 : this.lyricLinesSize.get(el)?.[1] ?? 0),\n\t\t\t\t0,\n\t\t\t);\n\t\tlet curPos = -scrollOffset;\n\t\tif (this.alignAnchor === \"bottom\") {\n\t\t\tcurPos += this.element.clientHeight / 2;\n\t\t\tconst curLine = this.lyricLinesEl[this.scrollToIndex];\n\t\t\tif (curLine) {\n\t\t\t\tconst lineHeight = this.lyricLinesSize.get(curLine)?.[1] ?? 0;\n\t\t\t\tcurPos -= lineHeight / 2;\n\t\t\t}\n\t\t} else if (typeof this.alignAnchor === \"number\") {\n\t\t\tcurPos += this.element.clientHeight * this.alignAnchor;\n\t\t\tconst curLine = this.lyricLinesEl[this.scrollToIndex];\n\t\t\tif (curLine) {\n\t\t\t\tconst lineHeight = this.lyricLinesSize.get(curLine)?.[1] ?? 0;\n\t\t\t\tcurPos -= lineHeight / 2;\n\t\t\t}\n\t\t}\n\t\tconst interlude =\n\t\t\tthis.currentTime === 0 ? undefined : this.getCurrentInterlude();\n\t\tlet interludeDuration = 0;\n\t\tif (interlude) {\n\t\t\tinterludeDuration = interlude[1] - interlude[0];\n\t\t\tif (interludeDuration >= 5000) {\n\t\t\t\tconst nextLine =\n\t\t\t\t\tthis.currentTime === 0\n\t\t\t\t\t\t? this.lyricLinesEl[0]\n\t\t\t\t\t\t: this.lyricLinesEl[this.scrollToIndex + 1];\n\t\t\t\tif (nextLine) {\n\t\t\t\t\tcurPos -= this.lyricLinesSize.get(nextLine)?.[1] ?? 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst latestIndex = Math.max(...this.bufferedLines);\n\t\tlet delay = 0;\n\t\tthis.lyricLinesEl.forEach((el, i) => {\n\t\t\tconst hasBuffered = this.bufferedLines.has(i);\n\t\t\tconst isActive =\n\t\t\t\thasBuffered || (i >= this.scrollToIndex && i < latestIndex);\n\t\t\tconst line = el.getLine();\n\t\t\tlet left = 0;\n\t\t\tif (line.isDuet) {\n\t\t\t\tleft = this.size[0] - (this.lyricLinesSize.get(el)?.[0] ?? 0);\n\t\t\t}\n\t\t\tif (i === this.scrollToIndex + 1 && interludeDuration >= 5000) {\n\t\t\t\tthis.interludeDots.setTransform(0, curPos);\n\t\t\t\tthis.interludeDots.setInterlude(this.getCurrentInterlude());\n\t\t\t\tcurPos += this.interludeDotsSize[1];\n\t\t\t}\n\t\t\tel.setTransform(\n\t\t\t\tleft,\n\t\t\t\tcurPos,\n\t\t\t\tisActive ? 1 : SCALE_ASPECT,\n\t\t\t\thasBuffered ? 1 : 1 / 3,\n\t\t\t\tthis.enableBlur\n\t\t\t\t\t? 3 *\n\t\t\t\t\t (isActive\n\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t: 1 +\n\t\t\t\t\t\t\t (i < this.scrollToIndex\n\t\t\t\t\t\t\t\t\t? Math.abs(this.scrollToIndex - i)\n\t\t\t\t\t\t\t\t\t: Math.abs(i - Math.max(this.scrollToIndex, latestIndex))))\n\t\t\t\t\t: 0,\n\t\t\t\treflow,\n\t\t\t\tdelay,\n\t\t\t);\n\t\t\tif (line.isBG && isActive) {\n\t\t\t\tcurPos += this.lyricLinesSize.get(el)?.[1] ?? 0;\n\t\t\t} else if (!line.isBG) {\n\t\t\t\tcurPos += this.lyricLinesSize.get(el)?.[1] ?? 0;\n\t\t\t}\n\t\t\tif (curPos >= 0) {\n\t\t\t\tdelay += 0.05;\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t * 获取当前歌词的播放位置\n\t *\n\t * 一般和最后调用 `setCurrentTime` 给予的参数一样\n\t * @returns 当前播放位置\n\t */\n\tgetCurrentTime() {\n\t\treturn this.currentTime;\n\t}\n\t/**\n\t * 获取当前歌词数组\n\t *\n\t * 一般和最后调用 `setLyricLines` 给予的参数一样\n\t * @returns 当前歌词数组\n\t */\n\tgetLyricLines() {\n\t\treturn this.lyricLines;\n\t}\n\tgetElement(): HTMLElement {\n\t\treturn this.element;\n\t}\n\t/**\n\t * 设置歌词行的对齐方式,默认为 `top`\n\t *\n\t * - 设置成 `top` 的话歌词将会向组件顶部对齐\n\t * - 设置成 `bottom` 的话歌词将会向组件底部对齐\n\t * - 设置成 [0.0-1.0] 之间任意数字的话则会根据当前组件高度从顶部向下位移为对齐位置垂直居中对齐\n\t * @param alignAnchor 歌词行对齐方式,详情见函数说明\n\t */\n\tsetAlignAnchor(alignAnchor: \"top\" | \"bottom\" | number) {\n\t\tthis.alignAnchor = alignAnchor;\n\t}\n\t/**\n\t * 设置当前播放进度,单位为毫秒且**必须是整数**,此时将会更新内部的歌词进度信息\n\t * 内部会根据调用间隔和播放进度自动决定如何滚动和显示歌词,所以这个的调用频率越快越准确越好\n\t *\n\t * 调用完成后,可以每帧调用 `update` 函数来执行歌词动画效果\n\t * @param time 当前播放进度,单位为毫秒\n\t */\n\tsetCurrentTime(time: number, isSeek = false) {\n\t\t// 我在这里定义了歌词的选择状态:\n\t\t// 普通行:当前不处于时间范围内的歌词行\n\t\t// 热行:当前绝对处于播放时间内的歌词行,且一般会被立刻加入到缓冲行中\n\t\t// 缓冲行:一般处于播放时间后的歌词行,会因为当前播放状态的缘故推迟解除状态\n\n\t\t// 然后我们需要让歌词行为如下:\n\t\t// 如果当前仍有缓冲行的情况下加入新热行,则不会解除当前缓冲行,且也不会修改当前滚动位置\n\t\t// 如果当前所有缓冲行都将被删除且没有新热行加入,则删除所有缓冲行,且也不会修改当前滚动位置\n\t\t// 如果当前所有缓冲行都将被删除且有新热行加入,则删除所有缓冲行并加入新热行作为缓冲行,然后修改当前滚动位置\n\t\tthis.currentTime = time;\n\t\tthis.element.style.setProperty(\"--amll-player-time\", `${time}`);\n\t\tconst removedHotIds = new Set<number>();\n\t\tconst removedIds = new Set<number>();\n\t\tconst addedIds = new Set<number>();\n\n\t\t// 先检索当前已经超出时间范围的缓冲行,列入待删除集内\n\t\tthis.hotLines.forEach((lastHotId) => {\n\t\t\tconst line = this.processedLines[lastHotId];\n\t\t\tif (line.isBG) return;\n\t\t\tif (line) {\n\t\t\t\tconst nextLine = this.processedLines[lastHotId + 1];\n\t\t\t\tif (nextLine?.isBG) {\n\t\t\t\t\tconst startTime = Math.min(line.startTime, nextLine?.startTime);\n\t\t\t\t\tconst endTime = Math.max(line.endTime, nextLine?.endTime);\n\t\t\t\t\tif (startTime > time || endTime <= time) {\n\t\t\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\t\t\tthis.hotLines.delete(lastHotId + 1);\n\t\t\t\t\t\tremovedHotIds.add(lastHotId + 1);\n\t\t\t\t\t\tif (isSeek) {\n\t\t\t\t\t\t\tthis.lyricLinesEl[lastHotId].disable();\n\t\t\t\t\t\t\tthis.lyricLinesEl[lastHotId + 1].disable();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (line.startTime > time || line.endTime <= time) {\n\t\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\t\tif (isSeek) this.lyricLinesEl[lastHotId].disable();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\tif (isSeek) this.lyricLinesEl[lastHotId].disable();\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, id, arr) => {\n\t\t\tif (!line.isBG && line.startTime <= time && line.endTime > time) {\n\t\t\t\tif (!this.hotLines.has(id)) {\n\t\t\t\t\tthis.hotLines.add(id);\n\t\t\t\t\taddedIds.add(id);\n\t\t\t\t\tif (isSeek) this.lyricLinesEl[id].enable();\n\t\t\t\t\tif (arr[id + 1]?.isBG) {\n\t\t\t\t\t\tthis.hotLines.add(id + 1);\n\t\t\t\t\t\taddedIds.add(id + 1);\n\t\t\t\t\t\tif (isSeek) this.lyricLinesEl[id + 1].enable();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.bufferedLines.forEach((v) => {\n\t\t\tif (!this.hotLines.has(v)) {\n\t\t\t\tremovedIds.add(v);\n\t\t\t\tif (isSeek) this.lyricLinesEl[v].disable();\n\t\t\t}\n\t\t});\n\t\tif (isSeek) {\n\t\t\tif (this.bufferedLines.size > 0) {\n\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t} else {\n\t\t\t\tthis.scrollToIndex = this.processedLines.findIndex(\n\t\t\t\t\t(line) => line.startTime >= time,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.bufferedLines.clear();\n\t\t\tthis.hotLines.forEach((v) => this.bufferedLines.add(v));\n\t\t\tthis.calcLayout(true);\n\t\t} else if (removedIds.size > 0 || addedIds.size > 0) {\n\t\t\tif (removedIds.size === 0 && addedIds.size > 0) {\n\t\t\t\taddedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.add(v);\n\t\t\t\t\tthis.lyricLinesEl[v].enable();\n\t\t\t\t});\n\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t} else if (addedIds.size === 0 && removedIds.size > 0) {\n\t\t\t\tif (eqSet(removedIds, this.bufferedLines)) {\n\t\t\t\t\tthis.bufferedLines.forEach((v) => {\n\t\t\t\t\t\tif (!this.hotLines.has(v)) {\n\t\t\t\t\t\t\tthis.bufferedLines.delete(v);\n\t\t\t\t\t\t\tthis.lyricLinesEl[v].disable();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.add(v);\n\t\t\t\t\tthis.lyricLinesEl[v].enable();\n\t\t\t\t});\n\t\t\t\tremovedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.delete(v);\n\t\t\t\t\tthis.lyricLinesEl[v].disable();\n\t\t\t\t});\n\t\t\t\tif (this.bufferedLines.size > 0)\n\t\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t}\n\t\t\tthis.calcLayout();\n\t\t}\n\t}\n\t/**\n\t * 更新动画,这个函数应该被逐帧调用或者在以下情况下调用一次:\n\t *\n\t * 1. 刚刚调用完设置歌词函数的时候\n\t * @param delta 距离上一次被调用到现在的时长,单位为毫秒(可为浮点数)\n\t */\n\tupdate(delta = 0) {\n\t\tconst deltaS = delta / 1000;\n\t\tthis.interludeDots.update(delta);\n\t\tthis.lyricLinesEl.forEach((line) => line.update(deltaS));\n\t}\n\t/**\n\t * 设置所有歌词行在横坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLinePosXSpringParams(params: Partial<SpringParams>) {\n\t\tthis.posXSpringParams = {\n\t\t\t...this.posXSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.posX.updateParams(this.posXSpringParams),\n\t\t);\n\t}\n\t/**\n\t * 设置所有歌词行在​纵坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLinePosYSpringParams(params: Partial<SpringParams>) {\n\t\tthis.posYSpringParams = {\n\t\t\t...this.posYSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.posY.updateParams(this.posYSpringParams),\n\t\t);\n\t}\n\t/**\n\t * 设置所有歌词行在​缩放大小上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLineScaleSpringParams(params: Partial<SpringParams>) {\n\t\tthis.scaleSpringParams = {\n\t\t\t...this.scaleSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.scale.updateParams(this.scaleSpringParams),\n\t\t);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t\tthis.resizeObserver.disconnect();\n\t\tthis.style.detach();\n\t\tthis.lyricLinesEl.forEach((el) => el.dispose());\n\t\twindow.removeEventListener(\"pageshow\", this.onPageShow);\n\t}\n}\n"],"names":["timeRegexp","parseTimespan","timeSpan","matches","hour","min","sec","parseTTML","ttmlText","ttmlDoc","mainAgentId","agent","id","result","lineEl","line","curBGLine","wordNode","word","wordEl","role","bgLine","firstWord","lastWord","TimedContainer","Container","PixiRenderer","canvas","bounds","Application","delta","lastContainer","s1","s2","s3","s4","maxSize","speed","scale","minBorder","c0","ColorMatrixFilter","c1","c2","BlurFilter","fps","albumUrl","tex","Texture","container","Sprite","BackgroundRender","eqSet","xs","ys","x","easeInOutBack","clamp","cur","max","InterludeDots","lyricPlayer","left","top","interlude","curStyle","interludeDuration","currentDuration","breatheDuration","globalOpacity","dot0Opacity","dot1Opacity","dot2Opacity","Spring","currentPosition","curV","solveSpring","getVelocity","targetPosition","params","delay","from","velocity","to","soft","stiffness","damping","mass","angular_frequency","leftover","t","damping_frequency","dfm","dm","derivative","f","CJKEXP","generateFadeGradient","width","bright","dark","totalAspect","widthInTotal","leftPos","shouldEmphasize","LyricLineEl","lyricLine","main","trans","roman","a","size","style","splited","reusableElements","reusableTextNodes","collectNodes","curNode","lastWordEl","c","charEl","wholeWordEl","duration","el","i","arr","maskImage","_widthInTotal","totalAspectStr","w","maskPos","opacity","blur","force","l","r","b","pl","pt","pr","pb","jss","create","preset","LyricPlayer","rect","enable","currentTime","lines","timeOffset","lastLine","pastLine","nextLine","reflow","SCALE_ASPECT","curPos","acc","curLine","lineHeight","latestIndex","hasBuffered","isActive","alignAnchor","time","isSeek","removedHotIds","removedIds","addedIds","lastHotId","startTime","endTime","v","deltaS"],"mappings":"iTAEMA,EACL,uEACD,SAASC,EAAcC,EAA0B,CAC1C,MAAAC,EAAUH,EAAW,KAAKE,CAAQ,EACxC,GAAIC,EAAS,CACZ,MAAMC,EAAO,OAAOD,EAAQ,QAAQ,MAAQ,GAAG,EACzCE,EAAM,OAAOF,EAAQ,QAAQ,KAAO,GAAG,EACvCG,EAAM,OAAOH,EAAQ,QAAQ,IAAI,QAAQ,IAAK,GAAG,GAAK,GAAG,EAC/D,OAAO,KAAK,OAAOC,EAAO,KAAOC,EAAM,GAAKC,GAAO,GAAI,CAAA,KAEjD,OAAA,IAAI,UAAU,YAAY,CAElC,CAEO,SAASC,EAAUC,EAA+B,CAExD,MAAMC,EADY,IAAI,YACiB,gBACtCD,EACA,iBAAA,EAGD,IAAIE,EAAc,KAElB,UAAWC,KAASF,EAAQ,iBAAiB,aAAa,EACzD,GAAIE,EAAM,aA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K,WAAW,EAElB,CAOA,OAAO7I,EAAQ,EAAG,CACjB,MAAM8I,EAAS9I,EAAQ,IAClB,KAAA,cAAc,OAAOA,CAAK,EAC/B,KAAK,aAAa,QAASf,GAASA,EAAK,OAAO6J,CAAM,CAAC,CACxD,CAMA,wBAAwB7F,EAA+B,CACtD,KAAK,iBAAmB,CACvB,GAAG,KAAK,iBACR,GAAGA,CAAA,EAEJ,KAAK,aAAa,QAAShE,GAC1BA,EAAK,eAAe,KAAK,aAAa,KAAK,gBAAgB,CAAA,CAE7D,CAMA,wBAAwBgE,EAA+B,CACtD,KAAK,iBAAmB,CACvB,GAAG,KAAK,iBACR,GAAGA,CAAA,EAEJ,KAAK,aAAa,QAAShE,GAC1BA,EAAK,eAAe,KAAK,aAAa,KAAK,gBAAgB,CAAA,CAE7D,CAMA,yBAAyBgE,EAA+B,CACvD,KAAK,kBAAoB,CACxB,GAAG,KAAK,kBACR,GAAGA,CAAA,EAEJ,KAAK,aAAa,QAAShE,GAC1BA,EAAK,eAAe,MAAM,aAAa,KAAK,iBAAiB,CAAA,CAE/D,CACA,SAAgB,CACf,KAAK,QAAQ,SACb,KAAK,eAAe,aACpB,KAAK,MAAM,SACX,KAAK,aAAa,QAAS4G,GAAOA,EAAG,SAAS,EACvC,OAAA,oBAAoB,WAAY,KAAK,UAAU,CACvD,CACD"}
1
+ {"version":3,"file":"amll-core.js","sources":["../src/lyric/ttml.ts","../src/bg-render/pixi-renderer.ts","../src/bg-render/index.ts","../src/utils/eq-set.ts","../src/lyric-player/interlude-dots.ts","../src/utils/spring.ts","../src/lyric-player/lyric-line.ts","../src/lyric-player/index.ts"],"sourcesContent":["import { LyricLine, LyricWord } from \"../interfaces\";\n\nconst timeRegexp =\n\t/^(((?<hour>[0-9]+):)?(?<min>[0-9]+):)?(?<sec>[0-9]+([\\.:]([0-9]+))?)/;\nfunction parseTimespan(timeSpan: string): number {\n\tconst matches = timeRegexp.exec(timeSpan);\n\tif (matches) {\n\t\tconst hour = Number(matches.groups?.hour || \"0\");\n\t\tconst min = Number(matches.groups?.min || \"0\");\n\t\tconst sec = Number(matches.groups?.sec.replace(/:/, \".\") || \"0\");\n\t\treturn Math.floor((hour * 3600 + min * 60 + sec) * 1000);\n\t} else {\n\t\tthrow new TypeError(\"时间戳字符串解析失败\");\n\t}\n}\n\nexport function parseTTML(ttmlText: string): LyricLine[] {\n\tconst domParser = new DOMParser();\n\tconst ttmlDoc: XMLDocument = domParser.parseFromString(\n\t\tttmlText,\n\t\t\"application/xml\",\n\t);\n\n\tlet mainAgentId = \"v1\";\n\n\tfor (const agent of ttmlDoc.querySelectorAll(\"ttm\\\\:agent\")) {\n\t\tif (agent.getAttribute(\"type\") === \"person\") {\n\t\t\tconst id = agent.getAttribute(\"xml:id\");\n\t\t\tif (id) {\n\t\t\t\tmainAgentId = id;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst result: LyricLine[] = [];\n\n\tfor (const lineEl of ttmlDoc.querySelectorAll(\"body p[begin][end]\")) {\n\t\tconst line: LyricLine = {\n\t\t\twords: [],\n\t\t\tstartTime: parseTimespan(lineEl.getAttribute(\"begin\") ?? \"0:0\"),\n\t\t\tendTime: parseTimespan(lineEl.getAttribute(\"end\") ?? \"0:0\"),\n\t\t\ttranslatedLyric: \"\",\n\t\t\tromanLyric: \"\",\n\t\t\tisBG: false,\n\t\t\tisDuet: lineEl.getAttribute(\"ttm:agent\") !== mainAgentId,\n\t\t};\n\t\tlet curBGLine: LyricLine | null = null;\n\n\t\tfor (const wordNode of lineEl.childNodes) {\n\t\t\tif (wordNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\tconst word = wordNode.textContent ?? \"\";\n\t\t\t\tif (/^(\\s+)$/.test(word)) {\n\t\t\t\t\tline.words.push({\n\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tline.words.push({\n\t\t\t\t\t\tword: word,\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (wordNode.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\tconst wordEl = wordNode as Element;\n\t\t\t\tconst role = wordEl.getAttribute(\"ttm:role\");\n\n\t\t\t\tif (wordEl.nodeName === \"span\" && role) {\n\t\t\t\t\tif (role === \"x-bg\") {\n\t\t\t\t\t\tconst bgLine: LyricLine = {\n\t\t\t\t\t\t\twords: [],\n\t\t\t\t\t\t\tstartTime: line.startTime,\n\t\t\t\t\t\t\tendTime: line.endTime,\n\t\t\t\t\t\t\ttranslatedLyric: \"\",\n\t\t\t\t\t\t\tromanLyric: \"\",\n\t\t\t\t\t\t\tisBG: true,\n\t\t\t\t\t\t\tisDuet: line.isDuet,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tfor (const wordNode of wordEl.childNodes) {\n\t\t\t\t\t\t\tif (wordNode.nodeType === Node.TEXT_NODE) {\n\t\t\t\t\t\t\t\tconst word = wordNode.textContent ?? \"\";\n\t\t\t\t\t\t\t\tif (/^(\\s+)$/.test(word)) {\n\t\t\t\t\t\t\t\t\tbgLine.words.push({\n\t\t\t\t\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbgLine.words.push({\n\t\t\t\t\t\t\t\t\t\tword: word,\n\t\t\t\t\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (wordNode.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tconst wordEl = wordNode as Element;\n\t\t\t\t\t\t\t\tconst role = wordEl.getAttribute(\"ttm:role\");\n\t\t\t\t\t\t\t\tif (wordEl.nodeName === \"span\" && role) {\n\t\t\t\t\t\t\t\t\tif (role === \"x-translation\") {\n\t\t\t\t\t\t\t\t\t\tbgLine.translatedLyric = wordEl.innerHTML.trim();\n\t\t\t\t\t\t\t\t\t} else if (role === \"x-roman\") {\n\t\t\t\t\t\t\t\t\t\tbgLine.romanLyric = wordEl.innerHTML.trim();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\twordEl.hasAttribute(\"begin\") &&\n\t\t\t\t\t\t\t\t\twordEl.hasAttribute(\"end\")\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tconst word = {\n\t\t\t\t\t\t\t\t\t\tword: wordNode.textContent,\n\t\t\t\t\t\t\t\t\t\tstartTime: parseTimespan(wordEl.getAttribute(\"begin\")!!),\n\t\t\t\t\t\t\t\t\t\tendTime: parseTimespan(wordEl.getAttribute(\"end\")!!),\n\t\t\t\t\t\t\t\t\t} as LyricWord;\n\t\t\t\t\t\t\t\t\tbgLine.words.push(word);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst firstWord = bgLine.words[0];\n\t\t\t\t\t\tbgLine.startTime = firstWord.startTime;\n\t\t\t\t\t\tif (firstWord?.word.startsWith(\"(\")) {\n\t\t\t\t\t\t\tfirstWord.word = firstWord.word.substring(1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst lastWord = bgLine.words[bgLine.words.length - 1];\n\t\t\t\t\t\tbgLine.endTime = lastWord.endTime;\n\t\t\t\t\t\tif (lastWord?.word.endsWith(\")\")) {\n\t\t\t\t\t\t\tlastWord.word = lastWord.word.substring(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tlastWord.word.length - 1,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurBGLine = bgLine;\n\t\t\t\t\t} else if (role === \"x-translation\") {\n\t\t\t\t\t\tline.translatedLyric = wordEl.innerHTML;\n\t\t\t\t\t} else if (role === \"x-roman\") {\n\t\t\t\t\t\tline.romanLyric = wordEl.innerHTML;\n\t\t\t\t\t}\n\t\t\t\t} else if (wordEl.hasAttribute(\"begin\") && wordEl.hasAttribute(\"end\")) {\n\t\t\t\t\tconst word: LyricWord = {\n\t\t\t\t\t\tword: wordNode.textContent ?? \"\",\n\t\t\t\t\t\tstartTime: parseTimespan(wordEl.getAttribute(\"begin\")!!),\n\t\t\t\t\t\tendTime: parseTimespan(wordEl.getAttribute(\"end\")!!),\n\t\t\t\t\t};\n\t\t\t\t\tline.words.push(word);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tresult.push(line);\n\t\tif (curBGLine) {\n\t\t\t// line.startTime = Math.min(line.startTime, curBGLine.startTime);\n\t\t\t// line.endTime = Math.max(line.endTime, curBGLine.endTime);\n\t\t\t// curBGLine.startTime = line.startTime;\n\t\t\t// curBGLine.endTime = line.endTime;\n\t\t\tresult.push(curBGLine);\n\t\t}\n\t}\n\n\tconsole.log(result);\n\n\treturn result;\n}\n","import { Container } from \"@pixi/display\";\nimport { Application } from \"@pixi/app\";\nimport { BlurFilter } from \"@pixi/filter-blur\";\nimport { ColorMatrixFilter } from \"@pixi/filter-color-matrix\";\nimport { Texture } from \"@pixi/core\";\nimport { Sprite } from \"@pixi/sprite\";\nimport { Disposable } from \"../interfaces\";\n\nclass TimedContainer extends Container {\n\tpublic time = 0;\n}\n\nexport class PixiRenderer implements Disposable {\n\tprivate observer: ResizeObserver;\n\tprivate app: Application;\n\tprivate curContainer?: TimedContainer;\n\tprivate lastContainer: Set<TimedContainer> = new Set();\n\tprivate onTick = (delta: number): void => {\n\t\tfor (const lastContainer of this.lastContainer) {\n\t\t\tlastContainer.alpha = Math.max(0, lastContainer.alpha - delta / 60);\n\t\t\tif (lastContainer.alpha <= 0) {\n\t\t\t\tthis.app.stage.removeChild(lastContainer);\n\t\t\t\tthis.lastContainer.delete(lastContainer);\n\t\t\t}\n\t\t}\n\n\t\tif (this.curContainer) {\n\t\t\tthis.curContainer.alpha = Math.min(\n\t\t\t\t1,\n\t\t\t\tthis.curContainer.alpha + delta / 60,\n\t\t\t);\n\t\t\tconst [s1, s2, s3, s4] = this.curContainer.children as Sprite[];\n\t\t\tconst maxSize = Math.max(this.app.screen.width, this.app.screen.height);\n\t\t\ts1.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts2.position.set(\n\t\t\t\tthis.app.screen.width / 2.5,\n\t\t\t\tthis.app.screen.height / 2.5,\n\t\t\t);\n\t\t\ts3.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts4.position.set(this.app.screen.width / 2, this.app.screen.height / 2);\n\t\t\ts1.width = maxSize * Math.sqrt(2);\n\t\t\ts1.height = s1.width;\n\t\t\ts2.width = maxSize * 0.8;\n\t\t\ts2.height = s2.width;\n\t\t\ts3.width = maxSize * 0.5;\n\t\t\ts3.height = s3.width;\n\t\t\ts4.width = maxSize * 0.25;\n\t\t\ts4.height = s4.width;\n\n\t\t\tthis.curContainer.time += delta * this.flowSpeed;\n\n\t\t\ts1.rotation += (delta / 1000) * this.flowSpeed;\n\t\t\ts2.rotation -= (delta / 500) * this.flowSpeed;\n\t\t\ts3.rotation += (delta / 1000) * this.flowSpeed;\n\t\t\ts4.rotation -= (delta / 750) * this.flowSpeed;\n\n\t\t\ts3.x =\n\t\t\t\tthis.app.screen.width / 2 +\n\t\t\t\t(this.app.screen.width / 4) *\n\t\t\t\t\tMath.cos((this.curContainer.time / 1000) * 0.75);\n\t\t\ts3.y =\n\t\t\t\tthis.app.screen.height / 2 +\n\t\t\t\t(this.app.screen.width / 4) *\n\t\t\t\t\tMath.cos((this.curContainer.time / 1000) * 0.75);\n\n\t\t\ts4.x =\n\t\t\t\tthis.app.screen.width / 2 +\n\t\t\t\t(this.app.screen.width / 4) * 0.1 +\n\t\t\t\tMath.cos(this.curContainer.time * 0.006 * 0.75);\n\t\t\ts4.y =\n\t\t\t\tthis.app.screen.height / 2 +\n\t\t\t\t(this.app.screen.width / 4) * 0.1 +\n\t\t\t\tMath.cos(this.curContainer.time * 0.006 * 0.75);\n\t\t}\n\t};\n\tprivate flowSpeed = 2;\n\tprivate currerntRenderScale = 0.75;\n\tconstructor(private canvas: HTMLCanvasElement) {\n\t\tconst bounds = canvas.getBoundingClientRect();\n\t\tthis.canvas.width = bounds.width * this.currerntRenderScale;\n\t\tthis.canvas.height = bounds.height * this.currerntRenderScale;\n\t\tthis.observer = new ResizeObserver(() => {\n\t\t\tconst bounds = canvas.getBoundingClientRect();\n\t\t\tthis.canvas.width = Math.max(1, bounds.width);\n\t\t\tthis.canvas.height = Math.max(1, bounds.height);\n\t\t\tthis.app.renderer.resize(\n\t\t\t\tthis.canvas.width * this.currerntRenderScale,\n\t\t\t\tthis.canvas.height * this.currerntRenderScale,\n\t\t\t);\n\t\t\tthis.rebuildFilters();\n\t\t});\n\t\tthis.observer.observe(canvas);\n\t\tthis.app = new Application({\n\t\t\tview: canvas,\n\t\t\tresizeTo: this.canvas,\n\t\t\tpowerPreference: \"low-power\",\n\t\t\tbackgroundAlpha: 0,\n\t\t});\n\t\tthis.rebuildFilters();\n\t\tthis.app.ticker.add(this.onTick);\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 修改背景的流动速度,数字越大越快,默认为 2\n\t * @param speed 背景的流动速度,默认为 2\n\t */\n\tsetFlowSpeed(speed: number) {\n\t\tthis.flowSpeed = speed;\n\t}\n\t/**\n\t * 修改背景的渲染比例,默认是 0.5\n\t *\n\t * 一般情况下这个程度既没有明显瑕疵也不会特别吃性能\n\t * @param scale 背景的渲染比例\n\t */\n\tsetRenderScale(scale: number) {\n\t\tthis.currerntRenderScale = scale;\n\t\tconst bounds = this.canvas.getBoundingClientRect();\n\t\tthis.canvas.width = Math.max(1, bounds.width);\n\t\tthis.canvas.height = Math.max(1, bounds.height);\n\t\tthis.app.renderer.resize(\n\t\t\tthis.canvas.width * this.currerntRenderScale,\n\t\t\tthis.canvas.height * this.currerntRenderScale,\n\t\t);\n\t\tthis.rebuildFilters();\n\t}\n\tprivate rebuildFilters() {\n\t\tconst minBorder = Math.min(this.canvas.width, this.canvas.height);\n\t\tconst c0 = new ColorMatrixFilter();\n\t\tc0.saturate(1.2, false);\n\t\tconst c1 = new ColorMatrixFilter();\n\t\tc1.brightness(0.6, false);\n\t\tconst c2 = new ColorMatrixFilter();\n\t\tc2.contrast(0.3, true);\n\t\tthis.app.stage.filters = [];\n\t\tthis.app.stage.filters.push(new BlurFilter(5, 1));\n\t\tthis.app.stage.filters.push(new BlurFilter(10, 1));\n\t\tthis.app.stage.filters.push(new BlurFilter(20, 2));\n\t\tthis.app.stage.filters.push(new BlurFilter(40, 2));\n\t\tif (minBorder > 512) this.app.stage.filters.push(new BlurFilter(80, 2));\n\t\tif (minBorder > 768) this.app.stage.filters.push(new BlurFilter(160, 4));\n\t\tif (minBorder > 768 * 2)\n\t\t\tthis.app.stage.filters.push(new BlurFilter(320, 4));\n\n\t\tthis.app.stage.filters.push(c0, c1, c2);\n\t\tthis.app.stage.filters.push(new BlurFilter(5, 1));\n\t}\n\t/**\n\t * 修改背景动画帧率,默认是 30 FPS\n\t *\n\t * 如果设置成 0 则会停止动画\n\t * @param fps 目标帧率,默认 30 FPS\n\t */\n\tsetFPS(fps: number) {\n\t\tthis.app.ticker.maxFPS = fps;\n\t}\n\t/**\n\t * 暂停背景动画,画面即便是更新了图片也不会发生变化\n\t */\n\tpause() {\n\t\tthis.app.ticker.stop();\n\t\tthis.app.render();\n\t}\n\t/**\n\t * 恢复播放背景动画\n\t */\n\tresume() {\n\t\tthis.app.ticker.start();\n\t}\n\t/**\n\t * 设置背景专辑图片,图片材质加载并设置完成后会返回\n\t * @param albumUrl 图片的目标链接\n\t */\n\tasync setAlbumImage(albumUrl: string) {\n\t\tconst tex = await Texture.fromURL(albumUrl);\n\t\tconst container = new TimedContainer();\n\t\tconst s1 = new Sprite(tex);\n\t\tconst s2 = new Sprite(tex);\n\t\tconst s3 = new Sprite(tex);\n\t\tconst s4 = new Sprite(tex);\n\t\ts1.anchor.set(0.5, 0.5);\n\t\ts2.anchor.set(0.5, 0.5);\n\t\ts3.anchor.set(0.5, 0.5);\n\t\ts4.anchor.set(0.5, 0.5);\n\t\ts1.rotation = Math.random() * Math.PI * 2;\n\t\ts2.rotation = Math.random() * Math.PI * 2;\n\t\ts3.rotation = Math.random() * Math.PI * 2;\n\t\ts4.rotation = Math.random() * Math.PI * 2;\n\t\tcontainer.addChild(s1, s2, s3, s4);\n\t\tif (this.curContainer) this.lastContainer.add(this.curContainer);\n\t\tthis.curContainer = container;\n\t\tthis.app.stage.addChild(this.curContainer);\n\t\tthis.curContainer.alpha = 0;\n\t}\n\n\tdispose() {\n\t\tthis.observer.disconnect();\n\t\tthis.app.ticker.remove(this.onTick);\n\t}\n}\n","/**\n * @fileoverview\n * 一个播放歌词的组件\n * @author SteveXMH\n */\n\nimport type { HasElement, Disposable } from \"../interfaces\";\nimport { PixiRenderer } from \"./pixi-renderer\";\n\nexport class BackgroundRender\n\textends PixiRenderer\n\timplements HasElement, Disposable\n{\n\tprivate element: HTMLCanvasElement;\n\tconstructor() {\n\t\tconst canvas = document.createElement(\"canvas\");\n\t\tsuper(canvas);\n\t\tthis.element = canvas;\n\t\tcanvas.style.pointerEvents = \"none\";\n\t\tcanvas.style.zIndex = \"-1\";\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tdispose() {\n\t\tsuper.dispose();\n\t\tthis.element.remove();\n\t}\n}\n","export const eqSet: <T>(xs: Set<T>, ys: Set<T>) => boolean = (\n\txs,\n\tys,\n): boolean => xs.size === ys.size && [...xs].every((x) => ys.has(x));\n","import { LyricPlayer } from \".\";\nimport type { Disposable, HasElement } from \"../interfaces\";\n\nfunction easeInOutBack(x: number): number {\n\tconst c1 = 1.70158;\n\tconst c2 = c1 * 1.525;\n\n\treturn x < 0.5\n\t\t? (Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2)) / 2\n\t\t: (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2;\n}\n\nconst clamp = (min: number, cur: number, max: number) =>\n\tMath.max(min, Math.min(cur, max));\n\nexport class InterludeDots implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate dot0: HTMLElement = document.createElement(\"span\");\n\tprivate dot1: HTMLElement = document.createElement(\"span\");\n\tprivate dot2: HTMLElement = document.createElement(\"span\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate scale = 1;\n\tprivate lastStyle = \"\";\n\tprivate currentInterlude?: [number, number];\n\tprivate currentTime = 0;\n\tprivate targetBreatheDuration = 1500;\n\tconstructor(private readonly lyricPlayer: LyricPlayer) {\n\t\tthis.element.className = this.lyricPlayer.style.classes.interludeDots;\n\t\tthis.element.appendChild(this.dot0);\n\t\tthis.element.appendChild(this.dot1);\n\t\tthis.element.appendChild(this.dot2);\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(left: number = this.left, top: number = this.top) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.update();\n\t}\n\tsetInterlude(interlude?: [number, number]) {\n\t\tthis.currentInterlude = interlude;\n\t\tthis.currentTime = interlude?.[0] ?? 0;\n\t}\n\tupdate(delta = 0) {\n\t\tthis.currentTime += delta;\n\t\tlet curStyle = \"\";\n\n\t\tcurStyle += `transform:translate(${this.left}px, ${this.top}px)`;\n\n\t\t// 计算缩放大小\n\n\t\tif (this.currentInterlude) {\n\t\t\tconst interludeDuration =\n\t\t\t\tthis.currentInterlude[1] - this.currentInterlude[0];\n\t\t\tconst currentDuration = this.currentTime - this.currentInterlude[0];\n\t\t\tif (currentDuration <= interludeDuration) {\n\t\t\t\tconst breatheDuration =\n\t\t\t\t\tinterludeDuration /\n\t\t\t\t\tMath.ceil(interludeDuration / this.targetBreatheDuration);\n\t\t\t\tlet scale = 1;\n\t\t\t\tlet globalOpacity = 1;\n\n\t\t\t\tscale *=\n\t\t\t\t\tMath.sin(1.5 * Math.PI - (currentDuration / breatheDuration) * 2) /\n\t\t\t\t\t\t10 +\n\t\t\t\t\t1;\n\n\t\t\t\tif (currentDuration < 1000) {\n\t\t\t\t\tscale *= 1 - Math.pow((1000 - currentDuration) / 1000, 2);\n\t\t\t\t}\n\n\t\t\t\tif (currentDuration < 500) {\n\t\t\t\t\tglobalOpacity = 0;\n\t\t\t\t} else if (currentDuration < 1000) {\n\t\t\t\t\tglobalOpacity *= (currentDuration - 500) / 500;\n\t\t\t\t}\n\n\t\t\t\tif (interludeDuration - currentDuration < 750) {\n\t\t\t\t\tscale *=\n\t\t\t\t\t\t1 -\n\t\t\t\t\t\teaseInOutBack(\n\t\t\t\t\t\t\t(750 - (interludeDuration - currentDuration)) / 750 / 2,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (interludeDuration - currentDuration < 375) {\n\t\t\t\t\tglobalOpacity *= clamp(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\t(interludeDuration - currentDuration) / 375,\n\t\t\t\t\t\t1,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tscale = Math.max(0, scale);\n\n\t\t\t\tcurStyle += ` scale(${scale})`;\n\n\t\t\t\tconst dot0Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t((currentDuration * 3) / interludeDuration) * 0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\t\t\t\tconst dot1Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t(((currentDuration - interludeDuration / 3) * 3) /\n\t\t\t\t\t\tinterludeDuration) *\n\t\t\t\t\t\t0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\t\t\t\tconst dot2Opacity = clamp(\n\t\t\t\t\t0.25,\n\t\t\t\t\t(((currentDuration - (interludeDuration / 3) * 2) * 3) /\n\t\t\t\t\t\tinterludeDuration) *\n\t\t\t\t\t\t0.75,\n\t\t\t\t\t1,\n\t\t\t\t);\n\n\t\t\t\tthis.dot0.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot0Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t\tthis.dot1.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot1Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t\tthis.dot2.style.opacity = `${clamp(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.max(0, globalOpacity * dot2Opacity),\n\t\t\t\t\t1,\n\t\t\t\t)}`;\n\t\t\t} else {\n\t\t\t\tcurStyle += \" scale(0)\";\n\t\t\t\tthis.dot0.style.opacity = \"0\";\n\t\t\t\tthis.dot1.style.opacity = \"0\";\n\t\t\t\tthis.dot2.style.opacity = \"0\";\n\t\t\t}\n\t\t} else {\n\t\t\tcurStyle += \" scale(0)\";\n\t\t\tthis.dot0.style.opacity = \"0\";\n\t\t\tthis.dot1.style.opacity = \"0\";\n\t\t\tthis.dot2.style.opacity = \"0\";\n\t\t}\n\n\t\tcurStyle += \";\";\n\n\t\tif (this.lastStyle !== curStyle) {\n\t\t\tthis.element.setAttribute(\"style\", curStyle);\n\t\t\tthis.lastStyle = curStyle;\n\t\t}\n\t}\n\tdispose() {\n\t\tthis.element.remove();\n\t}\n}\n","/** MIT License github.com/pushkine/ */\nexport interface SpringParams {\n\tmass: number; // = 1.0\n\tdamping: number; // = 10.0\n\tstiffness: number; // = 100.0\n\tsoft: boolean; // = false\n}\n\ntype seconds = number;\n\nexport class Spring {\n\tprivate currentPosition = 0;\n\tprivate targetPosition = 0;\n\tprivate currentTime = 0;\n\tprivate params: Partial<SpringParams> = {};\n\tprivate currentSolver: (t: seconds) => number;\n\tprivate getV: (t: seconds) => number;\n\tprivate queueParams:\n\t\t| (Partial<SpringParams> & {\n\t\t\t\ttime: number;\n\t\t })\n\t\t| undefined;\n\tprivate queuePosition:\n\t\t| {\n\t\t\t\ttime: number;\n\t\t\t\tposition: number;\n\t\t }\n\t\t| undefined;\n\tconstructor(currentPosition = 0) {\n\t\tthis.targetPosition = currentPosition;\n\t\tthis.currentPosition = this.targetPosition;\n\t\tthis.currentSolver = () => this.targetPosition;\n\t\tthis.getV = () => 0;\n\t}\n\tprivate resetSolver() {\n\t\tconst curV = this.getV(this.currentTime);\n\t\tthis.currentTime = 0;\n\t\tthis.currentSolver = solveSpring(\n\t\t\tthis.currentPosition,\n\t\t\tcurV,\n\t\t\tthis.targetPosition,\n\t\t\t0,\n\t\t\tthis.params,\n\t\t);\n\t\tthis.getV = getVelocity(this.currentSolver);\n\t}\n\tarrived() {\n\t\treturn (\n\t\t\tMath.abs(this.targetPosition - this.currentPosition) < 0.01 &&\n\t\t\tthis.getV(this.currentTime) < 0.01 &&\n\t\t\tthis.queueParams === undefined &&\n\t\t\tthis.queuePosition === undefined\n\t\t);\n\t}\n\tsetPosition(targetPosition: number) {\n\t\tthis.targetPosition = targetPosition;\n\t\tthis.currentPosition = targetPosition;\n\t\tthis.currentSolver = () => this.targetPosition;\n\t\tthis.getV = () => 0;\n\t}\n\tupdate(delta = 0) {\n\t\tthis.currentTime += delta;\n\t\tthis.currentPosition = this.currentSolver(this.currentTime);\n\t\tif (this.queueParams) {\n\t\t\tthis.queueParams.time -= delta;\n\t\t\tif (this.queueParams.time <= 0) {\n\t\t\t\tthis.updateParams({\n\t\t\t\t\t...this.queueParams,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.queuePosition) {\n\t\t\tthis.queuePosition.time -= delta;\n\t\t\tif (this.queuePosition.time <= 0) {\n\t\t\t\tthis.setTargetPosition(this.queuePosition.position);\n\t\t\t}\n\t\t}\n\t\tif (this.arrived()) {\n\t\t\tthis.setPosition(this.targetPosition);\n\t\t}\n\t}\n\tupdateParams(params: Partial<SpringParams>, delay = 0) {\n\t\tif (delay > 0) {\n\t\t\tthis.queueParams = {\n\t\t\t\t...params,\n\t\t\t\ttime: delay,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.params = {\n\t\t\t\t...this.params,\n\t\t\t\t...params,\n\t\t\t};\n\t\t\tthis.resetSolver();\n\t\t}\n\t}\n\tsetTargetPosition(targetPosition: number, delay = 0) {\n\t\tif (delay > 0) {\n\t\t\tthis.queuePosition = {\n\t\t\t\tposition: targetPosition,\n\t\t\t\ttime: delay,\n\t\t\t};\n\t\t} else {\n\t\t\tthis.queuePosition = undefined;\n\t\t\tthis.targetPosition = targetPosition;\n\t\t\tthis.resetSolver();\n\t\t}\n\t}\n\tgetCurrentPosition() {\n\t\treturn this.currentPosition;\n\t}\n}\n\nfunction solveSpring(\n\tfrom: number,\n\tvelocity: number,\n\tto: number,\n\tdelay: seconds = 0,\n\tparams?: Partial<SpringParams>,\n): (t: seconds) => number {\n\tconst soft = params?.soft ?? false;\n\tconst stiffness = params?.stiffness ?? 100;\n\tconst damping = params?.damping ?? 10;\n\tconst mass = params?.mass ?? 1;\n\tconst delta = to - from;\n\tif (soft || 1.0 <= damping / (2.0 * Math.sqrt(stiffness * mass))) {\n\t\tconst angular_frequency = -Math.sqrt(stiffness / mass);\n\t\tconst leftover = -angular_frequency * delta - velocity;\n\t\treturn (t: seconds) => {\n\t\t\tt -= delay;\n\t\t\tif (t < 0) return from;\n\t\t\treturn to - (delta + t * leftover) * Math.E ** (t * angular_frequency);\n\t\t};\n\t} else {\n\t\tconst damping_frequency = Math.sqrt(\n\t\t\t4.0 * mass * stiffness - damping ** 2.0,\n\t\t);\n\t\tconst leftover =\n\t\t\t(damping * delta - 2.0 * mass * velocity) / damping_frequency;\n\t\tconst dfm = (0.5 * damping_frequency) / mass;\n\t\tconst dm = -(0.5 * damping) / mass;\n\t\treturn (t: seconds) => {\n\t\t\tt -= delay;\n\t\t\tif (t < 0) return from;\n\t\t\treturn (\n\t\t\t\tto -\n\t\t\t\t(Math.cos(t * dfm) * delta + Math.sin(t * dfm) * leftover) *\n\t\t\t\t\tMath.E ** (t * dm)\n\t\t\t);\n\t\t};\n\t}\n}\n\nfunction derivative(f: (x: number) => number) {\n\tconst h = 0.001;\n\treturn (x: number) => (f(x + h) - f(x - h)) / (2 * h);\n}\n\nfunction getVelocity(f: (t: seconds) => number): (t: seconds) => number {\n\treturn derivative(f);\n}\n","import { LyricPlayer } from \".\";\nimport { Disposable, HasElement, LyricLine, LyricWord } from \"../interfaces\";\nimport { Spring } from \"../utils/spring\";\n\nconst CJKEXP = /^[\\p{Unified_Ideograph}\\u0800-\\u9FFC]+$/u;\n\ninterface RealWord extends LyricWord {\n\telements: HTMLSpanElement[];\n\telementAnimations: Animation[];\n\twidth: number;\n\theight: number;\n\tshouldEmphasize: boolean;\n}\n\nfunction generateFadeGradient(\n\twidth: number,\n\tbright = \"rgba(0,0,0,1)\",\n\tdark = \"rgba(0,0,0,0.5)\",\n): [string, number, number] {\n\tconst totalAspect = 2 + width;\n\tconst widthInTotal = width / totalAspect;\n\tconst leftPos = (1 - widthInTotal) / 2;\n\treturn [\n\t\t`linear-gradient(to right,${bright} ${leftPos * 100}%,${dark} ${\n\t\t\t(leftPos + widthInTotal) * 100\n\t\t}%)`,\n\t\twidthInTotal,\n\t\ttotalAspect,\n\t];\n}\n\n// 果子在对辉光效果的解释是一种强调(emphasized)效果\n// 条件是一个单词时长大于等于 1s 且长度小于等于 7\nexport function shouldEmphasize(word: LyricWord): boolean {\n\treturn word.endTime - word.startTime >= 1000 && word.word.length <= 7;\n}\n\nexport class LyricLineEl implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate left = 0;\n\tprivate top = 0;\n\tprivate scale = 1;\n\tprivate blur = 0;\n\tprivate delay = 0;\n\tprivate splittedWords: RealWord[] = [];\n\t// 由 LyricPlayer 来设置\n\tlineSize: number[] = [0, 0];\n\treadonly lineTransforms = {\n\t\tposX: new Spring(0),\n\t\tposY: new Spring(0),\n\t\tscale: new Spring(1),\n\t};\n\tconstructor(\n\t\tprivate lyricPlayer: LyricPlayer,\n\t\tprivate lyricLine: LyricLine = {\n\t\t\twords: [],\n\t\t\ttranslatedLyric: \"\",\n\t\t\tromanLyric: \"\",\n\t\t\tstartTime: 0,\n\t\t\tendTime: 0,\n\t\t\tisBG: false,\n\t\t\tisDuet: false,\n\t\t},\n\t) {\n\t\tthis.element.setAttribute(\n\t\t\t\"class\",\n\t\t\tthis.lyricPlayer.style.classes.lyricLine,\n\t\t);\n\t\tif (this.lyricLine.isBG) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t}\n\t\tif (this.lyricLine.isDuet) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine);\n\t\t}\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 歌词行\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 翻译行\n\t\tthis.element.appendChild(document.createElement(\"div\")); // 音译行\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tconst trans = this.element.children[1] as HTMLDivElement;\n\t\tconst roman = this.element.children[2] as HTMLDivElement;\n\t\tmain.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricMainLine);\n\t\ttrans.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricSubLine);\n\t\troman.setAttribute(\"class\", this.lyricPlayer.style.classes.lyricSubLine);\n\t\tthis.rebuildElement();\n\t\tthis.rebuildStyle();\n\t}\n\tprivate isEnabled = false;\n\tenable() {\n\t\tthis.isEnabled = true;\n\t\tthis.element.classList.add(\"active\");\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tword.elementAnimations.forEach((a) => {\n\t\t\t\ta.currentTime = 0;\n\t\t\t\ta.playbackRate = 1;\n\t\t\t\ta.play();\n\t\t\t});\n\t\t});\n\t\tmain.classList.add(\"active\");\n\t}\n\tmeasureSize(): [number, number] {\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"\";\n\t\t\tthis.element.style.visibility = \"hidden\";\n\t\t}\n\t\tconst size: [number, number] = [\n\t\t\tthis.element.clientWidth,\n\t\t\tthis.element.clientHeight,\n\t\t];\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"none\";\n\t\t\tthis.element.style.visibility = \"\";\n\t\t}\n\t\treturn size;\n\t}\n\tdisable() {\n\t\tthis.isEnabled = false;\n\t\tthis.element.classList.remove(\"active\");\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tword.elementAnimations.forEach((a) => {\n\t\t\t\tif (a.id === \"float-word\") {\n\t\t\t\t\ta.playbackRate = -1;\n\t\t\t\t\ta.play();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tmain.classList.remove(\"active\");\n\t}\n\tsetLine(line: LyricLine) {\n\t\tthis.lyricLine = line;\n\t\tif (this.lyricLine.isBG) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t} else {\n\t\t\tthis.element.classList.remove(this.lyricPlayer.style.classes.lyricBgLine);\n\t\t}\n\t\tif (this.lyricLine.isDuet) {\n\t\t\tthis.element.classList.add(this.lyricPlayer.style.classes.lyricDuetLine);\n\t\t} else {\n\t\t\tthis.element.classList.remove(\n\t\t\t\tthis.lyricPlayer.style.classes.lyricDuetLine,\n\t\t\t);\n\t\t}\n\t\tthis.rebuildElement();\n\t\tthis.rebuildStyle();\n\t}\n\tgetLine() {\n\t\treturn this.lyricLine;\n\t}\n\tprivate _hide = true;\n\tprivate lastStyle = \"\";\n\tshow() {\n\t\tthis._hide = false;\n\t\tthis.rebuildStyle();\n\t}\n\thide() {\n\t\tthis._hide = true;\n\t\tthis.rebuildStyle();\n\t}\n\trebuildStyle() {\n\t\tif (this._hide) {\n\t\t\tif (this.lastStyle !== \"display:none;transform:translate(0,-10000px);\") {\n\t\t\t\tthis.lastStyle = \"display:none;transform:translate(0,-10000px);\";\n\t\t\t\tthis.element.setAttribute(\n\t\t\t\t\t\"style\",\n\t\t\t\t\t\"display:none;transform:translate(0,-10000px);\",\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet style = `transform:translate(${this.lineTransforms.posX.getCurrentPosition()}px,${this.lineTransforms.posY.getCurrentPosition()}px) scale(${this.lineTransforms.scale.getCurrentPosition()});`;\n\t\tif (!this.lyricPlayer.getEnableSpring() && this.isInSight) {\n\t\t\tstyle += `transition-delay:${this.delay}ms;`;\n\t\t}\n\t\tstyle += `filter:blur(${Math.min(32, this.blur)}px);`;\n\t\tif (style !== this.lastStyle) {\n\t\t\tthis.lastStyle = style;\n\t\t\tthis.element.setAttribute(\"style\", style);\n\t\t}\n\t}\n\trebuildElement() {\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tconst trans = this.element.children[1] as HTMLDivElement;\n\t\tconst roman = this.element.children[2] as HTMLDivElement;\n\t\tthis.splittedWords = [];\n\t\tthis.lyricLine.words.forEach((word) => {\n\t\t\tconst splited = word.word.split(/\\s+/);\n\t\t\tconst trimmedLength = splited.reduce((pv, cv) => pv + cv.length, 0);\n\t\t\tlet pos = 0;\n\t\t\tsplited.forEach((sub, i) => {\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\t\tword: \" \",\n\t\t\t\t\t\tstartTime: 0,\n\t\t\t\t\t\tendTime: 0,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\telements: [],\n\t\t\t\t\t\telementAnimations: [],\n\t\t\t\t\t\tshouldEmphasize: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis.splittedWords.push({\n\t\t\t\t\tword: sub,\n\t\t\t\t\tstartTime:\n\t\t\t\t\t\tword.startTime +\n\t\t\t\t\t\t((word.endTime - word.startTime) / trimmedLength) * pos,\n\t\t\t\t\tendTime:\n\t\t\t\t\t\tword.startTime +\n\t\t\t\t\t\t((word.endTime - word.startTime) / trimmedLength) *\n\t\t\t\t\t\t\t(pos + sub.length),\n\t\t\t\t\twidth: 0,\n\t\t\t\t\theight: 0,\n\t\t\t\t\telements: [],\n\t\t\t\t\telementAnimations: [],\n\t\t\t\t\tshouldEmphasize: shouldEmphasize(word),\n\t\t\t\t});\n\t\t\t\tpos += sub.length;\n\t\t\t});\n\t\t});\n\t\t// 回收元素以复用\n\t\tconst reusableElements: HTMLElement[] = [];\n\t\tconst reusableTextNodes: Text[] = [];\n\t\tfunction collectNodes(curNode: Node) {\n\t\t\twhile (curNode.firstChild) {\n\t\t\t\tif (curNode.firstChild.nodeType === Node.ELEMENT_NODE)\n\t\t\t\t\treusableElements.push(main.firstChild as HTMLElement);\n\t\t\t\telse if (curNode.firstChild.nodeType === Node.TEXT_NODE)\n\t\t\t\t\treusableTextNodes.push(main.firstChild as Text);\n\t\t\t\tcurNode.removeChild(curNode.firstChild);\n\t\t\t\tcollectNodes(curNode.firstChild);\n\t\t\t}\n\t\t}\n\t\tcollectNodes(main);\n\t\tlet lastWordEl: HTMLSpanElement | null = null;\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tif (word.word.trim().length > 0) {\n\t\t\t\tif (word.shouldEmphasize) {\n\t\t\t\t\tconst wordEl =\n\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\twordEl.className = \"emphasize\";\n\t\t\t\t\tword.elements = [wordEl];\n\t\t\t\t\tfor (const c of word.word) {\n\t\t\t\t\t\tconst charEl =\n\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\tcharEl.className = \"\";\n\t\t\t\t\t\tcharEl.innerText = c;\n\t\t\t\t\t\twordEl.appendChild(charEl);\n\t\t\t\t\t\tword.elements.push(charEl);\n\t\t\t\t\t}\n\t\t\t\t\tword.elementAnimations = this.initEmphasizeAnimation(word);\n\t\t\t\t\tconsole.log(word.word, CJKEXP.test(word.word));\n\t\t\t\t\tif (lastWordEl && !CJKEXP.test(word.word)) {\n\t\t\t\t\t\tif (lastWordEl.childElementCount > 0) {\n\t\t\t\t\t\t\tlastWordEl.appendChild(wordEl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst wholeWordEl =\n\t\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\t\twholeWordEl.className = \"\";\n\t\t\t\t\t\t\tlastWordEl.remove();\n\t\t\t\t\t\t\twholeWordEl.appendChild(lastWordEl);\n\t\t\t\t\t\t\twholeWordEl.appendChild(wordEl);\n\t\t\t\t\t\t\tmain.appendChild(wholeWordEl);\n\t\t\t\t\t\t\tlastWordEl = wholeWordEl;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastWordEl = CJKEXP.test(word.word) ? null : wordEl;\n\t\t\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst wordEl =\n\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\twordEl.className = \"\";\n\t\t\t\t\twordEl.innerText = word.word;\n\t\t\t\t\tword.elements = [wordEl];\n\t\t\t\t\tword.elementAnimations.push(this.initFloatAnimation(word, wordEl));\n\t\t\t\t\tif (lastWordEl) {\n\t\t\t\t\t\tif (lastWordEl.childElementCount > 0) {\n\t\t\t\t\t\t\tlastWordEl.appendChild(wordEl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst wholeWordEl =\n\t\t\t\t\t\t\t\treusableElements.pop() ?? document.createElement(\"span\");\n\t\t\t\t\t\t\twholeWordEl.className = \"\";\n\t\t\t\t\t\t\tlastWordEl.remove();\n\t\t\t\t\t\t\twholeWordEl.appendChild(lastWordEl);\n\t\t\t\t\t\t\twholeWordEl.appendChild(wordEl);\n\t\t\t\t\t\t\tmain.appendChild(wholeWordEl);\n\t\t\t\t\t\t\tlastWordEl = wholeWordEl;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastWordEl = wordEl;\n\t\t\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (word.word.length > 0) {\n\t\t\t\tconst wordEl = reusableTextNodes.pop() ?? document.createTextNode(\" \");\n\t\t\t\tmain.appendChild(wordEl);\n\t\t\t\tlastWordEl = null;\n\t\t\t} else {\n\t\t\t\tlastWordEl = null;\n\t\t\t}\n\t\t});\n\t\ttrans.innerText = this.lyricLine.translatedLyric;\n\t\troman.innerText = this.lyricLine.romanLyric;\n\t}\n\tprivate initFloatAnimation(word: LyricWord, wordEl: HTMLSpanElement) {\n\t\tconst delay = word.startTime - this.lyricLine.startTime;\n\t\tconst duration = Math.max(1000, word.endTime - word.startTime);\n\t\tconst a = wordEl.animate(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttransform: \"translateY(0px)\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttransform: \"translateY(-3%)\",\n\t\t\t\t},\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: isFinite(duration) ? duration : 0,\n\t\t\t\tdelay: isFinite(delay) ? delay : 0,\n\t\t\t\tid: \"float-word\",\n\t\t\t\tcomposite: \"add\",\n\t\t\t\tfill: \"both\",\n\t\t\t},\n\t\t);\n\t\ta.pause();\n\t\treturn a;\n\t}\n\tprivate initEmphasizeAnimation(word: RealWord): Animation[] {\n\t\tconst delay = word.startTime - this.lyricLine.startTime;\n\t\tconst duration = word.endTime - word.startTime;\n\t\treturn word.elements.map((el, i, arr) => {\n\t\t\tif (i === 0) {\n\t\t\t\treturn this.initFloatAnimation(word, el);\n\t\t\t} else {\n\t\t\t\tconst a = el.animate(\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, 0px, 0px)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0 var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 0.5,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, -2%, 20px)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0.2rem var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toffset: 1,\n\t\t\t\t\t\t\ttransform: \"translate3d(0, 0px, 0)\",\n\t\t\t\t\t\t\tfilter: \"drop-shadow(0 0 0 var(--amll-lyric-line-color))\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tduration: Math.max(1000, word.endTime - word.startTime),\n\t\t\t\t\t\tdelay: delay + (duration / (arr.length - 1)) * (i - 1),\n\t\t\t\t\t\tid: \"glow-word\",\n\t\t\t\t\t\titerations: 1,\n\t\t\t\t\t\tcomposite: \"replace\",\n\t\t\t\t\t\tfill: \"both\",\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\ta.pause();\n\t\t\t\treturn a;\n\t\t\t}\n\t\t});\n\t}\n\tupdateMaskImage() {\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"\";\n\t\t\tthis.element.style.visibility = \"hidden\";\n\t\t}\n\t\tthis.splittedWords.forEach((word) => {\n\t\t\tconst wordEl = word.elements[0];\n\t\t\tif (wordEl) {\n\t\t\t\tword.width = wordEl.clientWidth;\n\t\t\t\tword.height = wordEl.clientHeight;\n\t\t\t\tconst [maskImage, _widthInTotal, totalAspect] = generateFadeGradient(\n\t\t\t\t\t16 / word.width,\n\t\t\t\t\t\"rgba(0,0,0,0.75)\",\n\t\t\t\t\t\"rgba(0,0,0,0.25)\",\n\t\t\t\t);\n\t\t\t\tconst totalAspectStr = `${totalAspect * 100}% 100%`;\n\t\t\t\tif (this.lyricPlayer.supportMaskImage) {\n\t\t\t\t\twordEl.style.maskImage = maskImage;\n\t\t\t\t\twordEl.style.maskOrigin = \"left\";\n\t\t\t\t\twordEl.style.maskSize = totalAspectStr;\n\t\t\t\t} else {\n\t\t\t\t\twordEl.style.webkitMaskImage = maskImage;\n\t\t\t\t\twordEl.style.webkitMaskOrigin = \"left\";\n\t\t\t\t\twordEl.style.webkitMaskSize = totalAspectStr;\n\t\t\t\t}\n\t\t\t\tconst w = word.width + 16;\n\t\t\t\tconst maskPos = `clamp(${-w}px,calc(${-w}px + (var(--amll-player-time) - ${\n\t\t\t\t\tword.startTime\n\t\t\t\t})*${\n\t\t\t\t\tw / Math.abs(word.endTime - word.startTime)\n\t\t\t\t}px),0px) 0px, left top`;\n\t\t\t\t// const maskPos = `clamp(0px,${w}px,${w}px) 0px, left top`;\n\t\t\t\twordEl.style.maskPosition = maskPos;\n\t\t\t\twordEl.style.webkitMaskPosition = maskPos;\n\t\t\t}\n\t\t});\n\t\tif (this._hide) {\n\t\t\tthis.element.style.display = \"none\";\n\t\t\tthis.element.style.visibility = \"\";\n\t\t}\n\t}\n\tgetElement() {\n\t\treturn this.element;\n\t}\n\tsetTransform(\n\t\tleft: number = this.left,\n\t\ttop: number = this.top,\n\t\tscale: number = this.scale,\n\t\topacity = 1,\n\t\tblur = 0,\n\t\tforce = false,\n\t\tdelay = 0,\n\t) {\n\t\tthis.left = left;\n\t\tthis.top = top;\n\t\tthis.scale = scale;\n\t\tthis.delay = (delay * 1000) | 0;\n\t\tconst main = this.element.children[0] as HTMLDivElement;\n\t\tmain.style.opacity = `${opacity}`;\n\t\tif (force || !this.lyricPlayer.getEnableSpring()) {\n\t\t\tthis.blur = Math.min(32, blur);\n\t\t\tif (force)\n\t\t\t\tthis.element.classList.add(\n\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t);\n\t\t\tthis.lineTransforms.posX.setPosition(left);\n\t\t\tthis.lineTransforms.posY.setPosition(top);\n\t\t\tthis.lineTransforms.scale.setPosition(scale);\n\t\t\tif (!this.lyricPlayer.getEnableSpring()) this.show();\n\t\t\telse this.rebuildStyle();\n\t\t\tif (force)\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tthis.element.classList.remove(\n\t\t\t\t\t\tthis.lyricPlayer.style.classes.tmpDisableTransition,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t} else {\n\t\t\tthis.lineTransforms.posX.setTargetPosition(left, delay);\n\t\t\tthis.lineTransforms.posY.setTargetPosition(top, delay);\n\t\t\tthis.lineTransforms.scale.setTargetPosition(scale);\n\t\t\tif (this.blur !== Math.min(32, blur)) {\n\t\t\t\tthis.blur = Math.min(32, blur);\n\t\t\t\tthis.element.style.filter = `blur(${Math.min(32, blur)}px)`;\n\t\t\t}\n\t\t}\n\t}\n\tupdate(delta = 0) {\n\t\tif (!this.lyricPlayer.getEnableSpring()) return;\n\t\tthis.lineTransforms.posX.update(delta);\n\t\tthis.lineTransforms.posY.update(delta);\n\t\tthis.lineTransforms.scale.update(delta);\n\t\tif (this.isInSight) {\n\t\t\tthis.show();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\tget isInSight() {\n\t\tconst l = this.lineTransforms.posX.getCurrentPosition();\n\t\tconst t = this.lineTransforms.posY.getCurrentPosition();\n\t\tconst r = l + this.lineSize[0];\n\t\tconst b = t + this.lineSize[1];\n\t\tconst pl = this.lyricPlayer.pos[0];\n\t\tconst pt = this.lyricPlayer.pos[1];\n\t\tconst pr = this.lyricPlayer.pos[0] + this.lyricPlayer.size[0];\n\t\tconst pb = this.lyricPlayer.pos[1] + this.lyricPlayer.size[1];\n\t\treturn !(l > pr || t > pb || r < pl || b < pt);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t}\n}\n","/**\n * @fileoverview\n * 一个播放歌词的组件\n * @author SteveXMH\n */\n\nimport type { Disposable, HasElement, LyricLine } from \"../interfaces\";\nimport { eqSet } from \"../utils/eq-set\";\nimport { SpringParams } from \"../utils/spring\";\nimport { InterludeDots } from \"./interlude-dots\";\nimport { LyricLineEl, shouldEmphasize } from \"./lyric-line\";\nimport { create } from \"jss\";\nimport preset from \"jss-preset-default\";\n\nconst jss = create(preset());\n\n/**\n * 歌词播放组件,本框架的核心组件\n *\n * 尽可能贴切 Apple Music for iPad 的歌词效果设计,且做了力所能及的优化措施\n */\nexport class LyricPlayer extends EventTarget implements HasElement, Disposable {\n\tprivate element: HTMLElement = document.createElement(\"div\");\n\tprivate currentTime = 0;\n\tprivate lyricLines: LyricLine[] = [];\n\tprivate processedLines: LyricLine[] = [];\n\tprivate lyricLinesEl: LyricLineEl[] = [];\n\tprivate lyricLinesSize: Map<LyricLineEl, [number, number]> = new Map();\n\tprivate hotLines: Set<number> = new Set();\n\tprivate bufferedLines: Set<number> = new Set();\n\tprivate scrollToIndex = 0;\n\tprivate resizeObserver: ResizeObserver = new ResizeObserver((e) => {\n\t\tconst rect = e[0].contentRect;\n\t\tthis.size[0] = rect.width;\n\t\tthis.size[1] = rect.height;\n\t\tthis.pos[0] = rect.left;\n\t\tthis.pos[1] = rect.top;\n\t\tthis.rebuildStyle();\n\t\tthis.calcLayout(true);\n\t\tthis.lyricLinesEl.forEach((el) => el.updateMaskImage());\n\t});\n\tprivate posXSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 10,\n\t\tstiffness: 100,\n\t};\n\tprivate posYSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 15,\n\t\tstiffness: 100,\n\t};\n\tprivate scaleSpringParams: Partial<SpringParams> = {\n\t\tmass: 1,\n\t\tdamping: 20,\n\t\tstiffness: 100,\n\t};\n\tprivate enableBlur = true;\n\tprivate interludeDots: InterludeDots;\n\tprivate interludeDotsSize: [number, number] = [0, 0];\n\treadonly supportPlusLighter = CSS.supports(\"mix-blend-mode\", \"plus-lighter\");\n\treadonly supportMaskImage = CSS.supports(\"mask-image\", \"none\");\n\tprivate disableSpring = false;\n\tprivate alignAnchor: \"top\" | \"bottom\" | number = 0.5;\n\treadonly size: [number, number] = [0, 0];\n\treadonly pos: [number, number] = [0, 0];\n\t/**\n\t * 设置是否使用物理弹簧算法实现歌词动画效果,默认启用\n\t *\n\t * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行\n\t *\n\t * 如果不启用,则会回退到基于 `transition` 的过渡效果,对低性能的机器比较友好,但是效果会比较单一\n\t */\n\tsetEnableSpring(enable = true) {\n\t\tthis.disableSpring = !enable;\n\t\tif (enable) {\n\t\t\tthis.element.classList.remove(this.style.classes.disableSpring);\n\t\t} else {\n\t\t\tthis.element.classList.add(this.style.classes.disableSpring);\n\t\t}\n\t\tthis.calcLayout(true);\n\t}\n\t/**\n\t * 获取当前是否启用了物理弹簧\n\t * @returns 是否启用物理弹簧\n\t */\n\tgetEnableSpring() {\n\t\treturn !this.disableSpring;\n\t}\n\tpublic readonly style = jss.createStyleSheet({\n\t\tlyricPlayer: {\n\t\t\tuserSelect: \"none\",\n\t\t\tpadding: \"1rem\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tfontSize: \"max(5vh, 12px)\",\n\t\t\tfontWeight: \"bold\",\n\t\t\twidth: \"100%\",\n\t\t\theight: \"100%\",\n\t\t\toverflow: \"hidden\",\n\t\t\tmaxWidth: \"100%\",\n\t\t\tmaxHeight: \"100%\",\n\t\t\tzIndex: 1,\n\t\t\tcolor: \"var(--amll-lyric-line-color)\",\n\t\t\tmixBlendMode: \"plus-lighter\",\n\t\t\tcontain: \"strict\",\n\t\t},\n\t\tlyricLine: {\n\t\t\tposition: \"absolute\",\n\t\t\ttransformOrigin: \"left\",\n\t\t\tmaxWidth: \"65%\",\n\t\t\tpadding: \"max(2vh, 1rem) 1rem\",\n\t\t\tcontain: \"content\",\n\t\t\ttransition: \"filter 0.25s\",\n\t\t\tmargin: \"max(2vh, 1rem) -1rem\",\n\t\t},\n\t\t\"@media (max-width: 1024px)\": {\n\t\t\tlyricLine: {\n\t\t\t\tmaxWidth: \"75%\",\n\t\t\t\tpadding: \"max(1vh, 1rem) 1rem\",\n\t\t\t\tmargin: \"0 -1rem\",\n\t\t\t},\n\t\t},\n\t\tlyricDuetLine: {\n\t\t\ttextAlign: \"right\",\n\t\t\ttransformOrigin: \"right\",\n\t\t},\n\t\tlyricBgLine: {\n\t\t\topacity: 0,\n\t\t\tfontSize: \"max(50%, 10px)\",\n\t\t\ttransition: \"opacity 0.25s\",\n\t\t\t\"&.active\": {\n\t\t\t\ttransition: \"opacity 0.25s 0.25s\",\n\t\t\t\topacity: 1,\n\t\t\t},\n\t\t},\n\t\tlyricMainLine: {\n\t\t\ttransition: \"opacity 0.3s 0.25s\",\n\t\t\tmargin: \"-1rem\",\n\t\t\tpadding: \"1rem\",\n\t\t\t\"& span\": {\n\t\t\t\tdisplay: \"inline-block\",\n\t\t\t\tmargin: \"-1rem\",\n\t\t\t\tpadding: \"1rem\",\n\t\t\t},\n\t\t\t\"& > span\": {\n\t\t\t\twhiteSpace: \"pre-wrap\",\n\t\t\t\twordBreak: \"keep-all\",\n\t\t\t\tmaxLines: \"1\",\n\t\t\t\t\"&.emphasize\": {\n\t\t\t\t\tmargin: \"-1rem\",\n\t\t\t\t\tpadding: \"1rem\",\n\t\t\t\t\ttransformStyle: \"preserve-3d\",\n\t\t\t\t\tperspective: \"50vw\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tlyricSubLine: {\n\t\t\tfontSize: \"max(50%, 10px)\",\n\t\t\topacity: 0.5,\n\t\t},\n\t\tdisableSpring: {\n\t\t\t\"& > *\": {\n\t\t\t\ttransition: \"filter 0.25s, transform 0.5s\",\n\t\t\t},\n\t\t},\n\t\tinterludeDots: {\n\t\t\theight: \"min(1rem,2.5vh)\",\n\t\t\ttransformOrigin: \"center\",\n\t\t\twidth: \"fit-content\",\n\t\t\tpadding: \"2.5% 0\",\n\t\t\tposition: \"absolute\",\n\t\t\tdisplay: \"flex\",\n\t\t\tgap: \"0.5rem\",\n\t\t\t\"& > *\": {\n\t\t\t\twidth: \"100%\",\n\t\t\t\tdisplay: \"inline-block\",\n\t\t\t\tborderRadius: \"50%\",\n\t\t\t\taspectRatio: \"1 / 1\",\n\t\t\t\tbackgroundColor: \"var(--amll-lyric-line-color)\",\n\t\t\t\tmarginRight: \"4px\",\n\t\t\t},\n\t\t\t\"&.duet\": {\n\t\t\t\tright: \"1rem\",\n\t\t\t\ttransformOrigin: \"center\",\n\t\t\t},\n\t\t},\n\t\t\"@supports (mix-blend-mode: plus-lighter)\": {\n\t\t\tlyricSubLine: {\n\t\t\t\topacity: 0.3,\n\t\t\t},\n\t\t},\n\t\ttmpDisableTransition: {\n\t\t\ttransition: \"none !important\",\n\t\t},\n\t});\n\tprivate onPageShow = () => {\n\t\tthis.calcLayout(true);\n\t};\n\tconstructor() {\n\t\tsuper();\n\t\tthis.interludeDots = new InterludeDots(this);\n\t\tthis.element.setAttribute(\"class\", this.style.classes.lyricPlayer);\n\t\tif (this.disableSpring) {\n\t\t\tthis.element.classList.add(this.style.classes.disableSpring);\n\t\t}\n\t\tthis.rebuildStyle();\n\t\tthis.resizeObserver.observe(this.element);\n\t\tthis.element.appendChild(this.interludeDots.getElement());\n\t\tthis.style.attach();\n\t\tthis.interludeDots.setTransform(0, 200);\n\t\twindow.addEventListener(\"pageshow\", this.onPageShow);\n\t}\n\t/**\n\t * 获取当前播放时间里是否处于间奏区间\n\t * 如果是则会返回单位为毫秒的始末时间\n\t * 否则返回 undefined\n\t *\n\t * 这个只允许内部调用\n\t * @returns [开始时间,结束时间] 或 undefined 如果不处于间奏区间\n\t */\n\tgetCurrentInterlude(): [number, number, number] | undefined {\n\t\tif (this.bufferedLines.size > 0) return undefined;\n\t\tconst currentTime = this.currentTime + 20;\n\t\tconst i = this.scrollToIndex;\n\t\tif (i === 0) {\n\t\t\tif (this.processedLines[0]?.startTime) {\n\t\t\t\tif (this.processedLines[0].startTime > currentTime) {\n\t\t\t\t\treturn [0, this.processedLines[0].startTime, -2];\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (\n\t\t\tthis.processedLines[i]?.endTime &&\n\t\t\tthis.processedLines[i + 1]?.startTime\n\t\t) {\n\t\t\tif (\n\t\t\t\tthis.processedLines[i + 1].startTime > currentTime &&\n\t\t\t\tthis.processedLines[i].endTime < currentTime\n\t\t\t) {\n\t\t\t\treturn [\n\t\t\t\t\tthis.processedLines[i].endTime,\n\t\t\t\t\tthis.processedLines[i + 1].startTime,\n\t\t\t\t\ti,\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\t/**\n\t * 重建样式\n\t *\n\t * 这个只允许内部调用\n\t */\n\trebuildStyle() {\n\t\tlet style = \"\";\n\t\tstyle += \"--amll-lyric-player-width:\";\n\t\tstyle += this.element.clientWidth;\n\t\tstyle += \"px;\";\n\t\tstyle += \"--amll-lyric-player-height:\";\n\t\tstyle += this.element.clientHeight;\n\t\tstyle += \"px;\";\n\t\tstyle += \"--amll-lyric-line-color:\";\n\t\tstyle += \"#FFFFFF;\";\n\t\tstyle += \"--amll-player-time:\";\n\t\tstyle += this.currentTime;\n\t\tstyle += \";\";\n\t\tthis.element.setAttribute(\"style\", style);\n\t}\n\t/**\n\t * 设置是否启用歌词行的模糊效果\n\t * @param enable 是否启用\n\t */\n\tsetEnableBlur(enable: boolean) {\n\t\tif (this.enableBlur === enable) return;\n\t\tthis.enableBlur = enable;\n\t\tthis.calcLayout();\n\t}\n\t/**\n\t * 设置当前播放歌词,要注意传入后这个数组内的信息不得修改,否则会发生错误\n\t * @param lines 歌词数组\n\t */\n\tsetLyricLines(lines: LyricLine[]) {\n\t\tthis.lyricLines = lines;\n\t\tconst timeOffset = 750;\n\t\tthis.processedLines = lines\n\t\t\t.filter(\n\t\t\t\t(line) =>\n\t\t\t\t\tline.words.reduce((pv, cv) => pv + cv.word.trim().length, 0) > 0,\n\t\t\t)\n\t\t\t.map((line, i, lines) => {\n\t\t\t\tif (line.isBG)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...line,\n\t\t\t\t\t};\n\t\t\t\telse {\n\t\t\t\t\tconst lastLine = lines[i - 1];\n\t\t\t\t\tconst pastLine = lines[i - 2];\n\t\t\t\t\tif (lastLine?.isBG && pastLine) {\n\t\t\t\t\t\tif (pastLine.endTime < line.startTime) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\t\tMath.max(pastLine.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (lastLine?.endTime) {\n\t\t\t\t\t\tif (lastLine.endTime < line.startTime) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...line,\n\t\t\t\t\t\t\t\tstartTime:\n\t\t\t\t\t\t\t\t\tMath.max(lastLine?.endTime, line.startTime - timeOffset) ||\n\t\t\t\t\t\t\t\t\tline.startTime,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...line,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\tthis.processedLines.forEach((line, i, lines) => {\n\t\t\tconst nextLine = lines[i + 1];\n\t\t\tconst lastWord = line.words[line.words.length - 1];\n\t\t\tif (lastWord && shouldEmphasize(lastWord)) {\n\t\t\t\tif (nextLine) {\n\t\t\t\t\tif (nextLine.startTime > line.endTime) {\n\t\t\t\t\t\tline.endTime = Math.min(line.endTime + 1500, nextLine.startTime);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tline.endTime = line.endTime + 1500;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, i, lines) => {\n\t\t\tif (line.isBG) return;\n\t\t\tconst nextLine = lines[i + 1];\n\t\t\tif (nextLine?.isBG) {\n\t\t\t\tnextLine.startTime = Math.min(nextLine.startTime, line.startTime);\n\t\t\t}\n\t\t});\n\t\tthis.lyricLinesEl.forEach((el) => el.dispose());\n\t\tthis.lyricLinesEl = this.processedLines.map(\n\t\t\t(line) => new LyricLineEl(this, line),\n\t\t);\n\t\tthis.lyricLinesEl.forEach((el) => {\n\t\t\tthis.element.appendChild(el.getElement());\n\t\t\tel.updateMaskImage();\n\t\t});\n\t\tthis.hotLines.clear();\n\t\tthis.bufferedLines.clear();\n\t\tthis.setLinePosXSpringParams({});\n\t\tthis.setLinePosYSpringParams({});\n\t\tthis.setLineScaleSpringParams({});\n\t\tthis.setCurrentTime(0, true);\n\t\tthis.calcLayout(true);\n\t}\n\t/**\n\t * 重新布局定位歌词行的位置,调用完成后再逐帧调用 `update`\n\t * 函数即可让歌词通过动画移动到目标位置。\n\t *\n\t * 此函数还有一个 `reflow` 参数,用于指定是否需要重新计算布局\n\t *\n\t * 因为计算布局必定会导致浏览器重排布局,所以会大幅度影响流畅度和性能,故请只在以下情况下将其​设置为 true:\n\t *\n\t * 1. 歌词页面大小发生改变时(这个组件会自行处理)\n\t * 2. 加载了新的歌词时(不论前后歌词是否完全一样)\n\t * 3. 用户自行跳转了歌曲播放位置(不论距离远近)\n\t *\n\t * @param reflow 是否进行重新布局(重新计算每行歌词大小)\n\t */\n\tcalcLayout(reflow = false) {\n\t\tif (reflow) {\n\t\t\tthis.lyricLinesEl.forEach((el) => {\n\t\t\t\tconst size: [number, number] = el.measureSize();\n\t\t\t\tthis.lyricLinesSize.set(el, size);\n\t\t\t\tel.lineSize = size;\n\t\t\t});\n\t\t\tthis.interludeDotsSize[0] = this.interludeDots.getElement().clientWidth;\n\t\t\tthis.interludeDotsSize[1] = this.interludeDots.getElement().clientHeight;\n\t\t}\n\t\tconst SCALE_ASPECT = 0.95;\n\t\tconst scrollOffset = this.lyricLinesEl\n\t\t\t.slice(0, this.scrollToIndex)\n\t\t\t.reduce(\n\t\t\t\t(acc, el) =>\n\t\t\t\t\tacc + (el.getLine().isBG ? 0 : this.lyricLinesSize.get(el)?.[1] ?? 0),\n\t\t\t\t0,\n\t\t\t);\n\t\tlet curPos = -scrollOffset;\n\t\tif (this.alignAnchor === \"bottom\") {\n\t\t\tcurPos += this.element.clientHeight / 2;\n\t\t\tconst curLine = this.lyricLinesEl[this.scrollToIndex];\n\t\t\tif (curLine) {\n\t\t\t\tconst lineHeight = this.lyricLinesSize.get(curLine)?.[1] ?? 0;\n\t\t\t\tcurPos -= lineHeight / 2;\n\t\t\t}\n\t\t} else if (typeof this.alignAnchor === \"number\") {\n\t\t\tcurPos += this.element.clientHeight * this.alignAnchor;\n\t\t\tconst curLine = this.lyricLinesEl[this.scrollToIndex];\n\t\t\tif (curLine) {\n\t\t\t\tconst lineHeight = this.lyricLinesSize.get(curLine)?.[1] ?? 0;\n\t\t\t\tcurPos -= lineHeight / 2;\n\t\t\t}\n\t\t}\n\t\tconst interlude = this.getCurrentInterlude();\n\t\tlet interludeDuration = 0;\n\t\tif (interlude) {\n\t\t\tinterludeDuration = interlude[1] - interlude[0];\n\t\t\tif (interludeDuration >= 5000) {\n\t\t\t\tconst nextLine = this.lyricLinesEl[interlude[2] + 1];\n\t\t\t\tif (nextLine) {\n\t\t\t\t\tcurPos -= this.lyricLinesSize.get(nextLine)?.[1] ?? 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst latestIndex = Math.max(...this.bufferedLines);\n\t\tlet delay = 0;\n\t\tlet setDots = false;\n\t\tthis.lyricLinesEl.forEach((el, i) => {\n\t\t\tconst hasBuffered = this.bufferedLines.has(i);\n\t\t\tconst isActive =\n\t\t\t\thasBuffered || (i >= this.scrollToIndex && i < latestIndex);\n\t\t\tconst line = el.getLine();\n\t\t\tlet left = 0;\n\t\t\tif (line.isDuet) {\n\t\t\t\tleft = this.size[0] - (this.lyricLinesSize.get(el)?.[0] ?? 0);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!setDots &&\n\t\t\t\tinterludeDuration >= 5000 &&\n\t\t\t\t((i === this.scrollToIndex && interlude?.[2] === -2) ||\n\t\t\t\t\ti === this.scrollToIndex + 1)\n\t\t\t) {\n\t\t\t\tsetDots = true;\n\t\t\t\tthis.interludeDots.setTransform(0, curPos);\n\t\t\t\tif (interlude) {\n\t\t\t\t\tthis.interludeDots.setInterlude([interlude[0], interlude[1]]);\n\t\t\t\t}\n\t\t\t\tcurPos += this.interludeDotsSize[1];\n\t\t\t}\n\t\t\tel.setTransform(\n\t\t\t\tleft,\n\t\t\t\tcurPos,\n\t\t\t\tisActive ? 1 : SCALE_ASPECT,\n\t\t\t\thasBuffered ? 1 : 1 / 3,\n\t\t\t\tthis.enableBlur\n\t\t\t\t\t? 3 *\n\t\t\t\t\t (isActive\n\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t: 1 +\n\t\t\t\t\t\t\t (i < this.scrollToIndex\n\t\t\t\t\t\t\t\t\t? Math.abs(this.scrollToIndex - i)\n\t\t\t\t\t\t\t\t\t: Math.abs(i - Math.max(this.scrollToIndex, latestIndex))))\n\t\t\t\t\t: 0,\n\t\t\t\treflow,\n\t\t\t\tdelay,\n\t\t\t);\n\t\t\tif (line.isBG && isActive) {\n\t\t\t\tcurPos += this.lyricLinesSize.get(el)?.[1] ?? 0;\n\t\t\t} else if (!line.isBG) {\n\t\t\t\tcurPos += this.lyricLinesSize.get(el)?.[1] ?? 0;\n\t\t\t}\n\t\t\tif (curPos >= 0) {\n\t\t\t\tdelay += 0.05;\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t * 获取当前歌词的播放位置\n\t *\n\t * 一般和最后调用 `setCurrentTime` 给予的参数一样\n\t * @returns 当前播放位置\n\t */\n\tgetCurrentTime() {\n\t\treturn this.currentTime;\n\t}\n\t/**\n\t * 获取当前歌词数组\n\t *\n\t * 一般和最后调用 `setLyricLines` 给予的参数一样\n\t * @returns 当前歌词数组\n\t */\n\tgetLyricLines() {\n\t\treturn this.lyricLines;\n\t}\n\tgetElement(): HTMLElement {\n\t\treturn this.element;\n\t}\n\t/**\n\t * 设置歌词行的对齐方式,默认为 `top`\n\t *\n\t * - 设置成 `top` 的话歌词将会向组件顶部对齐\n\t * - 设置成 `bottom` 的话歌词将会向组件底部对齐\n\t * - 设置成 [0.0-1.0] 之间任意数字的话则会根据当前组件高度从顶部向下位移为对齐位置垂直居中对齐\n\t * @param alignAnchor 歌词行对齐方式,详情见函数说明\n\t */\n\tsetAlignAnchor(alignAnchor: \"top\" | \"bottom\" | number) {\n\t\tthis.alignAnchor = alignAnchor;\n\t}\n\t/**\n\t * 设置当前播放进度,单位为毫秒且**必须是整数**,此时将会更新内部的歌词进度信息\n\t * 内部会根据调用间隔和播放进度自动决定如何滚动和显示歌词,所以这个的调用频率越快越准确越好\n\t *\n\t * 调用完成后,可以每帧调用 `update` 函数来执行歌词动画效果\n\t * @param time 当前播放进度,单位为毫秒\n\t */\n\tsetCurrentTime(time: number, isSeek = false) {\n\t\t// 我在这里定义了歌词的选择状态:\n\t\t// 普通行:当前不处于时间范围内的歌词行\n\t\t// 热行:当前绝对处于播放时间内的歌词行,且一般会被立刻加入到缓冲行中\n\t\t// 缓冲行:一般处于播放时间后的歌词行,会因为当前播放状态的缘故推迟解除状态\n\n\t\t// 然后我们需要让歌词行为如下:\n\t\t// 如果当前仍有缓冲行的情况下加入新热行,则不会解除当前缓冲行,且也不会修改当前滚动位置\n\t\t// 如果当前所有缓冲行都将被删除且没有新热行加入,则删除所有缓冲行,且也不会修改当前滚动位置\n\t\t// 如果当前所有缓冲行都将被删除且有新热行加入,则删除所有缓冲行并加入新热行作为缓冲行,然后修改当前滚动位置\n\t\tthis.currentTime = time;\n\t\tthis.element.style.setProperty(\"--amll-player-time\", `${time}`);\n\t\tconst removedHotIds = new Set<number>();\n\t\tconst removedIds = new Set<number>();\n\t\tconst addedIds = new Set<number>();\n\n\t\t// 先检索当前已经超出时间范围的缓冲行,列入待删除集内\n\t\tthis.hotLines.forEach((lastHotId) => {\n\t\t\tconst line = this.processedLines[lastHotId];\n\t\t\tif (line) {\n\t\t\t\tif (line.isBG) return;\n\t\t\t\tconst nextLine = this.processedLines[lastHotId + 1];\n\t\t\t\tif (nextLine?.isBG) {\n\t\t\t\t\tconst startTime = Math.min(line.startTime, nextLine?.startTime);\n\t\t\t\t\tconst endTime = Math.max(line.endTime, nextLine?.endTime);\n\t\t\t\t\tif (startTime > time || endTime <= time) {\n\t\t\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\t\t\tthis.hotLines.delete(lastHotId + 1);\n\t\t\t\t\t\tremovedHotIds.add(lastHotId + 1);\n\t\t\t\t\t\tif (isSeek) {\n\t\t\t\t\t\t\tthis.lyricLinesEl[lastHotId].disable();\n\t\t\t\t\t\t\tthis.lyricLinesEl[lastHotId + 1].disable();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (line.startTime > time || line.endTime <= time) {\n\t\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\t\tif (isSeek) this.lyricLinesEl[lastHotId].disable();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.hotLines.delete(lastHotId);\n\t\t\t\tremovedHotIds.add(lastHotId);\n\t\t\t\tif (isSeek) this.lyricLinesEl[lastHotId].disable();\n\t\t\t}\n\t\t});\n\t\tthis.processedLines.forEach((line, id, arr) => {\n\t\t\tif (!line.isBG && line.startTime <= time && line.endTime > time) {\n\t\t\t\tif (!this.hotLines.has(id)) {\n\t\t\t\t\tthis.hotLines.add(id);\n\t\t\t\t\taddedIds.add(id);\n\t\t\t\t\tif (isSeek) this.lyricLinesEl[id].enable();\n\t\t\t\t\tif (arr[id + 1]?.isBG) {\n\t\t\t\t\t\tthis.hotLines.add(id + 1);\n\t\t\t\t\t\taddedIds.add(id + 1);\n\t\t\t\t\t\tif (isSeek) this.lyricLinesEl[id + 1].enable();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.bufferedLines.forEach((v) => {\n\t\t\tif (!this.hotLines.has(v)) {\n\t\t\t\tremovedIds.add(v);\n\t\t\t\tif (isSeek) this.lyricLinesEl[v].disable();\n\t\t\t}\n\t\t});\n\t\tif (isSeek) {\n\t\t\tif (this.bufferedLines.size > 0) {\n\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t} else {\n\t\t\t\tthis.scrollToIndex = this.processedLines.findIndex(\n\t\t\t\t\t(line) => line.startTime >= time,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.bufferedLines.clear();\n\t\t\tthis.hotLines.forEach((v) => this.bufferedLines.add(v));\n\t\t\tthis.calcLayout(true);\n\t\t} else if (removedIds.size > 0 || addedIds.size > 0) {\n\t\t\tif (removedIds.size === 0 && addedIds.size > 0) {\n\t\t\t\taddedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.add(v);\n\t\t\t\t\tthis.lyricLinesEl[v].enable();\n\t\t\t\t});\n\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t} else if (addedIds.size === 0 && removedIds.size > 0) {\n\t\t\t\tif (eqSet(removedIds, this.bufferedLines)) {\n\t\t\t\t\tthis.bufferedLines.forEach((v) => {\n\t\t\t\t\t\tif (!this.hotLines.has(v)) {\n\t\t\t\t\t\t\tthis.bufferedLines.delete(v);\n\t\t\t\t\t\t\tthis.lyricLinesEl[v].disable();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.add(v);\n\t\t\t\t\tthis.lyricLinesEl[v].enable();\n\t\t\t\t});\n\t\t\t\tremovedIds.forEach((v) => {\n\t\t\t\t\tthis.bufferedLines.delete(v);\n\t\t\t\t\tthis.lyricLinesEl[v].disable();\n\t\t\t\t});\n\t\t\t\tif (this.bufferedLines.size > 0)\n\t\t\t\t\tthis.scrollToIndex = Math.min(...this.bufferedLines);\n\t\t\t}\n\t\t\tthis.calcLayout();\n\t\t}\n\t}\n\t/**\n\t * 更新动画,这个函数应该被逐帧调用或者在以下情况下调用一次:\n\t *\n\t * 1. 刚刚调用完设置歌词函数的时候\n\t * @param delta 距离上一次被调用到现在的时长,单位为毫秒(可为浮点数)\n\t */\n\tupdate(delta = 0) {\n\t\tconst deltaS = delta / 1000;\n\t\tthis.interludeDots.update(delta);\n\t\tthis.lyricLinesEl.forEach((line) => line.update(deltaS));\n\t}\n\t/**\n\t * 设置所有歌词行在横坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLinePosXSpringParams(params: Partial<SpringParams>) {\n\t\tthis.posXSpringParams = {\n\t\t\t...this.posXSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.posX.updateParams(this.posXSpringParams),\n\t\t);\n\t}\n\t/**\n\t * 设置所有歌词行在​纵坐标上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLinePosYSpringParams(params: Partial<SpringParams>) {\n\t\tthis.posYSpringParams = {\n\t\t\t...this.posYSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.posY.updateParams(this.posYSpringParams),\n\t\t);\n\t}\n\t/**\n\t * 设置所有歌词行在​缩放大小上的弹簧属性,包括重量、弹力和阻力。\n\t *\n\t * @param params 需要设置的弹簧属性,提供的属性将会覆盖原来的属性,未提供的属性将会保持原样\n\t */\n\tsetLineScaleSpringParams(params: Partial<SpringParams>) {\n\t\tthis.scaleSpringParams = {\n\t\t\t...this.scaleSpringParams,\n\t\t\t...params,\n\t\t};\n\t\tthis.lyricLinesEl.forEach((line) =>\n\t\t\tline.lineTransforms.scale.updateParams(this.scaleSpringParams),\n\t\t);\n\t}\n\tdispose(): void {\n\t\tthis.element.remove();\n\t\tthis.resizeObserver.disconnect();\n\t\tthis.style.detach();\n\t\tthis.lyricLinesEl.forEach((el) => el.dispose());\n\t\twindow.removeEventListener(\"pageshow\", this.onPageShow);\n\t}\n}\n"],"names":["timeRegexp","parseTimespan","timeSpan","matches","hour","min","sec","parseTTML","ttmlText","ttmlDoc","mainAgentId","agent","id","result","lineEl","line","curBGLine","wordNode","word","wordEl","role","bgLine","firstWord","lastWord","TimedContainer","Container","PixiRenderer","canvas","bounds","Application","delta","lastContainer","s1","s2","s3","s4","maxSize","speed","scale","minBorder","c0","ColorMatrixFilter","c1","c2","BlurFilter","fps","albumUrl","tex","Texture","container","Sprite","BackgroundRender","eqSet","xs","ys","x","easeInOutBack","clamp","cur","max","InterludeDots","lyricPlayer","left","top","interlude","curStyle","interludeDuration","currentDuration","breatheDuration","globalOpacity","dot0Opacity","dot1Opacity","dot2Opacity","Spring","currentPosition","curV","solveSpring","getVelocity","targetPosition","params","delay","from","velocity","to","soft","stiffness","damping","mass","angular_frequency","leftover","t","damping_frequency","dfm","dm","derivative","f","CJKEXP","generateFadeGradient","width","bright","dark","totalAspect","widthInTotal","leftPos","shouldEmphasize","LyricLineEl","lyricLine","main","trans","roman","a","size","style","splited","trimmedLength","pv","cv","pos","sub","i","reusableElements","reusableTextNodes","collectNodes","curNode","lastWordEl","c","charEl","wholeWordEl","duration","el","arr","maskImage","_widthInTotal","totalAspectStr","w","maskPos","opacity","blur","force","l","r","b","pl","pt","pr","pb","jss","create","preset","LyricPlayer","rect","enable","currentTime","lines","timeOffset","lastLine","pastLine","nextLine","reflow","SCALE_ASPECT","curPos","acc","curLine","lineHeight","latestIndex","setDots","hasBuffered","isActive","alignAnchor","time","isSeek","removedHotIds","removedIds","addedIds","lastHotId","startTime","endTime","v","deltaS"],"mappings":"iTAEMA,EACL,uEACD,SAASC,EAAcC,EAA0B,CAC1C,MAAAC,EAAUH,EAAW,KAAKE,CAAQ,EACxC,GAAIC,EAAS,CACZ,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