(function(M){function Sa(q){var z=document.documentElement;z.exitFullscreen?z.exitFullscreen():z.mozCancelFullScreen?z.mozCancelFullScreen():z.webkitCancelFullScreen?z.webkitCancelFullScreen():document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.oRequestFullscreen?document.oCancelFullScreen():document.webkitExitFullscreen?
document.webkitExitFullscreen():(z=document.body,document.documentElement.style.cssText="",z.style.cssText="",q.style.cssText="",document.IsFullScreen=!1)}function Ia(){return document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||!1}function gb(q,z,t){var u=new Date;u.setTime(u.getTime()+t*24*60*60*1E3);t="expires="+u.toGMTString();document.cookie=q+"="+z+"; "+t}function Ca(q,z,t){if(q){var u=parseInt(q.style.opacity)||1;u*=100;
z=parseInt(z/50);z===0&&(z=1);var E=u/z;E<5&&(E=5);var I=setInterval(function(){u>0?(u-=E,u<0&&(u=0),q.style.opacity=u/100):(clearInterval(I),typeof t=="function"&&t(q))},50);return I}return null}function Ta(q,z,t){if(q){var u=q.style.opacity;u*=100;z=parseInt(z/50);z===0&&(z=1);var E=(100-u)/z;E<5&&(E=5);var I=null;return I=setInterval(function(){u<100?(u+=E,u>100&&(u=100),q.style.opacity=u/100):(clearInterval(I),typeof t=="function"&&t(q))},50)}return null}function Ua(q,z){if(!q)return!1;if(q==
z)return!0;var t=q.indexOf(z);if(t<0)return!1;if(t>0){if(q.charAt(t-1)==" "&&(q.length-t==z.length||q.charAt(t+z.length)==" "))return!0}else if(q.charAt(z.length)==" ")return!0;return!1}function Va(q,z,t){var u=new XMLHttpRequest;u.onreadystatechange=function(){u.readyState===4&&(u.status>=200&&u.status<300||u.status===304?z(u.response):typeof t==="function"&&t(u))};u.open("GET",q,!0);u.send(null)}function hb(q){const z=function(I,w,J){for(var L=J.length,Q=0;Q<L;Q++)I.setUint8(w+Q,J.charCodeAt(Q))};
var t=function(){var I=new ArrayBuffer(364);let w=new DataView(I);z(w,0,"RIFF");w.setUint32(4,204,!0);z(w,8,"WAVE");z(w,12,"fmt ");w.setUint32(16,16,!0);w.setUint16(20,1,!0);w.setUint16(22,1,!0);w.setUint32(24,16E3,!0);w.setUint32(28,32E3,!0);w.setUint16(32,4,!0);w.setUint16(34,16,!0);z(w,36,"data");w.setUint32(40,320,!0);let J=44;for(let L=0;L<160;L++)w.setInt16(J,15,!0),J+=2;I=new Uint8Array(I);return"data:audio/x-wav;base64,"+btoa(String.fromCharCode.apply(null,I))}(),u=new Audio(t),E=M.setTimeout(function(){E=
0;typeof q==="function"&&q(!1)},500);u.play().then(function(){E&&M.clearTimeout(E);u.pause();q(!0)}).catch(function(I){E&&M.clearTimeout(E);typeof q==="function"&&q(!1)})}async function ib(q){navigator.clipboard&&navigator.clipboard.write([new ClipboardItem({[q.type]:q})]).then(()=>{}).catch(z=>{})}function jb(){var q=new Date,z=q.getMonth()+1;z<10&&(z="0"+z);var t=q.getDate();t<10&&(t="0"+t);var u=q.getHours();u<10&&(u="0"+u);var E=q.getMinutes();E<10&&(E="0"+E);var I=q.getSeconds();I<10&&(I="0"+
I);var w=q.getMilliseconds();w<10?w="00"+w:w<100&&(w="0"+w);return""+q.getFullYear()+z+t+u+E+I+w}function Wa(q){var z={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},t=function(w){w=w.split(":");if(w.length!==3)return 0;var J=parseInt(w[0],10)*3600,L=parseInt(w[1],10)*60,Q=parseInt(w[2],10),R=w[2].indexOf(","),Y=0;R>0&&(Y=parseInt(w[2].substr(R+1))/1E3);return J+L+Q+Y};q=q.replace(/\r/g,"");q=q.split("\n");for(var u=0;u<q.length-2;){var E={},
I=q[u].trim();if(I){E.id=parseInt(I);I=q[u+1].split(" --\x3e ");if(I.length!==2)break;E.from=t(I[0].trim());E.to=t(I[1].trim());E.location=2;E.content=q[u+2].trim();z.body.push(E);u+=3}else u++}return z}function Ka(q){var z={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},t=function(w){w=w.split(":");var J=0,L=0;if(w.length===3){J=parseInt(w[0],10)*3600;L=parseInt(w[1],10)*60;var Q=parseInt(w[2],10)}else if(w.length===2)L=parseInt(w[0],10)*60,
Q=parseInt(w[1],10);else if(w.length===1)Q=parseInt(w[0],10);else return 0;var R=w.length-1,Y=w[R].indexOf("."),da=0;Y>0&&(da=parseInt(w[R].substr(Y+1))/1E3);return J+L+Q+da};q=q.replace(/\r/g,"");q=q.split("\n");if(q.length<2||q[0].substr(0,6)!=="WEBVTT"||q[1].trim().length!==0)return null;for(var u=2;u<=q.length-2;){var E={};if(!q[u].startsWith("NOTE")&&q[u].trim()!==""){var I=q[u].split(" --\x3e ");if(I.length!==2&&(I=q[u].trim(),E.id=parseInt(I),u++,I=q[u].split(" --\x3e "),I.length!==2)){u++;
continue}E.from=t(I[0].trim());E.to=t(I[1].trim());E.location=2;u++;E.content=q[u].trim();for(u++;u<q.length;){I=q[u].trim();if(!I)break;E.content+="<br/>"+I;u++}z.body.push(E)}u++}return z}function Xa(q){return!(!q.width()&&!q.height())&&q.css("display")!=="none"}function kb(q,z){var t="smilesFaces-view",u=Ga.path+"widgets/smiles/p",E=$$(q);if(!E.hasClass("disabled")){t=E.attr("data-viewid");if(!E.attr("data-viewinit")&&$$("#"+t).length<=0){var I=E.closest(".zwp-barrage_form");q='<div id="'+t+'" style="position:absolute;display:none;z-index:1138;" class="zwp-smileview"><table border="0" cellspacing="0" cellpadding="0"><tr>';
for(var w=1;w<=40;w++){var J="[sm-"+w+"]";q+='<td><img src="'+u+w+'.png" onclick="insertSmile(this,\''+J+"');\" /></td>";w%8==0&&(q+="</tr><tr>")}I.append(q+"</tr></table></div>");E.attr("data-viewinit","1");$$(document).click(function(){$$("#"+t).hide()});$$(M).on("resize",function(){var R=$$("#"+t);Xa(R)&&(E.offset(),R.outerHeight(!1),E.outerWidth(!1),R.outerWidth(!1))})}var L=$$("#"+t);if(Xa(L))L.hide();else{E.offset();L[0].style.opacity=0;L[0].style.display="block";L.outerHeight(!1);E.outerWidth(!1);
L.outerWidth(!1);u=E.parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");L.get(0).inputbox=u.get(0);L.css({bottom:"36px",right:"26px"}).show();var Q=function(){var R=parseFloat(L[0].style.opacity);R<=1&&(R+=.1,R>1&&(R=1),L[0].style.opacity=R,setTimeout(Q,50))};setTimeout(Q,50)}if(z=z||M.event)z.preventDefault?(z.preventDefault(),z.stopPropagation()):(M.event.cancelBubble=!0,M.event.returnValue=!1)}}function lb(q){var z=$$;q.find("a.barrage-tab-link").each(function(t){var u=z(this);
t===0?u.html(O("danmuSendSettings","Send Settings")+'<i class="bottom-line"></i>'):t===1?u.html(O("danmuViewSettings","View Settings")+'<i class="bottom-line"></i>'):t===2&&u.html(O("danmuBlockSettings","Block Settings")+'<i class="bottom-line"></i>')});q.find(".set-label").each(function(){var t=z(this),u=t.text();u==="\u6587\u5b57\u989c\u8272"?t.text(O("danmuTextColor","Text Color")):u==="\u6587\u5b57\u8fb9\u6846"?t.text(O("danmuTextBorder","Border")):u==="\u4e0d\u900f\u660e\u5ea6"?t.text(O("danmuOpacity",
"Opacity")):u==="\u6587\u5b57\u5927\u5c0f"?t.text(O("danmuFontSize","Font Size")):u==="\u6eda\u52a8\u901f\u5ea6"?t.text(O("danmuScrollSpeed","Scroll Speed")):u==="\u6392\u5217\u5bc6\u5ea6"&&t.text(O("danmuDensity","Density"))});q.find(".set-rol-left").each(function(){var t=z(this),u=t.text();u==="\u4e0d\u900f\u660e\u5ea6"?t.text(O("danmuOpacity","Opacity")):u==="\u6587\u5b57\u5927\u5c0f"?t.text(O("danmuFontSize","Font Size")):u==="\u6eda\u52a8\u901f\u5ea6"?t.text(O("danmuScrollSpeed","Scroll Speed")):
u==="\u6392\u5217\u5bc6\u5ea6"&&t.text(O("danmuDensity","Density"))});q.find(".pb-title").each(function(){var t=z(this),u=t.text();u==="\u5e95\u90e8\u533a\u57df"?t.text(O("danmuBottomArea","Bottom Area")):u==="\u5f69\u8272\u6587\u5b57"?t.text(O("colorfulText","Color")):u==="\u56fe\u7247\u8868\u60c5"&&t.text(O("imageEmoji","Emoji"))});q.find("a.barrage-set-rest").each(function(){var t=z(this);t.text()==="\u91cd\u7f6e"&&t.text(O("reset","Reset"))})}function mb(q,z){if(q.dragableWinInited)typeof q.zwpDragable===
"object"&&("oldX"in q.zwpDragable&&(q.style.left=q.zwpDragable.oldX+"px"),"oldY"in q.zwpDragable&&(q.style.top=q.zwpDragable.oldY+"px"),"oldWidth"in q.zwpDragable&&(q.style.width=q.zwpDragable.oldWidth+"px"),"oldHeight"in q.zwpDragable&&(q.style.height=q.zwpDragable.oldHeight+"px"));else{var t='<div class="zwp-captionbar"><button class="closeBtn" title="'+(O("closeSmallWindow","Close small window")+'"><i class="xicon xicon-close"></i></button></div><div class="zwp-gripper-right"></div><div class="zwp-gripper-bottom"></div><div class="zwp-gripper-bottom-right"></div>');
q.insertAdjacentHTML("beforeend",t);var u=function(Q){Q.stopPropagation();Q.preventDefault();var R=parseInt(q.offsetLeft),Y=parseInt(q.offsetTop),da=Q.pageX,Z=Q.pageY,ea=M.innerWidth-q.offsetWidth-20,na=M.innerHeight-q.offsetHeight-20,ca=function(ja){var ra=R+ja.pageX-da;ja=Y+ja.pageY-Z;ra<0&&(ra=0);ja<0&&(ja=0);ra>ea&&(ra=ea);ja>na&&(ja=na);q.style.left=ra+"px";q.style.top=ja+"px";typeof q.zwpDragable==="object"&&(q.zwpDragable.oldX=ra,q.zwpDragable.oldY=ja)},ba=function(ja){document.removeEventListener("mousemove",
ca);document.removeEventListener("mouseup",ba)};document.addEventListener("mousemove",ca);document.addEventListener("mouseup",ba)};t=function(Q){Q.stopPropagation();Q.preventDefault();var R=q.offsetWidth,Y=Q.pageX,da=function(ea){ea=R+ea.pageX-Y;ea<200&&(ea=200);q.style.width=ea+"px";typeof q.zwpDragable==="object"&&(q.zwpDragable.oldWidth=ea)},Z=function(ea){document.removeEventListener("mousemove",da);document.removeEventListener("mouseup",Z)};document.addEventListener("mousemove",da);document.addEventListener("mouseup",
Z)};var E=function(Q){Q.stopPropagation();Q.preventDefault();var R=q.offsetHeight,Y=Q.pageY,da=function(ea){ea=R+ea.pageY-Y;ea<180&&(ea=180);q.style.height=ea+"px";typeof q.zwpDragable==="object"&&(q.zwpDragable.oldHeight=ea)},Z=function(ea){document.removeEventListener("mousemove",da);document.removeEventListener("mouseup",Z)};document.addEventListener("mousemove",da);document.addEventListener("mouseup",Z)},I=function(Q){Q.stopPropagation();Q.preventDefault();var R=q.offsetWidth,Y=q.offsetHeight,
da=Q.pageX,Z=Q.pageY,ea=function(ca){var ba=R+ca.pageX-da;ba<200&&(ba=200);ca=Y+ca.pageY-Z;ca<180&&(ca=180);q.style.width=ba+"px";q.style.height=ca+"px";typeof q.zwpDragable==="object"&&(q.zwpDragable.oldWidth=ba,q.zwpDragable.oldHeight=ca)},na=function(ca){document.removeEventListener("mousemove",ea);document.removeEventListener("mouseup",na)};document.addEventListener("mousemove",ea);document.addEventListener("mouseup",na)};q.zwpDragable={};var w=q.querySelector(".zwp-captionbar");if(w){var J=w.querySelector(".closeBtn");
if(J){var L=z||function(){};J.addEventListener("click",function(Q){Q.preventDefault();Q.stopPropagation();L(q)})}w.addEventListener("mousedown",u);q.zwpDragable.doc_mousedown=u}z=q.querySelector(".zwp-gripper-right");u=q.querySelector(".zwp-gripper-bottom");w=q.querySelector(".zwp-gripper-bottom-right");z&&(z.addEventListener("mousedown",t),q.zwpDragable.gripperR_mousedown=t);u&&(u.addEventListener("mousedown",E),q.zwpDragable.gripperB_mousedown=E);w&&(w.addEventListener("mousedown",I),q.zwpDragable.gripperBR_mousedown=
I);q.dragableWinInited=!0}}(function(q){var z=!1,t=!1,u=0,E=2E3,I=0,w=document,J=q(M),L=[],Q=M.requestAnimationFrame||M.webkitRequestAnimationFrame||M.mozRequestAnimationFrame||!1,R=M.cancelAnimationFrame||M.webkitCancelAnimationFrame||M.mozCancelAnimationFrame||!1;if(Q)M.cancelAnimationFrame||(R=function(V){});else{var Y=0;Q=function(V,F){var e=(new Date).getTime(),l=Math.max(0,16-(e-Y));F=M.setTimeout(function(){V(e+l)},l);Y=e+l;return F};R=function(V){M.clearTimeout(V)}}var da=M.MutationObserver||
M.WebKitMutationObserver||!1,Z=Date.now||function(){return(new Date).getTime()},ea={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,
railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,rightdock:0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",
scriptpath:function(){var V;(V=w.currentScript)||(V=w.getElementsByTagName("script"),V=V.length?V[V.length-1]:!1);V=V?V.src.split("?")[0]:"";return V.split("/").length>0?V.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1,scrollCLass:!1},na=!1,ca=function(){if(na)return na;var V=w.createElement("DIV"),F=V.style,e=navigator.userAgent,l=navigator.platform,n={};n.haspointerlock="pointerLockElement"in w||"webkitPointerLockElement"in
w||"mozPointerLockElement"in w;n.isopera="opera"in M;n.isopera12=n.isopera&&"getUserMedia"in navigator;n.isoperamini=Object.prototype.toString.call(M.operamini)==="[object OperaMini]";n.isie="all"in w&&"attachEvent"in V&&!n.isopera;n.isieold=n.isie&&!("msInterpolationMode"in F);n.isie7=n.isie&&!n.isieold&&(!("documentMode"in w)||w.documentMode===7);n.isie8=n.isie&&"documentMode"in w&&w.documentMode===8;n.isie9=n.isie&&"performance"in M&&w.documentMode===9;n.isie10=n.isie&&"performance"in M&&w.documentMode===
10;n.isie11="msRequestFullscreen"in V&&w.documentMode>=11;n.ismsedge="msCredentials"in M;n.ismozilla="MozAppearance"in F;n.iswebkit=!n.ismsedge&&"WebkitAppearance"in F;n.ischrome=n.iswebkit&&"chrome"in M;n.ischrome38=n.ischrome&&"touchAction"in F;n.ischrome22=!n.ischrome38&&n.ischrome&&n.haspointerlock;n.ischrome26=!n.ischrome38&&n.ischrome&&"transition"in F;n.cantouch="ontouchstart"in w.documentElement||"ontouchstart"in M;n.hasw3ctouch=(M.PointerEvent||!1)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>
0);n.hasmstouch=!n.hasw3ctouch&&(M.MSPointerEvent||!1);n.ismac=/^mac$/i.test(l);n.isios=n.cantouch&&/iphone|ipad|ipod/i.test(l);n.isios4=n.isios&&!("seal"in Object);n.isios7=n.isios&&"webkitHidden"in w;n.isios8=n.isios&&"hidden"in w;n.isios10=n.isios&&M.Proxy;n.isandroid=/android/i.test(e);n.haseventlistener="addEventListener"in V;n.trstyle=!1;n.hastransform=!1;n.hastranslate3d=!1;n.transitionstyle=!1;n.hastransition=!1;n.transitionend=!1;n.trstyle="transform";n.hastransform="transform"in F||function(){for(var p=
["msTransform","webkitTransform","MozTransform","OTransform"],y=0,N=p.length;y<N;y++)if(F[p[y]]!==void 0){n.trstyle=p[y];break}n.hastransform=!!n.trstyle}();n.hastransform&&(F[n.trstyle]="translate3d(1px,2px,3px)",n.hastranslate3d=/translate3d/.test(F[n.trstyle]));n.transitionstyle="transition";n.prefixstyle="";n.transitionend="transitionend";n.hastransition="transition"in F||function(){n.transitionend=!1;for(var p="webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),
y="-webkit- -ms- -moz- -o- -o -khtml-".split(" "),N="webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),b=0,G=p.length;b<G;b++)if(p[b]in F){n.transitionstyle=p[b];n.prefixstyle=y[b];n.transitionend=N[b];break}n.ischrome26&&(n.prefixstyle=y[1]);n.hastransition=n.transitionstyle}();n.cursorgrabvalue=function(){var p=["grab","-webkit-grab","-moz-grab"];if(n.ischrome&&!n.ischrome38||n.isie)p=[];for(var y=0,N=p.length;y<N;y++){var b=p[y];F.cursor=
b;if(F.cursor==b)return b}return"url("+(ea.scriptpath+"css/openhand.cur),n-resize")}();n.hasmousecapture="setCapture"in V;n.hasMutationObserver=da!==!1;V=null;return na=n},ba=function(V,F){function e(){var m=b.doc.css(D.trstyle);return m&&m.substr(0,6)=="matrix"?m.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function l(){var m=b.win;if("zIndex"in m)return m.zIndex();for(;m.length>0&&m[0].nodeType!=9;){var v=m.css("zIndex");if(!isNaN(v)&&v!==0)return parseInt(v);m=m.parent()}return!1}
function n(m,v,x){v=m.css(v);m=parseFloat(v);return isNaN(m)?(m=qa[v]||0,x=m==3?x?b.win.outerHeight()-b.win.innerHeight():b.win.outerWidth()-b.win.innerWidth():1,b.isie8&&m&&(m+=1),x?m:0):m}function p(m,v,x,c){b._bind(m,v,function(d){d=d||M.event;var f={original:d,target:d.target||d.srcElement,type:"wheel",deltaMode:d.type=="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){d.preventDefault?d.preventDefault():d.returnValue=!1;return!1},stopImmediatePropagation:function(){d.stopImmediatePropagation?
d.stopImmediatePropagation():d.cancelBubble=!0}};v=="mousewheel"?(d.wheelDeltaX&&(f.deltaX=-.025*d.wheelDeltaX),d.wheelDeltaY&&(f.deltaY=-.025*d.wheelDeltaY),f.deltaY||f.deltaX||(f.deltaY=-.025*d.wheelDelta)):f.deltaY=d.detail;return x.call(m,f)},c)}function y(m,v,x,c){b.scrollrunning||(b.newscrolly=b.getScrollTop(),b.newscrollx=b.getScrollLeft(),oa=Z());var d=Z()-oa;oa=Z();sa=d>350?1:sa+(2-sa)/10;m=m*sa|0;v=v*sa|0;if(m){if(c)if(m<0){if(b.getScrollLeft()>=b.page.maxw)return!0}else if(b.getScrollLeft()<=
0)return!0;c=m>0?1:-1;Aa!==c&&(b.scrollmom&&b.scrollmom.stop(),b.newscrollx=b.getScrollLeft(),Aa=c);b.lastdeltax-=m}if(v){if(function(){var f=b.getScrollTop();if(v<0){if(f>=b.page.maxh)return!0}else if(f<=0)return!0}()){if(A.nativeparentscrolling&&x&&!b.ispage&&!b.zoomactive)return!0;x=b.view.h>>1;b.newscrolly<-x?(b.newscrolly=-x,v=-1):b.newscrolly>b.page.maxh+x?(b.newscrolly=b.page.maxh+x,v=1):v=0}x=v>0?1:-1;ia!==x&&(b.scrollmom&&b.scrollmom.stop(),b.newscrolly=b.getScrollTop(),ia=x);b.lastdeltay-=
v}(v||m)&&b.synched("relativexy",function(){var f=b.lastdeltay+b.newscrolly;b.lastdeltay=0;var h=b.lastdeltax+b.newscrollx;b.lastdeltax=0;b.rail.drag||b.doScrollPos(h,f)})}function N(m,v,x){if(!x&&ta)return!0;if(m.deltaMode===0){var c=-(A.mousescrollstep/54*m.deltaX)|0;var d=-(A.mousescrollstep/54*m.deltaY)|0}else m.deltaMode===1&&(c=-(m.deltaX*A.mousescrollstep*50/80)|0,d=-(m.deltaY*A.mousescrollstep*50/80)|0);v&&A.oneaxismousemode&&c===0&&d&&(c=d,d=0,x&&(c<0?b.getScrollLeft()>=b.page.maxw:b.getScrollLeft()<=
0)&&(d=c,c=0));b.isrtlmode&&(c=-c);if(y(c,d,x,!0))x&&(ta=!0);else return ta=!1,m.stopImmediatePropagation(),m.preventDefault()}var b=this;this.version="3.7.6";this.name="nicescroll";this.me=F;var G=q("body"),A=this.opt={doc:G,win:!1};q.extend(A,ea);A.snapbackspeed=80;if(V)for(var U in A)V[U]!==void 0&&(A[U]=V[U]);A.disablemutationobserver&&(da=!1);this.iddoc=(this.doc=A.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(A.win?A.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=
A.win!==!1;this.win=A.win||(this.ispage?J:this.doc);this.docscroll=this.ispage&&!this.haswrapper?J:this.win;this.body=G;this.iframe=this.isfixed=this.viewport=!1;this.isiframe=this.doc[0].nodeName=="IFRAME"&&this.win[0].nodeName=="IFRAME";this.istextarea=this.win[0].nodeName=="TEXTAREA";this.forcescreen=!1;this.canshowonmouseevent=A.autohidemode!="scroll";this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=
this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;A.rtlmode=="auto"?(V=this.win[0]==M?this.body:this.win,F=V.css("writing-mode")||V.css("-webkit-writing-mode")||V.css("-ms-writing-mode")||V.css("-moz-writing-mode"),F=="horizontal-tb"||F=="lr-tb"||F===""?(this.isrtlmode=V.css("direction")=="rtl",this.isvertical=!1):(this.isrtlmode=F=="vertical-rl"||F=="tb"||F=="tb-rl"||F=="rl-tb",this.isvertical=
F=="vertical-rl"||F=="tb"||F=="tb-rl")):(this.isrtlmode=A.rtlmode===!0,this.isvertical=!1);this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;if(A.scrollbarid!==!1)this.id=A.scrollbarid;else{do this.id="ascrail"+E++;while(w.getElementById(this.id))}this.hidden=this.locked=this.railslocked=this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=
A.overflowx;this.overflowy=A.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=ca();var D=q.extend({},this.detected);this.ishwscroll=(this.canhwscroll=D.hastransform&&A.hwacceleration)&&b.haswrapper;this.hasreversehr=this.isrtlmode?this.isvertical?!(D.iswebkit||D.isie||D.isie11):!(D.iswebkit||D.isie&&!D.isie10&&!D.isie11):!1;this.istouchcapable=!1;D.cantouch||!D.hasw3ctouch&&!D.hasmstouch?
!D.cantouch||D.isios||D.isandroid||!D.iswebkit&&!D.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;A.enablemouselockapi||(D.hasmousecapture=!1,D.haspointerlock=!1);this.debounced=function(m,v,x){b&&(b.delaylist[m]||(b.delaylist[m]={h:Q(function(){b.delaylist[m].fn.call(b);b.delaylist[m]=!1},x)},v.call(b)),b.delaylist[m].fn=v)};this.synched=function(m,v){b.synclist[m]?b.synclist[m]=v:(b.synclist[m]=v,Q(function(){b&&(b.synclist[m]&&b.synclist[m].call(b),b.synclist[m]=null)}))};this.unsynched=
function(m){b.synclist[m]&&(b.synclist[m]=!1)};this.css=function(m,v){for(var x in v)b.saved.css.push([m,x,m.css(x)]),m.css(x,v[x])};this.scrollTop=function(m){return m===void 0?b.getScrollTop():b.setScrollTop(m)};this.scrollLeft=function(m){return m===void 0?b.getScrollLeft():b.setScrollLeft(m)};var fa=function(m,v,x,c,d,f,h){this.st=m;this.ed=v;this.spd=x;this.p1=c||0;this.p2=d||1;this.p3=f||0;this.p4=h||1;this.ts=Z();this.df=v-m};fa.prototype={B2:function(m){return 3*(1-m)*(1-m)*m},B3:function(m){return 3*
(1-m)*m*m},B4:function(m){return m*m*m},getPos:function(){return(Z()-this.ts)/this.spd},getNow:function(){var m=(Z()-this.ts)/this.spd,v=this.B2(m)+this.B3(m)+this.B4(m);return m>=1?this.ed:this.st+this.df*v|0},update:function(m,v){this.st=this.getNow();this.ed=m;this.spd=v;this.ts=Z();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};D.hastranslate3d&&D.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(m){if(!m){if(m=
e())return m.length==16?-m[13]:-m[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y};this.getScrollLeft=function(m){if(!m){if(m=e())return m.length==16?-m[12]:-m[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getNow()}return b.doc.translate.x};this.notifyScrollEvent=function(m){var v=w.createEvent("UIEvents");v.initUIEvent("scroll",!1,!1,M,1);v.niceevent=!0;m.dispatchEvent(v)};var ha=this.isrtlmode?1:-1;D.hastranslate3d&&A.enabletranslate3d?
(this.setScrollTop=function(m,v){b.doc.translate.y=m;b.doc.translate.ty=m*-1+"px";b.doc.css(D.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");v||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(m,v){b.doc.translate.x=m;b.doc.translate.tx=m*ha+"px";b.doc.css(D.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");v||b.notifyScrollEvent(b.win[0])}):(this.setScrollTop=function(m,v){b.doc.translate.y=m;b.doc.translate.ty=m*-1+"px";b.doc.css(D.trstyle,
"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");v||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(m,v){b.doc.translate.x=m;b.doc.translate.tx=m*ha+"px";b.doc.css(D.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");v||b.notifyScrollEvent(b.win[0])})}else this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(m){b.docscroll.scrollTop(m)},this.getScrollLeft=function(){return b.hasreversehr?b.detected.ismozilla?b.page.maxw-Math.abs(b.docscroll.scrollLeft()):
b.page.maxw-b.docscroll.scrollLeft():b.docscroll.scrollLeft()},this.setScrollLeft=function(m){return setTimeout(function(){if(b)return b.hasreversehr&&(m=b.detected.ismozilla?-(b.page.maxw-m):b.page.maxw-m),b.docscroll.scrollLeft(m)},1)};this.getTarget=function(m){return m?m.target?m.target:m.srcElement?m.srcElement:!1:!1};this.hasParent=function(m,v){if(!m)return!1;for(m=m.target||m.srcElement||m||!1;m&&m.id!=v;)m=m.parentNode||!1;return m!==!1};var qa={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=
function(){return{top:M.pageYOffset||w.documentElement.scrollTop,left:M.pageXOffset||w.documentElement.scrollLeft}};this.getOffset=function(){if(b.isfixed){var m=b.win.offset(),v=b.getDocumentScrollOffset();m.top-=v.top;m.left-=v.left;return m}m=b.win.offset();if(!b.viewport)return m;v=b.viewport.offset();return{top:m.top-v.top,left:m.left-v.left}};this.updateScrollBar=function(m){var v;if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()-(A.railpadding.top+A.railpadding.bottom)}),b.railh&&b.railh.css({width:b.win.innerWidth()-
(A.railpadding.left+A.railpadding.right)});else{var x=b.getOffset();var c=x.top;var d=x.left-(A.railpadding.left+A.railpadding.right);c+=n(b.win,"border-top-width",!0);d+=b.rail.align?b.win.outerWidth()-n(b.win,"border-right-width")-b.rail.width:n(b.win,"border-left-width");if(v=A.railoffset)v.top&&(c+=v.top),v.left&&(d+=v.left);m=(m?m.h:b.win.innerHeight())-(A.railpadding.top+A.railpadding.bottom);v="left";var f=d;typeof A.rightdock==="number"&&(v="right",f=A.rightdock);b.railslocked||b.rail.css({top:c,
[v]:f,height:m});b.zoom&&b.zoom.css({top:c+1,left:b.rail.align==1?d-20:d+b.rail.width+4});if(b.railh&&!b.railslocked){c=x.top;d=x.left;if(v=A.railhoffset)v.top&&(c+=v.top),v.left&&(d+=v.left);c=b.railh.align?c+n(b.win,"border-top-width",!0)+b.win.innerHeight()-b.railh.height:c+n(b.win,"border-top-width",!0);d+=n(b.win,"border-left-width");b.railh.css({top:c-(A.railpadding.top+A.railpadding.bottom),left:d,width:b.railh.width})}}};this.doRailClick=function(m,v,x){if(!b.railslocked)if(b.cancelEvent(m),
"pageY"in m||(m.pageX=m.clientX+w.documentElement.scrollLeft,m.pageY=m.clientY+w.documentElement.scrollTop),v){v=x?b.doScrollLeft:b.doScrollTop;var c=x?(m.pageX-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(m.pageY-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y;b.unsynched("relativexy");v(c|0)}else v=x?b.doScrollLeftBy:b.doScrollBy,c=x?b.scroll.x:b.scroll.y,m=x?m.pageX-b.railh.offset().left:m.pageY-b.rail.offset().top,x=x?b.view.w:b.view.h,v(c>=m?x:-x)};b.newscrolly=b.newscrollx=
0;b.hasanimationframe="requestAnimationFrame"in M;b.hascancelanimationframe="cancelAnimationFrame"in M;b.hasborderbox=!1;this.init=function(){b.saved.css=[];if(D.isoperamini||D.isandroid&&!("hidden"in w))return!0;A.emulatetouch=A.emulatetouch||A.touchbehavior;b.hasborderbox=M.getComputedStyle&&M.getComputedStyle(w.body)["box-sizing"]==="border-box";var m={"overflow-y":"hidden"};if(D.isie11||D.isie10)m["-ms-overflow-style"]="none";b.ishwscroll&&(this.doc.css(D.transitionstyle,D.prefixstyle+"transform 0ms ease-out"),
D.transitionend&&b.bind(b.doc,D.transitionend,b.onScrollTransitionEnd,!1));b.zindex="auto";b.zindex=b.ispage||A.zindex!="auto"?A.zindex:l()||"auto";!b.ispage&&b.zindex!="auto"&&b.zindex>I&&(I=b.zindex);b.isie&&b.zindex===0&&A.zindex=="auto"&&(b.zindex="auto");if(!b.ispage||!D.isieold){var v=b.docscroll;b.ispage&&(v=b.haswrapper?b.win:b.doc);b.css(v,m);b.ispage&&(D.isie11||D.isie)&&b.css(q("html"),m);!D.isios||b.ispage||b.haswrapper||b.css(G,{"-webkit-overflow-scrolling":"touch"});var x=q(w.createElement("div"));
x.css({position:"relative",top:0,"float":"right",width:A.cursorwidth,height:0,"background-color":A.cursorcolor,border:A.cursorborder,"background-clip":"padding-box","-webkit-border-radius":A.cursorborderradius,"-moz-border-radius":A.cursorborderradius,"border-radius":A.cursorborderradius});x.addClass("nicescroll-cursors");b.cursor=x;var c=q(w.createElement("div"));c.attr("id",b.id);c.addClass("nicescroll-rails nicescroll-rails-vr");A.scrollCLass&&c.addClass(A.scrollCLass);var d,f=["left","right",
"top","bottom"],h;for(h in f){var r=f[h];(d=A.railpadding[r]||0)&&c.css("padding-"+r,d+"px")}c.append(x);c.width=Math.max(parseFloat(A.cursorwidth),x.outerWidth());c.css({width:c.width+"px",zIndex:b.zindex,background:A.background,cursor:"default"});c.visibility=!0;c.scrollable=!0;c.align=A.railalign=="left"?0:1;b.rail=c;x=b.rail.drag=!1;!A.boxzoom||b.ispage||D.isieold||(x=w.createElement("div"),b.bind(x,"click",b.doZoom),b.bind(x,"mouseenter",function(){b.zoom.css("opacity",A.cursoropacitymax)}),
b.bind(x,"mouseleave",function(){b.zoom.css("opacity",A.cursoropacitymin)}),b.zoom=q(x),b.zoom.css({cursor:"pointer",zIndex:b.zindex,backgroundImage:"url("+A.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),A.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),D.cantouch&&A.gesturezoom&&(b.ongesturezoom=function(C){C.scale>1.5&&b.doZoomIn(C);C.scale<.8&&b.doZoomOut(C);return b.cancelEvent(C)},b.bind(b.win,"gestureend",b.ongesturezoom)));b.railh=!1;if(A.horizrailenabled){b.css(v,
{overflowX:"hidden"});x=q(w.createElement("div"));x.css({position:"absolute",top:0,height:A.cursorwidth,width:0,backgroundColor:A.cursorcolor,border:A.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":A.cursorborderradius,"-moz-border-radius":A.cursorborderradius,"border-radius":A.cursorborderradius});D.isieold&&x.css("overflow","hidden");x.addClass("nicescroll-cursors");b.cursorh=x;var B=q(w.createElement("div"));B.attr("id",b.id+"-hr");B.addClass("nicescroll-rails nicescroll-rails-hr");
A.scrollCLass&&B.addClass(A.scrollCLass);B.height=Math.max(parseFloat(A.cursorwidth),x.outerHeight());B.css({height:B.height+"px",zIndex:b.zindex,background:A.background});B.append(x);B.visibility=!0;B.scrollable=!0;B.align=A.railvalign=="top"?0:1;b.railh=B;b.railh.drag=!1}b.ispage?(c.css({position:"fixed",top:0,height:"100%"}),c.css(c.align?{right:0}:{left:0}),b.body.append(c),b.railh&&(B.css({position:"fixed",left:0,width:"100%"}),B.css(B.align?{bottom:0}:{top:0}),b.body.append(B))):(b.ishwscroll?
(b.win.css("position")=="static"&&b.css(b.win,{position:"relative"}),v=b.win[0].nodeName=="HTML"?b.body:b.win,q(v).scrollTop(0).scrollLeft(0),b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":c.width+4}),v.append(b.zoom)),c.css({position:"absolute",top:0}),c.css(c.align?{right:0}:{left:0}),v.append(c),B&&(B.css({position:"absolute",left:0,bottom:0}),B.css(B.align?{bottom:0}:{top:0}),v.append(B))):(b.isfixed=b.win.css("position")=="fixed",v=b.isfixed?"fixed":"absolute",b.isfixed||
(b.viewport=b.getViewport(b.win[0])),b.viewport&&(b.body=b.viewport,/fixed|absolute/.test(b.viewport.css("position"))||b.css(b.viewport,{position:"relative"})),c.css({position:v}),b.zoom&&b.zoom.css({position:v}),b.updateScrollBar(),b.body.append(c),b.zoom&&b.body.append(b.zoom),b.railh&&(B.css({position:v}),b.body.append(B))),D.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),A.disableoutline&&(D.isie&&b.win.attr("hideFocus","true"),D.iswebkit&&b.win.css("outline",
"none")));A.autohidemode===!1?(b.autohidedom=!1,b.rail.css({opacity:A.cursoropacitymax}),b.railh&&b.railh.css({opacity:A.cursoropacitymax})):A.autohidemode===!0||A.autohidemode==="leave"?(b.autohidedom=q().add(b.rail),D.isie8&&(b.autohidedom=b.autohidedom.add(b.cursor)),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh)),b.railh&&D.isie8&&(b.autohidedom=b.autohidedom.add(b.cursorh))):A.autohidemode=="scroll"?(b.autohidedom=q().add(b.rail),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh))):A.autohidemode==
"cursor"?(b.autohidedom=q().add(b.cursor),b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):A.autohidemode=="hidden"&&(b.autohidedom=!1,b.hide(),b.railslocked=!1);if(D.cantouch||b.istouchcapable||A.emulatetouch||D.hasmstouch){b.scrollmom=new ja(b);b.ontouchstart=function(C){if(b.locked||C.pointerType&&(C.pointerType==="mouse"||C.pointerType===C.MSPOINTER_TYPE_MOUSE))return!1;b.hasmoving=!1;b.scrollmom.timer&&(b.triggerScrollEnd(),b.scrollmom.stop());if(!b.railslocked){var W=b.getTarget(C);if(W&&
/INPUT/i.test(W.nodeName)&&/range/i.test(W.type))return b.stopPropagation(C);var la=C.type==="mousedown";!("clientX"in C)&&"changedTouches"in C&&(C.clientX=C.changedTouches[0].clientX,C.clientY=C.changedTouches[0].clientY);if(b.forcescreen){var ua=C;C={original:C.original?C.original:C};C.clientX=ua.screenX;C.clientY=ua.screenY}b.rail.drag={x:C.clientX,y:C.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),sl:b.getScrollLeft(),pt:2,dl:!1,tg:W};if(b.ispage||!A.directionlockdeadzone)b.rail.drag.dl=
"f";else{ua=J.width();var va=J.height(),Ha=b.getContentSize();va=Ha.h-va;ua=Ha.w-ua;b.rail.drag.ck=b.rail.scrollable&&!b.railh.scrollable?va>0?"v":!1:!b.rail.scrollable&&b.railh.scrollable?ua>0?"h":!1:!1}A.emulatetouch&&b.isiframe&&D.isie&&(ua=b.win.position(),b.rail.drag.x+=ua.left,b.rail.drag.y+=ua.top);b.hasmoving=!1;b.lastmouseup=!1;b.scrollmom.reset(C.clientX,C.clientY);if(W&&la){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(W.nodeName))return D.hasmousecapture&&W.setCapture(),A.emulatetouch?(W.onclick&&
!W._onclick&&(W._onclick=W.onclick,W.onclick=function(wa){if(b.hasmoving)return!1;W._onclick.call(this,wa)}),b.cancelEvent(C)):b.stopPropagation(C);/SUBMIT|CANCEL|BUTTON/i.test(q(W).attr("type"))&&(b.preventclick={tg:W,click:!1})}}};b.ontouchend=function(C){if(!b||!b.rail.drag)return!0;if(b.rail.drag.pt==2){if(C.pointerType&&(C.pointerType==="mouse"||C.pointerType===C.MSPOINTER_TYPE_MOUSE))return!1;b.rail.drag=!1;var W=C.type==="mouseup";if(b.hasmoving&&(b.scrollmom.doMomentum(),b.lastmouseup=!0,
b.hideCursor(),D.hasmousecapture&&w.releaseCapture(),W))return b.cancelEvent(C)}else if(b.rail.drag.pt==1)return b.onmouseup(C)};var H=A.emulatetouch&&b.isiframe&&!D.hasmousecapture,S=A.directionlockdeadzone*.3|0;b.ontouchmove=function(C,W){if(!b||!b.rail.drag||C.targetTouches&&A.preventmultitouchscrolling&&C.targetTouches.length>1||C.pointerType&&(C.pointerType==="mouse"||C.pointerType===C.MSPOINTER_TYPE_MOUSE))return!0;if(b.rail.drag.pt==2){"changedTouches"in C&&(C.clientX=C.changedTouches[0].clientX,
C.clientY=C.changedTouches[0].clientY);var la;var ua=la=0;H&&!W&&(W=b.win.position(),ua=-W.left,la=-W.top);var va=C.clientY+la;W=va-b.rail.drag.y;var Ha=C.clientX+ua;la=Ha-b.rail.drag.x;var wa=b.rail.drag.st-W;if(b.ishwscroll&&A.bouncescroll)wa<0?wa=Math.round(wa/2):wa>b.page.maxh&&(wa=b.page.maxh+Math.round((wa-b.page.maxh)/2));else if(wa<0?va=wa=0:wa>b.page.maxh&&(wa=b.page.maxh,va=0),va===0&&!b.hasmoving)return b.ispage||(b.rail.drag=!1),!0;var ya=b.getScrollLeft();b.railh&&b.railh.scrollable&&
(ya=b.isrtlmode?la-b.rail.drag.sl:b.rail.drag.sl-la,b.ishwscroll&&A.bouncescroll?ya<0?ya=Math.round(ya/2):ya>b.page.maxw&&(ya=b.page.maxw+Math.round((ya-b.page.maxw)/2)):(ya<0&&(Ha=ya=0),ya>b.page.maxw&&(ya=b.page.maxw,Ha=0)));if(!b.hasmoving){if(b.rail.drag.y===C.clientY&&b.rail.drag.x===C.clientX)return b.cancelEvent(C);ua=Math.abs(W);W=Math.abs(la);la=A.directionlockdeadzone;b.rail.drag.ck?b.rail.drag.ck=="v"?W>la&&ua<=S?b.rail.drag=!1:ua>la&&(b.rail.drag.dl="v"):b.rail.drag.ck=="h"&&(ua>la&&W<=
S?b.rail.drag=!1:W>la&&(b.rail.drag.dl="h")):ua>la&&W>la?b.rail.drag.dl="f":ua>la?b.rail.drag.dl=W>S?"f":"v":W>la&&(b.rail.drag.dl=ua>S?"f":"h");if(!b.rail.drag.dl)return b.cancelEvent(C);b.triggerScrollStart(C.clientX,C.clientY,0,0,0);b.hasmoving=!0}b.preventclick&&!b.preventclick.click&&(b.preventclick.click=b.preventclick.tg.onclick||!1,b.preventclick.tg.onclick=b.onpreventclick);b.rail.drag.dl&&(b.rail.drag.dl=="v"?ya=b.rail.drag.sl:b.rail.drag.dl=="h"&&(wa=b.rail.drag.st));b.synched("touchmove",
function(){b.rail.drag&&b.rail.drag.pt==2&&(b.prepareTransition&&b.resetTransition(),b.rail.scrollable&&b.setScrollTop(wa),b.scrollmom.update(Ha,va),b.railh&&b.railh.scrollable?(b.setScrollLeft(ya),b.showCursor(wa,ya)):b.showCursor(wa),D.isie10&&w.selection.clear())});return b.cancelEvent(C)}if(b.rail.drag.pt==1)return b.onmousemove(C)};b.ontouchstartCursor=function(C,W){if(!b.rail.drag||b.rail.drag.pt==3){if(b.locked)return b.cancelEvent(C);b.cancelScroll();b.rail.drag={x:C.touches[0].clientX,y:C.touches[0].clientY,
sx:b.scroll.x,sy:b.scroll.y,pt:3,hr:!!W};W=b.getTarget(C);!b.ispage&&D.hasmousecapture&&W.setCapture();b.isiframe&&!D.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));return b.cancelEvent(C)}};b.ontouchendCursor=function(C){if(b.rail.drag&&(D.hasmousecapture&&w.releaseCapture(),b.isiframe&&!D.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),b.rail.drag.pt==3))return b.rail.drag=!1,b.cancelEvent(C)};b.ontouchmoveCursor=
function(C){if(b.rail.drag&&b.rail.drag.pt==3){b.cursorfreezed=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(C.touches[0].clientX-b.rail.drag.x);b.scroll.x<0&&(b.scroll.x=0);var W=b.scrollvaluemaxw;b.scroll.x>W&&(b.scroll.x=W)}else b.scroll.y=b.rail.drag.sy+(C.touches[0].clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0),W=b.scrollvaluemax,b.scroll.y>W&&(b.scroll.y=W);b.synched("touchmove",function(){b.rail.drag&&b.rail.drag.pt==3&&(b.showCursor(),b.rail.drag.hr?b.doScrollLeft(Math.round(b.scroll.x*
b.scrollratio.x),A.cursordragspeed):b.doScrollTop(Math.round(b.scroll.y*b.scrollratio.y),A.cursordragspeed))});return b.cancelEvent(C)}}}b.onmousedown=function(C,W){if(!b.rail.drag||b.rail.drag.pt==1){if(b.railslocked)return b.cancelEvent(C);b.cancelScroll();b.rail.drag={x:C.clientX,y:C.clientY,sx:b.scroll.x,sy:b.scroll.y,pt:1,hr:W||!1};W=b.getTarget(C);D.hasmousecapture&&W.setCapture();b.isiframe&&!D.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));
b.hasmoving=!1;return b.cancelEvent(C)}};b.onmouseup=function(C){if(b.rail.drag){if(b.rail.drag.pt!=1)return!0;D.hasmousecapture&&w.releaseCapture();b.isiframe&&!D.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents);b.rail.drag=!1;b.cursorfreezed=!1;b.hasmoving&&b.triggerScrollEnd();return b.cancelEvent(C)}};b.onmousemove=function(C){if(b.rail.drag){if(b.rail.drag.pt===1){if(D.ischrome&&C.which===0)return b.onmouseup(C);b.cursorfreezed=!0;b.hasmoving||b.triggerScrollStart(C.clientX,
C.clientY,0,0,0);b.hasmoving=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(C.clientX-b.rail.drag.x);b.scroll.x<0&&(b.scroll.x=0);var W=b.scrollvaluemaxw;b.scroll.x>W&&(b.scroll.x=W)}else b.scroll.y=b.rail.drag.sy+(C.clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0),W=b.scrollvaluemax,b.scroll.y>W&&(b.scroll.y=W);b.synched("mousemove",function(){b.cursorfreezed&&(b.showCursor(),b.rail.drag.hr?b.scrollLeft(Math.round(b.scroll.x*b.scrollratio.x)):b.scrollTop(Math.round(b.scroll.y*b.scrollratio.y)))});
return b.cancelEvent(C)}}else b.checkarea=0};if(D.cantouch||A.emulatetouch)b.onpreventclick=function(C){if(b.preventclick)return b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=!1,b.cancelEvent(C)},b.onclick=D.isios?!1:function(C){return b.lastmouseup?(b.lastmouseup=!1,b.cancelEvent(C)):!0},A.grabcursorenabled&&D.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:D.cursorgrabvalue}),b.css(b.rail,{cursor:D.cursorgrabvalue}));else{var K=function(C){if(b.selectiondrag){if(C){var W=b.win.outerHeight();
C=C.pageY-b.selectiondrag.top;C>0&&C<W&&(C=0);C>=W&&(C-=W);b.selectiondrag.df=C}b.selectiondrag.df!==0&&(b.doScrollBy(-(b.selectiondrag.df*2/6)|0),b.debounced("doselectionscroll",function(){K()},50))}};b.hasTextSelected="getSelection"in w?function(){return w.getSelection().rangeCount>0}:"selection"in w?function(){return w.selection.type!="None"}:function(){return!1};b.onselectionstart=function(C){b.ispage||(b.selectiondrag=b.win.offset())};b.onselectionend=function(C){b.selectiondrag=!1};b.onselectiondrag=
function(C){b.selectiondrag&&b.hasTextSelected()&&b.debounced("selectionscroll",function(){K(C)},250)}}D.hasw3ctouch?(b.css(b.ispage?q("html"):b.win,{"touch-action":"none"}),b.css(b.rail,{"touch-action":"none"}),b.css(b.cursor,{"touch-action":"none"}),b.bind(b.win,"pointerdown",b.ontouchstart),b.bind(w,"pointerup",b.ontouchend),b.delegate(w,"pointermove",b.ontouchmove)):D.hasmstouch?(b.css(b.ispage?q("html"):b.win,{"-ms-touch-action":"none"}),b.css(b.rail,{"-ms-touch-action":"none"}),b.css(b.cursor,
{"-ms-touch-action":"none"}),b.bind(b.win,"MSPointerDown",b.ontouchstart),b.bind(w,"MSPointerUp",b.ontouchend),b.delegate(w,"MSPointerMove",b.ontouchmove),b.bind(b.cursor,"MSGestureHold",function(C){C.preventDefault()}),b.bind(b.cursor,"contextmenu",function(C){C.preventDefault()})):D.cantouch&&(b.bind(b.win,"touchstart",b.ontouchstart,!1,!0),b.bind(w,"touchend",b.ontouchend,!1,!0),b.bind(w,"touchcancel",b.ontouchend,!1,!0),b.delegate(w,"touchmove",b.ontouchmove,!1,!0));A.emulatetouch&&(b.bind(b.win,
"mousedown",b.ontouchstart,!1,!0),b.bind(w,"mouseup",b.ontouchend,!1,!0),b.bind(w,"mousemove",b.ontouchmove,!1,!0));if(A.cursordragontouch||!D.cantouch&&!A.emulatetouch)b.rail.css({cursor:"default"}),b.railh&&b.railh.css({cursor:"default"}),b.jqbind(b.rail,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.rail,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()}),A.sensitiverail&&(b.bind(b.rail,
"click",function(C){b.doRailClick(C,!1,!1)}),b.bind(b.rail,"dblclick",function(C){b.doRailClick(C,!0,!1)}),b.bind(b.cursor,"click",function(C){b.cancelEvent(C)}),b.bind(b.cursor,"dblclick",function(C){b.cancelEvent(C)})),b.railh&&(b.jqbind(b.railh,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.railh,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()}),A.sensitiverail&&(b.bind(b.railh,"click",
function(C){b.doRailClick(C,!1,!0)}),b.bind(b.railh,"dblclick",function(C){b.doRailClick(C,!0,!0)}),b.bind(b.cursorh,"click",function(C){b.cancelEvent(C)}),b.bind(b.cursorh,"dblclick",function(C){b.cancelEvent(C)})));A.cursordragontouch&&(this.istouchcapable||D.cantouch)&&(b.bind(b.cursor,"touchstart",b.ontouchstartCursor),b.bind(b.cursor,"touchmove",b.ontouchmoveCursor),b.bind(b.cursor,"touchend",b.ontouchendCursor),b.cursorh&&b.bind(b.cursorh,"touchstart",function(C){b.ontouchstartCursor(C,!0)}),
b.cursorh&&b.bind(b.cursorh,"touchmove",b.ontouchmoveCursor),b.cursorh&&b.bind(b.cursorh,"touchend",b.ontouchendCursor));A.emulatetouch||D.isandroid||D.isios?(b.bind(D.hasmousecapture?b.win:w,"mouseup",b.ontouchend),b.onclick&&b.bind(w,"click",b.onclick),A.cursordragontouch?(b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.cursorh&&b.bind(b.cursorh,"mousedown",function(C){b.onmousedown(C,!0)}),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onmouseup)):(b.bind(b.rail,"mousedown",
function(C){C.preventDefault()}),b.railh&&b.bind(b.railh,"mousedown",function(C){C.preventDefault()}))):(b.bind(D.hasmousecapture?b.win:w,"mouseup",b.onmouseup),b.bind(w,"mousemove",b.onmousemove),b.onclick&&b.bind(w,"click",b.onclick),b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.railh&&(b.bind(b.cursorh,"mousedown",function(C){b.onmousedown(C,!0)}),b.bind(b.cursorh,"mouseup",b.onmouseup)),!b.ispage&&A.enablescrollonselection&&(b.bind(b.win[0],"mousedown",b.onselectionstart),
b.bind(w,"mouseup",b.onselectionend),b.bind(b.cursor,"mouseup",b.onselectionend),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onselectionend),b.bind(w,"mousemove",b.onselectiondrag)),b.zoom&&(b.jqbind(b.zoom,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.zoom,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()})));A.enablemousewheel&&(b.isiframe||b.mousewheel(D.isie&&b.ispage?w:b.win,b.onmousewheel),b.mousewheel(b.rail,b.onmousewheel),b.railh&&
b.mousewheel(b.railh,b.onmousewheelhr));b.ispage||D.cantouch||/HTML|^BODY/.test(b.win[0].nodeName)||(b.win.attr("tabindex")||b.win.attr({tabindex:++u}),b.bind(b.win,"focus",function(C){z=b.getTarget(C).id||b.getTarget(C)||!1;b.hasfocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"blur",function(C){z=!1;b.hasfocus=!1}),b.bind(b.win,"mouseenter",function(C){t=b.getTarget(C).id||b.getTarget(C)||!1;b.hasmousefocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"mouseleave",function(C){t=
!1;b.hasmousefocus=!1;b.rail.drag||b.hideCursor()}));b.onkeypress=function(C){if(b.railslocked&&b.page.maxh===0)return!0;C=C||M.event;var W=b.getTarget(C);if(W&&/INPUT|TEXTAREA|SELECT|OPTION/.test(W.nodeName)&&(!W.getAttribute("type")&&!W.type||!/submit|button|cancel/i.tp)||q(W).attr("contenteditable"))return!0;if(b.hasfocus||b.hasmousefocus&&!z||b.ispage&&!z&&!t){W=C.keyCode;if(b.railslocked&&W!=27)return b.cancelEvent(C);var la=C.ctrlKey||!1,ua=C.shiftKey||!1,va=!1;switch(W){case 38:case 63233:b.doScrollBy(72);
va=!0;break;case 40:case 63235:b.doScrollBy(-72);va=!0;break;case 37:case 63232:b.railh&&(la?b.doScrollLeft(0):b.doScrollLeftBy(72),va=!0);break;case 39:case 63234:b.railh&&(la?b.doScrollLeft(b.page.maxw):b.doScrollLeftBy(-72),va=!0);break;case 33:case 63276:b.doScrollBy(b.view.h);va=!0;break;case 34:case 63277:b.doScrollBy(-b.view.h);va=!0;break;case 36:case 63273:b.railh&&la?b.doScrollPos(0,0):b.doScrollTo(0);va=!0;break;case 35:case 63275:b.railh&&la?b.doScrollPos(b.page.maxw,b.page.maxh):b.doScrollTo(b.page.maxh);
va=!0;break;case 32:A.spacebarenabled&&(ua?b.doScrollBy(b.view.h):b.doScrollBy(-b.view.h),va=!0);break;case 27:b.zoomactive&&(b.doZoom(),va=!0)}if(va)return b.cancelEvent(C)}};A.enablekeyboard&&b.bind(w,D.isopera&&!D.isopera12?"keypress":"keydown",b.onkeypress);b.bind(w,"keydown",function(C){C.ctrlKey&&(b.wheelprevented=!0)});b.bind(w,"keyup",function(C){C.ctrlKey||(b.wheelprevented=!1)});b.bind(M,"blur",function(C){b.wheelprevented=!1});b.bind(M,"resize",b.onscreenresize);b.bind(M,"orientationchange",
b.onscreenresize);b.bind(M,"load",b.lazyResize);if(D.ischrome&&!b.ispage&&!b.haswrapper){var P=b.win.attr("style");c=parseFloat(b.win.css("width"))+1;b.win.css("width",c);b.synched("chromefix",function(){b.win.attr("style",P)})}b.onAttributeChange=function(C){b.lazyResize(b.isieold?250:30)};if(A.enableobserver&&(b.isie11||da===!1||(b.observerbody=new da(function(C){C.forEach(function(W){if(W.type=="attributes")return G.hasClass("modal-open")&&G.hasClass("modal-dialog")&&!q.contains(q(".modal-dialog")[0],
b.doc[0])?b.hide():b.show()});if(b.me.clientWidth!=b.page.width||b.me.clientHeight!=b.page.height)return b.lazyResize(30)}),b.observerbody.observe(w.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),!b.ispage&&!b.haswrapper)){var T=b.win[0];da!==!1?(b.observer=new da(function(C){C.forEach(b.onAttributeChange)}),b.observer.observe(T,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),b.observerremover=new da(function(C){C.forEach(function(W){if(W.removedNodes.length>
0)for(var la in W.removedNodes)if(b&&W.removedNodes[la]===T)return b.remove()})}),b.observerremover.observe(T.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(b.bind(T,D.isie&&!D.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange),D.isie9&&T.attachEvent("onpropertychange",b.onAttributeChange),b.bind(T,"DOMNodeRemoved",function(C){C.target===T&&b.remove()}))}!b.ispage&&A.boxzoom&&b.bind(M,"resize",b.resizeZoom);b.istextarea&&(b.bind(b.win,"keydown",b.lazyResize),b.bind(b.win,
"mouseup",b.lazyResize));b.lazyResize(30)}if(this.doc[0].nodeName=="IFRAME"){var X=function(){b.iframexd=!1;try{var C="contentDocument"in this?this.contentDocument:this.contentWindow._doc}catch(la){b.iframexd=!0,C=!1}if(b.iframexd)return!0;b.forcescreen=!0;b.isiframe&&(b.iframe={doc:q(C),html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]},b.getContentSize=function(){return{w:Math.max(b.iframe.html.scrollWidth,b.iframe.body.scrollWidth),h:Math.max(b.iframe.html.scrollHeight,
b.iframe.body.scrollHeight)}},b.docscroll=q(b.iframe.body));if(!D.isios&&A.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);b.doc.height("");var W=Math.max(C.getElementsByTagName("html")[0].scrollHeight,C.body.scrollHeight);b.doc.height(W)}b.lazyResize(30);b.css(q(b.iframe.body),m);D.isios&&b.haswrapper&&b.css(q(C.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(C,"scroll",b.onscroll);A.enablemousewheel&&b.mousewheel(C,
b.onmousewheel);A.enablekeyboard&&b.bind(C,D.isopera?"keypress":"keydown",b.onkeypress);D.cantouch?(b.bind(C,"touchstart",b.ontouchstart),b.bind(C,"touchmove",b.ontouchmove)):A.emulatetouch&&(b.bind(C,"mousedown",b.ontouchstart),b.bind(C,"mousemove",function(la){return b.ontouchmove(la,!0)}),A.grabcursorenabled&&D.cursorgrabvalue&&b.css(q(C.body),{cursor:D.cursorgrabvalue}));b.bind(C,"mouseup",b.ontouchend);b.zoom&&(A.dblclickzoom&&b.bind(C,"dblclick",b.doZoom),b.ongesturezoom&&b.bind(C,"gestureend",
b.ongesturezoom))};this.doc[0].readyState&&this.doc[0].readyState==="complete"&&setTimeout(function(){X.call(b.doc[0],!1)},500);b.bind(this.doc,"load",X)}};this.showCursor=function(m,v){b.cursortimeout&&(clearTimeout(b.cursortimeout),b.cursortimeout=0);b.rail&&(b.autohidedom&&(b.autohidedom.stop().css({opacity:A.cursoropacitymax}),b.cursoractive=!0),b.rail.drag&&b.rail.drag.pt==1||(m!==void 0&&m!==!1&&(b.scroll.y=m/b.scrollratio.y|0),v!==void 0&&(b.scroll.x=v/b.scrollratio.x|0)),b.cursor.css({height:b.cursorheight,
top:b.scroll.y}),b.cursorh&&(m=b.hasreversehr?b.scrollvaluemaxw-b.scroll.x:b.scroll.x,b.cursorh.css({width:b.cursorwidth,left:!b.rail.align&&b.rail.visibility?m+b.rail.width:m}),b.cursoractive=!0),b.zoom&&b.zoom.stop().css({opacity:A.cursoropacitymax}))};this.hideCursor=function(m){b.cursortimeout||!b.rail||!b.autohidedom||b.hasmousefocus&&A.autohidemode==="leave"||(b.cursortimeout=setTimeout(function(){b.rail.active&&b.showonmouseevent||(b.autohidedom.stop().animate({opacity:A.cursoropacitymin}),
b.zoom&&b.zoom.stop().animate({opacity:A.cursoropacitymin}),b.cursoractive=!1);b.cursortimeout=0},m||A.hidecursordelay))};this.noticeCursor=function(m,v,x){b.showCursor(v,x);b.rail.active||b.hideCursor(m)};this.getContentSize=b.ispage?function(){return{w:Math.max(w.body.scrollWidth,w.documentElement.scrollWidth),h:Math.max(w.body.scrollHeight,w.documentElement.scrollHeight)}}:b.haswrapper?function(){return{w:b.doc[0].offsetWidth,h:b.doc[0].offsetHeight}}:function(){return{w:b.docscroll[0].scrollWidth,
h:b.docscroll[0].scrollHeight}};this.onResize=function(m,v){if(!b||!b.win)return!1;m=b.page.maxh;var x=b.page.maxw,c=b.view.h,d=b.view.w;b.view={w:b.ispage?b.win.width():b.win[0].clientWidth,h:b.ispage?b.win.height():b.win[0].clientHeight};b.page=v?v:b.getContentSize();b.page.maxh=Math.max(0,b.page.h-b.view.h);b.page.maxw=Math.max(0,b.page.w-b.view.w);if(b.page.maxh==m&&b.page.maxw==x&&b.view.w==d&&b.view.h==c){if(b.ispage)return b;v=b.win.offset();if(b.lastposition&&(m=b.lastposition,m.top==v.top&&
m.left==v.left))return b;b.lastposition=v}b.page.maxh===0?(b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio.y=0,b.cursorheight=0,b.setScrollTop(0),b.rail&&(b.rail.scrollable=!1)):(b.page.maxh-=A.railpadding.top+A.railpadding.bottom,b.rail.scrollable=!0);b.page.maxw===0?(b.hideRailHr(),b.scrollvaluemaxw=0,b.scroll.x=0,b.scrollratio.x=0,b.cursorwidth=0,b.setScrollLeft(0),b.railh&&(b.railh.scrollable=!1)):(b.page.maxw-=A.railpadding.left+A.railpadding.right,b.railh&&(b.railh.scrollable=A.horizrailenabled));
b.railslocked=b.locked||b.page.maxh===0&&b.page.maxw===0;if(b.railslocked)return b.ispage||b.updateScrollBar(b.view),!1;b.hidden||(b.rail.visibility||b.showRail(),b.railh&&!b.railh.visibility&&b.showRailHr());b.istextarea&&b.win.css("resize")&&b.win.css("resize")!="none"&&(b.view.h-=20);b.cursorheight=Math.min(b.view.h,Math.round(b.view.h/b.page.h*b.view.h));b.cursorheight=A.cursorfixedheight?A.cursorfixedheight:Math.max(A.cursorminheight,b.cursorheight);b.cursorwidth=Math.min(b.view.w,Math.round(b.view.w/
b.page.w*b.view.w));b.cursorwidth=A.cursorfixedheight?A.cursorfixedheight:Math.max(A.cursorminheight,b.cursorwidth);b.scrollvaluemax=b.view.h-b.cursorheight-(A.railpadding.top+A.railpadding.bottom);b.hasborderbox||(b.scrollvaluemax-=b.cursor[0].offsetHeight-b.cursor[0].clientHeight);b.railh&&(b.railh.width=b.page.maxh>0?b.view.w-b.rail.width:b.view.w,b.scrollvaluemaxw=b.railh.width-b.cursorwidth-(A.railpadding.left+A.railpadding.right));b.ispage||b.updateScrollBar(b.view);b.scrollratio={x:b.page.maxw/
b.scrollvaluemaxw,y:b.page.maxh/b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScrollTop(b.page.maxh):(b.scroll.y=b.getScrollTop()/b.scrollratio.y|0,b.scroll.x=b.getScrollLeft()/b.scrollratio.x|0,b.cursoractive&&b.noticeCursor());b.scroll.y&&b.getScrollTop()===0&&b.doScrollTo(b.scroll.y*b.scrollratio.y|0);return b};this.resize=b.onResize;var g=0;this.onscreenresize=function(m){clearTimeout(g);var v=!b.ispage&&!b.haswrapper;v&&b.hideRails();g=setTimeout(function(){b&&(v&&b.showRails(),b.resize());
g=0},120)};this.lazyResize=function(m){clearTimeout(g);m=isNaN(m)?240:m;g=setTimeout(function(){b&&b.resize();g=0},m);return b};this.jqbind=function(m,v,x){b.events.push({e:m,n:v,f:x,q:!0});q(m).on(v,x)};this.mousewheel=function(m,v,x){m="jquery"in m?m[0]:m;if("onwheel"in w.createElement("div"))b._bind(m,"wheel",v,x||!1);else{var c=w.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";p(m,c,v,x||!1);c=="DOMMouseScroll"&&p(m,"MozMousePixelScroll",v,x||!1)}};var xa=!1;if(D.haseventlistener){try{var ma=
Object.defineProperty({},"passive",{get:function(){xa=!0}});M.addEventListener("test",null,ma)}catch(m){}this.stopPropagation=function(m){if(!m)return!1;m=m.original?m.original:m;m.stopPropagation();return!1};this.cancelEvent=function(m){m.cancelable&&m.preventDefault();m.stopImmediatePropagation();m.preventManipulation&&m.preventManipulation();return!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},M.constructor.prototype.addEventListener=
w.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(m,v,x){this.attachEvent("on"+m,v)},M.constructor.prototype.removeEventListener=w.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(m,v,x){this.detachEvent("on"+m,v)},this.cancelEvent=function(m){if(m=m||M.event)m.cancelBubble=!0,m.cancel=!0,m.returnValue=!1;return!1},this.stopPropagation=function(m){if(m=m||M.event)m.cancelBubble=!0;return!1};this.delegate=function(m,v,x,c,d){var f=
L[v]||!1;f?b.events.push({e:m,n:v,f:x,b:c,q:!1}):(f={a:[],l:[],f:function(h){for(var r=f.l,B=!1,H=r.length-1;H>=0;H--)if(B=r[H].call(h.target,h),B===!1)return!1;return B}},b.bind(m,v,f.f,c,d),L[v]=f);b.ispage?(f.a=[b.id].concat(f.a),f.l=[x].concat(f.l)):(f.a.push(b.id),f.l.push(x))};this.undelegate=function(m,v,x,c,d){if((x=L[v]||!1)&&x.l)for(c=0,d=x.l.length;c<d;c++)x.a[c]===b.id&&(x.a.splice(c),x.l.splice(c),x.a.length===0&&(b._unbind(m,v,x.l.f),L[v]=null))};this.bind=function(m,v,x,c,d){b._bind("jquery"in
m?m[0]:m,v,x,c||!1,d||!1)};this._bind=function(m,v,x,c,d){b.events.push({e:m,n:v,f:x,b:c,q:!1});xa&&(d||m==M.document||m==M.document.body||m==M)?m.addEventListener(v,x,{passive:!1,capture:c}):m.addEventListener(v,x,c||!1)};this._unbind=function(m,v,x,c){L[v]?b.undelegate(m,v,x,c):m.removeEventListener(v,x,c)};this.unbindAll=function(){for(var m=0;m<b.events.length;m++){var v=b.events[m];v.q?v.e.unbind(v.n,v.f):b._unbind(v.e,v.n,v.f,v.b)}};this.showRails=function(){return b.showRail().showRailHr()};
this.showRail=function(){b.page.maxh===0||!b.ispage&&b.win.css("display")=="none"||(b.rail.visibility=!0,b.rail.css("display","block"));return b};this.showRailHr=function(){b.railh&&b.page.maxw!==0&&(b.ispage||b.win.css("display")!="none")&&(b.railh.visibility=!0,b.railh.css("display","block"));return b};this.hideRails=function(){return b.hideRail().hideRailHr()};this.hideRail=function(){b.rail.visibility=!1;b.rail.css("display","none");return b};this.hideRailHr=function(){b.railh&&(b.railh.visibility=
!1,b.railh.css("display","none"));return b};this.show=function(){b.hidden=!1;b.railslocked=!1;return b.showRails()};this.hide=function(){b.hidden=!0;b.railslocked=!0;return b.hideRails()};this.toggle=function(){return b.hidden?b.show():b.hide()};this.remove=function(){b.stop();b.cursortimeout&&clearTimeout(b.cursortimeout);for(var m in b.delaylist)b.delaylist[m]&&R(b.delaylist[m].h);b.doZoomOut();D.hasw3ctouch?b.undelegate(w,"pointermove",b.ontouchmove):D.hasmstouch?b.undelegate(w,"MSPointerMove",
b.ontouchmove):D.cantouch&&b.undelegate(w,"touchmove",b.ontouchmove,!1,!0);b.unbindAll();D.isie9&&b.win[0].detachEvent("onpropertychange",b.onAttributeChange);b.observer!==!1&&b.observer.disconnect();b.observerremover!==!1&&b.observerremover.disconnect();b.observerbody!==!1&&b.observerbody.disconnect();b.events=null;b.cursor&&b.cursor.remove();b.cursorh&&b.cursorh.remove();b.rail&&b.rail.remove();b.railh&&b.railh.remove();b.zoom&&b.zoom.remove();for(m=0;m<b.saved.css.length;m++){var v=b.saved.css[m];
v[0].css(v[1],v[2]===void 0?"":v[2])}b.saved=!1;b.me.data("__nicescroll","");var x=q.nicescroll;x.each(function(d){if(this&&this.id===b.id){delete x[d];for(var f=++d;f<x.length;f++,d++)x[d]=x[f];x.length--;x.length&&delete x[x.length]}});for(var c in b)b[c]=null,delete b[c];b=null};this.scrollstart=function(m){this.onscrollstart=m;return b};this.scrollend=function(m){this.onscrollend=m;return b};this.scrollcancel=function(m){this.onscrollcancel=m;return b};this.zoomin=function(m){this.onzoomin=m;
return b};this.zoomout=function(m){this.onzoomout=m;return b};this.isScrollable=function(m){m=m.target?m.target:m;if(m.nodeName=="OPTION")return!0;for(;m&&m.nodeType==1&&m!==this.me[0]&&!/^BODY|HTML/.test(m.nodeName);){var v=q(m);v=v.css("overflowY")||v.css("overflowX")||v.css("overflow")||"";if(/scroll|auto/.test(v))return m.clientHeight!=m.scrollHeight;m=m.parentNode?m.parentNode:!1}return!1};this.getViewport=function(m){for(m=m&&m.parentNode?m.parentNode:!1;m&&m.nodeType==1&&!/^BODY|HTML/.test(m.nodeName);){var v=
q(m);if(/fixed|absolute/.test(v.css("position")))return v;var x=v.css("overflowY")||v.css("overflowX")||v.css("overflow")||"";if(/scroll|auto/.test(x)&&m.clientHeight!=m.scrollHeight||v.getNiceScroll().length>0)return v;m=m.parentNode?m.parentNode:!1}return!1};this.triggerScrollStart=function(m,v,x,c,d){b.onscrollstart&&b.onscrollstart.call(b,{type:"scrollstart",current:{x:m,y:v},request:{x,y:c},end:{x:b.newscrollx,y:b.newscrolly},speed:d})};this.triggerScrollEnd=function(){if(b.onscrollend){var m=
b.getScrollLeft(),v=b.getScrollTop();b.onscrollend.call(b,{type:"scrollend",current:{x:m,y:v},end:{x:m,y:v}})}};var ia=0,Aa=0,oa=0,sa=1,ta=!1;this.onmousewheel=function(m){if(b.wheelprevented||b.locked)return!1;if(b.railslocked)return b.debounced("checkunlock",b.resize,250),!1;if(b.rail.drag)return b.cancelEvent(m);A.oneaxismousemode==="auto"&&m.deltaX!==0&&(A.oneaxismousemode=!1);if(A.oneaxismousemode&&m.deltaX===0&&!b.rail.scrollable)return b.railh&&b.railh.scrollable?b.onmousewheelhr(m):!0;var v=
Z(),x=!1;A.preservenativescrolling&&b.checkarea+600<v&&(b.nativescrollingarea=b.isScrollable(m),x=!0);b.checkarea=v;if(b.nativescrollingarea)return!0;if(m=N(m,!1,x))b.checkarea=0;return m};this.onmousewheelhr=function(m){if(!b.wheelprevented){if(b.railslocked||!b.railh.scrollable)return!0;if(b.rail.drag)return b.cancelEvent(m);var v=Z(),x=!1;A.preservenativescrolling&&b.checkarea+600<v&&(b.nativescrollingarea=b.isScrollable(m),x=!0);b.checkarea=v;return b.nativescrollingarea?!0:b.railslocked?b.cancelEvent(m):
N(m,!0,x)}};this.stop=function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=!1;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};this.getTransitionSpeed=function(m){return 80+m/72*A.scrollspeed|0};if(A.smoothscroll)if(b.ishwscroll&&D.hastransition&&A.usetransition&&A.smoothscroll){var za="";this.resetTransition=function(){za="";b.doc.css(D.prefixstyle+"transition-duration","0ms")};this.prepareTransition=function(m,v){m=v?m:b.getTransitionSpeed(m);
v=m+"ms";za!==v&&(za=v,b.doc.css(D.prefixstyle+"transition-duration",v));return m};this.doScrollLeft=function(m,v){var x=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(m,x,v)};this.doScrollTop=function(m,v){var x=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(x,m,v)};this.cursorupdate={running:!1,start:function(){var m=this;if(!m.running){m.running=!0;var v=function(){m.running&&Q(v);b.showCursor(b.getScrollTop(),b.getScrollLeft());b.notifyScrollEvent(b.win[0])};Q(v)}},
stop:function(){this.running=!1}};this.doScrollPos=function(m,v,x){x=b.getScrollTop();var c=b.getScrollLeft();((b.newscrolly-x)*(v-x)<0||(b.newscrollx-c)*(m-c)<0)&&b.cancelScroll();A.bouncescroll?(v<0?v=v/2|0:v>b.page.maxh&&(v=b.page.maxh+(v-b.page.maxh)/2|0),m<0?m=m/2|0:m>b.page.maxw&&(m=b.page.maxw+(m-b.page.maxw)/2|0)):(v<0?v=0:v>b.page.maxh&&(v=b.page.maxh),m<0?m=0:m>b.page.maxw&&(m=b.page.maxw));if(b.scrollrunning&&m==b.newscrollx&&v==b.newscrolly)return!1;b.newscrolly=v;b.newscrollx=m;x=b.getScrollTop();
c=b.getScrollLeft();var d=m-c;var f=v-x;d=b.prepareTransition(Math.sqrt(d*d+f*f)|0);b.scrollrunning||(b.scrollrunning=!0,b.triggerScrollStart(c,x,m,v,d),b.cursorupdate.start());b.scrollendtrapped=!0;D.transitionend||(b.scrollendtrapped&&clearTimeout(b.scrollendtrapped),b.scrollendtrapped=setTimeout(b.onScrollTransitionEnd,d));b.setScrollTop(b.newscrolly);b.setScrollLeft(b.newscrollx)};this.cancelScroll=function(){if(!b.scrollendtrapped)return!0;var m=b.getScrollTop(),v=b.getScrollLeft();b.scrollrunning=
!1;D.transitionend||clearTimeout(D.transitionend);b.scrollendtrapped=!1;b.resetTransition();b.setScrollTop(m);b.railh&&b.setScrollLeft(v);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=!1;b.cursorfreezed=!1;b.cursorupdate.stop();b.showCursor(m,v);return b};this.onScrollTransitionEnd=function(){if(b.scrollendtrapped){var m=b.getScrollTop(),v=b.getScrollLeft();m<0?m=0:m>b.page.maxh&&(m=b.page.maxh);v<0?v=0:v>b.page.maxw&&(v=b.page.maxw);if(m!=b.newscrolly||v!=b.newscrollx)return b.doScrollPos(v,
m,A.snapbackspeed);b.scrollrunning&&b.triggerScrollEnd();b.scrollrunning=!1;b.scrollendtrapped=!1;b.resetTransition();b.timerscroll=!1;b.setScrollTop(m);b.railh&&b.setScrollLeft(v);b.cursorupdate.stop();b.noticeCursor(!1,m,v);b.cursorfreezed=!1}}}else this.doScrollLeft=function(m,v){var x=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(m,x,v)},this.doScrollTop=function(m,v){var x=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(x,m,v)},this.doScrollPos=function(m,v,x){x=b.getScrollTop();
var c=b.getScrollLeft();((b.newscrolly-x)*(v-x)<0||(b.newscrollx-c)*(m-c)<0)&&b.cancelScroll();var d=!1;b.bouncescroll&&b.rail.visibility||(v<0?(v=0,d=!0):v>b.page.maxh&&(v=b.page.maxh,d=!0));b.bouncescroll&&b.railh.visibility||(m<0?(m=0,d=!0):m>b.page.maxw&&(m=b.page.maxw,d=!0));if(b.scrollrunning&&b.newscrolly===v&&b.newscrollx===m)return!0;b.newscrolly=v;b.newscrollx=m;b.dst={};b.dst.x=m-c;b.dst.y=v-x;b.dst.px=c;b.dst.py=x;var f=b.getTransitionSpeed(Math.sqrt(b.dst.x*b.dst.x+b.dst.y*b.dst.y)|0);
b.bzscroll={};d=d?1:.58;b.bzscroll.x=new fa(c,b.newscrollx,f,0,0,d,1);b.bzscroll.y=new fa(x,b.newscrolly,f,0,0,d,1);Z();var h=function(){if(b.scrollrunning){var r=b.bzscroll.y.getPos();b.setScrollLeft(b.bzscroll.x.getNow());b.setScrollTop(b.bzscroll.y.getNow());r<=1?b.timer=Q(h):(b.scrollrunning=!1,b.timer=0,b.triggerScrollEnd())}};b.scrollrunning||(b.triggerScrollStart(c,x,m,v,f),b.scrollrunning=!0,b.timer=Q(h))},this.cancelScroll=function(){b.timer&&R(b.timer);b.timer=0;b.bzscroll=!1;b.scrollrunning=
!1;return b};else this.doScrollLeft=function(m,v){var x=b.getScrollTop();b.doScrollPos(m,x,v)},this.doScrollTop=function(m,v){var x=b.getScrollLeft();b.doScrollPos(x,m,v)},this.doScrollPos=function(m,v,x){var c=m>b.page.maxw?b.page.maxw:m;c<0&&(c=0);var d=v>b.page.maxh?b.page.maxh:v;d<0&&(d=0);b.synched("scroll",function(){b.setScrollTop(d);b.setScrollLeft(c)})},this.cancelScroll=function(){};this.doScrollBy=function(m,v){y(0,m)};this.doScrollLeftBy=function(m,v){y(m,0)};this.doScrollTo=function(m,
v){b.cursorfreezed=!1;b.doScrollTop(m)};this.checkContentSize=function(){var m=b.getContentSize();m.h==b.page.h&&m.w==b.page.w||b.resize(!1,m)};b.onscroll=function(m){b.rail.drag||b.cursorfreezed||b.synched("scroll",function(){b.scroll.y=Math.round(b.getScrollTop()/b.scrollratio.y);b.railh&&(b.scroll.x=Math.round(b.getScrollLeft()/b.scrollratio.x));b.noticeCursor()})};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(m){if(!b.zoomactive){b.zoomactive=!0;b.zoomrestore={style:{}};var v=
"position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),x=b.win[0].style,c;for(c in v){var d=v[c];b.zoomrestore.style[d]=x[d]!==void 0?x[d]:""}b.zoomrestore.style.width=b.win.css("width");b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()};D.isios4&&(b.zoomrestore.scrollTop=J.scrollTop(),J.scrollTop(0));b.win.css({position:D.isios4?"absolute":"fixed",top:0,left:0,
zIndex:I+100,margin:0});v=b.win.css("backgroundColor");(""===v||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(v))&&b.win.css("backgroundColor","#fff");b.rail.css({zIndex:I+101});b.zoom.css({zIndex:I+102});b.zoom.css("backgroundPosition","0 -18px");b.resizeZoom();b.onzoomin&&b.onzoomin.call(b);return b.cancelEvent(m)}};this.doZoomOut=function(m){if(b.zoomactive)return b.zoomactive=!1,b.win.css("margin",""),b.win.css(b.zoomrestore.style),D.isios4&&J.scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.zindex}),
b.zoom.css({"z-index":b.zindex}),b.zoomrestore=!1,b.zoom.css("backgroundPosition","0 0"),b.onResize(),b.onzoomout&&b.onzoomout.call(b),b.cancelEvent(m)};this.doZoom=function(m){return b.zoomactive?b.doZoomOut(m):b.doZoomIn(m)};this.resizeZoom=function(){if(b.zoomactive){var m=b.getScrollTop();b.win.css({width:J.width()-b.zoomrestore.padding.w+"px",height:J.height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,m))}};this.init();q.nicescroll.push(this)},ja=function(V){var F=
this;this.nc=V;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.reset=function(e,l){F.stop();F.steptime=0;F.lasttime=Z();F.speedx=0;F.speedy=0;F.lastx=e;F.lasty=l;F.lastscrollx=-1;F.lastscrolly=-1};this.update=function(e,l){var n=Z();F.steptime=n-F.lasttime;F.lasttime=n;n=l-F.lasty;var p=e-F.lastx,y=F.nc.getScrollTop(),N=F.nc.getScrollLeft();y+=n;
N+=p;F.snapx=N<0||N>F.nc.page.maxw;F.snapy=y<0||y>F.nc.page.maxh;F.speedx=p;F.speedy=n;F.lastx=e;F.lasty=l};this.stop=function(){F.nc.unsynched("domomentum2d");F.timer&&clearTimeout(F.timer);F.timer=0;F.lastscrollx=-1;F.lastscrolly=-1};this.doSnapy=function(e,l){var n=!1;l<0?(l=0,n=!0):l>F.nc.page.maxh&&(l=F.nc.page.maxh,n=!0);e<0?(e=0,n=!0):e>F.nc.page.maxw&&(e=F.nc.page.maxw,n=!0);n?F.nc.doScrollPos(e,l,F.nc.opt.snapbackspeed):F.nc.triggerScrollEnd()};this.doMomentum=function(e){var l=Z(),n=e?l+
e:F.lasttime;e=F.nc.getScrollLeft();var p=F.nc.getScrollTop(),y=F.nc.page.maxh,N=F.nc.page.maxw;F.speedx=N>0?Math.min(60,F.speedx):0;F.speedy=y>0?Math.min(60,F.speedy):0;n=n&&l-n<=60;if(p<0||p>y||e<0||e>N)n=!1;e=F.speedx&&n?F.speedx:!1;if(F.speedy&&n&&F.speedy||e){var b=Math.max(16,F.steptime);b>50&&(e=b/50,F.speedx*=e,F.speedy*=e,b=50);F.demulxy=0;F.lastscrollx=F.nc.getScrollLeft();F.chkx=F.lastscrollx;F.lastscrolly=F.nc.getScrollTop();F.chky=F.lastscrolly;var G=F.lastscrollx,A=F.lastscrolly,U=function(){var D=
Z()-l>600?.04:.02;F.speedx&&(G=Math.floor(F.lastscrollx-F.speedx*(1-F.demulxy)),F.lastscrollx=G,G<0||G>N)&&(D=.1);F.speedy&&(A=Math.floor(F.lastscrolly-F.speedy*(1-F.demulxy)),F.lastscrolly=A,A<0||A>y)&&(D=.1);F.demulxy=Math.min(1,F.demulxy+D);F.nc.synched("domomentum2d",function(){F.speedx&&(F.nc.getScrollLeft(),F.chkx=G,F.nc.setScrollLeft(G));F.speedy&&(F.nc.getScrollTop(),F.chky=A,F.nc.setScrollTop(A));F.timer||(F.nc.hideCursor(),F.doSnapy(G,A))});F.demulxy<1?F.timer=setTimeout(U,b):(F.stop(),
F.nc.hideCursor(),F.doSnapy(G,A))};U()}else F.doSnapy(F.nc.getScrollLeft(),F.nc.getScrollTop())}},ra=q.fn.scrollTop;typeof q.cssHooks==="object"&&(q.cssHooks.pageYOffset={get:function(V,F,e){return(F=q.data(V,"__nicescroll")||!1)&&F.ishwscroll?F.getScrollTop():ra.call(V)},set:function(V,F){var e=q.data(V,"__nicescroll")||!1;e&&e.ishwscroll?e.setScrollTop(parseInt(F)):ra.call(V,F);return this}});q.fn.scrollTop=function(V){if(V===void 0){var F=this[0]?q.data(this[0],"__nicescroll")||!1:!1;return F&&
F.ishwscroll?F.getScrollTop():ra.call(this)}return this.each(function(){var e=q.data(this,"__nicescroll")||!1;e&&e.ishwscroll?e.setScrollTop(parseInt(V)):ra.call(q(this),V)})};var ka=q.fn.scrollLeft;typeof q.cssHooks==="object"&&(q.cssHooks.pageXOffset={get:function(V,F,e){return(F=q.data(V,"__nicescroll")||!1)&&F.ishwscroll?F.getScrollLeft():ka.call(V)},set:function(V,F){var e=q.data(V,"__nicescroll")||!1;e&&e.ishwscroll?e.setScrollLeft(parseInt(F)):ka.call(V,F);return this}});q.fn.scrollLeft=function(V){if(V===
void 0){var F=this[0]?q.data(this[0],"__nicescroll")||!1:!1;return F&&F.ishwscroll?F.getScrollLeft():ka.call(this)}return this.each(function(){var e=q.data(this,"__nicescroll")||!1;e&&e.ishwscroll?e.setScrollLeft(parseInt(V)):ka.call(q(this),V)})};var aa=function(V){var F=this;this.length=0;this.name="nicescrollarray";this.each=function(n){q.each(F,n);return F};this.push=function(n){F[F.length]=n;F.length++};this.eq=function(n){return F[n]};if(V)for(var e=0;e<V.length;e++){var l=q.data(V[e],"__nicescroll")||
!1;l&&(this[this.length]=l,this.length++)}return this};(function(V,F,e){for(var l=0,n=F.length;l<n;l++)e(V,F[l])})(aa.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(V,F){V[F]=function(){var e=arguments;return this.each(function(){this[F].apply(this,e)})}});q.fn.getNiceScroll=function(V){return V===void 0?new aa(this):this[V]&&q.data(this[V],"__nicescroll")||!1};if(typeof q.expr==="object"){var pa=q.expr.pseudos||q.expr[":"];pa&&(pa.nicescroll=function(V){return q.data(V,
"__nicescroll")!==void 0})}q.fn.niceScroll=function(V,F){F!==void 0||typeof V!="object"||"jquery"in V||(F=V,V=!1);var e=new aa;this.each(function(){var l=q(this),n=q.extend({},F);if(V){var p=q(V);n.doc=p.length>1?q(V,l):p;n.win=l}"doc"in n&&!("win"in n)&&(n.win=l);p=l.data("__nicescroll")||!1;p||(n.doc=n.doc||l,p=new ba(n,l),l.data("__nicescroll",p));e.push(p)});return e.length===1?e[0]:e};M.NiceScroll={getjQuery:function(){return q}};q.nicescroll||(q.nicescroll=new aa,q.nicescroll.options=ea)})(function(q){var z=
function(){function t(c){return c==null?String(c):ia[Aa.call(c)]||"object"}function u(c){return t(c)=="function"}function E(c){return c!=null&&c==c.window}function I(c){return t(c)=="object"}function w(c){return I(c)&&!E(c)&&Object.getPrototypeOf(c)==Object.prototype}function J(c){var d=!!c&&"length"in c&&c.length,f=x.type(c);return"function"!=f&&!E(c)&&("array"==f||d===0||typeof d=="number"&&d>0&&d-1 in c)}function L(c){return e.call(c,function(d){return d!=null})}function Q(c){return c.replace(/::/g,
"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function R(c){return c in y?y[c]:y[c]=new RegExp("(^|\\s)"+c+"(\\s|$)")}function Y(c,d){return typeof d!="number"||N[Q(c)]?d:d+"px"}function da(c){return"children"in c?l.call(c.children):x.map(c.childNodes,function(d){if(d.nodeType==1)return d})}function Z(c,d){var f,h=c?c.length:0;for(f=0;f<h;f++)this[f]=c[f];this.length=h;this.selector=d||""}function ea(c,d,f){for(aa in d)f&&(w(d[aa])||
za(d[aa]))?(w(d[aa])&&!w(c[aa])&&(c[aa]={}),za(d[aa])&&!za(c[aa])&&(c[aa]=[]),ea(c[aa],d[aa],f)):d[aa]!==ka&&(c[aa]=d[aa])}function na(c,d){return d==null?x(c):x(c).filter(d)}function ca(c,d,f,h){return u(d)?d.call(c,f,h):d}function ba(c,d){var f=c.className||"",h=f&&f.baseVal!==ka;if(d===ka)return h?f.baseVal:f;h?f.baseVal=d:c.className=d}function ja(c){try{return c?c=="true"||(c=="false"?!1:c=="null"?null:+c+""==c?+c:/^[\[\{]/.test(c)?x.parseJSON(c):c):c}catch(d){return c}}function ra(c,d){d(c);
for(var f=0,h=c.childNodes.length;f<h;f++)ra(c.childNodes[f],d)}var ka,aa,pa,V=[],F=V.concat,e=V.filter,l=V.slice,n=q.document,p={},y={},N={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},b=/^\s*<(\w+|!)[^>]*>/,G=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,A=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/^(?:body|html)$/i,D=/([A-Z])/g,fa="val css html text data width height offset".split(" "),ha=n.createElement("table"),qa=n.createElement("tr"),
g={tr:n.createElement("tbody"),tbody:ha,thead:ha,tfoot:ha,td:qa,th:qa,"*":n.createElement("div")},xa=/complete|loaded|interactive/,ma=/^[\w-]*$/,ia={},Aa=ia.toString,oa={},sa=n.createElement("div"),ta={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},za=Array.isArray||function(c){return c instanceof
Array};oa.matches=function(c,d){if(!d||!c||c.nodeType!==1)return!1;var f=c.matches||c.webkitMatchesSelector||c.mozMatchesSelector||c.oMatchesSelector||c.matchesSelector;if(f)return f.call(c,d);var h=c.parentNode;(f=!h)&&(h=sa).appendChild(c);d=~oa.qsa(h,d).indexOf(c);f&&sa.removeChild(c);return d};var m=function(c){return c.replace(/-+(.)?/g,function(d,f){return f?f.toUpperCase():""})};var v=function(c){return e.call(c,function(d,f){return c.indexOf(d)==f})};oa.fragment=function(c,d,f){var h;G.test(c)&&
(h=x(n.createElement(RegExp.$1)));if(!h){c.replace&&(c=c.replace(A,"<$1></$2>"));d===ka&&(d=b.test(c)&&RegExp.$1);d in g||(d="*");var r=g[d];r.innerHTML=""+c;h=x.each(l.call(r.childNodes),function(){r.removeChild(this)})}if(w(f)){var B=x(h);x.each(f,function(H,S){if(fa.indexOf(H)>-1)B[H](S);else B.attr(H,S)})}return h};oa.Z=function(c,d){return new Z(c,d)};oa.isZ=function(c){return c instanceof oa.Z};oa.init=function(c,d){if(c)if(typeof c=="string")if(c=c.trim(),c[0]=="<"&&b.test(c))d=oa.fragment(c,
RegExp.$1,d),c=null;else{if(d!==ka)return x(d).find(c);d=oa.qsa(n,c)}else{if(u(c))return x(n).ready(c);if(oa.isZ(c))return c;if(za(c))d=L(c);else if(I(c))d=[c],c=null;else if(b.test(c))d=oa.fragment(c.trim(),RegExp.$1,d),c=null;else{if(d!==ka)return x(d).find(c);d=oa.qsa(n,c)}}else return oa.Z();return oa.Z(d,c)};var x=function(c,d){return oa.init(c,d)};x.extend=function(c){var d=l.call(arguments,1);if(typeof c=="boolean"){var f=c;c=d.shift()}d.forEach(function(h){ea(c,h,f)});return c};oa.qsa=function(c,
d){var f,h=d[0]=="#",r=!h&&d[0]==".",B=h||r?d.slice(1):d,H=ma.test(B);return c.getElementById&&H&&h?(f=c.getElementById(B))?[f]:[]:c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11?[]:l.call(H&&!h&&c.getElementsByClassName?r?c.getElementsByClassName(B):c.getElementsByTagName(d):c.querySelectorAll(d))};x.contains=n.documentElement.contains?function(c,d){return c!==d&&c.contains(d)}:function(c,d){for(;d&&=d.parentNode;)if(d===c)return!0;return!1};x.type=t;x.isFunction=u;x.isWindow=E;x.isArray=za;x.isPlainObject=
w;x.isEmptyObject=function(c){for(var d in c)return!1;return!0};x.isNumeric=function(c){var d=Number(c),f=typeof c;return c!=null&&f!="boolean"&&(f!="string"||c.length)&&!isNaN(d)&&isFinite(d)||!1};x.inArray=function(c,d,f){return V.indexOf.call(d,c,f)};x.camelCase=m;x.trim=function(c){return c==null?"":String.prototype.trim.call(c)};x.uuid=0;x.support={};x.expr={};x.noop=function(){};x.map=function(c,d){var f=[],h;if(J(c))for(h=0;h<c.length;h++){var r=d(c[h],h);r!=null&&f.push(r)}else for(h in c)r=
d(c[h],h),r!=null&&f.push(r);return f.length>0?x.fn.concat.apply([],f):f};x.each=function(c,d){var f;if(J(c))for(f=0;f<c.length&&d.call(c[f],f,c[f])!==!1;f++);else for(f in c)if(d.call(c[f],f,c[f])===!1)break;return c};x.grep=function(c,d){return e.call(c,d)};q.JSON&&(x.parseJSON=JSON.parse);x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(c,d){ia["[object "+d+"]"]=d.toLowerCase()});x.data=function(c,d,f){if(f===ka)return typeof c[d]!=="undefined"?c[d]:ka;
f===null?delete c[d]:c[d]=f};x.fn={jquery:"1.2.0",constructor:oa.Z,length:0,forEach:V.forEach,reduce:V.reduce,push:V.push,sort:V.sort,splice:V.splice,indexOf:V.indexOf,concat:function(){var c,d=[];for(c=0;c<arguments.length;c++){var f=arguments[c];d[c]=oa.isZ(f)?f.toArray():f}return F.apply(oa.isZ(this)?this.toArray():this,d)},map:function(c){return x(x.map(this,function(d,f){return c.call(d,f,d)}))},slice:function(){return x(l.apply(this,arguments))},ready:function(c){xa.test(n.readyState)&&n.body?
c(x):n.addEventListener("DOMContentLoaded",function(){c(x)},!1);return this},get:function(c){return c===ka?l.call(this):this[c>=0?c:c+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(c){V.every.call(this,function(d,f){return c.call(d,f,d)!==!1});return this},filter:function(c){return u(c)?this.not(this.not(c)):x(e.call(this,function(d){return oa.matches(d,
c)}))},add:function(c,d){return x(v(this.concat(x(c,d))))},is:function(c){return c===":visible"?this.length>0?this.css("display")!=="none":!1:I(c)?this[0]===c?!0:!1:this.length>0&&oa.matches(this[0],c)},not:function(c){var d=[];if(u(c)&&c.call!==ka)this.each(function(h){c.call(this,h)||d.push(this)});else{var f=typeof c=="string"?this.filter(c):J(c)&&u(c.item)?l.call(c):x(c);this.forEach(function(h){f.indexOf(h)<0&&d.push(h)})}return x(d)},has:function(c){return this.filter(function(){return I(c)?
x.contains(this,c):x(this).find(c).size()})},eq:function(c){return c===-1?this.slice(c):this.slice(c,+c+1)},first:function(){var c=this[0];return c&&!I(c)?c:x(c)},last:function(){var c=this[this.length-1];return c&&!I(c)?c:x(c)},find:function(c){var d=this;return c?typeof c=="object"?x(c).filter(function(){var f=this;return V.some.call(d,function(h){return x.contains(h,f)})}):this.length==1?x(oa.qsa(this[0],c)):this.map(function(){return oa.qsa(this,c)}):x()},closest:function(c,d){var f=[],h=typeof c==
"object"&&x(c);this.each(function(r,B){for(;B&&!(h?h.indexOf(B)>=0:oa.matches(B,c));)B=B!==d&&!(B!=null&&B.nodeType==B.DOCUMENT_NODE)&&B.parentNode;B&&f.indexOf(B)<0&&f.push(B)});return x(f)},parents:function(c){for(var d=[],f=this;f.length>0;)f=x.map(f,function(h){if((h=h.parentNode)&&(h==null||h.nodeType!=h.DOCUMENT_NODE)&&d.indexOf(h)<0)return d.push(h),h});return na(d,c)},parent:function(c){return na(v(this.pluck("parentNode")),c)},children:function(c){return na(this.map(function(){return da(this)}),
c)},contents:function(){return this.map(function(){return this.contentDocument||l.call(this.childNodes)})},siblings:function(c){return na(this.map(function(d,f){return e.call(da(f.parentNode),function(h){return h!==f})}),c)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(c){return x.map(this,function(d){return d[c]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display="");if(getComputedStyle(this,"").getPropertyValue("display")==
"none"){var c=this.style,d=this.nodeName;if(!p[d]){var f=n.createElement(d);n.body.appendChild(f);var h=getComputedStyle(f,"").getPropertyValue("display");f.parentNode.removeChild(f);h=="none"&&(h="block");p[d]=h}c.display=p[d]}})},replaceWith:function(c){return this.before(c).remove()},wrap:function(c){var d=u(c);if(this[0]&&!d)var f=x(c).get(0),h=f.parentNode||this.length>1;return this.each(function(r){x(this).wrapAll(d?c.call(this,r):h?f.cloneNode(!0):f)})},wrapAll:function(c){if(this[0]){x(this[0]).before(c=
x(c));for(var d;(d=c.children()).length;)c=d.first();x(c).append(this)}return this},wrapInner:function(c){var d=u(c);return this.each(function(f){var h=x(this),r=h.contents();f=d?c.call(this,f):c;r.length?r.wrapAll(f):h.append(f)})},unwrap:function(){this.parent().each(function(){x(this).replaceWith(x(this).children())});return this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(c){return this.each(function(){var d=
x(this);(c===ka?d.css("display")=="none":c)?d.show():d.hide()})},prev:function(c){return x(this.pluck("previousElementSibling")).filter(c||"*")},next:function(c){return x(this.pluck("nextElementSibling")).filter(c||"*")},html:function(c){return 0 in arguments?this.each(function(d){var f=this.innerHTML;x(this).empty().append(ca(this,c,d,f))}):0 in this?this[0].innerHTML:null},text:function(c){return 0 in arguments?this.each(function(d){d=ca(this,c,d,this.textContent);this.textContent=d==null?"":""+
d}):0 in this?this.pluck("textContent").join(""):null},attr:function(c,d){var f;return typeof c!="string"||1 in arguments?this.each(function(h){if(this.nodeType===1)if(I(c))for(aa in c){var r=aa;h=c[aa];h==null?this.removeAttribute(r):this.setAttribute(r,h)}else r=c,h=ca(this,d,h,this.getAttribute(c)),h==null?this.removeAttribute(r):this.setAttribute(r,h)}):0 in this&&this[0].nodeType==1&&(f=this[0].getAttribute(c))!=null?f:ka},removeAttr:function(c){return this.each(function(){this.nodeType===1&&
c.split(" ").forEach(function(d){this.removeAttribute(d)},this)})},prop:function(c,d){c=ta[c]||c;return 1 in arguments?this.each(function(f){this[c]=ca(this,d,f,this[c])}):this[0]&&this[0][c]},removeProp:function(c){c=ta[c]||c;return this.each(function(){delete this[c]})},data:function(c,d){if(typeof d==="object")this.length&&(this[0][c]=d);else{if(typeof d==="undefined"){if(this.length&&typeof this[0][c]!=="undefined")return this[0][c]}else this.length&&(typeof this[0][c]!=="undefined"&&delete this[0][c],
d&&(this[0][c]=d));var f="data-"+c.replace(D,"-$1").toLowerCase();f=1 in arguments?this.attr(f,d):this.attr(f);return f!==null?ja(f):ka}},val:function(c){return 0 in arguments?(c==null&&(c=""),this.each(function(d){this.value=ca(this,c,d,this.value)})):this[0]&&(this[0].multiple?x(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(c){if(c)return this.each(function(f){var h=x(this);f=ca(this,c,f,h.offset());var r=h.offsetParent().offset();
f={top:f.top-r.top,left:f.left-r.left};h.css("position")=="static"&&(f.position="relative");h.css(f)});if(!this.length)return null;if(n.documentElement!==this[0]&&!x.contains(n.documentElement,this[0]))return{top:0,left:0};var d=this[0].getBoundingClientRect();return{left:d.left+q.pageXOffset,top:d.top+q.pageYOffset,width:Math.round(d.width),height:Math.round(d.height)}},css:function(c,d){if(arguments.length<2){var f=this[0];if(typeof c=="string")return f?f.style[m(c)]||getComputedStyle(f,"").getPropertyValue(c):
void 0;if(za(c)){if(!f)return;var h={},r=getComputedStyle(f,"");x.each(c,function(H,S){h[S]=f.style[m(S)]||r.getPropertyValue(S)});return h}}var B="";if(t(c)=="string")d||d===0?B=Q(c)+":"+Y(c,d):this.each(function(){this.style.removeProperty(Q(c))});else for(aa in c)c[aa]||c[aa]===0?B+=Q(aa)+":"+Y(aa,c[aa])+";":this.each(function(){this.style.removeProperty(Q(aa))});return this.each(function(){this.style.cssText+=";"+B})},index:function(c){return c?this.indexOf(x(c)[0]):this.parent().children().indexOf(this[0])},
hasClass:function(c){return c?V.some.call(this,function(d){return this.test(ba(d))},R(c)):!1},addClass:function(c){return c?this.each(function(d){if("className"in this){pa=[];var f=ba(this);ca(this,c,d,f).split(/\s+/g).forEach(function(h){x(this).hasClass(h)||pa.push(h)},this);pa.length&&ba(this,f+(f?" ":"")+pa.join(" "))}}):this},removeClass:function(c){return this.each(function(d){if("className"in this){if(c===ka)return ba(this,"");pa=ba(this);ca(this,c,d,pa).split(/\s+/g).forEach(function(f){pa=
pa.replace(R(f)," ")});ba(this,pa.trim())}})},toggleClass:function(c,d){return c?this.each(function(f){var h=x(this);ca(this,c,f,ba(this)).split(/\s+/g).forEach(function(r){(d===ka?!h.hasClass(r):d)?h.addClass(r):h.removeClass(r)})}):this},scrollTop:function(c){if(this.length){var d="scrollTop"in this[0];return c===ka?d?this[0].scrollTop:this[0].pageYOffset:this.each(d?function(){this.scrollTop=c}:function(){this.scrollTo(this.scrollX,c)})}},scrollLeft:function(c){if(this.length){var d="scrollLeft"in
this[0];return c===ka?d?this[0].scrollLeft:this[0].pageXOffset:this.each(d?function(){this.scrollLeft=c}:function(){this.scrollTo(c,this.scrollY)})}},position:function(){if(this.length){var c=this[0],d=this.offsetParent(),f=this.offset(),h=U.test(d[0].nodeName)?{top:0,left:0}:d.offset();f.top-=parseFloat(x(c).css("margin-top"))||0;f.left-=parseFloat(x(c).css("margin-left"))||0;h.top+=parseFloat(x(d[0]).css("border-top-width"))||0;h.left+=parseFloat(x(d[0]).css("border-left-width"))||0;return{top:f.top-
h.top,left:f.left-h.left}}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||n.body;c&&!U.test(c.nodeName)&&x(c).css("position")=="static";)c=c.offsetParent;return c})}};x.fn.detach=x.fn.remove;["width","height"].forEach(function(c){var d=c.replace(/./,function(f){return f[0].toUpperCase()});x.fn[c]=function(f){var h,r=this[0];return f===ka?E(r)?r["inner"+d]:r!=null&&r.nodeType==r.DOCUMENT_NODE?r.documentElement["scroll"+d]:(h=this.offset())&&h[c]:this.each(function(B){r=
x(this);r.css(c,ca(this,f,B,r[c]()))})}});x.fn.innerWidth=function(){return this.width()};x.fn.innerHeight=function(){return this.height()};["after","prepend","before","append"].forEach(function(c,d){var f=d%2;x.fn[c]=function(){var h,r=x.map(arguments,function(S){var K=[];h=t(S);return h=="array"?(S.forEach(function(P){if(P.nodeType!==ka)return K.push(P);if(x.zepto.isZ(P))return K=K.concat(P.get());K=K.concat(oa.fragment(P))}),K):h=="object"||S==null?S:oa.fragment(S)}),B,H=this.length>1;return r.length<
1?this:this.each(function(S,K){B=f?K:K.parentNode;K=d==0?K.nextSibling:d==1?K.firstChild:d==2?K:null;var P=x.contains(n.documentElement,B);r.forEach(function(T){if(H)T=T.cloneNode(!0);else if(!B)return x(T).remove();B.insertBefore(T,K);P&&ra(T,function(X){if(!(X.nodeName==null||X.nodeName.toUpperCase()!=="SCRIPT"||X.type&&X.type!=="text/javascript"||X.src)){var C=X.ownerDocument?X.ownerDocument.defaultView:q;C.eval.call(C,X.innerHTML)}})})})};x.fn[f?c+"To":"insert"+(d?"Before":"After")]=function(h){x(h)[c](this);
return this}});oa.Z.prototype=Z.prototype=x.fn;oa.uniq=v;oa.deserializeValue=ja;x.zepto=oa;return x}();q.mQuery=z;q.$$===void 0&&(q.$$=z);(function(t){function u(e){return e._zid||(e._zid=Y++)}function E(e,l,n,p){l=I(l);if(l.ns)var y=new RegExp("(?:^| )"+l.ns.replace(" "," .* ?")+"(?: |$)");return(ca[u(e)]||[]).filter(function(N){return N&&(!l.e||N.e==l.e)&&(!l.ns||y.test(N.ns))&&(!n||u(N.fn)===u(n))&&(!p||N.sel==p)})}function I(e){e=(""+e).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}
function w(e){return ka[e]||ja&&ra[e]||e}function J(e,l,n,p,y,N,b){var G=u(e),A=ca[G]||(ca[G]=[]);l.split(/\s/).forEach(function(U){if(U=="ready")return t(document).ready(n);var D=I(U);D.fn=n;D.sel=y;D.e in ka&&(n=function(ha){var qa=ha.relatedTarget;if(!qa||qa!==this&&!t.contains(this,qa))return D.fn.apply(this,arguments)});var fa=(D.del=N)||n;D.proxy=function(ha){ha=Q(ha);if(!ha.isImmediatePropagationStopped()){ha.data=p;var qa=fa.apply(e,ha._args==da?[ha]:[ha].concat(ha._args));qa===!1&&(ha.preventDefault(),
ha.stopPropagation());return qa}};D.i=A.length;A.push(D);"addEventListener"in e&&e.addEventListener(w(D.e),D.proxy,D.del&&!ja&&D.e in ra||!!b)})}function L(e,l,n,p,y){var N=u(e);(l||"").split(/\s/).forEach(function(b){E(e,b,n,p).forEach(function(G){delete ca[N][G.i];"removeEventListener"in e&&e.removeEventListener(w(G.e),G.proxy,G.del&&!ja&&G.e in ra||!!y)})})}function Q(e,l){if(l||!e.isDefaultPrevented)if(l||=e,t.each(F,function(n,p){var y=l[n];e[n]=function(){this[p]=aa;return y&&y.apply(l,arguments)};
e[p]=pa}),e.timeStamp||(e.timeStamp=Date.now()),l.defaultPrevented!==da?l.defaultPrevented:"returnValue"in l?l.returnValue===!1:l.getPreventDefault&&l.getPreventDefault())e.isDefaultPrevented=aa;return e}function R(e){var l,n={originalEvent:e};for(l in e)V.test(l)||e[l]===da||(n[l]=e[l]);return Q(n,e)}var Y=1,da,Z=Array.prototype.slice,ea=t.isFunction,na=function(e){return typeof e=="string"},ca={},ba={},ja="onfocusin"in q,ra={focus:"focusin",blur:"focusout"},ka={mouseenter:"mouseover",mouseleave:"mouseout"};
ba.click=ba.mousedown=ba.mouseup=ba.mousemove="MouseEvents";t.event={add:J,remove:L};t.proxy=function(e,l){var n=2 in arguments&&Z.call(arguments,2);if(ea(e)){var p=function(){return e.apply(l,n?n.concat(Z.call(arguments)):arguments)};p._zid=u(e);return p}if(na(l))return n?(n.unshift(e[l],e),t.proxy.apply(null,n)):t.proxy(e[l],e);throw new TypeError("expected function");};t.fn.bind=function(e,l,n){return this.on(e,l,n)};t.fn.unbind=function(e,l){return this.off(e,l)};t.fn.one=function(e,l,n,p){return this.on(e,
l,n,p,1)};var aa=function(){return!0},pa=function(){return!1},V=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,F={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(e,l,n){return this.on(l,e,n)};t.fn.undelegate=function(e,l,n){return this.off(l,e,n)};t.fn.live=function(e,l){t(document.body).delegate(this.selector,e,l);return this};t.fn.die=function(e,l){t(document.body).undelegate(this.selector,
e,l);return this};t.fn.on=function(e,l,n,p,y){var N,b,G=this;if(e&&!na(e))return t.each(e,function(A,U){G.on(A,l,n,U,y)}),G;na(l)||ea(p)||p===!1||(p=n,n=l,l=da);if(p===da||n===!1)p=n,n=da;p===!1&&(p=pa);return G.each(function(A,U){y&&(N=function(D){L(U,D.type,p);return p.apply(this,arguments)});l&&(b=function(D){var fa=t(D.target).closest(l,U).get(0);if(fa&&fa!==U){var ha=t.extend(R(D),{currentTarget:fa,liveFired:U});return(N||p).apply(fa,[ha].concat(Z.call(arguments,1)))}});J(U,e,p,n,l,b||N)})};
t.fn.off=function(e,l,n){var p=this;if(e&&!na(e))return t.each(e,function(y,N){p.off(y,l,N)}),p;na(l)||ea(n)||n===!1||(n=l,l=da);n===!1&&(n=pa);return p.each(function(){L(this,e,n,l)})};t.fn.trigger=function(e,l){e=na(e)||t.isPlainObject(e)?t.Event(e):Q(e);e._args=l;return this.each(function(){if(e.type in ra&&typeof this[e.type]=="function")this[e.type]();else"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,l)})};t.fn.triggerHandler=function(e,l){var n,p;this.each(function(y,
N){n=R(na(e)?t.Event(e):e);n._args=l;n.target=N;t.each(E(N,e.type||e),function(b,G){p=G.proxy(n);if(n.isImmediatePropagationStopped())return!1})});return p};"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(l){return 0 in arguments?this.bind(e,l):this.trigger(e)}});t.Event=function(e,l){na(e)||(l=e,e=l.type);var n=document.createEvent(ba[e]||
"Events"),p=!0;if(l)for(var y in l)y=="bubbles"?p=!!l[y]:n[y]=l[y];n.initEvent(e,p,!0);return Q(n)}})(z);(function(t){["width","height"].forEach(function(u){var E=u.replace(/./,function(I){return I[0].toUpperCase()});t.fn["outer"+E]=function(I){var w=this;if(w){var J=w[u]();({width:["left","right"],height:["top","bottom"]})[u].forEach(function(L){I&&(J+=parseInt(w.css("margin-"+L),10))});return J}return null}})})(z);(function(t){function u(e,l,n,p){if(e.global)return e=l||ca,n=t.Event(n),t(e).trigger(n,
p),!n.isDefaultPrevented()}function E(e){e.global&&t.active++===0&&u(e,null,"ajaxStart")}function I(e,l){var n=l.context;if(l.beforeSend.call(n,e,l)===!1||u(l,n,"ajaxBeforeSend",[e,l])===!1)return!1;u(l,n,"ajaxSend",[e,l])}function w(e,l,n,p){var y=n.context;n.success.call(y,e,"success",l);p&&p.resolveWith(y,[e,"success",l]);u(n,y,"ajaxSuccess",[l,n,e]);L("success",l,n)}function J(e,l,n,p,y){var N=p.context;p.error.call(N,n,l,e);y&&y.rejectWith(N,[n,l,e]);u(p,N,"ajaxError",[n,p,e||l]);L(l,n,p)}function L(e,
l,n){var p=n.context;n.complete.call(p,l,e);u(n,p,"ajaxComplete",[l,n]);n.global&&!--t.active&&u(n,null,"ajaxStop")}function Q(){}function R(e){e&&=e.split(";",2)[0];return e&&(e=="text/html"?"html":e=="application/json"?"json":ka.test(e)?"script":aa.test(e)&&"xml")||"text"}function Y(e,l){return l==""?e:(e+"&"+l).replace(/[&?]{1,2}/,"?")}function da(e){e.processData&&e.data&&t.type(e.data)!="string"&&(e.data=t.param(e.data,e.traditional));!e.data||e.type&&e.type.toUpperCase()!="GET"&&"jsonp"!=e.dataType||
(e.url=Y(e.url,e.data),e.data=void 0)}function Z(e,l,n,p){t.isFunction(l)&&(p=n,n=l,l=void 0);t.isFunction(n)||(p=n,n=void 0);return{url:e,data:l,success:n,dataType:p}}function ea(e,l,n,p){var y,N=t.isArray(l),b=t.isPlainObject(l);t.each(l,function(G,A){y=t.type(A);p&&(G=n?p:p+"["+(b||y=="object"||y=="array"?G:"")+"]");!p&&N?e.add(A.name,A.value):y=="array"||!n&&y=="object"?ea(e,A,n,G):e.add(G,A)})}var na=+new Date,ca=q.document,ba,ja,ra=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,ka=/^(?:text|application)\/javascript/i,
aa=/^(?:text|application)\/xml/i,pa=/^\s*$/,V=ca.createElement("a");V.href=q.location.href;t.active=0;t.ajaxJSONP=function(e,l){if(!("type"in e))return t.ajax(e);var n=e.jsonpCallback,p=(t.isFunction(n)?n():n)||"Zepto"+na++,y=ca.createElement("script"),N=q[p],b,G=function(D){t(y).triggerHandler("error",D||"abort")},A={abort:G},U;l&&l.promise(A);t(y).on("load error",function(D,fa){clearTimeout(U);t(y).off().remove();D.type!="error"&&b?w(b[0],A,e,l):J(null,fa||"error",A,e,l);q[p]=N;b&&t.isFunction(N)&&
N(b[0]);N=b=void 0});if(I(A,e)===!1)return G("abort"),A;q[p]=function(){b=arguments};y.src=e.url.replace(/\?(.+)=\?/,"?$1="+p);ca.head.appendChild(y);e.timeout>0&&(U=setTimeout(function(){G("timeout")},e.timeout));return A};t.ajaxSettings={type:"GET",beforeSend:Q,success:Q,error:Q,complete:Q,context:null,global:!0,xhr:function(){return new q.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",
text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:Q};t.ajax=function(e){var l=t.extend({},e||{}),n=t.Deferred&&t.Deferred();for(ba in t.ajaxSettings)l[ba]===void 0&&(l[ba]=t.ajaxSettings[ba]);E(l);if(!l.crossDomain){var p=ca.createElement("a");p.href=l.url;p.href=p.href;l.crossDomain=V.protocol+"//"+V.host!==p.protocol+"//"+p.host}l.url||(l.url=q.location.toString());(p=l.url.indexOf("#"))>-1&&(l.url=l.url.slice(0,p));da(l);var y=l.dataType;(p=/\?.+=\?/.test(l.url))&&
(y="jsonp");l.cache!==!1&&(e&&e.cache===!0||"script"!=y&&"jsonp"!=y)||(l.url=Y(l.url,"_="+Date.now()));if("jsonp"==y)return p||(l.url=Y(l.url,l.jsonp?l.jsonp+"=?":l.jsonp===!1?"":"callback=?")),t.ajaxJSONP(l,n);e=l.accepts[y];var N={};p=function(D,fa){N[D.toLowerCase()]=[D,fa]};var b=/^([\w-]+:)\/\//.test(l.url)?RegExp.$1:q.location.protocol,G=l.xhr(),A=G.setRequestHeader,U;n&&n.promise(G);l.crossDomain||p("X-Requested-With","XMLHttpRequest");p("Accept",e||"*/*");if(e=l.mimeType||e)e.indexOf(",")>
-1&&(e=e.split(",",2)[0]),G.overrideMimeType&&G.overrideMimeType(e);(l.contentType||l.contentType!==!1&&l.data&&l.type.toUpperCase()!="GET")&&p("Content-Type",l.contentType||"application/x-www-form-urlencoded");if(l.headers)for(ja in l.headers)p(ja,l.headers[ja]);G.setRequestHeader=p;G.onreadystatechange=function(){if(G.readyState==4){G.onreadystatechange=Q;clearTimeout(U);var D=!1;if(G.status>=200&&G.status<300||G.status==304||G.status==0&&b=="file:"){y=y||R(l.mimeType||G.getResponseHeader("content-type"));
if(G.responseType=="arraybuffer"||G.responseType=="blob")var fa=G.response;else{fa=G.responseText;try{fa=l.dataFilter==Q?fa:l.dataFilter.call(l.context,fa,y),y=="script"?(0,eval)(fa):y=="xml"?fa=G.responseXML:y=="json"&&(fa=pa.test(fa)?null:t.parseJSON(fa))}catch(ha){D=ha}if(D)return J(D,"parsererror",G,l,n)}w(fa,G,l,n)}else J(G.statusText||null,G.status?"error":"abort",G,l,n)}};if(I(G,l)===!1)return G.abort(),J(null,"abort",G,l,n),G;G.open(l.type,l.url,"async"in l?l.async:!0,l.username,l.password);
if(l.xhrFields)for(ja in l.xhrFields)G[ja]=l.xhrFields[ja];for(ja in N)A.apply(G,N[ja]);l.timeout>0&&(U=setTimeout(function(){G.onreadystatechange=Q;G.abort();J(null,"timeout",G,l,n)},l.timeout));G.send(l.data?l.data:null);return G};t.get=function(){return t.ajax(Z.apply(null,arguments))};t.post=function(){var e=Z.apply(null,arguments);e.type="POST";return t.ajax(e)};t.getJSON=function(){var e=Z.apply(null,arguments);e.dataType="json";return t.ajax(e)};t.fn.load=function(e,l,n){if(!this.length)return this;
var p=this,y=e.split(/\s/);e=Z(e,l,n);var N=e.success;if(y.length>1){e.url=y[0];var b=y[1]}e.success=function(G){p.html(b?t("<div>").html(G.replace(ra,"")).find(b):G);N&&N.apply(p,arguments)};t.ajax(e);return this};var F=encodeURIComponent;t.param=function(e,l){var n=[];n.add=function(p,y){t.isFunction(y)&&(y=y());y==null&&(y="");this.push(F(p)+"="+F(y))};ea(n,e,l);return n.join("&").replace(/%20/g,"+")}})(z);(function(t){t.fn.serializeArray=function(){var u,E,I=[],w=function(J){if(J.forEach)return J.forEach(w);
I.push({name:u,value:J})};this[0]&&t.each(this[0].elements,function(J,L){E=L.type;(u=L.name)&&L.nodeName.toLowerCase()!="fieldset"&&!L.disabled&&E!="submit"&&E!="reset"&&E!="button"&&E!="file"&&(E!="radio"&&E!="checkbox"||L.checked)&&w(t(L).val())});return I};t.fn.serialize=function(){var u=[];this.serializeArray().forEach(function(E){u.push(encodeURIComponent(E.name)+"="+encodeURIComponent(E.value))});return u.join("&")};t.fn.submit=function(u){if(0 in arguments)this.bind("submit",u);else if(this.length){var E=
t.Event("submit");this.eq(0).trigger(E);E.isDefaultPrevented()||this.get(0).submit()}return this}})(z);(function(t,u){function E(ka){return w?w+ka:ka.toLowerCase()}var I="",w,J={Webkit:"webkit",Moz:"",O:"o"},L=document.createElement("div"),Q=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,R,Y,da,Z,ea,na,ca,ba,ja={};L.style.transform===u&&t.each(J,function(ka,aa){if(L.style[ka+"TransitionProperty"]!==u)return I="-"+ka.toLowerCase()+"-",w=aa,!1});var ra=I+"transform";ja[R=
I+"transition-property"]=ja[Y=I+"transition-duration"]=ja[Z=I+"transition-delay"]=ja[da=I+"transition-timing-function"]=ja[ea=I+"animation-name"]=ja[na=I+"animation-duration"]=ja[ba=I+"animation-delay"]=ja[ca=I+"animation-timing-function"]="";t.fx={off:w===u&&L.style.transitionProperty===u,speeds:{_default:400,fast:200,slow:600},cssPrefix:I,transitionEnd:E("TransitionEnd"),animationEnd:E("AnimationEnd")};t.fn.animate=function(ka,aa,pa,V,F){t.isFunction(aa)&&(V=aa,aa=pa=u);t.isFunction(pa)&&(V=pa,
pa=u);t.isPlainObject(aa)&&(pa=aa.easing,V=aa.complete,F=aa.delay,aa=aa.duration);aa&&=(typeof aa=="number"?aa:t.fx.speeds[aa]||t.fx.speeds._default)/1E3;F&&=parseFloat(F)/1E3;return this.anim(ka,aa,pa,V,F)};t.fn.anim=function(ka,aa,pa,V,F){var e,l={},n="",p=this,y=t.fx.transitionEnd,N=!1;aa===u&&(aa=t.fx.speeds._default/1E3);F===u&&(F=0);t.fx.off&&(aa=0);if(typeof ka=="string")l[ea]=ka,l[na]=aa+"s",l[ba]=F+"s",l[ca]=pa||"linear",y=t.fx.animationEnd;else{var b=[];for(e in ka)Q.test(e)?n+=e+"("+ka[e]+
") ":(l[e]=ka[e],b.push(e.replace(/([A-Z])/g,"-$1").toLowerCase()));n&&(l[ra]=n,b.push(ra));aa>0&&typeof ka==="object"&&(l[R]=b.join(", "),l[Y]=aa+"s",l[Z]=F+"s",l[da]=pa||"linear")}var G=function(A){if(typeof A!=="undefined"){if(A.target!==A.currentTarget)return;t(A.target).unbind(y,G)}else t(this).unbind(y,G);N=!0;t(this).css(ja);V&&V.call(this)};aa>0&&(this.bind(y,G),setTimeout(function(){N||G.call(p)},(aa+F)*1E3+25));this.size()&&this.get(0).clientLeft;this.css(l);aa<=0&&setTimeout(function(){p.each(function(){G.call(this)})},
0);return this};t.fn.stop=function(ka,aa){return this};L=null})(z);(function(){try{getComputedStyle(void 0)}catch(u){var t=getComputedStyle;q.getComputedStyle=function(E,I){try{return t(E,I)}catch(w){return null}}}})();return z}(M));var Ga=function(){if(document.currentScript)var q=document.currentScript.src;else{q=document.scripts;for(var z=q.length-1,t,u=z;u>0;u--)if(q[u].readyState==="interactive"){t=q[u].src;break}q=t||q[z].src}z=q.indexOf("v=");z=z>0?q.substr(z+2):2023;q=q.substring(0,q.lastIndexOf("/")+
1);q.endsWith("zwplayer/")||(q+="js/");return{path:q,v:z}}(),La=Ga.path+"plugins/",Ma=function(q,z,t){var u=document.getElementsByTagName("head");if(u.length==0){u=document.createElement("head");var E=document.getElementsByTagName("body");if(E.length>0)E=E[0],document.insertBefore(u,E);else return alert("Invalid html document: no HEAD tag"),!1}else{u=u[0];E=u.childNodes;for(var I=0;I<E.length;I++){var w=E[I];if(w.nodeName.toUpperCase()==="SCRIPT"&&w.id&&w.id==q){if(w.getAttribute("loadstate")!="true"){var J=
function(){w.getAttribute("loadstate")!="true"?setTimeout(J,50):typeof t=="function"&&t(q)};setTimeout(J,50);return!1}typeof t=="function"&&t(q);return!0}}}var L=document.createElement("script");L.type="text/javascript";L.readyState?L.onreadystatechange=function(){if(L.readyState=="loaded"||L.readyState=="complete")L.onreadystatechange=null,L.setAttribute("loadstate","true"),typeof t=="function"&&t(q)}:L.onload=function(){L.setAttribute("loadstate","true");typeof t=="function"&&t(q)};L.id=q;L.src=
z;u.appendChild(L);return!1};(function(q,z,t){var u=document.getElementsByTagName("head");if(u.length==0){u=document.createElement("head");var E=document.getElementsByTagName("body");if(E.length>0)E=E[0],document.insertBefore(u,E);else return alert("Invalid html document: no HEAD tag found"),!1}else{u=u[0];E=u.childNodes;for(var I=0;I<E.length;I++){var w=E[I];if(w.nodeName.toUpperCase()==="link"&&w.id&&w.id==q){if(w.getAttribute("loadstate")!=="true"){var J=function(){w.getAttribute("loadstate")!==
"true"?setTimeout(J,50):typeof t==="function"&&t(q)};setTimeout(J,50);return!1}typeof t==="function"&&t(q);return!0}}}var L=document.createElement("link");L.type="text/css";L.setAttribute("rel","stylesheet");L.readyState?L.onreadystatechange=function(){if(L.readyState=="loaded"||L.readyState=="complete")L.onreadystatechange=null,L.setAttribute("loadstate","true"),typeof t=="function"&&t(q)}:L.onload=function(){L.setAttribute("loadstate","true");typeof t=="function"&&t(q)};L.id=q;L.href=z;u.appendChild(L);
return!1})("zwplayer-css",Ga.path+"css/zwplayer.css?v="+Ga.v,function(q){});var Ya=function(q){return typeof HTMLElement==="object"?q instanceof HTMLElement:!(!q||typeof q!=="object"||q.nodeType!==1&&q.nodeType!==9||typeof q.nodeName!=="string")};Array.isArray||(Array.isArray=function(q){return Object.prototype.toString.call(q)==="[object Array]"});var Qa=/iPhone|iPad|iPod/.test(navigator.userAgent);(function(q){q+="=";for(var z=document.cookie.split(";"),t=0;t<z.length;t++){var u=z[t].trim();if(u.indexOf(q)==
0)return u.substring(q.length,u.length)}return""})("ZWPlayer")||gb("ZWPlayer","V1.0",365);var nb=function(q){for(var z=navigator.languages&&navigator.languages.length?navigator.languages:[navigator.language],t=0;t<q.length;t++)for(var u=0;u<z.length;u++)if(q[t].lang&&z[u]&&z[u].indexOf(q[t].lang)>-1)return q[t].text;return q.length===1?q[0].text:null};HUAYI={};HUAYI.Danmu=function(){var q={playerObj:null,opacity:70,onInit:null,onClose:null,onResize:null};return{create:function(z){var t={};for(k in q)t[k]=
q[k];for(k in z)t[k]=z[k];typeof t.playerId=="undefined"&&(t.playerId="video-body");return new function(u){u=u.playerId;this.rows=[];this.timerId=this.rowCount=0;this.frameDuration=40;this.Danmulayer=null;this.danmuMargin=50;this.speedX=100;this.hasTransition=!0;this.rowHeight=28;this.topMargin=10;this.layerHeight=this.layerWidth=0;this.fontSize="25px";if(typeof u=="string")this.vPlayer=document.getElementById(u);else if(typeof u=="object")this.vPlayer=u;else return;this.vPlayer||(this.vPlayer=document.getElementById("video-body"));
if(this.vPlayer&&(u=this.vPlayer.childNodes,u.length>0))for(var E=0;E<u.length;E++){var I=u[E];if(I.nodeName=="DIV"&&Ua(I.className,"danmuplayer")){this.wrapObj=I;break}}if(this.wrapObj){if(u=this.wrapObj.childNodes,u.length>0)for(E=0;E<u.length;E++)if(I=u[E],I.nodeName=="DIV"&&Ua(I.className,"danmu-layer")){this.Danmulayer=I;break}}else this.wrapObj=document.createElement("div"),this.wrapObj.className="danmuplayer",this.vPlayer.appendChild(this.wrapObj),this.Danmulayer=document.createElement("div"),
this.Danmulayer.className="danmu-layer",this.wrapObj.appendChild(this.Danmulayer),Na.ie&&Na.ver<9&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");if(this.Danmulayer){this.hasTransition=typeof this.Danmulayer.style.transition!="undefined";this.rowCount=Math.floor(Math.floor((this.Danmulayer.offsetHeight-this.topMargin)*2/3)/this.rowHeight);if(this.rowCount>0)for(E=0;E<this.rowCount;E++)this.rows.push({top:this.topMargin+this.rowHeight*E,count:0,last:null,idx:E});this.layerWidth=this.Danmulayer.offsetWidth;
this.layerHeight=this.Danmulayer.offsetHeight;Da.addElement(this.Danmulayer);this.Danmulayer.addEventListener("resize",function(w){this.reCalcLayout()}.bind(this))}this.start=function(w){this.timerId&&(clearInterval(this.timerId),this.timerId=0);if(!this.hasTransition){var J=this;this.timerId=setInterval(function(){var L=J.Danmulayer,Q=L.childNodes;if(Q.length>0){for(var R=[],Y=0;Y<Q.length;Y++){var da=Q[Y];if(da.tagName=="DIV"){var Z=parseFloat(da.style.left);Z+da.offsetWidth<0?R.push(da):da.style.left=
Z-4.5+"px"}}if(R.length>0){for(Y=0;Y<R.length;Y++)Q=R[Y],Q.rowIdx&&(J.rows[Q.rowIdx].last==this&&(J.rows[Q.rowIdx].last=null),J.rows[Q.rowIdx].count--),L.removeChild(R[Y]);R.splice(0,R.length)}}},this.frameDuration)}};this.stop=function(){this.timerId&&(clearInterval(this.timerId),this.timerId=0);var w=this.Danmulayer.childNodes;if(w.length>0)for(var J=0;J<w.length;J++)w[J].style.display="none";this.Danmulayer.style.display="none"};this.destroy=function(){this.Danmulayer&&(Da.removeElement(this.Danmulayer),
delete this.Danmulayer);this.timerId&&(clearInterval(this.timerId),this.timerId=0);this.wrapObj&&this.vPlayer&&this.vPlayer.removeChild(this.wrapObj)};this.addDanmu=function(w,J){J||={};var L=document.createElement("div");L.className="danmu";typeof w.color=="undefined"||J.isFilterColorFont||(L.style.color=w.color);typeof w.border!="undefined"&&(L.style.border="1px solid #666");L.style.fontSize=J.forcedFontSizeValue?parseInt(25*J.forcedFontSizeValue/100)+"px":"25px";this.fontSize!=L.style.fontSize&&
(this.rowHeight=parseInt(L.style.fontSize)+3,this.layerHeight=0,this.reCalcLayout(),this.fontSize=L.style.fontSize);w.outlineColor&&(L.style.outlineStyle="solid",L.style.outlineWidth="2px",L.style.outlineColor=w.outlineColor);L.style.opacity=J.opacityValue?J.opacityValue/100:"0.9";L.innerHTML=typeof M.replaceSmileDanmu=="function"?M.replaceSmileDanmu(w.text,this.rowHeight,J):w.text;var Q=w=0,R=999999;this.rowCount>this.rows.length&&(this.rowCount=this.rows.length);for(;w<this.rowCount;w++)if(this.rows[w].count==
0){Q=w;R=this.layerWidth;break}else if(this.rows[w].last){var Y=this.rows[w].last;Y=Y.getBoundingClientRect().left+Y.offsetWidth+this.danmuMargin;if(Y<R&&(Q=w,R=Y,R<this.layerWidth))break}R<this.layerWidth&&(R=this.layerWidth);L.style.fontFamily='SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif';L.style.textShadow="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";L.style.cursor="pointer";L.style.left=R+"px";L.style.top=this.rows[Q].top+
"px";L.rowIdx=Q;this.rows[Q].last=L;this.rows[Q].count++;this.Danmulayer.appendChild(L);var da=this;L.onmouseover=function(Z){this.pause||(this.pause=!0)};L.onmouseout=function(Z){this.pause&&(this.pause=!1)};this.hasTransition&&(L.addEventListener("transitionend",function(){typeof this.rowIdx=="number"&&(da.rows[this.rowIdx].last==this&&(da.rows[this.rowIdx].last=null),da.rows[this.rowIdx].count--);da.Danmulayer.removeChild(this)}),w=R+L.offsetWidth,J.speedValue?(J=parseInt(this.speedX*parseFloat(J.speedValue)),
J==0&&(J=1),J=w/J+4*Math.random()):J=w/this.speedX+4*Math.random(),L.style.transition="transform "+J+"s linear",L.style.transform="translateX(-"+w+"px)")};this.reCalcLayout=function(){if(this.Danmulayer){Na.ie&&Na.ver<9&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");var w=this.Danmulayer.offsetHeight;if(w!=this.layerHeight){this.rowCount=Math.floor(Math.floor((w-this.topMargin)*2/3)/this.rowHeight);if(this.rowCount>0)if(this.rowCount>this.rows.length)for(var J=this.rows.length;J<this.rowCount;J++)this.rows.push({top:this.topMargin+
this.rowHeight*J,count:0,last:null,idx:J});else for(J=0;J<this.rowCount;J++)this.rows[J].top=this.topMargin+this.rowHeight*J;this.layerHeight=w}if(this.Danmulayer.offsetWidth!=this.layerWidth){w=this.Danmulayer.childNodes;if(w.length>0)for(J=0;J<w.length;J++);this.layerWidth=this.Danmulayer.offsetWidth}}};this.hasTransition||this.start()}(t)}}}();var Da={_onResize:function(q){var z=q.target||q.srcElement;if(z=z.__resizeTrigger__?z.__resizeTrigger__:z){var t=z.__z_resizeListeners;if(t)for(var u=t.length,
E=0;E<u;E++){var I=t[E],w=I.handler;(I=I.context)||(I=z);if(w)w.apply(I,[q]);else if(q.type==="resize"||Object.prototype.toString.call(q)==="[object ResizeObserverEntry]")w=document.createEvent("Event"),w.initEvent("resize",!1,!1),z.dispatchEvent(w)}}},addElement:function(q,z,t){var u=q.__z_resizeListeners;if(!u)if(u=[],q.__z_resizeListeners=u,typeof M.ResizeObserver==="function")this.resizeObserver||(this.resizeObserver=new ResizeObserver(function(I){for(var w=0;w<I.length;w++)this._onResize(I[w])}.bind(this))),
this.resizeObserver.observe(q);else{getComputedStyle(q,null).position==="static"&&(q.style.position="relative");var E=document.createElement("object");E.resizer=this;E.__resizeElement__=q;E.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; opacity: 0; pointer-events: none; z-index: -9999;");E.type="text/html";E.data="about:blank";E.onload=function(I){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__;this.contentDocument.defaultView.addEventListener("resize",
this.resizer._onResize)};q.appendChild(E);q.__resizeDetector__=E}u.push({handler:z,context:t})},removeElement:function(q,z,t){var u=q.__z_resizeListeners;if(u){for(var E=u.length,I=0;I<E;I++){var w=u[I];if(w.handler===z&&w.context===t){u.splice(I,1);break}}if(u.length===0){if(z=q.__resizeDetector__)z.contentDocument.defaultView.removeEventListener("resize",this._onResize),q.removeChild(z),delete q.__resizeDetector__;delete q.__z_resizeListeners;this.resizeObserver&&this.resizeObserver.unobserve(q)}}}},
Na=function(){var q,z,t,u,E,I,w=navigator.userAgent.toLowerCase(),J;(J=w.match(/chrome\/([\d.]+)/),J)?q=J[1]:(J=w.match(/firefox\/([\d.]+)/),J)?z=J[1]:(J=w.match(/edge\/([\d.]+)/),J)?t=J[1]:(J=w.match(/rv:([\d.]+)\) like gecko/),J)?u=J[1]:(J=w.match(/msie ([\d.]+)/),J)?u=J[1]:(J=w.match(/opera.([\d.]+)/),J)?E=J[1]:(J=w.match(/version\/([\d.]+).*safari/),J)?I=J[1]:I=!1;return q?{broswer:"Chrome",version:q,chrome:!0,ver:parseInt(q)}:z?{broswer:"Firefox",version:z,firefox:!0,ver:parseInt(z)}:I?{broswer:"Safari",
version:I,ver:parseInt(I)}:t?{broswer:"Edge",version:t,edge:!0,ver:parseInt(t)}:u?{broswer:"IE",version:u,ie:!0,ver:parseInt(u)}:E?{broswer:"Opera",version:E,opera:!0,ver:parseInt(E)}:{broswer:"",version:"0",ver:0}}(),Za={about:"\u5173\u4e8e",current:"\u5f53\u524d","qs-auto":"\u81ea\u52a8\u5207\u6362",enterFullScreen:"\u8fdb\u5165\u5168\u5c4f",exitFullScreen:"\u9000\u51fa\u5168\u5c4f",subtitleOff:"\u5b57\u5e55\u5173\u95ed",FULL_HD1:"\u539f\u753b",allSubtitle:"\u5b57\u5e55\u603b\u5f00\u5173",closeSmallWindow:"\u5173\u95ed\u5c0f\u7a97\u53e3\u6a21\u5f0f",
mainSubtitle:"\u9ed8\u8ba4\u5b57\u5e55",secondSubtitle:"\u7b2c\u4e8c\u5b57\u5e55",speed:"\u500d\u901f",muted:"\u9759\u97f3",unmuted:"\u5173\u95ed\u9759\u97f3",danmuEnabled:"\u5f00\u542f\u5f39\u5e55",danmuDisabled:"\u5173\u95ed\u5f39\u5e55",playbackSpeed1x:"1.0x\u64ad\u653e",playbackSpeed2x:"2.0x\u64ad\u653e",level:"\u7ea7\u522b","media-prop":"\u5a92\u4f53\u6d41\u5c5e\u6027","player-help":"\u4f7f\u7528\u8bf4\u660e","version-update":"\u7248\u672c\u66f4\u65b0",HD1:"\u8d85\u6e05",SD1:"\u9ad8\u6e05",SD2:"\u6807\u6e05",
HD:"\u9ad8\u6e05",FHD:"\u5168\u9ad8\u6e05",BD:"\u84dd\u5149","BD 4M":"\u84dd\u51494M","BD 8M":"\u84dd\u51498M",waitStreamToReady:"\u6b63\u5728\u7b49\u5f85\u8282\u76ee...",externalSubtitle:"\u5916\u6302\u5b57\u5e55",qualitySelection:"\u6e05\u6670\u5ea6\u9009\u62e9",danmuSettings:"\u5f39\u5e55\u8bbe\u7f6e",selectEmotion:"\u9009\u62e9\u8868\u60c5",loginToSendDanmu:"\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u53d1\u9001\u5f39\u5e55\u54e6",send:"\u53d1\u9001",settings:"\u8bbe\u7f6e",recordVideo:"\u5b8c\u6574\u5f55\u5236",
recordAudio:"\u4ec5\u5f55\u97f3\u9891",shortcutRecord:"\u5f00\u59cb / \u505c\u6b62\u5f55\u5236",webFullscreen:"\u7f51\u9875\u5168\u5c4f",snapshot:"\u6293\u53d6\u56fe\u50cf",selectLocalVideo:"\u9009\u62e9\u672c\u5730\u89c6\u97f3\u9891\u6587\u4ef6",pictureInPicture:"\u753b\u4e2d\u753b\u6a21\u5f0f",chapters:"\u7ae0\u8282",chapterList:"\u7ae0\u8282\u5217\u8868",danmu:"\u5f39\u5e55",login:"\u767b\u5f55",loginToParticipate:"\u767b\u5f55\u540e\u53ef\u4ee5\u53c2\u4e0e\u5f39\u5e55",brightness:"\u4eae\u5ea6",
contrast:"\u5bf9\u6bd4\u5ea6",saturation:"\u9971\u548c\u5ea6",hue:"\u8272\u8c03",reset:"\u91cd\u7f6e",colorfulText:"\u5f69\u8272\u6587\u5b57",imageEmoji:"\u56fe\u7247\u8868\u60c5",mirrorHorizontal:"\u5de6\u53f3\u7ffb\u8f6c",mirrorVertical:"\u4e0a\u4e0b\u7ffb\u8f6c",rotate90Clockwise:"\u987a90\u5ea6\u7ffb\u8f6c",rotate90Counterclockwise:"\u900690\u5ea6\u7ffb\u8f6c",loopPlayback:"\u5faa\u73af\u64ad\u653e",recordingSettings:"\u5f55\u5236\u8bbe\u7f6e...",recordingSettingsTitle:"\u5f55\u5236\u8bbe\u7f6e",
recordingOptionAsk:"\u6bcf\u6b21\u8be2\u95ee",recordingOptionVideo:"\u5b8c\u6574\u5f55\u5236",recordingOptionAudio:"\u4ec5\u63d0\u53d6\u97f3\u9891",recordingNote:"\u6ce8\u610f\uff1a\u5982\u679c\u6ca1\u6709\u97f3\u9891\uff0c\u5219\u76f4\u63a5\u5f55\u5236\u89c6\u9891",audioVolumeBoost:"\u97f3\u6548\u8c03\u8282...",videoColorTuning:"\u89c6\u9891\u8272\u5ea6\u8c03\u8282...",videoColorAdjustment:"\u89c6\u9891\u8272\u5ea6\u8c03\u8282",audioEffectAdjustment:"\u97f3\u6548\u8c03\u8282",volumeBoost:"\u97f3\u91cf\u589e\u5f3a",
selectOrDropVideo:"\u9009\u62e9\u6216\u62d6\u62fd\u89c6\u97f3\u9891\u6587\u4ef6",supportedFormats:"\u652f\u6301 MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS \u7b49\u683c\u5f0f",dragDropToPlay:"\u62d6\u62fd\u89c6\u97f3\u9891\u6587\u4ef6\u5230\u6b64\u5904\u64ad\u653e",pipModePlaying:"\u6b63\u5728\u300c\u753b\u4e2d\u753b\u300d\u6a21\u5f0f\u4e0b\u64ad\u653e",exitPictureInPicture:"\u9000\u51fa\u753b\u4e2d\u753b",close:"\u5173\u95ed\u63d0\u793a",unsupportedChapterFormat:"\u4e0d\u652f\u6301\u7684\u7ae0\u8282\u683c\u5f0f",
invalidChapterFormat:"\u7ae0\u8282\u6587\u4ef6\u683c\u5f0f\u65e0\u6548",failedToReadChapter:"\u8bfb\u53d6\u7ae0\u8282\u6587\u4ef6\u5931\u8d25",chapterValidationFailed:"\u7ae0\u8282\u6587\u4ef6\u9a8c\u8bc1\u5931\u8d25",unsupportedSubtitleFormat:"\u4e0d\u652f\u6301\u7684\u5b57\u5e55\u683c\u5f0f",invalidSubtitleFormat:"\u5b57\u5e55\u6587\u4ef6\u683c\u5f0f\u65e0\u6548",failedToReadSubtitle:"\u8bfb\u53d6\u5b57\u5e55\u6587\u4ef6\u5931\u8d25",subtitleValidationFailed:"\u5b57\u5e55\u6587\u4ef6\u9a8c\u8bc1\u5931\u8d25",
localFileDisabled:"\u672c\u5730\u6587\u4ef6\u64ad\u653e\u529f\u80fd\u5df2\u7981\u7528",unsupportedFileFormat:"\u4e0d\u652f\u6301\u7684\u6587\u4ef6\u683c\u5f0f",playbackFailedUnsupportedFormat:"\u64ad\u653e\u5931\u8d25\uff0c\u4e0d\u652f\u6301\u7684\u5a92\u4f53\u683c\u5f0f",fileValidationFailed:"\u6587\u4ef6\u683c\u5f0f\u9a8c\u8bc1\u5931\u8d25",playingFile:"\u6b63\u5728\u64ad\u653e",switchedToQuality:"\u5df2\u7ecf\u4e3a\u60a8\u5207\u6362\u5230",quality:"\u753b\u8d28",mutedAutoplayMessagePre:"\u56e0",
mutedAutoplayMessagePost:"\uff0c\u5df2\u9759\u97f3\u64ad\u653e\uff0c\u8bf7\u70b9\u51fb",browserLimits:"\u6d4f\u89c8\u5668\u9650\u5236",openAudio:"\u6253\u5f00\u58f0\u97f3",browserRestrictionsInfo:"\u5f53\u60a8\u8bbf\u95ee\u672c\u7f51\u7ad9\u7684\u6b21\u6570\u8f83\u5c11\uff0c\u6216\u7ecf\u5e38\u9759\u97f3\u64ad\u653e\u65f6\uff0c\u6d4f\u89c8\u5668\u53ef\u80fd\u4f1a\u9650\u5236\u7f51\u7ad9\u97f3\u91cf\uff0c\u5bfc\u81f4\u7f51\u7ad9\u65e0\u6cd5\u8fdb\u884c\u6709\u58f0\u81ea\u52a8\u64ad\u653e\u3002",iUnderstand:"\u6211\u77e5\u9053\u4e86",
danmuItems:"items",danmuDensityDefault:"30 items",danmuSendSettings:"\u53d1\u9001\u8bbe\u7f6e",danmuViewSettings:"\u89c2\u770b\u8bbe\u7f6e",danmuBlockSettings:"\u5c4f\u853d\u8bbe\u7f6e",danmuTextColor:"\u6587\u5b57\u989c\u8272",danmuTextBorder:"\u6587\u5b57\u8fb9\u6846",danmuOpacity:"\u4e0d\u900f\u660e\u5ea6",danmuFontSize:"\u6587\u5b57\u5927\u5c0f",danmuScrollSpeed:"\u6eda\u52a8\u901f\u5ea6",danmuDensity:"\u6392\u5217\u5bc6\u5ea6",danmuTopArea:"\u9876\u90e8\u533a\u57df",danmuBottomArea:"\u5e95\u90e8\u533a\u57df",
danmuColorFilter:"\u989c\u8272\u8fc7\u6ee4",keyboardShortcuts:"\u5feb\u6377\u952e\u8bf4\u660e",shortcutPlayPause:"\u64ad\u653e/\u6682\u505c",shortcutSeekRight:"\u5355\u6b21\u5feb\u8fdb5s\uff0c\u957f\u6309\u500d\u901f\u64ad\u653e",shortcutSeekLeft:"\u5feb\u90005s\uff0c\u957f\u6309\u8fde\u7eed\u64cd\u4f5c",shortcutVolume:"\u97f3\u91cf\u589e\u52a0/\u964d\u4f4e 5%",shortcutMute:"\u9759\u97f3 / \u5173\u95ed\u9759\u97f3",shortcutDanmu:"\u5f00\u542f / \u5173\u95ed\u5f39\u5e55",shortcutSendDanmu:"\u53d1\u9001\u5f39\u5e55",
shortcutSpeed1x:"\u4e00\u500d\u901f (\u6b63\u5e38\u500d\u6570)",shortcutSpeed2x:"\u4e8c\u500d\u901f",shortcutExit:"\u5173\u95ed\u83dc\u5355 / \u9000\u51fa\u5168\u5c4f",shortcutFullscreen:"\u5168\u5c4f / \u9000\u51fa\u5168\u5c4f",autoplayBlocked:"\u6d4f\u89c8\u5668\u963b\u6b62\u4e86\u81ea\u52a8\u64ad\u653e",playbackFailed:"\u64ad\u653e\u5931\u8d25",restartPlayback:"\u91cd\u64ad",shortcutRestart:"\u91cd\u64ad",lightOn:"\u706f\u5149\u5f00\u542f",lightOff:"\u706f\u5149\u5173\u95ed",shortcutLight:"\u5f00/\u5173\u706f\u5149",
segmentSelect:"\u9009\u62e9\u7247\u6bb5",record:"\u5f55\u5236"},$a={},ab={FULL_HD1:"RAW",HD1:"FHD",SD1:"HD",SD2:"SD",about:"About",current:"Current","qs-auto":"Auto",enterFullScreen:"Enter Fullscreen",exitFullScreen:"Exit Fullscreen",subtitleOff:"Subtitles Off",allSubtitle:"All Subtitles",closeSmallWindow:"Close Small Window",mainSubtitle:"Main Subtitle",secondSubtitle:"Second Subtitle",speed:"Rate",muted:"Muted",unmuted:"Unmuted",danmuEnabled:"Danmu Enabled",danmuDisabled:"Danmu Disabled",playbackSpeed1x:"Speed: 1x",
playbackSpeed2x:"Speed: 2x",level:"Level","media-prop":"Media Properties","player-help":"User Guide","version-update":"Version Update",HD:"HD",FHD:"FHD",BD:"BD","BD 4M":"BD 4M","BD 8M":"BD 8M",waitStreamToReady:"Waiting for stream to be ready...",externalSubtitle:"External Subtitles",qualitySelection:"Quality Selection",danmuSettings:"Danmu Settings",selectEmotion:"Select Emotion",loginToSendDanmu:"Login required to send danmu",send:"Send",settings:"settings",recordVideo:"Full Recording",recordAudio:"Audio Only",
shortcutRecord:"Start / Stop Recording",webFullscreen:"Web Fullscreen",snapshot:"Snapshot",selectLocalVideo:"Select Local Video File",pictureInPicture:"Picture-in-Picture",chapters:"Chapters",chapterList:"Chapter List",danmu:"Danmu",login:"Login",loginToParticipate:"Login to participate in danmu",videoColorAdjustment:"Video Color Adjustment",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",hue:"Hue",reset:"Reset",colorfulText:"Color",imageEmoji:"Emoji",mirrorHorizontal:"H-Mirror",
mirrorVertical:"V-Mirror",rotate90Clockwise:"90 CW",rotate90Counterclockwise:"90 CCW",loopPlayback:"Loop",recordingSettings:"Recording Settings...",recordingSettingsTitle:"Recording Settings",recordingOptionAsk:"Ask Every Time",recordingOptionVideo:"Full Recording",recordingOptionAudio:"Audio Only",recordingNote:"Note: If no audio is present, video will be recorded directly",audioVolumeBoost:"Audio Effects...",videoColorTuning:"Color Tuning...",audioEffectAdjustment:"Audio Effects",volumeBoost:"Gain",
selectOrDropVideo:"Select or drag video/audio files",supportedFormats:"Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats",dragDropToPlay:"Drag and drop video/audio files here to play",pipModePlaying:"Playing in Picture-in-Picture mode",exitPictureInPicture:"Exit Picture-in-Picture",close:"Close",unsupportedChapterFormat:"Unsupported chapter format",invalidChapterFormat:"Invalid chapter file format",failedToReadChapter:"Failed to read chapter file",chapterValidationFailed:"Chapter file validation failed",
unsupportedSubtitleFormat:"Unsupported subtitle format",invalidSubtitleFormat:"Invalid subtitle file format",failedToReadSubtitle:"Failed to read subtitle file",subtitleValidationFailed:"Subtitle file validation failed",localFileDisabled:"Local file playback is disabled",unsupportedFileFormat:"Unsupported file format",playbackFailedUnsupportedFormat:"Playback failed, unsupported media format",fileValidationFailed:"File validation failed",playingFile:"playing",switchedToQuality:"Switched to",quality:"quality",
mutedAutoplayMessagePre:"Muted due to ",mutedAutoplayLimit:"browser restrictions",mutedAutoplayMessagePost:". Click to ",openAudio:"Enable",browserRestrictionsInfo:"Browsers may limit audio volume when you visit this site infrequently or often play muted content, preventing automatic audio playback.",iUnderstand:"OK",browserLimits:"Browser Restrictions",danmuItems:"items",danmuDensityDefault:"30 items",danmuSendSettings:"Send",danmuViewSettings:"View",danmuBlockSettings:"Block",danmuTextColor:"Text Color",
danmuTextBorder:"Border",danmuOpacity:"Opacity",danmuFontSize:"Font Size",danmuScrollSpeed:"Speed",danmuDensity:"Density",danmuTopArea:"Top Area",danmuBottomArea:"Bottom Area",danmuColorFilter:"Color Filter",keyboardShortcuts:"Keyboard Shortcuts",shortcutPlayPause:"Play / Pause",shortcutSeekRight:"Single press: forward 5s, hold: speed playback",shortcutSeekLeft:"Rewind 5s (hold for continuous operation)",shortcutVolume:"Increase / decrease volume by 5%",shortcutMute:"Mute / Unmute",shortcutDanmu:"Enable / Disable Danmu",
shortcutSendDanmu:"Send Danmu",shortcutSpeed1x:"1x Speed (Normal)",shortcutSpeed2x:"2x Speed",shortcutExit:"Close menu / Exit fullscreen",shortcutFullscreen:"Fullscreen / Exit fullscreen",autoplayBlocked:"Autoplay blocked by browser",playbackFailed:"Playback failed",restartPlayback:"Restart",shortcutRestart:"Restart",lightOn:"Light On",lightOff:"Light Off",shortcutLight:"Light Toggle",segmentSelect:"Select Segment",record:"Record"},Ea="en",Ba={"zh-CN":Za,zh:Za,"zh-HK":$a,"zh-TW":$a,"en-US":ab,en:ab};
let bb="en";Ea=bb=M.navigator&&(navigator.languages&&navigator.languages.length&&navigator.languages[0].toLowerCase().startsWith("zh")||navigator.language&&navigator.language.toLowerCase().startsWith("zh")||navigator.browserLanguage&&navigator.browserLanguage.toLowerCase().startsWith("zh")||navigator.systemLanguage&&navigator.systemLanguage.toLowerCase().startsWith("zh")||navigator.userLanguage&&navigator.userLanguage.toLowerCase().startsWith("zh"))?"zh":"en";var O=function(q,z,t){t=t||Ea;var u=Ba[t];
if(u){if(u[q])return u[q];if(t!=="en"&&Ba.en&&Ba.en[q])return Ba.en[q];if(t!=="zh-CN"&&Ba["zh-CN"]&&Ba["zh-CN"][q])return Ba["zh-CN"][q]}return z||q},ob=function(){for(var q='<div class="zwp-button zwp-speedButton"><button class="zwpbtn zwp-speedBtn" data-action="showSpeedMenu" data-name="speedbtn">'+O("speed","Rate")+'</button><ul class="zwp-speedMenu">',z="2.0x 1.5x 1.25x 1.0x 0.75x 0.5x 0.25x".split(" "),t="",u=0;u<z.length;u++)t=u===3?t+('<li class="zwp-speed-item active">'+z[u]+"</li>"):t+('<li class="zwp-speed-item">'+
z[u]+"</li>");return q+t+"</ul></div>"},cb=function(){var q='<div class="zwp-option-item main"><label class="zwp-option-item-label">'+O("allSubtitle","All subtitle")+'</label><div class="zwp-option-item-value">'+Fa("","subtitleOn")+"</div></div>";q+='<div class="zwp-option-item sub1" style="display: none;"><label class="zwp-option-item-label">'+O("mainSubtitle","Main subtitle")+'</label><div class="zwp-option-item-value">'+Fa("","subtitleDefault")+"</div></div>";return q+='<div class="zwp-option-item sub2" style="display: none;"><label class="zwp-option-item-label">'+
O("secondSubtitle","Second subtitle")+'</label><div class="zwp-option-item-value">'+Fa("","subtitleSecond")+"</div></div>"},pb=function(q){var z='<li class="zwp-subtitles-item" data-id="-1">'+O("subtitleOff","Captions off")+"</li>";for(var t=0;t<q.length;t++)z=t===0?z+('<li class="zwp-subtitles-item active" data-id="'+q[t].id+'">'+q[t].name+"</li>"):z+('<li class="zwp-subtitles-item" data-id="'+q[t].id+'">'+q[t].name+"</li>");return'<ul class="zwp-subtitlesMenu">'+z+"</ul>"},qb=function(){var q="",
z=(new Date).getTime();q=q+'<div class="zwp-toolbox-ground-right zwp-dmform zwp_danmu-controlbar"> <div class="zwp_switch_group">   <div class="zwp_switch_text">'+(O("danmu","Danmu")+"</div>");q=q+('   <div class="zwp_switch" id="danmuSwitch-'+z+'"><i class="switch_inner"></i></div> </div> <div class="zwp_dmconfig zwp_dmicon" id="danmu-config-btn-')+(z+'" title="'+O("danmuSettings","Danmu Settings")+'"><i class="xicon xicon-subtitles"></i></div>');q=q+(' <div class="zwp-barrage_form" id="barrage_form-'+
z+'">   <div class="zwp-barrage_inp logined">    <input id="barrage_inp_text-')+(z+'" type="text" class="barrage_inp_text" maxlength="40" disabled="disabled" readonly="readonly">    <div class="barrage_login" href="#login"><span class="barrage_text">')+(O("login","Login")+"</span>"+O("loginToParticipate"," to participate in danmu")+"</div>");q+="   </div>";q+='   <a class="btn_bubble disabled" href="javascript:void(0);" title="'+O("selectEmotion","Select Emotion")+'" data-viewid="smilesFaces-view-'+
z+'"><i class="xicon xicon-smile"></i></a>';q+='   <button type="submit" class="btn_submit vtb_disabled" title="'+O("loginToSendDanmu","Login required to send danmu")+'" disabled="disabled">'+O("send","Send")+"</button>";q+=" </div>";q+=' <div class="zwp-barrage-set hidden" data-barrage-panel="panel" data-render="0"></div>';return q+="</div>"},Oa=function(q){if(typeof q==="number")return q;q=q.split(":");return q.length===2?parseInt(q[0])*60+parseInt(q[1]):q.length===3?parseInt(q[0])*3600+parseInt(q[1])*
60+parseInt(q[2]):q.length===1?parseFloat(q[0]):q.length>3?9.999999999999999E8:0},rb=function u(z,t){var E=(u.canvas||(u.canvas=document.createElement("canvas"))).getContext("2d");E.font=t;return E.measureText(z).width},sb=function(z,t){var u="";if(!t||!Array.isArray(t))return"";for(var E=0;E<t.length;E++){var I=t[E],w=Oa(I.time);if(!(w>=z)){var J=w*100/z+"%",L=I.title||I.text||I.time+"";if(typeof I.duration!=="undefined"){var Q="red";I.style&&typeof I.style.background!=="undefined"&&(Q=I.style.background);
var R=Oa(I.duration);w+R>z&&(R=z-w);u+='<span class="zwp__chapter_dot zwp_bar" style="left: '+J+"; width: "+(R*100/z+"%; border-radius: 3px; background-color: ")+Q+';" title="'+L+'" data-time="'+I.time+'" data-desc="'+I.desc+'">&nbsp;</span>'}else u+='<span class="zwp__chapter_dot" style="left: '+J+'" title="'+L+'" data-time="'+I.time+'" data-desc="'+I.desc+'">&nbsp;</span>'}}return u},db=function(z){return z.replace(/[<>&"]/g,function(t){return{"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"}[t]})},
tb=function(z){if(!z||!Array.isArray(z)||z.length===0)return null;var t='<div class="zwp-button zwp-chapterButton"><button class="zwpbtn zwp-chapterBtn" data-action="showChapterListview" data-name="chapterbtn"><i class="xicon xicon-chapter"></i> '+O("chapters","Chapters")+'</button><div class="zwp-chapterPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+O("chapterList","Chapter List")+'</div><div class="zwp-list-inner"><ul class="zwp-chapterlist">';
for(var u=0,E=0;E<z.length;E++){var I=z[E],w=I.title||I.text||I.time+"";w=db(w);a:{var J=I.time;if(typeof J==="string"){if(J.indexOf(":")>=0){var L=J;break a}J=parseInt(J)}L=parseInt(J/3600);var Q=parseInt(J%3600/60);J=parseInt(J%60);var R="";L>0&&(R+=L+":");Q>=0?(Q>10||L>0&&(R+="0"),R+=Q+":"):R+="0:";L=R=J>=10?R+J:R+("0"+J)}Q='<li class="chapter-item" data-time="'+I.time+'">';Q+='<div class="item-title"><span class="item-time">'+L+"</span>";Q+='<span class="title" title="'+w+'">'+w+"</span></div>";
I.desc&&(Q+='<div class="item-content"><span class="desc">'+db(I.desc)+"</span></div>");Q+="</li>";t+=Q;I=rb(w,'bold 16px "Microsoft YaHei", "Segoe UI","PingFang SC","Hiragino Sans GB","Helvetica Neue",Helvetica,Arial,sans-serif,-apple-system,BlinkMacSystemFont');I>u&&(u=I)}return{html:t+"</ul></div></div></div>",titleWidth:u}};M.insertSmile=function(z,t){z=$$(z).closest("div.zwp-smileview");if(z.length>0&&(z=z.get(0).inputbox))if(z.createTextRange&&(z.caretPos=document.selection.createRange().duplicate()),
document.all)z.createTextRange&&z.caretPos?(z=z.caretPos,z.text=z.text.charAt(z.text.length-1)==" "?t+" ":t):z.value=t;else if(z.setSelectionRange){var u=z.selectionEnd,E=z.value.substring(0,z.selectionStart);u=z.value.substring(u);z.value=E+t+u}else alert("This version of Mozilla based browser does not support setSelectionRange")};M.replaceSmileDanmu=function(z,t,u){if(typeof z!="string")return"";z.indexOf("<")>=0&&(z=z.replace(/</g,"&lt;").replace(/>/g,"&gt;"));var E=z.indexOf("[sm-");if(E<0)return z;
var I=Ga.path+"widgets/smiles/p",w="",J=z.substring(0,E);for(J!=""&&(w+=J);E>=0;){J=z.indexOf("]",E+4);if(J<0){J=z.substring(E);J!=""&&(w+=J);break}E=z.substring(E+4,J);E!=""&&(u.isFilterImage||(w+='<img style="opacity: 1;" src="'+I+E+'.png" height="'+t+'">'));E=z.indexOf("[sm-",J+1);E<0?(J=z.substring(J+1),J!=""&&(w+=J)):E>J+1&&(w+=z.substring(J+1,E))}return w};var Ra=function(z){hasClass(z,"switch_on")?removeClass(z,"switch_on"):addClass(z,"switch_on")},ub=function(z,t){var u=$$;z=u(t).closest("div.zwp-dmform").children(".zwp-barrage-set");
if(z.length!=0){if(z.attr("data-render")!="1"){var E=t.zwplayer,I=z.get(0);u.get(Ga.path+"widgets/danmu_setting.html?v="+Ga.v,{},function(L){var Q=u(I);Q.html(L);lb(Q);Q.find("a.barrage-tab-link").click(function(R){R.preventDefault();R=u(this).parent();R.hasClass("selected")||(R.addClass("selected").siblings().removeClass("selected"),R=u(R.attr("data-tab")),R.hasClass("hidden")&&(R.removeClass("hidden"),R.siblings().addClass("hidden")))});L=u("#fsBox_tab");L.find("div.color-box").children("a").click(function(R){R.preventDefault();
R=u(this);R.hasClass("selected")||(R.siblings().removeClass("selected"),R.addClass("selected"),E&&(E.danmuSetting.color=R.attr("data-color")))});L.find("div.other-box").children("a.checkbox-wrap").click(function(R){R.preventDefault();var Y=u(this);Y.toggleClass("selected");R=Y.attr("data-content");Y=Y.hasClass("selected");E&&(E.danmuSetting[R]=Y)});u("#bfBox_tab").find("a.zwp-barrage-icons").mousedown(function(R){if(R.button==0){this.isMousePressed=!0;var Y=u(this).position().left,da=R.clientX-Y,
Z=this,ea=function(ca){var ba=ca.clientX-da;ba<0?ba=0:ba>134&&(ba=134);u(Z).css({left:ba+"px"});ca=u(Z).siblings("div.bar-t");ca.length>0&&ca.width(ba+3);Z.valuePanel||(Z.valuePanel=u(Z).parent().siblings("div.set-rol-right").get(0));if(typeof Z.valuePanel=="object"){ca=u(Z.valuePanel);var ja=ca.attr("data-barrage-content");ja=="opacityValue"?(ba=parseInt(ba*100/138),E&&(E.danmuSetting.opacityValue=ba),ca.html(ba+"%")):ja=="forcedFontSizeValue"?(ba=50+parseInt(ba*150/138),E&&(E.danmuSetting.forcedFontSizeValue=
ba),ca.html(ba+"%")):ja=="speedValue"?(ba=(.5+parseFloat(ba/69)).toFixed(1),E&&(E.danmuSetting.speedValue=ba),ca.html(ba+"x")):ja=="densityValue"&&(ba=parseInt(ba*100/46),E&&(E.danmuSetting.densityValue=ba),ba=ba+" "+O("danmuItems","items"),ca.html(ba))}return!1},na=function(ca){u(document).unbind("mousemove",ea).unbind("mouseup",na)};u(document).bind("mousemove",ea).bind("mouseup",na)}return!1});u("#pbBox_tab").find("a.pb-link").click(function(R){R.preventDefault();var Y=u(this).parent();Y.toggleClass("selected");
R=u(this).attr("data-content");Y=Y.hasClass("selected");E&&(E.danmuSetting[R]=Y)});u("#barrage-set-bot").children("a").click(function(R){R.preventDefault();if(u(this).attr("data-content")=="reset"){if(E)for(a in E.danmuSetting)delete E.danmuSetting[a];u("#fsBox_tab").find(".color-box a").removeClass("selected").eq(0).addClass("selected");u("#fsBox_tab").find(".other-box a").removeClass("selected");var Y={opacityTrigger:[128,124,"90%"],forcedFontSizeTrigger:[50,46,"100%"],speedTrigger:[39,35,"1.0x"],
densityTrigger:[18,14,O("danmuDensityDefault","30 items")]};u("#bfBox_tab").find("a.zwp-barrage-icons").each(function(da,Z){da=u(Z).attr("data-barrage-content");if(Y[da]){var ea=Y[da];da=ea[1];var na=ea[0];ea=ea[2];Z=u(Z);Z.css({left:da+"px"});Z.siblings(".bar-t").width(na+"px");Z.parent().siblings(".set-rol-right").text(ea)}});u("#pbBox_tab").find("li.selected").removeClass("selected")}})},"html");z.attr("data-render","1")}if(z.hasClass("hidden")){I=z.get(0);var w=this,J=function(L){var Q=u(I);if(L.target==
w)w=null;else if(hasClass(L.target,"xicon-close")||!Q.is(L.target)&&Q.has(L.target).length===0)Q.addClass("hidden"),u(document).off("click",J),delete t.zwplayer};z.removeClass("hidden");u(document).on("click",J)}}},eb=function(z){M.ctrlInitId||(M.ctrlInitId=(new Date).getTime());var t=M.ctrlInitId++;return z+t},Fa=function(z,t){return'<div class="zwp_switch action-item" id="'+(z||eb("switch-"))+'" data-action="'+(t||"none")+'"><i class="switch_inner"></i></div>'},Pa=function(z){var t=z.parentNode;
if(t&&(t=t.querySelector(".zwp-slider-value"))){var u=z.getAttribute("data-action");z=z.value;u==="volumeBoost"?(z=parseFloat(z),z=(z>=0?"+":"")+z.toFixed(1)+"dB",t.innerHTML=z):t.innerHTML=z}},Ja=function(z,t,u,E,I,w){z=z||eb("zwp_slider-");u=u!==void 0?u:-100;E=E!==void 0?E:100;var J=u<0&&E>0?0:u,L="";w&&(L+='<span class="zwp-slider-min-label">'+u+"dB</span>");L+='<input type="range" id="'+z+'" name="slider'+z+'" data-action="'+t+'" class="zwp-slider" value="'+J+'" min="'+u+'" max="'+E+'" step="'+
(I!==void 0?I:1)+'"/><span class="zwp-slider-value">'+(t==="volumeBoost"?"+0.0dB":J)+"</span>";w&&(L+='<span class="zwp-slider-max-label">'+E+"dB</span>");return L},fb=function(z){var t="";z.infoButton&&(t='<div class="zwp-button zwp-infoButton"><button class="zwpbtn zwp-infoBtn" data-action="showMediainfo" data-name="infobtn"><i class="xicon xicon-info"></i></button></div>');var u="",E="",I="",w="",J="",L="",Q="",R="",Y="",da="",Z=z.defVolume||61.25;z.speedButton&&!z.isLive&&(u="");z.optionButton&&
(I='<div class="zwp-optionPanel"><div class="zwp-option-item"><label class="zwp-option-item-label">'+O("mirrorHorizontal","Mirror Horizontal")+'</label><div class="zwp-option-item-value">'+Fa("","mirror")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+O("mirrorVertical","Mirror Vertical")+'</label><div class="zwp-option-item-value">'+Fa("","flip")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+O("rotate90Clockwise","Rotate 90\u00b0 CW")+
'</label><div class="zwp-option-item-value">'+Fa("","rotated90")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+O("rotate90Counterclockwise","Rotate 90\u00b0 CCW")+'</label><div class="zwp-option-item-value">'+Fa("","rotated270")+'</div></div><div class="zwp-option-h-separator"><hr/></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+O("loopPlayback","Loop Playback")+'</label><div class="zwp-option-item-value">'+Fa("","loop")+"</div></div>",
z.recordButton&&(I+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-record"></i></span> <button class="zwp-option-button action-item" data-action="showRecordingConfig">'+O("recordingSettings","Recording Settings...")+"</button></div>"),I+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-audio-effect"></i></span> <button class="zwp-option-button action-item" data-action="showVolumeBoostConfig">'+O("audioVolumeBoost",
"Volume Boost...")+'</button></div><div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-hue"></i></span> <button class="zwp-option-button action-item" data-action="showColorConfig">'+O("videoColorTuning","Video Color Tuning...")+"</button></div></div>",I='<div class="zwp-button zwp-optionButton"><button class="zwpbtn zwp-optionBtn" data-action="showConfigPanel" data-name="optionbtn" title="'+O("settings","Settings")+'"><i class="xicon xicon-config"></i></button>'+
I+"</div>");z.disableVolumeControl||(Q='<div class="zwp-button zwp-volume-docker"><button class="zwpbtn zwp-muteBtn" data-action="mute"  data-name="mutebtn"><i class="xicon xicon-speaker"></i></button><div class="zwp-volume-slider"><div class="zwp-volume-total"><div class="zwp-volume-current" style="bottom: 0px; height: '+Z+'%;"></div><div class="zwp-volume-handle" style="bottom: '+Z+'%; margin-bottom: -7px;"></div></div></div></div>');z.disableFullscreenWin||(w='<div class="zwp-button zwp-fullscrWinButton"><button class="zwpbtn zwp-fullscrWinBtn" data-action="enterfullscreenWin" data-name="fullscrWinbtn" title="'+
O("webFullscreen","Web Fullscreen")+'"><i class="xicon xicon-fullScreen-win"></i></button></div>');z.snapshotButton&&(J='<div class="zwp-button zwp-snapshotButton"><button class="zwpbtn zwp-snapshotBtn" data-action="snapshot" data-name="snapshotbtn" title="'+O("snapshot","Snapshot")+'"><i class="xicon xicon-camera"></i></button></div>');z.localPlayback&&(R='<div class="zwp-button zwp-localPlaybackButton"><button class="zwpbtn zwp-localPlaybackBtn" data-action="selectLocalFile" data-name="localPlaybackbtn" title="'+
O("selectLocalVideo","Select Local Video File")+'"><i class="xicon xicon-open-file"></i></button></div>');z.isLive||z.segmentButton!==!0||(Y='<div class="zwp-button zwp-segmentButton"><button class="zwpbtn zwp-segmentBtn" data-action="toggleSegment" data-name="segmentbtn" title="'+O("segmentSelect","Segment Select")+'"><i class="xicon xicon-zone"></i></button></div>');z.recordButton&&(da='<div class="zwp-button zwp-recordButton"><button class="zwpbtn zwp-recordBtn" data-action="record" data-name="recordbtn" title="'+
O("record","Record")+'"><i class="xicon xicon-record"></i></button></div>');z.disablePicInPic||document.pictureInPictureEnabled&&(L='<div class="zwp-button zwp-picInPicButton"><button class="zwpbtn zwp-picInPicBtn" data-action="pictureInPicture" data-name="picInPicbtn" title="'+O("pictureInPicture","Picture-in-Picture")+'"><i class="xicon xicon-pic-in-pic"></i></button></div>');z.isLive||(E='<div class="zwp__time-rail"></div>');z='<div class="zwp-button zwp-subtitleButton" style="display: none;"><button class="zwpbtn zwp-subtitleBtn" data-action="showSubtitleMenu" data-name="subtitlebtn" title="'+
O("externalSubtitle","External Subtitles")+'"><i class="xicon xicon-cc"></i></button><div class="zwp-subtitleMenu">'+cb()+"</div></div>";Z='<div class="zwp-button zwp-qualityButton" style="display: none;"><button class="zwpbtn zwp-qualityBtn" data-action="showQualityMenu" data-name="qualitybtn" title="'+O("qualitySelection","Quality Selection")+'"><i class="xicon xicon-hd"></i></button><ul class="zwp-qualityMenu">';for(var ea=["1920","1280","720","480"],na="",ca=0;ca<ea.length;ca++)na=ca===3?na+('<li class="zwp-quality-item active">'+
ea[ca]+"</li>"):na+('<li class="zwp-quality-item">'+ea[ca]+"</li>");return'<div class="zwp-button zwp_playbtn"><button class="zwpbtn zwp-playbtn" data-action="play" data-name="playbtn"><i class="xicon xicon-play"></i></button></div><div class="zwp__time zwp__currenttime-container" role="timer" aria-live="on"><span class="zwp__currenttime">00:00</span></div><div class="zwp__time zwp__duration-container" style="display: none;"><span class="zwp__time_divider">/</span> <span class="zwp__duration">0:00:00</span></div><div class="zwp__time-info "></div>'+
t+R+J+Y+da+z+(Z+na+"</ul></div>")+u+I+Q+L+w+'<div class="zwp-button"><button class="zwpbtn zwp-fullscrBtn" data-action="enterfullscreen" data-name="fullscrbtn" title="'+O("enterFullScreen","Enter Fullscreen")+'"><i class="xicon xicon-fullScreen"></i></button></div>'+E},vb='<div class="zwp__overlay zwp__layer zwp__overlay-play" style="width: 100%; height: 100%; display: none;"><div class="zwp-local-playback-hint" style="display: none;" role="button" tabindex="0" aria-label="'+O("selectLocalVideo",
"Select Local Video File")+'" data-action="selectLocalFile"><div class="zwp-local-playback-text">'+O("selectOrDropVideo","Select or drag video/audio files")+'</div><div class="zwp-local-playback-subtitle">'+O("supportedFormats","Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats")+'</div></div><div class="zwp__overlay-button" role="button" tabindex="0" aria-label="play" aria-pressed="false" data-action="play"><svg class="icon" width="96px" height="96px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#c2c2c2" d="M512.61025 48.820024a463.790226 463.790226 0 1 0 463.790227 463.790226A463.790226 463.790226 0 0 0 512.61025 48.820024z m0 854.350417a390.560191 390.560191 0 1 1 390.560191-390.560191 390.560191 390.560191 0 0 1-390.560191 390.560191z m166.720382-414.970203l-120.341359-70.300834-127.908463-74.694636a22.945411 22.945411 0 0 0-32.465315 24.410011v288.526341a22.945411 22.945411 0 0 0 32.465315 24.410012l127.908463-74.694636 120.341359-70.056734a28.559714 28.559714 0 0 0 0-47.599524z" /></svg></div></div>',
wb='<div class="zwp-pipPlaceHolder">\t<div class="zwp-pipControl">\t\t<div class="zwp-pipTiptext">'+O("pipModePlaying","Playing in Picture-in-Picture mode")+'</div>\t\t<div class="zwp-pipExitButton">'+O("exitPictureInPicture","Exit Picture-in-Picture")+"</div>\t</div></div>";(function(z,t){typeof M.define==="function"&&M.define.amd?M.define([],t):typeof exports==="object"?module.exports=t():z.ZWPlayer=t()})(M,function(){function z(e){e=e.getBoundingClientRect();return{top:e.top+(M.pageYOffset||document.documentElement.scrollTop),
left:e.left+(M.pageXOffset||document.documentElement.scrollLeft)}}function t(e){var l=e.offsetTop;for(e=e.offsetParent;e!==null;)l+=e.offsetTop,e=e.offsetParent;return l}function u(e,l){if(document.createEvent){const n=document.createEvent("HTMLEvents");n.initEvent(l,!0,!1);e.dispatchEvent(n)}else document.createEventObject&&e.fireEvent(l)}var E=function(){return(new Date).getTime()};typeof performance!="undefined"&&performance.now&&(E=function(){return performance.now()});E();var I=function(e){var l=
"",n=!1,p="";e.startsWith("webrtc://")?l="/rtc/v1/play/":e.startsWith("brtc://")&&(l="/brtc/v3/pullstream",n=!0,p=e.replace("brtc://","webrtc://"));var y=e.indexOf("://");if(y==-1)return!1;var N="";if(e.indexOf("?")>=0){var b=e.indexOf("?");N=e.substr(b+1);e=e.substr(0,b)}var G=e.indexOf("/",y+3);b=e.substr(0,y);y=e.substring(y+3,G);var A=e.substring(G),U=A.lastIndexOf("/"),D="";G=y.indexOf(":");G>0&&(D=y.substring(G+1),y=y.substring(0,G));G=A.substring(1,U);A=A.substring(U+1);U=A.lastIndexOf(".");
U>0&&(A=A.substring(0,U));U="";N.indexOf("vhost=")>0&&(U=N.substr(N.indexOf("vhost=")+6),U.indexOf("&")>0&&(U=U.substr(0,U.indexOf("&"))));y===U&&/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(y)&&(U="_default_vhost_");e={url:e,schema:b,server:y,port:D,vhost:U,app:G,stream:A};e.user_query={};if(N.length!==0){N.indexOf("?")>=0&&(N=N.split("?")[1]);N=N.split("&");for(D=0;D<N.length;D++)U=N[D].split("="),e[U[0]]=U[1],e.user_query[U[0]]=U[1];e.domain&&(e.vhost=e.domain)}b==="webrtc"||b==="rtc"?(b="",e.port||(e.user_query.schema===
"https"?(e.port=443,b=e.user_query.schema||"https"):M.location.href.indexOf("https://")===0?(e.port=443,b=e.user_query.schema||"https"):e.port=1985)):n&&(M.location.href.indexOf("https://")===0?(b="https",e.port=e.por||443):(b="http",e.port=e.por||80));p||="rtmp://"+y+"/"+G+"/"+A;b=b?b+":":M.location.protocol;(D=e.port)||(D=b==="https:"?D||443:D||1985);l=l||"/live/webrtc/play/";y=b+"//"+e.server+":"+D+l;for(var fa in e.user_query)fa!=="api"&&fa!=="play"&&(y+="&"+fa+"="+e.user_query[fa]);y=y.replace(l+
"&",l+"?");n={apiUrl:y,streamUrl:p,schema:b,urlObject:e,port:D,is_brtc:n};n.tid=Number(parseInt((new Date).getTime()*Math.random()*100)).toString(16).slice(0,7);return n},w=function(e,l,n,p){let y=null;y=M.XMLHttpRequest?new M.XMLHttpRequest:new M.ActiveXObject("Microsoft.XMLHTTP");y.addEventListener("error",function(N){p&&p("REQUEST:"+N.type)});y.onreadystatechange=function(){if(y.readyState===4)if(y.status===200){var N=JSON.parse(y.responseText);n&&n(N)}else p&&p("STATUS:"+y.status+":"+y.statusText)};
y.open("POST",e,!0);y.setRequestHeader("Content-Type","application/json");y.send(l);return y},J=function(e){var l=e.lastIndexOf("/"),n=e.indexOf("?");l=e.indexOf(".",l+1);var p="";l>0&&(n>0?l>n||(p=e.substring(l,n).toLowerCase()):p=e.substring(l).toLowerCase(),l=p.lastIndexOf("."),l>0&&(p=p.substring(l)));return p},L=void 0,Q=void 0,R=void 0;"classList"in document.documentElement?(L=function(e,l){return e.classList!==void 0&&e.classList.contains(l)},Q=function(e,l){return e.classList.add(l)},R=function(e,
l){return e.classList.remove(l)}):(L=function(e,l){return(new RegExp("\\b"+l+"\\b")).test(e.className)},Q=function(e,l){L(e,l)||(e.className+=" "+l)},R=function(e,l){e.className=e.className.replace(new RegExp("\\b"+l+"\\b","g"),"")});M.hasClass=L;M.addClass=Q;M.removeClass=R;/MSIE 8\.0/.test(navigator.userAgent);var Y=function(e){e=parseInt(e);var l=parseInt(e/3600),n=parseInt(e%3600/60);e=parseInt(e%60);var p="";l>0&&(p+=l+":");p=n>=10?p+(n+":"):n>0?p+("0"+n+":"):p+"00:";return e>=10?p+e:p+("0"+
e)},da=function(e){if(typeof e!=="number"||isNaN(e))return"00:00.000";var l=Math.floor(e/3600),n=Math.floor(e%3600/60),p=Math.floor(e%60);e=Math.round(e%1*1E3);var y="";l>0&&(y+=l+":");y=n>=10?y+(n+":"):y+("0"+n+":");y=p>=10?y+(p+"."):y+("0"+p+".");return e>=100?y+e:e>=10?y+("0"+e):y+("00"+e)},Z=function(e){function l(c,d,f){var h=c.recording,r=c._config&&c._config.isLive,B=f==="audio"?"\u97f3\u9891":"\u89c6\u9891";h.isLive=r;if(!h.isRecording){h.isRecording=!0;h.startTime=Date.now();h.recordedChunks=
[];h.duration=0;h.recordType=f;h.finalized=!1;if(!h.indicator){var H=document.createElement("div");H.className="zwp-live-recording-indicator";H.title="\u6b63\u5728\u5f55\u5236";if(d){var S=d.closest(".zwp-recordButton");S?(S.style.position=S.style.position||"relative",S.appendChild(H)):(d.style.position=d.style.position||"relative",d.appendChild(H))}h.indicator=H}h.indicator&&(h.indicator.className="zwp-live-recording-indicator recording "+(f==="audio"?"audio-recording":""));d&&(d.title="\u505c\u6b62"+
B+"\u5f55\u5236");r?(h=0,B=Infinity):c.segment&&c.segment.isActive?(h=c.videoEl.currentTime=c.segment.startTime,B=c.segment.endTime):(h=c.videoEl.currentTime,B=c.videoEl.duration||Infinity);n(c,d,f,h,B,r)}}function n(c,d,f,h,r,B){var H=c.recording;H.isLive=B;try{var S=U(c);if(f==="audio"){var K=S.getAudioTracks();if(K.length===0)throw Error("\u6ca1\u6709\u627e\u5230\u97f3\u9891\u8f68\u9053\uff0c\u65e0\u6cd5\u8fdb\u884c\u97f3\u9891\u5f55\u5236");K.forEach(function(X){X.enabled=!0});S=new MediaStream(K)}H.format=
b(f);var P={mimeType:H.format.mimeType};f==="video"?(P.videoBitsPerSecond=25E5,S.getAudioTracks().length>0&&(P.audioBitsPerSecond=192E3)):P.audioBitsPerSecond=128E3;H.mediaRecorder=new MediaRecorder(S,P);H.mediaRecorder.ondataavailable=function(X){X.data.size>0&&H.recordedChunks.push(X.data)};H.mediaRecorder.onstop=function(){var X=c.recording;B!==X.isLive&&(X.isLive=B);if(X.recordedChunks.length!==0){var C=new Blob(X.recordedChunks,{type:X.format.mimeType}),W=B?"live_recording":"vod_recording",la=
new Date;la=la.getFullYear()+String(la.getMonth()+1).padStart(2,"0")+String(la.getDate()).padStart(2,"0")+"_"+String(la.getHours()).padStart(2,"0")+String(la.getMinutes()).padStart(2,"0")+String(la.getSeconds()).padStart(2,"0");W=W+"_"+la+X.format.fileExtension;C=URL.createObjectURL(C);la=document.createElement("a");la.href=C;la.download=W;la.style.display="none";document.body.appendChild(la);la.click();document.body.removeChild(la);URL.revokeObjectURL(C);X.recordedChunks=[];X.isRecording=!1;X.finalized=
!0;X.duration=0;X.startTime=0;X.recordType=null}};H.mediaRecorder.onstart=function(){};H.mediaRecorder.onerror=function(X){H.isRecording=!1;H.indicator&&(H.indicator.className="zwp-live-recording-indicator");d&&(d.title="\u5f55\u5236")};H.mediaRecorder.start(f==="audio"?100:200);fa(c,d);if(!B&&r!==Infinity)setTimeout(function(){H.isRecording&&y(c,d)},(r-h)*1E3);else if(!B&&r===Infinity){var T=function(){H.isRecording&&y(c,d);c.videoEl.removeEventListener("ended",T)};c.videoEl.addEventListener("ended",
T)}}catch(X){H.isRecording=!1,H.indicator&&(H.indicator.className="zwp-live-recording-indicator"),d&&(d.title="\u5f55\u5236")}}function p(c,d){var f=document.querySelector(".zwp-recording-options-menu");f&&f.remove();var h=document.createElement("div");h.className="zwp-recording-options-menu";h.style.cssText="position: fixed; background: rgba(0,0,0,0.9); border: 1px solid #444; border-radius: 4px; padding: 6px 0; width: 110px; z-index: 10000; box-shadow: 0 2px 8px rgba(0,0,0,0.3); overflow: hidden;";
f=document.createElement("div");f.className="zwp-recording-option";f.innerHTML=O("recordVideo","Full Recording");f.style.cssText="padding: 10px 12px; cursor: pointer; color: #fff; font-size: 13px; border: none; background: transparent; width: 100%; text-align: center; box-sizing: border-box;";f.onmouseover=function(){this.style.background="rgba(255,255,255,0.1)"};f.onmouseout=function(){this.style.background="transparent"};f.onclick=function(){h.remove();l(c,d,"video")};var r=document.createElement("div");
r.className="zwp-recording-option";r.innerHTML=O("recordAudio","Audio Only");r.style.cssText="padding: 10px 12px; cursor: pointer; color: #fff; font-size: 13px; border: none; background: transparent; width: 100%; text-align: center; box-sizing: border-box;";r.onmouseover=function(){this.style.background="rgba(255,255,255,0.1)"};r.onmouseout=function(){this.style.background="transparent"};r.onclick=function(){h.remove();l(c,d,"audio")};h.appendChild(f);h.appendChild(r);r=d.getBoundingClientRect();
r.width===0||r.height===0||r.left===0&&r.top===0&&r.bottom===0?(r=c.playerElm.getBoundingClientRect(),f=r.left+r.width/2-55,r=r.top+r.height/2-40):(f=r.left+r.width/2-55,r=r.bottom+2);h.style.left=f+"px";h.style.top=r+"px";document.body.appendChild(h);var B=function(H){h.contains(H.target)||H.target===d||(h.remove(),document.removeEventListener("click",B))};setTimeout(function(){document.addEventListener("click",B)},100)}function y(c,d){c=c.recording;if(c.isRecording||c.mediaRecorder){c.timer&&(clearInterval(c.timer),
c.timer=null);c.streamCheckInterval&&(clearInterval(c.streamCheckInterval),c.streamCheckInterval=null);if(c.mediaRecorder&&c.mediaRecorder.state!=="inactive")try{c.mediaRecorder.stop()}catch(f){}c.indicator&&(c.indicator.className="zwp-live-recording-indicator");d&&(d.title="\u5f55\u5236");c.isRecording=!1}}function N(c,d){try{if(c.videoEl)if(c.streamContentCache)d({hasVideo:c.streamContentCache.hasVideo,hasAudio:c.streamContentCache.hasAudio});else{var f=c.videoEl,h={hasVideo:!1,hasAudio:!1};if(f.captureStream||
f.mozCaptureStream)try{var r=(f.captureStream||f.mozCaptureStream).call(f),B=r.getVideoTracks();h.hasVideo=B.length>0;var H=r.getAudioTracks();h.hasAudio=H.length>0;c.streamContentCache={hasVideo:h.hasVideo,hasAudio:h.hasAudio};d(h);return}catch(S){}f.videoWidth>0&&f.videoHeight>0&&(h.hasVideo=!0);if(f.webkitAudioDecodedByteCount>0||f.getAudioTracks&&f.getAudioTracks().length>0)h.hasAudio=!0;h.hasVideo||h.hasAudio||(h.hasVideo=!0,h.hasAudio=!0);c.streamContentCache={hasVideo:h.hasVideo,hasAudio:h.hasAudio};
d(h)}else d({hasVideo:!1,hasAudio:!1})}catch(S){f={hasVideo:!0,hasAudio:!0},c.streamContentCache=f,d(f)}}function b(c){if((c||"video")==="audio"){c="audio/mp4;codecs=mp4a.40.2 audio/mp4 audio/webm;codecs=opus audio/webm;codecs=vorbis audio/webm audio/ogg;codecs=opus audio/ogg;codecs=vorbis".split(" ");for(var d=0;d<c.length;d++)if(MediaRecorder.isTypeSupported(c[d])){var f=c[d].includes("mp4");return{mimeType:c[d],isMP4:f,fileExtension:f?".m4a":".webm"}}return{mimeType:"audio/webm",isMP4:!1,fileExtension:".webm"}}c=
"video/mp4;codecs=avc1.42E01E,mp4a.40.2 video/mp4;codecs=avc1.42E01E video/mp4;codecs=h264 video/webm;codecs=vp9 video/webm;codecs=vp8 video/webm".split(" ");for(d=0;d<c.length;d++)if(MediaRecorder.isTypeSupported(c[d]))return{mimeType:c[d],isMP4:c[d].includes("mp4"),fileExtension:c[d].includes("mp4")?".mp4":".webm"};return{mimeType:"video/webm",isMP4:!1,fileExtension:".webm"}}function G(c){var d=c.videoEl;if(d.captureStream||d.mozCaptureStream)try{var f=(d.captureStream||d.mozCaptureStream).call(d).getAudioTracks();
if(f.length>0)return new MediaStream(f)}catch(h){}return A(c)}function A(c){c=c.videoEl;if(c.captureStream)try{var d=c.captureStream(),f=d.getAudioTracks();if(f.length>0){var h=new MediaStream(f);return h}}catch(K){}if(c.mozCaptureStream)try{if(d=c.mozCaptureStream(),f=d.getAudioTracks(),f.length>0)return h=new MediaStream(f)}catch(K){}try{var r=new (M.AudioContext||M.webkitAudioContext),B=document.createElement("audio");B.src=c.src;B.crossOrigin=c.crossOrigin||"anonymous";B.muted=!1;B.volume=1;var H=
r.createMediaStreamDestination(),S=r.createMediaElementSource(B);S.connect(H);S.connect(r.destination);d=H.stream;B.muted=!0;B.play().catch(function(K){});return d}catch(K){}return new MediaStream}function U(c){var d=c.videoEl;if(d.captureStream||d.mozCaptureStream)try{var f=(d.captureStream||d.mozCaptureStream).call(d),h=f.getVideoTracks(),r=f.getAudioTracks();if(h.length>0){if(r.length>0)return f;var B=G(c).getAudioTracks();B.length>0&&B.forEach(function(H){f.addTrack(H)});return f}}catch(H){}return D(c)}
function D(c){function d(){if(c.recording&&c.recording.isRecording){try{if(f&&f.videoWidth>0&&f.videoHeight>0){var T=f.currentTime;Math.abs(T-K)>.016&&(r.drawImage(f,0,0,h.width,h.height),K=T,P++)}else r.fillStyle="black",r.fillRect(0,0,h.width,h.height)}catch(X){}requestAnimationFrame(d)}}var f=c.videoEl,h=document.createElement("canvas"),r=h.getContext("2d");h.width=f?f.videoWidth||1280:1280;h.height=f?f.videoHeight||720:720;var B=h.captureStream(60),H=A(c),S=new MediaStream;B.getVideoTracks().forEach(function(T){S.addTrack(T)});
H.getAudioTracks().forEach(function(T){S.addTrack(T)});var K=0,P=0;d();return S}function fa(c,d){var f=c.recording;f.timer=setInterval(function(){f.duration=Math.floor((Date.now()-f.startTime)/1E3);if(f.duration>=f.maxDuration)y(c,d);else{var h=f.duration;var r=Math.floor(h/3600);var B=Math.floor(h%3600/60);h%=60;r=r>0?r+":"+String(B).padStart(2,"0")+":"+String(h).padStart(2,"0"):B+":"+String(h).padStart(2,"0");d&&(d.title="\u505c\u6b62\u5f55\u5236 ("+r+")")}},1E3)}var ha=!1,qa=!1,g=this;g instanceof
Z||(g=Object.create(Z.prototype));g._config=e||{};Ea=g._config.lang?g._config.lang:g._config.lang=bb;g.peer_conn=null;g.danmuSetting={};g.segment={isActive:!1,startTime:0,endTime:0,isDragging:!1,dragTarget:null};g.resetPlaybackState=function(){this.segment.isActive=!1;this.segment.startTime=0;this.segment.endTime=0;this.segment.isDragging=!1;this.segment.dragTarget=null;var c=this.controlbar?this.controlbar.querySelector("#segmentLayer"):null,d=this.controlbar?this.controlbar.querySelector(".zwp-segmentBtn"):
null;c&&(c.classList.remove("active"),(c=c.closest(".zwp__time-rail"))&&c.classList.remove("segment-active"));d&&d.closest(".zwp-segmentButton").classList.remove("active");this.streamContentCache=null};typeof g._config.controlbar==="undefined"&&(g._config.controlbar=!0);g._config.hideControlbarTimeout||(g._config.hideControlbarTimeout=1E4);typeof g._config.defVolume==="undefined"&&(g._config.defVolume=61.25);g.setRtcstream=function(c){this.videoEl&&(this.videoEl.srcObject=c,this.videoEl.play(),this.setplaystate(!0),
this.startHideControlbar(this))};g.onfullscrchange=function(c){var d=this;Ia()?(d.isFullscr=!0,d.setupFullscrBtn&&d.setupFullscrBtn.setAttribute("title",O("exitFullScreen","Exit full screen")),(c=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)||(c=d.videoEl||d.playerElm||d.playerContainer),c&&(d.fullscreenContextMenuHandler&&c.removeEventListener("contextmenu",d.fullscreenContextMenuHandler),d.fullscreenContextMenuHandler=
function(f){f.preventDefault();f.stopPropagation();Qa||d.showContextMenu(f)},c.addEventListener("contextmenu",d.fullscreenContextMenuHandler))):(d.setupFullscrBtn&&(R(d.playerElm,"zwp-fullscreen"),d.setupFullscrBtn.setAttribute("data-action","enterfullscreen"),d.setupFullscrBtn.setAttribute("title",O("enterFullScreen","Enter full screen"))),d.isFullscr=!1,d.fullscreenContextMenuHandler&&((c=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&
d.fullscreenContextMenuHandler&&c.removeEventListener("contextmenu",d.fullscreenContextMenuHandler),delete d.fullscreenContextMenuHandler),d._config.fluid&&(Q(d.playerElm,"zwp-fluid"),d.playerElm.style.height="0",c=d.videoEl,d.playerElm.style.paddingTop=c.videoHeight&&c.videoWidth?c.videoHeight*100/c.videoWidth+"%":d._config.keepAudioWindow?"264px":"64px"));d.isFullscrWin||d.reposDanmuToolbar(d.isFullscr)}.bind(g);g.on_btnclick=function(c){if(c.currentTarget&&this.btnBindZwp){c=c.currentTarget;var d=
c.getAttribute("data-action");d==="play"?this._config.disablePlayBtn||(this.isPlaying?this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&(this.initAudioContext(),this.videoEl.play(),this.setplaystate(!0)):this._config.url&&this.play(this._config.url)):d==="pause"?this._config.disablePlayBtn||!this.videoEl||this.videoEl.paused||this.videoEl.ended||(this.videoEl.pause(),this.setplaystate(!1)):d==="mute"?this.videoEl&&(this.videoEl.muted||this.setMuted(!0)):d==="unmute"?this.videoEl&&this.videoEl.muted&&
this.setMuted(!1):d==="enterfullscreen"?this.setFullscreen(!0,c):d==="exitfullscreen"?this.setFullscreen(!1,c):d==="enterfullscreenWin"?this.setFullscreenWin(!0,c):d==="exitfullscreenWin"?this.setFullscreenWin(!1,c):d==="showMediainfo"?this.showMediainfo():d==="snapshot"?this.doSnapshot():d==="pictureInPicture"?this.togglePictureInPicture():d==="selectLocalFile"?this.selectLocalFile():d==="toggleSegment"?this.toggleSegment():d==="record"&&this.recordVideo()}}.bind(g);g.setFullscreen=function(c,d){if(c){if(!Ia()&&
this.playerElm){this._config.fluid&&(R(this.playerElm,"zwp-fluid"),this.playerElm.style.height=null,this.playerElm.style.paddingTop=null);c=this.playerElm;var f=this.videoEl;c.requestFullscreen?c.requestFullscreen():c.webkitRequestFullscreen?c.webkitRequestFullScreen():c.mozRequestFullScreen?c.mozRequestFullScreen():c.msRequestFullscreen?c.msRequestFullscreen():c.oRequestFullscreen?c.oRequestFullscreen():f.webkitEnterFullScreen?f.webkitEnterFullScreen():(f=document.documentElement,f.requestFullscreen?
f.requestFullscreen():f.mozRequestFullScreen?f.mozRequestFullScreen():f.webkitRequestFullScreen?f.webkitRequestFullScreen():(f=document.body,document.documentElement.style.cssText="width:100%;height:100%;overflow:hidden;",f.style.cssText="width:100%;height:100%;overflow:hidden;",c.style.cssText="width:100%;height:100%;overflow:hidden;;margin:0px;padding:0px;",document.IsFullScreen=!0));Q(this.playerElm,"zwp-fullscreen");d.setAttribute("data-action","exitfullscreen");if(!this.setupFullscrBtn){c=this.onfullscrchange;
f=this.videoEl;var h=document.webkitExitFullscreen||document.webkitCancelFullScreen?"webkitfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":document.msExitFullscreen?"MSFullscreenChange":"webkitfullscreenchange";document.addEventListener("fullscreenchange",c,!1);h&&document.addEventListener(h,c,!1);f&&Qa&&(f.addEventListener("webkitbeginfullscreen",c),f.addEventListener("webkitendfullscreen",c));this.setupFullscrBtn=d}}}else Ia()&&this.playerElm&&(this._config.fluid&&(Q(this.playerElm,
"zwp-fluid"),this.playerElm.style.height="0",c=this.videoEl,this.playerElm.style.paddingTop=c.videoHeight&&c.videoWidth?c.videoHeight*100/c.videoWidth+"%":"64px"),Sa(this.playerElm),R(this.playerElm,"zwp-fullscreen"),d.setAttribute("data-action","enterfullscreen"),d.setAttribute("title",O("enterFullScreen","Enter full screen")))}.bind(g);g.setFullscreenWin=function(c,d){this.playerElm&&(c?this.isFullscrWin||(Q(this.playerElm,"zwp-fullscreen-win"),d.setAttribute("data-action","exitfullscreenWin"),
this.isFullscrWin=!0,this.reposDanmuToolbar(!0),(c=this.playerElm.parentNode)&&c.tagName!=="BODY"&&(this.oldWrapZIndex=c.style.zIndex,c.style.zIndex=99999999)):this.isFullscrWin&&(typeof this.oldWrapZIndex!=="undefined"&&(c=this.playerElm.parentNode,c.style.zIndex=this.oldWrapZIndex,delete this.oldWrapZIndex),R(this.playerElm,"zwp-fullscreen-win"),d.setAttribute("data-action","enterfullscreenWin"),delete this.isFullscrWin,this.reposDanmuToolbar(!1)))}.bind(g);g.setMuted=function(c){this.videoEl&&
(this.videoEl.muted=c)&&(this.oldVolume=this.videoEl.volume);c?(Q(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","unmute")):(this.oldVolume&&(this.videoEl.volume=this.oldVolume,delete this.oldVolume),R(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","mute"));this.mutedTipBox&&(this.popup_layers.removeChild(this.mutedTipBox),this.popup_layers.style.display=null,delete this.mutedTipBox)}.bind(g);g.setVolume=function(c){this.videoEl&&
(this.lastVolume=c,this.videoEl.volume=c,this.audioVolumeNode&&(this.audioVolumeNode.gain.value=c))}.bind(g);g.initAudioContext=function(){if(this.videoEl&&!this.audioContext)try{this.audioContext=new (M.AudioContext||M.webkitAudioContext),this.audioSource=this.audioContext.createMediaElementSource(this.videoEl),this.audioGainNode=this.audioContext.createGain(),this.audioGainNode.gain.value=1,this.audioVolumeNode=this.audioContext.createGain(),this.audioVolumeNode.gain.value=this.lastVolume||this.videoEl.volume,
this.audioSource.connect(this.audioVolumeNode),this.audioVolumeNode.connect(this.audioGainNode),this.audioGainNode.connect(this.audioContext.destination)}catch(c){}};g.toggleSegment=function(){if(this.videoEl&&this.videoEl.duration){this.segment.isActive=!this.segment.isActive;var c=this.controlbar?this.controlbar.querySelector("#segmentLayer"):null,d=this.controlbar?this.controlbar.querySelector(".zwp-segmentBtn"):null;if(this.segment.isActive){if(c&&(c.classList.add("active"),(c=c.closest(".zwp__time-rail"))&&
c.classList.add("segment-active")),d&&d.closest(".zwp-segmentButton").classList.add("active"),this.segment.endTime===0&&(d=this.videoEl.duration||100,c=this.videoEl.currentTime||0,this.segment.startTime=c,this.segment.endTime=Math.min(c+d*.1,d)),this.updateSegmentUI(),this.setupSegmentHandlers(),this.videoEl.currentTime<this.segment.startTime||this.videoEl.currentTime>this.segment.endTime)this.videoEl.currentTime=this.segment.startTime}else c&&(c.classList.remove("active"),(c=c.closest(".zwp__time-rail"))&&
c.classList.remove("segment-active")),d&&d.closest(".zwp-segmentButton").classList.remove("active"),this.removeSegmentHandlers()}};g.updateSegmentUI=function(){if(this.videoEl&&this.videoEl.duration){var c=this.controlbar?this.controlbar.querySelector("#segmentLayer"):null;if(c){var d=c.querySelector("#segmentHandleStart"),f=c.querySelector("#segmentHandleEnd");c=c.querySelector("#segmentSelection");if(d&&f&&c){var h=this.segment.startTime/this.videoEl.duration*100,r=this.segment.endTime/this.videoEl.duration*
100;d.style.left=h+"%";f.style.left=r+"%";c.style.left=h+"%";c.style.width=r-h+"%"}}}};g.setupSegmentHandlers=function(){var c=this;if(!c.segmentHandlersSetup){var d=c.controlbar?c.controlbar.querySelector("#segmentLayer"):null;if(d){var f=d.querySelector("#segmentHandleStart"),h=d.querySelector("#segmentHandleEnd"),r=c.controlbar?c.controlbar.querySelector(".zwp__time-rail"):null;if(f&&h&&r){var B=function(K){return function(P){P.preventDefault();c.segment.isDragging=!0;c.segment.dragTarget=K;if(P=
d.querySelector("#segmentTooltip")){P.classList.remove("start-handle","end-handle");if(K==="start"){P.classList.add("start-handle");var T=d.querySelector("#segmentHandleStart");if(T){T=T.getBoundingClientRect();var X=r.getBoundingClientRect();T=T.left+T.width/2-X.left;P.style.left=T+"px";P.textContent=da(c.segment.startTime)}}else if(P.classList.add("end-handle"),T=d.querySelector("#segmentHandleEnd"))T=T.getBoundingClientRect(),X=r.getBoundingClientRect(),T=T.left+T.width/2-X.left,P.style.left=T+
"px",P.textContent=da(c.segment.endTime);P.style.transform="translateX(-50%) translateY(-100%)";P.style.display="block"}document.addEventListener("mousemove",H);document.addEventListener("mouseup",S);document.addEventListener("touchmove",H,{passive:!1});document.addEventListener("touchend",S)}},H=function(K){if(c.segment.isDragging&&c.videoEl&&c.videoEl.duration){var P=r.getBoundingClientRect();K=(K.clientX||(K.touches?K.touches[0].clientX:0))-P.left;K<0&&(K=0);K>P.width&&(K=P.width);P=K/P.width*
c.videoEl.duration;var T=d.querySelector("#segmentTooltip");c.segment.dragTarget==="start"?(P>c.segment.endTime-1&&(P=c.segment.endTime-1),c.segment.startTime=P):(P<c.segment.startTime+1&&(P=c.segment.startTime+1),c.segment.endTime=P);c.videoEl.currentTime=P;T&&(T.textContent=da(P),T.style.left=K+"px",T.style.transform="translateX(-50%) translateY(-100%)");c.updateSegmentUI()}},S=function(){c.segment.isDragging=!1;c.segment.dragTarget=null;var K=d.querySelector("#segmentTooltip");K&&(K.style.display=
"none",K.classList.remove("start-handle","end-handle"));c.videoEl.currentTime=c.segment.startTime;document.removeEventListener("mousemove",H);document.removeEventListener("mouseup",S);document.removeEventListener("touchmove",H);document.removeEventListener("touchend",S)};f.addEventListener("mousedown",B("start"));f.addEventListener("touchstart",B("start"),{passive:!1});h.addEventListener("mousedown",B("end"));h.addEventListener("touchstart",B("end"),{passive:!1});c.segmentHandlersSetup=!0}}}};g.removeSegmentHandlers=
function(){this.segmentHandlersSetup=!1};g.recordingSettings={mode:"ask"};g.recording={isRecording:!1,startTime:null,mediaRecorder:null,recordedChunks:[],timer:null,duration:0,maxDuration:14400,format:null,indicator:null,isLive:!1};g.streamContentCache=null;g.recordVideo=function(){var c=this;if(c.videoEl&&c.videoEl.src){var d=c.recording,f=null;f=c.container?c.container.querySelector(".zwp-recordBtn"):c.element?c.element.querySelector(".zwp-recordBtn"):c.playerElm?c.playerElm.querySelector(".zwp-recordBtn"):
document.querySelector(".zwp-recordBtn");d.isRecording?y(c,f):c.makeRecordingDecision(f,function(h,r){switch(h){case "show_options":p(c,f);break;case "record_video":l(c,f,"video");break;case "record_audio":l(c,f,"audio");break;default:p(c,f)}})}};g.makeRecordingDecision=function(c,d){var f=this.recordingSettings?this.recordingSettings.mode:"ask";N(this,function(h){f==="ask"?h.hasVideo&&h.hasAudio?d("show_options",h):h.hasAudio?d("record_audio",h):d("record_video",h):f==="audio"&&h.hasAudio?d("record_audio",
h):f==="video"&&h.hasAudio&&!h.hasVideo?d("record_audio",h):d("record_video",h)})};g.startHideControlbar=function(c){c.controlbar&&!c._config.fixedControlbar&&(c.hideControlbarTime=(new Date).getTime()+c._config.hideControlbarTimeout,c.hideControlbarTimer||(c.hideControlbarTimer=M.setInterval(function(){(new Date).getTime()>=c.hideControlbarTime&&(M.clearInterval(c.hideControlbarTimer),delete c.hideControlbarTimer,Ca(c.controlbar,1E3,function(d){d.style.display="none";Q(c.playerElm,"hide-cursor");
c.isControlbarhidden=!0;typeof c._config.onhideControlbar=="function"&&c._config.onhideControlbar.call(c)}))},1E3)))}.bind(g);g.buildProgressBar=function(){var c={};if(this.controlbar){var d=this.controlbar;c.rail=d.querySelector(".zwp__time-rail");c.timeInfo=d.querySelector(".zwp__time-info");if(this._config.isLive)c.rail&&(R(c.rail,"has-duration"),Q(c.rail,"zwp-hidden")),this.progressBar&&this.progressBar.streamtype||(c.timeInfo&&(c.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">Live</div>',
c.streamtype=d.querySelector(".zwp-streamtype")),this.progressBar=c);else if(c.timeInfo&&(this.progressBar&&this.progressBar.streamtype?this.progressBar.streamtype.innerHTML="VOD":(c.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">VOD</div>',c.streamtype=d.querySelector(".zwp-streamtype"))),c.rail||(d.insertAdjacentHTML("beforeend",'<div class="zwp__time-rail"></div>'),c.rail=d.querySelector(".zwp__time-rail")),R(c.rail,"zwp-hidden"),Q(c.rail,"has-duration"),this._config.disableSeek&&Q(c.rail,
"zwp_disabled"),this.progressBar&&this.progressBar.total)this.progressBar.rail&&this._config.useProgressTooltip&&(d=this.progressBar.rail.querySelector(".zwp__time-float"))&&(f=d.querySelector(".zwp__time-thumbnail"),f||(d.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),f=d.querySelector(".zwp__time-thumbnail"),this.progressBar.thumbnails=f),this._config.thumbnails?(H=this._config.thumbnails,f&&(H.rowsize=typeof H.row=="number"?H.row:Math.ceil(Math.sqrt(H.total)),f.style.width=
H.width+"px",f.style.height=H.height+"px",f.style.backgroundImage="url("+H.url+")"),d.style.width=4+H.width+"px",d.style.height=4+H.height+"px",Q(d,"zwp__thumbnail")):(d.style.width=null,d.style.height=null,f&&(f.style.width="0px",f.style.height="0px",f.style.backgroundImage=null),R(d,"zwp__thumbnail")));else{var f='<span class="zwp__time-total zwp__time-slider"><span class="zwp__bar zwp__time-buffering"></span><span class="zwp__bar zwp__time-loaded"></span><span class="zwp__bar zwp__time-current"></span><span class="zwp__time-chapter"></span><span class="zwp__time-hovered no-hover"></span><span class="zwp__time-thumb"><span class="zwp__time-thumb-content"></span></span>';
if(this._config.useProgressTooltip){var h="",r="",B="";if(typeof this._config.thumbnails==="object"&&this._config.thumbnails!=null){var H=this._config.thumbnails;typeof H.width=="number"&&typeof H.height=="number"&&typeof H.total=="number"&&(H.rowsize=typeof H.row=="number"?H.row:Math.ceil(Math.sqrt(H.total)),B=' style="width: '+(4+H.width)+"px; height: "+(4+H.height)+'px;"',r=" zwp__thumbnail",h='<div class="zwp__time-thumbnail" style="width: '+H.width+"px;height: "+H.height+"px; background-image: url("+
H.url+');"></div>')}f+='<div class="zwp__time-float'+r+'"'+B+">"+h+'<span class="zwp__time-float-current">0:00</span><span class="zwp__time-float-corner corner_external"></span><span class="zwp__time-float-corner corner_internal"></span></div>'}c.rail.innerHTML=f+'</span><div class="zwp-segment-layer" id="segmentLayer"><div class="zwp-segment-selection" id="segmentSelection"></div><div class="zwp-segment-handle zwp-segment-handle-start" id="segmentHandleStart"></div><div class="zwp-segment-handle zwp-segment-handle-end" id="segmentHandleEnd"></div><div class="zwp-segment-tooltip" id="segmentTooltip" style="display: none;"></div></div>';
c.buffering=d.querySelector(".zwp__time-buffering");c.total=d.querySelector(".zwp__time-total");c.loaded=d.querySelector(".zwp__time-loaded");c.current=d.querySelector(".zwp__time-current");c.thumb=d.querySelector(".zwp__time-thumb");c.timefloat=d.querySelector(".zwp__time-float");c.timefloatcurrent=d.querySelector(".zwp__time-float-current");c.thumbnails=d.querySelector(".zwp__time-thumbnail");c.slider=d.querySelector(".zwp__time-slider");c.hovered=d.querySelector(".zwp__time-hovered");c.chapters=
d.querySelector(".zwp__time-chapter");c.newTime=0;c.forcedHandlePause=!1;c.buffering.style.display="none";c.slider.addEventListener("dragstart",function(){return!1});this.progressBar=c;this.showTimefloat=function(K){if(this._config.useProgressTooltip){var P=K.originalEvent&&K.originalEvent.changedTouches?K.originalEvent.changedTouches[0].pageX:K.changedTouches?K.changedTouches[0].pageX:K.pageX;K=this.progressBar;var T=this.videoEl.duration;var X=z(K.total);var C=K.total.offsetWidth;P<X.left?P=X.left:
P>C+X.left&&(P=C+X.left);P-=X.left;X=P/C;K=this.progressBar;K.timefloatcurrent.innerHTML=Y(T*X);K.thumbnails&&this._config.thumbnails?(T=this._config.thumbnails,X=Math.floor(X*T.total),X>=T.total&&(X=T.total-1),T.rowsize!=0&&(K.thumbnails.style.backgroundPosition="-"+X%T.rowsize*T.width+"px -"+T.height*Math.floor(X/T.rowsize)+"px")):(T=7*K.timefloatcurrent.innerHTML.length+10,T<40&&(T=40),K.timefloat.style.width=T+"px");T=K.timefloat.offsetWidth/2;K.timefloat.style.left=(P<T?T:P>C-T?C-T:P)+"px";K.timefloat.style.display=
"block"}}.bind(this);c.slider.addEventListener("mouseenter",function(K){var P=this;if(P.videoEl){var T=P.videoEl.duration;isNaN(T)||T===Infinity||K.target!==c.slider||(c.bindMouseMoveEvent||(c.slider.addEventListener("mousemove",function(X){var C=X.target;(C===c.slider||C.closest(".zwp__time-slider"))&&P.showTimefloat(X)}),c.bindMouseMoveEvent=!0),c.timefloat&&(c.timefloat.style.display="block"))}}.bind(this));c.slider.addEventListener("mouseleave",function(){if(this.videoEl){var K=this.videoEl.duration;
isNaN(K)||K===Infinity||ha||!c.timefloat||(c.timefloat.style.display="none")}}.bind(this));var S=function(K,P){var T=this,X=c.slider.offsetWidth,C=z(c.slider);C=K.pageX-C.left;C<0?C=0:C>X&&(C=X);X=(C*100/X).toFixed(4);c.thumb.style.left=X+"%";P?(T.seekTimeProgress(X),T.lastSeekProgress=X):typeof T.lastSeekProgress!="undefined"&&Math.abs(X-T.lastSeekProgress)>1&&(T.lastSeekProgress=X,T.seekTimer||(T.seekTimer=setTimeout(function(){T.seekTimeProgress(T.lastSeekProgress);delete T.seekTimer},1E3)));K.preventDefault();
K.stopPropagation()}.bind(this);this.on_progressbar_mousemove=function(K){var P=K.target,T;if(T=ha)a:if(T=c.slider,P===T)T=!0;else{for(;P.parentNode;){if(P.parentNode===T){T=!0;break a}P=P.parentNode}T=!1}T&&S(K)}.bind(this);this.on_progressbar_mouseup=function(K){if(ha){document.removeEventListener("mousemove",this.on_progressbar_mousemove);document.removeEventListener("mouseup",this.on_progressbar_mouseup);ha=!1;delete this.isTrackingProgress;this.seekTimer&&(clearTimeout(this.seekTimer),delete this.seekTimer);
if(K.target&&(K.target.parentNode==c.thumb||K.target==c.thumb)){var P=c.slider.offsetWidth,T=z(c.slider);K=K.pageX-T.left;K<0?K=0:K>P&&(K=P);P=(K*100/P).toFixed(4);typeof this.lastSeekProgress!="undefined"?Math.abs(P-this.lastSeekProgress)>1&&this.seekTimeProgress(P):this.seekTimeProgress(P)}delete this.lastSeekProgress}}.bind(this);this.on_progressbar_mousedown=function(K){ha||this._config.disableSeek||(g.isTrackingProgress=!0,S(K,!0),document.addEventListener("mousemove",this.on_progressbar_mousemove),
document.addEventListener("mouseup",this.on_progressbar_mouseup),ha=!0,K.preventDefault(),K.stopPropagation())}.bind(this);c.slider.addEventListener("mousedown",this.on_progressbar_mousedown)}}}.bind(g);g.updateProgressBarType=function(){if(this.controlbar){var c=this.controlbar.querySelector(".zwp__time-rail");this._config.isLive?(c&&(R(c,"has-duration"),Q(c,"zwp-hidden")),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="Live",this.progressBar.streamtype.style.display=
"block")):(c&&(R(c,"zwp-hidden"),Q(c,"has-duration"),this._config.disableSeek&&Q(c,"zwp_disabled")),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="VOD",this.progressBar.streamtype.style.display="block"))}}.bind(g);g.updateDuration=function(c){if(c.controlbar){var d=c.controlbar.querySelector(".zwp__duration-container"),f=c.videoEl.duration;if(isNaN(f)||f===Infinity)d.style.display="none",c._config.isLive=!0;else{d.style.display="block";d=d.querySelector(".zwp__duration");
var h=parseInt(f/3600),r=parseInt(f%3600/60);f=parseInt(f%60);var B="";h>0&&(B+=h+":");B=r>=10?B+(r+":"):r>0?B+("0"+r+":"):B+"00:";d.innerHTML=f>=10?B+f:B+("0"+f);c.chapters&&setTimeout(function(){this.loadChapters()}.bind(c),1E3)}c.updateProgressBarType();c.syncUI()}}.bind(g);g.setProgressRail=function(c){var d=c!==void 0?c.target||c.detail.target:this.videoEl,f=null;d&&d.buffered&&d.buffered.length>0&&d.buffered.end&&this.videoEl.duration?f=d.buffered.end(d.buffered.length-1)/this.videoEl.duration:
d&&d.bytesTotal!==void 0&&d.bytesTotal>0&&d.bufferedBytes!==void 0?f=d.bufferedBytes/d.bytesTotal:c&&c.lengthComputable&&c.total!==0&&(f=c.loaded/c.total);f!==null&&(f=Math.min(1,Math.max(0,f)),this.progressBar&&this.progressBar.loaded&&(this.progressBar.loaded.style.width=f*100+"%"))}.bind(g);g.updateProgress=function(c){if(!this.isTrackingProgress&&this.progressBar&&this.progressBar.thumb){var d=this.videoEl.duration;!isNaN(d)&&d!==Infinity&&d>0&&(c+.3>=d&&(c=d),c=c/d*100,this.progressBar.thumb.style.left=
c+"%",this.progressBar.current&&(this.progressBar.current.style.width=c/100*100+"%"))}}.bind(g);g.seekTimeProgress=function(c){if(this.videoEl){var d=this.videoEl.duration;isNaN(d)||d===Infinity||(this.videoEl.currentTime=d*c/100,this.progressBar.current&&(this.progressBar.current.style.width=c+"%"))}}.bind(g);g.seekTimeProgressByTime=function(c){if(this.videoEl){var d=this.videoEl.duration;isNaN(d)||d===Infinity||(this.videoEl.currentTime=c,this.progressBar.current&&(this.progressBar.current.style.width=
c/d*100+"%"))}}.bind(g);g.on_speedItemclick=function(c){c.stopPropagation();c=c.currentTarget;if(!L(c,"active")){var d=parseFloat(c.innerText),f=c.parentNode.querySelector(".active");f&&R(f,"active");Q(c,"active");this.videoEl&&(this.videoEl.playbackRate=d);if(f=this.controlbar.querySelector(".zwp-speedBtn"))f.innerHTML=d==1?O("speed","Rate"):c.innerText}var h=c.parentNode;h.style.display="none";setTimeout(function(){h.style.display=null},1E3)}.bind(g);g.resetSpeedMenu=function(){if(this.controlbar){var c=
this.controlbar.querySelector(".zwp-speed-item.active");if(c&&c.innerText!=="1.0x"){var d=this.controlbar.querySelector(".zwp-speedBtn");d&&(d.innerHTML=O("speed","Rate"));R(c,"active");c=c.parentNode.querySelectorAll("li.zwp-speed-item");if(c.length>0)for(d=0;d<c.length;d++)if(c[d].innerText==="1.0x"){Q(c[d],"active");break}}}}.bind(g);g.syncUI=function(){if(this._config.isLive){var c=this.controlbar.querySelector(".zwp-speedButton");c&&this.controlbar.removeChild(c);R(this.controlbar,"zwp-vodplayer")}else{if(this._config.speedButton&&
(c=this.controlbar.querySelector(".zwp-speedButton"),!c)){var d=this.controlbar.querySelector(".zwp-infoButton")||this.controlbar.querySelector(".zwp-optionButton")||this.controlbar.querySelector(".zwp-volume-docker");if(d){var f=ob();c=document.createElement("div");this.controlbar.insertBefore(c,d);c.outerHTML=f;c=this.controlbar.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");c.length>0&&c.forEach(function(h){h.addEventListener("click",g.on_speedItemclick)})}}Q(this.controlbar,"zwp-vodplayer")}}.bind(g);
g.keyState={leftPressed:!1,rightPressed:!1,leftTimer:null,rightTimer:null,leftPressTime:0,rightPressTime:0,originalPlaybackRate:1,isFastForward:!1,leftRewindInterval:null,wasPlayingBeforeRewind:!1,frozenFrameTime:0,rewindStartTime:0,isRewinding:!1,rewindCompleted:!1};g.onKeydown=function(c){if(c){var d=this,f=document.activeElement;if(!f||!f.classList.contains("barrage_inp_text")&&f.tagName!=="INPUT"&&f.tagName!=="TEXTAREA"&&f.contentEditable!=="true"||c.keyCode===27)if(c.keyCode===27)if(d.contextMenu)d.hideContextMenu(),
c.stopPropagation(),c.preventDefault();else if(d.isFullscrWin&&d.controlbar){var h=d.controlbar.querySelector(".zwp-fullscrWinBtn");h&&(d.setFullscreenWin(!1,h),c.stopPropagation(),c.preventDefault())}else Ia()&&(c.stopPropagation(),c.preventDefault(),d.playerElm&&Sa(d.playerElm));else if(c.keyCode===13)d.danmuToolbar&&(h=d.danmuToolbar.querySelector(".zwp_switch"))&&L(h,"switch_on")&&(h=d.danmuToolbar.querySelector(".barrage_inp_text"))&&(f=document.activeElement,f===h?(c=h.value.trim())&&d.sendDanmu(c)&&
(h.value=""):(c.preventDefault(),h.focus()));else if(c.keyCode===38)c.preventDefault(),d.videoEl&&(c=d.videoEl.volume,c+=.05,c>1&&(c=1),d.setVolume(c),d.setMuted(!1),h=parseInt(c*100)+"%",h={icon:"speaker",text:h},d.toast(h,1200,!1),d.positionVolumeThumb&&d.positionVolumeThumb(c));else if(c.keyCode===40)c.preventDefault(),d.videoEl&&(c=d.videoEl.volume,c-=.05,c<0&&(c=0),d.setVolume(c),d.setMuted(c===0),h=parseInt(c*100)+"%",c===0&&(h=O("muted","Muted")),h={icon:"speaker",text:h},d.toast(h,1200,!1),
d.positionVolumeThumb&&d.positionVolumeThumb(c));else if(c.keyCode===32||c.keyCode===179)c.preventDefault(),d._config.isLive||d._config.disablePlayBtn||(d.playbtn?d.playbtn.click():d.controlbar&&(d.playbtn=d.controlbar.querySelector(".zwp-playbtn"),d.playbtn&&d.playbtn.click()));else if(c.keyCode===77||c.keyCode===109)d.videoEl&&(d.videoEl.muted?(d.toast(O("unmuted","Unmuted"),1E3,!1,!0),d.setMuted(!1)):(d.toast(O("muted","Muted"),1E3,!1,!0),d.setMuted(!0)));else if(c.keyCode===68||c.keyCode===100){if(c.preventDefault(),
d.danmuToolbar&&(h=d.danmuToolbar.querySelector(".zwp_switch")))h.click(),L(h,"switch_on")?d.toast(O("danmuEnabled","Danmu Enabled"),1E3,!1,!0):d.toast(O("danmuDisabled","Danmu Disabled"),1E3,!1,!0)}else if(c.shiftKey&&c.keyCode===49)c.preventDefault(),d.videoEl&&(d.videoEl.playbackRate=1,d.toast(O("playbackSpeed1x","Playback Speed: 1x"),1E3,!1,!0));else if(c.shiftKey&&c.keyCode===50)c.preventDefault(),d.videoEl&&(d.videoEl.playbackRate=2,d.toast(O("playbackSpeed2x","Playback Speed: 2x"),1E3,!1,!0));
else if(c.keyCode===76||c.keyCode===108)c.preventDefault(),d.playerElm&&(L(d.playerElm,"zwp-state-light-off")?d.lightOn():d.lightOff());else if(c.keyCode===48)c.preventDefault(),d._config.isLive||d._config.disablePlayBtn||!d.videoEl||d.videoEl.readyState<2||(d.videoEl.currentTime=d.segment&&d.segment.isActive&&d.segment.startTime!==void 0?d.segment.startTime:0,d.videoEl.play().then(function(){d.setplaystate(!0)}).catch(function(r){r.name==="NotAllowedError"?d.toast(O("autoplayBlocked","Autoplay blocked by browser"),
2E3,!1,!0):d.toast(O("playbackFailed","Playback failed")+": "+r.message,2E3,!1,!0)}));else if(c.keyCode===37)c.preventDefault(),!d.videoEl||d._config.isLive||d.videoEl.readyState<2||d.keyState.leftPressed||(c=0,d.segment&&d.segment.isActive&&d.segment.startTime!==void 0&&(c=d.segment.startTime),d.videoEl.currentTime<=c||(d.keyState.leftPressed=!0,d.keyState.leftPressTime=Date.now(),d.keyState.wasPlayingBeforeRewind=!0,d.seekVideo(-5),d.keyState.leftTimer=setTimeout(function(){if(d.keyState.leftPressed){d.keyState.isRewinding=
!0;d.keyState.frozenFrameTime=d.videoEl.currentTime;d.keyState.rewindStartTime=Date.now();d.videoEl.paused||d.videoEl.pause();d.bigPlayOverlay&&(d.bigPlayOverlay.style.display="none");var r=d.videoEl.duration||1;r=r>=3600?20:r>=1800?25:r>=600?30:80;d.timeSpan||(d.timeSpan=d.controlbar?d.controlbar.querySelector(".zwp__currenttime"):null);d.keyState.leftRewindInterval=setInterval(function(){if(d.keyState.leftPressed&&d.videoEl){var B=d.videoEl.currentTime-5,H=0;d.segment&&d.segment.isActive&&d.segment.startTime!==
void 0&&(H=d.segment.startTime);B<=H?(d.videoEl.currentTime=H,clearInterval(d.keyState.leftRewindInterval),clearTimeout(d.keyState.leftTimer),d.keyState.leftRewindInterval=null,d.keyState.leftTimer=null,d.videoEl.play().then(function(){d.setplaystate(!0)}).catch(function(S){}),d.keyState.frozenFrameTime=0,d.keyState.isRewinding=!1,d.keyState.rewindCompleted=!0):(d.videoEl.currentTime=B,d.updateProgress&&d.updateProgress(B),d.timeSpan&&(d.timeSpan.innerHTML=Y(B)))}},r)}},300)));else if(c.keyCode===
39)c.preventDefault(),!d.videoEl||d._config.isLive||d.videoEl.readyState<2||d.keyState.rightPressed||(c=d.videoEl.duration,d.segment&&d.segment.isActive&&d.segment.endTime!==void 0&&(c=d.segment.endTime),d.videoEl.currentTime>=c||(d.keyState.rightPressed=!0,d.keyState.rightPressTime=Date.now(),d.keyState.originalPlaybackRate=d.videoEl.playbackRate||1,d.keyState.maxBoundary=c,d.videoEl.paused&&(d.videoEl.play(),d.setplaystate(!0)),d.keyState.rightTimer=setTimeout(function(){d.keyState.rightPressed&&
(d.videoEl.playbackRate=3,d.keyState.isFastForward=!0)},300)));else if(c.keyCode===70||c.keyCode===102)c.preventDefault(),d.controlbar&&(c=d.controlbar.querySelector('[data-action="enterfullscreen"], [data-action="exitfullscreen"]'))&&c.click();else if(c.keyCode===82||c.keyCode===114)c.preventDefault(),d._config.recordButton&&(c=d.controlbar?d.controlbar.querySelector(".zwp-recordBtn"):null)&&c.click()}}.bind(g);g.onKeyup=function(c){if(c){var d=this;if(c.keyCode===37)c.preventDefault(),d.keyState.leftPressed&&
(d.keyState.leftPressed=!1,d.keyState.leftTimer&&(clearTimeout(d.keyState.leftTimer),d.keyState.leftTimer=null),d.keyState.leftRewindInterval&&(clearInterval(d.keyState.leftRewindInterval),d.keyState.leftRewindInterval=null),d.videoEl&&d.videoEl.play().then(function(){d.setplaystate(!0)}).catch(function(h){}),d.keyState.frozenFrameTime=0,d.keyState.isRewinding=!1,d.keyState.rewindCompleted=!1);else if(c.keyCode===39&&(c.preventDefault(),d.keyState.rightPressed)){d.keyState.rightPressed=!1;d.keyState.rightTimer&&
(clearTimeout(d.keyState.rightTimer),d.keyState.rightTimer=null);if(Date.now()-d.keyState.rightPressTime<300){c=d.videoEl.duration;d.segment&&d.segment.isActive&&d.segment.endTime!==void 0&&(c=d.segment.endTime);var f=d.videoEl.currentTime+5;if(f>c)f=c;else{d.seekVideo(5);return}d.videoEl.currentTime=f;d.updateProgress&&d.updateProgress(f);d.timeSpan&&(d.timeSpan.innerHTML=Y(f))}d.keyState.isFastForward&&d.videoEl&&(d.videoEl.playbackRate=d.keyState.originalPlaybackRate,d.keyState.isFastForward=!1)}}}.bind(g);
g.on_volumeBoostSliderChange=function(c){var d=c.currentTarget;c=d.getAttribute("data-action");this.volumeBoostConfig||(this.volumeBoostConfig={volumeBoost:0});Pa(d);typeof this.volumeBoostConfig[c]!=="undefined"&&(d=parseFloat(d.value),this.volumeBoostConfig[c]=d,this.audioContext||this.initAudioContext(),this.audioGainNode&&(this.audioGainNode.gain.value=Math.pow(10,d/20)))}.bind(g);g.on_colorSliderChange=function(c){var d=c.currentTarget;c=d.getAttribute("data-action");this.colors||(this.colors=
{brightness:0,contrast:0,saturation:0,hue:0});Pa(d);if(typeof this.colors[c]!=="undefined"&&(d=parseInt(d.value),c==="hue"?this.colors.hue=parseInt(d*180/100):this.colors[c]=d,this.videoEl)){c=null;d=this.colors;d.brightness&&(c="brightness("+(100+d.brightness)+"%)");if(d.contrast){var f=100+d.contrast;c=(c?c+" ":"")+("contrast("+f+"%)")}d.saturation&&(f=100+d.saturation,c=(c?c+" ":"")+("saturate("+f+"%)"));d.hue&&(d=d.hue,c=(c?c+" ":"")+("hue-rotate("+d+"deg)"));this.videoEl.style.filter=c}}.bind(g);
g.createVolumeBoostPanel=function(){var c=this,d='<div class="zwp-volumeBoostPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+O("audioEffectAdjustment","Audio Effects")+'</div><div class="form-row"><label class="row-label">'+O("volumeBoost","Volume Boost")+'</label><div class="row-content">'+Ja("","volumeBoost",-12,12,.1,!0)+'</div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetVolumeBoost">'+
O("reset","Reset")+"</button></div></div>";c.overlay_layers.insertAdjacentHTML("beforeend",d);d=c.overlay_layers.querySelector(":scope > .zwp-volumeBoostPanel");var f=d.querySelector(".closeBtn");f&&f.addEventListener("click",function(h){h.stopPropagation();var r=h.currentTarget.closest(".zwp-volumeBoostPanel");Ca(r,500,function(){r.remove()});delete c.volumeBoostPanel});f=d.querySelectorAll('input[type="range"]');f.length>0&&f.forEach(function(h){h.addEventListener("input",g.on_volumeBoostSliderChange);
if(c.volumeBoostConfig){var r=h.getAttribute("data-action");typeof c.volumeBoostConfig[r]!=="undefined"&&(h.value=c.volumeBoostConfig[r],Pa(h))}});d.addEventListener("mousedown",function(h){h.stopPropagation()});d.addEventListener("dblclick",function(h){h.stopPropagation()});d.addEventListener("click",function(h){h.stopPropagation()});(f=d.querySelector(".zwp-form-button"))&&f.addEventListener("click",function(h){h.preventDefault();h.stopPropagation();h=h.currentTarget.closest(".zwp-volumeBoostPanel").querySelectorAll('input[type="range"]');
h.length>0&&h.forEach(function(r){parseFloat(r.value)!==0&&(r.value=0,u(r,"input"))});c.audioGainNode&&(c.audioGainNode.gain.value=1)});return c.volumeBoostPanel=d}.bind(g);g.createColorSettingPanel=function(){var c=this,d='<div class="zwp-colorSettingPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+O("videoColorAdjustment","Video Color Adjustment")+'</div><div class="form-row"><label class="row-label">'+O("brightness","Brightness")+
'</label><div class="row-content">'+Ja("","brightness")+'</div></div><div class="form-row"><label class="row-label">'+O("contrast","Contrast")+'</label><div class="row-content">'+Ja("","contrast")+'</div></div><div class="form-row"><label class="row-label">'+O("saturation","Saturation")+'</label><div class="row-content">'+Ja("","saturation")+'</div></div><div class="form-row"><label class="row-label">'+O("hue","Hue")+'</label><div class="row-content">'+Ja("","hue")+'</div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetcolors">'+
O("reset","Reset")+"</button></div></div>";c.overlay_layers.insertAdjacentHTML("beforeend",d);d=c.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");var f=d.querySelector(".closeBtn");f&&f.addEventListener("click",function(h){h.stopPropagation();var r=h.currentTarget.closest(".zwp-colorSettingPanel");Ca(r,500,function(){r.remove()});delete c.colorSettingPanel});f=d.querySelectorAll('input[type="range"]');f.length>0&&f.forEach(function(h){h.addEventListener("input",g.on_colorSliderChange);
if(c.colors){var r=h.getAttribute("data-action");typeof c.colors[r]!=="undefined"&&(h.value=c.colors[r],Pa(h))}});d.addEventListener("mousedown",function(h){h.stopPropagation()});d.addEventListener("dblclick",function(h){h.stopPropagation()});d.addEventListener("click",function(h){h.stopPropagation()});(f=d.querySelector(".zwp-form-button"))&&f.addEventListener("click",function(h){h.preventDefault();h.stopPropagation();h=h.currentTarget.closest(".zwp-colorSettingPanel").querySelectorAll('input[type="range"]');
h.length>0&&h.forEach(function(r){parseInt(r.value)!==0&&(r.value=0,u(r,"input"))})});return c.colorSettingPanel=d}.bind(g);g.createRecordingSettingsPanel=function(){var c=this,d='<div class="zwp-recordingSettingsPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+O("recordingSettingsTitle","Recording Settings")+'</div><div class="form-row"><div class="zwp-radio-group"><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="ask" checked><span class="zwp-radio-label">'+
O("recordingOptionAsk","Ask Every Time")+'</span></label><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="video"><span class="zwp-radio-label">'+O("recordingOptionVideo","Record Video Directly")+'</span></label><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="audio"><span class="zwp-radio-label">'+O("recordingOptionAudio","Record Audio Directly")+'</span></label></div></div><div class="form-row recording-note"><div class="zwp-note-text">'+
O("recordingNote","Note: If no audio is present, video will be recorded directly")+"</div></div></div>";c.overlay_layers.insertAdjacentHTML("beforeend",d);d=c.overlay_layers.querySelector(":scope > .zwp-recordingSettingsPanel");var f=d.querySelector(".closeBtn");f&&f.addEventListener("click",function(h){h.stopPropagation();var r=h.currentTarget.closest(".zwp-recordingSettingsPanel");Ca(r,500,function(){r.remove()});delete c.recordingSettingsPanel});if(f=d.querySelector('input[name="recordingOption"][value="'+
(c.recordingSettings.mode||"ask")+'"]'))f.checked=!0;f=d.querySelectorAll('input[name="recordingOption"]');f.length>0&&f.forEach(function(h){h.addEventListener("change",function(r){c.recordingSettings.mode=r.target.value});h.value===c.recordingSettings.mode&&(h.checked=!0)});d.addEventListener("mousedown",function(h){h.stopPropagation()});d.addEventListener("dblclick",function(h){h.stopPropagation()});d.addEventListener("click",function(h){h.stopPropagation()});return c.recordingSettingsPanel=d}.bind(g);
g.createShortcutHelpPanel=function(){var c=this,d='<div class="zwp-shortcutHelpPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+O("keyboardShortcuts","Keyboard Shortcuts")+'</div><div class="shortcut-list"><div class="shortcut-item"><div class="shortcut-key">Space/MediaKey </div><div class="shortcut-desc">'+O("shortcutPlayPause","Play / Pause")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2192</div><div class="shortcut-desc">'+
O("shortcutSeekRight","Single press: forward 5s, hold: speed playback")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2190</div><div class="shortcut-desc">'+O("shortcutSeekLeft","Rewind 5s (hold for continuous operation)")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2191 / \u2193</div><div class="shortcut-desc">'+O("shortcutVolume","Increase / decrease volume by 5%")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Esc</div><div class="shortcut-desc">'+
O("shortcutExit","Close menu / Exit fullscreen")+'</div></div><div class="shortcut-item"><div class="shortcut-key">F</div><div class="shortcut-desc">'+O("shortcutFullscreen","Fullscreen / Exit fullscreen")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Enter</div><div class="shortcut-desc">'+O("shortcutSendDanmu","Send Danmu")+'</div></div><div class="shortcut-item"><div class="shortcut-key">D</div><div class="shortcut-desc">'+O("shortcutDanmu","Enable / Disable Danmu")+'</div></div><div class="shortcut-item"><div class="shortcut-key">M</div><div class="shortcut-desc">'+
O("shortcutMute","Mute / Unmute")+'</div></div><div class="shortcut-item"><div class="shortcut-key">0</div><div class="shortcut-desc">'+O("shortcutRestart","Restart")+'</div></div><div class="shortcut-item"><div class="shortcut-key">R</div><div class="shortcut-desc">'+O("shortcutRecord","Start / Stop Recording")+'</div></div><div class="shortcut-item"><div class="shortcut-key">L</div><div class="shortcut-desc">'+O("shortcutLight","Light Toggle")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Shift + 1</div><div class="shortcut-desc">'+
O("shortcutSpeed1x","1x Speed (Normal)")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Shift + 2</div><div class="shortcut-desc">'+O("shortcutSpeed2x","2x Speed")+"</div></div></div></div>";c.overlay_layers.insertAdjacentHTML("beforeend",d);d=c.overlay_layers.querySelector(":scope > .zwp-shortcutHelpPanel");var f=d.querySelector(".closeBtn");f&&f.addEventListener("click",function(h){h.stopPropagation();var r=h.currentTarget.closest(".zwp-shortcutHelpPanel");Ca(r,500,function(){r.remove()});
delete c.shortcutHelpPanel});d.addEventListener("mousedown",function(h){h.stopPropagation()});d.addEventListener("dblclick",function(h){h.stopPropagation()});d.addEventListener("click",function(h){h.stopPropagation()});d.style.display="block";return c.shortcutHelpPanel=d}.bind(g);var xa=function(c,d){if(c=c.querySelector(".zwp-optionPanel"))c=c.querySelectorAll(".zwp_switch"),c.length>0&&c.forEach(function(f){var h=f.getAttribute("data-action");d.indexOf(h)!==-1&&L(f,"switch_on")&&R(f,"switch_on")})};
g.on_optionItemclick=function(c){c.stopPropagation();c=c.currentTarget;L(c,"zwp_switch")&&Ra(c);var d=c.getAttribute("data-action");if(d==="mirror")this.videoEl&&(c=L(c,"switch_on"),this._config.video_mirror=c,this.flipMirrorVideo(),c&&(this._config.video_rotated=0,xa(this.controlbar,["rotated270","rotated90"])));else if(d==="flip")this.videoEl&&(c=L(c,"switch_on"),this._config.video_flip=c,this.flipMirrorVideo(),c&&(this._config.video_rotated=0,xa(this.controlbar,["rotated270","rotated90"])));else if(d===
"rotated90")this.videoEl&&(c=L(c,"switch_on"),this._config.video_rotated=c?90:0,this.rotateVideo(),c&&(this._config.video_mirror=!1,this._config.video_flip=!1,xa(this.controlbar,["mirror","flip","rotated270"])));else if(d==="rotated270")this.videoEl&&(c=L(c,"switch_on"),this._config.video_rotated=c?270:0,this.rotateVideo(),c&&(this._config.video_mirror=!1,this._config.video_flip=!1,xa(this.controlbar,["mirror","flip","rotated90"])));else if(d==="loop")c=L(c,"switch_on"),this._config.loop=c;else if(d===
"showRecordingConfig"){var f=c.closest(".zwp-optionPanel");if(f&&(c=f.closest(".zwp-optionButton"))){c=this.overlay_layers.querySelector(":scope > .zwp-recordingSettingsPanel");if(!c&&(c=this.createRecordingSettingsPanel(),!c))return;c.style.display="block";f.style.display="none";setTimeout(function(){f.style.display=null},1E3)}}else if(d==="showVolumeBoostConfig"){if(f=c.closest(".zwp-optionPanel"))if(c=f.closest(".zwp-optionButton")){c=this.overlay_layers.querySelector(":scope > .zwp-volumeBoostPanel");
if(!c&&(c=this.createVolumeBoostPanel(),!c))return;c.style.display="block";f.style.display="none";setTimeout(function(){f.style.display=null},1E3)}}else if(d==="showColorConfig"&&(f=c.closest(".zwp-optionPanel"))&&(c=f.closest(".zwp-optionButton"))){c=this.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");if(!c&&(c=this.createColorSettingPanel(),!c))return;c.style.display="block";f.style.display="none";setTimeout(function(){f.style.display=null},1E3)}}.bind(g);g.flipMirrorVideo=function(){var c=
null;this._config.video_flip&&(c="rotateX(180.00deg)");this._config.video_mirror&&(c=c?c+" rotateY(180.00deg)":" rotateY(180.00deg)");this.videoEl.style.width="100%";this.videoEl.style.height="100%";this.videoEl.style.transform=c}.bind(g);g.rotateVideo=function(){var c=null,d=this.videoEl.parentNode;if(d&&d===this.videoWrapper)if(this._config.video_rotated){var f=d.offsetHeight;d=d.offsetWidth;var h=this.videoEl.videoHeight;this.videoEl.videoWidth&&h&&(this.videoEl.style.width=f+"px",this.videoEl.style.height=
d+"px",this.videoEl.style.transformOrigin="center center",h=(d-f)/2,f=(f-d)/2,this._config.video_rotated===90?c="translate("+h+"px, "+f+"px) rotate(0.25turn)":this._config.video_rotated===270&&(c="translate("+h+"px, "+f+"px) rotate(0.75turn)"),this.videoEl.style.transform=c)}else this.videoEl.style.transform&&(this.videoEl.style.transform=null,this.videoEl.style.width="100%",this.videoEl.style.height="100%")}.bind(g);g.setupEventsHandler=function(){var c=this,d=function(B){c.loadingOverlay&&(c.loadingOverlay.style.display=
"none");c.videoEl.play();c.setplaystate(!0);c.updateDuration(c);c._config.isLive&&c.controlbar&&(c.controlbar.querySelector(".zwp__duration-container").style.display="none");c._config.fluid&&(B=c.videoEl,Q(c.playerElm,"zwp-fluid"),c.playerElm.style.maxWidth="100%",c.playerElm.style.width="100%",c.playerElm.style.height="0",c.playerElm.style.paddingTop=B.videoHeight&&B.videoWidth?B.videoHeight*100/B.videoWidth+"%":c._config.keepAudioWindow?"264px":"64px");c.buildProgressBar()};c.videoEl.addEventListener("loadedmetadata",
d);var f=c.videoEl,h=function(B){var H=!0;B.type==="ended"?!c._config.isLive&&c._config.loop?(M.setTimeout(function(){c.videoEl.currentTime=0;c.videoEl.play()},1E3),H=!1):(c.isEnded=!0,c.setplaystate(!1),c._config.isLive&&c._config.reconnect&&c.mpegtsPlayer&&(setTimeout(function(){c.lastDecodedFrames=0;c.closecall(c);c.openMpegts()},1E3),H=!1)):B.type==="play"?(delete c.isEnded,typeof c.postSeekTime!=="undefined"&&(c.seekTimeProgressByTime(c.postSeekTime),delete c.postSeekTime)):B.type==="pause"?
c.setplaystate(!1):B.type==="playing"&&c.setplaystate(!0);c.progressBar&&c.progressBar.buffering&&("play playing pause seeked ended error".split(" ").includes(B.type)?c.progressBar.buffering.style.display="none":["seeking","waiting","loadeddata"].includes(B.type)&&(c.progressBar.buffering.style.display=""));H&&typeof c._config.onmediaevent==="function"&&c._config.onmediaevent.call(c,B)},r=function(B){var H=this.currentTime;typeof c.postSeekTime!=="undefined"&&(H=c.postSeekTime);c.segment.isActive&&
!c.segment.isDragging&&H>=c.segment.endTime&&(c.keyState&&c.keyState.isFastForward?(this.currentTime=c.segment.endTime,c.videoEl.playbackRate=c.keyState.originalPlaybackRate||1,c.keyState.isFastForward=!1,c.keyState.rightPressed=!1):this.currentTime=c.segment.startTime);if(typeof c._config.ontimeupdate==="function")c._config.ontimeupdate(H);!c.timeSpan&&c.controlbar&&(c.timeSpan=c.controlbar.querySelector(".zwp__currenttime"));c.timeSpan&&(c.timeSpan.innerHTML=Y(H));c.updateProgress(H);c.setProgressRail(B);
c.renderSubtitles(H)};f.addEventListener("play",h);f.addEventListener("playing",h);f.addEventListener("pause",h);f.addEventListener("seeked",h);f.addEventListener("ended",h);f.addEventListener("error",h);f.addEventListener("seeking",h);f.addEventListener("waiting",h);f.addEventListener("timeupdate",r);c.keyboardEventsInitialized?c._config.localPlayback&&(document.removeEventListener("keydown",c.onKeydown),document.removeEventListener("keyup",c.onKeyup),document.addEventListener("keydown",c.onKeydown),
document.addEventListener("keyup",c.onKeyup)):(document.addEventListener("keydown",c.onKeydown),document.addEventListener("keyup",c.onKeyup),c.keyboardEventsInitialized=!0);g.videoEventsSetuped=!0;g.removeVideoEventHandlers=function(){if(this.videoEventsSetuped){var B=this.videoEl;B.removeEventListener("loadedmetadata",d);B.removeEventListener("play",h);B.removeEventListener("playing",h);B.removeEventListener("pause",h);B.removeEventListener("seeked",h);B.removeEventListener("ended",h);B.removeEventListener("error",
h);B.removeEventListener("seeking",h);B.removeEventListener("waiting",h);B.removeEventListener("timeupdate",r);document.removeEventListener("keydown",this.onKeydown);document.removeEventListener("keyup",this.onKeyup);this.keyState&&(this.keyState.leftTimer&&clearTimeout(this.keyState.leftTimer),this.keyState.rightTimer&&clearTimeout(this.keyState.rightTimer),this.keyState.leftRewindInterval&&clearInterval(this.keyState.leftRewindInterval));delete this.videoEventsSetuped}}}.bind(g);g.showMediainfo=
function(c){var d=this;if(d.overlay_layers){var f=d.overlay_layers.querySelector(".zwp__mediainfo-viewer");if(f){if(!c){c=f.querySelector(".closeBtn");var h=document.createEvent("Event");h.initEvent("click",!0,!0);c.dispatchEvent(h)}}else{c='<button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+(O("media-prop","Media properties")+"</div>");d.mediaInfo?(h=d.mediaInfo,h.hasVideo&&(c+='<div class="info-item"><span class="info-label">Video</span><span class="info-value">'+
h.vCodec+"</span></div>",c+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+h.width+"</span></div>",c+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+h.height+"</span></div>",c+='<div class="info-item"><span class="info-label">FPS</span><span class="info-value">'+h.fps+"</span></div>",c+='<div class="info-item"><span class="info-label">Profile</span><span class="info-value">'+h.profile+"</span></div>",c+='<div class="info-item"><span class="info-label">Level</span><span class="info-value">'+
h.level+"</span></div>"),h.hasAudio&&(c+='<div class="info-item"><span class="info-label">Audio</span><span class="info-value">'+h.aCodec+"</span></div>",c+='<div class="info-item"><span class="info-label">SampRate</span><span class="info-value">'+h.sampleRate+"</span></div>",c+='<div class="info-item"><span class="info-label">Channel</span><span class="info-value">'+h.channels+"</span></div>")):d.videoEl?(h=d.videoEl,h.videoWidth&&(c+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+
h.videoWidth+"</span></div>",c+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+h.videoHeight+"</span></div>"),h.duration&&(c+='<div class="info-item"><span class="info-label">Duration</span><span class="info-value">'+Y(h.duration)+"</span></div>")):c+='<div class="info-item"><div class="row-text">No More Media Info</div></div>';f=document.createElement("div");f.setAttribute("class","zwp__mediainfo-viewer zwp-popupwindow");f.innerHTML=c;d.overlay_layers.appendChild(f);
f.addEventListener("click",function(B){B.stopPropagation()});var r=function(B){B.preventDefault();B.stopPropagation();Ca(f,500,function(){f.remove()});d.overlay_layers.removeEventListener("click",r);delete d.infoViewer};c=f.querySelector(".closeBtn");c.addEventListener("click",r);d.infoViewer=f}}}.bind(g);g.setMediainfo=function(c,d){c={engine:c,hasVideo:d.hasVideo,hasAudio:d.hasAudio};if(d.hasVideo){var f=d.videoCodec;f=f.indexOf("avc1")>=0?"H264/AVC":f.indexOf("hvc")>=0?"H265/HEVC":"Unknown";c.vCodec=
f;c.width=d.width;c.height=d.height;c.fps=d.fps;typeof c.fps==="number"&&(c.fps=c.fps.toFixed(2));c.profile=d.profile;c.level=d.level}d.hasAudio&&(f=d.audioCodec,f=f.indexOf("mp4a.40.2")>=0?"AAC-LC":f.indexOf("mp4a.40.5")>=0?"HE-AAC":f.indexOf("mp3")>=0?"MP3":"Unknown",c.aCodec=f,c.sampleRate=d.audioSampleRate,c.channels=d.audioChannelCount);this.mediaInfo=c}.bind(g);g.loadChapters=function(){var c=this;if(c.chapters)if(typeof c.chapters==="object"&&c.chapters instanceof File)c.detectMimeType(c.chapters).then(function(S){return c.isValidChapterFile(c.chapters,
S).then(function(K){return K?!0:(c.toast(O("unsupportedChapterFormat","Unsupported chapter format")+": "+S,3E3,!0),!1)})}).then(function(S){S&&(S=new FileReader,S.onload=function(K){K=K.target.result;var P=c.getFileExtension(c.chapters.name);if(P===".vtt"||P===".webvtt"){if(K.substr(0,6)==="WEBVTT"&&(K=Ka(K))){var T=[];for(P=0;P<K.body.length;P++){var X=K.body[P];T.push({title:X.content,time:Y(X.from),desc:"no desc",image:null})}}}else if(P===".json")try{T=JSON.parse(K)}catch(C){}T&&Array.isArray(T)?
(c.chapters=T,c.loadChapters()):c.toast(O("invalidChapterFormat","Invalid chapter file format"),3E3,!0)},S.onerror=function(){c.toast(O("failedToReadChapter","Failed to read chapter file"),3E3,!0)},S.readAsText(c.chapters))}).catch(function(S){c.toast(O("chapterValidationFailed","Chapter file validation failed"),3E3,!0)});else{if(typeof c.chapters==="string")if(c.chapters.charAt(0)==="[")c.chapters=JSON.parse(c.chapters);else{if(c.chapters.substr(0,4)==="http")Va(c.chapters,function(S){if(S.substr(0,
6)==="WEBVTT")c.chapters=S,c.loadChapters();else if(S=JSON.parse(S))c.chapters=S,c.loadChapters()},function(S){});else if(c.chapters.substr(0,6)==="WEBVTT"){var d=Ka(c.chapters);if(d){for(var f=[],h=0;h<d.body.length;h++){var r=d.body[h];f.push({title:r.content,time:Y(r.from),desc:"no desc",image:null})}c.chapters=f;c.loadChapters()}else delete c.chapters}else delete c.chapters;return}else if(!Array.isArray(c.chapters))return;d=c.videoEl.duration;if(!isNaN(d)&&d!==Infinity){if(d=sb(d,c.chapters))if(f=
c.controlbar.querySelector(".zwp__time-chapter"))f.innerHTML=d,d=f.querySelectorAll(".zwp__chapter_dot"),d.length>0&&d.forEach(function(S){S.addEventListener("mousedown",function(K){K.stopPropagation();K=Oa(this.getAttribute("data-time"));c.seekTimeProgressByTime(K)})});if(c._config.chapterButton&&(d=c.controlbar.querySelector(".zwp__time-info"))){var B=d.querySelector(".zwp-chapterButton");B&&B.remove();var H=tb(c.chapters);H&&((f=d.querySelector(".zwp_danmuBarDock"))?f.insertAdjacentHTML("beforebegin",
H.html):d.insertAdjacentHTML("beforeend",H.html),B=d.querySelector(".zwp-chapterButton"),d=B.querySelector(".zwp-chapterlist"),f=d.querySelectorAll(".chapter-item"),f.length>0&&f.forEach(function(S){S.addEventListener("click",function(K){K.stopPropagation();K=Oa(this.getAttribute("data-time"));c.seekTimeProgressByTime(K)})}),d.addEventListener("mousedown",function(S){S.stopPropagation()}),d.addEventListener("dblclick",function(S){S.stopPropagation()}),B.querySelector(".zwp-chapterBtn").addEventListener("click",
function(S){S.stopPropagation();if(S=B.querySelector(".zwp-chapterPanel")){var K=c.overlay_layers.offsetHeight;if(!(K<100)){K-=100;K>400&&(K=400);var P=H.titleWidth;P>200&&(P=200);S.style.height=K+"px";S.style.width=80+P+10+"px";S.style.display!=="block"?(K=S.querySelector(".zwp-list-inner"),$$(K).niceScroll({cursorborder:"",cursorcolor:"rgb(179 178 178 / 67%)",boxzoom:!1,rightdock:4}),S.style.opacity=1,S.style.display="block"):S.style.display="none"}}}),(d=B.querySelector(".closeBtn"))&&d.addEventListener("click",
function(S){S.stopPropagation();var K=S.currentTarget.closest(".zwp-chapterPanel");Ca(K,500,function(){K.style.display="none"})}))}}}}.bind(g);g.removeChapters=function(){if(this.chapters){if(this.controlbar){var c=this.controlbar.querySelector(".zwp__time-chapter");c&&(c.innerHTML="")}(c=this.controlbar.querySelector(".zwp__time-info"))&&(c=c.querySelector(".zwp-chapterButton"))&&c.remove();delete this.chapters}}.bind(g);g.doSnapshot=function(){if(this.videoEl&&this.videoEl.videoWidth){if(!this.snapCanvas&&
(this.snapCanvas=document.createElement("canvas"),!this.snapCanvas))return;var c=this.videoEl,d=this.snapCanvas;d.width=this.videoEl.videoWidth;d.height=this.videoEl.videoHeight;var f=d.getContext("2d");f.fillStyle="#000000";f.beginPath();f.fillRect(0,0,c.videoWidth,c.videoHeight);f.closePath();f.drawImage(c,0,0,c.videoWidth,c.videoHeight);if(typeof d.toBlob=="function"){var h="SNAP-"+jb();try{d.toBlob(function(r){const B=document.createElement("a");B.download=`${h}.jpg`;B.href=URL.createObjectURL(r);
B.click();ib(r)},"image/jpg",.99)}catch(r){}}}}.bind(g);g.togglePictureInPicture=function(){var c=this;if(c.videoEl)if(document.pictureInPictureElement)document.exitPictureInPicture();else{var d=c.videoEl;c.smallWindowMode||(d.bindPicInPicEvent||(d.addEventListener("enterpictureinpicture",function(f){Q(c.playerElm,"zwp-picInPic");c.overlay_layers.insertAdjacentHTML("beforeEnd",wb);(f=c.overlay_layers.querySelector(".zwp-pipExitButton"))&&f.addEventListener("click",function(h){h.stopPropagation();
document.pictureInPictureElement&&document.exitPictureInPicture()});c.isInPicInPic=!0}),d.addEventListener("leavepictureinpicture",function(){R(c.playerElm,"zwp-picInPic");var f=c.overlay_layers.querySelector(".zwp-pipPlaceHolder");f&&c.overlay_layers.removeChild(f);setTimeout(function(){},500);delete c.isInPicInPic}),d.bindPicInPicEvent=!0),d.requestPictureInPicture())}}.bind(g);g.showSubtitle=function(c){var d=this;if(d.overlay_layers){var f=d.overlay_layers.querySelector(".zwp-subtitles-show");
if(f){if(c?f.style.display!=="block"&&(f.style.opacity=0,f.style.display="block",Ta(f,500,function(){})):Ca(f,500,function(){Da.removeElement(f);f.remove();delete d.subtitleShow;delete d.subtitle1;delete d.subtitle2}),d.controlbar){var h=d.controlbar.querySelector(".zwp-subtitleButton");h&&(h.style.display=c?"block":"none")}}else if(c){f=document.createElement("div");f.setAttribute("class","zwp-subtitles-show");f.innerHTML='<div class="zwp-subtitles-viever"><div class="zwp-subtitle subtitle-1"><span class="subtitle-text"></span></div><div class="zwp-subtitle subtitle-2"><span class="subtitle-text"></span></div></div>';
d.overlay_layers.appendChild(f);f.addEventListener("click",function(P){P.preventDefault();P.stopPropagation()});Da.addElement(f);f.addEventListener("resize",function(P){this.updateSubtitlePosition()}.bind(d));d.subtitleShow=f;d.subtitle1=f.querySelector(".subtitle-1 > .subtitle-text");d.subtitle2=f.querySelector(".subtitle-2 > .subtitle-text");d.subtitle2.style.display="none";var r=f.querySelector(".zwp-subtitles-viever"),B=!1,H=0,S=0;c="onpointerout"in document;var K="ontouchstart"in document.documentElement||
"ontouchstart"in M;d.on_subtitle_mousemove=function(P){var T=P.target;if(B&&(T===this.subtitle1||T===this.subtitle2)){T=P.pageY;var X=!0;P.type=="touchmove"&&(P.changedTouches&&(T=P.changedTouches[0].pageY),X=!1);X&&P.preventDefault();P.stopPropagation();P=H-T;r.offsetTop<=54&&P>0||(P=S+P,P<54&&(P=54),r.style.bottom=P+"px")}}.bind(d);d.on_subtitle_mouseup=function(P){B&&("onpointerout"in document?(document.removeEventListener("pointermove",this.on_subtitle_mousemove),document.removeEventListener("pointerup",
this.on_subtitle_mouseup)):K?(document.removeEventListener("touchmove",this.on_subtitle_mousemove),document.removeEventListener("touchend",this.on_subtitle_mouseup)):(document.removeEventListener("mousemove",this.on_subtitle_mousemove),document.removeEventListener("mouseup",this.on_subtitle_mouseup)),B=!1)}.bind(d);d.on_subtitle_mousedown=function(P){"onpointerout"in document?(document.addEventListener("pointermove",this.on_subtitle_mousemove),document.addEventListener("pointerup",this.on_subtitle_mouseup)):
K?(document.addEventListener("touchmove",this.on_subtitle_mousemove),document.addEventListener("touchend",this.on_subtitle_mouseup)):(document.addEventListener("mousemove",this.on_subtitle_mousemove),document.addEventListener("mouseup",this.on_subtitle_mouseup));B=!0;H=P.pageY;var T=parseInt(r.offsetTop+r.offsetHeight);S=this.subtitleShow.offsetHeight-T;P.stopPropagation();P.preventDefault()}.bind(d);d.on_subtitleItemclick=function(P){P.stopPropagation();var T=P.currentTarget;L(T,"zwp_switch")&&Ra(T);
P=T.getAttribute("data-action");T=L(T,"switch_on");P==="subtitleOn"?this.subtitleShow&&(this.subtitleShow.style.display=T?"block":"none"):P==="subtitleDefault"?this.subtitles["1"]&&(T?this.subtitles["1"].hidden&&(delete this.subtitles["1"].hidden,this.subtitle1.style.display="block"):(this.subtitles["1"].hidden=!0,this.subtitle1.style.display="none")):P==="subtitleSecond"&&this.subtitles["2"]&&(T?this.subtitles["2"].hidden&&(delete this.subtitles["2"].hidden,this.subtitle2.style.display="block"):
(this.subtitles["2"].hidden=!0,this.subtitle2.style.display="none"))}.bind(d);c?r.addEventListener("pointerdown",d.on_subtitle_mousedown):canTouch?r.addEventListener("touchstart",d.on_subtitle_mousedown):r.addEventListener("mousedown",d.on_subtitle_mousedown);if(d.controlbar){if(h=d.controlbar.querySelector(".zwp-subtitleButton"))h.style.display="block";(c=sa.querySelector(".zwp-subtitleMenu"))&&!c.bindSwitchEvent&&(h=c.querySelectorAll(".action-item"),h.length>0&&h.forEach(function(P){P.addEventListener("click",
d.on_subtitleItemclick);var T=P.getAttribute("data-action");T!=="subtitleOn"&&T!=="subtitleDefault"||Q(P,"switch_on")}),c.bindSwitchEvent=!0)}}}}.bind(g);g.getSimpleSubtitleRenderer=function(){if(!this.overlay_layers)return null;var c=this.overlay_layers.querySelector(".zwp-subtitles-show");if(c){var d=c.querySelector(".zwp-simple-subtitles-viever");d||(c.innerHTML='<div class="zwp-simple-subtitles-viever"></div>',d=c.querySelector(".zwp-simple-subtitles-viever"));return d}c=document.createElement("div");
c.setAttribute("class","zwp-subtitles-show");c.innerHTML='<div class="zwp-simple-subtitles-viever"></div>';this.overlay_layers.appendChild(c);c.addEventListener("click",function(f){f.preventDefault();f.stopPropagation()});Da.addElement(c);c.addEventListener("resize",function(f){this.updateSubtitlePosition()}.bind(this));this.subtitleShow=c;return c.querySelector(".zwp-simple-subtitles-viever")}.bind(g);g.loadSubtitle=function(c,d,f){var h=this;if(d==="1"||d==="2")typeof c==="object"&&c instanceof
File?h.detectMimeType(c).then(function(r){return h.isValidSubtitleFile(c,r).then(function(B){return B?!0:(h.toast(O("unsupportedSubtitleFormat","Unsupported subtitle format")+": "+r,3E3,!0),!1)})}).then(function(r){r&&(r=new FileReader,r.onload=function(B){B=B.target.result;var H=h.getFileExtension(c.name);if(H===".srt")var S=Wa(B);else if(H===".vtt"||H===".webvtt")S=Ka(B);else if(H===".json"||H===".bcc")S=JSON.parse(B);S?h.processLoadedSubtitle(S,d,f||c.name):h.toast(O("invalidSubtitleFormat","Invalid subtitle file format"),
3E3,!0)},r.onerror=function(){h.toast(O("failedToReadSubtitle","Failed to read subtitle file"),3E3,!0)},r.readAsText(c))}).catch(function(r){h.toast(O("subtitleValidationFailed","Subtitle file validation failed"),3E3,!0)}):typeof c==="string"&&Va(c,function(r){var B=J(c);if(B===".srt")var H=Wa(r);else if(B===".vtt")H=Ka(r);else if(B===".json"||B===".bcc")H=JSON.parse(r);H&&h.processLoadedSubtitle(H,d,f)},function(r){})}.bind(g);g.processLoadedSubtitle=function(c,d,f){this.subtitles||(this.subtitles=
{});f&&(c.title=f);d==="2"&&this._config.secondSubtitleHidden&&(c.hidden=!0);if(this.controlbar){var h=this.controlbar.querySelector(".zwp-subtitleMenu");if(h){h.querySelector(".main")||(h.innerHTML=cb(),R(h,"zwp-autosize"));if(d==="1"){var r=h.querySelector(".sub1");if(r){f||=O("mainSubtitle","Main subtitle");var B=r.querySelector(".zwp-option-item-label");B&&(B.innerHTML=f);r.style.display="block"}}if(d==="2"&&(r=h.querySelector(".sub2"))){f||=O("secondSubtitle","Second subtitle");if(B=r.querySelector(".zwp-option-item-label"))B.innerHTML=
f;c.hidden||(f=r.querySelector(".zwp_switch"))&&Q(f,"switch_on");r.style.display="block"}}}this.subtitles[d]=c;this.showSubtitleTimer||(this.showSubtitleTimer=setTimeout(function(){this.showSubtitle(!0);delete this.showSubtitleTimer}.bind(this),300))}.bind(g);g.renderSubtitles=function(c){if(this.subtitleShow&&this.subtitles&&this.subtitleShow.style.display!=="none")for(var d=["1","2"],f=0;f<d.length;f++){var h=d[f];if(this.subtitles[h]){var r="subtitle"+h;h=this.subtitles[h];var B=!1;if(!h.hidden){if(h.current){if(c<
h.current.from)B=!0;else if(c<h.current.to)continue;this[r]&&(this[r].innerHTML="",this[r].style.display="none");h.current=null}var H=h.nextSubtitleIdx||0,S=!0;if(B){var K=H-4;K<0&&(K=0);for(var P=H-2;P>=K;P--)if(B=h.body[P],c<=B.to){if(c>=B.from){h.current=B;h.nextSubtitleIdx=P+1;S=!1;break}}else{h.nextSubtitleIdx=H;S=!1;break}if(S&&K>0){H=0;for(P=K-1;H<=P;)if(K=parseInt((H+P)/2),B=h.body[K],c<B.from)P=K-1;else if(c>B.to)H=K+1;else{h.current=B;h.nextSubtitleIdx=K+1;S=!1;break}S&&(h.nextSubtitleIdx=
H)}}else{K=H+2;K>h.body.length&&(K=h.body.length);for(P=H;P<K;P++)if(B=h.body[P],c>=B.from){if(c<=B.to){h.current=B;h.nextSubtitleIdx=P+1;S=!1;break}}else{h.nextSubtitleIdx=H;S=!1;break}if(S){H=K;P=h.body.length-1;for(K>=h.body.length?c<h.body[h.body.length-1].from&&(H=0):c<h.body[K].from&&(H=0);H<=P;)if(K=parseInt((H+P)/2),B=h.body[K],c<B.from)P=K-1;else if(c>B.to)H=K+1;else{h.current=B;h.nextSubtitleIdx=K+1;S=!1;break}S&&(h.nextSubtitleIdx=H)}}h.current&&this[r]&&(this[r].innerHTML=h.current.content,
this[r].style.display="block")}}}}.bind(g);g.updateSubtitlePosition=function(){if(this.subtitleShow&&this.subtitles){var c=["1","2"],d=this.subtitleShow.offsetWidth,f=this.subtitleShow.offsetHeight;if(d&&f)for(d/=1024,f/=576,f=32*(d>f?f:d),d=0;d<c.length;d++){var h=c[d];this.subtitles[h]&&(h="subtitle"+h,this[h]&&(this[h].style.fontSize=f.toFixed(2)+"px"))}}}.bind(g);g.resetQualitiesMenu=function(){if(this&&!this.multiStreams&&this.controlbar){var c=this.controlbar.querySelector(".zwp-qualityButton");
if(c){var d=c.querySelector(".zwp-qualityMenu");d&&(d.innerHTML='<li class="zwp-quality-item zwp-disabled" data-index="-1">No quality</li>');c.style.display="none"}}}.bind(g);g.createQualitiesMenu=function(c){var d=this;if(c.length<=1)d.resetQualitiesMenu();else{var f=d.controlbar.querySelector(".zwp-qualityButton");if(f){var h="",r=O("level","Level")+" ";h+='<li class="zwp-quality-item active" data-idx="-1">'+O("qs-auto","AUTO SWITCH")+"</li>";for(var B=0;B<c.length;B++){var H="";typeof c[B]!=="undefined"&&
(H=c[B].width&&c[B].height?c[B].width+"x"+c[B].height:r+(B+1));typeof c[B].bitrate!=="undefined"&&(H+=" ("+parseInt(c[B].bitrate/1E3)+"kbps)");h+='<li class="zwp-quality-item" data-br="'+c[B].bitrate+'" data-idx="'+c[B].qualityIndex+'" data-vh="'+c[B].height+'">'+H+"</li>"}if(c=f.querySelector(".zwp-qualityMenu"))c.innerHTML=h,M.mQuery(c).find(".zwp-quality-item").click(function(S){S.preventDefault();S.stopPropagation();S=M.mQuery(this);S.hasClass("active")||(S.siblings().removeClass("active"),S.addClass("active"),
S=this.getAttribute("data-idx"),typeof d.switchQualityLevel==="function"&&d.switchQualityLevel(S))});f.style.display="block"}}}.bind(g);g.updateQualityLevel=function(c,d){if(this&&this.controlbar){var f=this.controlbar.querySelector(".zwp-qualityButton");f&&(f=f.querySelector(".zwp-qualityMenu"))&&M.mQuery(f).children(".zwp-quality-item").each(function(h,r){h=parseInt(r.getAttribute("data-idx"));r=M.mQuery(r);h===-1?d&&!r.hasClass("active")&&(r.siblings(".active").removeClass("active"),r.addClass("active")):
c===h?(d||r.hasClass("active")||(r.siblings(".active").removeClass("active"),r.addClass("active")),r.hasClass("current")||(r.siblings(".current").removeClass("current"),r.addClass("current"))):r.hasClass("current")&&r.removeClass("current")})}}.bind(g);g.buildStreamSelector=function(){var c=this;if(c.multiStreams&&c.controlbar){var d=c.controlbar.querySelector(".zwp-qualityButton");if(d){var f="",h=c.multiStreams.murls;if(!Array.isArray(h)||h.length!==1){for(var r in h){var B=h[r];B=typeof B==="object"?
B.name:r;f+='<li class="zwp-quality-item" data-stream="'+B+'">'+O(B,B)+"</li>"}if(h=d.querySelector(".zwp-qualityMenu"))h.innerHTML=f,f=M.mQuery(h).find(".zwp-quality-item"),f.click(function(H){H.preventDefault();H.stopPropagation();H=this.getAttribute("data-stream");if(c.multiStreams.curStream!==H){var S=c.multiStreams.murls;if(Array.isArray(S))for(var K in S){var P=S[K];if(P.name===H){var T=P.url;break}}else T=S[H];c.__switchStream(T);c.multiStreams.curStream=H;T=M.mQuery(this);T.hasClass("active")||
(T.siblings(".active").removeClass("active"),T.addClass("active"));H=O(H,H);c.toast(O("switchedToQuality","Switched to")+" "+H+" "+O("quality","quality"))}}),f.each(function(H,S){H=this.getAttribute("data-stream");if(c.multiStreams.curStream===H&&(H=M.mQuery(this),!H.hasClass("active")))return H.siblings(".active").removeClass("active"),H.addClass("active"),!1});d.style.display="block"}}}}.bind(g);g.createSubtitlesMenu=function(c,d){var f=this;f.controlbar&&(d=f.controlbar.querySelector(".zwp-subtitleMenu"),
c=pb(c),d.innerHTML=c,delete d.bindSwitchEvent,Q(d,"zwp-autosize"),M.mQuery(d).find(".zwp-subtitles-item").click(function(h){h.preventDefault();h.stopPropagation();h=M.mQuery(this);h.hasClass("active")||(h.siblings().removeClass("active"),h.addClass("active"),h=this.getAttribute("data-id"),typeof f.switchSubtitleTrack==="function"&&f.switchSubtitleTrack(h))}),c=f.controlbar.querySelector(".zwp-subtitleButton"))&&(c.style.display="block")}.bind(g);g.updateSubtitleTrack=function(c){}.bind(g);g.resetSubtitleMenu=
function(){if(this.controlbar){var c=this.controlbar.querySelector(".zwp-subtitleButton");c&&(c.style.display="none")}}.bind(g);g.__getDanmuBarDock=function(){var c=this.progressBar.timeInfo.querySelector(".zwp_danmuBarDock");c||(c=document.createElement("DIV"),c.setAttribute("class","zwp_danmuBarDock"),this.progressBar.timeInfo.appendChild(c),Da.addElement(c),c.addEventListener("resize",function(d){var f=this;f.resizeTimer||(f.resizeTimer=M.setTimeout(function(){c.clientWidth<350?Q(c,"zwp-mini"):
R(c,"zwp-mini");delete f.resizeTimer},50))}.bind(this)));return c}.bind(g);g.buildDanmuToolbar=function(c,d){var f=this,h;if(!f.danmuToolbar){c&&(h=document.querySelector("#"+c));if(!h){if(!f.overlay_layers)return;d=null;h=f.progressBar&&f.progressBar.timeInfo?f.__getDanmuBarDock():f.overlay_layers}c=qb();h.insertAdjacentHTML("beforeend",c);f.danmuToolbar=h.querySelector(".zwp_danmu-controlbar");d&&Q(f.danmuToolbar,d);h.appendChild(f.danmuToolbar);(d=f.danmuToolbar.querySelector(".zwp_switch"))&&
d.addEventListener("click",function(r){r.stopPropagation();r=r.currentTarget;if(L(r,"zwp_switch")){Ra(r);var B=L(r,"switch_on");r=M.$$(this.danmuToolbar);if(B){var H=r.find("button.btn_submit");H.removeClass("vtb_disabled").removeAttr("disabled");this.setEnableDanmu(!0);B=r.find(".barrage_inp_text");B.removeAttr("readonly").removeAttr("disabled").removeClass("disabled");B.attr("keydown")!="on"&&(B.keydown(function(S){S.which==13&&H.length>0&&H.trigger("click")}),B.attr("keydown","on"));r.find(".zwp-barrage_form").css("background-color",
"#28303db3").children("a.btn_bubble").toggleClass("disabled")}else r.find("button.btn_submit").addClass("vtb_disabled").attr({disabled:"disabled"}),this.setEnableDanmu(!1),r.find(".barrage_inp_text").attr("readonly","readonly").attr("disabled","disabled").addClass("disabled"),r.find(".zwp-barrage_form").css("background-color","#202020b3").children("a.btn_bubble").toggleClass("disabled")}}.bind(f));(d=f.danmuToolbar.querySelector(".barrage_login"))&&d.addEventListener("click",function(r){r.preventDefault();
r.stopPropagation();alert("login")});(d=f.danmuToolbar.querySelector(".zwp_dmconfig"))&&d.addEventListener("click",function(r){r.preventDefault();r.stopPropagation();this.zwplayer=f;ub(r,this)});(d=f.danmuToolbar.querySelector(".btn_bubble"))&&d.addEventListener("click",function(r){r.preventDefault();r.stopPropagation();kb(this,r)});(d=f.danmuToolbar.querySelector(".btn_submit"))&&d.addEventListener("click",function(r){r.preventDefault();r.stopPropagation();a:{if(!this.inpbox){$inpbox=$$(this).parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");
if(!$inpbox)break a;this.inpbox=$inpbox}if(f){r=this.inpbox.val();if(r=="")break a;r.indexOf("&")!=-1&&(r=r.replace(/&/g,"&amp;"));r.indexOf("<")!=-1&&(r=r.replace(/</g,"&lt;"));r.indexOf(">")!=-1&&(r=r.replace(/>/g,"&gt;"));r.indexOf('"')!=-1&&(r=r.replace(/"/g,"&quot;"));r.indexOf("'")!=-1&&(r=r.replace(/'/g,"&#039;"));if(!f.sendDanmu(r))break a}this.inpbox.val("")}})}}.bind(g);g.reposDanmuToolbar=function(c){if(this.danmuToolbar&&this.progressBar&&this.progressBar.timeInfo){var d=this.__getDanmuBarDock(),
f=this.danmuToolbar.parentNode;f&&(c?f!==d&&(f.removeChild(this.danmuToolbar),d.appendChild(this.danmuToolbar),this.oldDanmuParentNode=f):this.oldDanmuParentNode&&(d.removeChild(this.danmuToolbar),this.oldDanmuParentNode.appendChild(this.danmuToolbar),delete this.oldDanmuParentNode))}}.bind(g);g.sendDanmu=function(c){if(typeof this._config.sendDanmu==="function"){var d="";this.danmuSetting.border&&(d+=',"border":"1"');this.danmuSetting.color&&(d+=',"color":"#'+this.danmuSetting.color+'"');this._config.sendDanmu('{"type":"danmu","text":"'+
c+'"'+d+"}");return!0}alert("No danmu send function is setup");return!1}.bind(g);g.showContextMenu=function(c){var d=this;if(c.offsetX!==void 0&&c.offsetY!==void 0){var f=c.offsetX;c=c.offsetY}else{var h=d.playerContainer.getBoundingClientRect();f=c.clientX-h.left;c=c.clientY-h.top}h=d.playerContainer.getBoundingClientRect();var r=h.width;h=h.height;var B="left",H="top",S=f,K=c;f+180>r&&(B="right",S=r-f);c+148>h&&(H="bottom",K=h-c);if(d.contextMenu)d.contextMenu.style[B==="left"?"right":"left"]=null,
d.contextMenu.style[H==="top"?"bottom":"top"]=null,d.contextMenu.style[B]=S+"px",d.contextMenu.style[H]=K+"px";else{f='<div class="zwp-popupmenu" style="'+B+": "+S+"px; "+H+":"+K+'px;"><a class="zwp-menuitem" data-action="shortcutHelp" href="javascript:void(0)"><span class="zwp-menucaption">'+(O("keyboardShortcuts","Keyboard Shortcuts")+"</span></a>");f=f+'<span class="zwp-menuseperator" action="shortcutHelp"></span><a class="zwp-menuitem" data-action="document" href="https://www.zwplayer.cn/docs/support.html" target="zwplayer-doc"><span class="zwp-menucaption">'+
(O("player-help","Help and document")+"</span></a>");f+='<a class="zwp-menuitem" data-action="version" href="https://www.zwplayer.cn/pages/company/changelog.html?v=3.2.0" title="Build: 20251128" target="zwplayer-version"><span class="zwp-menucaption">'+O("version-update","Version update")+' (<span class="zwp-version">'+O("current")+": v3.2.0</span>) </span></a>";f=f+'<span class="zwp-menuseperator" action="version"></span><a class="zwp-menuitem" data-action="about" href="https://www.zwplayer.cn/pages/company/about.html"><span class="zwp-menucaption">'+
(O("about","About")+" zwplayer</span></a>");f+="</div>";c=d.playerContainer;Ia()&&(r=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&(c=r);c.insertAdjacentHTML("beforeEnd",f);d.contextMenu=c.querySelector(".zwp-popupmenu");var P=function(T){T.stopPropagation();T.preventDefault();var X=this.getAttribute("data-action");this.getAttribute("target");var C=this.getAttribute("href");d.hideContextMenu();setTimeout(function(){X===
"about"?M.open(C,"zwplayer-about"):X==="version"?M.open(C,"zwplayer-version"):X==="document"?M.open(C,"zwplayer-doc"):X==="shortcutHelp"&&d.createShortcutHelpPanel()},10)};d.contextMenu.querySelectorAll("a.zwp-menuitem").forEach(function(T){T.addEventListener("click",P,!1)});document.addEventListener("click",d.hideContextMenu)}}.bind(g);g.hideContextMenu=function(){if(this.contextMenu){var c=this.contextMenu.parentNode;c&&c.removeChild(this.contextMenu);delete this.contextMenu;document.removeEventListener("click",
this.hideContextMenu)}}.bind(g);g.toast=function(c,d,f,h){var r=this;d=d||2E3;r.toastTimerId&&(clearTimeout(r.toastTimerId),r.toastBox&&(r.overlay_layers.removeChild(r.toastBox),delete r.toastBox));if(c!=="closetoast"){if(typeof c==="object"){if("icon"in c)var B=c.icon;c=c.text}var H=document.createElement("div"),S="",K="zwp-toast zwp-center";B&&(K+=" zwp-toast-icon",S='<i class="xicon xicon-'+B+'"></i>');f&&(S+='<a href="javascript:void(0)" class="zwp-toast-closebtn"><i class="xicon xicon-close"></i></a>',
K+=" zwp-use-close");h&&(K+=" zwp-lite");S+='<span class="zwp-toast-text">'+c+"</span>";H.setAttribute("class",K);H.innerHTML=S;r.overlay_layers.appendChild(H);r.toastBox=H;var P=function(T){if(r.toastBox){var X=r.toastBox.querySelector(".zwp-toast-closebtn");X&&X.removeEventListener("click",P);r.overlay_layers.removeChild(r.toastBox);delete r.toastBox}r.toastTimerId&&(T&&T.type==="click"&&clearTimeout(r.toastTimerId),delete r.toastTimerId)};r.toastTimerId=M.setTimeout(P,d);f&&(f=H.querySelector(".zwp-toast-closebtn"))&&
f.addEventListener("click",P)}}.bind(g);g.mutedConfirmBox=function(){var c=this;c.popup_layers||(c.popup_layers=document.createElement("div"),c.popup_layers.setAttribute("class","zwp__popup_layers"),c.playerContainer.appendChild(c.popup_layers));var d=document.createElement("div"),f='<span class="zwp-toast-text">'+O("mutedAutoplayMessagePre","Muted due to ")+' <a href="#mutemore" class="mutemore">'+O("browserLimits","Browser Restrictions")+"</a>"+O("mutedAutoplayMessagePost",". Click to ")+'<a href="#openaudio" class="openaudio">'+
O("openAudio","Enable")+'</a><button class="closeBtn" title="'+O("close","Close")+'"><i class="xicon xicon-close"></i></button></span>';d.setAttribute("class","zwp-toast zwp-confirm zwp-center");d.innerHTML=f;c.popup_layers.appendChild(d);c.mutedTipBox=d;(f=d.querySelector(".closeBtn"))&&f.addEventListener("click",function(h){h.preventDefault();c.mutedTipBox&&(c.popup_layers.removeChild(c.mutedTipBox),c.popup_layers.style.display=null,delete c.mutedTipBox);M.allowAutoAudioPlay=!0});(f=d.querySelector(".openaudio"))&&
f.addEventListener("click",function(h){h.preventDefault();h.stopPropagation();c.mutedTipBox&&(c.popup_layers.removeChild(c.mutedTipBox),c.popup_layers.style.display=null,delete c.mutedTipBox);c.setMuted(!1);M.allowAutoAudioPlay=!0});(f=d.querySelector(".mutemore"))&&f.addEventListener("click",function(h){h.preventDefault();h.stopPropagation();var r=d.querySelector(".moreInfoBox");r||(h='<div class="moreInfoBox"><div class="info-text">'+O("browserRestrictionsInfo","When you visit this site infrequently or often play muted content, browsers may limit audio volume, preventing automatic audio playback.")+
'</div><div class="info-control"><button class="info-btn">'+O("iUnderstand","OK")+"</button></div></div>",d.insertAdjacentHTML("beforeend",h),r=d.querySelector(".moreInfoBox"),r.querySelector(".info-btn").addEventListener("click",function(B){B.preventDefault();B.stopPropagation();r.style.display="none"}));r&&(r.style.display="block");M.allowAutoAudioPlay=!0});c.popup_layers.style.display="block"}.bind(g);typeof g._config.playerElm=="string"?(e=g._config.playerElm,e.charAt(0)!="#"&&(e="#"+e),g.playerElm=
document.querySelector(e)):Ya(g._config.playerElm)&&(g.playerElm=g._config.playerElm);g.playerElm?L(g.playerElm,"zwp-wrap")||(g.playerElmOldClass=g.playerElm.getAttribute("class"),Q(g.playerElm,"zwp-wrap"),g.doRemovePlayerClass=!0):(e="",typeof g._config.playerElm=="string"?(e=g._config.playerElm,e.charAt(0)=="#"&&(e=e.substr(1))):e="ZWP-"+(new Date).getTime(),g.playerElm=document.createElement("DIV"),g.playerElm.id=e,g.playerElm.style.position="absolute",g.playerElm.style.left=0,g.playerElm.style.top=
0,g.playerElm.style.width="640px",g.playerElm.style.height="360px",document.body.appendChild(g.playerElm),g.playerElm.setAttribute("class","zwp-wrap"),g.doDeletePlayerElm=!0);g.playerContainer=document.createElement("DIV");g.playerContainer.setAttribute("class","zwp-container");g.playerElm.appendChild(g.playerContainer);typeof g._config.videoElm=="string"?(e=g._config.videoElm,e.charAt(0)!="#"&&(e="#"+e),g.videoEl=document.querySelector(e)):Ya(g._config.videoElm)&&(g.videoEl=g._config.videoElm);if(!g.videoEl){var ma=
document.createElement("DIV");ma.setAttribute("class","zwp-videoWrapper");g.playerContainer.appendChild(ma);Da.addElement(ma);ma.addEventListener("resize",function(c){this._config.video_rotated&&this.rotateVideo()}.bind(g));g.videoWrapper=ma;g.videoEl=document.createElement("VIDEO");typeof g._config.videostyle=="string"&&g.videoEl.setAttribute("style",g._config.videostyle);typeof g._config.videoclass=="string"&&g.videoEl.setAttribute("class",g._config.videoclass);g._config.videostyle||g._config.videoclass||
g.videoEl.setAttribute("style","width:100%;height:100%;");typeof g._config.videoElm=="string"&&(e=g._config.videoElm,e.charAt(0)=="#"&&(e=e.substr(1)),g.videoEl.id=e);g.videoEl.setAttribute("playsinline","");g.videoEl.setAttribute("webkit-playsinline","");g.videoEl.setAttribute("autoplay","");ma.appendChild(g.videoEl);g.videoRemoveWhenClose=!0}e=g._config.defVolume/100;g.lastVolume=e;g.videoEl.volume=e;g._config.poster&&g.videoEl.setAttribute("poster",g._config.poster);if(!g._config.disableOverlayLayer&&
(e=document.createElement("div"),e.setAttribute("class","zwp__layers"),e.innerHTML='<div class="zwp__overlay zwp__layer zwp_loadingicon" style="width: 100%; height: 100%; display: none;"><div class="zwp__overlay-loading"><span class="zwp__overlay-loading-bg-img"><svg width="80px" height="80px" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#fff"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".5" cx="18" cy="18" r="18"/><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"/></path></g></g></svg></span></div></div>'+
vb,g.playerContainer.appendChild(e),g.overlay_layers=e,g.bigPlayOverlay=e.querySelector(".zwp__overlay-play"),g.bigPlayBtn=g.bigPlayOverlay.querySelector(".zwp__overlay-button"),g.localPlaybackHint=g.bigPlayOverlay.querySelector(".zwp-local-playback-hint"),g.loadingOverlay=e.querySelector(".zwp_loadingicon"),g.updateLocalPlaybackHint=function(c){if(g.localPlaybackHint){var d=g._config.url||g.murl;c?(g.localPlaybackHint.style.setProperty("display","none","important"),g.bigPlayBtn&&g.bigPlayBtn.style.setProperty("display",
"flex","important"),g.bigPlayOverlay&&g.bigPlayOverlay.style.setProperty("display","flex","important")):g._config.localPlayback&&!d?(g.localPlaybackHint.style.setProperty("display","flex","important"),g.bigPlayBtn&&g.bigPlayBtn.style.setProperty("display","none","important"),g.bigPlayOverlay&&g.bigPlayOverlay.style.setProperty("display","flex","important")):d&&(g.localPlaybackHint.style.setProperty("display","none","important"),g.bigPlayBtn&&g.bigPlayBtn.style.setProperty("display","flex","important"),
g.bigPlayOverlay&&g.bigPlayOverlay.style.setProperty("display","flex","important"))}},g._config.disablePlayBtn?Q(g.bigPlayBtn,"zwp_disabled"):g.bigPlayBtn.addEventListener("click",function(c){c.preventDefault();c.stopPropagation();this.on_btnclick(c)}.bind(g)),g.localPlaybackHint&&(g.localPlaybackHint.addEventListener("click",function(c){c.preventDefault();c.stopPropagation();this.on_btnclick(c)}.bind(g)),g._config.localPlayback&&g.updateLocalPlaybackHint()),g._config.enableDanmu&&(g.danmuPlayer=
HUAYI.Danmu.create({playerId:e})),e.addEventListener("contextmenu",function(c){c.preventDefault();c.stopPropagation();Qa||this.showContextMenu(c)}.bind(g)),e.addEventListener("click",function(c){var d=this;c=function(f){f=f.querySelector(".closeBtn");var h=document.createEvent("Event");h.initEvent("click",!0,!0);f.dispatchEvent(h)};d.infoViewer?c(d.infoViewer):d.colorSettingPanel?c(d.colorSettingPanel):d.recordingSettingsPanel?c(d.recordingSettingsPanel):d.volumeBoostPanel?c(d.volumeBoostPanel):d.shortcutHelpPanel?
c(d.shortcutHelpPanel):d.contextMenu?d.hideContextMenu():d._config.disableClickPause||d._config.disablePlayBtn||d._config.isLive||(d.overlayLayerClickTimer&&(M.clearTimeout(d.overlayLayerClickTimer),delete d.overlayLayerClickTimer),d.playbtn&&(d.overlayLayerClickTimer=M.setTimeout(function(){d.playbtn.click();delete d.overlayLayerClickTimer},300)))}.bind(g)),g._config.logo)){if(typeof g._config.logo==="object"){if(typeof g._config.logo.icon==="string")var ia=g._config.logo.icon}else typeof g._config.logo===
"string"&&(ia=g._config.logo);if(ia){ma='<div class="zwp-logo"';if(typeof g._config.logo==="object"){var Aa="";"dock"in g._config.logo?Aa+=(g._config.logo.dock==="left"?"left":"right")+": "+(g._config.logo.x||"5%")+";":"x"in g._config.logo&&(Aa+="right: "+g._config.logo.x+";");"y"in g._config.logo&&(Aa+="top: "+g._config.logo.y+";");"width"in g._config.logo&&(Aa+="width: "+g._config.logo.width+";");if("opacity"in g._config.logo){var oa=g._config.logo.opacity/100;oa>1&&(oa=1);Aa+="opacity: "+oa+";"}Aa&&
(ma+=' style="'+Aa+'"')}e.insertAdjacentHTML("afterbegin",ma+('><img src="'+ia+'"></div>'))}}if(g._config.nativecontrols)g.videoEl.setAttribute("controls","controls"),g.overlay_layers&&(g.overlay_layers.style.bottom="70px"),g.videoEl.addEventListener("fullscreenchange",function(c){return!1}.bind(g));else if(g._config.controlbar){var sa=document.createElement("div");sa.setAttribute("class","zwp-controlbar");g._config.isLive||Q(sa,"zwp-vodplayer");sa.innerHTML=fb(g._config);g.playerContainer.appendChild(sa);
g.controlbar=sa;g.playbtn=sa.querySelector(".zwp-playbtn");if(g.controlbar){sa.addEventListener("dblclick",function(c){c.stopPropagation()});ia=sa.querySelectorAll("button.zwpbtn");ia.length>0&&(g.btnBindZwp=!0,ia.forEach(function(c){c.addEventListener("click",g.on_btnclick)}));g._config.disablePlayBtn&&(ia=sa.querySelector(".zwp_playbtn"),Q(ia,"zwp_disabled"),ia.setAttribute("disabled","disabled"));ia=sa.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");ia.length>0&&ia.forEach(function(c){c.addEventListener("click",
g.on_speedItemclick)});var ta=sa.querySelector(".zwp-volume-docker");if(ta){g.muteBtn=ta.querySelector("button.zwp-muteBtn");g.volslider=ta.querySelector(".zwp-volume-slider");g.voltotal=ta.querySelector(".zwp-volume-total");g.volcurrent=g.volslider.querySelector(".zwp-volume-current");g.volthumb=g.volslider.querySelector(".zwp-volume-handle");var za=function(c){if(c!==null&&!isNaN(c)&&c!==void 0){c=Math.max(0,c);c=Math.min(c,1);if(c===0){R(ta,"zwp__mute");Q(ta,"zwp__unmute");var d=g.muteBtn;d.setAttribute("title",
"unmute");d.setAttribute("aria-label","unmute")}else R(ta,"zwp__unmute"),Q(ta,"zwp__mute"),d=g.muteBtn,d.setAttribute("title","muted"),d.setAttribute("aria-label","muted");d=g.volthumb;var f=g.volcurrent;c=c*100+"%";var h=getComputedStyle(d);f.style.bottom=0;f.style.height=c;d.style.bottom=c;d.style.marginBottom=-parseFloat(h.height)/2+"px"}},m=function(c){var d=z(g.voltotal),f=getComputedStyle(g.voltotal),h=!0;c.type=="touchmove"&&(c.changedTouches&&(h=c.changedTouches[0],c.pageX=h.pageX,c.pageY=
h.pageY),h=!1);f=parseFloat(f.height);f=(f-(c.pageY-d.top))/f;d.top!==0&&d.left!==0&&(f=Math.max(0,f),f=Math.min(f,1),za(f),d=g,d.setMuted(f===0),d.setVolume(f),h&&c.preventDefault(),c.stopPropagation())};g.positionVolumeThumb=za;g.on_volthumb_mousemove=function(c){var d=c.target;ha&&(d===g.volslider||d.closest(".zwp-volume-slider"))&&m(c)}.bind(g);g.on_volthumb_mouseup=function(c){ha&&("onpointerout"in document?(document.removeEventListener("pointermove",g.on_volthumb_mousemove),document.removeEventListener("pointerup",
g.on_volthumb_mouseup),document.removeEventListener("touchmove",g.on_volthumb_mousemove),document.removeEventListener("touchend",g.on_volthumb_mouseup)):(document.removeEventListener("mousemove",g.on_volthumb_mousemove),document.removeEventListener("mouseup",g.on_volthumb_mouseup)),ha=!1);qa||(g.volslider.style.display="none")}.bind(g);g.on_volthumb_mousedown=function(c){m(c);"onpointerout"in document?(document.addEventListener("pointermove",g.on_volthumb_mousemove),document.addEventListener("pointerup",
g.on_volthumb_mouseup),document.addEventListener("touchmove",g.on_volthumb_mousemove),document.addEventListener("touchend",g.on_volthumb_mouseup)):(document.addEventListener("mousemove",g.on_volthumb_mousemove),document.addEventListener("mouseup",g.on_volthumb_mouseup));ha=!0;c.preventDefault();c.stopPropagation()}.bind(g);var v=g.volslider;ta.addEventListener("mouseenter",function(c){c.target===ta&&(v.style.display="block",qa=!0,c.preventDefault(),c.stopPropagation())});ta.addEventListener("focusin",
function(){v.style.display="block";qa=!0});ta.addEventListener("focusout",function(c){if(!c.relatedTarget||c.relatedTarget&&!c.relatedTarget.matches(".zwp-volume-slider"))v.style.display="none"});ta.addEventListener("mouseleave",function(){qa=!1;ha||(v.style.display="none")});ta.addEventListener("focusout",function(){qa=!1});ta.addEventListener("keydown",function(c){var d=c.which||c.keyCode||0;c.preventDefault();c.stopPropagation();d==32&&(g.videoEl.muted?g.setMuted(!1):g.setMuted(!0))});v.addEventListener("dragstart",
function(){return!1});v.addEventListener("mouseover",function(){qa=!0});v.addEventListener("focusin",function(){v.style.display="block";qa=!0});v.addEventListener("focusout",function(){qa=!1;ha||(v.style.display="none")});v.addEventListener("mousedown",g.on_volthumb_mousedown)}if(ia=sa.querySelector(".zwp-optionPanel"))ia=ia.querySelectorAll(".action-item"),ia.length>0&&ia.forEach(function(c){c.addEventListener("click",g.on_optionItemclick)})}}g._config.autoSmallWindow&&!g.windowScrollHandler&&(g.windowScrollHandler=
function(c){if(!this.isFullscr&&!this.isFullscrWin&&this.videoEl&&this.playerElm&&this.isPlaying&&!this.isInPicInPic)if(c=t(this.playerElm),(document.documentElement.scrollTop||document.body.scrollTop)>=c+this.playerElm.offsetHeight-100){if(!this.smallWindowMode){var d=this.playerContainer;mb(d,function(){R(d,"zwp-smallwindow");d.style.left=null;d.style.top=null;d.style.width=null;d.style.height=null});Q(d,"zwp-smallwindow");this.smallWindowMode=!0}}else this.smallWindowMode&&(d=this.playerContainer,
R(d,"zwp-smallwindow"),d.style.left=null,d.style.top=null,d.style.width=null,d.style.height=null,delete this.smallWindowMode)}.bind(g),M.addEventListener("scroll",g.windowScrollHandler));g._config.clientip||(g._config.clientip="");g.videoEl&&(g._config.muted?g.setMuted(!0):typeof M.allowAutoAudioPlay==="undefined"?(g.setMuted(!0),hb(function(c){c?g.setMuted(!1):g._config.disableMutedConfirm||g.mutedConfirmBox();M.allowAutoAudioPlay=c})):M.allowAutoAudioPlay||(g.setMuted(!0),g.mutedConfirmBox()),(g._config.snapshotButton||
g._config.allowSnapshot)&&g.videoEl.setAttribute("crossorigin","Anonymous"));ia=function(c){var d=this;if(d.controlbar)if(d.isControlbarhidden){d.controlbar.style.display="flex";R(d.playerElm,"hide-cursor");c=c||M.event;if(c.srcElement!=d.controlbar&&d.overlay_layers){var f=d.overlay_layers.offsetHeight,h=0;typeof c.offsetY!=="undefined"?h=f-c.offsetY:typeof c.layerY!=="undefined"&&(h=f-c.layerY);if(h>80)return}Ta(d.controlbar,500,function(r){r&&d.startHideControlbar(d)});d.isControlbarhidden=!1}else d.startHideControlbar(d)}.bind(g);
g.playerElm.addEventListener("mousemove",ia);g.playerElm.addEventListener("touchmove",ia);g.playerElm.addEventListener("dblclick",function(c){this.overlayLayerClickTimer&&(M.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);if(this.controlbar&&(c={},c.currentTarget=this.controlbar.querySelector(".zwp-fullscrBtn"),c.currentTarget))this.on_btnclick(c)}.bind(g));typeof g._config.autoplay=="undefined"&&(g._config.autoplay=!0);g._config.url&&g._config.autoplay&&g.play(g._config.url);
typeof g._config.onready=="function"&&g._config.onready.call(g);g._config.chapters&&(g.chapters=g._config.chapters);g._config.lostFocusPause&&typeof document.visibilityState!=="undefined"&&document.addEventListener("visibilitychange",function(){this._config.isLive||this.isInPicInPic||(document.visibilityState==="visible"?this.focusPaused&&this.videoEl.paused&&!this.videoEl.ended&&(this.videoEl.play(),this.setplaystate(!0),delete this.focusPaused):this.focusPaused||this.videoEl.paused||this.videoEl.ended||
(this.videoEl.pause(),this.setplaystate(!1),this.focusPaused=!0))}.bind(g));g._config.fluid?g._config.autoplay||(Q(g.playerElm,"zwp-fluid"),g.playerElm.style.maxWidth="100%",g.playerElm.style.width="100%",g.playerElm.style.height="0",e=56.25,typeof g._config.ratio==="number"?e=g._config.ratio*100:typeof g._config.ratio==="string"?(ia=g._config.ratio.split(":"),ia.length===2&&(e=parseFloat(ia[0]),ia=parseFloat(ia[1]),e===0&&(e=1),e=ia*100/e)):typeof g._config.width==="number"&&typeof g._config.height===
"number"&&(e=g._config.width,e===0&&(e=1),e=g._config.height*100/e),g.playerElm.style.paddingTop=e+"%"):g._config.width&&g._config.height&&(g.playerElm.style.width=typeof g._config.width==="number"?g._config.width+"px":g._config.width,g.playerElm.style.height=typeof g._config.height==="number"?g._config.height+"px":g._config.height);g.initializeDragDrop=function(){if(g._config.localPlayback){var c=g.playerContainer||g.playerElm;c&&(["dragenter","dragover","dragleave","drop"].forEach(function(d){c.addEventListener(d,
g.preventDefaults,!1);document.body.addEventListener(d,g.preventDefaults,!1)}),["dragenter","dragover"].forEach(function(d){c.addEventListener(d,g.highlight,!1)}),["dragleave","drop"].forEach(function(d){c.addEventListener(d,g.unhighlight,!1)}),c.addEventListener("drop",g.handleDrop,!1))}};g.preventDefaults=function(c){c.preventDefault();c.stopPropagation()};g.highlight=function(c){g._config.localPlayback&&(c=g.playerContainer||g.playerElm,Q(c,"zwp-drag-over"),g.localPlaybackHint&&g.localPlaybackHint.style.display!==
"none"&&Q(c,"zwp-drag-over-no-prompt"))};g.unhighlight=function(c){c=g.playerContainer||g.playerElm;R(c,"zwp-drag-over");R(c,"zwp-drag-over-no-prompt")};g.handleDrop=function(c){g._config.localPlayback&&(c=c.dataTransfer.files,c.length>0&&g.handleFiles(c))};g.handleFiles=function(c){Array.prototype.slice.call(c).forEach(function(d){g.uploadFile(d)})};g.uploadFile=async function(c){if(g._config.localPlayback){var d={file:c,name:c.name,size:c.size,lastModified:c.lastModified,type:c.type,timestamp:(new Date).toISOString()};
typeof g._config.onFileSelected==="function"&&g._config.onFileSelected.call(g,d);var f=await g.detectMimeType(c);d.detectedMime=f;await g.isValidVideoFile(c,f)?(f=URL.createObjectURL(c),d.url=f,g.loadingOverlay&&(g.loadingOverlay.style.display="block"),g.playLocalFile(f,c.name,d),typeof g._config.onFileLoaded==="function"&&g._config.onFileLoaded.call(g,d)):(d.error=O("unsupportedFileFormat","Unsupported file format"),d.errorCode="UNSUPPORTED_FORMAT",typeof g._config.onFileError==="function"&&g._config.onFileError.call(g,
d),g.toast(O("unsupportedFileFormat","Unsupported file format")+": "+f,3E3,!0))}else g.toast(O("localFileDisabled","Local file playback is disabled"),3E3,!0)};g._mimeCache=new Map;g.detectMimeType=async function(c){var d=c.name+"_"+c.size+"_"+c.lastModified;if(g._mimeCache.has(d))return g._mimeCache.get(d);var f;try{var h=await g.readFileHeader(c,16),r=g.detectMimeTypeFromHeader(h);r&&(f=r)}catch(B){}!f&&c.type&&c.type!==""&&(f=c.type);f||(c=g.getFileExtension(c.name),f=g.getMimeFromExtension(c)||
"application/octet-stream");g._mimeCache.set(d,f);return f};g.readFileHeader=function(c,d){return new Promise(function(f,h){var r=new FileReader;r.onload=function(B){f(B.target.result)};r.onerror=h;r.readAsArrayBuffer(c.slice(0,d))})};g.detectMimeTypeFromHeader=function(c){if(!c||c.byteLength===0)return null;c=new Uint8Array(c);return c.length>=8&&c[4]===102&&c[5]===116&&c[6]===121&&c[7]===112?"video/mp4":c.length>=4&&c[0]===26&&c[1]===69&&c[2]===223&&c[3]===163?"video/webm":c.length>=12&&c[0]===
82&&c[1]===73&&c[2]===70&&c[3]===70&&c[8]===65&&c[9]===86&&c[10]===73&&c[11]===32?"video/x-msvideo":c.length>=8&&(c[4]===109&&c[5]===111&&c[6]===111&&c[7]===118||c[4]===102&&c[5]===114&&c[6]===101&&c[7]===101)?"video/quicktime":c.length>=4&&c[0]===70&&c[1]===76&&c[2]===86&&c[3]===1?"video/x-flv":c.length>=4&&c[0]===26&&c[1]===69&&c[2]===223&&c[3]===163?"video/x-matroska":c.length>=16&&c[0]===48&&c[1]===38&&c[2]===178&&c[3]===117&&c[8]===6&&c[9]===230?"video/x-ms-wmv":c.length>=4&&(c[0]===71&&c[1]===
64||c[0]===71&&(c[1]&240)===64)?"video/mp2t":null};g.getFileExtension=function(c){var d=c.lastIndexOf(".");return d!==-1?c.substring(d).toLowerCase():""};g.getMimeFromExtension=function(c){return{".mp4":"video/mp4",".webm":"video/webm",".ogg":"video/ogg",".ogv":"video/ogg",".mov":"video/quicktime",".avi":"video/x-msvideo",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".3gp":"video/3gpp",".3g2":"video/3gpp2",".m4v":"video/x-m4v",".ts":"video/mp2t",".m4a":"audio/mp4",".mp3":"audio/mpeg",
".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".m3u8":"application/x-mpegURL",".dash":"application/dash+xml"}[c]||null};g.isValidVideoFile=async function(c,d){var f=".mp4 .webm .ogg .ogv .mov .mkv .m4v .flac .wav .m4a .mp3 .opus".split(" ");if("video/mp4 video/webm video/ogg video/ogv video/quicktime video/x-matroska video/x-m4v video/H264 video/h264 audio/wav audio/x-wav audio/flac audio/opus audio/mp4 audio/mpeg audio/ogg".split(" ").indexOf(d)!==-1)return!0;if("video/mp2t video/3gpp video/avi video/x-ms-wmv video/x-flv video/x-msvideo video/MP2T application/vnd.apple.mpegurl application/x-mpegURL application/dash+xml".split(" ").indexOf(d)!==
-1)return!1;if(d.startsWith("video/")||d.startsWith("audio/"))return!0;c=c.name.toLowerCase();for(d=0;d<f.length;d++)if(c.endsWith(f[d]))return!0;return!1};g.isValidSubtitleFile=async function(c,d){var f=[".srt",".vtt"];if(["text/plain","text/srt","text/vtt","text/vtt","application/x-subrip"].indexOf(d)!==-1)return!0;c=c.name.toLowerCase();for(var h=0;h<f.length;h++)if(c.endsWith(f[h]))return!0;return d.startsWith("text/")?!0:!1};g.isValidChapterFile=async function(c,d){var f=[".vtt",".webvtt",".json"];
if(["text/plain","text/vtt","text/vtt","application/json"].indexOf(d)!==-1)return!0;c=c.name.toLowerCase();for(var h=0;h<f.length;h++)if(c.endsWith(f[h]))return!0;return d.startsWith("text/")?!0:!1};g.playLocalFile=function(c,d,f){(g.murl||g._config.url)&&g.stop();g._config.url=c;g.murl=c;g.currentFileName=d;g.isPlaying=!0;g.force_stopped=!1;g.loadingOverlay&&(g.loadingOverlay.style.display="flex");var h=aa(g);if(h){g.setupEventsHandler();g.startHideControlbar(g);g.toast(O("playingFile","playing")+
": "+d,2E3,!1);var r={fileName:d,fileURL:c,timestamp:(new Date).toISOString(),source:"local"};f&&Object.assign(r,f);typeof g._config.onLocalFilePlaybackStart==="function"&&g._config.onLocalFilePlaybackStart.call(g,r);g.updateLocalPlaybackHint&&g.updateLocalPlaybackHint();g.localFileUrls||(g.localFileUrls=[]);g.localFileUrls.push(c);g.videoEl.addEventListener("loadeddata",function(){g.setplaystate(!0);var B={fileName:d,fileURL:c,duration:g.videoEl.duration,videoWidth:g.videoEl.videoWidth,videoHeight:g.videoEl.videoHeight,
currentTime:g.videoEl.currentTime,playbackRate:g.videoEl.playbackRate};f&&Object.assign(B,f);typeof g._config.onLocalFileMetadataReady==="function"&&g._config.onLocalFileMetadataReady.call(g,B)},{once:!0});g.videoEl.readyState>=2&&(g.setplaystate(!0),r={fileName:d,fileURL:c,duration:g.videoEl.duration,videoWidth:g.videoEl.videoWidth,videoHeight:g.videoEl.videoHeight,currentTime:g.videoEl.currentTime,playbackRate:g.videoEl.playbackRate},f&&Object.assign(r,f),typeof g._config.onLocalFileMetadataReady===
"function"&&g._config.onLocalFileMetadataReady.call(g,r))}else r={fileName:d,fileURL:c,error:O("playbackFailedUnsupportedFormat","Playback failed, unsupported media format"),errorCode:"PLAYBACK_FAILED",timestamp:(new Date).toISOString()},f&&Object.assign(r,f),typeof g._config.onLocalFilePlaybackError==="function"&&g._config.onLocalFilePlaybackError.call(g,r),g.toast(O("playbackFailedUnsupportedFormat","Playback failed, unsupported media format"),3E3,!0),g.loadingOverlay&&(g.loadingOverlay.style.display=
"none"),g.isPlaying=!1,g._config.url=null,g.murl=null;return h};g.cleanupLocalFiles=function(){this.localFileUrls&&(this.localFileUrls.forEach(function(c){URL.revokeObjectURL(c)}),this.localFileUrls=[])};g.selectLocalFile=function(){if(g._config.localPlayback){var c=document.createElement("input");c.type="file";c.accept="video/*,.mp4,.webm,.ogg,.ogv,.mov,.mkv,.m4v,audio/*,.flac,.wav,.m4a,.mp3,.opus";c.multiple=!1;c.onchange=function(d){d=d.target.files;d.length>0&&g.uploadFile(d[0])};c.click()}else g.toast(O("localFileDisabled",
"Local file playback is disabled"),3E3,!0)};if(g.playerContainer)g.initializeDragDrop();else{var x=function(){g.playerContainer?g.initializeDragDrop():setTimeout(x,100)};setTimeout(x,100)}g._config.localPlayback&&(g.updateLocalPlaybackHint(),g.localPlaybackHint&&(ia=g.localPlaybackHint.querySelector(".zwp-local-playback-text"),e=g.localPlaybackHint.querySelector(".zwp-local-playback-subtitle"),ia&&(ia.textContent=O("selectOrDropVideo","Select or drag video/audio files")),e&&(e.textContent=O("supportedFormats",
"Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats")),g.localPlaybackHint.setAttribute("aria-label",O("selectLocalVideo","Select Local Video File"))),g.updateDragDropText=function(){var c=document.getElementById("zwp-dragdrop-text-style");c&&c.remove();c=document.createElement("style");c.id="zwp-dragdrop-text-style";c.textContent='.zwp-drag-over::before { content: "'+O("dragDropToPlay","Drag and drop video/audio files here to play")+'" !important; }';document.head.appendChild(c)},
g.updateDragDropText());g.initKeyboardEvents=function(){!this.keyboardEventsInitialized&&this.onKeydown&&this.onKeyup&&(document.addEventListener("keydown",this.onKeydown),document.addEventListener("keyup",this.onKeyup),this.keyboardEventsInitialized=!0)};g.initKeyboardEvents();return g},ea=async function(e){if(typeof M.RTCPeerConnection=="undefined")return alert("This browser does not support the stream.\r\nPlease play this stream in chrome!"),!1;var l=I(e.murl);if(!l)return e.toast("Invalid url"),
!1;e.peer_conn=new RTCPeerConnection(typeof RTCPeerConnection.prototype.addTransceiver=="function"?{iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}:null);e.mediaStream=new MediaStream;e.peer_conn.ontrack=function(p){this.hasTracks||(this.setRtcstream(e.mediaStream),E());this.hasTracks++;this.mediaStream.addTrack(p.track);e.baseTrack&&p.track.kind!="video"||(e.baseTrack=p.track);e.rtcstatsTimerId||(e.packetsReceived=0,e.framesDecoded=
0,e.emptyCount=0,e.rtcstatsTimerId=M.setInterval(function(){e.baseTrack&&e.peer_conn.getStats(e.baseTrack).then(y=>{y.forEach(N=>{N.type=="inbound-rtp"&&N.kind=="video"&&(N.framesDecoded!=e.framesDecoded?(e.framesDecoded=N.framesDecoded,e.packetsReceived=N.packetsReceived,e.emptyCount=0):e.framesDecoded>0&&(e.emptyCount++,e.emptyCount>3&&(e.closecall(e),ea(e))))})})},1E3))}.bind(e);e.hasTracks=0;if(typeof e.peer_conn.addTransceiver=="function"){(typeof e._config.hasAudio==="undefined"||e._config.hasAudio)&&
await e.peer_conn.addTransceiver("audio",{direction:"recvonly"});await e.peer_conn.addTransceiver("video",{direction:"recvonly"});var n=await e.peer_conn.createOffer()}else n=await e.peer_conn.createOffer({offerToReceiveAudio:typeof e._config.hasAudio==="undefined"||e._config.hasAudio,offerToReceiveVideo:!0});await e.peer_conn.setLocalDescription(n);(new Promise(function(p,y){var N=l.is_brtc?{streamurl:l.streamUrl,sdp:n.sdp}:{api:l.apiUrl,rtcstream:l.streamUrl,clientip:null,sdp:n.sdp};l.urlObject.schema===
"webrtc"&&(delete N.rtcstream,N.streamurl=l.streamUrl);w(l.apiUrl,JSON.stringify(N),function(b){b.code?y(b):p(b)},function(b){"REQUEST:error"==b&&(e.tryStartPlayTimer=M.setTimeout(function(){delete e.tryStartPlayTimer;e.closecall(e);ea(e)},1E3));y(b)})})).then(p=>{e.peer_conn.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:p.sdp}))}).catch(p=>{e.peer_conn.close();e.peer_conn=null});e.closecall=function(p){p.rtcstatsTimerId&&(M.clearInterval(p.rtcstatsTimerId),delete p.rtcstatsTimerId);
p.tryStartPlayTimer&&(M.clearTimeout(p.tryStartPlayTimer),delete p.tryStartPlayTimer);typeof p.baseTrack!="undefined"&&delete p.baseTrack;p.peer_conn&&(p.videoEl&&(p.videoEl.srcObject=null),p.mediaStream&&delete p.mediaStream,p.peer_conn.close(),p.peer_conn=null)};return!0},na=async function(e){var l=e._config.xmc_url||M.xmc_url;if(!l)return e.toast("The rtsp protocol is not supported without setting XMC."),!1;l+="play";e.wsclient&&(e.wsclient.close(),delete e.wsclient);l=l.replace("http","ws");var n=
new WebSocket(l);n.onopen=function(){var p=typeof e._config.rtspOverTcp==="undefined"?1:e._config.rtspOverTcp,y=typeof e._config.rtsp_bypass==="boolean"?e._config.rtsp_bypass:0,N=typeof e._config.use_audio==="undefined"?0:e._config.use_audio,b="MediaSource"in M&&M.MediaSource.isTypeSupported("video/mp4;codecs=hvc1.1.1.L93.B0")?1:0;p=JSON.stringify({msgtype:"playurl",data:{sourceurl:e.murl,rtsp_over_tcp:p,has_audio:N,has_hevc:b,rtsp_bypass:y}});n.send(p)};n.onmessage=function(p){p=JSON.parse(p.data);
if(typeof p=="object"&&p.type==="onresult"&&p.event==="playurl"&&typeof p.streaminfo==="object")if(e.closecall2=function(N){N.waitSignTimer&&(M.clearTimeout(N.waitSignTimer),delete N.waitSignTimer);N.wsclient&&(N.wsclient.close(),N.wsclient=null,delete N.wsclient)},p.snapshot&&e.videoEl&&e.videoEl.setAttribute("poster",p.snapshot),e._config.useFlv||typeof p.streaminfo.rtc_playurl!=="string")typeof p.streaminfo.http_playurl==="string"?(y=p.streaminfo.http_playurl+p.streaminfo.stream+".flv",e.murl=
y,ba(e)):e.closecall2(e);else{var y=p.streaminfo.rtc_playurl+p.streaminfo.stream+".rtc";p.first?e.waitSignTimer=setTimeout(function(){e.murl=y;ea(e);delete e.waitSignTimer},1E3):(e.murl=y,ea(e))}};n.onclose=function(){e.wsclient&&delete e.wsclient};n.onerror=function(){};e.wsclient=n;return!0},ca=function(e){Ma("flv_js",La+"flv.min.js",function(l){var n=M.flvjs;if(!n.isSupported())return!1;l=!1;typeof e._config.isLive==="boolean"&&(l=e._config.isLive);var p={type:"flv",isLive:l,url:e.murl};var y=
{enableWorker:!1,enableStashBuffer:!1,stashInitialSize:0,lazyLoad:!1,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:0,isLive:!0};e.openFlv=function(){var N=n.createPlayer(p,y);N.on(n.Events.METADATA_ARRIVED,function(b){e.loadingOverlay&&(e.loadingOverlay.style.display="none")});N.on(n.Events.ERROR,function(b){});N.attachMediaElement(e.videoEl);e.videoEl.playbackRate=1;e.onFlvStaticInfo=function(b){this.videoEl.paused||(this.lastDecodedFrames?this.lastDecodedFrames!=b.decodedFrames?this.lastDecodedFrames=
b.decodedFrames:(this.lastDecodedFrames=0,this.flvPlayer&&(this.closecall(this),this.openFlv(),this.setplaystate(!0))):this.lastDecodedFrames=b.decodedFrames)}.bind(e);e.onFlvError=function(b){b!=="NetworkError"||e.reconnectTimer||(e.reconnectTimer=M.setTimeout(function(){e.flvPlayer&&(e.closecall(e),e.openFlv(),e.setplaystate(!0));delete e.reconnectTimer},1E3))}.bind(e);e.onMediainfoCb=function(b){b&&this.setMediainfo("flvjs",b)}.bind(e);N.on(n.Events.ERROR,e.onFlvError);N.on(n.Events.STATISTICS_INFO,
e.onFlvStaticInfo);N.on(n.Events.MEDIA_INFO,e.onMediainfoCb);e.delayCheckTimerId=M.setInterval(function(){if(this.flvPlayer&&!this.videoEl.paused){var b=this.flvPlayer;if(b.buffered.length){let G=b.buffered.end(0)-b.currentTime;G>=6?b.currentTime=b.buffered.end(0)-.2:G>3&&(e.videoEl.playbackRate=1.5,e.fastForwardTimerId=setTimeout(function(){e.videoEl.playbackRate=1;delete e.fastForwardTimerId},G*2E3))}}}.bind(e),2E3);N.load();N.play();e.flvPlayer=N;e.closecall=function(b){if(b.flvPlayer){var G=b.flvPlayer;
G.off(n.Events.ERROR,b.onFlvError);G.off(n.Events.STATISTICS_INFO,b.onFlvStaticInfo);G.off(n.Events.MEDIA_INFO,b.onMediainfoCb);delete b.onFlvError;delete b.onFlvStaticInfo;delete b.onMediainfoCb;b.delayCheckTimerId&&(M.clearInterval(b.delayCheckTimerId),delete b.delayCheckTimerId);b.fastForwardTimerId&&(M.clearTimeout(b.fastForwardTimerId),delete b.fastForwardTimerId);b.reconnectTimer&&(M.clearTimeout(b.reconnectTimer),delete b.reconnectTimer);G.pause();G.unload();G.detachMediaElement();G.destroy();
delete b.flvPlayer}}};e.openFlv();e.setplaystate(!0)});return!0},ba=function(e){Ma("mpeg_js",La+"mpeg.min.js?v=2.1",function(l){l=mpegts.getFeatureList();if(!mpegts.isSupported()||!l.mseLivePlayback)return!1;e.openMpegts=function(){var n=e.videoEl,p={autoCleanupSourceBuffer:!0,stashInitialSize:128,autoCleanupMaxBackwardDuration:20,autoCleanupMinBackwardDuration:10,enableWorker:!0,enableStashBuffer:!1},y=void 0,N=void 0,b=!1,G=!1,A={type:"mse",url:e.murl};typeof e._config.hasAudio==="boolean"&&(y=
e._config.hasAudio);typeof e._config.hasVideo==="boolean"&&(N=e._config.hasVideo);typeof e._config.isLive==="boolean"&&(b=e._config.isLive);A.hasAudio=y;A.hasVideo=N;if(A.isLive=b)e._config.useCustomLiveSync?G=!0:(p.liveSync=typeof e._config.useLiveChasing==="boolean"?e._config.useLiveChasing:!0,p.liveSync&&(typeof e._config.liveSyncMaxLatency!=="undefined"&&(p.liveSyncMaxLatency=e._config.liveSyncMaxLatency),typeof e._config.liveSyncPlaybackRate!=="undefined"&&(p.liveSyncPlaybackRate=e._config.liveSyncPlaybackRate)));
p=mpegts.createPlayer(A,p);e.onErrorCb=function(U){var D=this;U!==mpegts.ErrorTypes.NETWORK_ERROR||D.reconnectTimer||(D.reconnectTimer=M.setTimeout(function(){D.mpegtsPlayer&&(D.closecall(D),D.openMpegts());delete D.reconnectTimer},1E3))}.bind(e);e.onEventCb=function(U){}.bind(e);e.onMetadataCb=function(U){}.bind(e);e.onMediaInfoCb=function(U){U&&this.setMediainfo("mpegts",U)}.bind(e);e.onStatisCb=function(U){this.videoEl.paused||(this.lastDecodedFrames?this.lastDecodedFrames!=U.decodedFrames?(this.lastDecodedFrames=
U.decodedFrames,delete this.waitDecodedFrames):(typeof this.waitDecodedFrames==="undefined"?this.waitDecodedFrames=0:this.waitDecodedFrames++,this._config.reconnectByWaitFrames&&this.waitDecodedFrames>10&&(this.lastDecodedFrames=0,delete this.waitDecodedFrames,this.mpegtsPlayer&&(this.closecall(this),this.openMpegts()))):this.lastDecodedFrames=U.decodedFrames)}.bind(e);e.closecall=function(U){U.checkDelayTimerId&&(M.clearInterval(U.checkDelayTimerId),delete U.checkDelayTimerId);U.reconnectTimer||
(M.clearTimeout(U.reconnectTimer),delete U.reconnectTimer);U.fastForwardTimerId&&(M.clearTimeout(U.fastForwardTimerId),delete U.fastForwardTimerId);if(U.mpegtsPlayer){var D=U.mpegtsPlayer;D.pause();D.off(mpegts.Events.ERROR,U.onErrorCb);D.off(mpegts.Events.MEDIA_INFO,U.onMediaInfoCb);D.off(mpegts.Events.METADATA_ARRIVED,U.onMetadataCb);D.off(mpegts.Events.STATISTICS_INFO,U.onStatisCb);D.unload();D.detachMediaElement();D.destroy();delete U.onErrorCb;delete U.onMediaInfoCb;delete U.onMetadataCb;delete U.onStatisCb;
delete U.onEventCb;delete U.mpegtsPlayer}};G&&(e.checkDelayTimerId=M.setInterval(function(){var U=this;if(U.mpegtsPlayer&&!U.videoEl.paused&&typeof U.fastForwardTimerId==="undefined"&&U.mpegtsPlayer.buffered.length){var D=U.mpegtsPlayer.buffered;D=D.end(D.length-1)-U.mpegtsPlayer.currentTime;var fa=1.2;if(D>=6)fa=1.5;else if(D<2)return;U.videoEl.playbackRate=fa;U.fastForwardTimerId=setTimeout(function(){U.videoEl.playbackRate=1;delete U.fastForwardTimerId},D/fa*1E3)}}.bind(e),2E3));p.on(mpegts.Events.ERROR,
e.onErrorCb);p.on(mpegts.Events.MEDIA_INFO,e.onMediaInfoCb);p.on(mpegts.Events.METADATA_ARRIVED,e.onMetadataCb);p.on(mpegts.Events.STATISTICS_INFO,e.onStatisCb);p.attachMediaElement(n);p.load();p.play();e.mpegtsPlayer=p};e.openMpegts()});return!0},ja=function(e){Ma("hls_js",La+"hls.min.js",function(l){var n=M.Hls;if(n.isSupported()){var p=e,y=new n;y.attachMedia(e.videoEl);y.on(n.Events.MEDIA_ATTACHED,function(){y.loadSource(e.murl);y.on(n.Events.MANIFEST_PARSED,function(G,A){p.loadingOverlay&&(p.loadingOverlay.style.display=
"none");p.videoEl.play();p.setplaystate(!0)})});y.on(n.Events.ERROR,function(G,A){if(A.fatal)switch(A.type){case n.ErrorTypes.NETWORK_ERROR:y.startLoad();break;case n.ErrorTypes.MEDIA_ERROR:y.recoverMediaError();break;default:y.destroy(),delete e.hlsPlayer,p.setplaystate(!1)}});p.onHlsManifestParsed=function(G,A){var U=this;if(A.levels.length>1){var D=[];for(G=0;G<A.levels.length;G++){var fa={mediaType:"video",bitrate:A.levels[G].bitrate,height:A.levels[G].height,width:A.levels[G].width,qualityIndex:G,
name:A.levels[G].name||"q"+G};D.push(fa)}U.switchQualityLevel=function(ha){y.nextLevel=parseInt(ha)}.bind(U);U.createQualitiesMenu(D);y.on(n.Events.LEVEL_SWITCHED,function(ha,qa){U.updateQualityLevel(y.currentLevel,y.autoLevelEnabled)},U)}else U.resetQualitiesMenu();if(A.subtitleTracks&&A.subtitleTracks.length>0){D=[];for(G=0;G<A.subtitleTracks.length;G++)fa=A.subtitleTracks[G],fa.forced||(fa={"default":fa.default,id:fa.id,lang:fa.lang,name:fa.name,url:fa.url},D.push(fa));U.switchSubtitleTrack=function(ha){ha=
parseInt(ha);ha===-1?y.subtitleDisplay=!1:(y.subtitleDisplay=!0,y.subtitleTrack=ha)};U.createSubtitlesMenu(D);y.on(n.Events.SUBTITLE_TRACK_SWITCH,function(ha,qa){U.updateSubtitleTrack(qa.id)})}}.bind(p);p.onHlsManifestLoaded=function(G,A){}.bind(p);y.on(n.Events.MANIFEST_PARSED,p.onHlsManifestParsed);y.on(n.Events.MANIFEST_LOADED,p.onHlsManifestLoaded);p.hlsPlayer=y;p.closecall=function(G){G.hlsPlayer&&(G.hlsPlayer.off(n.Events.MANIFEST_PARSED,G.onHlsManifestParsed),G.hlsPlayer.off(n.Events.MANIFEST_LOADED,
G.onHlsManifestLoaded),G.hlsPlayer.detachMedia(),G.hlsPlayer.destroy(),delete G.hlsPlayer,delete G.onHlsManifestParsed,delete G.onHlsManifestLoaded)}}else if(e.videoEl.canPlayType("application/vnd.apple.mpegurl")){p=e;e.videoEl.zwplayer=e;var N=function(){typeof this.zwplayer=="object"&&(this.play(),this.zwplayer.setplaystate(!0))},b=function(){};p.videoEl.addEventListener("loadedmetadata",N);p.videoEl.addEventListener("error",b);p.closecall=function(G){typeof G.videoEl==="object"&&(G.videoEl.pause(),
G.videoEl.src="",G.videoEl.removeEventListener("loadedmetadata",N),G.videoEl.removeEventListener("error",b),typeof G.videoEl.zwplayer=="object"&&delete G.videoEl.zwplayer)};p.videoEl.src=p.murl}else return e.toast("player cannot play hls media"),!1});return!0},ra=function(e){Ma("dash_js",La+"dash.all.min.js",function(l){var n=M.dashjs,p=n.MediaPlayer().create();p.initialize(e.videoEl,e.murl,!0);l=e.getSimpleSubtitleRenderer();p.attachTTMLRenderingDiv(l);e.dashTextTrackList={};e.onDashMetadata=function(y){this.loadingOverlay&&
(this.loadingOverlay.style.display="none");this.videoEl.play();this.setplaystate(!0)}.bind(e);e.onDashQualityChanged=function(y){y=p.getQualityFor("video");var N=p.getSettings().streaming.abr.autoSwitchBitrate.video||!1;e.updateQualityLevel(y,N)}.bind(e);e.onDashStreamInitialized=function(y){p.getBitrateInfoListFor("audio");y=p.getBitrateInfoListFor("video")||[];y.length>1?(this.switchQualityLevel=function(N){N=parseInt(N);var b={streaming:{abr:{autoSwitchBitrate:{}}}};N>=0?(b.streaming.abr.autoSwitchBitrate.video=
!1,p.updateSettings(b),p.setQualityFor("video",N,!1)):(b.streaming.abr.autoSwitchBitrate.video=!0,p.updateSettings(b))}.bind(this),this.createQualitiesMenu(y),p.on(n.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.onDashQualityChanged,this)):this.resetQualitiesMenu()}.bind(e);e.onDashTracksAdded=function(y){var N=this.dashTextTrackList;N[y.streamId]||(N[y.streamId]=[]);N[y.streamId]=N[y.streamId].concat(y.tracks)};e.onDashStreamDeactivated=function(y){var N=this.dashTextTrackList;y.streamInfo&&N[y.streamInfo.id]&&
delete N[y.streamInfo.id]}.bind(e);e.onDashStreamActivated=function(y){y=y.streamInfo.id||"none";var N=this.dashTextTrackList;if(N[y]&&(y=N[y],!(y.length<1))){N=[];for(var b=0;b<y.length;b++){var G=y[b],A=nb(G.labels);A?A+=" : "+G.type:(A=G.label||G.lang,A+=" : "+G.kind);N.push({"default":G.defaultTrack,id:b,lang:G.lang,name:A,url:G.url||""})}this.switchSubtitleTrack=function(U){var D=this.dashPlayer||null;D&&(parseInt(U),D.setTextTrack(U))}.bind(this);this.createSubtitlesMenu(N)}}.bind(e);p.on(n.MediaPlayer.events.PLAYBACK_METADATA_LOADED,
e.onDashMetadata,e);p.on(n.MediaPlayer.events.STREAM_INITIALIZED,e.onDashStreamInitialized,e);p.on(n.MediaPlayer.events.STREAM_ACTIVATED,e.onDashStreamActivated,e);p.on(n.MediaPlayer.events.STREAM_DEACTIVATED,e.onDashStreamDeactivated,e);p.on(n.MediaPlayer.events.TEXT_TRACKS_ADDED,e.onDashTracksAdded,e);e.dashPlayer=p;e.closecall=function(y){y.dashPlayer&&(y.dashPlayer.pause(),y.dashPlayer.off(n.MediaPlayer.events.PLAYBACK_METADATA_LOADED,y.onDashMetadata,y),y.dashPlayer.off(n.MediaPlayer.events.STREAM_INITIALIZED,
y.onDashStreamInitialized,y),y.dashPlayer.off(n.MediaPlayer.events.STREAM_ACTIVATED,y.onDashStreamActivated,y),y.dashPlayer.off(n.MediaPlayer.events.STREAM_DEACTIVATED,y.onDashStreamDeactivated,y),y.dashPlayer.on(n.MediaPlayer.events.TEXT_TRACKS_ADDED,e.onDashTracksAdded,e),y.switchQualityLevel&&(y.dashPlayer.off(n.MediaPlayer.events.QUALITY_CHANGE_RENDERED,y.onDashQualityChanged,y),delete y.switchQualityLevel),y.dashPlayer.destroy(),delete y.dashPlayer,delete y.onDashMetadata,delete y.onDashStreamInitialized,
delete y.onDashStreamActivated,delete y.onDashStreamDeactivated,delete y.onDashTracksAdded,delete y.switchSubtitleTrack)}});return!0},ka=function(e,l){var n=e._config.cdn_addr||M.cdn_addr;if(!n)return e.toast("The webcdn protocol is not supported due without setting cdn server address url."),!1;n.endsWith("/")||(n+="/");n+="cdnplay";e.wcdnClient&&(e.wcdnClient.close(),delete e.wcdnClient);n=n.replace("http","ws");M.location.protocol=="https:"&&(n=n.replace("ws:","wss:"));var p=l.indexOf("://");if(p<
0)return e.toast("Invalid wcdn url:"+l),!1;l=l.substr(p+3);(p=e._config.userInfo||M.userInfo)||(p={userid:"0",username:"Visitor",nickname:"Visitor"});var y={msgtype:"startplay",data:{userid:p.userid||"0",username:p.username||"Visitor",nickname:p.nickname||"Visitor",avatar:p.avatar||"",streamurl:l}},N=function(b){var G=new WebSocket(n);G.onopen=function(A){A=JSON.stringify(y);G.send(A)};G.onmessage=function(A){if(typeof A.data==="string")try{var U=JSON.parse(A.data),D=U.msgtype||"none",fa=U.event||
"none";if(D==="onresult")if(fa==="startplay"){var ha=U.data||null;if(ha&&typeof ha==="object"){A=void 0;typeof b.closecall2==="function"&&(A=b.closecall2,b.closecall2=null);U={msgtype:"playstatus",data:{status:"playing"}};b.play(ha,!0)||(U.data.status="error");var qa=JSON.stringify(U);G.send(qa);typeof A==="function"&&(b.closecall2=A)}else{var g=U.msg||"Unknown error";g==="StreamNotExist"?(b.toast(O("waitStreamToReady","Waiting for stream")),b.errorHandleTimerId=M.setTimeout(function(){delete b.errorHandleTimerId;
b.toast("closetoast");var xa=JSON.stringify(y);G.send(xa)},3E3)):(b.toast(fa+" error:"+g),b.errorHandleTimerId=M.setTimeout(function(){delete b.errorHandleTimerId;b.stop()},2E3))}}else fa==="endplay"&&b.stop();else D==="error"?b.toast(fa+" error:"+U.msg||"Unknown error"):D==="command"&&(U.action||"none")==="stopplay"&&(b.toast("Server is close, player is stop."),b.errorHandleTimerId=M.setTimeout(function(){delete b.errorHandleTimerId;b.stop()},100),b.wcdnClient&&(b.wcdnClient.ws.close(),b.wcdnClient=
null))}catch(xa){}};G.onerror=function(A){};G.onclose=function(A){this.wsVersionId===b.wsVersionId&&b.wcdnClient&&!b.cdnReconnectTimerId&&b.wcdnClient===this&&(b.cdnReconnectTimerId=setTimeout(function(){N(b)},1E3),delete b.wcdnClient)};G.wsVersionId=(new Date).getTime();b.wcdnClient=G;b.wsVersionId=G.wsVersionId;typeof b.cdnReconnectTimerId!=="undefined"&&delete b.cdnReconnectTimerId};e.closecall2=function(b){e.cdnReconnectTimerId&&(clearTimeout(e.cdnReconnectTimerId),delete e.cdnReconnectTimerId);
e.errorHandleTimerId&&(clearTimeout(e.errorHandleTimerId),delete e.errorHandleTimerId);e.wcdnClient?(b=e.wcdnClient,delete e.wcdnClient,b.close()):e.toast("The wcdn connection has been passively closed.")};N(e);return!0},aa=function(e){var l=e.videoEl;e.closecall=function(n){if(n.isPlayVideo){var p=n.videoEl;p.paused||p.pause();p.src="";delete n.isPlayVideo}};e.isPlayVideo=!0;l.src=e.murl;e.resetPlaybackState();return!0},pa=function(e){var l=e.videoEl;e.closecall=function(n){if(n.isPlayAudio){var p=
n.videoEl;p.paused||p.pause();p.src="";delete n.isPlayAudio}};e.isPlayAudio=!0;l.src=e.murl;e.resetPlaybackState();return!0},V=function(e){var l=e.murl;if((l.type||"")==="dvr"&&l.http)return e.murl=l.http,aa(e);if(M.MediaSource&&M.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')){var n=M.RTCPeerConnection||M.webkitRTCPeerConnection||M.mozRTCPeerConnection||M.RTCIceGatherer;if(l.rtc&&n)return e.murl=l.rtc,ea(e);if(l["httpflv-n"])return e.murl=l["httpflv-n"],e._config.useOldFlv?
ca(e):ba(e);if(l.httpflv)return e.murl=l.httpflv,e._config.useOldFlv?ca(e):ba(e);if(l["wsflv-n"])return e.murl=l["wsflv-n"],e._config.useOldFlv?ca(e):ba(e);if(l.wsflv)return e.murl=l.wsflv,e._config.useOldFlv?ca(e):ba(e);if(l.hls)return e.murl=l.hls,ja(e);if(l.dash)return e.murl=l.dash,ra(e);if(l.ts)return e.murl=l.ts,ba(e)}else if(e.murl.hls)return e.murl=e.murl.hls,ja(e);return!1},F=function(e){var l=[];var n=String.fromCharCode(107)+"u"+String.fromCharCode(97)+"ishou";var p=String.fromCharCode(46)+
"co"+String.fromCharCode(109)+"/",y=String.fromCharCode(100)+"ou"+String.fromCharCode(121)+"i"+String.fromCharCode(110);l.push("https://live."+n+p+"u/");l.push("https://live."+y+p);if(typeof e==="string"&&e.length>23)for(p=0;p<l.length;p++)if(n=l[p],e.indexOf(n)===0)return!0;return!1};Z.prototype={play:function(e,l,n){var p=this;if(e){p.murl&&p.stop();if(typeof e==="object"&&e instanceof File)try{var y=e;p.detectMimeType(y).then(function(ma){return p.isValidVideoFile(y,ma).then(function(ia){if(!ia)return p.toast(O("unsupportedFileFormat",
"Unsupported file format")+": "+ma,3E3,!0),p.stop(),!1;ia=URL.createObjectURL(y);e=p._currentBlobUrl=ia;p._currentFile=y;ia=p.getFileExtension(y.name);if(!ia||ia===".")if(ma.includes("mp4"))ia=".mp4";else if(ma.includes("webm"))ia=".webm";else if(ma.includes("ogg"))ia=".ogv";else if(ma.includes("avi"))ia=".avi";else if(ma.includes("mov"))ia=".mov";else if(ma.includes("flv"))ia=".flv";else if(ma.includes("m3u8"))ia=".m3u8";else if(ma.includes("mpd"))ia=".mpd";else if(ma.includes("mp2t")||ma.includes("ts"))ia=
".ts";else if(ma.includes("matroska")||ma.includes("webm"))ia=".mkv";p._detectedFileExt=ia;p._detectedMimeType=ma})}).catch(function(ma){ma="."+y.name.split(".").pop().toLowerCase();p._detectedFileExt=ma;ma=URL.createObjectURL(y);p._currentFile=y;e=p._currentBlobUrl=ma})}catch(ma){return p.toast("Failed to load local file",3E3,!0),!1}if(typeof e==="string"&&(e.startsWith("wcdn://")||e.startsWith("wcdns://")))return l=ka(p,e);if(typeof e==="object"){typeof e.thumbnails==="object"&&(p._config.thumbnails=
JSON.parse(JSON.stringify(e.thumbnails)));if(typeof e.murls==="object"){p.multiStreams=JSON.parse(JSON.stringify(e));var N=e.murls}else Array.isArray(e)?(p.multiStreams={},N=e):(p.multiStreams={},N=[e]),p.multiStreams.murls=N;var b=!0,G="",A=[],U;for(U in N){var D=N[U];if(typeof D==="object")if(Array.isArray(D)){var fa="";var ha=D[0];if(D.length>2){var qa=D[2];fa=D[1]}else qa=D.length>1?D[1]:U;A.push({url:ha,name:qa,mime:fa});b&&(e=ha,G=qa,b=!1)}else{if(ha=!1,"default"in D&&D["default"]&&(ha=D["default"]),
b||ha)"url"in D&&(e=D.url),G=b="name"in D?D.name:U,b=!1}else typeof D==="string"&&b&&(b=U,e=D,G=b,b=!1)}A.length>0&&(p.multiStreams.murls=A);p.multiStreams.curStream=G}p.murl=e}if(!p.murl)return!1;p.force_stopped=!1;p.isPlaying=!0;p.loadingOverlay&&(p.loadingOverlay.style.display="flex");typeof l!="undefined"&&(l?p._config.isLive=l:delete p._config.isLive);typeof n!="undefined"&&(n?p._config.useOldFlv=n:delete p._config.useOldFlv);l=!1;if(typeof p.murl=="object")l=V(p);else if(typeof p.murl=="string"){l=
J(p.murl);!l&&p._detectedFileExt&&(l=p._detectedFileExt);l||(N=p.murl.indexOf("mime_type="),N>0&&(N+=10,A=p.murl.indexOf("&",N),A<0&&(A=p.murl.length),N=p.murl.substring(N,A),N==="video_mp4"?l=".mp4":N==="video_flv"?l=".flv":N==="video_hls"?l=".m3u8":N==="video_rtc"?l=".rtc":N==="video_dash"&&(l=".mpd")));if(!l&&(typeof p._config.streamtype==="string"&&(p._config.streamtype==="httpflv"?l=".flv":p._config.streamtype==="hls"?l=".m3u8":p._config.streamtype==="dash"?l=".mpd":p._config.streamtype==="mpegts"?
l=".ts":p._config.streamtype==="webrtc"&&(l=".rtc")),!l&&F(p.murl))){var g=function(){setTimeout(function(){p.loadingOverlay&&(p.loadingOverlay.style.display="none")},1E3)};if(!p._config.url_proxy)return p.toast("Sorry, the player cannot play this media address",5E3,!0),g(),!1;var xa=xa;w(p._config.url_proxy,JSON.stringify({roomUrl:p.murl,token:p._config.proxy_token||"12345678"}),function(ma){if(typeof ma==="object"&&ma.result){ma={murls:ma.flvStreams||ma.hlsStreams,multistream:1};if(!ma.murls)return p.toast("Sorry, missing valid address for this room.",
5E3,!0),g(),!1;p.play(ma,xa,n)}else p.toast("Sorry, unable to obtain a valid address for this room.",5E3,!0),g()},function(ma){p.toast("Sorry, failed to get address due to network!",5E3,!0);g()});return!1}l=p.murl.indexOf("rtsp")===0?na(p):l===".rtc"||p.murl.startsWith("webrtc://")||p.murl.startsWith("brtc://")?ea(p):l===".flv"?p._config.useOldFlv?ca(p):ba(p):l===".m3u8"?ja(p):l===".mpd"?ra(p):l===".mp4"?aa(p):l===".mp3"||l===".m4a"||l===".aac"||l===".mp4a"||l===".ogg"?pa(p):l===".ts"?ba(p):aa(p)}l?
(p.setupEventsHandler(),p.startHideControlbar(p),p.multiStreams&&M.setTimeout(function(){p.buildStreamSelector()},1E3)):(p.isPlaying=!1,p.loadingOverlay&&(p.loadingOverlay.style.display="none"),p.toast("Play media failed, unsupported media type",5E3,!0));return l},__switchStream:function(e){if(typeof e!=="string")this.toast("Switch stream methon does not support "+e);else{this.murl=e;e=J(this.murl);if(!e){var l=this.murl.indexOf("mime_type=");if(l>0){l+=10;var n=this.murl.indexOf("&",l);n<0&&(n=this.murl.length);
l=this.murl.substring(l,n);l==="video_mp4"?e=".mp4":l==="video_flv"?e=".flv":l==="video_hls"?e=".m3u8":l==="video_rtc"?e=".rtc":l==="video_dash"&&(e=".mpd")}}e||typeof this._config.streamtype==="string"&&(this._config.streamtype==="httpflv"?e=".flv":this._config.streamtype==="hls"?e=".m3u8":this._config.streamtype==="dash"?e=".mpd":this._config.streamtype==="mpegts"?e=".ts":this._config.streamtype==="webrtc"&&(e=".rtc"));!this._config.isLive&&this.videoEl&&(this.postSeekTime=this.videoEl.currentTime);
this.closecall&&(this.closecall(this),delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load());(this.murl.indexOf("rtsp")===0?na(this):e===".rtc"||this.murl.startsWith("webrtc://")||this.murl.startsWith("brtc://")?ea(this):e===".flv"?this._config.useOldFlv?ca(this):ba(this):e===".m3u8"?ja(this):e===".mpd"?ra(this):e===".mp4"?aa(this):e===".mp3"||e===".m4a"||e===".aac"||e===".mp4a"||e===".ogg"?pa(this):
e===".ts"?ba(this):aa(this))||this.toast("Switch stream failed, unsupported media type")}},stop:function(){this.closecall&&(this.closecall(this),this.removeVideoEventHandlers(),delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load());if(this._currentBlobUrl){try{URL.revokeObjectURL(this._currentBlobUrl)}catch(e){}this._detectedFileExt=this._currentFile=this._currentBlobUrl=null}this.isPlaying=!1;
this.setplaystate(!1);this.updateProgress(0);this.timeSpan&&(this.timeSpan.innerHTML="");this.controlbar&&(this.controlbar.querySelector(".zwp__duration-container").style.display="none");this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.style.display="none");this.progressBar&&this.progressBar.chapters&&(this.progressBar.chapters.innerHTML="");this.subtitles&&delete this.subtitles;this.subtitleShow&&(this.subtitleShow.style.display="none");this.toastTimerId&&(clearTimeout(this.toastTimerId),
delete this.toastTimerId,this.toastBox&&(this.overlay_layers.removeChild(this.toastBox),delete this.toastBox));this.mutedTipBox&&(this.popup_layers.removeChild(this.mutedTipBox),this.popup_layers.style.display=null,delete this.mutedTipBox);this.overlayLayerClickTimer&&(M.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);delete this.multiStreams;this.resetSpeedMenu();this.resetQualitiesMenu();this.removeChapters();this.resetSubtitleMenu()},pause:function(){this.isPlaying&&
this.videoEl&&!this.videoEl.paused&&!this.videoEl.ended&&(this.videoEl.pause(),this.setplaystate(!1))},resume:function(){this.isPlaying?this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&(this.videoEl.play(),this.setplaystate(!0)):this._config.url&&this.play(this._config.url)},seekTime:function(e){if(this.isPlaying&&this.videoEl&&!(e<0)){var l=this.videoEl.duration;isNaN(l)||l===Infinity||(e>l&&(e=l),this.videoEl.currentTime=e)}},getDuration:function(){if(this.isPlaying&&this.videoEl)return this.videoEl.duration},
destroy:function(){this.cleanupLocalFiles&&this.cleanupLocalFiles();this.closecall&&(this.closecall(this),this.removeVideoEventHandlers(),delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);this.videoRemoveWhenClose&&(this.videoEl&&this.videoWrapper&&(this.videoWrapper.removeChild(this.videoEl),this.playerContainer.removeChild(this.videoWrapper),delete this.videoWrapper),delete this.videoRemoveWhenClose);this.audioContext&&(this.audioContext.state!=="closed"&&this.audioContext.close(),
this.audioContext=null,delete this.audioContext);this.audioGainNode&&(this.audioGainNode=null,delete this.audioGainNode);this.audioVolumeNode&&(this.audioVolumeNode=null,delete this.audioVolumeNode);this.audioSource&&(this.audioSource=null,delete this.audioSource);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load(),this.videoEl=null,delete this.videoEl);this.snapCanvas&&delete this.snapCanvas;this.controlbar&&(this.progressBar&&this.progressBar.chapters&&(this.progressBar.chapters.innerHTML=
""),this.playerContainer.removeChild(this.controlbar),delete this.controlbar);this.danmuToolbar&&(this.danmuToolbar.remove(),delete this.danmuToolbar);this.subtitles&&delete this.subtitles;this.toastTimerId&&(clearTimeout(this.toastTimerId),delete this.toastTimerId,this.toastBox&&(this.overlay_layers.removeChild(this.toastBox),delete this.toastBox));this.overlayLayerClickTimer&&(M.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);this.overlay_layers&&(this.subtitle1&&delete this.subtitle1,
this.subtitle2&&delete this.subtitle2,this.subtitleShow&&(Da.removeElement(this.subtitleShow),delete this.subtitleShow),this.danmuPlayer&&(this.danmuPlayer.destroy(),delete this.danmuPlayer),this.playerContainer.removeChild(this.overlay_layers),delete this.overlay_layers);this.popup_layers&&(this.playerContainer.removeChild(this.popup_layers),delete this.popup_layers);this.playerElm&&(delete this.playerContainer.zwpDragable,this.playerElm.removeChild(this.playerContainer),delete this.playerContainer,
this.doDeletePlayerElm?(document.removeChild(this.playerElm),delete this.playerElm):this.doRemovePlayerClass&&(R(this.playerElm,"zwp-wrap"),this.playerElm.setAttribute("class",this.playerElmOldClass)));this.windowScrollHandler&&(M.removeEventListener("scroll",this.windowScrollHandler),delete this.windowScrollHandler);this.updateLocalPlaybackHint&&this.updateLocalPlaybackHint()},seekVideo:function(e){if(this.videoEl){var l=this.videoEl.duration||0;e=this.videoEl.currentTime+e;e<0?e=0:e>l&&(e=l);this.videoEl.currentTime=
e}},setplaystate:function(e){if(this.controlbar){this.playbtn||(this.playbtn=this.controlbar.querySelector(".zwp-playbtn"));if(this.playbtn)if(e)this.playbtn.setAttribute("data-action","pause"),this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="none");else{if(this.keyState&&this.keyState.isRewinding)return;this.playbtn.setAttribute("data-action","play");this.updateLocalPlaybackHint?this.updateLocalPlaybackHint(!0):this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="flex")}this.playerElm&&
(e?(R(this.playerElm,"zwp-pause"),Q(this.playerElm,"zwp-playing")):(R(this.playerElm,"zwp-playing"),Q(this.playerElm,"zwp-pause")));this.loadingOverlay&&(this.loadingOverlay.style.display="none")}},setEnableDanmu:function(e){e?this.overlay_layers&&!this.danmuPlayer&&(this.danmuPlayer=HUAYI.Danmu.create({playerId:this.overlay_layers})):this.danmuPlayer&&(this.danmuPlayer.destroy(),delete this.danmuPlayer)},appendDanmu:function(e,l){this.danmuPlayer&&(l||(l=this.danmuSetting),this.danmuPlayer.addDanmu(e,
l))},setChapters:function(e){e===null?this.removeChapters():(this.chapters=e,this.videoEl&&setTimeout(function(){this.loadChapters()}.bind(this),1E3))},addSubtitle:function(e,l,n){this.loadSubtitle(e,l,n)},removeSubtitle:function(){this.showSubtitle(!1)},buildDanmuControlbar:function(e,l){this.buildDanmuToolbar(e,l)},notifyResize:function(e,l){this.playerElm&&(typeof e!=="undefined"&&(typeof e==="number"&&(e+="px"),this.playerElm.style.width=e),typeof l!=="undefined"&&(typeof l==="number"&&(l+="px"),
this.playerElm.style.height=l))},lightOff:function(){this.playerElm&&Q(this.playerElm,"zwp-state-light-off")},lightOn:function(){this.playerElm&&R(this.playerElm,"zwp-state-light-off")},get CurrentTime(){return this.isPlaying&&this.videoEl?this.videoEl.currentTime:-1},set CurrentTime(e){if(this.isPlaying&&this.videoEl&&!(e<0)){var l=this.videoEl.duration;isNaN(l)||l===Infinity||(e>l&&(e=l),this.videoEl.currentTime=e)}},setLanguage:function(e,l){if(!e||!Ba[e])return!1;var n=Ea;if(e&&Ba[e]){var p=Ea;
Ea=e;l&&typeof M!=="undefined"&&M.dispatchEvent&&(p=new CustomEvent("zwplayerLanguageChanged",{detail:{oldLang:p,newLang:e}}),M.dispatchEvent(p));p=!0}else p=!1;if(p){this._config.language=e;l&&this.controlbar&&this.refreshControlbar();if(this._config.onLanguageChange)this._config.onLanguageChange(n,e);return!0}return!1},getLanguage:function(){return this._config.language||Ea},getText:function(e,l){var n=this.getLanguage();return O(e,l,n)},refreshControlbar:function(){if(this.controlbar&&this._config.controlbar!==
!1){var e=this.isPlaying,l=this.videoEl?this.videoEl.currentTime:0;this.controlbar.innerHTML=fb(this._config);e&&this.videoEl&&(this.videoEl.currentTime=l)}this.localPlaybackHint&&this._config.localPlayback&&(e=this.localPlaybackHint.querySelector(".zwp-local-playback-text"),l=this.localPlaybackHint.querySelector(".zwp-local-playback-subtitle"),e&&(e.textContent=O("selectOrDropVideo","Select or drag video/audio files")),l&&(l.textContent=O("supportedFormats","Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats")),
this.localPlaybackHint.setAttribute("aria-label",O("selectLocalVideo","Select Local Video File")));this.updateDragDropText&&this.updateDragDropText()}};return Z})})(window);
