1"use strict";(globalThis.webpackChunk_N_E=globalThis.webpackChunk_N_E||[]).push([[2042],{48580:(t,e,i)=>{i.r(e),i.d(e,{default:()=>b});var s=i(23796);let a="https://player.twitch.tv",n=/(?:www\.|go\.)?twitch\.tv\/(?:videos?\/|\?video=)(\d+)($|\?)/,r=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,o={IDLE:"Idle",ENDED:"Ended"},l={PAUSE:2,PLAY:3,SEEK:4,SET_MUTED:10,SET_VOLUME:11};function u(t,e={}){let i={src:d(t,e),frameborder:"0",width:"100%",height:"100%",allow:"accelerometer; fullscreen; autoplay; encrypted-media; picture-in-picture;",sandbox:"allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",scrolling:"no"};return e.config&&(i["data-config"]=JSON.stringify(e.config)),` 2 <style> 3 :host { 4 display: inline-block; 5 min-width: 300px; 6 min-height: 150px; 7 position: relative; 8 } 9 iframe { 10 position: absolute; 11 top: 0; 12 left: 0; 13 width: 100%; 14 height: 100%; 15 } 16 :host(:not([controls])) { 17 pointer-events: none; 18 } 19 </style> 20 <iframe${function(t){let e="";for(let i in t){let s=t[i];""===s?e+=` ${c(i)}`:e+=` ${c(i)}="${c(`${s}`)}"`}return e}(i)}></iframe> 21 `}function d(t,e){var i;if(!t.src)return;let s=t.src.match(n),o=t.src.match(r),l={parent:null==(i=globalThis.location)?void 0:i.hostname,controls:""===t.controls&&null,autoplay:""===t.autoplay&&null,muted:t.muted,preload:t.preload,...e.config};if(s){let t=s[1];return`${a}/?video=v${t}&${p(l)}`}if(o){let t=o[1];return`${a}/?channel=${t}&${p(l)}`}return""}class h extends(globalThis.HTMLElement??class{}){static getTemplateHTML=u;static shadowRootOptions={mode:"open"};static observedAttributes=["autoplay","controls","loop","muted","playsinline","preload","src"];loadComplete=new m;#t;#e;#i;#s={};#a=0;#n=!1;#r=1;#o=!this.autoplay;#l=!1;#u=0;#d=null;constructor(){super(),this.#h("config")}get config(){return this.#d}set config(t){this.#d=t}async load(){if(this.#t)return;this.shadowRoot||this.attachShadow({mode:"open"});let t=!this.#e;if(this.#e&&(this.loadComplete=new m),this.#e=!0,await (this.#t=Promise.resolve()),this.#t=null,this.#u=0,this.dispatchEvent(new Event("emptied")),!this.src){this.shadowRoot.innerHTML="",globalThis.removeEventListener("message",this.#c);return}this.dispatchEvent(new Event("loadstart"));let e=this.shadowRoot.querySelector("iframe"),i=function(t){let e={};for(let i of t)e[i.name]=i.value;return e}(this.attributes);t&&e&&(this.#d=JSON.parse(e.getAttribute("data-config")||"{}")),(null==e?void 0:e.src)&&e.src===d(i,this)||(this.shadowRoot.innerHTML=u(i,this),e=this.shadowRoot.querySelector("iframe")),this.#i=e,globalThis.addEventListener("message",this.#c)}attributeChangedCallback(t,e,i){if(e!==i)switch(t){case"src":case"controls":this.load()}}getVideoPlaybackQuality(){return this.#s.stats.videoStats}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t)}get readyState(){return this.#u}get seeking(){return this.#l}get buffered(){var t,e,i,s;return i=0,s=(null==(e=null==(t=this.#s.stats)?void 0:t.videoStats)?void 0:e.bufferSize)??0,Array.isArray(0)?f(i):null==i||null==s||0===i&&0===s?f([[0,0]]):f([[i,s]])}get paused(){return this.#s.playback?this.#s.playback===o.IDLE:this.#o}get ended(){return!!this.#s.playback&&this.#s.playback===o.ENDED}get duration(){return this.#s.duration??NaN}get autoplay(){return this.hasAttribute("autoplay")}set autoplay(t){this.autoplay!=t&&this.toggleAttribute("autoplay",!!t)}get controls(){return this.hasAttribute("controls")}set controls(t){this.controls!=t&&this.toggleAttribute("controls",!!t)}get currentTime(){return this.#s.currentTime?this.#s.currentTime:this.#a}set currentTime(t){this.#a=t,this.loadComplete.then(()=>{this.#p(l.SEEK,t)})}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(t){this.toggleAttribute("muted",!!t)}get loop(){return this.hasAttribute("loop")}set loop(t){this.toggleAttribute("loop",!!t)}get muted(){return this.#n}set muted(t){this.#n=t,this.loadComplete.then(()=>{this.#p(l.SET_MUTED,t)})}get volume(){return this.#r}set volume(t){this.#r=t,this.loadComplete.then(()=>{this.#p(l.SET_VOLUME,t)})}
21get playsInline(){return this.hasAttribute("playsinline")}set playsInline(t){this.toggleAttribute("playsinline",!!t)}play(){this.#o=!1,this.#p(l.PLAY)}pause(){this.#o=!0,this.#p(l.PAUSE)}#c=async t=>{var e,i,s,a;if(!this.#i.contentWindow)return;let{data:n,source:r}=t;if(r===this.#i.contentWindow){if("twitch-embed"===n.namespace)await new Promise(t=>setTimeout(t,10)),"ready"===n.eventName?(this.dispatchEvent(new Event("loadcomplete")),this.loadComplete.resolve(),this.#u=1,this.dispatchEvent(new Event("loadedmetadata"))):"seek"===n.eventName?(this.#l=!0,this.dispatchEvent(new Event("seeking"))):"playing"===n.eventName?(this.#l&&(this.#l=!1,this.dispatchEvent(new Event("seeked"))),this.#u=3,this.dispatchEvent(new Event("playing"))):this.dispatchEvent(new Event(n.eventName));else if("twitch-embed-player-proxy"===n.namespace&&"UPDATE_STATE"===n.eventName){let t=this.#s.duration,r=this.#s.currentTime,o=this.#s.volume,l=this.#s.muted,u=null==(i=null==(e=this.#s.stats)?void 0:e.videoStats)?void 0:i.bufferSize;this.#s={...this.#s,...n.params},t!==this.#s.duration&&this.dispatchEvent(new Event("durationchange")),r!==this.#s.currentTime&&this.dispatchEvent(new Event("timeupdate")),(o!==this.#s.volume||l!==this.#s.muted)&&(void 0!==this.#s.volume&&(this.#r=this.#s.volume),void 0!==this.#s.muted&&(this.#n=this.#s.muted),this.dispatchEvent(new Event("volumechange"))),u!==(null==(a=null==(s=this.#s.stats)?void 0:s.videoStats)?void 0:a.bufferSize)&&this.dispatchEvent(new Event("progress"))}}};#p(t,e){this.#i.contentWindow&&this.#i.contentWindow.postMessage({eventName:t,params:e,namespace:"twitch-embed-player-proxy"},a)}#h(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}}function c(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}function p(t){return String(new URLSearchParams(function(t){let e={};for(let i in t){let s=t[i];!0===s||""===s?e[i]=!0:!1===s?e[i]=!1:null!=s&&(e[i]=s)}return e}(t)))}class m extends Promise{constructor(t=()=>{}){let e,i;super((s,a)=>{t(s,a),e=s,i=a}),this.resolve=e,this.reject=i}}function f(t){return Object.defineProperties(t,{start:{value:e=>t[e][0]},end:{value:e=>t[e][1]}}),t}globalThis.customElements&&!globalThis.customElements.get("twitch-video")&&globalThis.customElements.define("twitch-video",h);var v=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),g={className:"class",htmlFor:"for"};function y(t){return t.toLowerCase()}function w(t){return"boolean"==typeof t?t?"":void 0:"function"==typeof t?void 0:"object"!=typeof t||null===t?t:void 0}function E(t,e,i){var s,a;t[e]=i,null==i&&e in(null!=(a=null==(s=globalThis.HTMLElement)?void 0:s.prototype)?a:{})&&t.removeAttribute(e)}var b=function(t){let{react:e,tagName:i,elementClass:s,events:a,displayName:n,defaultProps:r,toAttributeName:o=y,toAttributeValue:l=w}=t,u=Number.parseInt(e.version)>=19,d=e.forwardRef((t,n)=>{var d,h,c,p,m;let f=e.useRef(null),y=e.useRef(new Map),b={},S={},T={},L={};for(let[e,i]of Object.entries(t)){if(v.has(e)){T[e]=i;continue}let t=o(null!=(c=g[e])?c:e);if(s.prototype&&e in s.prototype&&!(e in(null!=(p=null==(d=globalThis.HTMLElement)?void 0:d.prototype)?p:{}))&&!(null==(h=s.observedAttributes)?void 0:h.some(e=>e===t))){L[e]=i;continue}if(e.startsWith("on")){b[e]=i;continue}let a=l(i);t&&null!=a&&(S[t]=String(a),u||(T[t]=a)),t&&u&&(a!==w(i)?T[t]=a:T[t]=i)}if("undefined"!=typeof window){for(let t in b){let i=b[t],s=t.endsWith("Capture"),n=(null!=(m=null==a?void 0:a[t])?m:t.slice(2).toLowerCase()).slice(0,s?-7:void 0);e.useLayoutEffect(()=>{let t=null==f?void 0:f.current;if(t&&"function"==typeof i)return t.addEventListener(n,i,s),()=>{t.removeEventListener(n,i,s)}},[null==f?void 0:f.current,i])}e.useLayoutEffect(()=>{if(null===f.current)return;let t=new Map;for(let e in L)E(f.current,e,L[e]),y.current.delete(e),t.set(e,L[e]);for(let[t,e]of y.current)E(f.current,t,void 0);y.current=t})}if("undefined"==typeof window&&(null==s?void 0:s.getTemplateHTML)&&(null==s?void 0:s.shadowRootOptions)){let{mode:i,delegatesFocus:a}=s.shadowRootOptions;T.children=[e.createElement("template",{shadowrootmode:i,shadowrootdelegatesfocus:a,dangerouslySetInnerHTML:{__html:s.getTemplateHTML(S,t)}}),T.children]}return e.createElement(i,{...r,...T,ref:e.useCallback(t=>{f.current=t,"function"==typeof n?n(t):null!==n&&(n.current=t)},[n])})});return d.displayName=null!=n?n:s.name,d}({react:s,tagName:"twitch-video",elementClass:h,toAttributeName:t=>"muted"===t?"":"defaultMuted"===t?"muted":y(t)})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.