svelte-multiview/public/build/bundle.js

22 lines
501 KiB
JavaScript
Raw Normal View History

var app=function(){"use strict";function e(){}function t(e){return e()}function i(){return Object.create(null)}function n(e){e.forEach(t)}function r(e){return"function"==typeof e}function s(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(t,i,n){t.$$.on_destroy.push(function(t,...i){if(null==t)return e;const n=t.subscribe(...i);return n.unsubscribe?()=>n.unsubscribe():n}(i,n))}function o(e,t){e.appendChild(t)}function u(e,t,i){e.insertBefore(t,i||null)}function l(e){e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function h(e){return document.createTextNode(e)}function d(){return h(" ")}function p(e,t,i,n){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)}function f(e,t,i){null==i?e.removeAttribute(t):e.getAttribute(t)!==i&&e.setAttribute(t,i)}function m(e){return Array.from(e.childNodes)}function g(e,t,i,n){for(let n=0;n<e.length;n+=1){const r=e[n];if(r.nodeName===t){let t=0;for(;t<r.attributes.length;){const e=r.attributes[t];i[e.name]?t++:r.removeAttribute(e.name)}return e.splice(n,1)[0]}}return n?function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}(t):c(t)}function v(e,t){for(let i=0;i<e.length;i+=1){const n=e[i];if(3===n.nodeType)return n.data=""+t,e.splice(i,1)[0]}return h(t)}function y(e){return v(e," ")}function _(e,t){t=""+t,e.data!==t&&(e.data=t)}let b;function T(e){b=e}function S(e){(function(){if(!b)throw new Error("Function called outside component initialization");return b})().$$.on_mount.push(e)}const k=[],C=[],w=[],E=[],x=Promise.resolve();let A=!1;function I(e){w.push(e)}let P=!1;const L=new Set;function O(){if(!P){P=!0;do{for(let e=0;e<k.length;e+=1){const t=k[e];T(t),D(t.$$)}for(k.length=0;C.length;)C.pop()();for(let e=0;e<w.length;e+=1){const t=w[e];L.has(t)||(L.add(t),t())}w.length=0}while(k.length);for(;E.length;)E.pop()();A=!1,P=!1,L.clear()}}function D(e){if(null!==e.fragment){e.update(),n(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(I)}}const N=new Set;function R(e,t){e&&e.i&&(N.delete(e),e.i(t))}function U(e,t,i,n){if(e&&e.o){if(N.has(e))return;N.add(e),(void 0).c.push(()=>{N.delete(e),n&&(i&&e.d(1),n())}),e.o(t)}}function M(e){e&&e.c()}function B(e,t){e&&e.l(t)}function j(e,i,s){const{fragment:a,on_mount:o,on_destroy:u,after_update:l}=e.$$;a&&a.m(i,s),I(()=>{const i=o.map(t).filter(r);u?u.push(...i):n(i),e.$$.on_mount=[]}),l.forEach(I)}function F(e,t){const i=e.$$;null!==i.fragment&&(n(i.on_destroy),i.fragment&&i.fragment.d(t),i.on_destroy=i.fragment=null,i.ctx=[])}function V(e,t){-1===e.$$.dirty[0]&&(k.push(e),A||(A=!0,x.then(O)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function H(t,r,s,a,o,u,c=[-1]){const h=b;T(t);const d=r.props||{},p=t.$$={fragment:null,ctx:null,props:u,update:e,not_equal:o,bound:i(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(h?h.$$.context:[]),callbacks:i(),dirty:c};let f=!1;if(p.ctx=s?s(t,d,(e,i,...n)=>{const r=n.length?n[0]:i;return p.ctx&&o(p.ctx[e],p.ctx[e]=r)&&(p.bound[e]&&p.bound[e](r),f&&V(t,e)),i}):[],p.update(),f=!0,n(p.before_update),p.fragment=!!a&&a(p.ctx),r.target){if(r.hydrate){const e=m(r.target);p.fragment&&p.fragment.l(e),e.forEach(l)}else p.fragment&&p.fragment.c();r.intro&&R(t.$$.fragment),j(t,r.target,r.anchor),O()}T(h)}class q{$destroy(){F(this,1),this.$destroy=e}$on(e,t){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}$set(){}}const W=[];const z=function(t,i=e){let n;const r=[];function a(e){if(s(t,e)&&(t=e,n)){const e=!W.length;for(let e=0;e<r.length;e+=1){const i=r[e];i[1](),W.push(i,t)}if(e){for(let e=0;e<W.length;e+=2)W[e][0](W[e+1]);W.length=0}}}return{set:a,update:function(e){a(e(t))},subscribe:function(s,o=e){const u=[s,o];return r.push(u),1===r.length&&(n=i(a)||e),s(t),()=>{const e=r.indexOf(u);-1!==e&&r.splice(e,1),0===r.length&&(n(),n=null)}}}}(""),G={setPlaying(e){console.log(">> setPlaying",e),z.update(t=>t===e?"":e)}};function $(t){let i,n,r,s,a,_,b,T,S,k,C,w,E;return{c
2020-05-28 23:03:16 +00:00
/*!
2020-05-28 22:32:12 +00:00
* Programatically add the following
*/
for(s=97;s<123;s++)n[String.fromCharCode(s)]=s-32;for(var s=48;s<58;s++)n[s-48]=s;for(s=1;s<13;s++)n["f"+s]=s+111;for(s=0;s<10;s++)n["numpad "+s]=s+96;var a=t.names=t.title={};for(s in n)a[n[s]]=s;for(var o in r)n[o]=r[o]})),le=(ue.code,ue.codes,ue.aliases,ue.names,ue.title,"undefined"!=typeof window?window:void 0!==Y?Y:"undefined"!=typeof self?self:{}),ce=function(e){if(!e)return!1;var t=he.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}
2020-05-28 23:03:16 +00:00
/**
2020-05-28 22:32:12 +00:00
* @license
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
* Copyright (c) 2014 David Björklund
* Available under the MIT license
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
*/,he=Object.prototype.toString;var de=me,pe=me;function fe(e,t,i){var n=e;return ce(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=re({},t,{uri:e}),n.callback=i,n}function me(e,t,i){return ge(t=fe(e,t,i))}function ge(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){var e=void 0;if(e=u.response?u.response:u.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(u),m)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(l),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,g)}function s(){if(!o){var t;clearTimeout(l),t=e.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var r=g,s=null;return 0!==t?(r={body:n(),statusCode:t,method:h,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(r.headers=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();void 0===t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t}(u.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),i(s,r,r.body)}}var a,o,u=e.xhr||null;u||(u=e.cors||e.useXDR?new me.XDomainRequest:new me.XMLHttpRequest);var l,c=u.url=e.uri||e.url,h=u.method=e.method||"GET",d=e.body||e.data,p=u.headers=e.headers||{},f=!!e.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:h,url:c,rawRequest:u};if("json"in e&&!1!==e.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),d=JSON.stringify(!0===e.json?d:e.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(s,0)},u.onload=s,u.onerror=r,u.onprogress=function(){},u.onabort=function(){o=!0},u.ontimeout=r,u.open(h,c,!f,e.username,e.password),f||(u.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(l=setTimeout((function(){if(!o){o=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),u.setRequestHeader)for(a in p)p.hasOwnProperty(a)&&u.setRequestHeader(a,p[a]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(d||null),u}me.XMLHttpRequest=le.XMLHttpRequest||function(){},me.XDomainRequest="withCredentials"in new me.XMLHttpRequest?me.XMLHttpRequest:le.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){me["delete"===e?"del":e]=function(t,i,n){return(i=fe(t,i,n)).method=e.toUpperCase(),ge(i)}})),de.default=pe;var ve=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function ye(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function _e(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function be(){this.values=ve(null)}function Te(e,t,i,n){var r=n?e.split(n):[e];for(var s in r)if("string"==typeof r[s]){var a=r[s].split(i);if(2===a.length)t(a[0],a[1])}}function Se(e,t,i){var n=e;function r(){var t=_e(e);if(null===t)throw new ye(ye.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=r(),s(),"--\x3e"!==e.substr(0,3))throw new ye(ye.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),s(),t.endTime=r(),s(),function(e,t)
2020-05-28 23:03:16 +00:00
/*! @name m3u8-parser @version 4.4.0 @license Apache-2.0 */
function Je(){return(Je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Ze(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var et=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t,i,n,r=this.listeners[e];if(r)if(2===arguments.length)for(i=r.length,t=0;t<i;++t)r[t].call(this,arguments[1]);else for(n=Array.prototype.slice.call(arguments,1),i=r.length,t=0;t<i;++t)r[t].apply(this,n)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),tt=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return Ze(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(et),it=function(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},nt=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}Ze(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,i){var n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((function(e){for(var r=0;r<n.customParsers.length;r++)if(n.customParsers[r].call(n,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))n.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void n.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"totalduration"},t[1]&&(i.duration=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void n.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"byterange"},t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),void n.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){var s=it(t[1]);if(s.URI&&(i.uri=s.URI),s.BYTERANGE){var a=s.BYTERANGE.split("@"),o=a[0],u=a[1];i.byterange={},o&&(i.byterange.length=parseInt(o,10)),u&&(i.byterange.offset=parseInt(u,10))}}n.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=it(t[1]),i.attributes.RESOLUTION){var l=i.attributes.RESOLUTION.split("x"),c={};l[0]&&(c.width=parseInt(l[0],10)),l[1]&&(c.height=parseInt(l[1],10)),i.attributes.RESOLUTION=c}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=pa
2020-05-28 23:03:16 +00:00
/**
2020-05-28 22:32:12 +00:00
* @videojs/http-streaming
* @version 1.13.2
* @copyright 2020 Brightcove, Inc
* @license Apache-2.0
*/
var Ml=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=Qe.buildAbsoluteURL(ee.location.href,e)),Qe.buildAbsoluteURL(e,t))},Bl=function(e,t,i){return e&&i.responseURL&&t!==i.responseURL?i.responseURL:t},jl=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Fl=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Vl=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Hl=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},ql=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);n=!0);}catch(e){r=!0,s=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Wl=Nl.mergeOptions,zl=Nl.EventTarget,Gl=Nl.log,$l=function(e,t){["AUDIO","SUBTITLES"].forEach((function(i){for(var n in e.mediaGroups[i])for(var r in e.mediaGroups[i][n]){var s=e.mediaGroups[i][n][r];t(s,i,n,r)}}))},Xl=function(e,t){var i=Wl(e,{}),n=i.playlists[t.id];if(!n)return null;if(n.segments&&t.segments&&n.segments.length===t.segments.length&&n.endList===t.endList&&n.mediaSequence===t.mediaSequence)return null;var r=Wl(n,t);n.segments&&(r.segments=function(e,t,i){var n=t.slice();i=i||0;for(var r=Math.min(e.length,t.length+i),s=i;s<r;s++)n[s-i]=Wl(e[s],n[s-i]);return n}(n.segments,t.segments,t.mediaSequence-n.mediaSequence)),r.segments.forEach((function(e){!function(e,t){e.resolvedUri||(e.resolvedUri=Ml(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Ml(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Ml(t,e.map.uri))}(e,r.resolvedUri)}));for(var s=0;s<i.playlists.length;s++)i.playlists[s].id===t.id&&(i.playlists[s]=r);return i.playlists[t.id]=r,i.playlists[t.uri]=r,i},Kl=function(e,t){return e+"-"+t},Yl=function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];i.resolvedUri=Ml(e.uri,i.uri),i.id=Kl(t,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes||(i.attributes={},Gl.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}},Ql=function(e){$l(e,(function(t){t.uri&&(t.resolvedUri=Ml(e.uri,t.uri))}))},Jl=function(e,t){var i=e.segments[e.segments.length-1];return t&&i&&i.duration?1e3*i.duration:500*(e.targetDuration||10)},Zl=function(e){function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};jl(this,t);var r=Hl(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),s=n.withCredentials,a=void 0!==s&&s,o=n.handleManifestRedirects,u=void 0!==o&&o;r.srcUrl=e,r.hls_=i,r.withCredentials=a,r.handleManifestRedirects=u;var l=i.options_;if(r.customTagParsers=l&&l.customTagParsers||[],r.customTagMappers=l&&l.customTagMappers||[],!r.srcUrl)throw new Error("A non-empty playlist URL is required");return r.state="HAVE_NOTHING",r.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===r.state&&(r.state="HAVE_CURRENT_METADATA",r.request=r.hls_.xhr({uri:Ml(r.master.uri,r.media().uri),withCredentials:r.withCredentials},(function(e,t){if(r.request)return e?r.playlistRequestError(r.request,r.media(),"HAVE_METADATA"):void r.haveMetadata(r.request,r.media().uri,r.media().id)})))})),r}return Vl(t,e),Fl(t,[{key:"playlistRequestError",value:function(e,t,i){var n=t.uri,r=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseT