@aidenlx/player
Version:
Headless web components that make integrating media on the a web a breeze.
4 lines (3 loc) • 35.4 kB
JavaScript
var Xe=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var Ut=(t,e,n,r)=>{for(var i=r>1?void 0:r?et(e,n):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=(r?o(e,n,i):o(i))||i);return r&&i&&Xe(e,n,i),i};var Z,k=globalThis.trustedTypes,we=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,S=`lit$${(Math.random()+"").slice(9)}$`,Y="?"+S,tt=`<${Y}>`,I=document,j=(t="")=>I.createComment(t),B=t=>t===null||typeof t!="object"&&typeof t!="function",Te=Array.isArray,Ae=t=>{var e;return Te(t)||typeof((e=t)===null||e===void 0?void 0:e[Symbol.iterator])=="function"},z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Se=/-->/g,Ee=/>/g,x=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,Ce=/'/g,Pe=/"/g,Ne=/^(?:script|style|textarea|title)$/i,Fe=t=>(e,...n)=>({ve:t,strings:e,values:n}),Dt=Fe(1),qt=Fe(2),O=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),xe=new WeakMap,Re=(t,e,n)=>{var r,i;let s=(r=n?.renderBefore)!==null&&r!==void 0?r:e,o=s.Pi;if(o===void 0){let c=(i=n?.renderBefore)!==null&&i!==void 0?i:null;s.Pi=o=new A(e.insertBefore(j(),c),c,void 0,n??{})}return o.w(t),o},L=I.createTreeWalker(I,129,null,!1),$e=(t,e)=>{let n=t.length-1,r=[],i,s=e===2?"<svg>":"",o=z;for(let l=0;l<n;l++){let a=t[l],d,u,h=-1,p=0;for(;p<a.length&&(o.lastIndex=p,u=o.exec(a),u!==null);)p=o.lastIndex,o===z?u[1]==="!--"?o=Se:u[1]!==void 0?o=Ee:u[2]!==void 0?(Ne.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=x):u[3]!==void 0&&(o=x):o===x?u[0]===">"?(o=i??z,h=-1):u[1]===void 0?h=-2:(h=o.lastIndex-u[2].length,d=u[1],o=u[3]===void 0?x:u[3]==='"'?Pe:Ce):o===Pe||o===Ce?o=x:o===Se||o===Ee?o=z:(o=x,i=void 0);let w=o===x&&t[l+1].startsWith("/>")?" ":"";s+=o===z?a+tt:h>=0?(r.push(d),a.slice(0,h)+"$lit$"+a.slice(h)+S+w):a+S+(h===-2?(r.push(void 0),l):w)}let c=s+(t[n]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[we!==void 0?we.createHTML(c):c,r]},U=class{constructor({strings:e,ve:n},r){let i;this.parts=[];let s=0,o=0,c=e.length-1,l=this.parts,[a,d]=$e(e,n);if(this.el=U.createElement(a,r),L.currentNode=this.el.content,n===2){let u=this.el.content,h=u.firstChild;h.remove(),u.append(...h.childNodes)}for(;(i=L.nextNode())!==null&&l.length<c;){if(i.nodeType===1){if(i.hasAttributes()){let u=[];for(let h of i.getAttributeNames())if(h.endsWith("$lit$")||h.startsWith(S)){let p=d[o++];if(u.push(h),p!==void 0){let w=i.getAttribute(p.toLowerCase()+"$lit$").split(S),$=/([.?@])?(.*)/.exec(p);l.push({type:1,index:s,name:$[2],strings:w,ctor:$[1]==="."?ee:$[1]==="?"?te:$[1]==="@"?ne:M})}else l.push({type:6,index:s})}for(let h of u)i.removeAttribute(h)}if(Ne.test(i.tagName)){let u=i.textContent.split(S),h=u.length-1;if(h>0){i.textContent=k?k.emptyScript:"";for(let p=0;p<h;p++)i.append(u[p],j()),L.nextNode(),l.push({type:2,index:++s});i.append(u[h],j())}}}else if(i.nodeType===8)if(i.data===Y)l.push({type:2,index:s});else{let u=-1;for(;(u=i.data.indexOf(S,u+1))!==-1;)l.push({type:7,index:s}),u+=S.length-1}s++}}static createElement(e,n){let r=I.createElement("template");return r.innerHTML=e,r}};function T(t,e,n=t,r){var i,s,o,c;if(e===O)return e;let l=r!==void 0?(i=n.er)===null||i===void 0?void 0:i[r]:n.Li,a=B(e)?void 0:e.nt;return l?.constructor!==a&&((s=l?.tr)===null||s===void 0||s.call(l,!1),a===void 0?l=void 0:(l=new a(t),l.at(t,n,r)),r!==void 0?((o=(c=n).er)!==null&&o!==void 0?o:c.er=[])[r]=l:n.Li=l),l!==void 0&&(e=T(t,l.Mi(t,e.values),l,r)),e}var X=class{constructor(e,n){this.v=[],this.x=void 0,this.rr=e,this.a=n}get parentNode(){return this.a.parentNode}get g(){return this.a.g}p(e){var n;let{el:{content:r},parts:i}=this.rr,s=((n=e?.creationScope)!==null&&n!==void 0?n:I).importNode(r,!0);L.currentNode=s;let o=L.nextNode(),c=0,l=0,a=i[0];for(;a!==void 0;){if(c===a.index){let d;a.type===2?d=new A(o,o.nextSibling,this,e):a.type===1?d=new a.ctor(o,a.name,a.strings,this,e):a.type===6&&(d=new re(o,this,e)),this.v.push(d),a=i[++l]}c!==a?.index&&(o=L.nextNode(),c++)}return s}m(e){let n=0;for(let r of this.v)r!==void 0&&(r.strings!==void 0?(r.w(e,r,n),n+=r.strings.length-2):r.w(e[n])),n++}},A=class{constructor(e,n,r,i){var s;this.type=2,this.s=f,this.x=void 0,this.q=e,this.X=n,this.a=r,this.options=i,this.ir=(s=i?.isConnected)===null||s===void 0||s}get g(){var e,n;return(n=(e=this.a)===null||e===void 0?void 0:e.g)!==null&&n!==void 0?n:this.ir}get parentNode(){let e=this.q.parentNode,n=this.a;return n!==void 0&&e.nodeType===11&&(e=n.parentNode),e}get startNode(){return this.q}get endNode(){return this.X}w(e,n=this){e=T(this,e,n),B(e)?e===f||e==null||e===""?(this.s!==f&&this.fe(),this.s=f):e!==this.s&&e!==O&&this.$(e):e.ve!==void 0?this.T(e):e.nodeType!==void 0?this.k(e):Ae(e)?this.S(e):this.$(e)}A(e,n=this.X){return this.q.parentNode.insertBefore(e,n)}k(e){this.s!==e&&(this.fe(),this.s=this.A(e))}$(e){this.s!==f&&B(this.s)?this.q.nextSibling.data=e:this.k(I.createTextNode(e)),this.s=e}T(e){var n;let{values:r,ve:i}=e,s=typeof i=="number"?this.Ti(e):(i.el===void 0&&(i.el=U.createElement(i.h,this.options)),i);if(((n=this.s)===null||n===void 0?void 0:n.rr)===s)this.s.m(r);else{let o=new X(s,this),c=o.p(this.options);o.m(r),this.k(c),this.s=o}}Ti(e){let n=xe.get(e.strings);return n===void 0&&xe.set(e.strings,n=new U(e)),n}S(e){Te(this.s)||(this.s=[],this.fe());let n=this.s,r,i=0;for(let s of e)i===n.length?n.push(r=new A(this.A(j()),this.A(j()),this,this.options)):r=n[i],r.w(s),i++;i<n.length&&(this.fe(r&&r.X.nextSibling,i),n.length=i)}fe(e=this.q.nextSibling,n){var r;for((r=this.ae)===null||r===void 0||r.call(this,!1,!0,n);e&&e!==this.X;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var n;this.a===void 0&&(this.ir=e,(n=this.ae)===null||n===void 0||n.call(this,e))}},M=class{constructor(e,n,r,i,s){this.type=1,this.s=f,this.x=void 0,this.element=e,this.name=n,this.a=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this.s=Array(r.length-1).fill(new String),this.strings=r):this.s=f}get tagName(){return this.element.tagName}get g(){return this.a.g}w(e,n=this,r,i){let s=this.strings,o=!1;if(s===void 0)e=T(this,e,n,0),o=!B(e)||e!==this.s&&e!==O,o&&(this.s=e);else{let c=e,l,a;for(e=s[0],l=0;l<s.length-1;l++)a=T(this,c[r+l],n,l),a===O&&(a=this.s[l]),o||(o=!B(a)||a!==this.s[l]),a===f?e=f:e!==f&&(e+=(a??"")+s[l+1]),this.s[l]=a}o&&!i&&this.C(e)}C(e){e===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ee=class extends M{constructor(){super(...arguments),this.type=3}C(e){this.element[this.name]=e===f?void 0:e}},nt=k?k.emptyScript:"",te=class extends M{constructor(){super(...arguments),this.type=4}C(e){e&&e!==f?this.element.setAttribute(this.name,nt):this.element.removeAttribute(this.name)}},ne=class extends M{constructor(e,n,r,i,s){super(e,n,r,i,s),this.type=5}w(e,n=this){var r;if((e=(r=T(this,e,n,0))!==null&&r!==void 0?r:f)===O)return;let i=this.s,s=e===f&&i!==f||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==f&&(i===f||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this.s=e}handleEvent(e){var n,r;typeof this.s=="function"?this.s.call((r=(n=this.options)===null||n===void 0?void 0:n.host)!==null&&r!==void 0?r:this.element,e):this.s.handleEvent(e)}},re=class{constructor(e,n,r){this.element=e,this.type=6,this.x=void 0,this.a=n,this.options=r}get g(){return this.a.g}w(e){T(this,e)}},zt={P:"$lit$",L:S,V:Y,I:1,N:$e,R:X,D:Ae,j:T,H:A,O:M,F:te,B:ne,W:ee,Z:re},Oe=window.litHtmlPolyfillSupport;Oe?.(U,A),((Z=globalThis.litHtmlVersions)!==null&&Z!==void 0?Z:globalThis.litHtmlVersions=[]).push("2.2.0");var _=t=>t??f;function F(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function de(t,e){return e.some(n=>t?.type.includes(n)??!1)}function Wt(t){return de(t,["pointer"])}function Qt(t){return de(t,["touch"])}function Gt(t){return de(t,["click","mouse"])}var R=class{constructor(){this.i=this.i??[]}add(...t){t&&t.forEach(e=>{this.i.push(e)})}empty(){this.i.forEach(t=>t()),this.i=[]}};function ie(t,e,n,r){let i;function s(){i||(i=F(r?.target??t,e,n,r))}s(),t.addController({hostConnected(){s()},hostDisconnected(){i?.(),i=void 0}})}var qe=class extends CustomEvent{get originEvent(){return H(this)??this}get isOriginTrusted(){return this.originEvent?.isTrusted??!1}constructor(t,e={}){super(t,e);this.triggerEvent=e.triggerEvent,this.hasOwnProperty("originEvent")||Object.defineProperties(this,{originEvent:{get(){return H(this)??this}},isOriginTrusted:{get(){return H(this)?.isTrusted??!1}}})}};function C(t,e={}){return new qe(t,e)}function H(t){let e=t.triggerEvent;for(;e&&e.triggerEvent;)e=e.triggerEvent;return e}function Jt(t,e){(H(t)??t).triggerEvent=e}function Kt(t,e){if(e.bubbles&&e.composed)return;let n=new qe(e.type,{triggerEvent:e.triggerEvent??e,detail:e.detail,bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed});t.dispatchEvent(n)}var rt=class{constructor(t,e,n){this.e=t,this.initialValue=e,this.dt=n,t.addController({hostConnected:this.ki.bind(this),hostDisconnected:()=>{delete this.e[this.id]}})}get id(){return this.dt.id}get value(){return this.e[this.id]??this.initialValue}ki(){this.id in this.e||this.e.dispatchEvent(C("vds-context-consumer-connect",{bubbles:!0,composed:!0,detail:{id:this.id,setValue:t=>{this.e[this.id]=t}}}))}},it=class{constructor(t,e,n){this.e=t,this.un=e,this.dt=n,this.sr=new R,this.nr=e(),t.addController({hostConnected:this.start.bind(this),hostDisconnected:this.stop.bind(this)})}get id(){return this.dt.id}get value(){return this.nr}start(){let t=F(this.e,"vds-context-consumer-connect",this.Hi.bind(this));this.sr.add(t)}stop(){this.sr.empty()}Hi(t){let e=t.detail;e.id===this.id&&(t.stopImmediatePropagation(),e.setValue(this.nr))}};function Zt(t){let e=Symbol("@vidstack/context");return{id:e,consume(n){return new rt(n,t(),{id:e})},provide(n){return new it(n,t,{id:e})}}}function ze(t){return typeof t?.id=="symbol"&&t.id.description==="@vidstack/context"}function Xt(t){return _(t===""||t==="undefined"?void 0:t)}function E(...t){}function tn(t,e){return e!==t&&(e===e||t===t)}function st(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function he(t){return t===null}function m(t){return typeof t>"u"}function je(t){return he(t)||m(t)}function ot(t){return t?.constructor===Object}function lt(t){return typeof t=="number"&&!Number.isNaN(t)}function Be(t){return typeof t=="string"}function q(t){return typeof t=="function"}function nn(t){return Array.isArray(t)}function rn(t){return _(lt(t)?t:void 0)}function sn(t,e){let n=new R;t.addController({hostConnected(){let r=C(e,{bubbles:!0,composed:!0,detail:{element:t,onDisconnect:i=>{n.add(i)}}});t.dispatchEvent(r)},hostDisconnected(){n.empty()}})}var y=typeof window<"u",Q=y?window.navigator?.userAgent.toLowerCase():"",at=/iphone|ipad|ipod|ios|CriOS|FxiOS/.test(Q),on=/android/.test(Q);var ln=y&&/(iPhone|iPod)/gi.test(window.navigator?.platform),an=/firefox/.test(Q),ct=y&&!!window.chrome,cn=y&&!ct&&(window.safari||at||/(apple|safari)/.test(Q)),un=y&&window.location.protocol!=="file:"?`${window.location.protocol}//${window.location.hostname}`:void 0;function ut(){return y&&!m(screen.orientation)&&q(screen.orientation.lock)&&q(screen.orientation.unlock)}function dt(){return window?.MediaSource??window?.WebKitMediaSource}function ht(){return window?.SourceBuffer??window?.WebKitSourceBuffer}function dn(){let t=dt();if(m(t))return!1;let e=t&&q(t.isTypeSupported)&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=ht(),r=m(n)||!m(n.prototype)&&q(n.prototype.appendBuffer)&&q(n.prototype.remove);return!!e&&!!r}var hn=`
${["a[href]","area[href]","input:not([disabled]):not([tabindex='-1'])","button:not([disabled]):not([tabindex='-1'])","select:not([disabled]):not([tabindex='-1'])","textarea:not([disabled]):not([tabindex='-1'])","iframe","object","embed","*[tabindex]:not([tabindex='-1'])","*[contenteditable=true]","vds-fullscreen-button","vds-mute-button","vds-play-button","vds-slider","vds-time-slider","vds-volume-slider"].join(", ")}
`;var v={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},Le=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],ke=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],Ie=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],g=typeof window<"u"&&typeof window.document<"u"?window.document:{},b="fullscreenEnabled"in g&&Object.keys(v)||Le[0]in g&&Le||ke[0]in g&&ke||Ie[0]in g&&Ie||[],ft={requestFullscreen:function(t){return t[b[v.requestFullscreen]]()},requestFullscreenFunction:function(t){return t[b[v.requestFullscreen]]},get exitFullscreen(){return g[b[v.exitFullscreen]].bind(g)},get fullscreenPseudoClass(){return":"+b[v.fullscreen]},addEventListener:function(t,e,n){return g.addEventListener(b[v[t]],e,n)},removeEventListener:function(t,e,n){return g.removeEventListener(b[v[t]],e,n)},get fullscreenEnabled(){return Boolean(g[b[v.fullscreenEnabled]])},set fullscreenEnabled(t){},get fullscreenElement(){return g[b[v.fullscreenElement]]},set fullscreenElement(t){},get onfullscreenchange(){return g[("on"+b[v.fullscreenchange]).toLowerCase()]},set onfullscreenchange(t){return g[("on"+b[v.fullscreenchange]).toLowerCase()]=t},get onfullscreenerror(){return g[("on"+b[v.fullscreenerror]).toLowerCase()]},set onfullscreenerror(t){return g[("on"+b[v.fullscreenerror]).toLowerCase()]=t}},N=ft;function pt(t,...e){return C("vds-log",{bubbles:!0,composed:!0,detail:{level:t,data:e}})}var Ve=Symbol("@vidstack/grouped-log");function se(t){return ot(t)&&t[Ve]===!0}function _e(t,e){let n=[],r={[Ve]:!0,title:t,logs:n,log(...i){return n.push({data:i}),r},labelledLog(i,...s){return n.push({label:i,data:s}),r},groupStart(i){return _e(i,r)},groupEnd(){return e?.logs.push(r),e??r}};return r}var He="@vidstack/log-colors",W=gt();function gt(){if(y&&!m(window.localStorage)){let t={};try{t=JSON.parse(localStorage.getItem(He)??"")}catch{}return new Map(Object.entries(t))}return new Map}function vt(t){return W.get(t)}function mt(t,{color:e=bt(),overwrite:n=!1}={}){(!W.has(t)||n)&&(W.set(t,e),yt())}function bt(){return`hsl(${Math.random()*360}, 55%, 70%)`}function yt(){if(y&&!m(window.localStorage)){let t={};W.forEach(function(e,n){t[n]=e}),localStorage.setItem(He,JSON.stringify(t))}}var Ue=Object.freeze({silent:0,error:1,warn:2,info:3,debug:4}),wt=Object.freeze({silent:"white",error:"hsl(6, 58%, 50%)",warn:"hsl(51, 58%, 50%)",info:"hsl(219, 58%, 50%)",debug:"hsl(280, 58%, 50%)"});function St(t,e=2){return Number(t.toFixed(e))}function fn(t,e,n){return Math.max(t,Math.min(n,e))}function pn(t){return String(t).split(".")[1]?.length??0}var le=1e3,ae=le*60,ce=ae*60,Me=ce*24;function Et(t){let e=Math.abs(t);return e>=Me?Math.round(t/Me)+"d":e>=ce?Math.round(t/ce)+"h":e>=ae?Math.round(t/ae)+"m":e>=le?Math.round(t/le)+"s":St(t,2)+"ms"}var gn=class{constructor(t){this.e=t,this.logLevel="silent",this.i=new R,t.addController({hostConnected:this._i.bind(this),hostDisconnected:this.Ri.bind(this)})}_i(){this.i.add(F(this.e,"vds-log",t=>{t.stopPropagation();let e=(t.path?.[0]??t.target).tagName.toLowerCase(),{level:n="warn",data:r}=t.detail;if(Ue[this.logLevel]<Ue[n])return;mt(e);let i=r?.length===1&&se(r[0])?r[0].title:Be(r?.[0])?r[0]:"";console.groupCollapsed(`%c${n.toUpperCase()}%c ${e}%c ${i.slice(0,50)}${i.length>50?"...":""}`,`background: ${wt[n]}; color: white; padding: 1.5px 2.2px; border-radius: 2px; font-size: 11px;`,`color: ${vt(e)}; padding: 4px 0px; font-size: 11px;`,"color: gray; font-size: 11px; padding-left: 4px;"),r?.length===1&&se(r[0])?this.or(n,r[0]):r&&this.ar(n,...r),this.Di(),this.Vi(),console.groupEnd()}))}Ri(){this.ut=void 0,this.i.empty()}or(t,e){console.groupCollapsed(e.title);for(let n of e.logs)se(n)?this.or(t,n):"label"in n&&!m(n.label)?this.dr(n.label,...n.data):this.ar(t,...n.data);console.groupEnd()}ar(t,...e){console[t](...e)}dr(t,...e){console.log(`%c${t}:`,"color: gray",...e)}Vi(){console.groupCollapsed("%cStack Trace","color: gray"),console.trace(),console.groupEnd()}Di(){this.dr("Time since last log",this.Ai())}Ai(){let t=performance.now(),e=t-(this.ut||(this.ut=performance.now()));return this.ut=t,Et(e)}},vn=class{constructor(t){this.e=t}error(...t){this.ge("error",...t)}warn(...t){this.ge("warn",...t)}info(...t){this.ge("info",...t)}debug(...t){this.ge("debug",...t)}errorGroup(t){return this.ye("error",t)}warnGroup(t){return this.ye("warn",t)}infoGroup(t){return this.ye("info",t)}debugGroup(t){return this.ye("debug",t)}ge(t,...e){this.e.dispatchEvent(pt(t,...e))}ye(t,e,n,r){let i=_e(e,r);return i.dispatch=()=>{this.ge(t,n??i)},{...i,groupStart:s=>this.ye(t,s,n??i,i)}}};var mn=class{constructor(t,e){this.e=t,this.ct=e,this.z=void 0,this.isRequestingNativeFullscreen=!1,this.E=new R,t.addController({hostDisconnected:this.Ee.bind(this)})}async Ee(){this.isFullscreen&&await this.exitFullscreen(),this.E.empty()}get isSupported(){return this.isSupportedNatively}get isSupportedNatively(){return N.fullscreenEnabled}get isFullscreen(){return this.isNativeFullscreen}get isNativeFullscreen(){if(N.fullscreenElement===this.e)return!0;try{return this.e.matches(N.fullscreenPseudoClass)}catch{return!1}}pt(t){if(!this.isSupported)return E;let e=listen(N,"fullscreenchange",t);return()=>{e()}}mt(t){if(!this.isSupported)return E;let e=listen(N,"fullscreenerror",t);return()=>{e()}}async requestFullscreen(){if(this.isFullscreen)return;this.lr(),this.E.add(this.pt(this.vt.bind(this))),this.E.add(this.mt(this.ur.bind(this)));let t=await this.ft();return await this.qi(),t}async ft(){this.isRequestingNativeFullscreen=!0;let t=await N.requestFullscreen(this.e);return this.isRequestingNativeFullscreen=!1,t}vt(t){this.isFullscreen||this.E.empty(),this.e.dispatchEvent(C("vds-fullscreen-change",{bubbles:!0,composed:!0,detail:this.isFullscreen,triggerEvent:t}))}ur(t){this.e.dispatchEvent(C("vds-fullscreen-error",{bubbles:!0,composed:!0,triggerEvent:t}))}async exitFullscreen(){if(!this.isFullscreen)return;this.lr();let t=await this.gt();return await this.Fi(),t}async gt(){return N.exitFullscreen()}cr(){return this.ct.canOrient&&!m(this.screenOrientationLock)}async qi(){m(this.screenOrientationLock)||!this.cr()||await this.ct.lock(this.screenOrientationLock)}async Fi(){!this.cr()||await this.ct.unlock()}lr(){if(!this.isSupported)throw Error("Fullscreen API is not enabled or supported in this environment.")}},Ct=class{constructor(t){this.e=t;let e=new R,n=!1;e.add(F(document,"pointerdown",()=>{n=!1})),ie(t,"keydown",r=>{r.metaKey||r.altKey||r.ctrlKey||(n=!0)}),ie(t,"focus",r=>{n&&t.classList.add("focus-visible")}),ie(t,"blur",r=>{t.classList.remove("focus-visible")}),t.addController({hostDisconnected:()=>{e.empty()}})}};function bn(t){return new Ct(t)}var Pt=class{constructor(t,e={},n=()=>!0,r=void 0){this.e=t,this.yt=n,this.z=r,this.Et=!1,this.bt=!1;let{target:i,skipInitial:s,...o}=e;this.hr=i===null?i:i??this.e,this.Et=s??this.Et,window.IntersectionObserver&&(this.Fe=new IntersectionObserver(c=>{let l=this.bt;this.bt=!1,!(this.Et&&l)&&(this.handleChanges(c),this.e.requestUpdate())},o),t.addController(this))}handleChanges(t){this.value=this.yt(t,this.Fe)}hostConnected(){this.hr&&this.observe(this.hr)}hostDisconnected(){this.disconnect()}async hostUpdated(){let t=this.Fe.takeRecords();t.length&&this.handleChanges(t)}observe(t){this.Fe.observe(t),this.bt=!0}disconnect(){this.Fe.disconnect()}};function yn(...t){return new Pt(...t)}var De=typeof window<"u"&&typeof window.safari=="object"&&window?.safari.pushNotification,wn=class{constructor(t,e,n=void 0){this.e=t,this.yt=e,this.z=n,this.be=this.St(),this.Se=document.visibilityState,this.i=new R,t.addController(this)}get state(){return this.be}get visibility(){return this.Se}hostConnected(){let t=["focus","blur","visibilitychange","pageshow","pagehide"];this.be=this.St(),this.Se=document.visibilityState,t.forEach(e=>{let n=F(window,e,this.Ni.bind(this));this.i.add(n)}),De&&this.i.add(F(window,"beforeunload",e=>{this.Oi=setTimeout(()=>{e.defaultPrevented||e.returnValue.length>0||(this.be="hidden",this.Se="hidden",this.pr())},0)}))}hostDisconnected(){this.i.empty()}Ni(t){De&&window.clearTimeout(this.Oi);let e=this.be,n=this.Se;(t.type!=="blur"||this.state==="active")&&(this.be=this.St(t),this.Se=document.visibilityState=="hidden"?"hidden":"visible"),(this.state!==e||this.visibility!==n)&&this.pr()}pr(){this.yt({state:this.state,visibility:this.visibility})}St(t){return t?.type==="blur"||document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}};function ue(){let t=E,e=E;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}var xt=class{constructor(){this.Y=new Map,this.wt=ue(),this.we=!1}get isServing(){return this.we}get size(){return this.Y.size}async waitForFlush(){this.we||await this.wt.promise}async queue(t,e){if(this.we){await e();return}this.Y.set(t,e)}async serve(t){await this.Y.get(t)?.(),this.Y.delete(t)}async start(){await this.mr(),this.we=!0,this.Y.size>0&&await this.mr()}async mr(){let t=Array.from(this.Y.keys());await Promise.all(t.map(e=>this.serve(e))),this.vr()}Ui(){this.Y.clear()}vr(){this.wt.resolve(),this.wt=ue()}stop(){this.we=!1}destroy(){this.stop(),this.Ui(),this.vr()}};function Sn(t){let e=new xt;return t.addController({hostConnected:e.start.bind(e),hostDisconnected:e.destroy.bind(e)}),e}var En=class{constructor(t){this.e=t,this.Ne=!1,this.z=void 0,this.fr(),this.E=new R,t.addController({hostConnected:this.$i.bind(this),hostDisconnected:this.Ee.bind(this)})}async $i(){this.fr(),this.Ii()}async Ee(){this.canOrient&&this.Ne&&await this.unlock(),this.E.empty()}get currentOrientation(){return this.Ct}get canOrient(){return ut()}get isLocked(){return this.Ne}async lock(t){this.gr(),await screen.orientation.lock(t),this.Ne=!0,this.e.dispatchEvent(C("vds-screen-orientation-lock-change",{bubbles:!0,composed:!0,detail:t}))}async unlock(){this.gr(),await screen.orientation.unlock(),this.Ne=!1,this.e.dispatchEvent(C("vds-screen-orientation-lock-change",{bubbles:!0,composed:!0,detail:screen.orientation.type}))}Ii(){!this.canOrient||this.E.add(this.Bi())}Bi(){return F(screen.orientation,"change",this.ji.bind(this))}ji(t){this.Ct=window.screen.orientation.type,this.e.dispatchEvent(C("vds-screen-orientation-change",{bubbles:!0,composed:!0,detail:this.Ct,triggerEvent:t}))}fr(){this.Ct=y?window.screen?.orientation?.type:void 0}gr(){if(!this.canOrient)throw Error("Screen orientation API is not available.")}};function Ot(t,e,n){let r;ze(e)&&(r=e.consume(t));let i;t.addController({hostConnected(){i=(r?.value??e).subscribe(n)},hostDisconnected(){i?.()}})}function Cn(t,e,n,r){if(ze(e)){let i=e.consume(t),s;t.addController({hostConnected:()=>{s=i.value[n].subscribe(r)},hostDisconnected:()=>{s?.()}})}else return Ot(t,e[n],r)}var D=[];function Tt(t,e){return{initialValue:t,subscribe:At(t,e).subscribe}}function At(t,e=E){let n,r=new Set;function i(c){if(st(t,c)&&(t=c,n)){let l=!D.length;for(let a of r)a[1](),D.push(a,t);if(l){for(let a=0;a<D.length;a+=2)D[a][0](D[a+1]);D.length=0}}}function s(c){i(c(t))}function o(c,l=E){let a=[c,l];return r.add(a),r.size===1&&(n=e(i)||E),c(t),()=>{r.delete(a),r.size===0&&(n?.(),n=null)}}return{initialValue:t,set:i,update:s,subscribe:o}}function Pn(t,e,n){let r=!Array.isArray(t),i=r?[t]:t,s=e.length<2;return Tt(n,o=>{let c=!1,l=[],a=0,d=E,u=()=>{if(a)return;d();let p=e(r?l[0]:l,o);s?o(p):d=q(p)?p:E},h=i.map((p,w)=>p.subscribe($=>{l[w]=$,a&=~(1<<w),c&&u()},()=>{a|=1<<w}));return c=!0,u(),function(){h.forEach(w=>w()),d()}})}function xn(t){let e;return t.subscribe(n=>e=n)(),e}function On(t,e,n=y){let r=n&&!m(window.customElements.get(t));!n||r||window.customElements.define(t,e)}function Tn(t,e,n){if(je(n)||n===!1)t.removeAttribute(e);else{let r=Be(n)?n:"";t.setAttribute(e,r)}}function An(t,e,n){t.hasAttribute(e)||t.setAttribute(e,n)}function Nn(t,e,n,r="vds"){t.style.setProperty(`--${r}-${e}`,n||null)}function Fn(t,e){let n=e?`slot[name="${e}"]`:"slot:not([name])",i=t.shadowRoot?.querySelector(n)?.assignedNodes({flatten:!0})??[];return Array.prototype.filter.call(i,s=>s.nodeType==Node.ELEMENT_NODE)}function Nt(t){return t?.type.startsWith("key")??!1}function Rn(t){return Nt(t)&&(t.key==="Enter"||t.key===" ")}async function Ft(t){let e=document.querySelector(`script[src="${t}"]`);if(!he(e))return;let n=document.createElement("script"),r=ue();n.src=t,n.onload=r.resolve,n.onerror=r.reject;let i=document.getElementsByTagName("script")[0];return je(i.parentNode)||i.parentNode.insertBefore(n,i),r.promise}function $n(t,e="preconnect",n=y){if(!n)return!1;let r=document.querySelector(`link[href="${t}"]`);if(!he(r))return!0;let i=document.createElement("link");return i.rel=e,i.href=t,i.crossOrigin="true",document.head.append(i),!0}var Rt=class{static async load(t){return new Promise((e,n)=>{if(this.pendingRequests[t]){this.pendingRequests[t].push({resolve:e,reject:n});return}this.pendingRequests[t]=[{resolve:e,reject:n}],Ft(t).then(()=>{this.pendingRequests[t].forEach(r=>r.resolve()),delete this.pendingRequests[t]}).catch(r=>{this.pendingRequests[t].forEach(i=>i.reject(r)),delete this.pendingRequests[t]})})}};Rt.pendingRequests={};function Ln(t){return Object.keys(t)}function kn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function In(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function oe(t,e){let n=String(t),r=n.length;if(r<e){let s=e-r;return`${"0".repeat(s)}${t}`}return n}function We(t){let e=Math.trunc(t/3600),n=Math.trunc(t%3600/60),r=Math.trunc(t%60),i=Number((t-Math.trunc(t)).toPrecision(3));return{hours:e,minutes:n,seconds:r,fraction:i}}function Un(t,e=!1,n=!1){let{hours:r,minutes:i,seconds:s}=We(t),o=e?oe(r,2):r,c=oe(i,2),l=oe(s,2);return r>0||n?`${o}:${c}:${l}`:`${i}:${l}`}function Mn(t){let e=[],{hours:n,minutes:r,seconds:i}=We(t),s=(o,c)=>o===1?c:`${c}s`;return n>0&&e.push(`${n} ${s(n,"hour")}`),r>0&&e.push(`${r} ${s(r,"minute")}`),(i>0||e.length===0)&&e.push(`${i} ${s(i,"second")}`),e.join(", ")}var Dn=$t;function $t(t,e,n){var r=null,i=null,s=function(){r&&(clearTimeout(r),i=null,r=null)},o=function(){var l=i;s(),l&&l()},c=function(){if(!e)return t.apply(this,arguments);var l=this,a=arguments,d=n&&!r;if(s(),i=function(){t.apply(l,a)},r=setTimeout(function(){if(r=null,!d){var u=i;return i=null,u()}},e),d)return i()};return c.cancel=s,c.flush=o,c}var qn=Lt;function Lt(t,e,n){var r=null,i=null,s=n&&n.leading,o=n&&n.trailing;s==null&&(s=!0),o==null&&(o=!s),s==!0&&(o=!1);var c=function(){r&&(clearTimeout(r),r=null)},l=function(){var d=i;c(),d&&d()},a=function(){var d=s&&!r,u=this,h=arguments;if(i=function(){return t.apply(u,h)},r||(r=setTimeout(function(){if(r=null,o)return i()},e)),d)return d=!1,i()};return a.cancel=c,a.flush=l,a}function zn(t){let e,n=()=>!m(e),r=()=>{m(e)||(window.cancelAnimationFrame(e),e=void 0)};function i(...s){n()||(e=window.requestAnimationFrame(()=>{t.apply(this,s),e=void 0}))}return i.cancel=r,i.pending=n,i}var G=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fe=Symbol(),Qe=new Map,J=class{constructor(e,n){if(this.Gi=!0,n!==fe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){let e=Qe.get(this.cssText);return G&&e===void 0&&(Qe.set(this.cssText,e=new CSSStyleSheet),e.replaceSync(this.cssText)),e}toString(){return this.cssText}},Ge=t=>new J(typeof t=="string"?t:t+"",fe),kt=(t,...e)=>{let n=t.length===1?t[0]:e.reduce((r,i,s)=>r+(o=>{if(o.Gi===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new J(n,fe)},pe=(t,e)=>{G?t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet):e.forEach(n=>{let r=document.createElement("style"),i=window.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,t.appendChild(r)})},K=G?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(let r of e.cssRules)n+=r.cssText;return Ge(n)})(t):t;var ge,Je=window.trustedTypes,It=Je?Je.emptyScript:"",Ke=window.reactiveElementPolyfillSupport,me={toAttribute(t,e){switch(e){case Boolean:t=t?It:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Ze=(t,e)=>e!==t&&(e==e||t==t),ve={attribute:!0,type:String,converter:me,reflect:!1,hasChanged:Ze},P=class extends HTMLElement{constructor(){super(),this.Oe=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this.de=null,this.o()}static addInitializer(e){var n;(n=this.l)!==null&&n!==void 0||(this.l=[]),this.l.push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((n,r)=>{let i=this.yr(r,n);i!==void 0&&(this.Er.set(i,r),e.push(i))}),e}static createProperty(e,n=ve){if(n.state&&(n.attribute=!1),this.finalize(),this.elementProperties.set(e,n),!n.noAccessor&&!this.prototype.hasOwnProperty(e)){let r=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,r,n);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,n,r){return{get(){return this[n]},set(i){let s=this[e];this[n]=i,this.requestUpdate(e,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||ve}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this.Er=new Map,this.hasOwnProperty("properties")){let n=this.properties,r=[...Object.getOwnPropertyNames(n),...Object.getOwnPropertySymbols(n)];for(let i of r)this.createProperty(i,n[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let n=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)n.unshift(K(i))}else e!==void 0&&n.push(K(e));return n}static yr(e,n){let r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}o(){var e;this.xt=new Promise(n=>this.enableUpdating=n),this.le=new Map,this.zi(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0||e.forEach(n=>n(this))}addController(e){var n,r;((n=this.ee)!==null&&n!==void 0?n:this.ee=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)===null||r===void 0||r.call(e))}removeController(e){var n;(n=this.ee)===null||n===void 0||n.splice(this.ee.indexOf(e)>>>0,1)}zi(){this.constructor.elementProperties.forEach((e,n)=>{this.hasOwnProperty(n)&&(this.Oe.set(n,this[n]),delete this[n])})}createRenderRoot(){var e;let n=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return pe(n,this.constructor.elementStyles),n}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this.ee)===null||e===void 0||e.forEach(n=>{var r;return(r=n.hostConnected)===null||r===void 0?void 0:r.call(n)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this.ee)===null||e===void 0||e.forEach(n=>{var r;return(r=n.hostDisconnected)===null||r===void 0?void 0:r.call(n)})}attributeChangedCallback(e,n,r){this.Pt(e,r)}Wi(e,n,r=ve){var i,s;let o=this.constructor.yr(e,r);if(o!==void 0&&r.reflect===!0){let c=((s=(i=r.converter)===null||i===void 0?void 0:i.toAttribute)!==null&&s!==void 0?s:me.toAttribute)(n,r.type);this.de=e,c==null?this.removeAttribute(o):this.setAttribute(o,c),this.de=null}}Pt(e,n){var r,i,s;let o=this.constructor,c=o.Er.get(e);if(c!==void 0&&this.de!==c){let l=o.getPropertyOptions(c),a=l.converter,d=(s=(i=(r=a)===null||r===void 0?void 0:r.fromAttribute)!==null&&i!==void 0?i:typeof a=="function"?a:null)!==null&&s!==void 0?s:me.fromAttribute;this.de=c,this[c]=d(n,l.type),this.de=null}}requestUpdate(e,n,r){let i=!0;e!==void 0&&(((r=r||this.constructor.getPropertyOptions(e)).hasChanged||Ze)(this[e],n)?(this.le.has(e)||this.le.set(e,n),r.reflect===!0&&this.de!==e&&(this.Ce===void 0&&(this.Ce=new Map),this.Ce.set(e,r))):i=!1),!this.isUpdatePending&&i&&(this.xt=this.Ki())}async Ki(){this.isUpdatePending=!0;try{await this.xt}catch(n){Promise.reject(n)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this.Oe&&(this.Oe.forEach((i,s)=>this[s]=i),this.Oe=void 0);let n=!1,r=this.le;try{n=this.shouldUpdate(r),n?(this.willUpdate(r),(e=this.ee)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdate)===null||s===void 0?void 0:s.call(i)}),this.update(r)):this.Lt()}catch(i){throw n=!1,this.Lt(),i}n&&this.Qi(r)}willUpdate(e){}Qi(e){var n;(n=this.ee)===null||n===void 0||n.forEach(r=>{var i;return(i=r.hostUpdated)===null||i===void 0?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}Lt(){this.le=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.xt}shouldUpdate(e){return!0}update(e){this.Ce!==void 0&&(this.Ce.forEach((n,r)=>this.Wi(r,this[r],n)),this.Ce=void 0),this.Lt()}updated(e){}firstUpdated(e){}};P.finalized=!0,P.elementProperties=new Map,P.elementStyles=[],P.shadowRootOptions={mode:"open"},Ke?.({ReactiveElement:P}),((ge=globalThis.reactiveElementVersions)!==null&&ge!==void 0?ge:globalThis.reactiveElementVersions=[]).push("1.3.0");var be,ye;var V=class extends P{constructor(){super(...arguments),this.renderOptions={host:this},this.Mt=void 0}createRenderRoot(){var e,n;let r=super.createRenderRoot();return(e=(n=this.renderOptions).renderBefore)!==null&&e!==void 0||(n.renderBefore=r.firstChild),r}update(e){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.Mt=Re(n,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.Mt)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.Mt)===null||e===void 0||e.setConnected(!1)}render(){return O}};V.finalized=!0,V.cn=!0,(be=globalThis.litElementHydrateSupport)===null||be===void 0||be.call(globalThis,{LitElement:V});var Ye=globalThis.litElementPolyfillSupport;Ye?.({LitElement:V});((ye=globalThis.litElementVersions)!==null&&ye!==void 0?ye:globalThis.litElementVersions=[]).push("3.2.0");export{Ut as a,Dt as b,f as c,zt as d,_ as e,F as f,Wt as g,Qt as h,Gt as i,R as j,ie as k,qe as l,C as m,Jt as n,Kt as o,Zt as p,Xt as q,E as r,tn as s,m as t,je as u,lt as v,Be as w,q as x,nn as y,rn as z,sn as A,at as B,dn as C,St as D,fn as E,pn as F,mn as G,bn as H,Pt as I,yn as J,wn as K,ue as L,xt as M,Sn as N,En as O,Cn as P,At as Q,Pn as R,xn as S,On as T,Tn as U,An as V,Nn as W,Fn as X,Nt as Y,Rn as Z,$n as _,Rt as $,Ln as aa,kn as ba,In as ca,Un as da,Mn as ea,Dn as fa,qn as ga,zn as ha,kt as ia,V as ja};