\\r\\n * All rights reserved.\\r\\n *\\r\\n * Redistribution and use in source and binary forms, with or without\\r\\n * modification, are permitted provided that the following conditions are met:\\r\\n *\\r\\n * * Redistributions of source code must retain the above copyright notice, this\\r\\n * list of conditions and the following disclaimer.\\r\\n * * Redistributions in binary form must reproduce the above copyright notice,\\r\\n * this list of conditions and the following disclaimer in the documentation\\r\\n * and/or other materials provided with the distribution.\\r\\n *\\r\\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\r\\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\r\\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\\r\\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\\r\\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\\r\\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\\r\\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\\r\\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\\r\\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\\r\\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\\r\\n * POSSIBILITY OF SUCH DAMAGE.\\r\\n */\\r\\n\\r\\n/**\\r\\n * @module imscHTML\\r\\n */\\r\\n\\r\\n;\\r\\n(function (imscHTML, imscNames, imscStyles) {\\r\\n\\r\\n /**\\r\\n * Function that maps smpte:background
URIs to URLs resolving to image resource\\r\\n * @callback IMGResolver\\r\\n * @param {string} smpte:background
URI\\r\\n * @return {string} PNG resource URL\\r\\n */\\r\\n\\r\\n\\r\\n /**\\r\\n * Renders an ISD object (returned by generateISD()
) into a \\r\\n * parent element, that must be attached to the DOM. The ISD will be rendered\\r\\n * into a child div
\\r\\n * with heigh and width equal to the clientHeight and clientWidth of the element,\\r\\n * unless explicitly specified otherwise by the caller. Images URIs specified \\r\\n * by smpte:background
attributes are mapped to image resource URLs\\r\\n * by an imgResolver
function. The latter takes the value of smpte:background
\\r\\n * attribute and an img
DOM element as input, and is expected to\\r\\n * set the src
attribute of the img
to the absolute URI of the image.\\r\\n * displayForcedOnlyMode
sets the (boolean)\\r\\n * value of the IMSC1 displayForcedOnlyMode parameter. The function returns\\r\\n * an opaque object that should passed in previousISDState
when this function\\r\\n * is called for the next ISD, otherwise previousISDState
should be set to \\r\\n * null
.\\r\\n * \\r\\n * @param {Object} isd ISD to be rendered\\r\\n * @param {Object} element Element into which the ISD is rendered\\r\\n * @param {?IMGResolver} imgResolver Resolve smpte:background
URIs into URLs.\\r\\n * @param {?number} eheight Height (in pixel) of the child div
or null \\r\\n * to use clientHeight of the parent element\\r\\n * @param {?number} ewidth Width (in pixel) of the child div
or null\\r\\n * to use clientWidth of the parent element\\r\\n * @param {?boolean} displayForcedOnlyMode Value of the IMSC1 displayForcedOnlyMode parameter,\\r\\n * or false if null \\r\\n * @param {?module:imscUtils.ErrorHandler} errorHandler Error callback\\r\\n * @param {Object} previousISDState State saved during processing of the previous ISD, or null if initial call\\r\\n * @param {?boolean} enableRollUp Enables roll-up animations (see CEA 708)\\r\\n * @return {Object} ISD state to be provided when this funtion is called for the next ISD\\r\\n */\\r\\n\\r\\n imscHTML.render = function (isd,\\r\\n element,\\r\\n imgResolver,\\r\\n eheight,\\r\\n ewidth,\\r\\n displayForcedOnlyMode,\\r\\n errorHandler,\\r\\n previousISDState,\\r\\n enableRollUp\\r\\n ) {\\r\\n\\r\\n /* maintain aspect ratio if specified */\\r\\n\\r\\n var height = eheight || element.clientHeight;\\r\\n var width = ewidth || element.clientWidth;\\r\\n\\r\\n if (isd.aspectRatio !== null) {\\r\\n\\r\\n var twidth = height * isd.aspectRatio;\\r\\n\\r\\n if (twidth > width) {\\r\\n\\r\\n height = Math.round(width / isd.aspectRatio);\\r\\n\\r\\n } else {\\r\\n\\r\\n width = twidth;\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n var rootcontainer = document.createElement(\\\"div\\\");\\r\\n\\r\\n rootcontainer.style.position = \\\"relative\\\";\\r\\n rootcontainer.style.width = width + \\\"px\\\";\\r\\n rootcontainer.style.height = height + \\\"px\\\";\\r\\n rootcontainer.style.margin = \\\"auto\\\";\\r\\n rootcontainer.style.top = 0;\\r\\n rootcontainer.style.bottom = 0;\\r\\n rootcontainer.style.left = 0;\\r\\n rootcontainer.style.right = 0;\\r\\n rootcontainer.style.zIndex = 0;\\r\\n\\r\\n var context = {\\r\\n h: height,\\r\\n w: width,\\r\\n regionH: null,\\r\\n regionW: null,\\r\\n imgResolver: imgResolver,\\r\\n displayForcedOnlyMode: displayForcedOnlyMode || false,\\r\\n isd: isd,\\r\\n errorHandler: errorHandler,\\r\\n previousISDState: previousISDState,\\r\\n enableRollUp: enableRollUp || false,\\r\\n currentISDState: {},\\r\\n flg: null, /* current fillLineGap value if active, null otherwise */\\r\\n lp: null, /* current linePadding value if active, null otherwise */\\r\\n mra: null, /* current multiRowAlign value if active, null otherwise */\\r\\n ipd: null, /* inline progression direction (lr, rl, tb) */\\r\\n bpd: null /* block progression direction (lr, rl, tb) */\\r\\n };\\r\\n\\r\\n element.appendChild(rootcontainer);\\r\\n\\r\\n for (var i in isd.contents) {\\r\\n\\r\\n processElement(context, rootcontainer, isd.contents[i]);\\r\\n\\r\\n }\\r\\n\\r\\n return context.currentISDState;\\r\\n\\r\\n };\\r\\n\\r\\n function processElement(context, dom_parent, isd_element) {\\r\\n\\r\\n var e;\\r\\n\\r\\n if (isd_element.kind === 'region') {\\r\\n\\r\\n e = document.createElement(\\\"div\\\");\\r\\n e.style.position = \\\"absolute\\\";\\r\\n\\r\\n } else if (isd_element.kind === 'body') {\\r\\n\\r\\n e = document.createElement(\\\"div\\\");\\r\\n\\r\\n } else if (isd_element.kind === 'div') {\\r\\n\\r\\n e = document.createElement(\\\"div\\\");\\r\\n\\r\\n } else if (isd_element.kind === 'p') {\\r\\n\\r\\n e = document.createElement(\\\"p\\\");\\r\\n\\r\\n } else if (isd_element.kind === 'span') {\\r\\n\\r\\n e = document.createElement(\\\"span\\\");\\r\\n\\r\\n //e.textContent = isd_element.text;\\r\\n\\r\\n } else if (isd_element.kind === 'br') {\\r\\n\\r\\n e = document.createElement(\\\"br\\\");\\r\\n\\r\\n }\\r\\n\\r\\n if (!e) {\\r\\n\\r\\n reportError(context.errorHandler, \\\"Error processing ISD element kind: \\\" + isd_element.kind);\\r\\n\\r\\n return;\\r\\n\\r\\n }\\r\\n\\r\\n /* override UA default margin */\\r\\n /* TODO: should apply to only */\\r\\n\\r\\n e.style.margin = \\\"0\\\";\\r\\n\\r\\n /* tranform TTML styles to CSS styles */\\r\\n\\r\\n for (var i in STYLING_MAP_DEFS) {\\r\\n\\r\\n var sm = STYLING_MAP_DEFS[i];\\r\\n\\r\\n var attr = isd_element.styleAttrs[sm.qname];\\r\\n\\r\\n if (attr !== undefined && sm.map !== null) {\\r\\n\\r\\n sm.map(context, e, isd_element, attr);\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n var proc_e = e;\\r\\n\\r\\n /* remember writing direction */\\r\\n\\r\\n if (isd_element.kind === \\\"region\\\") {\\r\\n\\r\\n var wdir = isd_element.styleAttrs[imscStyles.byName.writingMode.qname];\\r\\n\\r\\n if (wdir === \\\"lrtb\\\" || wdir === \\\"lr\\\") {\\r\\n\\r\\n context.ipd = \\\"lr\\\";\\r\\n context.bpd = \\\"tb\\\";\\r\\n\\r\\n } else if (wdir === \\\"rltb\\\" || wdir === \\\"rl\\\") {\\r\\n\\r\\n context.ipd = \\\"rl\\\";\\r\\n context.bpd = \\\"tb\\\";\\r\\n\\r\\n } else if (wdir === \\\"tblr\\\") {\\r\\n\\r\\n context.ipd = \\\"tb\\\";\\r\\n context.bpd = \\\"lr\\\";\\r\\n\\r\\n } else if (wdir === \\\"tbrl\\\" || wdir === \\\"tb\\\") {\\r\\n\\r\\n context.ipd = \\\"tb\\\";\\r\\n context.bpd = \\\"rl\\\";\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n /* do we have linePadding ? */\\r\\n\\r\\n var lp = isd_element.styleAttrs[imscStyles.byName.linePadding.qname];\\r\\n\\r\\n if (lp && lp > 0) {\\r\\n\\r\\n /* apply padding to the
so that line padding does not cause line wraps */\\r\\n\\r\\n var padmeasure = Math.ceil(lp * context.h) + \\\"px\\\";\\r\\n\\r\\n if (context.bpd === \\\"tb\\\") {\\r\\n\\r\\n proc_e.style.paddingLeft = padmeasure;\\r\\n proc_e.style.paddingRight = padmeasure;\\r\\n\\r\\n } else {\\r\\n\\r\\n proc_e.style.paddingTop = padmeasure;\\r\\n proc_e.style.paddingBottom = padmeasure;\\r\\n\\r\\n }\\r\\n\\r\\n context.lp = lp;\\r\\n }\\r\\n\\r\\n // do we have multiRowAlign?\\r\\n\\r\\n var mra = isd_element.styleAttrs[imscStyles.byName.multiRowAlign.qname];\\r\\n\\r\\n if (mra && mra !== \\\"auto\\\") {\\r\\n\\r\\n /* create inline block to handle multirowAlign */\\r\\n\\r\\n var s = document.createElement(\\\"span\\\");\\r\\n\\r\\n s.style.display = \\\"inline-block\\\";\\r\\n\\r\\n s.style.textAlign = mra;\\r\\n\\r\\n e.appendChild(s);\\r\\n\\r\\n proc_e = s;\\r\\n\\r\\n context.mra = mra;\\r\\n\\r\\n }\\r\\n\\r\\n /* remember we are filling line gaps */\\r\\n\\r\\n if (isd_element.styleAttrs[imscStyles.byName.fillLineGap.qname]) {\\r\\n context.flg = true;\\r\\n }\\r\\n\\r\\n\\r\\n if (isd_element.kind === \\\"span\\\" && isd_element.text) {\\r\\n\\r\\n if (context.lp || context.mra || context.flg) {\\r\\n\\r\\n // wrap characters in spans to find the line wrap locations\\r\\n\\r\\n var cbuf = '';\\r\\n\\r\\n for (var j = 0; j < isd_element.text.length; j++) {\\r\\n\\r\\n cbuf += isd_element.text.charAt(j);\\r\\n\\r\\n var cc = isd_element.text.charCodeAt(j);\\r\\n\\r\\n if (cc < 0xD800 || cc > 0xDBFF || j === isd_element.text.length) {\\r\\n\\r\\n /* wrap the character(s) in a span unless it is a high surrogate */\\r\\n\\r\\n var span = document.createElement(\\\"span\\\");\\r\\n\\r\\n span.textContent = cbuf;\\r\\n \\r\\n e.appendChild(span);\\r\\n\\r\\n cbuf = '';\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n } else {\\r\\n\\r\\n e.textContent = isd_element.text;\\r\\n\\r\\n }\\r\\n }\\r\\n\\r\\n dom_parent.appendChild(e);\\r\\n\\r\\n /* process the children of the ISD element */\\r\\n\\r\\n for (var k in isd_element.contents) {\\r\\n\\r\\n processElement(context, proc_e, isd_element.contents[k]);\\r\\n\\r\\n }\\r\\n\\r\\n /* list of lines */\\r\\n\\r\\n var linelist = [];\\r\\n\\r\\n\\r\\n /* paragraph processing */\\r\\n /* TODO: linePadding only supported for horizontal scripts */\\r\\n\\r\\n if ((context.lp || context.mra || context.flg) && isd_element.kind === \\\"p\\\") {\\r\\n\\r\\n constructLineList(context, proc_e, linelist, null);\\r\\n\\r\\n /* insert line breaks for multirowalign */\\r\\n\\r\\n if (context.mra) {\\r\\n\\r\\n applyMultiRowAlign(linelist);\\r\\n\\r\\n context.mra = null;\\r\\n\\r\\n }\\r\\n\\r\\n /* add linepadding */\\r\\n\\r\\n if (context.lp) {\\r\\n\\r\\n applyLinePadding(linelist, context.lp * context.h, context);\\r\\n\\r\\n context.lp = null;\\r\\n\\r\\n }\\r\\n\\r\\n /* fill line gaps linepadding */\\r\\n\\r\\n if (context.flg) {\\r\\n\\r\\n var par_edges = rect2edges(proc_e.getBoundingClientRect(), context);\\r\\n\\r\\n applyFillLineGap(linelist, par_edges.before, par_edges.after, context);\\r\\n\\r\\n context.flg = null;\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n\\r\\n /* region processing */\\r\\n\\r\\n if (isd_element.kind === \\\"region\\\") {\\r\\n\\r\\n /* build line list */\\r\\n\\r\\n constructLineList(context, proc_e, linelist);\\r\\n\\r\\n /* perform roll up if needed */\\r\\n\\r\\n if ((context.bpd === \\\"tb\\\") &&\\r\\n context.enableRollUp &&\\r\\n isd_element.contents.length > 0 &&\\r\\n isd_element.styleAttrs[imscStyles.byName.displayAlign.qname] === 'after') {\\r\\n\\r\\n /* horrible hack, perhaps default region id should be underscore everywhere? */\\r\\n\\r\\n var rid = isd_element.id === '' ? '_' : isd_element.id;\\r\\n\\r\\n var rb = new RegionPBuffer(rid, linelist);\\r\\n\\r\\n context.currentISDState[rb.id] = rb;\\r\\n\\r\\n if (context.previousISDState &&\\r\\n rb.id in context.previousISDState &&\\r\\n context.previousISDState[rb.id].plist.length > 0 &&\\r\\n rb.plist.length > 1 &&\\r\\n rb.plist[rb.plist.length - 2].text ===\\r\\n context.previousISDState[rb.id].plist[context.previousISDState[rb.id].plist.length - 1].text) {\\r\\n\\r\\n var body_elem = e.firstElementChild;\\r\\n \\r\\n var h = rb.plist[rb.plist.length - 1].after - rb.plist[rb.plist.length - 1].before;\\r\\n\\r\\n body_elem.style.bottom = \\\"-\\\" + h + \\\"px\\\";\\r\\n body_elem.style.transition = \\\"transform 0.4s\\\";\\r\\n body_elem.style.position = \\\"relative\\\";\\r\\n body_elem.style.transform = \\\"translateY(-\\\" + h + \\\"px)\\\";\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n /* TODO: clean-up the spans ? */\\r\\n\\r\\n }\\r\\n }\\r\\n\\r\\n function applyLinePadding(lineList, lp, context) {\\r\\n\\r\\n for (var i in lineList) {\\r\\n\\r\\n var l = lineList[i].elements.length;\\r\\n\\r\\n var se = lineList[i].elements[lineList[i].start_elem];\\r\\n\\r\\n var ee = lineList[i].elements[lineList[i].end_elem];\\r\\n\\r\\n var pospadpxlen = Math.ceil(lp) + \\\"px\\\";\\r\\n\\r\\n var negpadpxlen = \\\"-\\\" + Math.ceil(lp) + \\\"px\\\";\\r\\n\\r\\n if (l !== 0) {\\r\\n\\r\\n if (context.ipd === \\\"lr\\\") {\\r\\n\\r\\n se.node.style.borderLeftColor = se.bgcolor || \\\"#00000000\\\";\\r\\n se.node.style.borderLeftStyle = \\\"solid\\\";\\r\\n se.node.style.borderLeftWidth = pospadpxlen;\\r\\n se.node.style.marginLeft = negpadpxlen;\\r\\n\\r\\n } else if (context.ipd === \\\"rl\\\") {\\r\\n\\r\\n se.node.style.borderRightColor = se.bgcolor || \\\"#00000000\\\";\\r\\n se.node.style.borderRightStyle = \\\"solid\\\";\\r\\n se.node.style.borderRightWidth = pospadpxlen;\\r\\n se.node.style.marginRight = negpadpxlen;\\r\\n\\r\\n } else if (context.ipd === \\\"tb\\\") {\\r\\n\\r\\n se.node.style.borderTopColor = se.bgcolor || \\\"#00000000\\\";\\r\\n se.node.style.borderTopStyle = \\\"solid\\\";\\r\\n se.node.style.borderTopWidth = pospadpxlen;\\r\\n se.node.style.marginTop = negpadpxlen;\\r\\n\\r\\n }\\r\\n\\r\\n if (context.ipd === \\\"lr\\\") {\\r\\n\\r\\n ee.node.style.borderRightColor = ee.bgcolor || \\\"#00000000\\\";\\r\\n ee.node.style.borderRightStyle = \\\"solid\\\";\\r\\n ee.node.style.borderRightWidth = pospadpxlen;\\r\\n ee.node.style.marginRight = negpadpxlen;\\r\\n\\r\\n } else if (context.ipd === \\\"rl\\\") {\\r\\n\\r\\n ee.node.style.borderLeftColor = ee.bgcolor || \\\"#00000000\\\";\\r\\n ee.node.style.borderLeftStyle = \\\"solid\\\";\\r\\n ee.node.style.borderLeftWidth = pospadpxlen;\\r\\n ee.node.style.marginLeft = negpadpxlen;\\r\\n\\r\\n } else if (context.ipd === \\\"tb\\\") {\\r\\n\\r\\n ee.node.style.borderBottomColor = ee.bgcolor || \\\"#00000000\\\";\\r\\n ee.node.style.borderBottomStyle = \\\"solid\\\";\\r\\n ee.node.style.borderBottomWidth = pospadpxlen;\\r\\n ee.node.style.marginBottom = negpadpxlen;\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n function applyMultiRowAlign(lineList) {\\r\\n\\r\\n /* apply an explicit br to all but the last line */\\r\\n\\r\\n for (var i = 0; i < lineList.length - 1; i++) {\\r\\n\\r\\n var l = lineList[i].elements.length;\\r\\n\\r\\n if (l !== 0 && lineList[i].br === false) {\\r\\n var br = document.createElement(\\\"br\\\");\\r\\n\\r\\n var lastnode = lineList[i].elements[l - 1].node;\\r\\n\\r\\n lastnode.parentElement.insertBefore(br, lastnode.nextSibling);\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n function applyFillLineGap(lineList, par_before, par_after, context) {\\r\\n\\r\\n /* positive for BPD = lr and tb, negative for BPD = rl */\\r\\n var s = Math.sign(par_after - par_before);\\r\\n\\r\\n for (var i = 0; i <= lineList.length; i++) {\\r\\n\\r\\n /* compute frontier between lines */\\r\\n\\r\\n var frontier;\\r\\n\\r\\n if (i === 0) {\\r\\n\\r\\n frontier = par_before;\\r\\n\\r\\n } else if (i === lineList.length) {\\r\\n\\r\\n frontier = par_after;\\r\\n\\r\\n } else {\\r\\n\\r\\n frontier = (lineList[i].before + lineList[i - 1].after) / 2;\\r\\n\\r\\n }\\r\\n\\r\\n /* padding amount */\\r\\n\\r\\n var pad;\\r\\n\\r\\n /* current element */\\r\\n\\r\\n var e;\\r\\n\\r\\n /* before line */\\r\\n\\r\\n if (i > 0) {\\r\\n\\r\\n for (var j = 0; j < lineList[i - 1].elements.length; j++) {\\r\\n\\r\\n if (lineList[i - 1].elements[j].bgcolor === null) continue;\\r\\n\\r\\n e = lineList[i - 1].elements[j];\\r\\n\\r\\n if (s * (e.after - frontier) < 0) {\\r\\n\\r\\n pad = Math.ceil(Math.abs(frontier - e.after)) + \\\"px\\\";\\r\\n\\r\\n e.node.style.backgroundColor = e.bgcolor;\\r\\n\\r\\n if (context.bpd === \\\"lr\\\") {\\r\\n\\r\\n e.node.style.paddingRight = pad;\\r\\n\\r\\n\\r\\n } else if (context.bpd === \\\"rl\\\") {\\r\\n\\r\\n e.node.style.paddingLeft = pad;\\r\\n\\r\\n } else if (context.bpd === \\\"tb\\\") {\\r\\n\\r\\n e.node.style.paddingBottom = pad;\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n /* after line */\\r\\n\\r\\n if (i < lineList.length) {\\r\\n\\r\\n for (var k = 0; k < lineList[i].elements.length; k++) {\\r\\n\\r\\n e = lineList[i].elements[k];\\r\\n\\r\\n if (e.bgcolor === null) continue;\\r\\n\\r\\n if (s * (e.before - frontier) > 0) {\\r\\n\\r\\n pad = Math.ceil(Math.abs(e.before - frontier)) + \\\"px\\\";\\r\\n\\r\\n e.node.style.backgroundColor = e.bgcolor;\\r\\n\\r\\n if (context.bpd === \\\"lr\\\") {\\r\\n\\r\\n e.node.style.paddingLeft = pad;\\r\\n\\r\\n\\r\\n } else if (context.bpd === \\\"rl\\\") {\\r\\n\\r\\n e.node.style.paddingRight = pad;\\r\\n\\r\\n\\r\\n } else if (context.bpd === \\\"tb\\\") {\\r\\n\\r\\n e.node.style.paddingTop = pad;\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n function RegionPBuffer(id, lineList) {\\r\\n\\r\\n this.id = id;\\r\\n\\r\\n this.plist = lineList;\\r\\n\\r\\n }\\r\\n\\r\\n function pruneEmptySpans(element) {\\r\\n\\r\\n var child = element.firstChild;\\r\\n\\r\\n while (child) {\\r\\n\\r\\n var nchild = child.nextSibling;\\r\\n\\r\\n if (child.nodeType === Node.ELEMENT_NODE &&\\r\\n child.localName === 'span') {\\r\\n\\r\\n pruneEmptySpans(child);\\r\\n\\r\\n if (child.childElementCount === 0 &&\\r\\n child.textContent.length === 0) {\\r\\n\\r\\n element.removeChild(child);\\r\\n\\r\\n }\\r\\n }\\r\\n\\r\\n child = nchild;\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n function rect2edges(rect, context) {\\r\\n\\r\\n var edges = {before: null, after: null, start: null, end: null};\\r\\n\\r\\n if (context.bpd === \\\"tb\\\") {\\r\\n\\r\\n edges.before = rect.top;\\r\\n edges.after = rect.bottom;\\r\\n\\r\\n if (context.ipd === \\\"lr\\\") {\\r\\n\\r\\n edges.start = rect.left;\\r\\n edges.end = rect.right;\\r\\n\\r\\n } else {\\r\\n\\r\\n edges.start = rect.right;\\r\\n edges.end = rect.left;\\r\\n }\\r\\n\\r\\n } else if (context.bpd === \\\"lr\\\") {\\r\\n\\r\\n edges.before = rect.left;\\r\\n edges.after = rect.right;\\r\\n edges.start = rect.top;\\r\\n edges.end = rect.bottom;\\r\\n\\r\\n } else if (context.bpd === \\\"rl\\\") {\\r\\n\\r\\n edges.before = rect.right;\\r\\n edges.after = rect.left;\\r\\n edges.start = rect.top;\\r\\n edges.end = rect.bottom;\\r\\n\\r\\n }\\r\\n\\r\\n return edges;\\r\\n\\r\\n }\\r\\n\\r\\n function constructLineList(context, element, llist, bgcolor) {\\r\\n\\r\\n var curbgcolor = element.style.backgroundColor || bgcolor;\\r\\n\\r\\n if (element.childElementCount === 0) {\\r\\n\\r\\n if (element.localName === 'span') {\\r\\n\\r\\n var r = element.getBoundingClientRect();\\r\\n\\r\\n /* skip if span is not displayed */\\r\\n\\r\\n if (r.height === 0 || r.width === 0) return;\\r\\n\\r\\n var edges = rect2edges(r, context);\\r\\n\\r\\n if (llist.length === 0 ||\\r\\n (!isSameLine(edges.before, edges.after, llist[llist.length - 1].before, llist[llist.length - 1].after))\\r\\n ) {\\r\\n\\r\\n llist.push({\\r\\n before: edges.before,\\r\\n after: edges.after,\\r\\n start: edges.start,\\r\\n end: edges.end,\\r\\n start_elem: 0,\\r\\n end_elem: 0,\\r\\n elements: [],\\r\\n text: \\\"\\\",\\r\\n br: false\\r\\n });\\r\\n\\r\\n } else {\\r\\n\\r\\n /* positive for BPD = lr and tb, negative for BPD = rl */\\r\\n var bpd_dir = Math.sign(edges.after - edges.before);\\r\\n\\r\\n /* positive for IPD = lr and tb, negative for IPD = rl */\\r\\n var ipd_dir = Math.sign(edges.end - edges.start);\\r\\n\\r\\n /* check if the line height has increased */\\r\\n\\r\\n if (bpd_dir * (edges.before - llist[llist.length - 1].before) < 0) {\\r\\n llist[llist.length - 1].before = edges.before;\\r\\n }\\r\\n\\r\\n if (bpd_dir * (edges.after - llist[llist.length - 1].after) > 0) {\\r\\n llist[llist.length - 1].after = edges.after;\\r\\n }\\r\\n\\r\\n if (ipd_dir * (edges.start - llist[llist.length - 1].start) < 0) {\\r\\n llist[llist.length - 1].start = edges.start;\\r\\n llist[llist.length - 1].start_elem = llist[llist.length - 1].elements.length;\\r\\n }\\r\\n\\r\\n if (ipd_dir * (edges.end - llist[llist.length - 1].end) > 0) {\\r\\n llist[llist.length - 1].end = edges.end;\\r\\n llist[llist.length - 1].end_elem = llist[llist.length - 1].elements.length;\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n llist[llist.length - 1].text += element.textContent;\\r\\n\\r\\n llist[llist.length - 1].elements.push(\\r\\n {\\r\\n node: element,\\r\\n bgcolor: curbgcolor,\\r\\n before: edges.before,\\r\\n after: edges.after\\r\\n }\\r\\n );\\r\\n\\r\\n } else if (element.localName === 'br' && llist.length !== 0) {\\r\\n\\r\\n llist[llist.length - 1].br = true;\\r\\n\\r\\n }\\r\\n\\r\\n } else {\\r\\n\\r\\n var child = element.firstChild;\\r\\n\\r\\n while (child) {\\r\\n\\r\\n if (child.nodeType === Node.ELEMENT_NODE) {\\r\\n\\r\\n constructLineList(context, child, llist, curbgcolor);\\r\\n\\r\\n }\\r\\n\\r\\n child = child.nextSibling;\\r\\n }\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n function isSameLine(before1, after1, before2, after2) {\\r\\n\\r\\n return ((after1 < after2) && (before1 > before2)) || ((after2 <= after1) && (before2 >= before1));\\r\\n\\r\\n }\\r\\n\\r\\n function HTMLStylingMapDefintion(qName, mapFunc) {\\r\\n this.qname = qName;\\r\\n this.map = mapFunc;\\r\\n }\\r\\n\\r\\n var STYLING_MAP_DEFS = [\\r\\n\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling backgroundColor\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n /* skip if transparent */\\r\\n if (attr[3] === 0) return;\\r\\n\\r\\n dom_element.style.backgroundColor = \\\"rgba(\\\" +\\r\\n attr[0].toString() + \\\",\\\" +\\r\\n attr[1].toString() + \\\",\\\" +\\r\\n attr[2].toString() + \\\",\\\" +\\r\\n (attr[3] / 255).toString() +\\r\\n \\\")\\\";\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling color\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.color = \\\"rgba(\\\" +\\r\\n attr[0].toString() + \\\",\\\" +\\r\\n attr[1].toString() + \\\",\\\" +\\r\\n attr[2].toString() + \\\",\\\" +\\r\\n (attr[3] / 255).toString() +\\r\\n \\\")\\\";\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling direction\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.direction = attr;\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling display\\\",\\r\\n function (context, dom_element, isd_element, attr) {}\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling displayAlign\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n /* see https://css-tricks.com/snippets/css/a-guide-to-flexbox/ */\\r\\n\\r\\n /* TODO: is this affected by writing direction? */\\r\\n\\r\\n dom_element.style.display = \\\"flex\\\";\\r\\n dom_element.style.flexDirection = \\\"column\\\";\\r\\n\\r\\n\\r\\n if (attr === \\\"before\\\") {\\r\\n\\r\\n dom_element.style.justifyContent = \\\"flex-start\\\";\\r\\n\\r\\n } else if (attr === \\\"center\\\") {\\r\\n\\r\\n dom_element.style.justifyContent = \\\"center\\\";\\r\\n\\r\\n } else if (attr === \\\"after\\\") {\\r\\n\\r\\n dom_element.style.justifyContent = \\\"flex-end\\\";\\r\\n }\\r\\n\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling extent\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n /* TODO: this is super ugly */\\r\\n\\r\\n context.regionH = (attr.h * context.h);\\r\\n context.regionW = (attr.w * context.w);\\r\\n\\r\\n /* \\r\\n * CSS height/width are measured against the content rectangle,\\r\\n * whereas TTML height/width include padding\\r\\n */\\r\\n\\r\\n var hdelta = 0;\\r\\n var wdelta = 0;\\r\\n\\r\\n var p = isd_element.styleAttrs[\\\"http://www.w3.org/ns/ttml#styling padding\\\"];\\r\\n\\r\\n if (!p) {\\r\\n\\r\\n /* error */\\r\\n\\r\\n } else {\\r\\n\\r\\n hdelta = (p[0] + p[2]) * context.h;\\r\\n wdelta = (p[1] + p[3]) * context.w;\\r\\n\\r\\n }\\r\\n\\r\\n dom_element.style.height = (context.regionH - hdelta) + \\\"px\\\";\\r\\n dom_element.style.width = (context.regionW - wdelta) + \\\"px\\\";\\r\\n\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling fontFamily\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n var rslt = [];\\r\\n\\r\\n /* per IMSC1 */\\r\\n\\r\\n for (var i in attr) {\\r\\n\\r\\n if (attr[i] === \\\"monospaceSerif\\\") {\\r\\n\\r\\n rslt.push(\\\"Courier New\\\");\\r\\n rslt.push('\\\"Liberation Mono\\\"');\\r\\n rslt.push(\\\"Courier\\\");\\r\\n rslt.push(\\\"monospace\\\");\\r\\n\\r\\n } else if (attr[i] === \\\"proportionalSansSerif\\\") {\\r\\n\\r\\n rslt.push(\\\"Arial\\\");\\r\\n rslt.push(\\\"Helvetica\\\");\\r\\n rslt.push('\\\"Liberation Sans\\\"');\\r\\n rslt.push(\\\"sans-serif\\\");\\r\\n\\r\\n } else if (attr[i] === \\\"monospace\\\") {\\r\\n\\r\\n rslt.push(\\\"monospace\\\");\\r\\n\\r\\n } else if (attr[i] === \\\"sansSerif\\\") {\\r\\n\\r\\n rslt.push(\\\"sans-serif\\\");\\r\\n\\r\\n } else if (attr[i] === \\\"serif\\\") {\\r\\n\\r\\n rslt.push(\\\"serif\\\");\\r\\n\\r\\n } else if (attr[i] === \\\"monospaceSansSerif\\\") {\\r\\n\\r\\n rslt.push(\\\"Consolas\\\");\\r\\n rslt.push(\\\"monospace\\\");\\r\\n\\r\\n } else if (attr[i] === \\\"proportionalSerif\\\") {\\r\\n\\r\\n rslt.push(\\\"serif\\\");\\r\\n\\r\\n } else {\\r\\n\\r\\n rslt.push(attr[i]);\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n dom_element.style.fontFamily = rslt.join(\\\",\\\");\\r\\n }\\r\\n ),\\r\\n\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling fontSize\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.fontSize = (attr * context.h) + \\\"px\\\";\\r\\n }\\r\\n ),\\r\\n\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling fontStyle\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.fontStyle = attr;\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling fontWeight\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.fontWeight = attr;\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling lineHeight\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n if (attr === \\\"normal\\\") {\\r\\n\\r\\n dom_element.style.lineHeight = \\\"normal\\\";\\r\\n\\r\\n } else {\\r\\n\\r\\n dom_element.style.lineHeight = (attr * context.h) + \\\"px\\\";\\r\\n }\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling opacity\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.opacity = attr;\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling origin\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.top = (attr.h * context.h) + \\\"px\\\";\\r\\n dom_element.style.left = (attr.w * context.w) + \\\"px\\\";\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling overflow\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.overflow = attr;\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling padding\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n /* attr: top,left,bottom,right*/\\r\\n\\r\\n /* style: top right bottom left*/\\r\\n\\r\\n var rslt = [];\\r\\n\\r\\n rslt[0] = (attr[0] * context.h) + \\\"px\\\";\\r\\n rslt[1] = (attr[3] * context.w) + \\\"px\\\";\\r\\n rslt[2] = (attr[2] * context.h) + \\\"px\\\";\\r\\n rslt[3] = (attr[1] * context.w) + \\\"px\\\";\\r\\n\\r\\n dom_element.style.padding = rslt.join(\\\" \\\");\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling showBackground\\\",\\r\\n null\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling textAlign\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n var ta;\\r\\n var dir = isd_element.styleAttrs[imscStyles.byName.direction.qname];\\r\\n\\r\\n /* handle UAs that do not understand start or end */\\r\\n\\r\\n if (attr === \\\"start\\\") {\\r\\n\\r\\n ta = (dir === \\\"rtl\\\") ? \\\"right\\\" : \\\"left\\\";\\r\\n\\r\\n } else if (attr === \\\"end\\\") {\\r\\n\\r\\n ta = (dir === \\\"rtl\\\") ? \\\"left\\\" : \\\"right\\\";\\r\\n\\r\\n } else {\\r\\n\\r\\n ta = attr;\\r\\n\\r\\n }\\r\\n\\r\\n dom_element.style.textAlign = ta;\\r\\n\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling textDecoration\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.textDecoration = attr.join(\\\" \\\").replace(\\\"lineThrough\\\", \\\"line-through\\\");\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling textOutline\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n if (attr === \\\"none\\\") {\\r\\n\\r\\n dom_element.style.textShadow = \\\"\\\";\\r\\n\\r\\n } else {\\r\\n\\r\\n dom_element.style.textShadow = \\\"rgba(\\\" +\\r\\n attr.color[0].toString() + \\\",\\\" +\\r\\n attr.color[1].toString() + \\\",\\\" +\\r\\n attr.color[2].toString() + \\\",\\\" +\\r\\n (attr.color[3] / 255).toString() +\\r\\n \\\")\\\" + \\\" 0px 0px \\\" +\\r\\n (attr.thickness * context.h) + \\\"px\\\";\\r\\n\\r\\n }\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling unicodeBidi\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n var ub;\\r\\n\\r\\n if (attr === 'bidiOverride') {\\r\\n ub = \\\"bidi-override\\\";\\r\\n } else {\\r\\n ub = attr;\\r\\n }\\r\\n\\r\\n dom_element.style.unicodeBidi = ub;\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling visibility\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.visibility = attr;\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling wrapOption\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n if (attr === \\\"wrap\\\") {\\r\\n\\r\\n if (isd_element.space === \\\"preserve\\\") {\\r\\n dom_element.style.whiteSpace = \\\"pre-wrap\\\";\\r\\n } else {\\r\\n dom_element.style.whiteSpace = \\\"normal\\\";\\r\\n }\\r\\n\\r\\n } else {\\r\\n\\r\\n if (isd_element.space === \\\"preserve\\\") {\\r\\n\\r\\n dom_element.style.whiteSpace = \\\"pre\\\";\\r\\n\\r\\n } else {\\r\\n dom_element.style.whiteSpace = \\\"noWrap\\\";\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling writingMode\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n if (attr === \\\"lrtb\\\" || attr === \\\"lr\\\") {\\r\\n\\r\\n dom_element.style.writingMode = \\\"horizontal-tb\\\";\\r\\n\\r\\n } else if (attr === \\\"rltb\\\" || attr === \\\"rl\\\") {\\r\\n\\r\\n dom_element.style.writingMode = \\\"horizontal-tb\\\";\\r\\n\\r\\n } else if (attr === \\\"tblr\\\") {\\r\\n\\r\\n dom_element.style.writingMode = \\\"vertical-lr\\\";\\r\\n\\r\\n } else if (attr === \\\"tbrl\\\" || attr === \\\"tb\\\") {\\r\\n\\r\\n dom_element.style.writingMode = \\\"vertical-rl\\\";\\r\\n\\r\\n }\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml#styling zIndex\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n dom_element.style.zIndex = attr;\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt backgroundImage\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n if (context.imgResolver !== null && attr !== null) {\\r\\n\\r\\n var img = document.createElement(\\\"img\\\");\\r\\n\\r\\n var uri = context.imgResolver(attr, img);\\r\\n\\r\\n if (uri)\\r\\n img.src = uri;\\r\\n\\r\\n img.height = context.regionH;\\r\\n img.width = context.regionW;\\r\\n\\r\\n dom_element.appendChild(img);\\r\\n }\\r\\n }\\r\\n ),\\r\\n new HTMLStylingMapDefintion(\\r\\n \\\"http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay\\\",\\r\\n function (context, dom_element, isd_element, attr) {\\r\\n\\r\\n if (context.displayForcedOnlyMode && attr === false) {\\r\\n dom_element.style.visibility = \\\"hidden\\\";\\r\\n }\\r\\n\\r\\n }\\r\\n )\\r\\n ];\\r\\n\\r\\n var STYLMAP_BY_QNAME = {};\\r\\n\\r\\n for (var i in STYLING_MAP_DEFS) {\\r\\n\\r\\n STYLMAP_BY_QNAME[STYLING_MAP_DEFS[i].qname] = STYLING_MAP_DEFS[i];\\r\\n }\\r\\n\\r\\n function reportError(errorHandler, msg) {\\r\\n\\r\\n if (errorHandler && errorHandler.error && errorHandler.error(msg))\\r\\n throw msg;\\r\\n\\r\\n }\\r\\n\\r\\n})( false ? undefined : exports,\\r\\n typeof imscNames === 'undefined' ? __webpack_require__(/*! ./names */ \\\"./node_modules/imsc/src/main/js/names.js\\\") : imscNames,\\r\\n typeof imscStyles === 'undefined' ? __webpack_require__(/*! ./styles */ \\\"./node_modules/imsc/src/main/js/styles.js\\\") : imscStyles);\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/imsc/src/main/js/isd.js\\\":\\n/*!**********************************************!*\\\\\\n !*** ./node_modules/imsc/src/main/js/isd.js ***!\\n \\\\**********************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* \\r\\n * Copyright (c) 2016, Pierre-Anthony Lemieux \\r\\n * All rights reserved.\\r\\n *\\r\\n * Redistribution and use in source and binary forms, with or without\\r\\n * modification, are permitted provided that the following conditions are met:\\r\\n *\\r\\n * * Redistributions of source code must retain the above copyright notice, this\\r\\n * list of conditions and the following disclaimer.\\r\\n * * Redistributions in binary form must reproduce the above copyright notice,\\r\\n * this list of conditions and the following disclaimer in the documentation\\r\\n * and/or other materials provided with the distribution.\\r\\n *\\r\\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\r\\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\r\\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\\r\\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\\r\\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\\r\\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\\r\\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\\r\\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\\r\\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\\r\\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\\r\\n * POSSIBILITY OF SUCH DAMAGE.\\r\\n */\\r\\n\\r\\n/**\\r\\n * @module imscISD\\r\\n */\\r\\n\\r\\n\\r\\n;\\r\\n(function (imscISD, imscNames, imscStyles) { // wrapper for non-node envs\\r\\n\\r\\n /** \\r\\n * Creates a canonical representation of an IMSC1 document returned by imscDoc.fromXML()
\\r\\n * at a given absolute offset in seconds. This offset does not have to be one of the values returned\\r\\n * by getMediaTimeEvents()
.\\r\\n * \\r\\n * @param {Object} tt IMSC1 document\\r\\n * @param {number} offset Absolute offset (in seconds)\\r\\n * @param {?module:imscUtils.ErrorHandler} errorHandler Error callback\\r\\n * @returns {Object} Opaque in-memory representation of an ISD\\r\\n */\\r\\n\\r\\n imscISD.generateISD = function (tt, offset, errorHandler) {\\r\\n\\r\\n /* TODO check for tt and offset validity */\\r\\n\\r\\n /* create the ISD object from the IMSC1 doc */\\r\\n\\r\\n var isd = new ISD(tt);\\r\\n \\r\\n /* context */\\r\\n \\r\\n var context = {\\r\\n \\r\\n /* empty for now */\\r\\n \\r\\n };\\r\\n\\r\\n /* process regions */\\r\\n\\r\\n for (var r in tt.head.layout.regions) {\\r\\n\\r\\n /* post-order traversal of the body tree per [construct intermediate document] */\\r\\n\\r\\n var c = isdProcessContentElement(tt, offset, tt.head.layout.regions[r], tt.body, null, '', tt.head.layout.regions[r], errorHandler, context);\\r\\n\\r\\n if (c !== null) {\\r\\n\\r\\n /* add the region to the ISD */\\r\\n\\r\\n isd.contents.push(c.element);\\r\\n }\\r\\n\\r\\n\\r\\n }\\r\\n\\r\\n return isd;\\r\\n };\\r\\n\\r\\n function isdProcessContentElement(doc, offset, region, body, parent, inherited_region_id, elem, errorHandler, context) {\\r\\n\\r\\n /* prune if temporally inactive */\\r\\n\\r\\n if (offset < elem.begin || offset >= elem.end) {\\r\\n return null;\\r\\n }\\r\\n\\r\\n /* \\r\\n * set the associated region as specified by the regionID attribute, or the \\r\\n * inherited associated region otherwise\\r\\n */\\r\\n\\r\\n var associated_region_id = 'regionID' in elem && elem.regionID !== '' ? elem.regionID : inherited_region_id;\\r\\n\\r\\n /* prune the element if either:\\r\\n * - the element is not terminal and the associated region is neither the default\\r\\n * region nor the parent region (this allows children to be associated with a \\r\\n * region later on)\\r\\n * - the element is terminal and the associated region is not the parent region\\r\\n */\\r\\n \\r\\n /* TODO: improve detection of terminal elements since has no contents */\\r\\n\\r\\n if (parent !== null /* are we in the region element */ &&\\r\\n associated_region_id !== region.id &&\\r\\n (\\r\\n (! ('contents' in elem)) ||\\r\\n ('contents' in elem && elem.contents.length === 0) ||\\r\\n associated_region_id !== ''\\r\\n )\\r\\n )\\r\\n return null;\\r\\n\\r\\n /* create an ISD element, including applying specified styles */\\r\\n\\r\\n var isd_element = new ISDContentElement(elem);\\r\\n\\r\\n /* apply set (animation) styling */\\r\\n\\r\\n for (var i in elem.sets) {\\r\\n\\r\\n if (offset < elem.sets[i].begin || offset >= elem.sets[i].end)\\r\\n continue;\\r\\n\\r\\n isd_element.styleAttrs[elem.sets[i].qname] = elem.sets[i].value;\\r\\n\\r\\n }\\r\\n\\r\\n /* \\r\\n * keep track of specified styling attributes so that we\\r\\n * can compute them later\\r\\n */\\r\\n\\r\\n var spec_attr = {};\\r\\n\\r\\n for (var qname in isd_element.styleAttrs) {\\r\\n\\r\\n spec_attr[qname] = true;\\r\\n\\r\\n /* special rule for tts:writingMode (section 7.29.1 of XSL)\\r\\n * direction is set consistently with writingMode only\\r\\n * if writingMode sets inline-direction to LTR or RTL \\r\\n */\\r\\n\\r\\n if (qname === imscStyles.byName.writingMode.qname &&\\r\\n !(imscStyles.byName.direction.qname in isd_element.styleAttrs)) {\\r\\n\\r\\n var wm = isd_element.styleAttrs[qname];\\r\\n\\r\\n if (wm === \\\"lrtb\\\" || wm === \\\"lr\\\") {\\r\\n\\r\\n isd_element.styleAttrs[imscStyles.byName.direction.qname] = \\\"ltr\\\";\\r\\n\\r\\n } else if (wm === \\\"rltb\\\" || wm === \\\"rl\\\") {\\r\\n\\r\\n isd_element.styleAttrs[imscStyles.byName.direction.qname] = \\\"rtl\\\";\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n }\\r\\n\\r\\n /* inherited styling */\\r\\n\\r\\n if (parent !== null) {\\r\\n\\r\\n for (var j in imscStyles.all) {\\r\\n\\r\\n var sa = imscStyles.all[j];\\r\\n\\r\\n /* textDecoration has special inheritance rules */\\r\\n\\r\\n if (sa.qname === imscStyles.byName.textDecoration.qname) {\\r\\n\\r\\n /* handle both textDecoration inheritance and specification */\\r\\n\\r\\n var ps = parent.styleAttrs[sa.qname];\\r\\n var es = isd_element.styleAttrs[sa.qname];\\r\\n var outs = [];\\r\\n\\r\\n if (es === undefined) {\\r\\n\\r\\n outs = ps;\\r\\n\\r\\n } else if (es.indexOf(\\\"none\\\") === -1) {\\r\\n\\r\\n if ((es.indexOf(\\\"noUnderline\\\") === -1 &&\\r\\n ps.indexOf(\\\"underline\\\") !== -1) ||\\r\\n es.indexOf(\\\"underline\\\") !== -1) {\\r\\n\\r\\n outs.push(\\\"underline\\\");\\r\\n\\r\\n }\\r\\n\\r\\n if ((es.indexOf(\\\"noLineThrough\\\") === -1 &&\\r\\n ps.indexOf(\\\"lineThrough\\\") !== -1) ||\\r\\n es.indexOf(\\\"lineThrough\\\") !== -1) {\\r\\n\\r\\n outs.push(\\\"lineThrough\\\");\\r\\n\\r\\n }\\r\\n\\r\\n if ((es.indexOf(\\\"noOverline\\\") === -1 &&\\r\\n ps.indexOf(\\\"overline\\\") !== -1) ||\\r\\n es.indexOf(\\\"overline\\\") !== -1) {\\r\\n\\r\\n outs.push(\\\"overline\\\");\\r\\n\\r\\n }\\r\\n\\r\\n } else {\\r\\n\\r\\n outs.push(\\\"none\\\");\\r\\n\\r\\n }\\r\\n\\r\\n isd_element.styleAttrs[sa.qname] = outs;\\r\\n\\r\\n } else if (sa.inherit &&\\r\\n (sa.qname in parent.styleAttrs) &&\\r\\n !(sa.qname in isd_element.styleAttrs)) {\\r\\n\\r\\n isd_element.styleAttrs[sa.qname] = parent.styleAttrs[sa.qname];\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n /* initial value styling */\\r\\n\\r\\n for (var k in imscStyles.all) {\\r\\n\\r\\n var ivs = imscStyles.all[k];\\r\\n\\r\\n /* skip if value is already specified */\\r\\n\\r\\n if (ivs.qname in isd_element.styleAttrs) continue;\\r\\n\\r\\n /* apply initial value to elements other than region only if non-inherited */\\r\\n\\r\\n if (isd_element.kind === 'region' || (ivs.inherit === false && ivs.initial !== null)) {\\r\\n\\r\\n isd_element.styleAttrs[ivs.qname] = ivs.parse(ivs.initial);\\r\\n\\r\\n /* keep track of the style as specified */\\r\\n\\r\\n spec_attr[ivs.qname] = true;\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n /* compute styles (only for non-inherited styles) */\\r\\n /* TODO: get rid of spec_attr */\\r\\n\\r\\n for (var z in imscStyles.all) {\\r\\n\\r\\n var cs = imscStyles.all[z];\\r\\n\\r\\n if (!(cs.qname in spec_attr)) continue;\\r\\n\\r\\n if (cs.compute !== null) {\\r\\n\\r\\n var cstyle = cs.compute(\\r\\n /*doc, parent, element, attr, context*/\\r\\n doc,\\r\\n parent,\\r\\n isd_element,\\r\\n isd_element.styleAttrs[cs.qname],\\r\\n context\\r\\n );\\r\\n\\r\\n if (cstyle !== null) {\\r\\n isd_element.styleAttrs[cs.qname] = cstyle;\\r\\n } else {\\r\\n reportError(errorHandler, \\\"Style '\\\" + cs.qname + \\\"' on element '\\\" + isd_element.kind + \\\"' cannot be computed\\\");\\r\\n }\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n /* prune if tts:display is none */\\r\\n\\r\\n if (isd_element.styleAttrs[imscStyles.byName.display.qname] === \\\"none\\\")\\r\\n return null;\\r\\n\\r\\n /* process contents of the element */\\r\\n\\r\\n var contents;\\r\\n\\r\\n if (parent === null) {\\r\\n\\r\\n /* we are processing the region */\\r\\n\\r\\n if (body === null) {\\r\\n\\r\\n /* if there is no body, still process the region but with empty content */\\r\\n\\r\\n contents = [];\\r\\n\\r\\n } else {\\r\\n\\r\\n /*use the body element as contents */\\r\\n\\r\\n contents = [body];\\r\\n\\r\\n }\\r\\n\\r\\n } else if ('contents' in elem) {\\r\\n\\r\\n contents = elem.contents;\\r\\n\\r\\n }\\r\\n\\r\\n for (var x in contents) {\\r\\n\\r\\n var c = isdProcessContentElement(doc, offset, region, body, isd_element, associated_region_id, contents[x], errorHandler, context);\\r\\n\\r\\n /* \\r\\n * keep child element only if they are non-null and their region match \\r\\n * the region of this element\\r\\n */\\r\\n\\r\\n if (c !== null) {\\r\\n\\r\\n isd_element.contents.push(c.element);\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n /* compute used value of lineHeight=\\\"normal\\\" */\\r\\n\\r\\n /* if (isd_element.styleAttrs[imscStyles.byName.lineHeight.qname] === \\\"normal\\\" ) {\\r\\n \\r\\n isd_element.styleAttrs[imscStyles.byName.lineHeight.qname] =\\r\\n isd_element.styleAttrs[imscStyles.byName.fontSize.qname] * 1.2;\\r\\n \\r\\n }\\r\\n */\\r\\n\\r\\n /* remove styles that are not applicable */\\r\\n\\r\\n for (var qnameb in isd_element.styleAttrs) {\\r\\n var da = imscStyles.byQName[qnameb];\\r\\n\\r\\n if (da.applies.indexOf(isd_element.kind) === -1) {\\r\\n delete isd_element.styleAttrs[qnameb];\\r\\n }\\r\\n }\\r\\n\\r\\n /* collapse white space if space is \\\"default\\\" */\\r\\n\\r\\n if (isd_element.kind === 'span' && isd_element.text && isd_element.space === \\\"default\\\") {\\r\\n\\r\\n var trimmedspan = isd_element.text.replace(/\\\\s+/g, ' ');\\r\\n\\r\\n isd_element.text = trimmedspan;\\r\\n\\r\\n }\\r\\n\\r\\n /* trim whitespace around explicit line breaks */\\r\\n\\r\\n if (isd_element.kind === 'p') {\\r\\n\\r\\n var elist = [];\\r\\n\\r\\n constructSpanList(isd_element, elist);\\r\\n\\r\\n var l = 0;\\r\\n\\r\\n var state = \\\"after_br\\\";\\r\\n var br_pos = 0;\\r\\n\\r\\n while (true) {\\r\\n\\r\\n if (state === \\\"after_br\\\") {\\r\\n\\r\\n if (l >= elist.length || elist[l].kind === \\\"br\\\") {\\r\\n\\r\\n state = \\\"before_br\\\";\\r\\n br_pos = l;\\r\\n l--;\\r\\n\\r\\n } else {\\r\\n\\r\\n if (elist[l].space !== \\\"preserve\\\") {\\r\\n\\r\\n elist[l].text = elist[l].text.replace(/^\\\\s+/g, '');\\r\\n\\r\\n }\\r\\n\\r\\n if (elist[l].text.length > 0) {\\r\\n\\r\\n state = \\\"looking_br\\\";\\r\\n l++;\\r\\n\\r\\n } else {\\r\\n\\r\\n elist.splice(l, 1);\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n } else if (state === \\\"before_br\\\") {\\r\\n\\r\\n if (l < 0 || elist[l].kind === \\\"br\\\") {\\r\\n\\r\\n state = \\\"after_br\\\";\\r\\n l = br_pos + 1;\\r\\n\\r\\n if (l >= elist.length) break;\\r\\n\\r\\n } else {\\r\\n\\r\\n if (elist[l].space !== \\\"preserve\\\") {\\r\\n\\r\\n elist[l].text = elist[l].text.replace(/\\\\s+$/g, '');\\r\\n\\r\\n }\\r\\n\\r\\n if (elist[l].text.length > 0) {\\r\\n\\r\\n state = \\\"after_br\\\";\\r\\n l = br_pos + 1;\\r\\n\\r\\n if (l >= elist.length) break;\\r\\n\\r\\n } else {\\r\\n\\r\\n elist.splice(l, 1);\\r\\n l--;\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n } else {\\r\\n\\r\\n if (l >= elist.length || elist[l].kind === \\\"br\\\") {\\r\\n\\r\\n state = \\\"before_br\\\";\\r\\n br_pos = l;\\r\\n l--;\\r\\n\\r\\n } else {\\r\\n\\r\\n l++;\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n \\r\\n pruneEmptySpans(isd_element);\\r\\n\\r\\n }\\r\\n\\r\\n /* keep element if:\\r\\n * * contains a background image\\r\\n * *
\\r\\n * * if there are children\\r\\n * * if and has text\\r\\n * * if region and showBackground = always\\r\\n */\\r\\n\\r\\n if ((isd_element.kind === 'div' && imscStyles.byName.backgroundImage.qname in isd_element.styleAttrs) ||\\r\\n isd_element.kind === 'br' ||\\r\\n ('contents' in isd_element && isd_element.contents.length > 0) ||\\r\\n (isd_element.kind === 'span' && isd_element.text !== null) ||\\r\\n (isd_element.kind === 'region' &&\\r\\n isd_element.styleAttrs[imscStyles.byName.showBackground.qname] === 'always')) {\\r\\n\\r\\n return {\\r\\n region_id: associated_region_id,\\r\\n element: isd_element\\r\\n };\\r\\n }\\r\\n\\r\\n return null;\\r\\n }\\r\\n\\r\\n function constructSpanList(element, elist) {\\r\\n\\r\\n if ('contents' in element) {\\r\\n\\r\\n for (var i in element.contents) {\\r\\n constructSpanList(element.contents[i], elist);\\r\\n }\\r\\n\\r\\n } else {\\r\\n\\r\\n elist.push(element);\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n function pruneEmptySpans(element) {\\r\\n\\r\\n if (element.kind === 'br') {\\r\\n \\r\\n return false;\\r\\n \\r\\n } else if ('text' in element) {\\r\\n \\r\\n return element.text.length === 0;\\r\\n \\r\\n } else if ('contents' in element) {\\r\\n \\r\\n var i = element.contents.length;\\r\\n\\r\\n while (i--) {\\r\\n \\r\\n if (pruneEmptySpans(element.contents[i])) {\\r\\n element.contents.splice(i, 1);\\r\\n }\\r\\n \\r\\n }\\r\\n \\r\\n return element.contents.length === 0;\\r\\n\\r\\n }\\r\\n }\\r\\n\\r\\n function ISD(tt) {\\r\\n this.contents = [];\\r\\n this.aspectRatio = tt.aspectRatio;\\r\\n }\\r\\n\\r\\n function ISDContentElement(ttelem) {\\r\\n\\r\\n /* assume the element is a region if it does not have a kind */\\r\\n\\r\\n this.kind = ttelem.kind || 'region';\\r\\n \\r\\n /* copy id */\\r\\n \\r\\n if (ttelem.id) {\\r\\n this.id = ttelem.id;\\r\\n }\\r\\n\\r\\n /* deep copy of style attributes */\\r\\n this.styleAttrs = {};\\r\\n\\r\\n for (var sname in ttelem.styleAttrs) {\\r\\n\\r\\n this.styleAttrs[sname] =\\r\\n ttelem.styleAttrs[sname];\\r\\n }\\r\\n\\r\\n /* TODO: clean this! */\\r\\n\\r\\n if ('text' in ttelem) {\\r\\n\\r\\n this.text = ttelem.text;\\r\\n\\r\\n } else if (ttelem.kind !== 'br') {\\r\\n \\r\\n this.contents = [];\\r\\n }\\r\\n\\r\\n if ('space' in ttelem) {\\r\\n\\r\\n this.space = ttelem.space;\\r\\n }\\r\\n }\\r\\n\\r\\n\\r\\n /*\\r\\n * ERROR HANDLING UTILITY FUNCTIONS\\r\\n * \\r\\n */\\r\\n\\r\\n function reportInfo(errorHandler, msg) {\\r\\n\\r\\n if (errorHandler && errorHandler.info && errorHandler.info(msg))\\r\\n throw msg;\\r\\n\\r\\n }\\r\\n\\r\\n function reportWarning(errorHandler, msg) {\\r\\n\\r\\n if (errorHandler && errorHandler.warn && errorHandler.warn(msg))\\r\\n throw msg;\\r\\n\\r\\n }\\r\\n\\r\\n function reportError(errorHandler, msg) {\\r\\n\\r\\n if (errorHandler && errorHandler.error && errorHandler.error(msg))\\r\\n throw msg;\\r\\n\\r\\n }\\r\\n\\r\\n function reportFatal(errorHandler, msg) {\\r\\n\\r\\n if (errorHandler && errorHandler.fatal)\\r\\n errorHandler.fatal(msg);\\r\\n\\r\\n throw msg;\\r\\n\\r\\n }\\r\\n\\r\\n\\r\\n})( false ? undefined : exports,\\r\\n typeof imscNames === 'undefined' ? __webpack_require__(/*! ./names */ \\\"./node_modules/imsc/src/main/js/names.js\\\") : imscNames,\\r\\n typeof imscStyles === 'undefined' ? __webpack_require__(/*! ./styles */ \\\"./node_modules/imsc/src/main/js/styles.js\\\") : imscStyles\\r\\n );\\r\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/imsc/src/main/js/main.js\\\":\\n/*!***********************************************!*\\\\\\n !*** ./node_modules/imsc/src/main/js/main.js ***!\\n \\\\***********************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* \\r\\n * Copyright (c) 2016, Pierre-Anthony Lemieux \\r\\n * All rights reserved.\\r\\n *\\r\\n * Redistribution and use in source and binary forms, with or without\\r\\n * modification, are permitted provided that the following conditions are met:\\r\\n *\\r\\n * * Redistributions of source code must retain the above copyright notice, this\\r\\n * list of conditions and the following disclaimer.\\r\\n * * Redistributions in binary form must reproduce the above copyright notice,\\r\\n * this list of conditions and the following disclaimer in the documentation\\r\\n * and/or other materials provided with the distribution.\\r\\n *\\r\\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\r\\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\r\\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\\r\\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\\r\\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\\r\\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\\r\\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\\r\\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\\r\\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\\r\\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\\r\\n * POSSIBILITY OF SUCH DAMAGE.\\r\\n */\\r\\n\\r\\nexports.generateISD = __webpack_require__(/*! ./isd */ \\\"./node_modules/imsc/src/main/js/isd.js\\\").generateISD;\\r\\nexports.fromXML = __webpack_require__(/*! ./doc */ \\\"./node_modules/imsc/src/main/js/doc.js\\\").fromXML;\\r\\nexports.renderHTML = __webpack_require__(/*! ./html */ \\\"./node_modules/imsc/src/main/js/html.js\\\").render;\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/imsc/src/main/js/names.js\\\":\\n/*!************************************************!*\\\\\\n !*** ./node_modules/imsc/src/main/js/names.js ***!\\n \\\\************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* \\r\\n * Copyright (c) 2016, Pierre-Anthony Lemieux \\r\\n * All rights reserved.\\r\\n *\\r\\n * Redistribution and use in source and binary forms, with or without\\r\\n * modification, are permitted provided that the following conditions are met:\\r\\n *\\r\\n * * Redistributions of source code must retain the above copyright notice, this\\r\\n * list of conditions and the following disclaimer.\\r\\n * * Redistributions in binary form must reproduce the above copyright notice,\\r\\n * this list of conditions and the following disclaimer in the documentation\\r\\n * and/or other materials provided with the distribution.\\r\\n *\\r\\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\r\\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\r\\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\\r\\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\\r\\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\\r\\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\\r\\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\\r\\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\\r\\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\\r\\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\\r\\n * POSSIBILITY OF SUCH DAMAGE.\\r\\n */\\r\\n\\r\\n/**\\r\\n * @module imscNames\\r\\n */\\r\\n\\r\\n;\\r\\n(function (imscNames) { // wrapper for non-node envs\\r\\n\\r\\n imscNames.ns_tt = \\\"http://www.w3.org/ns/ttml\\\";\\r\\n imscNames.ns_tts = \\\"http://www.w3.org/ns/ttml#styling\\\";\\r\\n imscNames.ns_ttp = \\\"http://www.w3.org/ns/ttml#parameter\\\";\\r\\n imscNames.ns_xml = \\\"http://www.w3.org/XML/1998/namespace\\\";\\r\\n imscNames.ns_itts = \\\"http://www.w3.org/ns/ttml/profile/imsc1#styling\\\";\\r\\n imscNames.ns_ittp = \\\"http://www.w3.org/ns/ttml/profile/imsc1#parameter\\\";\\r\\n imscNames.ns_smpte = \\\"http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt\\\";\\r\\n imscNames.ns_ebutts = \\\"urn:ebu:tt:style\\\";\\r\\n \\r\\n})( false ? undefined : exports);\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/imsc/src/main/js/styles.js\\\":\\n/*!*************************************************!*\\\\\\n !*** ./node_modules/imsc/src/main/js/styles.js ***!\\n \\\\*************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* \\r\\n * Copyright (c) 2016, Pierre-Anthony Lemieux \\r\\n * All rights reserved.\\r\\n *\\r\\n * Redistribution and use in source and binary forms, with or without\\r\\n * modification, are permitted provided that the following conditions are met:\\r\\n *\\r\\n * * Redistributions of source code must retain the above copyright notice, this\\r\\n * list of conditions and the following disclaimer.\\r\\n * * Redistributions in binary form must reproduce the above copyright notice,\\r\\n * this list of conditions and the following disclaimer in the documentation\\r\\n * and/or other materials provided with the distribution.\\r\\n *\\r\\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\r\\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\r\\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\\r\\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\\r\\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\\r\\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\\r\\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\\r\\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\\r\\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\\r\\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\\r\\n * POSSIBILITY OF SUCH DAMAGE.\\r\\n */\\r\\n\\r\\n/**\\r\\n * @module imscStyles\\r\\n */\\r\\n\\r\\n;\\r\\n(function (imscStyles, imscNames, imscUtils) { // wrapper for non-node envs\\r\\n\\r\\n function StylingAttributeDefinition(ns, name, initialValue, appliesTo, isInherit, isAnimatable, parseFunc, computeFunc) {\\r\\n this.name = name;\\r\\n this.ns = ns;\\r\\n this.qname = ns + \\\" \\\" + name;\\r\\n this.inherit = isInherit;\\r\\n this.animatable = isAnimatable;\\r\\n this.initial = initialValue;\\r\\n this.applies = appliesTo;\\r\\n this.parse = parseFunc;\\r\\n this.compute = computeFunc;\\r\\n }\\r\\n\\r\\n imscStyles.all = [\\r\\n\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"backgroundColor\\\",\\r\\n \\\"transparent\\\",\\r\\n ['body', 'div', 'p', 'region', 'span'],\\r\\n false,\\r\\n true,\\r\\n imscUtils.parseColor,\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"color\\\",\\r\\n \\\"white\\\",\\r\\n ['span'],\\r\\n true,\\r\\n true,\\r\\n imscUtils.parseColor,\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"direction\\\",\\r\\n \\\"ltr\\\",\\r\\n ['p', 'span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"display\\\",\\r\\n \\\"auto\\\",\\r\\n ['body', 'div', 'p', 'region', 'span'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"displayAlign\\\",\\r\\n \\\"before\\\",\\r\\n ['region'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"extent\\\",\\r\\n \\\"auto\\\",\\r\\n ['tt', 'region'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n\\r\\n if (str === \\\"auto\\\") {\\r\\n\\r\\n return str;\\r\\n\\r\\n } else {\\r\\n\\r\\n var s = str.split(\\\" \\\");\\r\\n if (s.length !== 2) return null;\\r\\n var w = imscUtils.parseLength(s[0]);\\r\\n var h = imscUtils.parseLength(s[1]);\\r\\n if (!h || !w) return null;\\r\\n return {'h': h, 'w': w};\\r\\n }\\r\\n\\r\\n },\\r\\n function (doc, parent, element, attr, context) {\\r\\n\\r\\n var h;\\r\\n var w;\\r\\n\\r\\n if (attr === \\\"auto\\\") {\\r\\n\\r\\n h = 1;\\r\\n\\r\\n } else if (attr.h.unit === \\\"%\\\") {\\r\\n\\r\\n h = attr.h.value / 100;\\r\\n\\r\\n } else if (attr.h.unit === \\\"px\\\") {\\r\\n\\r\\n h = attr.h.value / doc.pxDimensions.h;\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n if (attr === \\\"auto\\\") {\\r\\n\\r\\n w = 1;\\r\\n\\r\\n } else if (attr.w.unit === \\\"%\\\") {\\r\\n\\r\\n w = attr.w.value / 100;\\r\\n\\r\\n } else if (attr.w.unit === \\\"px\\\") {\\r\\n\\r\\n w = attr.w.value / doc.pxDimensions.w;\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n return {'h': h, 'w': w};\\r\\n }\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"fontFamily\\\",\\r\\n \\\"default\\\",\\r\\n ['span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n var ffs = str.split(\\\",\\\");\\r\\n var rslt = [];\\r\\n\\r\\n for (var i in ffs) {\\r\\n\\r\\n if (ffs[i].charAt(0) !== \\\"'\\\" && ffs[i].charAt(0) !== '\\\"') {\\r\\n\\r\\n if (ffs[i] === \\\"default\\\") {\\r\\n\\r\\n /* per IMSC1 */\\r\\n\\r\\n rslt.push(\\\"monospaceSerif\\\");\\r\\n\\r\\n } else {\\r\\n\\r\\n rslt.push(ffs[i]);\\r\\n\\r\\n }\\r\\n\\r\\n } else {\\r\\n\\r\\n rslt.push(ffs[i]);\\r\\n\\r\\n }\\r\\n\\r\\n }\\r\\n\\r\\n return rslt;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"fontSize\\\",\\r\\n \\\"1c\\\",\\r\\n ['span'],\\r\\n true,\\r\\n true,\\r\\n imscUtils.parseLength,\\r\\n function (doc, parent, element, attr, context) {\\r\\n\\r\\n var fs;\\r\\n\\r\\n if (attr.unit === \\\"%\\\") {\\r\\n\\r\\n if (parent !== null) {\\r\\n\\r\\n fs = parent.styleAttrs[imscStyles.byName.fontSize.qname] * attr.value / 100;\\r\\n\\r\\n } else {\\r\\n\\r\\n /* region, so percent of 1c */\\r\\n\\r\\n fs = attr.value / 100 / doc.cellResolution.h;\\r\\n\\r\\n }\\r\\n\\r\\n } else if (attr.unit === \\\"em\\\") {\\r\\n\\r\\n if (parent !== null) {\\r\\n\\r\\n fs = parent.styleAttrs[imscStyles.byName.fontSize.qname] * attr.value;\\r\\n\\r\\n } else {\\r\\n\\r\\n /* region, so percent of 1c */\\r\\n\\r\\n fs = attr.value / doc.cellResolution.h;\\r\\n\\r\\n }\\r\\n\\r\\n } else if (attr.unit === \\\"c\\\") {\\r\\n\\r\\n fs = attr.value / doc.cellResolution.h;\\r\\n\\r\\n } else if (attr.unit === \\\"px\\\") {\\r\\n\\r\\n fs = attr.value / doc.pxDimensions.h;\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n return fs;\\r\\n }\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"fontStyle\\\",\\r\\n \\\"normal\\\",\\r\\n ['span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n /* TODO: handle font style */\\r\\n\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"fontWeight\\\",\\r\\n \\\"normal\\\",\\r\\n ['span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n /* TODO: handle font weight */\\r\\n\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"lineHeight\\\",\\r\\n \\\"normal\\\",\\r\\n ['p'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n if (str === \\\"normal\\\") {\\r\\n return str;\\r\\n } else {\\r\\n return imscUtils.parseLength(str);\\r\\n }\\r\\n },\\r\\n function (doc, parent, element, attr, context) {\\r\\n\\r\\n var lh;\\r\\n\\r\\n if (attr === \\\"normal\\\") {\\r\\n\\r\\n /* inherit normal per https://github.com/w3c/ttml1/issues/220 */\\r\\n\\r\\n lh = attr;\\r\\n\\r\\n } else if (attr.unit === \\\"%\\\") {\\r\\n\\r\\n lh = element.styleAttrs[imscStyles.byName.fontSize.qname] * attr.value / 100;\\r\\n\\r\\n } else if (attr.unit === \\\"em\\\") {\\r\\n\\r\\n lh = element.styleAttrs[imscStyles.byName.fontSize.qname] * attr.value;\\r\\n\\r\\n } else if (attr.unit === \\\"c\\\") {\\r\\n\\r\\n lh = attr.value / doc.cellResolution.h;\\r\\n\\r\\n } else if (attr.unit === \\\"px\\\") {\\r\\n\\r\\n /* TODO: handle error if no px dimensions are provided */\\r\\n\\r\\n lh = attr.value / doc.pxDimensions.h;\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n /* TODO: create a Length constructor */\\r\\n\\r\\n return lh;\\r\\n }\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"opacity\\\",\\r\\n 1.0,\\r\\n ['region'],\\r\\n false,\\r\\n true,\\r\\n parseFloat,\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"origin\\\",\\r\\n \\\"auto\\\",\\r\\n ['region'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n\\r\\n if (str === \\\"auto\\\") {\\r\\n\\r\\n return str;\\r\\n\\r\\n } else {\\r\\n\\r\\n var s = str.split(\\\" \\\");\\r\\n if (s.length !== 2) return null;\\r\\n var w = imscUtils.parseLength(s[0]);\\r\\n var h = imscUtils.parseLength(s[1]);\\r\\n if (!h || !w) return null;\\r\\n return {'h': h, 'w': w};\\r\\n }\\r\\n\\r\\n },\\r\\n function (doc, parent, element, attr, context) {\\r\\n\\r\\n var h;\\r\\n var w;\\r\\n\\r\\n if (attr === \\\"auto\\\") {\\r\\n\\r\\n h = 0;\\r\\n\\r\\n } else if (attr.h.unit === \\\"%\\\") {\\r\\n\\r\\n h = attr.h.value / 100;\\r\\n\\r\\n } else if (attr.h.unit === \\\"px\\\") {\\r\\n\\r\\n h = attr.h.value / doc.pxDimensions.h;\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n if (attr === \\\"auto\\\") {\\r\\n\\r\\n w = 0;\\r\\n\\r\\n } else if (attr.w.unit === \\\"%\\\") {\\r\\n\\r\\n w = attr.w.value / 100;\\r\\n\\r\\n } else if (attr.w.unit === \\\"px\\\") {\\r\\n\\r\\n w = attr.w.value / doc.pxDimensions.w;\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n return {'h': h, 'w': w};\\r\\n }\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"overflow\\\",\\r\\n \\\"hidden\\\",\\r\\n ['region'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"padding\\\",\\r\\n \\\"0px\\\",\\r\\n ['region'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n\\r\\n var s = str.split(\\\" \\\");\\r\\n if (s.length > 4) return null;\\r\\n var r = [];\\r\\n for (var i in s) {\\r\\n\\r\\n var l = imscUtils.parseLength(s[i]);\\r\\n if (!l) return null;\\r\\n r.push(l);\\r\\n }\\r\\n\\r\\n return r;\\r\\n },\\r\\n function (doc, parent, element, attr, context) {\\r\\n\\r\\n var padding;\\r\\n\\r\\n /* TODO: make sure we are in region */\\r\\n\\r\\n /*\\r\\n * expand padding shortcuts to \\r\\n * [before, end, after, start]\\r\\n * \\r\\n */\\r\\n\\r\\n if (attr.length === 1) {\\r\\n\\r\\n padding = [attr[0], attr[0], attr[0], attr[0]];\\r\\n\\r\\n } else if (attr.length === 2) {\\r\\n\\r\\n padding = [attr[0], attr[1], attr[0], attr[1]];\\r\\n\\r\\n } else if (attr.length === 3) {\\r\\n\\r\\n padding = [attr[0], attr[1], attr[2], attr[1]];\\r\\n\\r\\n } else if (attr.length === 4) {\\r\\n\\r\\n padding = [attr[0], attr[1], attr[2], attr[3]];\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n /* TODO: take into account tts:direction */\\r\\n\\r\\n /* \\r\\n * transform [before, end, after, start] according to writingMode to \\r\\n * [top,left,bottom,right]\\r\\n * \\r\\n */\\r\\n\\r\\n var dir = element.styleAttrs[imscStyles.byName.writingMode.qname];\\r\\n\\r\\n if (dir === \\\"lrtb\\\" || dir === \\\"lr\\\") {\\r\\n\\r\\n padding = [padding[0], padding[3], padding[2], padding[1]];\\r\\n\\r\\n } else if (dir === \\\"rltb\\\" || dir === \\\"rl\\\") {\\r\\n\\r\\n padding = [padding[0], padding[1], padding[2], padding[3]];\\r\\n\\r\\n } else if (dir === \\\"tblr\\\") {\\r\\n\\r\\n padding = [padding[3], padding[0], padding[1], padding[2]];\\r\\n\\r\\n } else if (dir === \\\"tbrl\\\" || dir === \\\"tb\\\") {\\r\\n\\r\\n padding = [padding[3], padding[2], padding[1], padding[0]];\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n var out = [];\\r\\n\\r\\n for (var i in padding) {\\r\\n\\r\\n if (padding[i].value === 0) {\\r\\n\\r\\n out[i] = 0;\\r\\n\\r\\n } else if (padding[i].unit === \\\"%\\\") {\\r\\n\\r\\n if (i === \\\"0\\\" || i === \\\"2\\\") {\\r\\n\\r\\n out[i] = element.styleAttrs[imscStyles.byName.extent.qname].h * padding[i].value / 100;\\r\\n\\r\\n } else {\\r\\n\\r\\n out[i] = element.styleAttrs[imscStyles.byName.extent.qname].w * padding[i].value / 100;\\r\\n }\\r\\n\\r\\n } else if (padding[i].unit === \\\"em\\\") {\\r\\n\\r\\n out[i] = element.styleAttrs[imscStyles.byName.fontSize.qname] * padding[i].value;\\r\\n\\r\\n } else if (padding[i].unit === \\\"c\\\") {\\r\\n\\r\\n out[i] = padding[i].value / doc.cellResolution.h;\\r\\n\\r\\n } else if (padding[i].unit === \\\"px\\\") {\\r\\n \\r\\n if (i === \\\"0\\\" || i === \\\"2\\\") {\\r\\n\\r\\n out[i] = padding[i].value / doc.pxDimensions.h;\\r\\n\\r\\n } else {\\r\\n\\r\\n out[i] = padding[i].value / doc.pxDimensions.w;\\r\\n }\\r\\n \\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n }\\r\\n\\r\\n\\r\\n return out;\\r\\n }\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"showBackground\\\",\\r\\n \\\"always\\\",\\r\\n ['region'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"textAlign\\\",\\r\\n \\\"start\\\",\\r\\n ['p'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n function (doc, parent, element, attr, context) {\\r\\n \\r\\n /* Section 7.16.9 of XSL */\\r\\n \\r\\n if (attr === \\\"left\\\") {\\r\\n \\r\\n return \\\"start\\\";\\r\\n \\r\\n } else if (attr === \\\"right\\\") {\\r\\n \\r\\n return \\\"end\\\";\\r\\n \\r\\n } else {\\r\\n \\r\\n return attr;\\r\\n \\r\\n }\\r\\n }\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"textDecoration\\\",\\r\\n \\\"none\\\",\\r\\n ['span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n return str.split(\\\" \\\");\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"textOutline\\\",\\r\\n \\\"none\\\",\\r\\n ['span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n\\r\\n /*\\r\\n * returns {c: ?, thichness: } | \\\"none\\\"\\r\\n * \\r\\n */\\r\\n\\r\\n if (str === \\\"none\\\") {\\r\\n\\r\\n return str;\\r\\n\\r\\n } else {\\r\\n\\r\\n var r = {};\\r\\n var s = str.split(\\\" \\\");\\r\\n if (s.length === 0 || s.length > 2) return null;\\r\\n var c = imscUtils.parseColor(s[0]);\\r\\n \\r\\n r.color = c;\\r\\n \\r\\n if (c !== null) s.shift();\\r\\n\\r\\n if (s.length !== 1) return null;\\r\\n\\r\\n var l = imscUtils.parseLength(s[0]);\\r\\n\\r\\n if (!l) return null;\\r\\n\\r\\n r.thickness = l;\\r\\n\\r\\n return r;\\r\\n }\\r\\n\\r\\n },\\r\\n function (doc, parent, element, attr, context) {\\r\\n\\r\\n /*\\r\\n * returns {color: , thickness: }\\r\\n * \\r\\n */\\r\\n\\r\\n if (attr === \\\"none\\\") return attr;\\r\\n\\r\\n var rslt = {};\\r\\n\\r\\n if (attr.color === null) {\\r\\n \\r\\n rslt.color = element.styleAttrs[imscStyles.byName.color.qname];\\r\\n \\r\\n } else {\\r\\n \\r\\n rslt.color = attr.color;\\r\\n\\r\\n }\\r\\n\\r\\n if (attr.thickness.unit === \\\"%\\\") {\\r\\n\\r\\n rslt.thickness = element.styleAttrs[imscStyles.byName.fontSize.qname] * attr.thickness.value / 100;\\r\\n\\r\\n } else if (attr.thickness.unit === \\\"em\\\") {\\r\\n\\r\\n rslt.thickness = element.styleAttrs[imscStyles.byName.fontSize.qname] * attr.thickness.value;\\r\\n\\r\\n } else if (attr.thickness.unit === \\\"c\\\") {\\r\\n\\r\\n rslt.thickness = attr.thickness.value / doc.cellResolution.h;\\r\\n\\r\\n } else if (attr.thickness.unit === \\\"px\\\") {\\r\\n\\r\\n rslt.thickness = attr.thickness.value / doc.pxDimensions.h;\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n\\r\\n\\r\\n return rslt;\\r\\n }\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"unicodeBidi\\\",\\r\\n \\\"normal\\\",\\r\\n ['span', 'p'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"visibility\\\",\\r\\n \\\"visible\\\",\\r\\n ['body', 'div', 'p', 'region', 'span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"wrapOption\\\",\\r\\n \\\"wrap\\\",\\r\\n ['span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"writingMode\\\",\\r\\n \\\"lrtb\\\",\\r\\n ['region'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_tts,\\r\\n \\\"zIndex\\\",\\r\\n \\\"auto\\\",\\r\\n ['region'],\\r\\n false,\\r\\n true,\\r\\n function (str) {\\r\\n \\r\\n var rslt;\\r\\n \\r\\n if (str === 'auto') {\\r\\n \\r\\n rslt = str;\\r\\n \\r\\n } else {\\r\\n \\r\\n rslt = parseInt(str);\\r\\n \\r\\n if (isNaN(rslt)) {\\r\\n rslt = null;\\r\\n }\\r\\n \\r\\n }\\r\\n \\r\\n return rslt;\\r\\n },\\r\\n null\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_ebutts,\\r\\n \\\"linePadding\\\",\\r\\n \\\"0c\\\",\\r\\n ['p'],\\r\\n true,\\r\\n false,\\r\\n imscUtils.parseLength,\\r\\n function (doc, parent, element, attr, context) {\\r\\n if (attr.unit === \\\"c\\\") {\\r\\n\\r\\n return attr.value / doc.cellResolution.h;\\r\\n\\r\\n } else {\\r\\n\\r\\n return null;\\r\\n\\r\\n }\\r\\n }\\r\\n ),\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_ebutts,\\r\\n \\\"multiRowAlign\\\",\\r\\n \\\"auto\\\",\\r\\n ['p'],\\r\\n true,\\r\\n false,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_smpte,\\r\\n \\\"backgroundImage\\\",\\r\\n null,\\r\\n ['div'],\\r\\n false,\\r\\n false,\\r\\n function (str) {\\r\\n return str;\\r\\n },\\r\\n null\\r\\n ),\\r\\n\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_itts,\\r\\n \\\"forcedDisplay\\\",\\r\\n \\\"false\\\",\\r\\n ['body', 'div', 'p', 'region', 'span'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n return str === 'true' ? true : false;\\r\\n },\\r\\n null\\r\\n ),\\r\\n\\r\\n new StylingAttributeDefinition(\\r\\n imscNames.ns_itts,\\r\\n \\\"fillLineGap\\\",\\r\\n \\\"false\\\",\\r\\n ['p'],\\r\\n true,\\r\\n true,\\r\\n function (str) {\\r\\n return str === 'true' ? true : false;\\r\\n },\\r\\n null\\r\\n )\\r\\n ];\\r\\n\\r\\n /* TODO: allow null parse function */\\r\\n\\r\\n imscStyles.byQName = {};\\r\\n for (var i in imscStyles.all) {\\r\\n\\r\\n imscStyles.byQName[imscStyles.all[i].qname] = imscStyles.all[i];\\r\\n }\\r\\n\\r\\n imscStyles.byName = {};\\r\\n for (var j in imscStyles.all) {\\r\\n\\r\\n imscStyles.byName[imscStyles.all[j].name] = imscStyles.all[j];\\r\\n }\\r\\n\\r\\n})( false ? undefined : exports,\\r\\n typeof imscNames === 'undefined' ? __webpack_require__(/*! ./names */ \\\"./node_modules/imsc/src/main/js/names.js\\\") : imscNames,\\r\\n typeof imscUtils === 'undefined' ? __webpack_require__(/*! ./utils */ \\\"./node_modules/imsc/src/main/js/utils.js\\\") : imscUtils);\\r\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/imsc/src/main/js/utils.js\\\":\\n/*!************************************************!*\\\\\\n !*** ./node_modules/imsc/src/main/js/utils.js ***!\\n \\\\************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* \\r\\n * Copyright (c) 2016, Pierre-Anthony Lemieux \\r\\n * All rights reserved.\\r\\n *\\r\\n * Redistribution and use in source and binary forms, with or without\\r\\n * modification, are permitted provided that the following conditions are met:\\r\\n *\\r\\n * * Redistributions of source code must retain the above copyright notice, this\\r\\n * list of conditions and the following disclaimer.\\r\\n * * Redistributions in binary form must reproduce the above copyright notice,\\r\\n * this list of conditions and the following disclaimer in the documentation\\r\\n * and/or other materials provided with the distribution.\\r\\n *\\r\\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\"\\r\\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\\r\\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\\r\\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\\r\\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\\r\\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\\r\\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\\r\\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\\r\\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\\r\\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\\r\\n * POSSIBILITY OF SUCH DAMAGE.\\r\\n */\\r\\n\\r\\n/**\\r\\n * @module imscUtils\\r\\n */\\r\\n\\r\\n;\\r\\n(function (imscUtils) { // wrapper for non-node envs\\r\\n \\r\\n /* Documents the error handler interface */\\r\\n \\r\\n /**\\r\\n * @classdesc Generic interface for handling events. The interface exposes four\\r\\n * methods:\\r\\n * * info
: unusual event that does not result in an inconsistent state\\r\\n * * warn
: unexpected event that should not result in an inconsistent state\\r\\n * * error
: unexpected event that may result in an inconsistent state\\r\\n * * fatal
: unexpected event that results in an inconsistent state\\r\\n * and termination of processing\\r\\n * Each method takes a single string
describing the event as argument,\\r\\n * and returns a single boolean
, which terminates processing if true
.\\r\\n *\\r\\n * @name ErrorHandler\\r\\n * @class\\r\\n */\\r\\n\\r\\n\\r\\n /*\\r\\n * Parses a TTML color expression\\r\\n * \\r\\n */\\r\\n\\r\\n var HEX_COLOR_RE = /#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/;\\r\\n var DEC_COLOR_RE = /rgb\\\\(\\\\s*(\\\\d+)\\\\s*,\\\\s*(\\\\d+)\\\\s*,\\\\s*(\\\\d+)\\\\s*\\\\)/;\\r\\n var DEC_COLORA_RE = /rgba\\\\(\\\\s*(\\\\d+),\\\\s*(\\\\d+)\\\\s*,\\\\s*(\\\\d+)\\\\s*,\\\\s*(\\\\d+)\\\\s*\\\\)/;\\r\\n var NAMED_COLOR = {\\r\\n transparent: [0, 0, 0, 0],\\r\\n black: [0, 0, 0, 255],\\r\\n silver: [192, 192, 192, 255],\\r\\n gray: [128, 128, 128, 255],\\r\\n white: [255, 255, 255, 255],\\r\\n maroon: [128, 0, 0, 255],\\r\\n red: [255, 0, 0, 255],\\r\\n purple: [128, 0, 128, 255],\\r\\n fuchsia: [255, 0, 255, 255],\\r\\n magenta: [255, 0, 255, 255],\\r\\n green: [0, 128, 0, 255],\\r\\n lime: [0, 255, 0, 255],\\r\\n olive: [128, 128, 0, 255],\\r\\n yellow: [255, 255, 0, 255],\\r\\n navy: [0, 0, 128, 255],\\r\\n blue: [0, 0, 255, 255],\\r\\n teal: [0, 128, 128, 255],\\r\\n aqua: [0, 255, 255, 255],\\r\\n cyan: [0, 255, 255, 255]\\r\\n };\\r\\n\\r\\n imscUtils.parseColor = function (str) {\\r\\n\\r\\n var m;\\r\\n \\r\\n var r = null;\\r\\n \\r\\n var nc = NAMED_COLOR[str.toLowerCase()];\\r\\n \\r\\n if (nc !== undefined) {\\r\\n\\r\\n r = nc;\\r\\n\\r\\n } else if ((m = HEX_COLOR_RE.exec(str)) !== null) {\\r\\n\\r\\n r = [parseInt(m[1], 16),\\r\\n parseInt(m[2], 16),\\r\\n parseInt(m[3], 16),\\r\\n (m[4] !== undefined ? parseInt(m[4], 16) : 255)];\\r\\n \\r\\n } else if ((m = DEC_COLOR_RE.exec(str)) !== null) {\\r\\n\\r\\n r = [parseInt(m[1]),\\r\\n parseInt(m[2]),\\r\\n parseInt(m[3]),\\r\\n 255];\\r\\n \\r\\n } else if ((m = DEC_COLORA_RE.exec(str)) !== null) {\\r\\n\\r\\n r = [parseInt(m[1]),\\r\\n parseInt(m[2]),\\r\\n parseInt(m[3]),\\r\\n parseInt(m[4])];\\r\\n \\r\\n }\\r\\n\\r\\n return r;\\r\\n };\\r\\n\\r\\n var LENGTH_RE = /^((?:\\\\+|\\\\-)?\\\\d*(?:\\\\.\\\\d+)?)(px|em|c|%)$/;\\r\\n\\r\\n imscUtils.parseLength = function (str) {\\r\\n\\r\\n var m;\\r\\n\\r\\n var r = null;\\r\\n\\r\\n if ((m = LENGTH_RE.exec(str)) !== null) {\\r\\n\\r\\n r = {value: parseFloat(m[1]), unit: m[2]};\\r\\n }\\r\\n\\r\\n return r;\\r\\n };\\r\\n\\r\\n})( false ? undefined : exports);\\r\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/inherits/inherits_browser.js\\\":\\n/*!***************************************************!*\\\\\\n !*** ./node_modules/inherits/inherits_browser.js ***!\\n \\\\***************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nif (typeof Object.create === 'function') {\\n // implementation from standard node.js 'util' module\\n module.exports = function inherits(ctor, superCtor) {\\n ctor.super_ = superCtor\\n ctor.prototype = Object.create(superCtor.prototype, {\\n constructor: {\\n value: ctor,\\n enumerable: false,\\n writable: true,\\n configurable: true\\n }\\n });\\n };\\n} else {\\n // old school shim for old browsers\\n module.exports = function inherits(ctor, superCtor) {\\n ctor.super_ = superCtor\\n var TempCtor = function () {}\\n TempCtor.prototype = superCtor.prototype\\n ctor.prototype = new TempCtor()\\n ctor.prototype.constructor = ctor\\n }\\n}\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/isarray/index.js\\\":\\n/*!***************************************!*\\\\\\n !*** ./node_modules/isarray/index.js ***!\\n \\\\***************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\nvar toString = {}.toString;\\n\\nmodule.exports = Array.isArray || function (arr) {\\n return toString.call(arr) == '[object Array]';\\n};\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/node-libs-browser/node_modules/buffer/index.js\\\":\\n/*!*********************************************************************!*\\\\\\n !*** ./node_modules/node-libs-browser/node_modules/buffer/index.js ***!\\n \\\\*********************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n/* WEBPACK VAR INJECTION */(function(global) {/*!\\n * The buffer module from node.js, for the browser.\\n *\\n * @author Feross Aboukhadijeh \\n * @license MIT\\n */\\n/* eslint-disable no-proto */\\n\\n\\n\\nvar base64 = __webpack_require__(/*! base64-js */ \\\"./node_modules/base64-js/index.js\\\")\\nvar ieee754 = __webpack_require__(/*! ieee754 */ \\\"./node_modules/ieee754/index.js\\\")\\nvar isArray = __webpack_require__(/*! isarray */ \\\"./node_modules/isarray/index.js\\\")\\n\\nexports.Buffer = Buffer\\nexports.SlowBuffer = SlowBuffer\\nexports.INSPECT_MAX_BYTES = 50\\n\\n/**\\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\\n * === true Use Uint8Array implementation (fastest)\\n * === false Use Object implementation (most compatible, even IE6)\\n *\\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\\n * Opera 11.6+, iOS 4.2+.\\n *\\n * Due to various browser bugs, sometimes the Object implementation will be used even\\n * when the browser supports typed arrays.\\n *\\n * Note:\\n *\\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\\n *\\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\\n *\\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\\n * incorrect length in some situations.\\n\\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\\n * get the Object implementation, which is slower but behaves correctly.\\n */\\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\\n ? global.TYPED_ARRAY_SUPPORT\\n : typedArraySupport()\\n\\n/*\\n * Export kMaxLength after typed array support is determined.\\n */\\nexports.kMaxLength = kMaxLength()\\n\\nfunction typedArraySupport () {\\n try {\\n var arr = new Uint8Array(1)\\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\\n return arr.foo() === 42 && // typed array instances can be augmented\\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\\n } catch (e) {\\n return false\\n }\\n}\\n\\nfunction kMaxLength () {\\n return Buffer.TYPED_ARRAY_SUPPORT\\n ? 0x7fffffff\\n : 0x3fffffff\\n}\\n\\nfunction createBuffer (that, length) {\\n if (kMaxLength() < length) {\\n throw new RangeError('Invalid typed array length')\\n }\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n // Return an augmented `Uint8Array` instance, for best performance\\n that = new Uint8Array(length)\\n that.__proto__ = Buffer.prototype\\n } else {\\n // Fallback: Return an object instance of the Buffer class\\n if (that === null) {\\n that = new Buffer(length)\\n }\\n that.length = length\\n }\\n\\n return that\\n}\\n\\n/**\\n * The Buffer constructor returns instances of `Uint8Array` that have their\\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\\n * returns a single octet.\\n *\\n * The `Uint8Array` prototype remains unmodified.\\n */\\n\\nfunction Buffer (arg, encodingOrOffset, length) {\\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\\n return new Buffer(arg, encodingOrOffset, length)\\n }\\n\\n // Common case.\\n if (typeof arg === 'number') {\\n if (typeof encodingOrOffset === 'string') {\\n throw new Error(\\n 'If encoding is specified then the first argument must be a string'\\n )\\n }\\n return allocUnsafe(this, arg)\\n }\\n return from(this, arg, encodingOrOffset, length)\\n}\\n\\nBuffer.poolSize = 8192 // not used by this implementation\\n\\n// TODO: Legacy, not needed anymore. Remove in next major version.\\nBuffer._augment = function (arr) {\\n arr.__proto__ = Buffer.prototype\\n return arr\\n}\\n\\nfunction from (that, value, encodingOrOffset, length) {\\n if (typeof value === 'number') {\\n throw new TypeError('\\\"value\\\" argument must not be a number')\\n }\\n\\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\\n return fromArrayBuffer(that, value, encodingOrOffset, length)\\n }\\n\\n if (typeof value === 'string') {\\n return fromString(that, value, encodingOrOffset)\\n }\\n\\n return fromObject(that, value)\\n}\\n\\n/**\\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\\n * if value is a number.\\n * Buffer.from(str[, encoding])\\n * Buffer.from(array)\\n * Buffer.from(buffer)\\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\\n **/\\nBuffer.from = function (value, encodingOrOffset, length) {\\n return from(null, value, encodingOrOffset, length)\\n}\\n\\nif (Buffer.TYPED_ARRAY_SUPPORT) {\\n Buffer.prototype.__proto__ = Uint8Array.prototype\\n Buffer.__proto__ = Uint8Array\\n if (typeof Symbol !== 'undefined' && Symbol.species &&\\n Buffer[Symbol.species] === Buffer) {\\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\\n Object.defineProperty(Buffer, Symbol.species, {\\n value: null,\\n configurable: true\\n })\\n }\\n}\\n\\nfunction assertSize (size) {\\n if (typeof size !== 'number') {\\n throw new TypeError('\\\"size\\\" argument must be a number')\\n } else if (size < 0) {\\n throw new RangeError('\\\"size\\\" argument must not be negative')\\n }\\n}\\n\\nfunction alloc (that, size, fill, encoding) {\\n assertSize(size)\\n if (size <= 0) {\\n return createBuffer(that, size)\\n }\\n if (fill !== undefined) {\\n // Only pay attention to encoding if it's a string. This\\n // prevents accidentally sending in a number that would\\n // be interpretted as a start offset.\\n return typeof encoding === 'string'\\n ? createBuffer(that, size).fill(fill, encoding)\\n : createBuffer(that, size).fill(fill)\\n }\\n return createBuffer(that, size)\\n}\\n\\n/**\\n * Creates a new filled Buffer instance.\\n * alloc(size[, fill[, encoding]])\\n **/\\nBuffer.alloc = function (size, fill, encoding) {\\n return alloc(null, size, fill, encoding)\\n}\\n\\nfunction allocUnsafe (that, size) {\\n assertSize(size)\\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\\n for (var i = 0; i < size; ++i) {\\n that[i] = 0\\n }\\n }\\n return that\\n}\\n\\n/**\\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\\n * */\\nBuffer.allocUnsafe = function (size) {\\n return allocUnsafe(null, size)\\n}\\n/**\\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\\n */\\nBuffer.allocUnsafeSlow = function (size) {\\n return allocUnsafe(null, size)\\n}\\n\\nfunction fromString (that, string, encoding) {\\n if (typeof encoding !== 'string' || encoding === '') {\\n encoding = 'utf8'\\n }\\n\\n if (!Buffer.isEncoding(encoding)) {\\n throw new TypeError('\\\"encoding\\\" must be a valid string encoding')\\n }\\n\\n var length = byteLength(string, encoding) | 0\\n that = createBuffer(that, length)\\n\\n var actual = that.write(string, encoding)\\n\\n if (actual !== length) {\\n // Writing a hex string, for example, that contains invalid characters will\\n // cause everything after the first invalid character to be ignored. (e.g.\\n // 'abxxcd' will be treated as 'ab')\\n that = that.slice(0, actual)\\n }\\n\\n return that\\n}\\n\\nfunction fromArrayLike (that, array) {\\n var length = array.length < 0 ? 0 : checked(array.length) | 0\\n that = createBuffer(that, length)\\n for (var i = 0; i < length; i += 1) {\\n that[i] = array[i] & 255\\n }\\n return that\\n}\\n\\nfunction fromArrayBuffer (that, array, byteOffset, length) {\\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\\n\\n if (byteOffset < 0 || array.byteLength < byteOffset) {\\n throw new RangeError('\\\\'offset\\\\' is out of bounds')\\n }\\n\\n if (array.byteLength < byteOffset + (length || 0)) {\\n throw new RangeError('\\\\'length\\\\' is out of bounds')\\n }\\n\\n if (byteOffset === undefined && length === undefined) {\\n array = new Uint8Array(array)\\n } else if (length === undefined) {\\n array = new Uint8Array(array, byteOffset)\\n } else {\\n array = new Uint8Array(array, byteOffset, length)\\n }\\n\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n // Return an augmented `Uint8Array` instance, for best performance\\n that = array\\n that.__proto__ = Buffer.prototype\\n } else {\\n // Fallback: Return an object instance of the Buffer class\\n that = fromArrayLike(that, array)\\n }\\n return that\\n}\\n\\nfunction fromObject (that, obj) {\\n if (Buffer.isBuffer(obj)) {\\n var len = checked(obj.length) | 0\\n that = createBuffer(that, len)\\n\\n if (that.length === 0) {\\n return that\\n }\\n\\n obj.copy(that, 0, 0, len)\\n return that\\n }\\n\\n if (obj) {\\n if ((typeof ArrayBuffer !== 'undefined' &&\\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\\n return createBuffer(that, 0)\\n }\\n return fromArrayLike(that, obj)\\n }\\n\\n if (obj.type === 'Buffer' && isArray(obj.data)) {\\n return fromArrayLike(that, obj.data)\\n }\\n }\\n\\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\\n}\\n\\nfunction checked (length) {\\n // Note: cannot use `length < kMaxLength()` here because that fails when\\n // length is NaN (which is otherwise coerced to zero.)\\n if (length >= kMaxLength()) {\\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\\n }\\n return length | 0\\n}\\n\\nfunction SlowBuffer (length) {\\n if (+length != length) { // eslint-disable-line eqeqeq\\n length = 0\\n }\\n return Buffer.alloc(+length)\\n}\\n\\nBuffer.isBuffer = function isBuffer (b) {\\n return !!(b != null && b._isBuffer)\\n}\\n\\nBuffer.compare = function compare (a, b) {\\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\\n throw new TypeError('Arguments must be Buffers')\\n }\\n\\n if (a === b) return 0\\n\\n var x = a.length\\n var y = b.length\\n\\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\\n if (a[i] !== b[i]) {\\n x = a[i]\\n y = b[i]\\n break\\n }\\n }\\n\\n if (x < y) return -1\\n if (y < x) return 1\\n return 0\\n}\\n\\nBuffer.isEncoding = function isEncoding (encoding) {\\n switch (String(encoding).toLowerCase()) {\\n case 'hex':\\n case 'utf8':\\n case 'utf-8':\\n case 'ascii':\\n case 'latin1':\\n case 'binary':\\n case 'base64':\\n case 'ucs2':\\n case 'ucs-2':\\n case 'utf16le':\\n case 'utf-16le':\\n return true\\n default:\\n return false\\n }\\n}\\n\\nBuffer.concat = function concat (list, length) {\\n if (!isArray(list)) {\\n throw new TypeError('\\\"list\\\" argument must be an Array of Buffers')\\n }\\n\\n if (list.length === 0) {\\n return Buffer.alloc(0)\\n }\\n\\n var i\\n if (length === undefined) {\\n length = 0\\n for (i = 0; i < list.length; ++i) {\\n length += list[i].length\\n }\\n }\\n\\n var buffer = Buffer.allocUnsafe(length)\\n var pos = 0\\n for (i = 0; i < list.length; ++i) {\\n var buf = list[i]\\n if (!Buffer.isBuffer(buf)) {\\n throw new TypeError('\\\"list\\\" argument must be an Array of Buffers')\\n }\\n buf.copy(buffer, pos)\\n pos += buf.length\\n }\\n return buffer\\n}\\n\\nfunction byteLength (string, encoding) {\\n if (Buffer.isBuffer(string)) {\\n return string.length\\n }\\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\\n return string.byteLength\\n }\\n if (typeof string !== 'string') {\\n string = '' + string\\n }\\n\\n var len = string.length\\n if (len === 0) return 0\\n\\n // Use a for loop to avoid recursion\\n var loweredCase = false\\n for (;;) {\\n switch (encoding) {\\n case 'ascii':\\n case 'latin1':\\n case 'binary':\\n return len\\n case 'utf8':\\n case 'utf-8':\\n case undefined:\\n return utf8ToBytes(string).length\\n case 'ucs2':\\n case 'ucs-2':\\n case 'utf16le':\\n case 'utf-16le':\\n return len * 2\\n case 'hex':\\n return len >>> 1\\n case 'base64':\\n return base64ToBytes(string).length\\n default:\\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\\n encoding = ('' + encoding).toLowerCase()\\n loweredCase = true\\n }\\n }\\n}\\nBuffer.byteLength = byteLength\\n\\nfunction slowToString (encoding, start, end) {\\n var loweredCase = false\\n\\n // No need to verify that \\\"this.length <= MAX_UINT32\\\" since it's a read-only\\n // property of a typed array.\\n\\n // This behaves neither like String nor Uint8Array in that we set start/end\\n // to their upper/lower bounds if the value passed is out of range.\\n // undefined is handled specially as per ECMA-262 6th Edition,\\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\\n if (start === undefined || start < 0) {\\n start = 0\\n }\\n // Return early if start > this.length. Done here to prevent potential uint32\\n // coercion fail below.\\n if (start > this.length) {\\n return ''\\n }\\n\\n if (end === undefined || end > this.length) {\\n end = this.length\\n }\\n\\n if (end <= 0) {\\n return ''\\n }\\n\\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\\n end >>>= 0\\n start >>>= 0\\n\\n if (end <= start) {\\n return ''\\n }\\n\\n if (!encoding) encoding = 'utf8'\\n\\n while (true) {\\n switch (encoding) {\\n case 'hex':\\n return hexSlice(this, start, end)\\n\\n case 'utf8':\\n case 'utf-8':\\n return utf8Slice(this, start, end)\\n\\n case 'ascii':\\n return asciiSlice(this, start, end)\\n\\n case 'latin1':\\n case 'binary':\\n return latin1Slice(this, start, end)\\n\\n case 'base64':\\n return base64Slice(this, start, end)\\n\\n case 'ucs2':\\n case 'ucs-2':\\n case 'utf16le':\\n case 'utf-16le':\\n return utf16leSlice(this, start, end)\\n\\n default:\\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\\n encoding = (encoding + '').toLowerCase()\\n loweredCase = true\\n }\\n }\\n}\\n\\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\\n// Buffer instances.\\nBuffer.prototype._isBuffer = true\\n\\nfunction swap (b, n, m) {\\n var i = b[n]\\n b[n] = b[m]\\n b[m] = i\\n}\\n\\nBuffer.prototype.swap16 = function swap16 () {\\n var len = this.length\\n if (len % 2 !== 0) {\\n throw new RangeError('Buffer size must be a multiple of 16-bits')\\n }\\n for (var i = 0; i < len; i += 2) {\\n swap(this, i, i + 1)\\n }\\n return this\\n}\\n\\nBuffer.prototype.swap32 = function swap32 () {\\n var len = this.length\\n if (len % 4 !== 0) {\\n throw new RangeError('Buffer size must be a multiple of 32-bits')\\n }\\n for (var i = 0; i < len; i += 4) {\\n swap(this, i, i + 3)\\n swap(this, i + 1, i + 2)\\n }\\n return this\\n}\\n\\nBuffer.prototype.swap64 = function swap64 () {\\n var len = this.length\\n if (len % 8 !== 0) {\\n throw new RangeError('Buffer size must be a multiple of 64-bits')\\n }\\n for (var i = 0; i < len; i += 8) {\\n swap(this, i, i + 7)\\n swap(this, i + 1, i + 6)\\n swap(this, i + 2, i + 5)\\n swap(this, i + 3, i + 4)\\n }\\n return this\\n}\\n\\nBuffer.prototype.toString = function toString () {\\n var length = this.length | 0\\n if (length === 0) return ''\\n if (arguments.length === 0) return utf8Slice(this, 0, length)\\n return slowToString.apply(this, arguments)\\n}\\n\\nBuffer.prototype.equals = function equals (b) {\\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\\n if (this === b) return true\\n return Buffer.compare(this, b) === 0\\n}\\n\\nBuffer.prototype.inspect = function inspect () {\\n var str = ''\\n var max = exports.INSPECT_MAX_BYTES\\n if (this.length > 0) {\\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\\n if (this.length > max) str += ' ... '\\n }\\n return ''\\n}\\n\\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\\n if (!Buffer.isBuffer(target)) {\\n throw new TypeError('Argument must be a Buffer')\\n }\\n\\n if (start === undefined) {\\n start = 0\\n }\\n if (end === undefined) {\\n end = target ? target.length : 0\\n }\\n if (thisStart === undefined) {\\n thisStart = 0\\n }\\n if (thisEnd === undefined) {\\n thisEnd = this.length\\n }\\n\\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\\n throw new RangeError('out of range index')\\n }\\n\\n if (thisStart >= thisEnd && start >= end) {\\n return 0\\n }\\n if (thisStart >= thisEnd) {\\n return -1\\n }\\n if (start >= end) {\\n return 1\\n }\\n\\n start >>>= 0\\n end >>>= 0\\n thisStart >>>= 0\\n thisEnd >>>= 0\\n\\n if (this === target) return 0\\n\\n var x = thisEnd - thisStart\\n var y = end - start\\n var len = Math.min(x, y)\\n\\n var thisCopy = this.slice(thisStart, thisEnd)\\n var targetCopy = target.slice(start, end)\\n\\n for (var i = 0; i < len; ++i) {\\n if (thisCopy[i] !== targetCopy[i]) {\\n x = thisCopy[i]\\n y = targetCopy[i]\\n break\\n }\\n }\\n\\n if (x < y) return -1\\n if (y < x) return 1\\n return 0\\n}\\n\\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\\n//\\n// Arguments:\\n// - buffer - a Buffer to search\\n// - val - a string, Buffer, or number\\n// - byteOffset - an index into `buffer`; will be clamped to an int32\\n// - encoding - an optional encoding, relevant is val is a string\\n// - dir - true for indexOf, false for lastIndexOf\\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\\n // Empty buffer means no match\\n if (buffer.length === 0) return -1\\n\\n // Normalize byteOffset\\n if (typeof byteOffset === 'string') {\\n encoding = byteOffset\\n byteOffset = 0\\n } else if (byteOffset > 0x7fffffff) {\\n byteOffset = 0x7fffffff\\n } else if (byteOffset < -0x80000000) {\\n byteOffset = -0x80000000\\n }\\n byteOffset = +byteOffset // Coerce to Number.\\n if (isNaN(byteOffset)) {\\n // byteOffset: it it's undefined, null, NaN, \\\"foo\\\", etc, search whole buffer\\n byteOffset = dir ? 0 : (buffer.length - 1)\\n }\\n\\n // Normalize byteOffset: negative offsets start from the end of the buffer\\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\\n if (byteOffset >= buffer.length) {\\n if (dir) return -1\\n else byteOffset = buffer.length - 1\\n } else if (byteOffset < 0) {\\n if (dir) byteOffset = 0\\n else return -1\\n }\\n\\n // Normalize val\\n if (typeof val === 'string') {\\n val = Buffer.from(val, encoding)\\n }\\n\\n // Finally, search either indexOf (if dir is true) or lastIndexOf\\n if (Buffer.isBuffer(val)) {\\n // Special case: looking for empty string/buffer always fails\\n if (val.length === 0) {\\n return -1\\n }\\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\\n } else if (typeof val === 'number') {\\n val = val & 0xFF // Search for a byte value [0-255]\\n if (Buffer.TYPED_ARRAY_SUPPORT &&\\n typeof Uint8Array.prototype.indexOf === 'function') {\\n if (dir) {\\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\\n } else {\\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\\n }\\n }\\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\\n }\\n\\n throw new TypeError('val must be string, number or Buffer')\\n}\\n\\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\\n var indexSize = 1\\n var arrLength = arr.length\\n var valLength = val.length\\n\\n if (encoding !== undefined) {\\n encoding = String(encoding).toLowerCase()\\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\\n encoding === 'utf16le' || encoding === 'utf-16le') {\\n if (arr.length < 2 || val.length < 2) {\\n return -1\\n }\\n indexSize = 2\\n arrLength /= 2\\n valLength /= 2\\n byteOffset /= 2\\n }\\n }\\n\\n function read (buf, i) {\\n if (indexSize === 1) {\\n return buf[i]\\n } else {\\n return buf.readUInt16BE(i * indexSize)\\n }\\n }\\n\\n var i\\n if (dir) {\\n var foundIndex = -1\\n for (i = byteOffset; i < arrLength; i++) {\\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\\n if (foundIndex === -1) foundIndex = i\\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\\n } else {\\n if (foundIndex !== -1) i -= i - foundIndex\\n foundIndex = -1\\n }\\n }\\n } else {\\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\\n for (i = byteOffset; i >= 0; i--) {\\n var found = true\\n for (var j = 0; j < valLength; j++) {\\n if (read(arr, i + j) !== read(val, j)) {\\n found = false\\n break\\n }\\n }\\n if (found) return i\\n }\\n }\\n\\n return -1\\n}\\n\\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\\n return this.indexOf(val, byteOffset, encoding) !== -1\\n}\\n\\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\\n}\\n\\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\\n}\\n\\nfunction hexWrite (buf, string, offset, length) {\\n offset = Number(offset) || 0\\n var remaining = buf.length - offset\\n if (!length) {\\n length = remaining\\n } else {\\n length = Number(length)\\n if (length > remaining) {\\n length = remaining\\n }\\n }\\n\\n // must be an even number of digits\\n var strLen = string.length\\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\\n\\n if (length > strLen / 2) {\\n length = strLen / 2\\n }\\n for (var i = 0; i < length; ++i) {\\n var parsed = parseInt(string.substr(i * 2, 2), 16)\\n if (isNaN(parsed)) return i\\n buf[offset + i] = parsed\\n }\\n return i\\n}\\n\\nfunction utf8Write (buf, string, offset, length) {\\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\\n}\\n\\nfunction asciiWrite (buf, string, offset, length) {\\n return blitBuffer(asciiToBytes(string), buf, offset, length)\\n}\\n\\nfunction latin1Write (buf, string, offset, length) {\\n return asciiWrite(buf, string, offset, length)\\n}\\n\\nfunction base64Write (buf, string, offset, length) {\\n return blitBuffer(base64ToBytes(string), buf, offset, length)\\n}\\n\\nfunction ucs2Write (buf, string, offset, length) {\\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\\n}\\n\\nBuffer.prototype.write = function write (string, offset, length, encoding) {\\n // Buffer#write(string)\\n if (offset === undefined) {\\n encoding = 'utf8'\\n length = this.length\\n offset = 0\\n // Buffer#write(string, encoding)\\n } else if (length === undefined && typeof offset === 'string') {\\n encoding = offset\\n length = this.length\\n offset = 0\\n // Buffer#write(string, offset[, length][, encoding])\\n } else if (isFinite(offset)) {\\n offset = offset | 0\\n if (isFinite(length)) {\\n length = length | 0\\n if (encoding === undefined) encoding = 'utf8'\\n } else {\\n encoding = length\\n length = undefined\\n }\\n // legacy write(string, encoding, offset, length) - remove in v0.13\\n } else {\\n throw new Error(\\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\\n )\\n }\\n\\n var remaining = this.length - offset\\n if (length === undefined || length > remaining) length = remaining\\n\\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\\n throw new RangeError('Attempt to write outside buffer bounds')\\n }\\n\\n if (!encoding) encoding = 'utf8'\\n\\n var loweredCase = false\\n for (;;) {\\n switch (encoding) {\\n case 'hex':\\n return hexWrite(this, string, offset, length)\\n\\n case 'utf8':\\n case 'utf-8':\\n return utf8Write(this, string, offset, length)\\n\\n case 'ascii':\\n return asciiWrite(this, string, offset, length)\\n\\n case 'latin1':\\n case 'binary':\\n return latin1Write(this, string, offset, length)\\n\\n case 'base64':\\n // Warning: maxLength not taken into account in base64Write\\n return base64Write(this, string, offset, length)\\n\\n case 'ucs2':\\n case 'ucs-2':\\n case 'utf16le':\\n case 'utf-16le':\\n return ucs2Write(this, string, offset, length)\\n\\n default:\\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\\n encoding = ('' + encoding).toLowerCase()\\n loweredCase = true\\n }\\n }\\n}\\n\\nBuffer.prototype.toJSON = function toJSON () {\\n return {\\n type: 'Buffer',\\n data: Array.prototype.slice.call(this._arr || this, 0)\\n }\\n}\\n\\nfunction base64Slice (buf, start, end) {\\n if (start === 0 && end === buf.length) {\\n return base64.fromByteArray(buf)\\n } else {\\n return base64.fromByteArray(buf.slice(start, end))\\n }\\n}\\n\\nfunction utf8Slice (buf, start, end) {\\n end = Math.min(buf.length, end)\\n var res = []\\n\\n var i = start\\n while (i < end) {\\n var firstByte = buf[i]\\n var codePoint = null\\n var bytesPerSequence = (firstByte > 0xEF) ? 4\\n : (firstByte > 0xDF) ? 3\\n : (firstByte > 0xBF) ? 2\\n : 1\\n\\n if (i + bytesPerSequence <= end) {\\n var secondByte, thirdByte, fourthByte, tempCodePoint\\n\\n switch (bytesPerSequence) {\\n case 1:\\n if (firstByte < 0x80) {\\n codePoint = firstByte\\n }\\n break\\n case 2:\\n secondByte = buf[i + 1]\\n if ((secondByte & 0xC0) === 0x80) {\\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\\n if (tempCodePoint > 0x7F) {\\n codePoint = tempCodePoint\\n }\\n }\\n break\\n case 3:\\n secondByte = buf[i + 1]\\n thirdByte = buf[i + 2]\\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\\n codePoint = tempCodePoint\\n }\\n }\\n break\\n case 4:\\n secondByte = buf[i + 1]\\n thirdByte = buf[i + 2]\\n fourthByte = buf[i + 3]\\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\\n codePoint = tempCodePoint\\n }\\n }\\n }\\n }\\n\\n if (codePoint === null) {\\n // we did not generate a valid codePoint so insert a\\n // replacement char (U+FFFD) and advance only 1 byte\\n codePoint = 0xFFFD\\n bytesPerSequence = 1\\n } else if (codePoint > 0xFFFF) {\\n // encode to utf16 (surrogate pair dance)\\n codePoint -= 0x10000\\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\\n codePoint = 0xDC00 | codePoint & 0x3FF\\n }\\n\\n res.push(codePoint)\\n i += bytesPerSequence\\n }\\n\\n return decodeCodePointsArray(res)\\n}\\n\\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\\n// the lowest limit is Chrome, with 0x10000 args.\\n// We go 1 magnitude less, for safety\\nvar MAX_ARGUMENTS_LENGTH = 0x1000\\n\\nfunction decodeCodePointsArray (codePoints) {\\n var len = codePoints.length\\n if (len <= MAX_ARGUMENTS_LENGTH) {\\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\\n }\\n\\n // Decode in chunks to avoid \\\"call stack size exceeded\\\".\\n var res = ''\\n var i = 0\\n while (i < len) {\\n res += String.fromCharCode.apply(\\n String,\\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\\n )\\n }\\n return res\\n}\\n\\nfunction asciiSlice (buf, start, end) {\\n var ret = ''\\n end = Math.min(buf.length, end)\\n\\n for (var i = start; i < end; ++i) {\\n ret += String.fromCharCode(buf[i] & 0x7F)\\n }\\n return ret\\n}\\n\\nfunction latin1Slice (buf, start, end) {\\n var ret = ''\\n end = Math.min(buf.length, end)\\n\\n for (var i = start; i < end; ++i) {\\n ret += String.fromCharCode(buf[i])\\n }\\n return ret\\n}\\n\\nfunction hexSlice (buf, start, end) {\\n var len = buf.length\\n\\n if (!start || start < 0) start = 0\\n if (!end || end < 0 || end > len) end = len\\n\\n var out = ''\\n for (var i = start; i < end; ++i) {\\n out += toHex(buf[i])\\n }\\n return out\\n}\\n\\nfunction utf16leSlice (buf, start, end) {\\n var bytes = buf.slice(start, end)\\n var res = ''\\n for (var i = 0; i < bytes.length; i += 2) {\\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\\n }\\n return res\\n}\\n\\nBuffer.prototype.slice = function slice (start, end) {\\n var len = this.length\\n start = ~~start\\n end = end === undefined ? len : ~~end\\n\\n if (start < 0) {\\n start += len\\n if (start < 0) start = 0\\n } else if (start > len) {\\n start = len\\n }\\n\\n if (end < 0) {\\n end += len\\n if (end < 0) end = 0\\n } else if (end > len) {\\n end = len\\n }\\n\\n if (end < start) end = start\\n\\n var newBuf\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n newBuf = this.subarray(start, end)\\n newBuf.__proto__ = Buffer.prototype\\n } else {\\n var sliceLen = end - start\\n newBuf = new Buffer(sliceLen, undefined)\\n for (var i = 0; i < sliceLen; ++i) {\\n newBuf[i] = this[i + start]\\n }\\n }\\n\\n return newBuf\\n}\\n\\n/*\\n * Need to make sure that buffer isn't trying to write out of bounds.\\n */\\nfunction checkOffset (offset, ext, length) {\\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\\n}\\n\\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\\n offset = offset | 0\\n byteLength = byteLength | 0\\n if (!noAssert) checkOffset(offset, byteLength, this.length)\\n\\n var val = this[offset]\\n var mul = 1\\n var i = 0\\n while (++i < byteLength && (mul *= 0x100)) {\\n val += this[offset + i] * mul\\n }\\n\\n return val\\n}\\n\\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\\n offset = offset | 0\\n byteLength = byteLength | 0\\n if (!noAssert) {\\n checkOffset(offset, byteLength, this.length)\\n }\\n\\n var val = this[offset + --byteLength]\\n var mul = 1\\n while (byteLength > 0 && (mul *= 0x100)) {\\n val += this[offset + --byteLength] * mul\\n }\\n\\n return val\\n}\\n\\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 1, this.length)\\n return this[offset]\\n}\\n\\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 2, this.length)\\n return this[offset] | (this[offset + 1] << 8)\\n}\\n\\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 2, this.length)\\n return (this[offset] << 8) | this[offset + 1]\\n}\\n\\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 4, this.length)\\n\\n return ((this[offset]) |\\n (this[offset + 1] << 8) |\\n (this[offset + 2] << 16)) +\\n (this[offset + 3] * 0x1000000)\\n}\\n\\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 4, this.length)\\n\\n return (this[offset] * 0x1000000) +\\n ((this[offset + 1] << 16) |\\n (this[offset + 2] << 8) |\\n this[offset + 3])\\n}\\n\\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\\n offset = offset | 0\\n byteLength = byteLength | 0\\n if (!noAssert) checkOffset(offset, byteLength, this.length)\\n\\n var val = this[offset]\\n var mul = 1\\n var i = 0\\n while (++i < byteLength && (mul *= 0x100)) {\\n val += this[offset + i] * mul\\n }\\n mul *= 0x80\\n\\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\\n\\n return val\\n}\\n\\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\\n offset = offset | 0\\n byteLength = byteLength | 0\\n if (!noAssert) checkOffset(offset, byteLength, this.length)\\n\\n var i = byteLength\\n var mul = 1\\n var val = this[offset + --i]\\n while (i > 0 && (mul *= 0x100)) {\\n val += this[offset + --i] * mul\\n }\\n mul *= 0x80\\n\\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\\n\\n return val\\n}\\n\\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 1, this.length)\\n if (!(this[offset] & 0x80)) return (this[offset])\\n return ((0xff - this[offset] + 1) * -1)\\n}\\n\\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 2, this.length)\\n var val = this[offset] | (this[offset + 1] << 8)\\n return (val & 0x8000) ? val | 0xFFFF0000 : val\\n}\\n\\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 2, this.length)\\n var val = this[offset + 1] | (this[offset] << 8)\\n return (val & 0x8000) ? val | 0xFFFF0000 : val\\n}\\n\\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 4, this.length)\\n\\n return (this[offset]) |\\n (this[offset + 1] << 8) |\\n (this[offset + 2] << 16) |\\n (this[offset + 3] << 24)\\n}\\n\\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 4, this.length)\\n\\n return (this[offset] << 24) |\\n (this[offset + 1] << 16) |\\n (this[offset + 2] << 8) |\\n (this[offset + 3])\\n}\\n\\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 4, this.length)\\n return ieee754.read(this, offset, true, 23, 4)\\n}\\n\\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 4, this.length)\\n return ieee754.read(this, offset, false, 23, 4)\\n}\\n\\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 8, this.length)\\n return ieee754.read(this, offset, true, 52, 8)\\n}\\n\\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\\n if (!noAssert) checkOffset(offset, 8, this.length)\\n return ieee754.read(this, offset, false, 52, 8)\\n}\\n\\nfunction checkInt (buf, value, offset, ext, max, min) {\\n if (!Buffer.isBuffer(buf)) throw new TypeError('\\\"buffer\\\" argument must be a Buffer instance')\\n if (value > max || value < min) throw new RangeError('\\\"value\\\" argument is out of bounds')\\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\\n}\\n\\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\\n value = +value\\n offset = offset | 0\\n byteLength = byteLength | 0\\n if (!noAssert) {\\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\\n checkInt(this, value, offset, byteLength, maxBytes, 0)\\n }\\n\\n var mul = 1\\n var i = 0\\n this[offset] = value & 0xFF\\n while (++i < byteLength && (mul *= 0x100)) {\\n this[offset + i] = (value / mul) & 0xFF\\n }\\n\\n return offset + byteLength\\n}\\n\\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\\n value = +value\\n offset = offset | 0\\n byteLength = byteLength | 0\\n if (!noAssert) {\\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\\n checkInt(this, value, offset, byteLength, maxBytes, 0)\\n }\\n\\n var i = byteLength - 1\\n var mul = 1\\n this[offset + i] = value & 0xFF\\n while (--i >= 0 && (mul *= 0x100)) {\\n this[offset + i] = (value / mul) & 0xFF\\n }\\n\\n return offset + byteLength\\n}\\n\\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\\n this[offset] = (value & 0xff)\\n return offset + 1\\n}\\n\\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\\n if (value < 0) value = 0xffff + value + 1\\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\\n (littleEndian ? i : 1 - i) * 8\\n }\\n}\\n\\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n this[offset] = (value & 0xff)\\n this[offset + 1] = (value >>> 8)\\n } else {\\n objectWriteUInt16(this, value, offset, true)\\n }\\n return offset + 2\\n}\\n\\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n this[offset] = (value >>> 8)\\n this[offset + 1] = (value & 0xff)\\n } else {\\n objectWriteUInt16(this, value, offset, false)\\n }\\n return offset + 2\\n}\\n\\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\\n if (value < 0) value = 0xffffffff + value + 1\\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\\n }\\n}\\n\\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n this[offset + 3] = (value >>> 24)\\n this[offset + 2] = (value >>> 16)\\n this[offset + 1] = (value >>> 8)\\n this[offset] = (value & 0xff)\\n } else {\\n objectWriteUInt32(this, value, offset, true)\\n }\\n return offset + 4\\n}\\n\\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n this[offset] = (value >>> 24)\\n this[offset + 1] = (value >>> 16)\\n this[offset + 2] = (value >>> 8)\\n this[offset + 3] = (value & 0xff)\\n } else {\\n objectWriteUInt32(this, value, offset, false)\\n }\\n return offset + 4\\n}\\n\\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) {\\n var limit = Math.pow(2, 8 * byteLength - 1)\\n\\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\\n }\\n\\n var i = 0\\n var mul = 1\\n var sub = 0\\n this[offset] = value & 0xFF\\n while (++i < byteLength && (mul *= 0x100)) {\\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\\n sub = 1\\n }\\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\\n }\\n\\n return offset + byteLength\\n}\\n\\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) {\\n var limit = Math.pow(2, 8 * byteLength - 1)\\n\\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\\n }\\n\\n var i = byteLength - 1\\n var mul = 1\\n var sub = 0\\n this[offset + i] = value & 0xFF\\n while (--i >= 0 && (mul *= 0x100)) {\\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\\n sub = 1\\n }\\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\\n }\\n\\n return offset + byteLength\\n}\\n\\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\\n if (value < 0) value = 0xff + value + 1\\n this[offset] = (value & 0xff)\\n return offset + 1\\n}\\n\\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n this[offset] = (value & 0xff)\\n this[offset + 1] = (value >>> 8)\\n } else {\\n objectWriteUInt16(this, value, offset, true)\\n }\\n return offset + 2\\n}\\n\\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n this[offset] = (value >>> 8)\\n this[offset + 1] = (value & 0xff)\\n } else {\\n objectWriteUInt16(this, value, offset, false)\\n }\\n return offset + 2\\n}\\n\\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n this[offset] = (value & 0xff)\\n this[offset + 1] = (value >>> 8)\\n this[offset + 2] = (value >>> 16)\\n this[offset + 3] = (value >>> 24)\\n } else {\\n objectWriteUInt32(this, value, offset, true)\\n }\\n return offset + 4\\n}\\n\\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\\n value = +value\\n offset = offset | 0\\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\\n if (value < 0) value = 0xffffffff + value + 1\\n if (Buffer.TYPED_ARRAY_SUPPORT) {\\n this[offset] = (value >>> 24)\\n this[offset + 1] = (value >>> 16)\\n this[offset + 2] = (value >>> 8)\\n this[offset + 3] = (value & 0xff)\\n } else {\\n objectWriteUInt32(this, value, offset, false)\\n }\\n return offset + 4\\n}\\n\\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\\n if (offset < 0) throw new RangeError('Index out of range')\\n}\\n\\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\\n if (!noAssert) {\\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\\n }\\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\\n return offset + 4\\n}\\n\\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\\n return writeFloat(this, value, offset, true, noAssert)\\n}\\n\\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\\n return writeFloat(this, value, offset, false, noAssert)\\n}\\n\\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\\n if (!noAssert) {\\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\\n }\\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\\n return offset + 8\\n}\\n\\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\\n return writeDouble(this, value, offset, true, noAssert)\\n}\\n\\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\\n return writeDouble(this, value, offset, false, noAssert)\\n}\\n\\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\\n if (!start) start = 0\\n if (!end && end !== 0) end = this.length\\n if (targetStart >= target.length) targetStart = target.length\\n if (!targetStart) targetStart = 0\\n if (end > 0 && end < start) end = start\\n\\n // Copy 0 bytes; we're done\\n if (end === start) return 0\\n if (target.length === 0 || this.length === 0) return 0\\n\\n // Fatal error conditions\\n if (targetStart < 0) {\\n throw new RangeError('targetStart out of bounds')\\n }\\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\\n\\n // Are we oob?\\n if (end > this.length) end = this.length\\n if (target.length - targetStart < end - start) {\\n end = target.length - targetStart + start\\n }\\n\\n var len = end - start\\n var i\\n\\n if (this === target && start < targetStart && targetStart < end) {\\n // descending copy from end\\n for (i = len - 1; i >= 0; --i) {\\n target[i + targetStart] = this[i + start]\\n }\\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\\n // ascending copy from start\\n for (i = 0; i < len; ++i) {\\n target[i + targetStart] = this[i + start]\\n }\\n } else {\\n Uint8Array.prototype.set.call(\\n target,\\n this.subarray(start, start + len),\\n targetStart\\n )\\n }\\n\\n return len\\n}\\n\\n// Usage:\\n// buffer.fill(number[, offset[, end]])\\n// buffer.fill(buffer[, offset[, end]])\\n// buffer.fill(string[, offset[, end]][, encoding])\\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\\n // Handle string cases:\\n if (typeof val === 'string') {\\n if (typeof start === 'string') {\\n encoding = start\\n start = 0\\n end = this.length\\n } else if (typeof end === 'string') {\\n encoding = end\\n end = this.length\\n }\\n if (val.length === 1) {\\n var code = val.charCodeAt(0)\\n if (code < 256) {\\n val = code\\n }\\n }\\n if (encoding !== undefined && typeof encoding !== 'string') {\\n throw new TypeError('encoding must be a string')\\n }\\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\\n throw new TypeError('Unknown encoding: ' + encoding)\\n }\\n } else if (typeof val === 'number') {\\n val = val & 255\\n }\\n\\n // Invalid ranges are not set to a default, so can range check early.\\n if (start < 0 || this.length < start || this.length < end) {\\n throw new RangeError('Out of range index')\\n }\\n\\n if (end <= start) {\\n return this\\n }\\n\\n start = start >>> 0\\n end = end === undefined ? this.length : end >>> 0\\n\\n if (!val) val = 0\\n\\n var i\\n if (typeof val === 'number') {\\n for (i = start; i < end; ++i) {\\n this[i] = val\\n }\\n } else {\\n var bytes = Buffer.isBuffer(val)\\n ? val\\n : utf8ToBytes(new Buffer(val, encoding).toString())\\n var len = bytes.length\\n for (i = 0; i < end - start; ++i) {\\n this[i + start] = bytes[i % len]\\n }\\n }\\n\\n return this\\n}\\n\\n// HELPER FUNCTIONS\\n// ================\\n\\nvar INVALID_BASE64_RE = /[^+\\\\/0-9A-Za-z-_]/g\\n\\nfunction base64clean (str) {\\n // Node strips out invalid characters like \\\\n and \\\\t from the string, base64-js does not\\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\\n // Node converts strings with length < 2 to ''\\n if (str.length < 2) return ''\\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\\n while (str.length % 4 !== 0) {\\n str = str + '='\\n }\\n return str\\n}\\n\\nfunction stringtrim (str) {\\n if (str.trim) return str.trim()\\n return str.replace(/^\\\\s+|\\\\s+$/g, '')\\n}\\n\\nfunction toHex (n) {\\n if (n < 16) return '0' + n.toString(16)\\n return n.toString(16)\\n}\\n\\nfunction utf8ToBytes (string, units) {\\n units = units || Infinity\\n var codePoint\\n var length = string.length\\n var leadSurrogate = null\\n var bytes = []\\n\\n for (var i = 0; i < length; ++i) {\\n codePoint = string.charCodeAt(i)\\n\\n // is surrogate component\\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\\n // last char was a lead\\n if (!leadSurrogate) {\\n // no lead yet\\n if (codePoint > 0xDBFF) {\\n // unexpected trail\\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\\n continue\\n } else if (i + 1 === length) {\\n // unpaired lead\\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\\n continue\\n }\\n\\n // valid lead\\n leadSurrogate = codePoint\\n\\n continue\\n }\\n\\n // 2 leads in a row\\n if (codePoint < 0xDC00) {\\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\\n leadSurrogate = codePoint\\n continue\\n }\\n\\n // valid surrogate pair\\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\\n } else if (leadSurrogate) {\\n // valid bmp char, but last char was a lead\\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\\n }\\n\\n leadSurrogate = null\\n\\n // encode utf8\\n if (codePoint < 0x80) {\\n if ((units -= 1) < 0) break\\n bytes.push(codePoint)\\n } else if (codePoint < 0x800) {\\n if ((units -= 2) < 0) break\\n bytes.push(\\n codePoint >> 0x6 | 0xC0,\\n codePoint & 0x3F | 0x80\\n )\\n } else if (codePoint < 0x10000) {\\n if ((units -= 3) < 0) break\\n bytes.push(\\n codePoint >> 0xC | 0xE0,\\n codePoint >> 0x6 & 0x3F | 0x80,\\n codePoint & 0x3F | 0x80\\n )\\n } else if (codePoint < 0x110000) {\\n if ((units -= 4) < 0) break\\n bytes.push(\\n codePoint >> 0x12 | 0xF0,\\n codePoint >> 0xC & 0x3F | 0x80,\\n codePoint >> 0x6 & 0x3F | 0x80,\\n codePoint & 0x3F | 0x80\\n )\\n } else {\\n throw new Error('Invalid code point')\\n }\\n }\\n\\n return bytes\\n}\\n\\nfunction asciiToBytes (str) {\\n var byteArray = []\\n for (var i = 0; i < str.length; ++i) {\\n // Node's code seems to be doing this and not & 0x7F..\\n byteArray.push(str.charCodeAt(i) & 0xFF)\\n }\\n return byteArray\\n}\\n\\nfunction utf16leToBytes (str, units) {\\n var c, hi, lo\\n var byteArray = []\\n for (var i = 0; i < str.length; ++i) {\\n if ((units -= 2) < 0) break\\n\\n c = str.charCodeAt(i)\\n hi = c >> 8\\n lo = c % 256\\n byteArray.push(lo)\\n byteArray.push(hi)\\n }\\n\\n return byteArray\\n}\\n\\nfunction base64ToBytes (str) {\\n return base64.toByteArray(base64clean(str))\\n}\\n\\nfunction blitBuffer (src, dst, offset, length) {\\n for (var i = 0; i < length; ++i) {\\n if ((i + offset >= dst.length) || (i >= src.length)) break\\n dst[i + offset] = src[i]\\n }\\n return i\\n}\\n\\nfunction isnan (val) {\\n return val !== val // eslint-disable-line no-self-compare\\n}\\n\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \\\"./node_modules/webpack/buildin/global.js\\\")))\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/node-libs-browser/node_modules/events/events.js\\\":\\n/*!**********************************************************************!*\\\\\\n !*** ./node_modules/node-libs-browser/node_modules/events/events.js ***!\\n \\\\**********************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n// Copyright Joyent, Inc. and other Node contributors.\\n//\\n// Permission is hereby granted, free of charge, to any person obtaining a\\n// copy of this software and associated documentation files (the\\n// \\\"Software\\\"), to deal in the Software without restriction, including\\n// without limitation the rights to use, copy, modify, merge, publish,\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\n// persons to whom the Software is furnished to do so, subject to the\\n// following conditions:\\n//\\n// The above copyright notice and this permission notice shall be included\\n// in all copies or substantial portions of the Software.\\n//\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\n\\n\\n\\nvar R = typeof Reflect === 'object' ? Reflect : null\\nvar ReflectApply = R && typeof R.apply === 'function'\\n ? R.apply\\n : function ReflectApply(target, receiver, args) {\\n return Function.prototype.apply.call(target, receiver, args);\\n }\\n\\nvar ReflectOwnKeys\\nif (R && typeof R.ownKeys === 'function') {\\n ReflectOwnKeys = R.ownKeys\\n} else if (Object.getOwnPropertySymbols) {\\n ReflectOwnKeys = function ReflectOwnKeys(target) {\\n return Object.getOwnPropertyNames(target)\\n .concat(Object.getOwnPropertySymbols(target));\\n };\\n} else {\\n ReflectOwnKeys = function ReflectOwnKeys(target) {\\n return Object.getOwnPropertyNames(target);\\n };\\n}\\n\\nfunction ProcessEmitWarning(warning) {\\n if (console && console.warn) console.warn(warning);\\n}\\n\\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\\n return value !== value;\\n}\\n\\nfunction EventEmitter() {\\n EventEmitter.init.call(this);\\n}\\nmodule.exports = EventEmitter;\\nmodule.exports.once = once;\\n\\n// Backwards-compat with node 0.10.x\\nEventEmitter.EventEmitter = EventEmitter;\\n\\nEventEmitter.prototype._events = undefined;\\nEventEmitter.prototype._eventsCount = 0;\\nEventEmitter.prototype._maxListeners = undefined;\\n\\n// By default EventEmitters will print a warning if more than 10 listeners are\\n// added to it. This is a useful default which helps finding memory leaks.\\nvar defaultMaxListeners = 10;\\n\\nfunction checkListener(listener) {\\n if (typeof listener !== 'function') {\\n throw new TypeError('The \\\"listener\\\" argument must be of type Function. Received type ' + typeof listener);\\n }\\n}\\n\\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\\n enumerable: true,\\n get: function() {\\n return defaultMaxListeners;\\n },\\n set: function(arg) {\\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\\n throw new RangeError('The value of \\\"defaultMaxListeners\\\" is out of range. It must be a non-negative number. Received ' + arg + '.');\\n }\\n defaultMaxListeners = arg;\\n }\\n});\\n\\nEventEmitter.init = function() {\\n\\n if (this._events === undefined ||\\n this._events === Object.getPrototypeOf(this)._events) {\\n this._events = Object.create(null);\\n this._eventsCount = 0;\\n }\\n\\n this._maxListeners = this._maxListeners || undefined;\\n};\\n\\n// Obviously not all Emitters should be limited to 10. This function allows\\n// that to be increased. Set to zero for unlimited.\\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\\n throw new RangeError('The value of \\\"n\\\" is out of range. It must be a non-negative number. Received ' + n + '.');\\n }\\n this._maxListeners = n;\\n return this;\\n};\\n\\nfunction _getMaxListeners(that) {\\n if (that._maxListeners === undefined)\\n return EventEmitter.defaultMaxListeners;\\n return that._maxListeners;\\n}\\n\\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\\n return _getMaxListeners(this);\\n};\\n\\nEventEmitter.prototype.emit = function emit(type) {\\n var args = [];\\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\\n var doError = (type === 'error');\\n\\n var events = this._events;\\n if (events !== undefined)\\n doError = (doError && events.error === undefined);\\n else if (!doError)\\n return false;\\n\\n // If there is no 'error' event listener then throw.\\n if (doError) {\\n var er;\\n if (args.length > 0)\\n er = args[0];\\n if (er instanceof Error) {\\n // Note: The comments on the `throw` lines are intentional, they show\\n // up in Node's output if this results in an unhandled exception.\\n throw er; // Unhandled 'error' event\\n }\\n // At least give some kind of context to the user\\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\\n err.context = er;\\n throw err; // Unhandled 'error' event\\n }\\n\\n var handler = events[type];\\n\\n if (handler === undefined)\\n return false;\\n\\n if (typeof handler === 'function') {\\n ReflectApply(handler, this, args);\\n } else {\\n var len = handler.length;\\n var listeners = arrayClone(handler, len);\\n for (var i = 0; i < len; ++i)\\n ReflectApply(listeners[i], this, args);\\n }\\n\\n return true;\\n};\\n\\nfunction _addListener(target, type, listener, prepend) {\\n var m;\\n var events;\\n var existing;\\n\\n checkListener(listener);\\n\\n events = target._events;\\n if (events === undefined) {\\n events = target._events = Object.create(null);\\n target._eventsCount = 0;\\n } else {\\n // To avoid recursion in the case that type === \\\"newListener\\\"! Before\\n // adding it to the listeners, first emit \\\"newListener\\\".\\n if (events.newListener !== undefined) {\\n target.emit('newListener', type,\\n listener.listener ? listener.listener : listener);\\n\\n // Re-assign `events` because a newListener handler could have caused the\\n // this._events to be assigned to a new object\\n events = target._events;\\n }\\n existing = events[type];\\n }\\n\\n if (existing === undefined) {\\n // Optimize the case of one listener. Don't need the extra array object.\\n existing = events[type] = listener;\\n ++target._eventsCount;\\n } else {\\n if (typeof existing === 'function') {\\n // Adding the second element, need to change to array.\\n existing = events[type] =\\n prepend ? [listener, existing] : [existing, listener];\\n // If we've already got an array, just append.\\n } else if (prepend) {\\n existing.unshift(listener);\\n } else {\\n existing.push(listener);\\n }\\n\\n // Check for listener leak\\n m = _getMaxListeners(target);\\n if (m > 0 && existing.length > m && !existing.warned) {\\n existing.warned = true;\\n // No error code for this since it is a Warning\\n // eslint-disable-next-line no-restricted-syntax\\n var w = new Error('Possible EventEmitter memory leak detected. ' +\\n existing.length + ' ' + String(type) + ' listeners ' +\\n 'added. Use emitter.setMaxListeners() to ' +\\n 'increase limit');\\n w.name = 'MaxListenersExceededWarning';\\n w.emitter = target;\\n w.type = type;\\n w.count = existing.length;\\n ProcessEmitWarning(w);\\n }\\n }\\n\\n return target;\\n}\\n\\nEventEmitter.prototype.addListener = function addListener(type, listener) {\\n return _addListener(this, type, listener, false);\\n};\\n\\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\\n\\nEventEmitter.prototype.prependListener =\\n function prependListener(type, listener) {\\n return _addListener(this, type, listener, true);\\n };\\n\\nfunction onceWrapper() {\\n if (!this.fired) {\\n this.target.removeListener(this.type, this.wrapFn);\\n this.fired = true;\\n if (arguments.length === 0)\\n return this.listener.call(this.target);\\n return this.listener.apply(this.target, arguments);\\n }\\n}\\n\\nfunction _onceWrap(target, type, listener) {\\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\\n var wrapped = onceWrapper.bind(state);\\n wrapped.listener = listener;\\n state.wrapFn = wrapped;\\n return wrapped;\\n}\\n\\nEventEmitter.prototype.once = function once(type, listener) {\\n checkListener(listener);\\n this.on(type, _onceWrap(this, type, listener));\\n return this;\\n};\\n\\nEventEmitter.prototype.prependOnceListener =\\n function prependOnceListener(type, listener) {\\n checkListener(listener);\\n this.prependListener(type, _onceWrap(this, type, listener));\\n return this;\\n };\\n\\n// Emits a 'removeListener' event if and only if the listener was removed.\\nEventEmitter.prototype.removeListener =\\n function removeListener(type, listener) {\\n var list, events, position, i, originalListener;\\n\\n checkListener(listener);\\n\\n events = this._events;\\n if (events === undefined)\\n return this;\\n\\n list = events[type];\\n if (list === undefined)\\n return this;\\n\\n if (list === listener || list.listener === listener) {\\n if (--this._eventsCount === 0)\\n this._events = Object.create(null);\\n else {\\n delete events[type];\\n if (events.removeListener)\\n this.emit('removeListener', type, list.listener || listener);\\n }\\n } else if (typeof list !== 'function') {\\n position = -1;\\n\\n for (i = list.length - 1; i >= 0; i--) {\\n if (list[i] === listener || list[i].listener === listener) {\\n originalListener = list[i].listener;\\n position = i;\\n break;\\n }\\n }\\n\\n if (position < 0)\\n return this;\\n\\n if (position === 0)\\n list.shift();\\n else {\\n spliceOne(list, position);\\n }\\n\\n if (list.length === 1)\\n events[type] = list[0];\\n\\n if (events.removeListener !== undefined)\\n this.emit('removeListener', type, originalListener || listener);\\n }\\n\\n return this;\\n };\\n\\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\\n\\nEventEmitter.prototype.removeAllListeners =\\n function removeAllListeners(type) {\\n var listeners, events, i;\\n\\n events = this._events;\\n if (events === undefined)\\n return this;\\n\\n // not listening for removeListener, no need to emit\\n if (events.removeListener === undefined) {\\n if (arguments.length === 0) {\\n this._events = Object.create(null);\\n this._eventsCount = 0;\\n } else if (events[type] !== undefined) {\\n if (--this._eventsCount === 0)\\n this._events = Object.create(null);\\n else\\n delete events[type];\\n }\\n return this;\\n }\\n\\n // emit removeListener for all listeners on all events\\n if (arguments.length === 0) {\\n var keys = Object.keys(events);\\n var key;\\n for (i = 0; i < keys.length; ++i) {\\n key = keys[i];\\n if (key === 'removeListener') continue;\\n this.removeAllListeners(key);\\n }\\n this.removeAllListeners('removeListener');\\n this._events = Object.create(null);\\n this._eventsCount = 0;\\n return this;\\n }\\n\\n listeners = events[type];\\n\\n if (typeof listeners === 'function') {\\n this.removeListener(type, listeners);\\n } else if (listeners !== undefined) {\\n // LIFO order\\n for (i = listeners.length - 1; i >= 0; i--) {\\n this.removeListener(type, listeners[i]);\\n }\\n }\\n\\n return this;\\n };\\n\\nfunction _listeners(target, type, unwrap) {\\n var events = target._events;\\n\\n if (events === undefined)\\n return [];\\n\\n var evlistener = events[type];\\n if (evlistener === undefined)\\n return [];\\n\\n if (typeof evlistener === 'function')\\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\\n\\n return unwrap ?\\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\\n}\\n\\nEventEmitter.prototype.listeners = function listeners(type) {\\n return _listeners(this, type, true);\\n};\\n\\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\\n return _listeners(this, type, false);\\n};\\n\\nEventEmitter.listenerCount = function(emitter, type) {\\n if (typeof emitter.listenerCount === 'function') {\\n return emitter.listenerCount(type);\\n } else {\\n return listenerCount.call(emitter, type);\\n }\\n};\\n\\nEventEmitter.prototype.listenerCount = listenerCount;\\nfunction listenerCount(type) {\\n var events = this._events;\\n\\n if (events !== undefined) {\\n var evlistener = events[type];\\n\\n if (typeof evlistener === 'function') {\\n return 1;\\n } else if (evlistener !== undefined) {\\n return evlistener.length;\\n }\\n }\\n\\n return 0;\\n}\\n\\nEventEmitter.prototype.eventNames = function eventNames() {\\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\\n};\\n\\nfunction arrayClone(arr, n) {\\n var copy = new Array(n);\\n for (var i = 0; i < n; ++i)\\n copy[i] = arr[i];\\n return copy;\\n}\\n\\nfunction spliceOne(list, index) {\\n for (; index + 1 < list.length; index++)\\n list[index] = list[index + 1];\\n list.pop();\\n}\\n\\nfunction unwrapListeners(arr) {\\n var ret = new Array(arr.length);\\n for (var i = 0; i < ret.length; ++i) {\\n ret[i] = arr[i].listener || arr[i];\\n }\\n return ret;\\n}\\n\\nfunction once(emitter, name) {\\n return new Promise(function (resolve, reject) {\\n function errorListener(err) {\\n emitter.removeListener(name, resolver);\\n reject(err);\\n }\\n\\n function resolver() {\\n if (typeof emitter.removeListener === 'function') {\\n emitter.removeListener('error', errorListener);\\n }\\n resolve([].slice.call(arguments));\\n };\\n\\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\\n if (name !== 'error') {\\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\\n }\\n });\\n}\\n\\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\\n if (typeof emitter.on === 'function') {\\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\\n }\\n}\\n\\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\\n if (typeof emitter.on === 'function') {\\n if (flags.once) {\\n emitter.once(name, listener);\\n } else {\\n emitter.on(name, listener);\\n }\\n } else if (typeof emitter.addEventListener === 'function') {\\n // EventTarget does not have `error` event semantics like Node\\n // EventEmitters, we do not listen for `error` events here.\\n emitter.addEventListener(name, function wrapListener(arg) {\\n // IE does not have builtin `{ once: true }` support so we\\n // have to do it manually.\\n if (flags.once) {\\n emitter.removeEventListener(name, wrapListener);\\n }\\n listener(arg);\\n });\\n } else {\\n throw new TypeError('The \\\"emitter\\\" argument must be of type EventEmitter. Received type ' + typeof emitter);\\n }\\n}\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/node-libs-browser/node_modules/timers-browserify/main.js\\\":\\n/*!*******************************************************************************!*\\\\\\n !*** ./node_modules/node-libs-browser/node_modules/timers-browserify/main.js ***!\\n \\\\*******************************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== \\\"undefined\\\" && global) ||\\n (typeof self !== \\\"undefined\\\" && self) ||\\n window;\\nvar apply = Function.prototype.apply;\\n\\n// DOM APIs, for completeness\\n\\nexports.setTimeout = function() {\\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\\n};\\nexports.setInterval = function() {\\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\\n};\\nexports.clearTimeout =\\nexports.clearInterval = function(timeout) {\\n if (timeout) {\\n timeout.close();\\n }\\n};\\n\\nfunction Timeout(id, clearFn) {\\n this._id = id;\\n this._clearFn = clearFn;\\n}\\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\\nTimeout.prototype.close = function() {\\n this._clearFn.call(scope, this._id);\\n};\\n\\n// Does not start the time, just sets up the members needed.\\nexports.enroll = function(item, msecs) {\\n clearTimeout(item._idleTimeoutId);\\n item._idleTimeout = msecs;\\n};\\n\\nexports.unenroll = function(item) {\\n clearTimeout(item._idleTimeoutId);\\n item._idleTimeout = -1;\\n};\\n\\nexports._unrefActive = exports.active = function(item) {\\n clearTimeout(item._idleTimeoutId);\\n\\n var msecs = item._idleTimeout;\\n if (msecs >= 0) {\\n item._idleTimeoutId = setTimeout(function onTimeout() {\\n if (item._onTimeout)\\n item._onTimeout();\\n }, msecs);\\n }\\n};\\n\\n// setimmediate attaches itself to the global object\\n__webpack_require__(/*! setimmediate */ \\\"./node_modules/setimmediate/setImmediate.js\\\");\\n// On some exotic environments, it's not clear which object `setimmediate` was\\n// able to install onto. Search each possibility in the same order as the\\n// `setimmediate` library.\\nexports.setImmediate = (typeof self !== \\\"undefined\\\" && self.setImmediate) ||\\n (typeof global !== \\\"undefined\\\" && global.setImmediate) ||\\n (this && this.setImmediate);\\nexports.clearImmediate = (typeof self !== \\\"undefined\\\" && self.clearImmediate) ||\\n (typeof global !== \\\"undefined\\\" && global.clearImmediate) ||\\n (this && this.clearImmediate);\\n\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \\\"./node_modules/webpack/buildin/global.js\\\")))\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/path-browserify/index.js\\\":\\n/*!***********************************************!*\\\\\\n !*** ./node_modules/path-browserify/index.js ***!\\n \\\\***********************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\\n// backported and transplited with Babel, with backwards-compat fixes\\n\\n// Copyright Joyent, Inc. and other Node contributors.\\n//\\n// Permission is hereby granted, free of charge, to any person obtaining a\\n// copy of this software and associated documentation files (the\\n// \\\"Software\\\"), to deal in the Software without restriction, including\\n// without limitation the rights to use, copy, modify, merge, publish,\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\n// persons to whom the Software is furnished to do so, subject to the\\n// following conditions:\\n//\\n// The above copyright notice and this permission notice shall be included\\n// in all copies or substantial portions of the Software.\\n//\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\n\\n// resolves . and .. elements in a path array with directory names there\\n// must be no slashes, empty elements, or device names (c:\\\\) in the array\\n// (so also no leading and trailing slashes - it does not distinguish\\n// relative and absolute paths)\\nfunction normalizeArray(parts, allowAboveRoot) {\\n // if the path tries to go above the root, `up` ends up > 0\\n var up = 0;\\n for (var i = parts.length - 1; i >= 0; i--) {\\n var last = parts[i];\\n if (last === '.') {\\n parts.splice(i, 1);\\n } else if (last === '..') {\\n parts.splice(i, 1);\\n up++;\\n } else if (up) {\\n parts.splice(i, 1);\\n up--;\\n }\\n }\\n\\n // if the path is allowed to go above the root, restore leading ..s\\n if (allowAboveRoot) {\\n for (; up--; up) {\\n parts.unshift('..');\\n }\\n }\\n\\n return parts;\\n}\\n\\n// path.resolve([from ...], to)\\n// posix version\\nexports.resolve = function() {\\n var resolvedPath = '',\\n resolvedAbsolute = false;\\n\\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\\n var path = (i >= 0) ? arguments[i] : process.cwd();\\n\\n // Skip empty and invalid entries\\n if (typeof path !== 'string') {\\n throw new TypeError('Arguments to path.resolve must be strings');\\n } else if (!path) {\\n continue;\\n }\\n\\n resolvedPath = path + '/' + resolvedPath;\\n resolvedAbsolute = path.charAt(0) === '/';\\n }\\n\\n // At this point the path should be resolved to a full absolute path, but\\n // handle relative paths to be safe (might happen when process.cwd() fails)\\n\\n // Normalize the path\\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\\n return !!p;\\n }), !resolvedAbsolute).join('/');\\n\\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\\n};\\n\\n// path.normalize(path)\\n// posix version\\nexports.normalize = function(path) {\\n var isAbsolute = exports.isAbsolute(path),\\n trailingSlash = substr(path, -1) === '/';\\n\\n // Normalize the path\\n path = normalizeArray(filter(path.split('/'), function(p) {\\n return !!p;\\n }), !isAbsolute).join('/');\\n\\n if (!path && !isAbsolute) {\\n path = '.';\\n }\\n if (path && trailingSlash) {\\n path += '/';\\n }\\n\\n return (isAbsolute ? '/' : '') + path;\\n};\\n\\n// posix version\\nexports.isAbsolute = function(path) {\\n return path.charAt(0) === '/';\\n};\\n\\n// posix version\\nexports.join = function() {\\n var paths = Array.prototype.slice.call(arguments, 0);\\n return exports.normalize(filter(paths, function(p, index) {\\n if (typeof p !== 'string') {\\n throw new TypeError('Arguments to path.join must be strings');\\n }\\n return p;\\n }).join('/'));\\n};\\n\\n\\n// path.relative(from, to)\\n// posix version\\nexports.relative = function(from, to) {\\n from = exports.resolve(from).substr(1);\\n to = exports.resolve(to).substr(1);\\n\\n function trim(arr) {\\n var start = 0;\\n for (; start < arr.length; start++) {\\n if (arr[start] !== '') break;\\n }\\n\\n var end = arr.length - 1;\\n for (; end >= 0; end--) {\\n if (arr[end] !== '') break;\\n }\\n\\n if (start > end) return [];\\n return arr.slice(start, end - start + 1);\\n }\\n\\n var fromParts = trim(from.split('/'));\\n var toParts = trim(to.split('/'));\\n\\n var length = Math.min(fromParts.length, toParts.length);\\n var samePartsLength = length;\\n for (var i = 0; i < length; i++) {\\n if (fromParts[i] !== toParts[i]) {\\n samePartsLength = i;\\n break;\\n }\\n }\\n\\n var outputParts = [];\\n for (var i = samePartsLength; i < fromParts.length; i++) {\\n outputParts.push('..');\\n }\\n\\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\\n\\n return outputParts.join('/');\\n};\\n\\nexports.sep = '/';\\nexports.delimiter = ':';\\n\\nexports.dirname = function (path) {\\n if (typeof path !== 'string') path = path + '';\\n if (path.length === 0) return '.';\\n var code = path.charCodeAt(0);\\n var hasRoot = code === 47 /*/*/;\\n var end = -1;\\n var matchedSlash = true;\\n for (var i = path.length - 1; i >= 1; --i) {\\n code = path.charCodeAt(i);\\n if (code === 47 /*/*/) {\\n if (!matchedSlash) {\\n end = i;\\n break;\\n }\\n } else {\\n // We saw the first non-path separator\\n matchedSlash = false;\\n }\\n }\\n\\n if (end === -1) return hasRoot ? '/' : '.';\\n if (hasRoot && end === 1) {\\n // return '//';\\n // Backwards-compat fix:\\n return '/';\\n }\\n return path.slice(0, end);\\n};\\n\\nfunction basename(path) {\\n if (typeof path !== 'string') path = path + '';\\n\\n var start = 0;\\n var end = -1;\\n var matchedSlash = true;\\n var i;\\n\\n for (i = path.length - 1; i >= 0; --i) {\\n if (path.charCodeAt(i) === 47 /*/*/) {\\n // If we reached a path separator that was not part of a set of path\\n // separators at the end of the string, stop now\\n if (!matchedSlash) {\\n start = i + 1;\\n break;\\n }\\n } else if (end === -1) {\\n // We saw the first non-path separator, mark this as the end of our\\n // path component\\n matchedSlash = false;\\n end = i + 1;\\n }\\n }\\n\\n if (end === -1) return '';\\n return path.slice(start, end);\\n}\\n\\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\\n// in new Node.js versions, so only basename() above is backported here\\nexports.basename = function (path, ext) {\\n var f = basename(path);\\n if (ext && f.substr(-1 * ext.length) === ext) {\\n f = f.substr(0, f.length - ext.length);\\n }\\n return f;\\n};\\n\\nexports.extname = function (path) {\\n if (typeof path !== 'string') path = path + '';\\n var startDot = -1;\\n var startPart = 0;\\n var end = -1;\\n var matchedSlash = true;\\n // Track the state of characters (if any) we see before our first dot and\\n // after any path separator we find\\n var preDotState = 0;\\n for (var i = path.length - 1; i >= 0; --i) {\\n var code = path.charCodeAt(i);\\n if (code === 47 /*/*/) {\\n // If we reached a path separator that was not part of a set of path\\n // separators at the end of the string, stop now\\n if (!matchedSlash) {\\n startPart = i + 1;\\n break;\\n }\\n continue;\\n }\\n if (end === -1) {\\n // We saw the first non-path separator, mark this as the end of our\\n // extension\\n matchedSlash = false;\\n end = i + 1;\\n }\\n if (code === 46 /*.*/) {\\n // If this is our first dot, mark it as the start of our extension\\n if (startDot === -1)\\n startDot = i;\\n else if (preDotState !== 1)\\n preDotState = 1;\\n } else if (startDot !== -1) {\\n // We saw a non-dot and non-path separator before our dot, so we should\\n // have a good chance at having a non-empty extension\\n preDotState = -1;\\n }\\n }\\n\\n if (startDot === -1 || end === -1 ||\\n // We saw a non-dot character immediately before the dot\\n preDotState === 0 ||\\n // The (right-most) trimmed path component is exactly '..'\\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\\n return '';\\n }\\n return path.slice(startDot, end);\\n};\\n\\nfunction filter (xs, f) {\\n if (xs.filter) return xs.filter(f);\\n var res = [];\\n for (var i = 0; i < xs.length; i++) {\\n if (f(xs[i], i, xs)) res.push(xs[i]);\\n }\\n return res;\\n}\\n\\n// String.prototype.substr - negative index don't work in IE8\\nvar substr = 'ab'.substr(-1) === 'b'\\n ? function (str, start, len) { return str.substr(start, len) }\\n : function (str, start, len) {\\n if (start < 0) start = str.length + start;\\n return str.substr(start, len);\\n }\\n;\\n\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \\\"./node_modules/process/browser.js\\\")))\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/process-nextick-args/index.js\\\":\\n/*!****************************************************!*\\\\\\n !*** ./node_modules/process-nextick-args/index.js ***!\\n \\\\****************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n/* WEBPACK VAR INJECTION */(function(process) {\\n\\nif (!process.version ||\\n process.version.indexOf('v0.') === 0 ||\\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\\n module.exports = { nextTick: nextTick };\\n} else {\\n module.exports = process\\n}\\n\\nfunction nextTick(fn, arg1, arg2, arg3) {\\n if (typeof fn !== 'function') {\\n throw new TypeError('\\\"callback\\\" argument must be a function');\\n }\\n var len = arguments.length;\\n var args, i;\\n switch (len) {\\n case 0:\\n case 1:\\n return process.nextTick(fn);\\n case 2:\\n return process.nextTick(function afterTickOne() {\\n fn.call(null, arg1);\\n });\\n case 3:\\n return process.nextTick(function afterTickTwo() {\\n fn.call(null, arg1, arg2);\\n });\\n case 4:\\n return process.nextTick(function afterTickThree() {\\n fn.call(null, arg1, arg2, arg3);\\n });\\n default:\\n args = new Array(len - 1);\\n i = 0;\\n while (i < args.length) {\\n args[i++] = arguments[i];\\n }\\n return process.nextTick(function afterTick() {\\n fn.apply(null, args);\\n });\\n }\\n}\\n\\n\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \\\"./node_modules/process/browser.js\\\")))\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/process/browser.js\\\":\\n/*!*****************************************!*\\\\\\n !*** ./node_modules/process/browser.js ***!\\n \\\\*****************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports) {\\n\\n// shim for using process in browser\\nvar process = module.exports = {};\\n\\n// cached from whatever global is present so that test runners that stub it\\n// don't break things. But we need to wrap it in a try catch in case it is\\n// wrapped in strict mode code which doesn't define any globals. It's inside a\\n// function because try/catches deoptimize in certain engines.\\n\\nvar cachedSetTimeout;\\nvar cachedClearTimeout;\\n\\nfunction defaultSetTimout() {\\n throw new Error('setTimeout has not been defined');\\n}\\nfunction defaultClearTimeout () {\\n throw new Error('clearTimeout has not been defined');\\n}\\n(function () {\\n try {\\n if (typeof setTimeout === 'function') {\\n cachedSetTimeout = setTimeout;\\n } else {\\n cachedSetTimeout = defaultSetTimout;\\n }\\n } catch (e) {\\n cachedSetTimeout = defaultSetTimout;\\n }\\n try {\\n if (typeof clearTimeout === 'function') {\\n cachedClearTimeout = clearTimeout;\\n } else {\\n cachedClearTimeout = defaultClearTimeout;\\n }\\n } catch (e) {\\n cachedClearTimeout = defaultClearTimeout;\\n }\\n} ())\\nfunction runTimeout(fun) {\\n if (cachedSetTimeout === setTimeout) {\\n //normal enviroments in sane situations\\n return setTimeout(fun, 0);\\n }\\n // if setTimeout wasn't available but was latter defined\\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\\n cachedSetTimeout = setTimeout;\\n return setTimeout(fun, 0);\\n }\\n try {\\n // when when somebody has screwed with setTimeout but no I.E. maddness\\n return cachedSetTimeout(fun, 0);\\n } catch(e){\\n try {\\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\\n return cachedSetTimeout.call(null, fun, 0);\\n } catch(e){\\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\\n return cachedSetTimeout.call(this, fun, 0);\\n }\\n }\\n\\n\\n}\\nfunction runClearTimeout(marker) {\\n if (cachedClearTimeout === clearTimeout) {\\n //normal enviroments in sane situations\\n return clearTimeout(marker);\\n }\\n // if clearTimeout wasn't available but was latter defined\\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\\n cachedClearTimeout = clearTimeout;\\n return clearTimeout(marker);\\n }\\n try {\\n // when when somebody has screwed with setTimeout but no I.E. maddness\\n return cachedClearTimeout(marker);\\n } catch (e){\\n try {\\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\\n return cachedClearTimeout.call(null, marker);\\n } catch (e){\\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\\n return cachedClearTimeout.call(this, marker);\\n }\\n }\\n\\n\\n\\n}\\nvar queue = [];\\nvar draining = false;\\nvar currentQueue;\\nvar queueIndex = -1;\\n\\nfunction cleanUpNextTick() {\\n if (!draining || !currentQueue) {\\n return;\\n }\\n draining = false;\\n if (currentQueue.length) {\\n queue = currentQueue.concat(queue);\\n } else {\\n queueIndex = -1;\\n }\\n if (queue.length) {\\n drainQueue();\\n }\\n}\\n\\nfunction drainQueue() {\\n if (draining) {\\n return;\\n }\\n var timeout = runTimeout(cleanUpNextTick);\\n draining = true;\\n\\n var len = queue.length;\\n while(len) {\\n currentQueue = queue;\\n queue = [];\\n while (++queueIndex < len) {\\n if (currentQueue) {\\n currentQueue[queueIndex].run();\\n }\\n }\\n queueIndex = -1;\\n len = queue.length;\\n }\\n currentQueue = null;\\n draining = false;\\n runClearTimeout(timeout);\\n}\\n\\nprocess.nextTick = function (fun) {\\n var args = new Array(arguments.length - 1);\\n if (arguments.length > 1) {\\n for (var i = 1; i < arguments.length; i++) {\\n args[i - 1] = arguments[i];\\n }\\n }\\n queue.push(new Item(fun, args));\\n if (queue.length === 1 && !draining) {\\n runTimeout(drainQueue);\\n }\\n};\\n\\n// v8 likes predictible objects\\nfunction Item(fun, array) {\\n this.fun = fun;\\n this.array = array;\\n}\\nItem.prototype.run = function () {\\n this.fun.apply(null, this.array);\\n};\\nprocess.title = 'browser';\\nprocess.browser = true;\\nprocess.env = {};\\nprocess.argv = [];\\nprocess.version = ''; // empty string to avoid regexp issues\\nprocess.versions = {};\\n\\nfunction noop() {}\\n\\nprocess.on = noop;\\nprocess.addListener = noop;\\nprocess.once = noop;\\nprocess.off = noop;\\nprocess.removeListener = noop;\\nprocess.removeAllListeners = noop;\\nprocess.emit = noop;\\nprocess.prependListener = noop;\\nprocess.prependOnceListener = noop;\\n\\nprocess.listeners = function (name) { return [] }\\n\\nprocess.binding = function (name) {\\n throw new Error('process.binding is not supported');\\n};\\n\\nprocess.cwd = function () { return '/' };\\nprocess.chdir = function (dir) {\\n throw new Error('process.chdir is not supported');\\n};\\nprocess.umask = function() { return 0; };\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/duplex-browser.js\\\":\\n/*!********************************************************!*\\\\\\n !*** ./node_modules/readable-stream/duplex-browser.js ***!\\n \\\\********************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\nmodule.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ \\\"./node_modules/readable-stream/lib/_stream_duplex.js\\\");\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/lib/_stream_duplex.js\\\":\\n/*!************************************************************!*\\\\\\n !*** ./node_modules/readable-stream/lib/_stream_duplex.js ***!\\n \\\\************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n// Copyright Joyent, Inc. and other Node contributors.\\n//\\n// Permission is hereby granted, free of charge, to any person obtaining a\\n// copy of this software and associated documentation files (the\\n// \\\"Software\\\"), to deal in the Software without restriction, including\\n// without limitation the rights to use, copy, modify, merge, publish,\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\n// persons to whom the Software is furnished to do so, subject to the\\n// following conditions:\\n//\\n// The above copyright notice and this permission notice shall be included\\n// in all copies or substantial portions of the Software.\\n//\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\n\\n// a duplex stream is just a stream that is both readable and writable.\\n// Since JS doesn't have multiple prototypal inheritance, this class\\n// prototypally inherits from Readable, and then parasitically from\\n// Writable.\\n\\n\\n\\n/**/\\n\\nvar pna = __webpack_require__(/*! process-nextick-args */ \\\"./node_modules/process-nextick-args/index.js\\\");\\n/**/\\n\\n/**/\\nvar objectKeys = Object.keys || function (obj) {\\n var keys = [];\\n for (var key in obj) {\\n keys.push(key);\\n }return keys;\\n};\\n/**/\\n\\nmodule.exports = Duplex;\\n\\n/**/\\nvar util = __webpack_require__(/*! core-util-is */ \\\"./node_modules/core-util-is/lib/util.js\\\");\\nutil.inherits = __webpack_require__(/*! inherits */ \\\"./node_modules/inherits/inherits_browser.js\\\");\\n/**/\\n\\nvar Readable = __webpack_require__(/*! ./_stream_readable */ \\\"./node_modules/readable-stream/lib/_stream_readable.js\\\");\\nvar Writable = __webpack_require__(/*! ./_stream_writable */ \\\"./node_modules/readable-stream/lib/_stream_writable.js\\\");\\n\\nutil.inherits(Duplex, Readable);\\n\\n{\\n // avoid scope creep, the keys array can then be collected\\n var keys = objectKeys(Writable.prototype);\\n for (var v = 0; v < keys.length; v++) {\\n var method = keys[v];\\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\\n }\\n}\\n\\nfunction Duplex(options) {\\n if (!(this instanceof Duplex)) return new Duplex(options);\\n\\n Readable.call(this, options);\\n Writable.call(this, options);\\n\\n if (options && options.readable === false) this.readable = false;\\n\\n if (options && options.writable === false) this.writable = false;\\n\\n this.allowHalfOpen = true;\\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\\n\\n this.once('end', onend);\\n}\\n\\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\\n // making it explicit this property is not enumerable\\n // because otherwise some prototype manipulation in\\n // userland will fail\\n enumerable: false,\\n get: function () {\\n return this._writableState.highWaterMark;\\n }\\n});\\n\\n// the no-half-open enforcer\\nfunction onend() {\\n // if we allow half-open state, or if the writable side ended,\\n // then we're ok.\\n if (this.allowHalfOpen || this._writableState.ended) return;\\n\\n // no more data can be written.\\n // But allow more writes to happen in this tick.\\n pna.nextTick(onEndNT, this);\\n}\\n\\nfunction onEndNT(self) {\\n self.end();\\n}\\n\\nObject.defineProperty(Duplex.prototype, 'destroyed', {\\n get: function () {\\n if (this._readableState === undefined || this._writableState === undefined) {\\n return false;\\n }\\n return this._readableState.destroyed && this._writableState.destroyed;\\n },\\n set: function (value) {\\n // we ignore the value if the stream\\n // has not been initialized yet\\n if (this._readableState === undefined || this._writableState === undefined) {\\n return;\\n }\\n\\n // backward compatibility, the user is explicitly\\n // managing destroyed\\n this._readableState.destroyed = value;\\n this._writableState.destroyed = value;\\n }\\n});\\n\\nDuplex.prototype._destroy = function (err, cb) {\\n this.push(null);\\n this.end();\\n\\n pna.nextTick(cb, err);\\n};\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/lib/_stream_passthrough.js\\\":\\n/*!*****************************************************************!*\\\\\\n !*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***!\\n \\\\*****************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n// Copyright Joyent, Inc. and other Node contributors.\\n//\\n// Permission is hereby granted, free of charge, to any person obtaining a\\n// copy of this software and associated documentation files (the\\n// \\\"Software\\\"), to deal in the Software without restriction, including\\n// without limitation the rights to use, copy, modify, merge, publish,\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\n// persons to whom the Software is furnished to do so, subject to the\\n// following conditions:\\n//\\n// The above copyright notice and this permission notice shall be included\\n// in all copies or substantial portions of the Software.\\n//\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\n\\n// a passthrough stream.\\n// basically just the most minimal sort of Transform stream.\\n// Every written chunk gets output as-is.\\n\\n\\n\\nmodule.exports = PassThrough;\\n\\nvar Transform = __webpack_require__(/*! ./_stream_transform */ \\\"./node_modules/readable-stream/lib/_stream_transform.js\\\");\\n\\n/**/\\nvar util = __webpack_require__(/*! core-util-is */ \\\"./node_modules/core-util-is/lib/util.js\\\");\\nutil.inherits = __webpack_require__(/*! inherits */ \\\"./node_modules/inherits/inherits_browser.js\\\");\\n/**/\\n\\nutil.inherits(PassThrough, Transform);\\n\\nfunction PassThrough(options) {\\n if (!(this instanceof PassThrough)) return new PassThrough(options);\\n\\n Transform.call(this, options);\\n}\\n\\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\\n cb(null, chunk);\\n};\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/lib/_stream_readable.js\\\":\\n/*!**************************************************************!*\\\\\\n !*** ./node_modules/readable-stream/lib/_stream_readable.js ***!\\n \\\\**************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\\n//\\n// Permission is hereby granted, free of charge, to any person obtaining a\\n// copy of this software and associated documentation files (the\\n// \\\"Software\\\"), to deal in the Software without restriction, including\\n// without limitation the rights to use, copy, modify, merge, publish,\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\n// persons to whom the Software is furnished to do so, subject to the\\n// following conditions:\\n//\\n// The above copyright notice and this permission notice shall be included\\n// in all copies or substantial portions of the Software.\\n//\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\n\\n\\n\\n/**/\\n\\nvar pna = __webpack_require__(/*! process-nextick-args */ \\\"./node_modules/process-nextick-args/index.js\\\");\\n/**/\\n\\nmodule.exports = Readable;\\n\\n/**/\\nvar isArray = __webpack_require__(/*! isarray */ \\\"./node_modules/isarray/index.js\\\");\\n/**/\\n\\n/**/\\nvar Duplex;\\n/**/\\n\\nReadable.ReadableState = ReadableState;\\n\\n/**/\\nvar EE = __webpack_require__(/*! events */ \\\"./node_modules/node-libs-browser/node_modules/events/events.js\\\").EventEmitter;\\n\\nvar EElistenerCount = function (emitter, type) {\\n return emitter.listeners(type).length;\\n};\\n/**/\\n\\n/**/\\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \\\"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\\\");\\n/**/\\n\\n/**/\\n\\nvar Buffer = __webpack_require__(/*! safe-buffer */ \\\"./node_modules/safe-buffer/index.js\\\").Buffer;\\nvar OurUint8Array = global.Uint8Array || function () {};\\nfunction _uint8ArrayToBuffer(chunk) {\\n return Buffer.from(chunk);\\n}\\nfunction _isUint8Array(obj) {\\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\\n}\\n\\n/**/\\n\\n/**/\\nvar util = __webpack_require__(/*! core-util-is */ \\\"./node_modules/core-util-is/lib/util.js\\\");\\nutil.inherits = __webpack_require__(/*! inherits */ \\\"./node_modules/inherits/inherits_browser.js\\\");\\n/**/\\n\\n/**/\\nvar debugUtil = __webpack_require__(/*! util */ 0);\\nvar debug = void 0;\\nif (debugUtil && debugUtil.debuglog) {\\n debug = debugUtil.debuglog('stream');\\n} else {\\n debug = function () {};\\n}\\n/**/\\n\\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \\\"./node_modules/readable-stream/lib/internal/streams/BufferList.js\\\");\\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \\\"./node_modules/readable-stream/lib/internal/streams/destroy.js\\\");\\nvar StringDecoder;\\n\\nutil.inherits(Readable, Stream);\\n\\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\\n\\nfunction prependListener(emitter, event, fn) {\\n // Sadly this is not cacheable as some libraries bundle their own\\n // event emitter implementation with them.\\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\\n\\n // This is a hack to make sure that our error handler is attached before any\\n // userland ones. NEVER DO THIS. This is here only because this code needs\\n // to continue to work with older versions of Node.js that do not include\\n // the prependListener() method. The goal is to eventually remove this hack.\\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\\n}\\n\\nfunction ReadableState(options, stream) {\\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \\\"./node_modules/readable-stream/lib/_stream_duplex.js\\\");\\n\\n options = options || {};\\n\\n // Duplex streams are both readable and writable, but share\\n // the same options object.\\n // However, some cases require setting options to different\\n // values for the readable and the writable sides of the duplex stream.\\n // These options can be provided separately as readableXXX and writableXXX.\\n var isDuplex = stream instanceof Duplex;\\n\\n // object stream flag. Used to make read(n) ignore n and to\\n // make all the buffer merging and length checks go away\\n this.objectMode = !!options.objectMode;\\n\\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\\n\\n // the point at which it stops calling _read() to fill the buffer\\n // Note: 0 is a valid value, means \\\"don't call _read preemptively ever\\\"\\n var hwm = options.highWaterMark;\\n var readableHwm = options.readableHighWaterMark;\\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\\n\\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\\n\\n // cast to ints.\\n this.highWaterMark = Math.floor(this.highWaterMark);\\n\\n // A linked list is used to store data chunks instead of an array because the\\n // linked list can remove elements from the beginning faster than\\n // array.shift()\\n this.buffer = new BufferList();\\n this.length = 0;\\n this.pipes = null;\\n this.pipesCount = 0;\\n this.flowing = null;\\n this.ended = false;\\n this.endEmitted = false;\\n this.reading = false;\\n\\n // a flag to be able to tell if the event 'readable'/'data' is emitted\\n // immediately, or on a later tick. We set this to true at first, because\\n // any actions that shouldn't happen until \\\"later\\\" should generally also\\n // not happen before the first read call.\\n this.sync = true;\\n\\n // whenever we return null, then we set a flag to say\\n // that we're awaiting a 'readable' event emission.\\n this.needReadable = false;\\n this.emittedReadable = false;\\n this.readableListening = false;\\n this.resumeScheduled = false;\\n\\n // has it been destroyed\\n this.destroyed = false;\\n\\n // Crypto is kind of old and crusty. Historically, its default string\\n // encoding is 'binary' so we have to make this configurable.\\n // Everything else in the universe uses 'utf8', though.\\n this.defaultEncoding = options.defaultEncoding || 'utf8';\\n\\n // the number of writers that are awaiting a drain event in .pipe()s\\n this.awaitDrain = 0;\\n\\n // if true, a maybeReadMore has been scheduled\\n this.readingMore = false;\\n\\n this.decoder = null;\\n this.encoding = null;\\n if (options.encoding) {\\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \\\"./node_modules/string_decoder/lib/string_decoder.js\\\").StringDecoder;\\n this.decoder = new StringDecoder(options.encoding);\\n this.encoding = options.encoding;\\n }\\n}\\n\\nfunction Readable(options) {\\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \\\"./node_modules/readable-stream/lib/_stream_duplex.js\\\");\\n\\n if (!(this instanceof Readable)) return new Readable(options);\\n\\n this._readableState = new ReadableState(options, this);\\n\\n // legacy\\n this.readable = true;\\n\\n if (options) {\\n if (typeof options.read === 'function') this._read = options.read;\\n\\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\\n }\\n\\n Stream.call(this);\\n}\\n\\nObject.defineProperty(Readable.prototype, 'destroyed', {\\n get: function () {\\n if (this._readableState === undefined) {\\n return false;\\n }\\n return this._readableState.destroyed;\\n },\\n set: function (value) {\\n // we ignore the value if the stream\\n // has not been initialized yet\\n if (!this._readableState) {\\n return;\\n }\\n\\n // backward compatibility, the user is explicitly\\n // managing destroyed\\n this._readableState.destroyed = value;\\n }\\n});\\n\\nReadable.prototype.destroy = destroyImpl.destroy;\\nReadable.prototype._undestroy = destroyImpl.undestroy;\\nReadable.prototype._destroy = function (err, cb) {\\n this.push(null);\\n cb(err);\\n};\\n\\n// Manually shove something into the read() buffer.\\n// This returns true if the highWaterMark has not been hit yet,\\n// similar to how Writable.write() returns true if you should\\n// write() some more.\\nReadable.prototype.push = function (chunk, encoding) {\\n var state = this._readableState;\\n var skipChunkCheck;\\n\\n if (!state.objectMode) {\\n if (typeof chunk === 'string') {\\n encoding = encoding || state.defaultEncoding;\\n if (encoding !== state.encoding) {\\n chunk = Buffer.from(chunk, encoding);\\n encoding = '';\\n }\\n skipChunkCheck = true;\\n }\\n } else {\\n skipChunkCheck = true;\\n }\\n\\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\\n};\\n\\n// Unshift should *always* be something directly out of read()\\nReadable.prototype.unshift = function (chunk) {\\n return readableAddChunk(this, chunk, null, true, false);\\n};\\n\\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\\n var state = stream._readableState;\\n if (chunk === null) {\\n state.reading = false;\\n onEofChunk(stream, state);\\n } else {\\n var er;\\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\\n if (er) {\\n stream.emit('error', er);\\n } else if (state.objectMode || chunk && chunk.length > 0) {\\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\\n chunk = _uint8ArrayToBuffer(chunk);\\n }\\n\\n if (addToFront) {\\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\\n } else if (state.ended) {\\n stream.emit('error', new Error('stream.push() after EOF'));\\n } else {\\n state.reading = false;\\n if (state.decoder && !encoding) {\\n chunk = state.decoder.write(chunk);\\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\\n } else {\\n addChunk(stream, state, chunk, false);\\n }\\n }\\n } else if (!addToFront) {\\n state.reading = false;\\n }\\n }\\n\\n return needMoreData(state);\\n}\\n\\nfunction addChunk(stream, state, chunk, addToFront) {\\n if (state.flowing && state.length === 0 && !state.sync) {\\n stream.emit('data', chunk);\\n stream.read(0);\\n } else {\\n // update the buffer info.\\n state.length += state.objectMode ? 1 : chunk.length;\\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\\n\\n if (state.needReadable) emitReadable(stream);\\n }\\n maybeReadMore(stream, state);\\n}\\n\\nfunction chunkInvalid(state, chunk) {\\n var er;\\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\\n er = new TypeError('Invalid non-string/buffer chunk');\\n }\\n return er;\\n}\\n\\n// if it's past the high water mark, we can push in some more.\\n// Also, if we have no data yet, we can stand some\\n// more bytes. This is to work around cases where hwm=0,\\n// such as the repl. Also, if the push() triggered a\\n// readable event, and the user called read(largeNumber) such that\\n// needReadable was set, then we ought to push more, so that another\\n// 'readable' event will be triggered.\\nfunction needMoreData(state) {\\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\\n}\\n\\nReadable.prototype.isPaused = function () {\\n return this._readableState.flowing === false;\\n};\\n\\n// backwards compatibility.\\nReadable.prototype.setEncoding = function (enc) {\\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \\\"./node_modules/string_decoder/lib/string_decoder.js\\\").StringDecoder;\\n this._readableState.decoder = new StringDecoder(enc);\\n this._readableState.encoding = enc;\\n return this;\\n};\\n\\n// Don't raise the hwm > 8MB\\nvar MAX_HWM = 0x800000;\\nfunction computeNewHighWaterMark(n) {\\n if (n >= MAX_HWM) {\\n n = MAX_HWM;\\n } else {\\n // Get the next highest power of 2 to prevent increasing hwm excessively in\\n // tiny amounts\\n n--;\\n n |= n >>> 1;\\n n |= n >>> 2;\\n n |= n >>> 4;\\n n |= n >>> 8;\\n n |= n >>> 16;\\n n++;\\n }\\n return n;\\n}\\n\\n// This function is designed to be inlinable, so please take care when making\\n// changes to the function body.\\nfunction howMuchToRead(n, state) {\\n if (n <= 0 || state.length === 0 && state.ended) return 0;\\n if (state.objectMode) return 1;\\n if (n !== n) {\\n // Only flow one buffer at a time\\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\\n }\\n // If we're asking for more than the current hwm, then raise the hwm.\\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\\n if (n <= state.length) return n;\\n // Don't have enough\\n if (!state.ended) {\\n state.needReadable = true;\\n return 0;\\n }\\n return state.length;\\n}\\n\\n// you can override either this method, or the async _read(n) below.\\nReadable.prototype.read = function (n) {\\n debug('read', n);\\n n = parseInt(n, 10);\\n var state = this._readableState;\\n var nOrig = n;\\n\\n if (n !== 0) state.emittedReadable = false;\\n\\n // if we're doing read(0) to trigger a readable event, but we\\n // already have a bunch of data in the buffer, then just trigger\\n // the 'readable' event and move on.\\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\\n debug('read: emitReadable', state.length, state.ended);\\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\\n return null;\\n }\\n\\n n = howMuchToRead(n, state);\\n\\n // if we've ended, and we're now clear, then finish it up.\\n if (n === 0 && state.ended) {\\n if (state.length === 0) endReadable(this);\\n return null;\\n }\\n\\n // All the actual chunk generation logic needs to be\\n // *below* the call to _read. The reason is that in certain\\n // synthetic stream cases, such as passthrough streams, _read\\n // may be a completely synchronous operation which may change\\n // the state of the read buffer, providing enough data when\\n // before there was *not* enough.\\n //\\n // So, the steps are:\\n // 1. Figure out what the state of things will be after we do\\n // a read from the buffer.\\n //\\n // 2. If that resulting state will trigger a _read, then call _read.\\n // Note that this may be asynchronous, or synchronous. Yes, it is\\n // deeply ugly to write APIs this way, but that still doesn't mean\\n // that the Readable class should behave improperly, as streams are\\n // designed to be sync/async agnostic.\\n // Take note if the _read call is sync or async (ie, if the read call\\n // has returned yet), so that we know whether or not it's safe to emit\\n // 'readable' etc.\\n //\\n // 3. Actually pull the requested chunks out of the buffer and return.\\n\\n // if we need a readable event, then we need to do some reading.\\n var doRead = state.needReadable;\\n debug('need readable', doRead);\\n\\n // if we currently have less than the highWaterMark, then also read some\\n if (state.length === 0 || state.length - n < state.highWaterMark) {\\n doRead = true;\\n debug('length less than watermark', doRead);\\n }\\n\\n // however, if we've ended, then there's no point, and if we're already\\n // reading, then it's unnecessary.\\n if (state.ended || state.reading) {\\n doRead = false;\\n debug('reading or ended', doRead);\\n } else if (doRead) {\\n debug('do read');\\n state.reading = true;\\n state.sync = true;\\n // if the length is currently zero, then we *need* a readable event.\\n if (state.length === 0) state.needReadable = true;\\n // call internal read method\\n this._read(state.highWaterMark);\\n state.sync = false;\\n // If _read pushed data synchronously, then `reading` will be false,\\n // and we need to re-evaluate how much data we can return to the user.\\n if (!state.reading) n = howMuchToRead(nOrig, state);\\n }\\n\\n var ret;\\n if (n > 0) ret = fromList(n, state);else ret = null;\\n\\n if (ret === null) {\\n state.needReadable = true;\\n n = 0;\\n } else {\\n state.length -= n;\\n }\\n\\n if (state.length === 0) {\\n // If we have nothing in the buffer, then we want to know\\n // as soon as we *do* get something into the buffer.\\n if (!state.ended) state.needReadable = true;\\n\\n // If we tried to read() past the EOF, then emit end on the next tick.\\n if (nOrig !== n && state.ended) endReadable(this);\\n }\\n\\n if (ret !== null) this.emit('data', ret);\\n\\n return ret;\\n};\\n\\nfunction onEofChunk(stream, state) {\\n if (state.ended) return;\\n if (state.decoder) {\\n var chunk = state.decoder.end();\\n if (chunk && chunk.length) {\\n state.buffer.push(chunk);\\n state.length += state.objectMode ? 1 : chunk.length;\\n }\\n }\\n state.ended = true;\\n\\n // emit 'readable' now to make sure it gets picked up.\\n emitReadable(stream);\\n}\\n\\n// Don't emit readable right away in sync mode, because this can trigger\\n// another read() call => stack overflow. This way, it might trigger\\n// a nextTick recursion warning, but that's not so bad.\\nfunction emitReadable(stream) {\\n var state = stream._readableState;\\n state.needReadable = false;\\n if (!state.emittedReadable) {\\n debug('emitReadable', state.flowing);\\n state.emittedReadable = true;\\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\\n }\\n}\\n\\nfunction emitReadable_(stream) {\\n debug('emit readable');\\n stream.emit('readable');\\n flow(stream);\\n}\\n\\n// at this point, the user has presumably seen the 'readable' event,\\n// and called read() to consume some data. that may have triggered\\n// in turn another _read(n) call, in which case reading = true if\\n// it's in progress.\\n// However, if we're not ended, or reading, and the length < hwm,\\n// then go ahead and try to read some more preemptively.\\nfunction maybeReadMore(stream, state) {\\n if (!state.readingMore) {\\n state.readingMore = true;\\n pna.nextTick(maybeReadMore_, stream, state);\\n }\\n}\\n\\nfunction maybeReadMore_(stream, state) {\\n var len = state.length;\\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\\n debug('maybeReadMore read 0');\\n stream.read(0);\\n if (len === state.length)\\n // didn't get any data, stop spinning.\\n break;else len = state.length;\\n }\\n state.readingMore = false;\\n}\\n\\n// abstract method. to be overridden in specific implementation classes.\\n// call cb(er, data) where data is <= n in length.\\n// for virtual (non-string, non-buffer) streams, \\\"length\\\" is somewhat\\n// arbitrary, and perhaps not very meaningful.\\nReadable.prototype._read = function (n) {\\n this.emit('error', new Error('_read() is not implemented'));\\n};\\n\\nReadable.prototype.pipe = function (dest, pipeOpts) {\\n var src = this;\\n var state = this._readableState;\\n\\n switch (state.pipesCount) {\\n case 0:\\n state.pipes = dest;\\n break;\\n case 1:\\n state.pipes = [state.pipes, dest];\\n break;\\n default:\\n state.pipes.push(dest);\\n break;\\n }\\n state.pipesCount += 1;\\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\\n\\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\\n\\n var endFn = doEnd ? onend : unpipe;\\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\\n\\n dest.on('unpipe', onunpipe);\\n function onunpipe(readable, unpipeInfo) {\\n debug('onunpipe');\\n if (readable === src) {\\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\\n unpipeInfo.hasUnpiped = true;\\n cleanup();\\n }\\n }\\n }\\n\\n function onend() {\\n debug('onend');\\n dest.end();\\n }\\n\\n // when the dest drains, it reduces the awaitDrain counter\\n // on the source. This would be more elegant with a .once()\\n // handler in flow(), but adding and removing repeatedly is\\n // too slow.\\n var ondrain = pipeOnDrain(src);\\n dest.on('drain', ondrain);\\n\\n var cleanedUp = false;\\n function cleanup() {\\n debug('cleanup');\\n // cleanup event handlers once the pipe is broken\\n dest.removeListener('close', onclose);\\n dest.removeListener('finish', onfinish);\\n dest.removeListener('drain', ondrain);\\n dest.removeListener('error', onerror);\\n dest.removeListener('unpipe', onunpipe);\\n src.removeListener('end', onend);\\n src.removeListener('end', unpipe);\\n src.removeListener('data', ondata);\\n\\n cleanedUp = true;\\n\\n // if the reader is waiting for a drain event from this\\n // specific writer, then it would cause it to never start\\n // flowing again.\\n // So, if this is awaiting a drain, then we just call it now.\\n // If we don't know, then assume that we are waiting for one.\\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\\n }\\n\\n // If the user pushes more data while we're writing to dest then we'll end up\\n // in ondata again. However, we only want to increase awaitDrain once because\\n // dest will only emit one 'drain' event for the multiple writes.\\n // => Introduce a guard on increasing awaitDrain.\\n var increasedAwaitDrain = false;\\n src.on('data', ondata);\\n function ondata(chunk) {\\n debug('ondata');\\n increasedAwaitDrain = false;\\n var ret = dest.write(chunk);\\n if (false === ret && !increasedAwaitDrain) {\\n // If the user unpiped during `dest.write()`, it is possible\\n // to get stuck in a permanently paused state if that write\\n // also returned false.\\n // => Check whether `dest` is still a piping destination.\\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\\n debug('false write response, pause', src._readableState.awaitDrain);\\n src._readableState.awaitDrain++;\\n increasedAwaitDrain = true;\\n }\\n src.pause();\\n }\\n }\\n\\n // if the dest has an error, then stop piping into it.\\n // however, don't suppress the throwing behavior for this.\\n function onerror(er) {\\n debug('onerror', er);\\n unpipe();\\n dest.removeListener('error', onerror);\\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\\n }\\n\\n // Make sure our error handler is attached before userland ones.\\n prependListener(dest, 'error', onerror);\\n\\n // Both close and finish should trigger unpipe, but only once.\\n function onclose() {\\n dest.removeListener('finish', onfinish);\\n unpipe();\\n }\\n dest.once('close', onclose);\\n function onfinish() {\\n debug('onfinish');\\n dest.removeListener('close', onclose);\\n unpipe();\\n }\\n dest.once('finish', onfinish);\\n\\n function unpipe() {\\n debug('unpipe');\\n src.unpipe(dest);\\n }\\n\\n // tell the dest that it's being piped to\\n dest.emit('pipe', src);\\n\\n // start the flow if it hasn't been started already.\\n if (!state.flowing) {\\n debug('pipe resume');\\n src.resume();\\n }\\n\\n return dest;\\n};\\n\\nfunction pipeOnDrain(src) {\\n return function () {\\n var state = src._readableState;\\n debug('pipeOnDrain', state.awaitDrain);\\n if (state.awaitDrain) state.awaitDrain--;\\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\\n state.flowing = true;\\n flow(src);\\n }\\n };\\n}\\n\\nReadable.prototype.unpipe = function (dest) {\\n var state = this._readableState;\\n var unpipeInfo = { hasUnpiped: false };\\n\\n // if we're not piping anywhere, then do nothing.\\n if (state.pipesCount === 0) return this;\\n\\n // just one destination. most common case.\\n if (state.pipesCount === 1) {\\n // passed in one, but it's not the right one.\\n if (dest && dest !== state.pipes) return this;\\n\\n if (!dest) dest = state.pipes;\\n\\n // got a match.\\n state.pipes = null;\\n state.pipesCount = 0;\\n state.flowing = false;\\n if (dest) dest.emit('unpipe', this, unpipeInfo);\\n return this;\\n }\\n\\n // slow case. multiple pipe destinations.\\n\\n if (!dest) {\\n // remove all.\\n var dests = state.pipes;\\n var len = state.pipesCount;\\n state.pipes = null;\\n state.pipesCount = 0;\\n state.flowing = false;\\n\\n for (var i = 0; i < len; i++) {\\n dests[i].emit('unpipe', this, unpipeInfo);\\n }return this;\\n }\\n\\n // try to find the right one.\\n var index = indexOf(state.pipes, dest);\\n if (index === -1) return this;\\n\\n state.pipes.splice(index, 1);\\n state.pipesCount -= 1;\\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\\n\\n dest.emit('unpipe', this, unpipeInfo);\\n\\n return this;\\n};\\n\\n// set up data events if they are asked for\\n// Ensure readable listeners eventually get something\\nReadable.prototype.on = function (ev, fn) {\\n var res = Stream.prototype.on.call(this, ev, fn);\\n\\n if (ev === 'data') {\\n // Start flowing on next tick if stream isn't explicitly paused\\n if (this._readableState.flowing !== false) this.resume();\\n } else if (ev === 'readable') {\\n var state = this._readableState;\\n if (!state.endEmitted && !state.readableListening) {\\n state.readableListening = state.needReadable = true;\\n state.emittedReadable = false;\\n if (!state.reading) {\\n pna.nextTick(nReadingNextTick, this);\\n } else if (state.length) {\\n emitReadable(this);\\n }\\n }\\n }\\n\\n return res;\\n};\\nReadable.prototype.addListener = Readable.prototype.on;\\n\\nfunction nReadingNextTick(self) {\\n debug('readable nexttick read 0');\\n self.read(0);\\n}\\n\\n// pause() and resume() are remnants of the legacy readable stream API\\n// If the user uses them, then switch into old mode.\\nReadable.prototype.resume = function () {\\n var state = this._readableState;\\n if (!state.flowing) {\\n debug('resume');\\n state.flowing = true;\\n resume(this, state);\\n }\\n return this;\\n};\\n\\nfunction resume(stream, state) {\\n if (!state.resumeScheduled) {\\n state.resumeScheduled = true;\\n pna.nextTick(resume_, stream, state);\\n }\\n}\\n\\nfunction resume_(stream, state) {\\n if (!state.reading) {\\n debug('resume read 0');\\n stream.read(0);\\n }\\n\\n state.resumeScheduled = false;\\n state.awaitDrain = 0;\\n stream.emit('resume');\\n flow(stream);\\n if (state.flowing && !state.reading) stream.read(0);\\n}\\n\\nReadable.prototype.pause = function () {\\n debug('call pause flowing=%j', this._readableState.flowing);\\n if (false !== this._readableState.flowing) {\\n debug('pause');\\n this._readableState.flowing = false;\\n this.emit('pause');\\n }\\n return this;\\n};\\n\\nfunction flow(stream) {\\n var state = stream._readableState;\\n debug('flow', state.flowing);\\n while (state.flowing && stream.read() !== null) {}\\n}\\n\\n// wrap an old-style stream as the async data source.\\n// This is *not* part of the readable stream interface.\\n// It is an ugly unfortunate mess of history.\\nReadable.prototype.wrap = function (stream) {\\n var _this = this;\\n\\n var state = this._readableState;\\n var paused = false;\\n\\n stream.on('end', function () {\\n debug('wrapped end');\\n if (state.decoder && !state.ended) {\\n var chunk = state.decoder.end();\\n if (chunk && chunk.length) _this.push(chunk);\\n }\\n\\n _this.push(null);\\n });\\n\\n stream.on('data', function (chunk) {\\n debug('wrapped data');\\n if (state.decoder) chunk = state.decoder.write(chunk);\\n\\n // don't skip over falsy values in objectMode\\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\\n\\n var ret = _this.push(chunk);\\n if (!ret) {\\n paused = true;\\n stream.pause();\\n }\\n });\\n\\n // proxy all the other methods.\\n // important when wrapping filters and duplexes.\\n for (var i in stream) {\\n if (this[i] === undefined && typeof stream[i] === 'function') {\\n this[i] = function (method) {\\n return function () {\\n return stream[method].apply(stream, arguments);\\n };\\n }(i);\\n }\\n }\\n\\n // proxy certain important events.\\n for (var n = 0; n < kProxyEvents.length; n++) {\\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\\n }\\n\\n // when we try to consume some more bytes, simply unpause the\\n // underlying stream.\\n this._read = function (n) {\\n debug('wrapped _read', n);\\n if (paused) {\\n paused = false;\\n stream.resume();\\n }\\n };\\n\\n return this;\\n};\\n\\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\\n // making it explicit this property is not enumerable\\n // because otherwise some prototype manipulation in\\n // userland will fail\\n enumerable: false,\\n get: function () {\\n return this._readableState.highWaterMark;\\n }\\n});\\n\\n// exposed for testing purposes only.\\nReadable._fromList = fromList;\\n\\n// Pluck off n bytes from an array of buffers.\\n// Length is the combined lengths of all the buffers in the list.\\n// This function is designed to be inlinable, so please take care when making\\n// changes to the function body.\\nfunction fromList(n, state) {\\n // nothing buffered\\n if (state.length === 0) return null;\\n\\n var ret;\\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\\n // read it all, truncate the list\\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\\n state.buffer.clear();\\n } else {\\n // read part of list\\n ret = fromListPartial(n, state.buffer, state.decoder);\\n }\\n\\n return ret;\\n}\\n\\n// Extracts only enough buffered data to satisfy the amount requested.\\n// This function is designed to be inlinable, so please take care when making\\n// changes to the function body.\\nfunction fromListPartial(n, list, hasStrings) {\\n var ret;\\n if (n < list.head.data.length) {\\n // slice is the same for buffers and strings\\n ret = list.head.data.slice(0, n);\\n list.head.data = list.head.data.slice(n);\\n } else if (n === list.head.data.length) {\\n // first chunk is a perfect match\\n ret = list.shift();\\n } else {\\n // result spans more than one buffer\\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\\n }\\n return ret;\\n}\\n\\n// Copies a specified amount of characters from the list of buffered data\\n// chunks.\\n// This function is designed to be inlinable, so please take care when making\\n// changes to the function body.\\nfunction copyFromBufferString(n, list) {\\n var p = list.head;\\n var c = 1;\\n var ret = p.data;\\n n -= ret.length;\\n while (p = p.next) {\\n var str = p.data;\\n var nb = n > str.length ? str.length : n;\\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\\n n -= nb;\\n if (n === 0) {\\n if (nb === str.length) {\\n ++c;\\n if (p.next) list.head = p.next;else list.head = list.tail = null;\\n } else {\\n list.head = p;\\n p.data = str.slice(nb);\\n }\\n break;\\n }\\n ++c;\\n }\\n list.length -= c;\\n return ret;\\n}\\n\\n// Copies a specified amount of bytes from the list of buffered data chunks.\\n// This function is designed to be inlinable, so please take care when making\\n// changes to the function body.\\nfunction copyFromBuffer(n, list) {\\n var ret = Buffer.allocUnsafe(n);\\n var p = list.head;\\n var c = 1;\\n p.data.copy(ret);\\n n -= p.data.length;\\n while (p = p.next) {\\n var buf = p.data;\\n var nb = n > buf.length ? buf.length : n;\\n buf.copy(ret, ret.length - n, 0, nb);\\n n -= nb;\\n if (n === 0) {\\n if (nb === buf.length) {\\n ++c;\\n if (p.next) list.head = p.next;else list.head = list.tail = null;\\n } else {\\n list.head = p;\\n p.data = buf.slice(nb);\\n }\\n break;\\n }\\n ++c;\\n }\\n list.length -= c;\\n return ret;\\n}\\n\\nfunction endReadable(stream) {\\n var state = stream._readableState;\\n\\n // If we get here before consuming all the bytes, then that is a\\n // bug in node. Should never happen.\\n if (state.length > 0) throw new Error('\\\"endReadable()\\\" called on non-empty stream');\\n\\n if (!state.endEmitted) {\\n state.ended = true;\\n pna.nextTick(endReadableNT, state, stream);\\n }\\n}\\n\\nfunction endReadableNT(state, stream) {\\n // Check that we didn't get one last unshift.\\n if (!state.endEmitted && state.length === 0) {\\n state.endEmitted = true;\\n stream.readable = false;\\n stream.emit('end');\\n }\\n}\\n\\nfunction indexOf(xs, x) {\\n for (var i = 0, l = xs.length; i < l; i++) {\\n if (xs[i] === x) return i;\\n }\\n return -1;\\n}\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \\\"./node_modules/webpack/buildin/global.js\\\"), __webpack_require__(/*! ./../../process/browser.js */ \\\"./node_modules/process/browser.js\\\")))\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/lib/_stream_transform.js\\\":\\n/*!***************************************************************!*\\\\\\n !*** ./node_modules/readable-stream/lib/_stream_transform.js ***!\\n \\\\***************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n// Copyright Joyent, Inc. and other Node contributors.\\n//\\n// Permission is hereby granted, free of charge, to any person obtaining a\\n// copy of this software and associated documentation files (the\\n// \\\"Software\\\"), to deal in the Software without restriction, including\\n// without limitation the rights to use, copy, modify, merge, publish,\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\n// persons to whom the Software is furnished to do so, subject to the\\n// following conditions:\\n//\\n// The above copyright notice and this permission notice shall be included\\n// in all copies or substantial portions of the Software.\\n//\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\n\\n// a transform stream is a readable/writable stream where you do\\n// something with the data. Sometimes it's called a \\\"filter\\\",\\n// but that's not a great name for it, since that implies a thing where\\n// some bits pass through, and others are simply ignored. (That would\\n// be a valid example of a transform, of course.)\\n//\\n// While the output is causally related to the input, it's not a\\n// necessarily symmetric or synchronous transformation. For example,\\n// a zlib stream might take multiple plain-text writes(), and then\\n// emit a single compressed chunk some time in the future.\\n//\\n// Here's how this works:\\n//\\n// The Transform stream has all the aspects of the readable and writable\\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\\n// internally, and returns false if there's a lot of pending writes\\n// buffered up. When you call read(), that calls _read(n) until\\n// there's enough pending readable data buffered up.\\n//\\n// In a transform stream, the written data is placed in a buffer. When\\n// _read(n) is called, it transforms the queued up data, calling the\\n// buffered _write cb's as it consumes chunks. If consuming a single\\n// written chunk would result in multiple output chunks, then the first\\n// outputted bit calls the readcb, and subsequent chunks just go into\\n// the read buffer, and will cause it to emit 'readable' if necessary.\\n//\\n// This way, back-pressure is actually determined by the reading side,\\n// since _read has to be called to start processing a new chunk. However,\\n// a pathological inflate type of transform can cause excessive buffering\\n// here. For example, imagine a stream where every byte of input is\\n// interpreted as an integer from 0-255, and then results in that many\\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\\n// 1kb of data being output. In this case, you could write a very small\\n// amount of input, and end up with a very large amount of output. In\\n// such a pathological inflating mechanism, there'd be no way to tell\\n// the system to stop doing the transform. A single 4MB write could\\n// cause the system to run out of memory.\\n//\\n// However, even in such a pathological case, only a single written chunk\\n// would be consumed, and then the rest would wait (un-transformed) until\\n// the results of the previous transformed chunk were consumed.\\n\\n\\n\\nmodule.exports = Transform;\\n\\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \\\"./node_modules/readable-stream/lib/_stream_duplex.js\\\");\\n\\n/**/\\nvar util = __webpack_require__(/*! core-util-is */ \\\"./node_modules/core-util-is/lib/util.js\\\");\\nutil.inherits = __webpack_require__(/*! inherits */ \\\"./node_modules/inherits/inherits_browser.js\\\");\\n/**/\\n\\nutil.inherits(Transform, Duplex);\\n\\nfunction afterTransform(er, data) {\\n var ts = this._transformState;\\n ts.transforming = false;\\n\\n var cb = ts.writecb;\\n\\n if (!cb) {\\n return this.emit('error', new Error('write callback called multiple times'));\\n }\\n\\n ts.writechunk = null;\\n ts.writecb = null;\\n\\n if (data != null) // single equals check for both `null` and `undefined`\\n this.push(data);\\n\\n cb(er);\\n\\n var rs = this._readableState;\\n rs.reading = false;\\n if (rs.needReadable || rs.length < rs.highWaterMark) {\\n this._read(rs.highWaterMark);\\n }\\n}\\n\\nfunction Transform(options) {\\n if (!(this instanceof Transform)) return new Transform(options);\\n\\n Duplex.call(this, options);\\n\\n this._transformState = {\\n afterTransform: afterTransform.bind(this),\\n needTransform: false,\\n transforming: false,\\n writecb: null,\\n writechunk: null,\\n writeencoding: null\\n };\\n\\n // start out asking for a readable event once data is transformed.\\n this._readableState.needReadable = true;\\n\\n // we have implemented the _read method, and done the other things\\n // that Readable wants before the first _read call, so unset the\\n // sync guard flag.\\n this._readableState.sync = false;\\n\\n if (options) {\\n if (typeof options.transform === 'function') this._transform = options.transform;\\n\\n if (typeof options.flush === 'function') this._flush = options.flush;\\n }\\n\\n // When the writable side finishes, then flush out anything remaining.\\n this.on('prefinish', prefinish);\\n}\\n\\nfunction prefinish() {\\n var _this = this;\\n\\n if (typeof this._flush === 'function') {\\n this._flush(function (er, data) {\\n done(_this, er, data);\\n });\\n } else {\\n done(this, null, null);\\n }\\n}\\n\\nTransform.prototype.push = function (chunk, encoding) {\\n this._transformState.needTransform = false;\\n return Duplex.prototype.push.call(this, chunk, encoding);\\n};\\n\\n// This is the part where you do stuff!\\n// override this function in implementation classes.\\n// 'chunk' is an input chunk.\\n//\\n// Call `push(newChunk)` to pass along transformed output\\n// to the readable side. You may call 'push' zero or more times.\\n//\\n// Call `cb(err)` when you are done with this chunk. If you pass\\n// an error, then that'll put the hurt on the whole operation. If you\\n// never call cb(), then you'll never get another chunk.\\nTransform.prototype._transform = function (chunk, encoding, cb) {\\n throw new Error('_transform() is not implemented');\\n};\\n\\nTransform.prototype._write = function (chunk, encoding, cb) {\\n var ts = this._transformState;\\n ts.writecb = cb;\\n ts.writechunk = chunk;\\n ts.writeencoding = encoding;\\n if (!ts.transforming) {\\n var rs = this._readableState;\\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\\n }\\n};\\n\\n// Doesn't matter what the args are here.\\n// _transform does all the work.\\n// That we got here means that the readable side wants more data.\\nTransform.prototype._read = function (n) {\\n var ts = this._transformState;\\n\\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\\n ts.transforming = true;\\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\\n } else {\\n // mark that we need a transform, so that any data that comes in\\n // will get processed, now that we've asked for it.\\n ts.needTransform = true;\\n }\\n};\\n\\nTransform.prototype._destroy = function (err, cb) {\\n var _this2 = this;\\n\\n Duplex.prototype._destroy.call(this, err, function (err2) {\\n cb(err2);\\n _this2.emit('close');\\n });\\n};\\n\\nfunction done(stream, er, data) {\\n if (er) return stream.emit('error', er);\\n\\n if (data != null) // single equals check for both `null` and `undefined`\\n stream.push(data);\\n\\n // if there's nothing in the write buffer, then that means\\n // that nothing more will ever be provided\\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\\n\\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\\n\\n return stream.push(null);\\n}\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/lib/_stream_writable.js\\\":\\n/*!**************************************************************!*\\\\\\n !*** ./node_modules/readable-stream/lib/_stream_writable.js ***!\\n \\\\**************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors.\\n//\\n// Permission is hereby granted, free of charge, to any person obtaining a\\n// copy of this software and associated documentation files (the\\n// \\\"Software\\\"), to deal in the Software without restriction, including\\n// without limitation the rights to use, copy, modify, merge, publish,\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\n// persons to whom the Software is furnished to do so, subject to the\\n// following conditions:\\n//\\n// The above copyright notice and this permission notice shall be included\\n// in all copies or substantial portions of the Software.\\n//\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\n\\n// A bit simpler than readable streams.\\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\\n// the drain event emission and buffering.\\n\\n\\n\\n/**/\\n\\nvar pna = __webpack_require__(/*! process-nextick-args */ \\\"./node_modules/process-nextick-args/index.js\\\");\\n/**/\\n\\nmodule.exports = Writable;\\n\\n/* */\\nfunction WriteReq(chunk, encoding, cb) {\\n this.chunk = chunk;\\n this.encoding = encoding;\\n this.callback = cb;\\n this.next = null;\\n}\\n\\n// It seems a linked list but it is not\\n// there will be only 2 of these for each stream\\nfunction CorkedRequest(state) {\\n var _this = this;\\n\\n this.next = null;\\n this.entry = null;\\n this.finish = function () {\\n onCorkedFinish(_this, state);\\n };\\n}\\n/* */\\n\\n/**/\\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\\n/**/\\n\\n/**/\\nvar Duplex;\\n/**/\\n\\nWritable.WritableState = WritableState;\\n\\n/**/\\nvar util = __webpack_require__(/*! core-util-is */ \\\"./node_modules/core-util-is/lib/util.js\\\");\\nutil.inherits = __webpack_require__(/*! inherits */ \\\"./node_modules/inherits/inherits_browser.js\\\");\\n/**/\\n\\n/**/\\nvar internalUtil = {\\n deprecate: __webpack_require__(/*! util-deprecate */ \\\"./node_modules/util-deprecate/browser.js\\\")\\n};\\n/**/\\n\\n/**/\\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \\\"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\\\");\\n/**/\\n\\n/**/\\n\\nvar Buffer = __webpack_require__(/*! safe-buffer */ \\\"./node_modules/safe-buffer/index.js\\\").Buffer;\\nvar OurUint8Array = global.Uint8Array || function () {};\\nfunction _uint8ArrayToBuffer(chunk) {\\n return Buffer.from(chunk);\\n}\\nfunction _isUint8Array(obj) {\\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\\n}\\n\\n/**/\\n\\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \\\"./node_modules/readable-stream/lib/internal/streams/destroy.js\\\");\\n\\nutil.inherits(Writable, Stream);\\n\\nfunction nop() {}\\n\\nfunction WritableState(options, stream) {\\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \\\"./node_modules/readable-stream/lib/_stream_duplex.js\\\");\\n\\n options = options || {};\\n\\n // Duplex streams are both readable and writable, but share\\n // the same options object.\\n // However, some cases require setting options to different\\n // values for the readable and the writable sides of the duplex stream.\\n // These options can be provided separately as readableXXX and writableXXX.\\n var isDuplex = stream instanceof Duplex;\\n\\n // object stream flag to indicate whether or not this stream\\n // contains buffers or objects.\\n this.objectMode = !!options.objectMode;\\n\\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\\n\\n // the point at which write() starts returning false\\n // Note: 0 is a valid value, means that we always return false if\\n // the entire buffer is not flushed immediately on write()\\n var hwm = options.highWaterMark;\\n var writableHwm = options.writableHighWaterMark;\\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\\n\\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\\n\\n // cast to ints.\\n this.highWaterMark = Math.floor(this.highWaterMark);\\n\\n // if _final has been called\\n this.finalCalled = false;\\n\\n // drain event flag.\\n this.needDrain = false;\\n // at the start of calling end()\\n this.ending = false;\\n // when end() has been called, and returned\\n this.ended = false;\\n // when 'finish' is emitted\\n this.finished = false;\\n\\n // has it been destroyed\\n this.destroyed = false;\\n\\n // should we decode strings into buffers before passing to _write?\\n // this is here so that some node-core streams can optimize string\\n // handling at a lower level.\\n var noDecode = options.decodeStrings === false;\\n this.decodeStrings = !noDecode;\\n\\n // Crypto is kind of old and crusty. Historically, its default string\\n // encoding is 'binary' so we have to make this configurable.\\n // Everything else in the universe uses 'utf8', though.\\n this.defaultEncoding = options.defaultEncoding || 'utf8';\\n\\n // not an actual buffer we keep track of, but a measurement\\n // of how much we're waiting to get pushed to some underlying\\n // socket or file.\\n this.length = 0;\\n\\n // a flag to see when we're in the middle of a write.\\n this.writing = false;\\n\\n // when true all writes will be buffered until .uncork() call\\n this.corked = 0;\\n\\n // a flag to be able to tell if the onwrite cb is called immediately,\\n // or on a later tick. We set this to true at first, because any\\n // actions that shouldn't happen until \\\"later\\\" should generally also\\n // not happen before the first write call.\\n this.sync = true;\\n\\n // a flag to know if we're processing previously buffered items, which\\n // may call the _write() callback in the same tick, so that we don't\\n // end up in an overlapped onwrite situation.\\n this.bufferProcessing = false;\\n\\n // the callback that's passed to _write(chunk,cb)\\n this.onwrite = function (er) {\\n onwrite(stream, er);\\n };\\n\\n // the callback that the user supplies to write(chunk,encoding,cb)\\n this.writecb = null;\\n\\n // the amount that is being written when _write is called.\\n this.writelen = 0;\\n\\n this.bufferedRequest = null;\\n this.lastBufferedRequest = null;\\n\\n // number of pending user-supplied write callbacks\\n // this must be 0 before 'finish' can be emitted\\n this.pendingcb = 0;\\n\\n // emit prefinish if the only thing we're waiting for is _write cbs\\n // This is relevant for synchronous Transform streams\\n this.prefinished = false;\\n\\n // True if the error was already emitted and should not be thrown again\\n this.errorEmitted = false;\\n\\n // count buffered requests\\n this.bufferedRequestCount = 0;\\n\\n // allocate the first CorkedRequest, there is always\\n // one allocated and free to use, and we maintain at most two\\n this.corkedRequestsFree = new CorkedRequest(this);\\n}\\n\\nWritableState.prototype.getBuffer = function getBuffer() {\\n var current = this.bufferedRequest;\\n var out = [];\\n while (current) {\\n out.push(current);\\n current = current.next;\\n }\\n return out;\\n};\\n\\n(function () {\\n try {\\n Object.defineProperty(WritableState.prototype, 'buffer', {\\n get: internalUtil.deprecate(function () {\\n return this.getBuffer();\\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\\n });\\n } catch (_) {}\\n})();\\n\\n// Test _writableState for inheritance to account for Duplex streams,\\n// whose prototype chain only points to Readable.\\nvar realHasInstance;\\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\\n realHasInstance = Function.prototype[Symbol.hasInstance];\\n Object.defineProperty(Writable, Symbol.hasInstance, {\\n value: function (object) {\\n if (realHasInstance.call(this, object)) return true;\\n if (this !== Writable) return false;\\n\\n return object && object._writableState instanceof WritableState;\\n }\\n });\\n} else {\\n realHasInstance = function (object) {\\n return object instanceof this;\\n };\\n}\\n\\nfunction Writable(options) {\\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \\\"./node_modules/readable-stream/lib/_stream_duplex.js\\\");\\n\\n // Writable ctor is applied to Duplexes, too.\\n // `realHasInstance` is necessary because using plain `instanceof`\\n // would return false, as no `_writableState` property is attached.\\n\\n // Trying to use the custom `instanceof` for Writable here will also break the\\n // Node.js LazyTransform implementation, which has a non-trivial getter for\\n // `_writableState` that would lead to infinite recursion.\\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\\n return new Writable(options);\\n }\\n\\n this._writableState = new WritableState(options, this);\\n\\n // legacy.\\n this.writable = true;\\n\\n if (options) {\\n if (typeof options.write === 'function') this._write = options.write;\\n\\n if (typeof options.writev === 'function') this._writev = options.writev;\\n\\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\\n\\n if (typeof options.final === 'function') this._final = options.final;\\n }\\n\\n Stream.call(this);\\n}\\n\\n// Otherwise people can pipe Writable streams, which is just wrong.\\nWritable.prototype.pipe = function () {\\n this.emit('error', new Error('Cannot pipe, not readable'));\\n};\\n\\nfunction writeAfterEnd(stream, cb) {\\n var er = new Error('write after end');\\n // TODO: defer error events consistently everywhere, not just the cb\\n stream.emit('error', er);\\n pna.nextTick(cb, er);\\n}\\n\\n// Checks that a user-supplied chunk is valid, especially for the particular\\n// mode the stream is in. Currently this means that `null` is never accepted\\n// and undefined/non-string values are only allowed in object mode.\\nfunction validChunk(stream, state, chunk, cb) {\\n var valid = true;\\n var er = false;\\n\\n if (chunk === null) {\\n er = new TypeError('May not write null values to stream');\\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\\n er = new TypeError('Invalid non-string/buffer chunk');\\n }\\n if (er) {\\n stream.emit('error', er);\\n pna.nextTick(cb, er);\\n valid = false;\\n }\\n return valid;\\n}\\n\\nWritable.prototype.write = function (chunk, encoding, cb) {\\n var state = this._writableState;\\n var ret = false;\\n var isBuf = !state.objectMode && _isUint8Array(chunk);\\n\\n if (isBuf && !Buffer.isBuffer(chunk)) {\\n chunk = _uint8ArrayToBuffer(chunk);\\n }\\n\\n if (typeof encoding === 'function') {\\n cb = encoding;\\n encoding = null;\\n }\\n\\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\\n\\n if (typeof cb !== 'function') cb = nop;\\n\\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\\n state.pendingcb++;\\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\\n }\\n\\n return ret;\\n};\\n\\nWritable.prototype.cork = function () {\\n var state = this._writableState;\\n\\n state.corked++;\\n};\\n\\nWritable.prototype.uncork = function () {\\n var state = this._writableState;\\n\\n if (state.corked) {\\n state.corked--;\\n\\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\\n }\\n};\\n\\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\\n // node::ParseEncoding() requires lower case.\\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\\n this._writableState.defaultEncoding = encoding;\\n return this;\\n};\\n\\nfunction decodeChunk(state, chunk, encoding) {\\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\\n chunk = Buffer.from(chunk, encoding);\\n }\\n return chunk;\\n}\\n\\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\\n // making it explicit this property is not enumerable\\n // because otherwise some prototype manipulation in\\n // userland will fail\\n enumerable: false,\\n get: function () {\\n return this._writableState.highWaterMark;\\n }\\n});\\n\\n// if we're already writing something, then just put this\\n// in the queue, and wait our turn. Otherwise, call _write\\n// If we return false, then we need a drain event, so set that flag.\\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\\n if (!isBuf) {\\n var newChunk = decodeChunk(state, chunk, encoding);\\n if (chunk !== newChunk) {\\n isBuf = true;\\n encoding = 'buffer';\\n chunk = newChunk;\\n }\\n }\\n var len = state.objectMode ? 1 : chunk.length;\\n\\n state.length += len;\\n\\n var ret = state.length < state.highWaterMark;\\n // we must ensure that previous needDrain will not be reset to false.\\n if (!ret) state.needDrain = true;\\n\\n if (state.writing || state.corked) {\\n var last = state.lastBufferedRequest;\\n state.lastBufferedRequest = {\\n chunk: chunk,\\n encoding: encoding,\\n isBuf: isBuf,\\n callback: cb,\\n next: null\\n };\\n if (last) {\\n last.next = state.lastBufferedRequest;\\n } else {\\n state.bufferedRequest = state.lastBufferedRequest;\\n }\\n state.bufferedRequestCount += 1;\\n } else {\\n doWrite(stream, state, false, len, chunk, encoding, cb);\\n }\\n\\n return ret;\\n}\\n\\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\\n state.writelen = len;\\n state.writecb = cb;\\n state.writing = true;\\n state.sync = true;\\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\\n state.sync = false;\\n}\\n\\nfunction onwriteError(stream, state, sync, er, cb) {\\n --state.pendingcb;\\n\\n if (sync) {\\n // defer the callback if we are being called synchronously\\n // to avoid piling up things on the stack\\n pna.nextTick(cb, er);\\n // this can emit finish, and it will always happen\\n // after error\\n pna.nextTick(finishMaybe, stream, state);\\n stream._writableState.errorEmitted = true;\\n stream.emit('error', er);\\n } else {\\n // the caller expect this to happen before if\\n // it is async\\n cb(er);\\n stream._writableState.errorEmitted = true;\\n stream.emit('error', er);\\n // this can emit finish, but finish must\\n // always follow error\\n finishMaybe(stream, state);\\n }\\n}\\n\\nfunction onwriteStateUpdate(state) {\\n state.writing = false;\\n state.writecb = null;\\n state.length -= state.writelen;\\n state.writelen = 0;\\n}\\n\\nfunction onwrite(stream, er) {\\n var state = stream._writableState;\\n var sync = state.sync;\\n var cb = state.writecb;\\n\\n onwriteStateUpdate(state);\\n\\n if (er) onwriteError(stream, state, sync, er, cb);else {\\n // Check if we're actually ready to finish, but don't emit yet\\n var finished = needFinish(state);\\n\\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\\n clearBuffer(stream, state);\\n }\\n\\n if (sync) {\\n /**/\\n asyncWrite(afterWrite, stream, state, finished, cb);\\n /**/\\n } else {\\n afterWrite(stream, state, finished, cb);\\n }\\n }\\n}\\n\\nfunction afterWrite(stream, state, finished, cb) {\\n if (!finished) onwriteDrain(stream, state);\\n state.pendingcb--;\\n cb();\\n finishMaybe(stream, state);\\n}\\n\\n// Must force callback to be called on nextTick, so that we don't\\n// emit 'drain' before the write() consumer gets the 'false' return\\n// value, and has a chance to attach a 'drain' listener.\\nfunction onwriteDrain(stream, state) {\\n if (state.length === 0 && state.needDrain) {\\n state.needDrain = false;\\n stream.emit('drain');\\n }\\n}\\n\\n// if there's something in the buffer waiting, then process it\\nfunction clearBuffer(stream, state) {\\n state.bufferProcessing = true;\\n var entry = state.bufferedRequest;\\n\\n if (stream._writev && entry && entry.next) {\\n // Fast case, write everything using _writev()\\n var l = state.bufferedRequestCount;\\n var buffer = new Array(l);\\n var holder = state.corkedRequestsFree;\\n holder.entry = entry;\\n\\n var count = 0;\\n var allBuffers = true;\\n while (entry) {\\n buffer[count] = entry;\\n if (!entry.isBuf) allBuffers = false;\\n entry = entry.next;\\n count += 1;\\n }\\n buffer.allBuffers = allBuffers;\\n\\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\\n\\n // doWrite is almost always async, defer these to save a bit of time\\n // as the hot path ends with doWrite\\n state.pendingcb++;\\n state.lastBufferedRequest = null;\\n if (holder.next) {\\n state.corkedRequestsFree = holder.next;\\n holder.next = null;\\n } else {\\n state.corkedRequestsFree = new CorkedRequest(state);\\n }\\n state.bufferedRequestCount = 0;\\n } else {\\n // Slow case, write chunks one-by-one\\n while (entry) {\\n var chunk = entry.chunk;\\n var encoding = entry.encoding;\\n var cb = entry.callback;\\n var len = state.objectMode ? 1 : chunk.length;\\n\\n doWrite(stream, state, false, len, chunk, encoding, cb);\\n entry = entry.next;\\n state.bufferedRequestCount--;\\n // if we didn't call the onwrite immediately, then\\n // it means that we need to wait until it does.\\n // also, that means that the chunk and cb are currently\\n // being processed, so move the buffer counter past them.\\n if (state.writing) {\\n break;\\n }\\n }\\n\\n if (entry === null) state.lastBufferedRequest = null;\\n }\\n\\n state.bufferedRequest = entry;\\n state.bufferProcessing = false;\\n}\\n\\nWritable.prototype._write = function (chunk, encoding, cb) {\\n cb(new Error('_write() is not implemented'));\\n};\\n\\nWritable.prototype._writev = null;\\n\\nWritable.prototype.end = function (chunk, encoding, cb) {\\n var state = this._writableState;\\n\\n if (typeof chunk === 'function') {\\n cb = chunk;\\n chunk = null;\\n encoding = null;\\n } else if (typeof encoding === 'function') {\\n cb = encoding;\\n encoding = null;\\n }\\n\\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\\n\\n // .end() fully uncorks\\n if (state.corked) {\\n state.corked = 1;\\n this.uncork();\\n }\\n\\n // ignore unnecessary end() calls.\\n if (!state.ending && !state.finished) endWritable(this, state, cb);\\n};\\n\\nfunction needFinish(state) {\\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\\n}\\nfunction callFinal(stream, state) {\\n stream._final(function (err) {\\n state.pendingcb--;\\n if (err) {\\n stream.emit('error', err);\\n }\\n state.prefinished = true;\\n stream.emit('prefinish');\\n finishMaybe(stream, state);\\n });\\n}\\nfunction prefinish(stream, state) {\\n if (!state.prefinished && !state.finalCalled) {\\n if (typeof stream._final === 'function') {\\n state.pendingcb++;\\n state.finalCalled = true;\\n pna.nextTick(callFinal, stream, state);\\n } else {\\n state.prefinished = true;\\n stream.emit('prefinish');\\n }\\n }\\n}\\n\\nfunction finishMaybe(stream, state) {\\n var need = needFinish(state);\\n if (need) {\\n prefinish(stream, state);\\n if (state.pendingcb === 0) {\\n state.finished = true;\\n stream.emit('finish');\\n }\\n }\\n return need;\\n}\\n\\nfunction endWritable(stream, state, cb) {\\n state.ending = true;\\n finishMaybe(stream, state);\\n if (cb) {\\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\\n }\\n state.ended = true;\\n stream.writable = false;\\n}\\n\\nfunction onCorkedFinish(corkReq, state, err) {\\n var entry = corkReq.entry;\\n corkReq.entry = null;\\n while (entry) {\\n var cb = entry.callback;\\n state.pendingcb--;\\n cb(err);\\n entry = entry.next;\\n }\\n if (state.corkedRequestsFree) {\\n state.corkedRequestsFree.next = corkReq;\\n } else {\\n state.corkedRequestsFree = corkReq;\\n }\\n}\\n\\nObject.defineProperty(Writable.prototype, 'destroyed', {\\n get: function () {\\n if (this._writableState === undefined) {\\n return false;\\n }\\n return this._writableState.destroyed;\\n },\\n set: function (value) {\\n // we ignore the value if the stream\\n // has not been initialized yet\\n if (!this._writableState) {\\n return;\\n }\\n\\n // backward compatibility, the user is explicitly\\n // managing destroyed\\n this._writableState.destroyed = value;\\n }\\n});\\n\\nWritable.prototype.destroy = destroyImpl.destroy;\\nWritable.prototype._undestroy = destroyImpl.undestroy;\\nWritable.prototype._destroy = function (err, cb) {\\n this.end();\\n cb(err);\\n};\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \\\"./node_modules/process/browser.js\\\"), __webpack_require__(/*! ./../../node-libs-browser/node_modules/timers-browserify/main.js */ \\\"./node_modules/node-libs-browser/node_modules/timers-browserify/main.js\\\").setImmediate, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \\\"./node_modules/webpack/buildin/global.js\\\")))\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/lib/internal/streams/BufferList.js\\\":\\n/*!*************************************************************************!*\\\\\\n !*** ./node_modules/readable-stream/lib/internal/streams/BufferList.js ***!\\n \\\\*************************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nvar Buffer = __webpack_require__(/*! safe-buffer */ \\\"./node_modules/safe-buffer/index.js\\\").Buffer;\\nvar util = __webpack_require__(/*! util */ 1);\\n\\nfunction copyBuffer(src, target, offset) {\\n src.copy(target, offset);\\n}\\n\\nmodule.exports = function () {\\n function BufferList() {\\n _classCallCheck(this, BufferList);\\n\\n this.head = null;\\n this.tail = null;\\n this.length = 0;\\n }\\n\\n BufferList.prototype.push = function push(v) {\\n var entry = { data: v, next: null };\\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\\n this.tail = entry;\\n ++this.length;\\n };\\n\\n BufferList.prototype.unshift = function unshift(v) {\\n var entry = { data: v, next: this.head };\\n if (this.length === 0) this.tail = entry;\\n this.head = entry;\\n ++this.length;\\n };\\n\\n BufferList.prototype.shift = function shift() {\\n if (this.length === 0) return;\\n var ret = this.head.data;\\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\\n --this.length;\\n return ret;\\n };\\n\\n BufferList.prototype.clear = function clear() {\\n this.head = this.tail = null;\\n this.length = 0;\\n };\\n\\n BufferList.prototype.join = function join(s) {\\n if (this.length === 0) return '';\\n var p = this.head;\\n var ret = '' + p.data;\\n while (p = p.next) {\\n ret += s + p.data;\\n }return ret;\\n };\\n\\n BufferList.prototype.concat = function concat(n) {\\n if (this.length === 0) return Buffer.alloc(0);\\n if (this.length === 1) return this.head.data;\\n var ret = Buffer.allocUnsafe(n >>> 0);\\n var p = this.head;\\n var i = 0;\\n while (p) {\\n copyBuffer(p.data, ret, i);\\n i += p.data.length;\\n p = p.next;\\n }\\n return ret;\\n };\\n\\n return BufferList;\\n}();\\n\\nif (util && util.inspect && util.inspect.custom) {\\n module.exports.prototype[util.inspect.custom] = function () {\\n var obj = util.inspect({ length: this.length });\\n return this.constructor.name + ' ' + obj;\\n };\\n}\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/lib/internal/streams/destroy.js\\\":\\n/*!**********************************************************************!*\\\\\\n !*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***!\\n \\\\**********************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n\\\"use strict\\\";\\n\\n\\n/**/\\n\\nvar pna = __webpack_require__(/*! process-nextick-args */ \\\"./node_modules/process-nextick-args/index.js\\\");\\n/**/\\n\\n// undocumented cb() API, needed for core, not for public API\\nfunction destroy(err, cb) {\\n var _this = this;\\n\\n var readableDestroyed = this._readableState && this._readableState.destroyed;\\n var writableDestroyed = this._writableState && this._writableState.destroyed;\\n\\n if (readableDestroyed || writableDestroyed) {\\n if (cb) {\\n cb(err);\\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\\n pna.nextTick(emitErrorNT, this, err);\\n }\\n return this;\\n }\\n\\n // we set destroyed to true before firing error callbacks in order\\n // to make it re-entrance safe in case destroy() is called within callbacks\\n\\n if (this._readableState) {\\n this._readableState.destroyed = true;\\n }\\n\\n // if this is a duplex stream mark the writable part as destroyed as well\\n if (this._writableState) {\\n this._writableState.destroyed = true;\\n }\\n\\n this._destroy(err || null, function (err) {\\n if (!cb && err) {\\n pna.nextTick(emitErrorNT, _this, err);\\n if (_this._writableState) {\\n _this._writableState.errorEmitted = true;\\n }\\n } else if (cb) {\\n cb(err);\\n }\\n });\\n\\n return this;\\n}\\n\\nfunction undestroy() {\\n if (this._readableState) {\\n this._readableState.destroyed = false;\\n this._readableState.reading = false;\\n this._readableState.ended = false;\\n this._readableState.endEmitted = false;\\n }\\n\\n if (this._writableState) {\\n this._writableState.destroyed = false;\\n this._writableState.ended = false;\\n this._writableState.ending = false;\\n this._writableState.finished = false;\\n this._writableState.errorEmitted = false;\\n }\\n}\\n\\nfunction emitErrorNT(self, err) {\\n self.emit('error', err);\\n}\\n\\nmodule.exports = {\\n destroy: destroy,\\n undestroy: undestroy\\n};\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\\\":\\n/*!*****************************************************************************!*\\\\\\n !*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!\\n \\\\*****************************************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\nmodule.exports = __webpack_require__(/*! events */ \\\"./node_modules/node-libs-browser/node_modules/events/events.js\\\").EventEmitter;\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/passthrough.js\\\":\\n/*!*****************************************************!*\\\\\\n !*** ./node_modules/readable-stream/passthrough.js ***!\\n \\\\*****************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\nmodule.exports = __webpack_require__(/*! ./readable */ \\\"./node_modules/readable-stream/readable-browser.js\\\").PassThrough\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/readable-browser.js\\\":\\n/*!**********************************************************!*\\\\\\n !*** ./node_modules/readable-stream/readable-browser.js ***!\\n \\\\**********************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\nexports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ \\\"./node_modules/readable-stream/lib/_stream_readable.js\\\");\\nexports.Stream = exports;\\nexports.Readable = exports;\\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ \\\"./node_modules/readable-stream/lib/_stream_writable.js\\\");\\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ \\\"./node_modules/readable-stream/lib/_stream_duplex.js\\\");\\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ \\\"./node_modules/readable-stream/lib/_stream_transform.js\\\");\\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ \\\"./node_modules/readable-stream/lib/_stream_passthrough.js\\\");\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/transform.js\\\":\\n/*!***************************************************!*\\\\\\n !*** ./node_modules/readable-stream/transform.js ***!\\n \\\\***************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\nmodule.exports = __webpack_require__(/*! ./readable */ \\\"./node_modules/readable-stream/readable-browser.js\\\").Transform\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/readable-stream/writable-browser.js\\\":\\n/*!**********************************************************!*\\\\\\n !*** ./node_modules/readable-stream/writable-browser.js ***!\\n \\\\**********************************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\nmodule.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ \\\"./node_modules/readable-stream/lib/_stream_writable.js\\\");\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/safe-buffer/index.js\\\":\\n/*!*******************************************!*\\\\\\n !*** ./node_modules/safe-buffer/index.js ***!\\n \\\\*******************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* eslint-disable node/no-deprecated-api */\\nvar buffer = __webpack_require__(/*! buffer */ \\\"./node_modules/node-libs-browser/node_modules/buffer/index.js\\\")\\nvar Buffer = buffer.Buffer\\n\\n// alternative to using Object.keys for old browsers\\nfunction copyProps (src, dst) {\\n for (var key in src) {\\n dst[key] = src[key]\\n }\\n}\\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\\n module.exports = buffer\\n} else {\\n // Copy properties from require('buffer')\\n copyProps(buffer, exports)\\n exports.Buffer = SafeBuffer\\n}\\n\\nfunction SafeBuffer (arg, encodingOrOffset, length) {\\n return Buffer(arg, encodingOrOffset, length)\\n}\\n\\n// Copy static methods from Buffer\\ncopyProps(Buffer, SafeBuffer)\\n\\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\\n if (typeof arg === 'number') {\\n throw new TypeError('Argument must not be a number')\\n }\\n return Buffer(arg, encodingOrOffset, length)\\n}\\n\\nSafeBuffer.alloc = function (size, fill, encoding) {\\n if (typeof size !== 'number') {\\n throw new TypeError('Argument must be a number')\\n }\\n var buf = Buffer(size)\\n if (fill !== undefined) {\\n if (typeof encoding === 'string') {\\n buf.fill(fill, encoding)\\n } else {\\n buf.fill(fill)\\n }\\n } else {\\n buf.fill(0)\\n }\\n return buf\\n}\\n\\nSafeBuffer.allocUnsafe = function (size) {\\n if (typeof size !== 'number') {\\n throw new TypeError('Argument must be a number')\\n }\\n return Buffer(size)\\n}\\n\\nSafeBuffer.allocUnsafeSlow = function (size) {\\n if (typeof size !== 'number') {\\n throw new TypeError('Argument must be a number')\\n }\\n return buffer.SlowBuffer(size)\\n}\\n\\n\\n/***/ }),\\n\\n/***/ \\\"./node_modules/sax/lib/sax.js\\\":\\n/*!*************************************!*\\\\\\n !*** ./node_modules/sax/lib/sax.js ***!\\n \\\\*************************************/\\n/*! no static exports found */\\n/***/ (function(module, exports, __webpack_require__) {\\n\\n/* WEBPACK VAR INJECTION */(function(Buffer) {;(function (sax) { // wrapper for non-node envs\\n sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\\n sax.SAXParser = SAXParser\\n sax.SAXStream = SAXStream\\n sax.createStream = createStream\\n\\n // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\\n // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\\n // since that's the earliest that a buffer overrun could occur. This way, checks are\\n // as rare as required, but as often as necessary to ensure never crossing this bound.\\n // Furthermore, buffers are only tested at most once per write(), so passing a very\\n // large string into write() might have undesirable effects, but this is manageable by\\n // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\\n // edge case, result in creating at most one complete copy of the string passed in.\\n // Set to Infinity to have unlimited buffers.\\n sax.MAX_BUFFER_LENGTH = 64 * 1024\\n\\n var buffers = [\\n 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',\\n 'procInstName', 'procInstBody', 'entity', 'attribName',\\n 'attribValue', 'cdata', 'script'\\n ]\\n\\n sax.EVENTS = [\\n 'text',\\n 'processinginstruction',\\n 'sgmldeclaration',\\n 'doctype',\\n 'comment',\\n 'opentagstart',\\n 'attribute',\\n 'opentag',\\n 'closetag',\\n 'opencdata',\\n 'cdata',\\n 'closecdata',\\n 'error',\\n 'end',\\n 'ready',\\n 'script',\\n 'opennamespace',\\n 'closenamespace'\\n ]\\n\\n function SAXParser (strict, opt) {\\n if (!(this instanceof SAXParser)) {\\n return new SAXParser(strict, opt)\\n }\\n\\n var parser = this\\n clearBuffers(parser)\\n parser.q = parser.c = ''\\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\\n parser.opt = opt || {}\\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\\n parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'\\n parser.tags = []\\n parser.closed = parser.closedRoot = parser.sawRoot = false\\n parser.tag = parser.error = null\\n parser.strict = !!strict\\n parser.noscript = !!(strict || parser.opt.noscript)\\n parser.state = S.BEGIN\\n parser.strictEntities = parser.opt.strictEntities\\n parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)\\n parser.attribList = []\\n\\n // namespaces form a prototype chain.\\n // it always points at the current tag,\\n // which protos to its parent tag.\\n if (parser.opt.xmlns) {\\n parser.ns = Object.create(rootNS)\\n }\\n\\n // mostly just for error reporting\\n parser.trackPosition = parser.opt.position !== false\\n if (parser.trackPosition) {\\n parser.position = parser.line = parser.column = 0\\n }\\n emit(parser, 'onready')\\n }\\n\\n if (!Object.create) {\\n Object.create = function (o) {\\n function F () {}\\n F.prototype = o\\n var newf = new F()\\n return newf\\n }\\n }\\n\\n if (!Object.keys) {\\n Object.keys = function (o) {\\n var a = []\\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\\n return a\\n }\\n }\\n\\n function checkBufferLength (parser) {\\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\\n var maxActual = 0\\n for (var i = 0, l = buffers.length; i < l; i++) {\\n var len = parser[buffers[i]].length\\n if (len > maxAllowed) {\\n // Text/cdata nodes can get big, and since they're buffered,\\n // we can get here under normal conditions.\\n // Avoid issues by emitting the text node now,\\n // so at least it won't get any bigger.\\n switch (buffers[i]) {\\n case 'textNode':\\n closeText(parser)\\n break\\n\\n case 'cdata':\\n emitNode(parser, 'oncdata', parser.cdata)\\n parser.cdata = ''\\n break\\n\\n case 'script':\\n emitNode(parser, 'onscript', parser.script)\\n parser.script = ''\\n break\\n\\n default:\\n error(parser, 'Max buffer length exceeded: ' + buffers[i])\\n }\\n }\\n maxActual = Math.max(maxActual, len)\\n }\\n // schedule the next check for the earliest possible buffer overrun.\\n var m = sax.MAX_BUFFER_LENGTH - maxActual\\n parser.bufferCheckPosition = m + parser.position\\n }\\n\\n function clearBuffers (parser) {\\n for (var i = 0, l = buffers.length; i < l; i++) {\\n parser[buffers[i]] = ''\\n }\\n }\\n\\n function flushBuffers (parser) {\\n closeText(parser)\\n if (parser.cdata !== '') {\\n emitNode(parser, 'oncdata', parser.cdata)\\n parser.cdata = ''\\n }\\n if (parser.script !== '') {\\n emitNode(parser, 'onscript', parser.script)\\n parser.script = ''\\n }\\n }\\n\\n SAXParser.prototype = {\\n end: function () { end(this) },\\n write: write,\\n resume: function () { this.error = null; return this },\\n close: function () { return this.write(null) },\\n flush: function () { flushBuffers(this) }\\n }\\n\\n var Stream\\n try {\\n Stream = __webpack_require__(/*! stream */ \\\"./node_modules/stream-browserify/index.js\\\").Stream\\n } catch (ex) {\\n Stream = function () {}\\n }\\n\\n var streamWraps = sax.EVENTS.filter(function (ev) {\\n return ev !== 'error' && ev !== 'end'\\n })\\n\\n function createStream (strict, opt) {\\n return new SAXStream(strict, opt)\\n }\\n\\n function SAXStream (strict, opt) {\\n if (!(this instanceof SAXStream)) {\\n return new SAXStream(strict, opt)\\n }\\n\\n Stream.apply(this)\\n\\n this._parser = new SAXParser(strict, opt)\\n this.writable = true\\n this.readable = true\\n\\n var me = this\\n\\n this._parser.onend = function () {\\n me.emit('end')\\n }\\n\\n this._parser.onerror = function (er) {\\n me.emit('error', er)\\n\\n // if didn't throw, then means error was handled.\\n // go ahead and clear error, so we can write again.\\n me._parser.error = null\\n }\\n\\n this._decoder = null\\n\\n streamWraps.forEach(function (ev) {\\n Object.defineProperty(me, 'on' + ev, {\\n get: function () {\\n return me._parser['on' + ev]\\n },\\n set: function (h) {\\n if (!h) {\\n me.removeAllListeners(ev)\\n me._parser['on' + ev] = h\\n return h\\n }\\n me.on(ev, h)\\n },\\n enumerable: true,\\n configurable: false\\n })\\n })\\n }\\n\\n SAXStream.prototype = Object.create(Stream.prototype, {\\n constructor: {\\n value: SAXStream\\n }\\n })\\n\\n SAXStream.prototype.write = function (data) {\\n if (typeof Buffer === 'function' &&\\n typeof Buffer.isBuffer === 'function' &&\\n Buffer.isBuffer(data)) {\\n if (!this._decoder) {\\n var SD = __webpack_require__(/*! string_decoder */ \\\"./node_modules/string_decoder/lib/string_decoder.js\\\").StringDecoder\\n this._decoder = new SD('utf8')\\n }\\n data = this._decoder.write(data)\\n }\\n\\n this._parser.write(data.toString())\\n this.emit('data', data)\\n return true\\n }\\n\\n SAXStream.prototype.end = function (chunk) {\\n if (chunk && chunk.length) {\\n this.write(chunk)\\n }\\n this._parser.end()\\n return true\\n }\\n\\n SAXStream.prototype.on = function (ev, handler) {\\n var me = this\\n if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {\\n me._parser['on' + ev] = function () {\\n var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)\\n args.splice(0, 0, ev)\\n me.emit.apply(me, args)\\n }\\n }\\n\\n return Stream.prototype.on.call(me, ev, handler)\\n }\\n\\n // character classes and tokens\\n var whitespace = '\\\\r\\\\n\\\\t '\\n\\n // this really needs to be replaced with character classes.\\n // XML allows all manner of ridiculous numbers and digits.\\n var number = '0124356789'\\n var letter = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'\\n\\n // (Letter | \\\"_\\\" | \\\":\\\")\\n var quote = '\\\\'\\\"'\\n var attribEnd = whitespace + '>'\\n var CDATA = '[CDATA['\\n var DOCTYPE = 'DOCTYPE'\\n var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'\\n var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'\\n var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\\n\\n // turn all the string character sets into character class objects.\\n whitespace = charClass(whitespace)\\n number = charClass(number)\\n letter = charClass(letter)\\n\\n // http://www.w3.org/TR/REC-xml/#NT-NameStartChar\\n // This implementation works on strings, a single character at a time\\n // as such, it cannot ever support astral-plane characters (10000-EFFFF)\\n // without a significant breaking change to either this parser, or the\\n // JavaScript language. Implementation of an emoji-capable xml parser\\n // is left as an exercise for the reader.\\n var nameStart = /[:_A-Za-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD]/\\n\\n var nameBody = /[:_A-Za-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\\\\.\\\\d-]/\\n\\n var entityStart = /[#:_A-Za-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD]/\\n var entityBody = /[#:_A-Za-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\\\\.\\\\d-]/\\n\\n quote = charClass(quote)\\n attribEnd = charClass(attribEnd)\\n\\n function charClass (str) {\\n return str.split('').reduce(function (s, c) {\\n s[c] = true\\n return s\\n }, {})\\n }\\n\\n function isRegExp (c) {\\n return Object.prototype.toString.call(c) === '[object RegExp]'\\n }\\n\\n function is (charclass, c) {\\n return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]\\n }\\n\\n function not (charclass, c) {\\n return !is(charclass, c)\\n }\\n\\n var S = 0\\n sax.STATE = {\\n BEGIN: S++, // leading byte order mark or whitespace\\n BEGIN_WHITESPACE: S++, // leading whitespace\\n TEXT: S++, // general stuff\\n TEXT_ENTITY: S++, // & and such.\\n OPEN_WAKA: S++, // <\\n SGML_DECL: S++, // \\n SCRIPT: S++, //