"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8446],{83635:(e,t,i)=>{i.r(t),i.d(t,{default:()=>k});var s=i(12115);let n=/(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})/,l=/(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/.*?[?&]list=)([\w_-]+)/;function a(e,t={}){let i={src:o(e,t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture"};return t.config&&(i["data-config"]=JSON.stringify(t.config)),`
    <style>
      :host {
        display: inline-block;
        line-height: 0;
        position: relative;
        min-width: 300px;
        min-height: 150px;
      }
      iframe {
        position: absolute;
        top: 0;
        left: 0;
      }
    </style>
    <iframe${function(e){let t="";for(let i in e){let s=e[i];""===s?t+=` ${u(i)}`:t+=` ${u(i)}="${u(`${s}`)}"`}return t}(i)}></iframe>
  `}function o(e,t){if(!e.src)return;let i=e.src.includes("-nocookie")?"https://www.youtube-nocookie.com/embed":"https://www.youtube.com/embed",s={controls:""===e.controls?null:0,autoplay:e.autoplay,loop:e.loop,mute:e.muted,playsinline:e.playsinline,preload:e.preload??"metadata",enablejsapi:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1,...t.config};if(n.test(e.src)){let t=e.src.match(n),l=t&&t[1];return`${i}/${l}?${h(s)}`}let a=e.src.match(l),o={listType:"playlist",list:a&&a[1],...s};return`${i}?${h(o)}`}class r extends(globalThis.HTMLElement??class{}){static getTemplateHTML=a;static shadowRootOptions={mode:"open"};static observedAttributes=["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src"];loadComplete=new v;#e;#t;#i=0;#s=!1;#n;isLoaded=!1;#l=null;#a=null;constructor(){super(),this.#o("config")}get config(){return this.#a}set config(e){this.#a=e}async load(){let e;if(this.#e)return;this.shadowRoot||this.attachShadow({mode:"open"});let t=!this.#t;this.#t&&(this.loadComplete=new v,this.isLoaded=!1),this.#t=!0,await (this.#e=Promise.resolve()),this.#e=null,this.#i=0,this.dispatchEvent(new Event("emptied"));let i=this.api;if(this.api=null,!this.src){null==i||i.destroy();return}this.dispatchEvent(new Event("loadstart"));let s=this.shadowRoot.querySelector("iframe"),n=function(e){let t={};for(let i of e)t[i.name]=i.value;return t}(this.attributes);t&&s&&(this.#a=JSON.parse(s.getAttribute("data-config")||"{}")),(null==s?void 0:s.src)&&s.src===o(n,this)||(this.shadowRoot.innerHTML=a(n,this),s=this.shadowRoot.querySelector("iframe"));let l=await c("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady");this.api=new l.Player(s,{events:{onReady:()=>{this.#i=1,this.dispatchEvent(new Event("loadedmetadata")),this.dispatchEvent(new Event("durationchange")),this.dispatchEvent(new Event("volumechange")),this.dispatchEvent(new Event("loadcomplete")),this.isLoaded=!0,this.loadComplete.resolve()},onError:e=>{console.error(e),this.#l={code:e.data,message:`YouTube iframe player error #${e.data}; visit https://developers.google.com/youtube/iframe_api_reference#onError for the full error message.`},this.dispatchEvent(new Event("error"))}}});let r=!1;this.api.addEventListener("onStateChange",e=>{var t;let i=e.data;if(i!==l.PlayerState.PLAYING&&i!==l.PlayerState.BUFFERING||r||(r=!0,this.dispatchEvent(new Event("play"))),i===l.PlayerState.PLAYING)this.seeking&&(this.#s=!1,null==(t=this.#n)||t.resolve(),this.dispatchEvent(new Event("seeked"))),this.#i=3,this.dispatchEvent(new Event("playing"));else if(i===l.PlayerState.PAUSED){let e=Math.abs(this.currentTime-u);!this.seeking&&e>.1&&(this.#s=!0,this.dispatchEvent(new Event("seeking"))),r=!1,this.dispatchEvent(new Event("pause"))}i===l.PlayerState.ENDED&&(r=!1,this.dispatchEvent(new Event("pause")),this.dispatchEvent(new Event("ended")),this.loop&&this.play())}),this.api.addEventListener("onPlaybackRateChange",()=>{this.dispatchEvent(new Event("ratechange"))}),this.api.addEventListener("onVolumeChange",()=>{this.dispatchEvent(new Event("volumechange"))}),this.api.addEventListener("onVideoProgress",()=>{this.dispatchEvent(new Event("timeupdate"))}),await this.loadComplete;let u=0;setInterval(()=>{var e;let t=Math.abs(this.currentTime-u),i=this.buffered.end(this.buffered.length-1);this.seeking&&i>.1?(this.#s=!1,null==(e=this.#n)||e.resolve(),this.dispatchEvent(new Event("seeked"))):!this.seeking&&t>.1&&(this.#s=!0,this.dispatchEvent(new Event("seeking"))),u=this.currentTime},50);let h=setInterval(()=>{let t=this.buffered.end(this.buffered.length-1);t>=this.duration&&(clearInterval(h),this.#i=4),e!=t&&(e=t,this.dispatchEvent(new Event("progress")))},100)}async attributeChangedCallback(e,t,i){if(t!==i)switch(e){case"src":case"autoplay":case"controls":case"loop":case"playsinline":this.load()}}async play(){var e,t,i;return this.#n=null,await this.loadComplete,null==(e=this.api)||e.playVideo(),t=this,(i=(e,i)=>{let s;t.addEventListener(e,s=()=>{t.removeEventListener(e,s),i()})},(...e)=>new Promise(t=>{i(...e,(...e)=>{e.length>1?t(e):t(e[0])})}))("playing")}async pause(){var e;return await this.loadComplete,null==(e=this.api)?void 0:e.pauseVideo()}get seeking(){return this.#s}get readyState(){return this.#i}get src(){return this.getAttribute("src")}set src(e){this.src!=e&&this.setAttribute("src",e)}get error(){return this.#l}get paused(){var e,t;return this.isLoaded?[-1,0,2,5].includes(null==(t=null==(e=this.api)?void 0:e.getPlayerState)?void 0:t.call(e)):!this.autoplay}get duration(){var e,t;return(null==(t=null==(e=this.api)?void 0:e.getDuration)?void 0:t.call(e))??NaN}get autoplay(){return this.hasAttribute("autoplay")}set autoplay(e){this.autoplay!=e&&this.toggleAttribute("autoplay",!!e)}get buffered(){var e,t;if(!this.isLoaded)return f();let i=(null==(e=this.api)?void 0:e.getVideoLoadedFraction())*(null==(t=this.api)?void 0:t.getDuration());return i>0?f(0,i):f()}get controls(){return this.hasAttribute("controls")}set controls(e){this.controls!=e&&this.toggleAttribute("controls",!!e)}get currentTime(){var e,t;return(null==(t=null==(e=this.api)?void 0:e.getCurrentTime)?void 0:t.call(e))??0}set currentTime(e){this.currentTime!=e&&(this.#n=new v,this.loadComplete.then(()=>{var t,i;null==(t=this.api)||t.seekTo(e,!0),this.paused&&(null==(i=this.#n)||i.then(()=>{var e;this.#n&&(null==(e=this.api)||e.pauseVideo())}))}))}set defaultMuted(e){this.defaultMuted!=e&&this.toggleAttribute("muted",!!e)}get defaultMuted(){return this.hasAttribute("muted")}get loop(){return this.hasAttribute("loop")}set loop(e){this.loop!=e&&this.toggleAttribute("loop",!!e)}set muted(e){this.muted!=e&&this.loadComplete.then(()=>{var t,i;e?null==(t=this.api)||t.mute():null==(i=this.api)||i.unMute()})}get muted(){var e,t;return this.isLoaded?null==(t=null==(e=this.api)?void 0:e.isMuted)?void 0:t.call(e):this.defaultMuted}get playbackRate(){var e,t;return(null==(t=null==(e=this.api)?void 0:e.getPlaybackRate)?void 0:t.call(e))??1}set playbackRate(e){this.playbackRate!=e&&this.loadComplete.then(()=>{var t;null==(t=this.api)||t.setPlaybackRate(e)})}get playsInline(){return this.hasAttribute("playsinline")}set playsInline(e){this.playsInline!=e&&this.toggleAttribute("playsinline",!!e)}get poster(){return this.getAttribute("poster")}set poster(e){this.poster!=e&&this.setAttribute("poster",`${e}`)}set volume(e){this.volume!=e&&this.loadComplete.then(()=>{var t;null==(t=this.api)||t.setVolume(100*e)})}get volume(){var e;return this.isLoaded?(null==(e=this.api)?void 0:e.getVolume())/100:1}#o(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}}function u(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/`/g,"&#x60;")}function h(e){return String(new URLSearchParams(function(e){let t={};for(let i in e){let s=e[i];!0===s||""===s?t[i]=1:!1===s?t[i]=0:null!=s&&(t[i]=s)}return t}(e)))}let d={};async function c(e,t,i){return d[e]?d[e]:t&&self[t]?(await p(0),self[t]):d[e]=new Promise(function(s,n){let l=document.createElement("script");l.src=e;let a=()=>s(self[t]);i&&(self[i]=a),l.onload=()=>!i&&a(),l.onerror=n,document.head.append(l)})}let p=e=>new Promise(t=>setTimeout(t,e));class v extends Promise{constructor(e=()=>{}){let t,i;super((s,n)=>{e(s,n),t=s,i=n}),this.resolve=t,this.reject=i}}function f(e,t){return Array.isArray(e)?g(e):null==e||null==t||0===e&&0===t?g([[0,0]]):g([[e,t]])}function g(e){return Object.defineProperties(e,{start:{value:t=>e[t][0]},end:{value:t=>e[t][1]}}),e}globalThis.customElements&&!globalThis.customElements.get("youtube-video")&&globalThis.customElements.define("youtube-video",r);var m=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),y={className:"class",htmlFor:"for"};function w(e){return e.toLowerCase()}function b(e){return"boolean"==typeof e?e?"":void 0:"function"==typeof e?void 0:"object"!=typeof e||null===e?e:void 0}function E(e,t,i){var s,n;e[t]=i,null==i&&t in(null!=(n=null==(s=globalThis.HTMLElement)?void 0:s.prototype)?n:{})&&e.removeAttribute(t)}var k=function(e){let{react:t,tagName:i,elementClass:s,events:n,displayName:l,defaultProps:a,toAttributeName:o=w,toAttributeValue:r=b}=e,u=Number.parseInt(t.version)>=19,h=t.forwardRef((e,l)=>{var h,d,c,p,v;let f=t.useRef(null),g=t.useRef(new Map),w={},k={},L={},C={};for(let[t,i]of Object.entries(e)){if(m.has(t)){L[t]=i;continue}let e=o(null!=(c=y[t])?c:t);if(t in s.prototype&&!(t in(null!=(p=null==(h=globalThis.HTMLElement)?void 0:h.prototype)?p:{}))&&!(null==(d=s.observedAttributes)?void 0:d.some(t=>t===e))){C[t]=i;continue}if(t.startsWith("on")){w[t]=i;continue}let n=r(i);e&&null!=n&&(k[e]=String(n),u||(L[e]=n)),e&&u&&(n!==b(i)?L[e]=n:L[e]=i)}if("undefined"!=typeof window){for(let e in w){let i=w[e],s=e.endsWith("Capture"),l=(null!=(v=null==n?void 0:n[e])?v:e.slice(2).toLowerCase()).slice(0,s?-7:void 0);t.useLayoutEffect(()=>{let e=null==f?void 0:f.current;if(e&&"function"==typeof i)return e.addEventListener(l,i,s),()=>{e.removeEventListener(l,i,s)}},[null==f?void 0:f.current,i])}t.useLayoutEffect(()=>{if(null===f.current)return;let e=new Map;for(let t in C)E(f.current,t,C[t]),g.current.delete(t),e.set(t,C[t]);for(let[e,t]of g.current)E(f.current,e,void 0);g.current=e})}if("undefined"==typeof window&&(null==s?void 0:s.getTemplateHTML)&&(null==s?void 0:s.shadowRootOptions)){let{mode:i,delegatesFocus:n}=s.shadowRootOptions;L.children=[t.createElement("template",{shadowrootmode:i,shadowrootdelegatesfocus:n,dangerouslySetInnerHTML:{__html:s.getTemplateHTML(k,e)}}),L.children]}return t.createElement(i,{...a,...L,ref:t.useCallback(e=>{f.current=e,"function"==typeof l?l(e):null!==l&&(l.current=e)},[l])})});return h.displayName=null!=l?l:s.name,h}({react:s,tagName:"youtube-video",elementClass:r})}}]);