import{n as e,t}from"./proxy-6KS6wy69.js";function n(t,n){class r extends t{#e=new n;get(e){return e in this.#e?this.#e[e]:super.get?.(e)}set(e,t){if(e in this.#e){this.#e[e]=t;return}super.set?.(e,t)}call(e,...t){return e in this.#e?this.#e[e](...t):super.call?.(e,...t)}attach(e){super.attach?.(e),this.#e.attach?.(e)}detach(){this.#e.detach?.(),super.detach?.()}}for(let t=n.prototype;t&&t!==Object.prototype;t=Object.getPrototypeOf(t))e(r,t);return r}const r=`abort.canplay.canplaythrough.durationchange.emptied.encrypted.ended.error.loadeddata.loadedmetadata.loadstart.pause.play.playing.progress.ratechange.seeked.seeking.stalled.suspend.timeupdate.volumechange.waiting.waitingforkey.resize.enterpictureinpicture.leavepictureinpicture.webkitbeginfullscreen.webkitendfullscreen.webkitpresentationmodechanged`.split(`.`),i=[`autopictureinpicture`,`disablepictureinpicture`,`disableremoteplayback`,`autoplay`,`controls`,`controlslist`,`crossorigin`,`loop`,`muted`,`playsinline`,`poster`,`preload`,`src`];function a(e){return`
    <style>
      :host {
        display: inline-flex;
        line-height: 0;
        flex-direction: column;
        justify-content: end;
      }

      audio {
        width: 100%;
      }
    </style>
    <slot name="media">
      <audio${l(e)}></audio>
    </slot>
    <slot></slot>
  `}function o(e){return`
    <style>
      :host {
        display: contents;
      }

      video {
        display: block;
        width: 100%;
        height: 100%;
        border-radius: var(--media-video-border-radius);
        object-fit: var(--media-object-fit, contain);
        object-position: var(--media-object-position, center);
      }

      video::-webkit-media-text-track-container {
        transition: translate var(--media-caption-track-duration, 0) ease-out;
        transition-delay: var(--media-caption-track-delay, 0);
        translate: 0 var(--media-caption-track-y, 0);
        scale: 0.98;
        z-index: 1;
        font-family: inherit;
      }
    </style>
    <slot name="media">
      <video${l(e)}></video>
    </slot>
    <slot></slot>
  `}function s(e,{tag:t,is:n}){let s=globalThis.document?.createElement?.(t,{is:n}),l=s?c(s):[];return class c extends e{static getTemplateHTML=t.endsWith(`audio`)?a:o;static shadowRootOptions={mode:`open`};static Events=r;static#e=!1;static#t;static get observedAttributes(){return c.#n(),[...s?.constructor?.observedAttributes??[],...i]}static#n(){if(!c.#e){c.#e=!0,c.#t=new Set(c.observedAttributes),c.#t.delete(`muted`);for(let e of l)if(!(e in c.prototype))if(typeof s[e]==`function`)c.prototype[e]=function(...t){return this.#s(),this.call(e,...t)};else{let t={get(){return this.#s(),this.get(e)}};e!==e.toUpperCase()&&(t.set=function(t){this.#s(),this.set(e,t)}),Object.defineProperty(c.prototype,e,t)}}}#r=!1;#i=null;#a=new Map;#o;get(e){let t=e.toLowerCase();if(c.#t.has(t)){let e=this.getAttribute(t);return e===null?!1:e===``?!0:e}return this.target?.[e]}set(e,t){let n=e.toLowerCase();if(c.#t.has(n)){t===!0||t===!1||t==null?this.toggleAttribute(n,!!t):this.setAttribute(n,t);return}this.target&&(this.target[e]=t)}call(e,...t){return(this.target?.[e])?.apply(this.target,t)}get target(){return this.#s(),this.#i??this.querySelector(`:scope > [slot=media]`)??this.querySelector(t)??this.shadowRoot?.querySelector(t)??null}set target(e){this.#i=e}get defaultMuted(){return this.#s(),this.get(`muted`)}set defaultMuted(e){this.#s(),this.set(`muted`,e)}#s(){this.#r||(this.#r=!0,this.init())}init(){if(!this.shadowRoot){this.attachShadow({mode:`open`});let e=u(this.attributes);n&&(e.is=n),t&&(e.part=t),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.target.muted=this.hasAttribute(`muted`);for(let e of l)this.#d(e);this.#o=new MutationObserver(this.#l.bind(this)),this.shadowRoot.addEventListener(`slotchange`,()=>this.#c()),this.#c();for(let e of this.constructor.Events)this.shadowRoot.addEventListener(e,this,!0)}handleEvent(e){e.target===this.target&&this.dispatchEvent(new CustomEvent(e.type,{detail:e.detail}))}#c(){let e=new Map(this.#a);((this.shadowRoot?.querySelector(`slot:not([name])`))?.assignedElements({flatten:!0}).filter(e=>[`track`,`source`].includes(e.localName))).forEach(t=>{e.delete(t);let n=this.#a.get(t);n||(n=t.cloneNode(),this.#a.set(t,n),this.#o?.observe(t,{attributes:!0})),this.target?.append(n),this.#u(n)}),e.forEach((e,t)=>{e.remove(),this.#a.delete(t)})}#l(e){for(let t of e)if(t.type===`attributes`){let{target:e,attributeName:n}=t,r=this.#a.get(e);r&&n&&(r.setAttribute(n,e.getAttribute(n)??``),this.#u(r))}}#u(e){e&&e.localName===`track`&&e.default&&(e.kind===`chapters`||e.kind===`metadata`)&&e.track.mode===`disabled`&&(e.track.mode=`hidden`)}#d(e){if(Object.hasOwn(this,e)){let t=this[e];delete this[e],this[e]=t}}attributeChangedCallback(e,t,n){this.#s(),this.#f(e,t,n)}#f(e,t,n){[`id`,`class`].includes(e)||!c.observedAttributes.includes(e)&&this.constructor.observedAttributes.includes(e)||(n===null?this.target?.removeAttribute(e):this.target?.getAttribute(e)!==n&&this.target?.setAttribute(e,n))}connectedCallback(){this.#s()}}}function c(e){let t=[];for(let n=Object.getPrototypeOf(e);n&&n!==HTMLElement.prototype;n=Object.getPrototypeOf(n)){let e=Object.getOwnPropertyNames(n);t.push(...e)}return t}function l(e){let t=``;for(let n in e){if(!i.includes(n))continue;let r=e[n];r===``?t+=` ${n}`:t+=` ${n}="${r}"`}return t}function u(e){let t={};for(let n of e)t[n.name]=n.value;return t}s(globalThis.HTMLElement??class{},{tag:`video`}),s(globalThis.HTMLElement??class{},{tag:`audio`}),t(globalThis.HTMLVideoElement??class{},globalThis.HTMLMediaElement??class{},globalThis.EventTarget??class{});export{n,s as t};
//# sourceMappingURL=proxy-2oO2ph3m.js.map