@maveio/components 0.0.156 → 0.0.158

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.
Files changed (116) hide show
  1. package/dist/{chunk-45FW5DBN.js → chunk-24TUG5TP.js} +1 -1
  2. package/dist/{chunk-Z5AM3NST.cjs → chunk-32WXLTTE.cjs} +2 -2
  3. package/dist/{chunk-4CDE2QCJ.js → chunk-6XR2OUZW.js} +1 -1
  4. package/dist/chunk-7ZRXZY5C.js +20 -0
  5. package/dist/{chunk-TVNAG7X4.cjs → chunk-B3QILQEE.cjs} +3 -3
  6. package/dist/{chunk-6MCTUE3H.js → chunk-CHHWULL2.js} +4 -4
  7. package/dist/chunk-DITZCOYN.cjs +379 -0
  8. package/dist/{chunk-MKZYI5TY.cjs → chunk-EOHKHSQ3.cjs} +1 -1
  9. package/dist/{chunk-KTGL4HLA.cjs → chunk-FUSQ4EZG.cjs} +2 -2
  10. package/dist/chunk-JHSFSCC2.cjs +1 -0
  11. package/dist/chunk-KA24PL7V.js +1 -0
  12. package/dist/{chunk-VZKW2VWI.js → chunk-KNAAIER3.js} +2 -2
  13. package/dist/{chunk-5KQJTT3P.cjs → chunk-KVMGCTLR.cjs} +1 -1
  14. package/dist/{chunk-4DCPDVPE.js → chunk-LT26CEMU.js} +57 -5
  15. package/dist/{chunk-JBRRVOTV.cjs → chunk-MLZIA6JO.cjs} +5 -5
  16. package/dist/chunk-MSWONVA7.cjs +20 -0
  17. package/dist/{chunk-4AYP3SUJ.js → chunk-NKEVN7FX.js} +1 -1
  18. package/dist/{chunk-PLCF3Z5Q.cjs → chunk-OTRPT6Y4.cjs} +4 -4
  19. package/dist/{chunk-MC6T46LX.cjs → chunk-PHGKLFNF.cjs} +1 -1
  20. package/dist/chunk-QSQE5WBN.js +35 -0
  21. package/dist/chunk-QZSLJNS4.js +7 -0
  22. package/dist/chunk-STJ6CEFZ.cjs +1468 -0
  23. package/dist/chunk-T2P4BAWY.js +379 -0
  24. package/dist/chunk-ULZI6OGL.js +1468 -0
  25. package/dist/chunk-W3KNVBI3.cjs +213 -0
  26. package/dist/{chunk-CUGRXOA2.js → chunk-XLUB3ATV.js} +1 -1
  27. package/dist/{chunk-6NWQAHZT.cjs → chunk-ZLS57S3I.cjs} +1 -1
  28. package/dist/components/audio-track-menu.cjs +1 -0
  29. package/dist/components/audio-track-menu.d.cts +27 -0
  30. package/dist/components/audio-track-menu.d.ts +27 -0
  31. package/dist/components/audio-track-menu.js +1 -0
  32. package/dist/components/clip.cjs +1 -1
  33. package/dist/components/clip.js +1 -1
  34. package/dist/components/files.cjs +1 -1
  35. package/dist/components/files.js +1 -1
  36. package/dist/components/img.cjs +1 -1
  37. package/dist/components/img.js +1 -1
  38. package/dist/components/list.cjs +1 -1
  39. package/dist/components/list.js +1 -1
  40. package/dist/components/player.cjs +1 -1
  41. package/dist/components/player.d.cts +8 -0
  42. package/dist/components/player.d.ts +8 -0
  43. package/dist/components/player.js +1 -1
  44. package/dist/components/pop.cjs +1 -1
  45. package/dist/components/pop.js +1 -1
  46. package/dist/components/text.cjs +1 -1
  47. package/dist/components/text.js +1 -1
  48. package/dist/components/upload.cjs +1 -1
  49. package/dist/components/upload.d.cts +18 -1
  50. package/dist/components/upload.d.ts +18 -1
  51. package/dist/components/upload.js +1 -1
  52. package/dist/config.cjs +1 -1
  53. package/dist/config.js +1 -1
  54. package/dist/embed/api.cjs +1 -1
  55. package/dist/embed/api.d.cts +11 -1
  56. package/dist/embed/api.d.ts +11 -1
  57. package/dist/embed/api.js +1 -1
  58. package/dist/embed/caption.cjs +1 -1
  59. package/dist/embed/caption.js +1 -1
  60. package/dist/embed/controller.cjs +1 -1
  61. package/dist/embed/controller.js +1 -1
  62. package/dist/embed/socket.cjs +1 -1
  63. package/dist/embed/socket.d.cts +3 -5
  64. package/dist/embed/socket.d.ts +3 -5
  65. package/dist/embed/socket.js +1 -1
  66. package/dist/generated/locales/de.cjs +1 -1
  67. package/dist/generated/locales/de.d.cts +5 -0
  68. package/dist/generated/locales/de.d.ts +5 -0
  69. package/dist/generated/locales/de.js +1 -1
  70. package/dist/generated/locales/en.cjs +1 -1
  71. package/dist/generated/locales/en.d.cts +5 -0
  72. package/dist/generated/locales/en.d.ts +5 -0
  73. package/dist/generated/locales/en.js +1 -1
  74. package/dist/generated/locales/fr.cjs +1 -1
  75. package/dist/generated/locales/fr.d.cts +5 -0
  76. package/dist/generated/locales/fr.d.ts +5 -0
  77. package/dist/generated/locales/fr.js +1 -1
  78. package/dist/generated/locales/nl.cjs +1 -1
  79. package/dist/generated/locales/nl.d.cts +5 -0
  80. package/dist/generated/locales/nl.d.ts +5 -0
  81. package/dist/generated/locales/nl.js +1 -1
  82. package/dist/index.cjs +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/react.cjs +1 -1
  85. package/dist/react.js +1 -1
  86. package/dist/themes/default.cjs +53 -1
  87. package/dist/themes/default.js +53 -1
  88. package/dist/themes/dolphin.cjs +1 -1
  89. package/dist/themes/dolphin.js +1 -1
  90. package/dist/themes/loader.cjs +1 -1
  91. package/dist/themes/loader.js +1 -1
  92. package/dist/themes/synthwave.cjs +1 -1
  93. package/dist/themes/synthwave.js +1 -1
  94. package/dist/utils/localization.cjs +1 -1
  95. package/dist/utils/localization.js +1 -1
  96. package/dist/utils/mave_element.cjs +1 -1
  97. package/dist/utils/mave_element.js +1 -1
  98. package/dist/utils/origin.cjs +1 -1
  99. package/dist/utils/origin.js +1 -1
  100. package/dist/utils/video_events.cjs +1 -1
  101. package/dist/utils/video_events.js +1 -1
  102. package/dist/vue.cjs +1 -1
  103. package/dist/vue.js +1 -1
  104. package/package.json +3 -3
  105. package/dist/chunk-5IPIXU3O.js +0 -1807
  106. package/dist/chunk-DESQSXZF.cjs +0 -161
  107. package/dist/chunk-IBTJ5OMP.js +0 -35
  108. package/dist/chunk-IPA5Q26W.cjs +0 -1
  109. package/dist/chunk-LGWESJBJ.cjs +0 -20
  110. package/dist/chunk-NDDFZTBA.js +0 -1
  111. package/dist/chunk-SRXHXTDF.js +0 -7
  112. package/dist/chunk-ZMMJMM4X.cjs +0 -1807
  113. package/dist/chunk-ZT2E4EC7.js +0 -20
  114. /package/dist/{chunk-NI57YLPL.cjs → chunk-BVMU4ZXD.cjs} +0 -0
  115. /package/dist/{chunk-EXNM5EV2.js → chunk-DFLPNNA4.js} +0 -0
  116. /package/dist/{chunk-FSFJQ67W.js → chunk-FRPU6QLJ.js} +0 -0
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkJ7OISSKU_cjs=require('./chunk-J7OISSKU.cjs');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var M=e=>typeof e!="string"&&"strTag"in e,p=(e,t,o)=>{let n=e[0];for(let r=1;r<e.length;r++)n+=t[o?o[r-1]:r-1],n+=e[r];return n};var c=e=>M(e)?p(e.strings,e.values):e;var d="lit-localize-status";var x=class{constructor(t){this.__litLocalizeEventHandler=o=>{o.detail.status==="ready"&&this.host.requestUpdate();},this.host=t;}hostConnected(){window.addEventListener(d,this.__litLocalizeEventHandler);}hostDisconnected(){window.removeEventListener(d,this.__litLocalizeEventHandler);}},F=e=>e.addController(new x(e)),I=F;var N=()=>(e,t)=>(e.addInitializer(I),e);var u=class{constructor(){this.settled=false,this.promise=new Promise((t,o)=>{this._resolve=t,this._reject=o;});}resolve(t){this.settled=true,this._resolve(t);}reject(t){this.settled=true,this._reject(t);}};var i=[];for(let e=0;e<256;e++)i[e]=(e>>4&15).toString(16)+(e&15).toString(16);function C(e){let t=0,o=8997,n=0,r=33826,s=0,a=40164,L=0,f=52210;for(let v=0;v<e.length;v++)o^=e.charCodeAt(v),t=o*435,n=r*435,s=a*435,L=f*435,s+=o<<8,L+=r<<8,n+=t>>>16,o=t&65535,s+=n>>>16,r=n&65535,f=L+(s>>>16)&65535,a=s&65535;return i[f>>8]+i[f&255]+i[a>>8]+i[a&255]+i[r>>8]+i[r&255]+i[o>>8]+i[o&255]}var W="",$="h",b="s";function z(e,t){return (t?$:b)+C(typeof e=="string"?e:e.join(W))}var A=new WeakMap,R=new Map;function j(e,t,o){if(e){let n=o?.id??O(t),r=e[n];if(r){if(typeof r=="string")return r;if("strTag"in r)return p(r.strings,t.values,r.values);{let s=A.get(r);return s===void 0&&(s=r.values,A.set(r,s)),{...r,values:s.map(a=>t.values[a])}}}}return c(t)}function O(e){let t=typeof e=="string"?e:e.strings,o=R.get(t);return o===void 0&&(o=z(t,typeof e!="string"&&!("strTag"in e)),R.set(t,o)),o}function _(e){window.dispatchEvent(new CustomEvent(d,{detail:e}));}var g="",E,H,h,w,P,l=new u;l.resolve();var m=0,U=e=>(S((t,o)=>j(P,t,o)),g=H=e.sourceLocale,h=new Set(e.targetLocales),h.add(e.sourceLocale),w=e.loadLocale,{getLocale:k,setLocale:X}),k=()=>g,X=e=>{if(e===(E??g))return l.promise;if(!h||!w)throw new Error("Internal error");if(!h.has(e))throw new Error("Invalid locale code");m++;let t=m;return E=e,l.settled&&(l=new u),_({status:"loading",loadingLocale:e}),(e===H?Promise.resolve({templates:void 0}):w(e)).then(n=>{m===t&&(g=e,E=void 0,P=n.templates,_({status:"ready",readyLocale:e}),l.resolve());},n=>{m===t&&(_({status:"error",errorLocale:e,errorMessage:n.toString()}),l.reject(n));}),l.promise};exports.b=c;var V=false;function S(e){if(V)throw new Error("lit-localize can only be configured once");exports.b=e,V=true;}var G={en:()=>import('./generated/locales/en.cjs'),nl:()=>import('./generated/locales/nl.cjs'),de:()=>import('./generated/locales/de.cjs'),fr:()=>import('./generated/locales/fr.cjs')};function B(e){return G[e]}async function J(e){let t=chunkJ7OISSKU_cjs.a();if(!t)return null;try{return await import(new URL(`./${t}generated/locales/${e}.js`,(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-MC6T46LX.cjs', document.baseURI).href))).href)}catch{return null}}var K=U({sourceLocale:"default",targetLocales:["en","nl","de","fr"],loadLocale:async e=>{let t=B(e);if(t)try{return await t()}catch(n){console.error(`[mave-player]: failed to load locale ${e}`,n);}let o=await J(e);return o||(console.log(`[mave-player]: locale not loaded for ${e}`),null)}}),y=false,D=class{constructor(t){this._onLoad=t=>{t.detail.status==="loading"?y=false:t.detail.status==="ready"&&(y=true),this.host.requestUpdate();};this.host=t,t.addController(this);}get loaded(){return y}set locale(t){this._locale!==t&&(K.setLocale(t),this.host.requestUpdate());}get locale(){return this._locale}hostConnected(){typeof window<"u"&&window.addEventListener("lit-localize-status",this._onLoad);}hostDisconnected(){typeof window<"u"&&window.removeEventListener("lit-localize-status",this._onLoad);}};/*! Bundled license information:
1
+ 'use strict';var chunkJ7OISSKU_cjs=require('./chunk-J7OISSKU.cjs');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var M=e=>typeof e!="string"&&"strTag"in e,p=(e,t,o)=>{let n=e[0];for(let r=1;r<e.length;r++)n+=t[o?o[r-1]:r-1],n+=e[r];return n};var c=e=>M(e)?p(e.strings,e.values):e;var d="lit-localize-status";var x=class{constructor(t){this.__litLocalizeEventHandler=o=>{o.detail.status==="ready"&&this.host.requestUpdate();},this.host=t;}hostConnected(){window.addEventListener(d,this.__litLocalizeEventHandler);}hostDisconnected(){window.removeEventListener(d,this.__litLocalizeEventHandler);}},F=e=>e.addController(new x(e)),I=F;var N=()=>(e,t)=>(e.addInitializer(I),e);var u=class{constructor(){this.settled=false,this.promise=new Promise((t,o)=>{this._resolve=t,this._reject=o;});}resolve(t){this.settled=true,this._resolve(t);}reject(t){this.settled=true,this._reject(t);}};var i=[];for(let e=0;e<256;e++)i[e]=(e>>4&15).toString(16)+(e&15).toString(16);function C(e){let t=0,o=8997,n=0,r=33826,s=0,a=40164,L=0,f=52210;for(let v=0;v<e.length;v++)o^=e.charCodeAt(v),t=o*435,n=r*435,s=a*435,L=f*435,s+=o<<8,L+=r<<8,n+=t>>>16,o=t&65535,s+=n>>>16,r=n&65535,f=L+(s>>>16)&65535,a=s&65535;return i[f>>8]+i[f&255]+i[a>>8]+i[a&255]+i[r>>8]+i[r&255]+i[o>>8]+i[o&255]}var W="",$="h",b="s";function z(e,t){return (t?$:b)+C(typeof e=="string"?e:e.join(W))}var A=new WeakMap,R=new Map;function j(e,t,o){if(e){let n=o?.id??O(t),r=e[n];if(r){if(typeof r=="string")return r;if("strTag"in r)return p(r.strings,t.values,r.values);{let s=A.get(r);return s===void 0&&(s=r.values,A.set(r,s)),{...r,values:s.map(a=>t.values[a])}}}}return c(t)}function O(e){let t=typeof e=="string"?e:e.strings,o=R.get(t);return o===void 0&&(o=z(t,typeof e!="string"&&!("strTag"in e)),R.set(t,o)),o}function _(e){window.dispatchEvent(new CustomEvent(d,{detail:e}));}var g="",E,H,h,w,P,l=new u;l.resolve();var m=0,U=e=>(S((t,o)=>j(P,t,o)),g=H=e.sourceLocale,h=new Set(e.targetLocales),h.add(e.sourceLocale),w=e.loadLocale,{getLocale:k,setLocale:X}),k=()=>g,X=e=>{if(e===(E??g))return l.promise;if(!h||!w)throw new Error("Internal error");if(!h.has(e))throw new Error("Invalid locale code");m++;let t=m;return E=e,l.settled&&(l=new u),_({status:"loading",loadingLocale:e}),(e===H?Promise.resolve({templates:void 0}):w(e)).then(n=>{m===t&&(g=e,E=void 0,P=n.templates,_({status:"ready",readyLocale:e}),l.resolve());},n=>{m===t&&(_({status:"error",errorLocale:e,errorMessage:n.toString()}),l.reject(n));}),l.promise};exports.b=c;var V=false;function S(e){if(V)throw new Error("lit-localize can only be configured once");exports.b=e,V=true;}var G={en:()=>import('./generated/locales/en.cjs'),nl:()=>import('./generated/locales/nl.cjs'),de:()=>import('./generated/locales/de.cjs'),fr:()=>import('./generated/locales/fr.cjs')};function B(e){return G[e]}async function J(e){let t=chunkJ7OISSKU_cjs.a();if(!t)return null;try{return await import(new URL(`./${t}generated/locales/${e}.js`,(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-PHGKLFNF.cjs', document.baseURI).href))).href)}catch{return null}}var K=U({sourceLocale:"default",targetLocales:["en","nl","de","fr"],loadLocale:async e=>{let t=B(e);if(t)try{return await t()}catch(n){console.error(`[mave-player]: failed to load locale ${e}`,n);}let o=await J(e);return o||(console.log(`[mave-player]: locale not loaded for ${e}`),null)}}),y=false,D=class{constructor(t){this._onLoad=t=>{t.detail.status==="loading"?y=false:t.detail.status==="ready"&&(y=true),this.host.requestUpdate();};this.host=t,t.addController(this);}get loaded(){return y}set locale(t){this._locale!==t&&(K.setLocale(t),this.host.requestUpdate());}get locale(){return this._locale}hostConnected(){typeof window<"u"&&window.addEventListener("lit-localize-status",this._onLoad);}hostDisconnected(){typeof window<"u"&&window.removeEventListener("lit-localize-status",this._onLoad);}};/*! Bundled license information:
2
2
 
3
3
  @lit/localize/internal/str-tag.js:
4
4
  (**
@@ -0,0 +1,35 @@
1
+ import {a as a$2}from'./chunk-MS5NFI3Q.js';import {a as a$1}from'./chunk-ZWTODZDA.js';import {a as a$3}from'./chunk-3R7TX6NC.js';import {a,b}from'./chunk-HMISRRKC.js';import {h,i,f,c as c$1}from'./chunk-A4GZBQEB.js';import {c,e,g}from'./chunk-KA24PL7V.js';var o,k,C,S,n=class extends i{constructor(){super(...arguments);e(this,o);this._clickable=true;this._autoscroll=true;this._lastScrollTime=0;this.currentTime=0;}get embed(){return this._embedId}set embed(t){this._embedId!=t&&(this._embedId=t,this.captionController=new a$1(this,this.embed),this.reset(),this.requestUpdate("embed"));}get clickable(){return this._clickable}set clickable(t){this._clickable!=t&&(typeof t=="string"?this._clickable=t==="true"||t==="":this._clickable=t,this.requestUpdate("clickable"));}get autoscroll(){return this._autoscroll}set autoscroll(t){this._autoscroll!=t&&(typeof t=="string"?this._autoscroll=t==="true"||t==="":this._autoscroll=t,this.requestUpdate("autoscroll"));}get wordIndex(){return this._wordIndex}set wordIndex(t){if(this._wordIndex!=t&&(this._wordIndex=t,this.autoscroll)){let e=this.shadowRoot?.querySelector(`[data-word-id="word-${this.segmentIndex}-${this.wordIndex}"]`);if(e&&this._lastScrollTime+2500<Date.now()){let r=this.getBoundingClientRect(),i=e.getBoundingClientRect(),s=i.top-r.top;if(s>0){let c=this.scrollTop+s;g(this,o,k).call(this,this,c-i.height/2);}}}}get segmentIndex(){return this._segmentIndex}set segmentIndex(t){this._segmentIndex!=t&&(this._segmentIndex=t);}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",g(this,o,C).bind(this)),this.reset();}reset(){if(typeof document>"u")return;this.loop=false,this.currentTime=0,this.wordIndex=0,this.segmentIndex=0;let t=document.querySelector(`mave-player[embed="${this.embed}"]`);t&&(this.player=t,t.addEventListener("play",()=>{this.loop=true,this.loopUpdateTime();}),t.addEventListener("pause",()=>{this.loop=false;}));}updateTime(){this.currentTime=this.player.currentTime;}loopUpdateTime(){this.updateTime(),setTimeout(()=>{this.loop&&requestAnimationFrame(this.loopUpdateTime.bind(this));},10);}inRange({start:t,end:e},r,i,s){if(this.currentTime>=t&&this.currentTime<=e)return s&&(this.wordIndex=s),i&&(this.segmentIndex=i),r||true}segmentStyle(){return this.clickable?{cursor:"pointer"}:{}}wordStyle(t){return t?{"background-color":this.highlight}:{}}render(){return this.captionController?this.captionController.render({complete:t=>(this.captions=t,c$1`
2
+ <div>
3
+ ${this.captions.segments.map((e,r)=>c$1`
4
+ <p
5
+ data-segment-id="segment-${r}"
6
+ style=${a$2(this.segmentStyle())}
7
+ @click=${this.clickable?g(this,o,S):f}
8
+ part=${a$3(this.inRange(e,"segment"))}
9
+ x-caption-segment-start="${e.start}"
10
+ x-caption-segment-end="${e.end}"
11
+ >
12
+ ${e.words.map((i,s)=>c$1`
13
+ <span
14
+ data-word-id="word-${r}-${s}"
15
+ style=${a$2(this.wordStyle(this.inRange(i)))}
16
+ part=${a$3(this.inRange(i,"word",r,s))}
17
+ x-caption-word-start="${i.start}"
18
+ x-caption-word-end="${i.end}"
19
+ >${i.word.trim()}</span
20
+ >
21
+ `)}
22
+ </p>
23
+ `)}
24
+ </div>
25
+ `)}):f}};o=new WeakSet,k=function(t,e,r=500){let i=this.scrollTop,s=e-i,c=null,p=false;function w(l){c||(c=l);let y=l-c,v=Math.min(y/r,1);t.scrollTop=i+s*x(v),y<r&&p?requestAnimationFrame(w):p=false;}function x(l){return l<.5?2*l*l:1-Math.pow(-2*l+2,2)/2}p=true,requestAnimationFrame(w);},C=function(){this._lastScrollTime=Date.now();},S=function(t){if(this.clickable){let e=t.target.closest("p");if(e&&this.player){let r=e.getAttribute("x-caption-segment-start");this.player.currentTime=Number(r),this.player.paused&&this.player.play();}}},n.styles=h`
26
+ :host {
27
+ display: block;
28
+ width: 100%;
29
+ height: 100%;
30
+ }
31
+
32
+ [part='word'] {
33
+ background-color: rgba(255, 210, 42, 0.5);
34
+ }
35
+ `,c([a()],n.prototype,"embed",1),c([a()],n.prototype,"highlight",2),c([a()],n.prototype,"clickable",1),c([a()],n.prototype,"autoscroll",1),c([b()],n.prototype,"currentTime",2),c([b()],n.prototype,"captions",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-text")||window.customElements.define("mave-text",n));export{n as a};
@@ -0,0 +1,7 @@
1
+ import {b as b$2}from'./chunk-NKEVN7FX.js';import {b as b$1}from'./chunk-HX6F65VL.js';import {a as a$1}from'./chunk-24TUG5TP.js';import {a}from'./chunk-HMISRRKC.js';import {h as h$1,c as c$1,f as f$1}from'./chunk-A4GZBQEB.js';import {c,e,g}from'./chunk-KA24PL7V.js';var n,C,b,h,f,p,u=class extends a$1{constructor(){super(...arguments);e(this,n);this.order="newest";this.embedController=new b$1(this,0);}connectedCallback(){super.connectedCallback(),this.embedController.token=this.token;}requestUpdate(e,o){super.requestUpdate(e,o),e==="embed"&&(this.embedController.token=this.token);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}updated(){this.shadowRoot&&b$2(this.shadowRoot);}refresh(){return this.embedController.refresh()}containsEmbed(e){return this._collection?.videos?.some(o=>o.id===e)}getNextForEmbed(e){let o=g(this,n,C).call(this),t=o.findIndex(s=>s.id===e);if(t!==-1)return o[t+1]}render(){return c$1`
2
+ ${this.embedController.render({pending:this.renderPending,error:e=>c$1`<p>${e instanceof Error?e.message:f$1}</p>`,complete:e=>{if(this._collection=e,!e)return this.renderPending();if(e.error)return console.warn(e.error);let o=this._slottedChildren.map(t=>{function s(){let l;return t.nodeName==="TEMPLATE"?l=t.content.cloneNode(true):l=t.cloneNode(true),l}if(t.getAttribute("name")=="list-title"){let l=s();return l.textContent=this._collection?.name,c$1`${l}`}if(t.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let l=s(),i=g(this,n,f).call(this,l,"root-link");return i&&(i.addEventListener("click",a=>{a.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"back",embedId:""}),this.embedController.embed="";}),g(this,n,p).call(this,i)),c$1`${l}`}if(t.getAttribute("name")=="mave-list-folder"){let l=this._collection.collections?.map(i=>{let a=s(),m=g(this,n,f).call(this,a,"folder-link");return [t,m].forEach(d=>{d instanceof Element&&(d.addEventListener("click",g=>{g.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"show_collection",collectionId:i.id}),this.embedController.embed=i.id;}),g(this,n,p).call(this,d));}),g(this,n,h).call(this,a,"folder-title",i.name),typeof i.video_count=="number"&&g(this,n,h).call(this,a,"folder-count",i.video_count.toString()),c$1`${a}`});return c$1`${l}`}if(t.getAttribute("name")=="mave-list-item"||!["mave-list-folder","mave-list-item","mave-list-root","list-title"].includes(t.hasAttribute("name")?t.getAttribute("name"):"")&&t.nodeName=="TEMPLATE"){let l=g(this,n,C).call(this).map((i,a)=>{let m=s(),d=a+1;g(this,n,h).call(this,m,"item-title",i.name),g(this,n,h).call(this,m,"item-position",d.toString()),g(this,n,h).call(this,m,"item-duration",this.durationToTime(i.duration)),g(this,n,b).call(this,m,"mave-clip",i.id),g(this,n,b).call(this,m,"mave-player",i.id),g(this,n,b).call(this,m,"mave-img",i.id);let g$1=m.querySelector("mave-clip"),S=g(this,n,f).call(this,m,"item-title"),$=m.querySelector("mave-img");return [g$1,S,$,m].forEach(P=>{P?.addEventListener("click",x=>{this.emit(this.EVENT_TYPES.CLICK,{action:"show_embed",embedId:i.id,position:d});});}),c$1`${m}`});return c$1`${l}`}}).filter(t=>t);return c$1`${this._stylesheets} ${o}`}})}
3
+ `}renderPending(){return c$1`<slot style="display: none"></slot>`}};n=new WeakSet,C=function(){if(!this._collection)return [];let e=this._collection.videos;return this.order=="newest"&&(e=this._collection.videos?.sort((o,t)=>t.created-o.created)),this.order=="oldest"&&(e=this._collection.videos?.sort((o,t)=>o.created-t.created)),this.order=="az"&&(e=this._collection.videos?.sort((o,t)=>o.name.localeCompare(t.name))),this.order=="za"&&(e=this._collection.videos?.sort((o,t)=>t.name.localeCompare(o.name))),e},b=function(e,o,t){let s=e.querySelector(o);s&&(s.setAttribute("embed",t),g(this,n,p).call(this,s));},h=function(e,o,t){let s=g(this,n,f).call(this,e,o);s&&(s.textContent=t,g(this,n,p).call(this,s));},f=function(e,o){return e.querySelector(`[slot="${o}"], [data-slot="${o}"]`)},p=function(e){e&&(e.removeAttribute("slot"),e.removeAttribute("data-slot"));},u.styles=h$1`
4
+ :host {
5
+ display: block;
6
+ }
7
+ `,c([a()],u.prototype,"token",2),c([a()],u.prototype,"order",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-list")||window.customElements.define("mave-list",u));export{u as a};