From 267b21226a11930b1dd89508f326956c1e106928 Mon Sep 17 00:00:00 2001 From: Harvey Zhao Date: Wed, 16 Sep 2026 00:14:48 +0800 Subject: [PATCH] fix(danmuku): [PKG-DANMUKU-START-01] retain the initial playback sampling interval --- docs/compiled/artplayer-plugin-danmuku.js | 2 +- .../artplayer-plugin-danmuku.legacy.js | 2 +- docs/compiled/artplayer-plugin-danmuku.mjs | 17 +- .../artplayer-plugin-danmuku/index.js | 17 +- .../artplayer-plugin-danmuku/ARCHITECTURE.md | 11 +- .../dist/artplayer-plugin-danmuku.js | 2 +- .../dist/artplayer-plugin-danmuku.legacy.js | 2 +- .../dist/artplayer-plugin-danmuku.mjs | 17 +- .../src/sampling-window.ts | 5 + .../artplayer-plugin-danmuku/src/scheduler.ts | 15 +- .../baselines/danmuku-start-validation.json | 8739 +++++++++++++++++ ...09-16-PKG-DANMUKU-START-01-first-sample.md | 67 + refactor/plan.md | 14 +- refactor/progress.md | 13 + refactor/risk-table.md | 2 +- refactor/risks.json | 16 +- refactor/tasks.json | 30 +- .../browser/danmuku-timing-diagnostic.spec.js | 25 +- test/danmuku-scheduler.test.js | 34 + 19 files changed, 9004 insertions(+), 26 deletions(-) create mode 100644 refactor/baselines/danmuku-start-validation.json create mode 100644 refactor/changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md diff --git a/docs/compiled/artplayer-plugin-danmuku.js b/docs/compiled/artplayer-plugin-danmuku.js index aa21b5c86..712bb2bea 100644 --- a/docs/compiled/artplayer-plugin-danmuku.js +++ b/docs/compiled/artplayer-plugin-danmuku.js @@ -4,4 +4,4 @@ * (c) 2017-2026 Harvey Zhao * Released under the MIT License. */ -!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.artplayerPluginDanmuku=e(),define(function(){return t.artplayerPluginDanmuku})):(t="undefined"!==typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";function t(t){return t instanceof Promise||"[object Promise]"===Object.prototype.toString.call(t)}function e(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:return 2;case 5:return 1}}function i(t){if("string"!==typeof t)return[];const i=t.matchAll(/]*?p="(?

[^"]+)"[^>]*>(?.*?)<\/d>/gs);return Array.from(i).map(t=>{const i=t.groups.p.split(",");if(i.length>=8){return{text:t.groups.text.trim().replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&"),time:Number(i[0]),mode:e(Number(i[1])),fontSize:Number(i[2]),color:`#${Number(i[3]).toString(16)}`,timestamp:Number(i[4]),pool:Number(i[5]),userID:i[6],rowID:Number(i[7])}}return null}).filter(Boolean)}function n({data:t}){const{xml:e,id:n}=t,s=i(e);globalThis.postMessage({danmus:s,id:n})}let s=0;function a(t,{signal:a,onCancel:r}={}){return new Promise((o,l)=>{let d,h,c,p=!1;const u=++s,m=()=>g(void 0,function(t){if(void 0!==t?.reason)return t.reason;const e=new Error("Bilibili Danmu loading cancelled");return e.name="AbortError",e}(a));function f(){let t,e=!1;try{if(d){const t=d;d=void 0,t.onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate()}}catch(i){t=i,e=!0}if(void 0!==h){const n=h;h=void 0;try{URL.revokeObjectURL(n)}catch(i){e||(t=i),e=!0}}if(e)throw t}function g(t,e){if(p)return;p=!0;let i=arguments.length>1;a?.removeEventListener("abort",m),c?.();try{f()}catch(n){i||(e=n),i=!0}i?l(e):o(t)}function y(t,e){if(!p){console.error("Error parsing Bilibili Danmu:",e);try{g(i(t))}catch(n){g(void 0,n)}}}a?.aborted?m():(a?.addEventListener("abort",m),c=r?.(m),p?c?.():async function(){const s=a?await fetch(t,{signal:a}):await fetch(t);if(p)return;const r=await s.text();if(!p)try{const t=`\n ${e.toString()}\n ${i.toString()}\n onmessage = ${n.toString()}\n `;if(h=URL.createObjectURL(new Blob([t],{type:"application/javascript"})),p)return void f();if(d=new Worker(h),p)return void f();d.onmessage=t=>{if(p||t.data?.id!==u)return;const{danmus:e}=t.data;Array.isArray(e)?g(e):g(void 0,new Error("Invalid Bilibili Danmu worker response"))},d.onerror=t=>{t.preventDefault?.(),y(r,t.error||t)},d.onmessageerror=t=>y(r,t.error||t),d.postMessage({xml:r,id:u})}catch(o){y(r,o)}}().catch(t=>g(void 0,t)))})}const r=new WeakMap,o=Symbol("cancelled danmuku input");function l(t){return r.has(t)||r.set(t,{closed:!1,tasks:new Set,emitting:[]}),r.get(t)}function d(t){const e=l(t),i=e.emitting[e.emitting.length-1];return!e.closed&&!t.art.isDestroy&&(!i||i.active())}function h(t){const e=l(t);e.closed=!0;for(const i of[...e.tasks])i.cancel()}function c(t,e,i){const n=t.states[e]||[];for(let s=0;s{const s=n.$ref.offsetTop,a=this.owner.getLeft(n.$ref)-i,r=n.$ref.clientHeight,o=n.$ref.clientWidth,l=a+o,d=e-l,h=l/n.$restTime,c={};c.top=s,c.left=a,c.height=r,c.width=o,c.right=d,c.speed=h,c.distance=l,c.time=n.$restTime,c.mode=n.mode,t.push(c)}),t}left(t){const e=t.getBoundingClientRect();return this.owner.isRotate?e.top:e.left}makeWait(t){this.owner.setState(t,"wait"),t.$ref&&(t.$ref.style.cssText=this.owner.constructor.cssText,t.$ref.style.visibility="hidden",t.$ref.style.marginLeft="0px",t.$ref.style.transform="translateX(0px)",t.$ref.style.transition="transform 0s linear 0s",this.owner.$refs.push(t.$ref),t.$ref=null)}resize(){const{clientWidth:t}=this.owner.$player;this.owner.filter("stop",e=>{if(0===e.mode)e.$ref.style.left=`${t}px`}),this.owner.filter("emit",e=>{switch(e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.left=`${t}px`,e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}})}continue(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("stop",e=>{switch(this.owner.setState(e,"emit"),e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}}),this}suspend(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("emit",e=>{switch(this.owner.setState(e,"stop"),e.mode){case 0:{const i=t-(this.owner.getLeft(e.$ref)-this.owner.getLeft(this.owner.$player));e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition="transform 0s linear 0s";break}}}),this}prepare(t,e){const i=this.owner,n=i.$ref;return e.danmu=t,e.ref=n,t.$ref=n,n.textContent=t.text,i.$danmuku.appendChild(n),n.style.opacity=i.option.opacity,n.style.fontSize=`${i.fontSize}px`,n.style.color=t.color,n.style.border=t.border?`1px solid ${t.color}`:null,n.style.backgroundColor=t.border?"rgb(0 0 0 / 50%)":null,i.utils.setStyles(n,t.style),n}place(t,e,i,n,s){switch(e.style.top=`${i}px`,e.style.visibility="visible",e.dataset.mode=t.mode,e.dataset.id=t.id||"",t.mode){case 0:e.style.left=`${s}px`,e.style.marginLeft="0px",e.style.transform=`translateX(${-n}px)`,e.style.transition=`transform ${t.$restTime}s linear 0s`;break;case 1:case 2:e.style.left="50%",e.style.marginLeft=`-${e.clientWidth/2}px`}}release(t){const{danmu:e,ref:i}=t;i&&e.$ref===i&&(i.style.cssText=this.owner.constructor.cssText,i.style.visibility="hidden",this.owner.$refs.push(i),e.$ref=null),t.ref=null}clear(){this.destroy(),this.owner.$refs=[],this.owner.$danmuku.textContent=""}destroy(){for(const t of this.nodes)t.parentElement&&t.parentElement.removeChild(t);for(const t of this.owner.queue)t.$ref=null;this.owner.$refs.length=0,this.nodes.clear()}}function u({target:t,visibles:e,clientWidth:i,clientHeight:n,marginBottom:s,marginTop:a,antiOverlap:r}){const o=n-s,l=e.filter(e=>e.mode===t.mode&&e.top<=o).sort((t,e)=>t.top-e.top);if(0===l.length)return 2===t.mode?o-t.height:a;if(l.unshift({type:"top",top:0,left:0,right:0,height:a,width:i,speed:0,distance:i}),l.push({type:"bottom",top:o,left:0,right:0,height:s,width:i,speed:0,distance:i}),2===t.mode)for(let h=l.length-2;h>=0;h-=1){const e=l[h],i=l[h+1],n=e.top+e.height;if(i.top-n>=t.height)return i.top-t.height}else for(let h=1;h=t.height)return n}const d=[];for(let h=1;h{const i=Math.min(...e.map(t=>t.right)),n=Math.min(...t.map(t=>t.right));return i*e.length-n*t.length});break;case 1:case 2:d.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return d[0][0].top}switch(t.mode){case 0:{const e=d.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}class m{constructor(){this.rows=new Set,this.waiting=new Set,this.visibility=()=>this.clear()}capture(t,e,i){const n=t.$player.ownerDocument;if(n!==this.document&&(this.document?.removeEventListener("visibilitychange",this.visibility),this.document=n,n?.addEventListener("visibilitychange",this.visibility),this.clear()),!Number.isFinite(i)||"hidden"===n?.visibilityState||t.art.video?.seeking)return this.clear(),e;const s=this.time,a=this.rows,r=this.waiting;if(this.time=i,this.rows=new Set(e),this.waiting=new Set(t.states.wait),void 0===s||i<=s)return e;const o=t.states.wait.filter(t=>r.has(t)&&!a.has(t)&&t.time>=s-.1&&t.time"ready"===t.$state),...o,...e.filter(t=>"ready"!==t.$state)]}clear(){this.time=void 0,this.rows.clear(),this.waiting.clear()}destroy(){this.document?.removeEventListener("visibilitychange",this.visibility),this.document=void 0,this.clear()}}class f{constructor(){this.pending=new Set,this.reserved=new Set}capture(t,e){for(const i of t)this.reserved.has(i)||e.has(i)||this.pending.add(i)}take(){const t=[],e=[];for(const n of this.pending)"ready"===n.$state?t.push(n):"wait"===n.$state&&e.push(n);this.pending.clear();const i=[...t,...e];return this.reserved=new Set(i),i}complete(){this.reserved.clear()}clear(){this.pending.clear(),this.reserved.clear()}}const g=Symbol("cancelled danmuku frame");class y{constructor(t){this.owner=t,this.generation=0,this.starts=0,this.frame=null,this.operation=null,this.closed=!1,this.running=!1,this.fault=!1,this.failedItems=new Set,this.buffer=new f,this.sampling=new m}active(t){const e=this.owner;return!this.closed&&!this.fault&&!e.art.isDestroy&&!e.isStop&&!e.isHide&&t.generation===this.generation}release(t){this.owner.renderer.release(t)}invalidate(){if(this.generation++,null!==this.frame&&window.cancelAnimationFrame(this.frame),this.frame=null,this.owner.timer=null,this.operation){const t=this.operation;this.operation=null,t.cancel(),this.release(t)}this.owner.workerClient?.cancel(),this.failedItems.clear(),this.buffer.clear(),this.sampling.clear()}report(t){try{this.owner.art.emit("artplayerPluginDanmuku:error",t)}catch(e){console.warn("Failed to report danmuku scheduling error:",e)}}fail(t){this.closed||this.fault||(this.fault=!0,this.invalidate(),this.report(t))}recover(){if(!this.closed&&!this.owner.art.isDestroy&&(this.failedItems.clear(),this.fault))try{this.owner.workerClient?.dispose(),this.owner.createWorker(),this.fault=!1}catch(t){this.report(t)}}schedule(){const t=this.owner;!this.running||this.closed||this.fault||t.art.isDestroy||t.isStop||null!==this.frame||(this.frame=window.requestAnimationFrame(()=>{if(this.frame=null,t.timer=null,this.closed||this.fault||t.isStop||t.art.isDestroy)return;const e=this.generation;try{if(t.art.playing&&!t.isHide){t.filter("emit",e=>{const i=Date.now();e.$restTime-=(i-e.$lastStartTime)/1e3,e.$lastStartTime=i,e.$restTime<=0&&t.makeWait(e)});const i=t.art.currentTime,n=t.readys;if(e!==this.generation)return;this.buffer.capture(this.sampling.capture(t,n,i),this.failedItems)}}catch(r){return void(e===this.generation&&this.fail(r))}if(this.schedule(),this.operation||!t.art.playing||t.isHide)return;const i=this.buffer.take();if(!i.length)return;let n;const s=new Promise(t=>n=()=>t(g)),a={generation:this.generation,cancel:n,wait:t=>Promise.race([t,s]),ref:null};return this.operation=a,this.run(a,i).catch(t=>{this.active(a)&&this.fail(t)}).finally(()=>{this.release(a),this.operation===a&&(this.operation=null,this.buffer.complete())})}),t.timer=this.frame)}async run(t,e){const i=this.owner;if(i.art.playing&&this.active(t))for(const s of e){if(!this.active(t))return;if(this.failedItems.has(s))continue;let e;try{e=await t.wait(i.option.beforeVisible(s))}catch(n){if(!this.active(t))return;this.failedItems.add(s),this.report(n);continue}if(!this.active(t))return;if(!e)continue;const{clientWidth:a,clientHeight:r}=i.$player,o=i.renderer.prepare(s,t);if(!this.active(t))return;s.$lastStartTime=Date.now(),s.$restTime=i.speed;const l=a+o.clientWidth,d={type:"getDanmuTop",target:{mode:s.mode,height:o.clientHeight,speed:l/s.$restTime},visibles:i.visibles,antiOverlap:i.option.antiOverlap,clientWidth:a,clientHeight:r,marginBottom:i.marginBottom,marginTop:i.marginTop},h=d.antiOverlap?await t.wait(i.postMessage(d)):{result:u(d)},c="symbol"===typeof h?void 0:h.result;if(!this.active(t)||s.$ref!==o)return;void 0!==c?(s.$lastStartTime=Date.now(),i.setState(s,"emit"),i.renderer.place(s,o,c,l,a),t.ref=null,i.art.emit("artplayerPluginDanmuku:visible",s)):(i.setState(s,"ready"),this.release(t))}}destroy(){this.closed=!0,this.invalidate(),this.sampling.destroy()}}let v=0;class w{constructor(t,e){this.pending=new Map,this.closed=!1,this.failed=!1,this.onFailure=e,this.worker=t();try{this.worker.onmessage=t=>{const e=this.pending.get(t.data?.id);e&&(this.pending.delete(t.data.id),e.resolve(t.data))},this.worker.onerror=t=>{t.preventDefault?.(),this.fail(t.error||t)},this.worker.onmessageerror=t=>this.fail(t.error||t)}catch(i){try{this.dispose()}catch{}throw i}}request(t){t.id=++v;const{id:e}=t;return this.closed||this.failed?Promise.resolve({id:e,result:void 0}):new Promise((i,n)=>{this.pending.set(e,{resolve:i,reject:n});try{this.worker.postMessage(t)}catch(s){this.fail(s)}})}fail(t){if(!this.closed&&!this.failed){this.failed=!0;for(const e of this.pending.values())e.reject(t);this.pending.clear();try{this.dispose()}catch{}this.onFailure(t)}}cancel(){for(const[t,e]of this.pending)e.resolve({id:t,result:void 0});this.pending.clear()}dispose(){if(this.closed)return;this.closed=!0,this.cancel();let t,e=!1;const i=i=>{try{i()}catch(n){e||(t=n),e=!0}};for(const n of["onmessage","onerror","onmessageerror"])i(()=>this.worker[n]=null);if(i(()=>this.worker.terminate()),e)throw t}}const k='/*!\n * artplayer-plugin-danmuku.js v5.3.0\n * Github: https://github.com/zhw2590582/ArtPlayer\n * (c) 2017-2026 Harvey Zhao\n * Released under the MIT License.\n */\nfunction t({target:t,visibles:e,clientWidth:i,clientHeight:h,marginBottom:n,marginTop:o,antiOverlap:s}){const r=h-n,p=e.filter(e=>e.mode===t.mode&&e.top<=r).sort((t,e)=>t.top-e.top);if(0===p.length)return 2===t.mode?r-t.height:o;if(p.unshift({type:"top",top:0,left:0,right:0,height:o,width:i,speed:0,distance:i}),p.push({type:"bottom",top:r,left:0,right:0,height:n,width:i,speed:0,distance:i}),2===t.mode)for(let g=p.length-2;g>=0;g-=1){const e=p[g],i=p[g+1],h=e.top+e.height;if(i.top-h>=t.height)return i.top-t.height}else for(let g=1;g=t.height)return h}const a=[];for(let g=1;g{const i=Math.min(...e.map(t=>t.right)),h=Math.min(...t.map(t=>t.right));return i*e.length-h*t.length});break;case 1:case 2:a.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return a[0][0].top}switch(t.mode){case 0:{const e=a.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}onmessage=e=>{const{data:i}=e;if(!i.id||!i.type)return;const h=(0,{getDanmuTop:t}[i.type])(i);globalThis.postMessage({result:h,id:i.id})};\n',x="undefined"!==typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",k],{type:"text/javascript;charset=utf-8"});function b(t){let e;try{if(e=x&&(self.URL||self.webkitURL).createObjectURL(x),!e)throw"";const i=new Worker(e,{type:"module",name:t?.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(i){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(k),{type:"module",name:t?.name})}}class ${constructor(t,e){const{constructor:i,template:n}=t;this.utils=i.utils,this.validator=i.validator,this.$danmuku=n.$danmuku,this.$player=n.$player,this.art=t,this.queue=[],this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.index=0,this.worker=null,this.workerClient=null,this.renderer=new p(this),this.scheduler=new y(this),this.option=$.option,this.states={wait:[],ready:[],emit:[],stop:[]},this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.resize=this.resize.bind(this),this.destroy=this.destroy.bind(this),this.seek=this.seek.bind(this),d(this),t.on("destroy",this.destroy);try{if(this.config(e,!0),!d(this))return;this.createWorker()}catch(s){throw t.off("destroy",this.destroy),h(this),this.scheduler.destroy(),s}t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("resize",this.resize),t.on("video:seeking",this.seek),this.load().catch(t=>console.warn("Failed to load initial danmuku:",t))}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,width:512,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,emitter:!0,maxLength:200,lockTime:5,theme:"dark",OPACITY:{},FONT_SIZE:{},MARGIN:{},SPEED:{},COLOR:[]}}static get scheme(){return{danmuku:"array|function|string|promise",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement|string",heatmap:"object|boolean",width:"number",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",emitter:"boolean",maxLength:"number",lockTime:"number",theme:"string",OPACITY:"object",FONT_SIZE:"object",MARGIN:"object",SPEED:"object",COLOR:"array"}}static get cssText(){return'\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n '}get isRotate(){return this.art.plugins?.autoOrientation?.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return $.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return $.option.margin[1]}get fontSize(){const{clamp:t}=this.utils,{clientHeight:e}=this.$player,i=this.option.fontSize;if("number"===typeof i)return Math.round(t(i,12,e));if("string"===typeof i&&i.endsWith("%")){const n=Number.parseFloat(i)/100;return Math.round(t(e*n,12,e))}return $.option.fontSize}get $ref(){return this.renderer.acquire()}get readys(){return function(t){const{currentTime:e}=t.art,i=[];return c(t,"ready",t=>i.push(t)),c(t,"wait",t=>{e+.1>=t.time&&t.time>=e-.1&&i.push(t)}),i}(this)}get visibles(){return this.renderer.visibles}get speed(){return this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed}async load(e){const{errorHandle:i}=this.utils,n=function(t,e){const i=l(t);if(e)for(const o of[...i.tasks])o.replace&&o.cancel();let n,s=i.closed||t.art.isDestroy;const a=new Promise(t=>n=t),r=new Set,d="function"===typeof AbortController?new AbortController:void 0,h={replace:e,signal:d?.signal,active:()=>!s&&!i.closed&&!t.art.isDestroy,onCancel:t=>h.active()?(r.add(t),()=>r.delete(t)):(t(),()=>{}),cancel(){if(!s){s=!0,n(o),d?.abort();for(const t of[...r])t();r.clear()}},wait:t=>Promise.race([t,a]),emit(e){i.emitting.push(h);try{return t.emit(e)}finally{i.emitting.pop()}},finish(){i.tasks.delete(h),r.clear()}};return s?n(o):i.tasks.add(h),h}(this,void 0===e);try{if(!n.active())return this;const s=function(e,i){return"function"===typeof e?{asynchronous:!0,value:e()}:t(e)?{asynchronous:!0,value:e}:"string"===typeof e?{asynchronous:!0,value:a(e,i)}:{asynchronous:!1,value:Array.isArray(e)?e:[]}}(e||this.option.danmuku,n),r=s.asynchronous?await n.wait(s.value):s.value;if(!n.active())return this;i(Array.isArray(r),"Danmuku need return an array as result");const o=r;if(void 0===e){if(this.reset(),!n.active())return this;this.queue=[],this.states={wait:[],ready:[],emit:[],stop:[]},this.renderer.clear()}for(let t=0;t{const i=a[e],n=r[e];return"function"===typeof i||"function"===typeof n||t(i)||t(n)?i!==n:JSON.stringify(i)!==JSON.stringify(n)}))&&!i)return this;const o=function(t,e,{defaults:i,validate:n,clamp:s,mount:a}){const r=Object.assign({},i,t,e);return n(r),r.mode=s(r.mode,0,2),r.speed=s(r.speed,1,10),r.opacity=s(r.opacity,0,1),r.lockTime=s(r.lockTime,1,60),r.maxLength=s(r.maxLength,1,1e3),r.mount=r.mount||a,r}(this.option,e,{defaults:$.option,validate:t=>this.validator(t,$.scheme),clamp:n,mount:s});if(!d(this))return this;const l=this.option.beforeVisible!==o.beforeVisible;return this.option=o,l&&(this.scheduler.invalidate(),this.scheduler.schedule()),e.fontSize&&(this.reset(),!d(this))||(this.option.visible?this.show():this.hide(),d(this)&&this.art.emit("artplayerPluginDanmuku:config",this.option)),this}getLeft(t){return this.renderer.left(t)}postMessage(t={}){return this.workerClient.request(t)}createWorker(){this.workerClient=new w(()=>new b,t=>this.scheduler.fail(t)),this.worker=this.workerClient.worker}filter(t,e){return c(this,t,e)}setState(t,e){!function(t,e,i){t.states[e.$state]=t.states[e.$state].filter(t=>t!==e),e.$state=i,e.$ref&&(e.$ref.dataset.state=i),t.states[i].push(e)}(this,t,e)}makeWait(t){this.renderer.makeWait(t)}update(){return this.scheduler.running=!0,this.scheduler.schedule(),this}resize(){this.renderer.resize()}continue(){return this.renderer.continue(),this}suspend(){return this.renderer.suspend(),this}stop(){return this.isStop=!0,this.scheduler.running=!1,this.scheduler.invalidate(),this.suspend(),this.art.emit("artplayerPluginDanmuku:stop"),this}start(){if(this.scheduler.closed||this.art.isDestroy)return this;const t=++this.scheduler.starts,e=this.scheduler.generation;this.isStop=!1,this.scheduler.recover();return this.scheduler.closed||this.art.isDestroy||this.isStop||this.scheduler.fault||e!==this.scheduler.generation||t!==this.scheduler.starts||(this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")),this}reset(){return this.scheduler.invalidate(),this.queue.forEach(t=>this.makeWait(t)),this.art.emit("artplayerPluginDanmuku:reset"),this.scheduler.recover(),this.scheduler.schedule(),this}seek(){this.scheduler.invalidate(),this.scheduler.schedule()}show(){return this.isHide=!1,this.$danmuku.style.opacity=1,this.option.visible=!0,this.art.emit("artplayerPluginDanmuku:show"),this}hide(){return this.isHide=!0,this.scheduler.invalidate(),this.$danmuku.style.opacity=0,this.option.visible=!1,this.art.emit("artplayerPluginDanmuku:hide"),this.scheduler.schedule(),this}destroy(){h(this),this.scheduler.destroy();try{try{this.stop()}finally{this.workerClient?.dispose()}}finally{this.renderer.destroy(),this.art.off("video:play",this.start),this.art.off("video:playing",this.start),this.art.off("video:pause",this.stop),this.art.off("video:waiting",this.stop),this.art.off("resize",this.resize),this.art.off("video:seeking",this.seek),this.art.off("destroy",this.destroy),this.art.emit("artplayerPluginDanmuku:destroy")}}}const M=4294967295;function S(t,e){let i=0,n=t.length;for(;iNumber.isFinite(t)&&t>0))return null;const r={xMin:0,xMax:t,yMin:0,yMax:128,scale:.25,opacity:.2,minHeight:Math.floor(.05*e),sampling:Math.max(1,Math.floor(t/100)),smoothing:.2,flattening:.2},o=Object.assign({},"object"===typeof s?s:{}),l=Object.assign({},r,o);for(const b of Object.keys(r))Number.isFinite(l[b])||(l[b]=r[b]);if(l.sampling<=0&&(l.sampling=r.sampling),l.xMin===l.xMax||l.yMin===l.yMax)return null;const d=Array.isArray(a)&&a.length>0,h=d?[...a]:function(t,e,i,n){if(!Number.isFinite(e)||e<=0||!Number.isFinite(i)||i<=0||!Number.isFinite(n)||n<=0||Math.floor(e/n)+1>M)return[];const s=t.map(t=>t.time).filter(t=>"number"===typeof t&&!Number.isNaN(t)).sort((t,e)=>t-e),a=[],r=i/e;if(!Number.isFinite(r))return[];for(let o=0;o<=e;o+=n){if(a.length>=M||o+n===o)return[];const t=o*r,e=(o+n)*r;a.push([o,S(s,e)-S(s,t)])}return a}(n,t,i,l.sampling);if(!h.length||!h.every(t=>Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])))return null;const c=h[h.length-1];if(c[0]!==t){if(h.length===M)return null;h.push([t,c[1]])}let p=1/0,u=-1/0;for(const b of h)p=Math.min(p,b[1]),u=Math.max(u,b[1]);const m=(p+u)/2;for(const b of h){const t=b[1];b[1]=t*(t>m?1+l.scale:1-l.scale)+l.minHeight}const f=!d&&!Number.isFinite(o.yMin)&&!Number.isFinite(o.yMax);let g=0;for(const b of h)g=Math.max(g,b[1]);const y=f&&g>r.yMax/4;y&&(l.yMax=4*g);const v=t=>y?Math.min(e,Math.max(.75*e,t)):t,w=(t,e,i,n)=>{const s=function(t,e){const i=e[0]-t[0],n=e[1]-t[1];return{length:Math.sqrt(i**2+n**2),angle:Math.atan2(n,i)}}(e||t,i||t),a=z(Math.cos(s.angle)*l.flattening,0,1,1,0),r=s.angle*a+(n?Math.PI:0),o=s.length*l.smoothing;return[t[0]+Math.cos(r)*o,v(t[1]+Math.sin(r)*o)]},k=h.map(i=>[z(i[0],l.xMin,l.xMax,0,t),v(z(i[1],l.yMin,l.yMax,e,0))]);if(!k.every(t=>t.every(Number.isFinite)))return null;const x=k.map((t,i,n)=>{if(0===i)return`M ${n[n.length-1][0]},${e} L ${t[0]},${e} L ${t[0]},${t[1]}`;const s=w(n[i-1],n[i-2],t),a=w(t,n[i-1],n[i+1],!0);return`C ${s[0]},${s[1]} ${a[0]},${a[1]} ${t[0]},${t[1]}${i===n.length-1?" z":""}`}).join(" ");return/NaN|Infinity/u.test(x)?null:{path:x,opacity:l.opacity,width:t,height:e}}let F=0;function C(t,e,i){if(t.isDestroy)return;const{query:n}=t.constructor.utils;let s;const a=[];let r,o,l,d=!1;const h=()=>!d&&!t.isDestroy;function c(e,i){const n=i;a.push([e,n]),t.on(e,n)}function p(e){if(d)return;let i;d=!0,o=null,l=null;let n=!1;const s=t=>{try{t()}catch(e){n||(i=e),n=!0}};for(const[r,o]of a.splice(0))s(()=>t.off(r,o));if(e&&r&&t.controls.heatmap===r&&s(()=>t.controls.remove("heatmap")),r=void 0,n)throw i}function u(t){h()&&o&&l&&(o.setAttribute("offset",100*t+"%"),l.setAttribute("offset",100*t+"%"))}function m(a){try{!function(a=[]){if(!h())return;o=null,l=null;const d=r;if(d.innerHTML="",t.option.isLive)return;const c=E({width:d.offsetWidth,height:d.offsetHeight,duration:t.duration,queue:e.queue,option:i,points:a});if(!c||!h())return;const p=d.ownerDocument;for(s||(s=p?"heatmap-solids":"heatmap-solids-"+ ++F);p?.getElementById(s);)s="heatmap-solids-"+ ++F;d.innerHTML=`\n \n \n \n \n \n \n \n \n \n \n \n `,o=n("#heatmap-start",d),l=n("#heatmap-stop",d),u(t.played)}(a)}catch(d){try{p(!0)}catch{}throw d}}c("destroy",()=>p(!0));try{t.controls.add({name:"heatmap",position:"top",html:"",style:{position:"absolute",top:"-100px",left:"0px",right:"0px",height:"100px",width:"100%",pointerEvents:"none"},beforeUnmount(){p(!1)},mounted(e){if(r=e,d)return t.controls.heatmap===e&&t.controls.remove("heatmap"),void(r=void 0);h()?(c("video:timeupdate",()=>u(t.played)),c("setBar",(t,e)=>{"played"===t&&u(e)}),c("ready",()=>m()),c("resize",()=>m()),c("artplayerPluginDanmuku:loaded",()=>m()),c("artplayerPluginDanmuku:points",t=>m(t))):p(!0)}})}catch(f){try{p(!0)}catch{}throw f}return()=>p(!0)}const D=new WeakMap;class T{constructor(t){this.art=t,this.closed=!1,this.disposers=new Set,this.cancelled=new Promise(t=>this.cancel=t)}get active(){return!this.closed&&!this.art.isDestroy}own(t){this.closed?t():this.disposers.add(t)}write(t,e,i,n=i=>t[e]=i){const s=t;if(!this.active)return;const a=()=>"function"===typeof s.getPropertyPriority?s.getPropertyPriority(e):void 0;let r=D.get(s);r||(r=new Map,D.set(s,r));let o=r.get(e);o||(o={original:s[e],present:e in s||void 0!==s[e],priority:a(),owners:new Map,apply:n},r.set(e,o)),o.owners.has(this)||this.own(()=>{const t=[...o.owners.keys()],i=t[t.length-1]===this;if(o.owners.delete(this),i&&s[e]===o.last&&a()===o.lastPriority){const t=[...o.owners.values()];t.length?(o.apply(t[t.length-1]),o.last=s[e],o.lastPriority=a()):void 0!==o.priority?s.setProperty(e,o.original,o.priority):o.present?o.apply(o.original):delete s[e]}o.owners.size||(r.delete(e),r.size||D.delete(s))}),o.owners.delete(this),o.owners.set(this,i),o.apply(i),o.last=s[e],o.lastPriority=a()}on(t,e){if(!this.active)return;const i=this;function n(...t){if(i.active)return e.apply(this,t)}const s=()=>this.art.off(t,n);this.own(s);try{this.art.on(t,n),this.active||s()}catch(a){throw this.release(s),a}}proxy(t,e,i){if(!this.active)return;const n=this;function s(...t){if(n.active)return i.apply(this,t)}let a;const r=()=>{if("function"===typeof a){const t=this.art.events;"function"===typeof t?.remove&&t.destroyEvents?.has(a)?t.remove(a):a()}else t.removeEventListener?.(e,s)};this.own(r);try{a=this.art.proxy(t,e,s),this.active||r()}catch(o){throw this.release(r),o}}wait(t){return Promise.race([t,this.cancelled])}release(t){try{t()}catch(e){console.warn("Failed to dispose danmuku setting resource:",e)}}close(){if(!this.closed){this.closed=!0,this.cancel();for(const t of this.disposers)this.release(t);this.disposers.clear()}}}function P({min:t,max:e,container:i,findIndex:n,onChange:s,steps:a=[]}){const{lifecycle:r}=this;if(!r.active)return{reset(){}};const{query:o,clamp:l,setStyle:d}=this.utils;d(i,"touch-action","none"),i.innerHTML=`\n

\n
\n ${a.map(()=>'
').join("")}\n
\n
\n
\n
\n
\n ${a.map(t=>t.hide?"":`
${t.name}
`).join("")}\n
\n `;const h=o(".apd-slider-dot",i),c=o(".apd-slider-progress",i);let p=!1;function u(i){if(!r.active)return;if(void 0===i&&(i=n()),ie)return;const o=(i-t)/(e-t);h.style.left=100*o+"%",0===a.length&&(c.style.width=h.style.left),s(i)}function m(n){const{top:s,height:a,left:r,width:o}=i.getBoundingClientRect();if(this.art.isRotate){const i=l(n.clientY-s,0,a);u(Math.round(i/a*(e-t)+t))}else{const i=l(n.clientX-r,0,o);u(Math.round(i/o*(e-t)+t))}}return r.own(()=>p=!1),r.proxy(i,"click",t=>{m.call(this,t)}),r.proxy(i,"pointerdown",t=>{p=0===t.button}),r.on("document:pointermove",t=>{p&&m.call(this,t)}),r.on("document:pointerup",t=>{p&&(p=!1,m.call(this,t))}),{reset:u}}const L='',A='',H='',O='',N='',V='',q='',I='',j='',B='',R='',Z='';function W(){const{option:t}=this;return`\n
\n ${R}${B}\n
\n
\n ${H}\n
\n
\n
\n \u6309\u7c7b\u578b\u5c4f\u853d\n
\n
\n ${O}${N}\n
\u6eda\u52a8
\n
\n
\n ${V}${q}\n
\u9876\u90e8
\n
\n
\n ${I}${j}\n
\u5e95\u90e8
\n
\n
\n
\n
\n
\n ${A}${L}\n \u9632\u6b62\u5f39\u5e55\u91cd\u53e0\n
\n
\n ${A}${L}\n \u540c\u6b65\u89c6\u9891\u901f\u5ea6\n
\n
\n
\n \u4e0d\u900f\u660e\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n \u663e\u793a\u533a\u57df\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u5b57\u53f7\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u901f\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n
\n
\n
\n
\n ${Z}\n
\n
\n
\n \u6a21\u5f0f\n
\n
\n ${N}\n
\u6eda\u52a8
\n
\n
\n ${q}\n
\u9876\u90e8
\n
\n
\n ${j}\n
\u5e95\u90e8
\n
\n
\n
\n
\n \u989c\u8272\n
\n ${this.COLOR.map(t=>`
`).join("")}\n
\n
\n
\n
\n
\n \n
\u53d1\u9001
\n
\n `}if("undefined"!==typeof document){const t="artplayer-plugin-danmuku",e=Symbol.for("artplayer-plugin-danmuku.pending-style"),i=document;let n=document.getElementById(t)||i[e];if(!n)if(n=document.createElement("style"),n.id=t,"loading"===document.readyState){i[e]=n;const s=()=>{document.removeEventListener("DOMContentLoaded",s),i[e]===n&&delete i[e];const a=document.getElementById(t);a?a.textContent=n.textContent:(document.head||document.documentElement).appendChild(n)};document.addEventListener("DOMContentLoaded",s,{once:!0})}else(document.head||document.documentElement).appendChild(n);n.textContent='.artplayer-plugin-danmuku{display:flex;position:relative;z-index:99;align-items:center;justify-content:center;font-size:12px;height:32px;width:100%;color:#fff;font-weight:300;flex-shrink:0;gap:10px}.artplayer-plugin-danmuku .apd-icon{cursor:pointer;opacity:.75;transition:all .2s ease;fill:#fff}.artplayer-plugin-danmuku .apd-icon:hover{opacity:1}.artplayer-plugin-danmuku .apd-config{display:flex;position:relative}.artplayer-plugin-danmuku .apd-config .apd-config-panel{position:absolute;bottom:24px;left:0;width:320px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-config .apd-config-panel .apd-config-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-config:hover .apd-config-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-config-mode,.artplayer-plugin-danmuku .apd-config-slider,.artplayer-plugin-danmuku .apd-config-other,.artplayer-plugin-danmuku .apd-style-mode{margin-bottom:15px}.artplayer-plugin-danmuku .apd-modes{display:flex;align-items:center;margin-top:5px;gap:20px}.artplayer-plugin-danmuku .apd-modes .apd-mode{cursor:pointer;text-align:center}.artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-config-slider{display:flex;align-items:center;gap:12px}.artplayer-plugin-danmuku .apd-config-slider .apd-value{width:32px;text-align:right}.artplayer-plugin-danmuku .apd-slider{position:relative;flex:1;display:flex;height:20px;align-items:center;justify-content:center;cursor:pointer}.artplayer-plugin-danmuku .apd-slider .apd-slider-line{position:relative;height:2px;width:100%;overflow:hidden;border-radius:3px;background-color:#ffffff40}.artplayer-plugin-danmuku .apd-slider .apd-slider-points{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}.artplayer-plugin-danmuku .apd-slider .apd-slider-points .apd-slider-point{width:2px;height:2px;border-radius:50%;background-color:#ffffff80}.artplayer-plugin-danmuku .apd-slider .apd-slider-progress{width:0%;height:100%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-dot{position:absolute;transform:translate(-6px);left:0%;width:12px;height:12px;border-radius:50%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps{display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:-12px;width:calc(100% + 32px);color:#777}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps .apd-slider-step{flex-shrink:0;width:36px;text-align:center;scale:.95}.artplayer-plugin-danmuku .apd-config-other{display:flex;align-items:center;gap:20px}.artplayer-plugin-danmuku .apd-config-other .apd-check-off,.artplayer-plugin-danmuku .apd-config-other .apd-check-on{width:16px;height:16px}.artplayer-plugin-danmuku .apd-config-other .apd-other{display:flex;align-items:center;cursor:pointer;gap:2px}.artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-emitter{display:flex;flex:1;align-items:center;height:100%;background-color:#ffffff40;border-radius:5px}.artplayer-plugin-danmuku .apd-style{position:relative;display:flex;align-items:center;justify-content:center}.artplayer-plugin-danmuku .apd-style .apd-style-panel{position:absolute;bottom:24px;left:0;width:200px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-style .apd-style-panel .apd-style-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-style:hover .apd-style-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-colors{display:flex;flex-wrap:wrap;margin-top:5px;gap:8px}.artplayer-plugin-danmuku .apd-colors .apd-color{width:16px;height:16px;border-radius:2px;cursor:pointer}.artplayer-plugin-danmuku .apd-colors .apd-color.apd-active{border:1px solid black;box-shadow:0 0 0 1px #fff}.artplayer-plugin-danmuku .apd-input{outline:none;height:100%;flex:1;min-width:0;width:auto;border:none;line-height:1;color:#fff;background-color:transparent}.artplayer-plugin-danmuku .apd-input::placeholder{color:#ffffff80}.artplayer-plugin-danmuku .apd-send{display:flex;align-items:center;justify-content:center;height:100%;width:60px;flex-shrink:0;cursor:pointer;text-shadow:none;border-top-right-radius:5px;border-bottom-right-radius:5px;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-send.apd-lock{cursor:not-allowed;color:#666;background-color:#e7e7e7}.art-controls-center .apd-emitter{width:260px;flex:none}.art-fullscreen .artplayer-plugin-danmuku,.art-fullscreen-web .artplayer-plugin-danmuku{height:38px;gap:16px}.art-fullscreen .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen-web .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-on,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-on{width:28px;height:28px}.art-fullscreen .artplayer-plugin-danmuku .apd-emitter,.art-fullscreen-web .artplayer-plugin-danmuku .apd-emitter{width:400px;flex:none}.art-video-player>.artplayer-plugin-danmuku{position:absolute;left:0;right:0;bottom:-40px;padding:0 10px}.art-video-player:has(>.artplayer-plugin-danmuku){margin-bottom:40px}[data-danmuku-emitter=false] .apd-emitter{display:none!important}[data-danmuku-emitter=false] .art-controls-center .artplayer-plugin-danmuku{justify-content:flex-end;gap:18px}[data-danmuku-emitter=false].art-fullscreen .art-controls-center .artplayer-plugin-danmuku,[data-danmuku-emitter=false].art-fullscreen-web .art-controls-center .artplayer-plugin-danmuku{gap:24px}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-icon{fill:#333}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-emitter{background-color:#f1f2f3}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input{color:#000}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input::placeholder{color:#0000004d}[data-danmuku-visible=false] .apd-toggle-off{display:block}[data-danmuku-visible=false] .apd-toggle-on,[data-danmuku-visible=true] .apd-toggle-off{display:none}[data-danmuku-visible=true] .apd-toggle-on{display:block}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-on{display:none}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-off,[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-on{display:block}[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-off,[data-danmuku-sync-video=false] .apd-sync-video .apd-check-on{display:none}[data-danmuku-sync-video=false] .apd-sync-video .apd-check-off,[data-danmuku-sync-video=true] .apd-sync-video .apd-check-on{display:block}[data-danmuku-sync-video=true] .apd-sync-video .apd-check-off{display:none}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-off{display:block}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-on{display:none}[data-danmuku-mode0=false] .art-danmuku [data-mode="0"]{opacity:0!important}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-off{display:none}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-on{display:block}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"]{color:#00a1d6}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"] path{fill:#00a1d6}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-off{display:block}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-on{display:none}[data-danmuku-mode1=false] .art-danmuku [data-mode="1"]{opacity:0!important}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-off{display:none}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-on{display:block}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"]{color:#00a1d6}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"] path{fill:#00a1d6}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-off{display:block}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-on{display:none}[data-danmuku-mode2=false] .art-danmuku [data-mode="2"]{opacity:0!important}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-off{display:none}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-on{display:block}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"]{color:#00a1d6}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"] path{fill:#00a1d6}'}class _{constructor(t,e){this.art=t,this.danmuku=e,this.utils=t.constructor.utils;const{setStyle:i}=this.utils,{$controlsCenter:n}=t.template;this.template={$controlsCenter:n,$mount:n,$danmuku:null,$toggle:null,$config:null,$configPanel:null,$configModes:null,$style:null,$stylePanel:null,$styleModes:null,$colors:null,$opacitySlider:null,$opacityValue:null,$marginSlider:null,$marginValue:null,$fontSizeSlider:null,$fontSizeValue:null,$speedSlider:null,$speedValue:null,$input:null,$send:null},this.slider={opacity:null,margin:null,fontSize:null,speed:null},this.emitting=!1,this.isLock=!1,this.timer=null,this.lifecycle=new T(t),this.destroy=this.destroy.bind(this),this.lifecycle.own(()=>t.off("destroy",this.destroy));try{if(t.on("destroy",this.destroy),!this.lifecycle.active)return;if(this.lifecycle.write(n.style,"display","flex",t=>i(n,"display",t)),this.createTemplate(),!this.lifecycle.active)return;if(this.createSliders(),!this.lifecycle.active)return;if(this.createEvents(),this.mount(this.option.mount),!this.lifecycle.active)return;this.lifecycle.on("resize",()=>this.resize()),this.lifecycle.on("fullscreen",t=>this.onFullscreen(t)),this.lifecycle.on("fullscreenWeb",t=>this.onFullscreen(t)),this.lifecycle.proxy(this.template.$config,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$config,$panel:this.template.$configPanel})}),this.lifecycle.proxy(this.template.$style,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$style,$panel:this.template.$stylePanel})})}catch(s){try{this.destroy()}catch(a){console.warn("Failed to roll back danmuku setting:",a)}throw s}}static get icons(){return{$on:R,$off:B,$config:H,$style:Z,$mode_0_off:O,$mode_0_on:N,$mode_1_off:V,$mode_1_on:q,$mode_2_off:I,$mode_2_on:j,$check_on:A,$check_off:L}}get option(){return this.danmuku.option}get outside(){return this.template.$mount!==this.template.$controlsCenter}get TEMPLATE(){return W.call(this)}get OPACITY(){return{min:0,max:100,steps:[],...this.option.OPACITY}}get FONT_SIZE(){return{min:12,max:120,steps:[],...this.option.FONT_SIZE}}get MARGIN(){return{min:0,max:3,steps:[{name:"1/4",value:[10,"75%"]},{name:"\u534a\u5c4f",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"\u6ee1\u5c4f",value:[10,10]}],...this.option.MARGIN}}get SPEED(){return{min:0,max:4,steps:[{name:"\u6781\u6162",value:10},{name:"\u8f83\u6162",value:7.5,hide:!0},{name:"\u9002\u4e2d",value:5},{name:"\u8f83\u5feb",value:2.5,hide:!0},{name:"\u6781\u5feb",value:1}],...this.option.SPEED}}get COLOR(){return this.option.COLOR.length?this.option.COLOR:["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(t){const{query:e}=this.utils,{$danmuku:i}=this.template;return e(t,i)}append(t,e){if(!this.lifecycle.active)return;const{append:i}=this.utils;[...t.children].includes(e)||i(t,e)}setData(t,e){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,{$mount:n}=this.template;this.lifecycle.write(i.dataset,t,e),this.outside&&this.lifecycle.write(n.dataset,t,e)}createTemplate(){const{createElement:t,tooltip:e}=this.utils,i=t("div");this.template.$danmuku=i,i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$toggle=this.query(".apd-toggle"),this.template.$config=this.query(".apd-config"),this.template.$configPanel=this.query(".apd-config-panel"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$style=this.query(".apd-style"),this.template.$stylePanel=this.query(".apd-style-panel"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send");const{$toggle:n}=this.template;this.lifecycle.on("artplayerPluginDanmuku:show",()=>{e(n,"\u5173\u95ed\u5f39\u5e55")}),this.lifecycle.on("artplayerPluginDanmuku:hide",()=>{e(n,"\u6253\u5f00\u5f39\u5e55")})}createEvents(){const{$toggle:t,$configModes:e,$styleModes:i,$colors:n,$antiOverlap:s,$syncVideo:a,$send:r,$input:o}=this.template;this.lifecycle.proxy(t,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.lifecycle.proxy(e,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(t=>t!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.lifecycle.proxy(s,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.lifecycle.proxy(a,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.lifecycle.proxy(i,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.lifecycle.proxy(n,"click",t=>{const e=t.target.closest(".apd-color");e&&(this.danmuku.config({color:e.dataset.color}),this.reset())}),this.lifecycle.proxy(r,"click",()=>this.emit()),this.lifecycle.proxy(o,"keypress",t=>{"Enter"===t.key&&(t.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider({...this.OPACITY,container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:t=>{const{$opacityValue:e}=this.template;e.textContent=`${t}%`,this.danmuku.config({opacity:t/100})}}),this.slider.margin=this.createSlider({...this.MARGIN,container:this.template.$marginSlider,findIndex:()=>this.MARGIN.steps.findIndex(t=>t.value[0]===this.option.margin[0]&&t.value[1]===this.option.margin[1]),onChange:t=>{const e=this.MARGIN.steps[t];if(!e)return;const{$marginValue:i}=this.template;i.textContent=e.name,this.danmuku.config({margin:e.value})}}),this.slider.fontSize=this.createSlider({...this.FONT_SIZE,container:this.template.$fontSizeSlider,findIndex:()=>this.danmuku.fontSize,onChange:t=>{const{$fontSizeValue:e}=this.template;e.textContent=`${t}px`,t!==this.danmuku.fontSize&&this.danmuku.config({fontSize:t})}}),this.slider.speed=this.createSlider({...this.SPEED,container:this.template.$speedSlider,findIndex:()=>this.SPEED.steps.findIndex(t=>t.value===this.option.speed),onChange:t=>{const e=this.SPEED.steps[t];if(!e)return;const{$speedValue:i}=this.template;i.textContent=e.name,this.danmuku.config({speed:e.value})}})}createSlider(t){return P.call(this,t)}onFullscreen(t){if(!this.lifecycle.active)return;const{$danmuku:e,$controlsCenter:i,$mount:n}=this.template;this.outside?t?this.append(i,e):this.append(n,e):this.append(i,e)}onMouseEnter({$control:t,$panel:e}){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),r=s.width/2-n.width/2,o=a.left-(n.left-r),l=n.right+r-a.right;e.style.left=o>0?`${-r+o}px`:l>0?-r-l+"px":-r+"px"}emit(){return async function(t){const{lifecycle:e,template:{$input:i}}=t;if(!e.active)return;const n=i.value.trim();if(!n.length||t.isLock||t.emitting)return;const s={text:n,mode:t.option.mode,color:t.option.color,time:t.art.currentTime},a=t=>{e.active&&console.error("Error emitting danmuku:",t)};try{t.emitting=!0;const n=await e.wait(t.option.beforeEmit(s));if(!e.active)return;if(t.emitting=!1,!0!==n)return;if(s.border=!0,delete s.time,Promise.resolve(t.danmuku.emit(s)).catch(a),!e.active)return;i.value="",t.lock()}catch(r){a(r),e.active&&(t.emitting=!1)}}(this)}lock(){!function(t){if(!t.lifecycle.active)return;const{addClass:e}=t.utils,{$send:i}=t.template;clearTimeout(t.timer),t.isLock=!0;let n=t.option.lockTime;i.textContent=n,e(i,"apd-lock");const s=()=>{t.timer=setTimeout(()=>{t.lifecycle.active&&(0===n?t.unlock():(n-=1,i.textContent=n,s()))},1e3)};s()}(this)}unlock(){!function(t){if(clearTimeout(t.timer),t.timer=null,t.isLock=!1,!t.lifecycle.active)return;const{removeClass:e}=t.utils,{$send:i}=t.template;i.textContent="\u53d1\u9001",e(i,"apd-lock")}(this)}resize(){if(!this.lifecycle.active)return;if(this.outside)return;if(this.art.fullscreen)return;if(this.art.fullscreenWeb)return;const{$player:t,$controlsCenter:e}=this.art.template,{$danmuku:i}=this.template;this.art.widtht.dataset.color===this.option.color.toUpperCase());a&&t(a,"apd-active"),e(i,this.option.visible?"\u5173\u95ed\u5f39\u5e55":"\u6253\u5f00\u5f39\u5e55"),this.resize()}mount(t){if(!this.lifecycle.active)return;const{errorHandle:e}=this.utils,i="string"===typeof t?document.querySelector(t):t;e(i,`Can not find the mount point: ${t}`),this.append(i,this.template.$danmuku),this.template.$mount=i,this.reset()}destroy(){if(this.lifecycle.closed)return;this.lifecycle.close(),clearTimeout(this.timer),this.timer=null,this.emitting=!1,this.isLock=!1;const t=this.template.$danmuku;t?.parentElement&&t.parentElement.removeChild(t)}}function U(t){return e=>{const i=new $(e,t);let n;try{n=e.isDestroy?void 0:new _(e,i),!e.isDestroy&&i.option.heatmap&&C(e,i,i.option.heatmap)}catch(s){try{n?.destroy()}catch{}try{i.destroy()}catch{}throw s}return{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:n?n.mount.bind(n):()=>{},get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}return U.icons=_.icons,U}); +!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.artplayerPluginDanmuku=e(),define(function(){return t.artplayerPluginDanmuku})):(t="undefined"!==typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";function t(t){return t instanceof Promise||"[object Promise]"===Object.prototype.toString.call(t)}function e(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:return 2;case 5:return 1}}function i(t){if("string"!==typeof t)return[];const i=t.matchAll(/]*?p="(?

[^"]+)"[^>]*>(?.*?)<\/d>/gs);return Array.from(i).map(t=>{const i=t.groups.p.split(",");if(i.length>=8){return{text:t.groups.text.trim().replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&"),time:Number(i[0]),mode:e(Number(i[1])),fontSize:Number(i[2]),color:`#${Number(i[3]).toString(16)}`,timestamp:Number(i[4]),pool:Number(i[5]),userID:i[6],rowID:Number(i[7])}}return null}).filter(Boolean)}function n({data:t}){const{xml:e,id:n}=t,s=i(e);globalThis.postMessage({danmus:s,id:n})}let s=0;function a(t,{signal:a,onCancel:r}={}){return new Promise((o,l)=>{let d,h,c,p=!1;const u=++s,m=()=>g(void 0,function(t){if(void 0!==t?.reason)return t.reason;const e=new Error("Bilibili Danmu loading cancelled");return e.name="AbortError",e}(a));function f(){let t,e=!1;try{if(d){const t=d;d=void 0,t.onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate()}}catch(i){t=i,e=!0}if(void 0!==h){const n=h;h=void 0;try{URL.revokeObjectURL(n)}catch(i){e||(t=i),e=!0}}if(e)throw t}function g(t,e){if(p)return;p=!0;let i=arguments.length>1;a?.removeEventListener("abort",m),c?.();try{f()}catch(n){i||(e=n),i=!0}i?l(e):o(t)}function y(t,e){if(!p){console.error("Error parsing Bilibili Danmu:",e);try{g(i(t))}catch(n){g(void 0,n)}}}a?.aborted?m():(a?.addEventListener("abort",m),c=r?.(m),p?c?.():async function(){const s=a?await fetch(t,{signal:a}):await fetch(t);if(p)return;const r=await s.text();if(!p)try{const t=`\n ${e.toString()}\n ${i.toString()}\n onmessage = ${n.toString()}\n `;if(h=URL.createObjectURL(new Blob([t],{type:"application/javascript"})),p)return void f();if(d=new Worker(h),p)return void f();d.onmessage=t=>{if(p||t.data?.id!==u)return;const{danmus:e}=t.data;Array.isArray(e)?g(e):g(void 0,new Error("Invalid Bilibili Danmu worker response"))},d.onerror=t=>{t.preventDefault?.(),y(r,t.error||t)},d.onmessageerror=t=>y(r,t.error||t),d.postMessage({xml:r,id:u})}catch(o){y(r,o)}}().catch(t=>g(void 0,t)))})}const r=new WeakMap,o=Symbol("cancelled danmuku input");function l(t){return r.has(t)||r.set(t,{closed:!1,tasks:new Set,emitting:[]}),r.get(t)}function d(t){const e=l(t),i=e.emitting[e.emitting.length-1];return!e.closed&&!t.art.isDestroy&&(!i||i.active())}function h(t){const e=l(t);e.closed=!0;for(const i of[...e.tasks])i.cancel()}function c(t,e,i){const n=t.states[e]||[];for(let s=0;s{const s=n.$ref.offsetTop,a=this.owner.getLeft(n.$ref)-i,r=n.$ref.clientHeight,o=n.$ref.clientWidth,l=a+o,d=e-l,h=l/n.$restTime,c={};c.top=s,c.left=a,c.height=r,c.width=o,c.right=d,c.speed=h,c.distance=l,c.time=n.$restTime,c.mode=n.mode,t.push(c)}),t}left(t){const e=t.getBoundingClientRect();return this.owner.isRotate?e.top:e.left}makeWait(t){this.owner.setState(t,"wait"),t.$ref&&(t.$ref.style.cssText=this.owner.constructor.cssText,t.$ref.style.visibility="hidden",t.$ref.style.marginLeft="0px",t.$ref.style.transform="translateX(0px)",t.$ref.style.transition="transform 0s linear 0s",this.owner.$refs.push(t.$ref),t.$ref=null)}resize(){const{clientWidth:t}=this.owner.$player;this.owner.filter("stop",e=>{if(0===e.mode)e.$ref.style.left=`${t}px`}),this.owner.filter("emit",e=>{switch(e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.left=`${t}px`,e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}})}continue(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("stop",e=>{switch(this.owner.setState(e,"emit"),e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}}),this}suspend(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("emit",e=>{switch(this.owner.setState(e,"stop"),e.mode){case 0:{const i=t-(this.owner.getLeft(e.$ref)-this.owner.getLeft(this.owner.$player));e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition="transform 0s linear 0s";break}}}),this}prepare(t,e){const i=this.owner,n=i.$ref;return e.danmu=t,e.ref=n,t.$ref=n,n.textContent=t.text,i.$danmuku.appendChild(n),n.style.opacity=i.option.opacity,n.style.fontSize=`${i.fontSize}px`,n.style.color=t.color,n.style.border=t.border?`1px solid ${t.color}`:null,n.style.backgroundColor=t.border?"rgb(0 0 0 / 50%)":null,i.utils.setStyles(n,t.style),n}place(t,e,i,n,s){switch(e.style.top=`${i}px`,e.style.visibility="visible",e.dataset.mode=t.mode,e.dataset.id=t.id||"",t.mode){case 0:e.style.left=`${s}px`,e.style.marginLeft="0px",e.style.transform=`translateX(${-n}px)`,e.style.transition=`transform ${t.$restTime}s linear 0s`;break;case 1:case 2:e.style.left="50%",e.style.marginLeft=`-${e.clientWidth/2}px`}}release(t){const{danmu:e,ref:i}=t;i&&e.$ref===i&&(i.style.cssText=this.owner.constructor.cssText,i.style.visibility="hidden",this.owner.$refs.push(i),e.$ref=null),t.ref=null}clear(){this.destroy(),this.owner.$refs=[],this.owner.$danmuku.textContent=""}destroy(){for(const t of this.nodes)t.parentElement&&t.parentElement.removeChild(t);for(const t of this.owner.queue)t.$ref=null;this.owner.$refs.length=0,this.nodes.clear()}}function u({target:t,visibles:e,clientWidth:i,clientHeight:n,marginBottom:s,marginTop:a,antiOverlap:r}){const o=n-s,l=e.filter(e=>e.mode===t.mode&&e.top<=o).sort((t,e)=>t.top-e.top);if(0===l.length)return 2===t.mode?o-t.height:a;if(l.unshift({type:"top",top:0,left:0,right:0,height:a,width:i,speed:0,distance:i}),l.push({type:"bottom",top:o,left:0,right:0,height:s,width:i,speed:0,distance:i}),2===t.mode)for(let h=l.length-2;h>=0;h-=1){const e=l[h],i=l[h+1],n=e.top+e.height;if(i.top-n>=t.height)return i.top-t.height}else for(let h=1;h=t.height)return n}const d=[];for(let h=1;h{const i=Math.min(...e.map(t=>t.right)),n=Math.min(...t.map(t=>t.right));return i*e.length-n*t.length});break;case 1:case 2:d.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return d[0][0].top}switch(t.mode){case 0:{const e=d.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}class m{constructor(){this.rows=new Set,this.waiting=new Set,this.visibility=()=>this.clear()}begin(t){void 0===this.time&&this.capture(t,[],t.art.currentTime)}capture(t,e,i){const n=t.$player.ownerDocument;if(n!==this.document&&(this.document?.removeEventListener("visibilitychange",this.visibility),this.document=n,n?.addEventListener("visibilitychange",this.visibility),this.clear()),!Number.isFinite(i)||"hidden"===n?.visibilityState||t.art.video?.seeking)return this.clear(),e;const s=this.time,a=this.rows,r=this.waiting;if(this.time=i,this.rows=new Set(e),this.waiting=new Set(t.states.wait),void 0===s||i<=s)return e;const o=t.states.wait.filter(t=>r.has(t)&&!a.has(t)&&t.time>=s-.1&&t.time"ready"===t.$state),...o,...e.filter(t=>"ready"!==t.$state)]}clear(){this.time=void 0,this.rows.clear(),this.waiting.clear()}destroy(){this.document?.removeEventListener("visibilitychange",this.visibility),this.document=void 0,this.clear()}}class f{constructor(){this.pending=new Set,this.reserved=new Set}capture(t,e){for(const i of t)this.reserved.has(i)||e.has(i)||this.pending.add(i)}take(){const t=[],e=[];for(const n of this.pending)"ready"===n.$state?t.push(n):"wait"===n.$state&&e.push(n);this.pending.clear();const i=[...t,...e];return this.reserved=new Set(i),i}complete(){this.reserved.clear()}clear(){this.pending.clear(),this.reserved.clear()}}const g=Symbol("cancelled danmuku frame");class y{constructor(t){this.owner=t,this.generation=0,this.starts=0,this.frame=null,this.operation=null,this.closed=!1,this.running=!1,this.fault=!1,this.failedItems=new Set,this.buffer=new f,this.sampling=new m}active(t){const e=this.owner;return!this.closed&&!this.fault&&!e.art.isDestroy&&!e.isStop&&!e.isHide&&t.generation===this.generation}release(t){this.owner.renderer.release(t)}invalidate(){if(this.generation++,null!==this.frame&&window.cancelAnimationFrame(this.frame),this.frame=null,this.owner.timer=null,this.operation){const t=this.operation;this.operation=null,t.cancel(),this.release(t)}this.owner.workerClient?.cancel(),this.failedItems.clear(),this.buffer.clear(),this.sampling.clear()}report(t){try{this.owner.art.emit("artplayerPluginDanmuku:error",t)}catch(e){console.warn("Failed to report danmuku scheduling error:",e)}}fail(t){this.closed||this.fault||(this.fault=!0,this.invalidate(),this.report(t))}recover(){if(!this.closed&&!this.owner.art.isDestroy&&(this.failedItems.clear(),this.fault))try{this.owner.workerClient?.dispose(),this.owner.createWorker(),this.fault=!1}catch(t){this.report(t)}}schedule(){const t=this.owner;if(!(!this.running||this.closed||this.fault||t.art.isDestroy||t.isStop)){try{const e=t.art.video;(t.art.playing||!1===e?.paused&&!e.ended&&e.readyState>2)&&!t.isHide&&this.sampling.begin(t)}catch(e){return void this.fail(e)}null===this.frame&&(this.frame=window.requestAnimationFrame(()=>{if(this.frame=null,t.timer=null,this.closed||this.fault||t.isStop||t.art.isDestroy)return;const i=this.generation;try{if(t.art.playing&&!t.isHide){t.filter("emit",e=>{const i=Date.now();e.$restTime-=(i-e.$lastStartTime)/1e3,e.$lastStartTime=i,e.$restTime<=0&&t.makeWait(e)});const e=t.art.currentTime,n=t.readys;if(i!==this.generation)return;this.buffer.capture(this.sampling.capture(t,n,e),this.failedItems)}}catch(e){return void(i===this.generation&&this.fail(e))}if(this.schedule(),this.operation||!t.art.playing||t.isHide)return;const n=this.buffer.take();if(!n.length)return;let s;const a=new Promise(t=>s=()=>t(g)),r={generation:this.generation,cancel:s,wait:t=>Promise.race([t,a]),ref:null};return this.operation=r,this.run(r,n).catch(t=>{this.active(r)&&this.fail(t)}).finally(()=>{this.release(r),this.operation===r&&(this.operation=null,this.buffer.complete())})}),t.timer=this.frame)}}async run(t,e){const i=this.owner;if(i.art.playing&&this.active(t))for(const s of e){if(!this.active(t))return;if(this.failedItems.has(s))continue;let e;try{e=await t.wait(i.option.beforeVisible(s))}catch(n){if(!this.active(t))return;this.failedItems.add(s),this.report(n);continue}if(!this.active(t))return;if(!e)continue;const{clientWidth:a,clientHeight:r}=i.$player,o=i.renderer.prepare(s,t);if(!this.active(t))return;s.$lastStartTime=Date.now(),s.$restTime=i.speed;const l=a+o.clientWidth,d={type:"getDanmuTop",target:{mode:s.mode,height:o.clientHeight,speed:l/s.$restTime},visibles:i.visibles,antiOverlap:i.option.antiOverlap,clientWidth:a,clientHeight:r,marginBottom:i.marginBottom,marginTop:i.marginTop},h=d.antiOverlap?await t.wait(i.postMessage(d)):{result:u(d)},c="symbol"===typeof h?void 0:h.result;if(!this.active(t)||s.$ref!==o)return;void 0!==c?(s.$lastStartTime=Date.now(),i.setState(s,"emit"),i.renderer.place(s,o,c,l,a),t.ref=null,i.art.emit("artplayerPluginDanmuku:visible",s)):(i.setState(s,"ready"),this.release(t))}}destroy(){this.closed=!0,this.invalidate(),this.sampling.destroy()}}let v=0;class w{constructor(t,e){this.pending=new Map,this.closed=!1,this.failed=!1,this.onFailure=e,this.worker=t();try{this.worker.onmessage=t=>{const e=this.pending.get(t.data?.id);e&&(this.pending.delete(t.data.id),e.resolve(t.data))},this.worker.onerror=t=>{t.preventDefault?.(),this.fail(t.error||t)},this.worker.onmessageerror=t=>this.fail(t.error||t)}catch(i){try{this.dispose()}catch{}throw i}}request(t){t.id=++v;const{id:e}=t;return this.closed||this.failed?Promise.resolve({id:e,result:void 0}):new Promise((i,n)=>{this.pending.set(e,{resolve:i,reject:n});try{this.worker.postMessage(t)}catch(s){this.fail(s)}})}fail(t){if(!this.closed&&!this.failed){this.failed=!0;for(const e of this.pending.values())e.reject(t);this.pending.clear();try{this.dispose()}catch{}this.onFailure(t)}}cancel(){for(const[t,e]of this.pending)e.resolve({id:t,result:void 0});this.pending.clear()}dispose(){if(this.closed)return;this.closed=!0,this.cancel();let t,e=!1;const i=i=>{try{i()}catch(n){e||(t=n),e=!0}};for(const n of["onmessage","onerror","onmessageerror"])i(()=>this.worker[n]=null);if(i(()=>this.worker.terminate()),e)throw t}}const k='/*!\n * artplayer-plugin-danmuku.js v5.3.0\n * Github: https://github.com/zhw2590582/ArtPlayer\n * (c) 2017-2026 Harvey Zhao\n * Released under the MIT License.\n */\nfunction t({target:t,visibles:e,clientWidth:i,clientHeight:h,marginBottom:n,marginTop:o,antiOverlap:s}){const r=h-n,p=e.filter(e=>e.mode===t.mode&&e.top<=r).sort((t,e)=>t.top-e.top);if(0===p.length)return 2===t.mode?r-t.height:o;if(p.unshift({type:"top",top:0,left:0,right:0,height:o,width:i,speed:0,distance:i}),p.push({type:"bottom",top:r,left:0,right:0,height:n,width:i,speed:0,distance:i}),2===t.mode)for(let g=p.length-2;g>=0;g-=1){const e=p[g],i=p[g+1],h=e.top+e.height;if(i.top-h>=t.height)return i.top-t.height}else for(let g=1;g=t.height)return h}const a=[];for(let g=1;g{const i=Math.min(...e.map(t=>t.right)),h=Math.min(...t.map(t=>t.right));return i*e.length-h*t.length});break;case 1:case 2:a.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return a[0][0].top}switch(t.mode){case 0:{const e=a.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}onmessage=e=>{const{data:i}=e;if(!i.id||!i.type)return;const h=(0,{getDanmuTop:t}[i.type])(i);globalThis.postMessage({result:h,id:i.id})};\n',x="undefined"!==typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",k],{type:"text/javascript;charset=utf-8"});function b(t){let e;try{if(e=x&&(self.URL||self.webkitURL).createObjectURL(x),!e)throw"";const i=new Worker(e,{type:"module",name:t?.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(i){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(k),{type:"module",name:t?.name})}}class ${constructor(t,e){const{constructor:i,template:n}=t;this.utils=i.utils,this.validator=i.validator,this.$danmuku=n.$danmuku,this.$player=n.$player,this.art=t,this.queue=[],this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.index=0,this.worker=null,this.workerClient=null,this.renderer=new p(this),this.scheduler=new y(this),this.option=$.option,this.states={wait:[],ready:[],emit:[],stop:[]},this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.resize=this.resize.bind(this),this.destroy=this.destroy.bind(this),this.seek=this.seek.bind(this),d(this),t.on("destroy",this.destroy);try{if(this.config(e,!0),!d(this))return;this.createWorker()}catch(s){throw t.off("destroy",this.destroy),h(this),this.scheduler.destroy(),s}t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("resize",this.resize),t.on("video:seeking",this.seek),this.load().catch(t=>console.warn("Failed to load initial danmuku:",t))}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,width:512,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,emitter:!0,maxLength:200,lockTime:5,theme:"dark",OPACITY:{},FONT_SIZE:{},MARGIN:{},SPEED:{},COLOR:[]}}static get scheme(){return{danmuku:"array|function|string|promise",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement|string",heatmap:"object|boolean",width:"number",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",emitter:"boolean",maxLength:"number",lockTime:"number",theme:"string",OPACITY:"object",FONT_SIZE:"object",MARGIN:"object",SPEED:"object",COLOR:"array"}}static get cssText(){return'\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n '}get isRotate(){return this.art.plugins?.autoOrientation?.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return $.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return $.option.margin[1]}get fontSize(){const{clamp:t}=this.utils,{clientHeight:e}=this.$player,i=this.option.fontSize;if("number"===typeof i)return Math.round(t(i,12,e));if("string"===typeof i&&i.endsWith("%")){const n=Number.parseFloat(i)/100;return Math.round(t(e*n,12,e))}return $.option.fontSize}get $ref(){return this.renderer.acquire()}get readys(){return function(t){const{currentTime:e}=t.art,i=[];return c(t,"ready",t=>i.push(t)),c(t,"wait",t=>{e+.1>=t.time&&t.time>=e-.1&&i.push(t)}),i}(this)}get visibles(){return this.renderer.visibles}get speed(){return this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed}async load(e){const{errorHandle:i}=this.utils,n=function(t,e){const i=l(t);if(e)for(const o of[...i.tasks])o.replace&&o.cancel();let n,s=i.closed||t.art.isDestroy;const a=new Promise(t=>n=t),r=new Set,d="function"===typeof AbortController?new AbortController:void 0,h={replace:e,signal:d?.signal,active:()=>!s&&!i.closed&&!t.art.isDestroy,onCancel:t=>h.active()?(r.add(t),()=>r.delete(t)):(t(),()=>{}),cancel(){if(!s){s=!0,n(o),d?.abort();for(const t of[...r])t();r.clear()}},wait:t=>Promise.race([t,a]),emit(e){i.emitting.push(h);try{return t.emit(e)}finally{i.emitting.pop()}},finish(){i.tasks.delete(h),r.clear()}};return s?n(o):i.tasks.add(h),h}(this,void 0===e);try{if(!n.active())return this;const s=function(e,i){return"function"===typeof e?{asynchronous:!0,value:e()}:t(e)?{asynchronous:!0,value:e}:"string"===typeof e?{asynchronous:!0,value:a(e,i)}:{asynchronous:!1,value:Array.isArray(e)?e:[]}}(e||this.option.danmuku,n),r=s.asynchronous?await n.wait(s.value):s.value;if(!n.active())return this;i(Array.isArray(r),"Danmuku need return an array as result");const o=r;if(void 0===e){if(this.reset(),!n.active())return this;this.queue=[],this.states={wait:[],ready:[],emit:[],stop:[]},this.renderer.clear()}for(let t=0;t{const i=a[e],n=r[e];return"function"===typeof i||"function"===typeof n||t(i)||t(n)?i!==n:JSON.stringify(i)!==JSON.stringify(n)}))&&!i)return this;const o=function(t,e,{defaults:i,validate:n,clamp:s,mount:a}){const r=Object.assign({},i,t,e);return n(r),r.mode=s(r.mode,0,2),r.speed=s(r.speed,1,10),r.opacity=s(r.opacity,0,1),r.lockTime=s(r.lockTime,1,60),r.maxLength=s(r.maxLength,1,1e3),r.mount=r.mount||a,r}(this.option,e,{defaults:$.option,validate:t=>this.validator(t,$.scheme),clamp:n,mount:s});if(!d(this))return this;const l=this.option.beforeVisible!==o.beforeVisible;return this.option=o,l&&(this.scheduler.invalidate(),this.scheduler.schedule()),e.fontSize&&(this.reset(),!d(this))||(this.option.visible?this.show():this.hide(),d(this)&&this.art.emit("artplayerPluginDanmuku:config",this.option)),this}getLeft(t){return this.renderer.left(t)}postMessage(t={}){return this.workerClient.request(t)}createWorker(){this.workerClient=new w(()=>new b,t=>this.scheduler.fail(t)),this.worker=this.workerClient.worker}filter(t,e){return c(this,t,e)}setState(t,e){!function(t,e,i){t.states[e.$state]=t.states[e.$state].filter(t=>t!==e),e.$state=i,e.$ref&&(e.$ref.dataset.state=i),t.states[i].push(e)}(this,t,e)}makeWait(t){this.renderer.makeWait(t)}update(){return this.scheduler.running=!0,this.scheduler.schedule(),this}resize(){this.renderer.resize()}continue(){return this.renderer.continue(),this}suspend(){return this.renderer.suspend(),this}stop(){return this.isStop=!0,this.scheduler.running=!1,this.scheduler.invalidate(),this.suspend(),this.art.emit("artplayerPluginDanmuku:stop"),this}start(){if(this.scheduler.closed||this.art.isDestroy)return this;const t=++this.scheduler.starts,e=this.scheduler.generation;this.isStop=!1,this.scheduler.recover();return this.scheduler.closed||this.art.isDestroy||this.isStop||this.scheduler.fault||e!==this.scheduler.generation||t!==this.scheduler.starts||(this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")),this}reset(){return this.scheduler.invalidate(),this.queue.forEach(t=>this.makeWait(t)),this.art.emit("artplayerPluginDanmuku:reset"),this.scheduler.recover(),this.scheduler.schedule(),this}seek(){this.scheduler.invalidate(),this.scheduler.schedule()}show(){return this.isHide=!1,this.$danmuku.style.opacity=1,this.option.visible=!0,this.art.emit("artplayerPluginDanmuku:show"),this}hide(){return this.isHide=!0,this.scheduler.invalidate(),this.$danmuku.style.opacity=0,this.option.visible=!1,this.art.emit("artplayerPluginDanmuku:hide"),this.scheduler.schedule(),this}destroy(){h(this),this.scheduler.destroy();try{try{this.stop()}finally{this.workerClient?.dispose()}}finally{this.renderer.destroy(),this.art.off("video:play",this.start),this.art.off("video:playing",this.start),this.art.off("video:pause",this.stop),this.art.off("video:waiting",this.stop),this.art.off("resize",this.resize),this.art.off("video:seeking",this.seek),this.art.off("destroy",this.destroy),this.art.emit("artplayerPluginDanmuku:destroy")}}}const M=4294967295;function S(t,e){let i=0,n=t.length;for(;iNumber.isFinite(t)&&t>0))return null;const r={xMin:0,xMax:t,yMin:0,yMax:128,scale:.25,opacity:.2,minHeight:Math.floor(.05*e),sampling:Math.max(1,Math.floor(t/100)),smoothing:.2,flattening:.2},o=Object.assign({},"object"===typeof s?s:{}),l=Object.assign({},r,o);for(const b of Object.keys(r))Number.isFinite(l[b])||(l[b]=r[b]);if(l.sampling<=0&&(l.sampling=r.sampling),l.xMin===l.xMax||l.yMin===l.yMax)return null;const d=Array.isArray(a)&&a.length>0,h=d?[...a]:function(t,e,i,n){if(!Number.isFinite(e)||e<=0||!Number.isFinite(i)||i<=0||!Number.isFinite(n)||n<=0||Math.floor(e/n)+1>M)return[];const s=t.map(t=>t.time).filter(t=>"number"===typeof t&&!Number.isNaN(t)).sort((t,e)=>t-e),a=[],r=i/e;if(!Number.isFinite(r))return[];for(let o=0;o<=e;o+=n){if(a.length>=M||o+n===o)return[];const t=o*r,e=(o+n)*r;a.push([o,S(s,e)-S(s,t)])}return a}(n,t,i,l.sampling);if(!h.length||!h.every(t=>Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])))return null;const c=h[h.length-1];if(c[0]!==t){if(h.length===M)return null;h.push([t,c[1]])}let p=1/0,u=-1/0;for(const b of h)p=Math.min(p,b[1]),u=Math.max(u,b[1]);const m=(p+u)/2;for(const b of h){const t=b[1];b[1]=t*(t>m?1+l.scale:1-l.scale)+l.minHeight}const f=!d&&!Number.isFinite(o.yMin)&&!Number.isFinite(o.yMax);let g=0;for(const b of h)g=Math.max(g,b[1]);const y=f&&g>r.yMax/4;y&&(l.yMax=4*g);const v=t=>y?Math.min(e,Math.max(.75*e,t)):t,w=(t,e,i,n)=>{const s=function(t,e){const i=e[0]-t[0],n=e[1]-t[1];return{length:Math.sqrt(i**2+n**2),angle:Math.atan2(n,i)}}(e||t,i||t),a=z(Math.cos(s.angle)*l.flattening,0,1,1,0),r=s.angle*a+(n?Math.PI:0),o=s.length*l.smoothing;return[t[0]+Math.cos(r)*o,v(t[1]+Math.sin(r)*o)]},k=h.map(i=>[z(i[0],l.xMin,l.xMax,0,t),v(z(i[1],l.yMin,l.yMax,e,0))]);if(!k.every(t=>t.every(Number.isFinite)))return null;const x=k.map((t,i,n)=>{if(0===i)return`M ${n[n.length-1][0]},${e} L ${t[0]},${e} L ${t[0]},${t[1]}`;const s=w(n[i-1],n[i-2],t),a=w(t,n[i-1],n[i+1],!0);return`C ${s[0]},${s[1]} ${a[0]},${a[1]} ${t[0]},${t[1]}${i===n.length-1?" z":""}`}).join(" ");return/NaN|Infinity/u.test(x)?null:{path:x,opacity:l.opacity,width:t,height:e}}let F=0;function C(t,e,i){if(t.isDestroy)return;const{query:n}=t.constructor.utils;let s;const a=[];let r,o,l,d=!1;const h=()=>!d&&!t.isDestroy;function c(e,i){const n=i;a.push([e,n]),t.on(e,n)}function p(e){if(d)return;let i;d=!0,o=null,l=null;let n=!1;const s=t=>{try{t()}catch(e){n||(i=e),n=!0}};for(const[r,o]of a.splice(0))s(()=>t.off(r,o));if(e&&r&&t.controls.heatmap===r&&s(()=>t.controls.remove("heatmap")),r=void 0,n)throw i}function u(t){h()&&o&&l&&(o.setAttribute("offset",100*t+"%"),l.setAttribute("offset",100*t+"%"))}function m(a){try{!function(a=[]){if(!h())return;o=null,l=null;const d=r;if(d.innerHTML="",t.option.isLive)return;const c=E({width:d.offsetWidth,height:d.offsetHeight,duration:t.duration,queue:e.queue,option:i,points:a});if(!c||!h())return;const p=d.ownerDocument;for(s||(s=p?"heatmap-solids":"heatmap-solids-"+ ++F);p?.getElementById(s);)s="heatmap-solids-"+ ++F;d.innerHTML=`\n \n \n \n \n \n \n \n \n \n \n \n `,o=n("#heatmap-start",d),l=n("#heatmap-stop",d),u(t.played)}(a)}catch(d){try{p(!0)}catch{}throw d}}c("destroy",()=>p(!0));try{t.controls.add({name:"heatmap",position:"top",html:"",style:{position:"absolute",top:"-100px",left:"0px",right:"0px",height:"100px",width:"100%",pointerEvents:"none"},beforeUnmount(){p(!1)},mounted(e){if(r=e,d)return t.controls.heatmap===e&&t.controls.remove("heatmap"),void(r=void 0);h()?(c("video:timeupdate",()=>u(t.played)),c("setBar",(t,e)=>{"played"===t&&u(e)}),c("ready",()=>m()),c("resize",()=>m()),c("artplayerPluginDanmuku:loaded",()=>m()),c("artplayerPluginDanmuku:points",t=>m(t))):p(!0)}})}catch(f){try{p(!0)}catch{}throw f}return()=>p(!0)}const D=new WeakMap;class T{constructor(t){this.art=t,this.closed=!1,this.disposers=new Set,this.cancelled=new Promise(t=>this.cancel=t)}get active(){return!this.closed&&!this.art.isDestroy}own(t){this.closed?t():this.disposers.add(t)}write(t,e,i,n=i=>t[e]=i){const s=t;if(!this.active)return;const a=()=>"function"===typeof s.getPropertyPriority?s.getPropertyPriority(e):void 0;let r=D.get(s);r||(r=new Map,D.set(s,r));let o=r.get(e);o||(o={original:s[e],present:e in s||void 0!==s[e],priority:a(),owners:new Map,apply:n},r.set(e,o)),o.owners.has(this)||this.own(()=>{const t=[...o.owners.keys()],i=t[t.length-1]===this;if(o.owners.delete(this),i&&s[e]===o.last&&a()===o.lastPriority){const t=[...o.owners.values()];t.length?(o.apply(t[t.length-1]),o.last=s[e],o.lastPriority=a()):void 0!==o.priority?s.setProperty(e,o.original,o.priority):o.present?o.apply(o.original):delete s[e]}o.owners.size||(r.delete(e),r.size||D.delete(s))}),o.owners.delete(this),o.owners.set(this,i),o.apply(i),o.last=s[e],o.lastPriority=a()}on(t,e){if(!this.active)return;const i=this;function n(...t){if(i.active)return e.apply(this,t)}const s=()=>this.art.off(t,n);this.own(s);try{this.art.on(t,n),this.active||s()}catch(a){throw this.release(s),a}}proxy(t,e,i){if(!this.active)return;const n=this;function s(...t){if(n.active)return i.apply(this,t)}let a;const r=()=>{if("function"===typeof a){const t=this.art.events;"function"===typeof t?.remove&&t.destroyEvents?.has(a)?t.remove(a):a()}else t.removeEventListener?.(e,s)};this.own(r);try{a=this.art.proxy(t,e,s),this.active||r()}catch(o){throw this.release(r),o}}wait(t){return Promise.race([t,this.cancelled])}release(t){try{t()}catch(e){console.warn("Failed to dispose danmuku setting resource:",e)}}close(){if(!this.closed){this.closed=!0,this.cancel();for(const t of this.disposers)this.release(t);this.disposers.clear()}}}function P({min:t,max:e,container:i,findIndex:n,onChange:s,steps:a=[]}){const{lifecycle:r}=this;if(!r.active)return{reset(){}};const{query:o,clamp:l,setStyle:d}=this.utils;d(i,"touch-action","none"),i.innerHTML=`\n

\n
\n ${a.map(()=>'
').join("")}\n
\n
\n
\n
\n
\n ${a.map(t=>t.hide?"":`
${t.name}
`).join("")}\n
\n `;const h=o(".apd-slider-dot",i),c=o(".apd-slider-progress",i);let p=!1;function u(i){if(!r.active)return;if(void 0===i&&(i=n()),ie)return;const o=(i-t)/(e-t);h.style.left=100*o+"%",0===a.length&&(c.style.width=h.style.left),s(i)}function m(n){const{top:s,height:a,left:r,width:o}=i.getBoundingClientRect();if(this.art.isRotate){const i=l(n.clientY-s,0,a);u(Math.round(i/a*(e-t)+t))}else{const i=l(n.clientX-r,0,o);u(Math.round(i/o*(e-t)+t))}}return r.own(()=>p=!1),r.proxy(i,"click",t=>{m.call(this,t)}),r.proxy(i,"pointerdown",t=>{p=0===t.button}),r.on("document:pointermove",t=>{p&&m.call(this,t)}),r.on("document:pointerup",t=>{p&&(p=!1,m.call(this,t))}),{reset:u}}const L='',A='',H='',O='',N='',V='',q='',I='',j='',B='',R='',Z='';function W(){const{option:t}=this;return`\n
\n ${R}${B}\n
\n
\n ${H}\n
\n
\n
\n \u6309\u7c7b\u578b\u5c4f\u853d\n
\n
\n ${O}${N}\n
\u6eda\u52a8
\n
\n
\n ${V}${q}\n
\u9876\u90e8
\n
\n
\n ${I}${j}\n
\u5e95\u90e8
\n
\n
\n
\n
\n
\n ${A}${L}\n \u9632\u6b62\u5f39\u5e55\u91cd\u53e0\n
\n
\n ${A}${L}\n \u540c\u6b65\u89c6\u9891\u901f\u5ea6\n
\n
\n
\n \u4e0d\u900f\u660e\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n \u663e\u793a\u533a\u57df\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u5b57\u53f7\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u901f\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n
\n
\n
\n
\n ${Z}\n
\n
\n
\n \u6a21\u5f0f\n
\n
\n ${N}\n
\u6eda\u52a8
\n
\n
\n ${q}\n
\u9876\u90e8
\n
\n
\n ${j}\n
\u5e95\u90e8
\n
\n
\n
\n
\n \u989c\u8272\n
\n ${this.COLOR.map(t=>`
`).join("")}\n
\n
\n
\n
\n
\n \n
\u53d1\u9001
\n
\n `}if("undefined"!==typeof document){const t="artplayer-plugin-danmuku",e=Symbol.for("artplayer-plugin-danmuku.pending-style"),i=document;let n=document.getElementById(t)||i[e];if(!n)if(n=document.createElement("style"),n.id=t,"loading"===document.readyState){i[e]=n;const s=()=>{document.removeEventListener("DOMContentLoaded",s),i[e]===n&&delete i[e];const a=document.getElementById(t);a?a.textContent=n.textContent:(document.head||document.documentElement).appendChild(n)};document.addEventListener("DOMContentLoaded",s,{once:!0})}else(document.head||document.documentElement).appendChild(n);n.textContent='.artplayer-plugin-danmuku{display:flex;position:relative;z-index:99;align-items:center;justify-content:center;font-size:12px;height:32px;width:100%;color:#fff;font-weight:300;flex-shrink:0;gap:10px}.artplayer-plugin-danmuku .apd-icon{cursor:pointer;opacity:.75;transition:all .2s ease;fill:#fff}.artplayer-plugin-danmuku .apd-icon:hover{opacity:1}.artplayer-plugin-danmuku .apd-config{display:flex;position:relative}.artplayer-plugin-danmuku .apd-config .apd-config-panel{position:absolute;bottom:24px;left:0;width:320px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-config .apd-config-panel .apd-config-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-config:hover .apd-config-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-config-mode,.artplayer-plugin-danmuku .apd-config-slider,.artplayer-plugin-danmuku .apd-config-other,.artplayer-plugin-danmuku .apd-style-mode{margin-bottom:15px}.artplayer-plugin-danmuku .apd-modes{display:flex;align-items:center;margin-top:5px;gap:20px}.artplayer-plugin-danmuku .apd-modes .apd-mode{cursor:pointer;text-align:center}.artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-config-slider{display:flex;align-items:center;gap:12px}.artplayer-plugin-danmuku .apd-config-slider .apd-value{width:32px;text-align:right}.artplayer-plugin-danmuku .apd-slider{position:relative;flex:1;display:flex;height:20px;align-items:center;justify-content:center;cursor:pointer}.artplayer-plugin-danmuku .apd-slider .apd-slider-line{position:relative;height:2px;width:100%;overflow:hidden;border-radius:3px;background-color:#ffffff40}.artplayer-plugin-danmuku .apd-slider .apd-slider-points{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}.artplayer-plugin-danmuku .apd-slider .apd-slider-points .apd-slider-point{width:2px;height:2px;border-radius:50%;background-color:#ffffff80}.artplayer-plugin-danmuku .apd-slider .apd-slider-progress{width:0%;height:100%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-dot{position:absolute;transform:translate(-6px);left:0%;width:12px;height:12px;border-radius:50%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps{display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:-12px;width:calc(100% + 32px);color:#777}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps .apd-slider-step{flex-shrink:0;width:36px;text-align:center;scale:.95}.artplayer-plugin-danmuku .apd-config-other{display:flex;align-items:center;gap:20px}.artplayer-plugin-danmuku .apd-config-other .apd-check-off,.artplayer-plugin-danmuku .apd-config-other .apd-check-on{width:16px;height:16px}.artplayer-plugin-danmuku .apd-config-other .apd-other{display:flex;align-items:center;cursor:pointer;gap:2px}.artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-emitter{display:flex;flex:1;align-items:center;height:100%;background-color:#ffffff40;border-radius:5px}.artplayer-plugin-danmuku .apd-style{position:relative;display:flex;align-items:center;justify-content:center}.artplayer-plugin-danmuku .apd-style .apd-style-panel{position:absolute;bottom:24px;left:0;width:200px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-style .apd-style-panel .apd-style-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-style:hover .apd-style-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-colors{display:flex;flex-wrap:wrap;margin-top:5px;gap:8px}.artplayer-plugin-danmuku .apd-colors .apd-color{width:16px;height:16px;border-radius:2px;cursor:pointer}.artplayer-plugin-danmuku .apd-colors .apd-color.apd-active{border:1px solid black;box-shadow:0 0 0 1px #fff}.artplayer-plugin-danmuku .apd-input{outline:none;height:100%;flex:1;min-width:0;width:auto;border:none;line-height:1;color:#fff;background-color:transparent}.artplayer-plugin-danmuku .apd-input::placeholder{color:#ffffff80}.artplayer-plugin-danmuku .apd-send{display:flex;align-items:center;justify-content:center;height:100%;width:60px;flex-shrink:0;cursor:pointer;text-shadow:none;border-top-right-radius:5px;border-bottom-right-radius:5px;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-send.apd-lock{cursor:not-allowed;color:#666;background-color:#e7e7e7}.art-controls-center .apd-emitter{width:260px;flex:none}.art-fullscreen .artplayer-plugin-danmuku,.art-fullscreen-web .artplayer-plugin-danmuku{height:38px;gap:16px}.art-fullscreen .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen-web .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-on,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-on{width:28px;height:28px}.art-fullscreen .artplayer-plugin-danmuku .apd-emitter,.art-fullscreen-web .artplayer-plugin-danmuku .apd-emitter{width:400px;flex:none}.art-video-player>.artplayer-plugin-danmuku{position:absolute;left:0;right:0;bottom:-40px;padding:0 10px}.art-video-player:has(>.artplayer-plugin-danmuku){margin-bottom:40px}[data-danmuku-emitter=false] .apd-emitter{display:none!important}[data-danmuku-emitter=false] .art-controls-center .artplayer-plugin-danmuku{justify-content:flex-end;gap:18px}[data-danmuku-emitter=false].art-fullscreen .art-controls-center .artplayer-plugin-danmuku,[data-danmuku-emitter=false].art-fullscreen-web .art-controls-center .artplayer-plugin-danmuku{gap:24px}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-icon{fill:#333}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-emitter{background-color:#f1f2f3}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input{color:#000}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input::placeholder{color:#0000004d}[data-danmuku-visible=false] .apd-toggle-off{display:block}[data-danmuku-visible=false] .apd-toggle-on,[data-danmuku-visible=true] .apd-toggle-off{display:none}[data-danmuku-visible=true] .apd-toggle-on{display:block}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-on{display:none}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-off,[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-on{display:block}[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-off,[data-danmuku-sync-video=false] .apd-sync-video .apd-check-on{display:none}[data-danmuku-sync-video=false] .apd-sync-video .apd-check-off,[data-danmuku-sync-video=true] .apd-sync-video .apd-check-on{display:block}[data-danmuku-sync-video=true] .apd-sync-video .apd-check-off{display:none}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-off{display:block}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-on{display:none}[data-danmuku-mode0=false] .art-danmuku [data-mode="0"]{opacity:0!important}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-off{display:none}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-on{display:block}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"]{color:#00a1d6}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"] path{fill:#00a1d6}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-off{display:block}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-on{display:none}[data-danmuku-mode1=false] .art-danmuku [data-mode="1"]{opacity:0!important}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-off{display:none}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-on{display:block}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"]{color:#00a1d6}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"] path{fill:#00a1d6}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-off{display:block}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-on{display:none}[data-danmuku-mode2=false] .art-danmuku [data-mode="2"]{opacity:0!important}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-off{display:none}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-on{display:block}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"]{color:#00a1d6}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"] path{fill:#00a1d6}'}class _{constructor(t,e){this.art=t,this.danmuku=e,this.utils=t.constructor.utils;const{setStyle:i}=this.utils,{$controlsCenter:n}=t.template;this.template={$controlsCenter:n,$mount:n,$danmuku:null,$toggle:null,$config:null,$configPanel:null,$configModes:null,$style:null,$stylePanel:null,$styleModes:null,$colors:null,$opacitySlider:null,$opacityValue:null,$marginSlider:null,$marginValue:null,$fontSizeSlider:null,$fontSizeValue:null,$speedSlider:null,$speedValue:null,$input:null,$send:null},this.slider={opacity:null,margin:null,fontSize:null,speed:null},this.emitting=!1,this.isLock=!1,this.timer=null,this.lifecycle=new T(t),this.destroy=this.destroy.bind(this),this.lifecycle.own(()=>t.off("destroy",this.destroy));try{if(t.on("destroy",this.destroy),!this.lifecycle.active)return;if(this.lifecycle.write(n.style,"display","flex",t=>i(n,"display",t)),this.createTemplate(),!this.lifecycle.active)return;if(this.createSliders(),!this.lifecycle.active)return;if(this.createEvents(),this.mount(this.option.mount),!this.lifecycle.active)return;this.lifecycle.on("resize",()=>this.resize()),this.lifecycle.on("fullscreen",t=>this.onFullscreen(t)),this.lifecycle.on("fullscreenWeb",t=>this.onFullscreen(t)),this.lifecycle.proxy(this.template.$config,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$config,$panel:this.template.$configPanel})}),this.lifecycle.proxy(this.template.$style,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$style,$panel:this.template.$stylePanel})})}catch(s){try{this.destroy()}catch(a){console.warn("Failed to roll back danmuku setting:",a)}throw s}}static get icons(){return{$on:R,$off:B,$config:H,$style:Z,$mode_0_off:O,$mode_0_on:N,$mode_1_off:V,$mode_1_on:q,$mode_2_off:I,$mode_2_on:j,$check_on:A,$check_off:L}}get option(){return this.danmuku.option}get outside(){return this.template.$mount!==this.template.$controlsCenter}get TEMPLATE(){return W.call(this)}get OPACITY(){return{min:0,max:100,steps:[],...this.option.OPACITY}}get FONT_SIZE(){return{min:12,max:120,steps:[],...this.option.FONT_SIZE}}get MARGIN(){return{min:0,max:3,steps:[{name:"1/4",value:[10,"75%"]},{name:"\u534a\u5c4f",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"\u6ee1\u5c4f",value:[10,10]}],...this.option.MARGIN}}get SPEED(){return{min:0,max:4,steps:[{name:"\u6781\u6162",value:10},{name:"\u8f83\u6162",value:7.5,hide:!0},{name:"\u9002\u4e2d",value:5},{name:"\u8f83\u5feb",value:2.5,hide:!0},{name:"\u6781\u5feb",value:1}],...this.option.SPEED}}get COLOR(){return this.option.COLOR.length?this.option.COLOR:["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(t){const{query:e}=this.utils,{$danmuku:i}=this.template;return e(t,i)}append(t,e){if(!this.lifecycle.active)return;const{append:i}=this.utils;[...t.children].includes(e)||i(t,e)}setData(t,e){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,{$mount:n}=this.template;this.lifecycle.write(i.dataset,t,e),this.outside&&this.lifecycle.write(n.dataset,t,e)}createTemplate(){const{createElement:t,tooltip:e}=this.utils,i=t("div");this.template.$danmuku=i,i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$toggle=this.query(".apd-toggle"),this.template.$config=this.query(".apd-config"),this.template.$configPanel=this.query(".apd-config-panel"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$style=this.query(".apd-style"),this.template.$stylePanel=this.query(".apd-style-panel"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send");const{$toggle:n}=this.template;this.lifecycle.on("artplayerPluginDanmuku:show",()=>{e(n,"\u5173\u95ed\u5f39\u5e55")}),this.lifecycle.on("artplayerPluginDanmuku:hide",()=>{e(n,"\u6253\u5f00\u5f39\u5e55")})}createEvents(){const{$toggle:t,$configModes:e,$styleModes:i,$colors:n,$antiOverlap:s,$syncVideo:a,$send:r,$input:o}=this.template;this.lifecycle.proxy(t,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.lifecycle.proxy(e,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(t=>t!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.lifecycle.proxy(s,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.lifecycle.proxy(a,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.lifecycle.proxy(i,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.lifecycle.proxy(n,"click",t=>{const e=t.target.closest(".apd-color");e&&(this.danmuku.config({color:e.dataset.color}),this.reset())}),this.lifecycle.proxy(r,"click",()=>this.emit()),this.lifecycle.proxy(o,"keypress",t=>{"Enter"===t.key&&(t.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider({...this.OPACITY,container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:t=>{const{$opacityValue:e}=this.template;e.textContent=`${t}%`,this.danmuku.config({opacity:t/100})}}),this.slider.margin=this.createSlider({...this.MARGIN,container:this.template.$marginSlider,findIndex:()=>this.MARGIN.steps.findIndex(t=>t.value[0]===this.option.margin[0]&&t.value[1]===this.option.margin[1]),onChange:t=>{const e=this.MARGIN.steps[t];if(!e)return;const{$marginValue:i}=this.template;i.textContent=e.name,this.danmuku.config({margin:e.value})}}),this.slider.fontSize=this.createSlider({...this.FONT_SIZE,container:this.template.$fontSizeSlider,findIndex:()=>this.danmuku.fontSize,onChange:t=>{const{$fontSizeValue:e}=this.template;e.textContent=`${t}px`,t!==this.danmuku.fontSize&&this.danmuku.config({fontSize:t})}}),this.slider.speed=this.createSlider({...this.SPEED,container:this.template.$speedSlider,findIndex:()=>this.SPEED.steps.findIndex(t=>t.value===this.option.speed),onChange:t=>{const e=this.SPEED.steps[t];if(!e)return;const{$speedValue:i}=this.template;i.textContent=e.name,this.danmuku.config({speed:e.value})}})}createSlider(t){return P.call(this,t)}onFullscreen(t){if(!this.lifecycle.active)return;const{$danmuku:e,$controlsCenter:i,$mount:n}=this.template;this.outside?t?this.append(i,e):this.append(n,e):this.append(i,e)}onMouseEnter({$control:t,$panel:e}){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),r=s.width/2-n.width/2,o=a.left-(n.left-r),l=n.right+r-a.right;e.style.left=o>0?`${-r+o}px`:l>0?-r-l+"px":-r+"px"}emit(){return async function(t){const{lifecycle:e,template:{$input:i}}=t;if(!e.active)return;const n=i.value.trim();if(!n.length||t.isLock||t.emitting)return;const s={text:n,mode:t.option.mode,color:t.option.color,time:t.art.currentTime},a=t=>{e.active&&console.error("Error emitting danmuku:",t)};try{t.emitting=!0;const n=await e.wait(t.option.beforeEmit(s));if(!e.active)return;if(t.emitting=!1,!0!==n)return;if(s.border=!0,delete s.time,Promise.resolve(t.danmuku.emit(s)).catch(a),!e.active)return;i.value="",t.lock()}catch(r){a(r),e.active&&(t.emitting=!1)}}(this)}lock(){!function(t){if(!t.lifecycle.active)return;const{addClass:e}=t.utils,{$send:i}=t.template;clearTimeout(t.timer),t.isLock=!0;let n=t.option.lockTime;i.textContent=n,e(i,"apd-lock");const s=()=>{t.timer=setTimeout(()=>{t.lifecycle.active&&(0===n?t.unlock():(n-=1,i.textContent=n,s()))},1e3)};s()}(this)}unlock(){!function(t){if(clearTimeout(t.timer),t.timer=null,t.isLock=!1,!t.lifecycle.active)return;const{removeClass:e}=t.utils,{$send:i}=t.template;i.textContent="\u53d1\u9001",e(i,"apd-lock")}(this)}resize(){if(!this.lifecycle.active)return;if(this.outside)return;if(this.art.fullscreen)return;if(this.art.fullscreenWeb)return;const{$player:t,$controlsCenter:e}=this.art.template,{$danmuku:i}=this.template;this.art.widtht.dataset.color===this.option.color.toUpperCase());a&&t(a,"apd-active"),e(i,this.option.visible?"\u5173\u95ed\u5f39\u5e55":"\u6253\u5f00\u5f39\u5e55"),this.resize()}mount(t){if(!this.lifecycle.active)return;const{errorHandle:e}=this.utils,i="string"===typeof t?document.querySelector(t):t;e(i,`Can not find the mount point: ${t}`),this.append(i,this.template.$danmuku),this.template.$mount=i,this.reset()}destroy(){if(this.lifecycle.closed)return;this.lifecycle.close(),clearTimeout(this.timer),this.timer=null,this.emitting=!1,this.isLock=!1;const t=this.template.$danmuku;t?.parentElement&&t.parentElement.removeChild(t)}}function U(t){return e=>{const i=new $(e,t);let n;try{n=e.isDestroy?void 0:new _(e,i),!e.isDestroy&&i.option.heatmap&&C(e,i,i.option.heatmap)}catch(s){try{n?.destroy()}catch{}try{i.destroy()}catch{}throw s}return{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:n?n.mount.bind(n):()=>{},get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}return U.icons=_.icons,U}); diff --git a/docs/compiled/artplayer-plugin-danmuku.legacy.js b/docs/compiled/artplayer-plugin-danmuku.legacy.js index 29fbd92d3..2631ffe2e 100644 --- a/docs/compiled/artplayer-plugin-danmuku.legacy.js +++ b/docs/compiled/artplayer-plugin-danmuku.legacy.js @@ -4,4 +4,4 @@ * (c) 2017-2026 Harvey Zhao * Released under the MIT License. */ -!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.artplayerPluginDanmuku=e(),define(function(){return t.artplayerPluginDanmuku})):(t="undefined"!==typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=Math.pow,o=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,l=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&o(t,i,e[i]);if(n)for(var i of n(e))a.call(e,i)&&o(t,i,e[i]);return t},d=(t,n)=>e(t,i(n)),h=(t,e,i)=>new Promise((n,s)=>{var a=t=>{try{o(i.next(t))}catch(e){s(e)}},r=t=>{try{o(i.throw(t))}catch(e){s(e)}},o=t=>t.done?n(t.value):Promise.resolve(t.value).then(a,r);o((i=i.apply(t,e)).next())});function c(t){return t instanceof Promise||"[object Promise]"===Object.prototype.toString.call(t)}function p(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:return 2;case 5:return 1}}function u(t){if("string"!==typeof t)return[];const e=new RegExp(']*?p="(?

[^"]+)"[^>]*>(?.*?)<\\/d>',"gs"),i=t.matchAll(e);return Array.from(i).map(t=>{const e=t.groups.p.split(",");if(e.length>=8){return{text:t.groups.text.trim().replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&"),time:Number(e[0]),mode:p(Number(e[1])),fontSize:Number(e[2]),color:`#${Number(e[3]).toString(16)}`,timestamp:Number(e[4]),pool:Number(e[5]),userID:e[6],rowID:Number(e[7])}}return null}).filter(Boolean)}function m({data:t}){const{xml:e,id:i}=t,n=u(e);globalThis.postMessage({danmus:n,id:i})}let f=0;function g(t,{signal:e,onCancel:i}={}){return new Promise((n,s)=>{let a,r,o,l=!1;const d=++f,c=()=>y(void 0,function(t){if(void 0!==(null==t?void 0:t.reason))return t.reason;const e=new Error("Bilibili Danmu loading cancelled");return e.name="AbortError",e}(e));function g(){let t,e=!1;try{if(a){const t=a;a=void 0,t.onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate()}}catch(i){t=i,e=!0}if(void 0!==r){const n=r;r=void 0;try{URL.revokeObjectURL(n)}catch(i){e||(t=i),e=!0}}if(e)throw t}function y(t,i){if(l)return;l=!0;let a=arguments.length>1;null==e||e.removeEventListener("abort",c),null==o||o();try{g()}catch(r){a||(i=r),a=!0}a?s(i):n(t)}function v(t,e){if(!l){console.error("Error parsing Bilibili Danmu:",e);try{y(u(t))}catch(i){y(void 0,i)}}}(null==e?void 0:e.aborted)?c():(null==e||e.addEventListener("abort",c),o=null==i?void 0:i(c),l?null==o||o():function(){return h(this,null,function*(){const i=e?yield fetch(t,{signal:e}):yield fetch(t);if(l)return;const n=yield i.text();if(!l)try{const t=`\n ${p.toString()}\n ${u.toString()}\n onmessage = ${m.toString()}\n `;if(r=URL.createObjectURL(new Blob([t],{type:"application/javascript"})),l)return void g();if(a=new Worker(r),l)return void g();a.onmessage=t=>{var e;if(l||(null==(e=t.data)?void 0:e.id)!==d)return;const{danmus:i}=t.data;Array.isArray(i)?y(i):y(void 0,new Error("Invalid Bilibili Danmu worker response"))},a.onerror=t=>{var e;null==(e=t.preventDefault)||e.call(t),v(n,t.error||t)},a.onmessageerror=t=>v(n,t.error||t),a.postMessage({xml:n,id:d})}catch(s){v(n,s)}})}().catch(t=>y(void 0,t)))})}const y=new WeakMap,v=Symbol("cancelled danmuku input");function w(t){return y.has(t)||y.set(t,{closed:!1,tasks:new Set,emitting:[]}),y.get(t)}function k(t){const e=w(t),i=e.emitting[e.emitting.length-1];return!e.closed&&!t.art.isDestroy&&(!i||i.active())}function x(t){const e=w(t);e.closed=!0;for(const i of[...e.tasks])i.cancel()}function b(t,e,i){const n=t.states[e]||[];for(let s=0;s{const s=n.$ref.offsetTop,a=this.owner.getLeft(n.$ref)-i,r=n.$ref.clientHeight,o=n.$ref.clientWidth,l=a+o,d=e-l,h=l/n.$restTime,c={};c.top=s,c.left=a,c.height=r,c.width=o,c.right=d,c.speed=h,c.distance=l,c.time=n.$restTime,c.mode=n.mode,t.push(c)}),t}left(t){const e=t.getBoundingClientRect();return this.owner.isRotate?e.top:e.left}makeWait(t){this.owner.setState(t,"wait"),t.$ref&&(t.$ref.style.cssText=this.owner.constructor.cssText,t.$ref.style.visibility="hidden",t.$ref.style.marginLeft="0px",t.$ref.style.transform="translateX(0px)",t.$ref.style.transition="transform 0s linear 0s",this.owner.$refs.push(t.$ref),t.$ref=null)}resize(){const{clientWidth:t}=this.owner.$player;this.owner.filter("stop",e=>{if(0===e.mode)e.$ref.style.left=`${t}px`}),this.owner.filter("emit",e=>{switch(e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.left=`${t}px`,e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}})}continue(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("stop",e=>{switch(this.owner.setState(e,"emit"),e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}}),this}suspend(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("emit",e=>{switch(this.owner.setState(e,"stop"),e.mode){case 0:{const i=t-(this.owner.getLeft(e.$ref)-this.owner.getLeft(this.owner.$player));e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition="transform 0s linear 0s";break}}}),this}prepare(t,e){const i=this.owner,n=i.$ref;return e.danmu=t,e.ref=n,t.$ref=n,n.textContent=t.text,i.$danmuku.appendChild(n),n.style.opacity=i.option.opacity,n.style.fontSize=`${i.fontSize}px`,n.style.color=t.color,n.style.border=t.border?`1px solid ${t.color}`:null,n.style.backgroundColor=t.border?"rgb(0 0 0 / 50%)":null,i.utils.setStyles(n,t.style),n}place(t,e,i,n,s){switch(e.style.top=`${i}px`,e.style.visibility="visible",e.dataset.mode=t.mode,e.dataset.id=t.id||"",t.mode){case 0:e.style.left=`${s}px`,e.style.marginLeft="0px",e.style.transform=`translateX(${-n}px)`,e.style.transition=`transform ${t.$restTime}s linear 0s`;break;case 1:case 2:e.style.left="50%",e.style.marginLeft=`-${e.clientWidth/2}px`}}release(t){const{danmu:e,ref:i}=t;i&&e.$ref===i&&(i.style.cssText=this.owner.constructor.cssText,i.style.visibility="hidden",this.owner.$refs.push(i),e.$ref=null),t.ref=null}clear(){this.destroy(),this.owner.$refs=[],this.owner.$danmuku.textContent=""}destroy(){for(const t of this.nodes)t.parentElement&&t.parentElement.removeChild(t);for(const t of this.owner.queue)t.$ref=null;this.owner.$refs.length=0,this.nodes.clear()}}function M({target:t,visibles:e,clientWidth:i,clientHeight:n,marginBottom:s,marginTop:a,antiOverlap:r}){const o=n-s,l=e.filter(e=>e.mode===t.mode&&e.top<=o).sort((t,e)=>t.top-e.top);if(0===l.length)return 2===t.mode?o-t.height:a;if(l.unshift({type:"top",top:0,left:0,right:0,height:a,width:i,speed:0,distance:i}),l.push({type:"bottom",top:o,left:0,right:0,height:s,width:i,speed:0,distance:i}),2===t.mode)for(let h=l.length-2;h>=0;h-=1){const e=l[h],i=l[h+1],n=e.top+e.height;if(i.top-n>=t.height)return i.top-t.height}else for(let h=1;h=t.height)return n}const d=[];for(let h=1;h{const i=Math.min(...e.map(t=>t.right)),n=Math.min(...t.map(t=>t.right));return i*e.length-n*t.length});break;case 1:case 2:d.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return d[0][0].top}switch(t.mode){case 0:{const e=d.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}class S{constructor(){this.rows=new Set,this.waiting=new Set,this.visibility=()=>this.clear()}capture(t,e,i){var n,s;const a=t.$player.ownerDocument;if(a!==this.document&&(null==(n=this.document)||n.removeEventListener("visibilitychange",this.visibility),this.document=a,null==a||a.addEventListener("visibilitychange",this.visibility),this.clear()),!Number.isFinite(i)||"hidden"===(null==a?void 0:a.visibilityState)||(null==(s=t.art.video)?void 0:s.seeking))return this.clear(),e;const r=this.time,o=this.rows,l=this.waiting;if(this.time=i,this.rows=new Set(e),this.waiting=new Set(t.states.wait),void 0===r||i<=r)return e;const d=t.states.wait.filter(t=>l.has(t)&&!o.has(t)&&t.time>=r-.1&&t.time"ready"===t.$state),...d,...e.filter(t=>"ready"!==t.$state)]}clear(){this.time=void 0,this.rows.clear(),this.waiting.clear()}destroy(){var t;null==(t=this.document)||t.removeEventListener("visibilitychange",this.visibility),this.document=void 0,this.clear()}}class z{constructor(){this.pending=new Set,this.reserved=new Set}capture(t,e){for(const i of t)this.reserved.has(i)||e.has(i)||this.pending.add(i)}take(){const t=[],e=[];for(const n of this.pending)"ready"===n.$state?t.push(n):"wait"===n.$state&&e.push(n);this.pending.clear();const i=[...t,...e];return this.reserved=new Set(i),i}complete(){this.reserved.clear()}clear(){this.pending.clear(),this.reserved.clear()}}const E=Symbol("cancelled danmuku frame");class F{constructor(t){this.owner=t,this.generation=0,this.starts=0,this.frame=null,this.operation=null,this.closed=!1,this.running=!1,this.fault=!1,this.failedItems=new Set,this.buffer=new z,this.sampling=new S}active(t){const e=this.owner;return!this.closed&&!this.fault&&!e.art.isDestroy&&!e.isStop&&!e.isHide&&t.generation===this.generation}release(t){this.owner.renderer.release(t)}invalidate(){var t;if(this.generation++,null!==this.frame&&window.cancelAnimationFrame(this.frame),this.frame=null,this.owner.timer=null,this.operation){const t=this.operation;this.operation=null,t.cancel(),this.release(t)}null==(t=this.owner.workerClient)||t.cancel(),this.failedItems.clear(),this.buffer.clear(),this.sampling.clear()}report(t){try{this.owner.art.emit("artplayerPluginDanmuku:error",t)}catch(e){console.warn("Failed to report danmuku scheduling error:",e)}}fail(t){this.closed||this.fault||(this.fault=!0,this.invalidate(),this.report(t))}recover(){var t;if(!this.closed&&!this.owner.art.isDestroy&&(this.failedItems.clear(),this.fault))try{null==(t=this.owner.workerClient)||t.dispose(),this.owner.createWorker(),this.fault=!1}catch(e){this.report(e)}}schedule(){const t=this.owner;!this.running||this.closed||this.fault||t.art.isDestroy||t.isStop||null!==this.frame||(this.frame=window.requestAnimationFrame(()=>{if(this.frame=null,t.timer=null,this.closed||this.fault||t.isStop||t.art.isDestroy)return;const e=this.generation;try{if(t.art.playing&&!t.isHide){t.filter("emit",e=>{const i=Date.now();e.$restTime-=(i-e.$lastStartTime)/1e3,e.$lastStartTime=i,e.$restTime<=0&&t.makeWait(e)});const i=t.art.currentTime,n=t.readys;if(e!==this.generation)return;this.buffer.capture(this.sampling.capture(t,n,i),this.failedItems)}}catch(r){return void(e===this.generation&&this.fail(r))}if(this.schedule(),this.operation||!t.art.playing||t.isHide)return;const i=this.buffer.take();if(!i.length)return;let n;const s=new Promise(t=>n=()=>t(E)),a={generation:this.generation,cancel:n,wait:t=>Promise.race([t,s]),ref:null};return this.operation=a,this.run(a,i).catch(t=>{this.active(a)&&this.fail(t)}).finally(()=>{this.release(a),this.operation===a&&(this.operation=null,this.buffer.complete())})}),t.timer=this.frame)}run(t,e){return h(this,null,function*(){const i=this.owner;if(i.art.playing&&this.active(t))for(const s of e){if(!this.active(t))return;if(this.failedItems.has(s))continue;let e;try{e=yield t.wait(i.option.beforeVisible(s))}catch(n){if(!this.active(t))return;this.failedItems.add(s),this.report(n);continue}if(!this.active(t))return;if(!e)continue;const{clientWidth:a,clientHeight:r}=i.$player,o=i.renderer.prepare(s,t);if(!this.active(t))return;s.$lastStartTime=Date.now(),s.$restTime=i.speed;const l=a+o.clientWidth,d={type:"getDanmuTop",target:{mode:s.mode,height:o.clientHeight,speed:l/s.$restTime},visibles:i.visibles,antiOverlap:i.option.antiOverlap,clientWidth:a,clientHeight:r,marginBottom:i.marginBottom,marginTop:i.marginTop},h=d.antiOverlap?yield t.wait(i.postMessage(d)):{result:M(d)},c="symbol"===typeof h?void 0:h.result;if(!this.active(t)||s.$ref!==o)return;void 0!==c?(s.$lastStartTime=Date.now(),i.setState(s,"emit"),i.renderer.place(s,o,c,l,a),t.ref=null,i.art.emit("artplayerPluginDanmuku:visible",s)):(i.setState(s,"ready"),this.release(t))}})}destroy(){this.closed=!0,this.invalidate(),this.sampling.destroy()}}let C=0;class D{constructor(t,e){this.pending=new Map,this.closed=!1,this.failed=!1,this.onFailure=e,this.worker=t();try{this.worker.onmessage=t=>{var e;const i=this.pending.get(null==(e=t.data)?void 0:e.id);i&&(this.pending.delete(t.data.id),i.resolve(t.data))},this.worker.onerror=t=>{var e;null==(e=t.preventDefault)||e.call(t),this.fail(t.error||t)},this.worker.onmessageerror=t=>this.fail(t.error||t)}catch(i){try{this.dispose()}catch(n){}throw i}}request(t){t.id=++C;const{id:e}=t;return this.closed||this.failed?Promise.resolve({id:e,result:void 0}):new Promise((i,n)=>{this.pending.set(e,{resolve:i,reject:n});try{this.worker.postMessage(t)}catch(s){this.fail(s)}})}fail(t){if(!this.closed&&!this.failed){this.failed=!0;for(const e of this.pending.values())e.reject(t);this.pending.clear();try{this.dispose()}catch(e){}this.onFailure(t)}}cancel(){for(const[t,e]of this.pending)e.resolve({id:t,result:void 0});this.pending.clear()}dispose(){if(this.closed)return;this.closed=!0,this.cancel();let t,e=!1;const i=i=>{try{i()}catch(n){e||(t=n),e=!0}};for(const n of["onmessage","onerror","onmessageerror"])i(()=>this.worker[n]=null);if(i(()=>this.worker.terminate()),e)throw t}}const P='/*!\n * artplayer-plugin-danmuku.js v5.3.0\n * Github: https://github.com/zhw2590582/ArtPlayer\n * (c) 2017-2026 Harvey Zhao\n * Released under the MIT License.\n */\nfunction t({target:t,visibles:e,clientWidth:i,clientHeight:h,marginBottom:n,marginTop:o,antiOverlap:s}){const r=h-n,p=e.filter(e=>e.mode===t.mode&&e.top<=r).sort((t,e)=>t.top-e.top);if(0===p.length)return 2===t.mode?r-t.height:o;if(p.unshift({type:"top",top:0,left:0,right:0,height:o,width:i,speed:0,distance:i}),p.push({type:"bottom",top:r,left:0,right:0,height:n,width:i,speed:0,distance:i}),2===t.mode)for(let g=p.length-2;g>=0;g-=1){const e=p[g],i=p[g+1],h=e.top+e.height;if(i.top-h>=t.height)return i.top-t.height}else for(let g=1;g=t.height)return h}const a=[];for(let g=1;g{const i=Math.min(...e.map(t=>t.right)),h=Math.min(...t.map(t=>t.right));return i*e.length-h*t.length});break;case 1:case 2:a.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return a[0][0].top}switch(t.mode){case 0:{const e=a.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}onmessage=e=>{const{data:i}=e;if(!i.id||!i.type)return;const h=(0,{getDanmuTop:t}[i.type])(i);globalThis.postMessage({result:h,id:i.id})};\n',T="undefined"!==typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",P],{type:"text/javascript;charset=utf-8"});function L(t){let e;try{if(e=T&&(self.URL||self.webkitURL).createObjectURL(T),!e)throw"";const i=new Worker(e,{type:"module",name:null==t?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(i){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(P),{type:"module",name:null==t?void 0:t.name})}}class O{constructor(t,e){const{constructor:i,template:n}=t;this.utils=i.utils,this.validator=i.validator,this.$danmuku=n.$danmuku,this.$player=n.$player,this.art=t,this.queue=[],this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.index=0,this.worker=null,this.workerClient=null,this.renderer=new $(this),this.scheduler=new F(this),this.option=O.option,this.states={wait:[],ready:[],emit:[],stop:[]},this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.resize=this.resize.bind(this),this.destroy=this.destroy.bind(this),this.seek=this.seek.bind(this),k(this),t.on("destroy",this.destroy);try{if(this.config(e,!0),!k(this))return;this.createWorker()}catch(s){throw t.off("destroy",this.destroy),x(this),this.scheduler.destroy(),s}t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("resize",this.resize),t.on("video:seeking",this.seek),this.load().catch(t=>console.warn("Failed to load initial danmuku:",t))}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,width:512,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,emitter:!0,maxLength:200,lockTime:5,theme:"dark",OPACITY:{},FONT_SIZE:{},MARGIN:{},SPEED:{},COLOR:[]}}static get scheme(){return{danmuku:"array|function|string|promise",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement|string",heatmap:"object|boolean",width:"number",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",emitter:"boolean",maxLength:"number",lockTime:"number",theme:"string",OPACITY:"object",FONT_SIZE:"object",MARGIN:"object",SPEED:"object",COLOR:"array"}}static get cssText(){return'\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n '}get isRotate(){var t,e;return null==(e=null==(t=this.art.plugins)?void 0:t.autoOrientation)?void 0:e.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return O.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return O.option.margin[1]}get fontSize(){const{clamp:t}=this.utils,{clientHeight:e}=this.$player,i=this.option.fontSize;if("number"===typeof i)return Math.round(t(i,12,e));if("string"===typeof i&&i.endsWith("%")){const n=Number.parseFloat(i)/100;return Math.round(t(e*n,12,e))}return O.option.fontSize}get $ref(){return this.renderer.acquire()}get readys(){return function(t){const{currentTime:e}=t.art,i=[];return b(t,"ready",t=>i.push(t)),b(t,"wait",t=>{e+.1>=t.time&&t.time>=e-.1&&i.push(t)}),i}(this)}get visibles(){return this.renderer.visibles}get speed(){return this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed}load(t){return h(this,null,function*(){const{errorHandle:e}=this.utils,i=function(t,e){const i=w(t);if(e)for(const d of[...i.tasks])d.replace&&d.cancel();let n,s=i.closed||t.art.isDestroy;const a=new Promise(t=>n=t),r=new Set,o="function"===typeof AbortController?new AbortController:void 0,l={replace:e,signal:null==o?void 0:o.signal,active:()=>!s&&!i.closed&&!t.art.isDestroy,onCancel:t=>l.active()?(r.add(t),()=>r.delete(t)):(t(),()=>{}),cancel(){if(!s){s=!0,n(v),null==o||o.abort();for(const t of[...r])t();r.clear()}},wait:t=>Promise.race([t,a]),emit(e){i.emitting.push(l);try{return t.emit(e)}finally{i.emitting.pop()}},finish(){i.tasks.delete(l),r.clear()}};return s?n(v):i.tasks.add(l),l}(this,void 0===t);try{if(!i.active())return this;const n=function(t,e){return"function"===typeof t?{asynchronous:!0,value:t()}:c(t)?{asynchronous:!0,value:t}:"string"===typeof t?{asynchronous:!0,value:g(t,e)}:{asynchronous:!1,value:Array.isArray(t)?t:[]}}(t||this.option.danmuku,i),s=n.asynchronous?yield i.wait(n.value):n.value;if(!i.active())return this;e(Array.isArray(s),"Danmuku need return an array as result");const a=s;if(void 0===t){if(this.reset(),!i.active())return this;this.queue=[],this.states={wait:[],ready:[],emit:[],stop:[]},this.renderer.clear()}for(let t=0;t{const e=s[t],i=a[t];return"function"===typeof e||"function"===typeof i||c(e)||c(i)?e!==i:JSON.stringify(e)!==JSON.stringify(i)}))&&!e)return this;const r=function(t,e,{defaults:i,validate:n,clamp:s,mount:a}){const r=Object.assign({},i,t,e);return n(r),r.mode=s(r.mode,0,2),r.speed=s(r.speed,1,10),r.opacity=s(r.opacity,0,1),r.lockTime=s(r.lockTime,1,60),r.maxLength=s(r.maxLength,1,1e3),r.mount=r.mount||a,r}(this.option,t,{defaults:O.option,validate:t=>this.validator(t,O.scheme),clamp:i,mount:n});if(!k(this))return this;const o=this.option.beforeVisible!==r.beforeVisible;return this.option=r,o&&(this.scheduler.invalidate(),this.scheduler.schedule()),t.fontSize&&(this.reset(),!k(this))||(this.option.visible?this.show():this.hide(),k(this)&&this.art.emit("artplayerPluginDanmuku:config",this.option)),this}getLeft(t){return this.renderer.left(t)}postMessage(t={}){return this.workerClient.request(t)}createWorker(){this.workerClient=new D(()=>new L,t=>this.scheduler.fail(t)),this.worker=this.workerClient.worker}filter(t,e){return b(this,t,e)}setState(t,e){!function(t,e,i){t.states[e.$state]=t.states[e.$state].filter(t=>t!==e),e.$state=i,e.$ref&&(e.$ref.dataset.state=i),t.states[i].push(e)}(this,t,e)}makeWait(t){this.renderer.makeWait(t)}update(){return this.scheduler.running=!0,this.scheduler.schedule(),this}resize(){this.renderer.resize()}continue(){return this.renderer.continue(),this}suspend(){return this.renderer.suspend(),this}stop(){return this.isStop=!0,this.scheduler.running=!1,this.scheduler.invalidate(),this.suspend(),this.art.emit("artplayerPluginDanmuku:stop"),this}start(){if(this.scheduler.closed||this.art.isDestroy)return this;const t=++this.scheduler.starts,e=this.scheduler.generation;this.isStop=!1,this.scheduler.recover();return this.scheduler.closed||this.art.isDestroy||this.isStop||this.scheduler.fault||e!==this.scheduler.generation||t!==this.scheduler.starts||(this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")),this}reset(){return this.scheduler.invalidate(),this.queue.forEach(t=>this.makeWait(t)),this.art.emit("artplayerPluginDanmuku:reset"),this.scheduler.recover(),this.scheduler.schedule(),this}seek(){this.scheduler.invalidate(),this.scheduler.schedule()}show(){return this.isHide=!1,this.$danmuku.style.opacity=1,this.option.visible=!0,this.art.emit("artplayerPluginDanmuku:show"),this}hide(){return this.isHide=!0,this.scheduler.invalidate(),this.$danmuku.style.opacity=0,this.option.visible=!1,this.art.emit("artplayerPluginDanmuku:hide"),this.scheduler.schedule(),this}destroy(){var t;x(this),this.scheduler.destroy();try{try{this.stop()}finally{null==(t=this.workerClient)||t.dispose()}}finally{this.renderer.destroy(),this.art.off("video:play",this.start),this.art.off("video:playing",this.start),this.art.off("video:pause",this.stop),this.art.off("video:waiting",this.stop),this.art.off("resize",this.resize),this.art.off("video:seeking",this.seek),this.art.off("destroy",this.destroy),this.art.emit("artplayerPluginDanmuku:destroy")}}}const A=4294967295;function H(t,e){let i=0,n=t.length;for(;iNumber.isFinite(t)&&t>0))return null;const o={xMin:0,xMax:t,yMin:0,yMax:128,scale:.25,opacity:.2,minHeight:Math.floor(.05*e),sampling:Math.max(1,Math.floor(t/100)),smoothing:.2,flattening:.2},l=Object.assign({},"object"===typeof s?s:{}),d=Object.assign({},o,l);for(const r of Object.keys(o))Number.isFinite(d[r])||(d[r]=o[r]);if(d.sampling<=0&&(d.sampling=o.sampling),d.xMin===d.xMax||d.yMin===d.yMax)return null;const h=Array.isArray(a)&&a.length>0,c=h?[...a]:function(t,e,i,n){if(!Number.isFinite(e)||e<=0||!Number.isFinite(i)||i<=0||!Number.isFinite(n)||n<=0||Math.floor(e/n)+1>A)return[];const s=t.map(t=>t.time).filter(t=>"number"===typeof t&&!Number.isNaN(t)).sort((t,e)=>t-e),a=[],r=i/e;if(!Number.isFinite(r))return[];for(let o=0;o<=e;o+=n){if(a.length>=A||o+n===o)return[];const t=o*r,e=(o+n)*r;a.push([o,H(s,e)-H(s,t)])}return a}(n,t,i,d.sampling);if(!c.length||!c.every(t=>Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])))return null;const p=c[c.length-1];if(p[0]!==t){if(c.length===A)return null;c.push([t,p[1]])}let u=1/0,m=-1/0;for(const r of c)u=Math.min(u,r[1]),m=Math.max(m,r[1]);const f=(u+m)/2;for(const r of c){const t=r[1];r[1]=t*(t>f?1+d.scale:1-d.scale)+d.minHeight}const g=!h&&!Number.isFinite(l.yMin)&&!Number.isFinite(l.yMax);let y=0;for(const r of c)y=Math.max(y,r[1]);const v=g&&y>o.yMax/4;v&&(d.yMax=4*y);const w=t=>v?Math.min(e,Math.max(.75*e,t)):t,k=(t,e,i,n)=>{const s=function(t,e){const i=e[0]-t[0],n=e[1]-t[1];return{length:Math.sqrt(r(i,2)+r(n,2)),angle:Math.atan2(n,i)}}(e||t,i||t),a=N(Math.cos(s.angle)*d.flattening,0,1,1,0),o=s.angle*a+(n?Math.PI:0),l=s.length*d.smoothing;return[t[0]+Math.cos(o)*l,w(t[1]+Math.sin(o)*l)]},x=c.map(i=>[N(i[0],d.xMin,d.xMax,0,t),w(N(i[1],d.yMin,d.yMax,e,0))]);if(!x.every(t=>t.every(Number.isFinite)))return null;const b=x.map((t,i,n)=>{if(0===i)return`M ${n[n.length-1][0]},${e} L ${t[0]},${e} L ${t[0]},${t[1]}`;const s=k(n[i-1],n[i-2],t),a=k(t,n[i-1],n[i+1],!0);return`C ${s[0]},${s[1]} ${a[0]},${a[1]} ${t[0]},${t[1]}${i===n.length-1?" z":""}`}).join(" ");return/NaN|Infinity/u.test(b)?null:{path:b,opacity:d.opacity,width:t,height:e}}let j=0;function q(t,e,i){if(t.isDestroy)return;const{query:n}=t.constructor.utils;let s;const a=[];let r,o,l,d=!1;const h=()=>!d&&!t.isDestroy;function c(e,i){const n=i;a.push([e,n]),t.on(e,n)}function p(e){if(d)return;let i;d=!0,o=null,l=null;let n=!1;const s=t=>{try{t()}catch(e){n||(i=e),n=!0}};for(const[r,o]of a.splice(0))s(()=>t.off(r,o));if(e&&r&&t.controls.heatmap===r&&s(()=>t.controls.remove("heatmap")),r=void 0,n)throw i}function u(t){h()&&o&&l&&(o.setAttribute("offset",100*t+"%"),l.setAttribute("offset",100*t+"%"))}function m(a){try{!function(a=[]){if(!h())return;o=null,l=null;const d=r;if(d.innerHTML="",t.option.isLive)return;const c=V({width:d.offsetWidth,height:d.offsetHeight,duration:t.duration,queue:e.queue,option:i,points:a});if(!c||!h())return;const p=d.ownerDocument;for(s||(s=p?"heatmap-solids":"heatmap-solids-"+ ++j);null==p?void 0:p.getElementById(s);)s="heatmap-solids-"+ ++j;d.innerHTML=`\n \n \n \n \n \n \n \n \n \n \n \n `,o=n("#heatmap-start",d),l=n("#heatmap-stop",d),u(t.played)}(a)}catch(d){try{p(!0)}catch(c){}throw d}}c("destroy",()=>p(!0));try{t.controls.add({name:"heatmap",position:"top",html:"",style:{position:"absolute",top:"-100px",left:"0px",right:"0px",height:"100px",width:"100%",pointerEvents:"none"},beforeUnmount(){p(!1)},mounted(e){if(r=e,d)return t.controls.heatmap===e&&t.controls.remove("heatmap"),void(r=void 0);h()?(c("video:timeupdate",()=>u(t.played)),c("setBar",(t,e)=>{"played"===t&&u(e)}),c("ready",()=>m()),c("resize",()=>m()),c("artplayerPluginDanmuku:loaded",()=>m()),c("artplayerPluginDanmuku:points",t=>m(t))):p(!0)}})}catch(f){try{p(!0)}catch(g){}throw f}return()=>p(!0)}const I=new WeakMap;class B{constructor(t){this.art=t,this.closed=!1,this.disposers=new Set,this.cancelled=new Promise(t=>this.cancel=t)}get active(){return!this.closed&&!this.art.isDestroy}own(t){this.closed?t():this.disposers.add(t)}write(t,e,i,n=i=>t[e]=i){const s=t;if(!this.active)return;const a=()=>"function"===typeof s.getPropertyPriority?s.getPropertyPriority(e):void 0;let r=I.get(s);r||(r=new Map,I.set(s,r));let o=r.get(e);o||(o={original:s[e],present:e in s||void 0!==s[e],priority:a(),owners:new Map,apply:n},r.set(e,o)),o.owners.has(this)||this.own(()=>{const t=[...o.owners.keys()],i=t[t.length-1]===this;if(o.owners.delete(this),i&&s[e]===o.last&&a()===o.lastPriority){const t=[...o.owners.values()];t.length?(o.apply(t[t.length-1]),o.last=s[e],o.lastPriority=a()):void 0!==o.priority?s.setProperty(e,o.original,o.priority):o.present?o.apply(o.original):delete s[e]}o.owners.size||(r.delete(e),r.size||I.delete(s))}),o.owners.delete(this),o.owners.set(this,i),o.apply(i),o.last=s[e],o.lastPriority=a()}on(t,e){if(!this.active)return;const i=this;function n(...t){if(i.active)return e.apply(this,t)}const s=()=>this.art.off(t,n);this.own(s);try{this.art.on(t,n),this.active||s()}catch(a){throw this.release(s),a}}proxy(t,e,i){if(!this.active)return;const n=this;function s(...t){if(n.active)return i.apply(this,t)}let a;const r=()=>{var i,n;if("function"===typeof a){const t=this.art.events;"function"===typeof(null==t?void 0:t.remove)&&(null==(i=t.destroyEvents)?void 0:i.has(a))?t.remove(a):a()}else null==(n=t.removeEventListener)||n.call(t,e,s)};this.own(r);try{a=this.art.proxy(t,e,s),this.active||r()}catch(o){throw this.release(r),o}}wait(t){return Promise.race([t,this.cancelled])}release(t){try{t()}catch(e){console.warn("Failed to dispose danmuku setting resource:",e)}}close(){if(!this.closed){this.closed=!0,this.cancel();for(const t of this.disposers)this.release(t);this.disposers.clear()}}}function R({min:t,max:e,container:i,findIndex:n,onChange:s,steps:a=[]}){const{lifecycle:r}=this;if(!r.active)return{reset(){}};const{query:o,clamp:l,setStyle:d}=this.utils;d(i,"touch-action","none"),i.innerHTML=`\n

\n
\n ${a.map(()=>'
').join("")}\n
\n
\n
\n
\n
\n ${a.map(t=>t.hide?"":`
${t.name}
`).join("")}\n
\n `;const h=o(".apd-slider-dot",i),c=o(".apd-slider-progress",i);let p=!1;function u(i){if(!r.active)return;if(void 0===i&&(i=n()),ie)return;const o=(i-t)/(e-t);h.style.left=100*o+"%",0===a.length&&(c.style.width=h.style.left),s(i)}function m(n){const{top:s,height:a,left:r,width:o}=i.getBoundingClientRect();if(this.art.isRotate){const i=l(n.clientY-s,0,a);u(Math.round(i/a*(e-t)+t))}else{const i=l(n.clientX-r,0,o);u(Math.round(i/o*(e-t)+t))}}return r.own(()=>p=!1),r.proxy(i,"click",t=>{m.call(this,t)}),r.proxy(i,"pointerdown",t=>{p=0===t.button}),r.on("document:pointermove",t=>{p&&m.call(this,t)}),r.on("document:pointerup",t=>{p&&(p=!1,m.call(this,t))}),{reset:u}}const Z='',W='',_='',U='',G='',X='',Y='',J='',K='',Q='',tt='',et='';function it(){const{option:t}=this;return`\n
\n ${tt}${Q}\n
\n
\n ${_}\n
\n
\n
\n \u6309\u7c7b\u578b\u5c4f\u853d\n
\n
\n ${U}${G}\n
\u6eda\u52a8
\n
\n
\n ${X}${Y}\n
\u9876\u90e8
\n
\n
\n ${J}${K}\n
\u5e95\u90e8
\n
\n
\n
\n
\n
\n ${W}${Z}\n \u9632\u6b62\u5f39\u5e55\u91cd\u53e0\n
\n
\n ${W}${Z}\n \u540c\u6b65\u89c6\u9891\u901f\u5ea6\n
\n
\n
\n \u4e0d\u900f\u660e\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n \u663e\u793a\u533a\u57df\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u5b57\u53f7\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u901f\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n
\n
\n
\n
\n ${et}\n
\n
\n
\n \u6a21\u5f0f\n
\n
\n ${G}\n
\u6eda\u52a8
\n
\n
\n ${Y}\n
\u9876\u90e8
\n
\n
\n ${K}\n
\u5e95\u90e8
\n
\n
\n
\n
\n \u989c\u8272\n
\n ${this.COLOR.map(t=>`
`).join("")}\n
\n
\n
\n
\n
\n \n
\u53d1\u9001
\n
\n `}if("undefined"!==typeof document){const t="artplayer-plugin-danmuku",e=Symbol.for("artplayer-plugin-danmuku.pending-style"),i=document;let n=document.getElementById(t)||i[e];if(!n)if(n=document.createElement("style"),n.id=t,"loading"===document.readyState){i[e]=n;const s=()=>{document.removeEventListener("DOMContentLoaded",s),i[e]===n&&delete i[e];const a=document.getElementById(t);a?a.textContent=n.textContent:(document.head||document.documentElement).appendChild(n)};document.addEventListener("DOMContentLoaded",s,{once:!0})}else(document.head||document.documentElement).appendChild(n);n.textContent='.artplayer-plugin-danmuku{display:flex;position:relative;z-index:99;align-items:center;justify-content:center;font-size:12px;height:32px;width:100%;color:#fff;font-weight:300;flex-shrink:0;gap:10px}.artplayer-plugin-danmuku .apd-icon{cursor:pointer;opacity:.75;transition:all .2s ease;fill:#fff}.artplayer-plugin-danmuku .apd-icon:hover{opacity:1}.artplayer-plugin-danmuku .apd-config{display:flex;position:relative}.artplayer-plugin-danmuku .apd-config .apd-config-panel{position:absolute;bottom:24px;left:0;width:320px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-config .apd-config-panel .apd-config-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-config:hover .apd-config-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-config-mode,.artplayer-plugin-danmuku .apd-config-slider,.artplayer-plugin-danmuku .apd-config-other,.artplayer-plugin-danmuku .apd-style-mode{margin-bottom:15px}.artplayer-plugin-danmuku .apd-modes{display:flex;align-items:center;margin-top:5px;gap:20px}.artplayer-plugin-danmuku .apd-modes .apd-mode{cursor:pointer;text-align:center}.artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-config-slider{display:flex;align-items:center;gap:12px}.artplayer-plugin-danmuku .apd-config-slider .apd-value{width:32px;text-align:right}.artplayer-plugin-danmuku .apd-slider{position:relative;flex:1;display:flex;height:20px;align-items:center;justify-content:center;cursor:pointer}.artplayer-plugin-danmuku .apd-slider .apd-slider-line{position:relative;height:2px;width:100%;overflow:hidden;border-radius:3px;background-color:#ffffff40}.artplayer-plugin-danmuku .apd-slider .apd-slider-points{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}.artplayer-plugin-danmuku .apd-slider .apd-slider-points .apd-slider-point{width:2px;height:2px;border-radius:50%;background-color:#ffffff80}.artplayer-plugin-danmuku .apd-slider .apd-slider-progress{width:0%;height:100%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-dot{position:absolute;transform:translate(-6px);left:0%;width:12px;height:12px;border-radius:50%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps{display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:-12px;width:calc(100% + 32px);color:#777}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps .apd-slider-step{flex-shrink:0;width:36px;text-align:center;scale:.95}.artplayer-plugin-danmuku .apd-config-other{display:flex;align-items:center;gap:20px}.artplayer-plugin-danmuku .apd-config-other .apd-check-off,.artplayer-plugin-danmuku .apd-config-other .apd-check-on{width:16px;height:16px}.artplayer-plugin-danmuku .apd-config-other .apd-other{display:flex;align-items:center;cursor:pointer;gap:2px}.artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-emitter{display:flex;flex:1;align-items:center;height:100%;background-color:#ffffff40;border-radius:5px}.artplayer-plugin-danmuku .apd-style{position:relative;display:flex;align-items:center;justify-content:center}.artplayer-plugin-danmuku .apd-style .apd-style-panel{position:absolute;bottom:24px;left:0;width:200px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-style .apd-style-panel .apd-style-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-style:hover .apd-style-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-colors{display:flex;flex-wrap:wrap;margin-top:5px;gap:8px}.artplayer-plugin-danmuku .apd-colors .apd-color{width:16px;height:16px;border-radius:2px;cursor:pointer}.artplayer-plugin-danmuku .apd-colors .apd-color.apd-active{border:1px solid black;box-shadow:0 0 0 1px #fff}.artplayer-plugin-danmuku .apd-input{outline:none;height:100%;flex:1;min-width:0;width:auto;border:none;line-height:1;color:#fff;background-color:transparent}.artplayer-plugin-danmuku .apd-input::placeholder{color:#ffffff80}.artplayer-plugin-danmuku .apd-send{display:flex;align-items:center;justify-content:center;height:100%;width:60px;flex-shrink:0;cursor:pointer;text-shadow:none;border-top-right-radius:5px;border-bottom-right-radius:5px;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-send.apd-lock{cursor:not-allowed;color:#666;background-color:#e7e7e7}.art-controls-center .apd-emitter{width:260px;flex:none}.art-fullscreen .artplayer-plugin-danmuku,.art-fullscreen-web .artplayer-plugin-danmuku{height:38px;gap:16px}.art-fullscreen .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen-web .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-on,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-on{width:28px;height:28px}.art-fullscreen .artplayer-plugin-danmuku .apd-emitter,.art-fullscreen-web .artplayer-plugin-danmuku .apd-emitter{width:400px;flex:none}.art-video-player>.artplayer-plugin-danmuku{position:absolute;left:0;right:0;bottom:-40px;padding:0 10px}.art-video-player:has(>.artplayer-plugin-danmuku){margin-bottom:40px}[data-danmuku-emitter=false] .apd-emitter{display:none!important}[data-danmuku-emitter=false] .art-controls-center .artplayer-plugin-danmuku{justify-content:flex-end;gap:18px}[data-danmuku-emitter=false].art-fullscreen .art-controls-center .artplayer-plugin-danmuku,[data-danmuku-emitter=false].art-fullscreen-web .art-controls-center .artplayer-plugin-danmuku{gap:24px}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-icon{fill:#333}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-emitter{background-color:#f1f2f3}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input{color:#000}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input::placeholder{color:#0000004d}[data-danmuku-visible=false] .apd-toggle-off{display:block}[data-danmuku-visible=false] .apd-toggle-on,[data-danmuku-visible=true] .apd-toggle-off{display:none}[data-danmuku-visible=true] .apd-toggle-on{display:block}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-on{display:none}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-off,[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-on{display:block}[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-off,[data-danmuku-sync-video=false] .apd-sync-video .apd-check-on{display:none}[data-danmuku-sync-video=false] .apd-sync-video .apd-check-off,[data-danmuku-sync-video=true] .apd-sync-video .apd-check-on{display:block}[data-danmuku-sync-video=true] .apd-sync-video .apd-check-off{display:none}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-off{display:block}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-on{display:none}[data-danmuku-mode0=false] .art-danmuku [data-mode="0"]{opacity:0!important}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-off{display:none}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-on{display:block}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"]{color:#00a1d6}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"] path{fill:#00a1d6}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-off{display:block}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-on{display:none}[data-danmuku-mode1=false] .art-danmuku [data-mode="1"]{opacity:0!important}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-off{display:none}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-on{display:block}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"]{color:#00a1d6}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"] path{fill:#00a1d6}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-off{display:block}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-on{display:none}[data-danmuku-mode2=false] .art-danmuku [data-mode="2"]{opacity:0!important}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-off{display:none}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-on{display:block}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"]{color:#00a1d6}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"] path{fill:#00a1d6}'}class nt{constructor(t,e){this.art=t,this.danmuku=e,this.utils=t.constructor.utils;const{setStyle:i}=this.utils,{$controlsCenter:n}=t.template;this.template={$controlsCenter:n,$mount:n,$danmuku:null,$toggle:null,$config:null,$configPanel:null,$configModes:null,$style:null,$stylePanel:null,$styleModes:null,$colors:null,$opacitySlider:null,$opacityValue:null,$marginSlider:null,$marginValue:null,$fontSizeSlider:null,$fontSizeValue:null,$speedSlider:null,$speedValue:null,$input:null,$send:null},this.slider={opacity:null,margin:null,fontSize:null,speed:null},this.emitting=!1,this.isLock=!1,this.timer=null,this.lifecycle=new B(t),this.destroy=this.destroy.bind(this),this.lifecycle.own(()=>t.off("destroy",this.destroy));try{if(t.on("destroy",this.destroy),!this.lifecycle.active)return;if(this.lifecycle.write(n.style,"display","flex",t=>i(n,"display",t)),this.createTemplate(),!this.lifecycle.active)return;if(this.createSliders(),!this.lifecycle.active)return;if(this.createEvents(),this.mount(this.option.mount),!this.lifecycle.active)return;this.lifecycle.on("resize",()=>this.resize()),this.lifecycle.on("fullscreen",t=>this.onFullscreen(t)),this.lifecycle.on("fullscreenWeb",t=>this.onFullscreen(t)),this.lifecycle.proxy(this.template.$config,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$config,$panel:this.template.$configPanel})}),this.lifecycle.proxy(this.template.$style,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$style,$panel:this.template.$stylePanel})})}catch(s){try{this.destroy()}catch(a){console.warn("Failed to roll back danmuku setting:",a)}throw s}}static get icons(){return{$on:tt,$off:Q,$config:_,$style:et,$mode_0_off:U,$mode_0_on:G,$mode_1_off:X,$mode_1_on:Y,$mode_2_off:J,$mode_2_on:K,$check_on:W,$check_off:Z}}get option(){return this.danmuku.option}get outside(){return this.template.$mount!==this.template.$controlsCenter}get TEMPLATE(){return it.call(this)}get OPACITY(){return l({min:0,max:100,steps:[]},this.option.OPACITY)}get FONT_SIZE(){return l({min:12,max:120,steps:[]},this.option.FONT_SIZE)}get MARGIN(){return l({min:0,max:3,steps:[{name:"1/4",value:[10,"75%"]},{name:"\u534a\u5c4f",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"\u6ee1\u5c4f",value:[10,10]}]},this.option.MARGIN)}get SPEED(){return l({min:0,max:4,steps:[{name:"\u6781\u6162",value:10},{name:"\u8f83\u6162",value:7.5,hide:!0},{name:"\u9002\u4e2d",value:5},{name:"\u8f83\u5feb",value:2.5,hide:!0},{name:"\u6781\u5feb",value:1}]},this.option.SPEED)}get COLOR(){return this.option.COLOR.length?this.option.COLOR:["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(t){const{query:e}=this.utils,{$danmuku:i}=this.template;return e(t,i)}append(t,e){if(!this.lifecycle.active)return;const{append:i}=this.utils;[...t.children].includes(e)||i(t,e)}setData(t,e){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,{$mount:n}=this.template;this.lifecycle.write(i.dataset,t,e),this.outside&&this.lifecycle.write(n.dataset,t,e)}createTemplate(){const{createElement:t,tooltip:e}=this.utils,i=t("div");this.template.$danmuku=i,i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$toggle=this.query(".apd-toggle"),this.template.$config=this.query(".apd-config"),this.template.$configPanel=this.query(".apd-config-panel"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$style=this.query(".apd-style"),this.template.$stylePanel=this.query(".apd-style-panel"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send");const{$toggle:n}=this.template;this.lifecycle.on("artplayerPluginDanmuku:show",()=>{e(n,"\u5173\u95ed\u5f39\u5e55")}),this.lifecycle.on("artplayerPluginDanmuku:hide",()=>{e(n,"\u6253\u5f00\u5f39\u5e55")})}createEvents(){const{$toggle:t,$configModes:e,$styleModes:i,$colors:n,$antiOverlap:s,$syncVideo:a,$send:r,$input:o}=this.template;this.lifecycle.proxy(t,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.lifecycle.proxy(e,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(t=>t!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.lifecycle.proxy(s,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.lifecycle.proxy(a,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.lifecycle.proxy(i,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.lifecycle.proxy(n,"click",t=>{const e=t.target.closest(".apd-color");e&&(this.danmuku.config({color:e.dataset.color}),this.reset())}),this.lifecycle.proxy(r,"click",()=>this.emit()),this.lifecycle.proxy(o,"keypress",t=>{"Enter"===t.key&&(t.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider(d(l({},this.OPACITY),{container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:t=>{const{$opacityValue:e}=this.template;e.textContent=`${t}%`,this.danmuku.config({opacity:t/100})}})),this.slider.margin=this.createSlider(d(l({},this.MARGIN),{container:this.template.$marginSlider,findIndex:()=>this.MARGIN.steps.findIndex(t=>t.value[0]===this.option.margin[0]&&t.value[1]===this.option.margin[1]),onChange:t=>{const e=this.MARGIN.steps[t];if(!e)return;const{$marginValue:i}=this.template;i.textContent=e.name,this.danmuku.config({margin:e.value})}})),this.slider.fontSize=this.createSlider(d(l({},this.FONT_SIZE),{container:this.template.$fontSizeSlider,findIndex:()=>this.danmuku.fontSize,onChange:t=>{const{$fontSizeValue:e}=this.template;e.textContent=`${t}px`,t!==this.danmuku.fontSize&&this.danmuku.config({fontSize:t})}})),this.slider.speed=this.createSlider(d(l({},this.SPEED),{container:this.template.$speedSlider,findIndex:()=>this.SPEED.steps.findIndex(t=>t.value===this.option.speed),onChange:t=>{const e=this.SPEED.steps[t];if(!e)return;const{$speedValue:i}=this.template;i.textContent=e.name,this.danmuku.config({speed:e.value})}}))}createSlider(t){return R.call(this,t)}onFullscreen(t){if(!this.lifecycle.active)return;const{$danmuku:e,$controlsCenter:i,$mount:n}=this.template;this.outside?t?this.append(i,e):this.append(n,e):this.append(i,e)}onMouseEnter({$control:t,$panel:e}){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),r=s.width/2-n.width/2,o=a.left-(n.left-r),l=n.right+r-a.right;e.style.left=o>0?`${-r+o}px`:l>0?-r-l+"px":-r+"px"}emit(){return function(t){return h(this,null,function*(){const{lifecycle:e,template:{$input:i}}=t;if(!e.active)return;const n=i.value.trim();if(!n.length||t.isLock||t.emitting)return;const s={text:n,mode:t.option.mode,color:t.option.color,time:t.art.currentTime},a=t=>{e.active&&console.error("Error emitting danmuku:",t)};try{t.emitting=!0;const n=yield e.wait(t.option.beforeEmit(s));if(!e.active)return;if(t.emitting=!1,!0!==n)return;if(s.border=!0,delete s.time,Promise.resolve(t.danmuku.emit(s)).catch(a),!e.active)return;i.value="",t.lock()}catch(r){a(r),e.active&&(t.emitting=!1)}})}(this)}lock(){!function(t){if(!t.lifecycle.active)return;const{addClass:e}=t.utils,{$send:i}=t.template;clearTimeout(t.timer),t.isLock=!0;let n=t.option.lockTime;i.textContent=n,e(i,"apd-lock");const s=()=>{t.timer=setTimeout(()=>{t.lifecycle.active&&(0===n?t.unlock():(n-=1,i.textContent=n,s()))},1e3)};s()}(this)}unlock(){!function(t){if(clearTimeout(t.timer),t.timer=null,t.isLock=!1,!t.lifecycle.active)return;const{removeClass:e}=t.utils,{$send:i}=t.template;i.textContent="\u53d1\u9001",e(i,"apd-lock")}(this)}resize(){if(!this.lifecycle.active)return;if(this.outside)return;if(this.art.fullscreen)return;if(this.art.fullscreenWeb)return;const{$player:t,$controlsCenter:e}=this.art.template,{$danmuku:i}=this.template;this.art.widtht.dataset.color===this.option.color.toUpperCase());a&&t(a,"apd-active"),e(i,this.option.visible?"\u5173\u95ed\u5f39\u5e55":"\u6253\u5f00\u5f39\u5e55"),this.resize()}mount(t){if(!this.lifecycle.active)return;const{errorHandle:e}=this.utils,i="string"===typeof t?document.querySelector(t):t;e(i,`Can not find the mount point: ${t}`),this.append(i,this.template.$danmuku),this.template.$mount=i,this.reset()}destroy(){if(this.lifecycle.closed)return;this.lifecycle.close(),clearTimeout(this.timer),this.timer=null,this.emitting=!1,this.isLock=!1;const t=this.template.$danmuku;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t)}}function st(t){return e=>{const i=new O(e,t);let n;try{n=e.isDestroy?void 0:new nt(e,i),!e.isDestroy&&i.option.heatmap&&q(e,i,i.option.heatmap)}catch(s){try{null==n||n.destroy()}catch(a){}try{i.destroy()}catch(a){}throw s}return{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:n?n.mount.bind(n):()=>{},get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}return st.icons=nt.icons,st}); +!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.artplayerPluginDanmuku=e(),define(function(){return t.artplayerPluginDanmuku})):(t="undefined"!==typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=Math.pow,o=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,l=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&o(t,i,e[i]);if(n)for(var i of n(e))a.call(e,i)&&o(t,i,e[i]);return t},d=(t,n)=>e(t,i(n)),h=(t,e,i)=>new Promise((n,s)=>{var a=t=>{try{o(i.next(t))}catch(e){s(e)}},r=t=>{try{o(i.throw(t))}catch(e){s(e)}},o=t=>t.done?n(t.value):Promise.resolve(t.value).then(a,r);o((i=i.apply(t,e)).next())});function c(t){return t instanceof Promise||"[object Promise]"===Object.prototype.toString.call(t)}function p(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:return 2;case 5:return 1}}function u(t){if("string"!==typeof t)return[];const e=new RegExp(']*?p="(?

[^"]+)"[^>]*>(?.*?)<\\/d>',"gs"),i=t.matchAll(e);return Array.from(i).map(t=>{const e=t.groups.p.split(",");if(e.length>=8){return{text:t.groups.text.trim().replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&"),time:Number(e[0]),mode:p(Number(e[1])),fontSize:Number(e[2]),color:`#${Number(e[3]).toString(16)}`,timestamp:Number(e[4]),pool:Number(e[5]),userID:e[6],rowID:Number(e[7])}}return null}).filter(Boolean)}function m({data:t}){const{xml:e,id:i}=t,n=u(e);globalThis.postMessage({danmus:n,id:i})}let f=0;function g(t,{signal:e,onCancel:i}={}){return new Promise((n,s)=>{let a,r,o,l=!1;const d=++f,c=()=>y(void 0,function(t){if(void 0!==(null==t?void 0:t.reason))return t.reason;const e=new Error("Bilibili Danmu loading cancelled");return e.name="AbortError",e}(e));function g(){let t,e=!1;try{if(a){const t=a;a=void 0,t.onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate()}}catch(i){t=i,e=!0}if(void 0!==r){const n=r;r=void 0;try{URL.revokeObjectURL(n)}catch(i){e||(t=i),e=!0}}if(e)throw t}function y(t,i){if(l)return;l=!0;let a=arguments.length>1;null==e||e.removeEventListener("abort",c),null==o||o();try{g()}catch(r){a||(i=r),a=!0}a?s(i):n(t)}function v(t,e){if(!l){console.error("Error parsing Bilibili Danmu:",e);try{y(u(t))}catch(i){y(void 0,i)}}}(null==e?void 0:e.aborted)?c():(null==e||e.addEventListener("abort",c),o=null==i?void 0:i(c),l?null==o||o():function(){return h(this,null,function*(){const i=e?yield fetch(t,{signal:e}):yield fetch(t);if(l)return;const n=yield i.text();if(!l)try{const t=`\n ${p.toString()}\n ${u.toString()}\n onmessage = ${m.toString()}\n `;if(r=URL.createObjectURL(new Blob([t],{type:"application/javascript"})),l)return void g();if(a=new Worker(r),l)return void g();a.onmessage=t=>{var e;if(l||(null==(e=t.data)?void 0:e.id)!==d)return;const{danmus:i}=t.data;Array.isArray(i)?y(i):y(void 0,new Error("Invalid Bilibili Danmu worker response"))},a.onerror=t=>{var e;null==(e=t.preventDefault)||e.call(t),v(n,t.error||t)},a.onmessageerror=t=>v(n,t.error||t),a.postMessage({xml:n,id:d})}catch(s){v(n,s)}})}().catch(t=>y(void 0,t)))})}const y=new WeakMap,v=Symbol("cancelled danmuku input");function w(t){return y.has(t)||y.set(t,{closed:!1,tasks:new Set,emitting:[]}),y.get(t)}function k(t){const e=w(t),i=e.emitting[e.emitting.length-1];return!e.closed&&!t.art.isDestroy&&(!i||i.active())}function x(t){const e=w(t);e.closed=!0;for(const i of[...e.tasks])i.cancel()}function b(t,e,i){const n=t.states[e]||[];for(let s=0;s{const s=n.$ref.offsetTop,a=this.owner.getLeft(n.$ref)-i,r=n.$ref.clientHeight,o=n.$ref.clientWidth,l=a+o,d=e-l,h=l/n.$restTime,c={};c.top=s,c.left=a,c.height=r,c.width=o,c.right=d,c.speed=h,c.distance=l,c.time=n.$restTime,c.mode=n.mode,t.push(c)}),t}left(t){const e=t.getBoundingClientRect();return this.owner.isRotate?e.top:e.left}makeWait(t){this.owner.setState(t,"wait"),t.$ref&&(t.$ref.style.cssText=this.owner.constructor.cssText,t.$ref.style.visibility="hidden",t.$ref.style.marginLeft="0px",t.$ref.style.transform="translateX(0px)",t.$ref.style.transition="transform 0s linear 0s",this.owner.$refs.push(t.$ref),t.$ref=null)}resize(){const{clientWidth:t}=this.owner.$player;this.owner.filter("stop",e=>{if(0===e.mode)e.$ref.style.left=`${t}px`}),this.owner.filter("emit",e=>{switch(e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.left=`${t}px`,e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}})}continue(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("stop",e=>{switch(this.owner.setState(e,"emit"),e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}}),this}suspend(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("emit",e=>{switch(this.owner.setState(e,"stop"),e.mode){case 0:{const i=t-(this.owner.getLeft(e.$ref)-this.owner.getLeft(this.owner.$player));e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition="transform 0s linear 0s";break}}}),this}prepare(t,e){const i=this.owner,n=i.$ref;return e.danmu=t,e.ref=n,t.$ref=n,n.textContent=t.text,i.$danmuku.appendChild(n),n.style.opacity=i.option.opacity,n.style.fontSize=`${i.fontSize}px`,n.style.color=t.color,n.style.border=t.border?`1px solid ${t.color}`:null,n.style.backgroundColor=t.border?"rgb(0 0 0 / 50%)":null,i.utils.setStyles(n,t.style),n}place(t,e,i,n,s){switch(e.style.top=`${i}px`,e.style.visibility="visible",e.dataset.mode=t.mode,e.dataset.id=t.id||"",t.mode){case 0:e.style.left=`${s}px`,e.style.marginLeft="0px",e.style.transform=`translateX(${-n}px)`,e.style.transition=`transform ${t.$restTime}s linear 0s`;break;case 1:case 2:e.style.left="50%",e.style.marginLeft=`-${e.clientWidth/2}px`}}release(t){const{danmu:e,ref:i}=t;i&&e.$ref===i&&(i.style.cssText=this.owner.constructor.cssText,i.style.visibility="hidden",this.owner.$refs.push(i),e.$ref=null),t.ref=null}clear(){this.destroy(),this.owner.$refs=[],this.owner.$danmuku.textContent=""}destroy(){for(const t of this.nodes)t.parentElement&&t.parentElement.removeChild(t);for(const t of this.owner.queue)t.$ref=null;this.owner.$refs.length=0,this.nodes.clear()}}function M({target:t,visibles:e,clientWidth:i,clientHeight:n,marginBottom:s,marginTop:a,antiOverlap:r}){const o=n-s,l=e.filter(e=>e.mode===t.mode&&e.top<=o).sort((t,e)=>t.top-e.top);if(0===l.length)return 2===t.mode?o-t.height:a;if(l.unshift({type:"top",top:0,left:0,right:0,height:a,width:i,speed:0,distance:i}),l.push({type:"bottom",top:o,left:0,right:0,height:s,width:i,speed:0,distance:i}),2===t.mode)for(let h=l.length-2;h>=0;h-=1){const e=l[h],i=l[h+1],n=e.top+e.height;if(i.top-n>=t.height)return i.top-t.height}else for(let h=1;h=t.height)return n}const d=[];for(let h=1;h{const i=Math.min(...e.map(t=>t.right)),n=Math.min(...t.map(t=>t.right));return i*e.length-n*t.length});break;case 1:case 2:d.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return d[0][0].top}switch(t.mode){case 0:{const e=d.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}class S{constructor(){this.rows=new Set,this.waiting=new Set,this.visibility=()=>this.clear()}begin(t){void 0===this.time&&this.capture(t,[],t.art.currentTime)}capture(t,e,i){var n,s;const a=t.$player.ownerDocument;if(a!==this.document&&(null==(n=this.document)||n.removeEventListener("visibilitychange",this.visibility),this.document=a,null==a||a.addEventListener("visibilitychange",this.visibility),this.clear()),!Number.isFinite(i)||"hidden"===(null==a?void 0:a.visibilityState)||(null==(s=t.art.video)?void 0:s.seeking))return this.clear(),e;const r=this.time,o=this.rows,l=this.waiting;if(this.time=i,this.rows=new Set(e),this.waiting=new Set(t.states.wait),void 0===r||i<=r)return e;const d=t.states.wait.filter(t=>l.has(t)&&!o.has(t)&&t.time>=r-.1&&t.time"ready"===t.$state),...d,...e.filter(t=>"ready"!==t.$state)]}clear(){this.time=void 0,this.rows.clear(),this.waiting.clear()}destroy(){var t;null==(t=this.document)||t.removeEventListener("visibilitychange",this.visibility),this.document=void 0,this.clear()}}class z{constructor(){this.pending=new Set,this.reserved=new Set}capture(t,e){for(const i of t)this.reserved.has(i)||e.has(i)||this.pending.add(i)}take(){const t=[],e=[];for(const n of this.pending)"ready"===n.$state?t.push(n):"wait"===n.$state&&e.push(n);this.pending.clear();const i=[...t,...e];return this.reserved=new Set(i),i}complete(){this.reserved.clear()}clear(){this.pending.clear(),this.reserved.clear()}}const E=Symbol("cancelled danmuku frame");class F{constructor(t){this.owner=t,this.generation=0,this.starts=0,this.frame=null,this.operation=null,this.closed=!1,this.running=!1,this.fault=!1,this.failedItems=new Set,this.buffer=new z,this.sampling=new S}active(t){const e=this.owner;return!this.closed&&!this.fault&&!e.art.isDestroy&&!e.isStop&&!e.isHide&&t.generation===this.generation}release(t){this.owner.renderer.release(t)}invalidate(){var t;if(this.generation++,null!==this.frame&&window.cancelAnimationFrame(this.frame),this.frame=null,this.owner.timer=null,this.operation){const t=this.operation;this.operation=null,t.cancel(),this.release(t)}null==(t=this.owner.workerClient)||t.cancel(),this.failedItems.clear(),this.buffer.clear(),this.sampling.clear()}report(t){try{this.owner.art.emit("artplayerPluginDanmuku:error",t)}catch(e){console.warn("Failed to report danmuku scheduling error:",e)}}fail(t){this.closed||this.fault||(this.fault=!0,this.invalidate(),this.report(t))}recover(){var t;if(!this.closed&&!this.owner.art.isDestroy&&(this.failedItems.clear(),this.fault))try{null==(t=this.owner.workerClient)||t.dispose(),this.owner.createWorker(),this.fault=!1}catch(e){this.report(e)}}schedule(){const t=this.owner;if(!(!this.running||this.closed||this.fault||t.art.isDestroy||t.isStop)){try{const e=t.art.video;(t.art.playing||!1===(null==e?void 0:e.paused)&&!e.ended&&e.readyState>2)&&!t.isHide&&this.sampling.begin(t)}catch(e){return void this.fail(e)}null===this.frame&&(this.frame=window.requestAnimationFrame(()=>{if(this.frame=null,t.timer=null,this.closed||this.fault||t.isStop||t.art.isDestroy)return;const i=this.generation;try{if(t.art.playing&&!t.isHide){t.filter("emit",e=>{const i=Date.now();e.$restTime-=(i-e.$lastStartTime)/1e3,e.$lastStartTime=i,e.$restTime<=0&&t.makeWait(e)});const e=t.art.currentTime,n=t.readys;if(i!==this.generation)return;this.buffer.capture(this.sampling.capture(t,n,e),this.failedItems)}}catch(e){return void(i===this.generation&&this.fail(e))}if(this.schedule(),this.operation||!t.art.playing||t.isHide)return;const n=this.buffer.take();if(!n.length)return;let s;const a=new Promise(t=>s=()=>t(E)),r={generation:this.generation,cancel:s,wait:t=>Promise.race([t,a]),ref:null};return this.operation=r,this.run(r,n).catch(t=>{this.active(r)&&this.fail(t)}).finally(()=>{this.release(r),this.operation===r&&(this.operation=null,this.buffer.complete())})}),t.timer=this.frame)}}run(t,e){return h(this,null,function*(){const i=this.owner;if(i.art.playing&&this.active(t))for(const s of e){if(!this.active(t))return;if(this.failedItems.has(s))continue;let e;try{e=yield t.wait(i.option.beforeVisible(s))}catch(n){if(!this.active(t))return;this.failedItems.add(s),this.report(n);continue}if(!this.active(t))return;if(!e)continue;const{clientWidth:a,clientHeight:r}=i.$player,o=i.renderer.prepare(s,t);if(!this.active(t))return;s.$lastStartTime=Date.now(),s.$restTime=i.speed;const l=a+o.clientWidth,d={type:"getDanmuTop",target:{mode:s.mode,height:o.clientHeight,speed:l/s.$restTime},visibles:i.visibles,antiOverlap:i.option.antiOverlap,clientWidth:a,clientHeight:r,marginBottom:i.marginBottom,marginTop:i.marginTop},h=d.antiOverlap?yield t.wait(i.postMessage(d)):{result:M(d)},c="symbol"===typeof h?void 0:h.result;if(!this.active(t)||s.$ref!==o)return;void 0!==c?(s.$lastStartTime=Date.now(),i.setState(s,"emit"),i.renderer.place(s,o,c,l,a),t.ref=null,i.art.emit("artplayerPluginDanmuku:visible",s)):(i.setState(s,"ready"),this.release(t))}})}destroy(){this.closed=!0,this.invalidate(),this.sampling.destroy()}}let C=0;class D{constructor(t,e){this.pending=new Map,this.closed=!1,this.failed=!1,this.onFailure=e,this.worker=t();try{this.worker.onmessage=t=>{var e;const i=this.pending.get(null==(e=t.data)?void 0:e.id);i&&(this.pending.delete(t.data.id),i.resolve(t.data))},this.worker.onerror=t=>{var e;null==(e=t.preventDefault)||e.call(t),this.fail(t.error||t)},this.worker.onmessageerror=t=>this.fail(t.error||t)}catch(i){try{this.dispose()}catch(n){}throw i}}request(t){t.id=++C;const{id:e}=t;return this.closed||this.failed?Promise.resolve({id:e,result:void 0}):new Promise((i,n)=>{this.pending.set(e,{resolve:i,reject:n});try{this.worker.postMessage(t)}catch(s){this.fail(s)}})}fail(t){if(!this.closed&&!this.failed){this.failed=!0;for(const e of this.pending.values())e.reject(t);this.pending.clear();try{this.dispose()}catch(e){}this.onFailure(t)}}cancel(){for(const[t,e]of this.pending)e.resolve({id:t,result:void 0});this.pending.clear()}dispose(){if(this.closed)return;this.closed=!0,this.cancel();let t,e=!1;const i=i=>{try{i()}catch(n){e||(t=n),e=!0}};for(const n of["onmessage","onerror","onmessageerror"])i(()=>this.worker[n]=null);if(i(()=>this.worker.terminate()),e)throw t}}const P='/*!\n * artplayer-plugin-danmuku.js v5.3.0\n * Github: https://github.com/zhw2590582/ArtPlayer\n * (c) 2017-2026 Harvey Zhao\n * Released under the MIT License.\n */\nfunction t({target:t,visibles:e,clientWidth:i,clientHeight:h,marginBottom:n,marginTop:o,antiOverlap:s}){const r=h-n,p=e.filter(e=>e.mode===t.mode&&e.top<=r).sort((t,e)=>t.top-e.top);if(0===p.length)return 2===t.mode?r-t.height:o;if(p.unshift({type:"top",top:0,left:0,right:0,height:o,width:i,speed:0,distance:i}),p.push({type:"bottom",top:r,left:0,right:0,height:n,width:i,speed:0,distance:i}),2===t.mode)for(let g=p.length-2;g>=0;g-=1){const e=p[g],i=p[g+1],h=e.top+e.height;if(i.top-h>=t.height)return i.top-t.height}else for(let g=1;g=t.height)return h}const a=[];for(let g=1;g{const i=Math.min(...e.map(t=>t.right)),h=Math.min(...t.map(t=>t.right));return i*e.length-h*t.length});break;case 1:case 2:a.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return a[0][0].top}switch(t.mode){case 0:{const e=a.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}onmessage=e=>{const{data:i}=e;if(!i.id||!i.type)return;const h=(0,{getDanmuTop:t}[i.type])(i);globalThis.postMessage({result:h,id:i.id})};\n',T="undefined"!==typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",P],{type:"text/javascript;charset=utf-8"});function L(t){let e;try{if(e=T&&(self.URL||self.webkitURL).createObjectURL(T),!e)throw"";const i=new Worker(e,{type:"module",name:null==t?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(i){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(P),{type:"module",name:null==t?void 0:t.name})}}class O{constructor(t,e){const{constructor:i,template:n}=t;this.utils=i.utils,this.validator=i.validator,this.$danmuku=n.$danmuku,this.$player=n.$player,this.art=t,this.queue=[],this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.index=0,this.worker=null,this.workerClient=null,this.renderer=new $(this),this.scheduler=new F(this),this.option=O.option,this.states={wait:[],ready:[],emit:[],stop:[]},this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.resize=this.resize.bind(this),this.destroy=this.destroy.bind(this),this.seek=this.seek.bind(this),k(this),t.on("destroy",this.destroy);try{if(this.config(e,!0),!k(this))return;this.createWorker()}catch(s){throw t.off("destroy",this.destroy),x(this),this.scheduler.destroy(),s}t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("resize",this.resize),t.on("video:seeking",this.seek),this.load().catch(t=>console.warn("Failed to load initial danmuku:",t))}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,width:512,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,emitter:!0,maxLength:200,lockTime:5,theme:"dark",OPACITY:{},FONT_SIZE:{},MARGIN:{},SPEED:{},COLOR:[]}}static get scheme(){return{danmuku:"array|function|string|promise",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement|string",heatmap:"object|boolean",width:"number",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",emitter:"boolean",maxLength:"number",lockTime:"number",theme:"string",OPACITY:"object",FONT_SIZE:"object",MARGIN:"object",SPEED:"object",COLOR:"array"}}static get cssText(){return'\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n '}get isRotate(){var t,e;return null==(e=null==(t=this.art.plugins)?void 0:t.autoOrientation)?void 0:e.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return O.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return O.option.margin[1]}get fontSize(){const{clamp:t}=this.utils,{clientHeight:e}=this.$player,i=this.option.fontSize;if("number"===typeof i)return Math.round(t(i,12,e));if("string"===typeof i&&i.endsWith("%")){const n=Number.parseFloat(i)/100;return Math.round(t(e*n,12,e))}return O.option.fontSize}get $ref(){return this.renderer.acquire()}get readys(){return function(t){const{currentTime:e}=t.art,i=[];return b(t,"ready",t=>i.push(t)),b(t,"wait",t=>{e+.1>=t.time&&t.time>=e-.1&&i.push(t)}),i}(this)}get visibles(){return this.renderer.visibles}get speed(){return this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed}load(t){return h(this,null,function*(){const{errorHandle:e}=this.utils,i=function(t,e){const i=w(t);if(e)for(const d of[...i.tasks])d.replace&&d.cancel();let n,s=i.closed||t.art.isDestroy;const a=new Promise(t=>n=t),r=new Set,o="function"===typeof AbortController?new AbortController:void 0,l={replace:e,signal:null==o?void 0:o.signal,active:()=>!s&&!i.closed&&!t.art.isDestroy,onCancel:t=>l.active()?(r.add(t),()=>r.delete(t)):(t(),()=>{}),cancel(){if(!s){s=!0,n(v),null==o||o.abort();for(const t of[...r])t();r.clear()}},wait:t=>Promise.race([t,a]),emit(e){i.emitting.push(l);try{return t.emit(e)}finally{i.emitting.pop()}},finish(){i.tasks.delete(l),r.clear()}};return s?n(v):i.tasks.add(l),l}(this,void 0===t);try{if(!i.active())return this;const n=function(t,e){return"function"===typeof t?{asynchronous:!0,value:t()}:c(t)?{asynchronous:!0,value:t}:"string"===typeof t?{asynchronous:!0,value:g(t,e)}:{asynchronous:!1,value:Array.isArray(t)?t:[]}}(t||this.option.danmuku,i),s=n.asynchronous?yield i.wait(n.value):n.value;if(!i.active())return this;e(Array.isArray(s),"Danmuku need return an array as result");const a=s;if(void 0===t){if(this.reset(),!i.active())return this;this.queue=[],this.states={wait:[],ready:[],emit:[],stop:[]},this.renderer.clear()}for(let t=0;t{const e=s[t],i=a[t];return"function"===typeof e||"function"===typeof i||c(e)||c(i)?e!==i:JSON.stringify(e)!==JSON.stringify(i)}))&&!e)return this;const r=function(t,e,{defaults:i,validate:n,clamp:s,mount:a}){const r=Object.assign({},i,t,e);return n(r),r.mode=s(r.mode,0,2),r.speed=s(r.speed,1,10),r.opacity=s(r.opacity,0,1),r.lockTime=s(r.lockTime,1,60),r.maxLength=s(r.maxLength,1,1e3),r.mount=r.mount||a,r}(this.option,t,{defaults:O.option,validate:t=>this.validator(t,O.scheme),clamp:i,mount:n});if(!k(this))return this;const o=this.option.beforeVisible!==r.beforeVisible;return this.option=r,o&&(this.scheduler.invalidate(),this.scheduler.schedule()),t.fontSize&&(this.reset(),!k(this))||(this.option.visible?this.show():this.hide(),k(this)&&this.art.emit("artplayerPluginDanmuku:config",this.option)),this}getLeft(t){return this.renderer.left(t)}postMessage(t={}){return this.workerClient.request(t)}createWorker(){this.workerClient=new D(()=>new L,t=>this.scheduler.fail(t)),this.worker=this.workerClient.worker}filter(t,e){return b(this,t,e)}setState(t,e){!function(t,e,i){t.states[e.$state]=t.states[e.$state].filter(t=>t!==e),e.$state=i,e.$ref&&(e.$ref.dataset.state=i),t.states[i].push(e)}(this,t,e)}makeWait(t){this.renderer.makeWait(t)}update(){return this.scheduler.running=!0,this.scheduler.schedule(),this}resize(){this.renderer.resize()}continue(){return this.renderer.continue(),this}suspend(){return this.renderer.suspend(),this}stop(){return this.isStop=!0,this.scheduler.running=!1,this.scheduler.invalidate(),this.suspend(),this.art.emit("artplayerPluginDanmuku:stop"),this}start(){if(this.scheduler.closed||this.art.isDestroy)return this;const t=++this.scheduler.starts,e=this.scheduler.generation;this.isStop=!1,this.scheduler.recover();return this.scheduler.closed||this.art.isDestroy||this.isStop||this.scheduler.fault||e!==this.scheduler.generation||t!==this.scheduler.starts||(this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")),this}reset(){return this.scheduler.invalidate(),this.queue.forEach(t=>this.makeWait(t)),this.art.emit("artplayerPluginDanmuku:reset"),this.scheduler.recover(),this.scheduler.schedule(),this}seek(){this.scheduler.invalidate(),this.scheduler.schedule()}show(){return this.isHide=!1,this.$danmuku.style.opacity=1,this.option.visible=!0,this.art.emit("artplayerPluginDanmuku:show"),this}hide(){return this.isHide=!0,this.scheduler.invalidate(),this.$danmuku.style.opacity=0,this.option.visible=!1,this.art.emit("artplayerPluginDanmuku:hide"),this.scheduler.schedule(),this}destroy(){var t;x(this),this.scheduler.destroy();try{try{this.stop()}finally{null==(t=this.workerClient)||t.dispose()}}finally{this.renderer.destroy(),this.art.off("video:play",this.start),this.art.off("video:playing",this.start),this.art.off("video:pause",this.stop),this.art.off("video:waiting",this.stop),this.art.off("resize",this.resize),this.art.off("video:seeking",this.seek),this.art.off("destroy",this.destroy),this.art.emit("artplayerPluginDanmuku:destroy")}}}const A=4294967295;function H(t,e){let i=0,n=t.length;for(;iNumber.isFinite(t)&&t>0))return null;const o={xMin:0,xMax:t,yMin:0,yMax:128,scale:.25,opacity:.2,minHeight:Math.floor(.05*e),sampling:Math.max(1,Math.floor(t/100)),smoothing:.2,flattening:.2},l=Object.assign({},"object"===typeof s?s:{}),d=Object.assign({},o,l);for(const r of Object.keys(o))Number.isFinite(d[r])||(d[r]=o[r]);if(d.sampling<=0&&(d.sampling=o.sampling),d.xMin===d.xMax||d.yMin===d.yMax)return null;const h=Array.isArray(a)&&a.length>0,c=h?[...a]:function(t,e,i,n){if(!Number.isFinite(e)||e<=0||!Number.isFinite(i)||i<=0||!Number.isFinite(n)||n<=0||Math.floor(e/n)+1>A)return[];const s=t.map(t=>t.time).filter(t=>"number"===typeof t&&!Number.isNaN(t)).sort((t,e)=>t-e),a=[],r=i/e;if(!Number.isFinite(r))return[];for(let o=0;o<=e;o+=n){if(a.length>=A||o+n===o)return[];const t=o*r,e=(o+n)*r;a.push([o,H(s,e)-H(s,t)])}return a}(n,t,i,d.sampling);if(!c.length||!c.every(t=>Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])))return null;const p=c[c.length-1];if(p[0]!==t){if(c.length===A)return null;c.push([t,p[1]])}let u=1/0,m=-1/0;for(const r of c)u=Math.min(u,r[1]),m=Math.max(m,r[1]);const f=(u+m)/2;for(const r of c){const t=r[1];r[1]=t*(t>f?1+d.scale:1-d.scale)+d.minHeight}const g=!h&&!Number.isFinite(l.yMin)&&!Number.isFinite(l.yMax);let y=0;for(const r of c)y=Math.max(y,r[1]);const v=g&&y>o.yMax/4;v&&(d.yMax=4*y);const w=t=>v?Math.min(e,Math.max(.75*e,t)):t,k=(t,e,i,n)=>{const s=function(t,e){const i=e[0]-t[0],n=e[1]-t[1];return{length:Math.sqrt(r(i,2)+r(n,2)),angle:Math.atan2(n,i)}}(e||t,i||t),a=N(Math.cos(s.angle)*d.flattening,0,1,1,0),o=s.angle*a+(n?Math.PI:0),l=s.length*d.smoothing;return[t[0]+Math.cos(o)*l,w(t[1]+Math.sin(o)*l)]},x=c.map(i=>[N(i[0],d.xMin,d.xMax,0,t),w(N(i[1],d.yMin,d.yMax,e,0))]);if(!x.every(t=>t.every(Number.isFinite)))return null;const b=x.map((t,i,n)=>{if(0===i)return`M ${n[n.length-1][0]},${e} L ${t[0]},${e} L ${t[0]},${t[1]}`;const s=k(n[i-1],n[i-2],t),a=k(t,n[i-1],n[i+1],!0);return`C ${s[0]},${s[1]} ${a[0]},${a[1]} ${t[0]},${t[1]}${i===n.length-1?" z":""}`}).join(" ");return/NaN|Infinity/u.test(b)?null:{path:b,opacity:d.opacity,width:t,height:e}}let j=0;function q(t,e,i){if(t.isDestroy)return;const{query:n}=t.constructor.utils;let s;const a=[];let r,o,l,d=!1;const h=()=>!d&&!t.isDestroy;function c(e,i){const n=i;a.push([e,n]),t.on(e,n)}function p(e){if(d)return;let i;d=!0,o=null,l=null;let n=!1;const s=t=>{try{t()}catch(e){n||(i=e),n=!0}};for(const[r,o]of a.splice(0))s(()=>t.off(r,o));if(e&&r&&t.controls.heatmap===r&&s(()=>t.controls.remove("heatmap")),r=void 0,n)throw i}function u(t){h()&&o&&l&&(o.setAttribute("offset",100*t+"%"),l.setAttribute("offset",100*t+"%"))}function m(a){try{!function(a=[]){if(!h())return;o=null,l=null;const d=r;if(d.innerHTML="",t.option.isLive)return;const c=V({width:d.offsetWidth,height:d.offsetHeight,duration:t.duration,queue:e.queue,option:i,points:a});if(!c||!h())return;const p=d.ownerDocument;for(s||(s=p?"heatmap-solids":"heatmap-solids-"+ ++j);null==p?void 0:p.getElementById(s);)s="heatmap-solids-"+ ++j;d.innerHTML=`\n \n \n \n \n \n \n \n \n \n \n \n `,o=n("#heatmap-start",d),l=n("#heatmap-stop",d),u(t.played)}(a)}catch(d){try{p(!0)}catch(c){}throw d}}c("destroy",()=>p(!0));try{t.controls.add({name:"heatmap",position:"top",html:"",style:{position:"absolute",top:"-100px",left:"0px",right:"0px",height:"100px",width:"100%",pointerEvents:"none"},beforeUnmount(){p(!1)},mounted(e){if(r=e,d)return t.controls.heatmap===e&&t.controls.remove("heatmap"),void(r=void 0);h()?(c("video:timeupdate",()=>u(t.played)),c("setBar",(t,e)=>{"played"===t&&u(e)}),c("ready",()=>m()),c("resize",()=>m()),c("artplayerPluginDanmuku:loaded",()=>m()),c("artplayerPluginDanmuku:points",t=>m(t))):p(!0)}})}catch(f){try{p(!0)}catch(g){}throw f}return()=>p(!0)}const I=new WeakMap;class B{constructor(t){this.art=t,this.closed=!1,this.disposers=new Set,this.cancelled=new Promise(t=>this.cancel=t)}get active(){return!this.closed&&!this.art.isDestroy}own(t){this.closed?t():this.disposers.add(t)}write(t,e,i,n=i=>t[e]=i){const s=t;if(!this.active)return;const a=()=>"function"===typeof s.getPropertyPriority?s.getPropertyPriority(e):void 0;let r=I.get(s);r||(r=new Map,I.set(s,r));let o=r.get(e);o||(o={original:s[e],present:e in s||void 0!==s[e],priority:a(),owners:new Map,apply:n},r.set(e,o)),o.owners.has(this)||this.own(()=>{const t=[...o.owners.keys()],i=t[t.length-1]===this;if(o.owners.delete(this),i&&s[e]===o.last&&a()===o.lastPriority){const t=[...o.owners.values()];t.length?(o.apply(t[t.length-1]),o.last=s[e],o.lastPriority=a()):void 0!==o.priority?s.setProperty(e,o.original,o.priority):o.present?o.apply(o.original):delete s[e]}o.owners.size||(r.delete(e),r.size||I.delete(s))}),o.owners.delete(this),o.owners.set(this,i),o.apply(i),o.last=s[e],o.lastPriority=a()}on(t,e){if(!this.active)return;const i=this;function n(...t){if(i.active)return e.apply(this,t)}const s=()=>this.art.off(t,n);this.own(s);try{this.art.on(t,n),this.active||s()}catch(a){throw this.release(s),a}}proxy(t,e,i){if(!this.active)return;const n=this;function s(...t){if(n.active)return i.apply(this,t)}let a;const r=()=>{var i,n;if("function"===typeof a){const t=this.art.events;"function"===typeof(null==t?void 0:t.remove)&&(null==(i=t.destroyEvents)?void 0:i.has(a))?t.remove(a):a()}else null==(n=t.removeEventListener)||n.call(t,e,s)};this.own(r);try{a=this.art.proxy(t,e,s),this.active||r()}catch(o){throw this.release(r),o}}wait(t){return Promise.race([t,this.cancelled])}release(t){try{t()}catch(e){console.warn("Failed to dispose danmuku setting resource:",e)}}close(){if(!this.closed){this.closed=!0,this.cancel();for(const t of this.disposers)this.release(t);this.disposers.clear()}}}function R({min:t,max:e,container:i,findIndex:n,onChange:s,steps:a=[]}){const{lifecycle:r}=this;if(!r.active)return{reset(){}};const{query:o,clamp:l,setStyle:d}=this.utils;d(i,"touch-action","none"),i.innerHTML=`\n

\n
\n ${a.map(()=>'
').join("")}\n
\n
\n
\n
\n
\n ${a.map(t=>t.hide?"":`
${t.name}
`).join("")}\n
\n `;const h=o(".apd-slider-dot",i),c=o(".apd-slider-progress",i);let p=!1;function u(i){if(!r.active)return;if(void 0===i&&(i=n()),ie)return;const o=(i-t)/(e-t);h.style.left=100*o+"%",0===a.length&&(c.style.width=h.style.left),s(i)}function m(n){const{top:s,height:a,left:r,width:o}=i.getBoundingClientRect();if(this.art.isRotate){const i=l(n.clientY-s,0,a);u(Math.round(i/a*(e-t)+t))}else{const i=l(n.clientX-r,0,o);u(Math.round(i/o*(e-t)+t))}}return r.own(()=>p=!1),r.proxy(i,"click",t=>{m.call(this,t)}),r.proxy(i,"pointerdown",t=>{p=0===t.button}),r.on("document:pointermove",t=>{p&&m.call(this,t)}),r.on("document:pointerup",t=>{p&&(p=!1,m.call(this,t))}),{reset:u}}const Z='',W='',_='',U='',G='',X='',Y='',J='',K='',Q='',tt='',et='';function it(){const{option:t}=this;return`\n
\n ${tt}${Q}\n
\n
\n ${_}\n
\n
\n
\n \u6309\u7c7b\u578b\u5c4f\u853d\n
\n
\n ${U}${G}\n
\u6eda\u52a8
\n
\n
\n ${X}${Y}\n
\u9876\u90e8
\n
\n
\n ${J}${K}\n
\u5e95\u90e8
\n
\n
\n
\n
\n
\n ${W}${Z}\n \u9632\u6b62\u5f39\u5e55\u91cd\u53e0\n
\n
\n ${W}${Z}\n \u540c\u6b65\u89c6\u9891\u901f\u5ea6\n
\n
\n
\n \u4e0d\u900f\u660e\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n \u663e\u793a\u533a\u57df\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u5b57\u53f7\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u901f\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n
\n
\n
\n
\n ${et}\n
\n
\n
\n \u6a21\u5f0f\n
\n
\n ${G}\n
\u6eda\u52a8
\n
\n
\n ${Y}\n
\u9876\u90e8
\n
\n
\n ${K}\n
\u5e95\u90e8
\n
\n
\n
\n
\n \u989c\u8272\n
\n ${this.COLOR.map(t=>`
`).join("")}\n
\n
\n
\n
\n
\n \n
\u53d1\u9001
\n
\n `}if("undefined"!==typeof document){const t="artplayer-plugin-danmuku",e=Symbol.for("artplayer-plugin-danmuku.pending-style"),i=document;let n=document.getElementById(t)||i[e];if(!n)if(n=document.createElement("style"),n.id=t,"loading"===document.readyState){i[e]=n;const s=()=>{document.removeEventListener("DOMContentLoaded",s),i[e]===n&&delete i[e];const a=document.getElementById(t);a?a.textContent=n.textContent:(document.head||document.documentElement).appendChild(n)};document.addEventListener("DOMContentLoaded",s,{once:!0})}else(document.head||document.documentElement).appendChild(n);n.textContent='.artplayer-plugin-danmuku{display:flex;position:relative;z-index:99;align-items:center;justify-content:center;font-size:12px;height:32px;width:100%;color:#fff;font-weight:300;flex-shrink:0;gap:10px}.artplayer-plugin-danmuku .apd-icon{cursor:pointer;opacity:.75;transition:all .2s ease;fill:#fff}.artplayer-plugin-danmuku .apd-icon:hover{opacity:1}.artplayer-plugin-danmuku .apd-config{display:flex;position:relative}.artplayer-plugin-danmuku .apd-config .apd-config-panel{position:absolute;bottom:24px;left:0;width:320px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-config .apd-config-panel .apd-config-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-config:hover .apd-config-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-config-mode,.artplayer-plugin-danmuku .apd-config-slider,.artplayer-plugin-danmuku .apd-config-other,.artplayer-plugin-danmuku .apd-style-mode{margin-bottom:15px}.artplayer-plugin-danmuku .apd-modes{display:flex;align-items:center;margin-top:5px;gap:20px}.artplayer-plugin-danmuku .apd-modes .apd-mode{cursor:pointer;text-align:center}.artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-config-slider{display:flex;align-items:center;gap:12px}.artplayer-plugin-danmuku .apd-config-slider .apd-value{width:32px;text-align:right}.artplayer-plugin-danmuku .apd-slider{position:relative;flex:1;display:flex;height:20px;align-items:center;justify-content:center;cursor:pointer}.artplayer-plugin-danmuku .apd-slider .apd-slider-line{position:relative;height:2px;width:100%;overflow:hidden;border-radius:3px;background-color:#ffffff40}.artplayer-plugin-danmuku .apd-slider .apd-slider-points{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}.artplayer-plugin-danmuku .apd-slider .apd-slider-points .apd-slider-point{width:2px;height:2px;border-radius:50%;background-color:#ffffff80}.artplayer-plugin-danmuku .apd-slider .apd-slider-progress{width:0%;height:100%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-dot{position:absolute;transform:translate(-6px);left:0%;width:12px;height:12px;border-radius:50%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps{display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:-12px;width:calc(100% + 32px);color:#777}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps .apd-slider-step{flex-shrink:0;width:36px;text-align:center;scale:.95}.artplayer-plugin-danmuku .apd-config-other{display:flex;align-items:center;gap:20px}.artplayer-plugin-danmuku .apd-config-other .apd-check-off,.artplayer-plugin-danmuku .apd-config-other .apd-check-on{width:16px;height:16px}.artplayer-plugin-danmuku .apd-config-other .apd-other{display:flex;align-items:center;cursor:pointer;gap:2px}.artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-emitter{display:flex;flex:1;align-items:center;height:100%;background-color:#ffffff40;border-radius:5px}.artplayer-plugin-danmuku .apd-style{position:relative;display:flex;align-items:center;justify-content:center}.artplayer-plugin-danmuku .apd-style .apd-style-panel{position:absolute;bottom:24px;left:0;width:200px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-style .apd-style-panel .apd-style-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-style:hover .apd-style-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-colors{display:flex;flex-wrap:wrap;margin-top:5px;gap:8px}.artplayer-plugin-danmuku .apd-colors .apd-color{width:16px;height:16px;border-radius:2px;cursor:pointer}.artplayer-plugin-danmuku .apd-colors .apd-color.apd-active{border:1px solid black;box-shadow:0 0 0 1px #fff}.artplayer-plugin-danmuku .apd-input{outline:none;height:100%;flex:1;min-width:0;width:auto;border:none;line-height:1;color:#fff;background-color:transparent}.artplayer-plugin-danmuku .apd-input::placeholder{color:#ffffff80}.artplayer-plugin-danmuku .apd-send{display:flex;align-items:center;justify-content:center;height:100%;width:60px;flex-shrink:0;cursor:pointer;text-shadow:none;border-top-right-radius:5px;border-bottom-right-radius:5px;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-send.apd-lock{cursor:not-allowed;color:#666;background-color:#e7e7e7}.art-controls-center .apd-emitter{width:260px;flex:none}.art-fullscreen .artplayer-plugin-danmuku,.art-fullscreen-web .artplayer-plugin-danmuku{height:38px;gap:16px}.art-fullscreen .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen-web .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-on,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-on{width:28px;height:28px}.art-fullscreen .artplayer-plugin-danmuku .apd-emitter,.art-fullscreen-web .artplayer-plugin-danmuku .apd-emitter{width:400px;flex:none}.art-video-player>.artplayer-plugin-danmuku{position:absolute;left:0;right:0;bottom:-40px;padding:0 10px}.art-video-player:has(>.artplayer-plugin-danmuku){margin-bottom:40px}[data-danmuku-emitter=false] .apd-emitter{display:none!important}[data-danmuku-emitter=false] .art-controls-center .artplayer-plugin-danmuku{justify-content:flex-end;gap:18px}[data-danmuku-emitter=false].art-fullscreen .art-controls-center .artplayer-plugin-danmuku,[data-danmuku-emitter=false].art-fullscreen-web .art-controls-center .artplayer-plugin-danmuku{gap:24px}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-icon{fill:#333}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-emitter{background-color:#f1f2f3}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input{color:#000}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input::placeholder{color:#0000004d}[data-danmuku-visible=false] .apd-toggle-off{display:block}[data-danmuku-visible=false] .apd-toggle-on,[data-danmuku-visible=true] .apd-toggle-off{display:none}[data-danmuku-visible=true] .apd-toggle-on{display:block}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-on{display:none}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-off,[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-on{display:block}[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-off,[data-danmuku-sync-video=false] .apd-sync-video .apd-check-on{display:none}[data-danmuku-sync-video=false] .apd-sync-video .apd-check-off,[data-danmuku-sync-video=true] .apd-sync-video .apd-check-on{display:block}[data-danmuku-sync-video=true] .apd-sync-video .apd-check-off{display:none}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-off{display:block}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-on{display:none}[data-danmuku-mode0=false] .art-danmuku [data-mode="0"]{opacity:0!important}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-off{display:none}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-on{display:block}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"]{color:#00a1d6}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"] path{fill:#00a1d6}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-off{display:block}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-on{display:none}[data-danmuku-mode1=false] .art-danmuku [data-mode="1"]{opacity:0!important}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-off{display:none}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-on{display:block}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"]{color:#00a1d6}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"] path{fill:#00a1d6}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-off{display:block}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-on{display:none}[data-danmuku-mode2=false] .art-danmuku [data-mode="2"]{opacity:0!important}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-off{display:none}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-on{display:block}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"]{color:#00a1d6}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"] path{fill:#00a1d6}'}class nt{constructor(t,e){this.art=t,this.danmuku=e,this.utils=t.constructor.utils;const{setStyle:i}=this.utils,{$controlsCenter:n}=t.template;this.template={$controlsCenter:n,$mount:n,$danmuku:null,$toggle:null,$config:null,$configPanel:null,$configModes:null,$style:null,$stylePanel:null,$styleModes:null,$colors:null,$opacitySlider:null,$opacityValue:null,$marginSlider:null,$marginValue:null,$fontSizeSlider:null,$fontSizeValue:null,$speedSlider:null,$speedValue:null,$input:null,$send:null},this.slider={opacity:null,margin:null,fontSize:null,speed:null},this.emitting=!1,this.isLock=!1,this.timer=null,this.lifecycle=new B(t),this.destroy=this.destroy.bind(this),this.lifecycle.own(()=>t.off("destroy",this.destroy));try{if(t.on("destroy",this.destroy),!this.lifecycle.active)return;if(this.lifecycle.write(n.style,"display","flex",t=>i(n,"display",t)),this.createTemplate(),!this.lifecycle.active)return;if(this.createSliders(),!this.lifecycle.active)return;if(this.createEvents(),this.mount(this.option.mount),!this.lifecycle.active)return;this.lifecycle.on("resize",()=>this.resize()),this.lifecycle.on("fullscreen",t=>this.onFullscreen(t)),this.lifecycle.on("fullscreenWeb",t=>this.onFullscreen(t)),this.lifecycle.proxy(this.template.$config,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$config,$panel:this.template.$configPanel})}),this.lifecycle.proxy(this.template.$style,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$style,$panel:this.template.$stylePanel})})}catch(s){try{this.destroy()}catch(a){console.warn("Failed to roll back danmuku setting:",a)}throw s}}static get icons(){return{$on:tt,$off:Q,$config:_,$style:et,$mode_0_off:U,$mode_0_on:G,$mode_1_off:X,$mode_1_on:Y,$mode_2_off:J,$mode_2_on:K,$check_on:W,$check_off:Z}}get option(){return this.danmuku.option}get outside(){return this.template.$mount!==this.template.$controlsCenter}get TEMPLATE(){return it.call(this)}get OPACITY(){return l({min:0,max:100,steps:[]},this.option.OPACITY)}get FONT_SIZE(){return l({min:12,max:120,steps:[]},this.option.FONT_SIZE)}get MARGIN(){return l({min:0,max:3,steps:[{name:"1/4",value:[10,"75%"]},{name:"\u534a\u5c4f",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"\u6ee1\u5c4f",value:[10,10]}]},this.option.MARGIN)}get SPEED(){return l({min:0,max:4,steps:[{name:"\u6781\u6162",value:10},{name:"\u8f83\u6162",value:7.5,hide:!0},{name:"\u9002\u4e2d",value:5},{name:"\u8f83\u5feb",value:2.5,hide:!0},{name:"\u6781\u5feb",value:1}]},this.option.SPEED)}get COLOR(){return this.option.COLOR.length?this.option.COLOR:["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(t){const{query:e}=this.utils,{$danmuku:i}=this.template;return e(t,i)}append(t,e){if(!this.lifecycle.active)return;const{append:i}=this.utils;[...t.children].includes(e)||i(t,e)}setData(t,e){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,{$mount:n}=this.template;this.lifecycle.write(i.dataset,t,e),this.outside&&this.lifecycle.write(n.dataset,t,e)}createTemplate(){const{createElement:t,tooltip:e}=this.utils,i=t("div");this.template.$danmuku=i,i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$toggle=this.query(".apd-toggle"),this.template.$config=this.query(".apd-config"),this.template.$configPanel=this.query(".apd-config-panel"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$style=this.query(".apd-style"),this.template.$stylePanel=this.query(".apd-style-panel"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send");const{$toggle:n}=this.template;this.lifecycle.on("artplayerPluginDanmuku:show",()=>{e(n,"\u5173\u95ed\u5f39\u5e55")}),this.lifecycle.on("artplayerPluginDanmuku:hide",()=>{e(n,"\u6253\u5f00\u5f39\u5e55")})}createEvents(){const{$toggle:t,$configModes:e,$styleModes:i,$colors:n,$antiOverlap:s,$syncVideo:a,$send:r,$input:o}=this.template;this.lifecycle.proxy(t,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.lifecycle.proxy(e,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(t=>t!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.lifecycle.proxy(s,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.lifecycle.proxy(a,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.lifecycle.proxy(i,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.lifecycle.proxy(n,"click",t=>{const e=t.target.closest(".apd-color");e&&(this.danmuku.config({color:e.dataset.color}),this.reset())}),this.lifecycle.proxy(r,"click",()=>this.emit()),this.lifecycle.proxy(o,"keypress",t=>{"Enter"===t.key&&(t.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider(d(l({},this.OPACITY),{container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:t=>{const{$opacityValue:e}=this.template;e.textContent=`${t}%`,this.danmuku.config({opacity:t/100})}})),this.slider.margin=this.createSlider(d(l({},this.MARGIN),{container:this.template.$marginSlider,findIndex:()=>this.MARGIN.steps.findIndex(t=>t.value[0]===this.option.margin[0]&&t.value[1]===this.option.margin[1]),onChange:t=>{const e=this.MARGIN.steps[t];if(!e)return;const{$marginValue:i}=this.template;i.textContent=e.name,this.danmuku.config({margin:e.value})}})),this.slider.fontSize=this.createSlider(d(l({},this.FONT_SIZE),{container:this.template.$fontSizeSlider,findIndex:()=>this.danmuku.fontSize,onChange:t=>{const{$fontSizeValue:e}=this.template;e.textContent=`${t}px`,t!==this.danmuku.fontSize&&this.danmuku.config({fontSize:t})}})),this.slider.speed=this.createSlider(d(l({},this.SPEED),{container:this.template.$speedSlider,findIndex:()=>this.SPEED.steps.findIndex(t=>t.value===this.option.speed),onChange:t=>{const e=this.SPEED.steps[t];if(!e)return;const{$speedValue:i}=this.template;i.textContent=e.name,this.danmuku.config({speed:e.value})}}))}createSlider(t){return R.call(this,t)}onFullscreen(t){if(!this.lifecycle.active)return;const{$danmuku:e,$controlsCenter:i,$mount:n}=this.template;this.outside?t?this.append(i,e):this.append(n,e):this.append(i,e)}onMouseEnter({$control:t,$panel:e}){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),r=s.width/2-n.width/2,o=a.left-(n.left-r),l=n.right+r-a.right;e.style.left=o>0?`${-r+o}px`:l>0?-r-l+"px":-r+"px"}emit(){return function(t){return h(this,null,function*(){const{lifecycle:e,template:{$input:i}}=t;if(!e.active)return;const n=i.value.trim();if(!n.length||t.isLock||t.emitting)return;const s={text:n,mode:t.option.mode,color:t.option.color,time:t.art.currentTime},a=t=>{e.active&&console.error("Error emitting danmuku:",t)};try{t.emitting=!0;const n=yield e.wait(t.option.beforeEmit(s));if(!e.active)return;if(t.emitting=!1,!0!==n)return;if(s.border=!0,delete s.time,Promise.resolve(t.danmuku.emit(s)).catch(a),!e.active)return;i.value="",t.lock()}catch(r){a(r),e.active&&(t.emitting=!1)}})}(this)}lock(){!function(t){if(!t.lifecycle.active)return;const{addClass:e}=t.utils,{$send:i}=t.template;clearTimeout(t.timer),t.isLock=!0;let n=t.option.lockTime;i.textContent=n,e(i,"apd-lock");const s=()=>{t.timer=setTimeout(()=>{t.lifecycle.active&&(0===n?t.unlock():(n-=1,i.textContent=n,s()))},1e3)};s()}(this)}unlock(){!function(t){if(clearTimeout(t.timer),t.timer=null,t.isLock=!1,!t.lifecycle.active)return;const{removeClass:e}=t.utils,{$send:i}=t.template;i.textContent="\u53d1\u9001",e(i,"apd-lock")}(this)}resize(){if(!this.lifecycle.active)return;if(this.outside)return;if(this.art.fullscreen)return;if(this.art.fullscreenWeb)return;const{$player:t,$controlsCenter:e}=this.art.template,{$danmuku:i}=this.template;this.art.widtht.dataset.color===this.option.color.toUpperCase());a&&t(a,"apd-active"),e(i,this.option.visible?"\u5173\u95ed\u5f39\u5e55":"\u6253\u5f00\u5f39\u5e55"),this.resize()}mount(t){if(!this.lifecycle.active)return;const{errorHandle:e}=this.utils,i="string"===typeof t?document.querySelector(t):t;e(i,`Can not find the mount point: ${t}`),this.append(i,this.template.$danmuku),this.template.$mount=i,this.reset()}destroy(){if(this.lifecycle.closed)return;this.lifecycle.close(),clearTimeout(this.timer),this.timer=null,this.emitting=!1,this.isLock=!1;const t=this.template.$danmuku;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t)}}function st(t){return e=>{const i=new O(e,t);let n;try{n=e.isDestroy?void 0:new nt(e,i),!e.isDestroy&&i.option.heatmap&&q(e,i,i.option.heatmap)}catch(s){try{null==n||n.destroy()}catch(a){}try{i.destroy()}catch(a){}throw s}return{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:n?n.mount.bind(n):()=>{},get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}return st.icons=nt.icons,st}); diff --git a/docs/compiled/artplayer-plugin-danmuku.mjs b/docs/compiled/artplayer-plugin-danmuku.mjs index 616c74f51..5b9fd98ca 100644 --- a/docs/compiled/artplayer-plugin-danmuku.mjs +++ b/docs/compiled/artplayer-plugin-danmuku.mjs @@ -652,6 +652,10 @@ class SamplingWindow { this.waiting = /* @__PURE__ */ new Set(); this.visibility = () => this.clear(); } + begin(owner) { + if (this.time === void 0) + this.capture(owner, [], owner.art.currentTime); + } capture(owner, rows, time) { const doc = owner.$player.ownerDocument; if (doc !== this.document) { @@ -789,7 +793,18 @@ class Scheduler { } schedule() { const owner = this.owner; - if (!this.running || this.closed || this.fault || owner.art.isDestroy || owner.isStop || this.frame !== null) + if (!this.running || this.closed || this.fault || owner.art.isDestroy || owner.isStop) + return; + try { + const video = owner.art.video; + const started = owner.art.playing || video?.paused === false && !video.ended && video.readyState > 2; + if (started && !owner.isHide) + this.sampling.begin(owner); + } catch (error) { + this.fail(error); + return; + } + if (this.frame !== null) return; this.frame = window.requestAnimationFrame(() => { this.frame = null; diff --git a/docs/uncompiled/artplayer-plugin-danmuku/index.js b/docs/uncompiled/artplayer-plugin-danmuku/index.js index 4ecf7c08c..7678afa0e 100644 --- a/docs/uncompiled/artplayer-plugin-danmuku/index.js +++ b/docs/uncompiled/artplayer-plugin-danmuku/index.js @@ -648,6 +648,10 @@ var artplayerPluginDanmuku = (function() { this.waiting = /* @__PURE__ */ new Set(); this.visibility = () => this.clear(); } + begin(owner) { + if (this.time === void 0) + this.capture(owner, [], owner.art.currentTime); + } capture(owner, rows, time) { const doc = owner.$player.ownerDocument; if (doc !== this.document) { @@ -785,7 +789,18 @@ var artplayerPluginDanmuku = (function() { } schedule() { const owner = this.owner; - if (!this.running || this.closed || this.fault || owner.art.isDestroy || owner.isStop || this.frame !== null) + if (!this.running || this.closed || this.fault || owner.art.isDestroy || owner.isStop) + return; + try { + const video = owner.art.video; + const started = owner.art.playing || video?.paused === false && !video.ended && video.readyState > 2; + if (started && !owner.isHide) + this.sampling.begin(owner); + } catch (error) { + this.fail(error); + return; + } + if (this.frame !== null) return; this.frame = window.requestAnimationFrame(() => { this.frame = null; diff --git a/packages/artplayer-plugin-danmuku/ARCHITECTURE.md b/packages/artplayer-plugin-danmuku/ARCHITECTURE.md index 80869bacb..6b97094dd 100644 --- a/packages/artplayer-plugin-danmuku/ARCHITECTURE.md +++ b/packages/artplayer-plugin-danmuku/ARCHITECTURE.md @@ -196,7 +196,16 @@ existing track algorithm and geometry fields until separately reviewed. RAF sampling and visible lifetime maintenance continue while `beforeVisible` or the Worker is pending. Public `readys` remains the instantaneous +/- 0.1 second -query. The sampling window also recovers rows crossed between consecutive +query. A playing, visible scheduler seeds its first observation before requesting +RAF, so a delayed first callback cannot discard the initial playback interval. +This records time and existing waiting identities only; it never calls the public +readys getter or dispatches beforeVisible/visible outside RAF. Repeated play/playing +or start calls retain that anchor until a lifecycle boundary clears it. Native +unpaused, non-ended media with current data can seed time zero even though the +unchanged public playing getter requires currentTime > 0. Dispatch still waits +for the existing playing condition; paused, hidden and seeking periods do not +become catch-up intervals. +The sampling window also recovers rows crossed between consecutive forward media samples, but only if they were already waiting at the earlier sample and were not already selected there. It does not replay newly appended past rows or retry a false callback merely because time crossed that row. diff --git a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js b/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js index aa21b5c86..712bb2bea 100644 --- a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js +++ b/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js @@ -4,4 +4,4 @@ * (c) 2017-2026 Harvey Zhao * Released under the MIT License. */ -!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.artplayerPluginDanmuku=e(),define(function(){return t.artplayerPluginDanmuku})):(t="undefined"!==typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";function t(t){return t instanceof Promise||"[object Promise]"===Object.prototype.toString.call(t)}function e(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:return 2;case 5:return 1}}function i(t){if("string"!==typeof t)return[];const i=t.matchAll(/]*?p="(?

[^"]+)"[^>]*>(?.*?)<\/d>/gs);return Array.from(i).map(t=>{const i=t.groups.p.split(",");if(i.length>=8){return{text:t.groups.text.trim().replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&"),time:Number(i[0]),mode:e(Number(i[1])),fontSize:Number(i[2]),color:`#${Number(i[3]).toString(16)}`,timestamp:Number(i[4]),pool:Number(i[5]),userID:i[6],rowID:Number(i[7])}}return null}).filter(Boolean)}function n({data:t}){const{xml:e,id:n}=t,s=i(e);globalThis.postMessage({danmus:s,id:n})}let s=0;function a(t,{signal:a,onCancel:r}={}){return new Promise((o,l)=>{let d,h,c,p=!1;const u=++s,m=()=>g(void 0,function(t){if(void 0!==t?.reason)return t.reason;const e=new Error("Bilibili Danmu loading cancelled");return e.name="AbortError",e}(a));function f(){let t,e=!1;try{if(d){const t=d;d=void 0,t.onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate()}}catch(i){t=i,e=!0}if(void 0!==h){const n=h;h=void 0;try{URL.revokeObjectURL(n)}catch(i){e||(t=i),e=!0}}if(e)throw t}function g(t,e){if(p)return;p=!0;let i=arguments.length>1;a?.removeEventListener("abort",m),c?.();try{f()}catch(n){i||(e=n),i=!0}i?l(e):o(t)}function y(t,e){if(!p){console.error("Error parsing Bilibili Danmu:",e);try{g(i(t))}catch(n){g(void 0,n)}}}a?.aborted?m():(a?.addEventListener("abort",m),c=r?.(m),p?c?.():async function(){const s=a?await fetch(t,{signal:a}):await fetch(t);if(p)return;const r=await s.text();if(!p)try{const t=`\n ${e.toString()}\n ${i.toString()}\n onmessage = ${n.toString()}\n `;if(h=URL.createObjectURL(new Blob([t],{type:"application/javascript"})),p)return void f();if(d=new Worker(h),p)return void f();d.onmessage=t=>{if(p||t.data?.id!==u)return;const{danmus:e}=t.data;Array.isArray(e)?g(e):g(void 0,new Error("Invalid Bilibili Danmu worker response"))},d.onerror=t=>{t.preventDefault?.(),y(r,t.error||t)},d.onmessageerror=t=>y(r,t.error||t),d.postMessage({xml:r,id:u})}catch(o){y(r,o)}}().catch(t=>g(void 0,t)))})}const r=new WeakMap,o=Symbol("cancelled danmuku input");function l(t){return r.has(t)||r.set(t,{closed:!1,tasks:new Set,emitting:[]}),r.get(t)}function d(t){const e=l(t),i=e.emitting[e.emitting.length-1];return!e.closed&&!t.art.isDestroy&&(!i||i.active())}function h(t){const e=l(t);e.closed=!0;for(const i of[...e.tasks])i.cancel()}function c(t,e,i){const n=t.states[e]||[];for(let s=0;s{const s=n.$ref.offsetTop,a=this.owner.getLeft(n.$ref)-i,r=n.$ref.clientHeight,o=n.$ref.clientWidth,l=a+o,d=e-l,h=l/n.$restTime,c={};c.top=s,c.left=a,c.height=r,c.width=o,c.right=d,c.speed=h,c.distance=l,c.time=n.$restTime,c.mode=n.mode,t.push(c)}),t}left(t){const e=t.getBoundingClientRect();return this.owner.isRotate?e.top:e.left}makeWait(t){this.owner.setState(t,"wait"),t.$ref&&(t.$ref.style.cssText=this.owner.constructor.cssText,t.$ref.style.visibility="hidden",t.$ref.style.marginLeft="0px",t.$ref.style.transform="translateX(0px)",t.$ref.style.transition="transform 0s linear 0s",this.owner.$refs.push(t.$ref),t.$ref=null)}resize(){const{clientWidth:t}=this.owner.$player;this.owner.filter("stop",e=>{if(0===e.mode)e.$ref.style.left=`${t}px`}),this.owner.filter("emit",e=>{switch(e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.left=`${t}px`,e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}})}continue(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("stop",e=>{switch(this.owner.setState(e,"emit"),e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}}),this}suspend(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("emit",e=>{switch(this.owner.setState(e,"stop"),e.mode){case 0:{const i=t-(this.owner.getLeft(e.$ref)-this.owner.getLeft(this.owner.$player));e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition="transform 0s linear 0s";break}}}),this}prepare(t,e){const i=this.owner,n=i.$ref;return e.danmu=t,e.ref=n,t.$ref=n,n.textContent=t.text,i.$danmuku.appendChild(n),n.style.opacity=i.option.opacity,n.style.fontSize=`${i.fontSize}px`,n.style.color=t.color,n.style.border=t.border?`1px solid ${t.color}`:null,n.style.backgroundColor=t.border?"rgb(0 0 0 / 50%)":null,i.utils.setStyles(n,t.style),n}place(t,e,i,n,s){switch(e.style.top=`${i}px`,e.style.visibility="visible",e.dataset.mode=t.mode,e.dataset.id=t.id||"",t.mode){case 0:e.style.left=`${s}px`,e.style.marginLeft="0px",e.style.transform=`translateX(${-n}px)`,e.style.transition=`transform ${t.$restTime}s linear 0s`;break;case 1:case 2:e.style.left="50%",e.style.marginLeft=`-${e.clientWidth/2}px`}}release(t){const{danmu:e,ref:i}=t;i&&e.$ref===i&&(i.style.cssText=this.owner.constructor.cssText,i.style.visibility="hidden",this.owner.$refs.push(i),e.$ref=null),t.ref=null}clear(){this.destroy(),this.owner.$refs=[],this.owner.$danmuku.textContent=""}destroy(){for(const t of this.nodes)t.parentElement&&t.parentElement.removeChild(t);for(const t of this.owner.queue)t.$ref=null;this.owner.$refs.length=0,this.nodes.clear()}}function u({target:t,visibles:e,clientWidth:i,clientHeight:n,marginBottom:s,marginTop:a,antiOverlap:r}){const o=n-s,l=e.filter(e=>e.mode===t.mode&&e.top<=o).sort((t,e)=>t.top-e.top);if(0===l.length)return 2===t.mode?o-t.height:a;if(l.unshift({type:"top",top:0,left:0,right:0,height:a,width:i,speed:0,distance:i}),l.push({type:"bottom",top:o,left:0,right:0,height:s,width:i,speed:0,distance:i}),2===t.mode)for(let h=l.length-2;h>=0;h-=1){const e=l[h],i=l[h+1],n=e.top+e.height;if(i.top-n>=t.height)return i.top-t.height}else for(let h=1;h=t.height)return n}const d=[];for(let h=1;h{const i=Math.min(...e.map(t=>t.right)),n=Math.min(...t.map(t=>t.right));return i*e.length-n*t.length});break;case 1:case 2:d.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return d[0][0].top}switch(t.mode){case 0:{const e=d.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}class m{constructor(){this.rows=new Set,this.waiting=new Set,this.visibility=()=>this.clear()}capture(t,e,i){const n=t.$player.ownerDocument;if(n!==this.document&&(this.document?.removeEventListener("visibilitychange",this.visibility),this.document=n,n?.addEventListener("visibilitychange",this.visibility),this.clear()),!Number.isFinite(i)||"hidden"===n?.visibilityState||t.art.video?.seeking)return this.clear(),e;const s=this.time,a=this.rows,r=this.waiting;if(this.time=i,this.rows=new Set(e),this.waiting=new Set(t.states.wait),void 0===s||i<=s)return e;const o=t.states.wait.filter(t=>r.has(t)&&!a.has(t)&&t.time>=s-.1&&t.time"ready"===t.$state),...o,...e.filter(t=>"ready"!==t.$state)]}clear(){this.time=void 0,this.rows.clear(),this.waiting.clear()}destroy(){this.document?.removeEventListener("visibilitychange",this.visibility),this.document=void 0,this.clear()}}class f{constructor(){this.pending=new Set,this.reserved=new Set}capture(t,e){for(const i of t)this.reserved.has(i)||e.has(i)||this.pending.add(i)}take(){const t=[],e=[];for(const n of this.pending)"ready"===n.$state?t.push(n):"wait"===n.$state&&e.push(n);this.pending.clear();const i=[...t,...e];return this.reserved=new Set(i),i}complete(){this.reserved.clear()}clear(){this.pending.clear(),this.reserved.clear()}}const g=Symbol("cancelled danmuku frame");class y{constructor(t){this.owner=t,this.generation=0,this.starts=0,this.frame=null,this.operation=null,this.closed=!1,this.running=!1,this.fault=!1,this.failedItems=new Set,this.buffer=new f,this.sampling=new m}active(t){const e=this.owner;return!this.closed&&!this.fault&&!e.art.isDestroy&&!e.isStop&&!e.isHide&&t.generation===this.generation}release(t){this.owner.renderer.release(t)}invalidate(){if(this.generation++,null!==this.frame&&window.cancelAnimationFrame(this.frame),this.frame=null,this.owner.timer=null,this.operation){const t=this.operation;this.operation=null,t.cancel(),this.release(t)}this.owner.workerClient?.cancel(),this.failedItems.clear(),this.buffer.clear(),this.sampling.clear()}report(t){try{this.owner.art.emit("artplayerPluginDanmuku:error",t)}catch(e){console.warn("Failed to report danmuku scheduling error:",e)}}fail(t){this.closed||this.fault||(this.fault=!0,this.invalidate(),this.report(t))}recover(){if(!this.closed&&!this.owner.art.isDestroy&&(this.failedItems.clear(),this.fault))try{this.owner.workerClient?.dispose(),this.owner.createWorker(),this.fault=!1}catch(t){this.report(t)}}schedule(){const t=this.owner;!this.running||this.closed||this.fault||t.art.isDestroy||t.isStop||null!==this.frame||(this.frame=window.requestAnimationFrame(()=>{if(this.frame=null,t.timer=null,this.closed||this.fault||t.isStop||t.art.isDestroy)return;const e=this.generation;try{if(t.art.playing&&!t.isHide){t.filter("emit",e=>{const i=Date.now();e.$restTime-=(i-e.$lastStartTime)/1e3,e.$lastStartTime=i,e.$restTime<=0&&t.makeWait(e)});const i=t.art.currentTime,n=t.readys;if(e!==this.generation)return;this.buffer.capture(this.sampling.capture(t,n,i),this.failedItems)}}catch(r){return void(e===this.generation&&this.fail(r))}if(this.schedule(),this.operation||!t.art.playing||t.isHide)return;const i=this.buffer.take();if(!i.length)return;let n;const s=new Promise(t=>n=()=>t(g)),a={generation:this.generation,cancel:n,wait:t=>Promise.race([t,s]),ref:null};return this.operation=a,this.run(a,i).catch(t=>{this.active(a)&&this.fail(t)}).finally(()=>{this.release(a),this.operation===a&&(this.operation=null,this.buffer.complete())})}),t.timer=this.frame)}async run(t,e){const i=this.owner;if(i.art.playing&&this.active(t))for(const s of e){if(!this.active(t))return;if(this.failedItems.has(s))continue;let e;try{e=await t.wait(i.option.beforeVisible(s))}catch(n){if(!this.active(t))return;this.failedItems.add(s),this.report(n);continue}if(!this.active(t))return;if(!e)continue;const{clientWidth:a,clientHeight:r}=i.$player,o=i.renderer.prepare(s,t);if(!this.active(t))return;s.$lastStartTime=Date.now(),s.$restTime=i.speed;const l=a+o.clientWidth,d={type:"getDanmuTop",target:{mode:s.mode,height:o.clientHeight,speed:l/s.$restTime},visibles:i.visibles,antiOverlap:i.option.antiOverlap,clientWidth:a,clientHeight:r,marginBottom:i.marginBottom,marginTop:i.marginTop},h=d.antiOverlap?await t.wait(i.postMessage(d)):{result:u(d)},c="symbol"===typeof h?void 0:h.result;if(!this.active(t)||s.$ref!==o)return;void 0!==c?(s.$lastStartTime=Date.now(),i.setState(s,"emit"),i.renderer.place(s,o,c,l,a),t.ref=null,i.art.emit("artplayerPluginDanmuku:visible",s)):(i.setState(s,"ready"),this.release(t))}}destroy(){this.closed=!0,this.invalidate(),this.sampling.destroy()}}let v=0;class w{constructor(t,e){this.pending=new Map,this.closed=!1,this.failed=!1,this.onFailure=e,this.worker=t();try{this.worker.onmessage=t=>{const e=this.pending.get(t.data?.id);e&&(this.pending.delete(t.data.id),e.resolve(t.data))},this.worker.onerror=t=>{t.preventDefault?.(),this.fail(t.error||t)},this.worker.onmessageerror=t=>this.fail(t.error||t)}catch(i){try{this.dispose()}catch{}throw i}}request(t){t.id=++v;const{id:e}=t;return this.closed||this.failed?Promise.resolve({id:e,result:void 0}):new Promise((i,n)=>{this.pending.set(e,{resolve:i,reject:n});try{this.worker.postMessage(t)}catch(s){this.fail(s)}})}fail(t){if(!this.closed&&!this.failed){this.failed=!0;for(const e of this.pending.values())e.reject(t);this.pending.clear();try{this.dispose()}catch{}this.onFailure(t)}}cancel(){for(const[t,e]of this.pending)e.resolve({id:t,result:void 0});this.pending.clear()}dispose(){if(this.closed)return;this.closed=!0,this.cancel();let t,e=!1;const i=i=>{try{i()}catch(n){e||(t=n),e=!0}};for(const n of["onmessage","onerror","onmessageerror"])i(()=>this.worker[n]=null);if(i(()=>this.worker.terminate()),e)throw t}}const k='/*!\n * artplayer-plugin-danmuku.js v5.3.0\n * Github: https://github.com/zhw2590582/ArtPlayer\n * (c) 2017-2026 Harvey Zhao\n * Released under the MIT License.\n */\nfunction t({target:t,visibles:e,clientWidth:i,clientHeight:h,marginBottom:n,marginTop:o,antiOverlap:s}){const r=h-n,p=e.filter(e=>e.mode===t.mode&&e.top<=r).sort((t,e)=>t.top-e.top);if(0===p.length)return 2===t.mode?r-t.height:o;if(p.unshift({type:"top",top:0,left:0,right:0,height:o,width:i,speed:0,distance:i}),p.push({type:"bottom",top:r,left:0,right:0,height:n,width:i,speed:0,distance:i}),2===t.mode)for(let g=p.length-2;g>=0;g-=1){const e=p[g],i=p[g+1],h=e.top+e.height;if(i.top-h>=t.height)return i.top-t.height}else for(let g=1;g=t.height)return h}const a=[];for(let g=1;g{const i=Math.min(...e.map(t=>t.right)),h=Math.min(...t.map(t=>t.right));return i*e.length-h*t.length});break;case 1:case 2:a.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return a[0][0].top}switch(t.mode){case 0:{const e=a.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}onmessage=e=>{const{data:i}=e;if(!i.id||!i.type)return;const h=(0,{getDanmuTop:t}[i.type])(i);globalThis.postMessage({result:h,id:i.id})};\n',x="undefined"!==typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",k],{type:"text/javascript;charset=utf-8"});function b(t){let e;try{if(e=x&&(self.URL||self.webkitURL).createObjectURL(x),!e)throw"";const i=new Worker(e,{type:"module",name:t?.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(i){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(k),{type:"module",name:t?.name})}}class ${constructor(t,e){const{constructor:i,template:n}=t;this.utils=i.utils,this.validator=i.validator,this.$danmuku=n.$danmuku,this.$player=n.$player,this.art=t,this.queue=[],this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.index=0,this.worker=null,this.workerClient=null,this.renderer=new p(this),this.scheduler=new y(this),this.option=$.option,this.states={wait:[],ready:[],emit:[],stop:[]},this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.resize=this.resize.bind(this),this.destroy=this.destroy.bind(this),this.seek=this.seek.bind(this),d(this),t.on("destroy",this.destroy);try{if(this.config(e,!0),!d(this))return;this.createWorker()}catch(s){throw t.off("destroy",this.destroy),h(this),this.scheduler.destroy(),s}t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("resize",this.resize),t.on("video:seeking",this.seek),this.load().catch(t=>console.warn("Failed to load initial danmuku:",t))}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,width:512,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,emitter:!0,maxLength:200,lockTime:5,theme:"dark",OPACITY:{},FONT_SIZE:{},MARGIN:{},SPEED:{},COLOR:[]}}static get scheme(){return{danmuku:"array|function|string|promise",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement|string",heatmap:"object|boolean",width:"number",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",emitter:"boolean",maxLength:"number",lockTime:"number",theme:"string",OPACITY:"object",FONT_SIZE:"object",MARGIN:"object",SPEED:"object",COLOR:"array"}}static get cssText(){return'\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n '}get isRotate(){return this.art.plugins?.autoOrientation?.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return $.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return $.option.margin[1]}get fontSize(){const{clamp:t}=this.utils,{clientHeight:e}=this.$player,i=this.option.fontSize;if("number"===typeof i)return Math.round(t(i,12,e));if("string"===typeof i&&i.endsWith("%")){const n=Number.parseFloat(i)/100;return Math.round(t(e*n,12,e))}return $.option.fontSize}get $ref(){return this.renderer.acquire()}get readys(){return function(t){const{currentTime:e}=t.art,i=[];return c(t,"ready",t=>i.push(t)),c(t,"wait",t=>{e+.1>=t.time&&t.time>=e-.1&&i.push(t)}),i}(this)}get visibles(){return this.renderer.visibles}get speed(){return this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed}async load(e){const{errorHandle:i}=this.utils,n=function(t,e){const i=l(t);if(e)for(const o of[...i.tasks])o.replace&&o.cancel();let n,s=i.closed||t.art.isDestroy;const a=new Promise(t=>n=t),r=new Set,d="function"===typeof AbortController?new AbortController:void 0,h={replace:e,signal:d?.signal,active:()=>!s&&!i.closed&&!t.art.isDestroy,onCancel:t=>h.active()?(r.add(t),()=>r.delete(t)):(t(),()=>{}),cancel(){if(!s){s=!0,n(o),d?.abort();for(const t of[...r])t();r.clear()}},wait:t=>Promise.race([t,a]),emit(e){i.emitting.push(h);try{return t.emit(e)}finally{i.emitting.pop()}},finish(){i.tasks.delete(h),r.clear()}};return s?n(o):i.tasks.add(h),h}(this,void 0===e);try{if(!n.active())return this;const s=function(e,i){return"function"===typeof e?{asynchronous:!0,value:e()}:t(e)?{asynchronous:!0,value:e}:"string"===typeof e?{asynchronous:!0,value:a(e,i)}:{asynchronous:!1,value:Array.isArray(e)?e:[]}}(e||this.option.danmuku,n),r=s.asynchronous?await n.wait(s.value):s.value;if(!n.active())return this;i(Array.isArray(r),"Danmuku need return an array as result");const o=r;if(void 0===e){if(this.reset(),!n.active())return this;this.queue=[],this.states={wait:[],ready:[],emit:[],stop:[]},this.renderer.clear()}for(let t=0;t{const i=a[e],n=r[e];return"function"===typeof i||"function"===typeof n||t(i)||t(n)?i!==n:JSON.stringify(i)!==JSON.stringify(n)}))&&!i)return this;const o=function(t,e,{defaults:i,validate:n,clamp:s,mount:a}){const r=Object.assign({},i,t,e);return n(r),r.mode=s(r.mode,0,2),r.speed=s(r.speed,1,10),r.opacity=s(r.opacity,0,1),r.lockTime=s(r.lockTime,1,60),r.maxLength=s(r.maxLength,1,1e3),r.mount=r.mount||a,r}(this.option,e,{defaults:$.option,validate:t=>this.validator(t,$.scheme),clamp:n,mount:s});if(!d(this))return this;const l=this.option.beforeVisible!==o.beforeVisible;return this.option=o,l&&(this.scheduler.invalidate(),this.scheduler.schedule()),e.fontSize&&(this.reset(),!d(this))||(this.option.visible?this.show():this.hide(),d(this)&&this.art.emit("artplayerPluginDanmuku:config",this.option)),this}getLeft(t){return this.renderer.left(t)}postMessage(t={}){return this.workerClient.request(t)}createWorker(){this.workerClient=new w(()=>new b,t=>this.scheduler.fail(t)),this.worker=this.workerClient.worker}filter(t,e){return c(this,t,e)}setState(t,e){!function(t,e,i){t.states[e.$state]=t.states[e.$state].filter(t=>t!==e),e.$state=i,e.$ref&&(e.$ref.dataset.state=i),t.states[i].push(e)}(this,t,e)}makeWait(t){this.renderer.makeWait(t)}update(){return this.scheduler.running=!0,this.scheduler.schedule(),this}resize(){this.renderer.resize()}continue(){return this.renderer.continue(),this}suspend(){return this.renderer.suspend(),this}stop(){return this.isStop=!0,this.scheduler.running=!1,this.scheduler.invalidate(),this.suspend(),this.art.emit("artplayerPluginDanmuku:stop"),this}start(){if(this.scheduler.closed||this.art.isDestroy)return this;const t=++this.scheduler.starts,e=this.scheduler.generation;this.isStop=!1,this.scheduler.recover();return this.scheduler.closed||this.art.isDestroy||this.isStop||this.scheduler.fault||e!==this.scheduler.generation||t!==this.scheduler.starts||(this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")),this}reset(){return this.scheduler.invalidate(),this.queue.forEach(t=>this.makeWait(t)),this.art.emit("artplayerPluginDanmuku:reset"),this.scheduler.recover(),this.scheduler.schedule(),this}seek(){this.scheduler.invalidate(),this.scheduler.schedule()}show(){return this.isHide=!1,this.$danmuku.style.opacity=1,this.option.visible=!0,this.art.emit("artplayerPluginDanmuku:show"),this}hide(){return this.isHide=!0,this.scheduler.invalidate(),this.$danmuku.style.opacity=0,this.option.visible=!1,this.art.emit("artplayerPluginDanmuku:hide"),this.scheduler.schedule(),this}destroy(){h(this),this.scheduler.destroy();try{try{this.stop()}finally{this.workerClient?.dispose()}}finally{this.renderer.destroy(),this.art.off("video:play",this.start),this.art.off("video:playing",this.start),this.art.off("video:pause",this.stop),this.art.off("video:waiting",this.stop),this.art.off("resize",this.resize),this.art.off("video:seeking",this.seek),this.art.off("destroy",this.destroy),this.art.emit("artplayerPluginDanmuku:destroy")}}}const M=4294967295;function S(t,e){let i=0,n=t.length;for(;iNumber.isFinite(t)&&t>0))return null;const r={xMin:0,xMax:t,yMin:0,yMax:128,scale:.25,opacity:.2,minHeight:Math.floor(.05*e),sampling:Math.max(1,Math.floor(t/100)),smoothing:.2,flattening:.2},o=Object.assign({},"object"===typeof s?s:{}),l=Object.assign({},r,o);for(const b of Object.keys(r))Number.isFinite(l[b])||(l[b]=r[b]);if(l.sampling<=0&&(l.sampling=r.sampling),l.xMin===l.xMax||l.yMin===l.yMax)return null;const d=Array.isArray(a)&&a.length>0,h=d?[...a]:function(t,e,i,n){if(!Number.isFinite(e)||e<=0||!Number.isFinite(i)||i<=0||!Number.isFinite(n)||n<=0||Math.floor(e/n)+1>M)return[];const s=t.map(t=>t.time).filter(t=>"number"===typeof t&&!Number.isNaN(t)).sort((t,e)=>t-e),a=[],r=i/e;if(!Number.isFinite(r))return[];for(let o=0;o<=e;o+=n){if(a.length>=M||o+n===o)return[];const t=o*r,e=(o+n)*r;a.push([o,S(s,e)-S(s,t)])}return a}(n,t,i,l.sampling);if(!h.length||!h.every(t=>Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])))return null;const c=h[h.length-1];if(c[0]!==t){if(h.length===M)return null;h.push([t,c[1]])}let p=1/0,u=-1/0;for(const b of h)p=Math.min(p,b[1]),u=Math.max(u,b[1]);const m=(p+u)/2;for(const b of h){const t=b[1];b[1]=t*(t>m?1+l.scale:1-l.scale)+l.minHeight}const f=!d&&!Number.isFinite(o.yMin)&&!Number.isFinite(o.yMax);let g=0;for(const b of h)g=Math.max(g,b[1]);const y=f&&g>r.yMax/4;y&&(l.yMax=4*g);const v=t=>y?Math.min(e,Math.max(.75*e,t)):t,w=(t,e,i,n)=>{const s=function(t,e){const i=e[0]-t[0],n=e[1]-t[1];return{length:Math.sqrt(i**2+n**2),angle:Math.atan2(n,i)}}(e||t,i||t),a=z(Math.cos(s.angle)*l.flattening,0,1,1,0),r=s.angle*a+(n?Math.PI:0),o=s.length*l.smoothing;return[t[0]+Math.cos(r)*o,v(t[1]+Math.sin(r)*o)]},k=h.map(i=>[z(i[0],l.xMin,l.xMax,0,t),v(z(i[1],l.yMin,l.yMax,e,0))]);if(!k.every(t=>t.every(Number.isFinite)))return null;const x=k.map((t,i,n)=>{if(0===i)return`M ${n[n.length-1][0]},${e} L ${t[0]},${e} L ${t[0]},${t[1]}`;const s=w(n[i-1],n[i-2],t),a=w(t,n[i-1],n[i+1],!0);return`C ${s[0]},${s[1]} ${a[0]},${a[1]} ${t[0]},${t[1]}${i===n.length-1?" z":""}`}).join(" ");return/NaN|Infinity/u.test(x)?null:{path:x,opacity:l.opacity,width:t,height:e}}let F=0;function C(t,e,i){if(t.isDestroy)return;const{query:n}=t.constructor.utils;let s;const a=[];let r,o,l,d=!1;const h=()=>!d&&!t.isDestroy;function c(e,i){const n=i;a.push([e,n]),t.on(e,n)}function p(e){if(d)return;let i;d=!0,o=null,l=null;let n=!1;const s=t=>{try{t()}catch(e){n||(i=e),n=!0}};for(const[r,o]of a.splice(0))s(()=>t.off(r,o));if(e&&r&&t.controls.heatmap===r&&s(()=>t.controls.remove("heatmap")),r=void 0,n)throw i}function u(t){h()&&o&&l&&(o.setAttribute("offset",100*t+"%"),l.setAttribute("offset",100*t+"%"))}function m(a){try{!function(a=[]){if(!h())return;o=null,l=null;const d=r;if(d.innerHTML="",t.option.isLive)return;const c=E({width:d.offsetWidth,height:d.offsetHeight,duration:t.duration,queue:e.queue,option:i,points:a});if(!c||!h())return;const p=d.ownerDocument;for(s||(s=p?"heatmap-solids":"heatmap-solids-"+ ++F);p?.getElementById(s);)s="heatmap-solids-"+ ++F;d.innerHTML=`\n \n \n \n \n \n \n \n \n \n \n \n `,o=n("#heatmap-start",d),l=n("#heatmap-stop",d),u(t.played)}(a)}catch(d){try{p(!0)}catch{}throw d}}c("destroy",()=>p(!0));try{t.controls.add({name:"heatmap",position:"top",html:"",style:{position:"absolute",top:"-100px",left:"0px",right:"0px",height:"100px",width:"100%",pointerEvents:"none"},beforeUnmount(){p(!1)},mounted(e){if(r=e,d)return t.controls.heatmap===e&&t.controls.remove("heatmap"),void(r=void 0);h()?(c("video:timeupdate",()=>u(t.played)),c("setBar",(t,e)=>{"played"===t&&u(e)}),c("ready",()=>m()),c("resize",()=>m()),c("artplayerPluginDanmuku:loaded",()=>m()),c("artplayerPluginDanmuku:points",t=>m(t))):p(!0)}})}catch(f){try{p(!0)}catch{}throw f}return()=>p(!0)}const D=new WeakMap;class T{constructor(t){this.art=t,this.closed=!1,this.disposers=new Set,this.cancelled=new Promise(t=>this.cancel=t)}get active(){return!this.closed&&!this.art.isDestroy}own(t){this.closed?t():this.disposers.add(t)}write(t,e,i,n=i=>t[e]=i){const s=t;if(!this.active)return;const a=()=>"function"===typeof s.getPropertyPriority?s.getPropertyPriority(e):void 0;let r=D.get(s);r||(r=new Map,D.set(s,r));let o=r.get(e);o||(o={original:s[e],present:e in s||void 0!==s[e],priority:a(),owners:new Map,apply:n},r.set(e,o)),o.owners.has(this)||this.own(()=>{const t=[...o.owners.keys()],i=t[t.length-1]===this;if(o.owners.delete(this),i&&s[e]===o.last&&a()===o.lastPriority){const t=[...o.owners.values()];t.length?(o.apply(t[t.length-1]),o.last=s[e],o.lastPriority=a()):void 0!==o.priority?s.setProperty(e,o.original,o.priority):o.present?o.apply(o.original):delete s[e]}o.owners.size||(r.delete(e),r.size||D.delete(s))}),o.owners.delete(this),o.owners.set(this,i),o.apply(i),o.last=s[e],o.lastPriority=a()}on(t,e){if(!this.active)return;const i=this;function n(...t){if(i.active)return e.apply(this,t)}const s=()=>this.art.off(t,n);this.own(s);try{this.art.on(t,n),this.active||s()}catch(a){throw this.release(s),a}}proxy(t,e,i){if(!this.active)return;const n=this;function s(...t){if(n.active)return i.apply(this,t)}let a;const r=()=>{if("function"===typeof a){const t=this.art.events;"function"===typeof t?.remove&&t.destroyEvents?.has(a)?t.remove(a):a()}else t.removeEventListener?.(e,s)};this.own(r);try{a=this.art.proxy(t,e,s),this.active||r()}catch(o){throw this.release(r),o}}wait(t){return Promise.race([t,this.cancelled])}release(t){try{t()}catch(e){console.warn("Failed to dispose danmuku setting resource:",e)}}close(){if(!this.closed){this.closed=!0,this.cancel();for(const t of this.disposers)this.release(t);this.disposers.clear()}}}function P({min:t,max:e,container:i,findIndex:n,onChange:s,steps:a=[]}){const{lifecycle:r}=this;if(!r.active)return{reset(){}};const{query:o,clamp:l,setStyle:d}=this.utils;d(i,"touch-action","none"),i.innerHTML=`\n

\n
\n ${a.map(()=>'
').join("")}\n
\n
\n
\n
\n
\n ${a.map(t=>t.hide?"":`
${t.name}
`).join("")}\n
\n `;const h=o(".apd-slider-dot",i),c=o(".apd-slider-progress",i);let p=!1;function u(i){if(!r.active)return;if(void 0===i&&(i=n()),ie)return;const o=(i-t)/(e-t);h.style.left=100*o+"%",0===a.length&&(c.style.width=h.style.left),s(i)}function m(n){const{top:s,height:a,left:r,width:o}=i.getBoundingClientRect();if(this.art.isRotate){const i=l(n.clientY-s,0,a);u(Math.round(i/a*(e-t)+t))}else{const i=l(n.clientX-r,0,o);u(Math.round(i/o*(e-t)+t))}}return r.own(()=>p=!1),r.proxy(i,"click",t=>{m.call(this,t)}),r.proxy(i,"pointerdown",t=>{p=0===t.button}),r.on("document:pointermove",t=>{p&&m.call(this,t)}),r.on("document:pointerup",t=>{p&&(p=!1,m.call(this,t))}),{reset:u}}const L='',A='',H='',O='',N='',V='',q='',I='',j='',B='',R='',Z='';function W(){const{option:t}=this;return`\n
\n ${R}${B}\n
\n
\n ${H}\n
\n
\n
\n \u6309\u7c7b\u578b\u5c4f\u853d\n
\n
\n ${O}${N}\n
\u6eda\u52a8
\n
\n
\n ${V}${q}\n
\u9876\u90e8
\n
\n
\n ${I}${j}\n
\u5e95\u90e8
\n
\n
\n
\n
\n
\n ${A}${L}\n \u9632\u6b62\u5f39\u5e55\u91cd\u53e0\n
\n
\n ${A}${L}\n \u540c\u6b65\u89c6\u9891\u901f\u5ea6\n
\n
\n
\n \u4e0d\u900f\u660e\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n \u663e\u793a\u533a\u57df\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u5b57\u53f7\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u901f\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n
\n
\n
\n
\n ${Z}\n
\n
\n
\n \u6a21\u5f0f\n
\n
\n ${N}\n
\u6eda\u52a8
\n
\n
\n ${q}\n
\u9876\u90e8
\n
\n
\n ${j}\n
\u5e95\u90e8
\n
\n
\n
\n
\n \u989c\u8272\n
\n ${this.COLOR.map(t=>`
`).join("")}\n
\n
\n
\n
\n
\n \n
\u53d1\u9001
\n
\n `}if("undefined"!==typeof document){const t="artplayer-plugin-danmuku",e=Symbol.for("artplayer-plugin-danmuku.pending-style"),i=document;let n=document.getElementById(t)||i[e];if(!n)if(n=document.createElement("style"),n.id=t,"loading"===document.readyState){i[e]=n;const s=()=>{document.removeEventListener("DOMContentLoaded",s),i[e]===n&&delete i[e];const a=document.getElementById(t);a?a.textContent=n.textContent:(document.head||document.documentElement).appendChild(n)};document.addEventListener("DOMContentLoaded",s,{once:!0})}else(document.head||document.documentElement).appendChild(n);n.textContent='.artplayer-plugin-danmuku{display:flex;position:relative;z-index:99;align-items:center;justify-content:center;font-size:12px;height:32px;width:100%;color:#fff;font-weight:300;flex-shrink:0;gap:10px}.artplayer-plugin-danmuku .apd-icon{cursor:pointer;opacity:.75;transition:all .2s ease;fill:#fff}.artplayer-plugin-danmuku .apd-icon:hover{opacity:1}.artplayer-plugin-danmuku .apd-config{display:flex;position:relative}.artplayer-plugin-danmuku .apd-config .apd-config-panel{position:absolute;bottom:24px;left:0;width:320px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-config .apd-config-panel .apd-config-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-config:hover .apd-config-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-config-mode,.artplayer-plugin-danmuku .apd-config-slider,.artplayer-plugin-danmuku .apd-config-other,.artplayer-plugin-danmuku .apd-style-mode{margin-bottom:15px}.artplayer-plugin-danmuku .apd-modes{display:flex;align-items:center;margin-top:5px;gap:20px}.artplayer-plugin-danmuku .apd-modes .apd-mode{cursor:pointer;text-align:center}.artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-config-slider{display:flex;align-items:center;gap:12px}.artplayer-plugin-danmuku .apd-config-slider .apd-value{width:32px;text-align:right}.artplayer-plugin-danmuku .apd-slider{position:relative;flex:1;display:flex;height:20px;align-items:center;justify-content:center;cursor:pointer}.artplayer-plugin-danmuku .apd-slider .apd-slider-line{position:relative;height:2px;width:100%;overflow:hidden;border-radius:3px;background-color:#ffffff40}.artplayer-plugin-danmuku .apd-slider .apd-slider-points{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}.artplayer-plugin-danmuku .apd-slider .apd-slider-points .apd-slider-point{width:2px;height:2px;border-radius:50%;background-color:#ffffff80}.artplayer-plugin-danmuku .apd-slider .apd-slider-progress{width:0%;height:100%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-dot{position:absolute;transform:translate(-6px);left:0%;width:12px;height:12px;border-radius:50%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps{display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:-12px;width:calc(100% + 32px);color:#777}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps .apd-slider-step{flex-shrink:0;width:36px;text-align:center;scale:.95}.artplayer-plugin-danmuku .apd-config-other{display:flex;align-items:center;gap:20px}.artplayer-plugin-danmuku .apd-config-other .apd-check-off,.artplayer-plugin-danmuku .apd-config-other .apd-check-on{width:16px;height:16px}.artplayer-plugin-danmuku .apd-config-other .apd-other{display:flex;align-items:center;cursor:pointer;gap:2px}.artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-emitter{display:flex;flex:1;align-items:center;height:100%;background-color:#ffffff40;border-radius:5px}.artplayer-plugin-danmuku .apd-style{position:relative;display:flex;align-items:center;justify-content:center}.artplayer-plugin-danmuku .apd-style .apd-style-panel{position:absolute;bottom:24px;left:0;width:200px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-style .apd-style-panel .apd-style-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-style:hover .apd-style-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-colors{display:flex;flex-wrap:wrap;margin-top:5px;gap:8px}.artplayer-plugin-danmuku .apd-colors .apd-color{width:16px;height:16px;border-radius:2px;cursor:pointer}.artplayer-plugin-danmuku .apd-colors .apd-color.apd-active{border:1px solid black;box-shadow:0 0 0 1px #fff}.artplayer-plugin-danmuku .apd-input{outline:none;height:100%;flex:1;min-width:0;width:auto;border:none;line-height:1;color:#fff;background-color:transparent}.artplayer-plugin-danmuku .apd-input::placeholder{color:#ffffff80}.artplayer-plugin-danmuku .apd-send{display:flex;align-items:center;justify-content:center;height:100%;width:60px;flex-shrink:0;cursor:pointer;text-shadow:none;border-top-right-radius:5px;border-bottom-right-radius:5px;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-send.apd-lock{cursor:not-allowed;color:#666;background-color:#e7e7e7}.art-controls-center .apd-emitter{width:260px;flex:none}.art-fullscreen .artplayer-plugin-danmuku,.art-fullscreen-web .artplayer-plugin-danmuku{height:38px;gap:16px}.art-fullscreen .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen-web .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-on,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-on{width:28px;height:28px}.art-fullscreen .artplayer-plugin-danmuku .apd-emitter,.art-fullscreen-web .artplayer-plugin-danmuku .apd-emitter{width:400px;flex:none}.art-video-player>.artplayer-plugin-danmuku{position:absolute;left:0;right:0;bottom:-40px;padding:0 10px}.art-video-player:has(>.artplayer-plugin-danmuku){margin-bottom:40px}[data-danmuku-emitter=false] .apd-emitter{display:none!important}[data-danmuku-emitter=false] .art-controls-center .artplayer-plugin-danmuku{justify-content:flex-end;gap:18px}[data-danmuku-emitter=false].art-fullscreen .art-controls-center .artplayer-plugin-danmuku,[data-danmuku-emitter=false].art-fullscreen-web .art-controls-center .artplayer-plugin-danmuku{gap:24px}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-icon{fill:#333}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-emitter{background-color:#f1f2f3}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input{color:#000}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input::placeholder{color:#0000004d}[data-danmuku-visible=false] .apd-toggle-off{display:block}[data-danmuku-visible=false] .apd-toggle-on,[data-danmuku-visible=true] .apd-toggle-off{display:none}[data-danmuku-visible=true] .apd-toggle-on{display:block}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-on{display:none}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-off,[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-on{display:block}[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-off,[data-danmuku-sync-video=false] .apd-sync-video .apd-check-on{display:none}[data-danmuku-sync-video=false] .apd-sync-video .apd-check-off,[data-danmuku-sync-video=true] .apd-sync-video .apd-check-on{display:block}[data-danmuku-sync-video=true] .apd-sync-video .apd-check-off{display:none}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-off{display:block}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-on{display:none}[data-danmuku-mode0=false] .art-danmuku [data-mode="0"]{opacity:0!important}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-off{display:none}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-on{display:block}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"]{color:#00a1d6}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"] path{fill:#00a1d6}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-off{display:block}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-on{display:none}[data-danmuku-mode1=false] .art-danmuku [data-mode="1"]{opacity:0!important}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-off{display:none}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-on{display:block}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"]{color:#00a1d6}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"] path{fill:#00a1d6}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-off{display:block}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-on{display:none}[data-danmuku-mode2=false] .art-danmuku [data-mode="2"]{opacity:0!important}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-off{display:none}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-on{display:block}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"]{color:#00a1d6}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"] path{fill:#00a1d6}'}class _{constructor(t,e){this.art=t,this.danmuku=e,this.utils=t.constructor.utils;const{setStyle:i}=this.utils,{$controlsCenter:n}=t.template;this.template={$controlsCenter:n,$mount:n,$danmuku:null,$toggle:null,$config:null,$configPanel:null,$configModes:null,$style:null,$stylePanel:null,$styleModes:null,$colors:null,$opacitySlider:null,$opacityValue:null,$marginSlider:null,$marginValue:null,$fontSizeSlider:null,$fontSizeValue:null,$speedSlider:null,$speedValue:null,$input:null,$send:null},this.slider={opacity:null,margin:null,fontSize:null,speed:null},this.emitting=!1,this.isLock=!1,this.timer=null,this.lifecycle=new T(t),this.destroy=this.destroy.bind(this),this.lifecycle.own(()=>t.off("destroy",this.destroy));try{if(t.on("destroy",this.destroy),!this.lifecycle.active)return;if(this.lifecycle.write(n.style,"display","flex",t=>i(n,"display",t)),this.createTemplate(),!this.lifecycle.active)return;if(this.createSliders(),!this.lifecycle.active)return;if(this.createEvents(),this.mount(this.option.mount),!this.lifecycle.active)return;this.lifecycle.on("resize",()=>this.resize()),this.lifecycle.on("fullscreen",t=>this.onFullscreen(t)),this.lifecycle.on("fullscreenWeb",t=>this.onFullscreen(t)),this.lifecycle.proxy(this.template.$config,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$config,$panel:this.template.$configPanel})}),this.lifecycle.proxy(this.template.$style,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$style,$panel:this.template.$stylePanel})})}catch(s){try{this.destroy()}catch(a){console.warn("Failed to roll back danmuku setting:",a)}throw s}}static get icons(){return{$on:R,$off:B,$config:H,$style:Z,$mode_0_off:O,$mode_0_on:N,$mode_1_off:V,$mode_1_on:q,$mode_2_off:I,$mode_2_on:j,$check_on:A,$check_off:L}}get option(){return this.danmuku.option}get outside(){return this.template.$mount!==this.template.$controlsCenter}get TEMPLATE(){return W.call(this)}get OPACITY(){return{min:0,max:100,steps:[],...this.option.OPACITY}}get FONT_SIZE(){return{min:12,max:120,steps:[],...this.option.FONT_SIZE}}get MARGIN(){return{min:0,max:3,steps:[{name:"1/4",value:[10,"75%"]},{name:"\u534a\u5c4f",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"\u6ee1\u5c4f",value:[10,10]}],...this.option.MARGIN}}get SPEED(){return{min:0,max:4,steps:[{name:"\u6781\u6162",value:10},{name:"\u8f83\u6162",value:7.5,hide:!0},{name:"\u9002\u4e2d",value:5},{name:"\u8f83\u5feb",value:2.5,hide:!0},{name:"\u6781\u5feb",value:1}],...this.option.SPEED}}get COLOR(){return this.option.COLOR.length?this.option.COLOR:["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(t){const{query:e}=this.utils,{$danmuku:i}=this.template;return e(t,i)}append(t,e){if(!this.lifecycle.active)return;const{append:i}=this.utils;[...t.children].includes(e)||i(t,e)}setData(t,e){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,{$mount:n}=this.template;this.lifecycle.write(i.dataset,t,e),this.outside&&this.lifecycle.write(n.dataset,t,e)}createTemplate(){const{createElement:t,tooltip:e}=this.utils,i=t("div");this.template.$danmuku=i,i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$toggle=this.query(".apd-toggle"),this.template.$config=this.query(".apd-config"),this.template.$configPanel=this.query(".apd-config-panel"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$style=this.query(".apd-style"),this.template.$stylePanel=this.query(".apd-style-panel"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send");const{$toggle:n}=this.template;this.lifecycle.on("artplayerPluginDanmuku:show",()=>{e(n,"\u5173\u95ed\u5f39\u5e55")}),this.lifecycle.on("artplayerPluginDanmuku:hide",()=>{e(n,"\u6253\u5f00\u5f39\u5e55")})}createEvents(){const{$toggle:t,$configModes:e,$styleModes:i,$colors:n,$antiOverlap:s,$syncVideo:a,$send:r,$input:o}=this.template;this.lifecycle.proxy(t,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.lifecycle.proxy(e,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(t=>t!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.lifecycle.proxy(s,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.lifecycle.proxy(a,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.lifecycle.proxy(i,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.lifecycle.proxy(n,"click",t=>{const e=t.target.closest(".apd-color");e&&(this.danmuku.config({color:e.dataset.color}),this.reset())}),this.lifecycle.proxy(r,"click",()=>this.emit()),this.lifecycle.proxy(o,"keypress",t=>{"Enter"===t.key&&(t.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider({...this.OPACITY,container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:t=>{const{$opacityValue:e}=this.template;e.textContent=`${t}%`,this.danmuku.config({opacity:t/100})}}),this.slider.margin=this.createSlider({...this.MARGIN,container:this.template.$marginSlider,findIndex:()=>this.MARGIN.steps.findIndex(t=>t.value[0]===this.option.margin[0]&&t.value[1]===this.option.margin[1]),onChange:t=>{const e=this.MARGIN.steps[t];if(!e)return;const{$marginValue:i}=this.template;i.textContent=e.name,this.danmuku.config({margin:e.value})}}),this.slider.fontSize=this.createSlider({...this.FONT_SIZE,container:this.template.$fontSizeSlider,findIndex:()=>this.danmuku.fontSize,onChange:t=>{const{$fontSizeValue:e}=this.template;e.textContent=`${t}px`,t!==this.danmuku.fontSize&&this.danmuku.config({fontSize:t})}}),this.slider.speed=this.createSlider({...this.SPEED,container:this.template.$speedSlider,findIndex:()=>this.SPEED.steps.findIndex(t=>t.value===this.option.speed),onChange:t=>{const e=this.SPEED.steps[t];if(!e)return;const{$speedValue:i}=this.template;i.textContent=e.name,this.danmuku.config({speed:e.value})}})}createSlider(t){return P.call(this,t)}onFullscreen(t){if(!this.lifecycle.active)return;const{$danmuku:e,$controlsCenter:i,$mount:n}=this.template;this.outside?t?this.append(i,e):this.append(n,e):this.append(i,e)}onMouseEnter({$control:t,$panel:e}){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),r=s.width/2-n.width/2,o=a.left-(n.left-r),l=n.right+r-a.right;e.style.left=o>0?`${-r+o}px`:l>0?-r-l+"px":-r+"px"}emit(){return async function(t){const{lifecycle:e,template:{$input:i}}=t;if(!e.active)return;const n=i.value.trim();if(!n.length||t.isLock||t.emitting)return;const s={text:n,mode:t.option.mode,color:t.option.color,time:t.art.currentTime},a=t=>{e.active&&console.error("Error emitting danmuku:",t)};try{t.emitting=!0;const n=await e.wait(t.option.beforeEmit(s));if(!e.active)return;if(t.emitting=!1,!0!==n)return;if(s.border=!0,delete s.time,Promise.resolve(t.danmuku.emit(s)).catch(a),!e.active)return;i.value="",t.lock()}catch(r){a(r),e.active&&(t.emitting=!1)}}(this)}lock(){!function(t){if(!t.lifecycle.active)return;const{addClass:e}=t.utils,{$send:i}=t.template;clearTimeout(t.timer),t.isLock=!0;let n=t.option.lockTime;i.textContent=n,e(i,"apd-lock");const s=()=>{t.timer=setTimeout(()=>{t.lifecycle.active&&(0===n?t.unlock():(n-=1,i.textContent=n,s()))},1e3)};s()}(this)}unlock(){!function(t){if(clearTimeout(t.timer),t.timer=null,t.isLock=!1,!t.lifecycle.active)return;const{removeClass:e}=t.utils,{$send:i}=t.template;i.textContent="\u53d1\u9001",e(i,"apd-lock")}(this)}resize(){if(!this.lifecycle.active)return;if(this.outside)return;if(this.art.fullscreen)return;if(this.art.fullscreenWeb)return;const{$player:t,$controlsCenter:e}=this.art.template,{$danmuku:i}=this.template;this.art.widtht.dataset.color===this.option.color.toUpperCase());a&&t(a,"apd-active"),e(i,this.option.visible?"\u5173\u95ed\u5f39\u5e55":"\u6253\u5f00\u5f39\u5e55"),this.resize()}mount(t){if(!this.lifecycle.active)return;const{errorHandle:e}=this.utils,i="string"===typeof t?document.querySelector(t):t;e(i,`Can not find the mount point: ${t}`),this.append(i,this.template.$danmuku),this.template.$mount=i,this.reset()}destroy(){if(this.lifecycle.closed)return;this.lifecycle.close(),clearTimeout(this.timer),this.timer=null,this.emitting=!1,this.isLock=!1;const t=this.template.$danmuku;t?.parentElement&&t.parentElement.removeChild(t)}}function U(t){return e=>{const i=new $(e,t);let n;try{n=e.isDestroy?void 0:new _(e,i),!e.isDestroy&&i.option.heatmap&&C(e,i,i.option.heatmap)}catch(s){try{n?.destroy()}catch{}try{i.destroy()}catch{}throw s}return{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:n?n.mount.bind(n):()=>{},get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}return U.icons=_.icons,U}); +!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.artplayerPluginDanmuku=e(),define(function(){return t.artplayerPluginDanmuku})):(t="undefined"!==typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";function t(t){return t instanceof Promise||"[object Promise]"===Object.prototype.toString.call(t)}function e(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:return 2;case 5:return 1}}function i(t){if("string"!==typeof t)return[];const i=t.matchAll(/]*?p="(?

[^"]+)"[^>]*>(?.*?)<\/d>/gs);return Array.from(i).map(t=>{const i=t.groups.p.split(",");if(i.length>=8){return{text:t.groups.text.trim().replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&"),time:Number(i[0]),mode:e(Number(i[1])),fontSize:Number(i[2]),color:`#${Number(i[3]).toString(16)}`,timestamp:Number(i[4]),pool:Number(i[5]),userID:i[6],rowID:Number(i[7])}}return null}).filter(Boolean)}function n({data:t}){const{xml:e,id:n}=t,s=i(e);globalThis.postMessage({danmus:s,id:n})}let s=0;function a(t,{signal:a,onCancel:r}={}){return new Promise((o,l)=>{let d,h,c,p=!1;const u=++s,m=()=>g(void 0,function(t){if(void 0!==t?.reason)return t.reason;const e=new Error("Bilibili Danmu loading cancelled");return e.name="AbortError",e}(a));function f(){let t,e=!1;try{if(d){const t=d;d=void 0,t.onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate()}}catch(i){t=i,e=!0}if(void 0!==h){const n=h;h=void 0;try{URL.revokeObjectURL(n)}catch(i){e||(t=i),e=!0}}if(e)throw t}function g(t,e){if(p)return;p=!0;let i=arguments.length>1;a?.removeEventListener("abort",m),c?.();try{f()}catch(n){i||(e=n),i=!0}i?l(e):o(t)}function y(t,e){if(!p){console.error("Error parsing Bilibili Danmu:",e);try{g(i(t))}catch(n){g(void 0,n)}}}a?.aborted?m():(a?.addEventListener("abort",m),c=r?.(m),p?c?.():async function(){const s=a?await fetch(t,{signal:a}):await fetch(t);if(p)return;const r=await s.text();if(!p)try{const t=`\n ${e.toString()}\n ${i.toString()}\n onmessage = ${n.toString()}\n `;if(h=URL.createObjectURL(new Blob([t],{type:"application/javascript"})),p)return void f();if(d=new Worker(h),p)return void f();d.onmessage=t=>{if(p||t.data?.id!==u)return;const{danmus:e}=t.data;Array.isArray(e)?g(e):g(void 0,new Error("Invalid Bilibili Danmu worker response"))},d.onerror=t=>{t.preventDefault?.(),y(r,t.error||t)},d.onmessageerror=t=>y(r,t.error||t),d.postMessage({xml:r,id:u})}catch(o){y(r,o)}}().catch(t=>g(void 0,t)))})}const r=new WeakMap,o=Symbol("cancelled danmuku input");function l(t){return r.has(t)||r.set(t,{closed:!1,tasks:new Set,emitting:[]}),r.get(t)}function d(t){const e=l(t),i=e.emitting[e.emitting.length-1];return!e.closed&&!t.art.isDestroy&&(!i||i.active())}function h(t){const e=l(t);e.closed=!0;for(const i of[...e.tasks])i.cancel()}function c(t,e,i){const n=t.states[e]||[];for(let s=0;s{const s=n.$ref.offsetTop,a=this.owner.getLeft(n.$ref)-i,r=n.$ref.clientHeight,o=n.$ref.clientWidth,l=a+o,d=e-l,h=l/n.$restTime,c={};c.top=s,c.left=a,c.height=r,c.width=o,c.right=d,c.speed=h,c.distance=l,c.time=n.$restTime,c.mode=n.mode,t.push(c)}),t}left(t){const e=t.getBoundingClientRect();return this.owner.isRotate?e.top:e.left}makeWait(t){this.owner.setState(t,"wait"),t.$ref&&(t.$ref.style.cssText=this.owner.constructor.cssText,t.$ref.style.visibility="hidden",t.$ref.style.marginLeft="0px",t.$ref.style.transform="translateX(0px)",t.$ref.style.transition="transform 0s linear 0s",this.owner.$refs.push(t.$ref),t.$ref=null)}resize(){const{clientWidth:t}=this.owner.$player;this.owner.filter("stop",e=>{if(0===e.mode)e.$ref.style.left=`${t}px`}),this.owner.filter("emit",e=>{switch(e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.left=`${t}px`,e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}})}continue(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("stop",e=>{switch(this.owner.setState(e,"emit"),e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}}),this}suspend(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("emit",e=>{switch(this.owner.setState(e,"stop"),e.mode){case 0:{const i=t-(this.owner.getLeft(e.$ref)-this.owner.getLeft(this.owner.$player));e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition="transform 0s linear 0s";break}}}),this}prepare(t,e){const i=this.owner,n=i.$ref;return e.danmu=t,e.ref=n,t.$ref=n,n.textContent=t.text,i.$danmuku.appendChild(n),n.style.opacity=i.option.opacity,n.style.fontSize=`${i.fontSize}px`,n.style.color=t.color,n.style.border=t.border?`1px solid ${t.color}`:null,n.style.backgroundColor=t.border?"rgb(0 0 0 / 50%)":null,i.utils.setStyles(n,t.style),n}place(t,e,i,n,s){switch(e.style.top=`${i}px`,e.style.visibility="visible",e.dataset.mode=t.mode,e.dataset.id=t.id||"",t.mode){case 0:e.style.left=`${s}px`,e.style.marginLeft="0px",e.style.transform=`translateX(${-n}px)`,e.style.transition=`transform ${t.$restTime}s linear 0s`;break;case 1:case 2:e.style.left="50%",e.style.marginLeft=`-${e.clientWidth/2}px`}}release(t){const{danmu:e,ref:i}=t;i&&e.$ref===i&&(i.style.cssText=this.owner.constructor.cssText,i.style.visibility="hidden",this.owner.$refs.push(i),e.$ref=null),t.ref=null}clear(){this.destroy(),this.owner.$refs=[],this.owner.$danmuku.textContent=""}destroy(){for(const t of this.nodes)t.parentElement&&t.parentElement.removeChild(t);for(const t of this.owner.queue)t.$ref=null;this.owner.$refs.length=0,this.nodes.clear()}}function u({target:t,visibles:e,clientWidth:i,clientHeight:n,marginBottom:s,marginTop:a,antiOverlap:r}){const o=n-s,l=e.filter(e=>e.mode===t.mode&&e.top<=o).sort((t,e)=>t.top-e.top);if(0===l.length)return 2===t.mode?o-t.height:a;if(l.unshift({type:"top",top:0,left:0,right:0,height:a,width:i,speed:0,distance:i}),l.push({type:"bottom",top:o,left:0,right:0,height:s,width:i,speed:0,distance:i}),2===t.mode)for(let h=l.length-2;h>=0;h-=1){const e=l[h],i=l[h+1],n=e.top+e.height;if(i.top-n>=t.height)return i.top-t.height}else for(let h=1;h=t.height)return n}const d=[];for(let h=1;h{const i=Math.min(...e.map(t=>t.right)),n=Math.min(...t.map(t=>t.right));return i*e.length-n*t.length});break;case 1:case 2:d.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return d[0][0].top}switch(t.mode){case 0:{const e=d.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}class m{constructor(){this.rows=new Set,this.waiting=new Set,this.visibility=()=>this.clear()}begin(t){void 0===this.time&&this.capture(t,[],t.art.currentTime)}capture(t,e,i){const n=t.$player.ownerDocument;if(n!==this.document&&(this.document?.removeEventListener("visibilitychange",this.visibility),this.document=n,n?.addEventListener("visibilitychange",this.visibility),this.clear()),!Number.isFinite(i)||"hidden"===n?.visibilityState||t.art.video?.seeking)return this.clear(),e;const s=this.time,a=this.rows,r=this.waiting;if(this.time=i,this.rows=new Set(e),this.waiting=new Set(t.states.wait),void 0===s||i<=s)return e;const o=t.states.wait.filter(t=>r.has(t)&&!a.has(t)&&t.time>=s-.1&&t.time"ready"===t.$state),...o,...e.filter(t=>"ready"!==t.$state)]}clear(){this.time=void 0,this.rows.clear(),this.waiting.clear()}destroy(){this.document?.removeEventListener("visibilitychange",this.visibility),this.document=void 0,this.clear()}}class f{constructor(){this.pending=new Set,this.reserved=new Set}capture(t,e){for(const i of t)this.reserved.has(i)||e.has(i)||this.pending.add(i)}take(){const t=[],e=[];for(const n of this.pending)"ready"===n.$state?t.push(n):"wait"===n.$state&&e.push(n);this.pending.clear();const i=[...t,...e];return this.reserved=new Set(i),i}complete(){this.reserved.clear()}clear(){this.pending.clear(),this.reserved.clear()}}const g=Symbol("cancelled danmuku frame");class y{constructor(t){this.owner=t,this.generation=0,this.starts=0,this.frame=null,this.operation=null,this.closed=!1,this.running=!1,this.fault=!1,this.failedItems=new Set,this.buffer=new f,this.sampling=new m}active(t){const e=this.owner;return!this.closed&&!this.fault&&!e.art.isDestroy&&!e.isStop&&!e.isHide&&t.generation===this.generation}release(t){this.owner.renderer.release(t)}invalidate(){if(this.generation++,null!==this.frame&&window.cancelAnimationFrame(this.frame),this.frame=null,this.owner.timer=null,this.operation){const t=this.operation;this.operation=null,t.cancel(),this.release(t)}this.owner.workerClient?.cancel(),this.failedItems.clear(),this.buffer.clear(),this.sampling.clear()}report(t){try{this.owner.art.emit("artplayerPluginDanmuku:error",t)}catch(e){console.warn("Failed to report danmuku scheduling error:",e)}}fail(t){this.closed||this.fault||(this.fault=!0,this.invalidate(),this.report(t))}recover(){if(!this.closed&&!this.owner.art.isDestroy&&(this.failedItems.clear(),this.fault))try{this.owner.workerClient?.dispose(),this.owner.createWorker(),this.fault=!1}catch(t){this.report(t)}}schedule(){const t=this.owner;if(!(!this.running||this.closed||this.fault||t.art.isDestroy||t.isStop)){try{const e=t.art.video;(t.art.playing||!1===e?.paused&&!e.ended&&e.readyState>2)&&!t.isHide&&this.sampling.begin(t)}catch(e){return void this.fail(e)}null===this.frame&&(this.frame=window.requestAnimationFrame(()=>{if(this.frame=null,t.timer=null,this.closed||this.fault||t.isStop||t.art.isDestroy)return;const i=this.generation;try{if(t.art.playing&&!t.isHide){t.filter("emit",e=>{const i=Date.now();e.$restTime-=(i-e.$lastStartTime)/1e3,e.$lastStartTime=i,e.$restTime<=0&&t.makeWait(e)});const e=t.art.currentTime,n=t.readys;if(i!==this.generation)return;this.buffer.capture(this.sampling.capture(t,n,e),this.failedItems)}}catch(e){return void(i===this.generation&&this.fail(e))}if(this.schedule(),this.operation||!t.art.playing||t.isHide)return;const n=this.buffer.take();if(!n.length)return;let s;const a=new Promise(t=>s=()=>t(g)),r={generation:this.generation,cancel:s,wait:t=>Promise.race([t,a]),ref:null};return this.operation=r,this.run(r,n).catch(t=>{this.active(r)&&this.fail(t)}).finally(()=>{this.release(r),this.operation===r&&(this.operation=null,this.buffer.complete())})}),t.timer=this.frame)}}async run(t,e){const i=this.owner;if(i.art.playing&&this.active(t))for(const s of e){if(!this.active(t))return;if(this.failedItems.has(s))continue;let e;try{e=await t.wait(i.option.beforeVisible(s))}catch(n){if(!this.active(t))return;this.failedItems.add(s),this.report(n);continue}if(!this.active(t))return;if(!e)continue;const{clientWidth:a,clientHeight:r}=i.$player,o=i.renderer.prepare(s,t);if(!this.active(t))return;s.$lastStartTime=Date.now(),s.$restTime=i.speed;const l=a+o.clientWidth,d={type:"getDanmuTop",target:{mode:s.mode,height:o.clientHeight,speed:l/s.$restTime},visibles:i.visibles,antiOverlap:i.option.antiOverlap,clientWidth:a,clientHeight:r,marginBottom:i.marginBottom,marginTop:i.marginTop},h=d.antiOverlap?await t.wait(i.postMessage(d)):{result:u(d)},c="symbol"===typeof h?void 0:h.result;if(!this.active(t)||s.$ref!==o)return;void 0!==c?(s.$lastStartTime=Date.now(),i.setState(s,"emit"),i.renderer.place(s,o,c,l,a),t.ref=null,i.art.emit("artplayerPluginDanmuku:visible",s)):(i.setState(s,"ready"),this.release(t))}}destroy(){this.closed=!0,this.invalidate(),this.sampling.destroy()}}let v=0;class w{constructor(t,e){this.pending=new Map,this.closed=!1,this.failed=!1,this.onFailure=e,this.worker=t();try{this.worker.onmessage=t=>{const e=this.pending.get(t.data?.id);e&&(this.pending.delete(t.data.id),e.resolve(t.data))},this.worker.onerror=t=>{t.preventDefault?.(),this.fail(t.error||t)},this.worker.onmessageerror=t=>this.fail(t.error||t)}catch(i){try{this.dispose()}catch{}throw i}}request(t){t.id=++v;const{id:e}=t;return this.closed||this.failed?Promise.resolve({id:e,result:void 0}):new Promise((i,n)=>{this.pending.set(e,{resolve:i,reject:n});try{this.worker.postMessage(t)}catch(s){this.fail(s)}})}fail(t){if(!this.closed&&!this.failed){this.failed=!0;for(const e of this.pending.values())e.reject(t);this.pending.clear();try{this.dispose()}catch{}this.onFailure(t)}}cancel(){for(const[t,e]of this.pending)e.resolve({id:t,result:void 0});this.pending.clear()}dispose(){if(this.closed)return;this.closed=!0,this.cancel();let t,e=!1;const i=i=>{try{i()}catch(n){e||(t=n),e=!0}};for(const n of["onmessage","onerror","onmessageerror"])i(()=>this.worker[n]=null);if(i(()=>this.worker.terminate()),e)throw t}}const k='/*!\n * artplayer-plugin-danmuku.js v5.3.0\n * Github: https://github.com/zhw2590582/ArtPlayer\n * (c) 2017-2026 Harvey Zhao\n * Released under the MIT License.\n */\nfunction t({target:t,visibles:e,clientWidth:i,clientHeight:h,marginBottom:n,marginTop:o,antiOverlap:s}){const r=h-n,p=e.filter(e=>e.mode===t.mode&&e.top<=r).sort((t,e)=>t.top-e.top);if(0===p.length)return 2===t.mode?r-t.height:o;if(p.unshift({type:"top",top:0,left:0,right:0,height:o,width:i,speed:0,distance:i}),p.push({type:"bottom",top:r,left:0,right:0,height:n,width:i,speed:0,distance:i}),2===t.mode)for(let g=p.length-2;g>=0;g-=1){const e=p[g],i=p[g+1],h=e.top+e.height;if(i.top-h>=t.height)return i.top-t.height}else for(let g=1;g=t.height)return h}const a=[];for(let g=1;g{const i=Math.min(...e.map(t=>t.right)),h=Math.min(...t.map(t=>t.right));return i*e.length-h*t.length});break;case 1:case 2:a.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return a[0][0].top}switch(t.mode){case 0:{const e=a.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}onmessage=e=>{const{data:i}=e;if(!i.id||!i.type)return;const h=(0,{getDanmuTop:t}[i.type])(i);globalThis.postMessage({result:h,id:i.id})};\n',x="undefined"!==typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",k],{type:"text/javascript;charset=utf-8"});function b(t){let e;try{if(e=x&&(self.URL||self.webkitURL).createObjectURL(x),!e)throw"";const i=new Worker(e,{type:"module",name:t?.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(i){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(k),{type:"module",name:t?.name})}}class ${constructor(t,e){const{constructor:i,template:n}=t;this.utils=i.utils,this.validator=i.validator,this.$danmuku=n.$danmuku,this.$player=n.$player,this.art=t,this.queue=[],this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.index=0,this.worker=null,this.workerClient=null,this.renderer=new p(this),this.scheduler=new y(this),this.option=$.option,this.states={wait:[],ready:[],emit:[],stop:[]},this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.resize=this.resize.bind(this),this.destroy=this.destroy.bind(this),this.seek=this.seek.bind(this),d(this),t.on("destroy",this.destroy);try{if(this.config(e,!0),!d(this))return;this.createWorker()}catch(s){throw t.off("destroy",this.destroy),h(this),this.scheduler.destroy(),s}t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("resize",this.resize),t.on("video:seeking",this.seek),this.load().catch(t=>console.warn("Failed to load initial danmuku:",t))}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,width:512,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,emitter:!0,maxLength:200,lockTime:5,theme:"dark",OPACITY:{},FONT_SIZE:{},MARGIN:{},SPEED:{},COLOR:[]}}static get scheme(){return{danmuku:"array|function|string|promise",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement|string",heatmap:"object|boolean",width:"number",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",emitter:"boolean",maxLength:"number",lockTime:"number",theme:"string",OPACITY:"object",FONT_SIZE:"object",MARGIN:"object",SPEED:"object",COLOR:"array"}}static get cssText(){return'\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n '}get isRotate(){return this.art.plugins?.autoOrientation?.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return $.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return $.option.margin[1]}get fontSize(){const{clamp:t}=this.utils,{clientHeight:e}=this.$player,i=this.option.fontSize;if("number"===typeof i)return Math.round(t(i,12,e));if("string"===typeof i&&i.endsWith("%")){const n=Number.parseFloat(i)/100;return Math.round(t(e*n,12,e))}return $.option.fontSize}get $ref(){return this.renderer.acquire()}get readys(){return function(t){const{currentTime:e}=t.art,i=[];return c(t,"ready",t=>i.push(t)),c(t,"wait",t=>{e+.1>=t.time&&t.time>=e-.1&&i.push(t)}),i}(this)}get visibles(){return this.renderer.visibles}get speed(){return this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed}async load(e){const{errorHandle:i}=this.utils,n=function(t,e){const i=l(t);if(e)for(const o of[...i.tasks])o.replace&&o.cancel();let n,s=i.closed||t.art.isDestroy;const a=new Promise(t=>n=t),r=new Set,d="function"===typeof AbortController?new AbortController:void 0,h={replace:e,signal:d?.signal,active:()=>!s&&!i.closed&&!t.art.isDestroy,onCancel:t=>h.active()?(r.add(t),()=>r.delete(t)):(t(),()=>{}),cancel(){if(!s){s=!0,n(o),d?.abort();for(const t of[...r])t();r.clear()}},wait:t=>Promise.race([t,a]),emit(e){i.emitting.push(h);try{return t.emit(e)}finally{i.emitting.pop()}},finish(){i.tasks.delete(h),r.clear()}};return s?n(o):i.tasks.add(h),h}(this,void 0===e);try{if(!n.active())return this;const s=function(e,i){return"function"===typeof e?{asynchronous:!0,value:e()}:t(e)?{asynchronous:!0,value:e}:"string"===typeof e?{asynchronous:!0,value:a(e,i)}:{asynchronous:!1,value:Array.isArray(e)?e:[]}}(e||this.option.danmuku,n),r=s.asynchronous?await n.wait(s.value):s.value;if(!n.active())return this;i(Array.isArray(r),"Danmuku need return an array as result");const o=r;if(void 0===e){if(this.reset(),!n.active())return this;this.queue=[],this.states={wait:[],ready:[],emit:[],stop:[]},this.renderer.clear()}for(let t=0;t{const i=a[e],n=r[e];return"function"===typeof i||"function"===typeof n||t(i)||t(n)?i!==n:JSON.stringify(i)!==JSON.stringify(n)}))&&!i)return this;const o=function(t,e,{defaults:i,validate:n,clamp:s,mount:a}){const r=Object.assign({},i,t,e);return n(r),r.mode=s(r.mode,0,2),r.speed=s(r.speed,1,10),r.opacity=s(r.opacity,0,1),r.lockTime=s(r.lockTime,1,60),r.maxLength=s(r.maxLength,1,1e3),r.mount=r.mount||a,r}(this.option,e,{defaults:$.option,validate:t=>this.validator(t,$.scheme),clamp:n,mount:s});if(!d(this))return this;const l=this.option.beforeVisible!==o.beforeVisible;return this.option=o,l&&(this.scheduler.invalidate(),this.scheduler.schedule()),e.fontSize&&(this.reset(),!d(this))||(this.option.visible?this.show():this.hide(),d(this)&&this.art.emit("artplayerPluginDanmuku:config",this.option)),this}getLeft(t){return this.renderer.left(t)}postMessage(t={}){return this.workerClient.request(t)}createWorker(){this.workerClient=new w(()=>new b,t=>this.scheduler.fail(t)),this.worker=this.workerClient.worker}filter(t,e){return c(this,t,e)}setState(t,e){!function(t,e,i){t.states[e.$state]=t.states[e.$state].filter(t=>t!==e),e.$state=i,e.$ref&&(e.$ref.dataset.state=i),t.states[i].push(e)}(this,t,e)}makeWait(t){this.renderer.makeWait(t)}update(){return this.scheduler.running=!0,this.scheduler.schedule(),this}resize(){this.renderer.resize()}continue(){return this.renderer.continue(),this}suspend(){return this.renderer.suspend(),this}stop(){return this.isStop=!0,this.scheduler.running=!1,this.scheduler.invalidate(),this.suspend(),this.art.emit("artplayerPluginDanmuku:stop"),this}start(){if(this.scheduler.closed||this.art.isDestroy)return this;const t=++this.scheduler.starts,e=this.scheduler.generation;this.isStop=!1,this.scheduler.recover();return this.scheduler.closed||this.art.isDestroy||this.isStop||this.scheduler.fault||e!==this.scheduler.generation||t!==this.scheduler.starts||(this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")),this}reset(){return this.scheduler.invalidate(),this.queue.forEach(t=>this.makeWait(t)),this.art.emit("artplayerPluginDanmuku:reset"),this.scheduler.recover(),this.scheduler.schedule(),this}seek(){this.scheduler.invalidate(),this.scheduler.schedule()}show(){return this.isHide=!1,this.$danmuku.style.opacity=1,this.option.visible=!0,this.art.emit("artplayerPluginDanmuku:show"),this}hide(){return this.isHide=!0,this.scheduler.invalidate(),this.$danmuku.style.opacity=0,this.option.visible=!1,this.art.emit("artplayerPluginDanmuku:hide"),this.scheduler.schedule(),this}destroy(){h(this),this.scheduler.destroy();try{try{this.stop()}finally{this.workerClient?.dispose()}}finally{this.renderer.destroy(),this.art.off("video:play",this.start),this.art.off("video:playing",this.start),this.art.off("video:pause",this.stop),this.art.off("video:waiting",this.stop),this.art.off("resize",this.resize),this.art.off("video:seeking",this.seek),this.art.off("destroy",this.destroy),this.art.emit("artplayerPluginDanmuku:destroy")}}}const M=4294967295;function S(t,e){let i=0,n=t.length;for(;iNumber.isFinite(t)&&t>0))return null;const r={xMin:0,xMax:t,yMin:0,yMax:128,scale:.25,opacity:.2,minHeight:Math.floor(.05*e),sampling:Math.max(1,Math.floor(t/100)),smoothing:.2,flattening:.2},o=Object.assign({},"object"===typeof s?s:{}),l=Object.assign({},r,o);for(const b of Object.keys(r))Number.isFinite(l[b])||(l[b]=r[b]);if(l.sampling<=0&&(l.sampling=r.sampling),l.xMin===l.xMax||l.yMin===l.yMax)return null;const d=Array.isArray(a)&&a.length>0,h=d?[...a]:function(t,e,i,n){if(!Number.isFinite(e)||e<=0||!Number.isFinite(i)||i<=0||!Number.isFinite(n)||n<=0||Math.floor(e/n)+1>M)return[];const s=t.map(t=>t.time).filter(t=>"number"===typeof t&&!Number.isNaN(t)).sort((t,e)=>t-e),a=[],r=i/e;if(!Number.isFinite(r))return[];for(let o=0;o<=e;o+=n){if(a.length>=M||o+n===o)return[];const t=o*r,e=(o+n)*r;a.push([o,S(s,e)-S(s,t)])}return a}(n,t,i,l.sampling);if(!h.length||!h.every(t=>Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])))return null;const c=h[h.length-1];if(c[0]!==t){if(h.length===M)return null;h.push([t,c[1]])}let p=1/0,u=-1/0;for(const b of h)p=Math.min(p,b[1]),u=Math.max(u,b[1]);const m=(p+u)/2;for(const b of h){const t=b[1];b[1]=t*(t>m?1+l.scale:1-l.scale)+l.minHeight}const f=!d&&!Number.isFinite(o.yMin)&&!Number.isFinite(o.yMax);let g=0;for(const b of h)g=Math.max(g,b[1]);const y=f&&g>r.yMax/4;y&&(l.yMax=4*g);const v=t=>y?Math.min(e,Math.max(.75*e,t)):t,w=(t,e,i,n)=>{const s=function(t,e){const i=e[0]-t[0],n=e[1]-t[1];return{length:Math.sqrt(i**2+n**2),angle:Math.atan2(n,i)}}(e||t,i||t),a=z(Math.cos(s.angle)*l.flattening,0,1,1,0),r=s.angle*a+(n?Math.PI:0),o=s.length*l.smoothing;return[t[0]+Math.cos(r)*o,v(t[1]+Math.sin(r)*o)]},k=h.map(i=>[z(i[0],l.xMin,l.xMax,0,t),v(z(i[1],l.yMin,l.yMax,e,0))]);if(!k.every(t=>t.every(Number.isFinite)))return null;const x=k.map((t,i,n)=>{if(0===i)return`M ${n[n.length-1][0]},${e} L ${t[0]},${e} L ${t[0]},${t[1]}`;const s=w(n[i-1],n[i-2],t),a=w(t,n[i-1],n[i+1],!0);return`C ${s[0]},${s[1]} ${a[0]},${a[1]} ${t[0]},${t[1]}${i===n.length-1?" z":""}`}).join(" ");return/NaN|Infinity/u.test(x)?null:{path:x,opacity:l.opacity,width:t,height:e}}let F=0;function C(t,e,i){if(t.isDestroy)return;const{query:n}=t.constructor.utils;let s;const a=[];let r,o,l,d=!1;const h=()=>!d&&!t.isDestroy;function c(e,i){const n=i;a.push([e,n]),t.on(e,n)}function p(e){if(d)return;let i;d=!0,o=null,l=null;let n=!1;const s=t=>{try{t()}catch(e){n||(i=e),n=!0}};for(const[r,o]of a.splice(0))s(()=>t.off(r,o));if(e&&r&&t.controls.heatmap===r&&s(()=>t.controls.remove("heatmap")),r=void 0,n)throw i}function u(t){h()&&o&&l&&(o.setAttribute("offset",100*t+"%"),l.setAttribute("offset",100*t+"%"))}function m(a){try{!function(a=[]){if(!h())return;o=null,l=null;const d=r;if(d.innerHTML="",t.option.isLive)return;const c=E({width:d.offsetWidth,height:d.offsetHeight,duration:t.duration,queue:e.queue,option:i,points:a});if(!c||!h())return;const p=d.ownerDocument;for(s||(s=p?"heatmap-solids":"heatmap-solids-"+ ++F);p?.getElementById(s);)s="heatmap-solids-"+ ++F;d.innerHTML=`\n \n \n \n \n \n \n \n \n \n \n \n `,o=n("#heatmap-start",d),l=n("#heatmap-stop",d),u(t.played)}(a)}catch(d){try{p(!0)}catch{}throw d}}c("destroy",()=>p(!0));try{t.controls.add({name:"heatmap",position:"top",html:"",style:{position:"absolute",top:"-100px",left:"0px",right:"0px",height:"100px",width:"100%",pointerEvents:"none"},beforeUnmount(){p(!1)},mounted(e){if(r=e,d)return t.controls.heatmap===e&&t.controls.remove("heatmap"),void(r=void 0);h()?(c("video:timeupdate",()=>u(t.played)),c("setBar",(t,e)=>{"played"===t&&u(e)}),c("ready",()=>m()),c("resize",()=>m()),c("artplayerPluginDanmuku:loaded",()=>m()),c("artplayerPluginDanmuku:points",t=>m(t))):p(!0)}})}catch(f){try{p(!0)}catch{}throw f}return()=>p(!0)}const D=new WeakMap;class T{constructor(t){this.art=t,this.closed=!1,this.disposers=new Set,this.cancelled=new Promise(t=>this.cancel=t)}get active(){return!this.closed&&!this.art.isDestroy}own(t){this.closed?t():this.disposers.add(t)}write(t,e,i,n=i=>t[e]=i){const s=t;if(!this.active)return;const a=()=>"function"===typeof s.getPropertyPriority?s.getPropertyPriority(e):void 0;let r=D.get(s);r||(r=new Map,D.set(s,r));let o=r.get(e);o||(o={original:s[e],present:e in s||void 0!==s[e],priority:a(),owners:new Map,apply:n},r.set(e,o)),o.owners.has(this)||this.own(()=>{const t=[...o.owners.keys()],i=t[t.length-1]===this;if(o.owners.delete(this),i&&s[e]===o.last&&a()===o.lastPriority){const t=[...o.owners.values()];t.length?(o.apply(t[t.length-1]),o.last=s[e],o.lastPriority=a()):void 0!==o.priority?s.setProperty(e,o.original,o.priority):o.present?o.apply(o.original):delete s[e]}o.owners.size||(r.delete(e),r.size||D.delete(s))}),o.owners.delete(this),o.owners.set(this,i),o.apply(i),o.last=s[e],o.lastPriority=a()}on(t,e){if(!this.active)return;const i=this;function n(...t){if(i.active)return e.apply(this,t)}const s=()=>this.art.off(t,n);this.own(s);try{this.art.on(t,n),this.active||s()}catch(a){throw this.release(s),a}}proxy(t,e,i){if(!this.active)return;const n=this;function s(...t){if(n.active)return i.apply(this,t)}let a;const r=()=>{if("function"===typeof a){const t=this.art.events;"function"===typeof t?.remove&&t.destroyEvents?.has(a)?t.remove(a):a()}else t.removeEventListener?.(e,s)};this.own(r);try{a=this.art.proxy(t,e,s),this.active||r()}catch(o){throw this.release(r),o}}wait(t){return Promise.race([t,this.cancelled])}release(t){try{t()}catch(e){console.warn("Failed to dispose danmuku setting resource:",e)}}close(){if(!this.closed){this.closed=!0,this.cancel();for(const t of this.disposers)this.release(t);this.disposers.clear()}}}function P({min:t,max:e,container:i,findIndex:n,onChange:s,steps:a=[]}){const{lifecycle:r}=this;if(!r.active)return{reset(){}};const{query:o,clamp:l,setStyle:d}=this.utils;d(i,"touch-action","none"),i.innerHTML=`\n

\n
\n ${a.map(()=>'
').join("")}\n
\n
\n
\n
\n
\n ${a.map(t=>t.hide?"":`
${t.name}
`).join("")}\n
\n `;const h=o(".apd-slider-dot",i),c=o(".apd-slider-progress",i);let p=!1;function u(i){if(!r.active)return;if(void 0===i&&(i=n()),ie)return;const o=(i-t)/(e-t);h.style.left=100*o+"%",0===a.length&&(c.style.width=h.style.left),s(i)}function m(n){const{top:s,height:a,left:r,width:o}=i.getBoundingClientRect();if(this.art.isRotate){const i=l(n.clientY-s,0,a);u(Math.round(i/a*(e-t)+t))}else{const i=l(n.clientX-r,0,o);u(Math.round(i/o*(e-t)+t))}}return r.own(()=>p=!1),r.proxy(i,"click",t=>{m.call(this,t)}),r.proxy(i,"pointerdown",t=>{p=0===t.button}),r.on("document:pointermove",t=>{p&&m.call(this,t)}),r.on("document:pointerup",t=>{p&&(p=!1,m.call(this,t))}),{reset:u}}const L='',A='',H='',O='',N='',V='',q='',I='',j='',B='',R='',Z='';function W(){const{option:t}=this;return`\n
\n ${R}${B}\n
\n
\n ${H}\n
\n
\n
\n \u6309\u7c7b\u578b\u5c4f\u853d\n
\n
\n ${O}${N}\n
\u6eda\u52a8
\n
\n
\n ${V}${q}\n
\u9876\u90e8
\n
\n
\n ${I}${j}\n
\u5e95\u90e8
\n
\n
\n
\n
\n
\n ${A}${L}\n \u9632\u6b62\u5f39\u5e55\u91cd\u53e0\n
\n
\n ${A}${L}\n \u540c\u6b65\u89c6\u9891\u901f\u5ea6\n
\n
\n
\n \u4e0d\u900f\u660e\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n \u663e\u793a\u533a\u57df\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u5b57\u53f7\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u901f\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n
\n
\n
\n
\n ${Z}\n
\n
\n
\n \u6a21\u5f0f\n
\n
\n ${N}\n
\u6eda\u52a8
\n
\n
\n ${q}\n
\u9876\u90e8
\n
\n
\n ${j}\n
\u5e95\u90e8
\n
\n
\n
\n
\n \u989c\u8272\n
\n ${this.COLOR.map(t=>`
`).join("")}\n
\n
\n
\n
\n
\n \n
\u53d1\u9001
\n
\n `}if("undefined"!==typeof document){const t="artplayer-plugin-danmuku",e=Symbol.for("artplayer-plugin-danmuku.pending-style"),i=document;let n=document.getElementById(t)||i[e];if(!n)if(n=document.createElement("style"),n.id=t,"loading"===document.readyState){i[e]=n;const s=()=>{document.removeEventListener("DOMContentLoaded",s),i[e]===n&&delete i[e];const a=document.getElementById(t);a?a.textContent=n.textContent:(document.head||document.documentElement).appendChild(n)};document.addEventListener("DOMContentLoaded",s,{once:!0})}else(document.head||document.documentElement).appendChild(n);n.textContent='.artplayer-plugin-danmuku{display:flex;position:relative;z-index:99;align-items:center;justify-content:center;font-size:12px;height:32px;width:100%;color:#fff;font-weight:300;flex-shrink:0;gap:10px}.artplayer-plugin-danmuku .apd-icon{cursor:pointer;opacity:.75;transition:all .2s ease;fill:#fff}.artplayer-plugin-danmuku .apd-icon:hover{opacity:1}.artplayer-plugin-danmuku .apd-config{display:flex;position:relative}.artplayer-plugin-danmuku .apd-config .apd-config-panel{position:absolute;bottom:24px;left:0;width:320px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-config .apd-config-panel .apd-config-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-config:hover .apd-config-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-config-mode,.artplayer-plugin-danmuku .apd-config-slider,.artplayer-plugin-danmuku .apd-config-other,.artplayer-plugin-danmuku .apd-style-mode{margin-bottom:15px}.artplayer-plugin-danmuku .apd-modes{display:flex;align-items:center;margin-top:5px;gap:20px}.artplayer-plugin-danmuku .apd-modes .apd-mode{cursor:pointer;text-align:center}.artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-config-slider{display:flex;align-items:center;gap:12px}.artplayer-plugin-danmuku .apd-config-slider .apd-value{width:32px;text-align:right}.artplayer-plugin-danmuku .apd-slider{position:relative;flex:1;display:flex;height:20px;align-items:center;justify-content:center;cursor:pointer}.artplayer-plugin-danmuku .apd-slider .apd-slider-line{position:relative;height:2px;width:100%;overflow:hidden;border-radius:3px;background-color:#ffffff40}.artplayer-plugin-danmuku .apd-slider .apd-slider-points{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}.artplayer-plugin-danmuku .apd-slider .apd-slider-points .apd-slider-point{width:2px;height:2px;border-radius:50%;background-color:#ffffff80}.artplayer-plugin-danmuku .apd-slider .apd-slider-progress{width:0%;height:100%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-dot{position:absolute;transform:translate(-6px);left:0%;width:12px;height:12px;border-radius:50%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps{display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:-12px;width:calc(100% + 32px);color:#777}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps .apd-slider-step{flex-shrink:0;width:36px;text-align:center;scale:.95}.artplayer-plugin-danmuku .apd-config-other{display:flex;align-items:center;gap:20px}.artplayer-plugin-danmuku .apd-config-other .apd-check-off,.artplayer-plugin-danmuku .apd-config-other .apd-check-on{width:16px;height:16px}.artplayer-plugin-danmuku .apd-config-other .apd-other{display:flex;align-items:center;cursor:pointer;gap:2px}.artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-emitter{display:flex;flex:1;align-items:center;height:100%;background-color:#ffffff40;border-radius:5px}.artplayer-plugin-danmuku .apd-style{position:relative;display:flex;align-items:center;justify-content:center}.artplayer-plugin-danmuku .apd-style .apd-style-panel{position:absolute;bottom:24px;left:0;width:200px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-style .apd-style-panel .apd-style-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-style:hover .apd-style-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-colors{display:flex;flex-wrap:wrap;margin-top:5px;gap:8px}.artplayer-plugin-danmuku .apd-colors .apd-color{width:16px;height:16px;border-radius:2px;cursor:pointer}.artplayer-plugin-danmuku .apd-colors .apd-color.apd-active{border:1px solid black;box-shadow:0 0 0 1px #fff}.artplayer-plugin-danmuku .apd-input{outline:none;height:100%;flex:1;min-width:0;width:auto;border:none;line-height:1;color:#fff;background-color:transparent}.artplayer-plugin-danmuku .apd-input::placeholder{color:#ffffff80}.artplayer-plugin-danmuku .apd-send{display:flex;align-items:center;justify-content:center;height:100%;width:60px;flex-shrink:0;cursor:pointer;text-shadow:none;border-top-right-radius:5px;border-bottom-right-radius:5px;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-send.apd-lock{cursor:not-allowed;color:#666;background-color:#e7e7e7}.art-controls-center .apd-emitter{width:260px;flex:none}.art-fullscreen .artplayer-plugin-danmuku,.art-fullscreen-web .artplayer-plugin-danmuku{height:38px;gap:16px}.art-fullscreen .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen-web .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-on,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-on{width:28px;height:28px}.art-fullscreen .artplayer-plugin-danmuku .apd-emitter,.art-fullscreen-web .artplayer-plugin-danmuku .apd-emitter{width:400px;flex:none}.art-video-player>.artplayer-plugin-danmuku{position:absolute;left:0;right:0;bottom:-40px;padding:0 10px}.art-video-player:has(>.artplayer-plugin-danmuku){margin-bottom:40px}[data-danmuku-emitter=false] .apd-emitter{display:none!important}[data-danmuku-emitter=false] .art-controls-center .artplayer-plugin-danmuku{justify-content:flex-end;gap:18px}[data-danmuku-emitter=false].art-fullscreen .art-controls-center .artplayer-plugin-danmuku,[data-danmuku-emitter=false].art-fullscreen-web .art-controls-center .artplayer-plugin-danmuku{gap:24px}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-icon{fill:#333}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-emitter{background-color:#f1f2f3}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input{color:#000}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input::placeholder{color:#0000004d}[data-danmuku-visible=false] .apd-toggle-off{display:block}[data-danmuku-visible=false] .apd-toggle-on,[data-danmuku-visible=true] .apd-toggle-off{display:none}[data-danmuku-visible=true] .apd-toggle-on{display:block}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-on{display:none}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-off,[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-on{display:block}[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-off,[data-danmuku-sync-video=false] .apd-sync-video .apd-check-on{display:none}[data-danmuku-sync-video=false] .apd-sync-video .apd-check-off,[data-danmuku-sync-video=true] .apd-sync-video .apd-check-on{display:block}[data-danmuku-sync-video=true] .apd-sync-video .apd-check-off{display:none}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-off{display:block}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-on{display:none}[data-danmuku-mode0=false] .art-danmuku [data-mode="0"]{opacity:0!important}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-off{display:none}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-on{display:block}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"]{color:#00a1d6}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"] path{fill:#00a1d6}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-off{display:block}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-on{display:none}[data-danmuku-mode1=false] .art-danmuku [data-mode="1"]{opacity:0!important}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-off{display:none}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-on{display:block}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"]{color:#00a1d6}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"] path{fill:#00a1d6}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-off{display:block}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-on{display:none}[data-danmuku-mode2=false] .art-danmuku [data-mode="2"]{opacity:0!important}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-off{display:none}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-on{display:block}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"]{color:#00a1d6}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"] path{fill:#00a1d6}'}class _{constructor(t,e){this.art=t,this.danmuku=e,this.utils=t.constructor.utils;const{setStyle:i}=this.utils,{$controlsCenter:n}=t.template;this.template={$controlsCenter:n,$mount:n,$danmuku:null,$toggle:null,$config:null,$configPanel:null,$configModes:null,$style:null,$stylePanel:null,$styleModes:null,$colors:null,$opacitySlider:null,$opacityValue:null,$marginSlider:null,$marginValue:null,$fontSizeSlider:null,$fontSizeValue:null,$speedSlider:null,$speedValue:null,$input:null,$send:null},this.slider={opacity:null,margin:null,fontSize:null,speed:null},this.emitting=!1,this.isLock=!1,this.timer=null,this.lifecycle=new T(t),this.destroy=this.destroy.bind(this),this.lifecycle.own(()=>t.off("destroy",this.destroy));try{if(t.on("destroy",this.destroy),!this.lifecycle.active)return;if(this.lifecycle.write(n.style,"display","flex",t=>i(n,"display",t)),this.createTemplate(),!this.lifecycle.active)return;if(this.createSliders(),!this.lifecycle.active)return;if(this.createEvents(),this.mount(this.option.mount),!this.lifecycle.active)return;this.lifecycle.on("resize",()=>this.resize()),this.lifecycle.on("fullscreen",t=>this.onFullscreen(t)),this.lifecycle.on("fullscreenWeb",t=>this.onFullscreen(t)),this.lifecycle.proxy(this.template.$config,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$config,$panel:this.template.$configPanel})}),this.lifecycle.proxy(this.template.$style,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$style,$panel:this.template.$stylePanel})})}catch(s){try{this.destroy()}catch(a){console.warn("Failed to roll back danmuku setting:",a)}throw s}}static get icons(){return{$on:R,$off:B,$config:H,$style:Z,$mode_0_off:O,$mode_0_on:N,$mode_1_off:V,$mode_1_on:q,$mode_2_off:I,$mode_2_on:j,$check_on:A,$check_off:L}}get option(){return this.danmuku.option}get outside(){return this.template.$mount!==this.template.$controlsCenter}get TEMPLATE(){return W.call(this)}get OPACITY(){return{min:0,max:100,steps:[],...this.option.OPACITY}}get FONT_SIZE(){return{min:12,max:120,steps:[],...this.option.FONT_SIZE}}get MARGIN(){return{min:0,max:3,steps:[{name:"1/4",value:[10,"75%"]},{name:"\u534a\u5c4f",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"\u6ee1\u5c4f",value:[10,10]}],...this.option.MARGIN}}get SPEED(){return{min:0,max:4,steps:[{name:"\u6781\u6162",value:10},{name:"\u8f83\u6162",value:7.5,hide:!0},{name:"\u9002\u4e2d",value:5},{name:"\u8f83\u5feb",value:2.5,hide:!0},{name:"\u6781\u5feb",value:1}],...this.option.SPEED}}get COLOR(){return this.option.COLOR.length?this.option.COLOR:["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(t){const{query:e}=this.utils,{$danmuku:i}=this.template;return e(t,i)}append(t,e){if(!this.lifecycle.active)return;const{append:i}=this.utils;[...t.children].includes(e)||i(t,e)}setData(t,e){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,{$mount:n}=this.template;this.lifecycle.write(i.dataset,t,e),this.outside&&this.lifecycle.write(n.dataset,t,e)}createTemplate(){const{createElement:t,tooltip:e}=this.utils,i=t("div");this.template.$danmuku=i,i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$toggle=this.query(".apd-toggle"),this.template.$config=this.query(".apd-config"),this.template.$configPanel=this.query(".apd-config-panel"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$style=this.query(".apd-style"),this.template.$stylePanel=this.query(".apd-style-panel"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send");const{$toggle:n}=this.template;this.lifecycle.on("artplayerPluginDanmuku:show",()=>{e(n,"\u5173\u95ed\u5f39\u5e55")}),this.lifecycle.on("artplayerPluginDanmuku:hide",()=>{e(n,"\u6253\u5f00\u5f39\u5e55")})}createEvents(){const{$toggle:t,$configModes:e,$styleModes:i,$colors:n,$antiOverlap:s,$syncVideo:a,$send:r,$input:o}=this.template;this.lifecycle.proxy(t,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.lifecycle.proxy(e,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(t=>t!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.lifecycle.proxy(s,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.lifecycle.proxy(a,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.lifecycle.proxy(i,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.lifecycle.proxy(n,"click",t=>{const e=t.target.closest(".apd-color");e&&(this.danmuku.config({color:e.dataset.color}),this.reset())}),this.lifecycle.proxy(r,"click",()=>this.emit()),this.lifecycle.proxy(o,"keypress",t=>{"Enter"===t.key&&(t.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider({...this.OPACITY,container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:t=>{const{$opacityValue:e}=this.template;e.textContent=`${t}%`,this.danmuku.config({opacity:t/100})}}),this.slider.margin=this.createSlider({...this.MARGIN,container:this.template.$marginSlider,findIndex:()=>this.MARGIN.steps.findIndex(t=>t.value[0]===this.option.margin[0]&&t.value[1]===this.option.margin[1]),onChange:t=>{const e=this.MARGIN.steps[t];if(!e)return;const{$marginValue:i}=this.template;i.textContent=e.name,this.danmuku.config({margin:e.value})}}),this.slider.fontSize=this.createSlider({...this.FONT_SIZE,container:this.template.$fontSizeSlider,findIndex:()=>this.danmuku.fontSize,onChange:t=>{const{$fontSizeValue:e}=this.template;e.textContent=`${t}px`,t!==this.danmuku.fontSize&&this.danmuku.config({fontSize:t})}}),this.slider.speed=this.createSlider({...this.SPEED,container:this.template.$speedSlider,findIndex:()=>this.SPEED.steps.findIndex(t=>t.value===this.option.speed),onChange:t=>{const e=this.SPEED.steps[t];if(!e)return;const{$speedValue:i}=this.template;i.textContent=e.name,this.danmuku.config({speed:e.value})}})}createSlider(t){return P.call(this,t)}onFullscreen(t){if(!this.lifecycle.active)return;const{$danmuku:e,$controlsCenter:i,$mount:n}=this.template;this.outside?t?this.append(i,e):this.append(n,e):this.append(i,e)}onMouseEnter({$control:t,$panel:e}){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),r=s.width/2-n.width/2,o=a.left-(n.left-r),l=n.right+r-a.right;e.style.left=o>0?`${-r+o}px`:l>0?-r-l+"px":-r+"px"}emit(){return async function(t){const{lifecycle:e,template:{$input:i}}=t;if(!e.active)return;const n=i.value.trim();if(!n.length||t.isLock||t.emitting)return;const s={text:n,mode:t.option.mode,color:t.option.color,time:t.art.currentTime},a=t=>{e.active&&console.error("Error emitting danmuku:",t)};try{t.emitting=!0;const n=await e.wait(t.option.beforeEmit(s));if(!e.active)return;if(t.emitting=!1,!0!==n)return;if(s.border=!0,delete s.time,Promise.resolve(t.danmuku.emit(s)).catch(a),!e.active)return;i.value="",t.lock()}catch(r){a(r),e.active&&(t.emitting=!1)}}(this)}lock(){!function(t){if(!t.lifecycle.active)return;const{addClass:e}=t.utils,{$send:i}=t.template;clearTimeout(t.timer),t.isLock=!0;let n=t.option.lockTime;i.textContent=n,e(i,"apd-lock");const s=()=>{t.timer=setTimeout(()=>{t.lifecycle.active&&(0===n?t.unlock():(n-=1,i.textContent=n,s()))},1e3)};s()}(this)}unlock(){!function(t){if(clearTimeout(t.timer),t.timer=null,t.isLock=!1,!t.lifecycle.active)return;const{removeClass:e}=t.utils,{$send:i}=t.template;i.textContent="\u53d1\u9001",e(i,"apd-lock")}(this)}resize(){if(!this.lifecycle.active)return;if(this.outside)return;if(this.art.fullscreen)return;if(this.art.fullscreenWeb)return;const{$player:t,$controlsCenter:e}=this.art.template,{$danmuku:i}=this.template;this.art.widtht.dataset.color===this.option.color.toUpperCase());a&&t(a,"apd-active"),e(i,this.option.visible?"\u5173\u95ed\u5f39\u5e55":"\u6253\u5f00\u5f39\u5e55"),this.resize()}mount(t){if(!this.lifecycle.active)return;const{errorHandle:e}=this.utils,i="string"===typeof t?document.querySelector(t):t;e(i,`Can not find the mount point: ${t}`),this.append(i,this.template.$danmuku),this.template.$mount=i,this.reset()}destroy(){if(this.lifecycle.closed)return;this.lifecycle.close(),clearTimeout(this.timer),this.timer=null,this.emitting=!1,this.isLock=!1;const t=this.template.$danmuku;t?.parentElement&&t.parentElement.removeChild(t)}}function U(t){return e=>{const i=new $(e,t);let n;try{n=e.isDestroy?void 0:new _(e,i),!e.isDestroy&&i.option.heatmap&&C(e,i,i.option.heatmap)}catch(s){try{n?.destroy()}catch{}try{i.destroy()}catch{}throw s}return{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:n?n.mount.bind(n):()=>{},get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}return U.icons=_.icons,U}); diff --git a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.legacy.js b/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.legacy.js index 29fbd92d3..2631ffe2e 100644 --- a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.legacy.js +++ b/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.legacy.js @@ -4,4 +4,4 @@ * (c) 2017-2026 Harvey Zhao * Released under the MIT License. */ -!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.artplayerPluginDanmuku=e(),define(function(){return t.artplayerPluginDanmuku})):(t="undefined"!==typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=Math.pow,o=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,l=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&o(t,i,e[i]);if(n)for(var i of n(e))a.call(e,i)&&o(t,i,e[i]);return t},d=(t,n)=>e(t,i(n)),h=(t,e,i)=>new Promise((n,s)=>{var a=t=>{try{o(i.next(t))}catch(e){s(e)}},r=t=>{try{o(i.throw(t))}catch(e){s(e)}},o=t=>t.done?n(t.value):Promise.resolve(t.value).then(a,r);o((i=i.apply(t,e)).next())});function c(t){return t instanceof Promise||"[object Promise]"===Object.prototype.toString.call(t)}function p(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:return 2;case 5:return 1}}function u(t){if("string"!==typeof t)return[];const e=new RegExp(']*?p="(?

[^"]+)"[^>]*>(?.*?)<\\/d>',"gs"),i=t.matchAll(e);return Array.from(i).map(t=>{const e=t.groups.p.split(",");if(e.length>=8){return{text:t.groups.text.trim().replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&"),time:Number(e[0]),mode:p(Number(e[1])),fontSize:Number(e[2]),color:`#${Number(e[3]).toString(16)}`,timestamp:Number(e[4]),pool:Number(e[5]),userID:e[6],rowID:Number(e[7])}}return null}).filter(Boolean)}function m({data:t}){const{xml:e,id:i}=t,n=u(e);globalThis.postMessage({danmus:n,id:i})}let f=0;function g(t,{signal:e,onCancel:i}={}){return new Promise((n,s)=>{let a,r,o,l=!1;const d=++f,c=()=>y(void 0,function(t){if(void 0!==(null==t?void 0:t.reason))return t.reason;const e=new Error("Bilibili Danmu loading cancelled");return e.name="AbortError",e}(e));function g(){let t,e=!1;try{if(a){const t=a;a=void 0,t.onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate()}}catch(i){t=i,e=!0}if(void 0!==r){const n=r;r=void 0;try{URL.revokeObjectURL(n)}catch(i){e||(t=i),e=!0}}if(e)throw t}function y(t,i){if(l)return;l=!0;let a=arguments.length>1;null==e||e.removeEventListener("abort",c),null==o||o();try{g()}catch(r){a||(i=r),a=!0}a?s(i):n(t)}function v(t,e){if(!l){console.error("Error parsing Bilibili Danmu:",e);try{y(u(t))}catch(i){y(void 0,i)}}}(null==e?void 0:e.aborted)?c():(null==e||e.addEventListener("abort",c),o=null==i?void 0:i(c),l?null==o||o():function(){return h(this,null,function*(){const i=e?yield fetch(t,{signal:e}):yield fetch(t);if(l)return;const n=yield i.text();if(!l)try{const t=`\n ${p.toString()}\n ${u.toString()}\n onmessage = ${m.toString()}\n `;if(r=URL.createObjectURL(new Blob([t],{type:"application/javascript"})),l)return void g();if(a=new Worker(r),l)return void g();a.onmessage=t=>{var e;if(l||(null==(e=t.data)?void 0:e.id)!==d)return;const{danmus:i}=t.data;Array.isArray(i)?y(i):y(void 0,new Error("Invalid Bilibili Danmu worker response"))},a.onerror=t=>{var e;null==(e=t.preventDefault)||e.call(t),v(n,t.error||t)},a.onmessageerror=t=>v(n,t.error||t),a.postMessage({xml:n,id:d})}catch(s){v(n,s)}})}().catch(t=>y(void 0,t)))})}const y=new WeakMap,v=Symbol("cancelled danmuku input");function w(t){return y.has(t)||y.set(t,{closed:!1,tasks:new Set,emitting:[]}),y.get(t)}function k(t){const e=w(t),i=e.emitting[e.emitting.length-1];return!e.closed&&!t.art.isDestroy&&(!i||i.active())}function x(t){const e=w(t);e.closed=!0;for(const i of[...e.tasks])i.cancel()}function b(t,e,i){const n=t.states[e]||[];for(let s=0;s{const s=n.$ref.offsetTop,a=this.owner.getLeft(n.$ref)-i,r=n.$ref.clientHeight,o=n.$ref.clientWidth,l=a+o,d=e-l,h=l/n.$restTime,c={};c.top=s,c.left=a,c.height=r,c.width=o,c.right=d,c.speed=h,c.distance=l,c.time=n.$restTime,c.mode=n.mode,t.push(c)}),t}left(t){const e=t.getBoundingClientRect();return this.owner.isRotate?e.top:e.left}makeWait(t){this.owner.setState(t,"wait"),t.$ref&&(t.$ref.style.cssText=this.owner.constructor.cssText,t.$ref.style.visibility="hidden",t.$ref.style.marginLeft="0px",t.$ref.style.transform="translateX(0px)",t.$ref.style.transition="transform 0s linear 0s",this.owner.$refs.push(t.$ref),t.$ref=null)}resize(){const{clientWidth:t}=this.owner.$player;this.owner.filter("stop",e=>{if(0===e.mode)e.$ref.style.left=`${t}px`}),this.owner.filter("emit",e=>{switch(e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.left=`${t}px`,e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}})}continue(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("stop",e=>{switch(this.owner.setState(e,"emit"),e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}}),this}suspend(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("emit",e=>{switch(this.owner.setState(e,"stop"),e.mode){case 0:{const i=t-(this.owner.getLeft(e.$ref)-this.owner.getLeft(this.owner.$player));e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition="transform 0s linear 0s";break}}}),this}prepare(t,e){const i=this.owner,n=i.$ref;return e.danmu=t,e.ref=n,t.$ref=n,n.textContent=t.text,i.$danmuku.appendChild(n),n.style.opacity=i.option.opacity,n.style.fontSize=`${i.fontSize}px`,n.style.color=t.color,n.style.border=t.border?`1px solid ${t.color}`:null,n.style.backgroundColor=t.border?"rgb(0 0 0 / 50%)":null,i.utils.setStyles(n,t.style),n}place(t,e,i,n,s){switch(e.style.top=`${i}px`,e.style.visibility="visible",e.dataset.mode=t.mode,e.dataset.id=t.id||"",t.mode){case 0:e.style.left=`${s}px`,e.style.marginLeft="0px",e.style.transform=`translateX(${-n}px)`,e.style.transition=`transform ${t.$restTime}s linear 0s`;break;case 1:case 2:e.style.left="50%",e.style.marginLeft=`-${e.clientWidth/2}px`}}release(t){const{danmu:e,ref:i}=t;i&&e.$ref===i&&(i.style.cssText=this.owner.constructor.cssText,i.style.visibility="hidden",this.owner.$refs.push(i),e.$ref=null),t.ref=null}clear(){this.destroy(),this.owner.$refs=[],this.owner.$danmuku.textContent=""}destroy(){for(const t of this.nodes)t.parentElement&&t.parentElement.removeChild(t);for(const t of this.owner.queue)t.$ref=null;this.owner.$refs.length=0,this.nodes.clear()}}function M({target:t,visibles:e,clientWidth:i,clientHeight:n,marginBottom:s,marginTop:a,antiOverlap:r}){const o=n-s,l=e.filter(e=>e.mode===t.mode&&e.top<=o).sort((t,e)=>t.top-e.top);if(0===l.length)return 2===t.mode?o-t.height:a;if(l.unshift({type:"top",top:0,left:0,right:0,height:a,width:i,speed:0,distance:i}),l.push({type:"bottom",top:o,left:0,right:0,height:s,width:i,speed:0,distance:i}),2===t.mode)for(let h=l.length-2;h>=0;h-=1){const e=l[h],i=l[h+1],n=e.top+e.height;if(i.top-n>=t.height)return i.top-t.height}else for(let h=1;h=t.height)return n}const d=[];for(let h=1;h{const i=Math.min(...e.map(t=>t.right)),n=Math.min(...t.map(t=>t.right));return i*e.length-n*t.length});break;case 1:case 2:d.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return d[0][0].top}switch(t.mode){case 0:{const e=d.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}class S{constructor(){this.rows=new Set,this.waiting=new Set,this.visibility=()=>this.clear()}capture(t,e,i){var n,s;const a=t.$player.ownerDocument;if(a!==this.document&&(null==(n=this.document)||n.removeEventListener("visibilitychange",this.visibility),this.document=a,null==a||a.addEventListener("visibilitychange",this.visibility),this.clear()),!Number.isFinite(i)||"hidden"===(null==a?void 0:a.visibilityState)||(null==(s=t.art.video)?void 0:s.seeking))return this.clear(),e;const r=this.time,o=this.rows,l=this.waiting;if(this.time=i,this.rows=new Set(e),this.waiting=new Set(t.states.wait),void 0===r||i<=r)return e;const d=t.states.wait.filter(t=>l.has(t)&&!o.has(t)&&t.time>=r-.1&&t.time"ready"===t.$state),...d,...e.filter(t=>"ready"!==t.$state)]}clear(){this.time=void 0,this.rows.clear(),this.waiting.clear()}destroy(){var t;null==(t=this.document)||t.removeEventListener("visibilitychange",this.visibility),this.document=void 0,this.clear()}}class z{constructor(){this.pending=new Set,this.reserved=new Set}capture(t,e){for(const i of t)this.reserved.has(i)||e.has(i)||this.pending.add(i)}take(){const t=[],e=[];for(const n of this.pending)"ready"===n.$state?t.push(n):"wait"===n.$state&&e.push(n);this.pending.clear();const i=[...t,...e];return this.reserved=new Set(i),i}complete(){this.reserved.clear()}clear(){this.pending.clear(),this.reserved.clear()}}const E=Symbol("cancelled danmuku frame");class F{constructor(t){this.owner=t,this.generation=0,this.starts=0,this.frame=null,this.operation=null,this.closed=!1,this.running=!1,this.fault=!1,this.failedItems=new Set,this.buffer=new z,this.sampling=new S}active(t){const e=this.owner;return!this.closed&&!this.fault&&!e.art.isDestroy&&!e.isStop&&!e.isHide&&t.generation===this.generation}release(t){this.owner.renderer.release(t)}invalidate(){var t;if(this.generation++,null!==this.frame&&window.cancelAnimationFrame(this.frame),this.frame=null,this.owner.timer=null,this.operation){const t=this.operation;this.operation=null,t.cancel(),this.release(t)}null==(t=this.owner.workerClient)||t.cancel(),this.failedItems.clear(),this.buffer.clear(),this.sampling.clear()}report(t){try{this.owner.art.emit("artplayerPluginDanmuku:error",t)}catch(e){console.warn("Failed to report danmuku scheduling error:",e)}}fail(t){this.closed||this.fault||(this.fault=!0,this.invalidate(),this.report(t))}recover(){var t;if(!this.closed&&!this.owner.art.isDestroy&&(this.failedItems.clear(),this.fault))try{null==(t=this.owner.workerClient)||t.dispose(),this.owner.createWorker(),this.fault=!1}catch(e){this.report(e)}}schedule(){const t=this.owner;!this.running||this.closed||this.fault||t.art.isDestroy||t.isStop||null!==this.frame||(this.frame=window.requestAnimationFrame(()=>{if(this.frame=null,t.timer=null,this.closed||this.fault||t.isStop||t.art.isDestroy)return;const e=this.generation;try{if(t.art.playing&&!t.isHide){t.filter("emit",e=>{const i=Date.now();e.$restTime-=(i-e.$lastStartTime)/1e3,e.$lastStartTime=i,e.$restTime<=0&&t.makeWait(e)});const i=t.art.currentTime,n=t.readys;if(e!==this.generation)return;this.buffer.capture(this.sampling.capture(t,n,i),this.failedItems)}}catch(r){return void(e===this.generation&&this.fail(r))}if(this.schedule(),this.operation||!t.art.playing||t.isHide)return;const i=this.buffer.take();if(!i.length)return;let n;const s=new Promise(t=>n=()=>t(E)),a={generation:this.generation,cancel:n,wait:t=>Promise.race([t,s]),ref:null};return this.operation=a,this.run(a,i).catch(t=>{this.active(a)&&this.fail(t)}).finally(()=>{this.release(a),this.operation===a&&(this.operation=null,this.buffer.complete())})}),t.timer=this.frame)}run(t,e){return h(this,null,function*(){const i=this.owner;if(i.art.playing&&this.active(t))for(const s of e){if(!this.active(t))return;if(this.failedItems.has(s))continue;let e;try{e=yield t.wait(i.option.beforeVisible(s))}catch(n){if(!this.active(t))return;this.failedItems.add(s),this.report(n);continue}if(!this.active(t))return;if(!e)continue;const{clientWidth:a,clientHeight:r}=i.$player,o=i.renderer.prepare(s,t);if(!this.active(t))return;s.$lastStartTime=Date.now(),s.$restTime=i.speed;const l=a+o.clientWidth,d={type:"getDanmuTop",target:{mode:s.mode,height:o.clientHeight,speed:l/s.$restTime},visibles:i.visibles,antiOverlap:i.option.antiOverlap,clientWidth:a,clientHeight:r,marginBottom:i.marginBottom,marginTop:i.marginTop},h=d.antiOverlap?yield t.wait(i.postMessage(d)):{result:M(d)},c="symbol"===typeof h?void 0:h.result;if(!this.active(t)||s.$ref!==o)return;void 0!==c?(s.$lastStartTime=Date.now(),i.setState(s,"emit"),i.renderer.place(s,o,c,l,a),t.ref=null,i.art.emit("artplayerPluginDanmuku:visible",s)):(i.setState(s,"ready"),this.release(t))}})}destroy(){this.closed=!0,this.invalidate(),this.sampling.destroy()}}let C=0;class D{constructor(t,e){this.pending=new Map,this.closed=!1,this.failed=!1,this.onFailure=e,this.worker=t();try{this.worker.onmessage=t=>{var e;const i=this.pending.get(null==(e=t.data)?void 0:e.id);i&&(this.pending.delete(t.data.id),i.resolve(t.data))},this.worker.onerror=t=>{var e;null==(e=t.preventDefault)||e.call(t),this.fail(t.error||t)},this.worker.onmessageerror=t=>this.fail(t.error||t)}catch(i){try{this.dispose()}catch(n){}throw i}}request(t){t.id=++C;const{id:e}=t;return this.closed||this.failed?Promise.resolve({id:e,result:void 0}):new Promise((i,n)=>{this.pending.set(e,{resolve:i,reject:n});try{this.worker.postMessage(t)}catch(s){this.fail(s)}})}fail(t){if(!this.closed&&!this.failed){this.failed=!0;for(const e of this.pending.values())e.reject(t);this.pending.clear();try{this.dispose()}catch(e){}this.onFailure(t)}}cancel(){for(const[t,e]of this.pending)e.resolve({id:t,result:void 0});this.pending.clear()}dispose(){if(this.closed)return;this.closed=!0,this.cancel();let t,e=!1;const i=i=>{try{i()}catch(n){e||(t=n),e=!0}};for(const n of["onmessage","onerror","onmessageerror"])i(()=>this.worker[n]=null);if(i(()=>this.worker.terminate()),e)throw t}}const P='/*!\n * artplayer-plugin-danmuku.js v5.3.0\n * Github: https://github.com/zhw2590582/ArtPlayer\n * (c) 2017-2026 Harvey Zhao\n * Released under the MIT License.\n */\nfunction t({target:t,visibles:e,clientWidth:i,clientHeight:h,marginBottom:n,marginTop:o,antiOverlap:s}){const r=h-n,p=e.filter(e=>e.mode===t.mode&&e.top<=r).sort((t,e)=>t.top-e.top);if(0===p.length)return 2===t.mode?r-t.height:o;if(p.unshift({type:"top",top:0,left:0,right:0,height:o,width:i,speed:0,distance:i}),p.push({type:"bottom",top:r,left:0,right:0,height:n,width:i,speed:0,distance:i}),2===t.mode)for(let g=p.length-2;g>=0;g-=1){const e=p[g],i=p[g+1],h=e.top+e.height;if(i.top-h>=t.height)return i.top-t.height}else for(let g=1;g=t.height)return h}const a=[];for(let g=1;g{const i=Math.min(...e.map(t=>t.right)),h=Math.min(...t.map(t=>t.right));return i*e.length-h*t.length});break;case 1:case 2:a.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return a[0][0].top}switch(t.mode){case 0:{const e=a.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}onmessage=e=>{const{data:i}=e;if(!i.id||!i.type)return;const h=(0,{getDanmuTop:t}[i.type])(i);globalThis.postMessage({result:h,id:i.id})};\n',T="undefined"!==typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",P],{type:"text/javascript;charset=utf-8"});function L(t){let e;try{if(e=T&&(self.URL||self.webkitURL).createObjectURL(T),!e)throw"";const i=new Worker(e,{type:"module",name:null==t?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(i){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(P),{type:"module",name:null==t?void 0:t.name})}}class O{constructor(t,e){const{constructor:i,template:n}=t;this.utils=i.utils,this.validator=i.validator,this.$danmuku=n.$danmuku,this.$player=n.$player,this.art=t,this.queue=[],this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.index=0,this.worker=null,this.workerClient=null,this.renderer=new $(this),this.scheduler=new F(this),this.option=O.option,this.states={wait:[],ready:[],emit:[],stop:[]},this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.resize=this.resize.bind(this),this.destroy=this.destroy.bind(this),this.seek=this.seek.bind(this),k(this),t.on("destroy",this.destroy);try{if(this.config(e,!0),!k(this))return;this.createWorker()}catch(s){throw t.off("destroy",this.destroy),x(this),this.scheduler.destroy(),s}t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("resize",this.resize),t.on("video:seeking",this.seek),this.load().catch(t=>console.warn("Failed to load initial danmuku:",t))}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,width:512,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,emitter:!0,maxLength:200,lockTime:5,theme:"dark",OPACITY:{},FONT_SIZE:{},MARGIN:{},SPEED:{},COLOR:[]}}static get scheme(){return{danmuku:"array|function|string|promise",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement|string",heatmap:"object|boolean",width:"number",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",emitter:"boolean",maxLength:"number",lockTime:"number",theme:"string",OPACITY:"object",FONT_SIZE:"object",MARGIN:"object",SPEED:"object",COLOR:"array"}}static get cssText(){return'\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n '}get isRotate(){var t,e;return null==(e=null==(t=this.art.plugins)?void 0:t.autoOrientation)?void 0:e.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return O.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return O.option.margin[1]}get fontSize(){const{clamp:t}=this.utils,{clientHeight:e}=this.$player,i=this.option.fontSize;if("number"===typeof i)return Math.round(t(i,12,e));if("string"===typeof i&&i.endsWith("%")){const n=Number.parseFloat(i)/100;return Math.round(t(e*n,12,e))}return O.option.fontSize}get $ref(){return this.renderer.acquire()}get readys(){return function(t){const{currentTime:e}=t.art,i=[];return b(t,"ready",t=>i.push(t)),b(t,"wait",t=>{e+.1>=t.time&&t.time>=e-.1&&i.push(t)}),i}(this)}get visibles(){return this.renderer.visibles}get speed(){return this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed}load(t){return h(this,null,function*(){const{errorHandle:e}=this.utils,i=function(t,e){const i=w(t);if(e)for(const d of[...i.tasks])d.replace&&d.cancel();let n,s=i.closed||t.art.isDestroy;const a=new Promise(t=>n=t),r=new Set,o="function"===typeof AbortController?new AbortController:void 0,l={replace:e,signal:null==o?void 0:o.signal,active:()=>!s&&!i.closed&&!t.art.isDestroy,onCancel:t=>l.active()?(r.add(t),()=>r.delete(t)):(t(),()=>{}),cancel(){if(!s){s=!0,n(v),null==o||o.abort();for(const t of[...r])t();r.clear()}},wait:t=>Promise.race([t,a]),emit(e){i.emitting.push(l);try{return t.emit(e)}finally{i.emitting.pop()}},finish(){i.tasks.delete(l),r.clear()}};return s?n(v):i.tasks.add(l),l}(this,void 0===t);try{if(!i.active())return this;const n=function(t,e){return"function"===typeof t?{asynchronous:!0,value:t()}:c(t)?{asynchronous:!0,value:t}:"string"===typeof t?{asynchronous:!0,value:g(t,e)}:{asynchronous:!1,value:Array.isArray(t)?t:[]}}(t||this.option.danmuku,i),s=n.asynchronous?yield i.wait(n.value):n.value;if(!i.active())return this;e(Array.isArray(s),"Danmuku need return an array as result");const a=s;if(void 0===t){if(this.reset(),!i.active())return this;this.queue=[],this.states={wait:[],ready:[],emit:[],stop:[]},this.renderer.clear()}for(let t=0;t{const e=s[t],i=a[t];return"function"===typeof e||"function"===typeof i||c(e)||c(i)?e!==i:JSON.stringify(e)!==JSON.stringify(i)}))&&!e)return this;const r=function(t,e,{defaults:i,validate:n,clamp:s,mount:a}){const r=Object.assign({},i,t,e);return n(r),r.mode=s(r.mode,0,2),r.speed=s(r.speed,1,10),r.opacity=s(r.opacity,0,1),r.lockTime=s(r.lockTime,1,60),r.maxLength=s(r.maxLength,1,1e3),r.mount=r.mount||a,r}(this.option,t,{defaults:O.option,validate:t=>this.validator(t,O.scheme),clamp:i,mount:n});if(!k(this))return this;const o=this.option.beforeVisible!==r.beforeVisible;return this.option=r,o&&(this.scheduler.invalidate(),this.scheduler.schedule()),t.fontSize&&(this.reset(),!k(this))||(this.option.visible?this.show():this.hide(),k(this)&&this.art.emit("artplayerPluginDanmuku:config",this.option)),this}getLeft(t){return this.renderer.left(t)}postMessage(t={}){return this.workerClient.request(t)}createWorker(){this.workerClient=new D(()=>new L,t=>this.scheduler.fail(t)),this.worker=this.workerClient.worker}filter(t,e){return b(this,t,e)}setState(t,e){!function(t,e,i){t.states[e.$state]=t.states[e.$state].filter(t=>t!==e),e.$state=i,e.$ref&&(e.$ref.dataset.state=i),t.states[i].push(e)}(this,t,e)}makeWait(t){this.renderer.makeWait(t)}update(){return this.scheduler.running=!0,this.scheduler.schedule(),this}resize(){this.renderer.resize()}continue(){return this.renderer.continue(),this}suspend(){return this.renderer.suspend(),this}stop(){return this.isStop=!0,this.scheduler.running=!1,this.scheduler.invalidate(),this.suspend(),this.art.emit("artplayerPluginDanmuku:stop"),this}start(){if(this.scheduler.closed||this.art.isDestroy)return this;const t=++this.scheduler.starts,e=this.scheduler.generation;this.isStop=!1,this.scheduler.recover();return this.scheduler.closed||this.art.isDestroy||this.isStop||this.scheduler.fault||e!==this.scheduler.generation||t!==this.scheduler.starts||(this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")),this}reset(){return this.scheduler.invalidate(),this.queue.forEach(t=>this.makeWait(t)),this.art.emit("artplayerPluginDanmuku:reset"),this.scheduler.recover(),this.scheduler.schedule(),this}seek(){this.scheduler.invalidate(),this.scheduler.schedule()}show(){return this.isHide=!1,this.$danmuku.style.opacity=1,this.option.visible=!0,this.art.emit("artplayerPluginDanmuku:show"),this}hide(){return this.isHide=!0,this.scheduler.invalidate(),this.$danmuku.style.opacity=0,this.option.visible=!1,this.art.emit("artplayerPluginDanmuku:hide"),this.scheduler.schedule(),this}destroy(){var t;x(this),this.scheduler.destroy();try{try{this.stop()}finally{null==(t=this.workerClient)||t.dispose()}}finally{this.renderer.destroy(),this.art.off("video:play",this.start),this.art.off("video:playing",this.start),this.art.off("video:pause",this.stop),this.art.off("video:waiting",this.stop),this.art.off("resize",this.resize),this.art.off("video:seeking",this.seek),this.art.off("destroy",this.destroy),this.art.emit("artplayerPluginDanmuku:destroy")}}}const A=4294967295;function H(t,e){let i=0,n=t.length;for(;iNumber.isFinite(t)&&t>0))return null;const o={xMin:0,xMax:t,yMin:0,yMax:128,scale:.25,opacity:.2,minHeight:Math.floor(.05*e),sampling:Math.max(1,Math.floor(t/100)),smoothing:.2,flattening:.2},l=Object.assign({},"object"===typeof s?s:{}),d=Object.assign({},o,l);for(const r of Object.keys(o))Number.isFinite(d[r])||(d[r]=o[r]);if(d.sampling<=0&&(d.sampling=o.sampling),d.xMin===d.xMax||d.yMin===d.yMax)return null;const h=Array.isArray(a)&&a.length>0,c=h?[...a]:function(t,e,i,n){if(!Number.isFinite(e)||e<=0||!Number.isFinite(i)||i<=0||!Number.isFinite(n)||n<=0||Math.floor(e/n)+1>A)return[];const s=t.map(t=>t.time).filter(t=>"number"===typeof t&&!Number.isNaN(t)).sort((t,e)=>t-e),a=[],r=i/e;if(!Number.isFinite(r))return[];for(let o=0;o<=e;o+=n){if(a.length>=A||o+n===o)return[];const t=o*r,e=(o+n)*r;a.push([o,H(s,e)-H(s,t)])}return a}(n,t,i,d.sampling);if(!c.length||!c.every(t=>Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])))return null;const p=c[c.length-1];if(p[0]!==t){if(c.length===A)return null;c.push([t,p[1]])}let u=1/0,m=-1/0;for(const r of c)u=Math.min(u,r[1]),m=Math.max(m,r[1]);const f=(u+m)/2;for(const r of c){const t=r[1];r[1]=t*(t>f?1+d.scale:1-d.scale)+d.minHeight}const g=!h&&!Number.isFinite(l.yMin)&&!Number.isFinite(l.yMax);let y=0;for(const r of c)y=Math.max(y,r[1]);const v=g&&y>o.yMax/4;v&&(d.yMax=4*y);const w=t=>v?Math.min(e,Math.max(.75*e,t)):t,k=(t,e,i,n)=>{const s=function(t,e){const i=e[0]-t[0],n=e[1]-t[1];return{length:Math.sqrt(r(i,2)+r(n,2)),angle:Math.atan2(n,i)}}(e||t,i||t),a=N(Math.cos(s.angle)*d.flattening,0,1,1,0),o=s.angle*a+(n?Math.PI:0),l=s.length*d.smoothing;return[t[0]+Math.cos(o)*l,w(t[1]+Math.sin(o)*l)]},x=c.map(i=>[N(i[0],d.xMin,d.xMax,0,t),w(N(i[1],d.yMin,d.yMax,e,0))]);if(!x.every(t=>t.every(Number.isFinite)))return null;const b=x.map((t,i,n)=>{if(0===i)return`M ${n[n.length-1][0]},${e} L ${t[0]},${e} L ${t[0]},${t[1]}`;const s=k(n[i-1],n[i-2],t),a=k(t,n[i-1],n[i+1],!0);return`C ${s[0]},${s[1]} ${a[0]},${a[1]} ${t[0]},${t[1]}${i===n.length-1?" z":""}`}).join(" ");return/NaN|Infinity/u.test(b)?null:{path:b,opacity:d.opacity,width:t,height:e}}let j=0;function q(t,e,i){if(t.isDestroy)return;const{query:n}=t.constructor.utils;let s;const a=[];let r,o,l,d=!1;const h=()=>!d&&!t.isDestroy;function c(e,i){const n=i;a.push([e,n]),t.on(e,n)}function p(e){if(d)return;let i;d=!0,o=null,l=null;let n=!1;const s=t=>{try{t()}catch(e){n||(i=e),n=!0}};for(const[r,o]of a.splice(0))s(()=>t.off(r,o));if(e&&r&&t.controls.heatmap===r&&s(()=>t.controls.remove("heatmap")),r=void 0,n)throw i}function u(t){h()&&o&&l&&(o.setAttribute("offset",100*t+"%"),l.setAttribute("offset",100*t+"%"))}function m(a){try{!function(a=[]){if(!h())return;o=null,l=null;const d=r;if(d.innerHTML="",t.option.isLive)return;const c=V({width:d.offsetWidth,height:d.offsetHeight,duration:t.duration,queue:e.queue,option:i,points:a});if(!c||!h())return;const p=d.ownerDocument;for(s||(s=p?"heatmap-solids":"heatmap-solids-"+ ++j);null==p?void 0:p.getElementById(s);)s="heatmap-solids-"+ ++j;d.innerHTML=`\n \n \n \n \n \n \n \n \n \n \n \n `,o=n("#heatmap-start",d),l=n("#heatmap-stop",d),u(t.played)}(a)}catch(d){try{p(!0)}catch(c){}throw d}}c("destroy",()=>p(!0));try{t.controls.add({name:"heatmap",position:"top",html:"",style:{position:"absolute",top:"-100px",left:"0px",right:"0px",height:"100px",width:"100%",pointerEvents:"none"},beforeUnmount(){p(!1)},mounted(e){if(r=e,d)return t.controls.heatmap===e&&t.controls.remove("heatmap"),void(r=void 0);h()?(c("video:timeupdate",()=>u(t.played)),c("setBar",(t,e)=>{"played"===t&&u(e)}),c("ready",()=>m()),c("resize",()=>m()),c("artplayerPluginDanmuku:loaded",()=>m()),c("artplayerPluginDanmuku:points",t=>m(t))):p(!0)}})}catch(f){try{p(!0)}catch(g){}throw f}return()=>p(!0)}const I=new WeakMap;class B{constructor(t){this.art=t,this.closed=!1,this.disposers=new Set,this.cancelled=new Promise(t=>this.cancel=t)}get active(){return!this.closed&&!this.art.isDestroy}own(t){this.closed?t():this.disposers.add(t)}write(t,e,i,n=i=>t[e]=i){const s=t;if(!this.active)return;const a=()=>"function"===typeof s.getPropertyPriority?s.getPropertyPriority(e):void 0;let r=I.get(s);r||(r=new Map,I.set(s,r));let o=r.get(e);o||(o={original:s[e],present:e in s||void 0!==s[e],priority:a(),owners:new Map,apply:n},r.set(e,o)),o.owners.has(this)||this.own(()=>{const t=[...o.owners.keys()],i=t[t.length-1]===this;if(o.owners.delete(this),i&&s[e]===o.last&&a()===o.lastPriority){const t=[...o.owners.values()];t.length?(o.apply(t[t.length-1]),o.last=s[e],o.lastPriority=a()):void 0!==o.priority?s.setProperty(e,o.original,o.priority):o.present?o.apply(o.original):delete s[e]}o.owners.size||(r.delete(e),r.size||I.delete(s))}),o.owners.delete(this),o.owners.set(this,i),o.apply(i),o.last=s[e],o.lastPriority=a()}on(t,e){if(!this.active)return;const i=this;function n(...t){if(i.active)return e.apply(this,t)}const s=()=>this.art.off(t,n);this.own(s);try{this.art.on(t,n),this.active||s()}catch(a){throw this.release(s),a}}proxy(t,e,i){if(!this.active)return;const n=this;function s(...t){if(n.active)return i.apply(this,t)}let a;const r=()=>{var i,n;if("function"===typeof a){const t=this.art.events;"function"===typeof(null==t?void 0:t.remove)&&(null==(i=t.destroyEvents)?void 0:i.has(a))?t.remove(a):a()}else null==(n=t.removeEventListener)||n.call(t,e,s)};this.own(r);try{a=this.art.proxy(t,e,s),this.active||r()}catch(o){throw this.release(r),o}}wait(t){return Promise.race([t,this.cancelled])}release(t){try{t()}catch(e){console.warn("Failed to dispose danmuku setting resource:",e)}}close(){if(!this.closed){this.closed=!0,this.cancel();for(const t of this.disposers)this.release(t);this.disposers.clear()}}}function R({min:t,max:e,container:i,findIndex:n,onChange:s,steps:a=[]}){const{lifecycle:r}=this;if(!r.active)return{reset(){}};const{query:o,clamp:l,setStyle:d}=this.utils;d(i,"touch-action","none"),i.innerHTML=`\n

\n
\n ${a.map(()=>'
').join("")}\n
\n
\n
\n
\n
\n ${a.map(t=>t.hide?"":`
${t.name}
`).join("")}\n
\n `;const h=o(".apd-slider-dot",i),c=o(".apd-slider-progress",i);let p=!1;function u(i){if(!r.active)return;if(void 0===i&&(i=n()),ie)return;const o=(i-t)/(e-t);h.style.left=100*o+"%",0===a.length&&(c.style.width=h.style.left),s(i)}function m(n){const{top:s,height:a,left:r,width:o}=i.getBoundingClientRect();if(this.art.isRotate){const i=l(n.clientY-s,0,a);u(Math.round(i/a*(e-t)+t))}else{const i=l(n.clientX-r,0,o);u(Math.round(i/o*(e-t)+t))}}return r.own(()=>p=!1),r.proxy(i,"click",t=>{m.call(this,t)}),r.proxy(i,"pointerdown",t=>{p=0===t.button}),r.on("document:pointermove",t=>{p&&m.call(this,t)}),r.on("document:pointerup",t=>{p&&(p=!1,m.call(this,t))}),{reset:u}}const Z='',W='',_='',U='',G='',X='',Y='',J='',K='',Q='',tt='',et='';function it(){const{option:t}=this;return`\n
\n ${tt}${Q}\n
\n
\n ${_}\n
\n
\n
\n \u6309\u7c7b\u578b\u5c4f\u853d\n
\n
\n ${U}${G}\n
\u6eda\u52a8
\n
\n
\n ${X}${Y}\n
\u9876\u90e8
\n
\n
\n ${J}${K}\n
\u5e95\u90e8
\n
\n
\n
\n
\n
\n ${W}${Z}\n \u9632\u6b62\u5f39\u5e55\u91cd\u53e0\n
\n
\n ${W}${Z}\n \u540c\u6b65\u89c6\u9891\u901f\u5ea6\n
\n
\n
\n \u4e0d\u900f\u660e\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n \u663e\u793a\u533a\u57df\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u5b57\u53f7\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u901f\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n
\n
\n
\n
\n ${et}\n
\n
\n
\n \u6a21\u5f0f\n
\n
\n ${G}\n
\u6eda\u52a8
\n
\n
\n ${Y}\n
\u9876\u90e8
\n
\n
\n ${K}\n
\u5e95\u90e8
\n
\n
\n
\n
\n \u989c\u8272\n
\n ${this.COLOR.map(t=>`
`).join("")}\n
\n
\n
\n
\n
\n \n
\u53d1\u9001
\n
\n `}if("undefined"!==typeof document){const t="artplayer-plugin-danmuku",e=Symbol.for("artplayer-plugin-danmuku.pending-style"),i=document;let n=document.getElementById(t)||i[e];if(!n)if(n=document.createElement("style"),n.id=t,"loading"===document.readyState){i[e]=n;const s=()=>{document.removeEventListener("DOMContentLoaded",s),i[e]===n&&delete i[e];const a=document.getElementById(t);a?a.textContent=n.textContent:(document.head||document.documentElement).appendChild(n)};document.addEventListener("DOMContentLoaded",s,{once:!0})}else(document.head||document.documentElement).appendChild(n);n.textContent='.artplayer-plugin-danmuku{display:flex;position:relative;z-index:99;align-items:center;justify-content:center;font-size:12px;height:32px;width:100%;color:#fff;font-weight:300;flex-shrink:0;gap:10px}.artplayer-plugin-danmuku .apd-icon{cursor:pointer;opacity:.75;transition:all .2s ease;fill:#fff}.artplayer-plugin-danmuku .apd-icon:hover{opacity:1}.artplayer-plugin-danmuku .apd-config{display:flex;position:relative}.artplayer-plugin-danmuku .apd-config .apd-config-panel{position:absolute;bottom:24px;left:0;width:320px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-config .apd-config-panel .apd-config-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-config:hover .apd-config-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-config-mode,.artplayer-plugin-danmuku .apd-config-slider,.artplayer-plugin-danmuku .apd-config-other,.artplayer-plugin-danmuku .apd-style-mode{margin-bottom:15px}.artplayer-plugin-danmuku .apd-modes{display:flex;align-items:center;margin-top:5px;gap:20px}.artplayer-plugin-danmuku .apd-modes .apd-mode{cursor:pointer;text-align:center}.artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-config-slider{display:flex;align-items:center;gap:12px}.artplayer-plugin-danmuku .apd-config-slider .apd-value{width:32px;text-align:right}.artplayer-plugin-danmuku .apd-slider{position:relative;flex:1;display:flex;height:20px;align-items:center;justify-content:center;cursor:pointer}.artplayer-plugin-danmuku .apd-slider .apd-slider-line{position:relative;height:2px;width:100%;overflow:hidden;border-radius:3px;background-color:#ffffff40}.artplayer-plugin-danmuku .apd-slider .apd-slider-points{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}.artplayer-plugin-danmuku .apd-slider .apd-slider-points .apd-slider-point{width:2px;height:2px;border-radius:50%;background-color:#ffffff80}.artplayer-plugin-danmuku .apd-slider .apd-slider-progress{width:0%;height:100%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-dot{position:absolute;transform:translate(-6px);left:0%;width:12px;height:12px;border-radius:50%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps{display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:-12px;width:calc(100% + 32px);color:#777}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps .apd-slider-step{flex-shrink:0;width:36px;text-align:center;scale:.95}.artplayer-plugin-danmuku .apd-config-other{display:flex;align-items:center;gap:20px}.artplayer-plugin-danmuku .apd-config-other .apd-check-off,.artplayer-plugin-danmuku .apd-config-other .apd-check-on{width:16px;height:16px}.artplayer-plugin-danmuku .apd-config-other .apd-other{display:flex;align-items:center;cursor:pointer;gap:2px}.artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-emitter{display:flex;flex:1;align-items:center;height:100%;background-color:#ffffff40;border-radius:5px}.artplayer-plugin-danmuku .apd-style{position:relative;display:flex;align-items:center;justify-content:center}.artplayer-plugin-danmuku .apd-style .apd-style-panel{position:absolute;bottom:24px;left:0;width:200px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-style .apd-style-panel .apd-style-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-style:hover .apd-style-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-colors{display:flex;flex-wrap:wrap;margin-top:5px;gap:8px}.artplayer-plugin-danmuku .apd-colors .apd-color{width:16px;height:16px;border-radius:2px;cursor:pointer}.artplayer-plugin-danmuku .apd-colors .apd-color.apd-active{border:1px solid black;box-shadow:0 0 0 1px #fff}.artplayer-plugin-danmuku .apd-input{outline:none;height:100%;flex:1;min-width:0;width:auto;border:none;line-height:1;color:#fff;background-color:transparent}.artplayer-plugin-danmuku .apd-input::placeholder{color:#ffffff80}.artplayer-plugin-danmuku .apd-send{display:flex;align-items:center;justify-content:center;height:100%;width:60px;flex-shrink:0;cursor:pointer;text-shadow:none;border-top-right-radius:5px;border-bottom-right-radius:5px;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-send.apd-lock{cursor:not-allowed;color:#666;background-color:#e7e7e7}.art-controls-center .apd-emitter{width:260px;flex:none}.art-fullscreen .artplayer-plugin-danmuku,.art-fullscreen-web .artplayer-plugin-danmuku{height:38px;gap:16px}.art-fullscreen .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen-web .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-on,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-on{width:28px;height:28px}.art-fullscreen .artplayer-plugin-danmuku .apd-emitter,.art-fullscreen-web .artplayer-plugin-danmuku .apd-emitter{width:400px;flex:none}.art-video-player>.artplayer-plugin-danmuku{position:absolute;left:0;right:0;bottom:-40px;padding:0 10px}.art-video-player:has(>.artplayer-plugin-danmuku){margin-bottom:40px}[data-danmuku-emitter=false] .apd-emitter{display:none!important}[data-danmuku-emitter=false] .art-controls-center .artplayer-plugin-danmuku{justify-content:flex-end;gap:18px}[data-danmuku-emitter=false].art-fullscreen .art-controls-center .artplayer-plugin-danmuku,[data-danmuku-emitter=false].art-fullscreen-web .art-controls-center .artplayer-plugin-danmuku{gap:24px}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-icon{fill:#333}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-emitter{background-color:#f1f2f3}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input{color:#000}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input::placeholder{color:#0000004d}[data-danmuku-visible=false] .apd-toggle-off{display:block}[data-danmuku-visible=false] .apd-toggle-on,[data-danmuku-visible=true] .apd-toggle-off{display:none}[data-danmuku-visible=true] .apd-toggle-on{display:block}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-on{display:none}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-off,[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-on{display:block}[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-off,[data-danmuku-sync-video=false] .apd-sync-video .apd-check-on{display:none}[data-danmuku-sync-video=false] .apd-sync-video .apd-check-off,[data-danmuku-sync-video=true] .apd-sync-video .apd-check-on{display:block}[data-danmuku-sync-video=true] .apd-sync-video .apd-check-off{display:none}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-off{display:block}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-on{display:none}[data-danmuku-mode0=false] .art-danmuku [data-mode="0"]{opacity:0!important}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-off{display:none}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-on{display:block}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"]{color:#00a1d6}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"] path{fill:#00a1d6}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-off{display:block}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-on{display:none}[data-danmuku-mode1=false] .art-danmuku [data-mode="1"]{opacity:0!important}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-off{display:none}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-on{display:block}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"]{color:#00a1d6}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"] path{fill:#00a1d6}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-off{display:block}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-on{display:none}[data-danmuku-mode2=false] .art-danmuku [data-mode="2"]{opacity:0!important}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-off{display:none}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-on{display:block}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"]{color:#00a1d6}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"] path{fill:#00a1d6}'}class nt{constructor(t,e){this.art=t,this.danmuku=e,this.utils=t.constructor.utils;const{setStyle:i}=this.utils,{$controlsCenter:n}=t.template;this.template={$controlsCenter:n,$mount:n,$danmuku:null,$toggle:null,$config:null,$configPanel:null,$configModes:null,$style:null,$stylePanel:null,$styleModes:null,$colors:null,$opacitySlider:null,$opacityValue:null,$marginSlider:null,$marginValue:null,$fontSizeSlider:null,$fontSizeValue:null,$speedSlider:null,$speedValue:null,$input:null,$send:null},this.slider={opacity:null,margin:null,fontSize:null,speed:null},this.emitting=!1,this.isLock=!1,this.timer=null,this.lifecycle=new B(t),this.destroy=this.destroy.bind(this),this.lifecycle.own(()=>t.off("destroy",this.destroy));try{if(t.on("destroy",this.destroy),!this.lifecycle.active)return;if(this.lifecycle.write(n.style,"display","flex",t=>i(n,"display",t)),this.createTemplate(),!this.lifecycle.active)return;if(this.createSliders(),!this.lifecycle.active)return;if(this.createEvents(),this.mount(this.option.mount),!this.lifecycle.active)return;this.lifecycle.on("resize",()=>this.resize()),this.lifecycle.on("fullscreen",t=>this.onFullscreen(t)),this.lifecycle.on("fullscreenWeb",t=>this.onFullscreen(t)),this.lifecycle.proxy(this.template.$config,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$config,$panel:this.template.$configPanel})}),this.lifecycle.proxy(this.template.$style,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$style,$panel:this.template.$stylePanel})})}catch(s){try{this.destroy()}catch(a){console.warn("Failed to roll back danmuku setting:",a)}throw s}}static get icons(){return{$on:tt,$off:Q,$config:_,$style:et,$mode_0_off:U,$mode_0_on:G,$mode_1_off:X,$mode_1_on:Y,$mode_2_off:J,$mode_2_on:K,$check_on:W,$check_off:Z}}get option(){return this.danmuku.option}get outside(){return this.template.$mount!==this.template.$controlsCenter}get TEMPLATE(){return it.call(this)}get OPACITY(){return l({min:0,max:100,steps:[]},this.option.OPACITY)}get FONT_SIZE(){return l({min:12,max:120,steps:[]},this.option.FONT_SIZE)}get MARGIN(){return l({min:0,max:3,steps:[{name:"1/4",value:[10,"75%"]},{name:"\u534a\u5c4f",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"\u6ee1\u5c4f",value:[10,10]}]},this.option.MARGIN)}get SPEED(){return l({min:0,max:4,steps:[{name:"\u6781\u6162",value:10},{name:"\u8f83\u6162",value:7.5,hide:!0},{name:"\u9002\u4e2d",value:5},{name:"\u8f83\u5feb",value:2.5,hide:!0},{name:"\u6781\u5feb",value:1}]},this.option.SPEED)}get COLOR(){return this.option.COLOR.length?this.option.COLOR:["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(t){const{query:e}=this.utils,{$danmuku:i}=this.template;return e(t,i)}append(t,e){if(!this.lifecycle.active)return;const{append:i}=this.utils;[...t.children].includes(e)||i(t,e)}setData(t,e){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,{$mount:n}=this.template;this.lifecycle.write(i.dataset,t,e),this.outside&&this.lifecycle.write(n.dataset,t,e)}createTemplate(){const{createElement:t,tooltip:e}=this.utils,i=t("div");this.template.$danmuku=i,i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$toggle=this.query(".apd-toggle"),this.template.$config=this.query(".apd-config"),this.template.$configPanel=this.query(".apd-config-panel"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$style=this.query(".apd-style"),this.template.$stylePanel=this.query(".apd-style-panel"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send");const{$toggle:n}=this.template;this.lifecycle.on("artplayerPluginDanmuku:show",()=>{e(n,"\u5173\u95ed\u5f39\u5e55")}),this.lifecycle.on("artplayerPluginDanmuku:hide",()=>{e(n,"\u6253\u5f00\u5f39\u5e55")})}createEvents(){const{$toggle:t,$configModes:e,$styleModes:i,$colors:n,$antiOverlap:s,$syncVideo:a,$send:r,$input:o}=this.template;this.lifecycle.proxy(t,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.lifecycle.proxy(e,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(t=>t!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.lifecycle.proxy(s,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.lifecycle.proxy(a,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.lifecycle.proxy(i,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.lifecycle.proxy(n,"click",t=>{const e=t.target.closest(".apd-color");e&&(this.danmuku.config({color:e.dataset.color}),this.reset())}),this.lifecycle.proxy(r,"click",()=>this.emit()),this.lifecycle.proxy(o,"keypress",t=>{"Enter"===t.key&&(t.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider(d(l({},this.OPACITY),{container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:t=>{const{$opacityValue:e}=this.template;e.textContent=`${t}%`,this.danmuku.config({opacity:t/100})}})),this.slider.margin=this.createSlider(d(l({},this.MARGIN),{container:this.template.$marginSlider,findIndex:()=>this.MARGIN.steps.findIndex(t=>t.value[0]===this.option.margin[0]&&t.value[1]===this.option.margin[1]),onChange:t=>{const e=this.MARGIN.steps[t];if(!e)return;const{$marginValue:i}=this.template;i.textContent=e.name,this.danmuku.config({margin:e.value})}})),this.slider.fontSize=this.createSlider(d(l({},this.FONT_SIZE),{container:this.template.$fontSizeSlider,findIndex:()=>this.danmuku.fontSize,onChange:t=>{const{$fontSizeValue:e}=this.template;e.textContent=`${t}px`,t!==this.danmuku.fontSize&&this.danmuku.config({fontSize:t})}})),this.slider.speed=this.createSlider(d(l({},this.SPEED),{container:this.template.$speedSlider,findIndex:()=>this.SPEED.steps.findIndex(t=>t.value===this.option.speed),onChange:t=>{const e=this.SPEED.steps[t];if(!e)return;const{$speedValue:i}=this.template;i.textContent=e.name,this.danmuku.config({speed:e.value})}}))}createSlider(t){return R.call(this,t)}onFullscreen(t){if(!this.lifecycle.active)return;const{$danmuku:e,$controlsCenter:i,$mount:n}=this.template;this.outside?t?this.append(i,e):this.append(n,e):this.append(i,e)}onMouseEnter({$control:t,$panel:e}){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),r=s.width/2-n.width/2,o=a.left-(n.left-r),l=n.right+r-a.right;e.style.left=o>0?`${-r+o}px`:l>0?-r-l+"px":-r+"px"}emit(){return function(t){return h(this,null,function*(){const{lifecycle:e,template:{$input:i}}=t;if(!e.active)return;const n=i.value.trim();if(!n.length||t.isLock||t.emitting)return;const s={text:n,mode:t.option.mode,color:t.option.color,time:t.art.currentTime},a=t=>{e.active&&console.error("Error emitting danmuku:",t)};try{t.emitting=!0;const n=yield e.wait(t.option.beforeEmit(s));if(!e.active)return;if(t.emitting=!1,!0!==n)return;if(s.border=!0,delete s.time,Promise.resolve(t.danmuku.emit(s)).catch(a),!e.active)return;i.value="",t.lock()}catch(r){a(r),e.active&&(t.emitting=!1)}})}(this)}lock(){!function(t){if(!t.lifecycle.active)return;const{addClass:e}=t.utils,{$send:i}=t.template;clearTimeout(t.timer),t.isLock=!0;let n=t.option.lockTime;i.textContent=n,e(i,"apd-lock");const s=()=>{t.timer=setTimeout(()=>{t.lifecycle.active&&(0===n?t.unlock():(n-=1,i.textContent=n,s()))},1e3)};s()}(this)}unlock(){!function(t){if(clearTimeout(t.timer),t.timer=null,t.isLock=!1,!t.lifecycle.active)return;const{removeClass:e}=t.utils,{$send:i}=t.template;i.textContent="\u53d1\u9001",e(i,"apd-lock")}(this)}resize(){if(!this.lifecycle.active)return;if(this.outside)return;if(this.art.fullscreen)return;if(this.art.fullscreenWeb)return;const{$player:t,$controlsCenter:e}=this.art.template,{$danmuku:i}=this.template;this.art.widtht.dataset.color===this.option.color.toUpperCase());a&&t(a,"apd-active"),e(i,this.option.visible?"\u5173\u95ed\u5f39\u5e55":"\u6253\u5f00\u5f39\u5e55"),this.resize()}mount(t){if(!this.lifecycle.active)return;const{errorHandle:e}=this.utils,i="string"===typeof t?document.querySelector(t):t;e(i,`Can not find the mount point: ${t}`),this.append(i,this.template.$danmuku),this.template.$mount=i,this.reset()}destroy(){if(this.lifecycle.closed)return;this.lifecycle.close(),clearTimeout(this.timer),this.timer=null,this.emitting=!1,this.isLock=!1;const t=this.template.$danmuku;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t)}}function st(t){return e=>{const i=new O(e,t);let n;try{n=e.isDestroy?void 0:new nt(e,i),!e.isDestroy&&i.option.heatmap&&q(e,i,i.option.heatmap)}catch(s){try{null==n||n.destroy()}catch(a){}try{i.destroy()}catch(a){}throw s}return{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:n?n.mount.bind(n):()=>{},get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}return st.icons=nt.icons,st}); +!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.artplayerPluginDanmuku=e(),define(function(){return t.artplayerPluginDanmuku})):(t="undefined"!==typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=Math.pow,o=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,l=(t,e)=>{for(var i in e||(e={}))s.call(e,i)&&o(t,i,e[i]);if(n)for(var i of n(e))a.call(e,i)&&o(t,i,e[i]);return t},d=(t,n)=>e(t,i(n)),h=(t,e,i)=>new Promise((n,s)=>{var a=t=>{try{o(i.next(t))}catch(e){s(e)}},r=t=>{try{o(i.throw(t))}catch(e){s(e)}},o=t=>t.done?n(t.value):Promise.resolve(t.value).then(a,r);o((i=i.apply(t,e)).next())});function c(t){return t instanceof Promise||"[object Promise]"===Object.prototype.toString.call(t)}function p(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:return 2;case 5:return 1}}function u(t){if("string"!==typeof t)return[];const e=new RegExp(']*?p="(?

[^"]+)"[^>]*>(?.*?)<\\/d>',"gs"),i=t.matchAll(e);return Array.from(i).map(t=>{const e=t.groups.p.split(",");if(e.length>=8){return{text:t.groups.text.trim().replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&"),time:Number(e[0]),mode:p(Number(e[1])),fontSize:Number(e[2]),color:`#${Number(e[3]).toString(16)}`,timestamp:Number(e[4]),pool:Number(e[5]),userID:e[6],rowID:Number(e[7])}}return null}).filter(Boolean)}function m({data:t}){const{xml:e,id:i}=t,n=u(e);globalThis.postMessage({danmus:n,id:i})}let f=0;function g(t,{signal:e,onCancel:i}={}){return new Promise((n,s)=>{let a,r,o,l=!1;const d=++f,c=()=>y(void 0,function(t){if(void 0!==(null==t?void 0:t.reason))return t.reason;const e=new Error("Bilibili Danmu loading cancelled");return e.name="AbortError",e}(e));function g(){let t,e=!1;try{if(a){const t=a;a=void 0,t.onmessage=null,t.onerror=null,t.onmessageerror=null,t.terminate()}}catch(i){t=i,e=!0}if(void 0!==r){const n=r;r=void 0;try{URL.revokeObjectURL(n)}catch(i){e||(t=i),e=!0}}if(e)throw t}function y(t,i){if(l)return;l=!0;let a=arguments.length>1;null==e||e.removeEventListener("abort",c),null==o||o();try{g()}catch(r){a||(i=r),a=!0}a?s(i):n(t)}function v(t,e){if(!l){console.error("Error parsing Bilibili Danmu:",e);try{y(u(t))}catch(i){y(void 0,i)}}}(null==e?void 0:e.aborted)?c():(null==e||e.addEventListener("abort",c),o=null==i?void 0:i(c),l?null==o||o():function(){return h(this,null,function*(){const i=e?yield fetch(t,{signal:e}):yield fetch(t);if(l)return;const n=yield i.text();if(!l)try{const t=`\n ${p.toString()}\n ${u.toString()}\n onmessage = ${m.toString()}\n `;if(r=URL.createObjectURL(new Blob([t],{type:"application/javascript"})),l)return void g();if(a=new Worker(r),l)return void g();a.onmessage=t=>{var e;if(l||(null==(e=t.data)?void 0:e.id)!==d)return;const{danmus:i}=t.data;Array.isArray(i)?y(i):y(void 0,new Error("Invalid Bilibili Danmu worker response"))},a.onerror=t=>{var e;null==(e=t.preventDefault)||e.call(t),v(n,t.error||t)},a.onmessageerror=t=>v(n,t.error||t),a.postMessage({xml:n,id:d})}catch(s){v(n,s)}})}().catch(t=>y(void 0,t)))})}const y=new WeakMap,v=Symbol("cancelled danmuku input");function w(t){return y.has(t)||y.set(t,{closed:!1,tasks:new Set,emitting:[]}),y.get(t)}function k(t){const e=w(t),i=e.emitting[e.emitting.length-1];return!e.closed&&!t.art.isDestroy&&(!i||i.active())}function x(t){const e=w(t);e.closed=!0;for(const i of[...e.tasks])i.cancel()}function b(t,e,i){const n=t.states[e]||[];for(let s=0;s{const s=n.$ref.offsetTop,a=this.owner.getLeft(n.$ref)-i,r=n.$ref.clientHeight,o=n.$ref.clientWidth,l=a+o,d=e-l,h=l/n.$restTime,c={};c.top=s,c.left=a,c.height=r,c.width=o,c.right=d,c.speed=h,c.distance=l,c.time=n.$restTime,c.mode=n.mode,t.push(c)}),t}left(t){const e=t.getBoundingClientRect();return this.owner.isRotate?e.top:e.left}makeWait(t){this.owner.setState(t,"wait"),t.$ref&&(t.$ref.style.cssText=this.owner.constructor.cssText,t.$ref.style.visibility="hidden",t.$ref.style.marginLeft="0px",t.$ref.style.transform="translateX(0px)",t.$ref.style.transition="transform 0s linear 0s",this.owner.$refs.push(t.$ref),t.$ref=null)}resize(){const{clientWidth:t}=this.owner.$player;this.owner.filter("stop",e=>{if(0===e.mode)e.$ref.style.left=`${t}px`}),this.owner.filter("emit",e=>{switch(e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.left=`${t}px`,e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}})}continue(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("stop",e=>{switch(this.owner.setState(e,"emit"),e.$lastStartTime=Date.now(),e.mode){case 0:{const i=t+e.$ref.clientWidth;e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition=`transform ${e.$restTime}s linear 0s`;break}}}),this}suspend(){const{clientWidth:t}=this.owner.$player;return this.owner.filter("emit",e=>{switch(this.owner.setState(e,"stop"),e.mode){case 0:{const i=t-(this.owner.getLeft(e.$ref)-this.owner.getLeft(this.owner.$player));e.$ref.style.transform=`translateX(${-i}px)`,e.$ref.style.transition="transform 0s linear 0s";break}}}),this}prepare(t,e){const i=this.owner,n=i.$ref;return e.danmu=t,e.ref=n,t.$ref=n,n.textContent=t.text,i.$danmuku.appendChild(n),n.style.opacity=i.option.opacity,n.style.fontSize=`${i.fontSize}px`,n.style.color=t.color,n.style.border=t.border?`1px solid ${t.color}`:null,n.style.backgroundColor=t.border?"rgb(0 0 0 / 50%)":null,i.utils.setStyles(n,t.style),n}place(t,e,i,n,s){switch(e.style.top=`${i}px`,e.style.visibility="visible",e.dataset.mode=t.mode,e.dataset.id=t.id||"",t.mode){case 0:e.style.left=`${s}px`,e.style.marginLeft="0px",e.style.transform=`translateX(${-n}px)`,e.style.transition=`transform ${t.$restTime}s linear 0s`;break;case 1:case 2:e.style.left="50%",e.style.marginLeft=`-${e.clientWidth/2}px`}}release(t){const{danmu:e,ref:i}=t;i&&e.$ref===i&&(i.style.cssText=this.owner.constructor.cssText,i.style.visibility="hidden",this.owner.$refs.push(i),e.$ref=null),t.ref=null}clear(){this.destroy(),this.owner.$refs=[],this.owner.$danmuku.textContent=""}destroy(){for(const t of this.nodes)t.parentElement&&t.parentElement.removeChild(t);for(const t of this.owner.queue)t.$ref=null;this.owner.$refs.length=0,this.nodes.clear()}}function M({target:t,visibles:e,clientWidth:i,clientHeight:n,marginBottom:s,marginTop:a,antiOverlap:r}){const o=n-s,l=e.filter(e=>e.mode===t.mode&&e.top<=o).sort((t,e)=>t.top-e.top);if(0===l.length)return 2===t.mode?o-t.height:a;if(l.unshift({type:"top",top:0,left:0,right:0,height:a,width:i,speed:0,distance:i}),l.push({type:"bottom",top:o,left:0,right:0,height:s,width:i,speed:0,distance:i}),2===t.mode)for(let h=l.length-2;h>=0;h-=1){const e=l[h],i=l[h+1],n=e.top+e.height;if(i.top-n>=t.height)return i.top-t.height}else for(let h=1;h=t.height)return n}const d=[];for(let h=1;h{const i=Math.min(...e.map(t=>t.right)),n=Math.min(...t.map(t=>t.right));return i*e.length-n*t.length});break;case 1:case 2:d.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return d[0][0].top}switch(t.mode){case 0:{const e=d.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}class S{constructor(){this.rows=new Set,this.waiting=new Set,this.visibility=()=>this.clear()}begin(t){void 0===this.time&&this.capture(t,[],t.art.currentTime)}capture(t,e,i){var n,s;const a=t.$player.ownerDocument;if(a!==this.document&&(null==(n=this.document)||n.removeEventListener("visibilitychange",this.visibility),this.document=a,null==a||a.addEventListener("visibilitychange",this.visibility),this.clear()),!Number.isFinite(i)||"hidden"===(null==a?void 0:a.visibilityState)||(null==(s=t.art.video)?void 0:s.seeking))return this.clear(),e;const r=this.time,o=this.rows,l=this.waiting;if(this.time=i,this.rows=new Set(e),this.waiting=new Set(t.states.wait),void 0===r||i<=r)return e;const d=t.states.wait.filter(t=>l.has(t)&&!o.has(t)&&t.time>=r-.1&&t.time"ready"===t.$state),...d,...e.filter(t=>"ready"!==t.$state)]}clear(){this.time=void 0,this.rows.clear(),this.waiting.clear()}destroy(){var t;null==(t=this.document)||t.removeEventListener("visibilitychange",this.visibility),this.document=void 0,this.clear()}}class z{constructor(){this.pending=new Set,this.reserved=new Set}capture(t,e){for(const i of t)this.reserved.has(i)||e.has(i)||this.pending.add(i)}take(){const t=[],e=[];for(const n of this.pending)"ready"===n.$state?t.push(n):"wait"===n.$state&&e.push(n);this.pending.clear();const i=[...t,...e];return this.reserved=new Set(i),i}complete(){this.reserved.clear()}clear(){this.pending.clear(),this.reserved.clear()}}const E=Symbol("cancelled danmuku frame");class F{constructor(t){this.owner=t,this.generation=0,this.starts=0,this.frame=null,this.operation=null,this.closed=!1,this.running=!1,this.fault=!1,this.failedItems=new Set,this.buffer=new z,this.sampling=new S}active(t){const e=this.owner;return!this.closed&&!this.fault&&!e.art.isDestroy&&!e.isStop&&!e.isHide&&t.generation===this.generation}release(t){this.owner.renderer.release(t)}invalidate(){var t;if(this.generation++,null!==this.frame&&window.cancelAnimationFrame(this.frame),this.frame=null,this.owner.timer=null,this.operation){const t=this.operation;this.operation=null,t.cancel(),this.release(t)}null==(t=this.owner.workerClient)||t.cancel(),this.failedItems.clear(),this.buffer.clear(),this.sampling.clear()}report(t){try{this.owner.art.emit("artplayerPluginDanmuku:error",t)}catch(e){console.warn("Failed to report danmuku scheduling error:",e)}}fail(t){this.closed||this.fault||(this.fault=!0,this.invalidate(),this.report(t))}recover(){var t;if(!this.closed&&!this.owner.art.isDestroy&&(this.failedItems.clear(),this.fault))try{null==(t=this.owner.workerClient)||t.dispose(),this.owner.createWorker(),this.fault=!1}catch(e){this.report(e)}}schedule(){const t=this.owner;if(!(!this.running||this.closed||this.fault||t.art.isDestroy||t.isStop)){try{const e=t.art.video;(t.art.playing||!1===(null==e?void 0:e.paused)&&!e.ended&&e.readyState>2)&&!t.isHide&&this.sampling.begin(t)}catch(e){return void this.fail(e)}null===this.frame&&(this.frame=window.requestAnimationFrame(()=>{if(this.frame=null,t.timer=null,this.closed||this.fault||t.isStop||t.art.isDestroy)return;const i=this.generation;try{if(t.art.playing&&!t.isHide){t.filter("emit",e=>{const i=Date.now();e.$restTime-=(i-e.$lastStartTime)/1e3,e.$lastStartTime=i,e.$restTime<=0&&t.makeWait(e)});const e=t.art.currentTime,n=t.readys;if(i!==this.generation)return;this.buffer.capture(this.sampling.capture(t,n,e),this.failedItems)}}catch(e){return void(i===this.generation&&this.fail(e))}if(this.schedule(),this.operation||!t.art.playing||t.isHide)return;const n=this.buffer.take();if(!n.length)return;let s;const a=new Promise(t=>s=()=>t(E)),r={generation:this.generation,cancel:s,wait:t=>Promise.race([t,a]),ref:null};return this.operation=r,this.run(r,n).catch(t=>{this.active(r)&&this.fail(t)}).finally(()=>{this.release(r),this.operation===r&&(this.operation=null,this.buffer.complete())})}),t.timer=this.frame)}}run(t,e){return h(this,null,function*(){const i=this.owner;if(i.art.playing&&this.active(t))for(const s of e){if(!this.active(t))return;if(this.failedItems.has(s))continue;let e;try{e=yield t.wait(i.option.beforeVisible(s))}catch(n){if(!this.active(t))return;this.failedItems.add(s),this.report(n);continue}if(!this.active(t))return;if(!e)continue;const{clientWidth:a,clientHeight:r}=i.$player,o=i.renderer.prepare(s,t);if(!this.active(t))return;s.$lastStartTime=Date.now(),s.$restTime=i.speed;const l=a+o.clientWidth,d={type:"getDanmuTop",target:{mode:s.mode,height:o.clientHeight,speed:l/s.$restTime},visibles:i.visibles,antiOverlap:i.option.antiOverlap,clientWidth:a,clientHeight:r,marginBottom:i.marginBottom,marginTop:i.marginTop},h=d.antiOverlap?yield t.wait(i.postMessage(d)):{result:M(d)},c="symbol"===typeof h?void 0:h.result;if(!this.active(t)||s.$ref!==o)return;void 0!==c?(s.$lastStartTime=Date.now(),i.setState(s,"emit"),i.renderer.place(s,o,c,l,a),t.ref=null,i.art.emit("artplayerPluginDanmuku:visible",s)):(i.setState(s,"ready"),this.release(t))}})}destroy(){this.closed=!0,this.invalidate(),this.sampling.destroy()}}let C=0;class D{constructor(t,e){this.pending=new Map,this.closed=!1,this.failed=!1,this.onFailure=e,this.worker=t();try{this.worker.onmessage=t=>{var e;const i=this.pending.get(null==(e=t.data)?void 0:e.id);i&&(this.pending.delete(t.data.id),i.resolve(t.data))},this.worker.onerror=t=>{var e;null==(e=t.preventDefault)||e.call(t),this.fail(t.error||t)},this.worker.onmessageerror=t=>this.fail(t.error||t)}catch(i){try{this.dispose()}catch(n){}throw i}}request(t){t.id=++C;const{id:e}=t;return this.closed||this.failed?Promise.resolve({id:e,result:void 0}):new Promise((i,n)=>{this.pending.set(e,{resolve:i,reject:n});try{this.worker.postMessage(t)}catch(s){this.fail(s)}})}fail(t){if(!this.closed&&!this.failed){this.failed=!0;for(const e of this.pending.values())e.reject(t);this.pending.clear();try{this.dispose()}catch(e){}this.onFailure(t)}}cancel(){for(const[t,e]of this.pending)e.resolve({id:t,result:void 0});this.pending.clear()}dispose(){if(this.closed)return;this.closed=!0,this.cancel();let t,e=!1;const i=i=>{try{i()}catch(n){e||(t=n),e=!0}};for(const n of["onmessage","onerror","onmessageerror"])i(()=>this.worker[n]=null);if(i(()=>this.worker.terminate()),e)throw t}}const P='/*!\n * artplayer-plugin-danmuku.js v5.3.0\n * Github: https://github.com/zhw2590582/ArtPlayer\n * (c) 2017-2026 Harvey Zhao\n * Released under the MIT License.\n */\nfunction t({target:t,visibles:e,clientWidth:i,clientHeight:h,marginBottom:n,marginTop:o,antiOverlap:s}){const r=h-n,p=e.filter(e=>e.mode===t.mode&&e.top<=r).sort((t,e)=>t.top-e.top);if(0===p.length)return 2===t.mode?r-t.height:o;if(p.unshift({type:"top",top:0,left:0,right:0,height:o,width:i,speed:0,distance:i}),p.push({type:"bottom",top:r,left:0,right:0,height:n,width:i,speed:0,distance:i}),2===t.mode)for(let g=p.length-2;g>=0;g-=1){const e=p[g],i=p[g+1],h=e.top+e.height;if(i.top-h>=t.height)return i.top-t.height}else for(let g=1;g=t.height)return h}const a=[];for(let g=1;g{const i=Math.min(...e.map(t=>t.right)),h=Math.min(...t.map(t=>t.right));return i*e.length-h*t.length});break;case 1:case 2:a.sort((t,e)=>{const i=Math.max(...e.map(t=>t.width));return Math.max(...t.map(t=>t.width))*t.length-i*e.length})}return a[0][0].top}switch(t.mode){case 0:{const e=a.find(e=>e.every(e=>{if(ie.time}));return e&&e[0]?e[0].top:void 0}case 1:case 2:return}}onmessage=e=>{const{data:i}=e;if(!i.id||!i.type)return;const h=(0,{getDanmuTop:t}[i.type])(i);globalThis.postMessage({result:h,id:i.id})};\n',T="undefined"!==typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",P],{type:"text/javascript;charset=utf-8"});function L(t){let e;try{if(e=T&&(self.URL||self.webkitURL).createObjectURL(T),!e)throw"";const i=new Worker(e,{type:"module",name:null==t?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch(i){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(P),{type:"module",name:null==t?void 0:t.name})}}class O{constructor(t,e){const{constructor:i,template:n}=t;this.utils=i.utils,this.validator=i.validator,this.$danmuku=n.$danmuku,this.$player=n.$player,this.art=t,this.queue=[],this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.index=0,this.worker=null,this.workerClient=null,this.renderer=new $(this),this.scheduler=new F(this),this.option=O.option,this.states={wait:[],ready:[],emit:[],stop:[]},this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.resize=this.resize.bind(this),this.destroy=this.destroy.bind(this),this.seek=this.seek.bind(this),k(this),t.on("destroy",this.destroy);try{if(this.config(e,!0),!k(this))return;this.createWorker()}catch(s){throw t.off("destroy",this.destroy),x(this),this.scheduler.destroy(),s}t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("resize",this.resize),t.on("video:seeking",this.seek),this.load().catch(t=>console.warn("Failed to load initial danmuku:",t))}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,width:512,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,emitter:!0,maxLength:200,lockTime:5,theme:"dark",OPACITY:{},FONT_SIZE:{},MARGIN:{},SPEED:{},COLOR:[]}}static get scheme(){return{danmuku:"array|function|string|promise",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement|string",heatmap:"object|boolean",width:"number",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",emitter:"boolean",maxLength:"number",lockTime:"number",theme:"string",OPACITY:"object",FONT_SIZE:"object",MARGIN:"object",SPEED:"object",COLOR:"array"}}static get cssText(){return'\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n '}get isRotate(){var t,e;return null==(e=null==(t=this.art.plugins)?void 0:t.autoOrientation)?void 0:e.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return O.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"===typeof e)return t(e,0,i);if("string"===typeof e&&e.endsWith("%")){return t(i*(Number.parseFloat(e)/100),0,i)}return O.option.margin[1]}get fontSize(){const{clamp:t}=this.utils,{clientHeight:e}=this.$player,i=this.option.fontSize;if("number"===typeof i)return Math.round(t(i,12,e));if("string"===typeof i&&i.endsWith("%")){const n=Number.parseFloat(i)/100;return Math.round(t(e*n,12,e))}return O.option.fontSize}get $ref(){return this.renderer.acquire()}get readys(){return function(t){const{currentTime:e}=t.art,i=[];return b(t,"ready",t=>i.push(t)),b(t,"wait",t=>{e+.1>=t.time&&t.time>=e-.1&&i.push(t)}),i}(this)}get visibles(){return this.renderer.visibles}get speed(){return this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed}load(t){return h(this,null,function*(){const{errorHandle:e}=this.utils,i=function(t,e){const i=w(t);if(e)for(const d of[...i.tasks])d.replace&&d.cancel();let n,s=i.closed||t.art.isDestroy;const a=new Promise(t=>n=t),r=new Set,o="function"===typeof AbortController?new AbortController:void 0,l={replace:e,signal:null==o?void 0:o.signal,active:()=>!s&&!i.closed&&!t.art.isDestroy,onCancel:t=>l.active()?(r.add(t),()=>r.delete(t)):(t(),()=>{}),cancel(){if(!s){s=!0,n(v),null==o||o.abort();for(const t of[...r])t();r.clear()}},wait:t=>Promise.race([t,a]),emit(e){i.emitting.push(l);try{return t.emit(e)}finally{i.emitting.pop()}},finish(){i.tasks.delete(l),r.clear()}};return s?n(v):i.tasks.add(l),l}(this,void 0===t);try{if(!i.active())return this;const n=function(t,e){return"function"===typeof t?{asynchronous:!0,value:t()}:c(t)?{asynchronous:!0,value:t}:"string"===typeof t?{asynchronous:!0,value:g(t,e)}:{asynchronous:!1,value:Array.isArray(t)?t:[]}}(t||this.option.danmuku,i),s=n.asynchronous?yield i.wait(n.value):n.value;if(!i.active())return this;e(Array.isArray(s),"Danmuku need return an array as result");const a=s;if(void 0===t){if(this.reset(),!i.active())return this;this.queue=[],this.states={wait:[],ready:[],emit:[],stop:[]},this.renderer.clear()}for(let t=0;t{const e=s[t],i=a[t];return"function"===typeof e||"function"===typeof i||c(e)||c(i)?e!==i:JSON.stringify(e)!==JSON.stringify(i)}))&&!e)return this;const r=function(t,e,{defaults:i,validate:n,clamp:s,mount:a}){const r=Object.assign({},i,t,e);return n(r),r.mode=s(r.mode,0,2),r.speed=s(r.speed,1,10),r.opacity=s(r.opacity,0,1),r.lockTime=s(r.lockTime,1,60),r.maxLength=s(r.maxLength,1,1e3),r.mount=r.mount||a,r}(this.option,t,{defaults:O.option,validate:t=>this.validator(t,O.scheme),clamp:i,mount:n});if(!k(this))return this;const o=this.option.beforeVisible!==r.beforeVisible;return this.option=r,o&&(this.scheduler.invalidate(),this.scheduler.schedule()),t.fontSize&&(this.reset(),!k(this))||(this.option.visible?this.show():this.hide(),k(this)&&this.art.emit("artplayerPluginDanmuku:config",this.option)),this}getLeft(t){return this.renderer.left(t)}postMessage(t={}){return this.workerClient.request(t)}createWorker(){this.workerClient=new D(()=>new L,t=>this.scheduler.fail(t)),this.worker=this.workerClient.worker}filter(t,e){return b(this,t,e)}setState(t,e){!function(t,e,i){t.states[e.$state]=t.states[e.$state].filter(t=>t!==e),e.$state=i,e.$ref&&(e.$ref.dataset.state=i),t.states[i].push(e)}(this,t,e)}makeWait(t){this.renderer.makeWait(t)}update(){return this.scheduler.running=!0,this.scheduler.schedule(),this}resize(){this.renderer.resize()}continue(){return this.renderer.continue(),this}suspend(){return this.renderer.suspend(),this}stop(){return this.isStop=!0,this.scheduler.running=!1,this.scheduler.invalidate(),this.suspend(),this.art.emit("artplayerPluginDanmuku:stop"),this}start(){if(this.scheduler.closed||this.art.isDestroy)return this;const t=++this.scheduler.starts,e=this.scheduler.generation;this.isStop=!1,this.scheduler.recover();return this.scheduler.closed||this.art.isDestroy||this.isStop||this.scheduler.fault||e!==this.scheduler.generation||t!==this.scheduler.starts||(this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")),this}reset(){return this.scheduler.invalidate(),this.queue.forEach(t=>this.makeWait(t)),this.art.emit("artplayerPluginDanmuku:reset"),this.scheduler.recover(),this.scheduler.schedule(),this}seek(){this.scheduler.invalidate(),this.scheduler.schedule()}show(){return this.isHide=!1,this.$danmuku.style.opacity=1,this.option.visible=!0,this.art.emit("artplayerPluginDanmuku:show"),this}hide(){return this.isHide=!0,this.scheduler.invalidate(),this.$danmuku.style.opacity=0,this.option.visible=!1,this.art.emit("artplayerPluginDanmuku:hide"),this.scheduler.schedule(),this}destroy(){var t;x(this),this.scheduler.destroy();try{try{this.stop()}finally{null==(t=this.workerClient)||t.dispose()}}finally{this.renderer.destroy(),this.art.off("video:play",this.start),this.art.off("video:playing",this.start),this.art.off("video:pause",this.stop),this.art.off("video:waiting",this.stop),this.art.off("resize",this.resize),this.art.off("video:seeking",this.seek),this.art.off("destroy",this.destroy),this.art.emit("artplayerPluginDanmuku:destroy")}}}const A=4294967295;function H(t,e){let i=0,n=t.length;for(;iNumber.isFinite(t)&&t>0))return null;const o={xMin:0,xMax:t,yMin:0,yMax:128,scale:.25,opacity:.2,minHeight:Math.floor(.05*e),sampling:Math.max(1,Math.floor(t/100)),smoothing:.2,flattening:.2},l=Object.assign({},"object"===typeof s?s:{}),d=Object.assign({},o,l);for(const r of Object.keys(o))Number.isFinite(d[r])||(d[r]=o[r]);if(d.sampling<=0&&(d.sampling=o.sampling),d.xMin===d.xMax||d.yMin===d.yMax)return null;const h=Array.isArray(a)&&a.length>0,c=h?[...a]:function(t,e,i,n){if(!Number.isFinite(e)||e<=0||!Number.isFinite(i)||i<=0||!Number.isFinite(n)||n<=0||Math.floor(e/n)+1>A)return[];const s=t.map(t=>t.time).filter(t=>"number"===typeof t&&!Number.isNaN(t)).sort((t,e)=>t-e),a=[],r=i/e;if(!Number.isFinite(r))return[];for(let o=0;o<=e;o+=n){if(a.length>=A||o+n===o)return[];const t=o*r,e=(o+n)*r;a.push([o,H(s,e)-H(s,t)])}return a}(n,t,i,d.sampling);if(!c.length||!c.every(t=>Array.isArray(t)&&Number.isFinite(t[0])&&Number.isFinite(t[1])))return null;const p=c[c.length-1];if(p[0]!==t){if(c.length===A)return null;c.push([t,p[1]])}let u=1/0,m=-1/0;for(const r of c)u=Math.min(u,r[1]),m=Math.max(m,r[1]);const f=(u+m)/2;for(const r of c){const t=r[1];r[1]=t*(t>f?1+d.scale:1-d.scale)+d.minHeight}const g=!h&&!Number.isFinite(l.yMin)&&!Number.isFinite(l.yMax);let y=0;for(const r of c)y=Math.max(y,r[1]);const v=g&&y>o.yMax/4;v&&(d.yMax=4*y);const w=t=>v?Math.min(e,Math.max(.75*e,t)):t,k=(t,e,i,n)=>{const s=function(t,e){const i=e[0]-t[0],n=e[1]-t[1];return{length:Math.sqrt(r(i,2)+r(n,2)),angle:Math.atan2(n,i)}}(e||t,i||t),a=N(Math.cos(s.angle)*d.flattening,0,1,1,0),o=s.angle*a+(n?Math.PI:0),l=s.length*d.smoothing;return[t[0]+Math.cos(o)*l,w(t[1]+Math.sin(o)*l)]},x=c.map(i=>[N(i[0],d.xMin,d.xMax,0,t),w(N(i[1],d.yMin,d.yMax,e,0))]);if(!x.every(t=>t.every(Number.isFinite)))return null;const b=x.map((t,i,n)=>{if(0===i)return`M ${n[n.length-1][0]},${e} L ${t[0]},${e} L ${t[0]},${t[1]}`;const s=k(n[i-1],n[i-2],t),a=k(t,n[i-1],n[i+1],!0);return`C ${s[0]},${s[1]} ${a[0]},${a[1]} ${t[0]},${t[1]}${i===n.length-1?" z":""}`}).join(" ");return/NaN|Infinity/u.test(b)?null:{path:b,opacity:d.opacity,width:t,height:e}}let j=0;function q(t,e,i){if(t.isDestroy)return;const{query:n}=t.constructor.utils;let s;const a=[];let r,o,l,d=!1;const h=()=>!d&&!t.isDestroy;function c(e,i){const n=i;a.push([e,n]),t.on(e,n)}function p(e){if(d)return;let i;d=!0,o=null,l=null;let n=!1;const s=t=>{try{t()}catch(e){n||(i=e),n=!0}};for(const[r,o]of a.splice(0))s(()=>t.off(r,o));if(e&&r&&t.controls.heatmap===r&&s(()=>t.controls.remove("heatmap")),r=void 0,n)throw i}function u(t){h()&&o&&l&&(o.setAttribute("offset",100*t+"%"),l.setAttribute("offset",100*t+"%"))}function m(a){try{!function(a=[]){if(!h())return;o=null,l=null;const d=r;if(d.innerHTML="",t.option.isLive)return;const c=V({width:d.offsetWidth,height:d.offsetHeight,duration:t.duration,queue:e.queue,option:i,points:a});if(!c||!h())return;const p=d.ownerDocument;for(s||(s=p?"heatmap-solids":"heatmap-solids-"+ ++j);null==p?void 0:p.getElementById(s);)s="heatmap-solids-"+ ++j;d.innerHTML=`\n \n \n \n \n \n \n \n \n \n \n \n `,o=n("#heatmap-start",d),l=n("#heatmap-stop",d),u(t.played)}(a)}catch(d){try{p(!0)}catch(c){}throw d}}c("destroy",()=>p(!0));try{t.controls.add({name:"heatmap",position:"top",html:"",style:{position:"absolute",top:"-100px",left:"0px",right:"0px",height:"100px",width:"100%",pointerEvents:"none"},beforeUnmount(){p(!1)},mounted(e){if(r=e,d)return t.controls.heatmap===e&&t.controls.remove("heatmap"),void(r=void 0);h()?(c("video:timeupdate",()=>u(t.played)),c("setBar",(t,e)=>{"played"===t&&u(e)}),c("ready",()=>m()),c("resize",()=>m()),c("artplayerPluginDanmuku:loaded",()=>m()),c("artplayerPluginDanmuku:points",t=>m(t))):p(!0)}})}catch(f){try{p(!0)}catch(g){}throw f}return()=>p(!0)}const I=new WeakMap;class B{constructor(t){this.art=t,this.closed=!1,this.disposers=new Set,this.cancelled=new Promise(t=>this.cancel=t)}get active(){return!this.closed&&!this.art.isDestroy}own(t){this.closed?t():this.disposers.add(t)}write(t,e,i,n=i=>t[e]=i){const s=t;if(!this.active)return;const a=()=>"function"===typeof s.getPropertyPriority?s.getPropertyPriority(e):void 0;let r=I.get(s);r||(r=new Map,I.set(s,r));let o=r.get(e);o||(o={original:s[e],present:e in s||void 0!==s[e],priority:a(),owners:new Map,apply:n},r.set(e,o)),o.owners.has(this)||this.own(()=>{const t=[...o.owners.keys()],i=t[t.length-1]===this;if(o.owners.delete(this),i&&s[e]===o.last&&a()===o.lastPriority){const t=[...o.owners.values()];t.length?(o.apply(t[t.length-1]),o.last=s[e],o.lastPriority=a()):void 0!==o.priority?s.setProperty(e,o.original,o.priority):o.present?o.apply(o.original):delete s[e]}o.owners.size||(r.delete(e),r.size||I.delete(s))}),o.owners.delete(this),o.owners.set(this,i),o.apply(i),o.last=s[e],o.lastPriority=a()}on(t,e){if(!this.active)return;const i=this;function n(...t){if(i.active)return e.apply(this,t)}const s=()=>this.art.off(t,n);this.own(s);try{this.art.on(t,n),this.active||s()}catch(a){throw this.release(s),a}}proxy(t,e,i){if(!this.active)return;const n=this;function s(...t){if(n.active)return i.apply(this,t)}let a;const r=()=>{var i,n;if("function"===typeof a){const t=this.art.events;"function"===typeof(null==t?void 0:t.remove)&&(null==(i=t.destroyEvents)?void 0:i.has(a))?t.remove(a):a()}else null==(n=t.removeEventListener)||n.call(t,e,s)};this.own(r);try{a=this.art.proxy(t,e,s),this.active||r()}catch(o){throw this.release(r),o}}wait(t){return Promise.race([t,this.cancelled])}release(t){try{t()}catch(e){console.warn("Failed to dispose danmuku setting resource:",e)}}close(){if(!this.closed){this.closed=!0,this.cancel();for(const t of this.disposers)this.release(t);this.disposers.clear()}}}function R({min:t,max:e,container:i,findIndex:n,onChange:s,steps:a=[]}){const{lifecycle:r}=this;if(!r.active)return{reset(){}};const{query:o,clamp:l,setStyle:d}=this.utils;d(i,"touch-action","none"),i.innerHTML=`\n

\n
\n ${a.map(()=>'
').join("")}\n
\n
\n
\n
\n
\n ${a.map(t=>t.hide?"":`
${t.name}
`).join("")}\n
\n `;const h=o(".apd-slider-dot",i),c=o(".apd-slider-progress",i);let p=!1;function u(i){if(!r.active)return;if(void 0===i&&(i=n()),ie)return;const o=(i-t)/(e-t);h.style.left=100*o+"%",0===a.length&&(c.style.width=h.style.left),s(i)}function m(n){const{top:s,height:a,left:r,width:o}=i.getBoundingClientRect();if(this.art.isRotate){const i=l(n.clientY-s,0,a);u(Math.round(i/a*(e-t)+t))}else{const i=l(n.clientX-r,0,o);u(Math.round(i/o*(e-t)+t))}}return r.own(()=>p=!1),r.proxy(i,"click",t=>{m.call(this,t)}),r.proxy(i,"pointerdown",t=>{p=0===t.button}),r.on("document:pointermove",t=>{p&&m.call(this,t)}),r.on("document:pointerup",t=>{p&&(p=!1,m.call(this,t))}),{reset:u}}const Z='',W='',_='',U='',G='',X='',Y='',J='',K='',Q='',tt='',et='';function it(){const{option:t}=this;return`\n
\n ${tt}${Q}\n
\n
\n ${_}\n
\n
\n
\n \u6309\u7c7b\u578b\u5c4f\u853d\n
\n
\n ${U}${G}\n
\u6eda\u52a8
\n
\n
\n ${X}${Y}\n
\u9876\u90e8
\n
\n
\n ${J}${K}\n
\u5e95\u90e8
\n
\n
\n
\n
\n
\n ${W}${Z}\n \u9632\u6b62\u5f39\u5e55\u91cd\u53e0\n
\n
\n ${W}${Z}\n \u540c\u6b65\u89c6\u9891\u901f\u5ea6\n
\n
\n
\n \u4e0d\u900f\u660e\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n \u663e\u793a\u533a\u57df\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u5b57\u53f7\n
\n
\u672a\u77e5
\n
\n
\n \u5f39\u5e55\u901f\u5ea6\n
\n
\u672a\u77e5
\n
\n
\n
\n
\n
\n
\n ${et}\n
\n
\n
\n \u6a21\u5f0f\n
\n
\n ${G}\n
\u6eda\u52a8
\n
\n
\n ${Y}\n
\u9876\u90e8
\n
\n
\n ${K}\n
\u5e95\u90e8
\n
\n
\n
\n
\n \u989c\u8272\n
\n ${this.COLOR.map(t=>`
`).join("")}\n
\n
\n
\n
\n
\n \n
\u53d1\u9001
\n
\n `}if("undefined"!==typeof document){const t="artplayer-plugin-danmuku",e=Symbol.for("artplayer-plugin-danmuku.pending-style"),i=document;let n=document.getElementById(t)||i[e];if(!n)if(n=document.createElement("style"),n.id=t,"loading"===document.readyState){i[e]=n;const s=()=>{document.removeEventListener("DOMContentLoaded",s),i[e]===n&&delete i[e];const a=document.getElementById(t);a?a.textContent=n.textContent:(document.head||document.documentElement).appendChild(n)};document.addEventListener("DOMContentLoaded",s,{once:!0})}else(document.head||document.documentElement).appendChild(n);n.textContent='.artplayer-plugin-danmuku{display:flex;position:relative;z-index:99;align-items:center;justify-content:center;font-size:12px;height:32px;width:100%;color:#fff;font-weight:300;flex-shrink:0;gap:10px}.artplayer-plugin-danmuku .apd-icon{cursor:pointer;opacity:.75;transition:all .2s ease;fill:#fff}.artplayer-plugin-danmuku .apd-icon:hover{opacity:1}.artplayer-plugin-danmuku .apd-config{display:flex;position:relative}.artplayer-plugin-danmuku .apd-config .apd-config-panel{position:absolute;bottom:24px;left:0;width:320px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-config .apd-config-panel .apd-config-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-config:hover .apd-config-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-config-mode,.artplayer-plugin-danmuku .apd-config-slider,.artplayer-plugin-danmuku .apd-config-other,.artplayer-plugin-danmuku .apd-style-mode{margin-bottom:15px}.artplayer-plugin-danmuku .apd-modes{display:flex;align-items:center;margin-top:5px;gap:20px}.artplayer-plugin-danmuku .apd-modes .apd-mode{cursor:pointer;text-align:center}.artplayer-plugin-danmuku .apd-modes .apd-mode:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-config-slider{display:flex;align-items:center;gap:12px}.artplayer-plugin-danmuku .apd-config-slider .apd-value{width:32px;text-align:right}.artplayer-plugin-danmuku .apd-slider{position:relative;flex:1;display:flex;height:20px;align-items:center;justify-content:center;cursor:pointer}.artplayer-plugin-danmuku .apd-slider .apd-slider-line{position:relative;height:2px;width:100%;overflow:hidden;border-radius:3px;background-color:#ffffff40}.artplayer-plugin-danmuku .apd-slider .apd-slider-points{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between}.artplayer-plugin-danmuku .apd-slider .apd-slider-points .apd-slider-point{width:2px;height:2px;border-radius:50%;background-color:#ffffff80}.artplayer-plugin-danmuku .apd-slider .apd-slider-progress{width:0%;height:100%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-dot{position:absolute;transform:translate(-6px);left:0%;width:12px;height:12px;border-radius:50%;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps{display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:-12px;width:calc(100% + 32px);color:#777}.artplayer-plugin-danmuku .apd-slider .apd-slider-steps .apd-slider-step{flex-shrink:0;width:36px;text-align:center;scale:.95}.artplayer-plugin-danmuku .apd-config-other{display:flex;align-items:center;gap:20px}.artplayer-plugin-danmuku .apd-config-other .apd-check-off,.artplayer-plugin-danmuku .apd-config-other .apd-check-on{width:16px;height:16px}.artplayer-plugin-danmuku .apd-config-other .apd-other{display:flex;align-items:center;cursor:pointer;gap:2px}.artplayer-plugin-danmuku .apd-config-other .apd-other:hover{color:#00a1d6}.artplayer-plugin-danmuku .apd-emitter{display:flex;flex:1;align-items:center;height:100%;background-color:#ffffff40;border-radius:5px}.artplayer-plugin-danmuku .apd-style{position:relative;display:flex;align-items:center;justify-content:center}.artplayer-plugin-danmuku .apd-style .apd-style-panel{position:absolute;bottom:24px;left:0;width:200px;padding:10px;opacity:0;pointer-events:none}.artplayer-plugin-danmuku .apd-style .apd-style-panel .apd-style-panel-inner{width:100%;border-radius:3px;background-color:#000000d9;padding:10px}.artplayer-plugin-danmuku .apd-style:hover .apd-style-panel{opacity:100;pointer-events:all}.artplayer-plugin-danmuku .apd-colors{display:flex;flex-wrap:wrap;margin-top:5px;gap:8px}.artplayer-plugin-danmuku .apd-colors .apd-color{width:16px;height:16px;border-radius:2px;cursor:pointer}.artplayer-plugin-danmuku .apd-colors .apd-color.apd-active{border:1px solid black;box-shadow:0 0 0 1px #fff}.artplayer-plugin-danmuku .apd-input{outline:none;height:100%;flex:1;min-width:0;width:auto;border:none;line-height:1;color:#fff;background-color:transparent}.artplayer-plugin-danmuku .apd-input::placeholder{color:#ffffff80}.artplayer-plugin-danmuku .apd-send{display:flex;align-items:center;justify-content:center;height:100%;width:60px;flex-shrink:0;cursor:pointer;text-shadow:none;border-top-right-radius:5px;border-bottom-right-radius:5px;background-color:#00a1d6}.artplayer-plugin-danmuku .apd-send.apd-lock{cursor:not-allowed;color:#666;background-color:#e7e7e7}.art-controls-center .apd-emitter{width:260px;flex:none}.art-fullscreen .artplayer-plugin-danmuku,.art-fullscreen-web .artplayer-plugin-danmuku{height:38px;gap:16px}.art-fullscreen .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen-web .artplayer-plugin-danmuku .apd-config-icon,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-off,.art-fullscreen .artplayer-plugin-danmuku .apd-toggle-on,.art-fullscreen-web .artplayer-plugin-danmuku .apd-toggle-on{width:28px;height:28px}.art-fullscreen .artplayer-plugin-danmuku .apd-emitter,.art-fullscreen-web .artplayer-plugin-danmuku .apd-emitter{width:400px;flex:none}.art-video-player>.artplayer-plugin-danmuku{position:absolute;left:0;right:0;bottom:-40px;padding:0 10px}.art-video-player:has(>.artplayer-plugin-danmuku){margin-bottom:40px}[data-danmuku-emitter=false] .apd-emitter{display:none!important}[data-danmuku-emitter=false] .art-controls-center .artplayer-plugin-danmuku{justify-content:flex-end;gap:18px}[data-danmuku-emitter=false].art-fullscreen .art-controls-center .artplayer-plugin-danmuku,[data-danmuku-emitter=false].art-fullscreen-web .art-controls-center .artplayer-plugin-danmuku{gap:24px}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-icon{fill:#333}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-emitter{background-color:#f1f2f3}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input{color:#000}[data-danmuku-theme=light]>.artplayer-plugin-danmuku .apd-input::placeholder{color:#0000004d}[data-danmuku-visible=false] .apd-toggle-off{display:block}[data-danmuku-visible=false] .apd-toggle-on,[data-danmuku-visible=true] .apd-toggle-off{display:none}[data-danmuku-visible=true] .apd-toggle-on{display:block}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-on{display:none}[data-danmuku-anti-overlap=false] .apd-anti-overlap .apd-check-off,[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-on{display:block}[data-danmuku-anti-overlap=true] .apd-anti-overlap .apd-check-off,[data-danmuku-sync-video=false] .apd-sync-video .apd-check-on{display:none}[data-danmuku-sync-video=false] .apd-sync-video .apd-check-off,[data-danmuku-sync-video=true] .apd-sync-video .apd-check-on{display:block}[data-danmuku-sync-video=true] .apd-sync-video .apd-check-off{display:none}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-off{display:block}[data-danmuku-mode0=false] .apd-config-mode .apd-mode-0-on{display:none}[data-danmuku-mode0=false] .art-danmuku [data-mode="0"]{opacity:0!important}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-off{display:none}[data-danmuku-mode0=true] .apd-config-mode .apd-mode-0-on{display:block}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"]{color:#00a1d6}[data-danmuku-mode="0"] .apd-style-mode [data-mode="0"] path{fill:#00a1d6}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-off{display:block}[data-danmuku-mode1=false] .apd-config-mode .apd-mode-1-on{display:none}[data-danmuku-mode1=false] .art-danmuku [data-mode="1"]{opacity:0!important}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-off{display:none}[data-danmuku-mode1=true] .apd-config-mode .apd-mode-1-on{display:block}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"]{color:#00a1d6}[data-danmuku-mode="1"] .apd-style-mode [data-mode="1"] path{fill:#00a1d6}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-off{display:block}[data-danmuku-mode2=false] .apd-config-mode .apd-mode-2-on{display:none}[data-danmuku-mode2=false] .art-danmuku [data-mode="2"]{opacity:0!important}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-off{display:none}[data-danmuku-mode2=true] .apd-config-mode .apd-mode-2-on{display:block}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"]{color:#00a1d6}[data-danmuku-mode="2"] .apd-style-mode [data-mode="2"] path{fill:#00a1d6}'}class nt{constructor(t,e){this.art=t,this.danmuku=e,this.utils=t.constructor.utils;const{setStyle:i}=this.utils,{$controlsCenter:n}=t.template;this.template={$controlsCenter:n,$mount:n,$danmuku:null,$toggle:null,$config:null,$configPanel:null,$configModes:null,$style:null,$stylePanel:null,$styleModes:null,$colors:null,$opacitySlider:null,$opacityValue:null,$marginSlider:null,$marginValue:null,$fontSizeSlider:null,$fontSizeValue:null,$speedSlider:null,$speedValue:null,$input:null,$send:null},this.slider={opacity:null,margin:null,fontSize:null,speed:null},this.emitting=!1,this.isLock=!1,this.timer=null,this.lifecycle=new B(t),this.destroy=this.destroy.bind(this),this.lifecycle.own(()=>t.off("destroy",this.destroy));try{if(t.on("destroy",this.destroy),!this.lifecycle.active)return;if(this.lifecycle.write(n.style,"display","flex",t=>i(n,"display",t)),this.createTemplate(),!this.lifecycle.active)return;if(this.createSliders(),!this.lifecycle.active)return;if(this.createEvents(),this.mount(this.option.mount),!this.lifecycle.active)return;this.lifecycle.on("resize",()=>this.resize()),this.lifecycle.on("fullscreen",t=>this.onFullscreen(t)),this.lifecycle.on("fullscreenWeb",t=>this.onFullscreen(t)),this.lifecycle.proxy(this.template.$config,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$config,$panel:this.template.$configPanel})}),this.lifecycle.proxy(this.template.$style,"mouseenter",()=>{this.onMouseEnter({$control:this.template.$style,$panel:this.template.$stylePanel})})}catch(s){try{this.destroy()}catch(a){console.warn("Failed to roll back danmuku setting:",a)}throw s}}static get icons(){return{$on:tt,$off:Q,$config:_,$style:et,$mode_0_off:U,$mode_0_on:G,$mode_1_off:X,$mode_1_on:Y,$mode_2_off:J,$mode_2_on:K,$check_on:W,$check_off:Z}}get option(){return this.danmuku.option}get outside(){return this.template.$mount!==this.template.$controlsCenter}get TEMPLATE(){return it.call(this)}get OPACITY(){return l({min:0,max:100,steps:[]},this.option.OPACITY)}get FONT_SIZE(){return l({min:12,max:120,steps:[]},this.option.FONT_SIZE)}get MARGIN(){return l({min:0,max:3,steps:[{name:"1/4",value:[10,"75%"]},{name:"\u534a\u5c4f",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"\u6ee1\u5c4f",value:[10,10]}]},this.option.MARGIN)}get SPEED(){return l({min:0,max:4,steps:[{name:"\u6781\u6162",value:10},{name:"\u8f83\u6162",value:7.5,hide:!0},{name:"\u9002\u4e2d",value:5},{name:"\u8f83\u5feb",value:2.5,hide:!0},{name:"\u6781\u5feb",value:1}]},this.option.SPEED)}get COLOR(){return this.option.COLOR.length?this.option.COLOR:["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(t){const{query:e}=this.utils,{$danmuku:i}=this.template;return e(t,i)}append(t,e){if(!this.lifecycle.active)return;const{append:i}=this.utils;[...t.children].includes(e)||i(t,e)}setData(t,e){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,{$mount:n}=this.template;this.lifecycle.write(i.dataset,t,e),this.outside&&this.lifecycle.write(n.dataset,t,e)}createTemplate(){const{createElement:t,tooltip:e}=this.utils,i=t("div");this.template.$danmuku=i,i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$toggle=this.query(".apd-toggle"),this.template.$config=this.query(".apd-config"),this.template.$configPanel=this.query(".apd-config-panel"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$style=this.query(".apd-style"),this.template.$stylePanel=this.query(".apd-style-panel"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send");const{$toggle:n}=this.template;this.lifecycle.on("artplayerPluginDanmuku:show",()=>{e(n,"\u5173\u95ed\u5f39\u5e55")}),this.lifecycle.on("artplayerPluginDanmuku:hide",()=>{e(n,"\u6253\u5f00\u5f39\u5e55")})}createEvents(){const{$toggle:t,$configModes:e,$styleModes:i,$colors:n,$antiOverlap:s,$syncVideo:a,$send:r,$input:o}=this.template;this.lifecycle.proxy(t,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.lifecycle.proxy(e,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(t=>t!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.lifecycle.proxy(s,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.lifecycle.proxy(a,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.lifecycle.proxy(i,"click",t=>{const e=t.target.closest(".apd-mode");if(!e)return;const i=Number(e.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.lifecycle.proxy(n,"click",t=>{const e=t.target.closest(".apd-color");e&&(this.danmuku.config({color:e.dataset.color}),this.reset())}),this.lifecycle.proxy(r,"click",()=>this.emit()),this.lifecycle.proxy(o,"keypress",t=>{"Enter"===t.key&&(t.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider(d(l({},this.OPACITY),{container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:t=>{const{$opacityValue:e}=this.template;e.textContent=`${t}%`,this.danmuku.config({opacity:t/100})}})),this.slider.margin=this.createSlider(d(l({},this.MARGIN),{container:this.template.$marginSlider,findIndex:()=>this.MARGIN.steps.findIndex(t=>t.value[0]===this.option.margin[0]&&t.value[1]===this.option.margin[1]),onChange:t=>{const e=this.MARGIN.steps[t];if(!e)return;const{$marginValue:i}=this.template;i.textContent=e.name,this.danmuku.config({margin:e.value})}})),this.slider.fontSize=this.createSlider(d(l({},this.FONT_SIZE),{container:this.template.$fontSizeSlider,findIndex:()=>this.danmuku.fontSize,onChange:t=>{const{$fontSizeValue:e}=this.template;e.textContent=`${t}px`,t!==this.danmuku.fontSize&&this.danmuku.config({fontSize:t})}})),this.slider.speed=this.createSlider(d(l({},this.SPEED),{container:this.template.$speedSlider,findIndex:()=>this.SPEED.steps.findIndex(t=>t.value===this.option.speed),onChange:t=>{const e=this.SPEED.steps[t];if(!e)return;const{$speedValue:i}=this.template;i.textContent=e.name,this.danmuku.config({speed:e.value})}}))}createSlider(t){return R.call(this,t)}onFullscreen(t){if(!this.lifecycle.active)return;const{$danmuku:e,$controlsCenter:i,$mount:n}=this.template;this.outside?t?this.append(i,e):this.append(n,e):this.append(i,e)}onMouseEnter({$control:t,$panel:e}){if(!this.lifecycle.active)return;const{$player:i}=this.art.template,n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),r=s.width/2-n.width/2,o=a.left-(n.left-r),l=n.right+r-a.right;e.style.left=o>0?`${-r+o}px`:l>0?-r-l+"px":-r+"px"}emit(){return function(t){return h(this,null,function*(){const{lifecycle:e,template:{$input:i}}=t;if(!e.active)return;const n=i.value.trim();if(!n.length||t.isLock||t.emitting)return;const s={text:n,mode:t.option.mode,color:t.option.color,time:t.art.currentTime},a=t=>{e.active&&console.error("Error emitting danmuku:",t)};try{t.emitting=!0;const n=yield e.wait(t.option.beforeEmit(s));if(!e.active)return;if(t.emitting=!1,!0!==n)return;if(s.border=!0,delete s.time,Promise.resolve(t.danmuku.emit(s)).catch(a),!e.active)return;i.value="",t.lock()}catch(r){a(r),e.active&&(t.emitting=!1)}})}(this)}lock(){!function(t){if(!t.lifecycle.active)return;const{addClass:e}=t.utils,{$send:i}=t.template;clearTimeout(t.timer),t.isLock=!0;let n=t.option.lockTime;i.textContent=n,e(i,"apd-lock");const s=()=>{t.timer=setTimeout(()=>{t.lifecycle.active&&(0===n?t.unlock():(n-=1,i.textContent=n,s()))},1e3)};s()}(this)}unlock(){!function(t){if(clearTimeout(t.timer),t.timer=null,t.isLock=!1,!t.lifecycle.active)return;const{removeClass:e}=t.utils,{$send:i}=t.template;i.textContent="\u53d1\u9001",e(i,"apd-lock")}(this)}resize(){if(!this.lifecycle.active)return;if(this.outside)return;if(this.art.fullscreen)return;if(this.art.fullscreenWeb)return;const{$player:t,$controlsCenter:e}=this.art.template,{$danmuku:i}=this.template;this.art.widtht.dataset.color===this.option.color.toUpperCase());a&&t(a,"apd-active"),e(i,this.option.visible?"\u5173\u95ed\u5f39\u5e55":"\u6253\u5f00\u5f39\u5e55"),this.resize()}mount(t){if(!this.lifecycle.active)return;const{errorHandle:e}=this.utils,i="string"===typeof t?document.querySelector(t):t;e(i,`Can not find the mount point: ${t}`),this.append(i,this.template.$danmuku),this.template.$mount=i,this.reset()}destroy(){if(this.lifecycle.closed)return;this.lifecycle.close(),clearTimeout(this.timer),this.timer=null,this.emitting=!1,this.isLock=!1;const t=this.template.$danmuku;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t)}}function st(t){return e=>{const i=new O(e,t);let n;try{n=e.isDestroy?void 0:new nt(e,i),!e.isDestroy&&i.option.heatmap&&q(e,i,i.option.heatmap)}catch(s){try{null==n||n.destroy()}catch(a){}try{i.destroy()}catch(a){}throw s}return{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:n?n.mount.bind(n):()=>{},get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}return st.icons=nt.icons,st}); diff --git a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs b/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs index 616c74f51..5b9fd98ca 100644 --- a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs +++ b/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs @@ -652,6 +652,10 @@ class SamplingWindow { this.waiting = /* @__PURE__ */ new Set(); this.visibility = () => this.clear(); } + begin(owner) { + if (this.time === void 0) + this.capture(owner, [], owner.art.currentTime); + } capture(owner, rows, time) { const doc = owner.$player.ownerDocument; if (doc !== this.document) { @@ -789,7 +793,18 @@ class Scheduler { } schedule() { const owner = this.owner; - if (!this.running || this.closed || this.fault || owner.art.isDestroy || owner.isStop || this.frame !== null) + if (!this.running || this.closed || this.fault || owner.art.isDestroy || owner.isStop) + return; + try { + const video = owner.art.video; + const started = owner.art.playing || video?.paused === false && !video.ended && video.readyState > 2; + if (started && !owner.isHide) + this.sampling.begin(owner); + } catch (error) { + this.fail(error); + return; + } + if (this.frame !== null) return; this.frame = window.requestAnimationFrame(() => { this.frame = null; diff --git a/packages/artplayer-plugin-danmuku/src/sampling-window.ts b/packages/artplayer-plugin-danmuku/src/sampling-window.ts index 9ce94204b..f38309dd6 100644 --- a/packages/artplayer-plugin-danmuku/src/sampling-window.ts +++ b/packages/artplayer-plugin-danmuku/src/sampling-window.ts @@ -9,6 +9,11 @@ export default class SamplingWindow { private document: Document | undefined private visibility = () => this.clear() + begin(owner: Danmuku) { + if (this.time === undefined) + this.capture(owner, [], owner.art.currentTime) + } + capture(owner: Danmuku, rows: DanmuItem[], time: number) { const doc = owner.$player.ownerDocument if (doc !== this.document) { diff --git a/packages/artplayer-plugin-danmuku/src/scheduler.ts b/packages/artplayer-plugin-danmuku/src/scheduler.ts index ae408cc35..434881c34 100644 --- a/packages/artplayer-plugin-danmuku/src/scheduler.ts +++ b/packages/artplayer-plugin-danmuku/src/scheduler.ts @@ -105,7 +105,20 @@ export default class Scheduler { schedule() { const owner = this.owner - if (!this.running || this.closed || this.fault || owner.art.isDestroy || owner.isStop || this.frame !== null) + if (!this.running || this.closed || this.fault || owner.art.isDestroy || owner.isStop) + return + try { + // The public playing getter requires currentTime > 0; native play can start at zero. + const video = owner.art.video + const started = owner.art.playing || (video?.paused === false && !video.ended && video.readyState > 2) + if (started && !owner.isHide) + this.sampling.begin(owner) + } + catch (error) { + this.fail(error) + return + } + if (this.frame !== null) return this.frame = window.requestAnimationFrame(() => { this.frame = null diff --git a/refactor/baselines/danmuku-start-validation.json b/refactor/baselines/danmuku-start-validation.json new file mode 100644 index 000000000..419396f79 --- /dev/null +++ b/refactor/baselines/danmuku-start-validation.json @@ -0,0 +1,8739 @@ +{ + "schemaVersion": 1, + "task": "PKG-DANMUKU-START-01", + "status": "done", + "verifiedAt": "2026-09-15T16:12:04.996Z", + "startedFrom": "b5f8b5e28e33cfb44e7aa93089b6dfbf247142f0", + "node": "v24.21.0", + "yarn": "1.22.22", + "cause": "The first sampling timestamp and waiting identities were captured only inside RAF. A CPU gap preceding the first RAF had no earlier interval to recover. Native play at time zero also precedes the legacy public playing getter becoming true.", + "resolution": "Seed the private sampling window when a visible scheduler begins actual playback, before requesting RAF; repeated starts retain the anchor. Native unpaused/non-ended media with readyState > 2 can seed time zero. No public getter or dispatch semantics changed.", + "originalInstalledFailure": { + "directory": "refactor/.cache/ci-installed-webkit-bb2c12df3", + "reportSha256": "636898035f3d717ee6a5b7f657e901ab8d0c3f1383ca5ef75ec73ed4ae251a65", + "stats": { + "startTime": "2026-09-15T15:02:36.299Z", + "duration": 1214859.678, + "expected": 694, + "skipped": 138, + "unexpected": 13, + "flaky": 0 + }, + "cases": [ + { + "title": "candidate: native main-thread-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "unexpected", + "duration": 4950, + "retry": 0, + "errors": [ + { + "location": { + "file": "D:\\github\\ArtPlayer\\test\\browser\\danmuku-timing-diagnostic.spec.js", + "column": 37, + "line": 117 + }, + "message": "Error: \u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).\u001b[22mtoEqual\u001b[2m(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m) // deep equality\u001b[22m\n\n\u001b[32m- Expected - 1\u001b[39m\n\u001b[31m+ Received + 4\u001b[39m\n\n\u001b[32m- Array []\u001b[39m\n\u001b[31m+ Array [\u001b[39m\n\u001b[31m+ \"first\",\u001b[39m\n\u001b[31m+ \"middle\",\u001b[39m\n\u001b[31m+ ]\u001b[39m\n\n 115 | }\n 116 | if (implementation === 'candidate') {\n> 117 | expect(observation.missing).toEqual([])\n | ^\n 118 | expect(observation.visible.map(row => row.id)).toEqual(['first', 'middle', 'sentinel'])\n 119 | }\n 120 | await page.evaluate(() => window.art.destroy())\n at D:\\github\\ArtPlayer\\test\\browser\\danmuku-timing-diagnostic.spec.js:117:37" + } + ], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-cRduve\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "708d4eb455c1bffae284d2208c915ca3534bcb59731dd570bff65c5a39ca7f36", + "archiveSha256": "f885cebdc07105770a7e5ca9cc0aacc0e891864bc24ff926d319bbb2dc1c3f49", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "e60b4aa5b17264928019527403a239e7d216eb08969098da6d0581ba3dd9fa88", + "src/scheduler.ts": "d3493d28a6222edf78287c8b52510db6462dad29eda0ded0987744a47fdc7dd2", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "main-thread-gap", + "sha256": "708d4eb455c1bffae284d2208c915ca3534bcb59731dd570bff65c5a39ca7f36", + "block": { + "start": 1462, + "end": 2262, + "before": 0.4614583, + "after": 1.260896 + }, + "firstEligibility": { + "wall": 2262, + "time": 1.2613335, + "ids": [] + }, + "samples": 51, + "nonEmptySamples": [ + { + "wall": 2891, + "time": 1.8903544, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 51, + "visible": [ + { + "id": "sentinel", + "time": 1.8929377, + "wall": 2894 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2892, + "media": 1.8909794, + "end": 2892 + } + ], + "rows": [ + { + "id": "first", + "time": 0.7113125, + "state": "wait" + }, + { + "id": "middle", + "time": 1.0113125, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.9613125, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.417563, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + } + ] + }, + "red": { + "unit": "refactor/.cache/danmuku-initial-gap-before.log", + "zero": "refactor/.cache/danmuku-initial-gap-zero-before.log", + "browser": { + "directory": "refactor/.cache/danmuku-initial-gap-browser-before", + "reportSha256": "e20c7392624b7cc33d4cfa7e370de591cda42d6253eadc600039226602cd514a", + "stats": { + "startTime": "2026-09-15T15:57:33.040Z", + "duration": 22076.15, + "expected": 4, + "skipped": 0, + "unexpected": 2, + "flaky": 0 + }, + "cases": [ + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3960, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 916.3000000119209, + "end": 1916.300000011921, + "before": 0.49184, + "after": 0.49184 + }, + "firstEligibility": { + "wall": 1916.7000000476837, + "time": 1.45247, + "ids": [] + }, + "samples": 148, + "nonEmptySamples": [ + { + "wall": 2499.800000011921, + "time": 2.035306, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2502.800000011921, + "time": 2.038204, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 113, + "visible": [ + { + "id": "sentinel", + "time": 2.039701, + "wall": 2504.2000000476837 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2499.900000035763, + "media": 2.035306, + "end": 2499.900000035763 + }, + { + "id": "sentinel", + "start": 2502.800000011921, + "media": 2.038204, + "end": 2502.800000011921 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8706590000000001, + "state": "wait" + }, + { + "id": "middle", + "time": 1.1706590000000001, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.120659, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.291451, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "unexpected", + "duration": 4265, + "retry": 0, + "errors": [ + { + "location": { + "file": "D:\\github\\ArtPlayer\\test\\browser\\danmuku-timing-diagnostic.spec.js", + "column": 37, + "line": 126 + }, + "message": "Error: \u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).\u001b[22mtoEqual\u001b[2m(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m) // deep equality\u001b[22m\n\n\u001b[32m- Expected - 1\u001b[39m\n\u001b[31m+ Received + 4\u001b[39m\n\n\u001b[32m- Array []\u001b[39m\n\u001b[31m+ Array [\u001b[39m\n\u001b[31m+ \"first\",\u001b[39m\n\u001b[31m+ \"middle\",\u001b[39m\n\u001b[31m+ ]\u001b[39m\n\n 124 | }\n 125 | if (implementation === 'candidate') {\n> 126 | expect(observation.missing).toEqual([])\n | ^\n 127 | expect(observation.visible.map(row => row.id)).toEqual(['first', 'middle', 'sentinel'])\n 128 | }\n 129 | if (scenario === 'initial-frame-gap')\n at D:\\github\\ArtPlayer\\test\\browser\\danmuku-timing-diagnostic.spec.js:126:37" + } + ], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "d52ad0fc2b33e1d17e00ea1fee77a143a6b5b4b955a2a2f0e4abe885add17be6" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "d52ad0fc2b33e1d17e00ea1fee77a143a6b5b4b955a2a2f0e4abe885add17be6", + "block": { + "start": 920.9000000357628, + "end": 1920.9000000357628, + "before": 0.491849, + "after": 0.491849 + }, + "firstEligibility": { + "wall": 1921.4000000357628, + "time": 1.452416, + "ids": [] + }, + "samples": 112, + "nonEmptySamples": [ + { + "wall": 2504.699999988079, + "time": 2.035384, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 113, + "visible": [ + { + "id": "sentinel", + "time": 2.03836, + "wall": 2507.600000023842 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2504.900000035763, + "media": 2.035384, + "end": 2504.900000035763 + } + ], + "rows": [ + { + "id": "first", + "time": 0.870738, + "state": "wait" + }, + { + "id": "middle", + "time": 1.170738, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.120738, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.289778, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4937, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1017, + "end": 2017, + "before": 0.182323, + "after": 0.182323 + }, + "firstEligibility": { + "wall": 2017, + "time": 0.182323, + "ids": [] + }, + "samples": 156, + "nonEmptySamples": [ + { + "wall": 2609, + "time": 1.793741, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2611, + "time": 1.793741, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 120, + "visible": [ + { + "id": "sentinel", + "time": 1.793741, + "wall": 2612 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2609, + "media": 1.793741, + "end": 2609 + }, + { + "id": "sentinel", + "start": 2611, + "media": 1.793741, + "end": 2611 + } + ], + "rows": [ + { + "id": "first", + "time": 0.632323, + "state": "wait" + }, + { + "id": "middle", + "time": 0.932323, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.882323, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.17952, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 5121, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "d52ad0fc2b33e1d17e00ea1fee77a143a6b5b4b955a2a2f0e4abe885add17be6" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "d52ad0fc2b33e1d17e00ea1fee77a143a6b5b4b955a2a2f0e4abe885add17be6", + "block": { + "start": 1230, + "end": 2230, + "before": 0.423088, + "after": 0.423088 + }, + "firstEligibility": { + "wall": 2230, + "time": 0.423088, + "ids": [] + }, + "samples": 120, + "nonEmptySamples": [ + { + "wall": 2840, + "time": 2.044019, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 120, + "visible": [ + { + "id": "first", + "time": 1.418628, + "wall": 2241 + }, + { + "id": "middle", + "time": 1.418628, + "wall": 2242 + }, + { + "id": "sentinel", + "time": 2.044019, + "wall": 2843 + } + ], + "callbacks": [ + { + "id": "first", + "start": 2240, + "media": 1.418628, + "end": 2240 + }, + { + "id": "middle", + "start": 2242, + "media": 1.418628, + "end": 2242 + }, + { + "id": "sentinel", + "start": 2841, + "media": 2.044019, + "end": 2841 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8730880000000001, + "state": "stop" + }, + { + "id": "middle", + "time": 1.173088, + "state": "stop" + }, + { + "id": "sentinel", + "time": 2.123088, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.411028, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5303, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1536, + "end": 2536, + "before": 0.4, + "after": 1.3901252 + }, + "firstEligibility": { + "wall": 2559, + "time": 1.4136668, + "ids": [] + }, + "samples": 72, + "nonEmptySamples": [ + { + "wall": 3110, + "time": 1.9650419, + "ids": [ + "sentinel" + ] + }, + { + "wall": 3113, + "time": 1.9671878, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 56, + "visible": [ + { + "id": "sentinel", + "time": 1.9815627, + "wall": 3127 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 3111, + "media": 1.9652711, + "end": 3111 + }, + { + "id": "sentinel", + "start": 3113, + "media": 1.9671878, + "end": 3113 + } + ], + "rows": [ + { + "id": "first", + "time": 0.7790623999999999, + "state": "wait" + }, + { + "id": "middle", + "time": 1.0790624, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.0290624, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.6157297, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "unexpected", + "duration": 5436, + "retry": 0, + "errors": [ + { + "location": { + "file": "D:\\github\\ArtPlayer\\test\\browser\\danmuku-timing-diagnostic.spec.js", + "column": 37, + "line": 126 + }, + "message": "Error: \u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).\u001b[22mtoEqual\u001b[2m(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m) // deep equality\u001b[22m\n\n\u001b[32m- Expected - 1\u001b[39m\n\u001b[31m+ Received + 4\u001b[39m\n\n\u001b[32m- Array []\u001b[39m\n\u001b[31m+ Array [\u001b[39m\n\u001b[31m+ \"first\",\u001b[39m\n\u001b[31m+ \"middle\",\u001b[39m\n\u001b[31m+ ]\u001b[39m\n\n 124 | }\n 125 | if (implementation === 'candidate') {\n> 126 | expect(observation.missing).toEqual([])\n | ^\n 127 | expect(observation.visible.map(row => row.id)).toEqual(['first', 'middle', 'sentinel'])\n 128 | }\n 129 | if (scenario === 'initial-frame-gap')\n at D:\\github\\ArtPlayer\\test\\browser\\danmuku-timing-diagnostic.spec.js:126:37" + } + ], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "d52ad0fc2b33e1d17e00ea1fee77a143a6b5b4b955a2a2f0e4abe885add17be6" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "d52ad0fc2b33e1d17e00ea1fee77a143a6b5b4b955a2a2f0e4abe885add17be6", + "block": { + "start": 1580, + "end": 2580, + "before": 0.43, + "after": 1.4203335 + }, + "firstEligibility": { + "wall": 2617, + "time": 1.4572293, + "ids": [] + }, + "samples": 56, + "nonEmptySamples": [ + { + "wall": 3197, + "time": 2.0381669, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 56, + "visible": [ + { + "id": "sentinel", + "time": 2.0413127, + "wall": 3201 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 3198, + "media": 2.0389586, + "end": 3198 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8595416, + "state": "wait" + }, + { + "id": "middle", + "time": 1.1595416, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.1095416, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.7397713, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + } + ] + } + }, + "unit": { + "command": "yarn test:danmuku", + "pass": 278, + "fail": 0, + "skip": 0, + "durationMs": 25321.5839, + "log": "refactor/.cache/danmuku-initial-gap-unit-final-zero.log" + }, + "strictTypesAndLint": { + "exitCode": 0, + "scope": "Danmuku strict production tsconfig and changed source/tests" + }, + "installedUnit": { + "main": { + "pass": 61, + "durationMs": 909.2565, + "log": "refactor/.cache/danmuku-initial-gap-installed-final-js.log" + }, + "legacy": { + "pass": 61, + "durationMs": 920.6875, + "log": "refactor/.cache/danmuku-initial-gap-installed-final-legacy.js.log" + }, + "embeddedWorker": "Actual installed data URL Worker code is executed by the controlled runner." + }, + "browser": { + "source": { + "directory": "refactor/.cache/danmuku-initial-gap-browser-source-zero-final", + "reportSha256": "0ecd8dac5d4b7777cd778bba174b9ec60844ba6c6606a9ab0bdc5597a6e0a6cf", + "stats": { + "startTime": "2026-09-15T16:06:22.227Z", + "duration": 61622.822, + "expected": 24, + "skipped": 0, + "unexpected": 0, + "flaky": 0 + }, + "cases": [ + { + "title": "published: native main-thread-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3620, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "main-thread-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 985.1999999880791, + "end": 1785.199999988079, + "before": 0.609323, + "after": 0.609323 + }, + "firstEligibility": { + "wall": 801.1999999880791, + "time": 0.450442, + "ids": [] + }, + "samples": 157, + "nonEmptySamples": [ + { + "wall": 2384.199999988079, + "time": 2.008358, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2388.300000011921, + "time": 2.012438, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 109, + "visible": [ + { + "id": "sentinel", + "time": 2.013278, + "wall": 2389.199999988079 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2384.400000035763, + "media": 2.008358, + "end": 2384.400000035763 + }, + { + "id": "sentinel", + "start": 2388.300000011921, + "media": 2.012438, + "end": 2388.300000011921 + } + ], + "rows": [ + { + "id": "first", + "time": 0.849631, + "state": "wait" + }, + { + "id": "middle", + "time": 1.149631, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.099631, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 2.999787, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3901, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 750.8999999761581, + "end": 1751, + "before": 0.466238, + "after": 0.466238 + }, + "firstEligibility": { + "wall": 1751.8999999761581, + "time": 1.427131, + "ids": [] + }, + "samples": 155, + "nonEmptySamples": [ + { + "wall": 2332.899999976158, + "time": 2.007609, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2337.399999976158, + "time": 2.012071, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 120, + "visible": [ + { + "id": "sentinel", + "time": 2.012866, + "wall": 2338.199999988079 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2333, + "media": 2.007609, + "end": 2333 + }, + { + "id": "sentinel", + "start": 2337.399999976158, + "media": 2.012071, + "end": 2337.399999976158 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8544579999999999, + "state": "wait" + }, + { + "id": "middle", + "time": 1.154458, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.104458, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.38176, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3818, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-zero-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 723.1999999880791, + "end": 1723.199999988079, + "before": 0.008328, + "after": 0.008328 + }, + "firstEligibility": { + "wall": 1724, + "time": 0.968188, + "ids": [] + }, + "samples": 157, + "nonEmptySamples": [ + { + "wall": 2354.7999999523163, + "time": 1.600162, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2359.2999999523163, + "time": 1.604622, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 119, + "visible": [ + { + "id": "sentinel", + "time": 1.605594, + "wall": 2360.199999988079 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2355, + "media": 1.600162, + "end": 2355 + }, + { + "id": "sentinel", + "start": 2359.2999999523163, + "media": 1.604622, + "end": 2359.2999999523163 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "wait" + }, + { + "id": "middle", + "time": 0.75, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 2.907753, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native async-visibility-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3890, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "async-visibility-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": null, + "firstEligibility": { + "wall": 752.8999999761581, + "time": 0.470975, + "ids": [] + }, + "samples": 161, + "nonEmptySamples": [ + { + "wall": 1068.800000011921, + "time": 0.761328, + "ids": [ + "first" + ] + }, + { + "wall": 1068.8999999761581, + "time": 0.761493, + "ids": [ + "first" + ] + }, + { + "wall": 2320.699999988079, + "time": 2.013102, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 178, + "visible": [ + { + "id": "first", + "time": 1.367698, + "wall": 1674.3999999761581 + }, + { + "id": "sentinel", + "time": 2.01491, + "wall": 2322.5 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1068.8999999761581, + "media": 0.761328, + "end": 1669.199999988079 + }, + { + "id": "first", + "start": 1068.8999999761581, + "media": 0.761493, + "end": 1673.699999988079 + }, + { + "id": "sentinel", + "start": 2320.699999988079, + "media": 2.013102, + "end": 2320.699999988079 + } + ], + "rows": [ + { + "id": "first", + "time": 0.853208, + "state": "emit" + }, + { + "id": "middle", + "time": 1.153208, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.103208, + "state": "emit" + } + ], + "missing": [ + "middle" + ], + "media": { + "time": 3.385586, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native main-thread-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3631, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "main-thread-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 991.1999999880791, + "end": 1791.199999988079, + "before": 0.611355, + "after": 0.611355 + }, + "firstEligibility": { + "wall": 825.6000000238419, + "time": 0.471434, + "ids": [] + }, + "samples": 107, + "nonEmptySamples": [ + { + "wall": 2391.300000011921, + "time": 2.011341, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 108, + "visible": [ + { + "id": "first", + "time": 1.415751, + "wall": 1795.6000000238419 + }, + { + "id": "middle", + "time": 1.416525, + "wall": 1796.4000000357628 + }, + { + "id": "sentinel", + "time": 2.012204, + "wall": 2392.199999988079 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1791.6000000238419, + "media": 1.411382, + "end": 1791.6000000238419 + }, + { + "id": "middle", + "start": 1795.6000000238419, + "media": 1.415751, + "end": 1795.6000000238419 + }, + { + "id": "sentinel", + "start": 2391.5, + "media": 2.011341, + "end": 2391.5 + } + ], + "rows": [ + { + "id": "first", + "time": 0.851808, + "state": "emit" + }, + { + "id": "middle", + "time": 1.151808, + "state": "emit" + }, + { + "id": "sentinel", + "time": 2.101808, + "state": "emit" + } + ], + "missing": [], + "media": { + "time": 3.002508, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3884, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 753.8000000119209, + "end": 1753.800000011921, + "before": 0.467205, + "after": 0.467205 + }, + "firstEligibility": { + "wall": 1754.6000000238419, + "time": 1.428414, + "ids": [] + }, + "samples": 119, + "nonEmptySamples": [ + { + "wall": 2335.400000035763, + "time": 2.00989, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 120, + "visible": [ + { + "id": "first", + "time": 1.432829, + "wall": 1758.9000000357628 + }, + { + "id": "middle", + "time": 1.433477, + "wall": 1759.5 + }, + { + "id": "sentinel", + "time": 2.011218, + "wall": 2336.699999988079 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1754.9000000357628, + "media": 1.428414, + "end": 1754.9000000357628 + }, + { + "id": "middle", + "start": 1759, + "media": 1.432829, + "end": 1759 + }, + { + "id": "sentinel", + "start": 2335.600000023842, + "media": 2.00989, + "end": 2335.600000023842 + } + ], + "rows": [ + { + "id": "first", + "time": 0.854487, + "state": "emit" + }, + { + "id": "middle", + "time": 1.154487, + "state": "emit" + }, + { + "id": "sentinel", + "time": 2.1044869999999998, + "state": "emit" + } + ], + "missing": [], + "media": { + "time": 3.383607, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3885, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-zero-frame-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 756.5, + "end": 1756.5, + "before": 0.008978, + "after": 0.008978 + }, + "firstEligibility": { + "wall": 1757.199999988079, + "time": 0.969402, + "ids": [] + }, + "samples": 119, + "nonEmptySamples": [ + { + "wall": 2388.300000011921, + "time": 1.600365, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 120, + "visible": [ + { + "id": "first", + "time": 0.975057, + "wall": 1762.699999988079 + }, + { + "id": "middle", + "time": 0.976, + "wall": 1763.5999999642372 + }, + { + "id": "sentinel", + "time": 1.601492, + "wall": 2389.399999976158 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1757.3999999761581, + "media": 0.969402, + "end": 1757.3999999761581 + }, + { + "id": "middle", + "start": 1762.699999988079, + "media": 0.975057, + "end": 1762.699999988079 + }, + { + "id": "sentinel", + "start": 2388.399999976158, + "media": 1.600365, + "end": 2388.399999976158 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "stop" + }, + { + "id": "middle", + "time": 0.75, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 2.927952, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native async-visibility-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3859, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "async-visibility-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": null, + "firstEligibility": { + "wall": 738.5, + "time": 0.451147, + "ids": [] + }, + "samples": 177, + "nonEmptySamples": [ + { + "wall": 1054.4000000357628, + "time": 0.741309, + "ids": [ + "first" + ] + }, + { + "wall": 1071, + "time": 0.757867, + "ids": [ + "first" + ] + }, + { + "wall": 1088.5, + "time": 0.775891, + "ids": [ + "first" + ] + }, + { + "wall": 1104.300000011921, + "time": 0.790937, + "ids": [ + "first" + ] + }, + { + "wall": 1122.199999988079, + "time": 0.808318, + "ids": [ + "first" + ] + }, + { + "wall": 1138.699999988079, + "time": 0.825006, + "ids": [ + "first" + ] + }, + { + "wall": 1155, + "time": 0.842327, + "ids": [ + "first" + ] + }, + { + "wall": 1172, + "time": 0.85938, + "ids": [ + "first" + ] + }, + { + "wall": 1188.300000011921, + "time": 0.875542, + "ids": [ + "first" + ] + }, + { + "wall": 1205, + "time": 0.891526, + "ids": [ + "first" + ] + }, + { + "wall": 1221.300000011921, + "time": 0.908415, + "ids": [ + "first" + ] + }, + { + "wall": 1237.9000000357628, + "time": 0.924992, + "ids": [ + "first" + ] + }, + { + "wall": 1355.300000011921, + "time": 1.042331, + "ids": [ + "middle" + ] + }, + { + "wall": 1371.800000011921, + "time": 1.058867, + "ids": [ + "middle" + ] + }, + { + "wall": 1388.1000000238419, + "time": 1.075377, + "ids": [ + "middle" + ] + }, + { + "wall": 1405.199999988079, + "time": 1.091854, + "ids": [ + "middle" + ] + }, + { + "wall": 1422.1000000238419, + "time": 1.108381, + "ids": [ + "middle" + ] + }, + { + "wall": 1438.699999988079, + "time": 1.125973, + "ids": [ + "middle" + ] + }, + { + "wall": 1455.1000000238419, + "time": 1.14127, + "ids": [ + "middle" + ] + }, + { + "wall": 1472.1000000238419, + "time": 1.158289, + "ids": [ + "middle" + ] + }, + { + "wall": 1488.5, + "time": 1.175607, + "ids": [ + "middle" + ] + }, + { + "wall": 1505.199999988079, + "time": 1.19217, + "ids": [ + "middle" + ] + }, + { + "wall": 1521.6000000238419, + "time": 1.207902, + "ids": [ + "middle" + ] + }, + { + "wall": 1538.6000000238419, + "time": 1.22529, + "ids": [ + "middle" + ] + }, + { + "wall": 2304.400000035763, + "time": 1.991792, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 178, + "visible": [ + { + "id": "first", + "time": 1.345841, + "wall": 1659.699999988079 + }, + { + "id": "middle", + "time": 1.360579, + "wall": 1673.1000000238419 + }, + { + "id": "sentinel", + "time": 1.992709, + "wall": 2305.300000011921 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1054.800000011921, + "media": 0.741309, + "end": 1655.300000011921 + }, + { + "id": "middle", + "start": 1672.4000000357628, + "media": 1.358252, + "end": 1672.4000000357628 + }, + { + "id": "sentinel", + "start": 2304.400000035763, + "media": 1.991792, + "end": 2304.400000035763 + } + ], + "rows": [ + { + "id": "first", + "time": 0.836527, + "state": "stop" + }, + { + "id": "middle", + "time": 1.136527, + "state": "stop" + }, + { + "id": "sentinel", + "time": 2.086527, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.370683, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native main-thread-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 5056, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "main-thread-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1351, + "end": 2151, + "before": 0.414668, + "after": 0.414668 + }, + "firstEligibility": { + "wall": 1152, + "time": 0.211172, + "ids": [] + }, + "samples": 158, + "nonEmptySamples": [ + { + "wall": 2735, + "time": 1.791175, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2737, + "time": 1.791175, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 109, + "visible": [ + { + "id": "sentinel", + "time": 1.791175, + "wall": 2738 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2735, + "media": 1.791175, + "end": 2735 + }, + { + "id": "sentinel", + "start": 2737, + "media": 1.791175, + "end": 2737 + } + ], + "rows": [ + { + "id": "first", + "time": 0.628453, + "state": "wait" + }, + { + "id": "middle", + "time": 0.928453, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.878453, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 2.800556, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4062, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 811, + "end": 1811, + "before": 0.41987, + "after": 0.41987 + }, + "firstEligibility": { + "wall": 1811, + "time": 0.41987, + "ids": [] + }, + "samples": 156, + "nonEmptySamples": [ + { + "wall": 2407, + "time": 2.044195, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2411, + "time": 2.044195, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 120, + "visible": [ + { + "id": "sentinel", + "time": 2.044195, + "wall": 2414 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2408, + "media": 2.044195, + "end": 2408 + }, + { + "id": "sentinel", + "start": 2411, + "media": 2.044195, + "end": 2411 + } + ], + "rows": [ + { + "id": "first", + "time": 0.86987, + "state": "wait" + }, + { + "id": "middle", + "time": 1.16987, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.11987, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.432821, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 3757, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-zero-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 514, + "end": 1514, + "before": 0, + "after": 0 + }, + "firstEligibility": { + "wall": 1527, + "time": 0.973071, + "ids": [] + }, + "samples": 156, + "nonEmptySamples": [ + { + "wall": 2145, + "time": 1.627188, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2149, + "time": 1.627188, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 118, + "visible": [ + { + "id": "sentinel", + "time": 1.627188, + "wall": 2153 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2146, + "media": 1.627188, + "end": 2146 + }, + { + "id": "sentinel", + "start": 2149, + "media": 1.627188, + "end": 2149 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "wait" + }, + { + "id": "middle", + "time": 0.75, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 2.932577, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native async-visibility-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4058, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "async-visibility-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": null, + "firstEligibility": { + "wall": 788, + "time": 0.444259, + "ids": [] + }, + "samples": 166, + "nonEmptySamples": [ + { + "wall": 1155, + "time": 0.807743, + "ids": [ + "first" + ] + }, + { + "wall": 1156, + "time": 0.807743, + "ids": [ + "first" + ] + }, + { + "wall": 2390, + "time": 2.044879, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 179, + "visible": [ + { + "id": "first", + "time": 1.420063, + "wall": 1763 + }, + { + "id": "sentinel", + "time": 2.044879, + "wall": 2393 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1156, + "media": 0.807743, + "end": 1762 + }, + { + "id": "first", + "start": 1156, + "media": 0.807743, + "end": 1762 + }, + { + "id": "sentinel", + "start": 2390, + "media": 2.044879, + "end": 2390 + } + ], + "rows": [ + { + "id": "first", + "time": 0.869823, + "state": "stop" + }, + { + "id": "middle", + "time": 1.169823, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.119823, + "state": "stop" + } + ], + "missing": [ + "middle" + ], + "media": { + "time": 3.42992, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native main-thread-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4924, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "main-thread-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 1336, + "end": 2136, + "before": 0.406202, + "after": 0.406202 + }, + "firstEligibility": { + "wall": 1138, + "time": 0.204363, + "ids": [] + }, + "samples": 110, + "nonEmptySamples": [ + { + "wall": 2139, + "time": 0.608314, + "ids": [ + "first" + ] + }, + { + "wall": 2704, + "time": 1.780286, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 110, + "visible": [ + { + "id": "first", + "time": 0.608314, + "wall": 2140 + }, + { + "id": "middle", + "time": 1.213259, + "wall": 2155 + }, + { + "id": "sentinel", + "time": 1.780286, + "wall": 2706 + } + ], + "callbacks": [ + { + "id": "first", + "start": 2139, + "media": 0.608314, + "end": 2139 + }, + { + "id": "middle", + "start": 2154, + "media": 1.213259, + "end": 2154 + }, + { + "id": "sentinel", + "start": 2704, + "media": 1.780286, + "end": 2704 + } + ], + "rows": [ + { + "id": "first", + "time": 0.6253150000000001, + "state": "stop" + }, + { + "id": "middle", + "time": 0.925315, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.875315, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 2.794667, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 3790, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 520, + "end": 1520, + "before": 0.180534, + "after": 0.180534 + }, + "firstEligibility": { + "wall": 1520, + "time": 0.180534, + "ids": [] + }, + "samples": 119, + "nonEmptySamples": [ + { + "wall": 2116, + "time": 1.806931, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 119, + "visible": [ + { + "id": "first", + "time": 1.222002, + "wall": 1534 + }, + { + "id": "middle", + "time": 1.222002, + "wall": 1535 + }, + { + "id": "sentinel", + "time": 1.806931, + "wall": 2119 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1532, + "media": 1.222002, + "end": 1532 + }, + { + "id": "middle", + "start": 1534, + "media": 1.222002, + "end": 1534 + }, + { + "id": "sentinel", + "start": 2117, + "media": 1.806931, + "end": 2117 + } + ], + "rows": [ + { + "id": "first", + "time": 0.630534, + "state": "stop" + }, + { + "id": "middle", + "time": 0.930534, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.880534, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.146287, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4070, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-zero-frame-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 814, + "end": 1814, + "before": 0, + "after": 0 + }, + "firstEligibility": { + "wall": 1827, + "time": 0.981839, + "ids": [] + }, + "samples": 118, + "nonEmptySamples": [ + { + "wall": 2461, + "time": 1.633654, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 118, + "visible": [ + { + "id": "first", + "time": 0.981839, + "wall": 1829 + }, + { + "id": "middle", + "time": 0.981839, + "wall": 1829 + }, + { + "id": "sentinel", + "time": 1.633654, + "wall": 2462 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1827, + "media": 0.981839, + "end": 1827 + }, + { + "id": "middle", + "start": 1829, + "media": 0.981839, + "end": 1829 + }, + { + "id": "sentinel", + "start": 2461, + "media": 1.633654, + "end": 2461 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "stop" + }, + { + "id": "middle", + "time": 0.75, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 2.935055, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native async-visibility-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4061, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "async-visibility-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": null, + "firstEligibility": { + "wall": 802, + "time": 0.461904, + "ids": [] + }, + "samples": 180, + "nonEmptySamples": [ + { + "wall": 1135, + "time": 0.792963, + "ids": [ + "first" + ] + }, + { + "wall": 1152, + "time": 0.792963, + "ids": [ + "first" + ] + }, + { + "wall": 1169, + "time": 0.834562, + "ids": [ + "first" + ] + }, + { + "wall": 1185, + "time": 0.834562, + "ids": [ + "first" + ] + }, + { + "wall": 1202, + "time": 0.834562, + "ids": [ + "first" + ] + }, + { + "wall": 1218, + "time": 0.876409, + "ids": [ + "first" + ] + }, + { + "wall": 1235, + "time": 0.876409, + "ids": [ + "first" + ] + }, + { + "wall": 1251, + "time": 0.917713, + "ids": [ + "first" + ] + }, + { + "wall": 1268, + "time": 0.917713, + "ids": [ + "first" + ] + }, + { + "wall": 1286, + "time": 0.917713, + "ids": [ + "first" + ] + }, + { + "wall": 1302, + "time": 0.959797, + "ids": [ + "first" + ] + }, + { + "wall": 1319, + "time": 0.959797, + "ids": [ + "first" + ] + }, + { + "wall": 1418, + "time": 1.084973, + "ids": [ + "middle" + ] + }, + { + "wall": 1436, + "time": 1.084973, + "ids": [ + "middle" + ] + }, + { + "wall": 1452, + "time": 1.084973, + "ids": [ + "middle" + ] + }, + { + "wall": 1469, + "time": 1.126688, + "ids": [ + "middle" + ] + }, + { + "wall": 1486, + "time": 1.126688, + "ids": [ + "middle" + ] + }, + { + "wall": 1502, + "time": 1.16835, + "ids": [ + "middle" + ] + }, + { + "wall": 1519, + "time": 1.16835, + "ids": [ + "middle" + ] + }, + { + "wall": 1535, + "time": 1.16835, + "ids": [ + "middle" + ] + }, + { + "wall": 1551, + "time": 1.210039, + "ids": [ + "middle" + ] + }, + { + "wall": 1569, + "time": 1.210039, + "ids": [ + "middle" + ] + }, + { + "wall": 1586, + "time": 1.251397, + "ids": [ + "middle" + ] + }, + { + "wall": 1602, + "time": 1.251397, + "ids": [ + "middle" + ] + }, + { + "wall": 1618, + "time": 1.251397, + "ids": [ + "middle" + ] + }, + { + "wall": 2386, + "time": 2.041884, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 180, + "visible": [ + { + "id": "first", + "time": 1.377004, + "wall": 1739 + }, + { + "id": "middle", + "time": 1.418195, + "wall": 1756 + }, + { + "id": "sentinel", + "time": 2.041884, + "wall": 2389 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1136, + "media": 0.792963, + "end": 1738 + }, + { + "id": "middle", + "start": 1752, + "media": 1.418195, + "end": 1752 + }, + { + "id": "sentinel", + "start": 2387, + "media": 2.041884, + "end": 2387 + } + ], + "rows": [ + { + "id": "first", + "time": 0.872541, + "state": "stop" + }, + { + "id": "middle", + "time": 1.172541, + "state": "stop" + }, + { + "id": "sentinel", + "time": 2.122541, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.455496, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native main-thread-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 4944, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "main-thread-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1808, + "end": 2608, + "before": 0.6853542, + "after": 1.4851877 + }, + "firstEligibility": { + "wall": 1581, + "time": 0.47, + "ids": [] + }, + "samples": 71, + "nonEmptySamples": [ + { + "wall": 3165, + "time": 2.0429586, + "ids": [ + "sentinel" + ] + }, + { + "wall": 3168, + "time": 2.0455003, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 50, + "visible": [ + { + "id": "sentinel", + "time": 2.0586878, + "wall": 3181 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 3166, + "media": 2.0431461, + "end": 3166 + }, + { + "id": "sentinel", + "start": 3168, + "media": 2.0455211, + "end": 3168 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8831042, + "state": "wait" + }, + { + "id": "middle", + "time": 1.1831042, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.1331042, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.3040421, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5183, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1434, + "end": 2434, + "before": 0.43, + "after": 1.4133126 + }, + "firstEligibility": { + "wall": 2460, + "time": 1.4402085, + "ids": [] + }, + "samples": 67, + "nonEmptySamples": [ + { + "wall": 2874, + "time": 1.8533544, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2876, + "time": 1.8554586, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 55, + "visible": [ + { + "id": "sentinel", + "time": 1.8703752, + "wall": 2891 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2874, + "media": 1.8535211, + "end": 2874 + }, + { + "id": "sentinel", + "start": 2876, + "media": 1.8554794, + "end": 2876 + } + ], + "rows": [ + { + "id": "first", + "time": 0.6996458, + "state": "wait" + }, + { + "id": "middle", + "time": 0.9996458, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.9496457999999999, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.6954172, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5309, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-zero-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1559, + "end": 2559, + "before": 0.01, + "after": 1.0038126 + }, + "firstEligibility": { + "wall": 2578, + "time": 1.0231042, + "ids": [] + }, + "samples": 71, + "nonEmptySamples": [ + { + "wall": 3176, + "time": 1.6208543, + "ids": [ + "sentinel" + ] + }, + { + "wall": 3178, + "time": 1.6234168, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 55, + "visible": [ + { + "id": "sentinel", + "time": 1.6372085, + "wall": 3192 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 3176, + "media": 1.621021, + "end": 3176 + }, + { + "id": "sentinel", + "start": 3178, + "media": 1.6234168, + "end": 3178 + } + ], + "rows": [ + { + "id": "first", + "time": 0.46, + "state": "wait" + }, + { + "id": "middle", + "time": 0.76, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.71, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.2922296, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native async-visibility-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5291, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "async-visibility-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": null, + "firstEligibility": { + "wall": 1605, + "time": 0.4365417, + "ids": [] + }, + "samples": 62, + "nonEmptySamples": [ + { + "wall": 1791, + "time": 0.6219375, + "ids": [ + "first" + ] + }, + { + "wall": 1791, + "time": 0.62225, + "ids": [ + "first" + ] + }, + { + "wall": 3046, + "time": 1.8772502, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 74, + "visible": [ + { + "id": "first", + "time": 1.2533335, + "wall": 2422 + }, + { + "id": "sentinel", + "time": 1.8925419, + "wall": 3061 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1791, + "media": 0.622125, + "end": 2405 + }, + { + "id": "first", + "start": 1791, + "media": 0.62225, + "end": 2408 + }, + { + "id": "sentinel", + "start": 3046, + "media": 1.8772502, + "end": 3046 + } + ], + "rows": [ + { + "id": "first", + "time": 0.7136666, + "state": "stop" + }, + { + "id": "middle", + "time": 1.0136666, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.9636665999999998, + "state": "stop" + } + ], + "missing": [ + "middle" + ], + "media": { + "time": 3.6488547, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native main-thread-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 4830, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "main-thread-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 1684, + "end": 2484, + "before": 0.5522708, + "after": 1.3513335 + }, + "firstEligibility": { + "wall": 1546, + "time": 0.4140208, + "ids": [] + }, + "samples": 45, + "nonEmptySamples": [ + { + "wall": 3054, + "time": 1.9213127, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 45, + "visible": [ + { + "id": "first", + "time": 1.3544376, + "wall": 2487 + }, + { + "id": "middle", + "time": 1.355396, + "wall": 2488 + }, + { + "id": "sentinel", + "time": 1.9227919, + "wall": 3055 + } + ], + "callbacks": [ + { + "id": "first", + "start": 2484, + "media": 1.3519793, + "end": 2484 + }, + { + "id": "middle", + "start": 2487, + "media": 1.3544585, + "end": 2487 + }, + { + "id": "sentinel", + "start": 3054, + "media": 1.9214794, + "end": 3054 + } + ], + "rows": [ + { + "id": "first", + "time": 0.7620625000000001, + "state": "stop" + }, + { + "id": "middle", + "time": 1.0620625000000001, + "state": "stop" + }, + { + "id": "sentinel", + "time": 2.0120625, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.1961463, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5276, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 1482, + "end": 2482, + "before": 0.44, + "after": 1.4322502 + }, + "firstEligibility": { + "wall": 2507, + "time": 1.4578751, + "ids": [] + }, + "samples": 48, + "nonEmptySamples": [ + { + "wall": 3044, + "time": 1.9943544, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 48, + "visible": [ + { + "id": "first", + "time": 1.4619793, + "wall": 2511 + }, + { + "id": "middle", + "time": 1.4630418, + "wall": 2512 + }, + { + "id": "sentinel", + "time": 1.9953544, + "wall": 3045 + } + ], + "callbacks": [ + { + "id": "first", + "start": 2508, + "media": 1.4584585, + "end": 2508 + }, + { + "id": "middle", + "start": 2511, + "media": 1.4620001, + "end": 2511 + }, + { + "id": "sentinel", + "start": 3044, + "media": 1.9945211, + "end": 3044 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8368125, + "state": "stop" + }, + { + "id": "middle", + "time": 1.1368125, + "state": "stop" + }, + { + "id": "sentinel", + "time": 2.0868124999999997, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.7164172, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5252, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-zero-frame-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": { + "start": 1517, + "end": 2517, + "before": 0, + "after": 0.9878334 + }, + "firstEligibility": { + "wall": 2549, + "time": 1.0198751, + "ids": [] + }, + "samples": 49, + "nonEmptySamples": [ + { + "wall": 3162, + "time": 1.6328127, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 49, + "visible": [ + { + "id": "first", + "time": 1.0227709, + "wall": 2552 + }, + { + "id": "middle", + "time": 1.0237292, + "wall": 2553 + }, + { + "id": "sentinel", + "time": 1.6342919, + "wall": 3163 + } + ], + "callbacks": [ + { + "id": "first", + "start": 2549, + "media": 1.0203751, + "end": 2549 + }, + { + "id": "middle", + "start": 2552, + "media": 1.0227917, + "end": 2552 + }, + { + "id": "sentinel", + "start": 3162, + "media": 1.6331044, + "end": 3162 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "stop" + }, + { + "id": "middle", + "time": 0.75, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.2915213, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native async-visibility-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5296, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + } + }, + "timing": { + "implementation": "candidate", + "scenario": "async-visibility-gap", + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a", + "block": null, + "firstEligibility": { + "wall": 1514, + "time": 0.4427916, + "ids": [] + }, + "samples": 75, + "nonEmptySamples": [ + { + "wall": 1851, + "time": 0.7796459, + "ids": [ + "first" + ] + }, + { + "wall": 1881, + "time": 0.8096876, + "ids": [ + "first" + ] + }, + { + "wall": 1911, + "time": 0.8398542, + "ids": [ + "first" + ] + }, + { + "wall": 1958, + "time": 0.8868959, + "ids": [ + "first" + ] + }, + { + "wall": 1989, + "time": 0.9174584, + "ids": [ + "first" + ] + }, + { + "wall": 2141, + "time": 1.0698334, + "ids": [ + "middle" + ] + }, + { + "wall": 2186, + "time": 1.1148334, + "ids": [ + "middle" + ] + }, + { + "wall": 2217, + "time": 1.1459376, + "ids": [ + "middle" + ] + }, + { + "wall": 2262, + "time": 1.1909168, + "ids": [ + "middle" + ] + }, + { + "wall": 2294, + "time": 1.222646, + "ids": [ + "middle" + ] + }, + { + "wall": 3116, + "time": 2.0448753, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 75, + "visible": [ + { + "id": "first", + "time": 1.3936043, + "wall": 2465 + }, + { + "id": "middle", + "time": 1.437646, + "wall": 2509 + }, + { + "id": "sentinel", + "time": 2.0459378, + "wall": 3117 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1851, + "media": 0.7803542, + "end": 2463 + }, + { + "id": "middle", + "start": 2508, + "media": 1.436646, + "end": 2508 + }, + { + "id": "sentinel", + "start": 3116, + "media": 2.0449586, + "end": 3116 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8606875, + "state": "stop" + }, + { + "id": "middle", + "time": 1.1606874999999999, + "state": "stop" + }, + { + "id": "sentinel", + "time": 2.1106875, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.7280214, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + } + ] + }, + "installed": { + "directory": "refactor/.cache/danmuku-initial-gap-browser-installed-final", + "reportSha256": "a36ef5d2cf54f7d3c56dc089ba8fb7703177fd7d68ef86f9d1d1493e8d058a34", + "stats": { + "startTime": "2026-09-15T16:10:02.661Z", + "duration": 57127.811, + "expected": 24, + "skipped": 0, + "unexpected": 0, + "flaky": 0 + }, + "cases": [ + { + "title": "published: native main-thread-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3490, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "main-thread-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 909.6999999880791, + "end": 1709.699999988079, + "before": 0.592403, + "after": 0.592403 + }, + "firstEligibility": { + "wall": 743.6000000238419, + "time": 0.451021, + "ids": [] + }, + "samples": 155, + "nonEmptySamples": [ + { + "wall": 2309.800000011921, + "time": 1.992343, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2317.100000023842, + "time": 1.999638, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 108, + "visible": [ + { + "id": "sentinel", + "time": 2.000884, + "wall": 2318.199999988079 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2310, + "media": 1.992343, + "end": 2310 + }, + { + "id": "sentinel", + "start": 2317.100000023842, + "media": 1.999638, + "end": 2317.100000023842 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8373010000000001, + "state": "wait" + }, + { + "id": "middle", + "time": 1.137301, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.087301, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 2.984715, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3606, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 645.6000000238419, + "end": 1645.6000000238419, + "before": 0.449981, + "after": 0.449981 + }, + "firstEligibility": { + "wall": 1645.800000011921, + "time": 1.409275, + "ids": [] + }, + "samples": 147, + "nonEmptySamples": [ + { + "wall": 2228.400000035763, + "time": 1.991994, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2231.900000035763, + "time": 1.995488, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 112, + "visible": [ + { + "id": "sentinel", + "time": 1.996382, + "wall": 2232.800000011921 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2228.400000035763, + "media": 1.991994, + "end": 2228.5 + }, + { + "id": "sentinel", + "start": 2231.900000035763, + "media": 1.995488, + "end": 2231.900000035763 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8379639999999999, + "state": "wait" + }, + { + "id": "middle", + "time": 1.137964, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.087964, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.230334, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3628, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-zero-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 667.3999999761581, + "end": 1667.3999999761581, + "before": 0.011252, + "after": 0.011252 + }, + "firstEligibility": { + "wall": 1667.800000011921, + "time": 0.971016, + "ids": [] + }, + "samples": 151, + "nonEmptySamples": [ + { + "wall": 2300.300000011921, + "time": 1.604306, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2304.300000011921, + "time": 1.608333, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 113, + "visible": [ + { + "id": "sentinel", + "time": 1.608924, + "wall": 2304.899999976158 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2300.399999976158, + "media": 1.604306, + "end": 2300.399999976158 + }, + { + "id": "sentinel", + "start": 2304.300000011921, + "media": 1.608333, + "end": 2304.300000011921 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "wait" + }, + { + "id": "middle", + "time": 0.75, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 2.808589, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native async-visibility-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3719, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "async-visibility-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": null, + "firstEligibility": { + "wall": 674.2999999523163, + "time": 0.452875, + "ids": [] + }, + "samples": 160, + "nonEmptySamples": [ + { + "wall": 989.5999999642372, + "time": 0.745886, + "ids": [ + "first" + ] + }, + { + "wall": 989.6999999880791, + "time": 0.746004, + "ids": [ + "first" + ] + }, + { + "wall": 2239.099999964237, + "time": 1.995674, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 177, + "visible": [ + { + "id": "first", + "time": 1.352312, + "wall": 1596 + }, + { + "id": "sentinel", + "time": 1.99682, + "wall": 2240.199999988079 + } + ], + "callbacks": [ + { + "id": "first", + "start": 989.6999999880791, + "media": 0.745886, + "end": 1589.8999999761581 + }, + { + "id": "first", + "start": 989.6999999880791, + "media": 0.746004, + "end": 1595.3999999761581 + }, + { + "id": "sentinel", + "start": 2239.099999964237, + "media": 1.995674, + "end": 2239.099999964237 + } + ], + "rows": [ + { + "id": "first", + "time": 0.837235, + "state": "emit" + }, + { + "id": "middle", + "time": 1.137235, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.0872349999999997, + "state": "emit" + } + ], + "missing": [ + "middle" + ], + "media": { + "time": 3.349853, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native main-thread-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3491, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "main-thread-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 909.5, + "end": 1709.5, + "before": 0.592425, + "after": 0.592425 + }, + "firstEligibility": { + "wall": 743.3000000119209, + "time": 0.45242, + "ids": [] + }, + "samples": 107, + "nonEmptySamples": [ + { + "wall": 2309.699999988079, + "time": 1.994086, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 108, + "visible": [ + { + "id": "first", + "time": 1.397314, + "wall": 1713.300000011921 + }, + { + "id": "middle", + "time": 1.397782, + "wall": 1713.800000011921 + }, + { + "id": "sentinel", + "time": 1.995648, + "wall": 2311.199999988079 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1709.800000011921, + "media": 1.393571, + "end": 1709.800000011921 + }, + { + "id": "middle", + "start": 1713.300000011921, + "media": 1.397314, + "end": 1713.300000011921 + }, + { + "id": "sentinel", + "start": 2309.900000035763, + "media": 1.994086, + "end": 2309.900000035763 + } + ], + "rows": [ + { + "id": "first", + "time": 0.837798, + "state": "emit" + }, + { + "id": "middle", + "time": 1.137798, + "state": "emit" + }, + { + "id": "sentinel", + "time": 2.087798, + "state": "emit" + } + ], + "missing": [], + "media": { + "time": 2.984777, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3623, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 645.8000000119209, + "end": 1645.800000011921, + "before": 0.45092, + "after": 0.45092 + }, + "firstEligibility": { + "wall": 1646.1000000238419, + "time": 1.410799, + "ids": [] + }, + "samples": 112, + "nonEmptySamples": [ + { + "wall": 2228.600000023842, + "time": 1.992992, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 113, + "visible": [ + { + "id": "first", + "time": 1.414499, + "wall": 1649.699999988079 + }, + { + "id": "middle", + "time": 1.415024, + "wall": 1650.199999988079 + }, + { + "id": "sentinel", + "time": 1.99375, + "wall": 2229.300000011921 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1646.199999988079, + "media": 1.410799, + "end": 1646.199999988079 + }, + { + "id": "middle", + "start": 1649.699999988079, + "media": 1.414499, + "end": 1649.699999988079 + }, + { + "id": "sentinel", + "start": 2228.699999988079, + "media": 1.992992, + "end": 2228.699999988079 + } + ], + "rows": [ + { + "id": "first", + "time": 0.837859, + "state": "emit" + }, + { + "id": "middle", + "time": 1.137859, + "state": "emit" + }, + { + "id": "sentinel", + "time": 2.087859, + "state": "emit" + } + ], + "missing": [], + "media": { + "time": 3.248534, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3657, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-zero-frame-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 681.3000000119209, + "end": 1681.300000011921, + "before": 0.013384, + "after": 0.013384 + }, + "firstEligibility": { + "wall": 1681.5999999642372, + "time": 0.973439, + "ids": [] + }, + "samples": 113, + "nonEmptySamples": [ + { + "wall": 2313, + "time": 1.605063, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 114, + "visible": [ + { + "id": "first", + "time": 0.976292, + "wall": 1684.5 + }, + { + "id": "middle", + "time": 0.976696, + "wall": 1684.8999999761581 + }, + { + "id": "sentinel", + "time": 1.605962, + "wall": 2313.800000011921 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1681.8999999761581, + "media": 0.973439, + "end": 1681.8999999761581 + }, + { + "id": "middle", + "start": 1684.5, + "media": 0.976292, + "end": 1684.5 + }, + { + "id": "sentinel", + "start": 2313.099999964237, + "media": 1.605063, + "end": 2313.099999964237 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "emit" + }, + { + "id": "middle", + "time": 0.75, + "state": "emit" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "emit" + } + ], + "missing": [], + "media": { + "time": 2.82595, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native async-visibility-gap records actual frame and eligibility gaps", + "project": "chromium", + "status": "expected", + "duration": 3758, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "async-visibility-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": null, + "firstEligibility": { + "wall": 678.0999999642372, + "time": 0.452779, + "ids": [] + }, + "samples": 177, + "nonEmptySamples": [ + { + "wall": 993.8000000119209, + "time": 0.743922, + "ids": [ + "first" + ] + }, + { + "wall": 1010.8999999761581, + "time": 0.760277, + "ids": [ + "first" + ] + }, + { + "wall": 1027.0999999642372, + "time": 0.776384, + "ids": [ + "first" + ] + }, + { + "wall": 1043.699999988079, + "time": 0.79492, + "ids": [ + "first" + ] + }, + { + "wall": 1060.0999999642372, + "time": 0.809892, + "ids": [ + "first" + ] + }, + { + "wall": 1077.300000011921, + "time": 0.828435, + "ids": [ + "first" + ] + }, + { + "wall": 1093.800000011921, + "time": 0.844539, + "ids": [ + "first" + ] + }, + { + "wall": 1110.3999999761581, + "time": 0.860259, + "ids": [ + "first" + ] + }, + { + "wall": 1127.5, + "time": 0.877458, + "ids": [ + "first" + ] + }, + { + "wall": 1144.3999999761581, + "time": 0.895011, + "ids": [ + "first" + ] + }, + { + "wall": 1160.8999999761581, + "time": 0.911192, + "ids": [ + "first" + ] + }, + { + "wall": 1177.8999999761581, + "time": 0.928286, + "ids": [ + "first" + ] + }, + { + "wall": 1293.8999999761581, + "time": 1.044286, + "ids": [ + "middle" + ] + }, + { + "wall": 1310.3999999761581, + "time": 1.061301, + "ids": [ + "middle" + ] + }, + { + "wall": 1327.0999999642372, + "time": 1.077938, + "ids": [ + "middle" + ] + }, + { + "wall": 1344.0999999642372, + "time": 1.094902, + "ids": [ + "middle" + ] + }, + { + "wall": 1360.0999999642372, + "time": 1.111376, + "ids": [ + "middle" + ] + }, + { + "wall": 1377.5, + "time": 1.128655, + "ids": [ + "middle" + ] + }, + { + "wall": 1393.5, + "time": 1.144689, + "ids": [ + "middle" + ] + }, + { + "wall": 1411.3999999761581, + "time": 1.161225, + "ids": [ + "middle" + ] + }, + { + "wall": 1426.5999999642372, + "time": 1.176414, + "ids": [ + "middle" + ] + }, + { + "wall": 1444.0999999642372, + "time": 1.194652, + "ids": [ + "middle" + ] + }, + { + "wall": 1460.800000011921, + "time": 1.211588, + "ids": [ + "middle" + ] + }, + { + "wall": 1477.300000011921, + "time": 1.227872, + "ids": [ + "middle" + ] + }, + { + "wall": 2243.300000011921, + "time": 1.993421, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 178, + "visible": [ + { + "id": "first", + "time": 1.347658, + "wall": 1597.199999988079 + }, + { + "id": "middle", + "time": 1.36132, + "wall": 1611.3999999761581 + }, + { + "id": "sentinel", + "time": 1.994055, + "wall": 2244 + } + ], + "callbacks": [ + { + "id": "first", + "start": 994, + "media": 0.743922, + "end": 1594.300000011921 + }, + { + "id": "middle", + "start": 1610.800000011921, + "media": 1.360568, + "end": 1610.800000011921 + }, + { + "id": "sentinel", + "start": 2243.5, + "media": 1.993421, + "end": 2243.5 + } + ], + "rows": [ + { + "id": "first", + "time": 0.841978, + "state": "emit" + }, + { + "id": "middle", + "time": 1.141978, + "state": "emit" + }, + { + "id": "sentinel", + "time": 2.091978, + "state": "emit" + } + ], + "missing": [], + "media": { + "time": 3.366369, + "width": 640 + } + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native main-thread-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4703, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "main-thread-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1377, + "end": 2177, + "before": 0.648813, + "after": 0.648813 + }, + "firstEligibility": { + "wall": 1177, + "time": 0.443599, + "ids": [] + }, + "samples": 159, + "nonEmptySamples": [ + { + "wall": 2762, + "time": 2.028759, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2765, + "time": 2.028759, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 110, + "visible": [ + { + "id": "sentinel", + "time": 2.028759, + "wall": 2766 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2762, + "media": 2.028759, + "end": 2762 + }, + { + "id": "sentinel", + "start": 2765, + "media": 2.028759, + "end": 2765 + } + ], + "rows": [ + { + "id": "first", + "time": 0.867962, + "state": "wait" + }, + { + "id": "middle", + "time": 1.167962, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.117962, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.044297, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4051, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 761, + "end": 1761, + "before": 0.426283, + "after": 0.426283 + }, + "firstEligibility": { + "wall": 1761, + "time": 0.426283, + "ids": [] + }, + "samples": 158, + "nonEmptySamples": [ + { + "wall": 2372, + "time": 2.042349, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2375, + "time": 2.042349, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 121, + "visible": [ + { + "id": "sentinel", + "time": 2.042349, + "wall": 2376 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2373, + "media": 2.042349, + "end": 2373 + }, + { + "id": "sentinel", + "start": 2375, + "media": 2.042349, + "end": 2375 + } + ], + "rows": [ + { + "id": "first", + "time": 0.876283, + "state": "wait" + }, + { + "id": "middle", + "time": 1.176283, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.126283, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.41969, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 3863, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-zero-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 556, + "end": 1556, + "before": 0, + "after": 0 + }, + "firstEligibility": { + "wall": 1566, + "time": 0.977487, + "ids": [] + }, + "samples": 160, + "nonEmptySamples": [ + { + "wall": 2199, + "time": 1.629544, + "ids": [ + "sentinel" + ] + }, + { + "wall": 2201, + "time": 1.629544, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 121, + "visible": [ + { + "id": "sentinel", + "time": 1.629544, + "wall": 2203 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 2199, + "media": 1.629544, + "end": 2199 + }, + { + "id": "sentinel", + "start": 2201, + "media": 1.629544, + "end": 2201 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "wait" + }, + { + "id": "middle", + "time": 0.75, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.008107, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native async-visibility-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 3792, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "async-visibility-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": null, + "firstEligibility": { + "wall": 537, + "time": 0.213225, + "ids": [] + }, + "samples": 165, + "nonEmptySamples": [ + { + "wall": 870, + "time": 0.540256, + "ids": [ + "first" + ] + }, + { + "wall": 870, + "time": 0.540256, + "ids": [ + "first" + ] + }, + { + "wall": 2123, + "time": 1.805898, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 180, + "visible": [ + { + "id": "first", + "time": 1.145943, + "wall": 1485 + }, + { + "id": "sentinel", + "time": 1.805898, + "wall": 2127 + } + ], + "callbacks": [ + { + "id": "first", + "start": 870, + "media": 0.540256, + "end": 1481 + }, + { + "id": "first", + "start": 870, + "media": 0.540256, + "end": 1484 + }, + { + "id": "sentinel", + "start": 2124, + "media": 1.805898, + "end": 2124 + } + ], + "rows": [ + { + "id": "first", + "time": 0.628297, + "state": "stop" + }, + { + "id": "middle", + "time": 0.928297, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.8782969999999999, + "state": "stop" + } + ], + "missing": [ + "middle" + ], + "media": { + "time": 3.187195, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native main-thread-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4451, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "main-thread-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 1168, + "end": 1968, + "before": 0.416523, + "after": 0.416523 + }, + "firstEligibility": { + "wall": 969, + "time": 0.209894, + "ids": [] + }, + "samples": 109, + "nonEmptySamples": [ + { + "wall": 2553, + "time": 1.792491, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 109, + "visible": [ + { + "id": "first", + "time": 1.187076, + "wall": 1974 + }, + { + "id": "middle", + "time": 1.187076, + "wall": 1974 + }, + { + "id": "sentinel", + "time": 1.792491, + "wall": 2555 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1973, + "media": 1.187076, + "end": 1973 + }, + { + "id": "middle", + "start": 1974, + "media": 1.187076, + "end": 1974 + }, + { + "id": "sentinel", + "start": 2554, + "media": 1.792491, + "end": 2554 + } + ], + "rows": [ + { + "id": "first", + "time": 0.629214, + "state": "stop" + }, + { + "id": "middle", + "time": 0.929214, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.879214, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 2.802076, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 3818, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 532, + "end": 1532, + "before": 0.220554, + "after": 0.220554 + }, + "firstEligibility": { + "wall": 1532, + "time": 0.220554, + "ids": [] + }, + "samples": 120, + "nonEmptySamples": [ + { + "wall": 2159, + "time": 1.847423, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 120, + "visible": [ + { + "id": "first", + "time": 1.200575, + "wall": 1544 + }, + { + "id": "middle", + "time": 1.200575, + "wall": 1544 + }, + { + "id": "sentinel", + "time": 1.847423, + "wall": 2163 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1542, + "media": 1.200575, + "end": 1542 + }, + { + "id": "middle", + "start": 1544, + "media": 1.200575, + "end": 1544 + }, + { + "id": "sentinel", + "start": 2160, + "media": 1.847423, + "end": 2160 + } + ], + "rows": [ + { + "id": "first", + "time": 0.670554, + "state": "stop" + }, + { + "id": "middle", + "time": 0.970554, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.9205539999999999, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.18472, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 3879, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-zero-frame-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 581, + "end": 1581, + "before": 0, + "after": 0 + }, + "firstEligibility": { + "wall": 1589, + "time": 0.973298, + "ids": [] + }, + "samples": 121, + "nonEmptySamples": [ + { + "wall": 2223, + "time": 1.626875, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 121, + "visible": [ + { + "id": "first", + "time": 0.973298, + "wall": 1591 + }, + { + "id": "middle", + "time": 0.973298, + "wall": 1592 + }, + { + "id": "sentinel", + "time": 1.626875, + "wall": 2224 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1589, + "media": 0.973298, + "end": 1589 + }, + { + "id": "middle", + "start": 1591, + "media": 0.973298, + "end": 1591 + }, + { + "id": "sentinel", + "start": 2223, + "media": 1.626875, + "end": 2223 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "stop" + }, + { + "id": "middle", + "time": 0.75, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.01922, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native async-visibility-gap records actual frame and eligibility gaps", + "project": "firefox", + "status": "expected", + "duration": 4090, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "async-visibility-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": null, + "firstEligibility": { + "wall": 828, + "time": 0.445061, + "ids": [] + }, + "samples": 180, + "nonEmptySamples": [ + { + "wall": 1191, + "time": 0.812273, + "ids": [ + "first" + ] + }, + { + "wall": 1207, + "time": 0.812273, + "ids": [ + "first" + ] + }, + { + "wall": 1224, + "time": 0.852838, + "ids": [ + "first" + ] + }, + { + "wall": 1241, + "time": 0.852838, + "ids": [ + "first" + ] + }, + { + "wall": 1258, + "time": 0.852838, + "ids": [ + "first" + ] + }, + { + "wall": 1275, + "time": 0.893415, + "ids": [ + "first" + ] + }, + { + "wall": 1291, + "time": 0.893415, + "ids": [ + "first" + ] + }, + { + "wall": 1308, + "time": 0.933628, + "ids": [ + "first" + ] + }, + { + "wall": 1324, + "time": 0.933628, + "ids": [ + "first" + ] + }, + { + "wall": 1340, + "time": 0.933628, + "ids": [ + "first" + ] + }, + { + "wall": 1358, + "time": 0.973973, + "ids": [ + "first" + ] + }, + { + "wall": 1375, + "time": 0.973973, + "ids": [ + "first" + ] + }, + { + "wall": 1474, + "time": 1.095429, + "ids": [ + "middle" + ] + }, + { + "wall": 1491, + "time": 1.095429, + "ids": [ + "middle" + ] + }, + { + "wall": 1507, + "time": 1.135791, + "ids": [ + "middle" + ] + }, + { + "wall": 1524, + "time": 1.135791, + "ids": [ + "middle" + ] + }, + { + "wall": 1541, + "time": 1.135791, + "ids": [ + "middle" + ] + }, + { + "wall": 1558, + "time": 1.176242, + "ids": [ + "middle" + ] + }, + { + "wall": 1574, + "time": 1.176242, + "ids": [ + "middle" + ] + }, + { + "wall": 1592, + "time": 1.216413, + "ids": [ + "middle" + ] + }, + { + "wall": 1608, + "time": 1.216413, + "ids": [ + "middle" + ] + }, + { + "wall": 1624, + "time": 1.216413, + "ids": [ + "middle" + ] + }, + { + "wall": 1641, + "time": 1.260015, + "ids": [ + "middle" + ] + }, + { + "wall": 1658, + "time": 1.260015, + "ids": [ + "middle" + ] + }, + { + "wall": 2426, + "time": 2.041925, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 180, + "visible": [ + { + "id": "first", + "time": 1.383096, + "wall": 1796 + }, + { + "id": "middle", + "time": 1.423784, + "wall": 1810 + }, + { + "id": "sentinel", + "time": 2.041925, + "wall": 2430 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1191, + "media": 0.812273, + "end": 1793 + }, + { + "id": "middle", + "start": 1808, + "media": 1.423784, + "end": 1808 + }, + { + "id": "sentinel", + "start": 2426, + "media": 2.041925, + "end": 2426 + } + ], + "rows": [ + { + "id": "first", + "time": 0.880323, + "state": "stop" + }, + { + "id": "middle", + "time": 1.180323, + "state": "stop" + }, + { + "id": "sentinel", + "time": 2.1303229999999997, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.417639, + "width": 640 + } + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native main-thread-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5067, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "main-thread-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1919, + "end": 2719, + "before": 0.7319792, + "after": 1.5311877 + }, + "firstEligibility": { + "wall": 1751, + "time": 0.5636458, + "ids": [] + }, + "samples": 72, + "nonEmptySamples": [ + { + "wall": 3307, + "time": 2.1198127, + "ids": [ + "sentinel" + ] + }, + { + "wall": 3309, + "time": 2.1218544, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 51, + "visible": [ + { + "id": "sentinel", + "time": 2.1354794, + "wall": 3323 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 3307, + "media": 2.1200211, + "end": 3307 + }, + { + "id": "sentinel", + "start": 3309, + "media": 2.1218752, + "end": 3309 + } + ], + "rows": [ + { + "id": "first", + "time": 0.9561250000000001, + "state": "wait" + }, + { + "id": "middle", + "time": 1.256125, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.206125, + "state": "emit" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.4279172, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5216, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1590, + "end": 2590, + "before": 0.44, + "after": 1.4226043 + }, + "firstEligibility": { + "wall": 2616, + "time": 1.4492085, + "ids": [] + }, + "samples": 66, + "nonEmptySamples": [ + { + "wall": 3201, + "time": 2.0337919, + "ids": [ + "sentinel" + ] + }, + { + "wall": 3204, + "time": 2.0365419, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 51, + "visible": [ + { + "id": "sentinel", + "time": 2.0496878, + "wall": 3217 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 3201, + "media": 2.0340211, + "end": 3201 + }, + { + "id": "sentinel", + "start": 3204, + "media": 2.0365627, + "end": 3204 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8536665999999999, + "state": "wait" + }, + { + "id": "middle", + "time": 1.1536666, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.1036666, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.6315422, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5424, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "initial-zero-frame-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": { + "start": 1723, + "end": 2723, + "before": 0, + "after": 0.9842084 + }, + "firstEligibility": { + "wall": 2752, + "time": 1.0132709, + "ids": [] + }, + "samples": 74, + "nonEmptySamples": [ + { + "wall": 3363, + "time": 1.6247919, + "ids": [ + "sentinel" + ] + }, + { + "wall": 3365, + "time": 1.626646, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 57, + "visible": [ + { + "id": "sentinel", + "time": 1.6399169, + "wall": 3378 + } + ], + "callbacks": [ + { + "id": "sentinel", + "start": 3363, + "media": 1.6249377, + "end": 3363 + }, + { + "id": "sentinel", + "start": 3365, + "media": 1.6266669, + "end": 3365 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "wait" + }, + { + "id": "middle", + "time": 0.75, + "state": "wait" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "stop" + } + ], + "missing": [ + "first", + "middle" + ], + "media": { + "time": 3.2461254, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "published: native async-visibility-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5487, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "published", + "provenance": { + "kind": "published", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f" + } + }, + "timing": { + "implementation": "published", + "scenario": "async-visibility-gap", + "sha256": "7c8749288711ef97e80b6f9f00981170aa73f62a8ae25d6d663749a4aef62a8f", + "block": null, + "firstEligibility": { + "wall": 1632, + "time": 0.520875, + "ids": [] + }, + "samples": 73, + "nonEmptySamples": [ + { + "wall": 1939, + "time": 0.8278334, + "ids": [ + "first" + ] + }, + { + "wall": 1939, + "time": 0.8281667, + "ids": [ + "first" + ] + }, + { + "wall": 3207, + "time": 2.0968128, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 80, + "visible": [ + { + "id": "first", + "time": 1.4562293, + "wall": 2567 + }, + { + "id": "sentinel", + "time": 2.1121669, + "wall": 3223 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1939, + "media": 0.8280417, + "end": 2551 + }, + { + "id": "first", + "start": 1939, + "media": 0.8281667, + "end": 2553 + }, + { + "id": "sentinel", + "start": 3207, + "media": 2.0968128, + "end": 3207 + } + ], + "rows": [ + { + "id": "first", + "time": 0.9133333, + "state": "stop" + }, + { + "id": "middle", + "time": 1.2133333, + "state": "wait" + }, + { + "id": "sentinel", + "time": 2.1633333, + "state": "stop" + } + ], + "missing": [ + "middle" + ], + "media": { + "time": 3.872813, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native main-thread-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 4942, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "main-thread-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 1722, + "end": 2522, + "before": 0.59725, + "after": 1.3972085 + }, + "firstEligibility": { + "wall": 1583, + "time": 0.458125, + "ids": [] + }, + "samples": 45, + "nonEmptySamples": [ + { + "wall": 3077, + "time": 1.9528753, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 45, + "visible": [ + { + "id": "first", + "time": 1.400021, + "wall": 2524 + }, + { + "id": "middle", + "time": 1.400896, + "wall": 2525 + }, + { + "id": "sentinel", + "time": 1.9537919, + "wall": 3078 + } + ], + "callbacks": [ + { + "id": "first", + "start": 2522, + "media": 1.3978543, + "end": 2522 + }, + { + "id": "middle", + "start": 2524, + "media": 1.400021, + "end": 2524 + }, + { + "id": "sentinel", + "start": 3077, + "media": 1.9530003, + "end": 3077 + } + ], + "rows": [ + { + "id": "first", + "time": 0.7932499, + "state": "stop" + }, + { + "id": "middle", + "time": 1.0932499, + "state": "stop" + }, + { + "id": "sentinel", + "time": 2.0432499, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.2960213, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5352, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-frame-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 1502, + "end": 2502, + "before": 0.45, + "after": 1.4385835 + }, + "firstEligibility": { + "wall": 2541, + "time": 1.4775418, + "ids": [] + }, + "samples": 48, + "nonEmptySamples": [ + { + "wall": 2973, + "time": 1.910021, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 48, + "visible": [ + { + "id": "first", + "time": 1.4812085, + "wall": 2544 + }, + { + "id": "middle", + "time": 1.4821252, + "wall": 2545 + }, + { + "id": "sentinel", + "time": 1.9122085, + "wall": 2975 + } + ], + "callbacks": [ + { + "id": "first", + "start": 2541, + "media": 1.4782293, + "end": 2541 + }, + { + "id": "middle", + "start": 2544, + "media": 1.4812293, + "end": 2544 + }, + { + "id": "sentinel", + "start": 2973, + "media": 1.9101669, + "end": 2973 + } + ], + "rows": [ + { + "id": "first", + "time": 0.7238958, + "state": "stop" + }, + { + "id": "middle", + "time": 1.0238958, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.9738958, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.7354589, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native initial-zero-frame-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5257, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "initial-zero-frame-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": { + "start": 1534, + "end": 2534, + "before": 0.01, + "after": 0.9952709 + }, + "firstEligibility": { + "wall": 2552, + "time": 1.0136251, + "ids": [] + }, + "samples": 52, + "nonEmptySamples": [ + { + "wall": 3163, + "time": 1.624521, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 52, + "visible": [ + { + "id": "first", + "time": 1.0166251, + "wall": 2555 + }, + { + "id": "middle", + "time": 1.0176043, + "wall": 2556 + }, + { + "id": "sentinel", + "time": 1.6255835, + "wall": 3164 + } + ], + "callbacks": [ + { + "id": "first", + "start": 2552, + "media": 1.0141043, + "end": 2552 + }, + { + "id": "middle", + "start": 2555, + "media": 1.0166459, + "end": 2555 + }, + { + "id": "sentinel", + "start": 3163, + "media": 1.6247085, + "end": 3163 + } + ], + "rows": [ + { + "id": "first", + "time": 0.45, + "state": "stop" + }, + { + "id": "middle", + "time": 0.75, + "state": "stop" + }, + { + "id": "sentinel", + "time": 1.7, + "state": "stop" + } + ], + "missing": [], + "media": { + "time": 3.2899171, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "candidate: native async-visibility-gap records actual frame and eligibility gaps", + "project": "webkit", + "status": "expected", + "duration": 5377, + "retry": 0, + "errors": [], + "evidence": { + "input": { + "implementation": "candidate", + "provenance": { + "kind": "installed", + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + }, + "timing": { + "implementation": "candidate", + "scenario": "async-visibility-gap", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "block": null, + "firstEligibility": { + "wall": 1487, + "time": 0.44, + "ids": [] + }, + "samples": 78, + "nonEmptySamples": [ + { + "wall": 1839, + "time": 0.7932084, + "ids": [ + "first" + ] + }, + { + "wall": 1871, + "time": 0.8245417, + "ids": [ + "first" + ] + }, + { + "wall": 1916, + "time": 0.8697084, + "ids": [ + "first" + ] + }, + { + "wall": 1962, + "time": 0.9155834, + "ids": [ + "first" + ] + }, + { + "wall": 1994, + "time": 0.9477709, + "ids": [ + "first" + ] + }, + { + "wall": 2161, + "time": 1.1152709, + "ids": [ + "middle" + ] + }, + { + "wall": 2192, + "time": 1.1454584, + "ids": [ + "middle" + ] + }, + { + "wall": 2238, + "time": 1.1916251, + "ids": [ + "middle" + ] + }, + { + "wall": 2270, + "time": 1.223646, + "ids": [ + "middle" + ] + }, + { + "wall": 3093, + "time": 2.0468544, + "ids": [ + "sentinel" + ] + } + ], + "frameCount": 78, + "visible": [ + { + "id": "first", + "time": 1.4101668, + "wall": 2456 + }, + { + "id": "middle", + "time": 1.4230627, + "wall": 2469 + }, + { + "id": "sentinel", + "time": 2.0477503, + "wall": 3094 + } + ], + "callbacks": [ + { + "id": "first", + "start": 1840, + "media": 0.7938542, + "end": 2453 + }, + { + "id": "middle", + "start": 2468, + "media": 1.4221668, + "end": 2468 + }, + { + "id": "sentinel", + "start": 3093, + "media": 2.0468961, + "end": 3093 + } + ], + "rows": [ + { + "id": "first", + "time": 0.8641041, + "state": "emit" + }, + { + "id": "middle", + "time": 1.1641040999999999, + "state": "emit" + }, + { + "id": "sentinel", + "time": 2.1141041, + "state": "emit" + } + ], + "missing": [], + "media": { + "time": 3.8399381, + "width": 640 + } + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + } + ] + }, + "load": { + "directory": "refactor/.cache/danmuku-initial-gap-mask-load-final", + "reportSha256": "042bb4ef90de59ea1328e07e09ada702a0667b1cbc11cd8b5ed72e0f97ddc372", + "stats": { + "startTime": "2026-09-15T16:07:51.909Z", + "duration": 52106.41, + "expected": 3, + "skipped": 0, + "unexpected": 0, + "flaky": 0 + }, + "cases": [ + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with candidate core / candidate plugin", + "project": "chromium", + "status": "expected", + "duration": 23579, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 25.287361, + "end": 33.287361000000004, + "errors": [], + "startWall": 12821, + "endWall": 22484.69999998808, + "time": 34.950043, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 24, + "pooled": 24, + "uniquePool": 24, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 73, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 67, + "core": "candidate", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + }, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with candidate core / candidate plugin", + "project": "firefox", + "status": "expected", + "duration": 20921, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 23.098067, + "end": 31.098067, + "errors": [], + "startWall": 11483, + "endWall": 19665, + "time": 31.300942, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 24, + "pooled": 24, + "uniquePool": 24, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 88, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 102, + "core": "candidate", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + }, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with candidate core / candidate plugin", + "project": "webkit", + "status": "expected", + "duration": 18685, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 23.1671672, + "end": 31.1671672, + "errors": [], + "startWall": 9440, + "endWall": 17874, + "time": 31.6013144, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 25, + "pooled": 25, + "uniquePool": 25, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 49, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 46, + "core": "candidate", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + }, + "sha256": "6ba0b7d67622cff9f3d893fd25f4080eaeca79c7db3dc77a097cddf1ffccaf9a" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + } + ] + }, + "preZeroLoad": { + "directory": "refactor/.cache/danmuku-initial-gap-mask-load-before-zero", + "reportSha256": "d4a4511801fbe5bfade92889f86b38bbdf33b0ad884e4d723c1257bb8ffd192c", + "stats": { + "startTime": "2026-09-15T16:02:38.059Z", + "duration": 123573.798, + "expected": 9, + "skipped": 0, + "unexpected": 0, + "flaky": 0 + }, + "cases": [ + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with candidate core / candidate plugin", + "project": "chromium", + "status": "expected", + "duration": 25173, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 26.386779, + "end": 34.386779000000004, + "errors": [], + "startWall": 14790.5, + "endWall": 23912.19999998808, + "time": 35.488849, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 23, + "pooled": 23, + "uniquePool": 23, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 56, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 50, + "core": "candidate", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with published core / candidate plugin", + "project": "chromium", + "status": "expected", + "duration": 23427, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 25.214783, + "end": 33.214783, + "errors": [], + "startWall": 12593.899999976158, + "endWall": 22299.099999964237, + "time": 34.919257, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 23, + "pooled": 23, + "uniquePool": 23, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 72, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 66, + "core": "published", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with published-5.3.1-beta.1 core / candidate plugin", + "project": "chromium", + "status": "expected", + "duration": 26080, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 26.635008, + "end": 34.635008, + "errors": [], + "startWall": 15664.800000011921, + "endWall": 24961.5, + "time": 35.91222, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 24, + "pooled": 24, + "uniquePool": 24, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 57, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 51, + "core": "published-5.3.1-beta.1", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "153.0.8010.12", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with candidate core / candidate plugin", + "project": "firefox", + "status": "expected", + "duration": 21410, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 23.302778, + "end": 31.302778, + "errors": [], + "startWall": 11925, + "endWall": 19993, + "time": 31.392151, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 25, + "pooled": 25, + "uniquePool": 25, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 108, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 122, + "core": "candidate", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with published core / candidate plugin", + "project": "firefox", + "status": "expected", + "duration": 18003, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 22.202557, + "end": 30.202557, + "errors": [], + "startWall": 8213, + "endWall": 17394, + "time": 31.378435, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 24, + "pooled": 24, + "uniquePool": 24, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 128, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 141, + "core": "published", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with published-5.3.1-beta.1 core / candidate plugin", + "project": "firefox", + "status": "expected", + "duration": 19372, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 22.630846, + "end": 30.630846, + "errors": [], + "startWall": 9141, + "endWall": 18272, + "time": 31.820924, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 24, + "pooled": 24, + "uniquePool": 24, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 128, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 137, + "core": "published-5.3.1-beta.1", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "155.0", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with candidate core / candidate plugin", + "project": "webkit", + "status": "expected", + "duration": 17947, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 22.1671671, + "end": 30.1671671, + "errors": [], + "startWall": 8777, + "endWall": 17201, + "time": 30.5912934, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 26, + "pooled": 26, + "uniquePool": 26, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 41, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 40, + "core": "candidate", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with published core / candidate plugin", + "project": "webkit", + "status": "expected", + "duration": 17933, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 22.2761462, + "end": 30.2761462, + "errors": [], + "startWall": 8774, + "endWall": 17253, + "time": 30.7549184, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 25, + "pooled": 25, + "uniquePool": 25, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 47, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 46, + "core": "published", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + }, + { + "title": "Mask actual model and Danmuku share the layer through pause, seek and web fullscreen with published-5.3.1-beta.1 core / candidate plugin", + "project": "webkit", + "status": "expected", + "duration": 17967, + "retry": 0, + "errors": [], + "evidence": { + "load": { + "base": 22.2518963, + "end": 30.2518963, + "errors": [], + "startWall": 8733, + "endWall": 17229, + "time": 30.7482518, + "loaded": 120, + "waiting": 120, + "referenced": 0, + "nodes": 26, + "pooled": 26, + "uniquePool": 26, + "decodedWidth": 1280, + "buffered": { + "pending": [], + "reserved": [] + }, + "requireComplete": true, + "rate": 20, + "seconds": 6, + "modelOutputs": 43, + "rowCount": 120, + "visibleCount": 120, + "frameCount": 42, + "core": "published-5.3.1-beta.1", + "implementation": "candidate", + "danmuku": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "sha256": "da438b67a653a0a08d9911374a0e8a4aa47678b4e9c51cd87c5e01b7f5272b4e" + }, + "mask": { + "file": "source-build", + "provenance": { + "kind": "source-build", + "file": null, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "sha256": "2b4c117b0c2ccf52258877c697a3d83908a23fe3b5c8d698728b98de470c0045" + }, + "unexpected": [], + "limitation": "Actual model, native media, timestamp-delivered Danmuku and CSS web fullscreen. Bounded 20 rows/s after model readiness. No OS fullscreen, GPU completion or device coverage claim." + }, + "browser": { + "version": "26.6", + "platform": "win32", + "errors": [] + } + } + } + ] + } + }, + "installation": { + "map": "refactor/.cache/packages/run-n5mxDm/browser-artifacts.json", + "inputs": { + "directory": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm", + "inputs": [ + { + "name": "artplayer", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer\\dist\\artplayer.js", + "member": "package/dist/artplayer.js", + "sha256": "9148a369636f814b03e6a1ed2a7db222a31b159f93e8a94d52c5a9dde2dfe6a6", + "archiveSha256": "16638b0eb462da9febd5b771b0f099600c986f077373578b73ff2ba83b2e1f67", + "sourceHashes": { + "src/accessibility/button.ts": "e5afa7aade56116082f54678c44961157950fa550d66e21a4e1ff9bb5369a6f8", + "src/accessibility/focus.ts": "2fa16941ac3632cb1e4b466e9a7e29700ef97b7eb2facd4330c59ec0a9320594", + "src/accessibility/keyboard.ts": "2d82122732f84f39e59c6852ca081614caa6430a82b32c4749e297826c77eb12", + "src/accessibility/moved-focus.ts": "c3d2a7d496381b2a86819b82fbd26cc940a1204fdf19408ccc8db267741d96c9", + "src/accessibility/overlay-focus.ts": "93fa088daaa3afed88f645507828a10cb63292937c49b16f6c2a0ea895897878", + "src/accessibility/player-focus.ts": "e8fd5222cbfc38cd4938324c83d9f5cef3d01a439464e1570d63a5131c84f20a", + "src/accessibility/slider.ts": "cfc9237d8db8fe7db3c4a0201ae83f0c4027603e647636545ba7b7e891fef5dd", + "src/accessibility/suspend-focus.ts": "d95c6097236be66e252165287435cca01b50553d64259add6b011721e4bbc644", + "src/bootstrap/browser.ts": "8d401627e8ea1c87fb44204227b04177a70cc7a0f79f95fb5dc73fe828e46a8c", + "src/capture/frame.ts": "eb25d81ec2d40a239103c63cfd80333705251291f2c2da77c740b4d413ea9cd9", + "src/component/dom.ts": "740f63e6e5942c444b9f05605880f8d56a77b066dbe5c4791da74f78cb96c668", + "src/component/focus.ts": "f4aff802711f6146c80e8c6bd90bc2cb406ccbdb581aef41f436ff5c03871ad3", + "src/component/resources.ts": "ff158ef0db8ba13343ff6ba329713820cfe2f5c2c446a7873a6cfff782855edf", + "src/component/selection.ts": "1f0bd089415da28db862647ffd1a0b4af752576465fb616d4b97ae4f8dcae3a7", + "src/component/types.ts": "d7b0e7008b0f6c82e3e97ac43e0188598dca4f740a860e7a60b3b38a46f4565d", + "src/config/index.ts": "a56b4d3d6942cfa3e2b47f909fc5ad87e6e3202fd61b29c7afd7649049e31d05", + "src/contextmenu/aspectRatio.ts": "18ab60c9acee1e0cecd76c0b6cf750763eed7cfbede4220328b5200154c5c478", + "src/contextmenu/choices.ts": "6bb880b27afc9457442c3973992da6dc8da48fc61d6b66b3b5a3bb4fc4651dc8", + "src/contextmenu/close.ts": "84b7a96df910e6f38140df8b1e73519d209a7331e9be9f42d076ae791757024f", + "src/contextmenu/flip.ts": "a7a4ac375da45dc7b6c996d4534098838646a078abfc4438f688e91e14ef0b38", + "src/contextmenu/index.ts": "7532165d162fa463f1fe3c538d6bda0f579b5907b05137382efeb0018719b011", + "src/contextmenu/info.ts": "f37cf0104510c13a130d2f55114c8f7ff15cc1b51863f97e60825442bdb2bf01", + "src/contextmenu/keyboard.ts": "eaa1af6b1abf8947d957208a0535f1b34f6c88e95394efd56cae905ccdea564c", + "src/contextmenu/playbackRate.ts": "7e06bb6fab3acdd71fb3ed63f77083172af517b49c1ecaefa3ee6a9068bdfe54", + "src/contextmenu/position.ts": "851ed1a884a13fbe430be77e7f72ae46d8a719175647e058644834aabd27ac58", + "src/contextmenu/types.ts": "a93fc90f4e17b731e8f6b486a507117810b61c1f1b0d9e775eba27dabeaeee1d", + "src/contextmenu/version.ts": "0553a716be0ba49f614059c41eef6dc694a9641fca79e6448b1b30382c6b582b", + "src/control/airplay.ts": "539bcc3671c7fe428ab95f9fea8a4943444066bcb742c7cf71591ba347642547", + "src/control/builtins.ts": "2a0e12a9741713c92938e1d2009149bbbde498284aa85c63f270d02b27dc22b1", + "src/control/fullscreen.ts": "7f8a9e8915abf9cbb9dda05b5c68523a47cc0ccf9ef5e0d9b82bc5c362fe346d", + "src/control/fullscreenWeb.ts": "9cb30987a3d2cbb334a80d3f2c41f39fd339bf37a9524c7ed0145cf5c98f1859", + "src/control/index.ts": "0d8e5a281f2eeba06c4cc4ac5a042847df53db1a19fdf140efea17d6ab2c0b78", + "src/control/layout.ts": "72e0b95bc632561e97569d789b76d16f36edd94eac8c62ba9e1918c9a222d328", + "src/control/pip.ts": "b829a7c83c5efa6751c2e434345e077339c9f5bc5022af9973f181ca8ce7f7ce", + "src/control/playAndPause.ts": "20ed88bcc7ac7622e02a7c4e6be518582c05f0d7c571a97a54b851d79dcf13c5", + "src/control/progress/interactions.ts": "da03600375451ecf8c152be5afcc5f1a4f8b759e837bbd54b7faaf8f8b228497", + "src/control/progress/keyboard.ts": "03d1d47e6641ea08f765d731f10a6aad35f7c3edc16aa97df822c5f9a7f75eb0", + "src/control/progress/position.ts": "a3794ab5ac5dafa5fd61e56acb12c94998bd4b9065dbf0fa4739c6bba1094aa1", + "src/control/progress/view.ts": "60ee16d5170be81b8132bb56dd0bc0eaf23e50f5c268d0697c9187b38a14aba9", + "src/control/progress.ts": "629c622864619e2515b2eacb1bdfcf523ccce7ce680c8fdf51812e8e50a0cc7e", + "src/control/resources.ts": "16fd7c53ac8f47b333041c4f298313390dc102523d47767b8a16f39a2564ba74", + "src/control/screenshot.ts": "11a1e3da919e476e7882abc3f74aaa809c3e9fc1de4346ec808731f78b6f27e2", + "src/control/selector-keyboard.ts": "6a749f48b23cda62148298e648bb380a6067cc18c7be4258b9ec85c382a56165", + "src/control/selector.ts": "a6f0c564c674530da9a0e4ed8762c6dfb81fa89373d64313e1020550731441f6", + "src/control/setting.ts": "10ee1118858c41f2e97a6df70d6d5dc978757d0e5d79ec36c11e743e6df86726", + "src/control/time.ts": "fa572092e0848878689367fb536e9658d13888d0a0d476babc5acd165af0f8d3", + "src/control/types.ts": "454846310d4fc3a8576ba030c2e8428bb795cde7b89308d29943bb4d4bc2aaa4", + "src/control/volume.ts": "45474d8d7f43d59263aa42e774eaaafeb45530ec24b81a5f589f6c906954568b", + "src/display/fullscreen-abandoned.ts": "1715b30d336976921b4957b444418702b7d93dbf1debce47429269638d15810f", + "src/display/fullscreen-adapter.ts": "71da10ec21c7706a8264badedac9022c74b865887931e9e369168fe3233c3b2f", + "src/display/fullscreen-request.ts": "c6292ded96aab0f2dbc978af251f6cd9f5fd074819529ca498077db8d14e1bfe", + "src/display/mini-drag.ts": "73d2f48f868c0ba4d8d5e5df40cbbdb4698c26540f3973b178d9cd374008f1cb", + "src/display/mini-focus.ts": "1f717619e183b1cfab668bd2e41c8e9ba02210c94cdb58034ec97aa41e71aa34", + "src/display/mini-layout.ts": "3835fe3d314da2fc624cbeb0e79fcdfa5393f08d87dfde730d2eac4e827f405b", + "src/display/mini-view.ts": "bbe69e4419ffc0f6c744cb730a51778f23c311a0fac157223bcf8d8bf0f3edc7", + "src/display/mini.ts": "a6fed598428bbf8d52931f21bb68b7560a3643d2576f7e7bfbae98b2f7cdd1e5", + "src/display/native-fullscreen.ts": "323401f2b3ea5186da981a1215b1b9e7dcf4ef4261a8e885fe8ff0c090de6a7a", + "src/display/native-pip.ts": "647879ae027cc0ebe684daa31d75511dd882e123e4ca8da2942e659bae3719f2", + "src/display/orientation-native.ts": "909980ba837471d9b456545a18fb0ab19f0990e8788936f0580a4b332cd4baee", + "src/display/orientation-types.ts": "0d68d2bc99d04db1e2fdf16b74e406e31f8b7e03fd9b6ea271773ed263ffa890", + "src/display/orientation-web.ts": "aea55c3b9e8c708fe5559f07cf8f0afd7ad37ac5b1a43bf519245c3072ec4129", + "src/display/placement.ts": "dbe4491ebd0f46b4efe13ac567e476fcd9ca5b84da675f19025935b5e3f8d733", + "src/display/sizing-types.ts": "da9b3d957dafaca9331f7319257dd8156b3c3e7b6db11f33f11ded48512450ad", + "src/display/sizing.ts": "c19856976320f1f35ff5a1049d19a940768300e095270b336dd12861b200da2a", + "src/display/types.ts": "e88c868fd370fcc9dc612489992d446a8d0558bd87c26c5c05fdd73d8a3d1b02", + "src/display/video-fullscreen-state.ts": "5fcb5e6b80ac45577664ef67e0460e0ceefd4022cafacdd7434c376a86d619be", + "src/display/video-fullscreen.ts": "b425bf0df462524b5d3accc9e3df383c6635676c152bf4bef09c477a90662728", + "src/display/web-fullscreen.ts": "13f901d20a31a7b8e4ebfbcceac5d3e0737df6335b71f0dfed638785bc413a5a", + "src/display/webkit-pip.ts": "3617927b4bb8fa46f651d0e584141f804ae438e2b4531cc2e9cf9f7eeb027550", + "src/dom/event-path.ts": "e952ea847a2e844a79c5c1b83035e03917e0294b80b1eb8af3b3bec0d2f7d333", + "src/dom/measure.ts": "84a599351d26a790c5a8f6e7d271486a0a68d5b58457d8ce754d540b54902b96", + "src/dom/presentation.ts": "500bded394579dd8194778f73cc44d0724f0a59cb5400957491928534ed091c6", + "src/dom/styles.ts": "734e0a4e04d666417a18ac09ed6271ee7630c399d52d7f510a1c19fd6e7b3493", + "src/dom/tree.ts": "3bc517ab9fa5317a1445156d53afb27182685eb3b4c0ac2ff41bbde55c9eecb6", + "src/events/clickInit.ts": "bd1ba29fe0af4332ceb19297797c4c942a3a74bfd901998d6b93293f1b309300", + "src/events/core-types.ts": "a607a3b2eea1b031f23ec0f620f1f4cd68799c4a77138a1443ecb196b00d1662", + "src/events/gestureInit.ts": "9e9d1ac0da7f87e89dd0d86fa2820b980e9cb810782d6ab30017de8686fc910b", + "src/events/global-types.ts": "3f4672d7af959cfa34ba39aa84ce614f422901437686bba98b14f578df40021c", + "src/events/globalInit.ts": "6f6ea497a20a8fd0746b1f020caff76ad6817cd70a1a90fbaea12f992b6d03a7", + "src/events/hoverInit.ts": "d1250e0dd35a8ba8067275986acbe6320c22adf1a977ec1009c0c012ed1563fe", + "src/events/index.ts": "30d2286316dbd351e93f5a2234dcca84bf68ca28c05921169cca70c2e0b1ecf9", + "src/events/listener-registry.ts": "fb062df5151c4e8e970de469f1c7d9af948f72214d32c293c81a5feeb8406124", + "src/events/moveInit.ts": "da97591723f8b94a34702559b7ee67a35f172aa696d37dfbecd472581ad3de35", + "src/events/resizeInit.ts": "719e27d11d2f93fcbe8368393c9190e251fc86dd0c3c2919f60e9b3b1edd0192", + "src/events/scheduling-types.ts": "0fd98e94397064f32cae4c004d9932c006d2db69a7d6d9374ff174d74ff93cd4", + "src/events/subscriptions.ts": "98573ed6cce73a73467c0e7fdb8ddc45e66b6bdf684c38886749453b2002a1d8", + "src/events/types.ts": "df03625039605314a96ef15b5e3777cbb9d444fd317e1a2fbeaaa0f1e83f6b0f", + "src/events/updateInit.ts": "6f174db14d20319f03a76e6ea267a3d71973faac44a92483badfa4420791817a", + "src/events/viewInit.ts": "d77b83eab802ff0046a4966e28b810a25592bcada49f526adae37556c1e4c3e9", + "src/events/viewport.ts": "6196fccb8b08ae22bde732c4389d9aceb5d727a63efd87b6d3914e338aadc46f", + "src/hotkey.ts": "d8e477bf451143e566e1f743a5f253dcf00beb23544709794779f275e11498e8", + "src/i18n/ar.ts": "897d8935384da16c3c4e96480777fe7fc022f6e3c0d87f62f79ae5f3c98e228c", + "src/i18n/cs.ts": "cc154ee50d258495d04dd2d49e89e9c0166e8b368969c443ec80cb5e48cf357c", + "src/i18n/es.ts": "0ed0283cb78847d6d1674be8c8ffa45feab88beaa8dbd11954b793c7b1657c75", + "src/i18n/fa.ts": "a72e83717f2e3e8f19f1de82516aef4a54ea70563223637bcbb25d21e9eac084", + "src/i18n/fr.ts": "a7366c75530e87f069216e20a6f09da42f7e77fdce862c02b32acf311068124b", + "src/i18n/id.ts": "146bf4c4e5bb39d8e1eb1a6fe3c639eb3128c55789de20511201f8ec02c56c0e", + "src/i18n/index.ts": "09c6f5bce58e4118dde10e8b2a2d3808785b7fde913a54dd189e0b473e21266a", + "src/i18n/pl.ts": "420f3b620d5c7ccdeba7857872be6176239fdf5da30b9cc72341e85dc95c2c8d", + "src/i18n/publish.ts": "5b216bbe313b3cda56a5da41fba4fb9d095eeec0dc903fcf284ddd8f94926e99", + "src/i18n/ru.ts": "9a9f61e6a66b3cd884c609250bf765dcdbc850dae3270d8a1600a5c2542436d3", + "src/i18n/tr.ts": "631c262a5e6cd00fada5bf2e146007d845816e47edb7643ec792250a403e4ec6", + "src/i18n/vi.ts": "e6f3f8e53599e27755e162c76c3b049457aae7089eca73ee531986e67f517f6f", + "src/i18n/zh-cn.ts": "51eb75562ae1ae4e248e1db85c90bcbc69b388a177ada6cbf8c3196a2c343ac6", + "src/i18n/zh-tw.ts": "6b098739e27ad531172d0f13e53849be30e9936365ce9613a7d938d9f01cce53", + "src/icons/airplay.svg": "20802c6735f2489bb6ce4221b519437095c54a3d2c4adbbab3319bb30536f285", + "src/icons/arrow-left.svg": "f1570036b739b0a67fab9261284aa3a13afe277e4c11aba7ab142503e7cce9ba", + "src/icons/arrow-right.svg": "6ffd8eb809152fe54b863bb890b9384d6f8788d129d604d70897fc9bb4398280", + "src/icons/aspect-ratio.svg": "987752a87701523057d8dfa7c45a6a139c4542b96fdcfaf8665722bbeb41f3b2", + "src/icons/check.svg": "7d06c8797e3a71fa7439eda4ea5ae62378e1a974907733e1cdf413db4af99b0c", + "src/icons/close.svg": "bb9e23e5305d11ec3d8f75a50ecdf3150deab8614c7df2af588873f2d78f06c2", + "src/icons/config.svg": "e1884d5411296b5cd1bfec7803b558b0afa5ab64478393977b07a662e2e0f15c", + "src/icons/defaults.ts": "31df862d754922fe5d68b20911c477d7c22893a6a67b5dcb1a48d3b437a0b23a", + "src/icons/error.svg": "d85a72e27ceaa38221637405cb0a5be270a297da58f1b0428498f568fab7570a", + "src/icons/fast-forward.svg": "629cb09ab7e2966c1fc2c04d9b0ee427b71b71abbc437b1db6635992cbe36d83", + "src/icons/flip.svg": "78044b69504710080044315a017f4836d56edce517c210ced3969756818f5b6a", + "src/icons/fullscreen-off.svg": "185b49ff4b0383974cb15a8fda1ba413dc99a133d4a02a4b72c75381d52515f4", + "src/icons/fullscreen-on.svg": "2d71a366b612e29cb2d9cb23c05a75389f794d90646d28bb8a2ac740861a5daa", + "src/icons/fullscreen-web-off.svg": "b4c81bbaa2ea91858b138083df0515c87f4ab8aa70df95ab9eb79e627ab47c7c", + "src/icons/fullscreen-web-on.svg": "4f0a8f688c44aab286bd2d12ab240ab33207664498d3f9fd0a752b53a3c1651f", + "src/icons/index.ts": "7152126328f6e485ee92b6d924c34776518b4a3925b2887867b516f7523b15cc", + "src/icons/loading.svg": "c0f4fd4e243012f1ab67429c99b41e7f8828c66b4ca228e3c6b2d1b6ca629e90", + "src/icons/lock.svg": "571221f734ec224e03f5023d136bca2186f58d768a6ea262881a4c6b49dc283a", + "src/icons/pause.svg": "9efe05ebf5610befddebcac51b3c9a491001189ff86204cb47928eb1617f6c7a", + "src/icons/pip.svg": "36a01d01d140fea05bd7c4eced17c29bc59f73990ed70807d8184ff09f57f50b", + "src/icons/play.svg": "c35562d20028d52ce329f35f90496a06d4dc5b6dc39df7ebcfb027f6f2393958", + "src/icons/playback-rate.svg": "872deecac0365ab04aeb5ccb1cdd9a0c88589a1442709fdac7c0ed12a241ff2b", + "src/icons/screenshot.svg": "49f7d90198fb0bcbc29848f40b0a8c042b78c07ecef1cfc5184e2e84a61b4bd4", + "src/icons/setting.svg": "7f6454d1c7f037d5a7144a898abedc89ca339534166d620dfa45efcd4c74ee3c", + "src/icons/state.svg": "63b56ffbfbba6e9ffe8fd050b3894c033cf30b166bcce9e717b42a9dc42d6424", + "src/icons/switch-off.svg": "aa4b81a9684e02323c32eb58e9a3e409a8f5abac4b8928b176092bf55baec4c0", + "src/icons/switch-on.svg": "1d87b42af5e7141f9defdc790567534288d84858d5068dd15093d5ef12f37f9c", + "src/icons/unlock.svg": "6dc8d6062af2f38efe12ddf4772e97d3f3114a28b885ee90067a4527e1ad6007", + "src/icons/volume-close.svg": "b9dbeaf9043c8014cd29d0e4a21a82ce567bc6b85497c310cca5f68bceeb31b2", + "src/icons/volume.svg": "baebc4ede3013202a4b13202a8d961cb0e5e065ee03733816022b2541d13884f", + "src/image/load.ts": "b4f1517243249d5fb017b89f993660e8b148906bbf28d08fe5c9f6d3a41e1e88", + "src/index.ts": "20cfe3738b3ce7e11b69721a5f0bdad9db77807417d8e421397a40dfade4c047", + "src/info/keyboard.ts": "13a6f617514388b4d14e0bf752780937f2baf545edb216b8259f56a198112c83", + "src/info/poll.ts": "d26ff67d9eadf1e032445371dde6f15293a7fc0b2ae6b87c3815e4b4e1ed5dda", + "src/info.ts": "6594ff3ee5643d63fec874631865d0e35b4ebdcf8aeafdd9fd3d9c595cfa3713", + "src/input/gesture-controller.ts": "1ebbd18184771a623b02ec19c363f84dcc72fdb7cd82bcf2adc97f4a138cb2b4", + "src/input/gesture-direction.ts": "65737f60e177338ebb3337a13ca75aeae77d77e94bc21495ddb829cc30de33a7", + "src/input/gesture-types.ts": "5ed25db69e0d9579a2fc0ab6faadf00fa073ad73a1ea5aa48096b4430c71141a", + "src/input/hotkey-defaults.ts": "c28e14821e5c7f7ac92a302e92439ab68fe77d5ef7d90a36b147b7c979ab96c6", + "src/input/hotkey-types.ts": "c7232470d725f3700481ab98bf9203403a67f1ab82e72394baa9c3ad6f3c9a4b", + "src/input/keyboard-focus.ts": "270c9dba40c0eb6d9fb36118b53e7f1d42a301ba4514917849523b6a05ed9e11", + "src/input/long-press.ts": "110cf16cf9dae845597377ebbc43249e103cbc0ece56f89e44ec6ecc7f3819b0", + "src/input/pointer-focus.ts": "802087098c786135eefa6727f13177ffe4a98e2abf48fad0e356b91e26960077", + "src/input/pointer-types.ts": "63e679498f8f42f6842f63e910c38717ac3438d58df3a75ef5b77c009b7931d4", + "src/layer.ts": "4014268eed043d5dd7b925cdeef6245e357cda67192a1301c5612ef98cdbec12", + "src/libs/screenfull.js": "2332b50c0c6364d5c99080be0f5739255e4b9e465d2cca40f761adce9a1908f8", + "src/lifecycle/instance.ts": "3168f7db4271bae7a242e80798546b755ac15443e15dd9ebb7675f5a259299d8", + "src/lifecycle/resources.ts": "b743daeffb676bb0b31932c3198fa9cf842f5e9015344659594ffffe1a56ba23", + "src/lifecycle/scope.ts": "e2188e8544b27cf8c7ac149e7146af628a2d6166c82b719a247adef5d85be5db", + "src/lifecycle/template-rollback.ts": "7a83da6739bcec1587b02f8157934988910d7f9103fe489a0d6f4f65290c3d77", + "src/loading.ts": "216fa5e2af5be5fcbf95a1578c869553a02f625683a98333d4a404f9a70df9f5", + "src/mask.ts": "500b8c2fb5ded63d5acab3c984fc9757f28a8b6cbd4d5beeac8c5a6d73ca63e4", + "src/media/events/forward.ts": "6b1b7e80036bfb523b51843dc6ec6d83c2b949cefb9cef085b2d679a444e46d8", + "src/media/events/listen.ts": "4eb7e943c1ebca77da8025d83b7d408276187cd02860b7793284344378bd0fe0", + "src/media/events/playback.ts": "2c68e4f6274a0dc65e56d42c928e500fc1d63bf3e03bbdd8a83c3f3ed7ae8ee4", + "src/media/events/readiness.ts": "3ba74f26dd9ff0729967097c2cb6f329a9cea57745bfe8173f9173e0d134476a", + "src/media/events/reconnect.ts": "876027b5116d0d3628755705682b30630f4b713199ed8015541932d81d2944be", + "src/media/events/types.ts": "02bd29ad8b158fa04ce5c1524e397260ef24b94c2cf1f053e7bd02b23e5d29dd", + "src/media/hosts.ts": "498d1cde31bf9ee12af1f13523eb0a4553adb285264529378abba5b629829e9a", + "src/media/playback.ts": "b0364027e1ea26e44e435a938e93c022836885c2622cda6bc3a7ca791d3c2964", + "src/media/position-revision.ts": "ba074cce7e7c6bda84aa234de8eb315e5ca482aa9b06250896f9ac6251192851", + "src/media/types.ts": "96d4a7f066cbb6fb9138165dd736b4ca500cb19c827bd7702134d61c44cc0e87", + "src/notice.ts": "4faa700323a8fdfd91a59491a5f57da2dee9bd1f2de0d900ed16e9809a208c94", + "src/option/defaults.ts": "0bfdc329c48716ac5987c8979fee7e116f6894a70fefc908c99876dfbb4d9dc0", + "src/option/resolve.ts": "27bb1b81a9288062969abb561cec9c88c4b9acb715023e4f22f299f3d5f4bf65", + "src/option/runtime.ts": "4caa060f67c6a57db4a7cc93598e8768794f727b303a5cfa4aeb2ebc247e52d9", + "src/option/types.ts": "224e32ce13cfc9d41ad9f2f3427f97d10bcaaec7e88e30503d618a3d06ae381e", + "src/player/airplayMix.ts": "bfa30e1dcd7cbaef97e977344e8a35524fad6bd23089cd8e45945e3b32b4bf04", + "src/player/aspectRatioMix.ts": "9e5e7365d469aeaef65a6010cb92734702191f9086b2f21d98c9f0ad7f356898", + "src/player/attrMix.ts": "d82150611a69423ed46bf673f44c3e0f61e80425026effd486a6951b6c0dd90c", + "src/player/autoHeightMix.ts": "5848e34cd826f5d4cc81d076c83fb3bcea0aed1228cd93a1edb6b8ca402ad175", + "src/player/autoSizeMix.ts": "6373a8ea7fff4cd875d17c5d3df6dc37764055ab77850a6c6348526969071cbb", + "src/player/cssVarMix.ts": "0d023f28b7a8b4c1a5e2c4dd5672ef4294c86bce0013babd9d52efa32a443b2a", + "src/player/currentTimeMix.ts": "cc374abeb85b203b9f31c566a6b9e53a4a1723d609fccc7b0c9c210993b79e75", + "src/player/durationMix.ts": "60a9d665cf302dcb6b3e37e2f057e31720935e5e588fd7709231f691f6014191", + "src/player/eventInit.ts": "a915c5a618e70b1ab10536b1273ba0fea4ec11d3a2ca629b538e90b5ad2b55f9", + "src/player/flipMix.ts": "a1519c83f8c9437a9b7e99a59e38a3d931032c579f4085226fc0955c7c9eab67", + "src/player/fullscreenMix.ts": "b339bebb4c87f7b75232d7e0d637ebe25bd09a0a0428ba87339a16af5daa71aa", + "src/player/fullscreenWebMix.ts": "75b83a6093c7887ca8725f63c55503d0bf3aafdbbf2347b579120cb257503555", + "src/player/index.ts": "359943c88dc99863e510fc0d51f8e8ee2397217e68045f755d4e9538579bdaec", + "src/player/loadedMix.ts": "6a4c4a08ed74346dad3e138b1dda22c8c9c12f175fe6d00da41b89c78cbe2c18", + "src/player/miniMix.ts": "d68a0c4f6c6059d5831d2d1fd4823b8d3cbce95eefd6d36d38670d6d8720f44e", + "src/player/optionInit.ts": "7c1c47679ee6201d0e0d203fc7b449a09309e7b24a0a1099ad259a70fc1b1a35", + "src/player/pauseMix.ts": "f4fa2b1f05b84ebd27bec9cff5a151addf096dd9b32a38122fb2f1829def0043", + "src/player/pipMix.ts": "63dfb29ffd66ce7d081b24f8e8bf697c041675b49ab8919e206d2df5132de236", + "src/player/playbackRateMix.ts": "e185c6ff52cd567f7fd7c30553bbd6c65517324d1d16c4948c3623ef457ef536", + "src/player/playedMix.ts": "5b6b89bf8dec1efb19cd51e46af1505bae006bdb3fb798e9dec7e3fb5cf0acaa", + "src/player/playingMix.ts": "968c9f6e6d23c233c77d62a593db64adcc6d1a2411f5f1c61a35c6996d6a54d9", + "src/player/playMix.ts": "2d46a3f84da0b1dd18139b76e5e2e163f1d9d9c8f54e67807eeec672acd49917", + "src/player/posterMix.ts": "d569dc24e8e64efe398bd76942bfaf563ffbf64d2a7387ea2e1cb1cf511183d4", + "src/player/properties.ts": "76806d6273545ff556cf9c6d341b59b9041455a8ecbe1fd40510e841c0d5710b", + "src/player/qualityMix.ts": "980ff584c8a5793f5ec9f049f144df31d184d7c9acef49fbe9d504b7657a96bb", + "src/player/rectMix.ts": "a741ee09fa3271df84363c5d73eac1b2e5adb39491f95f8112af81f1219ffed4", + "src/player/screenshotMix.ts": "1754bbce09f713204c120cd4657b52c06eb09eb1fe3244f84474e5967cd68e50", + "src/player/seekMix.ts": "e6e1bf00e8441f1ce58d2a67a66f7e5e98c86d78620ff10a5e6268d54f13fadb", + "src/player/stateMix.ts": "e45b3209a93ab14665d19c5740d5c632187e9fe234b019a2a0263e26884ab3b2", + "src/player/subtitleOffsetMix.ts": "cf9834711842c8a31c3143ab3028f0cf9ba541fafe6f0a3076067daa9d4c750a", + "src/player/switchMix.ts": "b47e174ef0edb2b96ff29f2ddd3c9f2dd2a38713db2a81002b18c89ce71994e9", + "src/player/themeMix.ts": "5bf11bcf8b77cd5d5f2970bc3edcee315c693c1be3d567770d5107a5951cb48f", + "src/player/thumbnailsMix.ts": "6c097d7d00779a6d0d3d65cf9ffd126624a48c9bdb98396c84c39f4de4bdf712", + "src/player/toggleMix.ts": "a3050136248e7d0b942387484c61286ac2b33a90724b1dc3460f5061be76f247", + "src/player/typeMix.ts": "c2a234a9c09f0269a4bd0659087635995945075ac70a5cf2478c8a135fc1b2fe", + "src/player/urlMix.ts": "726a42899261879e03c8b1d4f716458bf3e6e614cecc3bb8d7a581afc2b7866d", + "src/player/volumeMix.ts": "d830bb27b984e0ab2f687943fb49abcbd0331d71fe96049fd81edbddaa64f07f", + "src/plugins/auto-playback/prompt.ts": "58c6dcaf540296ee6f6bdeeda38ee7302aca2b06ddb152b716c0c2bf9c6c96b4", + "src/plugins/auto-playback/records.ts": "133a4ba2fd2d3df724d96eb203d05cffb0b82ecb8de72403974f7979bd37ce01", + "src/plugins/autoOrientation.ts": "4a13b0c010ea7a5002e66c422260ed24bb0d18b3ed41ce10974ac7ca2804cc09", + "src/plugins/autoPlayback.ts": "e349010813bbcd53503383b707c5f6e6e60d8ade6442d020fe6ba07a128c3122", + "src/plugins/builtins.ts": "4631c9775732982dfdc87e16b1bd6b41a350be36fb27e0a9132c11a85b0c016d", + "src/plugins/fastForward.ts": "74c03e3fcfe2f87dcb0ef1a5da5410cb96322509fd07e32930128584c54f62b5", + "src/plugins/index.ts": "4c97f354769bbcb338263f321876a90745a87a9af2d267e216bd3d9d007f268a", + "src/plugins/lock-keyboard.ts": "d59ac2fc9d0daf48c7946e0b49698a74e01f5f55e903c1b090fbda5516cbd16f", + "src/plugins/lock.ts": "8f5fe4469787b7b2a0a302d0fbd925f8eb6d1b261cae6e17367e4d97666a096c", + "src/plugins/miniProgressBar.ts": "21b4850fcaf6b0e82d5e62ca7aca60c179c578f7ff6d5606e6025628ff4b1cc7", + "src/plugins/registration.ts": "9891686c32aeaa33c48ca500cf30ab24ffbb0835c6248769b4c645a5ff20129b", + "src/plugins/types.ts": "6823098d5ec1bf053f60ddfdd36bfcd3f06f3b528cc5dd30fd676a1318dac590", + "src/scheme/index.ts": "dc4a3b5e08478cf72b46b0b59c023359ad5f79b891ea8a6a119ce24a5251821a", + "src/setting/activity.ts": "699ceed4bdeddb6d48eacf79c8dbf737f5d2d8c4983be70205322b14807a91b7", + "src/setting/aspectRatio.ts": "a16eb58fadf77f0a9009cf162d957ffd59d9b8fde83cc193d510fd642e3456cb", + "src/setting/checkpoint.ts": "9d3bff311f9b15c067ca49661af4f48de939f266b8077e7c2f0d66edef22dde6", + "src/setting/events.ts": "f7a3347ca146232caf2a8c9a5a18731cf7bc91dca4cd36370e0265c6eb70df53", + "src/setting/flip.ts": "e72a4ae33300d9e48880897a4f85a04fa6d9a5fff7b06ecaf9081cfb1bb14404", + "src/setting/index.ts": "f6319af15ebe3600a466123dd9d343b86a8d6ed201693ac7ac86dc1d674d477f", + "src/setting/keyboard-focus.ts": "b9af20f66342e10564ef606d75550e9eb9c65274af615ff5719598a0620464a3", + "src/setting/keyboard-item.ts": "d94bfc0266486615ddb79b9eee3886f48891ebb2e5f465652ef98f142ada89d2", + "src/setting/keyboard.ts": "5a2c717d9ecd368efb1bab2562e8d8a06af7607e9fe6d96c1be4d8d58212d395", + "src/setting/layout.ts": "584604e8fffaeaf1d633d1ed45e64d94595c2a56976e3a3f7ede01839b83a37d", + "src/setting/model.ts": "c47348f0f9494c4ce8ea5561bcde6eb698fb11e9197ccdc1ca1359a6d5e370dd", + "src/setting/panels.ts": "64d48720971763985a2a652a18c2ed2f32300c3553d56b52049ae40c4dfceae1", + "src/setting/playbackRate.ts": "2e70e0d2a33cb0ec9fcdd6d22424979fed7b2e01f87015d6be4e520d5cf4e88a", + "src/setting/registration.ts": "c29db62b5d90e0efa4a926c753015e65e96a47add3f5b8840ee51017052edf7c", + "src/setting/render.ts": "ed73745f2c7e2d76bbe8ce7202336e5f4de217dc8f0806b769127cb25316faba", + "src/setting/resources.ts": "64c28cc2cb08cb87b0864ab957d7999bc94931be4788f282d6f190b8806a81fd", + "src/setting/selection.ts": "a642e630924eaf4ad91705fad1fa6e6dc946b32970d809a23da274399fce20ef", + "src/setting/subtitleOffset.ts": "86513835d4e542ac39e9d551507473e3e14c71fd0d5ea725267008ecbff6ab83", + "src/setting/types.ts": "21a07d75a28bbbe20b3e107b6f1a09cb6f8ef2773ea10a4bd7caa88956e9b99c", + "src/setting/update.ts": "79326cb55c52243a7aa8df347a3b081dcd84eb7932fc6162061cc0d9f7078add", + "src/source/listen.ts": "c0596b98258c1544c8e4b762509646428450e56588da36908cb8583b8b716c37", + "src/source/operation.ts": "a8d0b89fc706c4ef0ccdd6d94b220207e92b3d3bd3b42b55c90f9bd191f15cf6", + "src/source/restore-position.ts": "da98a47e8419b33069191e51fc94cc9652302ee4f3eff8ccc7a6dbd4c4c0e2bc", + "src/source/switch.ts": "c66a3db4ba52dcdb46e1f6ab1f350588a07f64d893423d3f135d9768bed74ab6", + "src/source/types.ts": "e5fa3a9cd6b84dffbbb02f61aad966d6046204d857de3e4564c795f02a0259ff", + "src/storage.ts": "9c0a0f3d8ac18261db6e49b2ea14322d1d53bfec3531c7337b85005e708fef30", + "src/style/accessibility.less": "eb9cfe282c64a059d2e102280750bcd33ac33726fa09042eb9875f534335efef", + "src/style/artplayer.less": "a0da37fc5beadee7181d20b0c4769caabce0416fe87b501cbf916d33d073a82b", + "src/style/aspectRatio.less": "2218f0db06da5287a8b7d99c3e72360d1c9af02d805d1b380f93d95df7542cd8", + "src/style/backdrop.less": "45d2518d29c294801dff1ab85e3a4bb2cec66496adccdf893854fb08d444869b", + "src/style/bottom.less": "324de61ac2a82748015168789fc48c861ba6d490a87f9a98dac931b53f0d5a95", + "src/style/contextmenu.less": "190d7e61fba903428847e4495f084306c9ddd1b45178abe04087f3ab883eda2d", + "src/style/controls.less": "eb6d4bf4e4ff903d724d45f3ff60f0cf10c02e622fba195555a8179100cdce87", + "src/style/danmuku.less": "e971e214fc4fcad36707d0a2739991e5345ed3b0d582fd9484e3e2065f4d4e45", + "src/style/flip.less": "f3169f63fbab0c8166b0f1fe58719bc980a295f160dd534855adb2670742b8b5", + "src/style/fullscreen.less": "ae20b0142cb4dab46f1062270608d47c6947a6e35d9c0915ae237f6d593287c2", + "src/style/fullscreenWeb.less": "d92057496349d44b903a4e62b4b4a6ebc2c7b93320fce81f26a5666abdf77330", + "src/style/hideCursor.less": "28c6c2150589607c2002fa7b6e7a09b525742630d0b247c3c36b414c2c693cb8", + "src/style/hint.less": "e2dc4940e6b212d8da75a404fd5ff1ad894008457677bc37554c6b64b735bc31", + "src/style/icon.less": "2751208954958b8437d10746111d192ca944f97d8cbfcbae6a2a2f5f0ceaf234", + "src/style/index.less": "ea6f4cd4ac769bbedf870e01a753c0cdc24493e9ac367c895ff3687d02f6a84c", + "src/style/index.ts": "856afc037ffcd4d18c4b54901ddbb30e310014553fe9d19560e34fb54b8378c1", + "src/style/info.less": "8cdb91746d0ad17dfd9c493f317bdbe0bac250c11ce6d907596a7f34c6f0d5d4", + "src/style/inject.ts": "9cddbe51b5de0da74f27c045ab982b509c3854cc6b81eeb02a6b974914760a4d", + "src/style/layers.less": "623d06fb1c5520e99401f6e5e3f2a6e60aec540e4d3226845582677e69fe220f", + "src/style/loading.less": "3defb61105e6229494501dfa3315cc82366eaffc9569a25dabdb54ba8ba57f9d", + "src/style/mask.less": "3bcd16bc8cb4fe573c3937ae7fa1a1435fc5479873841c21d99d83d1916cd1be", + "src/style/mini.less": "abf2b03a51d518867bdef5818ef5fd604f19c2f85dc8bc9784dbad480dd8b991", + "src/style/mixins.less": "4de7eb5642eb03388ff36b2fc37c5b2bbd9d8a68c74861aee2d9aba22cc0d171", + "src/style/mobile.less": "1c3f93a6eba38589a031478ba04d87007c02594613845c1325c22ba940629c32", + "src/style/notice.less": "4ef68e420702979d9bb6d9659fefdd52a22996edd9f528473ffc0e08bb9f70de", + "src/style/plugins.less": "7122d23a57a98f09b3d933ff15eddbadc909d3fd1cd096a8e8e25fef25cbc0b2", + "src/style/poster.less": "8bc21639753db5f5ee671b1155812ba4bb42365c218f9c53c95e42b68ec4498b", + "src/style/progress.less": "9578590a84cd446d9790ae97f89103cdd65cac0094846f0c36ea16e182275411", + "src/style/selector.less": "a33cba4ff9c8e9aad4af152547bf54fdc64fb74a1013ab99a9ac01eb55fe25c7", + "src/style/setting.less": "c7fec9fc8c3cc3e63085b405a0199e2148721050b41fca3ba33598dccb153958", + "src/style/subtitle.less": "9660cef4d9933f2e3b5f8299f1c820797df4942c18e8c9883930ad111a86b3b3", + "src/style/variables.less": "166418165eb862c669eaaf40bd068ae12beb9b784abf6ebdd83380b9aa72bedc", + "src/style/video.less": "1658e7941437268fc187c991d0fab1d2d74ec1fad5997df67b4b9cc6a1cb52d9", + "src/style/volume.less": "9c3a184f3921e026ba5e3164b6d0c52ea7d5f60214e2884959939b74360b21fd", + "src/subtitle/index.ts": "b4ead680dc82fa47c53d1ec7e5fb8bf94abbf55730d5d1130ad8d544cb42adc8", + "src/subtitle/parse.ts": "7db540c5edb1d2312eed82757fd15a7ce6a28996ba20d0087e56730f21dede74", + "src/subtitle/render.ts": "96493fc35680af635a8db225a8bf002208df79ed48b1d4ee6cc73587543add5c", + "src/subtitle/request.ts": "543c964571bd5ab984bc1adc9f64a8917dd134ed2892ad10b30ed9c859f34119", + "src/subtitle/state.ts": "9f79b982d66747170bc39bdaf99b65676310965f23da62a4dec15547c756a56b", + "src/subtitle/timing.ts": "f2c1dbb63697a51c200371127da4fb8ea6e90a5b4de888bb1c2d7eae4007a5f8", + "src/subtitle/track.ts": "707f4c43af4ebf4b87521f6f577168460e739274d0cec28b9efe5704d2540d18", + "src/subtitle/types.ts": "c7fd0568c71611fe44f0a7d2735a246250c8a63daefd15c63091e37d38bf1edb", + "src/template/html.ts": "351c472bfd01fa5ba1a4e347ed31bd5faaf823d9b4c5cab1ce8c651e3b175021", + "src/template/nodes.ts": "1572746a636647e4d313cc8752d3a110ff81fddb390ad7b0feb6a0db0d42b9d4", + "src/template/types.ts": "2bf906b4a209e17dae4d79225e758e2e53772e93f19f188d0131051ea2a0143a", + "src/template.ts": "0ea9155b9292d4c528a464d3c97996ee5a1c9c4aabc2959a744989085db2251b", + "src/thumbnails/layout.ts": "6630439242a880f53fcb374b7b15c7f486405aab8a0fad651b137f02971eeb59", + "src/utils/compatibility.ts": "1fd2a5b17ee3245712eda961d3c0a15caf3c428010112e48231890176ce1e5e2", + "src/utils/component.ts": "c3fa96467e8b315d974a42a19591aa4a4a7514853db796135b2acbcdcb160ea3", + "src/utils/dom.ts": "72f3539dabf296df37ab4cc7ade0c8ac9480f399987101589450c787e7d6719b", + "src/utils/emitter.ts": "26a93d3ff35b53e71a5f3bb22c252a854559d8151ede50a66a28d9eefae6c008", + "src/utils/error.ts": "ba303c7d4e4228919088f9d608fa364596f5853ee646eda2008deee354866f38", + "src/utils/file.ts": "ea71d7fc0e818d473bf5a596211ba9d571e4febdf1878014eadefa8d0a98d4cc", + "src/utils/format.ts": "891df5b7542b713aef46bf2b93924f42e68eee574afd802db3e6c62ff2655ede", + "src/utils/index.ts": "5211af833dddb2937d25dcc772740d62f9d5c5039ce5505bffff0796d4afd756", + "src/utils/property.ts": "c737d4582a4382f4038d12dafdf8b43418e508c9b8b859b2f0cc17c20f370343", + "src/utils/subtitle.ts": "f058851d11a418e321a8a498472b67fa535fec2c7b5d3df739b6b4f263d00337", + "src/utils/time.ts": "b8ce3d50865f6c343e8e3ce9f5c87de565a87b4e9fbcbccbe7030e30e80b93fe", + "public/artplayer.cts": "0e91e907d021db02a68004603e6190505fdc0806d873ebb6af171aa089a81da7", + "public/artplayer.mts": "f6292596a9ccb1d43a6d6a12c35f859b1889ad15924c5ae0f9f280941aade313", + "public/artplayer.ts": "2c1f228e38eeda3aba0dceb9630c5db1380ef7033037b28a12423355c8a80983", + "public/component.ts": "ec0ba441e6f834118afcefd0621d9a76143ad4fcf50b699a374249ab14d2c314", + "public/config.ts": "97322dce493ac3d1160f426e4fd0ba89fa746f7d66bfbeabd9f45454198560ad", + "public/cssVar.ts": "2ff9827aa10bf326f60f6cda7556a94fdcabafba529185a1ceae46d865f33697", + "public/emitter.ts": "9c62551cdcc6dd3966bed8a7a85dd477435db977c91a294d2ac8f162f9592537", + "public/events.ts": "cb23eb57b07a0b4725a2cbea62add2fe691f818cc4bbcb862bc62caf5b297f3d", + "public/i18n.ts": "38094c46bed0ecd5bad02a3a5fbf0d61521df45aa2e1154256cec4ad5491958f", + "public/icons.ts": "61ce1b0cb9bc7488263b644419b5fd5a13e72de1493c8113eee81d5174f1234b", + "public/language.cts": "2248040d86a8e34626755c4ecf53ea0174706c653073cf0e15884a030d173120", + "public/language.mts": "c391e863012c77769e661afbf8fa949e9373aa88d17f58cbba7f5696edb8077f", + "public/legacy/language.ts": "c452ffd764ff9b29b819b3475c42395d2ea7a33560d8c186ef5df3844b9524c3", + "public/option.ts": "88dab402e6f55c51ef7b70c0ecde3e4437116f7dfced303047e410835088a3a5", + "public/playback.ts": "1ceaed3aa1cef511fe8b20f4874647f6065c723ad805b742a0a9247e16bb1bb5", + "public/player.ts": "fe75e08e8bc3912bd1f42bba92998418b9718a688b60068c2b9843e6218b0519", + "public/plugin.ts": "2a57e148fda00ee687da5036b890b0f611cb94bb403a1ed52602179060259d35", + "public/quality.ts": "dcca8c0f5b5c25373f85825a274fc3ee8beeffd7c8b2a978468e039ff4946a9e", + "public/runtime/component.ts": "840213299c942fe058eb5436977ceec066b9dccda24c55ae9f464b399c979e39", + "public/runtime/construction.ts": "24cc5cda1f614314db382271a9b0d5583b781894cfdf6c548700b1b5270467ee", + "public/runtime/events.ts": "52848f57d35eb1037cf74c8877521edf99a015bcd77f30ef6bbcba1807a99bfe", + "public/runtime/media.ts": "8828f80953aec3e95328cefe691661e8897cb27cb309483cf806ec45a8549ae3", + "public/runtime/option.ts": "bb672e49ffe74a6fc78543217f6de80d7d738890146df0857c709d4dc283e4ce", + "public/runtime/player.ts": "a4a24794e26cfb9e4310bf0f459a7a407e85bf81b4f3a4feb6294331af8036fb", + "public/runtime/plugin.ts": "9ad482f2a77914a91450419680b8af6b314b926f0831c2f7f6d7c466690f95c9", + "public/runtime/services.ts": "8e4648d8c61bff47343f9e1c2b995af69fc00947264b826109ceadcbaf553254", + "public/runtime/setting.ts": "c48d20957b57f79f985ef76a2950cc8a5cfa25dafa8ec5939e562661778e6218", + "public/runtime/subtitle.ts": "13241c4f9a87517aa2cf7b3e0bb8cedaa12fa0b4d3f8934285797583b752557e", + "public/runtime/template.ts": "da9975513a1938e7f386f4f65f718f0fc595164bfeac8f0cd99a3e97a54919a1", + "public/runtime/utils.ts": "cab9916f5224a3b047812b9f759cc9cc62105662599744067a6955020ab36916", + "public/runtime.cts": "52cfff1daeb6841a90212c8fa8d46ca46d6650bb7ed1b59b62115d854b8ad652", + "public/runtime.mts": "1b09bc0ee0f0ee2f788689eaff441bdeda1fab0ce783e71b61b9792d81072b03", + "public/runtime.ts": "ec4b1d56993eb482a77eb0f94b701047549d009e6ba6433f27e7d464fef30c2b", + "public/setting.ts": "a60ed81da780439a55ee22ebe2611d936bd45da0d98e6bf44c92e9a5d9047492", + "public/subtitle.ts": "92f711ad0f7924e609ad4425cd26d19c73eb027cccddc6d89fcf9b8e334db065", + "public/template.ts": "b5f9bff43b4816bd2e3531a3a1750b8014fcf63d421fbc786341cedb1429035c", + "public/utils.ts": "63757d81dd9cf5b95c67ff758da71c87bf535f15aeea7dfda322637d26fd33d0", + "package.json": "82e92699e7c29847f32ac6767ece0401290e7d7a12854722bdbcfd09b90b7954", + "THIRD_PARTY_NOTICES": "b77b5b46b79fa0cda850b0781f78c3b1112c4ed9672fa291956fe8eff53098e7", + "tsconfig.json": "c074f0621b18e6f209e217a702745e4118ee7724955e8104c7e3df3a223a9921" + } + }, + { + "name": "artplayer-plugin-chapter", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-chapter\\dist\\artplayer-plugin-chapter.js", + "member": "package/dist/artplayer-plugin-chapter.js", + "sha256": "179c3ea90ddc85da27b46f000110e32d464dfa5c8c394e98316dc1b75d6f2a72", + "archiveSha256": "bf476440dc32f7a3d7f494bce495f7c7356706c70490ecf7619a2e45daafb971", + "sourceHashes": { + "src/chapters.ts": "92206f524624ac3a7304677b6a69fda88e62caeca52e1e530d746e51579d3a4d", + "src/index.ts": "83dc022253c0539587590f7a551e090684d1944dcb2010a76e8498a683e7ef36", + "src/progress.ts": "4a18d19ed703772d73622ea3fa9d433dbc2c6092ba244c9bb1ec727368996951", + "src/style.less": "6c0b688efd9606a55c1cf7bf902e3030717a65210506a33ab1b31156a72ee85f", + "src/stylesheet.ts": "6ccd88b6d17127acf6f6c1f02a7fbb3a55d59f427d2d92c007bf658122abd51c", + "src/types.ts": "07c528f9753cc54c12211276f28ff01a5f6e8f1ef1451b2b534f2d6cfaa17ee9", + "package.json": "24eec6907b3218439189adab6af3f932c1497c47c2d41209311c01042b07fd4f", + "tsconfig.json": "732a6076acef4c8437d305af19a9da8a0e04b8740a1df32921fd30011c162492" + } + }, + { + "name": "artplayer-plugin-danmuku", + "file": "D:\\github\\ArtPlayer\\refactor\\.cache\\packages\\run-n5mxDm\\artifacts\\artplayer-plugin-danmuku\\dist\\artplayer-plugin-danmuku.js", + "member": "package/dist/artplayer-plugin-danmuku.js", + "sha256": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "archiveSha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "sourceHashes": { + "src/bilibili-parser.ts": "a9d7668eda4ab10d076c319fb8847b2f4492f4499a47b003e30a8a647f1fce9f", + "src/bilibili.ts": "deb12c825ae8018501c81e935c17ce732621ea9e1e711181a71aa1f2db7102ed", + "src/config.ts": "ecdc1206b984126c4d49480fe264e2202d8e3393970d1552406e6a399c612951", + "src/danmuku.ts": "e15716c37b4e42e2a1b7b4b77d4ecdb66bb854a87715f6d99018f00bc321a3a5", + "src/heatmap-geometry.ts": "fc4a3073bdcfdeb09facf7dafce5bd10c2518ec6feb5ab6fccc008c869d01ee0", + "src/heatmap-sampling.ts": "7f4074a8ec3eb985599ca5c4def096030a11733285e72e9e1ba5cf23f81108a3", + "src/heatmap.ts": "032ec70f9594824fb6eedaed277e1125a6327219a8551bd22956f8a5ac162381", + "src/img/check_off.svg": "8cb8e31da1bf7b5be8f4065920b46e1988755910218fb121dd3d9649c50156cf", + "src/img/check_on.svg": "c5a34f56c56b0f696b4e3740c73e803076b5bfdfdee89714793118fc4c6baa84", + "src/img/config.svg": "bbd7c2952740ac8220f396477eaca3b01f6c249866d880ece38c565cc77c5e36", + "src/img/mode_0_off.svg": "fe9e5e1745e8206a4eda0d0ac30815f301c37acccec2564bbda51c1fa4bd1e1e", + "src/img/mode_0_on.svg": "96720a81f0315caf6c70664de934e49d22e6dd070a9f6ca1fec2a9a96af4d138", + "src/img/mode_1_off.svg": "3ccd22bf3648dc260cd1d0b6a60a9226a853764ae20efb8fe9c940cd856c81b2", + "src/img/mode_1_on.svg": "2238ca27e3c7c4c687d10de13b794d8be70ae1c5ba9225ebad27f251cfe5f12a", + "src/img/mode_2_off.svg": "31423e3d67c00839adc77dd871dc1da55f77c8b83b5a37b445e4b4c3f46c6d6d", + "src/img/mode_2_on.svg": "96b4c9db8d5055c8777fda74cb5e0f32b3e12e62a1e0bacbf75d2088f4505e2f", + "src/img/off.svg": "4e6743ee28002e16117caf47ea3bffb34ca75bcc4118744b4ee720829ae3b563", + "src/img/on.svg": "cc0fb7048bff6dc3f14a17ed549209c67e9bc34368cb1571e0abd8035c7b59b7", + "src/img/style.svg": "9034ea7b9a214a6d4c086c02cf85f42b1c4487cec0906e919fc91e99dfff529a", + "src/index.ts": "bb94fb7c711159c5bad8240b2cad3b5d11b7623307b0ef77f25b88ad21314d00", + "src/input.ts": "a9340c7031f486e22074a8def633fba47eb22c2a745fc5d6e6ddac988b9c6839", + "src/parser-types.ts": "f91cf9afc4947a12a79a44f51db7117a08d833db2cb2fca025935a3ac9358046", + "src/placement.ts": "84e7f059790f71f83e7039c561278a5cf016eceef2ba585a748ab47f1423f054", + "src/queue.ts": "79eb58836c90dc864b68019792a8185be907e23dfd451cfd2916a9ef78fc8e7e", + "src/renderer.ts": "b3b6b0f74a1cd34c4391eafb6be434f5efd1c6e2095356c8fa11c542209e9441", + "src/sampling-window.ts": "ea75cf1d990f92f90df837e107949f6171bebb02e6be7639bd7021f8e0fd7679", + "src/scheduler.ts": "ef02e52ab6c05f0e77eab929655c59c68bf2341a686e284660c33819d604b811", + "src/scheduling-buffer.ts": "0a7eaf5229adcc74a8d9814fbc9a61cb3990045b3e99ac4ad9dc3f65fb9aab2e", + "src/setting-lifecycle.ts": "4580ce961a4b9ca9d6a481667306204778fdd46b404fbfa232e28db97ab74db0", + "src/setting-send.ts": "b6abbaf3a5e29d42cffb41de44e1ec3760fa3c3223e1b0476e9c8a57f94fd650", + "src/setting-slider.ts": "f06dd34babc0d369cc741d1eb98638aa90a516f59b317fa97a7a0cb2f343cb1d", + "src/setting-style.ts": "47a9a52fee7b9565febb91f8db0f7027d9e77ea5c5dff9220c8425803cca5057", + "src/setting-template.ts": "136609371f91b057d7c589fc32ae7510a0359edc794628c6f1ace33ac6a10406", + "src/setting-types.ts": "42efe18a8fb4ec24d90df49d0c74532a1ad3661e9dcb584b563e38ce8ccaadaa", + "src/setting.ts": "9273fd8869364efb12fb90e9f45674fb0d5f9e49675acb2c2500850f0386ee5a", + "src/style.less": "7148a1bd32f5d3d743db4a4ae8d39dc0e1406d2bff18df42cbb20e6705d5fed9", + "src/types.ts": "d561f0aa1c46b39dfdf66ba74e57b66841f9ac75344b51d9707bfd3e33879c71", + "src/worker-assets.d.ts": "3582ccd87626600d9d29c6fa82f812012ea389bc03b39e4edcb4345d02372751", + "src/worker-client.ts": "252b048c67123d296c277d5c1e92ff0f36d919e4c47588497e2da3ca7b4ca881", + "src/worker-types.ts": "6595241341a2ed7c0d01120addadf42dcca306fa1282098084d5d0b6c4e32608", + "src/worker.ts": "39c134fcc5d785fccd8d0743b2353c6a45965e886191b7d4c7cf2131b299ca18", + "package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "tsconfig.json": "e77f21e3d898f815361f940427ac977adfcc40140972c320aace52a9038a9ea1" + } + } + ], + "toolchain": { + "yarn.lock": "aa33cfc38c7933ab53ce626a911fdafd7b14023e45f93ca37bf7f2f6a1d3ecce", + "scripts/build.js": "ec716c545d6bd0a06fdf7b616a487e0cc7605212de5c413bc247efa6737d5870", + "scripts/utils.js": "b42450026f5e8a621b59cd84f91d5c1d6915f4ec026ad2ee0980b06f16f6ae79", + "scripts/projects.js": "3956faff0032ab5b91daa45f390a664ca246559621f95fd2f53cef8bb8b58bdf", + "scripts/library/analysis.ts": "68ce6b33d0257ccd34a2abc5a75a7a6e06420cd93eaa00501cc04e38d48ad78b", + "scripts/library/assets.ts": "639c8137ccce15f903267e066e5dc55b4776c76bdfcfe5550599b15dc17e0f2e", + "scripts/library/banner.ts": "c07b9b033cf1e3ad68e9ce80c0f9e7955d24abe8ad291e01ad22b5303c9f9ec5", + "scripts/library/config.ts": "2017a781a78e227e8ecfd98af56ea9d3ae91f4f033f36b371e0efac1995a1aec", + "scripts/library/development.ts": "202d1cfa5cc5ba7a5ee474a5a7e36afaf028b7be834516ab0be5cc97a3a53f71", + "scripts/library/names.ts": "3749777e71f2f471e0edb4a1104d2c650d09643f57149a42f1c135dc79b7b1b5", + "scripts/library/production.ts": "f309ec71319d7d99f703bba3d11f3db53c1c240d6af9d0d5e6a5e36eb3b1bfeb", + "scripts/library/projects.ts": "fc658271482a4f293c21d606ac87b2668dbc88e3028b345a622587ebc0d151ca", + "scripts/library/rebuild.ts": "01cfc0f5f58263baa891e7c783349f1ff212a423a03a6805aecea568a482aec0", + "scripts/library/reload.ts": "0ee863e38c3065826d6432656e7c7d52ab4326733109195ad57ac6583fc6da58", + "scripts/library/server.ts": "389303abf965e5b8a1138de194b766457f625bf06438b50e48fb388d8a537dfd", + "scripts/library/vendor.d.ts": "af37a4c6bf37fde5c8eff862668f188eb1f3e9e3c12c3d46f563af78bd8b385f" + }, + "packages": [ + { + "name": "artplayer", + "version": "5.4.1", + "archive": "artplayer.tgz", + "sha256": "16638b0eb462da9febd5b771b0f099600c986f077373578b73ff2ba83b2e1f67", + "files": { + "package/ARCHITECTURE.md": "dad3ccb55f25c63e0eb3b8d5f25b21db58431c48f84a2d9eb046b2492ac6cedc", + "package/README.md": "1e185e65f67fc2081b4182bbc6c4558ea05b6e3fa3acc5dd0c3ac7df1d542b09", + "package/THIRD_PARTY_NOTICES": "b77b5b46b79fa0cda850b0781f78c3b1112c4ed9672fa291956fe8eff53098e7", + "package/dist/artplayer.js": "9148a369636f814b03e6a1ed2a7db222a31b159f93e8a94d52c5a9dde2dfe6a6", + "package/dist/artplayer.legacy.js": "9bde35a6d64234cae15300e37b03204c075ef26126058f48bb3bf97d6e002449", + "package/dist/artplayer.mjs": "265bca0ad3f8373acc84333c19cdded0cbd6b309ede9e51c0bec35685c77eebd", + "package/dist/i18n/ar.js": "bd0bef65f4f7dc3f8ed562904cc6fa9071ff4537fb64c1e0fc3d554141bcd3cb", + "package/dist/i18n/ar.mjs": "59310b7bbeea83bbb7d73aadc5ca82a6ec269c3530d19aa741c94d5c64fc5da8", + "package/dist/i18n/cs.js": "6e2c93daba24c2e48dfa206bcf4f2f2a8a02713b856e404d2e4e4ecd8309ca2f", + "package/dist/i18n/cs.mjs": "c73fba18797d62d7b2581e67fe7340c35fe84510b2250ff1ecaad253d9cabbac", + "package/dist/i18n/es.js": "f4133ac6ea06b69a474b33c4a1809a4066e2376bb9464a3f3aa8330f01f1944a", + "package/dist/i18n/es.mjs": "1390bca3def2be115e811de337df0a0c3f63998e51359f283023246245c552a7", + "package/dist/i18n/fa.js": "8d3ef2e0f0cc0ea480c2167b6fcb87cdf444e90759c3519e8daa139fec576da4", + "package/dist/i18n/fa.mjs": "ab441e8a2d79043b29ceca87c783bf06874bb9d3a149c1604bc167eb481be2a9", + "package/dist/i18n/fr.js": "89dc4194a6c0a962b9ce756b52c90401c1acf3b159f265f3bc0d7d6d7d987f03", + "package/dist/i18n/fr.mjs": "99491878430fb7b6f2b7bf93da0588a831704b412e01116f23ba1d9d45863816", + "package/dist/i18n/id.js": "4c6dc86db741bcc2857df55a9d037e82e91d375fa6fd22e0562809ff621b92db", + "package/dist/i18n/id.mjs": "383e5803a6b6686c6de4e867770241de75b6f517dcca2bdedc6f2004bf6e1fb3", + "package/dist/i18n/pl.js": "3a38828b1c3d719c0aca9906cf6a46c23555a8411f8d57645f0e0ce8147dc664", + "package/dist/i18n/pl.mjs": "079ed96732979035297af387c64a7b99519b5a43107fb86735a654ea4fe8e9b5", + "package/dist/i18n/ru.js": "62fac9dddb302eb16382e6e9301fc4b2c66f5f69d4a358a26b67026a5fa4e787", + "package/dist/i18n/ru.mjs": "a893aeaee1d79409db72e324fbff200e3864f33ed168f04d91d25f7cf2efa765", + "package/dist/i18n/tr.js": "1492c36b069a7d73db4f3913bd18085faff7afd8b3c158138fe264e31600e38c", + "package/dist/i18n/tr.mjs": "a90478cac078836b76c2a98261907610fee07f3e4b28671b8e7dbf533778f918", + "package/dist/i18n/vi.js": "c7216ef7e608a79b7e2c479a07bf310d4ab79577947ac4a62d676faaced0e9cf", + "package/dist/i18n/vi.mjs": "66270fdfa0b5da396322d1769169b7df37a030ba15ac18eb30bd87b3af8074ec", + "package/dist/i18n/zh-tw.js": "11c49857d6d40a5ffd224ffa59c9026e71621b345f63c5a086326db80a22371a", + "package/dist/i18n/zh-tw.mjs": "a38e630cb96de96c15d824686aec750e25cf6c8ada01285a292442a81566314f", + "package/package.json": "82e92699e7c29847f32ac6767ece0401290e7d7a12854722bdbcfd09b90b7954", + "package/types/COMPATIBILITY.md": "a7da9e102a116104b513df4f7451247b7759bc502d3375f30bd5b14a541826e0", + "package/types/README.md": "1bd9868e773610e6312fd48a1c5aa20772d29df0af40c3db66e75b7ab4a1aee0", + "package/types/artplayer.d.cts": "3685065e4263abcfd9d953176e461d5b3eb990b0363b54689a7f55deba770fef", + "package/types/artplayer.d.mts": "b664fec51ee5c5381f2ceab25d99d52aee56feab04a2ee7b4ea5b2145ea5fa0e", + "package/types/artplayer.d.ts": "5d0162adf7ac6d0f2bb9b5cfe361f28657c4d9c540cadbf36eba3cc954ce50f8", + "package/types/component.d.ts": "ae5bc1ddeaa1ee1ebbc62573e32423993727079205c64751a5a314170e588a32", + "package/types/config.d.ts": "36f9a84cd436f17701a0d11d3417fc1fe0414e0c52c80083b94a85dfc329e37e", + "package/types/cssVar.d.ts": "93217860fff2ebf750f606d95ddd22220a58837119e63bdf2f5f78fd7488458b", + "package/types/emitter.d.ts": "7e1f9a2a8ce65feb95734f1ed52d1334e57aa388bbef2a43d8bc53a9b6f6623c", + "package/types/events.d.ts": "f83624c9268a284477e8bd793fe3562a2363b72f2a44d5c64fe8c6a6cede8830", + "package/types/i18n.d.ts": "f4f2f05bdfda73c74fef34767cb18ee8e11b743120b1c4598e9714d7846018e5", + "package/types/icons.d.ts": "326a67ba7bdcf52862c5b2a269e540140aff98d05c7b96196485a77f84fe5960", + "package/types/language.d.cts": "f7928e108cf7b7814c2d75cb0a525333e95873fca6cd6d89a740450656b9c1cd", + "package/types/language.d.mts": "6619a26d604b7cccbe2f596243d87ae37cfaae33b8b52874ec071d9787446f9e", + "package/types/legacy/language.d.ts": "c7abda4d506fd933c350e9030290bf9e64347a921d683a66115da1995ebe0a81", + "package/types/option.d.ts": "ccf2c8ddc537dc65c9682d39f044726e23bff18f476b622512d7e6a4b949b5f6", + "package/types/playback.d.ts": "58705c273df6e76a77a6575e769a9ec6c013785c25080f2551aa22415788d870", + "package/types/player.d.ts": "92b00211b70ac71336e495899df972a0519dd138111846044fe4e0f967966177", + "package/types/plugin.d.ts": "fc3594a41c51d8248713e33c486fb1f6a518ac5c7ce31be6988a6cd8d052c5f3", + "package/types/quality.d.ts": "1ac1a48b4f74ff9ba1ce60443e1463d50d1c6a2e5d87d63dc7d2a8eb7f4c2c34", + "package/types/runtime.d.cts": "7ee988dfea9a0ac71a34a656f96f7b74e78aa92547cfdfab7ff7e1139a77d4a3", + "package/types/runtime.d.mts": "dcb85f59a8b7714918ced0c1d18c2bb24e8b80b56d8c594e019dcbdb5ad88b08", + "package/types/runtime.d.ts": "9c6ccd39a1be293f17ae46dae8ea077053e12635ee79d73a5e3b3a559230fcff", + "package/types/runtime/component.d.ts": "1b4c0cee44568649e80140fe778febfcae88af0ac85515f1cbeff78ab0c6d14f", + "package/types/runtime/construction.d.ts": "7a87bedf6f7ffff0c46078aa5f1551e0077d35574e286516121f5f935e2d9ce4", + "package/types/runtime/events.d.ts": "a1e2f9d387475453eaf95c2a5ee79e228636c0bb859bda3fcc46da46574a0c31", + "package/types/runtime/media.d.ts": "8fc89401be7fe25542c169d07dd5675f10916ed20be8493e19695966cf3864a8", + "package/types/runtime/option.d.ts": "6e334e1a76fdcc40b4665c02523bd31c3994d96078fadeb40e23422aa54c1a1d", + "package/types/runtime/player.d.ts": "8ac6383502e4872e83659838844856903031a81a0adc8e8535feb78453aa042c", + "package/types/runtime/plugin.d.ts": "8528f2b17843149f42f9cc16d6fd70baa238c9dc2c329b67d2c38096799c69bd", + "package/types/runtime/services.d.ts": "604c9f8e4b6c0da818f96576bf9f4b0e96085a9003927b2f7ba30027b1ba237e", + "package/types/runtime/setting.d.ts": "349c1fcb205ad312916bd3ee55e6bf241ea8a569fb2ab6c80822e69fc518f7d7", + "package/types/runtime/subtitle.d.ts": "269ff84678d327b3a9dc2f5bc6cc0d731d1e081b85422e474621d5d792efb153", + "package/types/runtime/template.d.ts": "7a62f968a38b4bf9109a4439557c02074eb1d62ba1f6e21a8eb194e91f0badfe", + "package/types/runtime/utils.d.ts": "6bf731705d86853e066dbaf3b8d4003b6548423fe615b7412b722bd0d3a6e48b", + "package/types/setting.d.ts": "08305a75dff96f06490430e099338b463df471b550c1d0dac3abc8995b39eb09", + "package/types/subtitle.d.ts": "b18314e2d64efdb6045830b6e12f615ae2ed585416130e562329ad3ea337f6ce", + "package/types/template.d.ts": "4792bc0c2cbcb7966e4375118bd34b326166e0831862e94ace4cf6b1bbe6a8c8", + "package/types/utils.d.ts": "fca0d3d814df94a25f9eb067c86fa0cf272e2791bac793b91229d57680797712" + } + }, + { + "name": "artplayer-plugin-chapter", + "version": "1.1.0", + "archive": "artplayer-plugin-chapter.tgz", + "sha256": "bf476440dc32f7a3d7f494bce495f7c7356706c70490ecf7619a2e45daafb971", + "files": { + "package/ARCHITECTURE.md": "7734e4d29aa25ccb39cab826781409c4ecfd2a47ef19c5535f1a70d7fb47b4c1", + "package/README.md": "b95400ff3d525621a15268bb56a2d353aacaaadefde7e735d7abd91a34edd96f", + "package/dist/artplayer-plugin-chapter.js": "179c3ea90ddc85da27b46f000110e32d464dfa5c8c394e98316dc1b75d6f2a72", + "package/dist/artplayer-plugin-chapter.legacy.js": "dade919ed044cbf46ac16e505f538f86a86edccf177da2e14d79d111559d4bef", + "package/dist/artplayer-plugin-chapter.mjs": "754fbcfc60add74d6b6ad3bc8db253df3eb14ace13ac8a5439be0592bd5512d0", + "package/package.json": "24eec6907b3218439189adab6af3f932c1497c47c2d41209311c01042b07fd4f", + "package/types/artplayer-plugin-chapter.d.cts": "4f07514b37453cd6cea8e5aa28fa018ff31738e0d423c11a3b5eccd50ed30bcc", + "package/types/artplayer-plugin-chapter.d.mts": "610179754db36276e161a07bccf4eaba8b4480f053e716a2bcc5a1574871a171", + "package/types/artplayer-plugin-chapter.d.ts": "581aa2862e709601c87a23585f54a969ebd350be56a7469a31ff53f1311b578d" + } + }, + { + "name": "artplayer-plugin-danmuku", + "version": "5.3.0", + "archive": "artplayer-plugin-danmuku.tgz", + "sha256": "3294262e23ba5e94fa65b1a4abe6a65978309fc956d95c59329c974e30400c55", + "files": { + "package/ARCHITECTURE.md": "76c0242d42faa1367aa982096413d46612cf55910d164d4fe181aa9fd634da7c", + "package/README.md": "d393b6862951242f258a579ea539e4a408599decf49925265c43dbee3bae3f37", + "package/dist/artplayer-plugin-danmuku.js": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "package/dist/artplayer-plugin-danmuku.legacy.js": "f95602b33ce0148c5ec5e78981811e2c3a5d3f91a776ee6a23d0b78b21c296d3", + "package/dist/artplayer-plugin-danmuku.mjs": "c0771fa003185daa3608854e0c81ee56f20c521828e1c44d4fb2129cecda65a4", + "package/package.json": "563f92ac14666c7600b0af623bd77d7ff71f1faebb851a1d780207ac8952f0a5", + "package/types/artplayer-plugin-danmuku.d.ts": "3162fc3db91bff06f0709fa0e6ca78de05053e25436ca215846a6267d4680e53", + "package/types/runtime-shared.d.ts": "52556c8228c0947fb74a4335a204521378099a6a855d83e48e4f5aec1e34944d", + "package/types/runtime.d.cts": "9b5073ca622762c367e79161968f6c31e1f3f73b412d3e049a0d845cdac2c832", + "package/types/runtime.d.mts": "564a6ed25fbb363603b825e84ae0298cfcc69c3d007fd56c616dbd20cec4a0a9", + "package/types/runtime.d.ts": "9b5073ca622762c367e79161968f6c31e1f3f73b412d3e049a0d845cdac2c832" + } + } + ] + }, + "command": "yarn test:package --include=artplayer-plugin-danmuku", + "log": "refactor/.cache/danmuku-initial-gap-package-final.log", + "fixtureScope": "Core/Chapter 36 runtime checks, five legacy and eight precise type modes; additional Danmuku installation is verified by installed bytes and dedicated scheduling/browser checks. This is a focused three-package run, not the full 20-package installed CI matrix." + }, + "build": { + "formats": [ + "main", + "legacy", + "esm" + ], + "exitCode": 0, + "log": "refactor/.cache/danmuku-initial-gap-build-final.log", + "initialFailure": "refactor/.cache/danmuku-initial-gap-build-copy-failure.log", + "note": "One Windows copyfile UNKNOWN -4094 error with sufficient disk space and ordinary file attributes. Same repository build succeeded on the next attempt; exact cause unproven, no build logic or assertion changed." + }, + "fingerprints": { + "packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "docs/compiled/artplayer-plugin-danmuku.js": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "refactor/.cache/packages/run-n5mxDm/artifacts/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js": "e855e22f7cda0746cbbc6b4a0bbd899128c93dadedd681a0cb3569c13ed75540", + "packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.legacy.js": "f95602b33ce0148c5ec5e78981811e2c3a5d3f91a776ee6a23d0b78b21c296d3", + "docs/compiled/artplayer-plugin-danmuku.legacy.js": "f95602b33ce0148c5ec5e78981811e2c3a5d3f91a776ee6a23d0b78b21c296d3", + "refactor/.cache/packages/run-n5mxDm/artifacts/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.legacy.js": "f95602b33ce0148c5ec5e78981811e2c3a5d3f91a776ee6a23d0b78b21c296d3", + "packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs": "c0771fa003185daa3608854e0c81ee56f20c521828e1c44d4fb2129cecda65a4", + "docs/compiled/artplayer-plugin-danmuku.mjs": "c0771fa003185daa3608854e0c81ee56f20c521828e1c44d4fb2129cecda65a4", + "refactor/.cache/packages/run-n5mxDm/artifacts/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs": "c0771fa003185daa3608854e0c81ee56f20c521828e1c44d4fb2129cecda65a4" + }, + "limitations": [ + "Original full WebKit CI report with 13 failures is retained; this change closes the Danmuku first-sample failure only.", + "Windows WebKit is not physical Safari; no physical device or remote CI acceptance is claimed.", + "The initial-frame Firefox control did not advance media before its first sample in the red run; it is not claimed as a Firefox reproduction.", + "Final model load covers candidate core across three engines; nine old/candidate-core load combinations passed before the separate time-zero guard was added.", + "No new dependency, public declaration, package version, publication or formal review in this task." + ] +} diff --git a/refactor/changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md b/refactor/changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md new file mode 100644 index 000000000..9789ee7c7 --- /dev/null +++ b/refactor/changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md @@ -0,0 +1,67 @@ +# PKG-DANMUKU-START-01 首帧之前的采样区间 + +状态:本缺陷修复完成。起点 b5f8b5e28e33cfb44e7aa93089b6dfbf247142f0。 +关闭 DANMUKU-INSTALLED-GAP-01;PKG-DANMUKU-08 的其他组合与设备门槛仍保留。 +这属于实施与回归验证,没有启动用户要求自行指导的正式复盘。 + +## 原因和修复 + +完整安装包 WebKit 回归的原始轨迹中,800ms CPU 阻塞期间媒体从约0.461前进到 +1.261;第一次 readys 查询已经在阻塞之后,first/middle 留在 wait 且未进入 +beforeVisible。原 sampling-window 直到 RAF 内第一次 capture 才保存时间及 +等待队列,因此没有先前区间可供补回。此前的连续两帧间隔测试未覆盖这个入口。 + +新增受控测试在播放开始后、第一帧前推进800ms,稳定复现两行都未显示。 +新增真实浏览器控制在 start 事件中进行1000ms CPU 工作,保留原生媒体时钟、 +RAF、readys 返回值和队列状态;修复前 Chromium/WebKit 同样漏掉 first/middle。 +Firefox 在这次负例的第一帧前没有前进媒体时间,不能称其复现了相同缺陷。 + +`SamplingWindow.begin` 只在没有起点时保存媒体时间及既有等待行;Scheduler +在确认开始播放且可见时、请求 RAF 前调用它。它不额外查询公开 readys,也不在 +RAF 外执行 beforeVisible 或 visible。重复 play/playing/start 不向前覆盖起点。 +原取消、seek、stop、hide、document visibility/adoption 清空规则保持。 +新插入的过期行、已采样的 false 回调仍不会因跨窗口而被额外重试。 + +进一步补测发现第0秒也必须覆盖:旧公开 playing 要求 currentTime > 0。 +因此内部起点还接受已解除暂停、未结束且 readyState > 2 的真实媒体状态。 +这不修改公开 playing;实际显示调度仍使用原 playing 条件。第0秒受控用例 +在此补充前失败、补充后通过,三浏览器同时验证了真实零点播放入口。 + +没有改变公开声明、事件负载、回调串行顺序、轨道算法、Worker 协议、显示寿命、 +播放速度或依赖。维护文档明确起点与公开 getter 的区别。 + +## 验证证据 + +详见 [机器证据](../baselines/danmuku-start-validation.json),包含原失败的精确输入、 +首个采样、红绿结果、安装来源、源码/产物指纹和实际模型负载计数。 + +- Node24.21.0 / Yarn1.22.22。最终 `yarn test:danmuku` 278/278,通过旧契约、 + 热力图、renderer、输入、Worker、失败/取消和调度回归;25.322秒。 + 严格生产 tsc 和修改范围 lint 通过。 +- 安装后的 main/legacy 各61/61调度测试通过,运行安装包内真正的 Worker 代码; + 包含三小时模拟时钟、池复用、暂停/seek、串行异步回调及首帧/零点红绿。 +- 最终源码三引擎时序24/24,61.623秒;安装产物24/24,57.128秒;均无跳过、 + 失败或重试。包括原800ms CPU窗口、首次RAF前阻塞、第0秒启动和异步回调间隔。 + 原 readys 查询保持瞬时窗口,候选 first/middle/sentinel 按序显示。 + 旧版本用例仍是历史观察或精确缺陷对照,不代表旧版已经修复。 +- 最终候选核心下的真实 MediaPipe Mask 组合三引擎3/3,52.106秒。每引擎 + 120行全部显示,模型输出分别73/88/49次,含暂停、seek和网页全屏。 + 零点补充前还验证了三个新旧核心×三个浏览器9/9;它是中间版本证据,未冒充 + 最终代码的完整九组合。没有降低模型尺寸、负载或替换 SDK 内部计算。 +- 最终隔离安装为 `.cache/packages/run-n5mxDm`,显式包含核心、Chapter和Danmuku。 + 此通用消费者检查的36项运行时、5旧类型/8精确类型模式属于核心/Chapter; + Danmuku 另由安装后的调度及浏览器检查证明。它不是完整20包CI矩阵。 + main/legacy/ESM 在工作区、docs/compiled和安装目录的字节逐一相等。 + +最后构建曾出现一次 Windows copyfile UNKNOWN/-4094,磁盘空间充足且文件属性 +正常;下一次相同构建成功。保留失败日志,根因未证实,没有为其修改构建逻辑。 + +## 剩余边界与下一步 + +原完整 WebKit 的13失败报告原样保留;本提交只关闭其中弹幕首采样缺陷。 +Windows WebKit26.6不是物理Safari,真实设备、其余组合问题和远端CI尚不能 +由这些本机结果替代。Chromium153.0.8010.12、Firefox155.0的版本见逐案例附件。 + +下一步继续剩余包验收与版本准备。每包大版本升级仍按已有政策单独实施; +完成全部实施后等待用户指导复盘,不能据此推送或发布。 +回退本任务时须一起回退源码、生成产物、测试及状态;原始失败证据继续保留。 diff --git a/refactor/plan.md b/refactor/plan.md index 8047c9cbe..2aa988604 100644 --- a/refactor/plan.md +++ b/refactor/plan.md @@ -2,9 +2,9 @@ > 由 tasks.json 生成。请修改数据后运行 `node refactor/scripts/plan.mjs --write`,不要手改本表。 -基线:`40fcda6a37d0049d42e49c1e64e70d4fd9ba5f7f`。总任务 282 项,范围 22 个包及工作区/示例。 +基线:`40fcda6a37d0049d42e49c1e64e70d4fd9ba5f7f`。总任务 283 项,范围 22 个包及工作区/示例。 -状态:todo 43 / doing 20 / blocked 0 / done 219 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。 +状态:todo 43 / doing 20 / blocked 0 / done 220 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。 前置依赖是启动条件;验收是完成条件。任务可以继续拆分,但不能复用或悄悄删除旧 ID。 @@ -22,7 +22,7 @@ | artplayer-plugin-auto-thumbnail | 1.1.0 | PKG-AUTO-THUMB-01, PKG-AUTO-THUMB-02, PKG-AUTO-THUMB-03, PKG-AUTO-THUMB-04, PKG-AUTO-THUMB-05, PKG-AUTO-THUMB-06, PKG-AUTO-THUMB-07, PKG-AUTO-THUMB-08, PKG-AUTO-THUMB-09, PKG-AUTO-THUMB-10, PKG-AUTO-THUMB-11, PKG-AUTO-THUMB-12, PKG-AUTO-THUMB-13 | | artplayer-plugin-chapter | 1.1.0 | PILOT-01, PKG-CHAPTER-01, PKG-CHAPTER-02, PKG-CHAPTER-03, PKG-CHAPTER-04, PKG-CHAPTER-05, PKG-CHAPTER-06, PKG-CHAPTER-HOVER-01 | | artplayer-plugin-chromecast | 1.1.0 | PKG-CAST-01, PKG-CAST-02, PKG-CAST-03, PKG-CAST-04, PKG-CAST-05, PKG-CAST-06 | -| artplayer-plugin-danmuku | 5.3.0 | PKG-DANMUKU-01, PKG-DANMUKU-02, PKG-DANMUKU-03, PKG-DANMUKU-04, PKG-DANMUKU-05, PKG-DANMUKU-06, PKG-DANMUKU-07, PKG-DANMUKU-08, PKG-DANMUKU-09, SITE-DANMUKU-01, PKG-DANMUKU-10, PKG-DANMUKU-11, PKG-DANMUKU-12, PKG-DANMUKU-MASK-LOAD-01 | +| artplayer-plugin-danmuku | 5.3.0 | PKG-DANMUKU-01, PKG-DANMUKU-02, PKG-DANMUKU-03, PKG-DANMUKU-04, PKG-DANMUKU-05, PKG-DANMUKU-06, PKG-DANMUKU-07, PKG-DANMUKU-08, PKG-DANMUKU-09, SITE-DANMUKU-01, PKG-DANMUKU-10, PKG-DANMUKU-11, PKG-DANMUKU-12, PKG-DANMUKU-MASK-LOAD-01, PKG-DANMUKU-START-01 | | artplayer-plugin-danmuku-mask | 1.1.0 | PKG-MASK-01, PKG-MASK-02, PKG-MASK-03, PKG-MASK-04, PKG-MASK-05, PKG-MASK-06, ENG-LINT-01, PKG-DANMUKU-MASK-LOAD-01 | | artplayer-plugin-dash-control | 1.1.0 | PKG-DASH-01, PKG-DASH-02, PKG-DASH-03, PKG-DASH-04, PKG-DASH-SEEK-01, PKG-DASH-MENU-01, PKG-DASH-05, PKG-DASH-06, SITE-DASH-01, PKG-DASH-CLEANUP-01 | | artplayer-plugin-document-pip | 1.1.0 | PKG-DPIP-01, PKG-DPIP-02, PKG-DPIP-03, PKG-DPIP-04, PKG-DPIP-05, PKG-DPIP-06 | @@ -345,11 +345,12 @@ | PKG-DANMUKU-05 | artplayer-plugin-danmuku
整理 DOM 渲染、设置、热力图与 worker | PKG-DANMUKU-04, CORE-14, CORE-18 | renderer/setting/heatmap/worker 职责及资源归属 | mount/icons/设置和 worker 协议保持,销毁无后台工作 | H | done | | PKG-DANMUKU-06 | artplayer-plugin-danmuku
迁移 TS 与公开声明 | PKG-DANMUKU-05, ENG-04, ENG-06 | 自有模块、worker 消息、option/item/result 类型 | 旧参数、扩展字段和事件消费通过,vendored 边界清楚 | H | done | | PKG-DANMUKU-07 | artplayer-plugin-danmuku
弹幕能力稳定性验收 | PKG-DANMUKU-06, PKG-DANMUKU-10, PKG-DANMUKU-11, PKG-DANMUKU-12 | 负载/渲染/资源对比及 mask 可依赖的稳定边界 | 在试点核心中旧插件 API 与关键帧路径通过 | H | done | -| PKG-DANMUKU-08 | artplayer-plugin-danmuku
完成新旧核心与组合验收 | PKG-DANMUKU-07, CORE-22 | 最终核心/旧核心、mask/fullscreen/PiP 组合报告 | 性能无未解释退化,反复装卸无累计资源 | H | doing | -| PKG-DANMUKU-09 | artplayer-plugin-danmuku
完成分发、示例与文档 | PKG-DANMUKU-08, ENG-07, PKG-DANMUKU-MASK-LOAD-01 | danmuku.js、README、声明、worker 与产物 | tarball 和静态 icons 等旧调用通过,有独立回退版本 | H | todo | +| PKG-DANMUKU-08 | artplayer-plugin-danmuku
完成新旧核心与组合验收 | PKG-DANMUKU-07, CORE-22, PKG-DANMUKU-START-01 | 最终核心/旧核心、mask/fullscreen/PiP 组合报告 | 性能无未解释退化,反复装卸无累计资源 | H | doing | +| PKG-DANMUKU-09 | artplayer-plugin-danmuku
完成分发、示例与文档 | PKG-DANMUKU-08, ENG-07, PKG-DANMUKU-MASK-LOAD-01, PKG-DANMUKU-START-01 | danmuku.js、README、声明、worker 与产物 | tarball 和静态 icons 等旧调用通过,有独立回退版本 | H | todo | | PKG-DANMUKU-10 | artplayer-plugin-danmuku
修复 issue958 密集热力图过高与曲线裁平 | PKG-DANMUKU-05 | 自动密度缩放与曲线边界、历史自定义坐标兼容及真实浏览器红绿证据 | 16000条三种分布在两核心三引擎和source/main/legacy不遮挡;显式轴和自定义points保持旧解释,有单独commit | M | done | | PKG-DANMUKU-11 | artplayer-plugin-danmuku
修复 Worker 隐藏等待吞掉可见寿命 | PKG-DANMUKU-06 | 成功放置时的可见计时与延迟回复回归 | 真实 Worker 延迟下完整显示寿命;保留暂停/回收/取消和公开契约 | M | done | | PKG-DANMUKU-12 | artplayer-plugin-danmuku
保持异步放置期间的原生帧采样与寿命维护 | PKG-DANMUKU-11 | 每帧采样与串行dispatcher、代际buffer及回归 | 异步等待不丢已到时采样、不延迟既有寿命维护;保留顺序、取消与公开readys窗口 | H | done | +| PKG-DANMUKU-START-01 | artplayer-plugin-danmuku
修复首帧延迟前丢失的弹幕采样区间 | PKG-DANMUKU-MASK-LOAD-01 | 播放起始采样修复、受控红绿及源码/安装产物真实浏览器证据 | 解释并修复安装 WebKit 首次 readys 在 CPU 间隔后才运行的漏显;保持公开查询、串行回调和 seek/暂停/隐藏取消边界 | H | done | ## 5 包迁移:artplayer-proxy-canvas @@ -650,7 +651,7 @@ - PKG-DANMUKU-05: [记录](changes/2026-09-13-PKG-DANMUKU-05-resources.md) [记录](baselines/danmuku-resources-validation.json) - PKG-DANMUKU-06: [记录](changes/2026-09-13-PKG-DANMUKU-06-types.md) [记录](baselines/danmuku-types-validation.json) - PKG-DANMUKU-07: [记录](changes/2026-09-13-PKG-DANMUKU-07-stability.md) [记录](baselines/danmuku-stability-validation.json) [记录](danmuku-stability.md) -- PKG-DANMUKU-08: [记录](changes/2026-09-14-PKG-DANMUKU-08-native-combinations.md) [记录](baselines/danmuku-combination-checkpoint.json) [记录](changes/2026-09-14-PKG-DANMUKU-08-fullscreen-lifetimes.md) [记录](baselines/danmuku-fullscreen-validation.json) [记录](baselines/danmuku-old-core-load-validation.json) [记录](changes/2026-09-14-PKG-DANMUKU-08-combined-load.md) [记录](baselines/danmuku-combined-load-validation.json) [记录](changes/2026-09-15-CI-01-installed-webkit.md) [记录](baselines/ci-installed-webkit-validation.json) +- PKG-DANMUKU-08: [记录](changes/2026-09-14-PKG-DANMUKU-08-native-combinations.md) [记录](baselines/danmuku-combination-checkpoint.json) [记录](changes/2026-09-14-PKG-DANMUKU-08-fullscreen-lifetimes.md) [记录](baselines/danmuku-fullscreen-validation.json) [记录](baselines/danmuku-old-core-load-validation.json) [记录](changes/2026-09-14-PKG-DANMUKU-08-combined-load.md) [记录](baselines/danmuku-combined-load-validation.json) [记录](changes/2026-09-15-CI-01-installed-webkit.md) [记录](baselines/ci-installed-webkit-validation.json) [记录](changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md) [记录](baselines/danmuku-start-validation.json) - PKG-CANVAS-01: [记录](changes/2026-09-12-PKG-CANVAS-01-contract.md) [记录](baselines/canvas-contract.md) [记录](baselines/canvas-release.json) [记录](canvas-validation.md) [记录](baselines/canvas-contract-validation.json) - PKG-CANVAS-02: [记录](changes/2026-09-12-PKG-CANVAS-02-tests.md) [记录](baselines/canvas-behavior-validation.json) [记录](canvas-validation.md) - PKG-CANVAS-03: [记录](changes/2026-09-12-PKG-CANVAS-03-lifecycle.md) [记录](baselines/canvas-lifecycle-validation.json) [记录](canvas-validation.md) @@ -740,3 +741,4 @@ - SITE-EDITOR-VAST-01: [记录](changes/2026-09-15-SITE-EDITOR-VAST-01-consumer.md) [记录](baselines/editor-vast-consumer-validation.json) [记录](baselines/ci-source-firefox-validation.json) [记录](vast-type-decision.md) - CI-JASSUB-SOURCE-01: [记录](changes/2026-09-15-CI-JASSUB-SOURCE-01-native-inputs.md) [记录](baselines/jassub-source-selection-validation.json) - DOC-REVIEW-01: [记录](changes/2026-09-15-DOC-REVIEW-01-user-guidance.md) [记录](release-reviews.md) [记录](ai-workflow.md) +- PKG-DANMUKU-START-01: [记录](baselines/ci-installed-webkit-validation.json) [记录](changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md) [记录](baselines/danmuku-start-validation.json) diff --git a/refactor/progress.md b/refactor/progress.md index ddceaf1fc..26f5bcdaa 100644 --- a/refactor/progress.md +++ b/refactor/progress.md @@ -1,5 +1,18 @@ # 进度与证据 +## PKG-DANMUKU-START-01 首帧漏显修复完成 + +已解释原安装 WebKit 的首个 readys 在CPU间隔之后才运行的漏显:私有采样窗口 +原本没有播放起点。现于实际播放开始、第一帧前建立起点,补齐第0秒的原生播放 +边界;公开 readys/playing 与回调调度规则保持。原失败轨迹及红绿均已归档。 +278项弹幕测试、严格类型、安装main/legacy各61项通过;最终源码/安装三浏览器 +时序各24项通过。最终候选核心的真实Mask负载3项均120/120显示;中间版本 +三个核心×三个引擎9项通过的范围单独注明。见[记录](changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md)、 +[证据](baselines/danmuku-start-validation.json)。 +DANMUKU-INSTALLED-GAP-01 resolved;完整CI原13失败报告保留,其余风险没有关闭。 +当前220 done、20 doing、43 todo,共283项。下一步继续包验收与版本准备; +实施后等待用户指导复盘,不推送或发布。 + ## PKG-TOOL-THUMB-04 Thumbnail 策略与源码迁移完成 用户批准已落实:默认保留 npm 3.5.31,显式 workspace-4.4 保留未发布工作区行为。 diff --git a/refactor/risk-table.md b/refactor/risk-table.md index 8ecb2412d..f83859b2f 100644 --- a/refactor/risk-table.md +++ b/refactor/risk-table.md @@ -290,4 +290,4 @@ | SITE-HTML-INVENTORY-01 | resolved / 已复现 | New documentation HTML is missing from historical demo route coverage, failing the complete local CI check | SITE-ROUTES-01 | | SITE-EDITOR-VAST-01 | resolved / 已复现 | Monaco browser consumer still assumes the workspace VAST namespace after the approved npm-root restoration | SITE-EDITOR-VAST-01 | | CI-JASSUB-SOURCE-01 | resolved / 已复现 | Default native JASSUB source runs select only the published plugin and omit the current source | CI-JASSUB-SOURCE-01 | -| DANMUKU-INSTALLED-GAP-01 | open / 已复现 | Windows WebKit installed Danmuku candidate misses two rows after a native main-thread gap | PKG-DANMUKU-08 | +| DANMUKU-INSTALLED-GAP-01 | resolved / 已复现 | Windows WebKit installed Danmuku candidate misses two rows after a native main-thread gap | PKG-DANMUKU-08, PKG-DANMUKU-START-01 | diff --git a/refactor/risks.json b/refactor/risks.json index 7605a95e3..94b0bc80e 100644 --- a/refactor/risks.json +++ b/refactor/risks.json @@ -6853,18 +6853,26 @@ "id": "DANMUKU-INSTALLED-GAP-01", "title": "Windows WebKit installed Danmuku candidate misses two rows after a native main-thread gap", "confirmation": "reproduced", - "status": "open", + "status": "resolved", "owners": [ - "PKG-DANMUKU-08" + "PKG-DANMUKU-08", + "PKG-DANMUKU-START-01" ], "evidence": [ "test/browser/danmuku-timing-diagnostic.spec.js", "refactor/changes/2026-09-15-CI-01-installed-webkit.md", - "refactor/baselines/ci-installed-webkit-validation.json" + "refactor/baselines/ci-installed-webkit-validation.json", + "refactor/changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md", + "refactor/baselines/danmuku-start-validation.json" ], "compatibleResolution": "Determine why the current installed candidate misses the first eligibility interval; preserve old API and timestamp semantics and add a deterministic source/installed regression. Do not treat the candidate failure as expected or lower assertions.", "closureCriteria": "Explain captured800ms CPU gap, first empty readys sample and unprocessed first/middle rows; validate fix across source, installed formats and affected browsers while preserving existing sampling, seek, worker, lifecycle and load regressions.", - "workspaceState": "At bb2c12df3 with run-cRduve, first/middle remain wait and never enter beforeVisible; sentinel alone is visible. Chromium and Firefox complete runs pass this case. Root cause unproven and original13-failure WebKit report retained." + "workspaceState": "Final source and installed timing 24/24 each, 278 source tests and installed main/legacy 61/61 each pass. Final candidate-core model load 120/120 rows on all three engines; earlier pre-zero-guard nine-core/engine combinations are labeled intermediate evidence. Original full installed CI failures remain recorded; no physical-device or full-matrix completion claimed.", + "resolutionEvidence": [ + "refactor/changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md", + "refactor/baselines/danmuku-start-validation.json" + ], + "resolutionRationale": "The first sampling anchor was created only inside RAF. Reproduced in controlled first-frame and time-zero tests plus real Chromium/WebKit start-listener CPU stalls. Private playback-start anchoring preserves public queries and invalidation. Final source/installed three-engine timing, both installed runtime formats, scheduler regression and actual model load pass." } ] } diff --git a/refactor/tasks.json b/refactor/tasks.json index e8636f08e..37b63f137 100644 --- a/refactor/tasks.json +++ b/refactor/tasks.json @@ -3642,7 +3642,8 @@ ], "dependsOn": [ "PKG-DANMUKU-07", - "CORE-22" + "CORE-22", + "PKG-DANMUKU-START-01" ], "status": "doing", "risk": "H", @@ -3657,7 +3658,9 @@ "changes/2026-09-14-PKG-DANMUKU-08-combined-load.md", "baselines/danmuku-combined-load-validation.json", "changes/2026-09-15-CI-01-installed-webkit.md", - "baselines/ci-installed-webkit-validation.json" + "baselines/ci-installed-webkit-validation.json", + "changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md", + "baselines/danmuku-start-validation.json" ] }, { @@ -3670,7 +3673,8 @@ "dependsOn": [ "PKG-DANMUKU-08", "ENG-07", - "PKG-DANMUKU-MASK-LOAD-01" + "PKG-DANMUKU-MASK-LOAD-01", + "PKG-DANMUKU-START-01" ], "status": "todo", "risk": "H", @@ -6104,6 +6108,26 @@ "release-reviews.md", "ai-workflow.md" ] + }, + { + "id": "PKG-DANMUKU-START-01", + "phase": "5 包迁移:artplayer-plugin-danmuku", + "title": "修复首帧延迟前丢失的弹幕采样区间", + "scope": [ + "artplayer-plugin-danmuku" + ], + "dependsOn": [ + "PKG-DANMUKU-MASK-LOAD-01" + ], + "status": "done", + "risk": "H", + "deliverable": "播放起始采样修复、受控红绿及源码/安装产物真实浏览器证据", + "acceptance": "解释并修复安装 WebKit 首次 readys 在 CPU 间隔后才运行的漏显;保持公开查询、串行回调和 seek/暂停/隐藏取消边界", + "evidence": [ + "baselines/ci-installed-webkit-validation.json", + "changes/2026-09-16-PKG-DANMUKU-START-01-first-sample.md", + "baselines/danmuku-start-validation.json" + ] } ] } diff --git a/test/browser/danmuku-timing-diagnostic.spec.js b/test/browser/danmuku-timing-diagnostic.spec.js index e9d0bcb57..ebf63d580 100644 --- a/test/browser/danmuku-timing-diagnostic.spec.js +++ b/test/browser/danmuku-timing-diagnostic.spec.js @@ -19,7 +19,7 @@ test.beforeAll(async () => { }) for (const implementation of ['published', 'candidate']) { - for (const scenario of ['main-thread-gap', 'async-visibility-gap']) { + for (const scenario of ['main-thread-gap', 'initial-frame-gap', 'initial-zero-frame-gap', 'async-visibility-gap']) { test(`${implementation}: native ${scenario} records actual frame and eligibility gaps`, async ({ page }, testInfo) => { await page.goto('/test/player.html?core=candidate') const code = implementations.get(implementation) @@ -29,6 +29,14 @@ for (const implementation of ['published', 'candidate']) { await page.click('#play') await expect.poll(() => page.evaluate(() => window.art.currentTime)).toBeGreaterThan(0.1) await page.click('#pause') + if (scenario === 'initial-zero-frame-gap') { + await page.evaluate(async () => { + const art = window.art + const seeked = new Promise(resolve => art.video.addEventListener('seeked', resolve, { once: true })) + art.currentTime = 0 + await seeked + }) + } await page.evaluate(async (scenario) => { const art = window.art const evidence = window.timingEvidence = { frames: [], eligibility: [], visible: [], callbacks: [], block: null } @@ -68,6 +76,15 @@ for (const implementation of ['published', 'candidate']) { return ready } }) await plugin.load(rows) + if (scenario.startsWith('initial-')) { + art.once('artplayerPluginDanmuku:start', () => { + const start = performance.now() + const before = art.currentTime + // Hold the real start listener after scheduling but before the first native RAF. + while (performance.now() - start < 1000) { /* Controlled CPU load. */ } + evidence.block = { start, end: performance.now(), before, after: art.currentTime } + }) + } let blocked = false function observe(wall) { if (art.playing) { @@ -101,8 +118,8 @@ for (const implementation of ['published', 'candidate']) { expect(observation.frames.length).toBeGreaterThan(2) expect(observation.eligibility.length).toBeGreaterThan(2) expect(observation.visible.some(row => row.id === 'sentinel')).toBe(true) - if (scenario === 'main-thread-gap') - expect(observation.block.end - observation.block.start).toBeGreaterThanOrEqual(800) + if (scenario !== 'async-visibility-gap') + expect(observation.block.end - observation.block.start).toBeGreaterThanOrEqual(scenario.startsWith('initial-') ? 1000 : 800) else expect(observation.callbacks.find(row => row.id === 'first').end - observation.callbacks.find(row => row.id === 'first').start).toBeGreaterThanOrEqual(550) if (scenario === 'async-visibility-gap') { @@ -117,6 +134,8 @@ for (const implementation of ['published', 'candidate']) { expect(observation.missing).toEqual([]) expect(observation.visible.map(row => row.id)).toEqual(['first', 'middle', 'sentinel']) } + if (scenario.startsWith('initial-')) + expect(observation.eligibility[0].wall).toBeGreaterThanOrEqual(observation.block.end) await page.evaluate(() => window.art.destroy()) }) } diff --git a/test/danmuku-scheduler.test.js b/test/danmuku-scheduler.test.js index febf57fed..22cf3d099 100644 --- a/test/danmuku-scheduler.test.js +++ b/test/danmuku-scheduler.test.js @@ -103,6 +103,40 @@ test(`${prefix}: non-overlap-disabled placement does not queue a Worker round tr assert.deepEqual([...owner.queue].map(row => row.$ref.offsetTop), [owner.marginTop, owner.marginTop + 20]) }) +test(`${prefix}: playback anchors eligibility before a delayed first animation frame`, async (t) => { + const { env, plugin, owner } = await fixture({ antiOverlap: false }) + t.after(() => env.destroy()) + await plugin.load([{ text: 'first', time: 10.2, mode: 1 }, { text: 'middle', time: 10.5, mode: 1 }]) + env.art.playing = true + env.art.emit('video:play') + assert.equal(output(env, 'visible').length, 0, 'Starting must not dispatch outside RAF') + env.tick(800) + env.art.currentTime = 10.8 + // A repeated playing event must not move an existing start anchor forward. + env.art.emit('video:playing') + assert.equal(owner.readys.length, 0, 'The public getter stays a point-in-time query') + await env.frame() + await env.flush() + assert.deepEqual(output(env, 'visible').map(event => event.args[0].text), ['first', 'middle']) +}) + +test(`${prefix}: native playback at zero anchors before the legacy playing getter becomes true`, async (t) => { + const { env, plugin, owner } = await fixture({ antiOverlap: false }) + t.after(() => env.destroy()) + env.art.currentTime = 0 + env.art.video = { paused: false, ended: false, readyState: 4, seeking: false } + await plugin.load([{ text: 'first', time: 0.2, mode: 1 }, { text: 'middle', time: 0.5, mode: 1 }]) + env.art.emit('video:play') + assert.equal(output(env, 'visible').length, 0) + env.tick(800) + env.art.currentTime = 0.8 + env.art.playing = true + assert.equal(owner.readys.length, 0) + await env.frame() + await env.flush() + assert.deepEqual(output(env, 'visible').map(event => event.args[0].text), ['first', 'middle']) +}) + for (const boundary of ['continuous', 'seek', 'stop', 'hide', 'visibility']) { test(`${prefix}: CPU gap recovery respects ${boundary} boundaries and keeps public readys unchanged`, async (t) => { const { env, plugin, owner } = await fixture({}, { automatic: true })