(function(){function l(b){b.style.display="";b.focus()}function n(b){return getComputedStyle(b).colorScheme==="dark"?!0:(b=document.querySelector('meta[name="color-scheme"]'))&&(b.content==="dark"||b.content.includes("dark")&&matchMedia("(prefers-color-scheme: dark)").matches)}
function p(b,h){function k(){document.getElementById("_dydlg_frame_").contentWindow.postMessage({cmd:"init",task:b,dlg_opts:h},"*")}var a=document.getElementById("_dydlg_frame_");if(a)l(document.getElementById("_dydlg_wrap_")),k();else{var c=document.getElementById("_dydlg_wrap_");c||(c=document.createElement("div"),c.id="_dydlg_wrap_",c.style.cssText="display:none;position:fixed;margin:0;bottom:0;left:0;right:0;top:0;opacity:1;-webkit-transition: opacity 0.2s;transition: opacity 0.2s;overflow: hidden;z-index: 9999;cursor: default;",
document.body.appendChild(c));a=n(c);var f=`${chrome.runtime.getURL("/com/taskdlg.html")}?page_title=${encodeURIComponent(document.title)}&fs=${h.fontSize}${a?"&theme=dark":""}`;a=document.createElement("iframe");a.id="_dydlg_frame_";a.style.cssText="overflow:hidden;height:100%;width:100%;position:absolute;top:0;left:0;right:0;bottom:0;";a.scrolling="no";a.frameBorder="0";a.width="100%";a.height="100%";a.onload=k;a.src=f;c.appendChild(a);l(c);console.log("dlg injected")}}
window.addEventListener("message",function(b){b.data.cmd=="close_dlg"&&(document.getElementById("_dydlg_wrap_").style.display="none",window.focus(),document.activeElement&&document.activeElement.blur())},!1);
(function(){if(!(Date.now()>1740009692193)){var b=150,h=150;document.body.addEventListener("mousedown",function(a){if(a.which==1||a.which==3)h=a.clientY,b=a.clientX},!0);var k=[];chrome.runtime.onMessage.addListener(function(a,c,f){function m(d){d.target.classList.contains("danim_icon")&&d.propertyName=="opacity"&&d.target.parentNode.removeChild(d.target)}function q(d){var r=b-24,t=h-24;d=chrome.runtime.getURL(d?"/icons/newd_pause.png":"/icons/newd.png");var e=document.createElement("div");e.className=
"danim_icon";e.style.cssText="position:fixed;opacity:1;width:48px;height:48px;z-index:9999;left:"+r+"px;top:"+t+'px;background-image:url("'+d+'");background-size:contain;transition: opacity 500ms ease-out,transform 700ms ease-out';document.body.appendChild(e);e.addEventListener("transitionend",m);e.addEventListener("webkitTransitionEnd",m);window.getComputedStyle(e).opacity;window.getComputedStyle(e).transform;e.style.opacity="0";e.style.transform="scale(1.5)"}switch(a.cmd){case "g_links":c=[];f=
{};for(var g of k){const d=g.url;f[d]==void 0&&(c.push(g),f[d]=!0)}c.length>0&&chrome.runtime.sendMessage({cmd:"add_links",data:c});break;case "stream_url":a.url&&(g={url:a.url,size:a.size},g.desc=a.desc||document.title,a.fext&&(g.fext=a.fext),k.push(g),a.need_send&&chrome.runtime.sendMessage({cmd:"add_links",data:[g]}));break;case "d_one":chrome.runtime.sendMessage({cmd:"dlg_options"},function(d){p(a.task,d||{})});f("y");break;case "g_title":f(document.title);break;case "d_anim":q(a.addpause)}})}})();}).call(this);
