@maveio/components 0.0.168 → 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-2E5GLLOS.cjs +19 -0
- package/dist/chunk-2FUCHY2J.cjs +35 -0
- package/dist/chunk-3BAQWQNY.cjs +25 -0
- package/dist/chunk-3UQNIS3L.js +194 -0
- package/dist/chunk-474VILDO.cjs +194 -0
- package/dist/chunk-5PIHL662.js +19 -0
- package/dist/chunk-5QLIDHRT.cjs +33 -0
- package/dist/chunk-AOBEOJ2U.cjs +10 -0
- package/dist/chunk-B6P2GJBQ.js +9 -0
- package/dist/chunk-BTCK3T4L.cjs +24 -0
- package/dist/{chunk-H5YWUSBE.js → chunk-CNPQ5Q2M.js} +1 -1
- package/dist/chunk-CVXHA76S.js +3 -0
- package/dist/chunk-CZUMF7SR.cjs +1 -0
- package/dist/chunk-DL4BV5IH.cjs +24 -0
- package/dist/chunk-EA4QYQHD.js +1639 -0
- package/dist/chunk-FAONFKQ2.cjs +9 -0
- package/dist/{chunk-LHWG7RHD.js → chunk-GRBSIFM2.js} +3 -3
- package/dist/chunk-GSVKVWEI.js +33 -0
- package/dist/chunk-HMVS6DJE.js +186 -0
- package/dist/chunk-IBQULJZC.cjs +3 -0
- package/dist/chunk-IETV3B4F.cjs +38 -0
- package/dist/chunk-ITC5FANW.cjs +1639 -0
- package/dist/{chunk-LGKQ3C7I.cjs → chunk-K5Z7QHTN.cjs} +1 -1
- package/dist/chunk-KO3CETGD.js +25 -0
- package/dist/chunk-LVGLIRQU.cjs +186 -0
- package/dist/chunk-N2L5GXPF.cjs +211 -0
- package/dist/{chunk-NX7L7P75.js → chunk-NDPOBFNC.js} +4 -4
- package/dist/chunk-NPP5B5PV.cjs +16 -0
- package/dist/{chunk-RIIKHYMD.cjs → chunk-OFBA5VRE.cjs} +3 -3
- package/dist/{chunk-FLXLRYLI.js → chunk-OX42Y2HR.js} +1 -1
- package/dist/chunk-PTN427IG.js +24 -0
- package/dist/chunk-Q3FGRSLA.js +38 -0
- package/dist/chunk-QFF6OUH6.js +9 -0
- package/dist/chunk-QOM4AP6R.cjs +9 -0
- package/dist/chunk-QQDH35OW.cjs +9 -0
- package/dist/{chunk-ZZBI6DXY.js → chunk-R3SDTEHC.js} +1 -1
- package/dist/chunk-RHTBV6KZ.js +24 -0
- package/dist/{chunk-RBBM42XM.cjs → chunk-RQN3DXJB.cjs} +1 -1
- package/dist/chunk-RWRHU74Q.js +1 -0
- package/dist/{chunk-FQRZLSBE.js → chunk-SWRFZ3FV.js} +1 -1
- package/dist/chunk-TFOTA27Y.js +211 -0
- package/dist/chunk-TH3DUBVR.js +35 -0
- package/dist/{chunk-4UB3XJZV.cjs → chunk-TJ5F2FGY.cjs} +4 -4
- package/dist/{chunk-42VJWULJ.cjs → chunk-TKJYRGEU.cjs} +1 -1
- package/dist/chunk-WOXKZOJ3.js +10 -0
- package/dist/chunk-YPCQNE3R.js +16 -0
- package/dist/{chunk-6KO66K2G.cjs → chunk-YWYZKUFB.cjs} +4 -4
- package/dist/{chunk-62PQDUAE.js → chunk-ZWLZE25P.js} +4 -4
- 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/img.cjs +1 -1
- package/dist/components/img.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/components/upload.cjs +1 -1
- package/dist/components/upload.js +1 -1
- package/dist/embed/caption.cjs +1 -1
- package/dist/embed/caption.js +1 -1
- package/dist/embed/controller.cjs +1 -1
- package/dist/embed/controller.js +1 -1
- package/dist/embed/socket.cjs +1 -1
- package/dist/embed/socket.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/utils/localization.cjs +1 -1
- package/dist/utils/localization.d.cts +2 -2
- package/dist/utils/localization.d.ts +2 -2
- package/dist/utils/localization.js +1 -1
- package/dist/utils/mave_element.cjs +1 -1
- package/dist/utils/mave_element.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +16 -16
- package/dist/vue.d.ts +16 -16
- package/dist/vue.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-27BWRXCN.js +0 -29
- package/dist/chunk-3J6Q5HPF.js +0 -37
- package/dist/chunk-3SSU5VNZ.cjs +0 -1532
- package/dist/chunk-43KJ6TMU.cjs +0 -17
- package/dist/chunk-6PSWE4MR.js +0 -3
- package/dist/chunk-6XBQ5C3V.js +0 -17
- package/dist/chunk-7SJMIXXD.js +0 -10
- package/dist/chunk-D75M3UFL.js +0 -1
- package/dist/chunk-D7LG2SMD.cjs +0 -33
- package/dist/chunk-DITZCOYN.cjs +0 -379
- package/dist/chunk-ES5FUTSE.cjs +0 -1
- package/dist/chunk-ETDEE7EL.cjs +0 -10
- package/dist/chunk-GO6BV3T4.cjs +0 -29
- package/dist/chunk-J74VK4RB.cjs +0 -9
- package/dist/chunk-M22WSPSU.js +0 -9
- package/dist/chunk-N27UPJGV.cjs +0 -37
- package/dist/chunk-NB5PC42C.js +0 -33
- package/dist/chunk-O2WRWRDO.cjs +0 -9
- package/dist/chunk-O4QBLS42.js +0 -17
- package/dist/chunk-OIZ5B5LE.cjs +0 -17
- package/dist/chunk-PJMR6NFX.js +0 -211
- package/dist/chunk-QPYU4D32.cjs +0 -3
- package/dist/chunk-T2P4BAWY.js +0 -379
- package/dist/chunk-VMGLCRPK.js +0 -35
- package/dist/chunk-WIS6FQDY.cjs +0 -24
- package/dist/chunk-WYXWOUKN.cjs +0 -211
- package/dist/chunk-XKFWCRVL.js +0 -1532
- package/dist/chunk-ZJWT7IOI.js +0 -24
- package/dist/chunk-ZQ3G5EQT.cjs +0 -35
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';var chunkRRCW5BBR_cjs=require('./chunk-RRCW5BBR.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs');var u="important",d=" !"+u,h=chunkRRCW5BBR_cjs.b(class extends chunkRRCW5BBR_cjs.c{constructor(s){if(super(s),s.type!==chunkRRCW5BBR_cjs.a.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((n,t)=>{let e=s[t];return e==null?n:n+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(s,[n]){let{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]==null&&(this.ft.delete(e),e.includes("-")?t.removeProperty(e):t[e]=null);for(let e in n){let r=n[e];if(r!=null){this.ft.add(e);let i=typeof r=="string"&&r.endsWith(d);e.includes("-")||i?t.setProperty(e,i?r.slice(0,-11):r,i?u:""):t[e]=r;}}return chunk2E5GLLOS_cjs.d}});/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
lit-html/directives/style-map.js:
|
|
4
|
+
(**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2018 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*)
|
|
9
|
+
*/exports.a=h;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {b as b$1,c as c$1,a as a$1}from'./chunk-MMHEOMF5.js';import {f as f$1,e}from'./chunk-5PIHL662.js';var fe=class{constructor(e,{target:s,config:r,callback:d,skipInitial:y}){this.t=new Set,this.o=false,this.i=false,this.h=e,s!==null&&this.t.add(s??e),this.o=y??this.o,this.callback=d,window.IntersectionObserver?(this.u=new IntersectionObserver(B=>{let _=this.i;this.i=false,this.o&&_||(this.handleChanges(B),this.h.requestUpdate());},r),e.addController(this)):console.warn("IntersectionController error: browser does not support IntersectionObserver.");}handleChanges(e){this.value=this.callback?.(e,this.u);}hostConnected(){for(let e of this.t)this.observe(e);}hostDisconnected(){this.disconnect();}async hostUpdated(){let e=this.u.takeRecords();e.length&&this.handleChanges(e);}observe(e){this.t.add(e),this.u.observe(e),this.i=true;}unobserve(e){this.t.delete(e),this.u.unobserve(e);}disconnect(){this.u.disconnect();}};var pe=i=>{throw TypeError(i)},ie=(i,e,s)=>e.has(i)||pe("Cannot "+s),t=(i,e,s)=>(ie(i,e,"read from private field"),s?s.call(i):e.get(i)),o=(i,e,s)=>e.has(i)?pe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),n=(i,e,s,r)=>(ie(i,e,"write to private field"),e.set(i,s),s),h=(i,e,s)=>(ie(i,e,"access private method"),s),G,_e=class R{static setDebug(e){n(R,G,e);}static debugEnabled(){if(t(R,G))return true;try{let e=globalThis;if(e.__MAVE_DATA_DEBUG__===!0||e.localStorage?.getItem("MAVE_DATA_DEBUG")==="1")return !0}catch{}return false}static log(e){console.log(`[mave_data]: ${e}`);}static error(e,s){typeof s>"u"?console.error(`[mave_data]: ${e}`):console.error(`[mave_data]: ${e}`,s);}static debug(e,s){R.debugEnabled()&&(typeof s>"u"?console.debug(`[mave_data]: ${e}`):console.debug(`[mave_data]: ${e}`,s));}};G=new WeakMap;o(_e,G,false);var f=_e,q,m,I,S,se,Y,z,W,p,me,ve,$,ne,ge,ye,be,we,ke,Ae,Be=class g{constructor(){if(o(this,p),o(this,q,{apiEndpoint:""}),o(this,m,[]),o(this,I,null),o(this,S,null),o(this,se,5e3),o(this,Y,50),o(this,z,48*1024),o(this,W,null),typeof window<"u"){let e=h(this,p,Ae).bind(this);n(this,S,e),document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e);}}static get instance_(){return g.instance||(g.instance=new g),g.instance}static set config(e){n(g.instance_,q,e),typeof e.debug=="boolean"&&f.setDebug(e.debug);}static push(e){var s;h(s=g.instance_,p,me).call(s,e);}static flush(){var e;h(e=g.instance_,p,$).call(e);}static flushAsync(){var e;return h(e=g.instance_,p,ve).call(e)}static flushOnExit(){var e;h(e=g.instance_,p,$).call(e,{keepalive:true,preferBeacon:true});}static __resetForTests(){var e;g.instance&&h(e=g.instance,p,ge).call(e),g.instance=void 0;}};q=new WeakMap;m=new WeakMap;I=new WeakMap;S=new WeakMap;se=new WeakMap;Y=new WeakMap;z=new WeakMap;W=new WeakMap;p=new WeakSet;me=function(i){let e={name:i.name||"unknown",timestamp:i.timestamp||Date.now(),session_id:i.session_id||"",...i};t(this,m).push(e),f.debug("Data.push",{name:e.name,session_id:e.session_id,embed_id:e.embed_id,video_time:e.video_time,buffer_size:t(this,m).length}),!t(this,I)&&typeof globalThis.setInterval=="function"&&n(this,I,globalThis.setInterval(()=>h(this,p,$).call(this),t(this,se))),t(this,m).length>=t(this,Y)&&h(this,p,$).call(this);};ve=function(i){return h(this,p,$).call(this,i),t(this,W)??Promise.resolve(true)};$=function(i){if(t(this,m).length===0||t(this,W))return;let e=[...t(this,m)];n(this,m,[]);let s=t(this,q).apiEndpoint||"https://metrics.video-dns.com/v1/events",r=i?.keepalive??(typeof document<"u"&&document.visibilityState==="hidden"),d=i?.preferBeacon??false,y=h(this,p,ye).call(this,e);f.debug("Data.flush.start",{url:s,buffered:e.length,batches:y.map(_=>_.length),keepalive:r,preferBeacon:d});let B=false;n(this,W,(async()=>{for(let _ of y){let Ce={events:_};if(f.debug("Data.flush.batch",{size:_.length,first:_[0]?.name,last:_[_.length-1]?.name}),!await h(this,p,we).call(this,s,Ce,r,d))return n(this,m,[..._,...t(this,m)]),false}return true})().catch(_=>(f.error("Failed to send metrics",_),n(this,m,[...e,...t(this,m)]),false)).then(_=>(f.debug("Data.flush.done",{ok:_,remaining_buffer:t(this,m).length}),_&&t(this,m).length>0&&(B=true),_)).finally(()=>{n(this,W,null),t(this,m).length===0&&h(this,p,ne).call(this),B&&h(this,p,$).call(this);}));};ne=function(){t(this,I)!=null&&(typeof globalThis.clearInterval=="function"&&globalThis.clearInterval(t(this,I)),n(this,I,null));};ge=function(){typeof window<"u"&&t(this,S)&&(document.removeEventListener("visibilitychange",t(this,S)),window.removeEventListener("pagehide",t(this,S)),window.removeEventListener("beforeunload",t(this,S))),h(this,p,ne).call(this),n(this,m,[]),n(this,W,null);};ye=function(i){let e=[],s=[],r=0;for(let d of i){let y=h(this,p,be).call(this,d),B=r+y>t(this,z),_=s.length>=t(this,Y);s.length>0&&(B||_)&&(e.push(s),s=[],r=0),s.push(d),r+=y;}return s.length>0&&e.push(s),e};be=function(i){try{return JSON.stringify(i).length}catch{return 1024}};we=async function(i,e,s,r){if(r&&s&&h(this,p,ke).call(this,i,e))return f.debug("Data.send.beacon",{url:i,bytes:JSON.stringify(e).length}),true;try{let d=await fetch(i,{method:"POST",keepalive:s,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return f.debug("Data.send.fetch",{url:i,ok:d.ok,status:d.status}),d.ok}catch(d){return f.error("Failed to send metrics",d),f.debug("Data.send.fetch.error",d),false}};ke=function(i,e){try{if(typeof navigator>"u"||typeof navigator.sendBeacon!="function")return !1;let s=JSON.stringify(e);if(s.length>t(this,z))return !1;let r=new Blob([s],{type:"application/json"});return navigator.sendBeacon(i,r)}catch{return false}};Ae=function(i){let e=i?.type==="pagehide"||i?.type==="beforeunload",s=document.visibilityState==="hidden";(e||s)&&(f.debug(`Data.handleVisibilityChange (${i?.type||"visibility"})`,{state:document.visibilityState}),h(this,p,$).call(this,{keepalive:true,preferBeacon:true}));};var u=Be;function Ne(){let i=globalThis.crypto;if(i?.randomUUID)return i.randomUUID();if(i?.getRandomValues)return "10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>{let d=i.getRandomValues(new Uint8Array(1))[0]??0;return (Number(r)^(d&15)>>Number(r)/4).toString(16)});let e=Math.random().toString(16).slice(2).padEnd(12,"0"),s=Date.now().toString(16).padStart(12,"0");return `${s.slice(0,8)}-${s.slice(8,12)}-4000-8000-${e.slice(0,12)}`}var ae=(i=>(i.PLAYING="playing",i.ENDED="ended",i.PAUSE="pause",i))(ae||{}),a,c,b,w,C,M,O,P,k,D,v,A,he,re,le,E,J,l,U,j,X,H,x,L,Me,Te,Ee,F,te,$e,Se,Pe,N,T,De,Ge=class{constructor(...i){if(o(this,l),this.VERSION="0.1.0",o(this,a),o(this,c,null),o(this,b,false),o(this,w,false),o(this,C,null),o(this,M,false),o(this,O,0),o(this,P,0),o(this,k,null),o(this,D,null),o(this,v,null),o(this,A,null),o(this,he,750),o(this,re,1),o(this,le,300),o(this,E,false),o(this,J,e=>h(this,l,De).call(this,e)),o(this,j,()=>{if(!t(this,b)||!t(this,a))return;h(this,l,U).call(this),f.debug("Metrics.native.seeking",{currentTime:t(this,a).currentTime,lastObservedVideoTime:t(this,P),paused:t(this,a).paused,seeking:t(this,a).seeking,lastEventType:t(this,c)});let e=t(this,c)==="play"||!t(this,a).paused&&!t(this,a).ended;if(e&&t(this,c)!=="pause"){n(this,w,true),n(this,M,false),h(this,l,F).call(this),h(this,l,T).call(this);let s=t(this,P)||t(this,a).currentTime||0,r=h(this,l,L).call(this,"pause");u.push({...r,name:"pause",video_time:s}),n(this,c,"pause"),u.flush(),f.debug("Metrics.scrub.pause_sent",{pauseTime:s,currentTime:t(this,a).currentTime});}else f.debug("Metrics.scrub.pause_not_sent",{wasPlaying:e,lastEventType:t(this,c)});}),o(this,X,()=>{t(this,b)&&t(this,a)&&(f.debug("Metrics.native.seeked",{currentTime:t(this,a).currentTime,paused:t(this,a).paused,seeking:t(this,a).seeking,wasPlayingBeforeSeek:t(this,w),lastEventType:t(this,c)}),t(this,w)&&(h(this,l,U).call(this),n(this,C,window.setTimeout(()=>{if(n(this,C,null),!!t(this,b)&&t(this,a)){if(t(this,c)==="play"){n(this,w,false),n(this,M,false);return}if(!t(this,a).seeking&&!t(this,a).paused&&!t(this,a).ended){let e=h(this,l,L).call(this,"play");u.push({...e,name:"play"}),n(this,c,"play"),n(this,D,Date.now()),n(this,E,true),n(this,O,Date.now()+1500),h(this,l,N).call(this),n(this,M,false),u.flush(),n(this,w,false);}else n(this,M,true),n(this,w,false);}},200))));}),o(this,H,()=>{t(this,b)&&document.visibilityState==="hidden"&&u.flush();}),o(this,x,e=>{if(t(this,b)){if(e.persisted){u.flush();return}h(this,l,te).call(this),h(this,l,Ee).call(this),u.flushOnExit();}}),this.sessionId=Ne(),i.length<2)f.error("Metrics requires two arguments: a querySelectorable, hls instance or HTMLMediaElement/HTMLVideoElement and a unique embedId for your video.");else if(typeof i[0]=="string"&&(this.querySelectorable=i[0],this.embedId=i[1]),i[0]instanceof HTMLVideoElement||i[0]instanceof HTMLMediaElement?n(this,a,i[0]):typeof i[0]=="object"&&(this.hls=i[0]),this.embedId=i[1],i[2]){let e=i[2];this.component=e.component;}}static set config(i){u.config=i,typeof i.debug=="boolean"&&f.setDebug(i.debug);}monitor(){let i=this.querySelectorable?document.querySelector(this.querySelectorable):this.hls?.media;return t(this,b)?this:(i||t(this,a)?(t(this,a)||n(this,a,i),f.debug("Metrics.monitor",{embed_id:this.embedId,session_id:this.sessionId,currentTime:t(this,a).currentTime,paused:t(this,a).paused,seeking:t(this,a).seeking,readyState:t(this,a).readyState}),h(this,l,Se).call(this),n(this,P,t(this,a).currentTime||0),window.addEventListener("visibilitychange",t(this,H)),window.addEventListener("pagehide",t(this,x)),n(this,b,true)):f.error(`${this.querySelectorable} is not a valid reference to a HTMLVideoElement.`),this)}demonitor(){t(this,b)&&(h(this,l,te).call(this),h(this,l,Me).call(this),h(this,l,U).call(this),h(this,l,T).call(this),h(this,l,Pe).call(this),window.removeEventListener("visibilitychange",t(this,H)),window.removeEventListener("pagehide",t(this,x)),n(this,b,false));}};a=new WeakMap;c=new WeakMap;b=new WeakMap;w=new WeakMap;C=new WeakMap;M=new WeakMap;O=new WeakMap;P=new WeakMap;k=new WeakMap;D=new WeakMap;v=new WeakMap;A=new WeakMap;he=new WeakMap;re=new WeakMap;le=new WeakMap;E=new WeakMap;J=new WeakMap;l=new WeakSet;U=function(){t(this,C)!=null&&(window.clearTimeout(t(this,C)),n(this,C,null));};j=new WeakMap;X=new WeakMap;H=new WeakMap;x=new WeakMap;L=function(i){return {name:i,duration:t(this,a)?.duration,video_time:t(this,a)?.currentTime,session_id:this.sessionId,embed_id:this.embedId||"unknown",component:this.component,source_url:window.location.href,timestamp:Date.now()}};Me=function(){t(this,a)&&(t(this,a).paused||t(this,c)!=="pause"&&(t(this,v)||(h(this,l,Te).call(this),u.flush())));};Te=function(){t(this,a)&&t(this,c)!=="pause"&&(t(this,v)||(u.push(h(this,l,L).call(this,"pause")),n(this,c,"pause")));};Ee=function(){t(this,a)&&t(this,c)==="play"&&(t(this,v)||(u.push(h(this,l,L).call(this,"pause")),n(this,c,"pause")));};F=function(){t(this,v)&&(window.clearTimeout(t(this,v)),n(this,v,null)),n(this,A,null);};te=function(){if(!t(this,v)||!t(this,A))return;window.clearTimeout(t(this,v));let i=t(this,A);n(this,v,null),n(this,A,null),u.push(i),n(this,c,"pause"),n(this,E,false),u.flush();};$e=function(i){t(this,v)||(n(this,A,i),n(this,v,window.setTimeout(()=>{if(!t(this,A)){n(this,v,null);return}let e=t(this,A);n(this,A,null),n(this,v,null),u.push(e),n(this,c,"pause"),u.flush();},t(this,le))));};Se=function(){f.debug("Metrics.listeners.attach",{embed_id:this.embedId,session_id:this.sessionId});for(let i of Object.values(ae))t(this,a).addEventListener(i,t(this,J));t(this,a).addEventListener("seeking",t(this,j)),t(this,a).addEventListener("seeked",t(this,X));};Pe=function(){for(let i of Object.values(ae))t(this,a).removeEventListener(i,t(this,J));t(this,a).removeEventListener("seeking",t(this,j)),t(this,a).removeEventListener("seeked",t(this,X));};N=function(){if(!t(this,a)||t(this,k)!=null)return;let i=()=>{if(!t(this,a)){n(this,k,null);return}n(this,P,t(this,a).currentTime||t(this,P)),t(this,b)&&!t(this,a).paused&&!t(this,a).ended?n(this,k,window.requestAnimationFrame(i)):n(this,k,null);};n(this,k,window.requestAnimationFrame(i));};T=function(){t(this,k)!=null&&(window.cancelAnimationFrame(t(this,k)),n(this,k,null));};De=function(i){let e=h(this,l,L).call(this,i.type);switch(f.debug("Metrics.native.event",{type:i.type,currentTime:t(this,a)?.currentTime,paused:t(this,a)?.paused,seeking:t(this,a)?.seeking,readyState:t(this,a)?.readyState,lastEventType:t(this,c),wasPlayingBeforeSeek:t(this,w),awaitingSeekResumePlay:t(this,M)}),i.type){case "playing":if(h(this,l,F).call(this),t(this,M)){if(t(this,c)!=="play"){let d=h(this,l,L).call(this,"play");u.push({...d,name:"play"}),n(this,c,"play"),n(this,D,Date.now()),n(this,E,true),n(this,O,Date.now()+1500),h(this,l,N).call(this),u.flush();}n(this,M,false);break}if(t(this,a)?.seeking||t(this,w))break;if(Date.now()<t(this,O)){n(this,c,"play"),h(this,l,N).call(this);break}if(t(this,c)==="play")break;u.push({...e,name:"play"}),n(this,c,"play"),n(this,D,Date.now()),n(this,E,false),h(this,l,N).call(this);break;case "pause":if(t(this,a)?.seeking){h(this,l,T).call(this);break}if(t(this,c)==="pause"){h(this,l,T).call(this);break}let s=t(this,D)==null?Number.POSITIVE_INFINITY:Date.now()-t(this,D),r=t(this,a)?.currentTime??0;if(s<=t(this,he)&&(r<=t(this,re)||t(this,E))){h(this,l,$e).call(this,{...e,name:"pause"}),h(this,l,T).call(this);break}u.push({...e,name:"pause"}),n(this,c,"pause"),n(this,E,false),h(this,l,T).call(this),u.flush();break;case "ended":h(this,l,F).call(this),h(this,l,T).call(this),t(this,c)!=="pause"&&(u.push({...e,name:"pause"}),n(this,c,"pause"),u.flush());break;}};var{I:ze}=f$1;var Ie=i=>i.strings===void 0;var V=(i,e)=>{let s=i._$AN;if(s===void 0)return false;for(let r of s)r._$AO?.(e,false),V(r,e);return true},Q=i=>{let e,s;do{if((e=i._$AM)===void 0)break;s=e._$AN,s.delete(i),i=e;}while(s?.size===0)},We=i=>{for(let e;e=i._$AM;i=e){let s=e._$AN;if(s===void 0)e._$AN=s=new Set;else if(s.has(i))break;s.add(i),Re(e);}};function Oe(i){this._$AN!==void 0?(Q(this),this._$AM=i,We(this)):this._$AM=i;}function Ve(i,e=false,s=0){let r=this._$AH,d=this._$AN;if(d!==void 0&&d.size!==0)if(e)if(Array.isArray(r))for(let y=s;y<r.length;y++)V(r[y],false),Q(r[y]);else r!=null&&(V(r,false),Q(r));else V(this,i);}var Re=i=>{i.type==a$1.CHILD&&(i._$AP??(i._$AP=Ve),i._$AQ??(i._$AQ=Oe));},K=class extends c$1{constructor(){super(...arguments),this._$AN=void 0;}_$AT(e,s,r){super._$AT(e,s,r),We(this),this.isConnected=e._$AU;}_$AO(e,s=true){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),s&&(V(this,e),Q(this));}setValue(e){if(Ie(this._$Ct))this._$Ct._$AI(e,this);else {let s=[...this._$Ct._$AH];s[this._$Ci]=e,this._$Ct._$AI(s,this,0);}}disconnected(){}reconnected(){}};var oe=new WeakMap,it=b$1(class extends K{render(i){return e}update(i,[e$1]){let s=e$1!==this.G;return s&&this.G!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.G=e$1,this.ht=i.options?.host,this.rt(this.ct=i.element)),e}rt(i){if(this.isConnected||(i=void 0),typeof this.G=="function"){let e=this.ht??globalThis,s=oe.get(e);s===void 0&&(s=new WeakMap,oe.set(e,s)),s.get(this.G)!==void 0&&this.G.call(this.ht,void 0),s.set(this.G,i),i!==void 0&&this.G.call(this.ht,i);}else this.G.value=i;}get lt(){return typeof this.G=="function"?oe.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0);}reconnected(){this.rt(this.ct);}});/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit-labs/observers/intersection-controller.js:
|
|
4
|
+
(**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2021 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*)
|
|
9
|
+
|
|
10
|
+
lit-html/directive-helpers.js:
|
|
11
|
+
lit-html/directives/ref.js:
|
|
12
|
+
(**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2020 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*)
|
|
17
|
+
|
|
18
|
+
lit-html/async-directive.js:
|
|
19
|
+
(**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*)
|
|
24
|
+
*/export{fe as a,Ge as b,it as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkX7OGQ4KH_cjs=require('./chunk-X7OGQ4KH.cjs'),
|
|
1
|
+
'use strict';var chunkX7OGQ4KH_cjs=require('./chunk-X7OGQ4KH.cjs'),chunkQOM4AP6R_cjs=require('./chunk-QOM4AP6R.cjs'),chunkEVKPEPYP_cjs=require('./chunk-EVKPEPYP.cjs');var c=(t=>(t[t.Collection=0]="Collection",t[t.Embed=1]="Embed",t))(c||{}),a=class{constructor(e,t=1){this.caching=true;this.loading=true;this.host=e,this.type=t,this.loading=true,this.task=new chunkQOM4AP6R_cjs.a(this.host,async()=>{try{if(this.type==1&&!this.embed)return;if(this.type==0&&!this.token){console.warn("No token attr provided for mave-list");return}let i=await(await fetch(this.manifest_url)).json();return this.loading=!1,this.type==1?(this._embedData=i,this.version=this._embedData.video?.version||0,this._embedData):i}catch(s){throw console.log(s),new Error(`Failed to fetch "${this.embed}"`)}},()=>[this.embed]);}get manifest_url(){if(this.type==1)return this.embedFile("manifest.json");{let e=new URL(`${chunkX7OGQ4KH_cjs.a}/collection/${this.token}`);return this.embed&&this.embed?.length>1&&e.searchParams.append("embed",this.embed),e.toString()}}set embed(e){this._embed!=e&&(this._embed=e,this.loading=true,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed?.substring(0,5)}get embedId(){return this.embed?.substring(5,this.embed?.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return chunkEVKPEPYP_cjs.a.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}refresh(){return this.loading=true,this.task?.run()}embedFile(e,t=new URLSearchParams){let s=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest.json"?"/":this.version}${e}`);if(e.includes("?")){let[i,h]=e.split("?");new URLSearchParams(h).forEach((d,m)=>{t.append(m,d);});}return this.token&&t.append("token",this.token),e=="manifest.json"&&(t.has("e")&&t.delete("e"),t.append("e",new Date().getTime().toString())),e!=="manifest.json"&&!this.caching&&(t.has("e")||t.append("e",new Date().getTime().toString())),s.search=t.toString(),s.toString()}render(e){return this.task?.render(e)}};exports.a=c;exports.b=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$3}from'./chunk-P6SBZPDR.js';import {g,a as a$1}from'./chunk-5PIHL662.js';import {a as a$2}from'./chunk-YPCQNE3R.js';var a=["default","synthwave","dolphin"],h={default:()=>import('./themes/default.js'),synthwave:()=>import('./themes/synthwave.js'),dolphin:()=>import('./themes/dolphin.js')};async function p(t){if(!a.includes(t))return;if(!!a$3()){let e=`./dist/themes/${t}.js`;return c(e)}let s=h[t];return s?s():void 0}async function c(t){return import(t)}var d=class t{constructor(){this.themes=[];}static async get(n,s){if(t.instance||(t.instance=new t),t.instance.themes.find(e=>e.name===n))return t.instance.currentTheme=n,Promise.resolve(t.instance);t.instance.themes.push({name:n}),t.instance.currentTheme=n;try{if(typeof document<"u"&&!a.includes(n)){let e=document.createElement("link");e.rel="stylesheet",e.href=`${s}/${n}.css`,document.head.appendChild(e);}}catch(e){console.log("[mave-player]: theme css not loaded",e);}try{if(s&&!a.includes(n)){let{build:e}=await c(`${s}/${n}.js`);e(n,g,a$1,a$2);}else {let e=await p(n);if(e)e.build(n,g,a$1,a$2);else {let m=`./${a$3()}themes/${n}.js`,{build:u}=await c(m);u(n,g,a$1,a$2);}}}catch(e){console.log("[mave-player]: theme not loaded",e);}return Promise.resolve(t.instance)}static async external(n){t.instance||(t.instance=new t);let s=n.split("/").pop()?.replace(".js","")||"";try{if(typeof document<"u"){let e=document.createElement("link");e.rel="stylesheet",e.href=`${n.replace(".js","")}.css`,document.head.appendChild(e);}}catch(e){console.log("[mave-player]: theme css not loaded",e);}if(t.instance.themes.find(e=>e.name===s))return t.instance.currentTheme=s,Promise.resolve(t.instance);t.instance.themes.push({name:s}),t.instance.currentTheme=s;try{let{build:e}=await c(n);e(s,g,a$1,a$2);}catch(e){console.log("[mave-player]: theme not loaded",e);}return Promise.resolve(t.instance)}static getTheme(){return t.instance?t.instance.currentTheme:""}};export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-PTN427IG.js';import {g,a as a$2}from'./chunk-5PIHL662.js';import {a as a$1}from'./chunk-ZTDQPDC6.js';import {c}from'./chunk-KA24PL7V.js';var s=class extends g{constructor(){super(...arguments);this.EVENT_TYPES={CLICK:"user_click"};}get embed(){return this._embed}set embed(t){this._embed=t;}get embedId(){return this._embed?.substring(5,this._embed?.length)}get spaceId(){return this.embed?.substring(0,5)}get cdn_root(){return a$1.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}get _stylesheets(){if(typeof document>"u")return a$2``;let t=document.querySelectorAll('style, link[rel="stylesheet"]');return a$2`${Array.from(t).map(e=>e.cloneNode(true))}`}durationToTime(t){let e=Math.floor(t),n=Math.floor(e/3600),i=Math.floor(e%3600/60),o=e%60;return n>0?`${n}:${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${i}:${o.toString().padStart(2,"0")}`}emit(t,e){this.dispatchEvent(new CustomEvent(`mave:${t}`,{detail:{...e,eventType:t}})),this.dispatchEvent(new CustomEvent("mave:*",{detail:{...e,eventType:t}}));}};c([a({type:String})],s.prototype,"embed",1);export{s as a};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import {a as a$3}from'./chunk-CVXHA76S.js';import {b as b$2,d,a as a$5}from'./chunk-GSVKVWEI.js';import {a as a$6}from'./chunk-B6P2GJBQ.js';import {a as a$2,b as b$1,c as c$1}from'./chunk-PTN427IG.js';import {g,a as a$7}from'./chunk-5PIHL662.js';import {a as a$1}from'./chunk-YPCQNE3R.js';import {a as a$4}from'./chunk-ZTDQPDC6.js';import {a,b,c}from'./chunk-KA24PL7V.js';var kt=a((ro,Pt)=>{Pt.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return false;switch(r){case "http":case "ws":return t!==80;case "https":case "wss":return t!==443;case "ftp":return t!==21;case "gopher":return t!==70;case "file":return false}return t!==0};});var Ct=a(Ie=>{var Xr=Object.prototype.hasOwnProperty,Vr;function Rt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Dt(e){try{return encodeURIComponent(e)}catch{return null}}function Wr(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var o=Rt(n[1]),a=Rt(n[2]);o===null||a===null||o in r||(r[o]=a);}return r}function Yr(e,t){t=t||"";var r=[],n,o;typeof t!="string"&&(t="?");for(o in e)if(Xr.call(e,o)){if(n=e[o],!n&&(n===null||n===Vr||isNaN(n))&&(n=""),o=Dt(o),n=Dt(n),o===null||n===null)continue;r.push(o+"="+n);}return r.length?t+r.join("&"):""}Ie.stringify=Yr;Ie.parse=Wr;});var Ht=a((oo,Nt)=>{var jt=kt(),_e=Ct(),Zr=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,At=/[\n\r\t]/g,Jr=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Lt=/:\d+$/,Qr=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,en=/^[a-zA-Z]:/;function He(e){return (e||"").toString().replace(Zr,"")}var Ne=[["#","hash"],["?","query"],function(t,r){return A(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Tt={hash:1,query:1};function Ft(e){var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t={};var r=t.location||{};e=e||r;var n={},o=typeof e,a;if(e.protocol==="blob:")n=new L(unescape(e.pathname),{});else if(o==="string"){n=new L(e,{});for(a in Tt)delete n[a];}else if(o==="object"){for(a in e)a in Tt||(n[a]=e[a]);n.slashes===void 0&&(n.slashes=Jr.test(e.href));}return n}function A(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function It(e,t){e=He(e),e=e.replace(At,""),t=t||{};var r=Qr.exec(e),n=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],u=0,c;return o?a?(c=r[2]+r[3]+r[4],u=r[2].length+r[3].length):(c=r[2]+r[4],u=r[2].length):a?(c=r[3]+r[4],u=r[3].length):c=r[4],n==="file:"?u>=2&&(c=c.slice(2)):A(n)?c=r[4]:n?o&&(c=c.slice(2)):u>=2&&A(t.protocol)&&(c=r[4]),{protocol:n,slashes:o||A(n),slashesCount:u,rest:c}}function tn(e,t){if(e==="")return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],a=false,u=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),u++):u&&(n===0&&(a=true),r.splice(n,1),u--);return a&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}function L(e,t,r){if(e=He(e),e=e.replace(At,""),!(this instanceof L))return new L(e,t,r);var n,o,a,u,c,h,m=Ne.slice(),v=typeof t,y=this,C=0;for(v!=="object"&&v!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=_e.parse),t=Ft(t),o=It(e||"",t),n=!o.protocol&&!o.slashes,y.slashes=o.slashes||n&&t.slashes,y.protocol=o.protocol||t.protocol||"",e=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||en.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!A(y.protocol)))&&(m[3]=[/(.*)/,"pathname"]);C<m.length;C++){if(u=m[C],typeof u=="function"){e=u(e,y);continue}a=u[0],h=u[1],a!==a?y[h]=e:typeof a=="string"?(c=a==="@"?e.lastIndexOf(a):e.indexOf(a),~c&&(typeof u[2]=="number"?(y[h]=e.slice(0,c),e=e.slice(c+u[2])):(y[h]=e.slice(c),e=e.slice(0,c)))):(c=a.exec(e))&&(y[h]=c[1],e=e.slice(0,c.index)),y[h]=y[h]||n&&u[3]&&t[h]||"",u[4]&&(y[h]=y[h].toLowerCase());}r&&(y.query=r(y.query)),n&&t.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||t.pathname!=="")&&(y.pathname=tn(y.pathname,t.pathname)),y.pathname.charAt(0)!=="/"&&A(y.protocol)&&(y.pathname="/"+y.pathname),jt(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(c=y.auth.indexOf(":"),~c?(y.username=y.auth.slice(0,c),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(c+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&A(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString();}function rn(e,t,r){var n=this;switch(e){case "query":typeof t=="string"&&t.length&&(t=(r||_e.parse)(t)),n[e]=t;break;case "port":n[e]=t,jt(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case "hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case "host":n[e]=t,Lt.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case "protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case "pathname":case "hash":if(t){var o=e==="pathname"?"/":"#";n[e]=t.charAt(0)!==o?o+t:t;}else n[e]=t;break;case "username":case "password":n[e]=encodeURIComponent(t);break;case "auth":var a=t.indexOf(":");~a?(n.username=t.slice(0,a),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=t.slice(a+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(t));}for(var u=0;u<Ne.length;u++){var c=Ne[u];c[4]&&(n[c[1]]=n[c[1]].toLowerCase());}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&A(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function nn(e){(!e||typeof e!="function")&&(e=_e.stringify);var t,r=this,n=r.host,o=r.protocol;o&&o.charAt(o.length-1)!==":"&&(o+=":");var a=o+(r.protocol&&r.slashes||A(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):r.protocol!=="file:"&&A(r.protocol)&&!n&&r.pathname!=="/"&&(a+="@"),(n[n.length-1]===":"||Lt.test(r.hostname)&&!r.port)&&(n+=":"),a+=n+r.pathname,t=typeof r.query=="object"?e(r.query):r.query,t&&(a+=t.charAt(0)!=="?"?"?"+t:t),r.hash&&(a+=r.hash),a}L.prototype={set:rn,toString:nn};L.extractProtocol=It;L.location=Ft;L.trimLeft=He;L.qs=_e;Nt.exports=L;});function J(e){"@babel/helpers - typeof";return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(e)}function wr(e,t,r){return Object.defineProperty(e,"prototype",{writable:false}),e}function xr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Or(e,t,r){return t=fe(t),Ur(e,Te()?Reflect.construct(t,r||[],fe(e).constructor):t.apply(e,r))}function Ur(e,t){if(t&&(J(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pr(e)}function Pr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}}),Object.defineProperty(e,"prototype",{writable:false}),t&&ue(e,t);}function Ce(e){var t=typeof Map=="function"?new Map:void 0;return Ce=function(n){if(n===null||!Dr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,o);}function o(){return Rr(n,arguments,fe(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:false,writable:true,configurable:true}}),ue(o,n)},Ce(e)}function Rr(e,t,r){if(Te())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&ue(o,r.prototype),o}function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (Te=function(){return !!e})()}function Dr(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function ue(e,t){return ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ue(e,t)}function fe(e){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fe(e)}var Cr=(function(e){function t(r){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(xr(this,t),n=Or(this,t,[r]),n.originalRequest=a,n.originalResponse=u,n.causingError=o,o!=null&&(r+=", caused by ".concat(o.toString())),a!=null){var c=a.getHeader("X-Request-ID")||"n/a",h=a.getMethod(),m=a.getURL(),v=u?u.getStatus():"n/a",y=u?u.getBody()||"":"n/a";r+=", originated from request (method: ".concat(h,", url: ").concat(m,", response code: ").concat(v,", response text: ").concat(y,", request id: ").concat(c,")");}return n.message=r,n}return kr(t,e),wr(t)})(Ce(Error)),Q=Cr;function B(e){}function ce(e){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(e)}function jr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function at(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Lr(n.key),n);}}function Ar(e,t,r){return t&&at(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Lr(e){var t=Fr(e,"string");return ce(t)=="symbol"?t:t+""}function Fr(e,t){if(ce(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ce(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var st=(function(){function e(){jr(this,e);}return Ar(e,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])})();var ht="3.7.8",Ir=ht,te=typeof Buffer=="function",lt=typeof TextDecoder=="function"?new TextDecoder:void 0,ut=typeof TextEncoder=="function"?new TextEncoder:void 0,Nr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",pe=Array.prototype.slice.call(Nr),ve=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(pe),Hr=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,O=String.fromCharCode.bind(String),ft=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),dt=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),yt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),mt=e=>{let t,r,n,o,a="",u=e.length%3;for(let c=0;c<e.length;){if((r=e.charCodeAt(c++))>255||(n=e.charCodeAt(c++))>255||(o=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,a+=pe[t>>18&63]+pe[t>>12&63]+pe[t>>6&63]+pe[t&63];}return u?a.slice(0,u-3)+"===".substring(u):a},Le=typeof btoa=="function"?e=>btoa(e):te?e=>Buffer.from(e,"binary").toString("base64"):mt,je=te?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(O.apply(null,e.subarray(n,n+4096)));return Le(r.join(""))},be=(e,t=false)=>t?dt(je(e)):je(e),Br=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?O(192|t>>>6)+O(128|t&63):O(224|t>>>12&15)+O(128|t>>>6&63)+O(128|t&63)}else {var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return O(240|t>>>18&7)+O(128|t>>>12&63)+O(128|t>>>6&63)+O(128|t&63)}},zr=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,gt=e=>e.replace(zr,Br),ct=te?e=>Buffer.from(e,"utf8").toString("base64"):ut?e=>je(ut.encode(e)):e=>Le(gt(e)),ee=(e,t=false)=>t?dt(ct(e)):ct(e),pt=e=>ee(e,true),qr=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Mr=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return O((r>>>10)+55296)+O((r&1023)+56320);case 3:return O((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return O((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},vt=e=>e.replace(qr,Mr),bt=e=>{if(e=e.replace(/\s+/g,""),!Hr.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,o=[];for(let a=0;a<e.length;)t=ve[e.charAt(a++)]<<18|ve[e.charAt(a++)]<<12|(r=ve[e.charAt(a++)])<<6|(n=ve[e.charAt(a++)]),r===64?o.push(O(t>>16&255)):n===64?o.push(O(t>>16&255,t>>8&255)):o.push(O(t>>16&255,t>>8&255,t&255));return o.join("")},Fe=typeof atob=="function"?e=>atob(yt(e)):te?e=>Buffer.from(e,"base64").toString("binary"):bt,_t=te?e=>ft(Buffer.from(e,"base64")):e=>ft(Fe(e).split("").map(t=>t.charCodeAt(0))),wt=e=>_t(St(e)),$r=te?e=>Buffer.from(e,"base64").toString("utf8"):lt?e=>lt.decode(_t(e)):e=>vt(Fe(e)),St=e=>yt(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Ae=e=>$r(St(e)),Gr=e=>{if(typeof e!="string")return false;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return !/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Et=e=>({value:e,enumerable:false,writable:true,configurable:true}),xt=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,Et(r));e("fromBase64",function(){return Ae(this)}),e("toBase64",function(t){return ee(this,t)}),e("toBase64URI",function(){return ee(this,true)}),e("toBase64URL",function(){return ee(this,true)}),e("toUint8Array",function(){return wt(this)});},Ot=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Et(r));e("toBase64",function(t){return be(this,t)}),e("toBase64URI",function(){return be(this,true)}),e("toBase64URL",function(){return be(this,true)});},Kr=()=>{xt(),Ot();},Ut={version:ht,VERSION:Ir,atob:Fe,atobPolyfill:bt,btoa:Le,btoaPolyfill:mt,fromBase64:Ae,toBase64:ee,encode:ee,encodeURI:pt,encodeURL:pt,utob:gt,btou:vt,decode:Ae,isValid:Gr,fromUint8Array:be,toUint8Array:wt,extendString:xt,extendUint8Array:Ot,extendBuiltins:Kr};var Jt=b(Ht());function Be(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}function ze(){ze=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(l,i,s){l[i]=s.value;},a=typeof Symbol=="function"?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function m(l,i,s){return Object.defineProperty(l,i,{value:s,enumerable:true,configurable:true,writable:true}),l[i]}try{m({},"");}catch{m=function(s,f,d){return s[f]=d};}function v(l,i,s,f){var d=i&&i.prototype instanceof F?i:F,p=Object.create(d.prototype),g=new $(f||[]);return o(p,"_invoke",{value:Pe(l,s,g)}),p}function y(l,i,s){try{return {type:"normal",arg:l.call(i,s)}}catch(f){return {type:"throw",arg:f}}}t.wrap=v;var C="suspendedStart",ae="suspendedYield",z="executing",j="completed",S={};function F(){}function R(){}function E(){}var T={};m(T,u,function(){return this});var q=Object.getPrototypeOf,I=q&&q(q(G([])));I&&I!==r&&n.call(I,u)&&(T=I);var D=E.prototype=F.prototype=Object.create(T);function se(l){["next","throw","return"].forEach(function(i){m(l,i,function(s){return this._invoke(i,s)});});}function N(l,i){function s(d,p,g,b){var _=y(l[d],l,p);if(_.type!=="throw"){var U=_.arg,x=U.value;return x&&W(x)=="object"&&n.call(x,"__await")?i.resolve(x.__await).then(function(P){s("next",P,g,b);},function(P){s("throw",P,g,b);}):i.resolve(x).then(function(P){U.value=P,g(U);},function(P){return s("throw",P,g,b)})}b(_.arg);}var f;o(this,"_invoke",{value:function(p,g){function b(){return new i(function(_,U){s(p,g,_,U);})}return f=f?f.then(b,b):b()}});}function Pe(l,i,s){var f=C;return function(d,p){if(f===z)throw Error("Generator is already running");if(f===j){if(d==="throw")throw p;return {value:e,done:true}}for(s.method=d,s.arg=p;;){var g=s.delegate;if(g){var b=le(g,s);if(b){if(b===S)continue;return b}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(f===C)throw f=j,s.arg;s.dispatchException(s.arg);}else s.method==="return"&&s.abrupt("return",s.arg);f=z;var _=y(l,i,s);if(_.type==="normal"){if(f=s.done?j:ae,_.arg===S)continue;return {value:_.arg,done:s.done}}_.type==="throw"&&(f=j,s.method="throw",s.arg=_.arg);}}}function le(l,i){var s=i.method,f=l.iterator[s];if(f===e)return i.delegate=null,s==="throw"&&l.iterator.return&&(i.method="return",i.arg=e,le(l,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),S;var d=y(f,l.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,S;var p=d.arg;return p?p.done?(i[l.resultName]=p.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,S):p:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,S)}function ke(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i);}function M(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i;}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(ke,this),this.reset(true);}function G(l){if(l||l===""){var i=l[u];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,f=function d(){for(;++s<l.length;)if(n.call(l,s))return d.value=l[s],d.done=false,d;return d.value=e,d.done=true,d};return f.next=f}}throw new TypeError(W(l)+" is not iterable")}return R.prototype=E,o(D,"constructor",{value:E,configurable:true}),o(E,"constructor",{value:R,configurable:true}),R.displayName=m(E,h,"GeneratorFunction"),t.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return !!i&&(i===R||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,E):(l.__proto__=E,m(l,h,"GeneratorFunction")),l.prototype=Object.create(D),l},t.awrap=function(l){return {__await:l}},se(N.prototype),m(N.prototype,c,function(){return this}),t.AsyncIterator=N,t.async=function(l,i,s,f,d){d===void 0&&(d=Promise);var p=new N(v(l,i,s,f),d);return t.isGeneratorFunction(i)?p:p.next().then(function(g){return g.done?g.value:p.next()})},se(D),m(D,h,"Generator"),m(D,u,function(){return this}),m(D,"toString",function(){return "[object Generator]"}),t.keys=function(l){var i=Object(l),s=[];for(var f in i)s.push(f);return s.reverse(),function d(){for(;s.length;){var p=s.pop();if(p in i)return d.value=p,d.done=false,d}return d.done=true,d}},t.values=G,$.prototype={constructor:$,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=false,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!i)for(var s in this)s.charAt(0)==="t"&&n.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=e);},stop:function(){this.done=true;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var s=this;function f(U,x){return g.type="throw",g.arg=i,s.next=U,x&&(s.method="next",s.arg=e),!!x}for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d],g=p.completion;if(p.tryLoc==="root")return f("end");if(p.tryLoc<=this.prev){var b=n.call(p,"catchLoc"),_=n.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return f(p.catchLoc,true);if(this.prev<p.finallyLoc)return f(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return f(p.catchLoc,true)}else {if(!_)throw Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return f(p.finallyLoc)}}}},abrupt:function(i,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var p=d;break}}p&&(i==="break"||i==="continue")&&p.tryLoc<=s&&s<=p.finallyLoc&&(p=null);var g=p?p.completion:{};return g.type=i,g.arg=s,p?(this.method="next",this.next=p.finallyLoc,S):this.complete(g)},complete:function(i,s){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&s&&(this.next=s),S},finish:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),M(f),S}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var p=d.arg;M(f);}return p}}throw Error("illegal catch attempt")},delegateYield:function(i,s,f){return this.delegate={iterator:G(i),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=e),S}},t}function Bt(e,t,r,n,o,a,u){try{var c=e[a](u),h=c.value;}catch(m){r(m);return}c.done?t(h):Promise.resolve(h).then(n,o);}function on(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function u(h){Bt(a,n,o,u,c,"next",h);}function c(h){Bt(a,n,o,u,c,"throw",h);}u(void 0);})}}function Wt(e,t){return ln(e)||sn(e,t)||Yt(e,t)||an()}function an(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,u,c=[],h=true,m=false;try{if(a=(r=r.call(e)).next,t===0);else for(;!(h=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);h=!0);}catch(v){m=true,o=v;}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(m)throw o}}return c}}function ln(e){if(Array.isArray(e))return e}function W(e){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function un(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Yt(e))||t){r&&(e=r);var n=0,o=function(){};return {s:o,n:function(){return n>=e.length?{done:true}:{done:false,value:e[n++]}},e:function(m){throw m},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=true,u=false,c;return {s:function(){r=r.call(e);},n:function(){var m=r.next();return a=m.done,m},e:function(m){u=true,c=m;},f:function(){try{!a&&r.return!=null&&r.return();}finally{if(u)throw c}}}}function Yt(e,t){if(e){if(typeof e=="string")return zt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zt(e,t)}}function zt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qt(Object(r),true).forEach(function(n){fn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function fn(e,t,r){return t=Zt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function cn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Zt(n.key),n);}}function pn(e,t,r){return t&&Mt(e.prototype,t),r&&Mt(e,r),Object.defineProperty(e,"prototype",{writable:false}),e}function Zt(e){var t=hn(e,"string");return W(t)=="symbol"?t:t+""}function hn(e,t){if(W(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(W(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var we="tus-v1",Se="ietf-draft-03",he="ietf-draft-05",dn={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:false,headers:{},addRequestId:false,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:er,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:true,removeFingerprintOnSuccess:false,uploadLengthDeferred:false,uploadDataDuringCreation:false,urlStorage:null,fileReader:null,httpStack:null,protocol:we},Qt=(function(){function e(t,r){cn(this,e),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=false,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null;}return pn(e,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey;}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![we,Se,he].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var o=this.options.retryDelays;if(o!=null&&Object.prototype.toString.call(o)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var a=0,u=["uploadUrl","uploadSize","uploadLengthDeferred"];a<u.length;a++){var c=u[a];if(this.options[c]){this._emitError(new Error("tus: cannot use the ".concat(c," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(h){return r._fingerprint=h,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(h){if(r._source=h,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload();}).catch(function(h){r._emitError(h);});}},{key:"_startParallelUpload",value:function(){var r,n=this,o=this._size,a=0;this._parallelUploads=[];var u=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,c=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:mn(this._source.size,u);this._parallelUploadUrls&&c.forEach(function(v,y){v.uploadUrl=n._parallelUploadUrls[y]||null;}),this._parallelUploadUrls=new Array(c.length);var h=c.map(function(v,y){var C=0;return n._source.slice(v.start,v.end).then(function(ae){var z=ae.value;return new Promise(function(j,S){var F=re(re({},n.options),{},{uploadUrl:v.uploadUrl||null,storeFingerprintForResuming:false,removeFingerprintOnSuccess:false,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:re(re({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:j,onError:S,onProgress:function(T){a=a-C+T,C=T,n._emitProgress(a,o);},onUploadUrlAvailable:function(){n._parallelUploadUrls[y]=R.url,n._parallelUploadUrls.filter(function(T){return !!T}).length===c.length&&n._saveUploadInUrlStorage();}}),R=new e(z,F);R.start(),n._parallelUploads.push(R);})})}),m;Promise.all(h).then(function(){m=n._openRequest("POST",n.options.endpoint),m.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var v=$t(n.options.metadata);return v!==""&&m.setHeader("Upload-Metadata",v),n._sendRequest(m,null)}).then(function(v){if(!ne(v.getStatus(),200)){n._emitHttpError(m,v,"tus: unexpected response while creating upload");return}var y=v.getHeader("Location");if(y==null){n._emitHttpError(m,v,"tus: invalid or missing Location header");return}n.url=Vt(n.options.endpoint,y),B("Created upload at ".concat(n.url)),n._emitSuccess(v);}).catch(function(v){n._emitError(v);});}},{key:"_startSingleUpload",value:function(){if(this._aborted=false,this.url!=null){B("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){B("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload();}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var o=un(this._parallelUploads),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;u.abort(r);}}catch(c){o.e(c);}finally{o.f();}}return this._req!==null&&this._req.abort(),this._aborted=true,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():e.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,o,a){this._emitError(new Q(o,a,r,n));}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var o=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(o&&(this._retryAttempt=0),Xt(r,this._retryAttempt,this.options)){var a=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start();},a);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r});}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n);}},{key:"_emitChunkComplete",value:function(r,n,o){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,o);}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var o=$t(this.options.metadata);o!==""&&n.setHeader("Upload-Metadata",o);var a;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,a=this._addChunkToRequest(n)):((this.options.protocol===Se||this.options.protocol===he)&&n.setHeader("Upload-Complete","?0"),a=this._sendRequest(n,null)),a.then(function(u){if(!ne(u.getStatus(),200)){r._emitHttpError(n,u,"tus: unexpected response while creating upload");return}var c=u.getHeader("Location");if(c==null){r._emitHttpError(n,u,"tus: invalid or missing Location header");return}if(r.url=Vt(r.options.endpoint,c),B("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(u),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,u):(r._offset=0,r._performUpload());});}).catch(function(u){r._emitHttpError(n,null,"tus: failed to create upload",u);});}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),o=this._sendRequest(n,null);o.then(function(a){var u=a.getStatus();if(!ne(u,200)){if(u===423){r._emitHttpError(n,a,"tus: upload is currently locked; retry later");return}if(ne(u,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,a,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var c=Number.parseInt(a.getHeader("Upload-Offset"),10);if(Number.isNaN(c)){r._emitHttpError(n,a,"tus: invalid or missing offset value");return}var h=Number.parseInt(a.getHeader("Upload-Length"),10);if(Number.isNaN(h)&&!r.options.uploadLengthDeferred&&r.options.protocol===we){r._emitHttpError(n,a,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(c===h){r._emitProgress(h,h),r._emitSuccess(a);return}r._offset=c,r._performUpload();});}).catch(function(a){r._emitHttpError(n,null,"tus: failed to resume upload",a);});}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var o=this._addChunkToRequest(n);o.then(function(a){if(!ne(a.getStatus(),200)){r._emitHttpError(n,a,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,a);}).catch(function(a){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),a);});}}},{key:"_addChunkToRequest",value:function(r){var n=this,o=this._offset,a=this._offset+this.options.chunkSize;return r.setProgressHandler(function(u){n._emitProgress(o+u,n._size);}),this.options.protocol===we?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===he&&r.setHeader("Content-Type","application/partial-upload"),(a===Number.POSITIVE_INFINITY||a>this._size)&&!this.options.uploadLengthDeferred&&(a=this._size),this._source.slice(o,a).then(function(u){var c=u.value,h=u.done,m=c!=null&&c.size?c.size:0;n.options.uploadLengthDeferred&&h&&(n._size=n._offset+m,r.setHeader("Upload-Length","".concat(n._size)));var v=n._offset+m;return !n.options.uploadLengthDeferred&&h&&v!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(v," bytes"))):c===null?n._sendRequest(r):((n.options.protocol===Se||n.options.protocol===he)&&r.setHeader("Upload-Complete",h?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,c))})}},{key:"_handleUploadResponse",value:function(r,n){var o=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(o)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(o,this._size),this._emitChunkComplete(o-this._offset,o,this._size),this._offset=o,o===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload();}},{key:"_openRequest",value:function(r,n){var o=Gt(r,n,this.options);return this._req=o,o}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n);}),this._urlStorageKey=null);}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(o){r._urlStorageKey=o;})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Kt(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=Gt("DELETE",r,n);return Kt(o,null,n).then(function(a){if(a.getStatus()!==204)throw new Q("tus: unexpected response while terminating upload",null,o,a)}).catch(function(a){if(a instanceof Q||(a=new Q("tus: failed to terminate upload",a,o,null)),!Xt(a,0,n))throw a;var u=n.retryDelays[0],c=n.retryDelays.slice(1),h=re(re({},n),{},{retryDelays:c});return new Promise(function(m){return setTimeout(m,u)}).then(function(){return e.terminate(r,h)})})}}])})();function $t(e){return Object.entries(e).map(function(t){var r=Wt(t,2),n=r[0],o=r[1];return "".concat(n," ").concat(Ut.encode(String(o)))}).join(",")}function ne(e,t){return e>=t&&e<t+100}function Gt(e,t,r){var n=r.httpStack.createRequest(e,t);r.protocol===Se?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===he?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},a=0,u=Object.entries(o);a<u.length;a++){var c=Wt(u[a],2),h=c[0],m=c[1];n.setHeader(h,m);}if(r.addRequestId){var v=Be();n.setHeader("X-Request-ID",v);}return n}function Kt(e,t,r){return qe.apply(this,arguments)}function qe(){return qe=on(ze().mark(function e(t,r,n){var o;return ze().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(typeof n.onBeforeRequest!="function"){u.next=3;break}return u.next=3,n.onBeforeRequest(t);case 3:return u.next=5,t.send(r);case 5:if(o=u.sent,typeof n.onAfterResponse!="function"){u.next=9;break}return u.next=9,n.onAfterResponse(t,o);case 9:return u.abrupt("return",o);case 10:case "end":return u.stop()}},e)})),qe.apply(this,arguments)}function yn(){var e=true;return typeof navigator<"u"&&navigator.onLine===false&&(e=false),e}function Xt(e,t,r){return r.retryDelays==null||t>=r.retryDelays.length||e.originalRequest==null?false:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(e,t,r):er(e)}function er(e){var t=e.originalResponse?e.originalResponse.getStatus():0;return (!ne(t,400)||t===409||t===423)&&yn()}function Vt(e,t){return new Jt.default(t,e).toString()}function mn(e,t){for(var r=Math.floor(e/t),n=[],o=0;o<t;o++)n.push({start:r*o,end:r*(o+1)});return n[t-1].end=e,n}Qt.defaultOptions=dn;var Ee=Qt;var gn=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"},xe=gn;function Me(e){return new Promise(function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var o=n.response;t(o);},n.onerror=function(o){r(o);},n.open("GET",e),n.send();})}var vn=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")},tr=vn;function $e(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){var o=new Uint8Array(n.result);t({value:o});},n.onerror=function(o){r(o);},n.readAsArrayBuffer(e);})}function de(e){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(e)}function bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,wn(n.key),n);}}function _n(e,t,r){return t&&rr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function wn(e){var t=Sn(e,"string");return de(t)=="symbol"?t:t+""}function Sn(e,t){if(de(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(de(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var Ge=(function(){function e(t){bn(this,e),this._file=t,this.size=t.size;}return _n(e,[{key:"slice",value:function(r,n){if(tr())return $e(this._file.slice(r,n));var o=this._file.slice(r,n),a=n>=this.size;return Promise.resolve({value:o,done:a})}},{key:"close",value:function(){}}])})();function ye(e){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function En(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,On(n.key),n);}}function xn(e,t,r){return t&&nr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function On(e){var t=Un(e,"string");return ye(t)=="symbol"?t:t+""}function Un(e,t){if(ye(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ye(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}function or(e){return e===void 0?0:e.size!==void 0?e.size:e.length}function Pn(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}var ir=(function(){function e(t){En(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=false;}return xn(e,[{key:"slice",value:function(r,n){return r<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(r,n)}},{key:"_readUntilEnoughDataOrDone",value:function(r,n){var o=this,a=n<=this._bufferOffset+or(this._buffer);if(this._done||a){var u=this._getDataFromBuffer(r,n),c=u==null?this._done:false;return Promise.resolve({value:u,done:c})}return this._reader.read().then(function(h){var m=h.value,v=h.done;return v?o._done=true:o._buffer===void 0?o._buffer=m:o._buffer=Pn(o._buffer,m),o._readUntilEnoughDataOrDone(r,n)})}},{key:"_getDataFromBuffer",value:function(r,n){r>this._bufferOffset&&(this._buffer=this._buffer.slice(r-this._bufferOffset),this._bufferOffset=r);var o=or(this._buffer)===0;return this._done&&o?null:this._buffer.slice(0,n-r)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel();}}])})();function Y(e){"@babel/helpers - typeof";return Y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(e)}function Ke(){Ke=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(l,i,s){l[i]=s.value;},a=typeof Symbol=="function"?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function m(l,i,s){return Object.defineProperty(l,i,{value:s,enumerable:true,configurable:true,writable:true}),l[i]}try{m({},"");}catch{m=function(s,f,d){return s[f]=d};}function v(l,i,s,f){var d=i&&i.prototype instanceof F?i:F,p=Object.create(d.prototype),g=new $(f||[]);return o(p,"_invoke",{value:Pe(l,s,g)}),p}function y(l,i,s){try{return {type:"normal",arg:l.call(i,s)}}catch(f){return {type:"throw",arg:f}}}t.wrap=v;var C="suspendedStart",ae="suspendedYield",z="executing",j="completed",S={};function F(){}function R(){}function E(){}var T={};m(T,u,function(){return this});var q=Object.getPrototypeOf,I=q&&q(q(G([])));I&&I!==r&&n.call(I,u)&&(T=I);var D=E.prototype=F.prototype=Object.create(T);function se(l){["next","throw","return"].forEach(function(i){m(l,i,function(s){return this._invoke(i,s)});});}function N(l,i){function s(d,p,g,b){var _=y(l[d],l,p);if(_.type!=="throw"){var U=_.arg,x=U.value;return x&&Y(x)=="object"&&n.call(x,"__await")?i.resolve(x.__await).then(function(P){s("next",P,g,b);},function(P){s("throw",P,g,b);}):i.resolve(x).then(function(P){U.value=P,g(U);},function(P){return s("throw",P,g,b)})}b(_.arg);}var f;o(this,"_invoke",{value:function(p,g){function b(){return new i(function(_,U){s(p,g,_,U);})}return f=f?f.then(b,b):b()}});}function Pe(l,i,s){var f=C;return function(d,p){if(f===z)throw Error("Generator is already running");if(f===j){if(d==="throw")throw p;return {value:e,done:true}}for(s.method=d,s.arg=p;;){var g=s.delegate;if(g){var b=le(g,s);if(b){if(b===S)continue;return b}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(f===C)throw f=j,s.arg;s.dispatchException(s.arg);}else s.method==="return"&&s.abrupt("return",s.arg);f=z;var _=y(l,i,s);if(_.type==="normal"){if(f=s.done?j:ae,_.arg===S)continue;return {value:_.arg,done:s.done}}_.type==="throw"&&(f=j,s.method="throw",s.arg=_.arg);}}}function le(l,i){var s=i.method,f=l.iterator[s];if(f===e)return i.delegate=null,s==="throw"&&l.iterator.return&&(i.method="return",i.arg=e,le(l,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),S;var d=y(f,l.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,S;var p=d.arg;return p?p.done?(i[l.resultName]=p.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,S):p:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,S)}function ke(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i);}function M(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i;}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(ke,this),this.reset(true);}function G(l){if(l||l===""){var i=l[u];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,f=function d(){for(;++s<l.length;)if(n.call(l,s))return d.value=l[s],d.done=false,d;return d.value=e,d.done=true,d};return f.next=f}}throw new TypeError(Y(l)+" is not iterable")}return R.prototype=E,o(D,"constructor",{value:E,configurable:true}),o(E,"constructor",{value:R,configurable:true}),R.displayName=m(E,h,"GeneratorFunction"),t.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return !!i&&(i===R||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,E):(l.__proto__=E,m(l,h,"GeneratorFunction")),l.prototype=Object.create(D),l},t.awrap=function(l){return {__await:l}},se(N.prototype),m(N.prototype,c,function(){return this}),t.AsyncIterator=N,t.async=function(l,i,s,f,d){d===void 0&&(d=Promise);var p=new N(v(l,i,s,f),d);return t.isGeneratorFunction(i)?p:p.next().then(function(g){return g.done?g.value:p.next()})},se(D),m(D,h,"Generator"),m(D,u,function(){return this}),m(D,"toString",function(){return "[object Generator]"}),t.keys=function(l){var i=Object(l),s=[];for(var f in i)s.push(f);return s.reverse(),function d(){for(;s.length;){var p=s.pop();if(p in i)return d.value=p,d.done=false,d}return d.done=true,d}},t.values=G,$.prototype={constructor:$,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=false,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!i)for(var s in this)s.charAt(0)==="t"&&n.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=e);},stop:function(){this.done=true;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var s=this;function f(U,x){return g.type="throw",g.arg=i,s.next=U,x&&(s.method="next",s.arg=e),!!x}for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d],g=p.completion;if(p.tryLoc==="root")return f("end");if(p.tryLoc<=this.prev){var b=n.call(p,"catchLoc"),_=n.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return f(p.catchLoc,true);if(this.prev<p.finallyLoc)return f(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return f(p.catchLoc,true)}else {if(!_)throw Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return f(p.finallyLoc)}}}},abrupt:function(i,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var p=d;break}}p&&(i==="break"||i==="continue")&&p.tryLoc<=s&&s<=p.finallyLoc&&(p=null);var g=p?p.completion:{};return g.type=i,g.arg=s,p?(this.method="next",this.next=p.finallyLoc,S):this.complete(g)},complete:function(i,s){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&s&&(this.next=s),S},finish:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),M(f),S}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var p=d.arg;M(f);}return p}}throw Error("illegal catch attempt")},delegateYield:function(i,s,f){return this.delegate={iterator:G(i),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=e),S}},t}function ar(e,t,r,n,o,a,u){try{var c=e[a](u),h=c.value;}catch(m){r(m);return}c.done?t(h):Promise.resolve(h).then(n,o);}function kn(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function u(h){ar(a,n,o,u,c,"next",h);}function c(h){ar(a,n,o,u,c,"throw",h);}u(void 0);})}}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Cn(n.key),n);}}function Dn(e,t,r){return t&&sr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Cn(e){var t=Tn(e,"string");return Y(t)=="symbol"?t:t+""}function Tn(e,t){if(Y(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Y(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var lr=(function(){function e(){Rn(this,e);}return Dn(e,[{key:"openFile",value:(function(){var t=kn(Ke().mark(function n(o,a){var u;return Ke().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(xe()&&o&&typeof o.uri<"u")){h.next=11;break}return h.prev=1,h.next=4,Me(o.uri);case 4:return u=h.sent,h.abrupt("return",new Ge(u));case 8:throw h.prev=8,h.t0=h.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(h.t0));case 11:if(!(typeof o.slice=="function"&&typeof o.size<"u")){h.next=13;break}return h.abrupt("return",Promise.resolve(new Ge(o)));case 13:if(typeof o.read!="function"){h.next=18;break}if(a=Number(a),Number.isFinite(a)){h.next=17;break}return h.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return h.abrupt("return",Promise.resolve(new ir(o,a)));case 18:return h.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case "end":return h.stop()}},n,null,[[1,8]])}));function r(n,o){return t.apply(this,arguments)}return r})()}])})();function Xe(e,t){return xe()?Promise.resolve(jn(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}function jn(e,t){var r=e.exif?An(JSON.stringify(e.exif)):"noexif";return ["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}function An(e){var t=0;if(e.length===0)return t;for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);t=(t<<5)-t+n,t&=t;}return t}function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(e)}function Ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ur(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Ln(n.key),n);}}function We(e,t,r){return t&&ur(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Ln(e){var t=Fn(e,"string");return me(t)=="symbol"?t:t+""}function Fn(e,t){if(me(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(me(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var fr=(function(){function e(){Ve(this,e);}return We(e,[{key:"createRequest",value:function(r,n){return new In(r,n)}},{key:"getName",value:function(){return "XHRHttpStack"}}])})();var In=(function(){function e(t,r){Ve(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,true),this._method=t,this._url=r,this._headers={};}return We(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._xhr.setRequestHeader(r,n),this._headers[r]=n;}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(n){n.lengthComputable&&r(n.loaded);});}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(o,a){r._xhr.onload=function(){o(new Nn(r._xhr));},r._xhr.onerror=function(u){a(u);},r._xhr.send(n);})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})(),Nn=(function(){function e(t){Ve(this,e),this._xhr=t;}return We(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(r){return this._xhr.getResponseHeader(r)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})();function ge(e){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(e)}function Hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,zn(n.key),n);}}function Bn(e,t,r){return t&&cr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function zn(e){var t=qn(e,"string");return ge(t)=="symbol"?t:t+""}function qn(e,t){if(ge(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ge(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var Ze=false;try{Ze="localStorage"in window,Oe="tusSupport",Ye=localStorage.getItem(Oe),localStorage.setItem(Oe,Ye),Ye===null&&localStorage.removeItem(Oe);}catch(e){if(e.code===e.SECURITY_ERR||e.code===e.QUOTA_EXCEEDED_ERR)Ze=false;else throw e}var Oe,Ye,pr=Ze,hr=(function(){function e(){Hn(this,e);}return Bn(e,[{key:"findAllUploads",value:function(){var r=this._findEntries("tus::");return Promise.resolve(r)}},{key:"findUploadsByFingerprint",value:function(r){var n=this._findEntries("tus::".concat(r,"::"));return Promise.resolve(n)}},{key:"removeUpload",value:function(r){return localStorage.removeItem(r),Promise.resolve()}},{key:"addUpload",value:function(r,n){var o=Math.round(Math.random()*1e12),a="tus::".concat(r,"::").concat(o);return localStorage.setItem(a,JSON.stringify(n)),Promise.resolve(a)}},{key:"_findEntries",value:function(r){for(var n=[],o=0;o<localStorage.length;o++){var a=localStorage.key(o);if(a.indexOf(r)===0)try{var u=JSON.parse(localStorage.getItem(a));u.urlStorageKey=a,n.push(u);}catch{}}return n}}])})();function ie(e){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(e)}function Mn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,vr(n.key),n);}}function $n(e,t,r){return r&&dr(e,r),Object.defineProperty(e,"prototype",{writable:false}),e}function Gn(e,t,r){return t=Ue(t),Kn(e,gr()?Reflect.construct(t,r||[],Ue(e).constructor):t.apply(e,r))}function Kn(e,t){if(t&&(ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xn(e)}function Xn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (gr=function(){return !!e})()}function Ue(e){return Ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ue(e)}function Vn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}}),Object.defineProperty(e,"prototype",{writable:false}),t&&Je(e,t);}function Je(e,t){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Je(e,t)}function yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yr(Object(r),true).forEach(function(n){Wn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function Wn(e,t,r){return t=vr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function vr(e){var t=Yn(e,"string");return ie(t)=="symbol"?t:t+""}function Yn(e,t){if(ie(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ie(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var mr=oe(oe({},Ee.defaultOptions),{},{httpStack:new fr,fileReader:new lr,urlStorage:pr?new hr:new st,fingerprint:Xe}),br=(function(e){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Mn(this,t),n=oe(oe({},mr),n),Gn(this,t,[r,n])}return Vn(t,e),$n(t,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=oe(oe({},mr),o),Ee.terminate(n,o)}}])})(Ee);var w=class extends g{constructor(){super(...arguments);this.disableCompletion=false;this._progress=0;this._completed=false;this._dragging=false;this._error=null;this._hasErrorSlot=false;this.playableEmitted=false;this.languageController=new d(this);this.lastState="initial";this.lastProgress=-1;}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleActionClick),this.addEventListener("keydown",this.handleActionKeyDown),this.languageController.locale=this.locale||"en",this.updateHasErrorSlot(),typeof MutationObserver<"u"&&(this.slotObserver=new MutationObserver(()=>{this.updateHasErrorSlot();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["slot"]})),this.embedChannel=a$3.connect(this.token),this.embedChannel.upload_id&&(this._upload_id=this.embedChannel.upload_id),this.embedChannel.channel.on("initiate",({upload_id:r})=>{this._upload_id=r,this.embedChannel.upload_id=r,this.playableEmitted=false;}),this.embedChannel.channel.on("completed",this.completed.bind(this)),this.embedChannel.channel.on("rendition",this.rendition.bind(this)),this.embedChannel.channel.on("error",this.error.bind(this));}requestUpdate(r,n){super.requestUpdate(r,n),r==="locale"&&(this.languageController.locale=this.locale);}reset(){this._progress=0,this._completed=false,this._error=null,this.playableEmitted=false,this.currentEmbed=void 0,this.embedChannel.channel.push("reset",{});}disconnectedCallback(){a$3.disconnect(this.embedChannel),this.removeEventListener("click",this.handleActionClick),this.removeEventListener("keydown",this.handleActionKeyDown),this.slotObserver?.disconnect(),this.slotObserver=void 0,super.disconnectedCallback();}handleDrop(r){r.preventDefault(),this._dragging=false;let n=r.dataTransfer;if(!n)return;let o=this.collectFilesFromDataTransfer(n);if(!o.length)return;this._error=null;let a=false;for(let u of o)this.isSupportedFile(u)?(a||(this._progress=1,a=true),this.upload(u)):this.handleUnsupportedFile(u);}handleForm(r){let n=r.target;if(n.files){n.files.length&&(this._error=null);let o=false;for(let a of n.files)this.isSupportedFile(a)?(o||(this._progress=1,o=true),this.upload(a)):this.handleUnsupportedFile(a);n.value="";}}upload(r){this.dispatchEvent(new CustomEvent("upload",{bubbles:true,composed:true,detail:{file:r}})),this._error=null;let n=new br(r,{endpoint:a$4.upload.endpoint,retryDelays:[0,3e3,5e3,1e4,2e4,6e4,6e4],metadata:{title:r.name,filetype:r.type,token:this.token,upload_id:this._upload_id},onError:o=>{console.log(o),this.dispatchEvent(new CustomEvent("failed",{bubbles:true,composed:true,detail:o}));},onProgress:(o,a)=>{let u=Math.round(o/a*100);u>this._progress&&(this._progress=u),this.dispatchEvent(new CustomEvent("progress",{bubbles:true,composed:true,detail:{progress:u}}));},onSuccess:()=>{this._progress=100,this.dispatchEvent(new CustomEvent("processing",{bubbles:true,composed:true}));},removeFingerprintOnSuccess:true});n.findPreviousUploads().then(o=>{o.length&&n.resumeFromPreviousUpload(o[0]),n.start();});}completed(r){this.currentEmbed=r?.embed,setTimeout(()=>{this.disableCompletion||(this._completed=true),this.dispatchEvent(new CustomEvent("completed",{bubbles:true,composed:true,detail:r}));},250);}rendition(r){!this.playableEmitted&&this.isPlayableRendition(r)&&(this.playableEmitted=true,setTimeout(()=>{this.dispatchEvent(new CustomEvent("playable",{bubbles:true,composed:true,detail:{embed:this.currentEmbed}}));},250)),this.dispatchEvent(new CustomEvent("rendition",{bubbles:true,composed:true,detail:r}));}error(r){console.warn(`[mave-upload] ${r.message}`),this._error={reason:"upload error",message:r.message},this._progress=0,this._completed=false,this.dispatchEvent(new CustomEvent("error",{bubbles:true,detail:r}));}isPlayableRendition(r){return typeof r?.container=="string"&&r.container==="hls"&&r?.type==="video"}updateHasErrorSlot(r){let n=!!this.querySelector('[slot="error"]');this._hasErrorSlot!==n&&(this._hasErrorSlot=n);}render(){switch(this.currentState){case "error":return this.renderError();case "uploading":return this.renderUploading();case "processing":return this.renderProcessing();case "done":return this.renderDone();default:return this.renderInitial()}}styleOpacity(){return this.languageController.loaded?this._upload_id?{}:{pointerEvents:"none",opacity:"0.5"}:{pointerEvents:"none",opacity:"0"}}styleFont(){return this.font?{fontFamily:this.font}:{fontFamily:"system-ui"}}get currentState(){return this._error?"error":this._completed?"done":this._progress>=100&&this._progress>0?"processing":this._progress>0?"uploading":"initial"}openFileDialog(){this.fileInput&&!this.fileInput.disabled&&this.fileInput.click();}findActionTarget(r){for(let n of r.composedPath())if(n instanceof HTMLElement&&n.hasAttribute("data-mave-upload-select"))return n;return null}handleActionClick(r){this.findActionTarget(r)&&(r.preventDefault(),this.openFileDialog());}handleActionKeyDown(r){if(r.key!=="Enter"&&r.key!==" ")return;this.findActionTarget(r)&&(r.preventDefault(),this.openFileDialog());}blockSubmit(r){r.preventDefault();}collectFilesFromDataTransfer(r){let n=[];if(r.items&&r.items.length){for(let o of r.items){if(o.kind!=="file")continue;let a=o.getAsFile();a&&n.push(a);}if(n.length)return n}if(r.files&&r.files.length)for(let o of r.files)n.push(o);return n}hasSupportedFiles(r){let n=this.collectFilesFromDataTransfer(r);if(n.length)return n.some(a=>this.isSupportedFile(a));if(typeof navigator<"u"&&/^((?!chrome|crios|chromium|android).)*safari/i.test(navigator.userAgent))return true;if(r.items&&r.items.length)for(let a of r.items){if(a.kind!=="file")continue;let u=(a.type||"").toLowerCase();if(u.startsWith("video/")||u.startsWith("audio/"))return true}return false}handleDragEnter(r){r.preventDefault();let n=r.dataTransfer;if(!n){this._dragging=false;return}let o=this.hasSupportedFiles(n);n.dropEffect=o?"copy":"none",this._dragging=o;}handleDragOver(r){r.preventDefault();let n=r.dataTransfer;if(!n){this._dragging=false;return}let o=this.hasSupportedFiles(n);n.dropEffect=o?"copy":"none",this._dragging=o;}handleDragLeave(r){r.preventDefault();let n=r.currentTarget,o=r.relatedTarget;if(!n){this._dragging=false;return}(!o||!(o instanceof Node)||!n.contains(o))&&(this._dragging=false);}isSupportedFile(r){let n=(r.type||"").toLowerCase(),o=w.getFileExtension(r);return n.startsWith("video/")?!o||w.SUPPORTED_VIDEO_EXTENSIONS.has(o):n.startsWith("audio/")?!o||w.SUPPORTED_AUDIO_EXTENSIONS.has(o):o?!!(w.SUPPORTED_VIDEO_EXTENSIONS.has(o)||w.SUPPORTED_AUDIO_EXTENSIONS.has(o)):false}static getFileExtension(r){let n=r.name||"",o=n.lastIndexOf(".");if(!(o===-1||o===n.length-1))return n.slice(o+1).toLowerCase()}handleUnsupportedFile(r){let n={file:r,reason:"unsupported type",allowedExtensions:{video:Array.from(w.SUPPORTED_VIDEO_EXTENSIONS),audio:Array.from(w.SUPPORTED_AUDIO_EXTENSIONS)}};this._error=n,this._progress=0,this._completed=false,this.dispatchEvent(new CustomEvent("invalid",{bubbles:true,composed:true,detail:{...n,message:a$5("unsupported file type")}}));}updated(r){super.updated(r);let n=this._progress||0,o=this.currentState;this.setAttribute("state",o),this.setAttribute("progress",`${n}`),this.toggleAttribute("drag-over",this._dragging),this.toggleAttribute("ready",!!this._upload_id&&this.languageController.loaded);let a=o!==this.lastState,u=n!==this.lastProgress,c=r.has("_dragging");(a||u||c)&&this.dispatchEvent(new CustomEvent("statechange",{bubbles:true,composed:true,detail:{state:o,progress:n,dragging:this._dragging,error:this._error}})),this.lastState=o,this.lastProgress=n;}renderInitial(){let r=this.color?this.color:"#1997FF",n=this.radius?this.radius:"16px";return a$7`<form
|
|
4
|
+
class="state state--initial"
|
|
5
|
+
style=${a$6({...this.styleOpacity(),...this.styleFont()})}
|
|
6
|
+
@submit=${this.blockSubmit}
|
|
7
|
+
@dragenter=${this.handleDragEnter}
|
|
8
|
+
@dragover=${this.handleDragOver}
|
|
9
|
+
@dragleave=${this.handleDragLeave}
|
|
10
|
+
@drop=${this.handleDrop}
|
|
11
|
+
>
|
|
12
|
+
<slot name="initial">
|
|
13
|
+
<div class="upload-default-title">${a$5("drop video here")}</div>
|
|
14
|
+
<div class="upload-default-subtitle">${a$5("or browse your files")}</div>
|
|
15
|
+
<button
|
|
16
|
+
type="button"
|
|
17
|
+
data-mave-upload-select
|
|
18
|
+
class="upload-default-button"
|
|
19
|
+
style=${a$6({background:r,borderRadius:n})}
|
|
20
|
+
>
|
|
21
|
+
${a$5("select file")}
|
|
22
|
+
</button>
|
|
23
|
+
</slot>
|
|
24
|
+
<input
|
|
25
|
+
id="mave-upload-input"
|
|
26
|
+
.disabled=${!this._upload_id}
|
|
27
|
+
type="file"
|
|
28
|
+
accept="video/*, audio/*"
|
|
29
|
+
@change=${this.handleForm}
|
|
30
|
+
hidden
|
|
31
|
+
/>
|
|
32
|
+
</form>`}renderError(){return this._hasErrorSlot?a$7`<form
|
|
33
|
+
class="state state--error"
|
|
34
|
+
style=${a$6({...this.styleOpacity(),...this.styleFont()})}
|
|
35
|
+
@submit=${this.blockSubmit}
|
|
36
|
+
@dragenter=${this.handleDragEnter}
|
|
37
|
+
@dragover=${this.handleDragOver}
|
|
38
|
+
@dragleave=${this.handleDragLeave}
|
|
39
|
+
@drop=${this.handleDrop}
|
|
40
|
+
>
|
|
41
|
+
<slot name="error" @slotchange=${this.updateHasErrorSlot}></slot>
|
|
42
|
+
<input
|
|
43
|
+
id="mave-upload-input"
|
|
44
|
+
.disabled=${!this._upload_id}
|
|
45
|
+
type="file"
|
|
46
|
+
accept="video/*, audio/*"
|
|
47
|
+
@change=${this.handleForm}
|
|
48
|
+
hidden
|
|
49
|
+
/>
|
|
50
|
+
</form>`:this.renderInitial()}renderUploading(){let r=Math.max(0,Math.min(100,this._progress||0));return a$7`<div class="state state--uploading" style=${a$6(this.styleFont())}>
|
|
51
|
+
<slot name="uploading">
|
|
52
|
+
<div class="upload-default-progress" role="status">
|
|
53
|
+
<div
|
|
54
|
+
class="upload-default-progress-bar"
|
|
55
|
+
role="progressbar"
|
|
56
|
+
aria-valuemin="0"
|
|
57
|
+
aria-valuemax="100"
|
|
58
|
+
aria-valuenow=${r}
|
|
59
|
+
>
|
|
60
|
+
<div class="upload-default-progress-value" style="width: ${r}%;"></div>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="upload-default-progress-label">${a$5("uploading...")}</div>
|
|
63
|
+
</div>
|
|
64
|
+
</slot>
|
|
65
|
+
</div>`}renderProcessing(){return a$7`<div class="state state--processing" style=${a$6(this.styleFont())}>
|
|
66
|
+
<slot name="processing">
|
|
67
|
+
<div class="upload-default-status" role="status">${a$5("just a minute...")}</div>
|
|
68
|
+
</slot>
|
|
69
|
+
</div>`}renderDone(){return a$7`<div class="state state--done" style=${a$6(this.styleFont())}>
|
|
70
|
+
<slot name="done">
|
|
71
|
+
<div class="upload-default-status" role="status">${a$5("done")}</div>
|
|
72
|
+
</slot>
|
|
73
|
+
</div>`}};w.SUPPORTED_VIDEO_EXTENSIONS=new Set(["3g2","3gp","avi","mov","mp4","m4v","mkv","qt","ts","mts","m2t","m2ts","webm"]),w.SUPPORTED_AUDIO_EXTENSIONS=new Set(["aac","amr","flac","m4a","m4b","m4p","mp3","ogg","wav"]),w.styles=a$1`
|
|
74
|
+
:host {
|
|
75
|
+
all: initial;
|
|
76
|
+
display: block;
|
|
77
|
+
width: 100%;
|
|
78
|
+
aspect-ratio: 16 / 9;
|
|
79
|
+
position: relative;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.state {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
align-items: center;
|
|
87
|
+
background: white;
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.state--initial {
|
|
93
|
+
transition: box-shadow 160ms ease;
|
|
94
|
+
gap: 12px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.state--error {
|
|
98
|
+
transition: box-shadow 160ms ease;
|
|
99
|
+
gap: 12px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.upload-default-error {
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: 12px;
|
|
107
|
+
text-align: center;
|
|
108
|
+
width: 100%;
|
|
109
|
+
padding: 0 24px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.upload-default-error-filename {
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
color: #111;
|
|
116
|
+
max-width: 320px;
|
|
117
|
+
overflow-wrap: anywhere;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.upload-default-error-title {
|
|
121
|
+
font-size: 24px;
|
|
122
|
+
font-weight: 400;
|
|
123
|
+
color: #e5484d;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.upload-default-error-subtitle {
|
|
127
|
+
opacity: 0.6;
|
|
128
|
+
max-width: 320px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.upload-default-title {
|
|
132
|
+
font-size: 32px;
|
|
133
|
+
padding-bottom: 2px;
|
|
134
|
+
font-weight: 300;
|
|
135
|
+
opacity: 0.9;
|
|
136
|
+
text-align: center;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.upload-default-subtitle {
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
padding-bottom: 16px;
|
|
142
|
+
text-align: center;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.upload-default-button {
|
|
146
|
+
position: relative;
|
|
147
|
+
width: 150px;
|
|
148
|
+
height: 40px;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
color: white;
|
|
151
|
+
display: flex;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
align-items: center;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
border: none;
|
|
156
|
+
font: inherit;
|
|
157
|
+
text-transform: none;
|
|
158
|
+
background: #1997ff;
|
|
159
|
+
border-radius: 16px;
|
|
160
|
+
transition: opacity 160ms ease;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.upload-default-button:hover,
|
|
164
|
+
.upload-default-button:focus {
|
|
165
|
+
opacity: 0.9;
|
|
166
|
+
outline: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.upload-default-button:disabled {
|
|
170
|
+
opacity: 0.5;
|
|
171
|
+
cursor: not-allowed;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.upload-default-progress {
|
|
175
|
+
width: 70%;
|
|
176
|
+
max-width: 380px;
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
gap: 16px;
|
|
180
|
+
align-items: center;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.upload-default-progress-bar {
|
|
184
|
+
width: 100%;
|
|
185
|
+
height: 4px;
|
|
186
|
+
border-radius: 999px;
|
|
187
|
+
background: #e6e6e6;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.upload-default-progress-value {
|
|
192
|
+
height: 100%;
|
|
193
|
+
background: #1997ff;
|
|
194
|
+
transition: width 200ms cubic-bezier(0, 0, 0.2, 1);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.upload-default-progress-label {
|
|
198
|
+
opacity: 0.6;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.upload-default-status {
|
|
202
|
+
opacity: 0.6;
|
|
203
|
+
padding-bottom: 24px;
|
|
204
|
+
text-align: center;
|
|
205
|
+
}
|
|
206
|
+
`,c([a$2()],w.prototype,"token",2),c([a$2()],w.prototype,"locale",2),c([a$2()],w.prototype,"color",2),c([a$2()],w.prototype,"font",2),c([a$2()],w.prototype,"radius",2),c([a$2({type:Boolean})],w.prototype,"disableCompletion",2),c([b$1()],w.prototype,"_progress",2),c([b$1()],w.prototype,"_upload_id",2),c([b$1()],w.prototype,"_completed",2),c([b$1()],w.prototype,"_dragging",2),c([b$1()],w.prototype,"_error",2),c([b$1()],w.prototype,"_hasErrorSlot",2),c([c$1("#mave-upload-input")],w.prototype,"fileInput",2),w=c([b$2()],w);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-upload")||window.customElements.define("mave-upload",w));/*! Bundled license information:
|
|
207
|
+
|
|
208
|
+
tus-js-client/lib.esm/upload.js:
|
|
209
|
+
tus-js-client/lib.esm/browser/fileReader.js:
|
|
210
|
+
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
|
|
211
|
+
*/export{w as a};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {a as a$3}from'./chunk-B6P2GJBQ.js';import {a as a$2}from'./chunk-CNPQ5Q2M.js';import {a as a$4}from'./chunk-R3SDTEHC.js';import {a as a$1,b}from'./chunk-PTN427IG.js';import {g,e as e$1,a as a$5}from'./chunk-5PIHL662.js';import {a}from'./chunk-YPCQNE3R.js';import {c,e,g as g$1}from'./chunk-KA24PL7V.js';var o,k,C,S,n=class extends g{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$2(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$1(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$1(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,a$5`
|
|
2
|
+
<div>
|
|
3
|
+
${this.captions.segments.map((e,r)=>a$5`
|
|
4
|
+
<p
|
|
5
|
+
data-segment-id="segment-${r}"
|
|
6
|
+
style=${a$3(this.segmentStyle())}
|
|
7
|
+
@click=${this.clickable?g$1(this,o,S):e$1}
|
|
8
|
+
part=${a$4(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)=>a$5`
|
|
13
|
+
<span
|
|
14
|
+
data-word-id="word-${r}-${s}"
|
|
15
|
+
style=${a$3(this.wordStyle(this.inRange(i)))}
|
|
16
|
+
part=${a$4(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
|
+
`)}):e$1}};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=a`
|
|
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$1()],n.prototype,"embed",1),c([a$1()],n.prototype,"highlight",2),c([a$1()],n.prototype,"clickable",1),c([a$1()],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};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
${this.embedController.render({pending:this.renderPending,complete:e=>{if(this._data=e,!e)return;let n=chunkJHSFSCC2_cjs.g(this,i,U).call(this),t=chunkJHSFSCC2_cjs.g(this,i,F).call(this),o=this._slottedChildren.map(a=>{function h(){let s;return a.nodeName==="TEMPLATE"?s=a.content.cloneNode(true):s=a.cloneNode(true),s}if(a.getAttribute("name")=="mave-files-video"){if(!n)return;let s=h(),d=Number(this._data.created_at),m=d&&d<1e12?d*1e3:d;Number.isFinite(m)&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"date",new Date(m).toLocaleDateString().replaceAll("/","-"));let p=this._data.video.duration;p&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"duration",this.durationToTime(p));let u=this._data.video.filetype;u&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"filetype",u);let k=n.file_size||this._data.video.size;k&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"size",chunkJHSFSCC2_cjs.g(this,i,v).call(this,k));let M=chunkJHSFSCC2_cjs.g(this,i,z).call(this,n),S=n.container||"mp4",b=chunkJHSFSCC2_cjs.g(this,i,g).call(this,M,`${this._data.name}.${S}`);return b.setAttribute("aria-label","Download video"),b.appendChild(s),
|
|
3
|
-
`}renderPending(){return
|
|
1
|
+
'use strict';var chunkTKJYRGEU_cjs=require('./chunk-TKJYRGEU.cjs'),chunkRQN3DXJB_cjs=require('./chunk-RQN3DXJB.cjs'),chunkDL4BV5IH_cjs=require('./chunk-DL4BV5IH.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs'),chunkNPP5B5PV_cjs=require('./chunk-NPP5B5PV.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var i,l,C,R,g,v,w,z,L,U,F,y,f=class extends chunkTKJYRGEU_cjs.a{constructor(){super(...arguments);chunkJHSFSCC2_cjs.e(this,i);this.embedController=new chunkRQN3DXJB_cjs.b(this);}get embed(){return this._embed}set embed(e){this._embed!==e&&(this._embed=e,this.requestUpdate("embed"),this.embedController.embed=this.embed);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}render(){return chunk2E5GLLOS_cjs.a`
|
|
2
|
+
${this.embedController.render({pending:this.renderPending,complete:e=>{if(this._data=e,!e)return;let n=chunkJHSFSCC2_cjs.g(this,i,U).call(this),t=chunkJHSFSCC2_cjs.g(this,i,F).call(this),o=this._slottedChildren.map(a=>{function h(){let s;return a.nodeName==="TEMPLATE"?s=a.content.cloneNode(true):s=a.cloneNode(true),s}if(a.getAttribute("name")=="mave-files-video"){if(!n)return;let s=h(),d=Number(this._data.created_at),m=d&&d<1e12?d*1e3:d;Number.isFinite(m)&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"date",new Date(m).toLocaleDateString().replaceAll("/","-"));let p=this._data.video.duration;p&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"duration",this.durationToTime(p));let u=this._data.video.filetype;u&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"filetype",u);let k=n.file_size||this._data.video.size;k&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"size",chunkJHSFSCC2_cjs.g(this,i,v).call(this,k));let M=chunkJHSFSCC2_cjs.g(this,i,z).call(this,n),S=n.container||"mp4",b=chunkJHSFSCC2_cjs.g(this,i,g).call(this,M,`${this._data.name}.${S}`);return b.setAttribute("aria-label","Download video"),b.appendChild(s),chunk2E5GLLOS_cjs.a`${b}`}if(t&&a.getAttribute("name")=="mave-files-audio"){let s=h(),d=t.codec||chunkJHSFSCC2_cjs.g(this,i,y).call(this,t.filename)||"mp3";chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"filetype",d);let m=t.file_size;m&&chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"size",chunkJHSFSCC2_cjs.g(this,i,v).call(this,m));let p=chunkJHSFSCC2_cjs.g(this,i,L).call(this,t),u=chunkJHSFSCC2_cjs.g(this,i,g).call(this,p,t.filename||`${this._data.name}.${d}`);return u.setAttribute("aria-label","Download audio"),u.appendChild(s),chunk2E5GLLOS_cjs.a`${u}`}let _=this._data.subtitles.find(s=>s.language==this._data.video.language);if(_&&a.getAttribute("name")=="mave-files-subtitles"){let s=h();chunkJHSFSCC2_cjs.g(this,i,l).call(this,s,"filetype","vtt");let d=chunkJHSFSCC2_cjs.g(this,i,g).call(this,_.path,`${this._data.name}.vtt`);return d.setAttribute("aria-label","Download subtitles"),d.appendChild(s),chunk2E5GLLOS_cjs.a`${d}`}});return chunk2E5GLLOS_cjs.a`${this._stylesheets} ${o}`}})}
|
|
3
|
+
`}renderPending(){return chunk2E5GLLOS_cjs.a`<slot style="display: none"></slot>`}};i=new WeakSet,l=function(e,n,t){let o=e.querySelector(`[slot="${n}"], [data-slot="${n}"]`);o&&(o.textContent=t,o.removeAttribute("slot"),o.removeAttribute("data-slot"));},C=function(e,n){let t=window.URL.createObjectURL(e),o=document.createElement("a");o.style.display="none",o.href=t,o.download=n,this.appendChild(o),o.click(),window.URL.revokeObjectURL(t),this.removeChild(o);},R=function(e,n){return fetch(e).then(t=>{if(!t.ok)throw new Error("Network response was not ok");return t.blob()}).then(t=>chunkJHSFSCC2_cjs.g(this,i,C).call(this,t,n)).catch(t=>console.error("Something went wrong:",t))},g=function(e,n){let t=document.createElement("a");t.classList.add("link"),t.setAttribute("href",e),t.setAttribute("download",n),t.setAttribute("target","new");let o=false;return t.addEventListener("click",a=>{a.preventDefault(),!o&&(o=true,t.style.cursor="wait",t.style.opacity="0.5",chunkJHSFSCC2_cjs.g(this,i,R).call(this,e,n).then(()=>{o=false,t.style.cursor="pointer",t.style.opacity="1";}));}),t},v=function(e){let n=e/1e6;if(n<10)return `${n.toFixed(1)} MB`;let t=n%1!==0;return `${n.toFixed(t?1:0)} MB`},w=function(e){let n=this._data?.video?.version&&this._data.video.version>0?`v${this._data.video.version}/`:"";return `${this.cdn_root}/${this.embedId}/${n}${e}`},z=function(e){let n=e?.codec||"h264",t=e?.size||"hd",o=e?.container||"mp4";return chunkJHSFSCC2_cjs.g(this,i,w).call(this,`${n}_${t}.${o}`)},L=function(e){if(e?.path)return e.path;let n=e?.codec||chunkJHSFSCC2_cjs.g(this,i,y).call(this,e?.filename||"")||"mp3";return chunkJHSFSCC2_cjs.g(this,i,w).call(this,`audio.${n}`)},U=function(){let e=this._data?.video?.renditions||[];if(!e.length)return;let n=e.filter(o=>o.container==="mp4"&&o.codec==="h264"&&(!o.type||o.type==="video")),t=["hd","fhd","sd","qhd","uhd"];for(let o of t){let a=n.find(h=>h.size===o);if(a)return a}return n[0]||e.find(o=>o.type==="video")},F=function(){let e=this._data?.audio_tracks||[];if(e.length)return e.find(n=>n.default)||e[0]},y=function(e){if(!e)return;let n=e.split(".");return n.length>1?n.pop():void 0},f.styles=chunkNPP5B5PV_cjs.a`
|
|
4
4
|
:host {
|
|
5
5
|
display: block;
|
|
6
6
|
--link-color: #006fc6;
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
color: var(--link-color);
|
|
18
18
|
cursor: var(--link-cursor);
|
|
19
19
|
}
|
|
20
|
-
`,chunkJHSFSCC2_cjs.c([
|
|
20
|
+
`,chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a({type:String})],f.prototype,"embed",1);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-files")||window.customElements.define("mave-files",f));exports.a=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkDL4BV5IH_cjs=require('./chunk-DL4BV5IH.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs'),chunkEVKPEPYP_cjs=require('./chunk-EVKPEPYP.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var s=class extends chunk2E5GLLOS_cjs.g{constructor(){super(...arguments);this.EVENT_TYPES={CLICK:"user_click"};}get embed(){return this._embed}set embed(t){this._embed=t;}get embedId(){return this._embed?.substring(5,this._embed?.length)}get spaceId(){return this.embed?.substring(0,5)}get cdn_root(){return chunkEVKPEPYP_cjs.a.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}get _stylesheets(){if(typeof document>"u")return chunk2E5GLLOS_cjs.a``;let t=document.querySelectorAll('style, link[rel="stylesheet"]');return chunk2E5GLLOS_cjs.a`${Array.from(t).map(e=>e.cloneNode(true))}`}durationToTime(t){let e=Math.floor(t),n=Math.floor(e/3600),i=Math.floor(e%3600/60),o=e%60;return n>0?`${n}:${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${i}:${o.toString().padStart(2,"0")}`}emit(t,e){this.dispatchEvent(new CustomEvent(`mave:${t}`,{detail:{...e,eventType:t}})),this.dispatchEvent(new CustomEvent("mave:*",{detail:{...e,eventType:t}}));}};chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a({type:String})],s.prototype,"embed",1);exports.a=s;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-SWRFZ3FV.js';import {a as a$2}from'./chunk-5PIHL662.js';import {a}from'./chunk-YPCQNE3R.js';var e=class extends a$1{get poster(){return `${this.cdn_root}/${this.embedId}/poster.webp`}render(){return a$2`<img src=${this.poster} />`}};e.styles=a`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
img {
|
|
7
|
+
width: 100%;
|
|
8
|
+
max-height: 100vh;
|
|
9
|
+
}
|
|
10
|
+
`;typeof window<"u"&&window.customElements&&(window.customElements.get("mave-img")||window.customElements.define("mave-img",e));export{e as a};
|