(Q.firstChild._isFirst = !0), Q.nextSibling && Q.nextSibling.textContent === " " && !Q.nextSibling.nextSibling && ut.push(Q.nextSibling), (Q._next = Q.nextSibling && Q.nextSibling._isFirst ? null : Q.nextSibling), Q.parentNode.removeChild(Q), ot.splice(it--, 1), W--) : ct || ((Qt = !Q.nextSibling && t1(Q.parentNode, t, w)), Q.parentNode._parent && Q.parentNode._parent.appendChild(Q), Qt && Q.parentNode.appendChild(ro.createTextNode(" ")), A === "span" && (Q.style.display = "inline"), C.push(Q)); else Q.parentNode._isSplit && !Q._isSplit && Q.innerHTML !== "" ? M.push(Q) : X && !Q._isSplit && (A === "span" && (Q.style.display = "inline"), C.push(Q)); } for (it = ut.length; --it > -1;) ut[it].parentNode.removeChild(ut[it]); if (N) { for ( at && ((Nt = ro.createElement(A)), t.appendChild(Nt), (At = Nt.offsetWidth + "px"), (Qt = Nt.offsetParent === t ? 0 : t.offsetLeft), t.removeChild(Nt)), Pt = t.style.cssText, t.style.cssText = "display:none;"; t.firstChild; ) t.removeChild(t.firstChild); for ( Rt = w === " " && (!at || (!D && !X)), it = 0; it < N.length; it++ ) { for ( Tt = N[it], Nt = ro.createElement(A), Nt.style.cssText = "display:block;text-align:" + b + ";position:" + (at ? "absolute;" : "relative;"), ft && (Nt.className = ft + (gt ? it + 1 : "")), E.push(Nt), W = Tt.length, tt = 0; tt < W; tt++ ) Tt[tt].nodeName !== "BR" && ((Q = Tt[tt]), Nt.appendChild(Q), Rt && Q._wordEnd && Nt.appendChild(ro.createTextNode(" ")), at && (tt === 0 && ((Nt.style.top = Q._y + "px"), (Nt.style.left = u + Qt + "px")), (Q.style.top = "0px"), Qt && (Q.style.left = Q._x - Qt + "px"))); W === 0 ? (Nt.innerHTML = " ") : !D && !X && (d2(Nt), Qx(Nt, String.fromCharCode(160), " ")), at && ((Nt.style.width = At), (Nt.style.height = Q._h + "px")), t.appendChild(Nt); } t.style.cssText = Pt; } at && (o > t.clientHeight && ((t.style.height = o - m + "px"), t.clientHeight < o && (t.style.height = o + g + "px")), a > t.clientWidth && ((t.style.width = a - _ + "px"), t.clientWidth < a && (t.style.width = a + f + "px"))), xt && (nt ? (t.style.display = nt) : t.style.removeProperty("display")), Rm(i, C), D && Rm(n, M), Rm(s, E); }, m2 = function(t, e, i, n) { var s = e.tag ? e.tag : e.span ? "span" : "div", a = e.type || e.split || "chars,words,lines", o = ~a.indexOf("chars"), h = Lm(e), u = e.wordDelimiter || " ", d = u !== " " ? "" : h ? "­ " : " ", g = "", f = 1, m = e.specialChars ? typeof e.specialChars == "function" ? e.specialChars : c2 : null, _, v, b, C, M, E, w, A, R = ro.createElement("div"), N = t.parentNode; for ( N.insertBefore(R, t), R.textContent = t.nodeValue, N.removeChild(t), t = R, _ = bm(t), w = _.indexOf("<") !== -1, e.reduceWhiteSpace !== !1 && (_ = _.replace(o2, " ").replace(a2, "")), w && (_ = _.split("<").join(("{" + "LT}"))), M = _.length, v = (_.charAt(0) === " " ? d : "") + i(), b = 0; b < M; b++ ) if (((E = _.charAt(b)), m && (A = m(_.substr(b), e.specialChars)))) (E = _.substr(b, A || 1)), (v += o && E !== " " ? n() + E + "" : E), (b += A - 1); else if (E === u && _.charAt(b - 1) !== u && b) { for (v += f ? g : "", f = 0; _.charAt(b + 1) === u;)(v += d), b++; b === M - 1 ? (v += d) : _.charAt(b + 1) !== ")" && ((v += d + i()), (f = 1)); } else E === "{" && _.substr(b, 6) === ("{" + "LT}") ? ((v += o ? n() + "{" + "LT}" : ("{" + "LT}")), (b += 5)) : (E.charCodeAt(0) >= 55296 && E.charCodeAt(0) <= 56319) || (_.charCodeAt(b + 1) >= 65024 && _.charCodeAt(b + 1) <= 65039) ? ((C = ((_.substr(b, 12).split(Tx) || [])[1] || "").length || 2), (v += o && E !== " " ? n() + _.substr(b, C) + "" : _.substr(b, C)), (b += C - 1)) : (v += o && E !== " " ? n() + E + "" : E); (t.outerHTML = v + (f ? g : "")), w && Qx(N, ("{" + "LT}"), "<"); }, g2 = function r(t, e, i, n) { var s = Dm(t.childNodes), a = s.length, o = Lm(e), h, u; if (t.nodeType !== 3 || a > 1) { for (e.absolute = !1, h = 0; h < a; h++) (u = s[h]), (u._next = u._isFirst = u._parent = u._wordEnd = null), (u.nodeType !== 3 || /\S+/.test(u.nodeValue)) && (o && u.nodeType !== 3 && $x(u).display === "inline" && ((u.style.display = "inline-block"), (u.style.position = "relative")), (u._isSplit = !0), r(u, e, i, n)); (e.absolute = o), (t._isSplit = !0); return; } m2(t, e, i, n); } function r(e, i) { Zx || l2(), (this.elements = Dm(e)), (this.chars = []), (this.words = []), (this.lines = []), (this._originals = []), (this.vars = i || {}), h2 && this.split(i); } var t = r.prototype; return ( (t.split = function(i) { this.isSplit && this.revert(), (this.vars = i = i || this.vars), (this._originals.length = this.chars.length = this.words.length = this.lines.length = 0); for ( var n = this.elements.length, s = i.tag ? i.tag : i.span ? "span" : "div", a = Kx(i.wordsClass, s), o = Kx(i.charsClass, s), h, u, d; --n > -1; ) (d = this.elements[n]), (this._originals[n] = d.innerHTML), (h = d.clientHeight), (u = d.clientWidth), g2(d, i, a, o), p2(d, i, this.chars, this.words, this.lines, u, h); return ( this.chars.reverse(), this.words.reverse(), this.lines.reverse(), (this.isSplit = !0), this ); }), (t.revert = function() { var i = this._originals; if (!i) throw "revert() call wasn't scoped properly."; return ( this.elements.forEach(function(n, s) { return (n.innerHTML = i[s]); }), (this.chars = []), (this.words = []), (this.lines = []), (this.isSplit = !1), this ); }), (r.create = function(i, n) { return new r(i, n); }), r ); })();