@maveio/components 0.0.163 → 0.0.165
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-27BWRXCN.js +29 -0
- package/dist/{chunk-ZTCF6574.js → chunk-2ULDXMYP.js} +1 -1
- package/dist/{chunk-B3QILQEE.cjs → chunk-3T573OW4.cjs} +10 -10
- package/dist/chunk-55JWHJJ5.cjs +211 -0
- package/dist/chunk-6XBQ5C3V.js +17 -0
- package/dist/chunk-BN4D4W23.js +20 -0
- package/dist/chunk-BS3IICLO.cjs +20 -0
- package/dist/{chunk-XLUB3ATV.js → chunk-BSJIDMTZ.js} +3 -9
- package/dist/chunk-D7LG2SMD.cjs +33 -0
- package/dist/{chunk-24TUG5TP.js → chunk-E7TZALBH.js} +1 -1
- package/dist/chunk-GO6BV3T4.cjs +29 -0
- package/dist/{chunk-EKNCY5EP.js → chunk-H5S4QWRJ.js} +1 -1
- package/dist/{chunk-6XR2OUZW.js → chunk-HT464LCH.js} +1 -1
- package/dist/chunk-J74VK4RB.cjs +9 -0
- package/dist/{chunk-KVMGCTLR.cjs → chunk-JR7IABIG.cjs} +3 -9
- package/dist/{chunk-EOHKHSQ3.cjs → chunk-JUDFZS5N.cjs} +1 -1
- package/dist/{chunk-HKQCX6NF.js → chunk-K36YHFDX.js} +1 -1
- package/dist/chunk-KUPCZDOX.cjs +10 -0
- package/dist/{chunk-DBQSBUJS.cjs → chunk-LLRH3JIV.cjs} +222 -157
- package/dist/chunk-M22WSPSU.js +9 -0
- package/dist/chunk-NB5PC42C.js +33 -0
- package/dist/{chunk-7XTOYROL.js → chunk-NNH623PH.js} +225 -160
- package/dist/{chunk-FS4URBZN.cjs → chunk-NQBXIQGV.cjs} +1 -1
- package/dist/chunk-O2WRWRDO.cjs +9 -0
- package/dist/chunk-OIZ5B5LE.cjs +17 -0
- package/dist/{chunk-YT56YDUY.cjs → chunk-PXLLLBZ3.cjs} +1 -1
- package/dist/{chunk-CHHWULL2.js → chunk-PZSV3LCB.js} +1 -1
- package/dist/{chunk-MLZIA6JO.cjs → chunk-QLCBHFAG.cjs} +9 -9
- package/dist/{chunk-ZWTODZDA.js → chunk-SF36AD3G.js} +1 -1
- package/dist/chunk-TSTFPNEM.js +211 -0
- package/dist/{chunk-QGSHEFIF.cjs → chunk-UOAF4SEH.cjs} +3 -3
- package/dist/{chunk-FUBUUA7Y.cjs → chunk-WIS6FQDY.cjs} +2 -50
- package/dist/{chunk-HX6F65VL.js → chunk-WO4HFIOO.js} +1 -1
- package/dist/{chunk-QJHVSRHC.cjs → chunk-YKO34INI.cjs} +1 -1
- package/dist/{chunk-HMISRRKC.js → chunk-ZJWT7IOI.js} +2 -50
- package/dist/{chunk-BY7JWUPM.cjs → chunk-ZOMPIWHG.cjs} +4 -4
- package/dist/{chunk-QSQE5WBN.js → chunk-ZUM5T3HV.js} +1 -1
- package/dist/{chunk-3R7TX6NC.js → chunk-ZZBI6DXY.js} +1 -1
- 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 +7 -0
- package/dist/components/player.d.ts +7 -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/api.d.cts +3 -1
- package/dist/embed/api.d.ts +3 -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/generated/locales/de.cjs +1 -1
- package/dist/generated/locales/de.d.cts +6 -4
- package/dist/generated/locales/de.d.ts +6 -4
- package/dist/generated/locales/de.js +1 -1
- package/dist/generated/locales/en.cjs +1 -1
- package/dist/generated/locales/en.d.cts +6 -4
- package/dist/generated/locales/en.d.ts +6 -4
- package/dist/generated/locales/en.js +1 -1
- package/dist/generated/locales/fr.cjs +1 -1
- package/dist/generated/locales/fr.d.cts +6 -4
- package/dist/generated/locales/fr.d.ts +6 -4
- package/dist/generated/locales/fr.js +1 -1
- package/dist/generated/locales/nl.cjs +1 -1
- package/dist/generated/locales/nl.d.cts +6 -4
- package/dist/generated/locales/nl.d.ts +6 -4
- package/dist/generated/locales/nl.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/loader.cjs +1 -1
- package/dist/themes/loader.js +1 -1
- package/dist/utils/localization.cjs +1 -1
- 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.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-5NSCV6C2.cjs +0 -53
- package/dist/chunk-5ZESCVE3.cjs +0 -213
- package/dist/chunk-7ZRXZY5C.js +0 -20
- package/dist/chunk-A4GZBQEB.js +0 -53
- package/dist/chunk-BNCWRH2S.js +0 -213
- package/dist/chunk-FRPU6QLJ.js +0 -93
- package/dist/chunk-H57FX4I6.cjs +0 -9
- package/dist/chunk-LCTGZL3L.js +0 -23
- package/dist/chunk-LG2O4WV2.cjs +0 -23
- package/dist/chunk-MS5NFI3Q.js +0 -9
- package/dist/chunk-MSWONVA7.cjs +0 -20
- package/dist/chunk-PHGKLFNF.cjs +0 -93
- package/dist/chunk-Q22T22LT.cjs +0 -9
- package/dist/chunk-ZLS57S3I.cjs +0 -10
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var x=globalThis,L=x.trustedTypes,rt=L?L.createPolicy("lit-html",{createHTML:r=>r}):void 0,Q="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,X="?"+$,Ut=`<${X}>`,A=document,O=()=>A.createComment(""),R=r=>r===null||typeof r!="object"&&typeof r!="function",ct=Array.isArray,pt=r=>ct(r)||typeof r?.[Symbol.iterator]=="function",G=`[
|
|
2
|
+
\f\r]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ot=/-->/g,nt=/>/g,S=RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ht=/'/g,at=/"/g,dt=/^(?:script|style|textarea|title)$/i,ut=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Zt=ut(1),Ft=ut(2),E=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),lt=new WeakMap,g=A.createTreeWalker(A,129);function $t(r,t){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return rt!==void 0?rt.createHTML(t):t}var _t=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"<svg>":"",n=U;for(let d=0;d<e;d++){let h=r[d],l,p,a=-1,u=0;for(;u<h.length&&(n.lastIndex=u,p=n.exec(h),p!==null);)u=n.lastIndex,n===U?p[1]==="!--"?n=ot:p[1]!==void 0?n=nt:p[2]!==void 0?(dt.test(p[2])&&(i=RegExp("</"+p[2],"g")),n=S):p[3]!==void 0&&(n=S):n===S?p[0]===">"?(n=i??U,a=-1):p[1]===void 0?a=-2:(a=n.lastIndex-p[2].length,l=p[1],n=p[3]===void 0?S:p[3]==='"'?at:ht):n===at||n===ht?n=S:n===ot||n===nt?n=U:(n=S,i=void 0);let f=n===S&&r[d+1].startsWith("/>")?" ":"";o+=n===U?h+Ut:a>=0?(s.push(l),h.slice(0,a)+Q+h.slice(a)+$+f):h+$+(a===-2?d:f);}return [$t(r,o+(r[e]||"<?>")+(t===2?"</svg>":"")),s]},T=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,d=t.length-1,h=this.parts,[l,p]=_t(t,e);if(this.el=r.createElement(l,s),g.currentNode=this.el.content,e===2){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes);}for(;(i=g.nextNode())!==null&&h.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let a of i.getAttributeNames())if(a.endsWith(Q)){let u=p[n++],f=i.getAttribute(a).split($),k=/([.?@])?(.*)/.exec(u);h.push({type:1,index:o,name:k[2],strings:f,ctor:k[1]==="."?j:k[1]==="?"?D:k[1]==="@"?B:b}),i.removeAttribute(a);}else a.startsWith($)&&(h.push({type:6,index:o}),i.removeAttribute(a));if(dt.test(i.tagName)){let a=i.textContent.split($),u=a.length-1;if(u>0){i.textContent=L?L.emptyScript:"";for(let f=0;f<u;f++)i.append(a[f],O()),g.nextNode(),h.push({type:2,index:++o});i.append(a[u],O());}}}else if(i.nodeType===8)if(i.data===X)h.push({type:2,index:o});else {let a=-1;for(;(a=i.data.indexOf($,a+1))!==-1;)h.push({type:7,index:o}),a+=$.length-1;}o++;}}static createElement(t,e){let s=A.createElement("template");return s.innerHTML=t,s}};function v(r,t,e=r,s){if(t===E)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl,o=R(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(false),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=v(r,i._$AS(r,t.values),i,s)),t}var z=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??A).importNode(e,true);g.currentNode=i;let o=g.nextNode(),n=0,d=0,h=s[0];for(;h!==void 0;){if(n===h.index){let l;h.type===2?l=new w(o,o.nextSibling,this,t):h.type===1?l=new h.ctor(o,h.name,h.strings,this,t):h.type===6&&(l=new I(o,this,t)),this._$AV.push(l),h=s[++d];}n!==h?.index&&(o=g.nextNode(),n++);}return g.currentNode=A,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++;}},w=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=v(this,t,e),R(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):pt(t)?this.k(t):this._(t);}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t));}_(t){this._$AH!==c&&R(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t;}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=T.createElement($t(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else {let o=new z(i,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o;}}_$AC(t){let e=lt.get(t.strings);return e===void 0&<.set(t.strings,e=new T(t)),e}k(t){ct(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let o of t)i===e.length?e.push(s=new r(this.S(O()),this.S(O()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i);}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(false,true,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s;}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t));}},b=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c;}_$AI(t,e=this,s,i){let o=this.strings,n=false;if(o===void 0)t=v(this,t,e,0),n=!R(t)||t!==this._$AH&&t!==E,n&&(this._$AH=t);else {let d=t,h,l;for(t=o[0],h=0;h<o.length-1;h++)l=v(this,d[s+h],e,h),l===E&&(l=this._$AH[h]),n||(n=!R(l)||l!==this._$AH[h]),l===c?t=c:t!==c&&(t+=(l??"")+o[h+1]),this._$AH[h]=l;}n&&!i&&this.j(t);}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}},j=class extends b{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===c?void 0:t;}},D=class extends b{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c);}},B=class extends b{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5;}_$AI(t,e=this){if((t=v(this,t,e,0)??c)===E)return;let s=this._$AH,i=t===c&&s!==c||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==c&&(s===c||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}},I=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){v(this,t);}},Gt={P:Q,A:$,C:X,M:1,L:_t,R:z,D:pt,V:v,I:w,H:b,N:D,U:B,B:j,F:I},xt=x.litHtmlPolyfillSupport;xt?.(T,w),(x.litHtmlVersions??(x.litHtmlVersions=[])).push("3.1.2");var ft=(r,t,e)=>{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new w(t.insertBefore(O(),o),o,void 0,e??{});}return i._$AI(r),i};var W=globalThis,V=W.ShadowRoot&&(W.ShadyCSS===void 0||W.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=Symbol(),mt=new WeakMap,M=class{constructor(t,e,s){if(this._$cssResult$=true,s!==Y)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(V&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=mt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&mt.set(e,t));}return t}toString(){return this.cssText}},yt=r=>new M(typeof r=="string"?r:r+"",void 0,Y),Ot=(r,...t)=>{let e=r.length===1?r[0]:t.reduce(((s,i,o)=>s+(n=>{if(n._$cssResult$===true)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1]),r[0]);return new M(e,r,Y)},tt=(r,t)=>{if(V)r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),i=W.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s);}},q=V?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return yt(e)})(r):r;var{is:Rt,defineProperty:Tt,getOwnPropertyDescriptor:Mt,getOwnPropertyNames:Nt,getOwnPropertySymbols:Ht,getPrototypeOf:kt}=Object,m=globalThis,St=m.trustedTypes,Lt=St?St.emptyScript:"",zt=m.reactiveElementPolyfillSupport,N=(r,t)=>r,et={toAttribute(r,t){switch(t){case Boolean:r=r?Lt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r);}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r);}catch{e=null;}}return e}},At=(r,t)=>!Rt(r,t),gt={attribute:true,type:String,converter:et,reflect:false,hasChanged:At};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);var _=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=gt){if(e.state&&(e.attribute=false),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Tt(this.prototype,t,i);}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Mt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n;}};return {get(){return i?.call(this)},set(n){let d=i?.call(this);o.call(this,n),this.requestUpdate(t,d,s);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??gt}static _$Ei(){if(this.hasOwnProperty(N("elementProperties")))return;let t=kt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(N("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(N("properties"))){let e=this.properties,s=[...Nt(e),...Ht(e)];for(let i of s)this.createProperty(i,e[i]);}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i);}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(q(i));}else t!==void 0&&e.push(q(t));return e}static _$Eu(t,e){let s=e.attribute;return s===false?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t);}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return tt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,e,s){this._$AK(t,s);}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===true){let o=(s.converter?.toAttribute!==void 0?s.converter:et).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null;}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:et;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null;}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??At)(this[t],e))return;this.P(t,e,s);}this.isUpdatePending===false&&(this._$ES=this._$ET());}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===true&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t);}async _$ET(){this.isUpdatePending=true;try{await this._$ES;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0;}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==true||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o);}let t=false,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EU();}catch(s){throw t=false,this._$EU(),s}t&&this._$AE(e);}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach((e=>this._$EC(e,this[e])))),this._$EU();}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[N("elementProperties")]=new Map,_[N("finalized")]=new Map,zt?.({ReactiveElement:_}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.0.4");var P=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){var e;let t=super.createRenderRoot();return (e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ft(e,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E}};P._$litElement$=true,P.finalized=true,globalThis.litElementHydrateSupport?.({LitElement:P});var jt=globalThis.litElementPolyfillSupport;jt?.({LitElement:P});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");var K=globalThis,Z=K.ShadowRoot&&(K.ShadyCSS===void 0||K.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vt=Symbol(),Et=new WeakMap,J=class{constructor(t,e,s){if(this._$cssResult$=true,s!==vt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Et.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Et.set(e,t));}return t}toString(){return this.cssText}},bt=r=>new J(typeof r=="string"?r:r+"",void 0,vt);var st=(r,t)=>{if(Z)r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),i=K.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s);}},F=Z?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return bt(e)})(r):r;var {is:Dt,defineProperty:Bt,getOwnPropertyDescriptor:It,getOwnPropertyNames:Wt,getOwnPropertySymbols:Vt,getPrototypeOf:qt}=Object,y=globalThis,Ct=y.trustedTypes,Kt=Ct?Ct.emptyScript:"",Jt=y.reactiveElementPolyfillSupport,H=(r,t)=>r,it={toAttribute(r,t){switch(t){case Boolean:r=r?Kt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r);}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r);}catch{e=null;}}return e}},Pt=(r,t)=>!Dt(r,t),wt={attribute:true,type:String,converter:it,reflect:false,hasChanged:Pt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),y.litPropertyMetadata??(y.litPropertyMetadata=new WeakMap);var C=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=wt){if(e.state&&(e.attribute=false),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Bt(this.prototype,t,i);}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=It(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n;}};return {get(){return i?.call(this)},set(n){let d=i?.call(this);o.call(this,n),this.requestUpdate(t,d,s);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??wt}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;let t=qt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(H("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(H("properties"))){let e=this.properties,s=[...Wt(e),...Vt(e)];for(let i of s)this.createProperty(i,e[i]);}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i);}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(F(i));}else t!==void 0&&e.push(F(t));return e}static _$Eu(t,e){let s=e.attribute;return s===false?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t);}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return st(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,e,s){this._$AK(t,s);}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===true){let o=(s.converter?.toAttribute!==void 0?s.converter:it).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null;}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:it;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null;}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??Pt)(this[t],e))return;this.P(t,e,s);}this.isUpdatePending===false&&(this._$ES=this._$ET());}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===true&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t);}async _$ET(){this.isUpdatePending=true;try{await this._$ES;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0;}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==true||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o);}let t=false,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EU();}catch(s){throw t=false,this._$EU(),s}t&&this._$AE(e);}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach((e=>this._$EC(e,this[e])))),this._$EU();}updated(t){}firstUpdated(t){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[H("elementProperties")]=new Map,C[H("finalized")]=new Map,Jt?.({ReactiveElement:C}),(y.reactiveElementVersions??(y.reactiveElementVersions=[])).push("2.0.4");/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
lit-html/lit-html.js:
|
|
6
|
+
@lit/reactive-element/reactive-element.js:
|
|
7
|
+
lit-element/lit-element.js:
|
|
8
|
+
@lit/reactive-element/reactive-element.js:
|
|
9
|
+
(**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
@lit/reactive-element/css-tag.js:
|
|
16
|
+
@lit/reactive-element/css-tag.js:
|
|
17
|
+
(**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2019 Google LLC
|
|
20
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
+
*)
|
|
22
|
+
|
|
23
|
+
lit-html/is-server.js:
|
|
24
|
+
(**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright 2022 Google LLC
|
|
27
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
+
*)
|
|
29
|
+
*/export{it as a,Pt as b,Zt as c,Ft as d,E as e,c as f,Gt as g,Ot as h,P as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as b$2}from'./chunk-
|
|
1
|
+
import {b as b$2}from'./chunk-H5S4QWRJ.js';import {b as b$1}from'./chunk-WO4HFIOO.js';import {a as a$1}from'./chunk-E7TZALBH.js';import {a}from'./chunk-ZJWT7IOI.js';import {h as h$1,c as c$1,f as f$1}from'./chunk-27BWRXCN.js';import {c,e,g}from'./chunk-KA24PL7V.js';var n,C,b,h,f,p,u=class extends a$1{constructor(){super(...arguments);e(this,n);this.order="newest";this.embedController=new b$1(this,0);}connectedCallback(){super.connectedCallback(),this.embedController.token=this.token;}requestUpdate(e,o){super.requestUpdate(e,o),e==="embed"&&(this.embedController.token=this.token);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}updated(){this.shadowRoot&&b$2(this.shadowRoot);}refresh(){return this.embedController.refresh()}containsEmbed(e){return this._collection?.videos?.some(o=>o.id===e)}getNextForEmbed(e){let o=g(this,n,C).call(this),t=o.findIndex(s=>s.id===e);if(t!==-1)return o[t+1]}render(){return c$1`
|
|
2
2
|
${this.embedController.render({pending:this.renderPending,error:e=>c$1`<p>${e instanceof Error?e.message:f$1}</p>`,complete:e=>{if(this._collection=e,!e)return this.renderPending();if(e.error)return console.warn(e.error);let o=this._slottedChildren.map(t=>{function s(){let l;return t.nodeName==="TEMPLATE"?l=t.content.cloneNode(true):l=t.cloneNode(true),l}if(t.getAttribute("name")=="list-title"){let l=s();return l.textContent=this._collection?.name,c$1`${l}`}if(t.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let l=s(),i=g(this,n,f).call(this,l,"root-link");return i&&(i.addEventListener("click",a=>{a.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"back",embedId:""}),this.embedController.embed="";}),g(this,n,p).call(this,i)),c$1`${l}`}if(t.getAttribute("name")=="mave-list-folder"){let l=this._collection.collections?.map(i=>{let a=s(),m=g(this,n,f).call(this,a,"folder-link");return [t,m].forEach(d=>{d instanceof Element&&(d.addEventListener("click",g=>{g.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"show_collection",collectionId:i.id}),this.embedController.embed=i.id;}),g(this,n,p).call(this,d));}),g(this,n,h).call(this,a,"folder-title",i.name),typeof i.video_count=="number"&&g(this,n,h).call(this,a,"folder-count",i.video_count.toString()),c$1`${a}`});return c$1`${l}`}if(t.getAttribute("name")=="mave-list-item"||!["mave-list-folder","mave-list-item","mave-list-root","list-title"].includes(t.hasAttribute("name")?t.getAttribute("name"):"")&&t.nodeName=="TEMPLATE"){let l=g(this,n,C).call(this).map((i,a)=>{let m=s(),d=a+1;g(this,n,h).call(this,m,"item-title",i.name),g(this,n,h).call(this,m,"item-position",d.toString()),g(this,n,h).call(this,m,"item-duration",this.durationToTime(i.duration)),g(this,n,b).call(this,m,"mave-clip",i.id),g(this,n,b).call(this,m,"mave-player",i.id),g(this,n,b).call(this,m,"mave-img",i.id);let g$1=m.querySelector("mave-clip"),S=g(this,n,f).call(this,m,"item-title"),$=m.querySelector("mave-img");return [g$1,S,$,m].forEach(P=>{P?.addEventListener("click",x=>{this.emit(this.EVENT_TYPES.CLICK,{action:"show_embed",embedId:i.id,position:d});});}),c$1`${m}`});return c$1`${l}`}}).filter(t=>t);return c$1`${this._stylesheets} ${o}`}})}
|
|
3
3
|
`}renderPending(){return c$1`<slot style="display: none"></slot>`}};n=new WeakSet,C=function(){if(!this._collection)return [];let e=this._collection.videos;return this.order=="newest"&&(e=this._collection.videos?.sort((o,t)=>t.created-o.created)),this.order=="oldest"&&(e=this._collection.videos?.sort((o,t)=>o.created-t.created)),this.order=="az"&&(e=this._collection.videos?.sort((o,t)=>o.name.localeCompare(t.name))),this.order=="za"&&(e=this._collection.videos?.sort((o,t)=>t.name.localeCompare(o.name))),e},b=function(e,o,t){let s=e.querySelector(o);s&&(s.setAttribute("embed",t),g(this,n,p).call(this,s));},h=function(e,o,t){let s=g(this,n,f).call(this,e,o);s&&(s.textContent=t,g(this,n,p).call(this,s));},f=function(e,o){return e.querySelector(`[slot="${o}"], [data-slot="${o}"]`)},p=function(e){e&&(e.removeAttribute("slot"),e.removeAttribute("data-slot"));},u.styles=h$1`
|
|
4
4
|
:host {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkO2WRWRDO_cjs=require('./chunk-O2WRWRDO.cjs'),chunkYKO34INI_cjs=require('./chunk-YKO34INI.cjs'),chunkJ74VK4RB_cjs=require('./chunk-J74VK4RB.cjs'),chunkWIS6FQDY_cjs=require('./chunk-WIS6FQDY.cjs'),chunkGO6BV3T4_cjs=require('./chunk-GO6BV3T4.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var o,k,C,S,n=class extends chunkGO6BV3T4_cjs.i{constructor(){super(...arguments);chunkJHSFSCC2_cjs.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 chunkYKO34INI_cjs.a(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;chunkJHSFSCC2_cjs.g(this,o,k).call(this,this,c-i.height/2);}}}}get segmentIndex(){return this._segmentIndex}set segmentIndex(t){this._segmentIndex!=t&&(this._segmentIndex=t);}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",chunkJHSFSCC2_cjs.g(this,o,C).bind(this)),this.reset();}reset(){if(typeof document>"u")return;this.loop=false,this.currentTime=0,this.wordIndex=0,this.segmentIndex=0;let t=document.querySelector(`mave-player[embed="${this.embed}"]`);t&&(this.player=t,t.addEventListener("play",()=>{this.loop=true,this.loopUpdateTime();}),t.addEventListener("pause",()=>{this.loop=false;}));}updateTime(){this.currentTime=this.player.currentTime;}loopUpdateTime(){this.updateTime(),setTimeout(()=>{this.loop&&requestAnimationFrame(this.loopUpdateTime.bind(this));},10);}inRange({start:t,end:e},r,i,s){if(this.currentTime>=t&&this.currentTime<=e)return s&&(this.wordIndex=s),i&&(this.segmentIndex=i),r||true}segmentStyle(){return this.clickable?{cursor:"pointer"}:{}}wordStyle(t){return t?{"background-color":this.highlight}:{}}render(){return this.captionController?this.captionController.render({complete:t=>(this.captions=t,chunkGO6BV3T4_cjs.c`
|
|
2
2
|
<div>
|
|
3
|
-
${this.captions.segments.map((e,r)=>
|
|
3
|
+
${this.captions.segments.map((e,r)=>chunkGO6BV3T4_cjs.c`
|
|
4
4
|
<p
|
|
5
5
|
data-segment-id="segment-${r}"
|
|
6
|
-
style=${
|
|
7
|
-
@click=${this.clickable?chunkJHSFSCC2_cjs.g(this,o,S):
|
|
8
|
-
part=${
|
|
6
|
+
style=${chunkO2WRWRDO_cjs.a(this.segmentStyle())}
|
|
7
|
+
@click=${this.clickable?chunkJHSFSCC2_cjs.g(this,o,S):chunkGO6BV3T4_cjs.f}
|
|
8
|
+
part=${chunkJ74VK4RB_cjs.a(this.inRange(e,"segment"))}
|
|
9
9
|
x-caption-segment-start="${e.start}"
|
|
10
10
|
x-caption-segment-end="${e.end}"
|
|
11
11
|
>
|
|
12
|
-
${e.words.map((i,s)=>
|
|
12
|
+
${e.words.map((i,s)=>chunkGO6BV3T4_cjs.c`
|
|
13
13
|
<span
|
|
14
14
|
data-word-id="word-${r}-${s}"
|
|
15
|
-
style=${
|
|
16
|
-
part=${
|
|
15
|
+
style=${chunkO2WRWRDO_cjs.a(this.wordStyle(this.inRange(i)))}
|
|
16
|
+
part=${chunkJ74VK4RB_cjs.a(this.inRange(i,"word",r,s))}
|
|
17
17
|
x-caption-word-start="${i.start}"
|
|
18
18
|
x-caption-word-end="${i.end}"
|
|
19
19
|
>${i.word.trim()}</span
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</p>
|
|
23
23
|
`)}
|
|
24
24
|
</div>
|
|
25
|
-
`)}):
|
|
25
|
+
`)}):chunkGO6BV3T4_cjs.f}};o=new WeakSet,k=function(t,e,r=500){let i=this.scrollTop,s=e-i,c=null,p=false;function w(l){c||(c=l);let y=l-c,v=Math.min(y/r,1);t.scrollTop=i+s*x(v),y<r&&p?requestAnimationFrame(w):p=false;}function x(l){return l<.5?2*l*l:1-Math.pow(-2*l+2,2)/2}p=true,requestAnimationFrame(w);},C=function(){this._lastScrollTime=Date.now();},S=function(t){if(this.clickable){let e=t.target.closest("p");if(e&&this.player){let r=e.getAttribute("x-caption-segment-start");this.player.currentTime=Number(r),this.player.paused&&this.player.play();}}},n.styles=chunkGO6BV3T4_cjs.h`
|
|
26
26
|
:host {
|
|
27
27
|
display: block;
|
|
28
28
|
width: 100%;
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
[part='word'] {
|
|
33
33
|
background-color: rgba(255, 210, 42, 0.5);
|
|
34
34
|
}
|
|
35
|
-
`,chunkJHSFSCC2_cjs.c([
|
|
35
|
+
`,chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],n.prototype,"embed",1),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],n.prototype,"highlight",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],n.prototype,"clickable",1),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],n.prototype,"autoscroll",1),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],n.prototype,"currentTime",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],n.prototype,"captions",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-text")||window.customElements.define("mave-text",n));exports.a=n;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
'use strict';var chunkFUSQ4EZG_cjs=require('./chunk-FUSQ4EZG.cjs'),chunkD7LG2SMD_cjs=require('./chunk-D7LG2SMD.cjs'),chunkO2WRWRDO_cjs=require('./chunk-O2WRWRDO.cjs'),chunkWIS6FQDY_cjs=require('./chunk-WIS6FQDY.cjs'),chunkGO6BV3T4_cjs=require('./chunk-GO6BV3T4.cjs'),chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var Pt=chunkJHSFSCC2_cjs.a((no,Ot)=>{Ot.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 Dt=chunkJHSFSCC2_cjs.a(Ae=>{var Vr=Object.prototype.hasOwnProperty,Wr;function kt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Rt(e){try{return encodeURIComponent(e)}catch{return null}}function Yr(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var o=kt(n[1]),a=kt(n[2]);o===null||a===null||o in r||(r[o]=a);}return r}function Zr(e,t){t=t||"";var r=[],n,o;typeof t!="string"&&(t="?");for(o in e)if(Vr.call(e,o)){if(n=e[o],!n&&(n===null||n===Wr||isNaN(n))&&(n=""),o=Rt(o),n=Rt(n),o===null||n===null)continue;r.push(o+"="+n);}return r.length?t+r.join("&"):""}Ae.stringify=Zr;Ae.parse=Yr;});var Nt=chunkJHSFSCC2_cjs.a((io,It)=>{var jt=Pt(),be=Dt(),Jr=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Tt=/[\n\r\t]/g,Qr=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Lt=/:\d+$/,en=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,tn=/^[a-zA-Z]:/;function Ie(e){return (e||"").toString().replace(Jr,"")}var Fe=[["#","hash"],["?","query"],function(t,r){return L(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]],Ct={hash:1,query:1};function At(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 A(unescape(e.pathname),{});else if(o==="string"){n=new A(e,{});for(a in Ct)delete n[a];}else if(o==="object"){for(a in e)a in Ct||(n[a]=e[a]);n.slashes===void 0&&(n.slashes=Qr.test(e.href));}return n}function L(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Ft(e,t){e=Ie(e),e=e.replace(Tt,""),t=t||{};var r=en.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)):L(n)?c=r[4]:n?o&&(c=c.slice(2)):u>=2&&L(t.protocol)&&(c=r[4]),{protocol:n,slashes:o||L(n),slashesCount:u,rest:c}}function rn(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 A(e,t,r){if(e=Ie(e),e=e.replace(Tt,""),!(this instanceof A))return new A(e,t,r);var n,o,a,u,c,h,m=Fe.slice(),v=typeof t,y=this,C=0;for(v!=="object"&&v!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=be.parse),t=At(t),o=Ft(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||tn.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!L(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=rn(y.pathname,t.pathname)),y.pathname.charAt(0)!=="/"&&L(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:"&&L(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString();}function nn(e,t,r){var n=this;switch(e){case "query":typeof t=="string"&&t.length&&(t=(r||be.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<Fe.length;u++){var c=Fe[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:"&&L(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function on(e){(!e||typeof e!="function")&&(e=be.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||L(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):r.protocol!=="file:"&&L(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}A.prototype={set:nn,toString:on};A.extractProtocol=Ft;A.location=At;A.trimLeft=Ie;A.qs=be;It.exports=A;});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 _r(e,t,r){return Object.defineProperty(e,"prototype",{writable:false}),e}function Er(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xr(e,t,r){return t=fe(t),Ur(e,De()?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 Or(e)}function Or(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pr(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 Re(e){var t=typeof Map=="function"?new Map:void 0;return Re=function(n){if(n===null||!Rr(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 kr(n,arguments,fe(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:false,writable:true,configurable:true}}),ue(o,n)},Re(e)}function kr(e,t,r){if(De())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 De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (De=function(){return !!e})()}function Rr(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 Dr=(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(Er(this,t),n=xr(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 Pr(t,e),_r(t)})(Re(Error)),Q=Dr;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 it(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 Tr(e,t,r){return t&&it(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Lr(e){var t=Ar(e,"string");return ce(t)=="symbol"?t:t+""}function Ar(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 at=(function(){function e(){jr(this,e);}return Tr(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 pt="3.7.5",Fr=pt,Ir=typeof atob=="function",Nr=typeof btoa=="function",te=typeof Buffer=="function",st=typeof TextDecoder=="function"?new TextDecoder:void 0,lt=typeof TextEncoder=="function"?new TextEncoder:void 0,Hr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",pe=Array.prototype.slice.call(Hr),ge=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(pe),Br=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,U=String.fromCharCode.bind(String),ut=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),ht=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),dt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),yt=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},Te=Nr?e=>btoa(e):te?e=>Buffer.from(e,"binary").toString("base64"):yt,Ce=te?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(U.apply(null,e.subarray(n,n+4096)));return Te(r.join(""))},ve=(e,t=false)=>t?ht(Ce(e)):Ce(e),qr=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?U(192|t>>>6)+U(128|t&63):U(224|t>>>12&15)+U(128|t>>>6&63)+U(128|t&63)}else {var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return U(240|t>>>18&7)+U(128|t>>>12&63)+U(128|t>>>6&63)+U(128|t&63)}},zr=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,mt=e=>e.replace(zr,qr),ft=te?e=>Buffer.from(e,"utf8").toString("base64"):lt?e=>Ce(lt.encode(e)):e=>Te(mt(e)),ee=(e,t=false)=>t?ht(ft(e)):ft(e),ct=e=>ee(e,true),Mr=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,$r=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 U((r>>>10)+55296)+U((r&1023)+56320);case 3:return U((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return U((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},gt=e=>e.replace(Mr,$r),vt=e=>{if(e=e.replace(/\s+/g,""),!Br.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=ge[e.charAt(a++)]<<18|ge[e.charAt(a++)]<<12|(n=ge[e.charAt(a++)])<<6|(o=ge[e.charAt(a++)]),r+=n===64?U(t>>16&255):o===64?U(t>>16&255,t>>8&255):U(t>>16&255,t>>8&255,t&255);return r},Le=Ir?e=>atob(dt(e)):te?e=>Buffer.from(e,"base64").toString("binary"):vt,bt=te?e=>ut(Buffer.from(e,"base64")):e=>ut(Le(e).split("").map(t=>t.charCodeAt(0))),_t=e=>bt(wt(e)),Gr=te?e=>Buffer.from(e,"base64").toString("utf8"):st?e=>st.decode(bt(e)):e=>gt(Le(e)),wt=e=>dt(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),je=e=>Gr(wt(e)),Kr=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)},St=e=>({value:e,enumerable:false,writable:true,configurable:true}),Et=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,St(r));e("fromBase64",function(){return je(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 _t(this)});},xt=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,St(r));e("toBase64",function(t){return ve(this,t)}),e("toBase64URI",function(){return ve(this,true)}),e("toBase64URL",function(){return ve(this,true)});},Xr=()=>{Et(),xt();},Ut={version:pt,VERSION:Fr,atob:Le,atobPolyfill:vt,btoa:Te,btoaPolyfill:yt,fromBase64:je,toBase64:ee,encode:ee,encodeURI:ct,encodeURL:ct,utob:mt,btou:gt,decode:je,isValid:Kr,fromUint8Array:ve,toUint8Array:_t,extendString:Et,extendUint8Array:xt,extendBuiltins:Xr};var Zt=chunkJHSFSCC2_cjs.b(Nt());function Ne(){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 He(){He=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:Ue(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",q="executing",T="completed",S={};function F(){}function R(){}function E(){}var j={};m(j,u,function(){return this});var z=Object.getPrototypeOf,I=z&&z(z(G([])));I&&I!==r&&n.call(I,u)&&(j=I);var D=E.prototype=F.prototype=Object.create(j);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 O=_.arg,x=O.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){O.value=P,g(O);},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(_,O){s(p,g,_,O);})}return f=f?f.then(b,b):b()}});}function Ue(l,i,s){var f=C;return function(d,p){if(f===q)throw Error("Generator is already running");if(f===T){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=T,s.arg;s.dispatchException(s.arg);}else s.method==="return"&&s.abrupt("return",s.arg);f=q;var _=y(l,i,s);if(_.type==="normal"){if(f=s.done?T:ae,_.arg===S)continue;return {value:_.arg,done:s.done}}_.type==="throw"&&(f=T,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 Oe(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(Oe,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(O,x){return g.type="throw",g.arg=i,s.next=O,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 Ht(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 an(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function u(h){Ht(a,n,o,u,c,"next",h);}function c(h){Ht(a,n,o,u,c,"throw",h);}u(void 0);})}}function Vt(e,t){return un(e)||ln(e,t)||Wt(e,t)||sn()}function sn(){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 ln(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 un(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 fn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Wt(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 Wt(e,t){if(e){if(typeof e=="string")return Bt(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 Bt(e,t)}}function Bt(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){cn(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 cn(e,t,r){return t=Yt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function pn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zt(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,Yt(n.key),n);}}function hn(e,t,r){return t&&zt(e.prototype,t),r&&zt(e,r),Object.defineProperty(e,"prototype",{writable:false}),e}function Yt(e){var t=dn(e,"string");return W(t)=="symbol"?t:t+""}function dn(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 Be="tus-v1",_e="ietf-draft-03",yn={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:Qt,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:Be},Jt=(function(){function e(t,r){pn(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 hn(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(![Be,_e].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:gn(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 q=ae.value;return new Promise(function(T,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:T,onError:S,onProgress:function(j){a=a-C+j,C=j,n._emitProgress(a,o);},onUploadUrlAvailable:function(){n._parallelUploadUrls[y]=R.url,n._parallelUploadUrls.filter(function(j){return !!j}).length===c.length&&n._saveUploadInUrlStorage();}}),R=new e(q,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=Mt(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=Xt(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=fn(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),Kt(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=Mt(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===_e&&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=Xt(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===Be){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);}),r.setHeader("Content-Type","application/offset+octet-stream"),(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===_e&&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=$t(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 Gt(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=$t("DELETE",r,n);return Gt(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)),!Kt(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 Mt(e){return Object.entries(e).map(function(t){var r=Vt(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 $t(e,t,r){var n=r.httpStack.createRequest(e,t);r.protocol===_e?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},a=0,u=Object.entries(o);a<u.length;a++){var c=Vt(u[a],2),h=c[0],m=c[1];n.setHeader(h,m);}if(r.addRequestId){var v=Ne();n.setHeader("X-Request-ID",v);}return n}function Gt(e,t,r){return qe.apply(this,arguments)}function qe(){return qe=an(He().mark(function e(t,r,n){var o;return He().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 mn(){var e=true;return typeof navigator<"u"&&navigator.onLine===false&&(e=false),e}function Kt(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):Qt(e)}function Qt(e){var t=e.originalResponse?e.originalResponse.getStatus():0;return (!ne(t,400)||t===409||t===423)&&mn()}function Xt(e,t){return new Zt.default(t,e).toString()}function gn(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}Jt.defaultOptions=yn;var we=Jt;var vn=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"},Se=vn;function ze(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 bn=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")},er=bn;function Me(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 he(e){"@babel/helpers - typeof";return he=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},he(e)}function _n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tr(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,Sn(n.key),n);}}function wn(e,t,r){return t&&tr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Sn(e){var t=En(e,"string");return he(t)=="symbol"?t:t+""}function En(e,t){if(he(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(he(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var $e=(function(){function e(t){_n(this,e),this._file=t,this.size=t.size;}return wn(e,[{key:"slice",value:function(r,n){if(er())return Me(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 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 xn(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,On(n.key),n);}}function Un(e,t,r){return t&&rr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function On(e){var t=Pn(e,"string");return de(t)=="symbol"?t:t+""}function Pn(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)}function nr(e){return e===void 0?0:e.size!==void 0?e.size:e.length}function kn(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 or=(function(){function e(t){xn(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=false;}return Un(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+nr(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=kn(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=nr(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 Ge(){Ge=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:Ue(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",q="executing",T="completed",S={};function F(){}function R(){}function E(){}var j={};m(j,u,function(){return this});var z=Object.getPrototypeOf,I=z&&z(z(G([])));I&&I!==r&&n.call(I,u)&&(j=I);var D=E.prototype=F.prototype=Object.create(j);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 O=_.arg,x=O.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){O.value=P,g(O);},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(_,O){s(p,g,_,O);})}return f=f?f.then(b,b):b()}});}function Ue(l,i,s){var f=C;return function(d,p){if(f===q)throw Error("Generator is already running");if(f===T){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=T,s.arg;s.dispatchException(s.arg);}else s.method==="return"&&s.abrupt("return",s.arg);f=q;var _=y(l,i,s);if(_.type==="normal"){if(f=s.done?T:ae,_.arg===S)continue;return {value:_.arg,done:s.done}}_.type==="throw"&&(f=T,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 Oe(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(Oe,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(O,x){return g.type="throw",g.arg=i,s.next=O,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 ir(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 Rn(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function u(h){ir(a,n,o,u,c,"next",h);}function c(h){ir(a,n,o,u,c,"throw",h);}u(void 0);})}}function Dn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ar(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,jn(n.key),n);}}function Cn(e,t,r){return t&&ar(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function jn(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 sr=(function(){function e(){Dn(this,e);}return Cn(e,[{key:"openFile",value:(function(){var t=Rn(Ge().mark(function n(o,a){var u;return Ge().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(Se()&&o&&typeof o.uri<"u")){h.next=11;break}return h.prev=1,h.next=4,ze(o.uri);case 4:return u=h.sent,h.abrupt("return",new $e(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 $e(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 or(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 Ke(e,t){return Se()?Promise.resolve(Ln(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}function Ln(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 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 Xe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lr(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,Fn(n.key),n);}}function Ve(e,t,r){return t&&lr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Fn(e){var t=In(e,"string");return ye(t)=="symbol"?t:t+""}function In(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)}var ur=(function(){function e(){Xe(this,e);}return Ve(e,[{key:"createRequest",value:function(r,n){return new Nn(r,n)}},{key:"getName",value:function(){return "XHRHttpStack"}}])})();var Nn=(function(){function e(t,r){Xe(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,true),this._method=t,this._url=r,this._headers={};}return Ve(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 Hn(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}}])})(),Hn=(function(){function e(t){Xe(this,e),this._xhr=t;}return Ve(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 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 Bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fr(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 qn(e,t,r){return t&&fr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function zn(e){var t=Mn(e,"string");return me(t)=="symbol"?t:t+""}function Mn(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 Ye=false;try{Ye="localStorage"in window,Ee="tusSupport",We=localStorage.getItem(Ee),localStorage.setItem(Ee,We),We===null&&localStorage.removeItem(Ee);}catch(e){if(e.code===e.SECURITY_ERR||e.code===e.QUOTA_EXCEEDED_ERR)Ye=false;else throw e}var Ee,We,cr=Ye,pr=(function(){function e(){Bn(this,e);}return qn(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 $n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hr(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,gr(n.key),n);}}function Gn(e,t,r){return r&&hr(e,r),Object.defineProperty(e,"prototype",{writable:false}),e}function Kn(e,t,r){return t=xe(t),Xn(e,mr()?Reflect.construct(t,r||[],xe(e).constructor):t.apply(e,r))}function Xn(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 Vn(e)}function Vn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (mr=function(){return !!e})()}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xe(e)}function Wn(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&&Ze(e,t);}function Ze(e,t){return Ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ze(e,t)}function dr(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?dr(Object(r),true).forEach(function(n){Yn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function Yn(e,t,r){return t=gr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function gr(e){var t=Zn(e,"string");return ie(t)=="symbol"?t:t+""}function Zn(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 yr=oe(oe({},we.defaultOptions),{},{httpStack:new ur,fileReader:new sr,urlStorage:cr?new pr:new at,fingerprint:Ke}),vr=(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 $n(this,t),n=oe(oe({},yr),n),Kn(this,t,[r,n])}return Wn(t,e),Gn(t,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=oe(oe({},yr),o),we.terminate(n,o)}}])})(we);exports.a=class w extends chunkGO6BV3T4_cjs.i{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 chunkD7LG2SMD_cjs.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=chunkFUSQ4EZG_cjs.a.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(){chunkFUSQ4EZG_cjs.a.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 vr(r,{endpoint:chunk5STN56TL_cjs.a.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=exports.a.getFileExtension(r);return n.startsWith("video/")?!o||exports.a.SUPPORTED_VIDEO_EXTENSIONS.has(o):n.startsWith("audio/")?!o||exports.a.SUPPORTED_AUDIO_EXTENSIONS.has(o):o?!!(exports.a.SUPPORTED_VIDEO_EXTENSIONS.has(o)||exports.a.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(exports.a.SUPPORTED_VIDEO_EXTENSIONS),audio:Array.from(exports.a.SUPPORTED_AUDIO_EXTENSIONS)}};this._error=n,this._progress=0,this._completed=false,this.dispatchEvent(new CustomEvent("invalid",{bubbles:true,composed:true,detail:{...n,message:chunkD7LG2SMD_cjs.b("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 chunkGO6BV3T4_cjs.c`<form
|
|
4
|
+
class="state state--initial"
|
|
5
|
+
style=${chunkO2WRWRDO_cjs.a({...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">${chunkD7LG2SMD_cjs.b("drop video here")}</div>
|
|
14
|
+
<div class="upload-default-subtitle">${chunkD7LG2SMD_cjs.b("or browse your files")}</div>
|
|
15
|
+
<button
|
|
16
|
+
type="button"
|
|
17
|
+
data-mave-upload-select
|
|
18
|
+
class="upload-default-button"
|
|
19
|
+
style=${chunkO2WRWRDO_cjs.a({background:r,borderRadius:n})}
|
|
20
|
+
>
|
|
21
|
+
${chunkD7LG2SMD_cjs.b("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?chunkGO6BV3T4_cjs.c`<form
|
|
33
|
+
class="state state--error"
|
|
34
|
+
style=${chunkO2WRWRDO_cjs.a({...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 chunkGO6BV3T4_cjs.c`<div class="state state--uploading" style=${chunkO2WRWRDO_cjs.a(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">${chunkD7LG2SMD_cjs.b("uploading...")}</div>
|
|
63
|
+
</div>
|
|
64
|
+
</slot>
|
|
65
|
+
</div>`}renderProcessing(){return chunkGO6BV3T4_cjs.c`<div class="state state--processing" style=${chunkO2WRWRDO_cjs.a(this.styleFont())}>
|
|
66
|
+
<slot name="processing">
|
|
67
|
+
<div class="upload-default-status" role="status">${chunkD7LG2SMD_cjs.b("just a minute...")}</div>
|
|
68
|
+
</slot>
|
|
69
|
+
</div>`}renderDone(){return chunkGO6BV3T4_cjs.c`<div class="state state--done" style=${chunkO2WRWRDO_cjs.a(this.styleFont())}>
|
|
70
|
+
<slot name="done">
|
|
71
|
+
<div class="upload-default-status" role="status">${chunkD7LG2SMD_cjs.b("done")}</div>
|
|
72
|
+
</slot>
|
|
73
|
+
</div>`}};exports.a.SUPPORTED_VIDEO_EXTENSIONS=new Set(["3g2","3gp","avi","mov","mp4","m4v","mkv","qt","ts","mts","m2t","m2ts","webm"]),exports.a.SUPPORTED_AUDIO_EXTENSIONS=new Set(["aac","amr","flac","m4a","m4b","m4p","mp3","ogg","wav"]),exports.a.styles=chunkGO6BV3T4_cjs.h`
|
|
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
|
+
`,chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],exports.a.prototype,"token",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],exports.a.prototype,"locale",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],exports.a.prototype,"color",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],exports.a.prototype,"font",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a()],exports.a.prototype,"radius",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.a({type:Boolean})],exports.a.prototype,"disableCompletion",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],exports.a.prototype,"_progress",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],exports.a.prototype,"_upload_id",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],exports.a.prototype,"_completed",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],exports.a.prototype,"_dragging",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],exports.a.prototype,"_error",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.b()],exports.a.prototype,"_hasErrorSlot",2),chunkJHSFSCC2_cjs.c([chunkWIS6FQDY_cjs.c("#mave-upload-input")],exports.a.prototype,"fileInput",2),exports.a=chunkJHSFSCC2_cjs.c([chunkD7LG2SMD_cjs.a()],exports.a);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-upload")||window.customElements.define("mave-upload",exports.a));/*! 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
|
+
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var h=window,c=h.ShadowRoot&&(h.ShadyCSS===void 0||h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,m=Symbol(),_=new WeakMap,l=class{constructor(t,e,s){if(this._$cssResult$=true,s!==m)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(c&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_.set(e,t));}return t}toString(){return this.cssText}},g=r=>new l(typeof r=="string"?r:r+"",void 0,m);var v=(r,t)=>{c?r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((e=>{let s=document.createElement("style"),i=h.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s);}));},u=c?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return g(e)})(r):r;var f,d=window,$=d.trustedTypes,A=$?$.emptyScript:"",b=d.reactiveElementPolyfillSupport,y={toAttribute(r,t){switch(t){case Boolean:r=r?A:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r);}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r);}catch{e=null;}}return e}},p=(r,t)=>t!==r&&(t==t||r==r),S={attribute:true,type:String,converter:y,reflect:false,hasChanged:p},n=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=false,this.hasUpdated=false,this._$El=null,this.u();}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t);}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach(((e,s)=>{let i=this._$Ep(s,e);i!==void 0&&(this._$Ev.set(i,s),t.push(i));})),t}static createProperty(t,e=S){if(e.state&&(e.attribute=false),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Object.defineProperty(this.prototype,t,i);}}static getPropertyDescriptor(t,e,s){return {get(){return this[e]},set(i){let o=this[t];this[e]=i,this.requestUpdate(t,o,s);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)||S}static finalize(){if(this.hasOwnProperty("finalized"))return false;this.finalized=true;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let i of s)this.createProperty(i,e[i]);}return this.elementStyles=this.finalizeStyles(this.styles),true}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(u(i));}else t!==void 0&&e.push(u(t));return e}static _$Ep(t,e){let s=e.attribute;return s===false?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach((e=>e(this)));}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t));}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e]);}));}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return v(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(true),(t=this._$ES)===null||t===void 0||t.forEach((e=>{var s;return (s=e.hostConnected)===null||s===void 0?void 0:s.call(e)}));}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach((e=>{var s;return (s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)}));}attributeChangedCallback(t,e,s){this._$AK(t,s);}_$EO(t,e,s=S){var i;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===true){let a=(((i=s.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?s.converter:y).toAttribute(e,s.type);this._$El=t,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$El=null;}}_$AK(t,e){var s;let i=this.constructor,o=i._$Ev.get(t);if(o!==void 0&&this._$El!==o){let a=i.getPropertyOptions(o),U=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?a.converter:y;this._$El=o,this[o]=U.fromAttribute(e,a.type),this._$El=null;}}requestUpdate(t,e,s){let i=true;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||p)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===true&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):i=false),!this.isUpdatePending&&i&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=true;try{await this._$E_;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((i,o)=>this[o]=i)),this._$Ei=void 0);let e=false,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach((i=>{var o;return (o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)})),this.update(s)):this._$Ek();}catch(i){throw e=false,this._$Ek(),i}e&&this._$AE(s);}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach((s=>{var i;return (i=s.hostUpdated)===null||i===void 0?void 0:i.call(s)})),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return true}update(t){this._$EC!==void 0&&(this._$EC.forEach(((e,s)=>this._$EO(s,this[s],e))),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}};n.finalized=true,n.elementProperties=new Map,n.elementStyles=[],n.shadowRootOptions={mode:"open"},b?.({ReactiveElement:n}),((f=d.reactiveElementVersions)!==null&&f!==void 0?f:d.reactiveElementVersions=[]).push("1.6.1");var w=Symbol(),E=class{get taskComplete(){return this.t||(this.status===1?this.t=new Promise(((t,e)=>{this.i=t,this.o=e;})):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(t,e,s){this.u=0,this.status=0,(this.p=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this._=i.task,this.v=i.args,this.j=i.argsEqual??C,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??true,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=this.A?.());}hostUpdate(){this.autoRun===true&&this.O();}hostUpdated(){this.autoRun==="afterUpdate"&&this.O();}A(){if(this.v===void 0)return;let t=this.v();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async O(){let t=this.A(),e=this.k;this.k=t,t===e||t===void 0||e!==void 0&&this.j(e,t)||await this.run(t);}async run(t){let e,s;t??(t=this.A()),this.k=t,this.status===1?this.T?.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this.p.requestUpdate())):this.p.requestUpdate();let i=++this.u;this.T=new AbortController;let o=false;try{e=await this._(t,{signal:this.T.signal});}catch(a){o=true,s=a;}if(this.u===i){if(e===w)this.status=0;else {if(o===false){try{this.m?.(e);}catch{}this.status=2,this.i?.(e);}else {try{this.g?.(s);}catch{}this.status=3,this.o?.(s);}this.l=e,this.h=s;}this.p.requestUpdate();}}abort(t){this.status===1&&this.T?.abort(t);}get value(){return this.l}get error(){return this.h}render(t){switch(this.status){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.status)}}},C=(r,t)=>r===t||r.length===t.length&&r.every(((e,s)=>!p(e,t[s])));/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit/reactive-element/css-tag.js:
|
|
4
|
+
(**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2019 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*)
|
|
9
|
+
|
|
10
|
+
@lit/reactive-element/reactive-element.js:
|
|
11
|
+
@lit/task/task.js:
|
|
12
|
+
(**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2017 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*)
|
|
17
|
+
*/export{E as a};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {b}from'./chunk-WO4HFIOO.js';import {a as a$1}from'./chunk-E7TZALBH.js';import {a}from'./chunk-ZJWT7IOI.js';import {h,c as c$1}from'./chunk-27BWRXCN.js';import {c,e,g as g$1}from'./chunk-KA24PL7V.js';var i,l,C,R,g,v,w,z,L,U,F,y,f=class extends a$1{constructor(){super(...arguments);e(this,i);this.embedController=new 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 c$1`
|
|
2
|
+
${this.embedController.render({pending:this.renderPending,complete:e=>{if(this._data=e,!e)return;let n=g$1(this,i,U).call(this),t=g$1(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)&&g$1(this,i,l).call(this,s,"date",new Date(m).toLocaleDateString().replaceAll("/","-"));let p=this._data.video.duration;p&&g$1(this,i,l).call(this,s,"duration",this.durationToTime(p));let u=this._data.video.filetype;u&&g$1(this,i,l).call(this,s,"filetype",u);let k=n.file_size||this._data.video.size;k&&g$1(this,i,l).call(this,s,"size",g$1(this,i,v).call(this,k));let M=g$1(this,i,z).call(this,n),S=n.container||"mp4",b=g$1(this,i,g).call(this,M,`${this._data.name}.${S}`);return b.setAttribute("aria-label","Download video"),b.appendChild(s),c$1`${b}`}if(t&&a.getAttribute("name")=="mave-files-audio"){let s=h(),d=t.codec||g$1(this,i,y).call(this,t.filename)||"mp3";g$1(this,i,l).call(this,s,"filetype",d);let m=t.file_size;m&&g$1(this,i,l).call(this,s,"size",g$1(this,i,v).call(this,m));let p=g$1(this,i,L).call(this,t),u=g$1(this,i,g).call(this,p,t.filename||`${this._data.name}.${d}`);return u.setAttribute("aria-label","Download audio"),u.appendChild(s),c$1`${u}`}let _=this._data.subtitles.find(s=>s.language==this._data.video.language);if(_&&a.getAttribute("name")=="mave-files-subtitles"){let s=h();g$1(this,i,l).call(this,s,"filetype","vtt");let d=g$1(this,i,g).call(this,_.path,`${this._data.name}.vtt`);return d.setAttribute("aria-label","Download subtitles"),d.appendChild(s),c$1`${d}`}});return c$1`${this._stylesheets} ${o}`}})}
|
|
3
|
+
`}renderPending(){return c$1`<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=>g$1(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",g$1(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 g$1(this,i,w).call(this,`${n}_${t}.${o}`)},L=function(e){if(e?.path)return e.path;let n=e?.codec||g$1(this,i,y).call(this,e?.filename||"")||"mp3";return g$1(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=h`
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
--link-color: #006fc6;
|
|
7
|
+
--link-decoration: underline;
|
|
8
|
+
--link-decoration-thickness: 1px;
|
|
9
|
+
--link-decoration-offset: 1px;
|
|
10
|
+
--link-cursor: pointer;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
a {
|
|
14
|
+
text-decoration: var(--link-decoration);
|
|
15
|
+
text-decoration-thickness: var(--link-decoration-thickness);
|
|
16
|
+
text-underline-offset: var(--link-decoration-thickness);
|
|
17
|
+
color: var(--link-color);
|
|
18
|
+
cursor: var(--link-cursor);
|
|
19
|
+
}
|
|
20
|
+
`,c([a({type:String})],f.prototype,"embed",1);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-files")||window.customElements.define("mave-files",f));export{f as a};
|