PageSourceSearch

https://aiven.io/remix-chunks/react-CHSAKCID.js

js aiven.io collected 2026-10-01 09:23:35 UTC 9,575 bytes, 32 lines download raw bytes

1import{a as W}from"./typography-CGJEf-yY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"c347d410ac36f54334105e4f6267ba208f688052"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1f810638-9ad9-4669-9c88-13b62d987a17",e._sentryDebugIdIdentifier="sentry-dbid-1f810638-9ad9-4669-9c88-13b62d987a17")})()}catch{}const M="https://player.twitch.tv",x=/(?:www\.|go\.)?twitch\.tv\/(?:videos?\/|\?video=)(\d+)($|\?)/,U=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,N={IDLE:"Idle",ENDED:"Ended"},v={PAUSE:2,PLAY:3,SEEK:4,SET_MUTED:10,SET_VOLUME:11};function k(e,t={}){const i={src:C(e,t),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 t.config&&(i["data-config"]=JSON.stringify(t.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${B(i)}></iframe>
21  `}function C(e,t){var i;if(!e.src)return;const n=e.src.match(x),l=e.src.match(U),u={parent:(i=globalThis.location)==null?void 0:i.hostname,controls:e.controls===""?null:!1,autoplay:e.autoplay===""?null:!1,muted:e.muted,preload:e.preload,...t.config};if(n){const r=n[1];return`${M}/?video=v${r}&${R(u)}`}else if(l){const r=l[1];return`${M}/?channel=${r}&${R(u)}`}return""}class O extends(globalThis.HTMLElement??class{}){static getTemplateHTML=k;static shadowRootOptions={mode:"open"};static observedAttributes=["autoplay","controls","loop","muted","playsinline","preload","src"];loadComplete=new D;#s;#r;#e;#t={};#d=0;#a=!1;#l=1;#u=!this.autoplay;#n=!1;#o=0;#c=null;constructor(){super(),this.#f("config")}get config(){return this.#c}set config(t){this.#c=t}async load(){if(this.#s)return;this.shadowRoot||this.attachShadow({mode:"open"});const t=!this.#r;if(this.#r&&(this.loadComplete=new D),this.#r=!0,await(this.#s=Promise.resolve()),this.#s=null,this.#o=0,this.dispatchEvent(new Event("emptied")),!this.src){this.shadowRoot.innerHTML="",globalThis.removeEventListener("message",this.#h);return}this.dispatchEvent(new Event("loadstart"));let i=this.shadowRoot.querySelector("iframe");const n=j(this.attributes);t&&i&&(this.#c=JSON.parse(i.getAttribute("data-config")||"{}")),(!i?.src||i.src!==C(n,this))&&(this.shadowRoot.innerHTML=k(n,this),i=this.shadowRoot.querySelector("iframe")),this.#e=i,globalThis.addEventListener("message",this.#h)}attributeChangedCallback(t,i,n){if(i!==n)switch(t){case"src":case"controls":{this.load();break}}}getVideoPlaybackQuality(){return this.#t.stats.videoStats}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t)}get readyState(){return this.#o}get seeking(){return this.#n}get buffered(){var t,i;return F(0,((i=(t=this.#t.stats)==null?void 0:t.videoStats)==null?void 0:i.bufferSize)??0)}get paused(){return this.#t.playback?this.#t.playback===N.IDLE:this.#u}get ended(){return this.#t.playback?this.#t.playback===N.ENDED:!1}get duration(){return this.#t.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.#t.currentTime?this.#t.currentTime:this.#d}set currentTime(t){this.#d=t,this.loadComplete.then(()=>{this.#i(v.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.#a}set muted(t){this.#a=t,this.loadComplete.then(()=>
21{this.#i(v.SET_MUTED,t)})}get volume(){return this.#l}set volume(t){this.#l=t,this.loadComplete.then(()=>{this.#i(v.SET_VOLUME,t)})}get playsInline(){return this.hasAttribute("playsinline")}set playsInline(t){this.toggleAttribute("playsinline",!!t)}play(){this.#u=!1,this.#i(v.PLAY)}pause(){this.#u=!0,this.#i(v.PAUSE)}#h=async t=>{var i,n,l,u;if(!this.#e.contentWindow)return;const{data:r,source:E}=t;if(E===this.#e.contentWindow){if(r.namespace==="twitch-embed")await new Promise(m=>setTimeout(m,10)),r.eventName==="ready"?(this.dispatchEvent(new Event("loadcomplete")),this.loadComplete.resolve(),this.#o=1,this.dispatchEvent(new Event("loadedmetadata"))):r.eventName==="seek"?(this.#n=!0,this.dispatchEvent(new Event("seeking"))):r.eventName==="playing"?(this.#n&&(this.#n=!1,this.dispatchEvent(new Event("seeked"))),this.#o=3,this.dispatchEvent(new Event("playing"))):this.dispatchEvent(new Event(r.eventName));else if(r.namespace==="twitch-embed-player-proxy"&&r.eventName==="UPDATE_STATE"){const m=this.#t.duration,g=this.#t.currentTime,h=this.#t.volume,y=this.#t.muted,b=(n=(i=this.#t.stats)==null?void 0:i.videoStats)==null?void 0:n.bufferSize;this.#t={...this.#t,...r.params},m!==this.#t.duration&&this.dispatchEvent(new Event("durationchange")),g!==this.#t.currentTime&&this.dispatchEvent(new Event("timeupdate")),(h!==this.#t.volume||y!==this.#t.muted)&&(this.#t.volume!==void 0&&(this.#l=this.#t.volume),this.#t.muted!==void 0&&(this.#a=this.#t.muted),this.dispatchEvent(new Event("volumechange"))),b!==((u=(l=this.#t.stats)==null?void 0:l.videoStats)==null?void 0:u.bufferSize)&&this.dispatchEvent(new Event("progress"))}}};#i(t,i){if(!this.#e.contentWindow)return;const n={eventName:t,params:i,namespace:"twitch-embed-player-proxy"};this.#e.contentWindow.postMessage(n,M)}#f(t){if(Object.prototype.hasOwnProperty.call(this,t)){const i=this[t];delete this[t],this[t]=i}}}function j(e){let t={};for(let i of e)t[i.name]=i.value;return t}function B(e){let t="";for(const i in e){const n=e[i];n===""?t+=` ${_(i)}`:t+=` ${_(i)}="${_(`${n}`)}"`}return t}function _(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/`/g,"&#x60;")}function R(e){return String(new URLSearchParams(z(e)))}function z(e){let t={};for(let i in e){let n=e[i];n===!0||n===""?t[i]=!0:n===!1?t[i]=!1:n!=null&&(t[i]=n)}return t}class D extends Promise{constructor(t=()=>{}){let i,n;super((l,u)=>{t(l,u),i=l,n=u}),this.resolve=i,this.reject=n}}function F(e,t){return Array.isArray(e)?L(e):t==null||t===0?L([[0,0]]):L([[e,t]])}function L(e){return Object.defineProperties(e,{start:{value:t=>e[t][0]},end:{value:t=>e[t][1]}}),e}globalThis.customElements&&!globalThis.customElements.get("twitch-video")&&globalThis.customElements.define("twitch-video",O);var q=O,V=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),Y={className:"class",htmlFor:"for"};function $(e){return e.toLowerCase()}function I(e){if(typeof e=="boolean")return e?"":void 0;if(typeof e!="function"&&!(typeof e=="object"&&e!==null))return e}function J({react:e,tagName:t,elementClass:i,events:n,displayName:l,defaultProps:u,toAttributeName:r=$,toAttributeValue:E=I}){const T=Number.parseInt(e.version)>=19,m=e.forwardRef((g,h)=>{var y,b;const c=e.useRef(null),A=e.useRef(new Map),S={},P={},f={},w={};for(const[o,s]of Object.entries(g)){if(V.has(o)){f[o]=s;continue}const a=r(Y[o]??o);if(i.prototype&&o in i.prototype&&!(o in(((y=globalThis.HTMLElement)==null?void 0:y.prototype)??{}))&&!((b=i.observedAttributes)!=null&&b.some(p=>p===a))){w[o]=s;continue}if(o.startsWith("on")){S[o]=s;continue}const d=E(s);if(a&&d!=null&&(P[a]=String(d),T||(f[a]=d)),a&&T){const p=I(s);d!==p?f[a]=d:f[a]=s}}if(typeof window<"u"){for(const o in S){const s=S[o],a=o.endsWith("Capture"),d=(n?.[o]??o.slice(2).toLowerCase()).slice(0,a?-7:void 0);e.useLayoutEffect(()=>{const p=c?.current;if(!(!p||typeof s!="function"))return p.addEventListener(d,s,a),()=>{p.removeEventListener(d,s,a)}},[c?.current,s])}e.useLayoutEffect(()=>{if(c.current===null)return;const o=new Map;for(const s in w)H(c.current,s,w[s]),A.current.delete(s),o.set(s,w[s]);for(const[s,a]of A.current)H(c.current,s,void 0);A.current=o})}if(typeof window>"u"&&i?.getTemplateHTML&&i?.shadowRootOptions){const{mode:o,delegatesFocus:s}=i.shadowRootOptions,a=e.createElement("template",{shadowrootmode:o,shadowrootdelegatesfocus:s,dangerouslySetInnerHTML:{__html:i.getTemplateHTML(P,g)}});f.children=[a,f.children]}return e.createElement(t,{...u,...f,ref:e.useCallback(o=>{c.current=o,typeof h=="function"?h(o):h!==null&&(h.current=o)},[h])})});return m.displayName=l??i.name,m}function H(e,t,i){var n;e[t]=i,i==null&&t in(((n=globalThis.HTMLElement)==null?void 0:n.prototype)??{})&&e.removeAttribute(t)}var Q=J({react:W,tagName:"twitch-video",elementClass:q,toAttributeName(e){return e==="muted"?"":e==="defaultMuted"?"muted":$(e)}});/*! Bundled license information:
22
23ce-la-react/dist/ce-la-react.js:
24  (**
25   * @license
26   * Copyright 2018 Google LLC
27   * SPDX-License-Identifier: BSD-3-Clause
28   *
29   * Modified version of `@lit/react` for vanilla custom elements with support for SSR.
30   *)
31*/export{Q as default};
32//# sourceMappingURL=react-CHSAKCID.js.map

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.