(window["webpackjsonp"] = window["webpackjsonp"] || []).push([[72],{ /***/ 164: /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * vue-client-only v0.0.0-semantic-release * (c) 2021-present egoist <0x142857@gmail.com> * released under the mit license. */ var index = { name: 'clientonly', functional: true, props: { placeholder: string, placeholdertag: { type: string, default: 'div' } }, render: function render(h, ref) { var parent = ref.parent; var slots = ref.slots; var props = ref.props; var ref$1 = slots(); var defaultslot = ref$1.default; if ( defaultslot === void 0 ) defaultslot = []; var placeholderslot = ref$1.placeholder; if (parent._ismounted) { return defaultslot } parent.$once('hook:mounted', function () { parent.$forceupdate(); }); if (props.placeholdertag && (props.placeholder || placeholderslot)) { return h( props.placeholdertag, { class: ['client-only-placeholder'] }, props.placeholder || placeholderslot ) } // return a placeholder element for each child in the default slot // or if no children return a single placeholder return defaultslot.length > 0 ? defaultslot.map(function () { return h(false); }) : h(false) } }; module.exports = index; /***/ }), /***/ 170: /***/ (function(module, exports, __webpack_require__) { /** * copyright 2013 vtt.js contributors * * licensed under the apache license, version 2.0 (the "license"); * you may not use this file except in compliance with the license. * you may obtain a copy of the license at * * http://www.apache.org/licenses/license-2.0 * * unless required by applicable law or agreed to in writing, software * distributed under the license is distributed on an "as is" basis, * without warranties or conditions of any kind, either express or implied. * see the license for the specific language governing permissions and * limitations under the license. */ // default exports for node. export the extended versions of vttcue and // vttregion in node since we likely want the capability to convert back and // forth between json. if we don't then it's not that big of a deal since we're // off browser. var window = __webpack_require__(0); var vttjs = module.exports = { webvtt: __webpack_require__(410), vttcue: __webpack_require__(411), vttregion: __webpack_require__(412) }; window.vttjs = vttjs; window.webvtt = vttjs.webvtt; var cueshim = vttjs.vttcue; var regionshim = vttjs.vttregion; var nativevttcue = window.vttcue; var nativevttregion = window.vttregion; vttjs.shim = function() { window.vttcue = cueshim; window.vttregion = regionshim; }; vttjs.restore = function() { window.vttcue = nativevttcue; window.vttregion = nativevttregion; }; if (!window.vttcue) { vttjs.shim(); } /***/ }), /***/ 171: /***/ (function(module, exports, __webpack_require__) { // see https://tools.ietf.org/html/rfc1808 (function (root) { var url_regex = /^(?=((?:[a-za-z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/; var first_segment_regex = /^(?=([^\/?#]*))\1([^]*)$/; var slash_dot_regex = /(?:\/|^)\.(?=\/)/g; var slash_dot_dot_regex = /(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g; var urltoolkit = { // if opts.alwaysnormalize is true then the path will always be normalized even when it starts with / or // // e.g // with opts.alwaysnormalize = false (default, spec compliant) // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g // with opts.alwaysnormalize = true (not spec compliant) // http://a.com/b/cd + /e/f/../g => http://a.com/e/g buildabsoluteurl: function (baseurl, relativeurl, opts) { opts = opts || {}; // remove any remaining space and crlf baseurl = baseurl.trim(); relativeurl = relativeurl.trim(); if (!relativeurl) { // 2a) if the embedded url is entirely empty, it inherits the // entire base url (i.e., is set equal to the base url) // and we are done. if (!opts.alwaysnormalize) { return baseurl; } var basepartsfornormalise = urltoolkit.parseurl(baseurl); if (!basepartsfornormalise) { throw new error('error trying to parse base url.'); } basepartsfornormalise.path = urltoolkit.normalizepath( basepartsfornormalise.path ); return urltoolkit.buildurlfromparts(basepartsfornormalise); } var relativeparts = urltoolkit.parseurl(relativeurl); if (!relativeparts) { throw new error('error trying to parse relative url.'); } if (relativeparts.scheme) { // 2b) if the embedded url starts with a scheme name, it is // interpreted as an absolute url and we are done. if (!opts.alwaysnormalize) { return relativeurl; } relativeparts.path = urltoolkit.normalizepath(relativeparts.path); return urltoolkit.buildurlfromparts(relativeparts); } var baseparts = urltoolkit.parseurl(baseurl); if (!baseparts) { throw new error('error trying to parse base url.'); } if (!baseparts.netloc && baseparts.path && baseparts.path[0] !== '/') { // if netloc missing and path doesn't start with '/', assume everthing before the first '/' is the netloc // this causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a' var pathparts = first_segment_regex.exec(baseparts.path); baseparts.netloc = pathparts[1]; baseparts.path = pathparts[2]; } if (baseparts.netloc && !baseparts.path) { baseparts.path = '/'; } var builtparts = { // 2c) otherwise, the embedded url inherits the scheme of // the base url. scheme: baseparts.scheme, netloc: relativeparts.netloc, path: null, params: relativeparts.params, query: relativeparts.query, fragment: relativeparts.fragment, }; if (!relativeparts.netloc) { // 3) if the embedded url's is non-empty, we skip to // step 7. otherwise, the embedded url inherits the // (if any) of the base url. builtparts.netloc = baseparts.netloc; // 4) if the embedded url path is preceded by a slash "/", the // path is not relative and we skip to step 7. if (relativeparts.path[0] !== '/') { if (!relativeparts.path) { // 5) if the embedded url path is empty (and not preceded by a // slash), then the embedded url inherits the base url path builtparts.path = baseparts.path; // 5a) if the embedded url's is non-empty, we skip to // step 7; otherwise, it inherits the of the base // url (if any) and if (!relativeparts.params) { builtparts.params = baseparts.params; // 5b) if the embedded url's is non-empty, we skip to // step 7; otherwise, it inherits the of the base // url (if any) and we skip to step 7. if (!relativeparts.query) { builtparts.query = baseparts.query; } } } else { // 6) the last segment of the base url's path (anything // following the rightmost slash "/", or the entire path if no // slash is present) is removed and the embedded url's path is // appended in its place. var baseurlpath = baseparts.path; var newpath = baseurlpath.substring(0, baseurlpath.lastindexof('/') + 1) + relativeparts.path; builtparts.path = urltoolkit.normalizepath(newpath); } } } if (builtparts.path === null) { builtparts.path = opts.alwaysnormalize ? urltoolkit.normalizepath(relativeparts.path) : relativeparts.path; } return urltoolkit.buildurlfromparts(builtparts); }, parseurl: function (url) { var parts = url_regex.exec(url); if (!parts) { return null; } return { scheme: parts[1] || '', netloc: parts[2] || '', path: parts[3] || '', params: parts[4] || '', query: parts[5] || '', fragment: parts[6] || '', }; }, normalizepath: function (path) { // the following operations are // then applied, in order, to the new path: // 6a) all occurrences of "./", where "." is a complete path // segment, are removed. // 6b) if the path ends with "." as a complete path segment, // that "." is removed. path = path.split('').reverse().join('').replace(slash_dot_regex, ''); // 6c) all occurrences of "/../", where is a // complete path segment not equal to "..", are removed. // removal of these path segments is performed iteratively, // removing the leftmost matching pattern on each iteration, // until no matching pattern remains. // 6d) if the path ends with "/..", where is a // complete path segment not equal to "..", that // "/.." is removed. while ( path.length !== (path = path.replace(slash_dot_dot_regex, '')).length ) {} return path.split('').reverse().join(''); }, buildurlfromparts: function (parts) { return ( parts.scheme + parts.netloc + parts.path + parts.params + parts.query + parts.fragment ); }, }; if (true) module.exports = urltoolkit; else {} })(this); /***/ }), /***/ 256: /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return e; }); function e(e,n){return n=n||{},new promise(function(t,r){var s=new xmlhttprequest,o=[],u={},a=function e(){return{ok:2==(s.status/100|0),statustext:s.statustext,status:s.status,url:s.responseurl,text:function(){return promise.resolve(s.responsetext)},json:function(){return promise.resolve(s.responsetext).then(json.parse)},blob:function(){return promise.resolve(new blob([s.response]))},clone:e,headers:{keys:function(){return o},entries:function(){return o.map(function(e){return[e,s.getresponseheader(e)]})},get:function(e){return s.getresponseheader(e)},has:function(e){return null!=s.getresponseheader(e)}}}};for(var i in s.open(n.method||"get",e,!0),s.onload=function(){s.getallresponseheaders().tolowercase().replace(/^(.+?):/gm,function(e,n){u[n]||o.push(u[n]=n)}),t(a())},s.onerror=r,s.withcredentials="include"==n.credentials,n.headers)s.setrequestheader(i,n.headers[i]);s.send(n.body||null)})} //# sourcemappingurl=unfetch.mjs.map /***/ }), /***/ 266: /***/ (function(module, exports) { module.exports = safeparsetuple function safeparsetuple(obj, reviver) { var json var error = null try { json = json.parse(obj, reviver) } catch (err) { error = err } return [error, json] } /***/ }), /***/ 410: /***/ (function(module, exports, __webpack_require__) { /** * copyright 2013 vtt.js contributors * * licensed under the apache license, version 2.0 (the "license"); * you may not use this file except in compliance with the license. * you may obtain a copy of the license at * * http://www.apache.org/licenses/license-2.0 * * unless required by applicable law or agreed to in writing, software * distributed under the license is distributed on an "as is" basis, * without warranties or conditions of any kind, either express or implied. * see the license for the specific language governing permissions and * limitations under the license. */ /* -*- mode: java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ var document = __webpack_require__(3); var _objcreate = object.create || (function() { function f() {} return function(o) { if (arguments.length !== 1) { throw new error('object.create shim only accepts one parameter.'); } f.prototype = o; return new f(); }; })(); // creates a new parsererror object from an errordata object. the errordata // object should have default code and message properties. the default message // property can be overriden by passing in a message parameter. // see parsingerror.errors below for acceptable errors. function parsingerror(errordata, message) { this.name = "parsingerror"; this.code = errordata.code; this.message = message || errordata.message; } parsingerror.prototype = _objcreate(error.prototype); parsingerror.prototype.constructor = parsingerror; // parsingerror metadata for acceptable parsingerrors. parsingerror.errors = { badsignature: { code: 0, message: "malformed webvtt signature." }, badtimestamp: { code: 1, message: "malformed time stamp." } }; // try to parse input as a time stamp. function parsetimestamp(input) { function computeseconds(h, m, s, f) { return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000; } var m = input.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/); if (!m) { return null; } if (m[3]) { // timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds] return computeseconds(m[1], m[2], m[3].replace(":", ""), m[4]); } else if (m[1] > 59) { // timestamp takes the form of [hours]:[minutes].[milliseconds] // first position is hours as it's over 59. return computeseconds(m[1], m[2], 0, m[4]); } else { // timestamp takes the form of [minutes]:[seconds].[milliseconds] return computeseconds(0, m[1], m[2], m[4]); } } // a settings object holds key/value pairs and will ignore anything but the first // assignment to a specific key. function settings() { this.values = _objcreate(null); } settings.prototype = { // only accept the first assignment to any key. set: function(k, v) { if (!this.get(k) && v !== "") { this.values[k] = v; } }, // return the value for a key, or a default value. // if 'defaultkey' is passed then 'dflt' is assumed to be an object with // a number of possible default values as properties where 'defaultkey' is // the key of the property that will be chosen; otherwise it's assumed to be // a single value. get: function(k, dflt, defaultkey) { if (defaultkey) { return this.has(k) ? this.values[k] : dflt[defaultkey]; } return this.has(k) ? this.values[k] : dflt; }, // check whether we have a value for a key. has: function(k) { return k in this.values; }, // accept a setting if its one of the given alternatives. alt: function(k, v, a) { for (var n = 0; n < a.length; ++n) { if (v === a[n]) { this.set(k, v); break; } } }, // accept a setting if its a valid (signed) integer. integer: function(k, v) { if (/^-?\d+$/.test(v)) { // integer this.set(k, parseint(v, 10)); } }, // accept a setting if its a valid percentage. percent: function(k, v) { var m; if ((m = v.match(/^([\d]{1,3})(\.[\d]*)?%$/))) { v = parsefloat(v); if (v >= 0 && v <= 100) { this.set(k, v); return true; } } return false; } }; // helper function to parse input into groups separated by 'groupdelim', and // interprete each group as a key/value pair separated by 'keyvaluedelim'. function parseoptions(input, callback, keyvaluedelim, groupdelim) { var groups = groupdelim ? input.split(groupdelim) : [input]; for (var i in groups) { if (typeof groups[i] !== "string") { continue; } var kv = groups[i].split(keyvaluedelim); if (kv.length !== 2) { continue; } var k = kv[0].trim(); var v = kv[1].trim(); callback(k, v); } } function parsecue(input, cue, regionlist) { // remember the original input if we need to throw an error. var oinput = input; // 4.1 webvtt timestamp function consumetimestamp() { var ts = parsetimestamp(input); if (ts === null) { throw new parsingerror(parsingerror.errors.badtimestamp, "malformed timestamp: " + oinput); } // remove time stamp from input. input = input.replace(/^[^\sa-za-z-]+/, ""); return ts; } // 4.4.2 webvtt cue settings function consumecuesettings(input, cue) { var settings = new settings(); parseoptions(input, function (k, v) { switch (k) { case "region": // find the last region we parsed with the same region id. for (var i = regionlist.length - 1; i >= 0; i--) { if (regionlist[i].id === v) { settings.set(k, regionlist[i].region); break; } } break; case "vertical": settings.alt(k, v, ["rl", "lr"]); break; case "line": var vals = v.split(","), vals0 = vals[0]; settings.integer(k, vals0); settings.percent(k, vals0) ? settings.set("snaptolines", false) : null; settings.alt(k, vals0, ["auto"]); if (vals.length === 2) { settings.alt("linealign", vals[1], ["start", "center", "end"]); } break; case "position": vals = v.split(","); settings.percent(k, vals[0]); if (vals.length === 2) { settings.alt("positionalign", vals[1], ["start", "center", "end"]); } break; case "size": settings.percent(k, v); break; case "align": settings.alt(k, v, ["start", "center", "end", "left", "right"]); break; } }, /:/, /\s/); // apply default values for any missing fields. cue.region = settings.get("region", null); cue.vertical = settings.get("vertical", ""); try { cue.line = settings.get("line", "auto"); } catch (e) {} cue.linealign = settings.get("linealign", "start"); cue.snaptolines = settings.get("snaptolines", true); cue.size = settings.get("size", 100); // safari still uses the old middle value and won't accept center try { cue.align = settings.get("align", "center"); } catch (e) { cue.align = settings.get("align", "middle"); } try { cue.position = settings.get("position", "auto"); } catch (e) { cue.position = settings.get("position", { start: 0, left: 0, center: 50, middle: 50, end: 100, right: 100 }, cue.align); } cue.positionalign = settings.get("positionalign", { start: "start", left: "start", center: "center", middle: "center", end: "end", right: "end" }, cue.align); } function skipwhitespace() { input = input.replace(/^\s+/, ""); } // 4.1 webvtt cue timings. skipwhitespace(); cue.starttime = consumetimestamp(); // (1) collect cue start time skipwhitespace(); if (input.substr(0, 3) !== "-->") { // (3) next characters must match "-->" throw new parsingerror(parsingerror.errors.badtimestamp, "malformed time stamp (time stamps must be separated by '-->'): " + oinput); } input = input.substr(3); skipwhitespace(); cue.endtime = consumetimestamp(); // (5) collect cue end time // 4.1 webvtt cue settings list. skipwhitespace(); consumecuesettings(input, cue); } // when evaluating this file as part of a webpack bundle for server // side rendering, `document` is an empty object. var textarea_element = document.createelement && document.createelement("textarea"); var tag_name = { c: "span", i: "i", b: "b", u: "u", ruby: "ruby", rt: "rt", v: "span", lang: "span" }; // 5.1 default text color // 5.2 default text background color is equivalent to text color with bg_ prefix var default_color_class = { white: 'rgba(255,255,255,1)', lime: 'rgba(0,255,0,1)', cyan: 'rgba(0,255,255,1)', red: 'rgba(255,0,0,1)', yellow: 'rgba(255,255,0,1)', magenta: 'rgba(255,0,255,1)', blue: 'rgba(0,0,255,1)', black: 'rgba(0,0,0,1)' }; var tag_annotation = { v: "title", lang: "lang" }; var needs_parent = { rt: "ruby" }; // parse content into a document fragment. function parsecontent(window, input) { function nexttoken() { // check for end-of-string. if (!input) { return null; } // consume 'n' characters from the input. function consume(result) { input = input.substr(result.length); return result; } var m = input.match(/^([^<]*)(<[^>]*>?)?/); // if there is some text before the next tag, return it, otherwise return // the tag. return consume(m[1] ? m[1] : m[2]); } function unescape(s) { textarea_element.innerhtml = s; s = textarea_element.textcontent; textarea_element.textcontent = ""; return s; } function shouldadd(current, element) { return !needs_parent[element.localname] || needs_parent[element.localname] === current.localname; } // create an element for this tag. function createelement(type, annotation) { var tagname = tag_name[type]; if (!tagname) { return null; } var element = window.document.createelement(tagname); var name = tag_annotation[type]; if (name && annotation) { element[name] = annotation.trim(); } return element; } var rootdiv = window.document.createelement("div"), current = rootdiv, t, tagstack = []; while ((t = nexttoken()) !== null) { if (t[0] === '<') { if (t[1] === "/") { // if the closing tag matches, move back up to the parent node. if (tagstack.length && tagstack[tagstack.length - 1] === t.substr(2).replace(">", "")) { tagstack.pop(); current = current.parentnode; } // otherwise just ignore the end tag. continue; } var ts = parsetimestamp(t.substr(1, t.length - 2)); var node; if (ts) { // timestamps are lead nodes as well. node = window.document.createprocessinginstruction("timestamp", ts); current.appendchild(node); continue; } var m = t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/); // if we can't parse the tag, skip to the next tag. if (!m) { continue; } // try to construct an element, and ignore the tag if we couldn't. node = createelement(m[1], m[3]); if (!node) { continue; } // determine if the tag should be added based on the context of where it // is placed in the cuetext. if (!shouldadd(current, node)) { continue; } // set the class list (as a list of classes, separated by space). if (m[2]) { var classes = m[2].split('.'); classes.foreach(function(cl) { var bgcolor = /^bg_/.test(cl); // slice out `bg_` if it's a background color var colorname = bgcolor ? cl.slice(3) : cl; if (default_color_class.hasownproperty(colorname)) { var propname = bgcolor ? 'background-color' : 'color'; var propvalue = default_color_class[colorname]; node.style[propname] = propvalue; } }); node.classname = classes.join(' '); } // append the node to the current node, and enter the scope of the new // node. tagstack.push(m[1]); current.appendchild(node); current = node; continue; } // text nodes are leaf nodes. current.appendchild(window.document.createtextnode(unescape(t))); } return rootdiv; } // this is a list of all the unicode characters that have a strong // right-to-left category. what this means is that these characters are // written right-to-left for sure. it was generated by pulling all the strong // right-to-left characters out of the unicode data table. that table can // found at: http://www.unicode.org/public/unidata/unicodedata.txt var strongrtlranges = [[0x5be, 0x5be], [0x5c0, 0x5c0], [0x5c3, 0x5c3], [0x5c6, 0x5c6], [0x5d0, 0x5ea], [0x5f0, 0x5f4], [0x608, 0x608], [0x60b, 0x60b], [0x60d, 0x60d], [0x61b, 0x61b], [0x61e, 0x64a], [0x66d, 0x66f], [0x671, 0x6d5], [0x6e5, 0x6e6], [0x6ee, 0x6ef], [0x6fa, 0x70d], [0x70f, 0x710], [0x712, 0x72f], [0x74d, 0x7a5], [0x7b1, 0x7b1], [0x7c0, 0x7ea], [0x7f4, 0x7f5], [0x7fa, 0x7fa], [0x800, 0x815], [0x81a, 0x81a], [0x824, 0x824], [0x828, 0x828], [0x830, 0x83e], [0x840, 0x858], [0x85e, 0x85e], [0x8a0, 0x8a0], [0x8a2, 0x8ac], [0x200f, 0x200f], [0xfb1d, 0xfb1d], [0xfb1f, 0xfb28], [0xfb2a, 0xfb36], [0xfb38, 0xfb3c], [0xfb3e, 0xfb3e], [0xfb40, 0xfb41], [0xfb43, 0xfb44], [0xfb46, 0xfbc1], [0xfbd3, 0xfd3d], [0xfd50, 0xfd8f], [0xfd92, 0xfdc7], [0xfdf0, 0xfdfc], [0xfe70, 0xfe74], [0xfe76, 0xfefc], [0x10800, 0x10805], [0x10808, 0x10808], [0x1080a, 0x10835], [0x10837, 0x10838], [0x1083c, 0x1083c], [0x1083f, 0x10855], [0x10857, 0x1085f], [0x10900, 0x1091b], [0x10920, 0x10939], [0x1093f, 0x1093f], [0x10980, 0x109b7], [0x109be, 0x109bf], [0x10a00, 0x10a00], [0x10a10, 0x10a13], [0x10a15, 0x10a17], [0x10a19, 0x10a33], [0x10a40, 0x10a47], [0x10a50, 0x10a58], [0x10a60, 0x10a7f], [0x10b00, 0x10b35], [0x10b40, 0x10b55], [0x10b58, 0x10b72], [0x10b78, 0x10b7f], [0x10c00, 0x10c48], [0x1ee00, 0x1ee03], [0x1ee05, 0x1ee1f], [0x1ee21, 0x1ee22], [0x1ee24, 0x1ee24], [0x1ee27, 0x1ee27], [0x1ee29, 0x1ee32], [0x1ee34, 0x1ee37], [0x1ee39, 0x1ee39], [0x1ee3b, 0x1ee3b], [0x1ee42, 0x1ee42], [0x1ee47, 0x1ee47], [0x1ee49, 0x1ee49], [0x1ee4b, 0x1ee4b], [0x1ee4d, 0x1ee4f], [0x1ee51, 0x1ee52], [0x1ee54, 0x1ee54], [0x1ee57, 0x1ee57], [0x1ee59, 0x1ee59], [0x1ee5b, 0x1ee5b], [0x1ee5d, 0x1ee5d], [0x1ee5f, 0x1ee5f], [0x1ee61, 0x1ee62], [0x1ee64, 0x1ee64], [0x1ee67, 0x1ee6a], [0x1ee6c, 0x1ee72], [0x1ee74, 0x1ee77], [0x1ee79, 0x1ee7c], [0x1ee7e, 0x1ee7e], [0x1ee80, 0x1ee89], [0x1ee8b, 0x1ee9b], [0x1eea1, 0x1eea3], [0x1eea5, 0x1eea9], [0x1eeab, 0x1eebb], [0x10fffd, 0x10fffd]]; function isstrongrtlchar(charcode) { for (var i = 0; i < strongrtlranges.length; i++) { var currentrange = strongrtlranges[i]; if (charcode >= currentrange[0] && charcode <= currentrange[1]) { return true; } } return false; } function determinebidi(cuediv) { var nodestack = [], text = "", charcode; if (!cuediv || !cuediv.childnodes) { return "ltr"; } function pushnodes(nodestack, node) { for (var i = node.childnodes.length - 1; i >= 0; i--) { nodestack.push(node.childnodes[i]); } } function nexttextnode(nodestack) { if (!nodestack || !nodestack.length) { return null; } var node = nodestack.pop(), text = node.textcontent || node.innertext; if (text) { // todo: this should match all unicode type b characters (paragraph // separator characters). see issue #115. var m = text.match(/^.*(\n|\r)/); if (m) { nodestack.length = 0; return m[0]; } return text; } if (node.tagname === "ruby") { return nexttextnode(nodestack); } if (node.childnodes) { pushnodes(nodestack, node); return nexttextnode(nodestack); } } pushnodes(nodestack, cuediv); while ((text = nexttextnode(nodestack))) { for (var i = 0; i < text.length; i++) { charcode = text.charcodeat(i); if (isstrongrtlchar(charcode)) { return "rtl"; } } } return "ltr"; } function computelinepos(cue) { if (typeof cue.line === "number" && (cue.snaptolines || (cue.line >= 0 && cue.line <= 100))) { return cue.line; } if (!cue.track || !cue.track.texttracklist || !cue.track.texttracklist.mediaelement) { return -1; } var track = cue.track, tracklist = track.texttracklist, count = 0; for (var i = 0; i < tracklist.length && tracklist[i] !== track; i++) { if (tracklist[i].mode === "showing") { count++; } } return ++count * -1; } function stylebox() { } // apply styles to a div. if there is no div passed then it defaults to the // div on 'this'. stylebox.prototype.applystyles = function(styles, div) { div = div || this.div; for (var prop in styles) { if (styles.hasownproperty(prop)) { div.style[prop] = styles[prop]; } } }; stylebox.prototype.formatstyle = function(val, unit) { return val === 0 ? 0 : val + unit; }; // constructs the computed display state of the cue (a div). places the div // into the overlay which should be a block level element (usually a div). function cuestylebox(window, cue, styleoptions) { stylebox.call(this); this.cue = cue; // parse our cue's text into a dom tree rooted at 'cuediv'. this div will // have inline positioning and will function as the cue background box. this.cuediv = parsecontent(window, cue.text); var styles = { color: "rgba(255, 255, 255, 1)", backgroundcolor: "rgba(0, 0, 0, 0.8)", position: "relative", left: 0, right: 0, top: 0, bottom: 0, display: "inline", writingmode: cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl", unicodebidi: "plaintext" }; this.applystyles(styles, this.cuediv); // create an absolutely positioned div that will be used to position the cue // div. note, all webvtt cue-setting alignments are equivalent to the css // mirrors of them except middle instead of center on safari. this.div = window.document.createelement("div"); styles = { direction: determinebidi(this.cuediv), writingmode: cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl", unicodebidi: "plaintext", textalign: cue.align === "middle" ? "center" : cue.align, font: styleoptions.font, whitespace: "pre-line", position: "absolute" }; this.applystyles(styles); this.div.appendchild(this.cuediv); // calculate the distance from the reference edge of the viewport to the text // position of the cue box. the reference edge will be resolved later when // the box orientation styles are applied. var textpos = 0; switch (cue.positionalign) { case "start": case "line-left": textpos = cue.position; break; case "center": textpos = cue.position - (cue.size / 2); break; case "end": case "line-right": textpos = cue.position - cue.size; break; } // horizontal box orientation; textpos is the distance from the left edge of the // area to the left edge of the box and cue.size is the distance extending to // the right from there. if (cue.vertical === "") { this.applystyles({ left: this.formatstyle(textpos, "%"), width: this.formatstyle(cue.size, "%") }); // vertical box orientation; textpos is the distance from the top edge of the // area to the top edge of the box and cue.size is the height extending // downwards from there. } else { this.applystyles({ top: this.formatstyle(textpos, "%"), height: this.formatstyle(cue.size, "%") }); } this.move = function(box) { this.applystyles({ top: this.formatstyle(box.top, "px"), bottom: this.formatstyle(box.bottom, "px"), left: this.formatstyle(box.left, "px"), right: this.formatstyle(box.right, "px"), height: this.formatstyle(box.height, "px"), width: this.formatstyle(box.width, "px") }); }; } cuestylebox.prototype = _objcreate(stylebox.prototype); cuestylebox.prototype.constructor = cuestylebox; // represents the co-ordinates of an element in a way that we can easily // compute things with such as if it overlaps or intersects with another element. // can initialize it with either a stylebox or another boxposition. function boxposition(obj) { // either a boxposition was passed in and we need to copy it, or a stylebox // was passed in and we need to copy the results of 'getboundingclientrect' // as the object returned is readonly. all co-ordinate values are in reference // to the viewport origin (top left). var lh, height, width, top; if (obj.div) { height = obj.div.offsetheight; width = obj.div.offsetwidth; top = obj.div.offsettop; var rects = (rects = obj.div.childnodes) && (rects = rects[0]) && rects.getclientrects && rects.getclientrects(); obj = obj.div.getboundingclientrect(); // in certain cases the outter div will be slightly larger then the sum of // the inner div's lines. this could be due to bold text, etc, on some platforms. // in this case we should get the average line height and use that. this will // result in the desired behaviour. lh = rects ? math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length) : 0; } this.left = obj.left; this.right = obj.right; this.top = obj.top || top; this.height = obj.height || height; this.bottom = obj.bottom || (top + (obj.height || height)); this.width = obj.width || width; this.lineheight = lh !== undefined ? lh : obj.lineheight; } // move the box along a particular axis. optionally pass in an amount to move // the box. if no amount is passed then the default is the line height of the // box. boxposition.prototype.move = function(axis, tomove) { tomove = tomove !== undefined ? tomove : this.lineheight; switch (axis) { case "+x": this.left += tomove; this.right += tomove; break; case "-x": this.left -= tomove; this.right -= tomove; break; case "+y": this.top += tomove; this.bottom += tomove; break; case "-y": this.top -= tomove; this.bottom -= tomove; break; } }; // check if this box overlaps another box, b2. boxposition.prototype.overlaps = function(b2) { return this.left < b2.right && this.right > b2.left && this.top < b2.bottom && this.bottom > b2.top; }; // check if this box overlaps any other boxes in boxes. boxposition.prototype.overlapsany = function(boxes) { for (var i = 0; i < boxes.length; i++) { if (this.overlaps(boxes[i])) { return true; } } return false; }; // check if this box is within another box. boxposition.prototype.within = function(container) { return this.top >= container.top && this.bottom <= container.bottom && this.left >= container.left && this.right <= container.right; }; // check if this box is entirely within the container or it is overlapping // on the edge opposite of the axis direction passed. for example, if "+x" is // passed and the box is overlapping on the left edge of the container, then // return true. boxposition.prototype.overlapsoppositeaxis = function(container, axis) { switch (axis) { case "+x": return this.left < container.left; case "-x": return this.right > container.right; case "+y": return this.top < container.top; case "-y": return this.bottom > container.bottom; } }; // find the percentage of the area that this box is overlapping with another // box. boxposition.prototype.intersectpercentage = function(b2) { var x = math.max(0, math.min(this.right, b2.right) - math.max(this.left, b2.left)), y = math.max(0, math.min(this.bottom, b2.bottom) - math.max(this.top, b2.top)), intersectarea = x * y; return intersectarea / (this.height * this.width); }; // convert the positions from this box to css compatible positions using // the reference container's positions. this has to be done because this // box's positions are in reference to the viewport origin, whereas, css // values are in referecne to their respective edges. boxposition.prototype.tocsscompatvalues = function(reference) { return { top: this.top - reference.top, bottom: reference.bottom - this.bottom, left: this.left - reference.left, right: reference.right - this.right, height: this.height, width: this.width }; }; // get an object that represents the box's position without anything extra. // can pass a stylebox, htmlelement, or another boxpositon. boxposition.getsimpleboxposition = function(obj) { var height = obj.div ? obj.div.offsetheight : obj.tagname ? obj.offsetheight : 0; var width = obj.div ? obj.div.offsetwidth : obj.tagname ? obj.offsetwidth : 0; var top = obj.div ? obj.div.offsettop : obj.tagname ? obj.offsettop : 0; obj = obj.div ? obj.div.getboundingclientrect() : obj.tagname ? obj.getboundingclientrect() : obj; var ret = { left: obj.left, right: obj.right, top: obj.top || top, height: obj.height || height, bottom: obj.bottom || (top + (obj.height || height)), width: obj.width || width }; return ret; }; // move a stylebox to its specified, or next best, position. the containerbox // is the box that contains the stylebox, such as a div. boxpositions are // a list of other boxes that the stylebox can't overlap with. function moveboxtolineposition(window, stylebox, containerbox, boxpositions) { // find the best position for a cue box, b, on the video. the axis parameter // is a list of axis, the order of which, it will move the box along. for example: // passing ["+x", "-x"] will move the box first along the x axis in the positive // direction. if it doesn't find a good position for it there it will then move // it along the x axis in the negative direction. function findbestposition(b, axis) { var bestposition, specifiedposition = new boxposition(b), percentage = 1; // highest possible so the first thing we get is better. for (var i = 0; i < axis.length; i++) { while (b.overlapsoppositeaxis(containerbox, axis[i]) || (b.within(containerbox) && b.overlapsany(boxpositions))) { b.move(axis[i]); } // we found a spot where we aren't overlapping anything. this is our // best position. if (b.within(containerbox)) { return b; } var p = b.intersectpercentage(containerbox); // if we're outside the container box less then we were on our last try // then remember this position as the best position. if (percentage > p) { bestposition = new boxposition(b); percentage = p; } // reset the box position to the specified position. b = new boxposition(specifiedposition); } return bestposition || specifiedposition; } var boxposition = new boxposition(stylebox), cue = stylebox.cue, linepos = computelinepos(cue), axis = []; // if we have a line number to align the cue to. if (cue.snaptolines) { var size; switch (cue.vertical) { case "": axis = [ "+y", "-y" ]; size = "height"; break; case "rl": axis = [ "+x", "-x" ]; size = "width"; break; case "lr": axis = [ "-x", "+x" ]; size = "width"; break; } var step = boxposition.lineheight, position = step * math.round(linepos), maxposition = containerbox[size] + step, initialaxis = axis[0]; // if the specified intial position is greater then the max position then // clamp the box to the amount of steps it would take for the box to // reach the max position. if (math.abs(position) > maxposition) { position = position < 0 ? -1 : 1; position *= math.ceil(maxposition / step) * step; } // if computed line position returns negative then line numbers are // relative to the bottom of the video instead of the top. therefore, we // need to increase our initial position by the length or width of the // video, depending on the writing direction, and reverse our axis directions. if (linepos < 0) { position += cue.vertical === "" ? containerbox.height : containerbox.width; axis = axis.reverse(); } // move the box to the specified position. this may not be its best // position. boxposition.move(initialaxis, position); } else { // if we have a percentage line value for the cue. var calculatedpercentage = (boxposition.lineheight / containerbox.height) * 100; switch (cue.linealign) { case "center": linepos -= (calculatedpercentage / 2); break; case "end": linepos -= calculatedpercentage; break; } // apply initial line position to the cue box. switch (cue.vertical) { case "": stylebox.applystyles({ top: stylebox.formatstyle(linepos, "%") }); break; case "rl": stylebox.applystyles({ left: stylebox.formatstyle(linepos, "%") }); break; case "lr": stylebox.applystyles({ right: stylebox.formatstyle(linepos, "%") }); break; } axis = [ "+y", "-x", "+x", "-y" ]; // get the box position again after we've applied the specified positioning // to it. boxposition = new boxposition(stylebox); } var bestposition = findbestposition(boxposition, axis); stylebox.move(bestposition.tocsscompatvalues(containerbox)); } function webvtt() { // nothing } // helper to allow strings to be decoded instead of the default binary utf8 data. webvtt.stringdecoder = function() { return { decode: function(data) { if (!data) { return ""; } if (typeof data !== "string") { throw new error("error - expected string data."); } return decodeuricomponent(encodeuricomponent(data)); } }; }; webvtt.convertcuetodomtree = function(window, cuetext) { if (!window || !cuetext) { return null; } return parsecontent(window, cuetext); }; var font_size_percent = 0.05; var font_style = "sans-serif"; var cue_background_padding = "1.5%"; // runs the processing model over the cues and regions passed to it. // @param overlay a block level element (usually a div) that the computed cues // and regions will be placed into. webvtt.processcues = function(window, cues, overlay) { if (!window || !cues || !overlay) { return null; } // remove all previous children. while (overlay.firstchild) { overlay.removechild(overlay.firstchild); } var paddedoverlay = window.document.createelement("div"); paddedoverlay.style.position = "absolute"; paddedoverlay.style.left = "0"; paddedoverlay.style.right = "0"; paddedoverlay.style.top = "0"; paddedoverlay.style.bottom = "0"; paddedoverlay.style.margin = cue_background_padding; overlay.appendchild(paddedoverlay); // determine if we need to compute the display states of the cues. this could // be the case if a cue's state has been changed since the last computation or // if it has not been computed yet. function shouldcompute(cues) { for (var i = 0; i < cues.length; i++) { if (cues[i].hasbeenreset || !cues[i].displaystate) { return true; } } return false; } // we don't need to recompute the cues' display states. just reuse them. if (!shouldcompute(cues)) { for (var i = 0; i < cues.length; i++) { paddedoverlay.appendchild(cues[i].displaystate); } return; } var boxpositions = [], containerbox = boxposition.getsimpleboxposition(paddedoverlay), fontsize = math.round(containerbox.height * font_size_percent * 100) / 100; var styleoptions = { font: fontsize + "px " + font_style }; (function() { var stylebox, cue; for (var i = 0; i < cues.length; i++) { cue = cues[i]; // compute the intial position and styles of the cue div. stylebox = new cuestylebox(window, cue, styleoptions); paddedoverlay.appendchild(stylebox.div); // move the cue div to it's correct line position. moveboxtolineposition(window, stylebox, containerbox, boxpositions); // remember the computed div so that we don't have to recompute it later // if we don't have too. cue.displaystate = stylebox.div; boxpositions.push(boxposition.getsimpleboxposition(stylebox)); } })(); }; webvtt.parser = function(window, vttjs, decoder) { if (!decoder) { decoder = vttjs; vttjs = {}; } if (!vttjs) { vttjs = {}; } this.window = window; this.vttjs = vttjs; this.state = "initial"; this.buffer = ""; this.decoder = decoder || new textdecoder("utf8"); this.regionlist = []; }; webvtt.parser.prototype = { // if the error is a parsingerror then report it to the consumer if // possible. if it's not a parsingerror then throw it like normal. reportorthrowerror: function(e) { if (e instanceof parsingerror) { this.onparsingerror && this.onparsingerror(e); } else { throw e; } }, parse: function (data) { var self = this; // if there is no data then we won't decode it, but will just try to parse // whatever is in buffer already. this may occur in circumstances, for // example when flush() is called. if (data) { // try to decode the data that we received. self.buffer += self.decoder.decode(data, {stream: true}); } function collectnextline() { var buffer = self.buffer; var pos = 0; while (pos < buffer.length && buffer[pos] !== '\r' && buffer[pos] !== '\n') { ++pos; } var line = buffer.substr(0, pos); // advance the buffer early in case we fail below. if (buffer[pos] === '\r') { ++pos; } if (buffer[pos] === '\n') { ++pos; } self.buffer = buffer.substr(pos); return line; } // 3.4 webvtt region and webvtt region settings syntax function parseregion(input) { var settings = new settings(); parseoptions(input, function (k, v) { switch (k) { case "id": settings.set(k, v); break; case "width": settings.percent(k, v); break; case "lines": settings.integer(k, v); break; case "regionanchor": case "viewportanchor": var xy = v.split(','); if (xy.length !== 2) { break; } // we have to make sure both x and y parse, so use a temporary // settings object here. var anchor = new settings(); anchor.percent("x", xy[0]); anchor.percent("y", xy[1]); if (!anchor.has("x") || !anchor.has("y")) { break; } settings.set(k + "x", anchor.get("x")); settings.set(k + "y", anchor.get("y")); break; case "scroll": settings.alt(k, v, ["up"]); break; } }, /=/, /\s/); // create the region, using default values for any values that were not // specified. if (settings.has("id")) { var region = new (self.vttjs.vttregion || self.window.vttregion)(); region.width = settings.get("width", 100); region.lines = settings.get("lines", 3); region.regionanchorx = settings.get("regionanchorx", 0); region.regionanchory = settings.get("regionanchory", 100); region.viewportanchorx = settings.get("viewportanchorx", 0); region.viewportanchory = settings.get("viewportanchory", 100); region.scroll = settings.get("scroll", ""); // register the region. self.onregion && self.onregion(region); // remember the vttregion for later in case we parse any vttcues that // reference it. self.regionlist.push({ id: settings.get("id"), region: region }); } } // draft-pantos-http-live-streaming-20 // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5 // 3.5 webvtt function parsetimestampmap(input) { var settings = new settings(); parseoptions(input, function(k, v) { switch(k) { case "mpegt": settings.integer(k + 's', v); break; case "loca": settings.set(k + 'l', parsetimestamp(v)); break; } }, /[^\d]:/, /,/); self.ontimestampmap && self.ontimestampmap({ "mpegts": settings.get("mpegts"), "local": settings.get("local") }); } // 3.2 webvtt metadata header syntax function parseheader(input) { if (input.match(/x-timestamp-map/)) { // this line contains hls x-timestamp-map metadata parseoptions(input, function(k, v) { switch(k) { case "x-timestamp-map": parsetimestampmap(v); break; } }, /=/); } else { parseoptions(input, function (k, v) { switch (k) { case "region": // 3.3 webvtt region metadata header syntax parseregion(v); break; } }, /:/); } } // 5.1 webvtt file parsing. try { var line; if (self.state === "initial") { // we can't start parsing until we have the first line. if (!/\r\n|\n/.test(self.buffer)) { return this; } line = collectnextline(); var m = line.match(/^webvtt([ \t].*)?$/); if (!m || !m[0]) { throw new parsingerror(parsingerror.errors.badsignature); } self.state = "header"; } var alreadycollectedline = false; while (self.buffer) { // we can't parse a line until we have the full line. if (!/\r\n|\n/.test(self.buffer)) { return this; } if (!alreadycollectedline) { line = collectnextline(); } else { alreadycollectedline = false; } switch (self.state) { case "header": // 13-18 - allow a header (metadata) under the webvtt line. if (/:/.test(line)) { parseheader(line); } else if (!line) { // an empty line terminates the header and starts the body (cues). self.state = "id"; } continue; case "note": // ignore note blocks. if (!line) { self.state = "id"; } continue; case "id": // check for the start of note blocks. if (/^note($|[ \t])/.test(line)) { self.state = "note"; break; } // 19-29 - allow any number of line terminators, then initialize new cue values. if (!line) { continue; } self.cue = new (self.vttjs.vttcue || self.window.vttcue)(0, 0, ""); // safari still uses the old middle value and won't accept center try { self.cue.align = "center"; } catch (e) { self.cue.align = "middle"; } self.state = "cue"; // 30-39 - check if self line contains an optional identifier or timing data. if (line.indexof("-->") === -1) { self.cue.id = line; continue; } // process line as start of a cue. /*falls through*/ case "cue": // 40 - collect cue timings and settings. try { parsecue(line, self.cue, self.regionlist); } catch (e) { self.reportorthrowerror(e); // in case of an error ignore rest of the cue. self.cue = null; self.state = "badcue"; continue; } self.state = "cuetext"; continue; case "cuetext": var hassubstring = line.indexof("-->") !== -1; // 34 - if we have an empty line then report the cue. // 35 - if we have the special substring '-->' then report the cue, // but do not collect the line as we need to process the current // one as a new cue. if (!line || hassubstring && (alreadycollectedline = true)) { // we are done parsing self cue. self.oncue && self.oncue(self.cue); self.cue = null; self.state = "id"; continue; } if (self.cue.text) { self.cue.text += "\n"; } self.cue.text += line.replace(/\u2028/g, '\n').replace(/u2029/g, '\n'); continue; case "badcue": // badcue // 54-62 - collect and discard the remaining cue. if (!line) { self.state = "id"; } continue; } } } catch (e) { self.reportorthrowerror(e); // if we are currently parsing a cue, report what we have. if (self.state === "cuetext" && self.cue && self.oncue) { self.oncue(self.cue); } self.cue = null; // enter badwebvtt state if header was not parsed correctly otherwise // another exception occurred so enter badcue state. self.state = self.state === "initial" ? "badwebvtt" : "badcue"; } return this; }, flush: function () { var self = this; try { // finish decoding the stream. self.buffer += self.decoder.decode(); // synthesize the end of the current cue or region. if (self.cue || self.state === "header") { self.buffer += "\n\n"; self.parse(); } // if we've flushed, parsed, and we're still on the initial state then // that means we don't have enough of the stream to parse the first // line. if (self.state === "initial") { throw new parsingerror(parsingerror.errors.badsignature); } } catch(e) { self.reportorthrowerror(e); } self.onflush && self.onflush(); return this; } }; module.exports = webvtt; /***/ }), /***/ 411: /***/ (function(module, exports) { /** * copyright 2013 vtt.js contributors * * licensed under the apache license, version 2.0 (the "license"); * you may not use this file except in compliance with the license. * you may obtain a copy of the license at * * http://www.apache.org/licenses/license-2.0 * * unless required by applicable law or agreed to in writing, software * distributed under the license is distributed on an "as is" basis, * without warranties or conditions of any kind, either express or implied. * see the license for the specific language governing permissions and * limitations under the license. */ var autokeyword = "auto"; var directionsetting = { "": 1, "lr": 1, "rl": 1 }; var alignsetting = { "start": 1, "center": 1, "end": 1, "left": 1, "right": 1, "auto": 1, "line-left": 1, "line-right": 1 }; function finddirectionsetting(value) { if (typeof value !== "string") { return false; } var dir = directionsetting[value.tolowercase()]; return dir ? value.tolowercase() : false; } function findalignsetting(value) { if (typeof value !== "string") { return false; } var align = alignsetting[value.tolowercase()]; return align ? value.tolowercase() : false; } function vttcue(starttime, endtime, text) { /** * shim implementation specific properties. these properties are not in * the spec. */ // lets us know when the vttcue's data has changed in such a way that we need // to recompute its display state. this lets us compute its display state // lazily. this.hasbeenreset = false; /** * vttcue and texttrackcue properties * http://dev.w3.org/html5/webvtt/#vttcue-interface */ var _id = ""; var _pauseonexit = false; var _starttime = starttime; var _endtime = endtime; var _text = text; var _region = null; var _vertical = ""; var _snaptolines = true; var _line = "auto"; var _linealign = "start"; var _position = "auto"; var _positionalign = "auto"; var _size = 100; var _align = "center"; object.defineproperties(this, { "id": { enumerable: true, get: function() { return _id; }, set: function(value) { _id = "" + value; } }, "pauseonexit": { enumerable: true, get: function() { return _pauseonexit; }, set: function(value) { _pauseonexit = !!value; } }, "starttime": { enumerable: true, get: function() { return _starttime; }, set: function(value) { if (typeof value !== "number") { throw new typeerror("start time must be set to a number."); } _starttime = value; this.hasbeenreset = true; } }, "endtime": { enumerable: true, get: function() { return _endtime; }, set: function(value) { if (typeof value !== "number") { throw new typeerror("end time must be set to a number."); } _endtime = value; this.hasbeenreset = true; } }, "text": { enumerable: true, get: function() { return _text; }, set: function(value) { _text = "" + value; this.hasbeenreset = true; } }, "region": { enumerable: true, get: function() { return _region; }, set: function(value) { _region = value; this.hasbeenreset = true; } }, "vertical": { enumerable: true, get: function() { return _vertical; }, set: function(value) { var setting = finddirectionsetting(value); // have to check for false because the setting an be an empty string. if (setting === false) { throw new syntaxerror("vertical: an invalid or illegal direction string was specified."); } _vertical = setting; this.hasbeenreset = true; } }, "snaptolines": { enumerable: true, get: function() { return _snaptolines; }, set: function(value) { _snaptolines = !!value; this.hasbeenreset = true; } }, "line": { enumerable: true, get: function() { return _line; }, set: function(value) { if (typeof value !== "number" && value !== autokeyword) { throw new syntaxerror("line: an invalid number or illegal string was specified."); } _line = value; this.hasbeenreset = true; } }, "linealign": { enumerable: true, get: function() { return _linealign; }, set: function(value) { var setting = findalignsetting(value); if (!setting) { console.warn("linealign: an invalid or illegal string was specified."); } else { _linealign = setting; this.hasbeenreset = true; } } }, "position": { enumerable: true, get: function() { return _position; }, set: function(value) { if (value < 0 || value > 100) { throw new error("position must be between 0 and 100."); } _position = value; this.hasbeenreset = true; } }, "positionalign": { enumerable: true, get: function() { return _positionalign; }, set: function(value) { var setting = findalignsetting(value); if (!setting) { console.warn("positionalign: an invalid or illegal string was specified."); } else { _positionalign = setting; this.hasbeenreset = true; } } }, "size": { enumerable: true, get: function() { return _size; }, set: function(value) { if (value < 0 || value > 100) { throw new error("size must be between 0 and 100."); } _size = value; this.hasbeenreset = true; } }, "align": { enumerable: true, get: function() { return _align; }, set: function(value) { var setting = findalignsetting(value); if (!setting) { throw new syntaxerror("align: an invalid or illegal alignment string was specified."); } _align = setting; this.hasbeenreset = true; } } }); /** * other spec defined properties */ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state this.displaystate = undefined; } /** * vttcue methods */ vttcue.prototype.getcueashtml = function() { // assume webvtt.convertcuetodomtree is on the global. return webvtt.convertcuetodomtree(window, this.text); }; module.exports = vttcue; /***/ }), /***/ 412: /***/ (function(module, exports) { /** * copyright 2013 vtt.js contributors * * licensed under the apache license, version 2.0 (the "license"); * you may not use this file except in compliance with the license. * you may obtain a copy of the license at * * http://www.apache.org/licenses/license-2.0 * * unless required by applicable law or agreed to in writing, software * distributed under the license is distributed on an "as is" basis, * without warranties or conditions of any kind, either express or implied. * see the license for the specific language governing permissions and * limitations under the license. */ var scrollsetting = { "": true, "up": true }; function findscrollsetting(value) { if (typeof value !== "string") { return false; } var scroll = scrollsetting[value.tolowercase()]; return scroll ? value.tolowercase() : false; } function isvalidpercentvalue(value) { return typeof value === "number" && (value >= 0 && value <= 100); } // vttregion shim http://dev.w3.org/html5/webvtt/#vttregion-interface function vttregion() { var _width = 100; var _lines = 3; var _regionanchorx = 0; var _regionanchory = 100; var _viewportanchorx = 0; var _viewportanchory = 100; var _scroll = ""; object.defineproperties(this, { "width": { enumerable: true, get: function() { return _width; }, set: function(value) { if (!isvalidpercentvalue(value)) { throw new error("width must be between 0 and 100."); } _width = value; } }, "lines": { enumerable: true, get: function() { return _lines; }, set: function(value) { if (typeof value !== "number") { throw new typeerror("lines must be set to a number."); } _lines = value; } }, "regionanchory": { enumerable: true, get: function() { return _regionanchory; }, set: function(value) { if (!isvalidpercentvalue(value)) { throw new error("regionanchorx must be between 0 and 100."); } _regionanchory = value; } }, "regionanchorx": { enumerable: true, get: function() { return _regionanchorx; }, set: function(value) { if(!isvalidpercentvalue(value)) { throw new error("regionanchory must be between 0 and 100."); } _regionanchorx = value; } }, "viewportanchory": { enumerable: true, get: function() { return _viewportanchory; }, set: function(value) { if (!isvalidpercentvalue(value)) { throw new error("viewportanchory must be between 0 and 100."); } _viewportanchory = value; } }, "viewportanchorx": { enumerable: true, get: function() { return _viewportanchorx; }, set: function(value) { if (!isvalidpercentvalue(value)) { throw new error("viewportanchorx must be between 0 and 100."); } _viewportanchorx = value; } }, "scroll": { enumerable: true, get: function() { return _scroll; }, set: function(value) { var setting = findscrollsetting(value); // have to check for false as an empty string is a legal value. if (setting === false) { console.warn("scroll: an invalid or illegal string was specified."); } else { _scroll = setting; } } } }); } module.exports = vttregion; /***/ }), /***/ 424: /***/ (function(module, exports, __webpack_require__) { // extracted by extract-css-chunks-webpack-plugin module.exports = {}; /***/ }), /***/ 427: /***/ (function(module, exports, __webpack_require__) { "use strict"; var getintrinsic = __webpack_require__(157); var callbound = __webpack_require__(433); var inspect = __webpack_require__(435); var $typeerror = getintrinsic('%typeerror%'); var $weakmap = getintrinsic('%weakmap%', true); var $map = getintrinsic('%map%', true); var $weakmapget = callbound('weakmap.prototype.get', true); var $weakmapset = callbound('weakmap.prototype.set', true); var $weakmaphas = callbound('weakmap.prototype.has', true); var $mapget = callbound('map.prototype.get', true); var $mapset = callbound('map.prototype.set', true); var $maphas = callbound('map.prototype.has', true); /* * this function traverses the list returning the node corresponding to the * given key. * * that node is also moved to the head of the list, so that if it's accessed * again we don't need to traverse the whole list. by doing so, all the recently * used nodes can be accessed relatively quickly. */ var listgetnode = function (list, key) { // eslint-disable-line consistent-return for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { if (curr.key === key) { prev.next = curr.next; curr.next = list.next; list.next = curr; // eslint-disable-line no-param-reassign return curr; } } }; var listget = function (objects, key) { var node = listgetnode(objects, key); return node && node.value; }; var listset = function (objects, key, value) { var node = listgetnode(objects, key); if (node) { node.value = value; } else { // prepend the new node to the beginning of the list objects.next = { // eslint-disable-line no-param-reassign key: key, next: objects.next, value: value }; } }; var listhas = function (objects, key) { return !!listgetnode(objects, key); }; module.exports = function getsidechannel() { var $wm; var $m; var $o; var channel = { assert: function (key) { if (!channel.has(key)) { throw new $typeerror('side channel does not contain ' + inspect(key)); } }, get: function (key) { // eslint-disable-line consistent-return if ($weakmap && key && (typeof key === 'object' || typeof key === 'function')) { if ($wm) { return $weakmapget($wm, key); } } else if ($map) { if ($m) { return $mapget($m, key); } } else { if ($o) { // eslint-disable-line no-lonely-if return listget($o, key); } } }, has: function (key) { if ($weakmap && key && (typeof key === 'object' || typeof key === 'function')) { if ($wm) { return $weakmaphas($wm, key); } } else if ($map) { if ($m) { return $maphas($m, key); } } else { if ($o) { // eslint-disable-line no-lonely-if return listhas($o, key); } } return false; }, set: function (key, value) { if ($weakmap && key && (typeof key === 'object' || typeof key === 'function')) { if (!$wm) { $wm = new $weakmap(); } $weakmapset($wm, key, value); } else if ($map) { if (!$m) { $m = new $map(); } $mapset($m, key, value); } else { if (!$o) { /* * initialize the linked list as an empty node, so that we don't have * to special-case handling of the first node: we can always refer to * it as (previous node).next, instead of something like (list).head */ $o = { key: {}, next: null }; } listset($o, key, value); } } }; return channel; }; /***/ }), /***/ 82: /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * vue-no-ssr v1.1.1 * (c) 2018-present egoist <0x142857@gmail.com> * released under the mit license. */ var index = { name: 'nossr', functional: true, props: { placeholder: string, placeholdertag: { type: string, default: 'div' } }, render: function render(h, ref) { var parent = ref.parent; var slots = ref.slots; var props = ref.props; var ref$1 = slots(); var defaultslot = ref$1.default; if ( defaultslot === void 0 ) defaultslot = []; var placeholderslot = ref$1.placeholder; if (parent._ismounted) { return defaultslot } parent.$once('hook:mounted', function () { parent.$forceupdate(); }); if (props.placeholdertag && (props.placeholder || placeholderslot)) { return h( props.placeholdertag, { class: ['no-ssr-placeholder'] }, props.placeholder || placeholderslot ) } // return a placeholder element for each child in the default slot // or if no children return a single placeholder return defaultslot.length > 0 ? defaultslot.map(function () { return h(false); }) : h(false) } }; module.exports = index; /***/ }) }]);