@maveio/components 0.0.167 → 0.0.169

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 (126) hide show
  1. package/dist/chunk-2E5GLLOS.cjs +19 -0
  2. package/dist/chunk-2EIQ3VMA.cjs +1 -0
  3. package/dist/chunk-2FUCHY2J.cjs +35 -0
  4. package/dist/chunk-2JCNQPEK.js +1 -0
  5. package/dist/chunk-5PIHL662.js +19 -0
  6. package/dist/chunk-5QLIDHRT.cjs +33 -0
  7. package/dist/chunk-AOBEOJ2U.cjs +10 -0
  8. package/dist/chunk-B6P2GJBQ.js +9 -0
  9. package/dist/chunk-BL2IUHCP.cjs +1663 -0
  10. package/dist/chunk-BTCK3T4L.cjs +24 -0
  11. package/dist/{chunk-DITZCOYN.cjs → chunk-C3CI3U2Z.js} +6 -6
  12. package/dist/{chunk-SF36AD3G.js → chunk-CNPQ5Q2M.js} +1 -1
  13. package/dist/chunk-CVXHA76S.js +3 -0
  14. package/dist/chunk-DL4BV5IH.cjs +24 -0
  15. package/dist/chunk-EVKPEPYP.cjs +2 -0
  16. package/dist/chunk-FAONFKQ2.cjs +9 -0
  17. package/dist/{chunk-E2IDHUN5.js → chunk-GHE5KR7E.js} +4 -4
  18. package/dist/chunk-GSVKVWEI.js +33 -0
  19. package/dist/chunk-IBQULJZC.cjs +3 -0
  20. package/dist/chunk-IETV3B4F.cjs +38 -0
  21. package/dist/{chunk-AJ33W3DD.cjs → chunk-IMY6Z3YA.cjs} +3 -3
  22. package/dist/{chunk-YKO34INI.cjs → chunk-K5Z7QHTN.cjs} +1 -1
  23. package/dist/{chunk-7MR3ZC3G.js → chunk-KLJGACPT.js} +3 -3
  24. package/dist/{chunk-HS74B6NF.cjs → chunk-L667KKJP.cjs} +4 -4
  25. package/dist/{chunk-BS3IICLO.cjs → chunk-MU4WLTQR.cjs} +4 -4
  26. package/dist/chunk-N2L5GXPF.cjs +211 -0
  27. package/dist/chunk-NPP5B5PV.cjs +16 -0
  28. package/dist/chunk-OVZCXWUJ.js +1663 -0
  29. package/dist/{chunk-WO4HFIOO.js → chunk-OX42Y2HR.js} +1 -1
  30. package/dist/{chunk-BN4D4W23.js → chunk-P5OWX4UR.js} +4 -4
  31. package/dist/chunk-PTN427IG.js +24 -0
  32. package/dist/chunk-Q3FGRSLA.js +38 -0
  33. package/dist/chunk-QFF6OUH6.js +9 -0
  34. package/dist/chunk-QOM4AP6R.cjs +9 -0
  35. package/dist/chunk-QQDH35OW.cjs +9 -0
  36. package/dist/{chunk-ZZBI6DXY.js → chunk-R3SDTEHC.js} +1 -1
  37. package/dist/chunk-RHTBV6KZ.js +24 -0
  38. package/dist/{chunk-PXLLLBZ3.cjs → chunk-RQN3DXJB.cjs} +1 -1
  39. package/dist/{chunk-E7TZALBH.js → chunk-SWRFZ3FV.js} +1 -1
  40. package/dist/chunk-TFOTA27Y.js +211 -0
  41. package/dist/chunk-TH3DUBVR.js +35 -0
  42. package/dist/{chunk-JUDFZS5N.cjs → chunk-TKJYRGEU.cjs} +1 -1
  43. package/dist/{chunk-T2P4BAWY.js → chunk-V54NMMTT.cjs} +6 -6
  44. package/dist/chunk-WOXKZOJ3.js +10 -0
  45. package/dist/chunk-WTS6WHUH.js +1 -0
  46. package/dist/chunk-X7OGQ4KH.cjs +1 -0
  47. package/dist/chunk-YPCQNE3R.js +16 -0
  48. package/dist/chunk-ZTDQPDC6.js +2 -0
  49. package/dist/components/audio-track-menu.cjs +1 -1
  50. package/dist/components/audio-track-menu.js +1 -1
  51. package/dist/components/clip.cjs +1 -1
  52. package/dist/components/clip.js +1 -1
  53. package/dist/components/files.cjs +1 -1
  54. package/dist/components/files.js +1 -1
  55. package/dist/components/img.cjs +1 -1
  56. package/dist/components/img.js +1 -1
  57. package/dist/components/list.cjs +1 -1
  58. package/dist/components/list.js +1 -1
  59. package/dist/components/player.cjs +1 -1
  60. package/dist/components/player.js +1 -1
  61. package/dist/components/pop.cjs +1 -1
  62. package/dist/components/pop.js +1 -1
  63. package/dist/components/text.cjs +1 -1
  64. package/dist/components/text.js +1 -1
  65. package/dist/components/upload.cjs +1 -1
  66. package/dist/components/upload.js +1 -1
  67. package/dist/config.cjs +1 -1
  68. package/dist/config.d.cts +1 -1
  69. package/dist/config.d.ts +1 -1
  70. package/dist/config.js +1 -1
  71. package/dist/embed/api.cjs +1 -1
  72. package/dist/embed/api.js +1 -1
  73. package/dist/embed/caption.cjs +1 -1
  74. package/dist/embed/caption.js +1 -1
  75. package/dist/embed/controller.cjs +1 -1
  76. package/dist/embed/controller.js +1 -1
  77. package/dist/embed/socket.cjs +1 -1
  78. package/dist/embed/socket.js +1 -1
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.js +1 -1
  81. package/dist/react.cjs +1 -1
  82. package/dist/react.js +1 -1
  83. package/dist/themes/loader.cjs +1 -1
  84. package/dist/themes/loader.js +1 -1
  85. package/dist/utils/localization.cjs +1 -1
  86. package/dist/utils/localization.d.cts +2 -2
  87. package/dist/utils/localization.d.ts +2 -2
  88. package/dist/utils/localization.js +1 -1
  89. package/dist/utils/mave_element.cjs +1 -1
  90. package/dist/utils/mave_element.js +1 -1
  91. package/dist/vue.cjs +1 -1
  92. package/dist/vue.d.cts +16 -16
  93. package/dist/vue.d.ts +16 -16
  94. package/dist/vue.js +1 -1
  95. package/package.json +2 -2
  96. package/dist/chunk-27BWRXCN.js +0 -29
  97. package/dist/chunk-3T573OW4.cjs +0 -35
  98. package/dist/chunk-55JWHJJ5.cjs +0 -211
  99. package/dist/chunk-5STN56TL.cjs +0 -2
  100. package/dist/chunk-6XBQ5C3V.js +0 -17
  101. package/dist/chunk-BSJIDMTZ.js +0 -18
  102. package/dist/chunk-BZKKXYJP.js +0 -37
  103. package/dist/chunk-D75M3UFL.js +0 -1
  104. package/dist/chunk-D7LG2SMD.cjs +0 -33
  105. package/dist/chunk-ES5FUTSE.cjs +0 -1
  106. package/dist/chunk-F6EKAS27.js +0 -1
  107. package/dist/chunk-FUSQ4EZG.cjs +0 -3
  108. package/dist/chunk-GO6BV3T4.cjs +0 -29
  109. package/dist/chunk-HT464LCH.js +0 -10
  110. package/dist/chunk-J74VK4RB.cjs +0 -9
  111. package/dist/chunk-JBV2AYRP.js +0 -2
  112. package/dist/chunk-JR7IABIG.cjs +0 -18
  113. package/dist/chunk-KNAAIER3.js +0 -3
  114. package/dist/chunk-KUPCZDOX.cjs +0 -10
  115. package/dist/chunk-M22WSPSU.js +0 -9
  116. package/dist/chunk-NB5PC42C.js +0 -33
  117. package/dist/chunk-NROHM3YR.cjs +0 -1532
  118. package/dist/chunk-O2WRWRDO.cjs +0 -9
  119. package/dist/chunk-OIZ5B5LE.cjs +0 -17
  120. package/dist/chunk-TSTFPNEM.js +0 -211
  121. package/dist/chunk-TVXCJNTZ.js +0 -1532
  122. package/dist/chunk-UHJ4X2NY.cjs +0 -37
  123. package/dist/chunk-WIS6FQDY.cjs +0 -24
  124. package/dist/chunk-ZJWT7IOI.js +0 -24
  125. package/dist/chunk-ZODBVQLM.cjs +0 -1
  126. package/dist/chunk-ZUM5T3HV.js +0 -35
@@ -1,37 +0,0 @@
1
- 'use strict';var chunkJR7IABIG_cjs=require('./chunk-JR7IABIG.cjs'),chunkSDKTBB4N_cjs=require('./chunk-SDKTBB4N.cjs'),chunkJ74VK4RB_cjs=require('./chunk-J74VK4RB.cjs'),chunkPXLLLBZ3_cjs=require('./chunk-PXLLLBZ3.cjs'),chunkWIS6FQDY_cjs=require('./chunk-WIS6FQDY.cjs'),chunkGO6BV3T4_cjs=require('./chunk-GO6BV3T4.cjs'),chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var b=chunkJHSFSCC2_cjs.b(chunkJR7IABIG_cjs.b(),1);var i,v,c,u,y,M,p,I,S,T,r=class extends chunkGO6BV3T4_cjs.i{constructor(){super(...arguments);chunkJHSFSCC2_cjs.e(this,i);this.autoplay="lazy";this.quality="auto";this.fallback="placeholder";this._queue=[];this._failedPlay=false;this._intersectionObserver=new chunkJR7IABIG_cjs.a(this,{callback:chunkJHSFSCC2_cjs.g(this,i,S).bind(this)});this.embedController=new chunkPXLLLBZ3_cjs.b(this);}get embed(){return this._embedId}set embed(t){this._embedId!=t&&(this._embedId=t,this.requestUpdate("embed"),this.embedController.embed=this.embed);}set loop(t){this._loop=(t===""||t=="true"||t==true)??false;}get loop(){return this._loop}get poster(){return this.embedController.embedFile(`${this.fallback}.jpg`)}set poster(t){if(t){let s=this._poster;this._poster=t,this.requestUpdate("poster",s);}}get token(){return this._token}set token(t){this._token!=t&&(this._token=t,this.requestUpdate("token"),this.embedController.token=this._token);}get sources(){let t=this.autoplay==="scroll"?["clip_keyframes"]:["video","clip"],s=this._embed.video.renditions.filter(e=>(this.quality=="auto"?e.size!=="uhd":chunkJHSFSCC2_cjs.d(this,i,c).indexOf(e.size)<=chunkJHSFSCC2_cjs.d(this,i,c).indexOf(this.quality))&&e.container==="mp4"&&chunkJHSFSCC2_cjs.d(this,i,u).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,o)=>e.size===o.size?chunkJHSFSCC2_cjs.d(this,i,u).indexOf(e.codec)-chunkJHSFSCC2_cjs.d(this,i,u).indexOf(o.codec):chunkJHSFSCC2_cjs.d(this,i,c).indexOf(o.size)-chunkJHSFSCC2_cjs.d(this,i,c).indexOf(e.size)).map(e=>{let o=chunkJHSFSCC2_cjs.d(this,i,M).find(g=>g.size===e.size)?.media,m=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`;return {media:o,src:this.embedController.embedFile(m),codec:chunkJHSFSCC2_cjs.d(this,i,y)[e.codec]??e.codec}}),d=this._embed.video.renditions.filter(e=>chunkJHSFSCC2_cjs.d(this,i,c).indexOf(e.size)<=chunkJHSFSCC2_cjs.d(this,i,c).indexOf("fhd")&&e.container==="mp4"&&chunkJHSFSCC2_cjs.d(this,i,u).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,o)=>chunkJHSFSCC2_cjs.d(this,i,c).indexOf(o.size)-chunkJHSFSCC2_cjs.d(this,i,c).indexOf(e.size));if(d.length>0){let e=d[0],o=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`,m={media:void 0,src:this.embedController.embedFile(o),codec:chunkJHSFSCC2_cjs.d(this,i,y)[e.codec]??e.codec};s.push(m);}return s}connectedCallback(){super.connectedCallback(),typeof document<"u"&&this.autoplay==="scroll"&&document.addEventListener("scroll",chunkJHSFSCC2_cjs.g(this,i,v).bind(this));}disconnectedCallback(){super.disconnectedCallback(),typeof document<"u"&&this.autoplay==="scroll"&&document.removeEventListener("scroll",chunkJHSFSCC2_cjs.g(this,i,v).bind(this)),this._metricsInstance?.demonitor();}set muted(t){this._videoElement?this._videoElement.muted=t:this._queue.push(()=>this._videoElement.muted=t);}get muted(){return this._videoElement?.muted||false}get paused(){return this._videoElement?.paused??true}get duration(){return new Promise((t,s)=>{if(this._videoElement&&!isNaN(this._videoElement.duration))return t(this._videoElement.duration);let d=()=>{this._videoElement?.addEventListener("loadedmetadata",()=>{this._videoElement&&t(this._videoElement.duration);}),this._videoElement?.addEventListener("error",e=>{s(new Error("Failed to load video metadata."));});};this._videoElement?d():this.addEventListener("mave:video_element_ready",()=>{d();});})}set currentTime(t){this._videoElement?this._videoElement.currentTime=t:this._queue.push(()=>this._videoElement.currentTime=t);}get currentTime(){return this._videoElement?this._videoElement?.currentTime:0}play(){this._videoElement?chunkJHSFSCC2_cjs.g(this,i,p).call(this):this._queue.push(()=>chunkJHSFSCC2_cjs.g(this,i,p).call(this));}pause(){this._videoElement?this._videoElement.pause():this._queue.push(()=>this._videoElement?.pause());}render(){return chunkGO6BV3T4_cjs.c`
2
- ${this.embedController.render({complete:t=>{if(this._embed=t,!!t)return chunkGO6BV3T4_cjs.c`
3
- <video
4
- @click=${chunkJHSFSCC2_cjs.g(this,i,T)}
5
- preload="metadata"
6
- style=${chunkJ74VK4RB_cjs.a(this._failedPlay||this.autoplay==="off"?"cursor: pointer":void 0)}
7
- muted
8
- playsinline
9
- poster=${chunkJ74VK4RB_cjs.a(this._failedPlay?this.poster:void 0)}
10
- ${chunkJR7IABIG_cjs.c(chunkJHSFSCC2_cjs.g(this,i,I))}
11
- ?autoplay=${this.autoplay==="always"}
12
- ?loop=${this.loop||true}
13
- >
14
- ${this.sources.map(s=>chunkGO6BV3T4_cjs.c`
15
- <source
16
- media=${chunkJ74VK4RB_cjs.a(s.media?`(min-width: ${s.media}px)`:void 0)}
17
- src=${s.src}
18
- type=${`video/mp4; ${s.codec}`}
19
- />
20
- `)}
21
- </video>
22
- `}})}
23
- `}};i=new WeakSet,v=function(){if(typeof window>"u")return;let{height:t,top:s,bottom:d}=this.getBoundingClientRect(),e=window.innerHeight;if(this._videoElement){this._videoElement.duration||this._videoElement.load();let o=0;if(s<e&&d>0){let m=t+e;o=(e-s)/m*this._videoElement.duration;}o>=0&&o<=this._videoElement.duration&&(this._videoElement.currentTime=o);}},c=function(){return ["sd","hd","fhd","qhd","uhd"]},u=function(){let t=navigator.userAgent,s=/Edg/.test(t)&&/Mac OS/.test(t),d=/Safari/.test(t)&&!/Chrome/.test(t),e=/Mac OS/.test(t),o=/iPhone|iPad/.test(t);return e&&(d||s)||o?["hevc","h264"]:["av1","h264"]},y=function(){return {av1:"av01.0.08M.08.0.110.01.01.01.0,opus",hevc:"hevc.01.00.78,mp4a.40.2",h264:"avc1.64.00.28,mp4a.40.2"}},M=function(){return [{size:"qhd",media:1280},{size:"fhd",media:1080},{size:"hd",media:720},{size:"sd",media:640}]},p=function(){this._metricsInstance?.monitor(),this._videoElement&&(this._videoElement.muted=true,this._videoElement.play().catch(t=>{this._failedPlay=true;}));},I=function(t){if(this._videoElement||(this._videoElement=t,this.dispatchEvent(new CustomEvent("mave:video_element_ready",{detail:this._videoElement,bubbles:true,composed:true}))),this._intersectionObserver.observe(this._videoElement),this._videoElement&&this._embed){chunkSDKTBB4N_cjs.a.forEach(d=>{this._videoElement?.addEventListener(d,e=>{!this._canPlay&&this.autoplay==="scroll"&&d==="canplay"&&(this._canPlay=true,chunkJHSFSCC2_cjs.g(this,i,v).call(this)),this.dispatchEvent(new CustomEvent(d,{detail:e,bubbles:true,composed:true}));});});let s={component:"clip",video_id:this._embed.video.id,space_id:this._embed.space_id};b.Metrics.config={socketPath:chunk5STN56TL_cjs.a.metrics.socket,apiKey:this._embed.metrics_key},chunk5STN56TL_cjs.a.metrics.enabled&&(this._metricsInstance=new b.Metrics(this._videoElement,this.embed,s));}this._queue.length&&(this._queue.forEach(s=>s()),this._queue=[]);},S=function(t){for(let{isIntersecting:s}of t){if(this.autoplay==="always")return;s&&(this.autoplay==="lazy"||this.autoplay==="true")?this._videoElement?.paused&&chunkJHSFSCC2_cjs.g(this,i,p).call(this):this._videoElement?.paused||this._videoElement?.pause();}},T=function(){(this.autoplay==="off"||this._failedPlay)&&(this._videoElement?.paused?chunkJHSFSCC2_cjs.g(this,i,p).call(this):this._videoElement?.pause());},r.styles=chunkGO6BV3T4_cjs.h`
24
- :host {
25
- display: block;
26
- position: relative;
27
- overflow: hidden;
28
- }
29
-
30
- video {
31
- all: initial;
32
- display: block;
33
- width: 100%;
34
- height: 100%;
35
- object-fit: cover;
36
- }
37
- `,chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],r.prototype,"embed",1),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],r.prototype,"autoplay",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],r.prototype,"quality",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],r.prototype,"fallback",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],r.prototype,"loop",1),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],r.prototype,"poster",1),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],r.prototype,"token",1),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],r.prototype,"_failedPlay",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-clip")||window.customElements.define("mave-clip",r));exports.a=r;
@@ -1,24 +0,0 @@
1
- 'use strict';var chunkGO6BV3T4_cjs=require('./chunk-GO6BV3T4.cjs');var f={attribute:true,type:String,converter:chunkGO6BV3T4_cjs.a,reflect:false,hasChanged:chunkGO6BV3T4_cjs.b},h=(e=f,n,t)=>{let{kind:s,metadata:i}=t,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(t.name,e),s==="accessor"){let{name:r}=t;return {set(c){let o=n.get.call(this);n.set.call(this,c),this.requestUpdate(r,o,e);},init(c){return c!==void 0&&this.P(r,void 0,e),c}}}if(s==="setter"){let{name:r}=t;return function(c){let o=this[r];n.call(this,c),this.requestUpdate(r,o,e);}}throw Error("Unsupported decorator location: "+s)};function d(e){return (n,t)=>typeof t=="object"?h(e,n,t):((s,i,a)=>{let r=i.hasOwnProperty(a);return i.constructor.createProperty(a,r?{...s,wrapped:true}:s),r?Object.getOwnPropertyDescriptor(i,a):void 0})(e,n,t)}function b(e){return d({...e,state:true,attribute:false})}var u=(e,n,t)=>(t.configurable=true,t.enumerable=true,Reflect.decorate&&typeof n!="object"&&Object.defineProperty(e,n,t),t);function E(e,n){return (t,s,i)=>{let a=r=>r.renderRoot?.querySelector(e)??null;if(n){let{get:r,set:c}=typeof s=="object"?t:i??(()=>{let o=Symbol();return {get(){return this[o]},set(m){this[o]=m;}}})();return u(t,s,{get(){let o=r.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&c.call(this,o)),o}})}return u(t,s,{get(){return a(this)}})}}/*! Bundled license information:
2
-
3
- @lit/reactive-element/decorators/property.js:
4
- @lit/reactive-element/decorators/state.js:
5
- @lit/reactive-element/decorators/base.js:
6
- @lit/reactive-element/decorators/query.js:
7
- @lit/reactive-element/decorators/custom-element.js:
8
- @lit/reactive-element/decorators/event-options.js:
9
- @lit/reactive-element/decorators/query-all.js:
10
- @lit/reactive-element/decorators/query-async.js:
11
- @lit/reactive-element/decorators/query-assigned-nodes.js:
12
- (**
13
- * @license
14
- * Copyright 2017 Google LLC
15
- * SPDX-License-Identifier: BSD-3-Clause
16
- *)
17
-
18
- @lit/reactive-element/decorators/query-assigned-elements.js:
19
- (**
20
- * @license
21
- * Copyright 2021 Google LLC
22
- * SPDX-License-Identifier: BSD-3-Clause
23
- *)
24
- */exports.a=d;exports.b=b;exports.c=E;
@@ -1,24 +0,0 @@
1
- import {b as b$1,a}from'./chunk-27BWRXCN.js';var f={attribute:true,type:String,converter:a,reflect:false,hasChanged:b$1},h=(e=f,n,t)=>{let{kind:s,metadata:i}=t,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(t.name,e),s==="accessor"){let{name:r}=t;return {set(c){let o=n.get.call(this);n.set.call(this,c),this.requestUpdate(r,o,e);},init(c){return c!==void 0&&this.P(r,void 0,e),c}}}if(s==="setter"){let{name:r}=t;return function(c){let o=this[r];n.call(this,c),this.requestUpdate(r,o,e);}}throw Error("Unsupported decorator location: "+s)};function d(e){return (n,t)=>typeof t=="object"?h(e,n,t):((s,i,a)=>{let r=i.hasOwnProperty(a);return i.constructor.createProperty(a,r?{...s,wrapped:true}:s),r?Object.getOwnPropertyDescriptor(i,a):void 0})(e,n,t)}function b(e){return d({...e,state:true,attribute:false})}var u=(e,n,t)=>(t.configurable=true,t.enumerable=true,Reflect.decorate&&typeof n!="object"&&Object.defineProperty(e,n,t),t);function E(e,n){return (t,s,i)=>{let a=r=>r.renderRoot?.querySelector(e)??null;if(n){let{get:r,set:c}=typeof s=="object"?t:i??(()=>{let o=Symbol();return {get(){return this[o]},set(m){this[o]=m;}}})();return u(t,s,{get(){let o=r.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&c.call(this,o)),o}})}return u(t,s,{get(){return a(this)}})}}/*! Bundled license information:
2
-
3
- @lit/reactive-element/decorators/property.js:
4
- @lit/reactive-element/decorators/state.js:
5
- @lit/reactive-element/decorators/base.js:
6
- @lit/reactive-element/decorators/query.js:
7
- @lit/reactive-element/decorators/custom-element.js:
8
- @lit/reactive-element/decorators/event-options.js:
9
- @lit/reactive-element/decorators/query-all.js:
10
- @lit/reactive-element/decorators/query-async.js:
11
- @lit/reactive-element/decorators/query-assigned-nodes.js:
12
- (**
13
- * @license
14
- * Copyright 2017 Google LLC
15
- * SPDX-License-Identifier: BSD-3-Clause
16
- *)
17
-
18
- @lit/reactive-element/decorators/query-assigned-elements.js:
19
- (**
20
- * @license
21
- * Copyright 2021 Google LLC
22
- * SPDX-License-Identifier: BSD-3-Clause
23
- *)
24
- */export{d as a,b,E as c};
@@ -1 +0,0 @@
1
- 'use strict';var chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs');var i=chunk5STN56TL_cjs.a.api.endpoint;exports.a=i;
@@ -1,35 +0,0 @@
1
- import {a as a$2}from'./chunk-M22WSPSU.js';import {a as a$1}from'./chunk-SF36AD3G.js';import {a as a$3}from'./chunk-ZZBI6DXY.js';import {a,b}from'./chunk-ZJWT7IOI.js';import {h,i,f,c as c$1}from'./chunk-27BWRXCN.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};