@elementmints/shadow-plyr 1.1.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- function e(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function t(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.value=n:t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;const n='<svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>',i='<svg viewBox="0 0 24 24"><path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/></svg>',o='<svg viewBox="0 0 24 24"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>',s='<svg viewBox="0 0 24 24"><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/></svg>',a='<svg viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>',r='<svg viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/></svg>',l='<svg viewBox="0 0 24 24"><path d="M20.38 8.57l-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83z"/></svg>',c=new Map;
2
- /*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
3
- const{entries:d,setPrototypeOf:p,isFrozen:u,getPrototypeOf:h,getOwnPropertyDescriptor:m}=Object;let{freeze:f,seal:v,create:b}=Object,{apply:g,construct:y}="undefined"!=typeof Reflect&&Reflect;f||(f=function(e){return e}),v||(v=function(e){return e}),g||(g=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return e.apply(t,i)}),y||(y=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const w=D(Array.prototype.forEach),E=D(Array.prototype.lastIndexOf),k=D(Array.prototype.pop),A=D(Array.prototype.push),T=D(Array.prototype.splice),x=D(String.prototype.toLowerCase),S=D(String.prototype.toString),C=D(String.prototype.match),N=D(String.prototype.replace),L=D(String.prototype.indexOf),M=D(String.prototype.trim),_=D(Object.prototype.hasOwnProperty),O=D(RegExp.prototype.test),R=(P=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y(P,t)});var P;function D(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return g(e,t,i)}}function z(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x;p&&p(e,null);let i=t.length;for(;i--;){let o=t[i];if("string"==typeof o){const e=n(o);e!==o&&(u(t)||(t[i]=e),o=e)}e[o]=!0}return e}function I(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function F(e){const t=b(null);for(const[n,i]of d(e)){_(e,n)&&(Array.isArray(i)?t[n]=I(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=F(i):t[n]=i)}return t}function W(e,t){for(;null!==e;){const n=m(e,t);if(n){if(n.get)return D(n.get);if("function"==typeof n.value)return D(n.value)}e=h(e)}return function(){return null}}const U=f(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),B=f(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),H=f(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),V=f(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),q=f(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),G=f(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Y=f(["#text"]),j=f(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),X=f(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$=f(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),K=f(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Z=v(/\{\{[\w\W]*|[\w\W]*\}\}/gm),J=v(/<%[\w\W]*|[\w\W]*%>/gm),Q=v(/\$\{[\w\W]*/gm),ee=v(/^data-[\-\w.\u00B7-\uFFFF]+$/),te=v(/^aria-[\-\w]+$/),ne=v(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ie=v(/^(?:\w+script|data):/i),oe=v(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),se=v(/^html$/i),ae=v(/^[a-z][.\w]*(-[.\w]+)+$/i);var re=Object.freeze({__proto__:null,ARIA_ATTR:te,ATTR_WHITESPACE:oe,CUSTOM_ELEMENT:ae,DATA_ATTR:ee,DOCTYPE_NAME:se,ERB_EXPR:J,IS_ALLOWED_URI:ne,IS_SCRIPT_OR_DATA:ie,MUSTACHE_EXPR:Z,TMPLIT_EXPR:Q});const le=1,ce=3,de=7,pe=8,ue=9,he=function(){return"undefined"==typeof window?null:window};var me,fe,ve,be,ge,ye,we,Ee,ke,Ae,Te,xe,Se,Ce,Ne,Le,Me,_e,Oe,Re,Pe,De,ze,Ie,Fe,We,Ue,Be,He,Ve,qe,Ge,Ye,je,Xe,$e,Ke,Ze,Je,Qe,et,tt,nt,it,ot,st,at,rt,lt,ct,dt,pt,ut,ht,mt,ft,vt,bt,gt,yt,wt,Et,kt,At,Tt,xt,St,Ct,Nt,Lt,Mt,_t,Ot,Rt,Pt,Dt,zt,It,Ft,Wt,Ut,Bt,Ht,Vt,qt,Gt=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:he();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||t.document.nodeType!==ue||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const o=i,s=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:r,Node:l,Element:c,NodeFilter:p,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:v}=t,g=c.prototype,y=W(g,"cloneNode"),P=W(g,"remove"),D=W(g,"nextSibling"),I=W(g,"childNodes"),Z=W(g,"parentNode");if("function"==typeof r){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let J,Q="";const{implementation:ee,createNodeIterator:te,createDocumentFragment:ie,getElementsByTagName:oe}=i,{importNode:ae}=o;let me={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof d&&"function"==typeof Z&&ee&&void 0!==ee.createHTMLDocument;const{MUSTACHE_EXPR:fe,ERB_EXPR:ve,TMPLIT_EXPR:be,DATA_ATTR:ge,ARIA_ATTR:ye,IS_SCRIPT_OR_DATA:we,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:ke}=re;let{IS_ALLOWED_URI:Ae}=re,Te=null;const xe=z({},[...U,...B,...H,...q,...Y]);let Se=null;const Ce=z({},[...j,...X,...$,...K]);let Ne=Object.seal(b(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Le=null,Me=null;const _e=Object.seal(b(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Oe=!0,Re=!0,Pe=!1,De=!0,ze=!1,Ie=!0,Fe=!1,We=!1,Ue=!1,Be=!1,He=!1,Ve=!1,qe=!0,Ge=!1,Ye=!0,je=!1,Xe={},$e=null;const Ke=z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ze=null;const Je=z({},["audio","video","img","source","image","track"]);let Qe=null;const et=z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",it="http://www.w3.org/1999/xhtml";let ot=it,st=!1,at=null;const rt=z({},[tt,nt,it],S);let lt=z({},["mi","mo","mn","ms","mtext"]),ct=z({},["annotation-xml"]);const dt=z({},["title","style","font","a","script"]);let pt=null;const ut=["application/xhtml+xml","text/html"];let ht=null,mt=null;const ft=i.createElement("form"),vt=function(e){return e instanceof RegExp||e instanceof Function},bt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!mt||mt!==e){if(e&&"object"==typeof e||(e={}),e=F(e),pt=-1===ut.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ht="application/xhtml+xml"===pt?S:x,Te=_(e,"ALLOWED_TAGS")?z({},e.ALLOWED_TAGS,ht):xe,Se=_(e,"ALLOWED_ATTR")?z({},e.ALLOWED_ATTR,ht):Ce,at=_(e,"ALLOWED_NAMESPACES")?z({},e.ALLOWED_NAMESPACES,S):rt,Qe=_(e,"ADD_URI_SAFE_ATTR")?z(F(et),e.ADD_URI_SAFE_ATTR,ht):et,Ze=_(e,"ADD_DATA_URI_TAGS")?z(F(Je),e.ADD_DATA_URI_TAGS,ht):Je,$e=_(e,"FORBID_CONTENTS")?z({},e.FORBID_CONTENTS,ht):Ke,Le=_(e,"FORBID_TAGS")?z({},e.FORBID_TAGS,ht):F({}),Me=_(e,"FORBID_ATTR")?z({},e.FORBID_ATTR,ht):F({}),Xe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,Re=!1!==e.ALLOW_DATA_ATTR,Pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ze=e.SAFE_FOR_TEMPLATES||!1,Ie=!1!==e.SAFE_FOR_XML,Fe=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,Ve=e.RETURN_TRUSTED_TYPE||!1,Ue=e.FORCE_BODY||!1,qe=!1!==e.SANITIZE_DOM,Ge=e.SANITIZE_NAMED_PROPS||!1,Ye=!1!==e.KEEP_CONTENT,je=e.IN_PLACE||!1,Ae=e.ALLOWED_URI_REGEXP||ne,ot=e.NAMESPACE||it,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,Ne=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&vt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&vt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ne.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ne.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ze&&(Re=!1),He&&(Be=!0),Xe&&(Te=z({},Y),Se=[],!0===Xe.html&&(z(Te,U),z(Se,j)),!0===Xe.svg&&(z(Te,B),z(Se,X),z(Se,K)),!0===Xe.svgFilters&&(z(Te,H),z(Se,X),z(Se,K)),!0===Xe.mathMl&&(z(Te,q),z(Se,$),z(Se,K))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?_e.tagCheck=e.ADD_TAGS:(Te===xe&&(Te=F(Te)),z(Te,e.ADD_TAGS,ht))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?_e.attributeCheck=e.ADD_ATTR:(Se===Ce&&(Se=F(Se)),z(Se,e.ADD_ATTR,ht))),e.ADD_URI_SAFE_ATTR&&z(Qe,e.ADD_URI_SAFE_ATTR,ht),e.FORBID_CONTENTS&&($e===Ke&&($e=F($e)),z($e,e.FORBID_CONTENTS,ht)),e.ADD_FORBID_CONTENTS&&($e===Ke&&($e=F($e)),z($e,e.ADD_FORBID_CONTENTS,ht)),Ye&&(Te["#text"]=!0),Fe&&z(Te,["html","head","body"]),Te.table&&(z(Te,["tbody"]),delete Le.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw R('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw R('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=e.TRUSTED_TYPES_POLICY,Q=J.createHTML("")}else void 0===J&&(J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(v,s)),null!==J&&"string"==typeof Q&&(Q=J.createHTML(""));f&&f(e),mt=e}},gt=z({},[...B,...H,...V]),yt=z({},[...q,...G]),wt=function(e){A(n.removed,{element:e});try{Z(e).removeChild(e)}catch(t){P(e)}},Et=function(e,t){try{A(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){A(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Be||He)try{wt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},kt=function(e){let t=null,n=null;if(Ue)e="<remove></remove>"+e;else{const t=C(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===pt&&ot===it&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=J?J.createHTML(e):e;if(ot===it)try{t=(new m).parseFromString(o,pt)}catch(e){}if(!t||!t.documentElement){t=ee.createDocument(ot,"template",null);try{t.documentElement.innerHTML=st?Q:o}catch(e){}}const s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),ot===it?oe.call(t,Fe?"html":"body")[0]:Fe?t.documentElement:s},At=function(e){return te.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Tt=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},xt=function(e){return"function"==typeof l&&e instanceof l};function St(e,t,i){w(e,e=>{e.call(n,t,i,mt)})}const Ct=function(e){let t=null;if(St(me.beforeSanitizeElements,e,null),Tt(e))return wt(e),!0;const i=ht(e.nodeName);if(St(me.uponSanitizeElement,e,{tagName:i,allowedTags:Te}),Ie&&e.hasChildNodes()&&!xt(e.firstElementChild)&&O(/<[/\w!]/g,e.innerHTML)&&O(/<[/\w!]/g,e.textContent))return wt(e),!0;if(e.nodeType===de)return wt(e),!0;if(Ie&&e.nodeType===pe&&O(/<[/\w]/g,e.data))return wt(e),!0;if(!(_e.tagCheck instanceof Function&&_e.tagCheck(i))&&(!Te[i]||Le[i])){if(!Le[i]&&Lt(i)){if(Ne.tagNameCheck instanceof RegExp&&O(Ne.tagNameCheck,i))return!1;if(Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(i))return!1}if(Ye&&!$e[i]){const t=Z(e)||e.parentNode,n=I(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const o=y(n[i],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,D(e))}}}return wt(e),!0}return e instanceof c&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=x(e.tagName),i=x(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===it?"svg"===n:t.namespaceURI===tt?"svg"===n&&("annotation-xml"===i||lt[i]):Boolean(gt[n]):e.namespaceURI===tt?t.namespaceURI===it?"math"===n:t.namespaceURI===nt?"math"===n&&ct[i]:Boolean(yt[n]):e.namespaceURI===it?!(t.namespaceURI===nt&&!ct[i])&&!(t.namespaceURI===tt&&!lt[i])&&!yt[n]&&(dt[n]||!gt[n]):!("application/xhtml+xml"!==pt||!at[e.namespaceURI]))}(e)?(wt(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!O(/<\/no(script|embed|frames)/i,e.innerHTML)?(ze&&e.nodeType===ce&&(t=e.textContent,w([fe,ve,be],e=>{t=N(t,e," ")}),e.textContent!==t&&(A(n.removed,{element:e.cloneNode()}),e.textContent=t)),St(me.afterSanitizeElements,e,null),!1):(wt(e),!0)},Nt=function(e,t,n){if(qe&&("id"===t||"name"===t)&&(n in i||n in ft))return!1;if(Re&&!Me[t]&&O(ge,t));else if(Oe&&O(ye,t));else if(_e.attributeCheck instanceof Function&&_e.attributeCheck(t,e));else if(!Se[t]||Me[t]){if(!(Lt(e)&&(Ne.tagNameCheck instanceof RegExp&&O(Ne.tagNameCheck,e)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(e))&&(Ne.attributeNameCheck instanceof RegExp&&O(Ne.attributeNameCheck,t)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(t,e))||"is"===t&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&O(Ne.tagNameCheck,n)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))))return!1}else if(Qe[t]);else if(O(Ae,N(n,Ee,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==L(n,"data:")||!Ze[e]){if(Pe&&!O(we,N(n,Ee,"")));else if(n)return!1}else;return!0},Lt=function(e){return"annotation-xml"!==e&&C(e,ke)},Mt=function(e){St(me.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Tt(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se,forceKeepAttr:void 0};let o=t.length;for(;o--;){const s=t[o],{name:a,namespaceURI:r,value:l}=s,c=ht(a),d=l;let p="value"===a?d:M(d);if(i.attrName=c,i.attrValue=p,i.keepAttr=!0,i.forceKeepAttr=void 0,St(me.uponSanitizeAttribute,e,i),p=i.attrValue,!Ge||"id"!==c&&"name"!==c||(Et(a,e),p="user-content-"+p),Ie&&O(/((--!?|])>)|<\/(style|title|textarea)/i,p)){Et(a,e);continue}if("attributename"===c&&C(p,"href")){Et(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Et(a,e);continue}if(!De&&O(/\/>/i,p)){Et(a,e);continue}ze&&w([fe,ve,be],e=>{p=N(p,e," ")});const u=ht(e.nodeName);if(Nt(u,c,p)){if(J&&"object"==typeof v&&"function"==typeof v.getAttributeType)if(r);else switch(v.getAttributeType(u,c)){case"TrustedHTML":p=J.createHTML(p);break;case"TrustedScriptURL":p=J.createScriptURL(p)}if(p!==d)try{r?e.setAttributeNS(r,a,p):e.setAttribute(a,p),Tt(e)?wt(e):k(n.removed)}catch(t){Et(a,e)}}else Et(a,e)}St(me.afterSanitizeAttributes,e,null)},_t=function e(t){let n=null;const i=At(t);for(St(me.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)St(me.uponSanitizeShadowNode,n,null),Ct(n),Mt(n),n.content instanceof a&&e(n.content);St(me.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,s=null,r=null,c=null;if(st=!e,st&&(e="\x3c!--\x3e"),"string"!=typeof e&&!xt(e)){if("function"!=typeof e.toString)throw R("toString is not a function");if("string"!=typeof(e=e.toString()))throw R("dirty is not a string, aborting")}if(!n.isSupported)return e;if(We||bt(t),n.removed=[],"string"==typeof e&&(je=!1),je){if(e.nodeName){const t=ht(e.nodeName);if(!Te[t]||Le[t])throw R("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)i=kt("\x3c!----\x3e"),s=i.ownerDocument.importNode(e,!0),s.nodeType===le&&"BODY"===s.nodeName||"HTML"===s.nodeName?i=s:i.appendChild(s);else{if(!Be&&!ze&&!Fe&&-1===e.indexOf("<"))return J&&Ve?J.createHTML(e):e;if(i=kt(e),!i)return Be?null:Ve?Q:""}i&&Ue&&wt(i.firstChild);const d=At(je?e:i);for(;r=d.nextNode();)Ct(r),Mt(r),r.content instanceof a&&_t(r.content);if(je)return e;if(Be){if(He)for(c=ie.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(Se.shadowroot||Se.shadowrootmode)&&(c=ae.call(o,c,!0)),c}let p=Fe?i.outerHTML:i.innerHTML;return Fe&&Te["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&O(se,i.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+p),ze&&w([fe,ve,be],e=>{p=N(p,e," ")}),J&&Ve?J.createHTML(p):p},n.setConfig=function(){bt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),We=!0},n.clearConfig=function(){mt=null,We=!1},n.isValidAttribute=function(e,t,n){mt||bt({});const i=ht(e),o=ht(t);return Nt(i,o,n)},n.addHook=function(e,t){"function"==typeof t&&A(me[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=E(me[e],t);return-1===n?void 0:T(me[e],n,1)[0]}return k(me[e])},n.removeHooks=function(e){me[e]=[]},n.removeAllHooks=function(){me={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Yt=new CSSStyleSheet;Yt.replaceSync("\n :host { display: block; position: relative; width: 100%; max-width: 100%; height:100%; }\n * { box-sizing: border-box; }\n .video-container {\n position: relative; width: 100%; aspect-ratio:var(--aspect-ratio,16:9); background: #000;\n overflow: hidden;\n height:100%;\n }\n .shadow-plyr-wrapper {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n display: flex; align-items: center; justify-content: center; outline: none;\n }\n video {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n object-fit: contain !important; display: block; pointer-events: auto !important;\n opacity: 0; transition: opacity .3s ease; will-change: opacity;\n }\n .video-loaded.is-playing video,\n .video-loaded:not(.poster-visible) video { opacity: 1 !important; }\n video::-webkit-media-controls { display: none !important; }\n picture {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block;\n z-index: 5; opacity: 0; transition: opacity .3s ease; pointer-events: none;\n cursor: pointer;\n }\n picture img { width: 100%; height: 100%; object-fit: contain !important; display: block; }\n .poster-visible picture { opacity: 1 !important; pointer-events: auto !important; }\n .video-loading::after {\n content: ''; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px;\n margin: -20px 0 0 -20px; border: 3px solid rgba(255,255,255,.3);\n border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;\n z-index: 10;\n }\n @keyframes spin { to { transform: rotate(360deg); } }\n /* ----- CSS CUSTOM PROPERTIES (allows external styling) ----- */\n .video-center-play {\n position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);\n width: var(--center-play-size, 80px); height: var(--center-play-size, 80px);\n border-radius: 50%; display: flex; align-items: center; justify-content: center;\n cursor: pointer; transition: all .3s ease; z-index: 20; opacity: 0;\n pointer-events: none; box-shadow: 0 4px 20px rgba(0,0,0,.3);\n background: var(--center-play-bg, rgba(0,0,0,.7)); will-change: transform,opacity;\n }\n .video-center-play svg {\n width: calc(var(--center-play-size, 80px) * 0.5);\n height: calc(var(--center-play-size, 80px) * 0.5);\n fill: var(--accent-color, #fff);\n color:var(--accent-color, #fff);\n }\n .video-loaded .video-center-play { opacity: .8; pointer-events: auto; }\n .video-loaded.is-playing .video-center-play { opacity: 0; pointer-events: none; }\n .video-loaded.is-playing:hover .video-center-play { opacity: .8; pointer-events: auto; }\n .video-center-play:hover { transform: translate(-50%,-50%) scale(1.1); }\n .video-controls-bar {\n position: absolute; bottom: 0; left: 0; right: 0;\n padding: 40px 15px 15px; display: flex; flex-direction: column; gap: 10px;\n transition: opacity .3s ease, transform .3s ease; z-index: 25; opacity: 0;\n transform: translateY(100%); pointer-events: none; will-change: transform,opacity;\n background: var(--controls-bg, linear-gradient(to top, rgba(0,0,0,.8), transparent));\n }\n .video-loaded:not(.is-playing) .video-controls-bar,\n .video-loaded:hover .video-controls-bar,\n .video-loaded.show-controls .video-controls-bar,\n .video-loaded.is-playing:hover .video-controls-bar {\n opacity: 1; transform: translateY(0); pointer-events: auto;\n }\n .video-loaded.is-playing .video-controls-bar { opacity: 0; transform: translateY(100%); pointer-events: none; }\n .video-seekbar {\n width: 100%; height: var(--seekbar-height, 5px); background: rgba(255,255,255,.3);\n border-radius: 3px; cursor: pointer; position: relative; margin-bottom: 5px;\n }\n .video-seekbar-progress {\n height: 100%; border-radius: 3px; width: 0%; position: relative;\n transition: width .1s linear; background: var(--accent-color, #fff); will-change: width;\n }\n .video-seekbar-handle {\n position: absolute; right: -6px; top: 50%; transform: translateY(-50%);\n width: 12px; height: 12px; border-radius: 50%; background: var(--accent-color, #fff);\n opacity: 0; transition: opacity .2s;\n }\n .video-seekbar:hover .video-seekbar-handle { opacity: 1; }\n .video-controls-row { display: flex; align-items: center; gap: 15px; }\n .video-control-btn {\n background: none; border: none; cursor: pointer; padding: 5px;\n display: flex; align-items: center; justify-content: center; transition: transform .2s;\n }\n .video-control-btn:hover { transform: scale(1.1); background: rgba(255,255,255,.1); }\n .video-control-btn svg { width: 24px; height: 24px; fill: var(--accent-color, #fff); color:var(--accent-color,#fff); }\n .video-control-btn.play-pause svg { width: 28px; height: 28px; }\n .video-volume-control { display: flex; align-items: center; gap: 8px; }\n .video-volume-slider {\n width: 0; height: 3px; background: rgba(255,255,255,.3); border-radius: 3px;\n cursor: pointer; position: relative; overflow: hidden; transition: width .3s ease;\n }\n .video-volume-control:hover .video-volume-slider { width: 60px; }\n .video-volume-progress {\n height: 100%; width: 100%; transition: width .1s;\n background: var(--accent-color, #fff); will-change: width;\n }\n .video-controls-spacer { flex: 1; }\n .video-time-display {\n font-size: 13px; font-family: monospace; user-select: none;\n color: var(--accent-color, #fff);\n }\n .video-speed-control { position: relative; }\n .video-speed-btn { min-width: 45px; font-size: 13px; font-weight: 600; color:var(--accent-color,#fff) }\n .video-speed-menu {\n position: absolute; bottom: 100%; right: 0; border-radius: 4px; padding: 5px 0;\n margin-bottom: 10px; min-width: 80px; opacity: 0; visibility: hidden;\n transform: translateY(10px); transition: all .2s ease; z-index: 100;\n background: var(--controls-bg, rgba(0,0,0,.8));\n }\n .video-speed-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }\n .video-speed-option {\n display: block; width: 100%; padding: 8px 15px; background: none; border: none;\n font-size: 13px; text-align: left; cursor: pointer; transition: background .2s;\n color: var(--accent-color, #fff);\n }\n .video-speed-option:hover { background: rgba(255,255,255,.1); }\n .video-speed-option.active { background: rgba(255,255,255,.2); font-weight: 600; }\n .video-control-btn:focus-visible,\n .video-seekbar:focus-visible,\n .video-volume-slider:focus-visible { outline: 2px solid var(--accent-color, #fff); outline-offset: 2px; }\n .sr-only {\n position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;\n overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;\n }\n /* ----- Tooltip styles ----- */\n .tooltip {\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: 8px;\n padding: 4px 8px;\n background: var(--tooltip-bg,rgba(0,0,0,0.8));\n color: var(--tooltip-color,#fff);\n font-size: var(--tooltip-font-size,12px);\n white-space: nowrap;\n border-radius: 4px;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.2s;\n z-index: 30;\n }\n .video-control-btn:hover .tooltip,\n .video-center-play:hover .tooltip {\n opacity: 1;\n }\n @media (max-width: 768px) {\n .video-center-play { width: 60px; height: 60px; }\n .video-center-play svg { width: 30px; height: 30px; }\n .video-controls-bar { padding: 30px 10px 10px; }\n .video-control-btn svg { width: 20px; height: 20px; }\n .video-volume-slider { display: none; }\n .video-time-display { font-size: 11px; }\n }\n\n .tap-ripple {\n position: absolute;\n width: 20px;\n height: 20px;\n background: rgba(255,255,255,0.4);\n border-radius: 50%;\n transform: translate(-50%, -50%);\n animation: ripple-expand 0.6s ease-out forwards;\n pointer-events: none;\n z-index: 50;\n}\n\n@keyframes ripple-expand {\n from {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n to {\n opacity: 0;\n transform: translate(-50%, -50%) scale(8);\n }\n}\n\n.video-seek-buttons {\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n pointer-events: none;\n}\n\n.video-seek-buttons button {\n pointer-events: auto;\n width: 30%;\n height: 60%;\n background: transparent;\n border: none;\n color: #fff;\n font-size: 20px;\n font-weight: bold;\n opacity: 0.6;\n}\n.seek-overlay {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%,-50%);\n font-size: 32px;\n color: white;\n font-weight: bold;\n pointer-events: none;\n animation: fadeOut 0.6s forwards;\n}\n\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n");const jt=(()=>{const e=new Set;let t=null;return{register(t){e.add(t)},unregister(n){e.delete(n),t===n&&(t=null)},requestPlay(e){t&&t!==e&&t.pauseVideo(!0),t=e}}})();class Xt extends HTMLElement{constructor(){super(),me.add(this),fe.set(this,void 0),ve.set(this,null),be.set(this,0),ge.set(this,1e4),ye.set(this,null),we.set(this,!1),Ee.set(this,null),ke.set(this,!1),Ae.set(this,!1),Te.set(this,!1),xe.set(this,1),Se.set(this,!1),Ce.set(this,!1),Ne.set(this,!1),Le.set(this,!1),Me.set(this,!1),_e.set(this,!0),Oe.set(this,null),Re.set(this,null),Pe.set(this,null),De.set(this,null),ze.set(this,null),Ie.set(this,null),Fe.set(this,null),We.set(this,null),Ue.set(this,0),Be.set(this,null),He.set(this,t=>{if(!e(this,Ee,"f"))return;const n=t.key.toLowerCase();e(this,me,"m",mt).call(this);let i=!1;const o={" ":()=>e(this,Ve,"f").call(this),k:()=>e(this,Ve,"f").call(this),arrowleft:()=>e(this,me,"m",Ft).call(this),arrowright:()=>e(this,me,"m",Wt).call(this),arrowup:()=>e(this,me,"m",Ut).call(this,.1),arrowdown:()=>e(this,me,"m",Ut).call(this,-.1),m:()=>e(this,qe,"f").call(this),f:()=>e(this,Ge,"f").call(this),home:()=>{e(this,Ee,"f")&&(e(this,Ee,"f").currentTime=0)},end:()=>{e(this,Ee,"f")&&(e(this,Ee,"f").currentTime=e(this,Ee,"f").duration)}};o[n]?(t.preventDefault(),o[n](),i=!0):n>="0"&&n<="9"&&e(this,Ee,"f").duration&&(t.preventDefault(),e(this,Ee,"f").currentTime=e(this,Ee,"f").duration*(parseInt(n)/10),i=!0),i&&e(this,Re,"f")&&e(this,Re,"f").classList.add("show-controls")}),Ve.set(this,t=>{t&&t.stopPropagation(),e(this,Ee,"f")&&(e(this,ke,"f")?this.pauseVideo():this.playVideo())}),qe.set(this,t=>{t&&t.stopPropagation(),e(this,Ee,"f")&&(e(this,Ee,"f").muted=!e(this,Ee,"f").muted)}),Ge.set(this,t=>{t&&t.stopPropagation();const n=e(this,fe,"f").querySelector(".video-container");document.fullscreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():(null==n?void 0:n.requestFullscreen)?n.requestFullscreen():n&&"webkitRequestFullscreen"in n&&n.webkitRequestFullscreen()}),Ye.set(this,t=>{var n;(null===(n=e(this,Ee,"f"))||void 0===n?void 0:n.duration)&&(e(this,Ee,"f").currentTime=e(this,Ee,"f").duration*t)}),je.set(this,t=>{if(e(this,Ee,"f")){const n=Math.max(0,Math.min(1,t));e(this,Ee,"f").volume=n,e(this,Ee,"f").muted=0===n}}),Xe.set(this,(n,i)=>{e(this,Ee,"f")&&(e(this,Ee,"f").playbackRate=n,t(this,xe,n,"f"),null==i||i.querySelectorAll(".video-speed-option").forEach(e=>{e.classList.toggle("active",parseFloat(e.getAttribute("data-speed"))===n)}),e(this,We,"f")&&(e(this,We,"f").textContent=n+"x"))}),$e.set(this,()=>{e(this,Se,"f")&&e(this,Ee,"f")&&(document.hidden?e(this,ke,"f")&&(t(this,Me,!0,"f"),this.pauseVideo()):e(this,Me,"f")&&!e(this,ke,"f")&&(this.playVideo(),t(this,Me,!1,"f")))}),Ke.set(this,()=>{e(this,ke,"f")&&(t(this,Me,!0,"f"),this.pauseVideo())}),Ze.set(this,()=>{e(this,Me,"f")&&!e(this,ke,"f")&&(this.playVideo(),t(this,Me,!1,"f"))}),Je.set(this,()=>{e(this,me,"m",mt).call(this).posterClickPlay&&e(this,Ee,"f")&&!e(this,Le,"f")&&this.playVideo()}),Qe.set(this,n=>{n.preventDefault(),t(this,Ae,!0,"f");const i=n.currentTarget,o=i.getBoundingClientRect();e(this,Ye,"f").call(this,(n.clientX-o.left)/o.width);const s=t=>{if(!e(this,Ae,"f"))return;t.preventDefault();const n=i.getBoundingClientRect();e(this,Ye,"f").call(this,(t.clientX-n.left)/n.width)},a=()=>{t(this,Ae,!1,"f"),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",a)}),et.set(this,n=>{if(!e(this,Ee,"f"))return;t(this,Ae,!0,"f");const i=n.currentTarget,o=t=>{const n=i.getBoundingClientRect(),o=(t.clientX-n.left)/n.width;e(this,Ye,"f").call(this,o)};o(n.touches[0]);const s=t=>{e(this,Ae,"f")&&o(t.touches[0])},a=()=>{t(this,Ae,!1,"f"),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a)};document.addEventListener("touchmove",s,{passive:!0}),document.addEventListener("touchend",a)}),tt.set(this,n=>{n.preventDefault(),t(this,Te,!0,"f");const i=n.currentTarget,o=i.getBoundingClientRect();e(this,je,"f").call(this,(n.clientX-o.left)/o.width);const s=t=>{if(!e(this,Te,"f"))return;t.preventDefault();const n=i.getBoundingClientRect();e(this,je,"f").call(this,(t.clientX-n.left)/n.width)},a=()=>{t(this,Te,!1,"f"),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",a)}),nt.set(this,(n,i)=>{e(this,Ee,"f")&&(n.classList.remove("video-loading"),n.classList.add("video-loaded"),t(this,we,!0,"f"),t(this,Se,!0,"f"),i.showControls&&e(this,me,"m",Ct).call(this,n),i.autoplay||(t(this,Le,!1,"f"),t(this,Ne,!0,"f"),n.classList.add("poster-visible")),e(this,me,"m",Pt).call(this,!1,n),e(this,me,"m",qt).call(this,"video-ready",{duration:e(this,Ee,"f").duration}))}),it.set(this,n=>{e(this,me,"m",qt).call(this,"video-playing",{src:e(this,Ee,"f").currentSrc,currentTime:e(this,Ee,"f").currentTime,duration:e(this,Ee,"f").duration}),n.classList.add("is-playing"),n.classList.remove("poster-visible"),t(this,ke,!0,"f"),t(this,Le,!0,"f"),t(this,Ne,!1,"f"),e(this,me,"m",Ot).call(this,!0,n)}),ot.set(this,n=>{e(this,me,"m",qt).call(this,"video-paused",{currentTime:e(this,Ee,"f").currentTime}),n.classList.remove("is-playing"),t(this,ke,!1,"f"),e(this,me,"m",Ot).call(this,!1,n)}),st.set(this,(n,i)=>{e(this,me,"m",qt).call(this,"video-ended",{duration:e(this,Ee,"f").duration}),n.classList.remove("is-playing"),t(this,ke,!1,"f"),e(this,me,"m",Ot).call(this,!1,n),i.loop||(i.resetOnEnded&&(e(this,Ee,"f").currentTime=0),i.showPosterOnEnded&&e(this,Ce,"f")&&(n.classList.add("poster-visible"),t(this,Ne,!0,"f")))}),at.set(this,t=>{const n=e(this,Ee,"f");e(this,me,"m",Rt).call(this,n.muted||0===n.volume,t),e(this,me,"m",Dt).call(this,n.volume,t),e(this,me,"m",qt).call(this,"video-volume-change",{volume:n.volume,muted:n.muted})}),rt.set(this,n=>{var i,o;console.error("Video load error"),n.classList.remove("video-loading","video-loaded"),t(this,Se,!1,"f"),e(this,me,"m",qt).call(this,"video-error",{code:null===(o=null===(i=e(this,Ee,"f"))||void 0===i?void 0:i.error)||void 0===o?void 0:o.code})}),lt.set(this,()=>{const t=document.fullscreenElement===e(this,fe,"f").querySelector(".video-container");e(this,me,"m",Pt).call(this,t),e(this,me,"m",qt).call(this,t?"video-fullscreen-enter":"video-fullscreen-exit")}),ct.set(this,n=>{var i;const o=e(this,me,"m",mt).call(this);if(!e(this,Ee,"f"))return;const s=e(this,Re,"f").getBoundingClientRect(),a=n.changedTouches[0].clientX<s.left+s.width/2;o.enableTapRipple&&e(this,me,"m",ut).call(this,n.changedTouches[0].clientX,n.changedTouches[0].clientY),t(this,Ue,(i=e(this,Ue,"f"),++i),"f"),e(this,Be,"f")&&clearTimeout(e(this,Be,"f")),t(this,Be,window.setTimeout(()=>{const n=o.doubleTapSeekSeconds,i=o.tripleTapSeconds;2===e(this,Ue,"f")&&o.doubleTapSeek&&e(this,me,"m",pt).call(this,a?-n:n),e(this,Ue,"f")>=3&&o.tripleTapSeek&&e(this,me,"m",pt).call(this,a?-i:i),t(this,Ue,0,"f")},300),"f")}),ht.set(this,void 0),t(this,fe,this.attachShadow({mode:"open"}),"f"),e(this,fe,"f").adoptedStyleSheets=[Yt],t(this,ht,function(e,t){let n;return function(...i){n||(e.apply(this,i),n=!0,setTimeout(()=>n=!1,t))}}(e(this,me,"m",Lt).bind(this),100),"f")}static get observedAttributes(){return["lazy","pause-on-out-of-view","autoplay","loop","muted","playsinline","desktop-poster","mobile-poster","desktop-video","mobile-video","show-controls","controls-type","show-center-play","show-play-pause","show-seekbar","show-volume","show-fullscreen","show-speed","theme","accent-color","controls-background","center-play-background","center-play-size","play-icon","pause-icon","volume-icon","muted-icon","fullscreen-icon","exit-fullscreen-icon","speed-icon","video-type","preload","speed-options","controls-hide-delay","seek-step","lazy-threshold","pause-threshold","pause-on-tab-hide","show-poster-on-ended","reset-on-ended","poster-click-play","performance-mode","show-tooltips","tooltip-play","tooltip-pause","tooltip-mute","tooltip-unmute","tooltip-fullscreen","tooltip-exit-fullscreen","tooltip-speed","tooltip-center-play","double-tap-seek","double-tap-seek-seconds","show-seek-buttons","seek-button-seconds","triple-tap-seek","triple-tap-seconds","enable-tap-ripple"]}connectedCallback(){e(this,me,"m",vt).call(this),e(this,me,"m",kt).call(this),e(this,me,"m",At).call(this),"true"===this.getAttribute("virtual-playback")&&jt.register(this)}disconnectedCallback(){e(this,me,"m",Vt).call(this),e(this,me,"m",Tt).call(this),e(this,Oe,"f")&&cancelAnimationFrame(e(this,Oe,"f")),jt.unregister(this)}attributeChangedCallback(n,i,o){if(i===o)return;if(t(this,ve,null,"f"),!e(this,we,"f"))return;const s=e(this,me,"m",mt).call(this);switch(n){case"muted":e(this,Ee,"f")&&(e(this,Ee,"f").muted=s.muted);break;case"loop":e(this,Ee,"f")&&(e(this,Ee,"f").loop=s.loop);break;case"accent-color":case"theme":case"controls-background":case"center-play-background":case"center-play-size":e(this,me,"m",Et).call(this,s);break;default:e(this,me,"m",Ht).call(this)}}play(){this.playVideo()}pause(){this.pauseVideo()}mute(){e(this,Ee,"f")&&(e(this,Ee,"f").muted=!0)}unmute(){e(this,Ee,"f")&&(e(this,Ee,"f").muted=!1)}seek(t){e(this,Ee,"f")&&(e(this,Ee,"f").currentTime=t)}playVideo(){if(!e(this,Ee,"f"))return;e(this,me,"m",mt).call(this).autoplay&&(e(this,Ee,"f").muted=!0),"true"===this.getAttribute("virtual-playback")&&jt.requestPlay(this);const n=e(this,Ee,"f").play();n&&n.catch(()=>{t(this,Ne,!0,"f"),e(this,Re,"f")&&e(this,Re,"f").classList.add("poster-visible")})}pauseVideo(t){e(this,Ee,"f")&&(e(this,Ee,"f").pause(),t||e(this,me,"m",qt).call(this,"video-paused"))}}fe=new WeakMap,ve=new WeakMap,be=new WeakMap,ge=new WeakMap,ye=new WeakMap,we=new WeakMap,Ee=new WeakMap,ke=new WeakMap,Ae=new WeakMap,Te=new WeakMap,xe=new WeakMap,Se=new WeakMap,Ce=new WeakMap,Ne=new WeakMap,Le=new WeakMap,Me=new WeakMap,_e=new WeakMap,Oe=new WeakMap,Re=new WeakMap,Pe=new WeakMap,De=new WeakMap,ze=new WeakMap,Ie=new WeakMap,Fe=new WeakMap,We=new WeakMap,Ue=new WeakMap,Be=new WeakMap,He=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,je=new WeakMap,Xe=new WeakMap,$e=new WeakMap,Ke=new WeakMap,Ze=new WeakMap,Je=new WeakMap,Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,it=new WeakMap,ot=new WeakMap,st=new WeakMap,at=new WeakMap,rt=new WeakMap,lt=new WeakMap,ct=new WeakMap,ht=new WeakMap,me=new WeakSet,dt=function(t){var n;const i=document.createElement("div");i.className="seek-overlay",i.textContent=(t>0?"+":"")+t+"s",null===(n=e(this,Re,"f"))||void 0===n||n.appendChild(i),setTimeout(()=>i.remove(),600)},pt=function(t){if(!e(this,Ee,"f"))return;const n=Math.min(Math.max(0,e(this,Ee,"f").currentTime+t),e(this,Ee,"f").duration);e(this,Ee,"f").currentTime=n,e(this,me,"m",dt).call(this,t)},ut=function(t,n){if(!e(this,Re,"f"))return;const i=e(this,Re,"f").getBoundingClientRect(),o=document.createElement("div");o.className="tap-ripple",o.style.left=t-i.left+"px",o.style.top=n-i.top+"px",e(this,Re,"f").appendChild(o),setTimeout(()=>o.remove(),600)},mt=function(){const n=Date.now();if(e(this,ve,"f")&&n-e(this,be,"f")<e(this,ge,"f"))return e(this,ve,"f");const i={lazy:"true"===this.getAttribute("lazy"),pauseOnOutOfView:"true"===this.getAttribute("pause-on-out-of-view"),pauseOnTabHide:"false"!==this.getAttribute("pause-on-tab-hide"),autoplay:"true"===this.getAttribute("autoplay"),loop:"true"===this.getAttribute("loop"),muted:"true"===this.getAttribute("muted"),playsinline:"true"===this.getAttribute("playsinline"),preload:this.getAttribute("preload")||"metadata",desktopPoster:this.getAttribute("desktop-poster")||"",mobilePoster:this.getAttribute("mobile-poster")||"",desktopVideo:this.getAttribute("desktop-video")||"",mobileVideo:this.getAttribute("mobile-video")||"",videoType:this.getAttribute("video-type")||"video/mp4",showControls:"true"===this.getAttribute("show-controls"),controlsType:this.getAttribute("controls-type")||"full",showPlayPause:"false"!==this.getAttribute("show-play-pause"),showSeekbar:"true"===this.getAttribute("show-seekbar"),showVolume:"true"===this.getAttribute("show-volume"),showFullscreen:"true"===this.getAttribute("show-fullscreen"),showCenterPlay:"true"===this.getAttribute("show-center-play"),showSpeed:"true"===this.getAttribute("show-speed"),speedOptions:e(this,me,"m",ft).call(this),controlsHideDelay:parseInt(this.getAttribute("controls-hide-delay")||"3000"),seekStep:parseInt(this.getAttribute("seek-step")||"5"),lazyThreshold:parseFloat(this.getAttribute("lazy-threshold")||"0.5"),pauseThreshold:parseFloat(this.getAttribute("pause-threshold")||"0.3"),theme:this.getAttribute("theme")||"dark",accentColor:this.getAttribute("accent-color")||"#ffffff",controlsBackground:this.getAttribute("controls-background")||"rgba(0, 0, 0, 0.8)",centerPlayBackground:this.getAttribute("center-play-background")||"rgba(0, 0, 0, 0.7)",centerPlaySize:parseInt(this.getAttribute("center-play-size")||"80"),showPosterOnEnded:"true"===this.getAttribute("show-poster-on-ended"),resetOnEnded:"true"===this.getAttribute("reset-on-ended"),posterClickPlay:"false"!==this.getAttribute("poster-click-play"),performanceMode:"true"===this.getAttribute("performance-mode"),showTooltips:"true"===this.getAttribute("show-tooltips"),tooltipPlay:this.getAttribute("tooltip-play")||"Play",tooltipPause:this.getAttribute("tooltip-pause")||"Pause",tooltipMute:this.getAttribute("tooltip-mute")||"Mute",tooltipUnmute:this.getAttribute("tooltip-unmute")||"Unmute",tooltipFullscreen:this.getAttribute("tooltip-fullscreen")||"Fullscreen",tooltipExitFullscreen:this.getAttribute("tooltip-exit-fullscreen")||"Exit fullscreen",tooltipSpeed:this.getAttribute("tooltip-speed")||"Playback speed",tooltipCenterPlay:this.getAttribute("tooltip-center-play")||"Play",doubleTapSeek:"false"!==this.getAttribute("double-tap-seek"),doubleTapSeekSeconds:parseInt(this.getAttribute("double-tap-seek-seconds")||"10"),showSeekButtons:"true"===this.getAttribute("show-seek-buttons"),seekButtonSeconds:parseInt(this.getAttribute("seek-button-seconds")||"10"),tripleTapSeek:"false"!==this.getAttribute("triple-tap-seek"),tripleTapSeconds:parseInt(this.getAttribute("triple-tap-seconds")||"30"),enableTapRipple:"false"!==this.getAttribute("enable-tap-ripple")};return t(this,ve,i,"f"),t(this,be,n,"f"),i},ft=function(){const e=this.getAttribute("speed-options");if(!e)return[.5,.75,1,1.25,1.5,2];try{return e.split(",").map(e=>parseFloat(e.trim())).filter(e=>!isNaN(e))}catch{return[.5,.75,1,1.25,1.5,2]}},vt=function(){const n=e(this,me,"m",mt).call(this);t(this,Ce,!(!n.desktopPoster&&!n.mobilePoster),"f"),t(this,Ne,e(this,Ce,"f")&&!e(this,Le,"f"),"f");const i=document.createElement("div");if(i.className="shadow-plyr-wrapper",i.setAttribute("tabindex","0"),i.setAttribute("role","application"),i.setAttribute("aria-label","Video player"),i.setAttribute("part","shadow-plyr-wrapper"),n.desktopPoster||n.mobilePoster){const e=document.createElement("picture");if(n.mobilePoster){const t=document.createElement("source");t.media="(max-width: 768px)",t.srcset=n.mobilePoster,e.appendChild(t)}const t=document.createElement("img");t.src=n.desktopPoster,t.alt="Video thumbnail",t.loading="lazy",e.appendChild(t),i.appendChild(e)}const o=document.createElement("div");if(o.className="video-placeholder",i.appendChild(o),n.showCenterPlay){const t=e(this,me,"m",yt).call(this),o=document.createElement("div");o.className="video-center-play",o.setAttribute("role","button"),o.tabIndex=0,o.setAttribute("aria-label","Play video");const s=document.createElement("span");s.className="play-icon",s.setAttribute("aria-hidden","true"),s.appendChild(e(this,me,"m",bt).call(this,t.play));const a=document.createElement("span");if(a.className="pause-icon",a.style.display="none",a.setAttribute("aria-hidden","true"),a.appendChild(e(this,me,"m",bt).call(this,t.pause)),o.appendChild(s),o.appendChild(a),n.showTooltips){const e=document.createElement("span");e.className="tooltip center-play-tooltip",e.textContent=n.tooltipCenterPlay,o.appendChild(e)}const r=document.createElement("span");r.className="sr-only",r.textContent="Play",o.appendChild(r),i.appendChild(o)}n.showControls&&"none"!==n.controlsType&&i.appendChild(e(this,me,"m",wt).call(this,n)),n.showSeekButtons&&i.appendChild(e(this,me,"m",gt).call(this,n));const s=document.createElement("div");s.className="video-container",s.setAttribute("part","video-container"),s.appendChild(i),e(this,fe,"f").innerHTML="",e(this,fe,"f").appendChild(s),t(this,Re,i,"f"),t(this,Pe,i.querySelector(".video-seekbar"),"f"),t(this,De,i.querySelector(".video-seekbar-progress"),"f"),t(this,ze,i.querySelector(".video-time-display"),"f"),t(this,Ie,i.querySelector(".video-volume-progress"),"f"),t(this,Fe,i.querySelector(".video-speed-menu"),"f"),t(this,We,i.querySelector(".speed-text"),"f")},bt=function(e){const t=document.createElement("div");t.innerHTML=e.trim();const n=t.firstElementChild;if(!n||"svg"!==n.tagName.toLowerCase()){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("viewBox","0 0 24 24"),e}return n},gt=function(t){const n=document.createElement("div");n.className="video-seek-buttons";const i=document.createElement("button");i.className="seek-left",i.textContent=`-${t.seekButtonSeconds}s`;const o=document.createElement("button");return o.className="seek-right",o.textContent=`+${t.seekButtonSeconds}s`,i.addEventListener("click",()=>{e(this,Ee,"f")&&(e(this,Ee,"f").currentTime=Math.max(0,e(this,Ee,"f").currentTime-t.seekButtonSeconds))}),o.addEventListener("click",()=>{e(this,Ee,"f")&&(e(this,Ee,"f").currentTime=Math.min(e(this,Ee,"f").duration,e(this,Ee,"f").currentTime+t.seekButtonSeconds))}),n.appendChild(i),n.appendChild(o),n},yt=function(){const e=`${this.getAttribute("play-icon")||""}-${this.getAttribute("pause-icon")||""}`;if(c.has(e))return c.get(e);const t={play:Gt.sanitize(this.getAttribute("play-icon")||n,{USE_PROFILES:{svg:!0}}),pause:Gt.sanitize(this.getAttribute("pause-icon")||i,{USE_PROFILES:{svg:!0}}),volume:Gt.sanitize(this.getAttribute("volume-icon")||o,{USE_PROFILES:{svg:!0}}),muted:Gt.sanitize(this.getAttribute("muted-icon")||s,{USE_PROFILES:{svg:!0}}),fullscreen:Gt.sanitize(this.getAttribute("fullscreen-icon")||a,{USE_PROFILES:{svg:!0}}),exitFullscreen:Gt.sanitize(this.getAttribute("exit-fullscreen-icon")||r,{USE_PROFILES:{svg:!0}}),speed:Gt.sanitize(this.getAttribute("speed-icon")||l,{USE_PROFILES:{svg:!0}})};return c.set(e,t),t},wt=function(t){const n=e(this,me,"m",yt).call(this),i=document.createDocumentFragment(),o=document.createElement("div");if(o.className="video-controls-bar",o.setAttribute("role","region"),o.setAttribute("aria-label","Video controls"),o.setAttribute("part","controls"),t.showSeekbar){const e=document.createElement("div");e.className="video-seekbar",e.setAttribute("role","slider"),e.tabIndex=0,e.setAttribute("aria-label","Seek"),e.setAttribute("aria-valuemin","0"),e.setAttribute("aria-valuemax","100"),e.setAttribute("aria-valuenow","0");const t=document.createElement("div");t.className="video-seekbar-progress";const n=document.createElement("div");n.className="video-seekbar-handle",t.appendChild(n),e.appendChild(t),o.appendChild(e)}const s=document.createElement("div");if(s.className="video-controls-row",t.showPlayPause){const i=document.createElement("button");i.className="video-control-btn play-pause",i.setAttribute("aria-label","Play"),i.tabIndex=0;const o=document.createElement("span");o.className="play-icon",o.setAttribute("aria-hidden","true"),o.appendChild(e(this,me,"m",bt).call(this,n.play));const a=document.createElement("span");if(a.className="pause-icon",a.style.display="none",a.setAttribute("aria-hidden","true"),a.appendChild(e(this,me,"m",bt).call(this,n.pause)),i.appendChild(o),i.appendChild(a),t.showTooltips){const e=document.createElement("span");e.className="tooltip play-tooltip",e.textContent=t.tooltipPlay;const n=document.createElement("span");n.className="tooltip pause-tooltip",n.style.display="none",n.textContent=t.tooltipPause,i.appendChild(e),i.appendChild(n)}s.appendChild(i)}if(t.showVolume){const i=document.createElement("div");i.className="video-volume-control";const o=document.createElement("button");o.className="video-control-btn volume-btn",o.setAttribute("aria-label","Mute"),o.tabIndex=0;const a=document.createElement("span");a.className="volume-icon",a.setAttribute("aria-hidden","true"),a.appendChild(e(this,me,"m",bt).call(this,n.volume));const r=document.createElement("span");if(r.className="muted-icon",r.style.display="none",r.setAttribute("aria-hidden","true"),r.appendChild(e(this,me,"m",bt).call(this,n.muted)),o.appendChild(a),o.appendChild(r),t.showTooltips){const e=document.createElement("span");e.className="tooltip volume-tooltip",e.textContent=t.tooltipMute;const n=document.createElement("span");n.className="tooltip muted-tooltip",n.style.display="none",n.textContent=t.tooltipUnmute,o.appendChild(e),o.appendChild(n)}i.appendChild(o);const l=document.createElement("div");l.className="video-volume-slider",l.setAttribute("role","slider"),l.tabIndex=0,l.setAttribute("aria-label","Volume"),l.setAttribute("aria-valuemin","0"),l.setAttribute("aria-valuemax","100"),l.setAttribute("aria-valuenow","100");const c=document.createElement("div");c.className="video-volume-progress",l.appendChild(c),i.appendChild(l),s.appendChild(i)}const a=document.createElement("div");a.className="video-time-display",a.textContent="0:00 / 0:00",s.appendChild(a);const r=document.createElement("div");if(r.className="video-controls-spacer",s.appendChild(r),t.showSpeed){const i=document.createElement("div");i.className="video-speed-control";const o=document.createElement("button");o.className="video-control-btn video-speed-btn",o.setAttribute("aria-label","Playback speed"),o.setAttribute("aria-haspopup","true"),o.setAttribute("aria-expanded","false"),o.tabIndex=0;const a=document.createElement("span");a.className="speed-text",a.textContent="1x";const r=document.createElement("span");if(r.setAttribute("aria-hidden","true"),r.appendChild(e(this,me,"m",bt).call(this,n.speed)),o.appendChild(r),o.appendChild(a),t.showTooltips){const e=document.createElement("span");e.className="tooltip speed-tooltip",e.textContent=t.tooltipSpeed,o.appendChild(e)}i.appendChild(o);const l=document.createElement("div");l.className="video-speed-menu",l.setAttribute("role","menu"),t.speedOptions.forEach(e=>{const t=document.createElement("button");t.className="video-speed-option "+(1===e?"active":""),t.setAttribute("role","menuitem"),t.tabIndex=-1,t.setAttribute("data-speed",e.toString()),t.textContent=e+"x",l.appendChild(t)}),i.appendChild(l),s.appendChild(i)}if(t.showFullscreen){const i=document.createElement("button");i.className="video-control-btn fullscreen-btn",i.setAttribute("aria-label","Fullscreen"),i.tabIndex=0;const o=document.createElement("span");o.className="fullscreen-icon",o.setAttribute("aria-hidden","true"),o.appendChild(e(this,me,"m",bt).call(this,n.fullscreen));const a=document.createElement("span");if(a.className="exit-fullscreen-icon",a.style.display="none",a.setAttribute("aria-hidden","true"),a.appendChild(e(this,me,"m",bt).call(this,n.exitFullscreen)),i.appendChild(o),i.appendChild(a),t.showTooltips){const e=document.createElement("span");e.className="tooltip fullscreen-tooltip",e.textContent=t.tooltipFullscreen;const n=document.createElement("span");n.className="tooltip exit-fullscreen-tooltip",n.style.display="none",n.textContent=t.tooltipExitFullscreen,i.appendChild(e),i.appendChild(n)}s.appendChild(i)}return o.appendChild(s),i.appendChild(o),i},Et=function(e){const t="light"===e.theme?{accent:"#ffffff"!==e.accentColor?e.accentColor:"#000000",controlsBg:"rgba(0,0,0,0.8)"!==e.controlsBackground?e.controlsBackground:"rgba(255,255,255,0.9)",centerPlayBg:"rgba(0,0,0,0.7)"!==e.centerPlayBackground?e.centerPlayBackground:"rgba(255,255,255,0.8)"}:{accent:e.accentColor,controlsBg:e.controlsBackground,centerPlayBg:e.centerPlayBackground};this.style.setProperty("--accent-color",t.accent),this.style.setProperty("--controls-bg",t.controlsBg),this.style.setProperty("--center-play-bg",t.centerPlayBg),e.centerPlaySize&&this.style.setProperty("--center-play-size",e.centerPlaySize+"px")},kt=function(){const t=e(this,me,"m",mt).call(this);t.lazy||t.pauseOnOutOfView?e(this,me,"m",xt).call(this,e(this,Re,"f"),t):e(this,me,"m",St).call(this,e(this,Re,"f"),t),t.performanceMode&&e(this,me,"m",Bt).call(this),e(this,me,"m",Et).call(this,t)},At=function(){e(this,me,"m",mt).call(this).pauseOnTabHide&&(document.addEventListener("visibilitychange",e(this,$e,"f"),{passive:!0}),window.addEventListener("pagehide",e(this,Ke,"f"),{passive:!0}),window.addEventListener("pageshow",e(this,Ze,"f"),{passive:!0}))},Tt=function(){document.removeEventListener("visibilitychange",e(this,$e,"f")),window.removeEventListener("pagehide",e(this,Ke,"f")),window.removeEventListener("pageshow",e(this,Ze,"f"))},xt=function(n,i){if(!("IntersectionObserver"in window))return e(this,me,"m",St).call(this,n,i);const o={root:null,rootMargin:"50px",threshold:i.lazyThreshold};t(this,ye,new IntersectionObserver(o=>{o.forEach(o=>{i.lazy&&!e(this,we,"f")&&o.isIntersecting&&o.intersectionRatio>=i.lazyThreshold&&e(this,me,"m",St).call(this,n,i),i.pauseOnOutOfView&&e(this,Ee,"f")&&e(this,Se,"f")&&(!o.isIntersecting||o.intersectionRatio<i.pauseThreshold?e(this,ke,"f")&&(t(this,Me,!0,"f"),this.pauseVideo()):e(this,Me,"f")&&!e(this,ke,"f")&&(this.playVideo(),t(this,Me,!1,"f")))})},o),"f"),e(this,ye,"f").observe(n),i.lazy||!i.pauseOnOutOfView||e(this,we,"f")||e(this,me,"m",St).call(this,n,i)},St=function(n,i){if(e(this,we,"f"))return;n.classList.add("video-loading");const o=document.createElement("video");t(this,Ee,o,"f");const s={preload:i.preload,disablepictureinpicture:"","webkit-playsinline":"",...i.loop&&{loop:""},...i.muted&&{muted:""},...i.playsinline&&{playsinline:""}};if(Object.entries(s).forEach(([e,t])=>o.setAttribute(e,t)),o.setAttribute("part","video"),i.desktopVideo){const e=document.createElement("source");e.src=i.desktopVideo,e.type=i.videoType,e.media="(min-width: 769px)",o.appendChild(e)}if(i.mobileVideo){const e=document.createElement("source");e.src=i.mobileVideo,e.type=i.videoType,e.media="(max-width: 768px)",o.appendChild(e)}const a=window.matchMedia("(max-width: 768px)").matches;o.src=a&&i.mobileVideo?i.mobileVideo:i.desktopVideo,o.addEventListener("loadeddata",e(this,nt,"f").bind(this,n,i),{once:!0}),o.addEventListener("playing",e(this,it,"f").bind(this,n)),o.addEventListener("pause",e(this,ot,"f").bind(this,n)),o.addEventListener("ended",e(this,st,"f").bind(this,n,i)),o.addEventListener("seeked",()=>e(this,me,"m",qt).call(this,"video-seeked",{currentTime:o.currentTime})),o.addEventListener("seeking",()=>e(this,me,"m",qt).call(this,"video-seeking",{currentTime:o.currentTime})),o.addEventListener("timeupdate",e(this,ht,"f"),{passive:!0}),o.addEventListener("volumechange",e(this,at,"f").bind(this,n)),o.addEventListener("error",e(this,rt,"f").bind(this,n)),document.addEventListener("fullscreenchange",e(this,lt,"f"));const r=n.querySelector(".video-placeholder");r&&r.replaceWith(o),o.style.pointerEvents="auto";const l=n.querySelector("picture");l&&(l.removeEventListener("click",e(this,Je,"f")),l.addEventListener("click",e(this,Je,"f"))),i.autoplay&&i.muted&&this.playVideo()},Ct=function(t){t.addEventListener("click",n=>{const i=n.target,o=i.closest(".video-seekbar");if(o){const t=o.getBoundingClientRect();return e(this,Ye,"f").call(this,(n.clientX-t.left)/t.width),void n.stopPropagation()}const s=i.closest(".video-volume-slider");if(s){const t=s.getBoundingClientRect();return e(this,je,"f").call(this,(n.clientX-t.left)/t.width),void n.stopPropagation()}const a=i.closest('[class*="video-"]');if(a)if(n.stopPropagation(),a.classList.contains("play-pause")||a.classList.contains("video-center-play"))e(this,Ve,"f").call(this,n);else if(a.classList.contains("volume-btn"))e(this,qe,"f").call(this,n);else if(a.classList.contains("fullscreen-btn"))e(this,Ge,"f").call(this,n);else if(a.classList.contains("video-speed-btn"))e(this,me,"m",zt).call(this,t);else if(a.classList.contains("video-speed-option")){const n=parseFloat(a.getAttribute("data-speed"));e(this,Xe,"f").call(this,n,t),e(this,me,"m",It).call(this,t)}});const n=t.querySelector(".video-seekbar");n&&(n.addEventListener("mousedown",e(this,Qe,"f")),n.addEventListener("touchstart",e(this,et,"f"),{passive:!0}));const i=t.querySelector(".video-volume-slider");i&&i.addEventListener("mousedown",e(this,tt,"f")),e(this,Ee,"f")&&e(this,Ee,"f").addEventListener("click",e(this,Ve,"f")),e(this,me,"m",Nt).call(this,t)},Nt=function(t){t.addEventListener("keydown",e(this,He,"f")),t.addEventListener("mouseenter",()=>{e(this,Se,"f")&&t.classList.add("show-controls")},{passive:!0}),t.addEventListener("mouseleave",()=>{t.classList.remove("show-controls")},{passive:!0}),t.addEventListener("touchend",e(this,ct,"f"))},Lt=function(){const t=e(this,Ee,"f");if(!t||!t.duration)return;const n=t.currentTime/t.duration*100;e(this,De,"f")&&(e(this,De,"f").style.width=n+"%"),e(this,Pe,"f")&&e(this,Pe,"f").setAttribute("aria-valuenow",Math.round(n).toString()),e(this,me,"m",Mt).call(this)},Mt=function(){if(!e(this,ze,"f")||!e(this,Ee,"f"))return;const t=e(this,me,"m",_t).call(this,e(this,Ee,"f").currentTime),n=e(this,me,"m",_t).call(this,e(this,Ee,"f").duration);e(this,ze,"f").textContent=`${t} / ${n}`},_t=function(e){if(isNaN(e)||!isFinite(e))return"0:00";return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`},Ot=function(t,n){n||(n=e(this,Re,"f")),n.querySelectorAll(".play-pause, .video-center-play").forEach(e=>{const n=e.querySelector(".play-icon"),i=e.querySelector(".pause-icon");n&&(n.style.display=t?"none":"block"),i&&(i.style.display=t?"block":"none"),e.setAttribute("aria-label",t?"Pause":"Play");const o=e.querySelector(".play-tooltip"),s=e.querySelector(".pause-tooltip");o&&(o.style.display=t?"none":"block"),s&&(s.style.display=t?"block":"none")})},Rt=function(t,n){n||(n=e(this,Re,"f"));const i=n.querySelector(".volume-btn");if(i){const e=i.querySelector(".volume-icon"),n=i.querySelector(".muted-icon");e&&(e.style.display=t?"none":"block"),n&&(n.style.display=t?"block":"none"),i.setAttribute("aria-label",t?"Unmute":"Mute");const o=i.querySelector(".volume-tooltip"),s=i.querySelector(".muted-tooltip");o&&(o.style.display=t?"none":"block"),s&&(s.style.display=t?"block":"none")}},Pt=function(t,n){n||(n=e(this,Re,"f"));const i=n.querySelector(".fullscreen-btn");if(i){const e=i.querySelector(".fullscreen-icon"),n=i.querySelector(".exit-fullscreen-icon");e&&(e.style.display=t?"none":"block"),n&&(n.style.display=t?"block":"none"),i.setAttribute("aria-label",t?"Exit fullscreen":"Fullscreen");const o=i.querySelector(".fullscreen-tooltip"),s=i.querySelector(".exit-fullscreen-tooltip");o&&(o.style.display=t?"none":"block"),s&&(s.style.display=t?"block":"none")}},Dt=function(t,n){e(this,Ie,"f")&&(e(this,Ie,"f").style.width=100*t+"%")},zt=function(t){var n;null===(n=e(this,Fe,"f"))||void 0===n||n.classList.toggle("active")},It=function(t){var n;null===(n=e(this,Fe,"f"))||void 0===n||n.classList.remove("active")},Ft=function(){e(this,Ee,"f")&&(e(this,Ee,"f").currentTime=Math.max(0,e(this,Ee,"f").currentTime-e(this,me,"m",mt).call(this).seekStep))},Wt=function(){e(this,Ee,"f")&&(e(this,Ee,"f").currentTime=Math.min(e(this,Ee,"f").duration,e(this,Ee,"f").currentTime+e(this,me,"m",mt).call(this).seekStep))},Ut=function(t){e(this,Ee,"f")&&e(this,je,"f").call(this,e(this,Ee,"f").volume+t)},Bt=function(){e(this,Re,"f")&&e(this,Re,"f").classList.add("perf-mode")},Ht=function(){e(this,me,"m",Vt).call(this),e(this,me,"m",vt).call(this),requestAnimationFrame(()=>{e(this,me,"m",kt).call(this),e(this,me,"m",At).call(this)})},Vt=function(){e(this,me,"m",Tt).call(this),e(this,ye,"f")&&(e(this,ye,"f").disconnect(),t(this,ye,null,"f")),e(this,Re,"f")&&e(this,Re,"f").removeEventListener("keydown",e(this,He,"f")),e(this,Ee,"f")&&(e(this,Ee,"f").pause(),e(this,Ee,"f").removeEventListener("click",e(this,Ve,"f")),e(this,Ee,"f").src="",e(this,Ee,"f").load(),t(this,Ee,null,"f")),e(this,Oe,"f")&&cancelAnimationFrame(e(this,Oe,"f")),t(this,we,!1,"f"),t(this,ke,!1,"f"),t(this,Se,!1,"f"),t(this,Me,!1,"f"),t(this,Le,!1,"f"),t(this,Ne,e(this,Ce,"f"),"f"),t(this,xe,1,"f"),t(this,Re,null,"f"),t(this,Pe,null,"f"),t(this,De,null,"f"),t(this,ze,null,"f"),t(this,Ie,null,"f"),t(this,Fe,null,"f"),t(this,We,null,"f"),t(this,ve,null,"f")},qt=function(e,t={}){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))},customElements.get("shadow-plyr")||customElements.define("shadow-plyr",Xt),customElements.get("shadow-plyr")||customElements.define("shadow-plyr",Xt);export{Xt as ShadowPlyr};
1
+ function t(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}function e(t,e,i,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,i):s?s.value=i:e.set(t,i),i}"function"==typeof SuppressedError&&SuppressedError;const i='<svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>',n='<svg viewBox="0 0 24 24"><path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/></svg>',s='<svg viewBox="0 0 24 24"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>',o='<svg viewBox="0 0 24 24"><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/></svg>',a='<svg viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>',l='<svg viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/></svg>',r='<svg viewBox="0 0 24 24"><path d="M20.38 8.57l-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83z"/></svg>',c='<svg viewBox="0 0 24 24"><title xmlns="">Loop Once</title><path fill="currentColor" d="M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"/></svg>',h='<svg viewBox="0 0 24 24"><title xmlns="">loop</title><path fill="currentColor" fill-rule="evenodd" d="M6.876 15.124A6.002 6.002 0 0 0 17.658 14h2.09a8.003 8.003 0 0 1-14.316 2.568L3 19v-6h6zm10.249-6.249A6.004 6.004 0 0 0 6.34 10H4.25a8.005 8.005 0 0 1 14.32-2.57L21 5v6h-6z"/></svg>',d='<svg viewBox="0 0 24 24"><path d="M19 11h-8v6h8v-6zm4 8V5c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 0H3V5h18v14z"/></svg>',u='<svg viewBox="0 0 24 24"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V6h16v12zM6 10h2v2H6v-2zm0 4h8v2H6v-2zm10 0h2v2h-2v-2zm-6-4h8v2h-8v-2z"/></svg>',p='<svg viewBox="0 0 24 24"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7v-7zm4-3h2v10h-2V7zm4 6h2v4h-2v-4z"/></svg>',m='<svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>',f='<svg viewBox="0 0 24 24"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM9 8h2v8H9V8zm4 0h2v8h-2V8z"/></svg>',b='<svg viewBox="0 0 24 24"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/></svg>',v='<svg viewBox="0 0 24 24"><path d="M6 22h12l-6-6-6 6zM21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4v-2H3V5h18v12h-4v2h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>',y='<svg viewBox="0 0 24 24"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zm-10-7h4v4h-4v-4z"/></svg>',g=new Map;function w(t,e){let i;return function(...n){i||(t.apply(this,n),i=!0,setTimeout(()=>i=!1,e))}}
2
+ /*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:A,setPrototypeOf:k,isFrozen:E,getPrototypeOf:x,getOwnPropertyDescriptor:C}=Object;let{freeze:T,seal:S,create:L}=Object,{apply:M,construct:N}="undefined"!=typeof Reflect&&Reflect;T||(T=function(t){return t}),S||(S=function(t){return t}),M||(M=function(t,e){for(var i=arguments.length,n=new Array(i>2?i-2:0),s=2;s<i;s++)n[s-2]=arguments[s];return t.apply(e,n)}),N||(N=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return new t(...i)});const z=G(Array.prototype.forEach),_=G(Array.prototype.lastIndexOf),P=G(Array.prototype.pop),O=G(Array.prototype.push),R=G(Array.prototype.splice),I=G(String.prototype.toLowerCase),D=G(String.prototype.toString),W=G(String.prototype.match),q=G(String.prototype.replace),F=G(String.prototype.indexOf),H=G(String.prototype.trim),B=G(Object.prototype.hasOwnProperty),V=G(RegExp.prototype.test),U=(j=TypeError,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return N(j,e)});var j;function G(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return M(t,e,n)}}function Y(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:I;k&&k(t,null);let n=e.length;for(;n--;){let s=e[n];if("string"==typeof s){const t=i(s);t!==s&&(E(e)||(e[n]=t),s=t)}t[s]=!0}return t}function X(t){for(let e=0;e<t.length;e++){B(t,e)||(t[e]=null)}return t}function $(t){const e=L(null);for(const[i,n]of A(t)){B(t,i)&&(Array.isArray(n)?e[i]=X(n):n&&"object"==typeof n&&n.constructor===Object?e[i]=$(n):e[i]=n)}return e}function K(t,e){for(;null!==t;){const i=C(t,e);if(i){if(i.get)return G(i.get);if("function"==typeof i.value)return G(i.value)}t=x(t)}return function(){return null}}const Q=T(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Z=T(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),J=T(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),tt=T(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),et=T(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),it=T(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nt=T(["#text"]),st=T(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ot=T(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),at=T(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),lt=T(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rt=S(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ct=S(/<%[\w\W]*|[\w\W]*%>/gm),ht=S(/\$\{[\w\W]*/gm),dt=S(/^data-[\-\w.\u00B7-\uFFFF]+$/),ut=S(/^aria-[\-\w]+$/),pt=S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mt=S(/^(?:\w+script|data):/i),ft=S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bt=S(/^html$/i),vt=S(/^[a-z][.\w]*(-[.\w]+)+$/i);var yt=Object.freeze({__proto__:null,ARIA_ATTR:ut,ATTR_WHITESPACE:ft,CUSTOM_ELEMENT:vt,DATA_ATTR:dt,DOCTYPE_NAME:bt,ERB_EXPR:ct,IS_ALLOWED_URI:pt,IS_SCRIPT_OR_DATA:mt,MUSTACHE_EXPR:rt,TMPLIT_EXPR:ht});const gt=1,wt=3,At=7,kt=8,Et=9,xt=function(){return"undefined"==typeof window?null:window};var Ct,Tt,St,Lt,Mt,Nt,zt,_t,Pt,Ot,Rt,It,Dt,Wt,qt,Ft,Ht,Bt,Vt,Ut,jt,Gt,Yt,Xt,$t,Kt,Qt,Zt,Jt,te,ee,ie,ne,se,oe,ae,le,re,ce,he,de,ue,pe,me,fe,be,ve,ye,ge,we,Ae,ke,Ee,xe,Ce,Te,Se,Le,Me,Ne,ze,_e,Pe,Oe,Re,Ie,De,We,qe,Fe,He,Be,Ve,Ue,je,Ge,Ye,Xe,$e,Ke,Qe,Ze,Je,ti,ei,ii,ni,si,oi,ai,li,ri,ci,hi,di,ui,pi,mi,fi,bi,vi,yi,gi,wi,Ai,ki,Ei,xi,Ci,Ti,Si,Li,Mi,Ni,zi,_i,Pi,Oi,Ri,Ii,Di,Wi,qi,Fi,Hi,Bi,Vi,Ui,ji,Gi,Yi,Xi,$i,Ki,Qi,Zi,Ji,tn,en,nn,sn,on,an,ln,rn,cn,hn,dn,un,pn,mn,fn,bn,vn,yn=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xt();const i=e=>t(e);if(i.version="3.3.1",i.removed=[],!e||!e.document||e.document.nodeType!==Et||!e.Element)return i.isSupported=!1,i;let{document:n}=e;const s=n,o=s.currentScript,{DocumentFragment:a,HTMLTemplateElement:l,Node:r,Element:c,NodeFilter:h,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:p,trustedTypes:m}=e,f=c.prototype,b=K(f,"cloneNode"),v=K(f,"remove"),y=K(f,"nextSibling"),g=K(f,"childNodes"),w=K(f,"parentNode");if("function"==typeof l){const t=n.createElement("template");t.content&&t.content.ownerDocument&&(n=t.content.ownerDocument)}let k,E="";const{implementation:x,createNodeIterator:C,createDocumentFragment:S,getElementsByTagName:M}=n,{importNode:N}=s;let j={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};i.isSupported="function"==typeof A&&"function"==typeof w&&x&&void 0!==x.createHTMLDocument;const{MUSTACHE_EXPR:G,ERB_EXPR:X,TMPLIT_EXPR:rt,DATA_ATTR:ct,ARIA_ATTR:ht,IS_SCRIPT_OR_DATA:dt,ATTR_WHITESPACE:ut,CUSTOM_ELEMENT:mt}=yt;let{IS_ALLOWED_URI:ft}=yt,vt=null;const Ct=Y({},[...Q,...Z,...J,...et,...nt]);let Tt=null;const St=Y({},[...st,...ot,...at,...lt]);let Lt=Object.seal(L(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Mt=null,Nt=null;const zt=Object.seal(L(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let _t=!0,Pt=!0,Ot=!1,Rt=!0,It=!1,Dt=!0,Wt=!1,qt=!1,Ft=!1,Ht=!1,Bt=!1,Vt=!1,Ut=!0,jt=!1,Gt=!0,Yt=!1,Xt={},$t=null;const Kt=Y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Qt=null;const Zt=Y({},["audio","video","img","source","image","track"]);let Jt=null;const te=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ee="http://www.w3.org/1998/Math/MathML",ie="http://www.w3.org/2000/svg",ne="http://www.w3.org/1999/xhtml";let se=ne,oe=!1,ae=null;const le=Y({},[ee,ie,ne],D);let re=Y({},["mi","mo","mn","ms","mtext"]),ce=Y({},["annotation-xml"]);const he=Y({},["title","style","font","a","script"]);let de=null;const ue=["application/xhtml+xml","text/html"];let pe=null,me=null;const fe=n.createElement("form"),be=function(t){return t instanceof RegExp||t instanceof Function},ve=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!me||me!==t){if(t&&"object"==typeof t||(t={}),t=$(t),de=-1===ue.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,pe="application/xhtml+xml"===de?D:I,vt=B(t,"ALLOWED_TAGS")?Y({},t.ALLOWED_TAGS,pe):Ct,Tt=B(t,"ALLOWED_ATTR")?Y({},t.ALLOWED_ATTR,pe):St,ae=B(t,"ALLOWED_NAMESPACES")?Y({},t.ALLOWED_NAMESPACES,D):le,Jt=B(t,"ADD_URI_SAFE_ATTR")?Y($(te),t.ADD_URI_SAFE_ATTR,pe):te,Qt=B(t,"ADD_DATA_URI_TAGS")?Y($(Zt),t.ADD_DATA_URI_TAGS,pe):Zt,$t=B(t,"FORBID_CONTENTS")?Y({},t.FORBID_CONTENTS,pe):Kt,Mt=B(t,"FORBID_TAGS")?Y({},t.FORBID_TAGS,pe):$({}),Nt=B(t,"FORBID_ATTR")?Y({},t.FORBID_ATTR,pe):$({}),Xt=!!B(t,"USE_PROFILES")&&t.USE_PROFILES,_t=!1!==t.ALLOW_ARIA_ATTR,Pt=!1!==t.ALLOW_DATA_ATTR,Ot=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,It=t.SAFE_FOR_TEMPLATES||!1,Dt=!1!==t.SAFE_FOR_XML,Wt=t.WHOLE_DOCUMENT||!1,Ht=t.RETURN_DOM||!1,Bt=t.RETURN_DOM_FRAGMENT||!1,Vt=t.RETURN_TRUSTED_TYPE||!1,Ft=t.FORCE_BODY||!1,Ut=!1!==t.SANITIZE_DOM,jt=t.SANITIZE_NAMED_PROPS||!1,Gt=!1!==t.KEEP_CONTENT,Yt=t.IN_PLACE||!1,ft=t.ALLOWED_URI_REGEXP||pt,se=t.NAMESPACE||ne,re=t.MATHML_TEXT_INTEGRATION_POINTS||re,ce=t.HTML_INTEGRATION_POINTS||ce,Lt=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&be(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Lt.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&be(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Lt.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Lt.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),It&&(Pt=!1),Bt&&(Ht=!0),Xt&&(vt=Y({},nt),Tt=[],!0===Xt.html&&(Y(vt,Q),Y(Tt,st)),!0===Xt.svg&&(Y(vt,Z),Y(Tt,ot),Y(Tt,lt)),!0===Xt.svgFilters&&(Y(vt,J),Y(Tt,ot),Y(Tt,lt)),!0===Xt.mathMl&&(Y(vt,et),Y(Tt,at),Y(Tt,lt))),t.ADD_TAGS&&("function"==typeof t.ADD_TAGS?zt.tagCheck=t.ADD_TAGS:(vt===Ct&&(vt=$(vt)),Y(vt,t.ADD_TAGS,pe))),t.ADD_ATTR&&("function"==typeof t.ADD_ATTR?zt.attributeCheck=t.ADD_ATTR:(Tt===St&&(Tt=$(Tt)),Y(Tt,t.ADD_ATTR,pe))),t.ADD_URI_SAFE_ATTR&&Y(Jt,t.ADD_URI_SAFE_ATTR,pe),t.FORBID_CONTENTS&&($t===Kt&&($t=$($t)),Y($t,t.FORBID_CONTENTS,pe)),t.ADD_FORBID_CONTENTS&&($t===Kt&&($t=$($t)),Y($t,t.ADD_FORBID_CONTENTS,pe)),Gt&&(vt["#text"]=!0),Wt&&Y(vt,["html","head","body"]),vt.table&&(Y(vt,["tbody"]),delete Mt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw U('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw U('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=t.TRUSTED_TYPES_POLICY,E=k.createHTML("")}else void 0===k&&(k=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let i=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(i=e.getAttribute(n));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(m,o)),null!==k&&"string"==typeof E&&(E=k.createHTML(""));T&&T(t),me=t}},ye=Y({},[...Z,...J,...tt]),ge=Y({},[...et,...it]),we=function(t){O(i.removed,{element:t});try{w(t).removeChild(t)}catch(e){v(t)}},Ae=function(t,e){try{O(i.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){O(i.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(Ht||Bt)try{we(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},ke=function(t){let e=null,i=null;if(Ft)t="<remove></remove>"+t;else{const e=W(t,/^[\r\n\t ]+/);i=e&&e[0]}"application/xhtml+xml"===de&&se===ne&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const s=k?k.createHTML(t):t;if(se===ne)try{e=(new p).parseFromString(s,de)}catch(t){}if(!e||!e.documentElement){e=x.createDocument(se,"template",null);try{e.documentElement.innerHTML=oe?E:s}catch(t){}}const o=e.body||e.documentElement;return t&&i&&o.insertBefore(n.createTextNode(i),o.childNodes[0]||null),se===ne?M.call(e,Wt?"html":"body")[0]:Wt?e.documentElement:o},Ee=function(t){return C.call(t.ownerDocument||t,t,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},xe=function(t){return t instanceof u&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof d)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},Ce=function(t){return"function"==typeof r&&t instanceof r};function Te(t,e,n){z(t,t=>{t.call(i,e,n,me)})}const Se=function(t){let e=null;if(Te(j.beforeSanitizeElements,t,null),xe(t))return we(t),!0;const n=pe(t.nodeName);if(Te(j.uponSanitizeElement,t,{tagName:n,allowedTags:vt}),Dt&&t.hasChildNodes()&&!Ce(t.firstElementChild)&&V(/<[/\w!]/g,t.innerHTML)&&V(/<[/\w!]/g,t.textContent))return we(t),!0;if(t.nodeType===At)return we(t),!0;if(Dt&&t.nodeType===kt&&V(/<[/\w]/g,t.data))return we(t),!0;if(!(zt.tagCheck instanceof Function&&zt.tagCheck(n))&&(!vt[n]||Mt[n])){if(!Mt[n]&&Me(n)){if(Lt.tagNameCheck instanceof RegExp&&V(Lt.tagNameCheck,n))return!1;if(Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(n))return!1}if(Gt&&!$t[n]){const e=w(t)||t.parentNode,i=g(t)||t.childNodes;if(i&&e){for(let n=i.length-1;n>=0;--n){const s=b(i[n],!0);s.__removalCount=(t.__removalCount||0)+1,e.insertBefore(s,y(t))}}}return we(t),!0}return t instanceof c&&!function(t){let e=w(t);e&&e.tagName||(e={namespaceURI:se,tagName:"template"});const i=I(t.tagName),n=I(e.tagName);return!!ae[t.namespaceURI]&&(t.namespaceURI===ie?e.namespaceURI===ne?"svg"===i:e.namespaceURI===ee?"svg"===i&&("annotation-xml"===n||re[n]):Boolean(ye[i]):t.namespaceURI===ee?e.namespaceURI===ne?"math"===i:e.namespaceURI===ie?"math"===i&&ce[n]:Boolean(ge[i]):t.namespaceURI===ne?!(e.namespaceURI===ie&&!ce[n])&&!(e.namespaceURI===ee&&!re[n])&&!ge[i]&&(he[i]||!ye[i]):!("application/xhtml+xml"!==de||!ae[t.namespaceURI]))}(t)?(we(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!V(/<\/no(script|embed|frames)/i,t.innerHTML)?(It&&t.nodeType===wt&&(e=t.textContent,z([G,X,rt],t=>{e=q(e,t," ")}),t.textContent!==e&&(O(i.removed,{element:t.cloneNode()}),t.textContent=e)),Te(j.afterSanitizeElements,t,null),!1):(we(t),!0)},Le=function(t,e,i){if(Ut&&("id"===e||"name"===e)&&(i in n||i in fe))return!1;if(Pt&&!Nt[e]&&V(ct,e));else if(_t&&V(ht,e));else if(zt.attributeCheck instanceof Function&&zt.attributeCheck(e,t));else if(!Tt[e]||Nt[e]){if(!(Me(t)&&(Lt.tagNameCheck instanceof RegExp&&V(Lt.tagNameCheck,t)||Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(t))&&(Lt.attributeNameCheck instanceof RegExp&&V(Lt.attributeNameCheck,e)||Lt.attributeNameCheck instanceof Function&&Lt.attributeNameCheck(e,t))||"is"===e&&Lt.allowCustomizedBuiltInElements&&(Lt.tagNameCheck instanceof RegExp&&V(Lt.tagNameCheck,i)||Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(i))))return!1}else if(Jt[e]);else if(V(ft,q(i,ut,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==F(i,"data:")||!Qt[t]){if(Ot&&!V(dt,q(i,ut,"")));else if(i)return!1}else;return!0},Me=function(t){return"annotation-xml"!==t&&W(t,mt)},Ne=function(t){Te(j.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||xe(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Tt,forceKeepAttr:void 0};let s=e.length;for(;s--;){const o=e[s],{name:a,namespaceURI:l,value:r}=o,c=pe(a),h=r;let d="value"===a?h:H(h);if(n.attrName=c,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Te(j.uponSanitizeAttribute,t,n),d=n.attrValue,!jt||"id"!==c&&"name"!==c||(Ae(a,t),d="user-content-"+d),Dt&&V(/((--!?|])>)|<\/(style|title|textarea)/i,d)){Ae(a,t);continue}if("attributename"===c&&W(d,"href")){Ae(a,t);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){Ae(a,t);continue}if(!Rt&&V(/\/>/i,d)){Ae(a,t);continue}It&&z([G,X,rt],t=>{d=q(d,t," ")});const u=pe(t.nodeName);if(Le(u,c,d)){if(k&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(l);else switch(m.getAttributeType(u,c)){case"TrustedHTML":d=k.createHTML(d);break;case"TrustedScriptURL":d=k.createScriptURL(d)}if(d!==h)try{l?t.setAttributeNS(l,a,d):t.setAttribute(a,d),xe(t)?we(t):P(i.removed)}catch(e){Ae(a,t)}}else Ae(a,t)}Te(j.afterSanitizeAttributes,t,null)},ze=function t(e){let i=null;const n=Ee(e);for(Te(j.beforeSanitizeShadowDOM,e,null);i=n.nextNode();)Te(j.uponSanitizeShadowNode,i,null),Se(i),Ne(i),i.content instanceof a&&t(i.content);Te(j.afterSanitizeShadowDOM,e,null)};return i.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,l=null,c=null;if(oe=!t,oe&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Ce(t)){if("function"!=typeof t.toString)throw U("toString is not a function");if("string"!=typeof(t=t.toString()))throw U("dirty is not a string, aborting")}if(!i.isSupported)return t;if(qt||ve(e),i.removed=[],"string"==typeof t&&(Yt=!1),Yt){if(t.nodeName){const e=pe(t.nodeName);if(!vt[e]||Mt[e])throw U("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof r)n=ke("\x3c!----\x3e"),o=n.ownerDocument.importNode(t,!0),o.nodeType===gt&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o);else{if(!Ht&&!It&&!Wt&&-1===t.indexOf("<"))return k&&Vt?k.createHTML(t):t;if(n=ke(t),!n)return Ht?null:Vt?E:""}n&&Ft&&we(n.firstChild);const h=Ee(Yt?t:n);for(;l=h.nextNode();)Se(l),Ne(l),l.content instanceof a&&ze(l.content);if(Yt)return t;if(Ht){if(Bt)for(c=S.call(n.ownerDocument);n.firstChild;)c.appendChild(n.firstChild);else c=n;return(Tt.shadowroot||Tt.shadowrootmode)&&(c=N.call(s,c,!0)),c}let d=Wt?n.outerHTML:n.innerHTML;return Wt&&vt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&V(bt,n.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+d),It&&z([G,X,rt],t=>{d=q(d,t," ")}),k&&Vt?k.createHTML(d):d},i.setConfig=function(){ve(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),qt=!0},i.clearConfig=function(){me=null,qt=!1},i.isValidAttribute=function(t,e,i){me||ve({});const n=pe(t),s=pe(e);return Le(n,s,i)},i.addHook=function(t,e){"function"==typeof e&&O(j[t],e)},i.removeHook=function(t,e){if(void 0!==e){const i=_(j[t],e);return-1===i?void 0:R(j[t],i,1)[0]}return P(j[t])},i.removeHooks=function(t){j[t]=[]},i.removeAllHooks=function(){j={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},i}();const gn=new CSSStyleSheet;gn.replaceSync("\n :host { display: block; position: relative; width: 100%; max-width: 100%; height:100%; }\n * { box-sizing: border-box; }\n .video-container {\n position: relative; width: 100%; aspect-ratio:var(--aspect-ratio,16:9); background: #000;\n overflow: hidden;\n height:100%;\n }\n .shadow-plyr-wrapper {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n display: flex; align-items: center; justify-content: center; outline: none;\n }\n video {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n object-fit: contain; display: block; pointer-events: auto;\n opacity: 0; transition: opacity .3s ease; will-change: opacity;\n will-change: opacity, transform;\n transform: translateZ(0);\n }\n .video-loaded.is-playing video,\n .video-loaded:not(.poster-visible) video { opacity: 1 }\n video::-webkit-media-controls { display: none }\n picture {\n position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block;\n z-index: 5; opacity: 0; transition: opacity .3s ease; pointer-events: none;\n cursor: pointer;\n }\n picture img { width: 100%; height: 100%; object-fit: contain display: block; }\n .poster-visible picture { opacity: 1; pointer-events: auto; }\n .video-loading::after {\n content: ''; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px;\n margin: -20px 0 0 -20px; border: 3px solid rgba(255,255,255,.3);\n border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;\n z-index: 10;\n }\n @keyframes spin { to { transform: rotate(360deg); } }\n /* ----- CSS CUSTOM PROPERTIES ----- */\n .video-center-play {\n position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);\n width: var(--center-play-size, 80px); height: var(--center-play-size, 80px);\n border-radius: 50%; display: flex; align-items: center; justify-content: center;\n cursor: pointer; transition: all .3s ease; z-index: 20; opacity: 0;\n pointer-events: none; box-shadow: 0 4px 20px rgba(0,0,0,.3);\n background: var(--center-play-bg, rgba(0,0,0,.7)); will-change: transform,opacity;\n }\n .video-center-play svg {\n width: calc(var(--center-play-size, 80px) * 0.5);\n height: calc(var(--center-play-size, 80px) * 0.5);\n fill: var(--accent-color, #fff);\n color:var(--accent-color, #fff);\n }\n .video-loaded .video-center-play { opacity: .8; pointer-events: auto; }\n .video-loaded.is-playing .video-center-play { opacity: 0; pointer-events: none; }\n .video-loaded.is-playing:hover .video-center-play { opacity: .8; pointer-events: auto; }\n .video-center-play:hover { transform: translate(-50%,-50%) scale(1.1); }\n .video-controls-bar {\n position: absolute; bottom: 0; left: 0; right: 0;\n padding: 40px 15px 15px; display: flex; flex-direction: column; gap: 10px;\n transition: opacity .3s ease, transform .3s ease; z-index: 25; opacity: 0;\n transform: translateY(100%); pointer-events: none; will-change: transform,opacity;\n background: var(--controls-bg, linear-gradient(to top, rgba(0,0,0,.8), transparent));\n }\n .video-loaded:not(.is-playing) .video-controls-bar,\n .video-loaded:hover .video-controls-bar,\n .video-loaded.show-controls .video-controls-bar,\n .video-loaded.is-playing:hover .video-controls-bar {\n opacity: 1; transform: translateY(0); pointer-events: auto;\n }\n .video-loaded.is-playing .video-controls-bar { opacity: 0; transform: translateY(100%); pointer-events: none; }\n .video-seekbar {\n position: relative;\n width: 100%;\n height: 14px;\n}\n\n.video-seekbar-track {\n position: absolute;\n top: 50%;\n left: 0;\n width: 100%;\n height: 8px;\n transform: translateY(-50%);\n background: rgba(255,255,255,.3);\n border-radius: 6px;\n overflow: hidden;\n}\n\n.video-seekbar-buffer {\n position: absolute;\n inset: 0;\n background: rgba(255,255,255,.2);\n transform-origin: left center;\n transform: scaleX(0);\n}\n\n.video-seekbar-progress{\nheight:8px;\n}\n\n.video-seekbar-fill {\n height: 100%;\n width: 100%;\n background: var(--accent-color,#ff8c42);\n transform-origin: left center;\n transform: scaleX(0);\n}\n\n.video-seekbar-handle {\n position: absolute;\n top: 50%;\n left: 0;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background: var(--accent-color,#ff8c42);\n transform: translate(-50%, -50%);\n}\n .video-seekbar:hover .video-seekbar-handle { opacity: 1; }\n .video-controls-row { display: flex; align-items: center; gap: 15px; }\n .video-control-btn {\n background: none; border: none; cursor: pointer; padding: 5px;\n display: flex; align-items: center; justify-content: center; transition: transform .2s;\n }\n .video-control-btn:hover { transform: scale(1.1); background: rgba(255,255,255,.1); }\n .video-control-btn svg { width: 24px; height: 24px; fill: var(--accent-color, #fff); color:var(--accent-color,#fff); }\n .video-control-btn.play-pause svg { width: 28px; height: 28px; }\n .video-volume-control { display: flex; align-items: center; gap: 8px; }\n .video-volume-slider {\n width: 0; height: 3px; background: rgba(255,255,255,.3); border-radius: 3px;\n cursor: pointer; position: relative; overflow: hidden; transition: width .3s ease;\n }\n .video-volume-control:hover .video-volume-slider { width: 60px; }\n .video-volume-progress {\n height: 100%; width: 100%; transition: width .1s;\n background: var(--accent-color, #fff); will-change: width;\n }\n .video-controls-spacer { flex: 1; }\n .video-time-display {\n font-size: 13px; font-family: monospace; user-select: none;\n color: var(--accent-color, #fff);\n }\n .video-speed-control, .video-quality-control, .video-subtitle-control, .video-more-control { position: relative; }\n .video-speed-btn, .video-quality-btn, .video-subtitle-btn, .video-more-btn { min-width: 45px; font-size: 13px; font-weight: 600; color:var(--accent-color,#fff) }\n .video-speed-menu, .video-quality-menu, .video-subtitle-menu, .video-more-menu {\n position: absolute; bottom: 100%; right: 0; border-radius: 4px; padding: 5px 0;\n margin-bottom: 10px; min-width: 80px; opacity: 0; visibility: hidden;\n transform: translateY(10px); transition: all .2s ease; z-index: 100;\n background: var(--controls-bg, rgba(0,0,0,.8));\n }\n .video-speed-menu.active, .video-quality-menu.active, .video-subtitle-menu.active, .video-more-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }\n .video-speed-option, .video-quality-option, .video-subtitle-option, .video-more-option {\n display: block; width: 100%; padding: 8px 15px; background: none; border: none;\n font-size: 13px; text-align: left; cursor: pointer; transition: background .2s;\n color: var(--accent-color, #fff);\n }\n .video-speed-option:hover, .video-quality-option:hover, .video-subtitle-option:hover, .video-more-option:hover { background: rgba(255,255,255,.1); }\n .video-speed-option.active, .video-quality-option.active, .video-subtitle-option.active, .video-more-option.active { background: rgba(255,255,255,.2); font-weight: 600; }\n .video-control-btn:focus-visible,\n .video-seekbar:focus-visible,\n .video-volume-slider:focus-visible { outline: 2px solid var(--accent-color, #fff); outline-offset: 2px; }\n .sr-only {\n position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;\n overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;\n }\n /* ----- Tooltip styles ----- */\n .tooltip {\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: 8px;\n padding: 4px 8px;\n background: var(--tooltip-bg,rgba(0,0,0,0.8));\n color: var(--tooltip-color,#fff);\n font-size: var(--tooltip-font-size,12px);\n white-space: nowrap;\n border-radius: 4px;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.2s;\n z-index: 30;\n }\n .video-control-btn:hover .tooltip,\n .video-center-play:hover .tooltip {\n opacity: 1;\n }\n\n .video-control-btn.disabled,\n.video-control-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n pointer-events: auto;\n}\n @media (max-width: 768px) {\n .video-center-play { width: 60px; height: 60px; }\n .video-center-play svg { width: 30px; height: 30px; }\n .video-controls-bar { padding: 30px 10px 10px; }\n .video-control-btn svg { width: 20px; height: 20px; }\n .video-volume-slider { display: none; }\n .video-time-display { font-size: 11px; }\n }\n .responsive-hidden { display: none }\n .responsive-more-menu .video-control-btn { display: flex; width: 100%; padding: 10px; }\n\n .tap-ripple {\n position: absolute;\n width: 20px;\n height: 20px;\n background: rgba(255,255,255,0.4);\n border-radius: 50%;\n transform: translate(-50%, -50%);\n animation: ripple-expand 0.6s ease-out forwards;\n pointer-events: none;\n z-index: 50;\n }\n @keyframes ripple-expand {\n from { opacity: 1; transform: translate(-50%, -50%) scale(1); }\n to { opacity: 0; transform: translate(-50%, -50%) scale(8); }\n }\n .video-seek-buttons {\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n pointer-events: none;\n }\n .video-seek-buttons button {\n pointer-events: auto;\n width: 30%;\n height: 60%;\n background: transparent;\n border: none;\n color: #fff;\n font-size: 20px;\n font-weight: bold;\n opacity: 0.6;\n }\n .seek-overlay {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%,-50%);\n font-size: 32px;\n color: white;\n font-weight: bold;\n pointer-events: none;\n animation: fadeOut 0.6s forwards;\n }\n @keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n /* Theater mode – applied to container */\n .video-container.theater-mode {\n max-width: none;\n aspect-ratio: auto;\n }\n /* Mini player */\n .mini-player {\n position: fixed;\n bottom: 20px;\n right: 20px;\n width: 320px;\n height: 180px;\n z-index: 9999;\n box-shadow: 0 0 20px rgba(0,0,0,.5);\n top:auto;\n left:auto;\n border-radius:8px;\n overflow:hidden;\n }\n .mini-player .video-volume-slider,\n.mini-player .video-time-display,\n.mini-player .fullscreen-btn,\n.mini-player .video-more-control\n{\n display: none !important;\n}\n .mini-player .miniplayer-btn {\n display:block !important;\n }\n .mini-player .video-controls-bar{\n gap:0;\n padding:16px 6px 2px;\n }\n .mini-player video,\n .mini-player img{\n border-radius:8px;\n }\n");const wn=(()=>{const t=new Set;let e=null;return{register(e){t.add(e)},unregister(i){t.delete(i),e===i&&(e=null)},requestPlay(t){e&&e!==t&&e.pauseVideo(!0),e=t}}})();class An extends HTMLElement{constructor(){super(),Ct.add(this),Tt.set(this,void 0),St.set(this,null),Lt.set(this,0),Mt.set(this,1e4),Nt.set(this,null),zt.set(this,!1),_t.set(this,null),Pt.set(this,!1),Ot.set(this,!1),Rt.set(this,!1),It.set(this,1),Dt.set(this,!1),Wt.set(this,!1),qt.set(this,!1),Ft.set(this,!1),Ht.set(this,!1),Bt.set(this,!0),Vt.set(this,null),Ut.set(this,null),jt.set(this,null),Gt.set(this,null),Yt.set(this,null),Xt.set(this,null),$t.set(this,void 0),Kt.set(this,null),Qt.set(this,null),Zt.set(this,null),Jt.set(this,null),te.set(this,null),ee.set(this,null),ie.set(this,null),ne.set(this,null),se.set(this,null),oe.set(this,null),ae.set(this,void 0),le.set(this,0),re.set(this,null),ce.set(this,null),he.set(this,null),de.set(this,[]),ue.set(this,[]),pe.set(this,null),me.set(this,null),fe.set(this,[]),be.set(this,null),ve.set(this,null),ye.set(this,!1),ge.set(this,!1),we.set(this,e=>{if(!t(this,_t,"f"))return;const i=e.key.toLowerCase();t(this,Ct,"m",mi).call(this);let n=!1;const s={" ":()=>t(this,Ae,"f").call(this),k:()=>t(this,Ae,"f").call(this),arrowleft:()=>t(this,Ct,"m",dn).call(this),arrowright:()=>t(this,Ct,"m",un).call(this),arrowup:()=>t(this,Ct,"m",pn).call(this,.1),arrowdown:()=>t(this,Ct,"m",pn).call(this,-.1),m:()=>t(this,ke,"f").call(this),f:()=>t(this,Ee,"f").call(this),home:()=>{t(this,_t,"f")&&(t(this,_t,"f").currentTime=0)},end:()=>{t(this,_t,"f")&&(t(this,_t,"f").currentTime=t(this,_t,"f").duration)},l:()=>t(this,xe,"f").call(this),p:()=>t(this,Ce,"f").call(this),t:()=>t(this,Te,"f").call(this),"?":()=>t(this,Le,"f").call(this)};s[i]?(e.preventDefault(),s[i](),n=!0):i>="0"&&i<="9"&&t(this,_t,"f").duration&&(e.preventDefault(),t(this,_t,"f").currentTime=t(this,_t,"f").duration*(parseInt(i)/10),n=!0),n&&t(this,Ut,"f")&&t(this,Ut,"f").classList.add("show-controls")}),Ae.set(this,e=>{e&&e.stopPropagation(),t(this,_t,"f")&&(t(this,Pt,"f")?this.pauseVideo():this.playVideo())}),ke.set(this,e=>{e&&e.stopPropagation(),t(this,_t,"f")&&(t(this,_t,"f").muted=!t(this,_t,"f").muted)}),Ee.set(this,e=>{e&&e.stopPropagation();const i=t(this,jt,"f"),n=t(this,_t,"f");if(document.fullscreenElement||document.webkitFullscreenElement)document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else{if(n&&"webkitEnterFullscreen"in n)return void n.webkitEnterFullscreen();(null==i?void 0:i.requestFullscreen)?i.requestFullscreen():i&&"webkitRequestFullscreen"in i&&i.webkitRequestFullscreen()}}),xe.set(this,e=>{e&&e.stopPropagation(),t(this,_t,"f")&&(t(this,_t,"f").loop=!t(this,_t,"f").loop,t(this,Ct,"m",Zi).call(this,t(this,_t,"f").loop),t(this,Ct,"m",vn).call(this,"video-loop-change",{loop:t(this,_t,"f").loop}))}),Ce.set(this,async e=>{if(e&&e.stopPropagation(),t(this,_t,"f"))try{document.pictureInPictureElement===t(this,_t,"f")?await document.exitPictureInPicture():t(this,_t,"f").requestPictureInPicture&&await t(this,_t,"f").requestPictureInPicture()}catch(t){console.warn("PiP failed",t)}}),Te.set(this,()=>{var i;e(this,ye,!t(this,ye,"f"),"f"),null===(i=t(this,jt,"f"))||void 0===i||i.classList.toggle("theater-mode",t(this,ye,"f")),this.classList.toggle("theater-mode",t(this,ye,"f")),t(this,Ct,"m",vn).call(this,"theater-mode-change",{enabled:t(this,ye,"f")})}),Se.set(this,()=>{var i,n;t(this,_t,"f")&&(t(this,ge,"f")?(e(this,ge,!1,"f"),null===(n=t(this,Ut,"f"))||void 0===n||n.classList.remove("mini-player"),this.classList.remove("mini-player")):(e(this,ge,!0,"f"),null===(i=t(this,Ut,"f"))||void 0===i||i.classList.add("mini-player"),this.classList.add("mini-player")),t(this,Ct,"m",vn).call(this,"mini-player-change",{active:t(this,ge,"f")}))}),Le.set(this,()=>{var e,i;const n=document.createElement("div");n.className="keyboard-help",n.innerHTML=`\n <div class="help-content">\n <h3>Keyboard Shortcuts</h3>\n <ul>\n <li>Space / K: Play/Pause</li>\n <li>←/→: Seek backward/forward ${t(this,Ct,"m",mi).call(this).seekStep}s</li>\n <li>↑/↓: Volume up/down</li>\n <li>M: Mute</li>\n <li>F: Fullscreen</li>\n <li>L: Toggle Loop</li>\n <li>P: Picture-in-Picture</li>\n <li>T: Theater mode</li>\n <li>Home/End: Start/End</li>\n <li>0-9: Seek 0% to 90%</li>\n </ul>\n <button class="close-help">Close</button>\n </div>\n `,n.addEventListener("click",()=>n.remove()),null===(e=n.querySelector(".close-help"))||void 0===e||e.addEventListener("click",()=>n.remove()),null===(i=t(this,Ut,"f"))||void 0===i||i.appendChild(n)}),Me.set(this,()=>{if(t(this,_t,"f"))try{const e=document.createElement("canvas");e.width=t(this,_t,"f").videoWidth,e.height=t(this,_t,"f").videoHeight;const i=e.getContext("2d");if(!i)return;i.drawImage(t(this,_t,"f"),0,0,e.width,e.height),e.toBlob(t=>{if(!t)return void console.warn("Screenshot blocked due to CORS.");const e=URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download=`screenshot-${Date.now()}.png`,i.click(),URL.revokeObjectURL(e)})}catch(t){console.warn("Screenshot failed:",t)}}),Ne.set(this,e=>{var i;(null===(i=t(this,_t,"f"))||void 0===i?void 0:i.duration)&&(t(this,_t,"f").currentTime=t(this,_t,"f").duration*e)}),ze.set(this,e=>{if(t(this,_t,"f")){const i=Math.max(0,Math.min(1,e));t(this,_t,"f").volume=i,t(this,_t,"f").muted=0===i}}),_e.set(this,(i,n)=>{t(this,_t,"f")&&(t(this,_t,"f").playbackRate=i,e(this,It,i,"f"),null==n||n.querySelectorAll(".video-speed-option").forEach(t=>{t.classList.toggle("active",parseFloat(t.getAttribute("data-speed"))===i)}),t(this,Jt,"f")&&(t(this,Jt,"f").textContent=i+"x"))}),Pe.set(this,()=>{const i=t(this,_t,"f");if(!i)return;const n=i.currentTime,s=t(this,Pt,"f");i.removeAttribute("src"),i.load(),i.addEventListener("loadeddata",()=>{i.currentTime=n,s&&i.play()},{once:!0}),e(this,pe,null,"f"),t(this,Ct,"m",en).call(this),t(this,Ct,"m",Ge).call(this)}),Oe.set(this,i=>{const n=t(this,_t,"f");if(!n)return;if(t(this,pe,"f")===i)return;const s=t(this,ue,"f").find(t=>t.label===i);if(!s)return;const o=n.currentTime,a=!n.paused;n.pause(),n.src=s.src,n.style.display="none",n.load(),requestAnimationFrame(()=>{n.style.display=""}),n.addEventListener("loadedmetadata",()=>{o>0&&o<n.duration&&(n.currentTime=o)},{once:!0}),n.addEventListener("canplay",()=>{a&&n.play().catch(()=>{})},{once:!0}),e(this,pe,i,"f"),t(this,Ct,"m",en).call(this),t(this,Ct,"m",Ge).call(this)}),Re.set(this,i=>{if(t(this,_t,"f")){if(t(this,fe,"f").forEach(t=>{t.mode="disabled"}),i){const e=t(this,fe,"f").find(t=>t.id===i||t.label===i);e&&(e.mode="showing")}e(this,be,i,"f"),t(this,Ct,"m",nn).call(this)}}),Ie.set(this,()=>{t(this,Dt,"f")&&t(this,_t,"f")&&(document.hidden?t(this,Pt,"f")&&(e(this,Ht,!0,"f"),this.pauseVideo()):t(this,Ht,"f")&&!t(this,Pt,"f")&&(this.playVideo(),e(this,Ht,!1,"f")))}),De.set(this,()=>{t(this,Pt,"f")&&(e(this,Ht,!0,"f"),this.pauseVideo())}),We.set(this,()=>{t(this,Ht,"f")&&!t(this,Pt,"f")&&(this.playVideo(),e(this,Ht,!1,"f"))}),qe.set(this,()=>{t(this,Ct,"m",mi).call(this).posterClickPlay&&t(this,_t,"f")&&!t(this,Ft,"f")&&this.playVideo()}),Fe.set(this,i=>{i.preventDefault(),e(this,Ot,!0,"f");const n=i.currentTarget,s=n.getBoundingClientRect();t(this,Ne,"f").call(this,(i.clientX-s.left)/s.width);const o=e=>{if(!t(this,Ot,"f"))return;e.preventDefault();const i=n.getBoundingClientRect();t(this,Ne,"f").call(this,(e.clientX-i.left)/i.width)},a=()=>{e(this,Ot,!1,"f"),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",a)}),He.set(this,i=>{if(!t(this,_t,"f"))return;e(this,Ot,!0,"f");const n=i.currentTarget,s=e=>{const i=n.getBoundingClientRect(),s=(e.clientX-i.left)/i.width;t(this,Ne,"f").call(this,s)};s(i.touches[0]);const o=e=>{t(this,Ot,"f")&&s(e.touches[0])},a=()=>{e(this,Ot,!1,"f"),document.removeEventListener("touchmove",o),document.removeEventListener("touchend",a)};document.addEventListener("touchmove",o,{passive:!0}),document.addEventListener("touchend",a)}),Be.set(this,i=>{i.preventDefault(),e(this,Rt,!0,"f");const n=i.currentTarget,s=n.getBoundingClientRect();t(this,ze,"f").call(this,(i.clientX-s.left)/s.width);const o=e=>{if(!t(this,Rt,"f"))return;e.preventDefault();const i=n.getBoundingClientRect();t(this,ze,"f").call(this,(e.clientX-i.left)/i.width)},a=()=>{e(this,Rt,!1,"f"),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",a)}),Ve.set(this,(i,n)=>{if(!t(this,_t,"f"))return;i.classList.remove("video-loading"),i.classList.add("video-loaded"),this.classList.remove("video-loading"),this.classList.add("video-loaded"),e(this,zt,!0,"f"),e(this,Dt,!0,"f"),e(this,fe,Array.from(t(this,_t,"f").textTracks).filter(t=>"subtitles"===t.kind||"captions"===t.kind),"f");const s=i.querySelector(".video-subtitle-btn");if(n.showSubtitles)if(t(this,fe,"f").length>0){if(t(this,Ct,"m",Xe).call(this,i),s){s.disabled=!1,s.classList.remove("disabled"),s.setAttribute("aria-disabled","false");const t=s.querySelector(".subtitle-tooltip");t&&(t.textContent="Subtitles")}}else if(s){s.disabled=!0,s.classList.add("disabled"),s.setAttribute("aria-disabled","true");const t=s.querySelector(".subtitle-tooltip");t&&(t.textContent="No subtitles available")}if(n.showQuality&&t(this,_t,"f").src.includes(".m3u8")?t(this,Ct,"m",Ue).call(this):(n.showQuality&&t(this,ue,"f").length>0||n.showQuality)&&t(this,Ct,"m",Ge).call(this),n.resume&&t(this,ve,"f")){const e=localStorage.getItem(t(this,ve,"f"));if(e){const i=parseFloat(e);i>5&&i<t(this,_t,"f").duration-5&&(t(this,_t,"f").currentTime=i)}}n.showControls&&t(this,Ct,"m",Fi).call(this,i),n.autoplay||(e(this,Ft,!1,"f"),e(this,qt,!0,"f"),i.classList.add("poster-visible"),this.classList.add("poster-visible")),t(this,Ct,"m",Qi).call(this,!1,i),t(this,Ct,"m",vn).call(this,"video-ready",{duration:t(this,_t,"f").duration}),n.responsiveControls&&t(this,Ct,"m",Vi).call(this,i)}),Ye.set(this,i=>{if(!t(this,he,"f")||0===t(this,he,"f").levels.length)return;if(t(this,me,"f")===i)return;t(this,he,"f").currentLevel=i,e(this,me,i,"f");const n=t(this,he,"f").levels[i];e(this,pe,(null==n?void 0:n.height)?`${n.height}p`:(null==n?void 0:n.name)||`${Math.round((null==n?void 0:n.bitrate)/1e3)}kbps`,"f"),t(this,Ct,"m",en).call(this),t(this,Ct,"m",Ge).call(this)}),Ke.set(this,i=>{t(this,Ct,"m",vn).call(this,"video-playing",{currentTime:t(this,_t,"f").currentTime,duration:t(this,_t,"f").duration}),i.classList.add("is-playing"),i.classList.remove("poster-visible"),this.classList.add("is-playing"),this.classList.remove("poster-visible"),e(this,Pt,!0,"f"),e(this,Ft,!0,"f"),e(this,qt,!1,"f"),t(this,Ct,"m",$i).call(this,!0,i),t(this,Ct,"m",$e).call(this)}),Qe.set(this,i=>{t(this,Vt,"f")&&(cancelAnimationFrame(t(this,Vt,"f")),e(this,Vt,null,"f")),t(this,Ct,"m",vn).call(this,"video-paused",{currentTime:t(this,_t,"f").currentTime}),i.classList.remove("is-playing"),this.classList.remove("is-playing"),e(this,Pt,!1,"f"),t(this,Ct,"m",$i).call(this,!1,i);t(this,Ct,"m",mi).call(this).resume&&t(this,ve,"f")&&t(this,_t,"f")&&window.isSecureContext&&localStorage.setItem(t(this,ve,"f"),t(this,_t,"f").currentTime.toString())}),Ze.set(this,(i,n)=>{t(this,Ct,"m",vn).call(this,"video-ended",{duration:t(this,_t,"f").duration}),i.classList.remove("is-playing"),this.classList.remove("is-playing"),e(this,Pt,!1,"f"),t(this,Ct,"m",$i).call(this,!1,i),n.loop||(n.resetOnEnded&&(t(this,_t,"f").currentTime=0),n.showPosterOnEnded&&t(this,Wt,"f")&&(i.classList.add("poster-visible"),this.classList.add("poster-visible"),e(this,qt,!0,"f")))}),Je.set(this,e=>{const i=t(this,_t,"f");t(this,Ct,"m",Ki).call(this,i.muted||0===i.volume,e),t(this,Ct,"m",tn).call(this,i.volume,e),t(this,Ct,"m",vn).call(this,"video-volume-change",{volume:i.volume,muted:i.muted})}),ti.set(this,i=>{var n,s;console.error("Video load error"),i.classList.remove("video-loading","video-loaded"),this.classList.remove("video-loading","video-loaded"),e(this,Dt,!1,"f"),t(this,Ct,"m",vn).call(this,"video-error",{code:null===(s=null===(n=t(this,_t,"f"))||void 0===n?void 0:n.error)||void 0===s?void 0:s.code})}),ei.set(this,()=>{const e=document.fullscreenElement||document.webkitFullscreenElement,i=e===t(this,jt,"f")||e===this||e&&this.contains(e);t(this,Ct,"m",Qi).call(this,i),t(this,Ct,"m",vn).call(this,i?"video-fullscreen-enter":"video-fullscreen-exit")}),ii.set(this,()=>{if(!t(this,_t,"f")||!t(this,Xt,"f"))return;const e=t(this,_t,"f").buffered;if(0===e.length)return;const i=e.end(e.length-1)/t(this,_t,"f").duration;t(this,Xt,"f").style.transform=`scaleX(${i})`}),ni.set(this,()=>{t(this,Ct,"m",Ji).call(this,!0)}),si.set(this,()=>{t(this,Ct,"m",Ji).call(this,!1)}),oi.set(this,i=>{var n;const s=t(this,Ct,"m",mi).call(this);if(!t(this,_t,"f"))return;const o=t(this,Ut,"f").getBoundingClientRect(),a=i.changedTouches[0].clientX<o.left+o.width/2;s.enableTapRipple&&t(this,Ct,"m",ri).call(this,i.changedTouches[0].clientX,i.changedTouches[0].clientY),e(this,le,(n=t(this,le,"f"),++n),"f"),t(this,re,"f")&&clearTimeout(t(this,re,"f")),e(this,re,window.setTimeout(()=>{const i=s.doubleTapSeekSeconds,n=s.tripleTapSeconds;2===t(this,le,"f")&&s.doubleTapSeek&&t(this,Ct,"m",li).call(this,a?-i:i),t(this,le,"f")>=3&&s.tripleTapSeek&&t(this,Ct,"m",li).call(this,a?-n:n),e(this,le,0,"f")},300),"f")}),ci.set(this,void 0),hi.set(this,void 0),di.set(this,void 0),e(this,Tt,this.attachShadow({mode:"open"}),"f"),t(this,Tt,"f").adoptedStyleSheets=[gn],e(this,ci,w(t(this,Ct,"m",Gi).bind(this),200),"f"),e(this,hi,w(t(this,ii,"f").bind(this),1e3),"f"),e(this,di,t(this,ei,"f").bind(this),"f")}static get observedAttributes(){return["lazy","pause-on-out-of-view","autoplay","loop","muted","playsinline","desktop-poster","mobile-poster","desktop-video","mobile-video","show-controls","controls-type","show-center-play","show-play-pause","show-seekbar","show-volume","show-fullscreen","show-speed","theme","accent-color","controls-background","center-play-background","center-play-size","play-icon","loop-once-icon","loop-icon","pause-icon","volume-icon","muted-icon","fullscreen-icon","exit-fullscreen-icon","speed-icon","video-type","preload","speed-options","controls-hide-delay","seek-step","lazy-threshold","pause-threshold","pause-on-tab-hide","show-poster-on-ended","reset-on-ended","poster-click-play","performance-mode","show-tooltips","tooltip-play","tooltip-pause","tooltip-mute","tooltip-unmute","tooltip-fullscreen","tooltip-exit-fullscreen","tooltip-speed","tooltip-center-play","double-tap-seek","double-tap-seek-seconds","show-seek-buttons","seek-button-seconds","triple-tap-seek","triple-tap-seconds","enable-tap-ripple","single-active","show-loop","show-pip","show-subtitles","show-quality","skip-intro","theater-mode","resume","screenshot","airplay","mini-player","responsive-controls","buffer-progress"]}connectedCallback(){t(this,Ct,"m",bi).call(this),t(this,Ct,"m",Ri).call(this),t(this,Ct,"m",Ii).call(this),document.addEventListener("fullscreenchange",t(this,di,"f")),document.addEventListener("webkitfullscreenchange",t(this,di,"f")),("true"===this.getAttribute("virtual-playback")||t(this,Ct,"m",mi).call(this).singleActive)&&wn.register(this)}disconnectedCallback(){t(this,Ct,"m",bn).call(this),t(this,Ct,"m",Di).call(this),document.removeEventListener("fullscreenchange",t(this,di,"f")),t(this,Vt,"f")&&cancelAnimationFrame(t(this,Vt,"f")),wn.unregister(this),t(this,ce,"f")&&t(this,ce,"f").disconnect()}attributeChangedCallback(i,n,s){if(n===s)return;if(e(this,St,null,"f"),!t(this,zt,"f"))return;const o=t(this,Ct,"m",mi).call(this);switch(i){case"muted":t(this,_t,"f")&&(t(this,_t,"f").muted=o.muted);break;case"loop":t(this,_t,"f")&&(t(this,_t,"f").loop=o.loop);break;case"accent-color":case"theme":case"controls-background":case"center-play-background":case"center-play-size":t(this,Ct,"m",Oi).call(this,o);break;default:t(this,Ct,"m",fn).call(this)}}play(){this.playVideo()}pause(){this.pauseVideo()}mute(){t(this,_t,"f")&&(t(this,_t,"f").muted=!0)}unmute(){t(this,_t,"f")&&(t(this,_t,"f").muted=!1)}seek(e){t(this,_t,"f")&&(t(this,_t,"f").currentTime=e)}playVideo(){if(!t(this,_t,"f"))return;const i=t(this,Ct,"m",mi).call(this);i.autoplay&&(t(this,_t,"f").muted=!0),(i.singleActive||"true"===this.getAttribute("virtual-playback"))&&wn.requestPlay(this);const n=t(this,_t,"f").play();n&&n.catch(()=>{e(this,qt,!0,"f"),t(this,Ut,"f")&&(t(this,Ut,"f").classList.add("poster-visible"),this.classList.add("poster-visible"))})}pauseVideo(e){t(this,_t,"f")&&(t(this,_t,"f").pause(),e||t(this,Ct,"m",vn).call(this,"video-paused"))}}Tt=new WeakMap,St=new WeakMap,Lt=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,zt=new WeakMap,_t=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,Rt=new WeakMap,It=new WeakMap,Dt=new WeakMap,Wt=new WeakMap,qt=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,Bt=new WeakMap,Vt=new WeakMap,Ut=new WeakMap,jt=new WeakMap,Gt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,$t=new WeakMap,Kt=new WeakMap,Qt=new WeakMap,Zt=new WeakMap,Jt=new WeakMap,te=new WeakMap,ee=new WeakMap,ie=new WeakMap,ne=new WeakMap,se=new WeakMap,oe=new WeakMap,ae=new WeakMap,le=new WeakMap,re=new WeakMap,ce=new WeakMap,he=new WeakMap,de=new WeakMap,ue=new WeakMap,pe=new WeakMap,me=new WeakMap,fe=new WeakMap,be=new WeakMap,ve=new WeakMap,ye=new WeakMap,ge=new WeakMap,we=new WeakMap,Ae=new WeakMap,ke=new WeakMap,Ee=new WeakMap,xe=new WeakMap,Ce=new WeakMap,Te=new WeakMap,Se=new WeakMap,Le=new WeakMap,Me=new WeakMap,Ne=new WeakMap,ze=new WeakMap,_e=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,Re=new WeakMap,Ie=new WeakMap,De=new WeakMap,We=new WeakMap,qe=new WeakMap,Fe=new WeakMap,He=new WeakMap,Be=new WeakMap,Ve=new WeakMap,Ye=new WeakMap,Ke=new WeakMap,Qe=new WeakMap,Ze=new WeakMap,Je=new WeakMap,ti=new WeakMap,ei=new WeakMap,ii=new WeakMap,ni=new WeakMap,si=new WeakMap,oi=new WeakMap,ci=new WeakMap,hi=new WeakMap,di=new WeakMap,Ct=new WeakSet,Ue=async function(){if(!t(this,_t,"f"))return;const e=t(this,_t,"f").currentSrc||t(this,_t,"f").src;if(e.includes(".m3u8"))try{const i=await import("hls.js");t(this,Ct,"m",je).call(this,i,e)}catch(t){console.error("HLS.js could not be loaded. Make sure it is included in your bundle.",t)}},je=function(i,n){const s=i.default;e(this,he,new s({enableWorker:!0,lowLatencyMode:!0}),"f"),t(this,he,"f").loadSource(n),t(this,he,"f").attachMedia(t(this,_t,"f")),t(this,he,"f").on(i.Events.MANIFEST_PARSED,()=>{e(this,de,t(this,he,"f").levels,"f"),t(this,Ct,"m",Ge).call(this)})},Ge=function(){var e,i;if(!t(this,te,"f"))return;t(this,te,"f").innerHTML="";const n=[...new Set(t(this,ue,"f").map(t=>t.label))].sort();if(0===n.length&&0===t(this,de,"f").length){const i=document.createElement("button");return i.className="video-quality-option",i.disabled=!0,i.textContent="No qualities available",i.setAttribute("part","quality-option"),void(null===(e=t(this,te,"f"))||void 0===e||e.appendChild(i))}const s=document.createElement("button");s.className="video-quality-option "+(t(this,pe,"f")?"":"active"),s.setAttribute("data-quality","auto"),s.textContent="Auto",s.setAttribute("part","quality-option"),s.addEventListener("click",()=>t(this,Pe,"f").call(this)),null===(i=t(this,te,"f"))||void 0===i||i.appendChild(s),t(this,de,"f").length>0&&t(this,de,"f").forEach((e,i)=>{var n;const s=e.height?`${e.height}p`:`Level ${i+1}`,o=document.createElement("button");o.className="video-quality-option "+(t(this,me,"f")===i?"active":""),o.setAttribute("data-quality",i.toString()),o.textContent=s,o.setAttribute("part","quality-option"),o.addEventListener("click",()=>t(this,Ye,"f").call(this,i)),null===(n=t(this,te,"f"))||void 0===n||n.appendChild(o)}),n.forEach(e=>{var i;const n=document.createElement("button");n.className="video-quality-option "+(t(this,pe,"f")===e?"active":""),n.setAttribute("data-quality",e),n.textContent=`${e}p`,n.setAttribute("part","quality-option"),n.addEventListener("click",()=>t(this,Oe,"f").call(this,e)),null===(i=t(this,te,"f"))||void 0===i||i.appendChild(n)})},Xe=function(e){const i=e.querySelector(".video-subtitle-menu");if(!i)return;i.innerHTML="";const n=document.createElement("button");n.className="video-subtitle-option "+(t(this,be,"f")?"":"active"),n.setAttribute("data-subtitle",""),n.textContent="Off",n.setAttribute("part","subtitle-option"),n.addEventListener("click",()=>t(this,Re,"f").call(this,null)),null==i||i.appendChild(n),t(this,fe,"f").forEach(e=>{const n=document.createElement("button");n.className="video-subtitle-option "+(t(this,be,"f")===e.label?"active":""),n.setAttribute("data-subtitle",e.label),n.textContent=e.label||"Subtitles",n.setAttribute("part","subtitle-option"),n.addEventListener("click",()=>t(this,Re,"f").call(this,e.label)),null==i||i.appendChild(n)})},$e=function(){const i=t(this,_t,"f");if(!i)return;const n=()=>{t(this,_t,"f")&&(t(this,Ct,"m",Gi).call(this),t(this,Ct,"m",Yi).call(this),"requestVideoFrameCallback"in i?i.requestVideoFrameCallback(n):e(this,Vt,requestAnimationFrame(n),"f"))};n()},ai=function(e){var i;const n=document.createElement("div");n.className="seek-overlay",n.textContent=(e>0?"+":"")+e+"s",null===(i=t(this,Ut,"f"))||void 0===i||i.appendChild(n),setTimeout(()=>n.remove(),600)},li=function(e){if(!t(this,_t,"f"))return;const i=Math.min(Math.max(0,t(this,_t,"f").currentTime+e),t(this,_t,"f").duration);t(this,_t,"f").currentTime=i,t(this,Ct,"m",ai).call(this,e)},ri=function(e,i){if(!t(this,Ut,"f"))return;const n=t(this,Ut,"f").getBoundingClientRect(),s=document.createElement("div");s.className="tap-ripple",s.style.left=e-n.left+"px",s.style.top=i-n.top+"px",t(this,Ut,"f").appendChild(s),setTimeout(()=>s.remove(),600)},ui=function(t){if(!t||"string"!=typeof t)return!1;try{return"https:"===new URL(t,window.location.origin).protocol}catch{return!1}},pi=function(e){const i=e.querySelector("img");if(i&&!t(this,Ct,"m",ui).call(this,i.src))return!1;const n=e.querySelectorAll("source");for(const e of Array.from(n))if(e.srcset&&!t(this,Ct,"m",ui).call(this,e.srcset))return!1;return!0},mi=function(){const i=Date.now();if(t(this,St,"f")&&i-t(this,Lt,"f")<t(this,Mt,"f"))return t(this,St,"f");const n={lazy:"true"===this.getAttribute("lazy"),pauseOnOutOfView:"true"===this.getAttribute("pause-on-out-of-view"),pauseOnTabHide:"false"!==this.getAttribute("pause-on-tab-hide"),autoplay:"true"===this.getAttribute("autoplay"),loop:"true"===this.getAttribute("loop"),muted:"true"===this.getAttribute("muted"),playsinline:"true"===this.getAttribute("playsinline"),preload:this.getAttribute("preload")||"metadata",desktopPoster:this.getAttribute("desktop-poster")||"",mobilePoster:this.getAttribute("mobile-poster")||"",desktopVideo:this.getAttribute("desktop-video")||"",mobileVideo:this.getAttribute("mobile-video")||"",videoType:this.getAttribute("video-type")||"video/mp4",showControls:"true"===this.getAttribute("show-controls"),controlsType:this.getAttribute("controls-type")||"full",showPlayPause:"false"!==this.getAttribute("show-play-pause"),showSeekbar:"true"===this.getAttribute("show-seekbar"),showVolume:"true"===this.getAttribute("show-volume"),showFullscreen:"true"===this.getAttribute("show-fullscreen"),showCenterPlay:"true"===this.getAttribute("show-center-play"),showSpeed:"true"===this.getAttribute("show-speed"),speedOptions:t(this,Ct,"m",fi).call(this),controlsHideDelay:parseInt(this.getAttribute("controls-hide-delay")||"3000"),seekStep:parseInt(this.getAttribute("seek-step")||"5"),lazyThreshold:parseFloat(this.getAttribute("lazy-threshold")||"0.5"),pauseThreshold:parseFloat(this.getAttribute("pause-threshold")||"0.3"),theme:this.getAttribute("theme")||"dark",accentColor:this.getAttribute("accent-color")||"#ffffff",controlsBackground:this.getAttribute("controls-background")||"rgba(0, 0, 0, 0.8)",centerPlayBackground:this.getAttribute("center-play-background")||"rgba(0, 0, 0, 0.7)",centerPlaySize:parseInt(this.getAttribute("center-play-size")||"80"),showPosterOnEnded:"true"===this.getAttribute("show-poster-on-ended"),resetOnEnded:"true"===this.getAttribute("reset-on-ended"),posterClickPlay:"false"!==this.getAttribute("poster-click-play"),performanceMode:"true"===this.getAttribute("performance-mode"),showTooltips:"true"===this.getAttribute("show-tooltips"),tooltipPlay:this.getAttribute("tooltip-play")||"Play",tooltipPause:this.getAttribute("tooltip-pause")||"Pause",tooltipMute:this.getAttribute("tooltip-mute")||"Mute",tooltipUnmute:this.getAttribute("tooltip-unmute")||"Unmute",tooltipFullscreen:this.getAttribute("tooltip-fullscreen")||"Fullscreen",tooltipExitFullscreen:this.getAttribute("tooltip-exit-fullscreen")||"Exit fullscreen",tooltipSpeed:this.getAttribute("tooltip-speed")||"Playback speed",tooltipCenterPlay:this.getAttribute("tooltip-center-play")||"Play",doubleTapSeek:"false"!==this.getAttribute("double-tap-seek"),doubleTapSeekSeconds:parseInt(this.getAttribute("double-tap-seek-seconds")||"10"),showSeekButtons:"true"===this.getAttribute("show-seek-buttons"),seekButtonSeconds:parseInt(this.getAttribute("seek-button-seconds")||"10"),tripleTapSeek:"false"!==this.getAttribute("triple-tap-seek"),tripleTapSeconds:parseInt(this.getAttribute("triple-tap-seconds")||"30"),enableTapRipple:"false"!==this.getAttribute("enable-tap-ripple"),singleActive:"true"===this.getAttribute("single-active"),showLoop:"true"===this.getAttribute("show-loop"),showPip:"true"===this.getAttribute("show-pip"),showSubtitles:"true"===this.getAttribute("show-subtitles"),showQuality:"true"===this.getAttribute("show-quality"),skipIntro:parseInt(this.getAttribute("skip-intro")||"0"),theaterMode:"true"===this.getAttribute("theater-mode"),resume:"true"===this.getAttribute("resume"),screenshot:"true"===this.getAttribute("screenshot"),airplay:"true"===this.getAttribute("airplay"),miniPlayer:"true"===this.getAttribute("mini-player"),responsiveControls:"true"===this.getAttribute("responsive-controls"),bufferProgress:"false"!==this.getAttribute("buffer-progress")};return e(this,St,n,"f"),e(this,Lt,i,"f"),n},fi=function(){const t=this.getAttribute("speed-options");if(!t)return[.5,.75,1,1.25,1.5,2];try{return t.split(",").map(t=>parseFloat(t.trim())).filter(t=>!isNaN(t))}catch{return[.5,.75,1,1.25,1.5,2]}},bi=function(){const i=t(this,Ct,"m",mi).call(this),n=this.querySelector("picture"),s=n&&t(this,Ct,"m",pi).call(this,n);e(this,Wt,!!(s||i.desktopPoster||i.mobilePoster),"f"),e(this,qt,t(this,Wt,"f")&&!t(this,Ft,"f"),"f"),e(this,ve,i.resume?`shadowplyr-${i.desktopVideo||i.mobileVideo}`:null,"f");const o=document.createElement("div");if(o.className="shadow-plyr-wrapper",o.setAttribute("tabindex","0"),o.setAttribute("role","application"),o.setAttribute("aria-label","Video player"),o.setAttribute("part","shadow-plyr-wrapper"),s){[n,...Array.from(n.querySelectorAll("*"))].forEach(t=>{for(let e=t.attributes.length-1;e>=0;e--){const i=t.attributes[e];i.name.startsWith("on")&&t.removeAttribute(i.name)}}),n.setAttribute("part","poster"),o.appendChild(n)}else if(t(this,Ct,"m",ui).call(this,i.desktopPoster)||t(this,Ct,"m",ui).call(this,i.mobilePoster)){const e=document.createElement("picture");if(e.setAttribute("part","poster"),i.mobilePoster&&t(this,Ct,"m",ui).call(this,i.mobilePoster)){const t=document.createElement("source");t.media="(max-width: 768px)",t.srcset=i.mobilePoster,e.appendChild(t)}if(t(this,Ct,"m",ui).call(this,i.desktopPoster)){const t=document.createElement("img");t.src=i.desktopPoster,t.alt="Video thumbnail",t.loading="lazy",e.appendChild(t)}o.appendChild(e)}const a=document.createElement("div");if(a.className="video-placeholder",o.appendChild(a),i.showCenterPlay){const e=t(this,Ct,"m",gi).call(this),n=document.createElement("div");n.className="video-center-play",n.setAttribute("role","button"),n.tabIndex=0,n.setAttribute("aria-label","Play video"),n.setAttribute("part","center-play");const s=document.createElement("span");s.className="play-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.play));const a=document.createElement("span");if(a.className="pause-icon",a.style.display="none",a.setAttribute("aria-hidden","true"),a.appendChild(t(this,Ct,"m",vi).call(this,e.pause)),n.appendChild(s),n.appendChild(a),i.showTooltips){const t=document.createElement("span");t.className="tooltip center-play-tooltip",t.textContent=i.tooltipCenterPlay,n.appendChild(t)}const l=document.createElement("span");l.className="sr-only",l.textContent="Play",n.appendChild(l),o.appendChild(n)}i.showControls&&"none"!==i.controlsType&&o.appendChild(t(this,Ct,"m",wi).call(this,i)),i.showSeekButtons&&o.appendChild(t(this,Ct,"m",yi).call(this,i));const l=document.createElement("div");l.className="video-container",l.setAttribute("part","video-container"),l.appendChild(o),t(this,Tt,"f").innerHTML="",t(this,Tt,"f").appendChild(l),e(this,Ut,o,"f"),e(this,jt,l,"f"),e(this,Gt,o.querySelector(".video-seekbar"),"f"),e(this,Yt,o.querySelector(".video-seekbar-progress"),"f"),e(this,Xt,o.querySelector(".video-seekbar-buffer"),"f"),e(this,Kt,o.querySelector(".video-time-display"),"f"),e(this,Qt,o.querySelector(".video-volume-progress"),"f"),e(this,Zt,o.querySelector(".video-speed-menu"),"f"),e(this,Jt,o.querySelector(".speed-text"),"f"),e(this,te,o.querySelector(".video-quality-menu"),"f"),e(this,ee,o.querySelector(".quality-text"),"f"),e(this,ie,o.querySelector(".video-subtitle-menu"),"f"),e(this,ne,o.querySelector(".subtitle-text"),"f"),e(this,se,o.querySelector(".video-more-menu"),"f"),e(this,oe,o.querySelector(".video-more-btn"),"f")},vi=function(t){const e=document.createElement("div");e.innerHTML=t.trim();const i=e.firstElementChild;if(!i||"svg"!==i.tagName.toLowerCase()){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 24 24"),t}return i},yi=function(e){const i=document.createElement("div");i.className="video-seek-buttons",i.setAttribute("part","seek-buttons");const n=document.createElement("button");n.className="seek-left",n.textContent=`-${e.seekButtonSeconds}s`,n.setAttribute("part","seek-left");const s=document.createElement("button");return s.className="seek-right",s.textContent=`+${e.seekButtonSeconds}s`,s.setAttribute("part","seek-right"),n.addEventListener("click",()=>{t(this,_t,"f")&&(t(this,_t,"f").currentTime=Math.max(0,t(this,_t,"f").currentTime-e.seekButtonSeconds))}),s.addEventListener("click",()=>{t(this,_t,"f")&&(t(this,_t,"f").currentTime=Math.min(t(this,_t,"f").duration,t(this,_t,"f").currentTime+e.seekButtonSeconds))}),i.appendChild(n),i.appendChild(s),i},gi=function(){const t=`${this.getAttribute("play-icon")||""}-${this.getAttribute("pause-icon")||""}`;if(g.has(t))return g.get(t);const e={USE_PROFILES:{svg:!0}},w={play:yn.sanitize(this.getAttribute("play-icon")||i,e),pause:yn.sanitize(this.getAttribute("pause-icon")||n,e),volume:yn.sanitize(this.getAttribute("volume-icon")||s,e),muted:yn.sanitize(this.getAttribute("muted-icon")||o,e),fullscreen:yn.sanitize(this.getAttribute("fullscreen-icon")||a,e),exitFullscreen:yn.sanitize(this.getAttribute("exit-fullscreen-icon")||l,e),speed:yn.sanitize(this.getAttribute("speed-icon")||r,e),loopOnce:yn.sanitize(this.getAttribute("loop-once-icon")||c,e),loop:yn.sanitize(this.getAttribute("loop-icon")||h,e),pip:yn.sanitize(this.getAttribute("pip-icon")||d,e),subtitle:yn.sanitize(this.getAttribute("subtitle-icon")||u,e),quality:yn.sanitize(this.getAttribute("quality-icon")||p,e),more:yn.sanitize(this.getAttribute("more-icon")||m,e),theater:yn.sanitize(this.getAttribute("theater-icon")||f,e),screenshot:yn.sanitize(this.getAttribute("screenshot-icon")||b,e),airplay:yn.sanitize(this.getAttribute("airplay-icon")||v,e),miniplayer:yn.sanitize(this.getAttribute("miniplayer-icon")||y,e)};return g.set(t,w),w},wi=function(i){const n=t(this,Ct,"m",gi).call(this),s=document.createDocumentFragment(),o=document.createElement("div");if(o.className="video-controls-bar",o.setAttribute("role","region"),o.setAttribute("aria-label","Video controls"),o.setAttribute("part","controls"),i.showSeekbar){const t=document.createElement("div");t.className="video-seekbar",t.setAttribute("role","slider"),t.tabIndex=0,t.setAttribute("aria-label","Seek"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax","100"),t.setAttribute("aria-valuenow","0"),t.setAttribute("part","seekbar"),e(this,Gt,t,"f");const n=document.createElement("div");if(n.className="video-seekbar-track",n.setAttribute("part","video-seekbar-track"),i.bufferProgress){const t=document.createElement("div");t.className="video-seekbar-buffer",t.setAttribute("part","seekbar-buffer"),e(this,Xt,t,"f"),n.appendChild(t)}const s=document.createElement("div");s.className="video-seekbar-progress",s.setAttribute("part","video-seekbar-progress");const a=document.createElement("div");a.className="video-seekbar-fill",a.setAttribute("part","seekbar-progress"),e(this,ae,a,"f"),s.appendChild(a),n.appendChild(s);const l=document.createElement("div");l.className="video-seekbar-handle",l.setAttribute("part","seekbar-handle"),e(this,$t,l,"f"),t.appendChild(n),t.appendChild(l),o.appendChild(t)}const a=document.createElement("div");a.className="video-controls-row",a.setAttribute("part","controls-row"),o.appendChild(a),i.showPlayPause&&a.appendChild(t(this,Ct,"m",Ai).call(this,n,i)),i.showVolume&&a.appendChild(t(this,Ct,"m",ki).call(this,n,i));const l=document.createElement("div");l.className="video-time-display",l.textContent="0:00 / 0:00",l.setAttribute("part","time-display"),a.appendChild(l);const r=document.createElement("div");return r.className="video-controls-spacer",r.setAttribute("part","controls-spacer"),a.appendChild(r),i.showLoop&&a.appendChild(t(this,Ct,"m",Ei).call(this,n,i)),i.showPip&&document.pictureInPictureEnabled&&a.appendChild(t(this,Ct,"m",xi).call(this,n,i)),i.showSubtitles&&a.appendChild(t(this,Ct,"m",Ci).call(this,n,i)),i.showQuality&&a.appendChild(t(this,Ct,"m",Ti).call(this,n,i)),i.showSpeed&&a.appendChild(t(this,Ct,"m",Si).call(this,n,i)),i.theaterMode&&a.appendChild(t(this,Ct,"m",Li).call(this,n,i)),i.screenshot&&a.appendChild(t(this,Ct,"m",Mi).call(this,n,i)),i.airplay&&window.WebKitPlaybackTargetAvailabilityEvent&&a.appendChild(t(this,Ct,"m",Ni).call(this,n,i)),i.miniPlayer&&a.appendChild(t(this,Ct,"m",zi).call(this,n,i)),i.showFullscreen&&a.appendChild(t(this,Ct,"m",_i).call(this,n,i)),i.responsiveControls&&a.appendChild(t(this,Ct,"m",Pi).call(this,n,i)),s.appendChild(o),s},Ai=function(e,i){const n=document.createElement("button");n.className="video-control-btn play-pause",n.setAttribute("aria-label","Play"),n.tabIndex=0,n.setAttribute("part","play-pause");const s=document.createElement("span");s.className="play-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.play));const o=document.createElement("span");if(o.className="pause-icon",o.style.display="none",o.setAttribute("aria-hidden","true"),o.appendChild(t(this,Ct,"m",vi).call(this,e.pause)),n.appendChild(s),n.appendChild(o),i.showTooltips){const t=document.createElement("span");t.className="tooltip play-tooltip",t.textContent=i.tooltipPlay,t.setAttribute("part","play-tooltip");const e=document.createElement("span");e.className="tooltip pause-tooltip",t.setAttribute("part","pause-tooltip"),e.style.display="none",e.textContent=i.tooltipPause,n.appendChild(t),n.appendChild(e)}return n},ki=function(e,i){const n=document.createElement("div");n.className="video-volume-control",n.setAttribute("part","volume-control");const s=document.createElement("button");s.className="video-control-btn volume-btn",s.setAttribute("aria-label","Mute"),s.tabIndex=0,s.setAttribute("part","volume-btn");const o=document.createElement("span");o.className="volume-icon",o.setAttribute("aria-hidden","true"),o.appendChild(t(this,Ct,"m",vi).call(this,e.volume));const a=document.createElement("span");if(a.className="muted-icon",a.style.display="none",a.setAttribute("aria-hidden","true"),a.appendChild(t(this,Ct,"m",vi).call(this,e.muted)),s.appendChild(o),s.appendChild(a),i.showTooltips){const t=document.createElement("span");t.className="tooltip volume-tooltip",t.textContent=i.tooltipMute,t.setAttribute("part","volume-tooltip");const e=document.createElement("span");e.className="tooltip muted-tooltip",e.style.display="none",e.textContent=i.tooltipUnmute,t.setAttribute("part","mute-tooltip"),s.appendChild(t),s.appendChild(e)}n.appendChild(s);const l=document.createElement("div");l.className="video-volume-slider",l.setAttribute("role","slider"),l.tabIndex=0,l.setAttribute("aria-label","Volume"),l.setAttribute("aria-valuemin","0"),l.setAttribute("aria-valuemax","100"),l.setAttribute("aria-valuenow","100"),l.setAttribute("part","volume-slider");const r=document.createElement("div");return r.className="video-volume-progress",r.setAttribute("part","volume-progress"),l.appendChild(r),n.appendChild(l),n},Ei=function(e,i){const n=document.createElement("button");n.className="video-control-btn loop-btn",n.setAttribute("aria-label","Enable loop"),n.tabIndex=0,n.setAttribute("part","loop-btn");const s=document.createElement("span");if(s.className="loop-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.loopOnce)),n.appendChild(s),i.showTooltips){const t=document.createElement("span");t.className="tooltip loop-on-tooltip",t.textContent="Disable loop",t.style.display="none",n.appendChild(t);const e=document.createElement("span");e.className="tooltip loop-off-tooltip",e.textContent="Enable loop",n.appendChild(e)}return n},xi=function(e,i){const n=document.createElement("button");n.className="video-control-btn pip-btn",n.setAttribute("aria-label","Picture in Picture"),n.tabIndex=0,n.setAttribute("part","pip-btn");const s=document.createElement("span");if(s.className="pip-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.pip)),n.appendChild(s),i.showTooltips){const t=document.createElement("span");t.className="tooltip pip-tooltip",t.textContent="Picture in Picture",t.setAttribute("part","pip-tooltip"),n.appendChild(t)}return n},Ci=function(e,i){const n=document.createElement("div");n.className="video-subtitle-control",n.setAttribute("part","subtitle-control");const s=document.createElement("button");s.className="video-control-btn video-subtitle-btn",s.setAttribute("aria-label","Subtitles"),s.setAttribute("aria-haspopup","true"),s.setAttribute("aria-expanded","false"),s.tabIndex=0,s.setAttribute("part","subtitle-btn");const o=document.createElement("span");o.setAttribute("aria-hidden","true"),o.appendChild(t(this,Ct,"m",vi).call(this,e.subtitle)),s.appendChild(o);const a=document.createElement("span");if(a.className="subtitle-text",a.textContent="CC",a.setAttribute("part","subtitle-text"),s.appendChild(a),i.showTooltips){const t=document.createElement("span");t.className="tooltip subtitle-tooltip",t.textContent="Subtitles",t.setAttribute("part","subtitle-tooltip"),s.appendChild(t)}n.appendChild(s);const l=document.createElement("div");return l.className="video-subtitle-menu",l.setAttribute("role","menu"),l.setAttribute("part","subtitle-menu"),n.appendChild(l),n},Ti=function(e,i){const n=document.createElement("div");n.className="video-quality-control",n.setAttribute("part","quality-control");const s=document.createElement("button");s.className="video-control-btn video-quality-btn",s.setAttribute("aria-label","Quality"),s.setAttribute("aria-haspopup","true"),s.setAttribute("aria-expanded","false"),s.tabIndex=0,s.setAttribute("part","quality-btn");const o=document.createElement("span");o.setAttribute("aria-hidden","true"),o.appendChild(t(this,Ct,"m",vi).call(this,e.quality)),s.appendChild(o);const a=document.createElement("span");if(a.className="quality-text",a.textContent="Auto",a.setAttribute("part","quality-text"),s.appendChild(a),i.showTooltips){const t=document.createElement("span");t.className="tooltip quality-tooltip",t.textContent="Quality",t.setAttribute("part","quality-tooltip"),s.appendChild(t)}n.appendChild(s);const l=document.createElement("div");return l.className="video-quality-menu",l.setAttribute("role","menu"),l.setAttribute("part","quality-menu"),n.appendChild(l),n},Si=function(e,i){const n=document.createElement("div");n.className="video-speed-control",n.setAttribute("part","speed-control");const s=document.createElement("button");s.className="video-control-btn video-speed-btn",s.setAttribute("aria-label","Playback speed"),s.setAttribute("aria-haspopup","true"),s.setAttribute("aria-expanded","false"),s.tabIndex=0,s.setAttribute("part","speed-btn");const o=document.createElement("span");o.setAttribute("aria-hidden","true"),o.appendChild(t(this,Ct,"m",vi).call(this,e.speed)),s.appendChild(o);const a=document.createElement("span");if(a.className="speed-text",a.textContent="1x",a.setAttribute("part","speed-text"),s.appendChild(a),i.showTooltips){const t=document.createElement("span");t.className="tooltip speed-tooltip",t.textContent=i.tooltipSpeed,t.setAttribute("part","speed-tooltip"),s.appendChild(t)}n.appendChild(s);const l=document.createElement("div");return l.className="video-speed-menu",l.setAttribute("role","menu"),l.setAttribute("part","speed-menu"),i.speedOptions.forEach(t=>{const e=document.createElement("button");e.className="video-speed-option "+(1===t?"active":""),e.setAttribute("role","menuitem"),e.tabIndex=-1,e.setAttribute("data-speed",t.toString()),e.textContent=t+"x",e.setAttribute("part","speed-option"),l.appendChild(e)}),n.appendChild(l),n},Li=function(e,i){const n=document.createElement("button");n.className="video-control-btn theater-btn",n.setAttribute("aria-label","Theater mode"),n.tabIndex=0,n.setAttribute("part","theater-btn");const s=document.createElement("span");if(s.className="theater-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.theater)),n.appendChild(s),i.showTooltips){const t=document.createElement("span");t.className="tooltip theater-tooltip",t.textContent="Theater mode",t.setAttribute("part","theater-tooltip"),n.appendChild(t)}return n},Mi=function(e,i){const n=document.createElement("button");n.className="video-control-btn screenshot-btn",n.setAttribute("aria-label","Screenshot"),n.tabIndex=0,n.setAttribute("part","screenshot-btn");const s=document.createElement("span");if(s.className="screenshot-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.screenshot)),n.appendChild(s),i.showTooltips){const t=document.createElement("span");t.className="tooltip screenshot-tooltip",t.textContent="Take screenshot",t.setAttribute("part","screenshot-tooltip"),n.appendChild(t)}return n},Ni=function(e,i){const n=document.createElement("button");n.className="video-control-btn airplay-btn",n.setAttribute("aria-label","AirPlay"),n.tabIndex=0,n.setAttribute("part","airplay-btn");const s=document.createElement("span");if(s.className="airplay-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.airplay)),n.appendChild(s),i.showTooltips){const t=document.createElement("span");t.className="tooltip airplay-tooltip",t.textContent="AirPlay",t.setAttribute("part","airplay-tooltip"),n.appendChild(t)}return n},zi=function(e,i){const n=document.createElement("button");n.className="video-control-btn miniplayer-btn",n.setAttribute("aria-label","Mini player"),n.tabIndex=0,n.setAttribute("part","miniplayer-btn");const s=document.createElement("span");if(s.className="miniplayer-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.miniplayer)),n.appendChild(s),i.showTooltips){const t=document.createElement("span");t.className="tooltip miniplayer-tooltip",t.textContent="Mini player",t.setAttribute("part","miniplayer-tooltip"),n.appendChild(t)}return n},_i=function(e,i){const n=document.createElement("button");n.className="video-control-btn fullscreen-btn",n.setAttribute("aria-label","Fullscreen"),n.tabIndex=0,n.setAttribute("part","fullscreen-btn");const s=document.createElement("span");s.className="fullscreen-icon",s.setAttribute("aria-hidden","true"),s.appendChild(t(this,Ct,"m",vi).call(this,e.fullscreen));const o=document.createElement("span");if(o.className="exit-fullscreen-icon",o.style.display="none",o.setAttribute("aria-hidden","true"),o.appendChild(t(this,Ct,"m",vi).call(this,e.exitFullscreen)),n.appendChild(s),n.appendChild(o),i.showTooltips){const t=document.createElement("span");t.className="tooltip fullscreen-tooltip",t.textContent=i.tooltipFullscreen,t.setAttribute("part","fullscreen-tooltip");const e=document.createElement("span");e.className="tooltip exit-fullscreen-tooltip",e.style.display="none",e.textContent=i.tooltipExitFullscreen,e.setAttribute("part","exit-fullscreen-tooltip"),n.appendChild(t),n.appendChild(e)}return n},Pi=function(e,i){const n=document.createElement("div");n.className="video-more-control",n.setAttribute("part","more-control");const s=document.createElement("button");s.className="video-control-btn video-more-btn",s.setAttribute("aria-label","More controls"),s.setAttribute("aria-haspopup","true"),s.setAttribute("aria-expanded","false"),s.tabIndex=0,s.setAttribute("part","more-btn");const o=document.createElement("span");o.setAttribute("aria-hidden","true"),o.appendChild(t(this,Ct,"m",vi).call(this,e.more)),s.appendChild(o),n.appendChild(s);const a=document.createElement("div");return a.className="video-more-menu",a.setAttribute("role","menu"),a.setAttribute("part","more-menu"),n.appendChild(a),n},Oi=function(t){const e="light"===t.theme?{accent:"#ffffff"!==t.accentColor?t.accentColor:"#000000",controlsBg:"rgba(0,0,0,0.8)"!==t.controlsBackground?t.controlsBackground:"rgba(255,255,255,0.9)",centerPlayBg:"rgba(0,0,0,0.7)"!==t.centerPlayBackground?t.centerPlayBackground:"rgba(255,255,255,0.8)"}:{accent:t.accentColor,controlsBg:t.controlsBackground,centerPlayBg:t.centerPlayBackground};this.style.setProperty("--accent-color",e.accent),this.style.setProperty("--controls-bg",e.controlsBg),this.style.setProperty("--center-play-bg",e.centerPlayBg),t.centerPlaySize&&this.style.setProperty("--center-play-size",t.centerPlaySize+"px")},Ri=function(){const e=t(this,Ct,"m",mi).call(this);e.lazy||e.pauseOnOutOfView?t(this,Ct,"m",Wi).call(this,t(this,Ut,"f"),e):t(this,Ct,"m",qi).call(this,t(this,Ut,"f"),e),e.performanceMode&&t(this,Ct,"m",mn).call(this),t(this,Ct,"m",Oi).call(this,e)},Ii=function(){t(this,Ct,"m",mi).call(this).pauseOnTabHide&&(document.addEventListener("visibilitychange",t(this,Ie,"f"),{passive:!0}),window.addEventListener("pagehide",t(this,De,"f"),{passive:!0}),window.addEventListener("pageshow",t(this,We,"f"),{passive:!0}))},Di=function(){document.removeEventListener("visibilitychange",t(this,Ie,"f")),window.removeEventListener("pagehide",t(this,De,"f")),window.removeEventListener("pageshow",t(this,We,"f"))},Wi=function(i,n){if(!("IntersectionObserver"in window))return t(this,Ct,"m",qi).call(this,i,n);const s={root:null,rootMargin:"50px",threshold:n.lazyThreshold};e(this,Nt,new IntersectionObserver(s=>{s.forEach(s=>{n.lazy&&!t(this,zt,"f")&&s.isIntersecting&&s.intersectionRatio>=n.lazyThreshold&&t(this,Ct,"m",qi).call(this,i,n),n.pauseOnOutOfView&&t(this,_t,"f")&&t(this,Dt,"f")&&(!s.isIntersecting||s.intersectionRatio<n.pauseThreshold?t(this,Pt,"f")&&(e(this,Ht,!0,"f"),this.pauseVideo()):t(this,Ht,"f")&&!t(this,Pt,"f")&&(this.playVideo(),e(this,Ht,!1,"f")))})},s),"f"),t(this,Nt,"f").observe(i),n.lazy||!n.pauseOnOutOfView||t(this,zt,"f")||t(this,Ct,"m",qi).call(this,i,n)},qi=function(i,n){if(t(this,zt,"f"))return;i.classList.add("video-loading"),this.classList.add("video-loading");const s=document.createElement("video");e(this,_t,s,"f"),s.muted=n.muted,s.defaultMuted=n.muted;const o={preload:n.preload,...!n.showPip&&{disablepictureinpicture:""},"webkit-playsinline":"",...n.loop&&{loop:""},...n.muted&&{muted:""},...n.playsinline&&{playsinline:""}};Object.entries(o).forEach(([t,e])=>s.setAttribute(t,e)),s.setAttribute("part","video"),s.playsInline=!0;Array.from(this.querySelectorAll("track")).forEach(t=>{for(let e=t.attributes.length-1;e>=0;e--){const i=t.attributes[e];i.name.startsWith("on")&&t.removeAttribute(i.name)}s.appendChild(t)});const a=Array.from(this.querySelectorAll("source")),l=[];if(a.forEach(e=>{for(let t=e.attributes.length-1;t>=0;t--){const i=e.attributes[t];i.name.startsWith("on")&&e.removeAttribute(i.name)}const i=e.getAttribute("src");i&&t(this,Ct,"m",ui).call(this,i)?l.push(e):console.warn("ShadowPlyr: Ignored invalid source URL:",i)}),l.length>0)l.forEach(t=>s.appendChild(t));else{if(n.desktopVideo&&t(this,Ct,"m",ui).call(this,n.desktopVideo)){const t=document.createElement("source");t.src=n.desktopVideo,t.type=n.videoType,t.media="(min-width: 769px)",s.appendChild(t)}if(n.mobileVideo&&t(this,Ct,"m",ui).call(this,n.mobileVideo)){const t=document.createElement("source");t.src=n.mobileVideo,t.type=n.videoType,t.media="(max-width: 768px)",s.appendChild(t)}n.desktopVideo&&t(this,Ct,"m",ui).call(this,n.desktopVideo)?s.src=n.desktopVideo:n.mobileVideo&&t(this,Ct,"m",ui).call(this,n.mobileVideo)&&(s.src=n.mobileVideo)}const r=Array.from(s.querySelectorAll("source[data-quality]"));e(this,ue,r.map(t=>({src:t.src,type:t.type||"video/mp4",label:t.getAttribute("data-quality"),media:t.media||null})).filter(e=>t(this,Ct,"m",ui).call(this,e.src)),"f"),s.addEventListener("loadedmetadata",t(this,Ve,"f").bind(this,i,n),{once:!0}),s.addEventListener("playing",t(this,Ke,"f").bind(this,i)),s.addEventListener("pause",t(this,Qe,"f").bind(this,i)),s.addEventListener("ended",t(this,Ze,"f").bind(this,i,n)),s.addEventListener("seeked",()=>t(this,Ct,"m",vn).call(this,"video-seeked",{currentTime:s.currentTime})),s.addEventListener("seeking",()=>t(this,Ct,"m",vn).call(this,"video-seeking",{currentTime:s.currentTime})),s.addEventListener("progress",t(this,hi,"f"),{passive:!0}),s.addEventListener("volumechange",t(this,Je,"f").bind(this,i)),(s.muted||n.muted)&&t(this,Ct,"m",Ki).call(this,!0,i),s.addEventListener("error",t(this,ti,"f").bind(this,i)),s.addEventListener("enterpictureinpicture",t(this,ni,"f")),s.addEventListener("leavepictureinpicture",t(this,si,"f"));const c=i.querySelector(".video-placeholder");c&&c.replaceWith(s),s.load(),s.style.pointerEvents="auto";const h=i.querySelector("picture");h&&(h.removeEventListener("click",t(this,qe,"f")),h.addEventListener("click",t(this,qe,"f"))),n.autoplay&&n.muted&&this.playVideo()},Fi=function(e){e.addEventListener("click",i=>{const n=i.target,s=n.closest(".video-seekbar");if(s){const e=s.getBoundingClientRect();return t(this,Ne,"f").call(this,(i.clientX-e.left)/e.width),void i.stopPropagation()}const o=n.closest(".video-volume-slider");if(o){const e=o.getBoundingClientRect();return t(this,ze,"f").call(this,(i.clientX-e.left)/e.width),void i.stopPropagation()}const a=n.closest('[class*="video-"]');if(a)if(a.classList.contains("play-pause")||a.classList.contains("video-center-play"))t(this,Ae,"f").call(this,i);else if(a.classList.contains("volume-btn"))t(this,ke,"f").call(this,i);else if(a.classList.contains("fullscreen-btn"))t(this,Ee,"f").call(this,i);else if(a.classList.contains("loop-btn"))t(this,xe,"f").call(this,i);else if(a.classList.contains("pip-btn"))t(this,Ce,"f").call(this,i);else if(a.classList.contains("theater-btn"))t(this,Te,"f").call(this);else if(a.classList.contains("screenshot-btn"))t(this,Me,"f").call(this);else if(a.classList.contains("airplay-btn"))t(this,_t,"f")&&t(this,_t,"f").webkitShowPlaybackTargetPicker&&t(this,_t,"f").webkitShowPlaybackTargetPicker();else if(a.classList.contains("miniplayer-btn"))t(this,Se,"f").call(this);else if(a.classList.contains("video-speed-btn"))t(this,Ct,"m",sn).call(this,e);else if(a.classList.contains("video-quality-btn"))t(this,Ct,"m",an).call(this,e);else if(a.classList.contains("video-subtitle-btn"))t(this,Ct,"m",rn).call(this,e);else if(a.classList.contains("video-more-btn"))t(this,Ct,"m",hn).call(this,e);else if(a.classList.contains("video-speed-option")){const i=parseFloat(a.getAttribute("data-speed"));t(this,_e,"f").call(this,i,e),t(this,Ct,"m",on).call(this,e)}else if(a.classList.contains("video-quality-option")){const i=a.getAttribute("data-quality");"auto"===i?t(this,Pe,"f").call(this):t(this,de,"f").length>0&&!isNaN(parseInt(i))?t(this,Ye,"f").call(this,parseInt(i)):t(this,Oe,"f").call(this,i),t(this,Ct,"m",ln).call(this,e)}else if(a.classList.contains("video-subtitle-option")){const i=a.getAttribute("data-subtitle");t(this,Re,"f").call(this,i||null),t(this,Ct,"m",cn).call(this,e)}});const i=e.querySelector(".video-seekbar");i&&(i.addEventListener("mousedown",t(this,Fe,"f")),i.addEventListener("touchstart",t(this,He,"f"),{passive:!0}));const n=e.querySelector(".video-volume-slider");n&&n.addEventListener("mousedown",t(this,Be,"f")),t(this,_t,"f")&&t(this,_t,"f").addEventListener("click",t(this,Ae,"f")),t(this,Ct,"m",Hi).call(this,e)},Hi=function(e){e.addEventListener("keydown",t(this,we,"f")),e.addEventListener("mouseenter",()=>{t(this,Dt,"f")&&(e.classList.add("show-controls"),this.classList.add("show-controls"))},{passive:!0}),e.addEventListener("mouseleave",()=>{e.classList.remove("show-controls"),this.classList.remove("show-controls"),t(this,Ct,"m",Bi).call(this)},{passive:!0}),e.addEventListener("touchend",t(this,oi,"f"))},Bi=function(e){t(this,Zt,"f")&&t(this,Zt,"f")!==e&&t(this,Zt,"f").classList.remove("active"),t(this,te,"f")&&t(this,te,"f")!==e&&t(this,te,"f").classList.remove("active"),t(this,ie,"f")&&t(this,ie,"f")!==e&&t(this,ie,"f").classList.remove("active"),t(this,se,"f")&&t(this,se,"f")!==e&&t(this,se,"f").classList.remove("active"),t(this,oe,"f")&&t(this,se,"f")!==e&&t(this,oe,"f").classList.remove("active")},Vi=function(i){t(this,ce,"f")||e(this,ce,new ResizeObserver(e=>{for(const n of e){const e=n.contentRect.width;t(this,Ct,"m",Ui).call(this,i,e)}}),"f"),t(this,ce,"f").observe(i),t(this,Ct,"m",ji).call(this,i)},Ui=function(t,e){const i=[".loop-btn",".pip-btn",".video-subtitle-control",".video-quality-control",".video-speed-control",".theater-btn",".screenshot-btn",".airplay-btn",".miniplayer-btn"],n=t.querySelector(".video-more-menu"),s=t.querySelector(".video-more-btn");n&&s&&(e<500?(i.forEach(e=>{const i=t.querySelector(e);if(i&&!i.classList.contains("responsive-hidden")){i.classList.add("responsive-hidden");const s=i.cloneNode(!0);s.classList.remove("responsive-hidden"),s.classList.add("video-more-option"),s.addEventListener("click",i=>{i.stopPropagation();const n=t.querySelector(e);n&&n.click()}),n.appendChild(s)}}),s.classList.remove("responsive-hidden")):(i.forEach(e=>{const i=t.querySelector(e);i&&i.classList.remove("responsive-hidden")}),s.classList.add("responsive-hidden"),n.innerHTML=""))},ji=function(t){},Gi=function(){const e=t(this,_t,"f");if(!e||!e.duration)return;const i=e.currentTime/e.duration;t(this,ae,"f")&&(t(this,ae,"f").style.transform=`scaleX(${i})`),t(this,$t,"f")&&(t(this,$t,"f").style.left=100*i+"%"),t(this,Gt,"f")&&t(this,Gt,"f").setAttribute("aria-valuenow",Math.round(100*i).toString()),t(this,Ct,"m",Yi).call(this)},Yi=function(){if(!t(this,Kt,"f")||!t(this,_t,"f"))return;const e=t(this,Ct,"m",Xi).call(this,t(this,_t,"f").currentTime),i=t(this,Ct,"m",Xi).call(this,t(this,_t,"f").duration);t(this,Kt,"f").textContent=`${e} / ${i}`},Xi=function(t){if(isNaN(t)||!isFinite(t))return"0:00";return`${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")}`},$i=function(e,i){i||(i=t(this,Ut,"f")),i.querySelectorAll(".play-pause, .video-center-play").forEach(t=>{const i=t.querySelector(".play-icon"),n=t.querySelector(".pause-icon");i&&(i.style.display=e?"none":"block"),n&&(n.style.display=e?"block":"none"),t.setAttribute("aria-label",e?"Pause":"Play");const s=t.querySelector(".play-tooltip"),o=t.querySelector(".pause-tooltip");s&&(s.style.display=e?"none":"block"),o&&(o.style.display=e?"block":"none")})},Ki=function(e,i){i||(i=t(this,Ut,"f"));const n=i.querySelector(".volume-btn");if(n){const t=n.querySelector(".volume-icon"),i=n.querySelector(".muted-icon");t&&(t.style.display=e?"none":"block"),i&&(i.style.display=e?"block":"none"),n.setAttribute("aria-label",e?"Unmute":"Mute");const s=n.querySelector(".volume-tooltip"),o=n.querySelector(".muted-tooltip");s&&(s.style.display=e?"none":"block"),o&&(o.style.display=e?"block":"none")}},Qi=function(e,i){i||(i=t(this,Ut,"f"));const n=i.querySelector(".fullscreen-btn");if(!n)return;const s=n.querySelector(".fullscreen-icon"),o=n.querySelector(".exit-fullscreen-icon");s&&(s.style.display=e?"none":"block"),o&&(o.style.display=e?"block":"none"),n.setAttribute("aria-label",e?"Exit fullscreen":"Fullscreen");const a=n.querySelector(".fullscreen-tooltip"),l=n.querySelector(".exit-fullscreen-tooltip");a&&(a.style.display=e?"none":"block"),l&&(l.style.display=e?"block":"none")},Zi=function(e){var i;const n=null===(i=t(this,Ut,"f"))||void 0===i?void 0:i.querySelector(".loop-btn");if(!n)return;const s=n.querySelector(".loop-icon");if(!s)return;const o=t(this,Ct,"m",gi).call(this);s.innerHTML="";const a=t(this,Ct,"m",vi).call(this,e?o.loop:o.loopOnce);s.appendChild(a),n.setAttribute("aria-label",e?"Disable loop":"Enable loop");const l=n.querySelector(".loop-on-tooltip"),r=n.querySelector(".loop-off-tooltip");l&&r&&(l.style.display=e?"block":"none",r.style.display=e?"none":"block")},Ji=function(e){var i;const n=null===(i=t(this,Ut,"f"))||void 0===i?void 0:i.querySelector(".pip-btn");n&&(n.classList.toggle("active",e),this.classList.toggle("active",e))},tn=function(e,i){t(this,Qt,"f")&&(t(this,Qt,"f").style.width=100*e+"%")},en=function(){t(this,ee,"f")&&(t(this,pe,"f")?t(this,ee,"f").textContent=t(this,pe,"f")+"p":t(this,ee,"f").textContent="Auto")},nn=function(){t(this,ne,"f")&&(t(this,ne,"f").textContent=t(this,be,"f")?"CC":"Off")},sn=function(e){var i;t(this,Ct,"m",Bi).call(this,t(this,Zt,"f")),null===(i=t(this,Zt,"f"))||void 0===i||i.classList.toggle("active")},on=function(e){var i;null===(i=t(this,Zt,"f"))||void 0===i||i.classList.remove("active")},an=function(e){var i;t(this,Ct,"m",Bi).call(this,t(this,te,"f")),null===(i=t(this,te,"f"))||void 0===i||i.classList.toggle("active")},ln=function(e){var i;null===(i=t(this,te,"f"))||void 0===i||i.classList.remove("active")},rn=function(e){var i;t(this,Ct,"m",Bi).call(this,t(this,ie,"f")),null===(i=t(this,ie,"f"))||void 0===i||i.classList.toggle("active")},cn=function(e){var i;null===(i=t(this,ie,"f"))||void 0===i||i.classList.remove("active")},hn=function(e){var i;t(this,Ct,"m",Bi).call(this,t(this,se,"f"));const n=null===(i=t(this,se,"f"))||void 0===i?void 0:i.classList.toggle("active");t(this,oe,"f")&&t(this,oe,"f").classList.toggle("active",n)},dn=function(){t(this,_t,"f")&&(t(this,_t,"f").currentTime=Math.max(0,t(this,_t,"f").currentTime-t(this,Ct,"m",mi).call(this).seekStep))},un=function(){t(this,_t,"f")&&(t(this,_t,"f").currentTime=Math.min(t(this,_t,"f").duration,t(this,_t,"f").currentTime+t(this,Ct,"m",mi).call(this).seekStep))},pn=function(e){t(this,_t,"f")&&t(this,ze,"f").call(this,t(this,_t,"f").volume+e)},mn=function(){t(this,Ut,"f")&&(t(this,Ut,"f").classList.add("perf-mode"),this.classList.add("perf-mode"))},fn=function(){t(this,Ct,"m",bn).call(this),t(this,Ct,"m",bi).call(this),requestAnimationFrame(()=>{t(this,Ct,"m",Ri).call(this),t(this,Ct,"m",Ii).call(this)})},bn=function(){t(this,Ct,"m",Di).call(this),t(this,Nt,"f")&&(t(this,Nt,"f").disconnect(),e(this,Nt,null,"f")),t(this,Ut,"f")&&(t(this,Ut,"f").removeEventListener("keydown",t(this,we,"f")),t(this,Ut,"f").__closeMenus&&document.removeEventListener("click",t(this,Ut,"f").__closeMenus)),t(this,_t,"f")&&(t(this,_t,"f").pause(),t(this,_t,"f").removeEventListener("click",t(this,Ae,"f")),t(this,_t,"f").removeEventListener("enterpictureinpicture",t(this,ni,"f")),t(this,_t,"f").removeEventListener("leavepictureinpicture",t(this,si,"f")),t(this,_t,"f").src="",t(this,_t,"f").load(),e(this,_t,null,"f")),this.classList.remove("video-loading","video-loaded","is-playing","poster-visible","show-controls","theater-mode","mini-player"),t(this,Vt,"f")&&cancelAnimationFrame(t(this,Vt,"f")),t(this,he,"f")&&t(this,he,"f").destroy(),e(this,zt,!1,"f"),e(this,Pt,!1,"f"),e(this,Dt,!1,"f"),e(this,Ht,!1,"f"),e(this,Ft,!1,"f"),e(this,qt,t(this,Wt,"f"),"f"),e(this,It,1,"f"),e(this,Ut,null,"f"),e(this,jt,null,"f"),e(this,Gt,null,"f"),e(this,Yt,null,"f"),e(this,Xt,null,"f"),e(this,Kt,null,"f"),e(this,Qt,null,"f"),e(this,Zt,null,"f"),e(this,Jt,null,"f"),e(this,te,null,"f"),e(this,ee,null,"f"),e(this,ie,null,"f"),e(this,ne,null,"f"),e(this,se,null,"f"),e(this,oe,null,"f"),e(this,St,null,"f"),e(this,de,[],"f"),e(this,ue,[],"f"),document.removeEventListener("webkitfullscreenchange",t(this,di,"f"))},vn=function(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))},customElements.get("shadow-plyr")||customElements.define("shadow-plyr",An),customElements.get("shadow-plyr")||customElements.define("shadow-plyr",An);export{An as ShadowPlyr};
4
3
  //# sourceMappingURL=index.js.map