@maveio/components 0.0.169 → 0.0.170
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3BAQWQNY.cjs +25 -0
- package/dist/chunk-3UQNIS3L.js +194 -0
- package/dist/chunk-474VILDO.cjs +194 -0
- package/dist/chunk-CZUMF7SR.cjs +1 -0
- package/dist/{chunk-OVZCXWUJ.js → chunk-EA4QYQHD.js} +141 -165
- package/dist/{chunk-KLJGACPT.js → chunk-GRBSIFM2.js} +1 -1
- package/dist/chunk-HMVS6DJE.js +186 -0
- package/dist/{chunk-BL2IUHCP.cjs → chunk-ITC5FANW.cjs} +203 -227
- package/dist/chunk-KO3CETGD.js +25 -0
- package/dist/chunk-LVGLIRQU.cjs +186 -0
- package/dist/{chunk-P5OWX4UR.js → chunk-NDPOBFNC.js} +1 -1
- package/dist/{chunk-IMY6Z3YA.cjs → chunk-OFBA5VRE.cjs} +2 -2
- package/dist/chunk-RWRHU74Q.js +1 -0
- package/dist/{chunk-MU4WLTQR.cjs → chunk-TJ5F2FGY.cjs} +1 -1
- package/dist/{chunk-L667KKJP.cjs → chunk-YWYZKUFB.cjs} +1 -1
- package/dist/{chunk-GHE5KR7E.js → chunk-ZWLZE25P.js} +1 -1
- package/dist/components/audio-track-menu.cjs +1 -1
- package/dist/components/audio-track-menu.js +1 -1
- package/dist/components/captions-menu-button.cjs +1 -0
- package/dist/components/captions-menu-button.d.cts +10 -0
- package/dist/components/captions-menu-button.d.ts +10 -0
- package/dist/components/captions-menu-button.js +1 -0
- package/dist/components/clip.cjs +1 -1
- package/dist/components/clip.js +1 -1
- package/dist/components/files.cjs +1 -1
- package/dist/components/files.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/player.cjs +1 -1
- package/dist/components/player.d.cts +4 -0
- package/dist/components/player.d.ts +4 -0
- package/dist/components/player.js +1 -1
- package/dist/components/pop.cjs +1 -1
- package/dist/components/pop.js +1 -1
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/themes/default.cjs +204 -28
- package/dist/themes/default.js +204 -28
- package/dist/themes/dolphin.cjs +192 -16
- package/dist/themes/dolphin.js +192 -16
- package/dist/themes/loader.cjs +1 -1
- package/dist/themes/loader.js +1 -1
- package/dist/themes/synthwave.cjs +192 -19
- package/dist/themes/synthwave.js +192 -19
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2EIQ3VMA.cjs +0 -1
- package/dist/chunk-C3CI3U2Z.js +0 -379
- package/dist/chunk-V54NMMTT.cjs +0 -379
- package/dist/chunk-WTS6WHUH.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-
|
|
1
|
+
import {a as a$4}from'./chunk-EA4QYQHD.js';import {a as a$2}from'./chunk-B6P2GJBQ.js';import {c as c$1,a as a$1}from'./chunk-PTN427IG.js';import {g,a as a$3}from'./chunk-5PIHL662.js';import {a}from'./chunk-YPCQNE3R.js';import {c}from'./chunk-KA24PL7V.js';var n=class extends g{get backdrop(){return this._backdropColor||"black"}set backdrop(t){this._backdropColor!=t&&(this._backdropColor=t);}get backdropFilter(){return this._backdropFilter}set backdropFilter(t){this._backdropFilter!=t&&(this._backdropFilter=t);}get styles(){let t={"--backdrop":this.backdrop,"--backdrop-filter":this.backdropFilter};return a$2(t)}open(t){if(this._player=t,t.aspect_ratio){let[i,s]=t.aspect_ratio.split("/");this.style.setProperty("--frame-ratio-w",i),this.style.setProperty("--frame-ratio-h",s);}this.style.display="block";let o=i=>{this._frame.appendChild(t),setTimeout(()=>{this._dialog.showModal();},25),this._dialog.addEventListener("close",s=>{s.preventDefault(),this.close();},{once:true}),i(this);};return new Promise(i=>{if(this._dialog)o(i);else {let s=setInterval(()=>{this._dialog&&(o(i),clearInterval(s));},100);return}})}possibleClose(t){t.target!=this._player&&this.close();}close(){this._dialog.close(),this._backdrop.addEventListener("transitionend",()=>{this._frame.innerHTML="",this.dispatchEvent(new Event("closed",{bubbles:true}));},{once:true});}render(){return a$3`
|
|
2
2
|
<dialog style=${this.styles}>
|
|
3
3
|
<div class="backdrop"></div>
|
|
4
4
|
<div class="content" @click=${this.possibleClose}>
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {o as o$1,q as q$1,b as b$1,C as C$1,s,L as L$1,y,x as x$1,v as v$1,K as K$1,w as w$1,r as r$1,n,M as M$1,a as a$1,p as p$1}from'./chunk-3UQNIS3L.js';import {e,g as g$1,d,f}from'./chunk-KA24PL7V.js';function Le({anchor:t,floating:e,placement:i}){let n=Je({anchor:t,floating:e}),{x:s,y:l}=je(n,i);return {x:s,y:l}}function Je({anchor:t,floating:e}){return {anchor:Ve(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Ve(t,e){var i;let n=t.getBoundingClientRect(),s=(i=e?.getBoundingClientRect())!=null?i:{x:0,y:0};return {x:n.x-s.x,y:n.y-s.y,width:n.width,height:n.height}}function je({anchor:t,floating:e},i){let n=et(i)==="x"?"y":"x",s=n==="y"?"height":"width",l=Re(i),h=t.x+t.width/2-e.width/2,c=t.y+t.height/2-e.height/2,d=t[s]/2-e[s]/2,f;switch(l){case "top":f={x:h,y:t.y-e.height};break;case "bottom":f={x:h,y:t.y+t.height};break;case "right":f={x:t.x+t.width,y:c};break;case "left":f={x:t.x-e.width,y:c};break;default:f={x:t.x,y:t.y};}switch(i.split("-")[1]){case "start":f[n]-=d;break;case "end":f[n]+=d;break}return f}function Re(t){return t.split("-")[0]}function et(t){return ["top","bottom"].includes(Re(t))?"y":"x"}var We=new WeakMap,ie=t=>{let e=We.get(t);return e||We.set(t,e=new Set),e},He=new o$1.ResizeObserver(t=>{for(let e of t)for(let i of ie(e.target))i(e);});function L(t,e){ie(t).add(e),He.observe(t);}function R(t,e){let i=ie(t);i.delete(e),i.size||He.unobserve(t);}var fe=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},o=(t,e,i)=>(fe(t,e,"read from private field"),i?i.call(t):e.get(t)),a=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i);},p=(t,e,i,n)=>(fe(t,e,"write to private field"),e.set(t,i),i),r=(t,e,i)=>(fe(t,e,"access private method"),i),v,w,x,z,N,E,O,ne,Oe,Z,pe,F,K,se,oe,De,ae,Pe,re,qe,I,C,M,D,Y,ve,le,$e,ge,Be,he,ze,be,Ne,de,Ke,ce,Ue,W,G,ue,Ze,H,Q,U,me;function Fe({type:t,text:e,value:i,checked:n}){let s=p$1.createElement("media-chrome-menu-item");s.type=t??"",s.part.add("menu-item"),t&&s.part.add(t),s.value=i,s.checked=n;let l=p$1.createElement("span");return l.textContent=e,s.append(l),s}function Ye(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if(i?.nodeName=="SLOT"&&(i=i.assignedElements({flatten:true})[0]),i)return i=i.cloneNode(true),i;let n=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return n?n.cloneNode(true):""}function tt(t){return `
|
|
2
|
+
<style>
|
|
3
|
+
:host {
|
|
4
|
+
font: var(--media-font,
|
|
5
|
+
var(--media-font-weight, normal)
|
|
6
|
+
var(--media-font-size, 14px) /
|
|
7
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
8
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
9
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
10
|
+
--_menu-bg: rgb(20 20 30 / .8);
|
|
11
|
+
background: var(--media-menu-background, var(--media-control-background, var(--media-secondary-color, var(--_menu-bg))));
|
|
12
|
+
border-radius: var(--media-menu-border-radius);
|
|
13
|
+
border: var(--media-menu-border, none);
|
|
14
|
+
display: var(--media-menu-display, inline-flex) !important;
|
|
15
|
+
|
|
16
|
+
transition: var(--media-menu-transition-in,
|
|
17
|
+
visibility 0s,
|
|
18
|
+
opacity .2s ease-out,
|
|
19
|
+
transform .15s ease-out,
|
|
20
|
+
left .2s ease-in-out,
|
|
21
|
+
min-width .2s ease-in-out,
|
|
22
|
+
min-height .2s ease-in-out
|
|
23
|
+
) !important;
|
|
24
|
+
|
|
25
|
+
visibility: var(--media-menu-visibility, visible);
|
|
26
|
+
opacity: var(--media-menu-opacity, 1);
|
|
27
|
+
max-height: var(--media-menu-max-height, var(--_menu-max-height, 300px));
|
|
28
|
+
transform: var(--media-menu-transform-in, translateY(0) scale(1));
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
|
|
31
|
+
min-height: 0;
|
|
32
|
+
position: relative;
|
|
33
|
+
bottom: var(--_menu-bottom);
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@-moz-document url-prefix() {
|
|
38
|
+
:host{
|
|
39
|
+
--_menu-bg: rgb(20 20 30);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([hidden]) {
|
|
44
|
+
transition: var(--media-menu-transition-out,
|
|
45
|
+
visibility .15s ease-in,
|
|
46
|
+
opacity .15s ease-in,
|
|
47
|
+
transform .15s ease-in
|
|
48
|
+
) !important;
|
|
49
|
+
visibility: var(--media-menu-hidden-visibility, hidden);
|
|
50
|
+
opacity: var(--media-menu-hidden-opacity, 0);
|
|
51
|
+
max-height: var(--media-menu-hidden-max-height,
|
|
52
|
+
var(--media-menu-max-height, var(--_menu-max-height, 300px)));
|
|
53
|
+
transform: var(--media-menu-transform-out, translateY(2px) scale(.99));
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([slot="submenu"]) {
|
|
58
|
+
background: none;
|
|
59
|
+
width: 100%;
|
|
60
|
+
min-height: 100%;
|
|
61
|
+
position: absolute;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
right: -100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#container {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
min-height: 0;
|
|
70
|
+
transition: transform .2s ease-out;
|
|
71
|
+
transform: translate(0, 0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#container.has-expanded {
|
|
75
|
+
transition: transform .2s ease-in;
|
|
76
|
+
transform: translate(-100%, 0);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
button {
|
|
80
|
+
background: none;
|
|
81
|
+
color: inherit;
|
|
82
|
+
border: none;
|
|
83
|
+
padding: 0;
|
|
84
|
+
font: inherit;
|
|
85
|
+
outline: inherit;
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
slot[name="header"][hidden] {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
slot[name="header"] > *,
|
|
95
|
+
slot[name="header"]::slotted(*) {
|
|
96
|
+
padding: .4em .7em;
|
|
97
|
+
border-bottom: 1px solid rgb(255 255 255 / .25);
|
|
98
|
+
cursor: var(--media-cursor, default);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
slot[name="header"] > button[part~="back"],
|
|
102
|
+
slot[name="header"]::slotted(button[part~="back"]) {
|
|
103
|
+
cursor: var(--media-cursor, pointer);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
svg[part~="back"] {
|
|
107
|
+
height: var(--media-menu-icon-height, var(--media-control-height, 24px));
|
|
108
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
109
|
+
display: block;
|
|
110
|
+
margin-right: .5ch;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
slot:not([name]) {
|
|
114
|
+
gap: var(--media-menu-gap);
|
|
115
|
+
flex-direction: var(--media-menu-flex-direction, column);
|
|
116
|
+
overflow: var(--media-menu-overflow, hidden auto);
|
|
117
|
+
display: flex;
|
|
118
|
+
min-height: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host([role="menu"]) slot:not([name]) {
|
|
122
|
+
padding-block: .4em;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
slot:not([name])::slotted([role="menu"]) {
|
|
126
|
+
background: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
media-chrome-menu-item > span {
|
|
130
|
+
margin-right: .5ch;
|
|
131
|
+
max-width: var(--media-menu-item-max-width);
|
|
132
|
+
text-overflow: ellipsis;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
}
|
|
135
|
+
</style>
|
|
136
|
+
<style id="layout-row" media="width:0">
|
|
137
|
+
|
|
138
|
+
slot[name="header"] > *,
|
|
139
|
+
slot[name="header"]::slotted(*) {
|
|
140
|
+
padding: .4em .5em;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
slot:not([name]) {
|
|
144
|
+
gap: var(--media-menu-gap, .25em);
|
|
145
|
+
flex-direction: var(--media-menu-flex-direction, row);
|
|
146
|
+
padding-inline: .5em;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
media-chrome-menu-item {
|
|
150
|
+
padding: .3em .5em;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
media-chrome-menu-item[aria-checked="true"] {
|
|
154
|
+
background: var(--media-menu-item-checked-background, rgb(255 255 255 / .2));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
media-chrome-menu-item::part(checked-indicator) {
|
|
159
|
+
display: var(--media-menu-item-checked-indicator-display, none);
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
162
|
+
<div id="container" part="container">
|
|
163
|
+
<slot name="header" hidden>
|
|
164
|
+
<button part="back button" aria-label="Back to previous menu">
|
|
165
|
+
<slot name="back-icon">
|
|
166
|
+
<svg aria-hidden="true" viewBox="0 0 20 24" part="back indicator">
|
|
167
|
+
<path d="m11.88 17.585.742-.669-4.2-4.665 4.2-4.666-.743-.669-4.803 5.335 4.803 5.334Z"/>
|
|
168
|
+
</svg>
|
|
169
|
+
</slot>
|
|
170
|
+
<slot name="title"></slot>
|
|
171
|
+
</button>
|
|
172
|
+
</slot>
|
|
173
|
+
<slot></slot>
|
|
174
|
+
</div>
|
|
175
|
+
<slot name="checked-indicator" hidden></slot>
|
|
176
|
+
`}var _={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},S=class extends o$1.HTMLElement{constructor(){if(super(),a(this,ne),a(this,Z),a(this,K),a(this,oe),a(this,ae),a(this,re),a(this,M),a(this,Y),a(this,le),a(this,ge),a(this,he),a(this,be),a(this,de),a(this,ce),a(this,W),a(this,ue),a(this,H),a(this,U),a(this,v,null),a(this,w,null),a(this,x,null),a(this,z,new Set),a(this,N,void 0),a(this,E,false),a(this,O,null),a(this,F,()=>{let e=o(this,z),i=new Set(this.items);for(let n of e)i.has(n)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:n}));for(let n of i)e.has(n)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:n}));p(this,z,i);}),a(this,I,()=>{r(this,M,D).call(this),r(this,Y,ve).call(this,false);}),a(this,C,()=>{r(this,M,D).call(this);}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=q$1(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e);}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),p(this,N,new MutationObserver(o(this,F))),o(this,N).observe(this.defaultSlot,{childList:true});}static get observedAttributes(){return [_.DISABLED,_.HIDDEN,_.STYLE,_.ANCHOR,b$1.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this);}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this);}handleEvent(e){switch(e.type){case "slotchange":r(this,ne,Oe).call(this,e);break;case "invoke":r(this,oe,De).call(this,e);break;case "click":r(this,le,$e).call(this,e);break;case "toggle":r(this,he,ze).call(this,e);break;case "focusout":r(this,de,Ke).call(this,e);break;case "keydown":r(this,ce,Ue).call(this,e);break}}connectedCallback(){var e,i;p(this,O,C$1(this.shadowRoot,":host")),r(this,K,se).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),p(this,v,s(this)),(i=(e=o(this,v))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(L(P(this),o(this,I)),L(this,o(this,C))),r(this,Z,pe).call(this);}disconnectedCallback(){var e,i;R(P(this),o(this,I)),R(this,o(this,C)),this.disable(),(i=(e=o(this,v))==null?void 0:e.unassociateElement)==null||i.call(e,this),p(this,v,null);}attributeChangedCallback(e,i,n){var s$1,l,h,c;e===_.HIDDEN&&n!==i?(o(this,E)||p(this,E,true),this.hidden?r(this,re,qe).call(this):r(this,ae,Pe).call(this),this.dispatchEvent(new L$1({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:true}))):e===b$1.MEDIA_CONTROLLER?(i&&((l=(s$1=o(this,v))==null?void 0:s$1.unassociateElement)==null||l.call(s$1,this),p(this,v,null)),n&&this.isConnected&&(p(this,v,s(this)),(c=(h=o(this,v))==null?void 0:h.associateElement)==null||c.call(h,this))):e===_.DISABLED&&n!==i?n==null?this.enable():this.disable():e===_.STYLE&&n!==i&&r(this,K,se).call(this);}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`);}get anchorElement(){var e;return this.anchor?(e=y(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:true}).filter(it)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return (i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(n=>n.value===e);i&&r(this,U,me).call(this,i);}focus(){if(p(this,w,x$1()),this.items.length){r(this,H,Q).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e?.focus();}handleSelect(e){var i;let n=r(this,W,G).call(this,e);n&&(r(this,U,me).call(this,n,n.type==="checkbox"),o(this,x)&&!this.hidden&&((i=o(this,w))==null||i.focus(),this.hidden=true));}get keysUsed(){return ["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,n;let{key:s}=e,l=this.items,h=(n=(i=r(this,W,G).call(this,e))!=null?i:r(this,ue,Ze).call(this))!=null?n:l[0],c=l.indexOf(h),d=Math.max(0,c);s==="ArrowDown"?d++:s==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=l.length-1),d<0&&(d=l.length-1),d>l.length-1&&(d=0),r(this,H,Q).call(this,l[d]),l[d].focus();}};v=new WeakMap;w=new WeakMap;x=new WeakMap;z=new WeakMap;N=new WeakMap;E=new WeakMap;O=new WeakMap;ne=new WeakSet;Oe=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:true}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();["header","title"].includes(e.name)&&r(this,Z,pe).call(this),e.name||o(this,F).call(this);};Z=new WeakSet;pe=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0;};F=new WeakMap;K=new WeakSet;se=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0");};oe=new WeakSet;De=function(t){p(this,x,t.relatedTarget),v$1(this,t.relatedTarget)||(this.hidden=!this.hidden);};ae=new WeakSet;Pe=function(){var t;(t=o(this,x))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:true}),L(P(this),o(this,I)),L(this,o(this,C));};re=new WeakSet;qe=function(){var t;(t=o(this,x))==null||t.setAttribute("aria-expanded","false"),R(P(this),o(this,I)),R(this,o(this,C));};I=new WeakMap;C=new WeakMap;M=new WeakSet;D=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Le({anchor:this.anchorElement,floating:this,placement:"top-start"});t??(t=this.offsetWidth);let s=P(this).getBoundingClientRect(),l=s.width-e-t,h=s.height-i-this.offsetHeight,{style:c}=o(this,O);c.setProperty("position","absolute"),c.setProperty("right",`${Math.max(0,l)}px`),c.setProperty("--_menu-bottom",`${h}px`);let d=getComputedStyle(this),Qe=c.getPropertyValue("--_menu-bottom")===d.bottom?h:parseFloat(d.bottom),Xe=s.height-Qe-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${Xe}px`);};Y=new WeakSet;ve=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e?.querySelector('[role="menu"]'),{style:n}=o(this,O);if(t||n.setProperty("--media-menu-transition-in","none"),i){let s=i.offsetHeight,l=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${l}px`),this.style.setProperty("min-height",`${s}px`),r(this,M,D).call(this,l);}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),r(this,M,D).call(this);n.removeProperty("--media-menu-transition-in");};le=new WeakSet;$e=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(o(this,ge,Be))){(e=o(this,w))==null||e.focus(),this.hidden=true;return}let i=r(this,W,G).call(this,t);!i||i.hasAttribute("disabled")||(r(this,H,Q).call(this,i),this.handleSelect(t));};ge=new WeakSet;Be=function(){var t;return (t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:true}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};he=new WeakSet;ze=function(t){if(t.target===this)return;r(this,be,Ne).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new K$1({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);r(this,Y,ve).call(this,true);};be=new WeakSet;Ne=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e);};de=new WeakSet;Ke=function(t){var e;v$1(this,t.relatedTarget)||(o(this,E)&&((e=o(this,w))==null||e.focus()),o(this,x)&&o(this,x)!==t.relatedTarget&&!this.hidden&&(this.hidden=true));};ce=new WeakSet;Ue=function(t){var e,i,n,s,l;let{key:h,ctrlKey:c,altKey:d,metaKey:f}=t;if(!(c||d||f)&&this.keysUsed.includes(h))if(t.preventDefault(),t.stopPropagation(),h==="Tab"){if(o(this,E)){this.hidden=true;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(s=(n=this.nextElementSibling)==null?void 0:n.focus)==null||s.call(n),this.blur();}else h==="Escape"?((l=o(this,w))==null||l.focus(),o(this,E)&&(this.hidden=true)):h==="Enter"||h===" "?this.handleSelect(t):this.handleMove(t);};W=new WeakSet;G=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};ue=new WeakSet;Ze=function(){return this.items.find(t=>t.tabIndex===0)};H=new WeakSet;Q=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1;};U=new WeakSet;me=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(n=>n.checked=false),e?t.checked=!t.checked:t.checked=true,this.checkedItems.some((n,s)=>n!=i[s])&&this.dispatchEvent(new Event("change",{bubbles:true,composed:true}));};S.shadowRootOptions={mode:"open"};S.getTemplateHTML=tt;function it(t){return ["menuitem","menuitemradio","menuitemcheckbox"].includes(t?.role)}function P(t){var e;return (e=t.getAttribute("bounds")?w$1(t,`#${t.getAttribute("bounds")}`):r$1(t)||t.parentElement)!=null?e:t}o$1.customElements.get("media-chrome-menu")||o$1.customElements.define("media-chrome-menu",S);var nt=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
177
|
+
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
178
|
+
<path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
|
|
179
|
+
</svg>`,k,g,b,ye,q,B,ke=class extends S{constructor(){super(...arguments);e(this,b);e(this,k,[]);e(this,g);e(this,B,()=>{let i=this.value??d(this,g);i!=null&&(f(this,g,String(i)),this.dispatchEvent(new o$1.CustomEvent(a$1.MEDIA_AUDIO_TRACK_REQUEST,{detail:d(this,g),composed:true,bubbles:true})),g$1(this,b,q).call(this));});}get tracks(){return d(this,k)}set tracks(i){f(this,k,[...i??[]]),g$1(this,b,ye).call(this);}get selected(){return d(this,g)}set selected(i){f(this,g,i??void 0),g$1(this,b,q).call(this);}connectedCallback(){super.connectedCallback(),this.addEventListener("change",d(this,B)),g$1(this,b,ye).call(this),g$1(this,b,q).call(this);}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",d(this,B));}};k=new WeakMap,g=new WeakMap,b=new WeakSet,ye=function(){let i=this.defaultSlot;if(i){i.textContent="";for(let n of d(this,k)){let s=Fe({type:"radio",text:n.label??n.language??"",value:n.id,checked:!!n.enabled});s.prepend(Ye(this,"checked-indicator")),i.append(s);}g$1(this,b,q).call(this);}},q=function(){let i=d(this,k).find(h=>h.enabled)??(d(this,k).length?d(this,k)[0]:void 0),n=d(this,g)??i?.id;f(this,g,n);let l=this.defaultSlot?.querySelectorAll("media-chrome-menu-item")??this.querySelectorAll("media-chrome-menu-item");for(let h of Array.from(l))"checked"in h&&"value"in h&&(h.checked=h.value===n);n!=null?this.value=n:(this.value="",this.removeAttribute("value"));},B=new WeakMap;var X,Ge,$=class extends M$1{constructor(){super(...arguments);e(this,X);}connectedCallback(){super.connectedCallback(),g$1(this,X,Ge).call(this);}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:this.closest("media-controller, mave-player")?.querySelector("mave-audio-track-menu")??null}};X=new WeakSet,Ge=function(){let i=n("audio tracks");this.setAttribute("aria-label",i);},$.getSlotTemplateHTML=()=>`
|
|
180
|
+
<style>
|
|
181
|
+
:host([aria-expanded="true"]) slot[name='tooltip'] {
|
|
182
|
+
display: none;
|
|
183
|
+
}
|
|
184
|
+
</style>
|
|
185
|
+
<slot name="icon">${nt}</slot>
|
|
186
|
+
`,$.getTooltipContentHTML=()=>n("audio tracks");o$1.customElements.get("mave-audio-track-menu")||o$1.customElements.define("mave-audio-track-menu",ke);o$1.customElements.get("mave-audio-track-menu-button")||o$1.customElements.define("mave-audio-track-menu-button",$);export{L as a,R as b,Fe as c,Ye as d,S as e,ke as f,$ as g};
|