Skip to content

Instantly share code, notes, and snippets.

@moorer2k
Created February 10, 2018 20:14
Show Gist options
  • Save moorer2k/a96d485c062709b439ce1edbc4384309 to your computer and use it in GitHub Desktop.
Save moorer2k/a96d485c062709b439ce1edbc4384309 to your computer and use it in GitHub Desktop.
TCSHIT
This file has been truncated, but you can view the full file.
<html>
<head></head>
<body>
<div hidden="" by-polymer-bundler="">
<script>
(function() {
"use strict";
function i() {
this.end = this.start = 0, this.rules = this.parent = this.previous = null, this.cssText = this.parsedCssText = "", this.atRule = !1, this.type = 0, this.parsedSelector = this.selector = this.keyframesName = ""
}
function j(ob) {
ob = ob.replace(Ra, "").replace(Sa, "");
var qb = ob,
rb = new i;
rb.start = 0, rb.end = qb.length;
for (var sb = rb, tb = 0, ub = qb.length; tb < ub; tb++)
if ("{" === qb[tb]) {
sb.rules || (sb.rules = []);
var vb = sb,
wb = vb.rules[vb.rules.length - 1] || null;
sb = new i, sb.start = tb + 1, sb.parent = vb, sb.previous = wb, vb.rules.push(sb)
} else "}" === qb[tb] && (sb.end = tb + 1, sb = sb.parent || rb);
return o(rb, ob)
}
function o(ob, pb) {
var qb = pb.substring(ob.start, ob.end - 1);
if (ob.parsedCssText = ob.cssText = qb.trim(), ob.parent && (qb = pb.substring(ob.previous ? ob.previous.end : ob.parent.start, ob.start - 1), qb = s(qb), qb = qb.replace(Ya, " "), qb = qb.substring(qb.lastIndexOf(";") + 1), qb = ob.parsedSelector = ob.selector = qb.trim(), ob.atRule = 0 === qb.indexOf("@"), ob.atRule ? 0 === qb.indexOf("@media") ? ob.type = Pa : qb.match(Xa) && (ob.type = Oa, ob.keyframesName = ob.selector.split(Ya).pop()) : ob.type = 0 === qb.indexOf("--") ? Qa : Na), qb = ob.rules)
for (var tb, rb = 0, sb = qb.length; rb < sb && (tb = qb[rb]); rb++) o(tb, pb);
return ob
}
function s(ob) {
return ob.replace(/\\([0-9a-f]{1,6})\s/gi, function(pb, qb) {
for (pb = qb, qb = 6 - pb.length; qb--;) pb = "0" + pb;
return "\\" + pb
})
}
function $(ob, pb, qb) {
qb = void 0 === qb ? "" : qb;
var rb = "";
if (ob.cssText || ob.rules) {
var tb, sb = ob.rules;
if ((tb = sb) && (tb = sb[0], tb = !(tb && tb.selector && 0 === tb.selector.indexOf("--"))), tb) {
tb = 0;
for (var vb, ub = sb.length; tb < ub && (vb = sb[tb]); tb++) rb = $(vb, pb, rb)
} else pb ? pb = ob.cssText : (pb = ob.cssText, pb = pb.replace(Ta, "").replace(Ua, ""), pb = pb.replace(Va, "").replace(Wa, "")), (rb = pb.trim()) && (rb = " " + rb + "\n")
}
return rb && (ob.selector && (qb += ob.selector + " {\n"), qb += rb, ob.selector && (qb += "}\n\n")), qb
}
function _(ob) {
(ob = Ma[ob]) && (ob._applyShimCurrentVersion = ob._applyShimCurrentVersion || 0, ob._applyShimValidatingVersion = ob._applyShimValidatingVersion || 0, ob._applyShimNextVersion = (ob._applyShimNextVersion || 0) + 1)
}
function ga(ob) {
return ob._applyShimCurrentVersion === ob._applyShimNextVersion
}
function va(ob) {
ob._applyShimValidatingVersion = ob._applyShimNextVersion, ob.b || (ob.b = !0, Za.then(function() {
ob._applyShimCurrentVersion = ob._applyShimNextVersion, ob.b = !1
}))
}
function wa(ob) {
_a = ob && ob.shimcssproperties ? !1 : $a || !navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) && window.CSS && CSS.supports && CSS.supports("box-shadow", "0 0 0 var(--foo)")
}
function xa(ob) {
return ob ? ("string" == typeof ob && (ob = j(ob)), $(ob, ab)) : ""
}
function ya(ob) {
return !ob.__cssRules && ob.textContent && (ob.__cssRules = j(ob.textContent)), ob.__cssRules || null
}
function za(ob, pb, qb, rb) {
if (ob) {
var sb = !1,
tb = ob.type;
if (rb && tb === Pa) {
var ub = ob.selector.match(db);
ub && (window.matchMedia(ub[1]).matches || (sb = !0))
}
if (tb === Na ? pb(ob) : qb && tb === Oa ? qb(ob) : tb === Qa && (sb = !0), (ob = ob.rules) && !sb) {
sb = 0, tb = ob.length;
for (var vb; sb < tb && (vb = ob[sb]); sb++) za(vb, pb, qb, rb)
}
}
}
function Aa(ob, pb) {
var qb = ob.indexOf("var(");
if (-1 === qb) return pb(ob, "", "", "");
a: {
for (var rb = 0, sb = qb + 3, tb = ob.length; sb < tb; sb++)
if ("(" === ob[sb]) rb++;
else if (")" === ob[sb] && 0 == --rb) break a;sb = -1
}
return rb = ob.substring(qb + 4, sb), qb = ob.substring(0, qb), ob = Aa(ob.substring(sb + 1), pb), sb = rb.indexOf(","), -1 === sb ? pb(qb, rb.trim(), "", ob) : pb(qb, rb.substring(0, sb).trim(), rb.substring(sb + 1).trim(), ob)
}
function Ba() {
this.a = {}
}
function Ca() {
this.b = this.c = null, this.a = new Ba
}
function Da(ob, pb) {
return pb = pb.replace(bb, function(qb, rb, sb, tb) {
return Ha(ob, qb, rb, sb, tb)
}), Ea(ob, pb)
}
function Ea(ob, pb) {
for (var qb; qb = cb.exec(pb);) {
var rb = qb[0],
sb = qb[1];
qb = qb.index;
var tb = pb.slice(0, qb + rb.indexOf("@apply"));
pb = pb.slice(qb + rb.length);
var ub = Fa(ob, tb);
rb = void 0;
var vb = ob;
sb = sb.replace(fb, "");
var wb = [],
xb = vb.a.get(sb);
if (xb || (vb.a.set(sb, {}), xb = vb.a.get(sb)), xb)
for (rb in vb.c && (xb.i[vb.c] = !0), xb.h) vb = ub && ub[rb], xb = [rb, ": var(", sb, "_-_", rb], vb && xb.push(",", vb), xb.push(")"), wb.push(xb.join(""));
rb = wb.join("; "), pb = "" + tb + rb + pb, cb.lastIndex = qb + rb.length
}
return pb
}
function Fa(ob, pb) {
pb = pb.split(";");
for (var qb, rb, ub, sb = {}, tb = 0; tb < pb.length; tb++)
if ((qb = pb[tb]) && (ub = qb.split(":"), 1 < ub.length)) {
qb = ub[0].trim();
var vb = ob;
rb = qb, ub = ub.slice(1).join(":");
var wb = gb.exec(ub);
wb && (wb[1] ? (vb.b || (vb.b = document.createElement("meta"), vb.b.setAttribute("apply-shim-measure", ""), vb.b.style.all = "initial", document.head.appendChild(vb.b)), rb = window.getComputedStyle(vb.b).getPropertyValue(rb)) : rb = "apply-shim-inherit", ub = rb), rb = ub, sb[qb] = rb
}
return sb
}
function Ga(ob, pb) {
if (hb)
for (var qb in pb.i) qb !== ob.c && hb(qb)
}
function Ha(ob, pb, qb, rb, sb) {
if (rb && Aa(rb, function(Cb, Db) {
Db && ob.a.get(Db) && (sb = "@apply " + Db + ";")
}), !sb) return pb;
var tb = Ea(ob, sb),
ub = pb.slice(0, pb.indexOf("--")),
vb = tb = Fa(ob, tb),
wb = ob.a.get(qb),
xb = wb && wb.h;
xb ? vb = Object.assign(Object.create(xb), tb) : ob.a.set(qb, vb);
var zb, yb = [],
Ab = !1;
for (zb in vb) {
var Bb = tb[zb];
void 0 === Bb && (Bb = "initial"), !xb || zb in xb || (Ab = !0), yb.push("" + qb + "_-_" + zb + ": " + Bb)
}
return Ab && Ga(ob, wb), wb && (wb.h = vb), rb && (ub = pb + ";" + ub), "" + ub + yb.join("; ") + ";"
}
function Ia(ob) {
requestAnimationFrame(function() {
jb ? jb(ob) : (ib || (ib = new Promise(function(pb) {
kb = pb
}), "complete" === document.readyState ? kb() : document.addEventListener("readystatechange", function() {
"complete" === document.readyState && kb()
})), ib.then(function() {
ob && ob()
}))
})
}
function Ja() {
var ob = this;
this.a = null, Ia(function() {
Ka(ob)
}), lb.invalidCallback = _
}
function Ka(ob) {
ob.a || (ob.a = window.ShadyCSS.CustomStyleInterface, ob.a && (ob.a.transformCallback = function(pb) {
lb.f(pb)
}, ob.a.validateCallback = function() {
requestAnimationFrame(function() {
ob.a.enqueued && La(ob)
})
}))
}
function La(ob) {
if (Ka(ob), ob.a) {
var pb = ob.a.processStyles();
if (ob.a.enqueued) {
for (var rb, qb = 0; qb < pb.length; qb++) rb = ob.a.getStyleForCustomStyle(pb[qb]), rb && lb.f(rb);
ob.a.enqueued = !1
}
}
}
var Ma = {},
Na = 1,
Oa = 7,
Pa = 4,
Qa = 1E3,
Ra = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,
Sa = /@import[^;]*;/gim,
Ta = /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,
Ua = /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,
Va = /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,
Wa = /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,
Xa = /^@[^\s]*keyframes/,
Ya = /\s+/g,
Za = Promise.resolve(),
_a, $a = !(window.ShadyDOM && window.ShadyDOM.inUse);
window.ShadyCSS && void 0 !== window.ShadyCSS.nativeCss ? _a = window.ShadyCSS.nativeCss : window.ShadyCSS ? (wa(window.ShadyCSS), window.ShadyCSS = void 0) : wa(window.WebComponents && window.WebComponents.flags);
var ab = _a,
bb = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,
cb = /(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,
db = /@media\s(.*)/,
eb = new Set,
fb = /;\s*/m,
gb = /^\s*(initial)|(inherit)\s*$/;
Ba.prototype.set = function(ob, pb) {
ob = ob.trim(), this.a[ob] = {
h: pb,
i: {}
}
}, Ba.prototype.get = function(ob) {
return ob = ob.trim(), this.a[ob] || null
};
var hb = null;
Ca.prototype.o = function(ob) {
return ob = cb.test(ob) || bb.test(ob), cb.lastIndex = 0, bb.lastIndex = 0, ob
}, Ca.prototype.m = function(ob, pb) {
if (void 0 === ob.a) {
for (var tb, qb = [], rb = ob.content.querySelectorAll("style"), sb = 0; sb < rb.length; sb++)
if (tb = rb[sb], !tb.hasAttribute("shady-unscoped")) qb.push(tb.textContent), tb.parentNode.removeChild(tb);
else if (!$a) {
var ub = tb.textContent;
eb.has(ub) || (eb.add(ub), ub = tb.cloneNode(!0), document.head.appendChild(ub)), tb.parentNode.removeChild(tb)
}(qb = qb.join("").trim()) ? (rb = document.createElement("style"), rb.textContent = qb, ob.content.insertBefore(rb, ob.content.firstChild), qb = rb) : qb = null, ob.a = qb
}
return (ob = ob.a) ? this.j(ob, pb) : null
}, Ca.prototype.j = function(ob, pb) {
pb = void 0 === pb ? "" : pb;
var qb = ya(ob);
return this.l(qb, pb), ob.textContent = xa(qb), qb
}, Ca.prototype.f = function(ob) {
var pb = this,
qb = ya(ob);
return za(qb, function(rb) {
":root" === rb.selector && (rb.selector = "html"), pb.g(rb)
}), ob.textContent = xa(qb), qb
}, Ca.prototype.l = function(ob, pb) {
var qb = this;
this.c = pb, za(ob, function(rb) {
qb.g(rb)
}), this.c = null
}, Ca.prototype.g = function(ob) {
ob.cssText = Da(this, ob.parsedCssText), ":root" === ob.selector && (ob.selector = ":host > *")
}, Ca.prototype.detectMixin = Ca.prototype.o, Ca.prototype.transformStyle = Ca.prototype.j, Ca.prototype.transformCustomStyle = Ca.prototype.f, Ca.prototype.transformRules = Ca.prototype.l, Ca.prototype.transformRule = Ca.prototype.g, Ca.prototype.transformTemplate = Ca.prototype.m, Ca.prototype._separator = "_-_", Object.defineProperty(Ca.prototype, "invalidCallback", {
get: function() {
return hb
},
set: function(ob) {
hb = ob
}
});
var kb, ib = null,
jb = window.HTMLImports && window.HTMLImports.whenReady || null,
lb = new Ca;
if (Ja.prototype.prepareTemplate = function(ob, pb) {
Ka(this), Ma[pb] = ob, pb = lb.m(ob, pb), ob._styleAst = pb
}, Ja.prototype.styleSubtree = function(ob, pb) {
if (Ka(this), pb)
for (var qb in pb) null === qb ? ob.style.removeProperty(qb) : ob.style.setProperty(qb, pb[qb]);
if (ob.shadowRoot)
for (this.styleElement(ob), ob = ob.shadowRoot.children || ob.shadowRoot.childNodes, pb = 0; pb < ob.length; pb++) this.styleSubtree(ob[pb]);
else
for (ob = ob.children || ob.childNodes, pb = 0; pb < ob.length; pb++) this.styleSubtree(ob[pb])
}, Ja.prototype.styleElement = function(ob) {
Ka(this);
var qb, pb = ob.localName;
qb = pb ? -1 < pb.indexOf("-") ? pb : ob.getAttribute && ob.getAttribute("is") || "" : ob.is, (pb = Ma[qb]) && !ga(pb) && ((ga(pb) || pb._applyShimValidatingVersion !== pb._applyShimNextVersion) && (this.prepareTemplate(pb, qb), va(pb)), (ob = ob.shadowRoot) && (ob = ob.querySelector("style")) && (ob.__cssRules = pb._styleAst, ob.textContent = xa(pb._styleAst)))
}, Ja.prototype.styleDocument = function(ob) {
Ka(this), this.styleSubtree(document.body, ob)
}, !window.ShadyCSS || !window.ShadyCSS.ScopingShim) {
var mb = new Ja,
nb = window.ShadyCSS && window.ShadyCSS.CustomStyleInterface;
window.ShadyCSS = {
prepareTemplate: function(ob, pb) {
La(mb), mb.prepareTemplate(ob, pb)
},
styleSubtree: function(ob, pb) {
La(mb), mb.styleSubtree(ob, pb)
},
styleElement: function(ob) {
La(mb), mb.styleElement(ob)
},
styleDocument: function(ob) {
La(mb), mb.styleDocument(ob)
},
getComputedStyleValue: function(ob, pb) {
return (ob = window.getComputedStyle(ob).getPropertyValue(pb)) ? ob.trim() : ""
},
nativeCss: ab,
nativeShadow: $a
}, nb && (window.ShadyCSS.CustomStyleInterface = nb)
}
window.ShadyCSS.ApplyShim = lb
}).call(this);
</script>
<script>
(function() {
'use strict';
const a = window.Polymer;
window.Polymer = function(b) {
return window.Polymer._polymerFn(b)
}, a && Object.assign(Polymer, a), window.Polymer._polymerFn = function() {
throw new Error('Load polymer.html to use the Polymer() function.')
}, window.Polymer.version = '2.0.0', window.JSCompiler_renameProperty = function(b) {
return b
}
})();
</script>
<script>
(function() {
'use strict';
function a(c) {
return function(d) {
c.__mixinApplications || (c.__mixinApplications = new WeakMap);
let e = c.__mixinApplications,
f = e.get(d);
return f || (f = c(d), e.set(d, f)), f
}
}
let b = 0;
Polymer.dedupingMixin = function(c) {
return c = a(c), c.__dedupeId = ++b,
function(d) {
let e = d.__mixinSet;
if (e && e[c.__dedupeId]) return d;
let f = c(d);
return f.__mixinSet = Object.create(f.__mixinSet || e || null), f.__mixinSet[c.__dedupeId] = !0, f
}
}
})();
</script>
<script>
(function() {
'use strict';
const a = {},
b = /-[a-z]/g,
c = /([A-Z])/g,
d = {
dashToCamelCase(e) {
return a[e] || (a[e] = 0 > e.indexOf('-') ? e : e.replace(b, f => f[1].toUpperCase()))
},
camelToDashCase(e) {
return a[e] || (a[e] = e.replace(c, '-$1').toLowerCase())
}
};
Polymer.CaseMap = d
})();
</script>
<script>
(function() {
'use strict';
function a(i, j) {
if (i && f.test(i)) return i;
if (void 0 === g) {
g = !1;
try {
const k = new URL('b', 'http://a');
k.pathname = 'c%20d', g = 'http://a/c%20d' === k.href
} catch (k) {}
}
return (j || (j = document.baseURI || window.location.href), g) ? new URL(i, j).href : (h || (h = document.implementation.createHTMLDocument('temp'), h.base = h.createElement('base'), h.head.appendChild(h.base), h.anchor = h.createElement('a'), h.body.appendChild(h.anchor)), h.base.href = j, h.anchor.href = i, h.anchor.href || i)
}
let d = /(url\()([^)]*)(\))/g,
f = /(^\/)|(^#)|(^[\w-\d]*:)/,
g, h;
Polymer.ResolveUrl = {
resolveCss: function(i, j) {
return i.replace(d, function(k, l, n, o) {
return l + '\'' + a(n.replace(/["']/g, ''), j) + '\'' + o
})
},
resolveUrl: a,
pathFromUrl: function(i) {
return i.substring(0, i.lastIndexOf('/') + 1)
}
}
})();
</script>
<script>
(function() {
'use strict';
function a(f) {
return Polymer.DomModule ? Polymer.DomModule.import(f) : null
}
const d = {
cssFromModules(f) {
let g = f.trim().split(' '),
h = '';
for (let j = 0; j < g.length; j++) h += this.cssFromModule(g[j]);
return h
},
cssFromModule(f) {
let g = a(f);
if (g && void 0 === g._cssText) {
let h = '',
j = g.querySelector('template');
j && (h += this.cssFromTemplate(j, g.assetpath)), h += this.cssFromModuleImports(f), g._cssText = h || null
}
return g || console.warn('Could not find style data in module named', f), g && g._cssText || ''
},
cssFromTemplate(f, g) {
let h = '',
j = f.content.querySelectorAll('style');
for (let k = 0; k < j.length; k++) {
let l = j[k],
n = l.getAttribute('include');
n && (h += this.cssFromModules(n)), l.parentNode.removeChild(l), h += g ? Polymer.ResolveUrl.resolveCss(l.textContent, g) : l.textContent
}
return h
},
cssFromModuleImports(f) {
let g = '',
h = a(f);
if (!h) return g;
let j = h.querySelectorAll('link[rel=import][type~=css]');
for (let l, k = 0; k < j.length; k++)
if (l = j[k], l.import) {
let n = l.import,
o = n.body ? n.body : n;
g += Polymer.ResolveUrl.resolveCss(o.textContent, n.baseURI)
}
return g
}
};
Polymer.StyleGather = d
})();
</script>
<script>
(function() {
'use strict';
function a(f) {
return c[f] || d[f.toLowerCase()]
}
function b(f) {
f.querySelector('style') && console.warn('dom-module %s has style outside template', f.id)
}
let c = {},
d = {};
class e extends HTMLElement {
static get observedAttributes() {
return ['id']
}
static
import (f, g) {
if (f) {
let h = a(f);
return h && g ? h.querySelector(g) : h
}
return null
}
attributeChangedCallback(f, g, h) {
g !== h && this.register()
}
get assetpath() {
if (!this.__assetpath) {
const f = window.HTMLImports && HTMLImports.importForElement ? HTMLImports.importForElement(this) || document : this.ownerDocument,
g = Polymer.ResolveUrl.resolveUrl(this.getAttribute('assetpath') || '', f.baseURI);
this.__assetpath = Polymer.ResolveUrl.pathFromUrl(g)
}
return this.__assetpath
}
register(f) {
f = f || this.id, f && (this.id = f, c[f] = this, d[f.toLowerCase()] = this, b(this))
}
}
e.prototype.modules = c, customElements.define('dom-module', e), Polymer.DomModule = e
})();
</script>
<script>
(function() {
'use strict';
const a = {
isPath: function(b) {
return 0 <= b.indexOf('.')
},
root: function(b) {
let c = b.indexOf('.');
return -1 === c ? b : b.slice(0, c)
},
isAncestor: function(b, c) {
return 0 === b.indexOf(c + '.')
},
isDescendant: function(b, c) {
return 0 === c.indexOf(b + '.')
},
translate: function(b, c, d) {
return c + d.slice(b.length)
},
matches: function(b, c) {
return b === c || this.isAncestor(b, c) || this.isDescendant(b, c)
},
normalize: function(b) {
if (Array.isArray(b)) {
let c = [];
for (let e, d = 0; d < b.length; d++) {
e = b[d].toString().split('.');
for (let f = 0; f < e.length; f++) c.push(e[f])
}
return c.join('.')
}
return b
},
split: function(b) {
return Array.isArray(b) ? this.normalize(b).split('.') : b.toString().split('.')
},
get: function(b, c, d) {
let e = b,
f = this.split(c);
for (let g = 0; g < f.length; g++) {
if (!e) return;
let h = f[g];
e = e[h]
}
return d && (d.path = f.join('.')), e
},
set: function(b, c, d) {
let e = b,
f = this.split(c),
g = f[f.length - 1];
if (1 < f.length) {
for (let k, h = 0; h < f.length - 1; h++)
if (k = f[h], e = e[k], !e) return;
e[g] = d
} else e[c] = d;
return f.join('.')
}
};
a.isDeep = a.isPath, Polymer.Path = a
})();
</script>
<script>
(function() {
'use strict';
let c = 0,
d = 0,
f = [],
g = 0,
h = document.createTextNode('');
new window.MutationObserver(function() {
const j = f.length;
for (let l, k = 0; k < j; k++)
if (l = f[k], l) try {
l()
} catch (m) {
setTimeout(() => {
throw m
})
}
f.splice(0, j), d += j
}).observe(h, {
characterData: !0
}), Polymer.Async = {
timeOut: {
after(j) {
return {
run(k) {
return setTimeout(k, j)
},
cancel: window.clearTimeout.bind(window)
}
},
run: window.setTimeout.bind(window),
cancel: window.clearTimeout.bind(window)
},
animationFrame: {
run: window.requestAnimationFrame.bind(window),
cancel: window.cancelAnimationFrame.bind(window)
},
idlePeriod: {
run(j) {
return window.requestIdleCallback ? window.requestIdleCallback(j) : window.setTimeout(j, 16)
},
cancel(j) {
window.cancelIdleCallback ? window.cancelIdleCallback(j) : window.clearTimeout(j)
}
},
microTask: {
run(j) {
return h.textContent = g++, f.push(j), c++
},
cancel(j) {
const k = j - d;
if (0 <= k) {
if (!f[k]) throw new Error('invalid async handle: ' + j);
f[k] = null
}
}
}
}
})();
</script>
<script>
(function() {
'use strict';
function a(f, g) {
if (!d[g]) {
let h = f[g];
h !== void 0 && (f.__data ? f._setPendingProperty(g, h) : (f.__dataProto ? !f.hasOwnProperty(JSCompiler_renameProperty('__dataProto', f)) && (f.__dataProto = Object.create(f.__dataProto)) : f.__dataProto = {}, f.__dataProto[g] = h))
}
}
let b = Polymer.CaseMap,
c = Polymer.Async.microTask;
const d = {};
for (let f, e = HTMLElement.prototype; e;) {
f = Object.getOwnPropertyNames(e);
for (let g = 0; g < f.length; g++) d[f[g]] = !0;
e = Object.getPrototypeOf(e)
}
Polymer.PropertyAccessors = Polymer.dedupingMixin(f => {
return class extends f {
static createPropertiesForAttributes() {
let h = this.observedAttributes;
for (let j = 0; j < h.length; j++) this.prototype._createPropertyAccessor(b.dashToCamelCase(h[j]))
}
constructor() {
super(), this._initializeProperties()
}
attributeChangedCallback(h, j, k) {
j !== k && this._attributeToProperty(h, k)
}
_initializeProperties() {
for (let h in this.__serializing = !1, this.__dataCounter = 0, this.__dataEnabled = !1, this.__dataInitialized = !1, this.__dataInvalid = !1, this.__data = {}, this.__dataPending = null, this.__dataOld = null, this.__dataProto && (this._initializeProtoProperties(this.__dataProto), this.__dataProto = null), this.__dataHasAccessor) this.hasOwnProperty(h) && (this.__dataInstanceProps = this.__dataInstanceProps || {}, this.__dataInstanceProps[h] = this[h], delete this[h])
}
_initializeProtoProperties(h) {
for (let j in h) this._setProperty(j, h[j])
}
_initializeInstanceProperties(h) {
Object.assign(this, h)
}
_ensureAttribute(h, j) {
this.hasAttribute(h) || this._valueToNodeAttribute(this, j, h)
}
_attributeToProperty(h, j, k) {
if (!this.__serializing) {
let l = b.dashToCamelCase(h);
this[l] = this._deserializeValue(j, k)
}
}
_propertyToAttribute(h, j, k) {
this.__serializing = !0, k = 3 > arguments.length ? this[h] : k, this._valueToNodeAttribute(this, k, j || b.camelToDashCase(h)), this.__serializing = !1
}
_valueToNodeAttribute(h, j, k) {
let l = this._serializeValue(j);
l === void 0 ? h.removeAttribute(k) : h.setAttribute(k, l)
}
_serializeValue(h) {
switch (typeof h) {
case 'boolean':
return h ? '' : void 0;
case 'object':
if (h instanceof Date) return h.toString();
if (h) try {
return JSON.stringify(h)
} catch (j) {
return ''
}
default: return null == h ? void 0 : h.toString();
}
}
_deserializeValue(h, j) {
let k;
switch (j) {
case Number:
k = +h;
break;
case Boolean:
k = null !== h;
break;
case Object:
try {
k = JSON.parse(h)
} catch (l) {}
break;
case Array:
try {
k = JSON.parse(h)
} catch (l) {
k = null, console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${h}`)
}
break;
case Date:
k = new Date(h);
break;
case String:
default:
k = h;
}
return k
}
_createPropertyAccessor(h, j) {
this.hasOwnProperty('__dataHasAccessor') || (this.__dataHasAccessor = Object.assign({}, this.__dataHasAccessor)), this.__dataHasAccessor[h] || (this.__dataHasAccessor[h] = !0, a(this, h), Object.defineProperty(this, h, {
get: function() {
return this.__data[h]
},
set: j ? function() {} : function(k) {
this._setProperty(h, k)
}
}))
}
_hasAccessor(h) {
return this.__dataHasAccessor && this.__dataHasAccessor[h]
}
_setProperty(h, j) {
this._setPendingProperty(h, j) && this._invalidateProperties()
}
_setPendingProperty(h, j) {
let k = this.__data[h];
if (this._shouldPropertyChange(h, j, k)) return this.__dataPending || (this.__dataPending = {}, this.__dataOld = {}), h in this.__dataOld || (this.__dataOld[h] = k), this.__data[h] = j, this.__dataPending[h] = j, !0
}
_isPropertyPending(h) {
return this.__dataPending && h in this.__dataPending
}
_invalidateProperties() {
!this.__dataInvalid && this.__dataInitialized && (this.__dataInvalid = !0, c.run(() => {
this.__dataInvalid && (this.__dataInvalid = !1, this._flushProperties())
}))
}
_enableProperties() {
this.__dataEnabled || (this.__dataEnabled = !0, this.__dataInstanceProps && (this._initializeInstanceProperties(this.__dataInstanceProps), this.__dataInstanceProps = null), this.ready())
}
_flushProperties() {
if (this.__dataPending) {
let h = this.__dataPending;
this.__dataPending = null, this.__dataCounter++, this._propertiesChanged(this.__data, h, this.__dataOld), this.__dataCounter--
}
}
ready() {
this.__dataInitialized = !0, this._flushProperties()
}
_propertiesChanged() {}
_shouldPropertyChange(h, j, k) {
return k !== j && (k === k || j === j)
}
}
})
})();
</script>
<script>
(function() {
'use strict';
function b(m) {
let o = m.getAttribute('is');
if (o && k[o]) {
let p = m;
for (p.removeAttribute('is'), m = p.ownerDocument.createElement(o), p.parentNode.replaceChild(m, p), m.appendChild(p); p.attributes.length;) m.setAttribute(p.attributes[0].name, p.attributes[0].value), p.removeAttribute(p.attributes[0].name)
}
return m
}
function c(m, o) {
let p = o.parentInfo && c(m, o.parentInfo);
if (p) {
for (let q = p.firstChild, r = 0; q; q = q.nextSibling)
if (o.parentIndex === r++) return q;
} else return m
}
function d(m, o, p, q) {
q.id && (o[q.id] = p)
}
function f(m, o, p) {
if (p.events && p.events.length)
for (let s, q = 0, r = p.events; q < r.length && (s = r[q]); q++) m._addMethodEventListenerToNode(o, s.name, s.value, m)
}
function g(m, o, p) {
p.templateInfo && (o._templateInfo = p.templateInfo)
}
function h(m, o, p) {
m = m._methodHost || m;
return function(r) {
m[p] ? m[p](r, r.detail) : console.warn('listener method `' + p + '` not defined')
}
}
const k = {
"dom-if": !0,
"dom-repeat": !0
};
Polymer.TemplateStamp = Polymer.dedupingMixin(m => {
return class extends m {
static _parseTemplate(p, q) {
if (!p._templateInfo) {
let r = p._templateInfo = {};
r.nodeInfoList = [], r.stripWhiteSpace = q && q.stripWhiteSpace || p.hasAttribute('strip-whitespace'), this._parseTemplateContent(p, r, {
parent: null
})
}
return p._templateInfo
}
static _parseTemplateContent(p, q, r) {
return this._parseTemplateNode(p.content, q, r)
}
static _parseTemplateNode(p, q, r) {
let s;
return 'template' != p.localName || p.hasAttribute('preserve-content') ? 'slot' === p.localName && (q.hasInsertionPoint = !0) : s = this._parseTemplateNestedTemplate(p, q, r) || s, p.firstChild && (s = this._parseTemplateChildNodes(p, q, r) || s), p.hasAttributes && p.hasAttributes() && (s = this._parseTemplateNodeAttributes(p, q, r) || s), s
}
static _parseTemplateChildNodes(p, q, r) {
for (let v, s = p.firstChild, u = 0; s; s = v) {
if ('template' == s.localName && (s = b(s)), v = s.nextSibling, s.nodeType === Node.TEXT_NODE) {
for (let x = v; x && x.nodeType === Node.TEXT_NODE;) s.textContent += x.textContent, v = x.nextSibling, p.removeChild(x), x = v;
if (q.stripWhiteSpace && !s.textContent.trim()) {
p.removeChild(s);
continue
}
}
let w = {
parentIndex: u,
parentInfo: r
};
this._parseTemplateNode(s, q, w) && (w.infoIndex = q.nodeInfoList.push(w) - 1), s.parentNode && u++
}
}
static _parseTemplateNestedTemplate(p, q, r) {
let s = this._parseTemplate(p, q),
u = s.content = p.content.ownerDocument.createDocumentFragment();
return u.appendChild(p.content), r.templateInfo = s, !0
}
static _parseTemplateNodeAttributes(p, q, r) {
let s, u = Array.from(p.attributes);
for (let w, v = u.length - 1; w = u[v]; v--) s = this._parseTemplateNodeAttribute(p, q, r, w.name, w.value) || s;
return s
}
static _parseTemplateNodeAttribute(p, q, r, s, u) {
return 'on-' === s.slice(0, 3) ? (p.removeAttribute(s), r.events = r.events || [], r.events.push({
name: s.slice(3),
value: u
}), !0) : 'id' === s ? (r.id = u, !0) : void 0
}
static _contentForTemplate(p) {
let q = p.__templateInfo;
return q && q.content || p.content
}
_stampTemplate(p) {
p && !p.content && window.HTMLTemplateElement && HTMLTemplateElement.decorate && HTMLTemplateElement.decorate(p);
let q = this.constructor._parseTemplate(p),
r = q.nodeInfoList,
s = q.content || p.content,
u = document.importNode(s, !0);
u.__noInsertionPoint = !q.hasInsertionPoint;
let v = u.nodeList = Array(r.length);
u.$ = {};
for (let y, z, w = 0, x = r.length; w < x && (y = r[w]); w++) z = v[w] = c(u, y), d(this, u.$, z, y), g(this, z, y), f(this, z, y);
return u
}
_addMethodEventListenerToNode(p, q, r, s) {
s = s || p;
let u = h(s, q, r);
return this._addEventListenerToNode(p, q, u), u
}
_addEventListenerToNode(p, q, r) {
p.addEventListener(q, r)
}
_removeEventListenerFromNode(p, q, r) {
p.removeEventListener(q, r)
}
}
})
})();
</script>
<script>
(function() {
'use strict';
function t(pe, _e) {
let le = pe[_e];
if (!le) le = pe[_e] = {};
else if (!pe.hasOwnProperty(_e))
for (let he in le = pe[_e] = Object.create(pe[_e]), le) {
let fe = le[he],
ue = le[he] = Array(fe.length);
for (let ge = 0; ge < fe.length; ge++) ue[ge] = fe[ge]
}
return le
}
function r(pe, _e, le, he, fe, ue) {
if (_e) {
let ge = !1,
Pe = q++;
for (let ce in le) o(pe, _e, Pe, ce, le, he, fe, ue) && (ge = !0);
return ge
}
return !1
}
function o(pe, _e, le, he, fe, ue, ge, Pe) {
let ce = !1,
me = ge ? Polymer.Path.root(he) : he,
ye = _e[me];
if (ye)
for (let Te, Ee = 0, Ce = ye.length; Ee < Ce && (Te = ye[Ee]); Ee++) Te.info && Te.info.lastRun === le || ge && !d(he, Te.trigger) || (Te.info && (Te.info.lastRun = le), Te.fn(pe, he, fe, ue, Te.info, ge, Pe), ce = !0);
return ce
}
function d(pe, _e) {
if (_e) {
let le = _e.name;
return le == pe || _e.structured && Polymer.Path.isAncestor(le, pe) || _e.wildcard && Polymer.Path.isDescendant(le, pe)
}
return !0
}
function _(pe, _e, le, he, fe) {
let ue = pe[fe.methodName],
ge = fe.property;
ue ? ue.call(pe, pe.__data[ge], he[ge]) : !fe.dynamicFn && console.warn('observer method `' + fe.methodName + '` not defined')
}
function h(pe, _e, le, he, fe) {
let ue = pe.__notifyEffects,
ge, Pe = q++;
for (let me in _e) _e[me] && (ue && o(pe, ue, Pe, me, le, he, fe) ? ge = !0 : fe && f(pe, me, le) && (ge = !0));
let ce;
ge && (ce = pe.__dataHost) && ce._invalidateProperties && ce._invalidateProperties()
}
function f(pe, _e, le) {
let he = Polymer.Path.root(_e);
if (he !== _e) {
let fe = Polymer.CaseMap.camelToDashCase(he) + '-changed';
return u(pe, fe, le[_e], _e), !0
}
}
function u(pe, _e, le, he) {
let fe = {
value: le,
queueProperty: !0
};
he && (fe.path = he), pe.dispatchEvent(new CustomEvent(_e, {
detail: fe
}))
}
function g(pe, _e, le, he, fe, ue) {
let ge = ue ? Polymer.Path.root(_e) : _e,
Pe = ge == _e ? null : _e,
ce = Pe ? Polymer.Path.get(pe, Pe) : pe.__data[_e];
Pe && ce === void 0 && (ce = le[_e]), u(pe, fe.eventName, ce, Pe)
}
function P(pe, _e, le, he, fe) {
let ue, ge = pe.detail,
Pe = ge && ge.path;
Pe ? (he = Polymer.Path.translate(le, he, Pe), ue = ge && ge.value) : ue = pe.target[le], ue = fe ? !ue : ue, _e.__readOnly && _e.__readOnly[he] || !_e._setPendingPropertyOrPath(he, ue, !0, !!Pe) || ge && ge.queueProperty || _e._invalidateProperties()
}
function c(pe, _e, le, he, fe) {
let ue = pe.__data[_e];
Polymer.sanitizeDOMValue && (ue = Polymer.sanitizeDOMValue(ue, fe.attrName, 'attribute', pe)), pe._propertyToAttribute(_e, fe.attrName, ue)
}
function y(pe, _e, le, he) {
let fe = pe.__computeEffects;
if (fe)
for (let ue = _e; r(pe, fe, ue, le, he);) Object.assign(le, pe.__dataOld), Object.assign(_e, pe.__dataPending), ue = pe.__dataPending, pe.__dataPending = null
}
function E(pe, _e, le, he, fe) {
let ue = R(pe, _e, le, he, fe),
ge = fe.methodInfo;
pe.__dataHasAccessor && pe.__dataHasAccessor[ge] ? pe._setPendingProperty(ge, ue, !0) : pe[ge] = ue
}
function C(pe, _e, le) {
let he = pe.__dataLinkedPaths;
if (he) {
let fe;
for (let ue in he) {
let ge = he[ue];
Polymer.Path.isDescendant(ue, _e) ? (fe = Polymer.Path.translate(ue, ge, _e), pe._setPendingPropertyOrPath(fe, le, !0, !0)) : Polymer.Path.isDescendant(ge, _e) && (fe = Polymer.Path.translate(ge, ue, _e), pe._setPendingPropertyOrPath(fe, le, !0, !0))
}
}
}
function T(pe, _e, le, he, fe, ue, ge) {
le.bindings = le.bindings || [];
let Pe = {
kind: he,
target: fe,
parts: ue,
literal: ge,
isCompound: 1 !== ue.length
};
if (le.bindings.push(Pe), A(Pe)) {
let {
event: me,
negate: ye
} = Pe.parts[0];
Pe.listenerEvent = me || U.camelToDashCase(fe) + '-changed', Pe.listenerNegate = ye
}
let ce = _e.nodeInfoList.length;
for (let ye, me = 0; me < Pe.parts.length; me++) ye = Pe.parts[me], ye.compoundIndex = me, O(pe, _e, Pe, ye, ce)
}
function O(pe, _e, le, he, fe) {
if (!he.literal)
if ('attribute' === le.kind && '-' === le.target[0]) console.warn('Cannot set attribute ' + le.target + ' because "-" is not a valid attribute starting character');
else {
let ue = he.dependencies,
ge = {
index: fe,
binding: le,
part: he,
evaluator: pe
};
for (let ce, Pe = 0; Pe < ue.length; Pe++) ce = ue[Pe], 'string' == typeof ce && (ce = S(ce), ce.wildcard = !0), pe._addTemplatePropertyEffect(_e, ce.rootProperty, {
fn: N,
info: ge,
trigger: ce
})
}
}
function N(pe, _e, le, he, fe, ue, ge) {
let Pe = ge[fe.index],
ce = fe.binding,
me = fe.part;
if (ue && me.source && _e.length > me.source.length && 'property' == ce.kind && !ce.isCompound && Pe.__dataHasAccessor && Pe.__dataHasAccessor[ce.target]) {
let ye = le[_e];
_e = Polymer.Path.translate(me.source, ce.target, _e), Pe._setPendingPropertyOrPath(_e, ye, !1, !0) && pe._enqueueClient(Pe)
} else {
let ye = fe.evaluator._evaluateBinding(pe, me, _e, le, he, ue);
I(pe, Pe, ce, me, ye)
}
}
function I(pe, _e, le, he, fe) {
if (fe = x(_e, fe, le, he), Polymer.sanitizeDOMValue && (fe = Polymer.sanitizeDOMValue(fe, le.target, le.kind, _e)), 'attribute' == le.kind) pe._valueToNodeAttribute(_e, fe, le.target);
else {
let ue = le.target;
_e.__dataHasAccessor && _e.__dataHasAccessor[ue] ? (!_e.__readOnly || !_e.__readOnly[ue]) && _e._setPendingProperty(ue, fe) && pe._enqueueClient(_e) : pe._setUnmanagedPropertyToNode(_e, ue, fe)
}
}
function x(pe, _e, le, he) {
if (le.isCompound) {
let fe = pe.__dataCompoundStorage[le.target];
fe[he.compoundIndex] = _e, _e = fe.join('')
}
return 'attribute' !== le.kind && ('textContent' === le.target || 'input' == pe.localName && 'value' == le.target) && (_e = void 0 == _e ? '' : _e), _e
}
function A(pe) {
return pe.target && 'attribute' != pe.kind && 'text' != pe.kind && !pe.isCompound && '{' === pe.parts[0].mode
}
function L(pe, _e) {
let {
nodeList: le,
nodeInfoList: he
} = _e;
if (he.length)
for (let fe = 0; fe < he.length; fe++) {
let ue = he[fe],
ge = le[fe],
Pe = ue.bindings;
if (Pe)
for (let me, ce = 0; ce < Pe.length; ce++) me = Pe[ce], k(ge, me), H(ge, pe, me);
ge.__dataHost = pe
}
}
function k(pe, _e) {
if (_e.isCompound) {
let le = pe.__dataCompoundStorage || (pe.__dataCompoundStorage = {}),
he = _e.parts,
fe = Array(he.length);
for (let ge = 0; ge < he.length; ge++) fe[ge] = he[ge].literal;
let ue = _e.target;
le[ue] = fe, _e.literal && 'property' == _e.kind && (pe[ue] = _e.literal)
}
}
function H(pe, _e, le) {
if (le.listenerEvent) {
let he = le.parts[0];
pe.addEventListener(le.listenerEvent, function(fe) {
P(fe, _e, le.target, he.source, he.negate)
})
}
}
function z(pe, _e, le, he, fe, ue) {
ue = _e.static || ue && ('object' != typeof ue || ue[_e.methodName]);
let ge = {
methodName: _e.methodName,
args: _e.args,
methodInfo: fe,
dynamicFn: ue
};
for (let ce, Pe = 0; Pe < _e.args.length && (ce = _e.args[Pe]); Pe++) ce.literal || pe._addPropertyEffect(ce.rootProperty, le, {
fn: he,
info: ge,
trigger: ce
});
ue && pe._addPropertyEffect(_e.methodName, le, {
fn: he,
info: ge
})
}
function R(pe, _e, le, he, fe) {
let ue = pe._methodHost || pe,
ge = ue[fe.methodName];
if (ge) {
let Pe = F(pe.__data, fe.args, _e, le);
return ge.apply(ue, Pe)
}
fe.dynamicFn || console.warn('method `' + fe.methodName + '` not defined')
}
function D(pe) {
let _e = '';
for (let he, le = 0; le < pe.length; le++) he = pe[le].literal, _e += he || '';
return _e
}
function w(pe) {
let _e = pe.match(/([^\s]+?)\(([\s\S]*)\)/);
if (_e) {
let le = _e[1],
he = {
methodName: le,
static: !0
};
if (_e[2].trim()) {
let fe = _e[2].replace(/\\,/g, '&comma;').split(',');
return M(fe, he)
}
return he.args = Z, he
}
return null
}
function M(pe, _e) {
return _e.args = pe.map(function(le) {
let he = S(le);
return he.literal || (_e.static = !1), he
}, this), _e
}
function S(pe) {
let _e = pe.trim().replace(/&comma;/g, ',').replace(/\\(.)/g, '$1'),
le = {
name: _e
},
he = _e[0];
return '-' === he && (he = _e[1]), '0' <= he && '9' >= he && (he = '#'), '\'' === he || '"' === he ? (le.value = _e.slice(1, -1), le.literal = !0) : '#' === he ? (le.value = +_e, le.literal = !0) : void 0, (le.literal || (le.rootProperty = Polymer.Path.root(_e), le.structured = Polymer.Path.isPath(_e), le.structured && (le.wildcard = '.*' == _e.slice(-2), le.wildcard && (le.name = _e.slice(0, -2)))), le)
}
function F(pe, _e, le, he) {
let fe = [];
for (let ue = 0, ge = _e.length; ue < ge; ue++) {
let me, Pe = _e[ue],
ce = Pe.name;
if (Pe.literal ? me = Pe.value : Pe.structured ? (me = Polymer.Path.get(pe, ce), void 0 == me && (me = he[ce])) : me = pe[ce], Pe.wildcard) {
let ye = 0 === ce.indexOf(le + '.'),
Ee = 0 === le.indexOf(ce) && !ye;
fe[ue] = {
path: Ee ? le : ce,
value: Ee ? he[le] : me,
base: me
}
} else fe[ue] = me
}
return fe
}
function B(pe, _e, le, he) {
let fe = le + '.splices';
pe.notifyPath(fe, {
indexSplices: he
}), pe.notifyPath(le + '.length', _e.length), pe.__data[fe] = {
indexSplices: null
}
}
function V(pe, _e, le, he, fe, ue) {
B(pe, _e, le, [{
index: he,
addedCount: fe,
removed: ue,
object: _e,
type: 'splice'
}])
}
function Y(pe) {
return pe[0].toUpperCase() + pe.substring(1)
}
const U = Polymer.CaseMap;
let q = 0;
const $ = {
COMPUTE: '__computeEffects',
REFLECT: '__reflectEffects',
NOTIFY: '__notifyEffects',
PROPAGATE: '__propagateEffects',
OBSERVE: '__observeEffects',
READ_ONLY: '__readOnly'
},
Z = [],
G = '(?:[a-zA-Z_$][\\w.:$\\-*]*)',
K = '(?:' + G + '|' + '(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)' + '|' + ('(?:' + '(?:\'(?:[^\'\\\\]|\\\\.)*\')' + '|' + '(?:"(?:[^"\\\\]|\\\\.)*")' + ')') + '\\s*)',
ie = /(\[\[|{{)\s*(?:(!)\s*)?((?:[a-zA-Z_$][\w.:$\-*]*)\s*(?:\(\s*(?:(?:(?:(?:[a-zA-Z_$][\w.:$\-*]*)|(?:[-+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\]|\\.)*')|(?:"(?:[^"\\]|\\.)*"))\s*)(?:,\s*(?:(?:[a-zA-Z_$][\w.:$\-*]*)|(?:[-+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\]|\\.)*')|(?:"(?:[^"\\]|\\.)*"))\s*))*)?)\)\s*)?)(?:]]|}})/g;
Polymer.PropertyEffects = Polymer.dedupingMixin(pe => {
const _e = Polymer.TemplateStamp(Polymer.PropertyAccessors(pe));
class le extends _e {
get PROPERTY_EFFECT_TYPES() {
return $
}
_initializeProperties() {
super._initializeProperties(), se.registerHost(this), this.__dataClientsInitialized = !1, this.__dataPendingClients = null, this.__dataToNotify = null, this.__dataLinkedPaths = null, this.__dataHasPaths = !1, this.__dataCompoundStorage = this.__dataCompoundStorage || null, this.__dataHost = this.__dataHost || null, this.__dataTemp = {}
}
_initializeProtoProperties(he) {
this.__data = Object.create(he), this.__dataPending = Object.create(he), this.__dataOld = {}
}
_initializeInstanceProperties(he) {
let fe = this.__readOnly;
for (let ue in he) fe && fe[ue] || (this.__dataPending = this.__dataPending || {}, this.__dataOld = this.__dataOld || {}, this.__data[ue] = this.__dataPending[ue] = he[ue])
}
_addPropertyEffect(he, fe, ue) {
this._createPropertyAccessor(he, fe == $.READ_ONLY);
let ge = t(this, fe)[he];
ge || (ge = this[fe][he] = []), ge.push(ue)
}
_removePropertyEffect(he, fe, ue) {
let ge = t(this, fe)[he],
Pe = ge.indexOf(ue);
0 <= Pe && ge.splice(Pe, 1)
}
_hasPropertyEffect(he, fe) {
let ue = this[fe];
return !!(ue && ue[he])
}
_hasReadOnlyEffect(he) {
return this._hasPropertyEffect(he, $.READ_ONLY)
}
_hasNotifyEffect(he) {
return this._hasPropertyEffect(he, $.NOTIFY)
}
_hasReflectEffect(he) {
return this._hasPropertyEffect(he, $.REFLECT)
}
_hasComputedEffect(he) {
return this._hasPropertyEffect(he, $.COMPUTE)
}
_setPendingPropertyOrPath(he, fe, ue, ge) {
if (ge || Polymer.Path.root(Array.isArray(he) ? he[0] : he) !== he) {
if (!ge) {
let Pe = Polymer.Path.get(this, he);
if (he = Polymer.Path.set(this, he, fe), !he || !super._shouldPropertyChange(he, fe, Pe)) return !1
}
if (this.__dataHasPaths = !0, this._setPendingProperty(he, fe, ue)) return C(this, he, fe), !0
} else {
if (this.__dataHasAccessor && this.__dataHasAccessor[he]) return this._setPendingProperty(he, fe, ue);
this[he] = fe
}
return !1
}
_setUnmanagedPropertyToNode(he, fe, ue) {
(ue !== he[fe] || 'object' == typeof ue) && (he[fe] = ue)
}
_setPendingProperty(he, fe, ue) {
let ge = this.__dataHasPaths && Polymer.Path.isPath(he),
Pe = ge ? this.__dataTemp : this.__data;
if (this._shouldPropertyChange(he, fe, Pe[he])) return this.__dataPending || (this.__dataPending = {}, this.__dataOld = {}), he in this.__dataOld || (this.__dataOld[he] = this.__data[he]), ge ? this.__dataTemp[he] = fe : this.__data[he] = fe, this.__dataPending[he] = fe, (ge || this.__notifyEffects && this.__notifyEffects[he]) && (this.__dataToNotify = this.__dataToNotify || {}, this.__dataToNotify[he] = ue), !0
}
_setProperty(he, fe) {
this._setPendingProperty(he, fe, !0) && this._invalidateProperties()
}
_invalidateProperties() {
this.__dataInitialized && this._flushProperties()
}
_enqueueClient(he) {
this.__dataPendingClients = this.__dataPendingClients || [], he !== this && this.__dataPendingClients.push(he)
}
_flushClients() {
if (!this.__dataClientsInitialized) this.__dataClientsInitialized = !0, this._readyClients(), this.__dataInitialized = !0;
else {
let he = this.__dataPendingClients;
if (he) {
this.__dataPendingClients = null;
for (let ue, fe = 0; fe < he.length; fe++) ue = he[fe], ue.__dataPending && ue._flushProperties()
}
}
}
_readyClients() {
let he = this.__dataPendingClients;
if (he) {
this.__dataPendingClients = null;
for (let ue, fe = 0; fe < he.length; fe++) ue = he[fe], ue.__dataEnabled || ue._enableProperties()
}
}
setProperties(he, fe) {
for (let ue in he) !fe && this.__readOnly && this.__readOnly[ue] || this._setPendingPropertyOrPath(ue, he[ue], !0);
this._invalidateProperties()
}
ready() {
this._flushProperties(), this.__dataClientsInitialized || this._flushClients(), this.__dataPending && this._flushProperties()
}
_propertiesChanged(he, fe, ue) {
let ge = this.__dataHasPaths;
this.__dataHasPaths = !1, y(this, fe, ue, ge);
let Pe = this.__dataToNotify;
this.__dataToNotify = null, this._propagatePropertyChanges(fe, ue, ge), this._flushClients(), r(this, this.__reflectEffects, fe, ue, ge), r(this, this.__observeEffects, fe, ue, ge), Pe && h(this, Pe, fe, ue, ge), 1 == this.__dataCounter && (this.__dataTemp = {})
}
_propagatePropertyChanges(he, fe, ue) {
this.__propagateEffects && r(this, this.__propagateEffects, he, fe, ue);
for (let ge = this.__templateInfo; ge;) r(this, ge.propertyEffects, he, fe, ue, ge.nodeList), ge = ge.nextTemplateInfo
}
linkPaths(he, fe) {
he = Polymer.Path.normalize(he), fe = Polymer.Path.normalize(fe), this.__dataLinkedPaths = this.__dataLinkedPaths || {}, this.__dataLinkedPaths[he] = fe
}
unlinkPaths(he) {
he = Polymer.Path.normalize(he), this.__dataLinkedPaths && delete this.__dataLinkedPaths[he]
}
notifySplices(he, fe) {
let ue = {},
ge = Polymer.Path.get(this, he, ue);
B(this, ge, ue.path, fe)
}
get(he, fe) {
return Polymer.Path.get(fe || this, he)
}
set(he, fe, ue) {
ue ? Polymer.Path.set(ue, he, fe) : (!this.__readOnly || !this.__readOnly[he]) && this._setPendingPropertyOrPath(he, fe, !0) && this._invalidateProperties()
}
push(he, ...fe) {
let ue = {},
ge = Polymer.Path.get(this, he, ue),
Pe = ge.length,
ce = ge.push(...fe);
return fe.length && V(this, ge, ue.path, Pe, fe.length, []), ce
}
pop(he) {
let fe = {},
ue = Polymer.Path.get(this, he, fe),
ge = !!ue.length,
Pe = ue.pop();
return ge && V(this, ue, fe.path, ue.length, 0, [Pe]), Pe
}
splice(he, fe, ue, ...ge) {
let Pe = {},
ce = Polymer.Path.get(this, he, Pe);
fe = 0 > fe ? ce.length - Math.floor(-fe) : Math.floor(fe), fe || (fe = 0);
let me = ce.splice(fe, ue, ...ge);
return (ge.length || me.length) && V(this, ce, Pe.path, fe, ge.length, me), me
}
shift(he) {
let fe = {},
ue = Polymer.Path.get(this, he, fe),
ge = !!ue.length,
Pe = ue.shift();
return ge && V(this, ue, fe.path, 0, 0, [Pe]), Pe
}
unshift(he, ...fe) {
let ue = {},
ge = Polymer.Path.get(this, he, ue),
Pe = ge.unshift(...fe);
return fe.length && V(this, ge, ue.path, 0, fe.length, []), Pe
}
notifyPath(he, fe) {
let ue;
if (1 == arguments.length) {
let ge = {};
fe = Polymer.Path.get(this, he, ge), ue = ge.path
} else ue = Array.isArray(he) ? Polymer.Path.normalize(he) : he;
this._setPendingPropertyOrPath(ue, fe, !0, !0) && this._invalidateProperties()
}
_createReadOnlyProperty(he, fe) {
this._addPropertyEffect(he, $.READ_ONLY), fe && (this['_set' + Y(he)] = function(ue) {
this._setProperty(he, ue)
})
}
_createPropertyObserver(he, fe, ue) {
let ge = {
property: he,
methodName: fe,
dynamicFn: ue
};
this._addPropertyEffect(he, $.OBSERVE, {
fn: _,
info: ge,
trigger: {
name: he
}
}), ue && this._addPropertyEffect(fe, $.OBSERVE, {
fn: _,
info: ge,
trigger: {
name: fe
}
})
}
_createMethodObserver(he, fe) {
let ue = w(he);
if (!ue) throw new Error('Malformed observer expression \'' + he + '\'');
z(this, ue, $.OBSERVE, R, null, fe)
}
_createNotifyingProperty(he) {
this._addPropertyEffect(he, $.NOTIFY, {
fn: g,
info: {
eventName: U.camelToDashCase(he) + '-changed',
property: he
}
})
}
_createReflectedProperty(he) {
let fe = U.camelToDashCase(he);
'-' === fe[0] ? console.warn('Property ' + he + ' cannot be reflected to attribute ' + fe + ' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property thisead.') : this._addPropertyEffect(he, $.REFLECT, {
fn: c,
info: {
attrName: fe
}
})
}
_createComputedProperty(he, fe, ue) {
let ge = w(fe);
if (!ge) throw new Error('Malformed computed expression \'' + fe + '\'');
z(this, ge, $.COMPUTE, E, he, ue)
}
static addPropertyEffect(he, fe, ue) {
this.prototype._addPropertyEffect(he, fe, ue)
}
static createPropertyObserver(he, fe, ue) {
this.prototype._createPropertyObserver(he, fe, ue)
}
static createMethodObserver(he, fe) {
this.prototype._createMethodObserver(he, fe)
}
static createNotifyingProperty(he) {
this.prototype._createNotifyingProperty(he)
}
static createReadOnlyProperty(he, fe) {
this.prototype._createReadOnlyProperty(he, fe)
}
static createReflectedProperty(he) {
this.prototype._createReflectedProperty(he)
}
static createComputedProperty(he, fe, ue) {
this.prototype._createComputedProperty(he, fe, ue)
}
static bindTemplate(he) {
return this.prototype._bindTemplate(he)
}
_bindTemplate(he, fe) {
let ue = this.constructor._parseTemplate(he),
ge = this.__templateInfo == ue;
if (!ge)
for (let Pe in ue.propertyEffects) this._createPropertyAccessor(Pe);
if (fe && (ue = Object.create(ue), ue.wasPreBound = ge, !ge && this.__templateInfo)) {
let Pe = this.__templateInfoLast || this.__templateInfo;
return this.__templateInfoLast = Pe.nextTemplateInfo = ue, ue.previousTemplateInfo = Pe, ue
}
return this.__templateInfo = ue
}
static _addTemplatePropertyEffect(he, fe, ue) {
let ge = he.hostProps = he.hostProps || {};
ge[fe] = !0;
let Pe = he.propertyEffects = he.propertyEffects || {},
ce = Pe[fe] = Pe[fe] || [];
ce.push(ue)
}
_stampTemplate(he) {
se.beginHosting(this);
let fe = super._stampTemplate(he);
se.endHosting(this);
let ue = this._bindTemplate(he, !0);
if (ue.nodeList = fe.nodeList, !ue.wasPreBound) {
let ge = ue.childNodes = [];
for (let Pe = fe.firstChild; Pe; Pe = Pe.nextSibling) ge.push(Pe)
}
return fe.templateInfo = ue, L(this, ue), this.__dataInitialized && r(this, ue.propertyEffects, this.__data, null, !1, ue.nodeList), fe
}
_removeBoundDom(he) {
let fe = he.templateInfo;
fe.previousTemplateInfo && (fe.previousTemplateInfo.nextTemplateInfo = fe.nextTemplateInfo), fe.nextTemplateInfo && (fe.nextTemplateInfo.previousTemplateInfo = fe.previousTemplateInfo), this.__templateInfoLast == fe && (this.__templateInfoLast = fe.previousTemplateInfo), fe.previousTemplateInfo = fe.nextTemplateInfo = null;
let ue = fe.childNodes;
for (let Pe, ge = 0; ge < ue.length; ge++) Pe = ue[ge], Pe.parentNode.removeChild(Pe)
}
static _parseTemplateNode(he, fe, ue) {
let ge = super._parseTemplateNode(he, fe, ue);
if (he.nodeType === Node.TEXT_NODE) {
let Pe = this._parseBindings(he.textContent, fe);
Pe && (he.textContent = D(Pe) || ' ', T(this, fe, ue, 'text', 'textContent', Pe), ge = !0)
}
return ge
}
static _parseTemplateNodeAttribute(he, fe, ue, ge, Pe) {
let ce = this._parseBindings(Pe, fe);
if (ce) {
let me = ge,
ye = 'property';
'$' == ge[ge.length - 1] && (ge = ge.slice(0, -1), ye = 'attribute');
let Ee = D(ce);
return Ee && 'attribute' == ye && he.setAttribute(ge, Ee), 'input' === he.localName && 'value' === me && he.setAttribute(me, ''), he.removeAttribute(me), 'property' == ye && (ge = Polymer.CaseMap.dashToCamelCase(ge)), T(this, fe, ue, ye, ge, ce, Ee), !0
}
return super._parseTemplateNodeAttribute(he, fe, ue, ge, Pe)
}
static _parseTemplateNestedTemplate(he, fe, ue) {
let ge = super._parseTemplateNestedTemplate(he, fe, ue),
Pe = ue.templateInfo.hostProps;
for (let me in Pe) {
T(this, fe, ue, 'property', '_host_' + me, [{
mode: '{',
source: me,
dependencies: [me]
}])
}
return ge
}
static _parseBindings(he, fe) {
let ue = [],
ge = 0,
Pe;
for (; null !== (Pe = ie.exec(he));) {
Pe.index > ge && ue.push({
literal: he.slice(ge, Pe.index)
});
let ce = Pe[1][0],
me = !!Pe[2],
ye = Pe[3].trim(),
Ee, Ce, Te;
'{' == ce && 0 < (Te = ye.indexOf('::')) && (Ce = ye.substring(Te + 2), ye = ye.substring(0, Te), Ee = !0);
let Oe = w(ye),
ve = [];
if (Oe) {
let {
args: be,
methodName: Ne
} = Oe;
for (let Ae, xe = 0; xe < be.length; xe++) Ae = be[xe], Ae.literal || ve.push(Ae);
let Ie = fe.dynamicFns;
(Ie && Ie[Ne] || Oe.static) && (ve.push(Ne), Oe.dynamicFn = !0)
} else ve.push(ye);
ue.push({
source: ye,
mode: ce,
negate: me,
customEvent: Ee,
signature: Oe,
dependencies: ve,
event: Ce
}), ge = ie.lastIndex
}
if (ge && ge < he.length) {
let ce = he.substring(ge);
ce && ue.push({
literal: ce
})
}
return ue.length ? ue : void 0
}
static _evaluateBinding(he, fe, ue, ge, Pe, ce) {
let me;
return me = fe.signature ? R(he, ue, ge, Pe, fe.signature) : ue == fe.source ? ce && Polymer.Path.isPath(ue) ? Polymer.Path.get(he, ue) : he.__data[ue] : Polymer.Path.get(he, fe.source), fe.negate && (me = !me), me
}
}
return le
});
let se = {
stack: [],
registerHost(pe) {
if (this.stack.length) {
let _e = this.stack[this.stack.length - 1];
_e._enqueueClient(pe)
}
},
beginHosting(pe) {
this.stack.push(pe)
},
endHosting(pe) {
let _e = this.stack.length;
_e && this.stack[_e - 1] == pe && this.stack.pop()
}
}
})();
</script>
<script>
(function() {
'use strict';
let b = function() {};
b.is, b.extends, b.properties, b.observers, b.template, Polymer.ElementMixin = Polymer.dedupingMixin(c => {
function d(w) {
return w.hasOwnProperty(JSCompiler_renameProperty('__ownProperties', w)) || (w.__ownProperties = w.hasOwnProperty(JSCompiler_renameProperty('properties', w)) ? w.properties : {}), w.__ownProperties
}
function e(w) {
return w.hasOwnProperty(JSCompiler_renameProperty('__ownObservers', w)) || (w.__ownObservers = w.hasOwnProperty(JSCompiler_renameProperty('observers', w)) ? w.observers : []), w.__ownObservers
}
function f(w, x) {
for (let y in x) {
let z = x[y];
'function' == typeof z && (z = {
type: z
}), w[y] = z
}
return w
}
function g(w) {
if (!w.hasOwnProperty(JSCompiler_renameProperty('__classProperties', w))) {
w.__classProperties = f({}, d(w));
let x = Object.getPrototypeOf(w.prototype).constructor;
x.prototype instanceof v && (w.__classProperties = Object.assign(Object.create(g(x)), w.__classProperties))
}
return w.__classProperties
}
function h(w) {
if (!w.hasOwnProperty(JSCompiler_renameProperty('__classPropertyDefaults', w))) {
w.__classPropertyDefaults = null;
let x = g(w);
for (let y in x) {
let z = x[y];
'value' in z && (w.__classPropertyDefaults = w.__classPropertyDefaults || {}, w.__classPropertyDefaults[y] = z)
}
}
return w.__classPropertyDefaults
}
function j(w) {
return w.hasOwnProperty(JSCompiler_renameProperty('__finalized', w))
}
function k(w) {
let x = w.prototype,
y = Object.getPrototypeOf(x).constructor;
y.prototype instanceof v && y.finalize(), l(w)
}
function l(w) {
w.__finalized = !0;
let x = w.prototype;
w.hasOwnProperty(JSCompiler_renameProperty('is', w)) && w.is && Polymer.telemetry.register(x);
let y = d(w);
y && m(x, y);
let z = e(w);
z && n(x, z, y);
let A = w.template;
if (A) {
if ('string' == typeof A) {
let B = document.createElement('template');
B.innerHTML = A, A = B
} else A = A.cloneNode(!0);
x._template = A
}
}
function m(w, x) {
for (let y in x) q(w, y, x[y], x)
}
function n(w, x, y) {
for (let z = 0; z < x.length; z++) w._createMethodObserver(x[z], y)
}
function q(w, x, y, z) {
y.computed && (y.readOnly = !0), y.computed && !w._hasReadOnlyEffect(x) && w._createComputedProperty(x, y.computed, z), y.readOnly && !w._hasReadOnlyEffect(x) && w._createReadOnlyProperty(x, !y.computed), y.reflectToAttribute && !w._hasReflectEffect(x) && w._createReflectedProperty(x), y.notify && !w._hasNotifyEffect(x) && w._createNotifyingProperty(x), y.observer && w._createPropertyObserver(x, y.observer, z[y.observer])
}
function r(w, x, y, z, A) {
let B = Polymer.StyleGather.cssFromTemplate(x, y) + Polymer.StyleGather.cssFromModuleImports(z);
if (B) {
let C = document.createElement('style');
C.textContent = B, x.content.insertBefore(C, x.content.firstChild)
}
window.ShadyCSS && window.ShadyCSS.prepareTemplate(x, z, A), w._bindTemplate(x)
}
const s = Polymer.PropertyEffects(c);
let u = Polymer.CaseMap;
class v extends s {
static get observedAttributes() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('__observedAttributes', this))) {
let w = [],
x = g(this);
for (let y in x) w.push(Polymer.CaseMap.camelToDashCase(y));
this.__observedAttributes = w
}
return this.__observedAttributes
}
static finalize() {
j(this) || k(this)
}
static get template() {
return this.hasOwnProperty(JSCompiler_renameProperty('_template', this)) || (this._template = Polymer.DomModule.import(this.is, 'template') || Object.getPrototypeOf(this.prototype).constructor.template), this._template
}
static get importPath() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_importPath', this))) {
const w = Polymer.DomModule.import(this.is);
this._importPath = w ? w.assetpath : Object.getPrototypeOf(this.prototype).constructor.importPath
}
return this._importPath
}
_initializeProperties() {
Polymer.telemetry.instanceCount++, this.constructor.finalize();
const w = this.constructor.importPath;
if (this._template && !this._template.__polymerFinalized) {
this._template.__polymerFinalized = !0;
const y = w ? Polymer.ResolveUrl.resolveUrl(w) : '';
r(this.__proto__, this._template, y, this.localName)
}
super._initializeProperties(), this.rootPath = Polymer.rootPath, this.importPath = w;
let x = h(this.constructor);
if (x)
for (let y in x) {
let z = x[y];
if (!this.hasOwnProperty(y)) {
let A = 'function' == typeof z.value ? z.value.call(this) : z.value;
this._hasAccessor(y) ? this._setPendingProperty(y, A, !0) : this[y] = A
}
}
}
connectedCallback() {
window.ShadyCSS && this._template && window.ShadyCSS.styleElement(this), this._enableProperties()
}
disconnectedCallback() {}
ready() {
this._template && (this.root = this._stampTemplate(this._template), this.$ = this.root.$), super.ready()
}
_readyClients() {
this._template && (this.root = this._attachDom(this.root)), super._readyClients()
}
_attachDom(w) {
if (!this.attachShadow) throw new Error('ShadowDOM not available. Polymer.Element can create dom as children instead of in ShadowDOM by setting `this.root = this;` before `ready`.');
else if (w) return this.shadowRoot || this.attachShadow({
mode: 'open'
}), this.shadowRoot.appendChild(w), this.shadowRoot
}
attributeChangedCallback(w, x, y) {
if (x !== y) {
let z = u.dashToCamelCase(w),
A = g(this.constructor)[z].type;
this._hasReadOnlyEffect(z) || this._attributeToProperty(w, y, A)
}
}
updateStyles(w) {
window.ShadyCSS && window.ShadyCSS.styleSubtree(this, w)
}
resolveUrl(w, x) {
return !x && this.importPath && (x = Polymer.ResolveUrl.resolveUrl(this.importPath)), Polymer.ResolveUrl.resolveUrl(w, x)
}
static _parseTemplateContent(w, x, y) {
return x.dynamicFns = x.dynamicFns || g(this), super._parseTemplateContent(w, x, y)
}
}
return v
}), Polymer.telemetry = {
instanceCount: 0,
registrations: [],
_regLog: function(c) {
console.log('[' + c.is + ']: registered')
},
register: function(c) {
this.registrations.push(c), Polymer.log && this._regLog(c)
},
dumpRegistrations: function() {
this.registrations.forEach(this._regLog)
}
}, Polymer.updateStyles = function(c) {
window.ShadyCSS && window.ShadyCSS.styleDocument(c)
}, Polymer.rootPath = Polymer.rootPath || Polymer.ResolveUrl.pathFromUrl(document.baseURI || window.location.href)
})();
</script>
<script>
(function() {
'use strict';
class b {
constructor() {
this._asyncModule = null, this._callback = null, this._timer = null
}
setConfig(c, d) {
this._asyncModule = c, this._callback = d, this._timer = this._asyncModule.run(() => {
this._timer = null, this._callback()
})
}
cancel() {
this.isActive() && (this._asyncModule.cancel(this._timer), this._timer = null)
}
flush() {
this.isActive() && (this.cancel(), this._callback())
}
isActive() {
return null != this._timer
}
static debounce(c, d, e) {
return c instanceof b ? c.cancel() : c = new b, c.setConfig(d, e), c
}
}
Polymer.Debouncer = b
})();
</script>
<script>
(function() {
'use strict';
function a(F) {
let G = B ? ['click'] : v;
for (let I, H = 0; H < G.length; H++) I = G[H], F ? document.addEventListener(I, C, !0) : document.removeEventListener(I, C, !0)
}
function c(F) {
let G = F.type;
if (-1 === v.indexOf(G)) return !1;
if ('mousemove' === G) {
let H = void 0 === F.buttons ? 1 : F.buttons;
return F instanceof window.MouseEvent && !z && (H = w[F.which] || 0), !!(1 & H)
}
let H = void 0 === F.button ? 0 : F.button;
return 0 === H
}
function d(F) {
if ('click' === F.type) {
if (0 === F.detail) return !0;
let G = E._findOriginalTarget(F);
if (G.nodeType !== Node.ELEMENT_NODE) return !0;
let H = G.getBoundingClientRect(),
I = F.pageX,
J = F.pageY;
return !(I >= H.left && I <= H.right && J >= H.top && J <= H.bottom)
}
return !1
}
function f(F) {
let G = 'auto',
H = F.composedPath && F.composedPath();
if (H)
for (let J, I = 0; I < H.length; I++)
if (J = H[I], J[o]) {
G = J[o];
break
}
return G
}
function g(F, G, H) {
F.movefn = G, F.upfn = H, document.addEventListener('mousemove', G), document.addEventListener('mouseup', H)
}
function h(F) {
document.removeEventListener('mousemove', F.movefn), document.removeEventListener('mouseup', F.upfn), F.movefn = null, F.upfn = null
}
let k = 'string' == typeof document.head.style.touchAction,
l = '__polymerGestures',
m = '__polymerGesturesHandled',
o = '__polymerGesturesTouchAction',
p = 25,
q = 5,
v = ['mousedown', 'mousemove', 'mouseup', 'click'],
w = [0, 1, 4, 2],
z = function() {
try {
return 1 === new MouseEvent('test', {
buttons: 1
}).buttons
} catch (F) {
return !1
}
}(),
A = !1;
(function() {
try {
let F = Object.defineProperty({}, 'passive', {
get: function() {
A = !0
}
});
window.addEventListener('test', null, F), window.removeEventListener('test', null, F)
} catch (F) {}
})();
let B = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/),
C = function(F) {
let G = F.sourceCapabilities;
if ((!G || G.firesTouchEvents) && (F[m] = {
skip: !0
}, 'click' === F.type)) {
let H = F.composedPath && F.composedPath();
if (H)
for (let I = 0; I < H.length; I++)
if (H[I] === D.mouse.target) return;
F.preventDefault(), F.stopPropagation()
}
},
D = {
mouse: {
target: null,
mouseIgnoreJob: null
},
touch: {
x: 0,
y: 0,
id: -1,
scrollDecided: !1
}
};
document.addEventListener('touchend', function(F) {
D.mouse.mouseIgnoreJob || a(!0);
D.mouse.target = F.composedPath()[0], D.mouse.mouseIgnoreJob = Polymer.Debouncer.debounce(D.mouse.mouseIgnoreJob, Polymer.Async.timeOut.after(2500), function() {
a(), D.mouse.target = null, D.mouse.mouseIgnoreJob = null
})
}, !!A && {
passive: !0
});
const E = {
gestures: {},
recognizers: [],
deepTargetFind: function(F, G) {
let H = document.elementFromPoint(F, G),
I = H;
for (; I && I.shadowRoot && !window.ShadyDOM;) {
let J = I;
if (I = I.shadowRoot.elementFromPoint(F, G), J === I) break;
I && (H = I)
}
return H
},
_findOriginalTarget: function(F) {
return F.composedPath ? F.composedPath()[0] : F.target
},
_handleNative: function(F) {
let G, H = F.type,
I = F.currentTarget,
J = I[l];
if (J) {
let K = J[H];
if (K) {
if (!F[m] && (F[m] = {}, 'touch' === H.slice(0, 5))) {
let M = F.changedTouches[0];
if ('touchstart' === H && 1 === F.touches.length && (D.touch.id = M.identifier), D.touch.id !== M.identifier) return;
k || 'touchstart' !== H && 'touchmove' !== H || E._handleTouchAction(F)
}
if (G = F[m], !G.skip) {
let L = E.recognizers;
for (let N, M = 0; M < L.length; M++) N = L[M], K[N.name] && !G[N.name] && N.flow && -1 < N.flow.start.indexOf(F.type) && N.reset && N.reset();
for (let N, M = 0; M < L.length; M++) N = L[M], K[N.name] && !G[N.name] && (G[N.name] = !0, N[H](F))
}
}
}
},
_handleTouchAction: function(F) {
let G = F.changedTouches[0],
H = F.type;
if ('touchstart' === H) D.touch.x = G.clientX, D.touch.y = G.clientY, D.touch.scrollDecided = !1;
else if ('touchmove' === H) {
if (D.touch.scrollDecided) return;
D.touch.scrollDecided = !0;
let I = f(F),
J = !1,
K = Math.abs(D.touch.x - G.clientX),
L = Math.abs(D.touch.y - G.clientY);
F.cancelable && ('none' === I ? J = !0 : 'pan-x' === I ? J = L > K : 'pan-y' === I && (J = K > L)), J ? F.preventDefault() : E.prevent('track')
}
},
addListener: function(F, G, H) {
if (this.gestures[G]) return this._add(F, G, H), !0
},
removeListener: function(F, G, H) {
if (this.gestures[G]) return this._remove(F, G, H), !0
},
_add: function(F, G, H) {
let I = this.gestures[G],
J = I.deps,
K = I.name,
L = F[l];
L || (F[l] = L = {});
for (let N, O, M = 0; M < J.length; M++)(N = J[M], !(B && -1 < v.indexOf(N) && 'click' !== N)) && (O = L[N], O || (L[N] = O = {
_count: 0
}), 0 === O._count && F.addEventListener(N, this._handleNative), O[K] = (O[K] || 0) + 1, O._count = (O._count || 0) + 1);
F.addEventListener(G, H), I.touchAction && this.setTouchAction(F, I.touchAction)
},
_remove: function(F, G, H) {
let I = this.gestures[G],
J = I.deps,
K = I.name,
L = F[l];
if (L)
for (let N, O, M = 0; M < J.length; M++) N = J[M], O = L[N], O && O[K] && (O[K] = (O[K] || 1) - 1, O._count = (O._count || 1) - 1, 0 === O._count && F.removeEventListener(N, this._handleNative));
F.removeEventListener(G, H)
},
register: function(F) {
this.recognizers.push(F);
for (let G = 0; G < F.emits.length; G++) this.gestures[F.emits[G]] = F
},
_findRecognizerByEvent: function(F) {
for (let H, G = 0; G < this.recognizers.length; G++) {
H = this.recognizers[G];
for (let J, I = 0; I < H.emits.length; I++)
if (J = H.emits[I], J === F) return H
}
return null
},
setTouchAction: function(F, G) {
k && (F.style.touchAction = G), F[o] = G
},
_fire: function(F, G, H) {
let I = new Event(G, {
bubbles: !0,
cancelable: !0,
composed: !0
});
if (I.detail = H, F.dispatchEvent(I), I.defaultPrevented) {
let J = H.preventer || H.sourceEvent;
J && J.preventDefault && J.preventDefault()
}
},
prevent: function(F) {
let G = this._findRecognizerByEvent(F);
G.info && (G.info.prevent = !0)
},
resetMouseCanceller: function() {
D.mouse.mouseIgnoreJob && D.mouse.mouseIgnoreJob.flush()
}
};
E.register({
name: 'downup',
deps: ['mousedown', 'touchstart', 'touchend'],
flow: {
start: ['mousedown', 'touchstart'],
end: ['mouseup', 'touchend']
},
emits: ['down', 'up'],
info: {
movefn: null,
upfn: null
},
reset: function() {
h(this.info)
},
mousedown: function(F) {
if (c(F)) {
let G = E._findOriginalTarget(F),
H = this;
g(this.info, function(L) {
c(L) || (H._fire('up', G, L), h(H.info))
}, function(L) {
c(L) && H._fire('up', G, L), h(H.info)
}), this._fire('down', G, F)
}
},
touchstart: function(F) {
this._fire('down', E._findOriginalTarget(F), F.changedTouches[0], F)
},
touchend: function(F) {
this._fire('up', E._findOriginalTarget(F), F.changedTouches[0], F)
},
_fire: function(F, G, H, I) {
E._fire(G, F, {
x: H.clientX,
y: H.clientY,
sourceEvent: H,
preventer: I,
prevent: function(J) {
return E.prevent(J)
}
})
}
}), E.register({
name: 'track',
touchAction: 'none',
deps: ['mousedown', 'touchstart', 'touchmove', 'touchend'],
flow: {
start: ['mousedown', 'touchstart'],
end: ['mouseup', 'touchend']
},
emits: ['track'],
info: {
x: 0,
y: 0,
state: 'start',
started: !1,
moves: [],
addMove: function(F) {
this.moves.length > 2 && this.moves.shift(), this.moves.push(F)
},
movefn: null,
upfn: null,
prevent: !1
},
reset: function() {
this.info.state = 'start', this.info.started = !1, this.info.moves = [], this.info.x = 0, this.info.y = 0, this.info.prevent = !1, h(this.info)
},
hasMovedEnough: function(F, G) {
if (this.info.prevent) return !1;
if (this.info.started) return !0;
let H = Math.abs(this.info.x - F),
I = Math.abs(this.info.y - G);
return H >= q || I >= q
},
mousedown: function(F) {
if (c(F)) {
let G = E._findOriginalTarget(F),
H = this,
I = function(L) {
let M = L.clientX,
N = L.clientY;
H.hasMovedEnough(M, N) && (H.info.state = H.info.started ? 'mouseup' === L.type ? 'end' : 'track' : 'start', 'start' === H.info.state && E.prevent('tap'), H.info.addMove({
x: M,
y: N
}), !c(L) && (H.info.state = 'end', h(H.info)), H._fire(G, L), H.info.started = !0)
};
g(this.info, I, function(L) {
H.info.started && I(L), h(H.info)
}), this.info.x = F.clientX, this.info.y = F.clientY
}
},
touchstart: function(F) {
let G = F.changedTouches[0];
this.info.x = G.clientX, this.info.y = G.clientY
},
touchmove: function(F) {
let G = E._findOriginalTarget(F),
H = F.changedTouches[0],
I = H.clientX,
J = H.clientY;
this.hasMovedEnough(I, J) && ('start' === this.info.state && E.prevent('tap'), this.info.addMove({
x: I,
y: J
}), this._fire(G, H), this.info.state = 'track', this.info.started = !0)
},
touchend: function(F) {
let G = E._findOriginalTarget(F),
H = F.changedTouches[0];
this.info.started && (this.info.state = 'end', this.info.addMove({
x: H.clientX,
y: H.clientY
}), this._fire(G, H, F))
},
_fire: function(F, G) {
let L, H = this.info.moves[this.info.moves.length - 2],
I = this.info.moves[this.info.moves.length - 1],
J = I.x - this.info.x,
K = I.y - this.info.y,
M = 0;
return H && (L = I.x - H.x, M = I.y - H.y), E._fire(F, 'track', {
state: this.info.state,
x: G.clientX,
y: G.clientY,
dx: J,
dy: K,
ddx: L,
ddy: M,
sourceEvent: G,
hover: function() {
return E.deepTargetFind(G.clientX, G.clientY)
}
})
}
}), E.register({
name: 'tap',
deps: ['mousedown', 'click', 'touchstart', 'touchend'],
flow: {
start: ['mousedown', 'touchstart'],
end: ['click', 'touchend']
},
emits: ['tap'],
info: {
x: NaN,
y: NaN,
prevent: !1
},
reset: function() {
this.info.x = NaN, this.info.y = NaN, this.info.prevent = !1
},
save: function(F) {
this.info.x = F.clientX, this.info.y = F.clientY
},
mousedown: function(F) {
c(F) && this.save(F)
},
click: function(F) {
c(F) && this.forward(F)
},
touchstart: function(F) {
this.save(F.changedTouches[0], F)
},
touchend: function(F) {
this.forward(F.changedTouches[0], F)
},
forward: function(F, G) {
let H = Math.abs(F.clientX - this.info.x),
I = Math.abs(F.clientY - this.info.y),
J = E._findOriginalTarget(F);
(isNaN(H) || isNaN(I) || H <= p && I <= p || d(F)) && !this.info.prevent && E._fire(J, 'tap', {
x: F.clientX,
y: F.clientY,
sourceEvent: F,
preventer: G
})
}
}), E.findOriginalTarget = E._findOriginalTarget, E.add = E.addListener, E.remove = E.removeListener, Polymer.Gestures = E
})();
</script>
<script>
(function() {
'use strict';
const a = Polymer.Gestures;
Polymer.GestureEventListeners = Polymer.dedupingMixin(b => {
return class extends b {
_addEventListenerToNode(d, e, f) {
a.addListener(d, e, f) || super._addEventListenerToNode(d, e, f)
}
_removeEventListenerFromNode(d, e, f) {
a.removeListener(d, e, f) || super._removeEventListenerFromNode(d, e, f)
}
}
})
})();
</script>
<script>
(function() {
'use strict';
function a(b) {
window.HTMLImports ? HTMLImports.whenReady(b) : b()
}
Polymer.importHref = function(b, c, d, e) {
let f = document.head.querySelector('link[href="' + b + '"][import-href]');
f || (f = document.createElement('link'), f.rel = 'import', f.href = b, f.setAttribute('import-href', '')), e && f.setAttribute('async', '');
let g = function() {
f.removeEventListener('load', h), f.removeEventListener('error', i)
},
h = function(j) {
g(), f.__dynamicImportLoaded = !0, c && a(() => {
c(j)
})
},
i = function(j) {
g(), f.parentNode && f.parentNode.removeChild(f), d && a(() => {
d(j)
})
};
return f.addEventListener('load', h), f.addEventListener('error', i), null == f.parentNode ? document.head.appendChild(f) : f.__dynamicImportLoaded && f.dispatchEvent(new Event('load')), f
}
})();
</script>
<script>
(function() {
'use strict';
function a() {
g = !0, requestAnimationFrame(function() {
g = !1, b(h), setTimeout(function() {
c(j)
})
})
}
function b(k) {
for (; k.length;) d(k.shift())
}
function c(k) {
for (let m = 0, n = k.length; m < n; m++) d(k.shift())
}
function d(k) {
const m = k[0],
n = k[1],
o = k[2];
try {
n.apply(m, o)
} catch (p) {
setTimeout(() => {
throw p
})
}
}
let g = !1,
h = [],
j = [];
Polymer.RenderStatus = {
beforeNextRender: function(k, m, n) {
g || a(), h.push([k, m, n])
},
afterNextRender: function(k, m, n) {
g || a(), j.push([k, m, n])
},
flush: function() {
for (; h.length || j.length;) b(h), b(j);
g = !1
}
}
})();
</script>
<script>
(function() {
'use strict';
function a() {
document.body.removeAttribute('unresolved')
}
window.WebComponents ? window.addEventListener('WebComponentsReady', a) : 'interactive' === document.readyState || 'complete' === document.readyState ? a() : window.addEventListener('DOMContentLoaded', a)
})();
</script>
<script>
(function() {
'use strict';
function a(g, h, k) {
return {
index: g,
removed: h,
addedCount: k
}
}
const b = 0,
c = 1,
d = 2,
e = 3,
f = {
calcEditDistances(g, h, k, l, m, n) {
let o = n - m + 1,
p = k - h + 1,
q = Array(o);
for (let r = 0; r < o; r++) q[r] = Array(p), q[r][0] = r;
for (let r = 0; r < p; r++) q[0][r] = r;
for (let r = 1; r < o; r++)
for (let s = 1; s < p; s++)
if (this.equals(g[h + s - 1], l[m + r - 1])) q[r][s] = q[r - 1][s - 1];
else {
let t = q[r - 1][s] + 1,
u = q[r][s - 1] + 1;
q[r][s] = t < u ? t : u
}
return q
},
spliceOperationsFromEditDistances(g) {
let h = g.length - 1,
k = g[0].length - 1,
l = g[h][k],
m = [];
for (; 0 < h || 0 < k;) {
if (0 == h) {
m.push(d), k--;
continue
}
if (0 == k) {
m.push(e), h--;
continue
}
let q, n = g[h - 1][k - 1],
o = g[h - 1][k],
p = g[h][k - 1];
q = o < p ? o < n ? o : n : p < n ? p : n, q == n ? (n == l ? m.push(b) : (m.push(c), l = n), h--, k--) : q == o ? (m.push(e), h--, l = o) : (m.push(d), k--, l = p)
}
return m.reverse(), m
},
calcSplices(g, h, k, l, m, n) {
let q, o = 0,
p = 0,
r = Math.min(k - h, n - m);
if (0 == h && 0 == m && (o = this.sharedPrefix(g, l, r)), k == g.length && n == l.length && (p = this.sharedSuffix(g, l, r - o)), h += o, m += o, k -= p, n -= p, 0 == k - h && 0 == n - m) return [];
if (h == k) {
for (q = a(h, [], 0); m < n;) q.removed.push(l[m++]);
return [q]
}
if (m == n) return [a(h, [], k - h)];
let s = this.spliceOperationsFromEditDistances(this.calcEditDistances(g, h, k, l, m, n));
q = void 0;
let t = [],
u = h,
v = m;
for (let w = 0; w < s.length; w++) switch (s[w]) {
case b:
q && (t.push(q), q = void 0), u++, v++;
break;
case c:
q || (q = a(u, [], 0)), q.addedCount++, u++, q.removed.push(l[v]), v++;
break;
case d:
q || (q = a(u, [], 0)), q.addedCount++, u++;
break;
case e:
q || (q = a(u, [], 0)), q.removed.push(l[v]), v++;
}
return q && t.push(q), t
},
sharedPrefix(g, h, k) {
for (let l = 0; l < k; l++)
if (!this.equals(g[l], h[l])) return l;
return k
},
sharedSuffix(g, h, k) {
let l = g.length,
m = h.length,
n = 0;
for (; n < k && this.equals(g[--l], h[--m]);) n++;
return n
},
calculateSplices(g, h) {
return this.calcSplices(g, 0, g.length, h, 0, h.length)
},
equals(g, h) {
return g === h
}
};
Polymer.ArraySplice = {
calculateSplices(g, h) {
return f.calculateSplices(g, h)
}
}
})();
</script>
<script>
(function() {
'use strict';
function c(e) {
return 'slot' === e.localName
}
Polymer.FlattenedNodesObserver = class {
static getFlattenedNodes(e) {
return c(e) ? e.assignedNodes({
flatten: !0
}) : Array.from(e.childNodes).map(f => {
return c(f) ? f.assignedNodes({
flatten: !0
}) : [f]
}).reduce((f, g) => f.concat(g), [])
}
constructor(e, f) {
this._shadyChildrenObserver = null, this._nativeChildrenObserver = null, this._connected = !1, this._target = e, this.callback = f, this._effectiveNodes = [], this._observer = null, this._scheduled = !1, this._boundSchedule = () => {
this._schedule()
}, this.connect(), this._schedule()
}
connect() {
c(this._target) ? this._listenSlots([this._target]) : (this._listenSlots(this._target.children), window.ShadyDOM ? this._shadyChildrenObserver = ShadyDOM.observeChildren(this._target, e => {
this._processMutations(e)
}) : (this._nativeChildrenObserver = new MutationObserver(e => {
this._processMutations(e)
}), this._nativeChildrenObserver.observe(this._target, {
childList: !0
}))), this._connected = !0
}
disconnect() {
c(this._target) ? this._unlistenSlots([this._target]) : (this._unlistenSlots(this._target.children), window.ShadyDOM && this._shadyChildrenObserver ? (ShadyDOM.unobserveChildren(this._shadyChildrenObserver), this._shadyChildrenObserver = null) : this._nativeChildrenObserver && (this._nativeChildrenObserver.disconnect(), this._nativeChildrenObserver = null)), this._connected = !1
}
_schedule() {
this._scheduled || (this._scheduled = !0, Polymer.Async.microTask.run(() => this.flush()))
}
_processMutations(e) {
this._processSlotMutations(e), this.flush()
}
_processSlotMutations(e) {
if (e)
for (let g, f = 0; f < e.length; f++) g = e[f], g.addedNodes && this._listenSlots(g.addedNodes), g.removedNodes && this._unlistenSlots(g.removedNodes)
}
flush() {
if (this._connected) {
window.ShadyDOM && ShadyDOM.flush(), this._nativeChildrenObserver ? this._processSlotMutations(this._nativeChildrenObserver.takeRecords()) : this.shadyChildrenObserver && this._processSlotMutations(this._shadyChildrenObserver.takeRecords()), this._scheduled = !1;
let e = {
target: this._target,
addedNodes: [],
removedNodes: []
},
f = this.constructor.getFlattenedNodes(this._target),
g = Polymer.ArraySplice.calculateSplices(f, this._effectiveNodes);
for (let l, k = 0; k < g.length && (l = g[k]); k++)
for (let o, m = 0; m < l.removed.length && (o = l.removed[m]); m++) e.removedNodes.push(o);
for (let l, k = 0; k < g.length && (l = g[k]); k++)
for (let m = l.index; m < l.index + l.addedCount; m++) e.addedNodes.push(f[m]);
this._effectiveNodes = f;
let h = !1;
return (e.addedNodes.length || e.removedNodes.length) && (h = !0, this.callback.call(this._target, e)), h
}
}
_listenSlots(e) {
for (let g, f = 0; f < e.length; f++) g = e[f], c(g) && g.addEventListener('slotchange', this._boundSchedule)
}
_unlistenSlots(e) {
for (let g, f = 0; f < e.length; f++) g = e[f], c(g) && g.removeEventListener('slotchange', this._boundSchedule)
}
}
})();
</script>
<script>
(function() {
'use strict';
function a() {
const c = !!b.length;
for (; b.length;) try {
b.shift().flush()
} catch (d) {
setTimeout(() => {
throw d
})
}
return c
}
let b = [];
Polymer.enqueueDebouncer = function(c) {
b.push(c)
}, Polymer.flush = function() {
let c, d;
do c = window.ShadyDOM && ShadyDOM.flush(), window.ShadyCSS && window.ShadyCSS.ScopingShim && window.ShadyCSS.ScopingShim.flush(), d = a(); while (c || d)
}
})();
</script>
<script>
(function() {
'use strict';
const e = Element.prototype,
f = e.matches || e.matchesSelector || e.mozMatchesSelector || e.msMatchesSelector || e.oMatchesSelector || e.webkitMatchesSelector,
g = function(m, o) {
return f.call(m, o)
};
class h {
constructor(m) {
this.node = m
}
observeNodes(m) {
return new Polymer.FlattenedNodesObserver(this.node, m)
}
unobserveNodes(m) {
m.disconnect()
}
notifyObserver() {}
deepContains(m) {
if (this.node.contains(m)) return !0;
let o = m,
q = m.ownerDocument;
for (; o && o !== q && o !== this.node;) o = o.parentNode || o.host;
return o === this.node
}
getOwnerRoot() {
return this.node.getRootNode()
}
getDistributedNodes() {
return 'slot' === this.node.localName ? this.node.assignedNodes({
flatten: !0
}) : []
}
getDestinationInsertionPoints() {
let m = [],
o = this.node.assignedSlot;
for (; o;) m.push(o), o = o.assignedSlot;
return m
}
importNode(m, o) {
let q = this.node instanceof Document ? this.node : this.node.ownerDocument;
return q.importNode(m, o)
}
getEffectiveChildNodes() {
return Polymer.FlattenedNodesObserver.getFlattenedNodes(this.node)
}
queryDistributedElements(m) {
let o = this.getEffectiveChildNodes(),
q = [];
for (let t, r = 0, s = o.length; r < s && (t = o[r]); r++) t.nodeType === Node.ELEMENT_NODE && g(t, m) && q.push(t);
return q
}
get activeElement() {
let m = this.node;
return m._activeElement === void 0 ? m.activeElement : m._activeElement
}
}(function(m, o) {
for (let r, q = 0; q < o.length; q++) r = o[q], m[r] = function() {
return this.node[r].apply(this.node, arguments)
}
})(h.prototype, ['cloneNode', 'appendChild', 'insertBefore', 'removeChild', 'replaceChild', 'setAttribute', 'removeAttribute', 'querySelector', 'querySelectorAll']),
function(m, o) {
for (let r, q = 0; q < o.length; q++) r = o[q], Object.defineProperty(m, r, {
get: function() {
return this.node[r]
},
configurable: !0
})
}(h.prototype, ['parentNode', 'firstChild', 'lastChild', 'nextSibling', 'previousSibling', 'firstElementChild', 'lastElementChild', 'nextElementSibling', 'previousElementSibling', 'childNodes', 'children', 'classList']),
function(m, o) {
for (let r, q = 0; q < o.length; q++) r = o[q], Object.defineProperty(m, r, {
get: function() {
return this.node[r]
},
set: function(s) {
this.node[r] = s
},
configurable: !0
})
}(h.prototype, ['textContent', 'innerHTML']);
class j {
constructor(m) {
this.event = m
}
get rootTarget() {
return this.event.composedPath()[0]
}
get localTarget() {
return this.event.target
}
get path() {
return this.event.composedPath()
}
}
Polymer.dom = function(m) {
m = m || document;
let o = m instanceof Event ? j : h;
return m.__domApi || (m.__domApi = new o(m)), m.__domApi
}, Polymer.dom.matchesSelector = g, Polymer.dom.flush = Polymer.flush, Polymer.dom.addDebouncer = Polymer.enqueueDebouncer;
let k = Polymer.Settings || {};
k.useShadow = !window.ShadyDOM, k.useNativeCSSProperties = !(window.ShadyCSS && !window.ShadyCSS.nativeCss), k.useNativeCustomElements = !window.customElements.polyfillWrapFlushCallback, Polymer.Settings = k
})();
</script>
<script>
(function() {
'use strict';
let a = window.ShadyCSS;
Polymer.LegacyElementMixin = Polymer.dedupingMixin(b => {
const d = Polymer.GestureEventListeners(Polymer.ElementMixin(b)),
e = {
x: 'pan-x',
y: 'pan-y',
none: 'none',
all: 'auto'
};
class f extends d {
constructor() {
super(), this.root = this, this.created()
}
created() {}
connectedCallback() {
super.connectedCallback(), this.isAttached = !0, this.attached()
}
attached() {}
disconnectedCallback() {
super.disconnectedCallback(), this.isAttached = !1, this.detached()
}
detached() {}
attributeChangedCallback(g, h, j) {
h !== j && (super.attributeChangedCallback(g, h, j), this.attributeChanged(g, h, j))
}
attributeChanged() {}
_initializeProperties() {
let g = Object.getPrototypeOf(this);
g.hasOwnProperty('__hasRegisterFinished') || (g.__hasRegisterFinished = !0, this._registered()), super._initializeProperties()
}
_registered() {}
ready() {
this._ensureAttributes(), this._applyListeners(), super.ready()
}
_ensureAttributes() {}
_applyListeners() {}
serialize(g) {
return this._serializeValue(g)
}
deserialize(g, h) {
return this._deserializeValue(g, h)
}
reflectPropertyToAttribute(g, h, j) {
this._propertyToAttribute(g, h, j)
}
serializeValueToAttribute(g, h, j) {
this._valueToNodeAttribute(j || this, g, h)
}
extend(g, h) {
if (!(g && h)) return g || h;
let j = Object.getOwnPropertyNames(h);
for (let l, m, k = 0; k < j.length && (l = j[k]); k++) m = Object.getOwnPropertyDescriptor(h, l), m && Object.defineProperty(g, l, m);
return g
}
mixin(g, h) {
for (let j in h) g[j] = h[j];
return g
}
chainObject(g, h) {
return g && h && g !== h && (g.__proto__ = h), g
}
instanceTemplate(g) {
let h = this.constructor._contentForTemplate(g),
j = document.importNode(h, !0);
return j
}
fire(g, h, j) {
j = j || {}, h = null === h || void 0 === h ? {} : h;
let k = new Event(g, {
bubbles: void 0 === j.bubbles || j.bubbles,
cancelable: !!j.cancelable,
composed: void 0 === j.composed || j.composed
});
k.detail = h;
let l = j.node || this;
return l.dispatchEvent(k), k
}
listen(g, h, j) {
g = g || this;
let k = this.__boundListeners || (this.__boundListeners = new WeakMap),
l = k.get(g);
l || (l = {}, k.set(g, l));
let m = h + j;
l[m] || (l[m] = this._addMethodEventListenerToNode(g, h, j, this))
}
unlisten(g, h, j) {
g = g || this;
let k = this.__boundListeners && this.__boundListeners.get(g),
l = h + j,
m = k && k[l];
m && (this._removeEventListenerFromNode(g, h, m), k[l] = null)
}
setScrollDirection(g, h) {
Polymer.Gestures.setTouchAction(h || this, e[g] || 'auto')
}
$$(g) {
return this.root.querySelector(g)
}
get domHost() {
let g = this.getRootNode();
return g instanceof DocumentFragment ? g.host : g
}
distributeContent() {
window.ShadyDOM && this.shadowRoot && this.shadowRoot.forceRender()
}
getEffectiveChildNodes() {
return Polymer.dom(this).getEffectiveChildNodes()
}
queryDistributedElements(g) {
return Polymer.dom(this).queryDistributedElements(g)
}
getEffectiveChildren() {
let g = this.getEffectiveChildNodes();
return g.filter(function(h) {
return h.nodeType === Node.ELEMENT_NODE
})
}
getEffectiveTextContent() {
let g = this.getEffectiveChildNodes(),
h = [];
for (let k, j = 0; k = g[j]; j++) k.nodeType !== Node.COMMENT_NODE && h.push(k.textContent);
return h.join('')
}
queryEffectiveChildren(g) {
let h = this.queryDistributedElements(g);
return h && h[0]
}
queryAllEffectiveChildren(g) {
return this.queryDistributedElements(g)
}
getContentChildNodes(g) {
let h = this.root.querySelector(g || 'slot');
return h ? Polymer.dom(h).getDistributedNodes() : []
}
getContentChildren(g) {
return this.getContentChildNodes(g).filter(function(h) {
return h.nodeType === Node.ELEMENT_NODE
})
}
isLightDescendant(g) {
return this !== g && this.contains(g) && this.getRootNode() === g.getRootNode()
}
isLocalDescendant(g) {
return this.root === g.getRootNode()
}
scopeSubtree() {}
getComputedStyleValue(g) {
return a.getComputedStyleValue(this, g)
}
debounce(g, h, j) {
return this._debouncers = this._debouncers || {}, this._debouncers[g] = Polymer.Debouncer.debounce(this._debouncers[g], 0 < j ? Polymer.Async.timeOut.after(j) : Polymer.Async.microTask, h.bind(this))
}
isDebouncerActive(g) {
this._debouncers = this._debouncers || {};
let h = this._debouncers[g];
return !!(h && h.isActive())
}
flushDebouncer(g) {
this._debouncers = this._debouncers || {};
let h = this._debouncers[g];
h && h.flush()
}
cancelDebouncer(g) {
this._debouncers = this._debouncers || {};
let h = this._debouncers[g];
h && h.cancel()
}
async (g, h) {
return 0 < h ? Polymer.Async.timeOut.run(g.bind(this), h) : ~Polymer.Async.microTask.run(g.bind(this))
}
cancelAsync(g) {
0 > g ? Polymer.Async.microTask.cancel(~g) : Polymer.Async.timeOut.cancel(g)
}
create(g, h) {
let j = document.createElement(g);
if (h)
if (j.setProperties) j.setProperties(h);
else
for (let k in h) j[k] = h[k];
return j
}
importHref(g, h, j, k) {
let l = h ? h.bind(this) : null,
m = j ? j.bind(this) : null;
return Polymer.importHref(g, l, m, k)
}
elementMatches(g, h) {
return Polymer.dom.matchesSelector(h || this, g)
}
toggleAttribute(g, h, j) {
j = j || this, 1 == arguments.length && (h = !j.hasAttribute(g)), h ? j.setAttribute(g, '') : j.removeAttribute(g)
}
toggleClass(g, h, j) {
j = j || this, 1 == arguments.length && (h = !j.classList.contains(g)), h ? j.classList.add(g) : j.classList.remove(g)
}
transform(g, h) {
h = h || this, h.style.webkitTransform = g, h.style.transform = g
}
translate3d(g, h, j, k) {
k = k || this, this.transform('translate3d(' + g + ',' + h + ',' + j + ')', k)
}
arrayDelete(g, h) {
let j;
if (!Array.isArray(g)) {
let k = Polymer.Path.get(this, g);
if (j = k.indexOf(h), 0 <= j) return this.splice(g, j, 1)
} else if (j = g.indexOf(h), 0 <= j) return g.splice(j, 1);
return null
}
_logger(g, h) {
Array.isArray(h) && 1 === h.length && (h = h[0]);
'log' === g || 'warn' === g || 'error' === g ? console[g](...h) : void 0
}
_log(...g) {
this._logger('log', g)
}
_warn(...g) {
this._logger('warn', g)
}
_error(...g) {
this._logger('error', g)
}
_logf(...g) {
return ['[%s::%s]', this.is, ...g]
}
}
return f
})
})();
</script>
<script>
(function() {
'use strict';
function c(j, k) {
if (!j) return k;
k = g(k), Array.isArray(j) || (j = [j]);
let m = k.prototype.behaviors;
return j = e(j, null, m), k = d(j, k), m && (j = m.concat(j)), k.prototype.behaviors = j, k
}
function d(j, k) {
for (let n, m = 0; m < j.length; m++) n = j[m], n && (k = Array.isArray(n) ? d(n, k) : f(n, k));
return k
}
function e(j, k, m) {
k = k || [];
for (let o, n = j.length - 1; 0 <= n; n--) o = j[n], o ? Array.isArray(o) ? e(o, k) : 0 > k.indexOf(o) && (!m || 0 > m.indexOf(o)) && k.unshift(o) : console.warn('behavior is null, check for missing or 404 import');
return k
}
function f(j, k) {
class m extends k {
static get properties() {
return j.properties
}
static get observers() {
return j.observers
}
static get template() {
return j._template || Polymer.DomModule.import(this.is, 'template') || k.template || this.prototype._template
}
created() {
super.created(), j.created && j.created.call(this)
}
_registered() {
super._registered(), j.beforeRegister && j.beforeRegister.call(Object.getPrototypeOf(this)), j.registered && j.registered.call(Object.getPrototypeOf(this))
}
_applyListeners() {
if (super._applyListeners(), j.listeners)
for (let n in j.listeners) this._addMethodEventListenerToNode(this, n, j.listeners[n])
}
_ensureAttributes() {
if (j.hostAttributes)
for (let n in j.hostAttributes) this._ensureAttribute(n, j.hostAttributes[n]);
super._ensureAttributes()
}
ready() {
super.ready(), j.ready && j.ready.call(this)
}
attached() {
super.attached(), j.attached && j.attached.call(this)
}
detached() {
super.detached(), j.detached && j.detached.call(this)
}
attributeChanged(n, o, q) {
super.attributeChanged(n, o, q), j.attributeChanged && j.attributeChanged.call(this, n, o, q)
}
}
for (let n in m.generatedFrom = j, j)
if (!(n in h)) {
let o = Object.getOwnPropertyDescriptor(j, n);
o && Object.defineProperty(m.prototype, n, o)
}
return m
}
let g = Polymer.LegacyElementMixin,
h = {
attached: !0,
detached: !0,
ready: !0,
created: !0,
beforeRegister: !0,
registered: !0,
attributeChanged: !0,
behaviors: !0
};
Polymer.Class = function(j) {
j || console.warn('Polymer.Class requires `info` argument');
let k = f(j, j.behaviors ? c(j.behaviors, HTMLElement) : g(HTMLElement));
return k.is = j.is, k
}, Polymer.mixinBehaviors = c
})();
</script>
<script>
(function() {
'use strict';
window.Polymer._polymerFn = function(a) {
let b;
return b = 'function' == typeof a ? a : Polymer.Class(a), customElements.define(b.is, b), b
}
})();
</script>
<script>
(function() {
'use strict';
function a(b, c, d, e, f) {
let g;
f && (g = 'object' == typeof d && null !== d, g && (e = b.__dataTemp[c]));
let h = e !== d && (e === e || d === d);
return g && h && (b.__dataTemp[c] = d), h
}
Polymer.MutableData = Polymer.dedupingMixin(b => {
return class extends b {
_shouldPropertyChange(d, e, f) {
return a(this, d, e, f, !0)
}
}
}), Polymer.OptionalMutableData = Polymer.dedupingMixin(b => {
class c extends b {
static get properties() {
return {
mutableData: Boolean
}
}
_shouldPropertyChange(d, e, f) {
return a(this, d, e, f, this.mutableData)
}
}
return c
}), Polymer.MutableData._mutablePropertyChange = a
})();
</script>
<script>
(function() {
'use strict';
function a() {
return m
}
function b(u, v) {
m = u, Object.setPrototypeOf(u, v.prototype), new v, m = null
}
function d(u) {
let v = u.__dataHost;
return v && v._methodHost || v
}
function f(u, v, w) {
let x = w.mutableData ? s : r,
y = class extends x {};
return y.prototype.__templatizeOptions = w, y.prototype._bindTemplate(u), j(y, u, v, w), y
}
function g(u, v, w) {
let x = w.forwardHostProp;
if (x) {
let y = v.templatizeTemplateClass;
if (!y) {
let z = w.mutableData ? p : o;
y = v.templatizeTemplateClass = class extends z {};
let A = v.hostProps;
for (let B in A) y.prototype._addPropertyEffect('_host_' + B, y.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE, {
fn: h(B, x)
}), y.prototype._createNotifyingProperty('_host_' + B)
}
b(u, y), u.__dataProto && Object.assign(u.__data, u.__dataProto), u.__dataTemp = {}, u.__dataPending = null, u.__dataOld = null, u._enableProperties()
}
}
function h(u, v) {
return function(x, y, z) {
v.call(x.__templatizeOwner, y.substring('_host_'.length), z[y])
}
}
function j(u, v, w, x) {
let y = w.hostProps || {};
for (let z in x.instanceProps) {
delete y[z];
let A = x.notifyInstanceProp;
A && u.prototype._addPropertyEffect(z, u.prototype.PROPERTY_EFFECT_TYPES.NOTIFY, {
fn: k(z, A)
})
}
if (x.forwardHostProp && v.__dataHost)
for (let z in y) u.prototype._addPropertyEffect(z, u.prototype.PROPERTY_EFFECT_TYPES.NOTIFY, {
fn: l()
})
}
function k(u, v) {
return function(x, y, z) {
v.call(x.__templatizeOwner, x, y, z[y])
}
}
function l() {
return function(v, w, x) {
v.__dataHost._setPendingPropertyOrPath('_host_' + w, x[w], !0, !0)
}
}
let m = null;
a.prototype = Object.create(HTMLTemplateElement.prototype, {
constructor: {
value: a,
writable: !0
}
});
const o = Polymer.PropertyEffects(a),
p = Polymer.MutableData(o),
q = Polymer.PropertyEffects(class {});
class r extends q {
constructor(u) {
super(), this._configureProperties(u), this.root = this._stampTemplate(this.__dataHost);
let v = this.children = [];
for (let x = this.root.firstChild; x; x = x.nextSibling) v.push(x), x.__templatizeInstance = this;
this.__templatizeOwner.__hideTemplateChildren__ && this._showHideChildren(!0);
let w = this.__templatizeOptions;
(u && w.instanceProps || !w.instanceProps) && this._enableProperties()
}
_configureProperties(u) {
let v = this.__templatizeOptions;
if (u)
for (let w in v.instanceProps) w in u && this._setPendingProperty(w, u[w]);
for (let w in this.__hostProps) this._setPendingProperty(w, this.__dataHost['_host_' + w])
}
forwardHostProp(u, v) {
this._setPendingPropertyOrPath(u, v, !1, !0) && this.__dataHost._enqueueClient(this)
}
_addEventListenerToNode(u, v, w) {
if (this._methodHost && this.__templatizeOptions.parentModel) this._methodHost._addEventListenerToNode(u, v, x => {
x.model = this, w(x)
});
else {
let x = this.__dataHost.__dataHost;
x && x._addEventListenerToNode(u, v, w)
}
}
_showHideChildren(u) {
let v = this.children;
for (let x, w = 0; w < v.length; w++) x = v[w], !!u != !!x.__hideTemplateChildren__ && (x.nodeType === Node.TEXT_NODE ? u ? (x.__polymerTextContent__ = x.textContent, x.textContent = '') : x.textContent = x.__polymerTextContent__ : x.style && (u ? (x.__polymerDisplay__ = x.style.display, x.style.display = 'none') : x.style.display = x.__polymerDisplay__)), x.__hideTemplateChildren__ = u, x._showHideChildren && x._showHideChildren(u)
}
_setUnmanagedPropertyToNode(u, v, w) {
u.__hideTemplateChildren__ && u.nodeType == Node.TEXT_NODE && 'textContent' == v ? u.__polymerTextContent__ = w : super._setUnmanagedPropertyToNode(u, v, w)
}
get parentModel() {
let u = this.__parentModel;
if (!u) {
let v;
u = this;
do u = u.__dataHost.__dataHost; while ((v = u.__templatizeOptions) && !v.parentModel);
this.__parentModel = u
}
return u
}
}
const s = Polymer.MutableData(r),
t = {
templatize(u, v, w) {
if (w = w || {}, u.__templatizeOwner) throw new Error('A <template> can only be templatized once');
u.__templatizeOwner = v;
let x = v.constructor._parseTemplate(u),
y = x.templatizeInstanceClass;
y || (y = f(u, x, w), x.templatizeInstanceClass = y), g(u, x, w);
let z = class extends y {};
return z.prototype._methodHost = d(u), z.prototype.__dataHost = u, z.prototype.__templatizeOwner = v, z.prototype.__hostProps = x.hostProps, z
},
modelForElement(u, v) {
for (let w; v;)
if (!(w = v.__templatizeInstance)) v = v.parentNode;
else if (w.__dataHost != u) v = w.__dataHost;
else return w;
return null
}
};
Polymer.Templatize = t
})();
</script>
<script>
(function() {
'use strict';
let a = {
templatize(b, c) {
this._templatizerTemplate = b, this.ctor = Polymer.Templatize.templatize(b, this, {
mutableData: !!c,
parentModel: this._parentModel,
instanceProps: this._instanceProps,
forwardHostProp: this._forwardHostPropV2,
notifyInstanceProp: this._notifyInstancePropV2
})
},
stamp(b) {
return new this.ctor(b)
},
modelForElement(b) {
return Polymer.Templatize.modelForElement(this._templatizerTemplate, b)
}
};
Polymer.Templatizer = a
})();
</script>
<script>
(function() {
'use strict';
const a = Polymer.GestureEventListeners(Polymer.OptionalMutableData(Polymer.PropertyEffects(HTMLElement)));
class b extends a {
static get observedAttributes() {
return ['mutable-data']
}
attributeChangedCallback() {
this.mutableData = !0
}
connectedCallback() {
this.render()
}
disconnectedCallback() {
this.__removeChildren()
}
__insertChildren() {
this.parentNode.insertBefore(this.root, this)
}
__removeChildren() {
if (this.__children)
for (let c = 0; c < this.__children.length; c++) this.root.appendChild(this.__children[c])
}
render() {
let c;
if (!this.__children) {
if (c = c || this.querySelector('template'), !c) {
let d = new MutationObserver(() => {
if (c = this.querySelector('template'), c) d.disconnect(), this.render(c);
else throw new Error('dom-bind requires a <template> child')
});
return void d.observe(this, {
childList: !0
})
}
this.root = this._stampTemplate(c), this.$ = this.root.$, this.__children = [];
for (let d = this.root.firstChild; d; d = d.nextSibling) this.__children[this.__children.length] = d;
this._enableProperties()
}
this.__insertChildren(), this.dispatchEvent(new CustomEvent('dom-change', {
bubbles: !0,
composed: !0
}))
}
}
customElements.define('dom-bind', b)
})();
</script>
<script>
(function() {
'use strict';
const a = Polymer.ElementMixin(HTMLElement);
Polymer.Element = a
})();
</script>
<script>
(function() {
'use strict';
const c = Polymer.OptionalMutableData(Polymer.Element);
class d extends c {
static get is() {
return 'dom-repeat'
}
static get template() {
return null
}
static get properties() {
return {
items: {
type: Array
},
as: {
type: String,
value: 'item'
},
indexAs: {
type: String,
value: 'index'
},
itemsIndexAs: {
type: String,
value: 'itemsIndex'
},
sort: {
type: Function,
observer: '__sortChanged'
},
filter: {
type: Function,
observer: '__filterChanged'
},
observe: {
type: String,
observer: '__observeChanged'
},
delay: Number,
renderedItemCount: {
type: Number,
notify: !0,
readOnly: !0
},
initialCount: {
type: Number,
observer: '__initializeChunking'
},
targetFramerate: {
type: Number,
value: 20
},
_targetFrameTime: {
type: Number,
computed: '__computeFrameTime(targetFramerate)'
}
}
}
static get observers() {
return ['__itemsChanged(items.*)']
}
constructor() {
super(), this.__instances = [], this.__limit = Infinity, this.__pool = [], this.__renderDebouncer = null, this.__itemsIdxToInstIdx = {}, this.__chunkCount = null, this.__lastChunkTime = null, this.__needFullRefresh = !1, this.__sortFn = null, this.__filterFn = null, this.__observePaths = null, this.__ctor = null
}
disconnectedCallback() {
super.disconnectedCallback(), this.__isDetached = !0;
for (let e = 0; e < this.__instances.length; e++) this.__detachInstance(e)
}
connectedCallback() {
if (super.connectedCallback(), this.__isDetached) {
this.__isDetached = !1;
let e = this.parentNode;
for (let f = 0; f < this.__instances.length; f++) this.__attachInstance(f, e)
}
}
__ensureTemplatized() {
if (!this.__ctor) {
let e = this.template = this.querySelector('template');
if (!e) {
let g = new MutationObserver(() => {
if (this.querySelector('template')) g.disconnect(), this.__render();
else throw new Error('dom-repeat requires a <template> child')
});
return g.observe(this, {
childList: !0
}), !1
}
let f = {};
f[this.as] = !0, f[this.indexAs] = !0, f[this.itemsIndexAs] = !0, this.__ctor = Polymer.Templatize.templatize(e, this, {
mutableData: this.mutableData,
parentModel: !0,
instanceProps: f,
forwardHostProp: function(g, h) {
let j = this.__instances;
for (let l, k = 0; k < j.length && (l = j[k]); k++) l.forwardHostProp(g, h)
},
notifyInstanceProp: function(g, h, j) {
if (Polymer.Path.matches(this.as, h)) {
let k = g[this.itemsIndexAs];
h == this.as && (this.items[k] = j);
let l = Polymer.Path.translate(this.as, 'items.' + k, h);
this.notifyPath(l, j)
}
}
})
}
return !0
}
__getMethodHost() {
return this.__dataHost._methodHost || this.__dataHost
}
__sortChanged(e) {
let f = this.__getMethodHost();
this.__sortFn = e && ('function' == typeof e ? e : function() {
return f[e].apply(f, arguments)
}), this.__needFullRefresh = !0, this.items && this.__debounceRender(this.__render)
}
__filterChanged(e) {
let f = this.__getMethodHost();
this.__filterFn = e && ('function' == typeof e ? e : function() {
return f[e].apply(f, arguments)
}), this.__needFullRefresh = !0, this.items && this.__debounceRender(this.__render)
}
__computeFrameTime(e) {
return Math.ceil(1e3 / e)
}
__initializeChunking() {
this.initialCount && (this.__limit = this.initialCount, this.__chunkCount = this.initialCount, this.__lastChunkTime = performance.now())
}
__tryRenderChunk() {
this.items && this.__limit < this.items.length && this.__debounceRender(this.__requestRenderChunk)
}
__requestRenderChunk() {
requestAnimationFrame(() => this.__renderChunk())
}
__renderChunk() {
let e = performance.now(),
f = this._targetFrameTime / (e - this.__lastChunkTime);
this.__chunkCount = Math.round(this.__chunkCount * f) || 1, this.__limit += this.__chunkCount, this.__lastChunkTime = e, this.__debounceRender(this.__render)
}
__observeChanged() {
this.__observePaths = this.observe && this.observe.replace('.*', '.').split(' ')
}
__itemsChanged(e) {
this.items && !Array.isArray(this.items) && console.warn('dom-repeat expected array for `items`, found', this.items), this.__handleItemPath(e.path, e.value) || (this.__needFullRefresh = !0, this.__initializeChunking(), this.__debounceRender(this.__render))
}
__handleObservedPaths(e) {
if (this.__observePaths) {
e = e.substring(e.indexOf('.') + 1);
let f = this.__observePaths;
for (let g = 0; g < f.length; g++)
if (0 === e.indexOf(f[g])) return this.__needFullRefresh = !0, this.__debounceRender(this.__render, this.delay), !0
}
}
__debounceRender(e, f) {
this.__renderDebouncer = Polymer.Debouncer.debounce(this.__renderDebouncer, 0 < f ? Polymer.Async.timeOut.after(f) : Polymer.Async.microTask, e.bind(this)), Polymer.enqueueDebouncer(this.__renderDebouncer)
}
render() {
this.__needFullRefresh = !0, this.__debounceRender(this.__render), Polymer.flush()
}
__render() {
this.__ensureTemplatized() && (this.__applyFullRefresh(), this.__pool.length = 0, this._setRenderedItemCount(this.__instances.length), this.dispatchEvent(new CustomEvent('dom-change', {
bubbles: !0,
composed: !0
})), this.__tryRenderChunk())
}
__applyFullRefresh() {
const e = this.items || [];
let f = Array(e.length);
for (let k = 0; k < e.length; k++) f[k] = k;
this.__filterFn && (f = f.filter((k, l, m) => this.__filterFn(e[k], l, m))), this.__sortFn && f.sort((k, l) => this.__sortFn(e[k], e[l]));
const g = this.__itemsIdxToInstIdx = {};
let h = 0;
for (const j = Math.min(f.length, this.__limit); h < j; h++) {
let k = this.__instances[h],
l = f[h],
m = e[l];
g[l] = h, k && h < this.__limit ? (k._setPendingProperty(this.as, m), k._setPendingProperty(this.indexAs, h), k._setPendingProperty(this.itemsIndexAs, l), k._flushProperties()) : this.__insertInstance(m, h, l)
}
for (let k = this.__instances.length - 1; k >= h; k--) this.__detachAndRemoveInstance(k)
}
__detachInstance(e) {
let f = this.__instances[e];
for (let h, g = 0; g < f.children.length; g++) h = f.children[g], f.root.appendChild(h);
return f
}
__attachInstance(e, f) {
let g = this.__instances[e];
f.insertBefore(g.root, this)
}
__detachAndRemoveInstance(e) {
let f = this.__detachInstance(e);
f && this.__pool.push(f), this.__instances.splice(e, 1)
}
__stampInstance(e, f, g) {
let h = {};
return h[this.as] = e, h[this.indexAs] = f, h[this.itemsIndexAs] = g, new this.__ctor(h)
}
__insertInstance(e, f, g) {
let h = this.__pool.pop();
h ? (h._setPendingProperty(this.as, e), h._setPendingProperty(this.indexAs, f), h._setPendingProperty(this.itemsIndexAs, g), h._flushProperties()) : h = this.__stampInstance(e, f, g);
let j = this.__instances[f + 1],
k = j ? j.children[0] : this;
return this.parentNode.insertBefore(h.root, k), this.__instances[f] = h, h
}
_showHideChildren(e) {
for (let f = 0; f < this.__instances.length; f++) this.__instances[f]._showHideChildren(e)
}
__handleItemPath(e, f) {
let g = e.slice(6),
h = g.indexOf('.'),
j = 0 > h ? g : g.substring(0, h);
if (j == parseInt(j, 10)) {
let k = 0 > h ? '' : g.substring(h + 1);
if (!this.__handleObservedPaths(k)) {
let l = this.__itemsIdxToInstIdx[j],
m = this.__instances[l];
if (m) {
let n = this.as + (k ? '.' + k : '');
m._setPendingPropertyOrPath(n, f, !1, !0), m._flushProperties()
}
}
return !0
}
}
itemForElement(e) {
let f = this.modelForElement(e);
return f && f[this.as]
}
indexForElement(e) {
let f = this.modelForElement(e);
return f && f[this.indexAs]
}
modelForElement(e) {
return Polymer.Templatize.modelForElement(this.template, e)
}
}
customElements.define(d.is, d), Polymer.DomRepeat = d
})();
</script>
<script>
(function() {
'use strict';
class a extends Polymer.Element {
static get is() {
return 'dom-if'
}
static get template() {
return null
}
static get properties() {
return {
if: {
type: Boolean,
observer: '__debounceRender'
},
restamp: {
type: Boolean,
observer: '__debounceRender'
}
}
}
constructor() {
super(), this.__renderDebouncer = null, this.__invalidProps = null, this.__instance = null
}
__debounceRender() {
this.__renderDebouncer = Polymer.Debouncer.debounce(this.__renderDebouncer, Polymer.Async.microTask, () => this.__render()), Polymer.enqueueDebouncer(this.__renderDebouncer)
}
disconnectedCallback() {
super.disconnectedCallback(), this.parentNode && (this.parentNode.nodeType != Node.DOCUMENT_FRAGMENT_NODE || this.parentNode.host) || this.__teardownInstance()
}
connectedCallback() {
super.connectedCallback(), this.if && this.__debounceRender()
}
render() {
Polymer.flush()
}
__render() {
if (this.if) {
if (!this.__ensureInstance()) return;
this._showHideChildren()
} else this.restamp && this.__teardownInstance();
!this.restamp && this.__instance && this._showHideChildren(), this.if != this._lastIf && (this.dispatchEvent(new CustomEvent('dom-change', {
bubbles: !0,
composed: !0
})), this._lastIf = this.if)
}
__ensureInstance() {
let b = this.parentNode;
if (b) {
if (!this.__ctor) {
let c = this.querySelector('template');
if (!c) {
let d = new MutationObserver(() => {
if (this.querySelector('template')) d.disconnect(), this.__render();
else throw new Error('dom-if requires a <template> child')
});
return d.observe(this, {
childList: !0
}), !1
}
this.__ctor = Polymer.Templatize.templatize(c, this, {
mutableData: !0,
forwardHostProp: function(d, e) {
this.__instance && (this.if ? this.__instance.forwardHostProp(d, e) : (this.__invalidProps = this.__invalidProps || Object.create(null), this.__invalidProps[Polymer.Path.root(d)] = !0))
}
})
}
if (!this.__instance) this.__instance = new this.__ctor, b.insertBefore(this.__instance.root, this);
else {
this.__syncHostProperties();
let c = this.__instance.children;
if (c && c.length) {
let d = this.previousSibling;
if (d !== c[c.length - 1])
for (let f, e = 0; e < c.length && (f = c[e]); e++) b.insertBefore(f, this)
}
}
}
return !0
}
__syncHostProperties() {
let b = this.__invalidProps;
if (b) {
for (let c in b) this.__instance._setPendingProperty(c, this.__dataHost[c]);
this.__invalidProps = null, this.__instance._flushProperties()
}
}
__teardownInstance() {
if (this.__instance) {
let b = this.__instance.children;
if (b && b.length) {
let c = b[0].parentNode;
for (let e, d = 0; d < b.length && (e = b[d]); d++) c.removeChild(e)
}
this.__instance = null, this.__invalidProps = null
}
}
_showHideChildren() {
let b = this.__hideTemplateChildren__ || !this.if;
this.__instance && this.__instance._showHideChildren(b)
}
}
customElements.define(a.is, a), Polymer.DomIf = a
})();
</script>
<script>
(function() {
'use strict';
let a = Polymer.dedupingMixin(d => {
class e extends d {
static get properties() {
return {
items: {
type: Array
},
multi: {
type: Boolean,
value: !1
},
selected: {
type: Object,
notify: !0
},
selectedItem: {
type: Object,
notify: !0
},
toggle: {
type: Boolean,
value: !1
}
}
}
static get observers() {
return ['__updateSelection(multi, items.*)']
}
constructor() {
super(), this.__lastItems = null, this.__lastMulti = null, this.__selectedMap = null
}
__updateSelection(f, g) {
let h = g.path;
if ('items' == h) {
let k = g.base || [],
l = this.__lastItems,
m = this.__lastMulti;
if (f !== m && this.clearSelection(), l) {
let n = Polymer.ArraySplice.calculateSplices(k, l);
this.__applySplices(n)
}
this.__lastItems = k, this.__lastMulti = f
} else if ('items.splices' == g.path) this.__applySplices(g.value.indexSplices);
else {
let k = h.slice('items.'.length),
l = parseInt(k, 10);
0 > k.indexOf('.') && k == l && this.__deselectChangedIdx(l)
}
}
__applySplices(f) {
let g = this.__selectedMap;
for (let l, k = 0; k < f.length; k++) {
l = f[k], g.forEach((m, n) => {
m < l.index || (m >= l.index + l.removed.length ? g.set(n, m + l.addedCount - l.removed.length) : g.set(n, -1))
});
for (let n, m = 0; m < l.addedCount; m++) n = l.index + m, g.has(this.items[n]) && g.set(this.items[n], n)
}
this.__updateLinks();
let h = 0;
g.forEach((k, l) => {
0 > k ? (this.multi ? this.splice('selected', h, 1) : this.selected = this.selectedItem = null, g.delete(l)) : h++
})
}
__updateLinks() {
if (this.__dataLinkedPaths = {}, this.multi) {
let f = 0;
this.__selectedMap.forEach(g => {
0 <= g && this.linkPaths('items.' + g, 'selected.' + f++)
})
} else this.__selectedMap.forEach(f => {
this.linkPaths('selected', 'items.' + f), this.linkPaths('selectedItem', 'items.' + f)
})
}
clearSelection() {
this.__dataLinkedPaths = {}, this.__selectedMap = new Map, this.selected = this.multi ? [] : null, this.selectedItem = null
}
isSelected(f) {
return this.__selectedMap.has(f)
}
isIndexSelected(f) {
return this.isSelected(this.items[f])
}
__deselectChangedIdx(f) {
let g = this.__selectedIndexForItemIndex(f);
if (0 <= g) {
let h = 0;
this.__selectedMap.forEach((k, l) => {
g == h++ && this.deselect(l)
})
}
}
__selectedIndexForItemIndex(f) {
let g = this.__dataLinkedPaths['items.' + f];
if (g) return parseInt(g.slice('selected.'.length), 10)
}
deselect(f) {
let g = this.__selectedMap.get(f);
if (0 <= g) {
this.__selectedMap.delete(f);
let h;
this.multi && (h = this.__selectedIndexForItemIndex(g)), this.__updateLinks(), this.multi ? this.splice('selected', h, 1) : this.selected = this.selectedItem = null
}
}
deselectIndex(f) {
this.deselect(this.items[f])
}
select(f) {
this.selectIndex(this.items.indexOf(f))
}
selectIndex(f) {
let g = this.items[f];
this.isSelected(g) ? this.toggle && this.deselectIndex(f) : (!this.multi && this.__selectedMap.clear(), this.__selectedMap.set(g, f), this.__updateLinks(), this.multi ? this.push('selected', g) : this.selected = this.selectedItem = g)
}
}
return e
});
Polymer.ArraySelectorMixin = a;
let b = a(Polymer.Element);
class c extends b {
static get is() {
return 'array-selector'
}
}
customElements.define(c.is, c), Polymer.ArraySelector = c
})();
</script>
<script>
(function() {
"use strict";
function i(G) {
y = G && G.shimcssproperties ? !1 : x || !navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) && window.CSS && CSS.supports && CSS.supports("box-shadow", "0 0 0 var(--foo)")
}
function j(G, H) {
for (var I in H) null === I ? G.style.removeProperty(I) : G.style.setProperty(I, H[I])
}
function o() {
var G = E;
requestAnimationFrame(function() {
B ? B(G) : (A || (A = new Promise(function(H) {
C = H
}), "complete" === document.readyState ? C() : document.addEventListener("readystatechange", function() {
"complete" === document.readyState && C()
})), A.then(function() {
G && G()
}))
})
}
function s() {
this.customStyles = [], this.enqueued = !1
}
function w(G) {
!G.enqueued && E && (G.enqueued = !0, o())
}
var y, x = !(window.ShadyDOM && window.ShadyDOM.inUse);
window.ShadyCSS && void 0 !== window.ShadyCSS.nativeCss ? y = window.ShadyCSS.nativeCss : window.ShadyCSS ? (i(window.ShadyCSS), window.ShadyCSS = void 0) : i(window.WebComponents && window.WebComponents.flags);
var z = y;
var C, A = null,
B = window.HTMLImports && window.HTMLImports.whenReady || null;
var D = null,
E = null;
s.prototype.c = function(G) {
G.__seenByShadyCSS || (G.__seenByShadyCSS = !0, this.customStyles.push(G), w(this))
}, s.prototype.b = function(G) {
if (G.__shadyCSSCachedStyle) return G.__shadyCSSCachedStyle;
var H;
return H = G.getStyle ? G.getStyle() : G, H
}, s.prototype.a = function() {
for (var I, G = this.customStyles, H = 0; H < G.length; H++)
if (I = G[H], !I.__shadyCSSCachedStyle) {
var J = this.b(I);
J && (J = J.__appliedElement || J, D && D(J), I.__shadyCSSCachedStyle = J)
}
return G
}, s.prototype.addCustomStyle = s.prototype.c, s.prototype.getStyleForCustomStyle = s.prototype.b, s.prototype.processStyles = s.prototype.a, Object.defineProperties(s.prototype, {
transformCallback: {
get: function() {
return D
},
set: function(G) {
D = G
}
},
validateCallback: {
get: function() {
return E
},
set: function(G) {
var H = !1;
E || (H = !0), E = G, H && w(this)
}
}
});
var F = new s;
window.ShadyCSS || (window.ShadyCSS = {
prepareTemplate: function() {},
styleSubtree: function(G, H) {
F.a(), j(G, H)
},
styleElement: function() {
F.a()
},
styleDocument: function(G) {
F.a(), j(document.body, G)
},
getComputedStyleValue: function(G, H) {
return (G = window.getComputedStyle(G).getPropertyValue(H)) ? G.trim() : ""
},
nativeCss: z,
nativeShadow: x
}), window.ShadyCSS.CustomStyleInterface = F
}).call(this);
</script>
<script>
(function() {
'use strict';
const a = 'include',
b = window.ShadyCSS.CustomStyleInterface;
class c extends HTMLElement {
constructor() {
super(), this._style = null, b.addCustomStyle(this)
}
getStyle() {
if (this._style) return this._style;
const d = this.querySelector('style');
if (d) {
this._style = d;
const e = d.getAttribute(a);
return e && (d.removeAttribute(a), d.textContent = Polymer.StyleGather.cssFromModules(e) + d.textContent), this._style
}
}
}
window.customElements.define('custom-style', c), Polymer.CustomStyle = c
})();
</script>
<script>
(function() {
'use strict';
let a = Polymer.MutableData._mutablePropertyChange;
Polymer.MutableDataBehavior = {
_shouldPropertyChange(b, c, d) {
return a(this, b, c, d, !0)
}
}, Polymer.OptionalMutableDataBehavior = {
properties: {
mutableData: Boolean
},
_shouldPropertyChange(b, c, d) {
return a(this, b, c, d, this.mutableData)
}
}
})();
</script>
<script>
Polymer.Base = Polymer.LegacyElementMixin(HTMLElement).prototype;
</script>
<dom-module id="client-app" assetpath="../../styles/"><template><style>#room{display:flex;flex-direction:column;align-items:stretch;width:100%;max-width:inherit;padding:0 0 0 270px;transition:.8s;}#room.wider{padding-left:0;}#room-content{display:flex;flex-direction:row;align-items:stretch;height:100%;min-height:100px;text-align:left;background-color:#f6f6f6;}@media screen and (max-width: 1200px){#room-content{flex-direction:column;}}@media screen and (max-width: 1000px){:host > #room{padding-left:0;}}@media screen and (max-width: 600px){#room-content{padding-top:54px;}#room.full-screen > #room-content{padding-top:0;}}#room.full-screen{padding-left:0;}</style></template></dom-module>
<script>
(function() {
'use strict';
window.requestAnimationFrame = function() {
return function(a) {
window.setTimeout(a, 1e3 / 30)
}
}(), Object.equals = function(a, b) {
if (a === b) return !0;
if (!(a instanceof Object) || !(b instanceof Object)) return !1;
if (a.constructor !== b.constructor) return !1;
for (var c in a)
if (a.hasOwnProperty(c)) {
if (!b.hasOwnProperty(c)) return !1;
if (a[c] !== b[c]) {
if ('object' != typeof a[c]) return !1;
if (!Object.equals(a[c], b[c])) return !1
}
}
for (c in b)
if (b.hasOwnProperty(c) && !a.hasOwnProperty(c)) return !1;
return !0
}, Object.isObj = () => {
return 'object' == typeof fun
}, Object.isFunc = a => {
return 'function' == typeof a
}, Object.getName = function(a) {
return null === a ? '[object Null]' : Object.prototype.toString.call(a)
}, Number.prototype.timeToReadable = function() {
function a(i) {
return 1 < i ? 's' : ''
}
let b = this;
var c = Math.floor(b / 31536000);
if (c) return c + ' year' + a(c);
var d = Math.floor((b %= 31536000) / 86400);
if (d) return d + ' day' + a(d);
var e = Math.floor((b %= 86400) / 3600);
if (e) return e + ' hour' + a(e);
var g = Math.floor((b %= 3600) / 60);
if (g) return g + ' minute' + a(g);
var h = b % 60;
return h ? h + ' second' + a(h) : 'less than a second'
}, Event.prototype.stopPropagation || (Event.prototype.stopPropagation = function() {
this.cancelBubble = !0
}), Event.prototype.preventDefault || (Event.prototype.preventDefault = function() {
event.getPreventDefault ? event.getPreventDefault() : event.defaultPrevented
})
})();
</script>
<script>
(function() {
'use strict';
window.CookieUtils = new class {
constructor() {}
getCookie(b) {
var c = document.cookie.match(new RegExp('(?:^|; )' + b.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + '=([^;]*)'));
return c ? decodeURIComponent(c[1]) : void 0
}
setCookie(b, c, e) {
e = e || {};
var f = e.expires;
if ('number' == typeof f && f) {
var g = new Date;
g.setTime(g.getTime() + 1e3 * f), f = e.expires = g
}
f && f.toUTCString && (e.expires = f.toUTCString()), c = encodeURIComponent(c);
var h = b + '=' + c;
for (var i in e) {
h += '; ' + i;
var j = e[i];
!0 !== j && (h += '=' + j)
}
document.cookie = h
}
}
})();
</script>
<script>
(function() {
"use strict";
window.EventBus = class {
constructor() {
this.listeners = {}
}
_getListenerIdx(b, c, d) {
let f, e = this.listeners[b],
g = -1;
if (!e || 0 === e.length) return g;
for (f = 0; f < e.length; f++)
if (e[f].callback === c && (!d || d === e[f].scope)) {
g = f;
break
}
return g
}
subscribe(b, c, d) {
let e, f;
if (!b) throw new Error("Event name cannot be null or undefined");
if (!c || "function" != typeof c) throw new Error("Listener must be of type function.");
f = this._getListenerIdx(b, c, d);
0 <= f || (e = {
callback: c,
scope: d
}, this.listeners[b] = this.listeners[b] || [], this.listeners[b].push(e))
}
unsubscribe(b, c, d) {
let e;
b && c && this.listeners[b] && (e = this._getListenerIdx(b, c, d), -1 === e || this.listeners[b].splice(e, 1))
}
broadcast(b, c) {
let d = this.listeners[b];
b && this.listeners[b] && (c = c || {}, d.forEach(function(f) {
f.callback.call(f.scope, c)
}))
}
reset() {
this.listeners = {}
}
}
})();
</script>
<script>
(function() {
'use strict';
window.Math.Guid = window.Math.Guid || function() {
var e = function(j, k, l) {
return j.length >= k ? j : e(l + j, k, l || ' ')
},
f = function(j) {
var k = j.toString(16);
return e(k, 4, '0')
},
g = function() {
var j = new window.Uint16Array(8);
return window.crypto.getRandomValues(j), [f(j[0]) + f(j[1]), f(j[2]), f(j[3]), f(j[4]), f(j[5]) + f(j[6]) + f(j[7])].join('-')
},
h = function() {
var j = new Date().getTime();
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(k) {
var l = 0 | (j + 16 * Math.random()) % 16;
return j = Math.floor(j / 16), ('x' === k ? l : 8 | 7 & l).toString(16)
})
};
return {
newGuid: function() {
var j = 'undefined' != typeof window.crypto,
k = 'undefined' != typeof window.crypto.getRandomValues;
return j && k ? g() : h()
},
empty: '00000000-0000-0000-0000-000000000000'
}
}(), window.Math.easeInOutQuad = function(a, e, f, g) {
return (a /= g / 2, 1 > a) ? f / 2 * a * a + e : (a--, -f / 2 * (a * (a - 2) - 1) + e)
}, window.Math.easeInCubic = function(a, e, f, g) {
var h = (a /= g) * a * a;
return e + f * h
}, window.Math.inOutQuintic = function(a, e, f, g) {
var h = (a /= g) * a,
i = h * a;
return e + f * (6 * i * h + -15 * h * h + 10 * i)
}
})();
</script>
<script>
(function() {
'use strict';
function a(c) {
this.context = c, this.instant = 0, this.slow = 0, this.clip = 0, this.script = c.createScriptProcessor(2048, 1, 1);
var d = this;
this.script.onaudioprocess = function(f) {
var g = f.inputBuffer.getChannelData(0),
h, j = 0,
k = 0;
for (h = 0; h < g.length; ++h) j += g[h] * g[h], 0.99 < Math.abs(g[h]) && (k += 1);
d.instant = Math.sqrt(j / g.length), d.slow = 0.95 * d.slow + 0.05 * d.instant, d.clip = k / g.length
}
}
var b = window.MediaStream;
'undefined' == typeof b && 'undefined' != typeof webkitMediaStream && (b = webkitMediaStream), 'undefined' == typeof b || 'stop' in b.prototype || (b.prototype.stop = function() {
this.getVideoTracks().forEach(function(c) {
c.stop()
}), this.getAudioTracks().forEach(function(c) {
c.stop()
})
}), navigator.mediaDevices === void 0 && (navigator.mediaDevices = {}), navigator.mediaDevices.getUserMedia === void 0 && (navigator.mediaDevices.getUserMedia = c => {
var d = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
return d ? new Promise((f, g) => {
d.call(navigator, c, f, g)
}) : Promise.reject(new Error('getUserMedia is not implemented in this browser'))
}), window.AudioContext = window.AudioContext || window.webkitAudioContext, a.prototype.connectToSource = function(c, d) {
try {
this.mic = this.context.createMediaStreamSource(c), this.mic.connect(this.script), this.script.connect(this.context.destination), 'undefined' != typeof d && d(null)
} catch (f) {
console.error(f), 'undefined' != typeof d && d(f)
}
}, a.prototype.stop = function() {
this.mic && this.mic.disconnect(), this.script && this.script.disconnect()
}, window.SoundMeter = a, window.fullscreenManager = {
request: c => {
void 0 == c || (c.requestFullscreen ? c.requestFullscreen() : c.webkitRequestFullscreen ? c.webkitRequestFullscreen() : c.mozRequestFullScreen && c.mozRequestFullScreen())
},
status: () => {
let c = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
return c
},
exit: () => {
document.ExitFullscreen ? document.ExitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.cancelFullscreen && document.cancelFullscreen()
},
addEventListener: (c, d) => {
document.addEventListener('webkitfullscreenchange', c, d), document.addEventListener('mozfullscreenchange', c, d), document.addEventListener('fullscreenchange', c, d), document.addEventListener('MSFullscreenChange', c, d)
},
removeEventListener: (c, d) => {
document.removeEventListener('webkitfullscreenchange', c, d), document.removeEventListener('mozfullscreenchange', c, d), document.removeEventListener('fullscreenchange', c, d), document.removeEventListener('MSFullscreenChange', c, d)
}
}
})();
</script>
<script>
(function() {
'use strict';
String.prototype.format = function() {
for (var c, a = this, b = 0; b < arguments.length; b++) c = new RegExp('\\{' + b + '\\}', 'gi'), a = a.replace(c, arguments[b]);
return a
}, String.prototype.isEmpty = function() {
return !this || 0 === this.length
}, String.prototype.isNotEmpty = function() {
return !this.isEmpty()
}
})();
</script>
<script>
(function() {
'use strict';
let a = null;
class b {
constructor() {}
static getInstance() {
return null == a && (a = new b), a
}
wsj(d, f) {
var g = new Promise(function(h, i) {
d.method = d.method == void 0 ? 'GET' : d.method;
let j = d.params,
l = j == void 0 ? '' : Object.keys(j).map(function(r) {
return encodeURIComponent(r) + '=' + encodeURIComponent(j[r])
}).join('&'),
m = j == void 0 ? void 0 : l,
n = 0 <= d.src.indexOf('?') ? '&' : '?',
p = 'GET' == d.method ? d.src + n + l : d.src;
var q = new XMLHttpRequest;
q.onreadystatechange = function() {
if (4 == q.readyState)
if (400 > q.status) try {
f ? h(q.response) : h(JSON.parse(q.response))
} catch (r) {
i(new c(r.message + '\n' + q.response))
} else i(new c(q.statusText))
}, q.open(d.method, p, !0), d['content-type'] !== void 0 && q.setRequestHeader('Content-Type', d['content-type']), q.send(m)
});
return g
}
}
class c extends Error {}
window.WebAPI = b, window.AJAXError = c
})();
</script>
<script>
! function(j, k) {
"function" == typeof define && define.amd ? define([], k) : "object" == typeof exports ? module.exports = k() : j.Autolinker = k()
}(this, function() {
var j = function(k) {
k = k || {}, this.version = j.version, this.urls = this.normalizeUrlsCfg(k.urls), this.email = "boolean" != typeof k.email || k.email, this.phone = "boolean" != typeof k.phone || k.phone, this.hashtag = k.hashtag || !1, this.mention = k.mention || !1, this.newWindow = "boolean" != typeof k.newWindow || k.newWindow, this.stripPrefix = this.normalizeStripPrefixCfg(k.stripPrefix), this.stripTrailingSlash = "boolean" != typeof k.stripTrailingSlash || k.stripTrailingSlash, this.decodePercentEncoding = "boolean" != typeof k.decodePercentEncoding || k.decodePercentEncoding;
var q = this.mention;
if (!1 !== q && "twitter" !== q && "instagram" !== q) throw new Error("invalid `mention` cfg - see docs");
var w = this.hashtag;
if (!1 !== w && "twitter" !== w && "facebook" !== w && "instagram" !== w) throw new Error("invalid `hashtag` cfg - see docs");
this.truncate = this.normalizeTruncateCfg(k.truncate), this.className = k.className || "", this.replaceFn = k.replaceFn || null, this.context = k.context || this, this.htmlParser = null, this.matchers = null, this.tagBuilder = null
};
return j.link = function(k, q) {
var w = new j(q);
return w.link(k)
}, j.parse = function(k, q) {
var w = new j(q);
return w.parse(k)
}, j.version = "1.6.0", j.prototype = {
constructor: j,
normalizeUrlsCfg: function(k) {
return null == k && (k = !0), "boolean" == typeof k ? {
schemeMatches: k,
wwwMatches: k,
tldMatches: k
} : {
schemeMatches: "boolean" != typeof k.schemeMatches || k.schemeMatches,
wwwMatches: "boolean" != typeof k.wwwMatches || k.wwwMatches,
tldMatches: "boolean" != typeof k.tldMatches || k.tldMatches
}
},
normalizeStripPrefixCfg: function(k) {
return null == k && (k = !0), "boolean" == typeof k ? {
scheme: k,
www: k
} : {
scheme: "boolean" != typeof k.scheme || k.scheme,
www: "boolean" != typeof k.www || k.www
}
},
normalizeTruncateCfg: function(k) {
return "number" == typeof k ? {
length: k,
location: "end"
} : j.Util.defaults(k || {}, {
length: Number.POSITIVE_INFINITY,
location: "end"
})
},
parse: function(k) {
for (var q = this.getHtmlParser(), w = q.parse(k), y = 0, z = [], A = 0, B = w.length; A < B; A++) {
var C = w[A],
D = C.getType();
if ("element" === D && "a" === C.getTagName()) C.isClosing() ? y = Math.max(y - 1, 0) : y++;
else if ("text" === D && 0 === y) {
var E = this.parseText(C.getText(), C.getOffset());
z.push.apply(z, E)
}
}
return z = this.compactMatches(z), z = this.removeUnwantedMatches(z)
},
compactMatches: function(k) {
k.sort(function(C, D) {
return C.getOffset() - D.getOffset()
});
for (var q = 0; q < k.length - 1; q++) {
var w = k[q],
y = w.getOffset(),
z = w.getMatchedText().length;
if (q + 1 < k.length) {
if (k[q + 1].getOffset() === y) {
var B = k[q + 1].getMatchedText().length > z ? q : q + 1;
k.splice(B, 1);
continue
}
k[q + 1].getOffset() <= y + z && k.splice(q + 1, 1)
}
}
return k
},
removeUnwantedMatches: function(k) {
var q = j.Util.remove;
return this.hashtag || q(k, function(w) {
return "hashtag" === w.getType()
}), this.email || q(k, function(w) {
return "email" === w.getType()
}), this.phone || q(k, function(w) {
return "phone" === w.getType()
}), this.mention || q(k, function(w) {
return "mention" === w.getType()
}), this.urls.schemeMatches || q(k, function(w) {
return "url" === w.getType() && "scheme" === w.getUrlMatchType()
}), this.urls.wwwMatches || q(k, function(w) {
return "url" === w.getType() && "www" === w.getUrlMatchType()
}), this.urls.tldMatches || q(k, function(w) {
return "url" === w.getType() && "tld" === w.getUrlMatchType()
}), k
},
parseText: function(k, q) {
q = q || 0;
for (var w = this.getMatchers(), y = [], z = 0, A = w.length; z < A; z++) {
for (var B = w[z].parseMatches(k), C = 0, D = B.length; C < D; C++) B[C].setOffset(q + B[C].getOffset());
y.push.apply(y, B)
}
return y
},
link: function(k) {
if (!k) return "";
for (var B, q = this.parse(k), w = [], y = 0, z = 0, A = q.length; z < A; z++) B = q[z], w.push(k.substring(y, B.getOffset())), w.push(this.createMatchReturnVal(B)), y = B.getOffset() + B.getMatchedText().length;
return w.push(k.substring(y)), w.join("")
},
createMatchReturnVal: function(k) {
var q;
if (this.replaceFn && (q = this.replaceFn.call(this.context, k)), "string" == typeof q) return q;
if (!1 === q) return k.getMatchedText();
if (q instanceof j.HtmlTag) return q.toAnchorString();
var w = k.buildTag();
return w.toAnchorString()
},
getHtmlParser: function() {
var k = this.htmlParser;
return k || (k = this.htmlParser = new j.htmlParser.HtmlParser), k
},
getMatchers: function() {
if (this.matchers) return this.matchers;
var k = j.matcher,
q = this.getTagBuilder(),
w = [new k.Hashtag({
tagBuilder: q,
serviceName: this.hashtag
}), new k.Email({
tagBuilder: q
}), new k.Phone({
tagBuilder: q
}), new k.Mention({
tagBuilder: q,
serviceName: this.mention
}), new k.Url({
tagBuilder: q,
stripPrefix: this.stripPrefix,
stripTrailingSlash: this.stripTrailingSlash,
decodePercentEncoding: this.decodePercentEncoding
})];
return this.matchers = w
},
getTagBuilder: function() {
var k = this.tagBuilder;
return k || (k = this.tagBuilder = new j.AnchorTagBuilder({
newWindow: this.newWindow,
truncate: this.truncate,
className: this.className
})), k
}
}, j.match = {}, j.matcher = {}, j.htmlParser = {}, j.truncate = {}, j.Util = {
abstractMethod: function() {
throw "abstract"
},
trimRegex: /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
assign: function(k, q) {
for (var w in q) q.hasOwnProperty(w) && (k[w] = q[w]);
return k
},
defaults: function(k, q) {
for (var w in q) q.hasOwnProperty(w) && void 0 === k[w] && (k[w] = q[w]);
return k
},
extend: function(k, q) {
var w = k.prototype,
y = function() {};
y.prototype = w;
var z = q.hasOwnProperty("constructor") ? q.constructor : function() {
w.constructor.apply(this, arguments)
};
var A = z.prototype = new y;
return A.constructor = z, A.superclass = w, delete q.constructor, j.Util.assign(A, q), z
},
ellipsis: function(k, q, w) {
var y;
return k.length > q && (null == w ? (w = "&hellip;", y = 3) : y = w.length, k = k.substring(0, q - y) + w), k
},
indexOf: function(k, q) {
if (Array.prototype.indexOf) return k.indexOf(q);
for (var w = 0, y = k.length; w < y; w++)
if (k[w] === q) return w;
return -1
},
remove: function(k, q) {
for (var w = k.length - 1; 0 <= w; w--) !0 === q(k[w]) && k.splice(w, 1)
},
splitAndCapture: function(k, q) {
for (var w, y = [], z = 0; w = q.exec(k);) y.push(k.substring(z, w.index)), y.push(w[0]), z = w.index + w[0].length;
return y.push(k.substring(z)), y
},
trim: function(k) {
return k.replace(this.trimRegex, "")
}
}, j.HtmlTag = j.Util.extend(Object, {
whitespaceRegex: /\s+/,
constructor: function(k) {
j.Util.assign(this, k), this.innerHtml = this.innerHtml || this.innerHTML
},
setTagName: function(k) {
return this.tagName = k, this
},
getTagName: function() {
return this.tagName || ""
},
setAttr: function(k, q) {
var w = this.getAttrs();
return w[k] = q, this
},
getAttr: function(k) {
return this.getAttrs()[k]
},
setAttrs: function(k) {
var q = this.getAttrs();
return j.Util.assign(q, k), this
},
getAttrs: function() {
return this.attrs || (this.attrs = {})
},
setClass: function(k) {
return this.setAttr("class", k)
},
addClass: function(k) {
for (var q, w = this.getClass(), y = this.whitespaceRegex, z = j.Util.indexOf, A = w ? w.split(y) : [], B = k.split(y); q = B.shift();) - 1 === z(A, q) && A.push(q);
return this.getAttrs()["class"] = A.join(" "), this
},
removeClass: function(k) {
for (var q, C, w = this.getClass(), y = this.whitespaceRegex, z = j.Util.indexOf, A = w ? w.split(y) : [], B = k.split(y); A.length && (q = B.shift());) C = z(A, q), -1 !== C && A.splice(C, 1);
return this.getAttrs()["class"] = A.join(" "), this
},
getClass: function() {
return this.getAttrs()["class"] || ""
},
hasClass: function(k) {
return -1 !== (" " + this.getClass() + " ").indexOf(" " + k + " ")
},
setInnerHtml: function(k) {
return this.innerHtml = k, this
},
getInnerHtml: function() {
return this.innerHtml || ""
},
toAnchorString: function() {
var k = this.getTagName(),
q = this.buildAttrsStr();
return q = q ? " " + q : "", ["<", k, q, ">", this.getInnerHtml(), "</", k, ">"].join("")
},
buildAttrsStr: function() {
if (!this.attrs) return "";
var k = this.getAttrs(),
q = [];
for (var w in k) k.hasOwnProperty(w) && q.push(w + "=\"" + k[w] + "\"");
return q.join(" ")
}
}), j.RegexLib = function() {
var k = "A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",
w = k + "0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19",
y = /(?:[0-9Ù -Ù©Û°-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯෦-෯๐-๙໐-໙༠-༩၀-၉႐-႙០-áŸ©á -á ™á¥†-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-á±™ê˜ -꘩꣐-꣙꤀-꤉꧐-꧙꧰-꧹꩐-꩙꯰-꯹0-ï¼™]{1,3}\.){3}[0-9Ù -Ù©Û°-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯෦-෯๐-๙໐-໙༠-༩၀-၉႐-႙០-áŸ©á -á ™á¥†-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-á±™ê˜ -꘩꣐-꣙꤀-꤉꧐-꧙꧰-꧹꩐-꩙꯰-꯹0-ï¼™]{1,3}/,
z = "[" + w + "](?:[" + w + "\\-]*[" + w + "])?",
A = new RegExp("(?:(?:(?:" + z + "\\.)*(?:" + z + "))|(?:" + y.source + "))");
return {
alphaNumericCharsStr: w,
alphaCharsStr: k,
domainNameRegex: A
}
}(), j.AnchorTagBuilder = j.Util.extend(Object, {
constructor: function(k) {
k = k || {}, this.newWindow = k.newWindow, this.truncate = k.truncate, this.className = k.className
},
build: function(k) {
return new j.HtmlTag({
tagName: "a",
attrs: this.createAttrs(k),
innerHtml: this.processAnchorText(k.getAnchorText())
})
},
createAttrs: function(k) {
var q = {
href: k.getAnchorHref()
},
w = this.createCssClass(k);
return w && (q["class"] = w), this.newWindow && (q.target = "_blank", q.rel = "noopener noreferrer"), this.truncate && this.truncate.length && this.truncate.length < k.getAnchorText().length && (q.title = k.getAnchorHref()), q
},
createCssClass: function(k) {
var q = this.className;
if (q) {
for (var w = [q], y = k.getCssClassSuffixes(), z = 0, A = y.length; z < A; z++) w.push(q + "-" + y[z]);
return w.join(" ")
}
return ""
},
processAnchorText: function(k) {
return k = this.doTruncate(k)
},
doTruncate: function(k) {
var q = this.truncate;
if (!q || !q.length) return k;
var w = q.length,
y = q.location;
return "smart" === y ? j.truncate.TruncateSmart(k, w) : "middle" === y ? j.truncate.TruncateMiddle(k, w) : j.truncate.TruncateEnd(k, w)
}
}), j.htmlParser.HtmlParser = j.Util.extend(Object, {
htmlRegex: function() {
var k = /!--([\s\S]+?)--/,
q = /[0-9a-zA-Z][0-9a-zA-Z:]*/,
w = /[^\s"'>\/=\x00-\x1F\x7F]+/,
y = /(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,
z = w.source + "(?:\\s*=\\s*" + y.source + ")?";
return new RegExp(["(?:", "<(!DOCTYPE)", "(?:", "\\s+", "(?:", z, "|", y.source + ")", ")*", ">", ")", "|", "(?:", "<(/)?", "(?:", k.source, "|", "(?:", "(" + q.source + ")", "\\s*/?", ")", "|", "(?:", "(" + q.source + ")", "\\s+", "(?:", "(?:\\s+|\\b)", z, ")*", "\\s*/?", ")", ")", ">", ")"].join(""), "gi")
}(),
htmlCharacterEntitiesRegex: /(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,
parse: function(k) {
for (var q, w, y = this.htmlRegex, z = 0, A = []; null !== (q = y.exec(k));) {
var B = q[0],
C = q[3],
D = q[1] || q[4] || q[5],
E = !!q[2],
F = q.index,
G = k.substring(z, F);
G && (w = this.parseTextAndEntityNodes(z, G), A.push.apply(A, w)), C ? A.push(this.createCommentNode(F, B, C)) : A.push(this.createElementNode(F, B, D, E)), z = F + B.length
}
if (z < k.length) {
var H = k.substring(z);
H && (w = this.parseTextAndEntityNodes(z, H), w.forEach(function(I) {
A.push(I)
}))
}
return A
},
parseTextAndEntityNodes: function(k, q) {
for (var w = [], y = j.Util.splitAndCapture(q, this.htmlCharacterEntitiesRegex), z = 0, A = y.length; z < A; z += 2) {
var B = y[z],
C = y[z + 1];
B && (w.push(this.createTextNode(k, B)), k += B.length), C && (w.push(this.createEntityNode(k, C)), k += C.length)
}
return w
},
createCommentNode: function(k, q, w) {
return new j.htmlParser.CommentNode({
offset: k,
text: q,
comment: j.Util.trim(w)
})
},
createElementNode: function(k, q, w, y) {
return new j.htmlParser.ElementNode({
offset: k,
text: q,
tagName: w.toLowerCase(),
closing: y
})
},
createEntityNode: function(k, q) {
return new j.htmlParser.EntityNode({
offset: k,
text: q
})
},
createTextNode: function(k, q) {
return new j.htmlParser.TextNode({
offset: k,
text: q
})
}
}), j.htmlParser.HtmlNode = j.Util.extend(Object, {
offset: void 0,
text: void 0,
constructor: function(k) {
j.Util.assign(this, k)
},
getType: j.Util.abstractMethod,
getOffset: function() {
return this.offset
},
getText: function() {
return this.text
}
}), j.htmlParser.CommentNode = j.Util.extend(j.htmlParser.HtmlNode, {
comment: "",
getType: function() {
return "comment"
},
getComment: function() {
return this.comment
}
}), j.htmlParser.ElementNode = j.Util.extend(j.htmlParser.HtmlNode, {
tagName: "",
closing: !1,
getType: function() {
return "element"
},
getTagName: function() {
return this.tagName
},
isClosing: function() {
return this.closing
}
}), j.htmlParser.EntityNode = j.Util.extend(j.htmlParser.HtmlNode, {
getType: function() {
return "entity"
}
}), j.htmlParser.TextNode = j.Util.extend(j.htmlParser.HtmlNode, {
getType: function() {
return "text"
}
}), j.match.Match = j.Util.extend(Object, {
constructor: function(k) {
this.tagBuilder = k.tagBuilder, this.matchedText = k.matchedText, this.offset = k.offset
},
getType: j.Util.abstractMethod,
getMatchedText: function() {
return this.matchedText
},
setOffset: function(k) {
this.offset = k
},
getOffset: function() {
return this.offset
},
getAnchorHref: j.Util.abstractMethod,
getAnchorText: j.Util.abstractMethod,
getCssClassSuffixes: function() {
return [this.getType()]
},
buildTag: function() {
return this.tagBuilder.build(this)
}
}), j.match.Email = j.Util.extend(j.match.Match, {
constructor: function(k) {
j.match.Match.prototype.constructor.call(this, k), this.email = k.email
},
getType: function() {
return "email"
},
getEmail: function() {
return this.email
},
getAnchorHref: function() {
return "mailto:" + this.email
},
getAnchorText: function() {
return this.email
}
}), j.match.Hashtag = j.Util.extend(j.match.Match, {
constructor: function(k) {
j.match.Match.prototype.constructor.call(this, k), this.serviceName = k.serviceName, this.hashtag = k.hashtag
},
getType: function() {
return "hashtag"
},
getServiceName: function() {
return this.serviceName
},
getHashtag: function() {
return this.hashtag
},
getAnchorHref: function() {
var k = this.serviceName,
q = this.hashtag;
switch (k) {
case "twitter":
return "https://twitter.com/hashtag/" + q;
case "facebook":
return "https://www.facebook.com/hashtag/" + q;
case "instagram":
return "https://instagram.com/explore/tags/" + q;
default:
throw new Error("Unknown service name to point hashtag to: ", k);
}
},
getAnchorText: function() {
return "#" + this.hashtag
}
}), j.match.Phone = j.Util.extend(j.match.Match, {
constructor: function(k) {
j.match.Match.prototype.constructor.call(this, k), this.number = k.number, this.plusSign = k.plusSign
},
getType: function() {
return "phone"
},
getNumber: function() {
return this.number
},
getAnchorHref: function() {
return "tel:" + (this.plusSign ? "+" : "") + this.number
},
getAnchorText: function() {
return this.matchedText
}
}), j.match.Mention = j.Util.extend(j.match.Match, {
constructor: function(k) {
j.match.Match.prototype.constructor.call(this, k), this.mention = k.mention, this.serviceName = k.serviceName
},
getType: function() {
return "mention"
},
getMention: function() {
return this.mention
},
getServiceName: function() {
return this.serviceName
},
getAnchorHref: function() {
switch (this.serviceName) {
case "twitter":
return "https://twitter.com/" + this.mention;
case "instagram":
return "https://instagram.com/" + this.mention;
default:
throw new Error("Unknown service name to point mention to: ", this.serviceName);
}
},
getAnchorText: function() {
return "@" + this.mention
},
getCssClassSuffixes: function() {
var k = j.match.Match.prototype.getCssClassSuffixes.call(this),
q = this.getServiceName();
return q && k.push(q), k
}
}), j.match.Url = j.Util.extend(j.match.Match, {
constructor: function(k) {
j.match.Match.prototype.constructor.call(this, k), this.urlMatchType = k.urlMatchType, this.url = k.url, this.protocolUrlMatch = k.protocolUrlMatch, this.protocolRelativeMatch = k.protocolRelativeMatch, this.stripPrefix = k.stripPrefix, this.stripTrailingSlash = k.stripTrailingSlash, this.decodePercentEncoding = k.decodePercentEncoding
},
schemePrefixRegex: /^(https?:\/\/)?/i,
wwwPrefixRegex: /^(https?:\/\/)?(www\.)?/i,
protocolRelativeRegex: /^\/\//,
protocolPrepended: !1,
getType: function() {
return "url"
},
getUrlMatchType: function() {
return this.urlMatchType
},
getUrl: function() {
var k = this.url;
return this.protocolRelativeMatch || this.protocolUrlMatch || this.protocolPrepended || (k = this.url = "http://" + k, this.protocolPrepended = !0), k
},
getAnchorHref: function() {
var k = this.getUrl();
return k.replace(/&amp;/g, "&")
},
getAnchorText: function() {
var k = this.getMatchedText();
return this.protocolRelativeMatch && (k = this.stripProtocolRelativePrefix(k)), this.stripPrefix.scheme && (k = this.stripSchemePrefix(k)), this.stripPrefix.www && (k = this.stripWwwPrefix(k)), this.stripTrailingSlash && (k = this.removeTrailingSlash(k)), this.decodePercentEncoding && (k = this.removePercentEncoding(k)), k
},
stripSchemePrefix: function(k) {
return k.replace(this.schemePrefixRegex, "")
},
stripWwwPrefix: function(k) {
return k.replace(this.wwwPrefixRegex, "$1")
},
stripProtocolRelativePrefix: function(k) {
return k.replace(this.protocolRelativeRegex, "")
},
removeTrailingSlash: function(k) {
return "/" === k.charAt(k.length - 1) && (k = k.slice(0, -1)), k
},
removePercentEncoding: function(k) {
try {
return decodeURIComponent(k.replace(/%22/gi, "&quot;").replace(/%26/gi, "&amp;").replace(/%27/gi, "&#39;").replace(/%3C/gi, "&lt;").replace(/%3E/gi, "&gt;"))
} catch (q) {
return k
}
}
}), j.tldRegex = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|international|lifeinsurance|orientexpress|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|pamperedchef|scholarships|versicherung|xn--3e0b707e|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--3bst00m|xn--3ds443g|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|goodhands|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|mcdonalds|melbourne|microsoft|montblanc|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|telecity|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|panerai|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|spiegel|staples|starhub|statoil|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|xperia|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|boots|bosch|build|canon|cards|chase|cheap|chloe|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vista|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|संगठन|বাংলা|భారత్|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|mtpc|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sapo|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بيتك|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ਭਾਰਤ|ભારત|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|é¦™æ ¼é‡Œæ‹‰|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|htc|ibm|ice|icu|ifm|ing|ink|int|ist|itv|iwc|jcb|jcp|jio|jlc|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|lol|lpl|ltd|man|mba|mcd|med|men|meo|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|Õ°Õ¡Õµ|קום|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|æˆ‘çˆ±ä½ |æ–°åŠ å¡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|ë‹·ë„·|ë‹·ì»´|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|å•†æ ‡|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|政务|政府|æ–°é—»|时尚|書籍|机构|游戏|澳門|点看|ç å®|移动|网址|网店|网站|网络|联通|è°·æ­Œ|购物|通販|集团|食品|餐厅|香港)/, j.matcher.Matcher = j.Util.extend(Object, {
constructor: function(k) {
this.tagBuilder = k.tagBuilder
},
parseMatches: j.Util.abstractMethod
}), j.matcher.Email = j.Util.extend(j.matcher.Matcher, {
matcherRegex: function() {
var k = j.RegexLib.alphaNumericCharsStr,
y = k + "!#$%&'*+\\-\\/=?^_`{|}~",
A = new RegExp("(?:[" + y + "](?:[" + y + "]|\\.(?!\\.|@))*|\\\"[" + (y + "\\s\"(),:;<>@\\[\\]") + ".]+\\\")@"),
B = j.RegexLib.domainNameRegex,
C = j.tldRegex;
return new RegExp([A.source, B.source, "\\.", C.source].join(""), "gi")
}(),
parseMatches: function(k) {
for (var q, A, w = this.matcherRegex, y = this.tagBuilder, z = []; null !== (q = w.exec(k));) A = q[0], z.push(new j.match.Email({
tagBuilder: y,
matchedText: A,
offset: q.index,
email: A
}));
return z
}
}), j.matcher.Hashtag = j.Util.extend(j.matcher.Matcher, {
matcherRegex: new RegExp("#[_" + j.RegexLib.alphaNumericCharsStr + "]{1,139}", "g"),
nonWordCharRegex: new RegExp("[^" + j.RegexLib.alphaNumericCharsStr + "]"),
constructor: function(k) {
j.matcher.Matcher.prototype.constructor.call(this, k), this.serviceName = k.serviceName
},
parseMatches: function(k) {
for (var q, w = this.matcherRegex, y = this.nonWordCharRegex, z = this.serviceName, A = this.tagBuilder, B = []; null !== (q = w.exec(k));) {
var C = q.index,
D = k.charAt(C - 1);
if (0 === C || y.test(D)) {
var E = q[0],
F = q[0].slice(1);
B.push(new j.match.Hashtag({
tagBuilder: A,
matchedText: E,
offset: C,
serviceName: z,
hashtag: F
}))
}
}
return B
}
}), j.matcher.Phone = j.Util.extend(j.matcher.Matcher, {
matcherRegex: /(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4}([,;]*[0-9]+#?)*/g,
parseMatches: function(k) {
for (var q, w = this.matcherRegex, y = this.tagBuilder, z = []; null !== (q = w.exec(k));) {
var A = q[0],
B = A.replace(/[^0-9,;#]/g, ""),
C = !!q[1];
this.testMatch(q[2]) && this.testMatch(A) && z.push(new j.match.Phone({
tagBuilder: y,
matchedText: A,
offset: q.index,
number: B,
plusSign: C
}))
}
return z
},
testMatch: function(k) {
return /\D/.test(k)
}
}), j.matcher.Mention = j.Util.extend(j.matcher.Matcher, {
matcherRegexes: {
twitter: new RegExp("@[_" + j.RegexLib.alphaNumericCharsStr + "]{1,20}", "g"),
instagram: new RegExp("@[_." + j.RegexLib.alphaNumericCharsStr + "]{1,50}", "g")
},
nonWordCharRegex: new RegExp("[^" + j.RegexLib.alphaNumericCharsStr + "]"),
constructor: function(k) {
j.matcher.Matcher.prototype.constructor.call(this, k), this.serviceName = k.serviceName
},
parseMatches: function(k) {
var q, w = this.matcherRegexes[this.serviceName],
y = this.nonWordCharRegex,
z = this.serviceName,
A = this.tagBuilder,
B = [];
if (!w) return B;
for (; null !== (q = w.exec(k));) {
var C = q.index,
D = k.charAt(C - 1);
if (0 === C || y.test(D)) {
var E = q[0].replace(/\.+$/g, ""),
F = E.slice(1);
B.push(new j.match.Mention({
tagBuilder: A,
matchedText: E,
offset: C,
serviceName: z,
mention: F
}))
}
}
return B
}
}), j.matcher.Url = j.Util.extend(j.matcher.Matcher, {
matcherRegex: function() {
var k = /(?:[A-Za-z][-.+A-Za-z0-9]*:(?![A-Za-z][-.+A-Za-z0-9]*:\/\/)(?!\d+\/?)(?:\/\/)?)/,
q = /(?:www\.)/,
w = j.RegexLib.domainNameRegex,
y = j.tldRegex,
z = j.RegexLib.alphaNumericCharsStr,
A = new RegExp("[/?#](?:[" + z + "\\-+&@#/%=~_()|'$*\\[\\]?!:,.;\u2713]*[" + z + "\\-+&@#/%=~_()|'$*\\[\\]\u2713])?");
return new RegExp(["(?:", "(", k.source, w.source, ")", "|", "(", "(//)?", q.source, w.source, ")", "|", "(", "(//)?", w.source + "\\.", y.source, "(?![-" + z + "])", ")", ")", "(?::[0-9]+)?", "(?:" + A.source + ")?"].join(""), "gi")
}(),
wordCharRegExp: new RegExp("[" + j.RegexLib.alphaNumericCharsStr + "]"),
openParensRe: /\(/g,
closeParensRe: /\)/g,
constructor: function(k) {
j.matcher.Matcher.prototype.constructor.call(this, k), this.stripPrefix = k.stripPrefix, this.stripTrailingSlash = k.stripTrailingSlash, this.decodePercentEncoding = k.decodePercentEncoding
},
parseMatches: function(k) {
for (var q, w = this.matcherRegex, y = this.stripPrefix, z = this.stripTrailingSlash, A = this.decodePercentEncoding, B = this.tagBuilder, C = []; null !== (q = w.exec(k));) {
var D = q[0],
E = q[1],
F = q[2],
G = q[3],
H = q[5],
I = q.index,
J = G || H,
K = k.charAt(I - 1);
if (j.matcher.UrlMatchValidator.isValid(D, E) && !(0 < I && "@" === K || 0 < I && J && this.wordCharRegExp.test(K))) {
if (/\?$/.test(D) && (D = D.substr(0, D.length - 1)), this.matchHasUnbalancedClosingParen(D)) D = D.substr(0, D.length - 1);
else {
var L = this.matchHasInvalidCharAfterTld(D, E); - 1 < L && (D = D.substr(0, L))
}
var M = E ? "scheme" : F ? "www" : "tld";
C.push(new j.match.Url({
tagBuilder: B,
matchedText: D,
offset: I,
urlMatchType: M,
url: D,
protocolUrlMatch: !!E,
protocolRelativeMatch: !!J,
stripPrefix: y,
stripTrailingSlash: z,
decodePercentEncoding: A
}))
}
}
return C
},
matchHasUnbalancedClosingParen: function(k) {
var q = k.charAt(k.length - 1);
if (")" === q) {
var w = k.match(this.openParensRe),
y = k.match(this.closeParensRe),
z = w && w.length || 0,
A = y && y.length || 0;
if (z < A) return !0
}
return !1
},
matchHasInvalidCharAfterTld: function(k, q) {
if (!k) return -1;
var w = 0;
q && (w = k.indexOf(":"), k = k.slice(w));
var y = j.RegexLib.alphaNumericCharsStr,
z = new RegExp("^((.?//)?[-." + y + "]*[-" + y + "]\\.[-" + y + "]+)"),
A = z.exec(k);
return null === A ? -1 : (w += A[1].length, k = k.slice(A[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(k) ? w : -1)
}
}), j.matcher.UrlMatchValidator = {
hasFullProtocolRegex: /^[A-Za-z][-.+A-Za-z0-9]*:\/\//,
uriSchemeRegex: /^[A-Za-z][-.+A-Za-z0-9]*:/,
hasWordCharAfterProtocolRegex: new RegExp(":[^\\s]*?[" + j.RegexLib.alphaCharsStr + "]"),
ipRegex: /[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,
isValid: function(k, q) {
return !(q && !this.isValidUriScheme(q) || this.urlMatchDoesNotHaveProtocolOrDot(k, q) || this.urlMatchDoesNotHaveAtLeastOneWordChar(k, q) && !this.isValidIpAddress(k) || this.containsMultipleDots(k))
},
isValidIpAddress: function(k) {
var q = new RegExp(this.hasFullProtocolRegex.source + this.ipRegex.source),
w = k.match(q);
return null !== w
},
containsMultipleDots: function(k) {
return -1 < k.indexOf("..")
},
isValidUriScheme: function(k) {
var q = k.match(this.uriSchemeRegex)[0].toLowerCase();
return "javascript:" !== q && "vbscript:" !== q
},
urlMatchDoesNotHaveProtocolOrDot: function(k, q) {
return !(!k || q && this.hasFullProtocolRegex.test(q) || -1 !== k.indexOf("."))
},
urlMatchDoesNotHaveAtLeastOneWordChar: function(k, q) {
return k && q && !this.hasWordCharAfterProtocolRegex.test(k)
}
}, j.truncate.TruncateEnd = function(k, q, w) {
return j.Util.ellipsis(k, q, w)
}, j.truncate.TruncateMiddle = function(k, q, w) {
if (k.length <= q) return k;
var y, z;
null == w ? (w = "&hellip;", y = 8, z = 3) : (y = w.length, z = w.length);
var A = q - z,
B = "";
return 0 < A && (B = k.substr(-1 * Math.floor(A / 2))), (k.substr(0, Math.ceil(A / 2)) + w + B).substr(0, A + y)
}, j.truncate.TruncateSmart = function(k, q, w) {
var y, z;
null == w ? (w = "&hellip;", z = 3, y = 8) : (z = w.length, y = w.length);
var B = function(N) {
var O = "";
return N.scheme && N.host && (O += N.scheme + "://"), N.host && (O += N.host), N.path && (O += "/" + N.path), N.query && (O += "?" + N.query), N.fragment && (O += "#" + N.fragment), O
},
C = function(N, O) {
var P = O / 2,
Q = Math.ceil(P),
R = -1 * Math.floor(P),
S = "";
return 0 > R && (S = N.substr(R)), N.substr(0, Q) + w + S
};
if (k.length <= q) return k;
var D = q - z,
E = function(N) {
var O = {},
P = N,
Q = P.match(/^([a-z]+):\/\//i);
return Q && (O.scheme = Q[1], P = P.substr(Q[0].length)), Q = P.match(/^(.*?)(?=(\?|#|\/|$))/i), Q && (O.host = Q[1], P = P.substr(Q[0].length)), Q = P.match(/^\/(.*?)(?=(\?|#|$))/i), Q && (O.path = Q[1], P = P.substr(Q[0].length)), Q = P.match(/^\?(.*?)(?=(#|$))/i), Q && (O.query = Q[1], P = P.substr(Q[0].length)), Q = P.match(/^#(.*?)$/i), Q && (O.fragment = Q[1]), O
}(k);
if (E.query) {
var F = E.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);
F && (E.query = E.query.substr(0, F[1].length), k = B(E))
}
if (k.length <= q) return k;
if (E.host && (E.host = E.host.replace(/^www\./, ""), k = B(E)), k.length <= q) return k;
var G = "";
if (E.host && (G += E.host), G.length >= D) return E.host.length == q ? (E.host.substr(0, q - z) + w).substr(0, D + y) : C(G, D).substr(0, D + y);
var H = "";
if (E.path && (H += "/" + E.path), E.query && (H += "?" + E.query), H) {
if ((G + H).length >= D) {
if ((G + H).length == q) return (G + H).substr(0, q);
var I = D - G.length;
return (G + C(H, I)).substr(0, D + y)
}
G += H
}
if (E.fragment) {
var J = "#" + E.fragment;
if ((G + J).length >= D) {
if ((G + J).length == q) return (G + J).substr(0, q);
var K = D - G.length;
return (G + C(J, K)).substr(0, D + y)
}
G += J
}
if (E.scheme && E.host) {
var L = E.scheme + "://";
if ((G + L).length < D) return (L + G).substr(0, q)
}
if (G.length <= q) return G;
var M = "";
return 0 < D && (M = G.substr(-1 * Math.floor(D / 2))), (G.substr(0, Math.ceil(D / 2)) + w + M).substr(0, D + y)
}, j
});
</script>
<script>
(function() {
'use strict';
var a = window.TinychatApp || {};
a.DAL = {}, window.TinychatApp = a
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.BanlistItemEntity = class {
constructor() {
this.id = "", this.username = "", this.nickname = "", this.reason = "", this.moderator = ""
}
}
})();
</script>
<script>
(function() {
'use strict';
window.TinychatApp.DAL.BroadcastResultEntity = class {
constructor() {
this.broadcastStarted = !1, this.password = !1, this.banned = !1, this.moderating = !1, this.canceled = !1, this.permissions = !1
}
}
})();
</script>
<script>
(function() {
"use strict";
class a {
static get PUBLIC() {
return 0
}
static get PRIVATE() {
return 1
}
static get SYSTEM() {
return 2
}
static get GIFT() {
return 6
}
constructor() {
this.type = a.PUBLIC, this.user = null, this.chatname = 0, this.message_text = "", this.language = "", this.giftUrl = "", this.color = 0
}
}
window.TinychatApp.DAL.ChatLogItemEntity = a
})();
</script>
<script>
(function() {
'use strict';
window.TinychatApp.DAL.EnterRoomResultEntity = class {
constructor() {
this.selfuser = new TinychatApp.DAL.UserEntity
}
}
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.GiftEntity = class {
constructor() {
this.fromUsername = "", this.fromUrl = "", this.fromIdInRoom = 0, this.toAchievement = "", this.toUsername = "", this.toIdInRoom = 0, this.toUrl = "", this.giftComment = "", this.giftExt = 0, this.giftName = "", this.giftStore = "", this.giftUrl = ""
}
}
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.LoginResultEntity = class {
constructor() {
this.loggedIn = !1, this.loginName = "", this.usersuggestion = "", this.errorcode = "", this.errormsg = "", this.userInfo = null
}
}
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.LoginUserInfoEntity = class {
constructor() {
this.email = "", this.stype = 0, this.promoted = !1, this.achivement = "", this.points = 0, this.coins = 0, this.avatar = "", this.intercom_hash = "", this.giftData = [], this.currentSubscriptionMessage = "", this.currentSubscriptionEnd = "", this.currentSubscriptionPlanInterval = ""
}
}
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.RoomHistoryEntity = class {
constructor() {
this.roomname = "", this.usage = 0
}
}
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.RoomSettingsEntity = class {
constructor() {
this.type = "", this.name = "", this.topic = "", this.subtype = 0, this.giftpoints = 0, this.pushtotalk = !1, this.recent_gifts = [], this.biography = "", this.location = "", this.website = "", this.avatar = ""
}
}
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.SettingsEntity = class {
constructor() {
this.enablePMs = !0, this.enableYoutube = !0, this.enableSound = !0, this.с onfirmBans = !0, this.rememberVolume = !1, this.enableAcousticEchoCancelation = !0, this.enableHotkeys = !0, this.nickname = "", this.audio = null, this.video = null
}
equals(b) {
return JSON.stringify(this) === JSON.stringify(b)
}
}
})();
</script>
<script>
(function() {
"use strict";
class a {
constructor() {
this.nickname = "", this.username = "", this.avatarUrl = "", this.path = 0, this.subscriptionType = 0, this.isOwner = !1, this.isOperator = !1, this.isLurker = !1, this.giftpoints = 0, this.achivementUrl = "", this.isSelf = !1, this.isBroadcasting = !1, this.isDeleting = !1, this.isOffline = !1, this.needToUpprove = !1, this.isFeatured = !1
}
get handle() {
return this.path
}
get isUsername() {
return "" != this.username
}
get isGuest() {
return !this.isUsername
}
get hasSubscriptions() {
return TinychatApp.BLL.User.isSubscription(this.subscriptionType)
}
get canUseFilters() {
return TinychatApp.BLL.User.canUseFilters(this.subscriptionType)
}
toString() {
return "UserEntity:{ h(" + this.handle + ") n(" + this.nickname + ") u(" + this.username + ")}"
}
}
window.TinychatApp.DAL.UserEntity = a
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.UserProfileEntity = class {
constructor() {
this.username = "", this.biography = "", this.gender = "", this.age = 0, this.location = "", this.role = "", this.stype = 0, this.avatarUrl = "", this.achieveUrl = "", this.percentToNextAchieve = 0, this.giftpoints = 0, this.gifts = []
}
}
})();
</script>
<script>
(function() {
"use strict";
window.TinychatApp.DAL.YoutubeItem = class {
constructor() {
this.id = "", this.title = "", this.imgurl = "", this.duration = void 0
}
}
})();
</script>
<script>
(function() {
'use strict';
var a = window.TinychatApp || {};
a.BLL = {}, window.TinychatApp = a
})();
</script>
<script>
(function() {
'use strict';
const a = window.TinychatApp.BLL;
class b {
static get url_tc_server() {
return 'wss://wss.tinychat.com:443'
}
constructor(c, d) {
this.chatRoom = c, this.app = c.app, this.EventBus = this.app.EventBus, this.packetWorker = d, this.closedLastReasonCode = -1, this.reconnect_timer = 0, this.reconnect_wait = 0, this.reconnect_tries = 0
}
connect(c) {
let d = b.url_tc_server;
console.log(`Chatroom.Connecting (${d}/${this.chatRoom.roomname},
tc_token: ${this.chatRoom.tc_token},
debug: ${this.app.debug}) ... ${0<this.reconnect_tries?this.reconnect_tries:''} `), this.closedLastReasonCode = -2;
let e = new a.RoomConnectEvent(this.reconnect_tries);
if (this.EventBus.broadcast(a.RoomConnectEvent.ID, e), void 0 !== c && c) {
let f = new a.RoomReconnected;
this.EventBus.broadcast(a.RoomReconnected.ID, f), this.ws.onclose = function() {}, this.close()
}
this.ws = new WebSocket(d, 'tc'), this.ws.onopen = f => this.onOpen(f), this.ws.onclose = f => this.onClose(f), this.ws.onmessage = f => this.packetWorker.onMessage(f)
}
onOpen() {
this.send(this.chatRoom.tcPkt_Connect(this.chatRoom.onRoomConnectCallback))
}
onClose() {
console.warn('Chatroom.Disconnected');
let d = new TinychatApp.BLL.RoomQuitEvent(TinychatApp.BLL.RoomQuitEvent.WS, this);
this.EventBus.broadcast(TinychatApp.BLL.RoomQuitEvent.ID, d), this.chatRoom.wsReset();
let e = this,
f = 1e3 + Math.floor(2e3 * Math.random());
this.reconnect_wait += f, this.reconnect_tries += 1;
let g = new a.RoomConnectStandby(this.reconnect_tries, this.reconnect_wait);
if (this.EventBus.broadcast(a.RoomConnectStandby.ID, g), 999 > e.reconnect_tries) switch (this.closedLastReasonCode) {
case 0:
case 1:
case 5:
case 7:
case 8:
case 9:
case 10:
case 11:
console.warn('Chatroom.ConnectStandby: ' + e.reconnect_wait + 'ms'), e.reconnect_timer = setInterval(() => {
e.Reconnect()
}, e.reconnect_wait);
break;
default:
} else {
let h = new a.RoomConnectFatal;
this.EventBus.broadcast(a.RoomConnectFatal.ID, h), console.error('Chatroom.ConnectFatal')
}
}
reset() {
this.wsHandle = null
}
send(c) {
if (!(1 < this.ws.readyState)) {
const d = JSON.stringify(c);
this.ws.send(d)
}
}
close() {
this.ws.close()
}
}
window.TinychatApp.BLL.TCSocket = b
})();
</script>
<script>
(function() {
'use strict';
const a = window.TinychatApp.BLL.TCSocket;
class b {
constructor(c) {
this.chatRoom = c, this.app = c.app, this.EventBus = c.EventBus, this.reqid = 0, this.queue = {}, this.tcSocket = new a(this.chatRoom, this)
}
get userlist() {
return this.chatRoom.userlist
}
get videolist() {
return this.chatRoom.videolist
}
get chatlog() {
return this.chatRoom.chatlog
}
reset() {
this.tcSocket.reset(), this.reqid = 0, this.queue = {}
}
send(c) {
return this.tcSocket.send(c)
}
connect(c) {
this.tcSocket.connect(c)
}
onMessage(c) {
let d = JSON.parse(c.data),
e = d.req;
if (e !== void 0) {
let g = this.queue[e];
if (void 0 !== g) return Object.isObj(g) && Object.isFunc(g.func) ? g.func.call(this.chatRoom, d, g.params) : Object.isFunc(g) && g.call(this.chatRoom, d), void delete this.queue[e]
}
let f = d.tc;
'string' == typeof f ? 'ping' === f ? this.chatRoom.onPing(d) : 'userlist' === f ? this.chatRoom.onRoomUserlist(d) : 'join' === f ? this.chatRoom.onRoomUserJoin(d) : 'room_settings' === f ? this.chatRoom.onRoomSettings(d) : 'quit' === f ? this.chatRoom.onRoomUserQuit(d) : 'publish' === f ? this.chatRoom.onRoomPublish(d) : 'unpublish' === f ? this.chatRoom.onRoomUnPublish(d) : 'stream_connected' === f ? this.chatRoom.onStreamConnected(d) : 'pending_moderation' === f ? this.chatRoom.onPendingModeration(d) : 'waiting_slot' === f ? this.chatRoom.onWaitingSlot(d) : 'stream_closed' === f ? this.chatRoom.onStreamClosed(d) : 'stream_moder_allow' === f ? this.chatRoom.onStreamModerAllow(d) : 'publish' === f ? this.chatRoom.onRoomPublish(d) : 'unpublish' === f ? this.chatRoom.onRoomUnPublish(d) : 'msg' === f ? this.chatRoom.onSendMessagePublicCallback(d) : 'nick' === f ? this.chatRoom.onNicknameChanged(d) : 'pvtmsg' === f ? this.chatRoom.onSendMessagePrivateCallback(d) : 'closed' === f ? (this.chatRoom.onClosed(d), this.tcSocket.close()) : 'sysmsg' === f ? this.chatRoom.onSystemMessage(d) : 'gift' === f ? this.chatRoom.onGiftMessage(d) : f.startsWith('yut_') ? this.chatRoom.onYoutube(d) : f.startsWith('yutpls_') ? this.chatRoom.onYoutubePlaylist(d) : console.error('Unknown pkt: ' + JSON.stringify(d)) : console.error('Unknown pkt format: ' + JSON.stringify(d))
}
wsCreatePacket(c, d) {
const e = {
tc: c,
req: ++this.reqid
};
return this.registerPacketCallback(e, d), e
}
registerPacketCallback(c, d) {
d !== void 0 && (this.queue[c.req] = d)
}
}
window.TinychatApp.BLL.PacketWorker = b
})();
</script>
<script>
(function() {
'use strict';
let a = null;
class b {
constructor() {}
static getInstance() {
return null == a && (a = new b), a
}
getRoomEvent() {}
}
window.TinychatApp.BLL.Tracker = b
})();
</script>
<script>
(function() {
'use strict';
let a = null;
class b {
constructor() {}
static getInstance() {
return null == a && (a = new b), a
}
gotoUrl(c, d) {
if (d) {
let e = window.open(c, '_blank');
e.focus()
} else window.location.href = c
}
get backUrl() {
return window.location.href
}
LiveDirectory() {
this.gotoUrl(b.url_livedirectory(this.backUrl))
}
GiveAGift(c) {
this.gotoUrl(b.url_giveagift(c), !0)
}
EarnCoins() {
this.gotoUrl(b.url_get_coins(this.backUrl), !0)
}
UpgradeSub() {
this.gotoUrl(b.url_upgradenow(this.backUrl), !0)
}
Login() {
this.gotoUrl(b.urlpath_login(this.backUrl))
}
DevNews() {
this.gotoUrl(b.url_devnews(this.backUrl), !0)
}
WebSettings() {
this.gotoUrl(b.url_websettings(this.backUrl), !0)
}
Register() {
this.gotoUrl(b.urlpath_register(this.backUrl))
}
Logout() {
this.gotoUrl(b.urlpath_logout(this.backUrl))
}
PromoteRoom() {
this.gotoUrl(b.urlpath_promoteroom(this.backUrl))
}
GooglePlay() {
this.gotoUrl(b.url_download_android())
}
AppStore() {
this.gotoUrl(b.url_download_iphone())
}
static url_giveagift(c) {
var d = '/gifts/';
return 'string' != typeof c || c.isEmpty() || (d = d + '?to=' + encodeURI(c)), d
}
static url_earncoins() {
return '/offers'
}
static url_upgradenow() {
return '/subscription/intro'
}
static url_livedirectory() {
return '/'
}
static urlpath_register(c) {
return urlpath_login(c)
}
static urlpath_login(c) {
var d = '';
return void 0 != c && (d = '?next=' + encodeURI(c)), '/start/' + d
}
static urlpath_logout() {
return '/logout'
}
static urlpath_promoteroom() {
return '/promote/intro'
}
static url_devnews() {
return 'https://twitter.com/tinychatdev'
}
static url_websettings() {
return '/settings/privacy'
}
static url_download_android() {
return 'https://tinychat.com/download/android'
}
static url_download_iphone() {
return 'https://tinychat.com/download/iphone'
}
static url_get_coins() {
return 'https://tinychat.com/coins/intro'
}
}
window.TinychatApp.BLL.Router = b
})();
</script>
<script>
(function() {
'use strict';
let a = null;
const b = 'tinychat_settings';
class c {
constructor(g) {
this.EventBus = g
}
static getInstance(g) {
return null == a && (a = new c(g)), a
}
isYoutube() {
let g = this.getSettings();
return g.enableYoutube
}
isPrivateMessage() {
let g = this.getSettings();
return g.enablePMs
}
isAcousticEchoCancelation() {
let g = this.getSettings();
return g.enableAcousticEchoCancelation
}
switchPrivatemessaging(g) {
let h = this.getSettings();
h.enablePMs = g, this.saveSettings(h)
}
switchYoutube(g) {
let h = this.getSettings();
h.enableYoutube = g, this.saveSettings(h)
}
switchSound(g) {
let h = this.getSettings();
h.enableSound = g, this.saveSettings(h)
}
switchConfirmBan(g) {
let h = this.getSettings();
h.с onfirmBans = g, this.saveSettings(h)
}
switchAcousticEchoCancelation(g) {
let h = this.getSettings();
h.enableAcousticEchoCancelation = g, this.saveSettings(h)
}
switchRememberVolume(g) {
let h = this.getSettings();
h.rememberVolume = g, this.saveSettings(h)
}
changeNickname(g) {
let h = this.getSettings();
h.nickname = g, this.saveSettings(h)
}
getSettings() {
var g = this._get(b);
try {
g = Object.assign(new TinychatApp.DAL.SettingsEntity, JSON.parse(g))
} catch (h) {}
return (void 0 == g || 'object' != typeof g) && (g = new TinychatApp.DAL.SettingsEntity), g
}
saveSettings(g) {
if ('object' == typeof g) {
let h = this.getSettings();
this._set(b, JSON.stringify(g));
let i = this.getSettings();
if (!h.equals(i)) {
let j = new f(i);
this.EventBus.broadcast(f.ID, j)
}
}
}
_set(g, h) {
'undefined' == typeof Storage || (localStorage[g] = h)
}
_get(g, h) {
if ('undefined' == typeof Storage) return h;
var i = localStorage[g];
return void 0 === i && (i = h), i
}
_remove(g) {
localStorage.removeItem(g)
}
}
const d = 'SettingsChangedEvent_' + Math.Guid.newGuid();
class f {
static get ID() {
return d
}
constructor(g) {
return this.settingsEntity = g, this
}
}
window.TinychatApp.BLL.SettingsFeature = c, window.TinychatApp.BLL.SettingsChangedEvent = f
})();
</script>
<script>
(function() {
'use strict';
window.TinychatApp.BLL.SoundPlayer = class {
static playGift(b) {
let c = new Audio(window.rootDir + '/sound/magic.mp3');
c.volume = b, c.play()
}
static playMessage(b) {
let c = new Audio(window.rootDir + '/sound/pop.mp3');
c.volume = b, c.play()
}
}
})();
</script>
<script>
(function() {
"use strict";
class a {
static get STYPE_FREE() {
return 0
}
static get STYPE_PRO() {
return 10
}
static get STYPE_EXTREME() {
return 20
}
static get STYPE_GOLD() {
return 30
}
static isSubscription(b) {
return b > a.STYPE_FREE
}
static isSubPro(b) {
return b >= a.STYPE_PRO && b < a.STYPE_EXTREME
}
static isSubExtreme(b) {
return b >= a.STYPE_EXTREME && b < a.STYPE_GOLD
}
static isSubGold(b) {
return b >= a.STYPE_GOLD
}
static isSubHighest(b) {
return a.isSubGold(b)
}
static canUseFilters(b) {
return b > a.STYPE_FREE
}
static getCssClass(b) {
var c = 0;
b instanceof TinychatApp.DAL.UserEntity && (c = b.subscriptionType), b instanceof TinychatApp.DAL.UserProfileEntity && (c = b.stype);
var d = "";
return a.isSubPro(c) ? d = "pro" : a.isSubExtreme(c) ? d = "extreme" : a.isSubGold(c) && (d = "gold"), d
}
}
window.TinychatApp.BLL.User = a
})();
</script>
<script>
(function() {
"use strict";
class c {
constructor(x) {
this.chatroom = x, this.EventBus = x.app.EventBus, this.items = [], this.bannedItems = [], this.ignored = [], this.firstBanlist = !0
}
get app() {
return this.chatroom.app
}
clear() {
this.items = [], this.bannedItems = [], this.ignored = [], this.firstBanlist = !0
}
start(x) {
this.items = x, this.sorting(this.items);
let y = new e(this.items, this.chatroom);
this.EventBus.broadcast(e.ID, y)
}
joined(x) {
this.items.push(x);
this.sorting(this.items);
let z = new g(this.items.indexOf(x), x, this.chatroom);
this.EventBus.broadcast(g.ID, z)
}
quited(x) {
for (var y in this.items) {
var z = this.items[y];
if (z.handle === x) {
this.items.splice(y, 1);
let A = new j(y, z, this.chatroom);
this.EventBus.broadcast(j.ID, A);
break
}
}
}
updateBroadcasting(x, y) {
this.generateUpdateEvent(x, z => {
z.isBroadcasting = y
})
}
updateNickname(x, y) {
this.generateUpdateEvent(x, z => {
z.nickname = y
})
}
generateUpdateEvent(x, y) {
var z = -1,
A = null,
B = -1,
C = null;
if ((Object.keys(this.items).forEach(E => {
let F = this.items[E];
if (F.handle === x) return z = Number.parseInt(E), A = Object.assign(new TinychatApp.DAL.UserEntity, F), C = F, !0
}), null != A) && (y(C), !Object.equals(A, C))) {
this.sorting(this.items), B = this.items.indexOf(C);
let D = new l(z, A, B, C, this);
this.EventBus.broadcast(l.ID, D)
}
}
sorting(x) {
x.sort((y, z) => {
let A = z.subscriptionType - y.subscriptionType || (z.isOperator ? 1 : 0) - (y.isOperator ? 1 : 0) || (z.isBroadcasting ? 1 : 0) - (y.isBroadcasting ? 1 : 0) || z.giftpoints - y.giftpoints || (z.username.localeCompare("") ? 1 : 0) - (y.username.localeCompare("") ? 1 : 0) || y.nickname.toLowerCase().localeCompare(z.nickname.toLowerCase()) || y.handle - z.handle;
return A
})
}
get(x) {
for (var y in this.items) {
var z = this.items[y];
if (z.handle === x) {
return z
}
}
return null
}
getByNickname(x) {
let y = x.toLowerCase();
for (var z in this.items) {
var A = this.items[z];
if (A.nickname.toLowerCase() === y) {
return A
}
}
return null
}
getItems() {
return this.items
}
getBannedItems() {
return this.bannedItems
}
isBanned() {
return !1
}
banIsAllowed(x) {
return !x.isSelf && !x.isOwner && this.chatroom.isOperator()
}
followIsAllowed(x) {
return !x.isSelf && !x.isGuest
}
ignoreIsAllowed(x) {
return !x.isSelf && !this.isIgnored(x)
}
kickIsAllowed(x) {
return !x.isSelf && !x.isOwner && this.chatroom.isOperator()
}
videoForceCloseAllow(x) {
if (this.chatroom.isOwner()) return !x.isSelf;
return !!this.chatroom.isOperator() && !x.isSelf && !x.isOwner && !x.isOperator
}
changenick(x) {
if (x.handle === this.chatroom.self_handle) {
let y = new TinychatApp.BLL.RoomNicknameChangeEvent("", ModalDialogChangeNickname.MODE_CHANGE);
this.EventBus.broadcast(TinychatApp.BLL.RoomNicknameChangeEvent.ID, y)
}
}
abuse(x) {
this.chatroom.Abuse(x)
}
kick(x) {
this.chatroom.Kick(x)
}
ban(x) {
this.chatroom.Ban(x)
}
videoForceClose(x) {
this.chatroom.VideoForceClose(x)
}
unban(x) {
this.app.showToast("unban " + x.handle)
}
isIgnored(x) {
let y = x.isUsername ? x.username : x.nickname;
return -1 < this.ignored.indexOf(y)
}
ignore(x) {
let y = x.isUsername ? x.username : x.nickname;
this.isIgnored(x) || this.ignored.push(y);
let z = new w(x);
this.EventBus.broadcast(w.ID, z), this.app.showToast(x.username + " ignored successfully")
}
unignore(x) {
let y = x.isUsername ? x.username : x.nickname,
z = this.ignored.indexOf(y); - 1 < z && this.ignored.splice(z, 1);
let A = new w(x);
this.EventBus.broadcast(w.ID, A), this.app.showToast(x.username + " unignored")
}
follow(x) {
if (x.isInsta) return void this.app.showToastWarn("Unfortunately, you can't follow insta-room", 4e3);
if (x.isGuest) return void this.app.showToastWarn("User is not signed in to Tinychat", 4e3);
let y = this;
this.app.Follow(x.username, function(z) {
"success" === z ? y.app.showToast("You are now following " + x.nickname) : "already" === z ? y.app.showToast("You are already following " + x.nickname) : "unregistered" === z ? y.app.showToastWarn("You must be logged into a Tinychat account to initiate follow. Please sign in (sign up) and try again", 4e3) : "unknown " == z && y.app.showToastWarn("User is not signed in to Tinychat", 4e3)
}, function() {})
}
unfollow(x) {
this.app.showToast("unfollow " + x.handle)
}
}
const d = "UserlistUpdateallEvent_" + Math.Guid.newGuid();
class e {
static get ID() {
return d
}
constructor(x, y) {
return this.users = x, this.chatroom = y, this
}
}
const f = "UserlistAddUserEvent_" + Math.Guid.newGuid();
class g {
static get ID() {
return f
}
constructor(x, y, z) {
return this.index = x, this.userentity = y, this.chatroom = z, this
}
}
const h = "UserlistRemoveUserEvent_" + Math.Guid.newGuid();
class j {
static get ID() {
return h
}
constructor(x, y, z) {
return this.index = x, this.userentity = y, this.chatroom = z, this
}
}
const k = "UserlistUpdateUserEvent_" + Math.Guid.newGuid();
class l {
static get ID() {
return k
}
constructor(x, y, z, A, B) {
return this.fromIndex = x, this.fromUserEntity = y, this.toIndex = z, this.toUserEntity = A, this.userlist = B, this
}
}
const m = "BanlistUpdateallEvent_" + Math.Guid.newGuid();
class n {
static get ID() {
return m
}
constructor(x) {
return this.chatroom = x, this
}
}
const o = "BanlistAddUserEvent_" + Math.Guid.newGuid();
class p {
static get ID() {
return o
}
constructor(x, y, z) {
return this.index = x, this.userentity = y, this.chatroom = z, this
}
}
const q = "BanlistRemoveUserEvent_" + Math.Guid.newGuid();
class r {
static get ID() {
return q
}
constructor(x, y, z) {
return this.index = x, this.userentity = y, this.chatroom = z, this
}
}
const t = "BanlistUpdateUserEvent_" + Math.Guid.newGuid();
class u {
static get ID() {
return t
}
constructor(x, y, z, A, B) {
return x, y, z, A, B, this.fromIndex = x, this.fromUserentity = y, this.toUserIndex = z, this.toUserEntity = A, this.chatroom = B, this
}
}
const v = "IgnorelistUpdateUserEvent_" + Math.Guid.newGuid();
class w {
static get ID() {
return v
}
constructor(x) {
return this.userentity = x, this
}
}
window.TinychatApp.BLL.Userlist = c, window.TinychatApp.BLL.UserlistUpdateallEvent = e, window.TinychatApp.BLL.UserlistAddUserEvent = g, window.TinychatApp.BLL.UserlistRemoveUserEvent = j, window.TinychatApp.BLL.UserlistUpdateUserEvent = l, window.TinychatApp.BLL.IgnorelistUpdateUserEvent = w
})();
</script>
<script>
(function() {
"use strict";
class a {
constructor(t) {
this.chatroom = t, this.EventBus = t.app.EventBus, this.items = {}, this.items[a.PUBLIC] = [], this.chatlist = [], this.selectedchat = a.PUBLIC, this.EventBus.subscribe(TinychatApp.BLL.UserlistUpdateUserEvent.ID, u => this.onUserlistUpdate(u)), this.EventBus.subscribe(TinychatApp.BLL.UserlistRemoveUserEvent.ID, u => this.onUserlistRemove(u))
}
static get PUBLIC() {
return -1
}
static get MAX() {
return 999
}
static get MAX_INPUT_LEN() {
return 500
}
get userlist() {
return this.chatroom.userlist
}
get settings() {
return this.chatroom.app.settings
}
SendMessage(t, u) {
u.length > a.MAX_INPUT_LEN && console.warn("Message length is limited by " + a.MAX_INPUT_LEN);
let v = this.chatroom.selfUser();
if (t === a.PUBLIC) return this.public_add_unconfirmed(u, v), this.chatroom.SendMessagePublic(u, v), !0;
if (t instanceof TinychatApp.DAL.UserEntity) {
let w = this.userlist.get(t.handle);
return null == w ? (this.system_add(t.handle, "Message has not delivered. User is offline ..."), !1) : (this.private_add_unconfirmed(u, v, t), this.chatroom.SendMessagePrivate(u, v, t), !0)
}
return !1
}
clear() {
this.items = {}, this.items[a.PUBLIC] = [], this.chatlist = [], this.selectedchat = a.PUBLIC
}
isequal(t, u) {
if (t === a.PUBLIC) return t === u;
return !!(t instanceof TinychatApp.DAL.UserEntity) && t.handle === u
}
gift_add(t) {
t.type = TinychatApp.DAL.ChatLogItemEntity.GIFT, t.chatname = a.PUBLIC;
let u = this.getitems(t.chatname);
this.additem(u, t);
let v = this.settings.getSettings();
v.enableSound && window.TinychatApp.BLL.SoundPlayer.playGift(this.chatroom.volume)
}
system_add(t, u) {
t instanceof TinychatApp.DAL.UserEntity && (t = t.handle);
let v = TinychatApp.DAL.ChatLogItemEntity,
w = new v;
w.type = v.SYSTEM, w.user = null, w.message_text = u, w.chatname = t;
let x = this.getitems(w.chatname);
this.additem(x, w)
}
public_add(t) {
if (null != t.user) {
if (null != t.user && t.user.handle === this.chatroom.self_handle) {
let w = new h(t, t.chatname);
return void this.EventBus.broadcast(h.ID, w)
}
t.chatname = a.PUBLIC;
let u = this.getitems(t.chatname);
this.additem(u, t);
let v = this.settings.getSettings();
v.enableSound && 5 >= this.userlist.items.length && window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)
}
}
public_add_unconfirmed(t, u) {
if (null != u) {
let v = TinychatApp.DAL.ChatLogItemEntity,
w = new v;
w.type = v.PUBLIC, w.user = u, w.message_text = t, w.chatname = a.PUBLIC;
let x = this.getitems(w.chatname);
this.additem(x, w);
let y = this.settings.getSettings();
y.enableSound && 5 >= this.userlist.items.length && window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)
}
}
private_add(t) {
if (null != t.user) {
if (null != t.user && t.user.handle === this.chatroom.self_handle) {
let v = new h(t, t.chatname);
return void this.EventBus.broadcast(h.ID, v)
}
var u = this.settings.isPrivateMessage();
if (u && !this.isopenedprivate(t.user) && this.openprivate(t.user, !0), u) {
let v = this.getitems(t.chatname);
this.additem(v, t);
let w = this.settings.getSettings();
w.enableSound && window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)
}
}
}
private_add_unconfirmed(t, u, v) {
if (null != t && null != u && null != v) {
let w = TinychatApp.DAL.ChatLogItemEntity,
x = new w;
x.type = w.PRIVATE, x.user = u, x.chatname = v.handle, x.message_text = t;
let y = this.getitems(x.chatname);
this.additem(y, x);
let z = this.settings.getSettings();
z.enableSound && window.TinychatApp.BLL.SoundPlayer.playMessage(this.chatroom.volume)
}
}
getitems(t) {
let u = this.items[t];
return void 0 == u && (u = [], this.items[t] = u), u
}
additem(t, u) {
if (t.length >= a.MAX) {
let x = t.shift(),
y = new f(0, x, u.chatname);
this.EventBus.broadcast(f.ID, y)
}
var v = t.push(u) - 1;
let w = new c(v, u, u.chatname);
this.EventBus.broadcast(c.ID, w)
}
onUserlistRemove(t) {
let u = this.getopenedprivate(t.userentity);
if (null != u) {
let v = TinychatApp.DAL.UserEntity;
u.isOffline = !0, this.selectedchat instanceof v && this.selectedchat.handle === u.handle && (this.selectedchat = Object.assign(this.selectedchat, u));
let w = this.chatlist.indexOf(u),
A = new o(w, u, w, u);
this.EventBus.broadcast(o.ID, A)
}
}
onUserlistUpdate(t) {
let u = this.getopenedprivate(t.toUserEntity);
if (null != u) {
let v = this.chatlist.indexOf(u),
x = this.chatlist.indexOf(t.toUserEntity),
y = t.toUserEntity,
z = TinychatApp.DAL.UserEntity;
this.selectedchat instanceof z && this.selectedchat.handle === y.handle && (this.selectedchat = Object.assign(this.selectedchat, y));
let A = new o(v, u, x, y);
this.EventBus.broadcast(o.ID, A)
}
}
selectChat(t) {
this.selectedchat = t;
let u = new q(this.selectedchat, this.getitems(this.selectedchat.handle));
this.EventBus.broadcast(q.ID, u)
}
selectPublic(t) {
this.selectedchat = a.PUBLIC;
let u = new q(this.selectedchat, this.getitems(this.selectedchat));
this.EventBus.broadcast(q.ID, u), t instanceof TinychatApp.DAL.UserEntity && this.closeprivate(t)
}
closeChat(t) {
this.selectPublic(t)
}
chatlist() {
return this.chatlist
}
openprivate(t, u) {
let v = this.isopenedprivate(t);
if (v || this.chatlist.push(t), void 0 == u && this.selectChat(t), !v) {
let w = new k(this.chatlist.indexOf(t), t, this.chatroom);
this.EventBus.broadcast(k.ID, w)
}
}
closeprivate(t) {
for (var u in this.chatlist) {
var v = this.chatlist[u];
if (v.handle === t.handle) {
this.chatlist.splice(u, 1);
let w = new m(u, v, this.chatroom);
this.EventBus.broadcast(m.ID, w);
break
}
}
}
getopenedprivate(t) {
var u = null;
for (var v in this.chatlist) {
var w = this.chatlist[v];
if (w.handle === t.handle) {
u = w;
break
}
}
return u
}
isopenedprivate(t) {
var u = !1;
for (var v in this.chatlist) {
var w = this.chatlist[v];
if (w.handle === t.handle) {
u = !0;
break
}
}
return u
}
}
const b = "ChatlogItemAddedEvent_" + Math.Guid.newGuid();
class c {
static get ID() {
return b
}
constructor(t, u, v) {
return this.index = t, this.chatentity = u, this.chatname = v, this
}
}
const d = "ChatlogItemRemovedEvent_" + Math.Guid.newGuid();
class f {
static get ID() {
return d
}
constructor(t, u, v) {
return this.index = t, this.chatentity = u, this.chatname = v, this
}
}
const g = "ChatlogItemSentEvent_" + Math.Guid.newGuid();
class h {
static get ID() {
return g
}
constructor(t, u) {
return this.chatentity = t, this.chatname = u, this
}
}
const j = "ChatlistAddEvent_" + Math.Guid.newGuid();
class k {
static get ID() {
return j
}
constructor(t, u, v) {
return this.index = t, this.userentity = u, this.chatroom = v, this
}
}
const l = "ChatlistRemoveEvent_" + Math.Guid.newGuid();
class m {
static get ID() {
return l
}
constructor(t, u, v) {
return this.index = t, this.userentity = u, this.chatroom = v, this
}
}
const n = "ChatlistUpdateEvent_" + Math.Guid.newGuid();
class o {
static get ID() {
return n
}
constructor(t, u, v, w) {
return this.fromIndex = t, this.fromUserEntity = u, this.toIndex = v, this.toUserEntity = w, this
}
}
const p = "ChatlistSelectedEvent_" + Math.Guid.newGuid();
class q {
static get ID() {
return p
}
constructor(t, u) {
return this.userentity = t, this.chatitems = u, this
}
}
const r = "ChatlistUIUpdateEvent_" + Math.Guid.newGuid();
class s {
static get ID() {
return r
}
constructor() {
return this
}
}
window.TinychatApp.BLL.Chatlog = a, window.TinychatApp.BLL.ChatlogItemAddedEvent = c, window.TinychatApp.BLL.ChatlogItemRemovedEvent = f, window.TinychatApp.BLL.ChatlogItemSentEvent = h, window.TinychatApp.BLL.ChatlistAddEvent = k, window.TinychatApp.BLL.ChatlistRemoveEvent = m, window.TinychatApp.BLL.ChatlistUpdateEvent = o, window.TinychatApp.BLL.ChatlistSelectedEvent = q, window.TinychatApp.BLL.ChatlistUIUpdateEvent = s
})();
</script>
<script>
(function() {
'use strict';
class d {
constructor(p, q, r) {
this.videolist = p, this.userentity = q, this.mediastream = r, this.progress = !1, this.large = !1, this.hidden = !1, this.mute = !1, this.volume = 1, this.audiolevel = 0, this.featured = !1;
try {
let s = this,
t = r.getAudioTracks();
if (!Array.isArray(t) || 1 > t.length) return;
this.soundMeter = new SoundMeter(this.videolist.audioContext), this.soundMeter.connectToSource(this.mediastream, u => {
return u ? void console.warn(u) : void(s.soundMeterTimer = setInterval(function() {
let w = s.audiolevel;
if (s.audiolevel = Math.ceil(10 * s.soundMeter.instant.toFixed(2)), 10 < s.audiolevel && (s.audiolevel = 10), w != s.audiolevel) {
let x = s.videolist.getitems().indexOf(s);
if (-1 < x) {
let y = new k(g.Update, s, x);
s.videolist.EventBus.broadcast(k.ID, y)
}
}
}, 200))
})
} catch (s) {
console.warn('Web Audio API not supported.', s)
}
}
Dispose() {
this.soundMeter && this.soundMeter.stop(), this.soundMeterTimer && clearInterval(this.soundMeterTimer)
}
get userlist() {
return this.videolist.chatroom.userlist
}
get handle() {
return this.userentity.handle
}
get nickname() {
return this.userentity.nickname
}
get muted() {
return this.mute || this.userentity.isSelf
}
get achivementUrl() {
return this.userentity.achivementUrl || ''
}
get videoForceCloseAllow() {
return this.videolist.chatroom.userlist.videoForceCloseAllow(this.userentity)
}
get ignoreAllow() {
return this.videolist.chatroom.userlist.ignoreIsAllowed(this.userentity)
}
get unignoreAllow() {
return this.videolist.chatroom.userlist.isIgnored(this.userentity)
}
get followAllow() {
return this.videolist.chatroom.userlist.followIsAllowed(this.userentity)
}
get openprivateAllow() {
return !this.userentity.isSelf && !this.videolist.chatroom.selfUser().isGuest
}
get profileAllow() {
return !0
}
get abuseAllow() {
return !this.userentity.isSelf
}
get banAllow() {
return this.userlist.banIsAllowed(this.userentity)
}
get kickAllow() {
return this.userlist.kickIsAllowed(this.userentity)
}
get filtersAllow() {
return this.userentity.isSelf
}
get giveagiftAllow() {
return !this.userentity.isSelf
}
get upgradeAllow() {
return this.userentity.isSelf
}
get volumeControlAllow() {
return !this.userentity.isSelf
}
}
const g = {
Add: 'Add',
AddWaiting: 'AddWaiting',
AddPending: 'AddPending',
AddModeration: 'AddModeration',
Remove: 'Remove',
RemovePendingWaiting: 'RemovePendingWaiting',
RemoveModeration: 'RemoveModeration',
Update: 'Update',
UpdateModeration: 'UpdateModeration'
},
h = 'VideolistEvent_' + Math.Guid.newGuid();
class k {
static get ID() {
return h
}
constructor(p, q, r) {
return this.action = p, this.videolistitem = q, this.index = r, this
}
}
const l = 'VideolistClear_' + Math.Guid.newGuid();
class m {
static get ID() {
return l
}
constructor(p) {
return this.chatroom = p, this
}
}
const n = 'VideolistAcceptedEvent_' + Math.Guid.newGuid();
class o {
static get ID() {
return n
}
constructor(p, q) {
return this.userId = p, this.chatroom = q, this
}
}
window.TinychatApp.BLL.Videolist = class {
constructor(p) {
this.chatroom = p, this.EventBus = p.app.EventBus, this.items = [], this.moderationitems = [], this.selfItem, this.audioContext = new AudioContext, this.EventBus.subscribe(TinychatApp.BLL.UserlistRemoveUserEvent.ID, q => this.onUserlistRemoved(q)), this.EventBus.subscribe(TinychatApp.BLL.UserlistUpdateUserEvent.ID, q => this.onUserlistUpdate(q))
}
getitems() {
return this.items
}
getModerationItems() {
return this.moderationitems
}
count() {
return this.items.length
}
clear() {
this.items = [], this.EventBus.broadcast(m.ID, new m(this.chatroom))
}
switchPTT(p) {
let q = this._getSelfMediaStream();
null != q && this._muteMediaStream(q, !p)
}
setVolume(p, q) {
q == void 0 ? (this.chatroom.volume = p, Object.keys(this.items).forEach(r => {
let s = this.items[r];
this._volMediaStream(s.mediastream, p)
})) : this._volMediaStream(q.mediastream, p)
}
toggleFeatured(p) {
let q = this.items.indexOf(p);
if (!(0 > q)) {
p.featured = !p.featured;
let r = new k(g.Update, p, q);
this.EventBus.broadcast(k.ID, r)
}
}
toggleSizeVW2Normal(p) {
Object.keys(this.items).forEach(q => {
let r = this.items[q];
if (r.large && (p == void 0 || r.userentity.handle != p.handle)) {
r.large = !1;
let s = new k(g.Update, r, q);
this.EventBus.broadcast(k.ID, s)
}
})
}
toggleSizeVW(p) {
p.large = !p.large, p.large && this.toggleSizeVW2Normal(p);
let q = this.items.indexOf(p);
if (0 <= q) {
let r = new k(g.Update, p, q);
this.EventBus.broadcast(k.ID, r)
}
}
toggleHiddenVW(p) {
let q = this.items.indexOf(p);
if (!(0 > q)) {
p.hidden = !p.hidden, this._pauseMediaStream(p.mediastream, p.hidden), p.hidden || this._muteMediaStream(p.mediastream, p.mute);
let r = new k(g.Update, p, q);
this.EventBus.broadcast(k.ID, r)
}
}
toggleMuteVW(p) {
let q = this.items.indexOf(p);
if (!(0 > q)) {
p.mute = !p.mute, p.hidden || this.switchMute(p.mute, p);
let r = new k(g.Update, p, q);
this.EventBus.broadcast(k.ID, r)
}
}
switchMicMute(p) {
this.chatroom.micmuted = void 0 == p ? !this.chatroom.micmuted : p;
let q = this._getSelfMediaStream();
return null != q && this._muteMediaStream(q, this.chatroom.micmuted), this.chatroom.micmuted
}
switchMute(p, q) {
let r = (s, t) => {
this._muteMediaStream(s.mediastream, s.mute);
let u = new k(g.Update, s, t);
this.EventBus.broadcast(k.ID, u)
};
if (void 0 == q) return this.chatroom.mute = void 0 == p ? !this.chatroom.mute : p, Object.keys(this.items).forEach(s => {
let t = this.items[s];
t.mute != this.chatroom.mute && t.userentity.handle != this.chatroom.self_handle && (t.mute = this.chatroom.mute, r(t, s))
}), this.chatroom.mute;
let s = q,
t = this.items.indexOf(s);
s.mute = p, r(s, t)
}
CanMakeLargeVideo() {
let p = this.chatroom.selfUser().subscriptionType,
q = chatroom.app.IsLoggedIn() && TinychatApp.BLL.User.isSubscription(p);
return q
}
AddingVideoSelf() {}
RemovingVideoSelf(p) {
if (this.chatroom.self_handle == p) {
this.selfItem = null;
let q = new k(g.RemovePendingWaiting, this.selfItem, 0);
this.EventBus.broadcast(k.ID, q)
}
}
AddVideoSelf(p, q) {
let r = this.chatroom.userlist.get(p),
s = new d(this, r, q);
(this.chatroom.roomSettings.pushtotalk || this.chatroom.micmuted) && this._muteMediaStream(s.mediastream, !0), this._volMediaStream(s.mediastream, this.chatroom.volume), this.selfItem = s
}
PublishedVideoSelf() {
this.items.push(this.selfItem);
let p = new k(g.Add, this.selfItem, this.items.indexOf(this.selfItem));
this.EventBus.broadcast(k.ID, p), this.selfItem = null
}
PendingModerationVideoSelf() {
let p = new k(g.AddPending, this.selfItem, 0);
this.EventBus.broadcast(k.ID, p)
}
WaitingSlotVideoSelf() {
let p = new k(g.AddWaiting, this.selfItem, 0);
this.EventBus.broadcast(k.ID, p)
}
RemoveVideoSelf(p) {
this.RemovingVideoSelf(p), this.RemoveVideoRemote(p)
}
AcceptedSelfVideoByModerator(p) {
this.EventBus.broadcast(VideoModeratorAcceptedEvent.ID, new VideoModeratorAcceptedEvent(p, this.chatroom))
}
AddVideoRemote(p, q) {
let r = this.chatroom.userlist.get(p),
s = new d(this, r, q);
if (this._muteMediaStream(s.mediastream, this.chatroom.mute), this._volMediaStream(s.mediastream, this.chatroom.volume), r.needToUpprove) {
this.moderationitems.push(s);
let t = new k(g.AddModeration, s, this.moderationitems.indexOf(s));
this.EventBus.broadcast(k.ID, t)
} else {
this.items.push(s);
let t = new k(g.Add, s, this.items.indexOf(s));
this.EventBus.broadcast(k.ID, t)
}
}
onUserlistRemoved(p) {
this.RemoveVideoRemote(p.userentity.handle)
}
onUserlistUpdate(p) {
let q = this.items.find(r => {
return !(r.userentity.handle !== p.toUserEntity.handle)
});
if (q instanceof d) {
q.userentity = p.toUserEntity;
let r = this.items.indexOf(q),
s = new k(g.Update, q, r);
this.EventBus.broadcast(k.ID, s)
}
}
RemoveVideoRemote(p) {
let q = null,
r = -1;
if (Object.keys(this.items).forEach(s => {
let t = this.items[s];
if (t.userentity.handle === p) return q = t, r = Number.parseInt(s), !0
}), null != q) {
this.items.splice(r, 1), q.Dispose();
let s = new k(g.Remove, q, r);
this.EventBus.broadcast(k.ID, s)
} else {
let s = null,
t = -1;
if (Object.keys(this.moderationitems).forEach(u => {
let w = this.moderationitems[u];
if (w.userentity.handle === p) return s = w, t = Number.parseInt(u), !0
}), null != s) {
this.moderationitems.splice(t, 1), s.Dispose();
let u = new k(g.RemoveModeration, s, t);
this.EventBus.broadcast(k.ID, u)
}
}
}
_muteMediaStream(p, q) {
let r = p.getAudioTracks();
!Array.isArray(r) || 1 > r.length || Object.keys(r).forEach(s => {
r[s].enabled = !q
})
}
_pauseMediaStream(p, q) {
let r = p.getAudioTracks();
if (Array.isArray(r) && !(1 > r.length)) {
Object.keys(r).forEach(t => {
r[t].enabled = !q
});
let s = p.getVideoTracks();
!Array.isArray(s) || 1 > s.length || Object.keys(s).forEach(t => {
s[t].enabled = !q
})
}
}
_volMediaStream(p, q) {
let r = p.getAudioTracks();
!Array.isArray(r) || 1 > r.length || Object.keys(r).forEach(s => {
r[s].volume = q, console.log(r[s].kind + ' - ' + r[s].readyState + ', remote:' + r[s].remote + ' - ' + r[s].id + ' -> vol: ' + r[s].volume)
})
}
_getSelfMediaStream() {
let p = this.items.find(q => {
return !(q.userentity.handle != this.chatroom.self_handle)
});
return p ? p.mediastream : null
}
}, window.TinychatApp.BLL.VideolistItem = d, window.TinychatApp.BLL.VideolistAction = g, window.TinychatApp.BLL.VideolistEvent = k, window.TinychatApp.BLL.VideolistClear = m, window.TinychatApp.BLL.VideolistAcceptedEvent = o
})();
</script>
<script>
(function() {
"use strict";
const e = window.TinychatApp.BLL.PacketWorker;
class t {
static get url_tc_server() {
return "wss://wss.tinychat.com:443"
}
constructor(E, T, B, R) {
this.app = E, this.tc_token = T, this.roomname = B, this.nickname = R, this.EventBus = E.EventBus, this.roomSettings = null, this._enterroomresult = null, this._userlist = null, this._chatlog = null, this._videolist = null, this.reqid = 0, this.wsHandle = null, this.queue = {}, this.mediaConnections = {
local: null,
remote: {}
}, this.mediaStream = null, this.mediaStreamVideo = null, this.mediaStreamCanvas = null, this.mediaStreamFilter = window.TinychatApp.BLL.VideoFilters.getAll[0].name, this.mediaStreamOrigin = null, this.mediaLastState = null, this.mediaLastConstraints = null;
let I = this;
this.EventBus.subscribe(TinychatApp.BLL.BroadcastProgressEvent.ID, function(A) {
I.mediaLastState = A.stage
}), this.banlist = null, this.youtubelist = [], this.youtubelist_random = !1, this.youtubelist_repeat = !1, this.fullscreen = !1, this.mute = !1, this.volume = 1, this.micmuted = !1, this.packetWorker = new e(this), this.wsReset()
}
wsReset() {
for (var E in null != this.mediaStream && this.mediaStream.stop(), null != this.mediaConnections.local && this.mediaConnections.local.Close(), this.mediaConnections.remote) {
var T = this.mediaConnections.remote[E];
T.Close()
}
this.roomSettings = new TinychatApp.DAL.RoomSettingsEntity, this._enterroomresult = null, null != this._userlist && this.userlist.clear(), null != this._videolist && this._videolist.clear(), this.mediaConnections = {
local: null,
remote: {}
}, this.streamReset(), this.fullscreen = !1, this.mute = !1, this.packetWorker.reset()
}
streamReset() {
null != this.mediaStream && this.mediaStream.stop(), this.mediaStream = null, this.mediaStreamCanvas = null, this.mediaStreamVideo = null, null != this.mediaStreamOrigin && this.mediaStreamOrigin.stop(), this.mediaStreamOrigin = null
}
get settings() {
return this.app.settings
}
get enterroomresult() {
return null == this._enterroomresult && (this._enterroomresult = new TinychatApp.DAL.EnterRoomResultEntity), this._enterroomresult
}
get userlist() {
return null == this._userlist && (this._userlist = new TinychatApp.BLL.Userlist(this)), this._userlist
}
get chatlog() {
return null == this._chatlog && (this._chatlog = new TinychatApp.BLL.Chatlog(this)), this._chatlog
}
get videolist() {
return null == this._videolist && (this._videolist = new TinychatApp.BLL.Videolist(this)), this._videolist
}
get _tracker() {
return TinychatApp.BLL.Tracker.getInstance()
}
get _router() {
return TinychatApp.BLL.Router.getInstance()
}
get _api() {
return WebAPI.getInstance()
}
get _cookie() {
return CookieUtils
}
get self_handle() {
let E = this.enterroomresult;
return null == E || null == E.selfuser ? -1 : E.selfuser.handle
}
get url() {
return TinychatApp.url + "/" + this.chatroomName()
}
get id__miconly() {
return "__miconly"
}
getRoomAvatarUrl() {
return this.app.GetAvatarUrl(this.chatroomName())
}
selfUser() {
return this.enterroomresult.selfuser
}
chatroomName() {
let E = TinychatApp.DAL.RoomSettingsEntity,
T = this.roomSettings instanceof E && this.roomSettings.name.isNotEmpty() ? this.roomSettings.name : this.roomname;
return T
}
updateSelfUser(E) {
E.isSelf = !0, this.enterroomresult.selfuser = E
}
updateRoomSettings(E) {
this.roomSettings = E;
let T = new o(this.roomSettings);
this.EventBus.broadcast(o.ID, T)
}
isLurker() {
return null != this.enterroomresult.selfuser && this.enterroomresult.selfuser.isLurker
}
isOperator() {
return null != this.enterroomresult.selfuser && this.enterroomresult.selfuser.isOperator
}
isOwner() {
return null != this.enterroomresult.selfuser && this.enterroomresult.selfuser.isOwner
}
gotoGift(E) {
this.app.GiveAGift(E.username)
}
gotoLiveDirectory() {
this.app.LiveDirectory()
}
Reconnect() {
clearInterval(this.reconnect_timer), null != this.wsHandle && this.wsReset(), this.Connect(!0)
}
Connect(E) {
let T = this;
this.app.isDebug() ? this.packetWorker.connect(E) : (console.log("Chatroom.Connecting: reinvoke tc token ..."), this._api.wsj({
src: TinychatApp.url_api_room_token(T.chatroomName())
}).then(B => {
T.tc_token = B.result, T.packetWorker.connect(E)
}).catch(B => {
console.error(B), T.app.showToastWarn("Some unknown server error occurred"), T.packetWorker.connect(E)
}))
}
ConnectSolveCaptcha(E) {
this.packetWorker.send(this.tcPkt_ConnectCaptcha(E, this.onRoomConnectCallback))
}
ConnectSolveSkip() {
this.packetWorker.send(this.tcPkt_ConnectCaptcha("", this.onRoomConnectCallback))
}
ConnectSolveTimeout() {
this.packetWorker.send(this.tcPkt_ConnectCaptcha("", this.onRoomConnectCallback))
}
ConnectPassword(E) {
this.packetWorker.send(this.tcPkt_ConnectPassword(E, this.onRoomConnectCallback))
}
NicknameChange(E, T) {
this.packetWorker.send(this.tcPkt_NickChange(E, this.onNicknameChanged)), T && this.app.settings.changeNickname(E)
}
NicknameIsValid(E) {
return this.app.IsValidNickname(E)
}
NicknameIsInUseFast(E) {
if ("string" != typeof E || E.isEmpty()) return !1;
let T = this.userlist.getByNickname(E);
return null != T
}
BroadcastSwitch(E) {
E ? this.BroadcastStop() : this.BroadcastStart()
}
IsLastCam(E, T) {
let B = !0;
for (let R in E) {
let I = E[R];
"videoinput" === I.kind && (B = I.deviceId === T.deviceId)
}
return B
}
BroadcastStart(E) {
let T = this,
B = this.settings,
R = this.settings.getSettings();
if (null === R.video) return void this.app.MediaSettings(() => this.BroadcastStart());
this.videolist.AddingVideoSelf(this.self_handle);
var I = {};
if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) I.audio = !0, I.video = {
width: 320,
height: 240
};
else {
let A = !1;
navigator.mediaDevices.enumerateDevices().then(W => {
let D = !1;
for (let U in W) {
let G = W[U];
"videoinput" === G.kind && (console.log(G), I.video === void 0 && (I.video = {
width: 320,
height: 240,
frameRate: {
ideal: 15,
max: 30
}
}), D && (R.video = G, D = !1, this.settings.saveSettings(R), A = T.IsLastCam(W, G)), null === R.video && (R.video = G, this.settings.saveSettings(R)), null != R.video && "object" == typeof R.video && R.video.deviceId == G.deviceId && R.video.deviceId !== E ? I.video.deviceId = {
exact: R.video.deviceId
} : R.video.deviceId === E && (D = !0)), "audioinput" === G.kind && (console.log(G), I.audio === void 0 && (I.audio = {}), null != R.audio && "object" == typeof R.audio && R.audio.deviceId == G.deviceId && (I.audio.deviceId = {
exact: R.audio.deviceId
}))
}
null != I.video && null != R.video && R.video.deviceId == T.id__miconly && delete I.video;
let M = navigator.mediaDevices.getSupportedConstraints();
for (let U in M) M.hasOwnProperty(U) && "echoCancellation" == U && I.audio && (I.audio[U] = B.isAcousticEchoCancelation());
if (!(I.audio || I.video)) T.onMediaFailedCallback(new Error("No media devices to start broadcast."));
else if ("https:" === location.protocol || this.app.isDebug()) {
console.log("Broadcast: Media ...");
let U = new y(y.MEDIA_START);
this.EventBus.broadcast(y.ID, U), console.log(I), T.mediaLastConstraints = I, navigator.mediaDevices.getUserMedia(I).then(G => {
T.onMediaSuccessCallback(G)
}).catch(G => {
A ? T.onMediaFailedCallback(G) : this.BroadcastStart(I.video.deviceId.exact)
})
} else T.onMediaFailedCallback(new Error("Use https:// protocol for safe open media devices."))
}).catch(W => {
console.log(W)
})
}
}
BroadcastStop() {
console.log("Broadcast: Media ... stop");
let E = new y(y.MEDIA_STOPING);
this.EventBus.broadcast(y.ID, E);
let T = this.tcPkt_StreamClose(this.self_handle, this.onStreamClosed);
this.packetWorker.send(T)
}
Youtube(E) {
let T = this.tcPkt_Youtube(E.cmd, E);
this.packetWorker.send(T)
}
YoutubePlaylistLoad(E) {
let T = this,
B = this.tcPkt_YoutubePlaylist(R => {
T.onYoutubePlaylist(R), E && E()
});
this.packetWorker.send(B)
}
YoutubePlaylistMode(E, T, B) {
let R = this,
I = this.tcPkt_YoutubePlaylistMode(E, T, A => {
let W = A.success,
D = A.reason;
!0 === W && B && B()
});
this.packetWorker.send(I)
}
YoutubePlaylistAdd(E, T) {
let B = this,
R = this.tcPkt_YoutubePlaylistAdd(E, I => {
let A = I.success,
W = I.reason;
!0 === A && T && T()
});
this.packetWorker.send(R)
}
YoutubePlaylistRemove(E, T) {
let B = this,
R = this.tcPkt_YoutubePlaylistRemove(E, I => {
let A = I.success,
W = I.reason;
!0 === A && T && T()
});
this.packetWorker.send(R)
}
YoutubePlaylistClear(E) {
let T = this,
B = this.tcPkt_YoutubePlaylistClear(R => {
let I = R.success,
A = R.reason;
!0 === I && E && E()
});
this.packetWorker.send(B)
}
SendMessagePublic(E) {
this.packetWorker.send(this.tcPkt_Msg(E, this.onSendMessagePublicCallback))
}
SendMessagePrivate(E, T, B) {
this.packetWorker.send(this.tcPkt_Msg_Private(E, B.handle, this.onSendMessagePrivateCallback))
}
Kick(E) {
this.packetWorker.send(this.tcPkt_Kick(E.handle))
}
Abuse(E) {
this.app.showToast("[" + E.nickname + "] was reported"), this.packetWorker.send(this.tcPkt_Abuse(E.handle))
}
Ban(E) {
this.app.showToast("[" + E.nickname + "] has been banned"), this.packetWorker.send(this.tcPkt_Ban(E.handle, this.onBanCallback))
}
Unban(E) {
this.packetWorker.send(this.tcPkt_Unban(E.id, this.onUnbanCallback))
}
Banlist(E) {
let T = this;
this.packetWorker.send(this.tcPkt_Banlist(B => {
T.onBanlistCallback(B), E(Array.isArray(T.banlist) ? T.banlist : [])
}))
}
VideoForceClose(E) {
this.packetWorker.send(this.tcPkt_VideoForceClose(E.handle, this.onVideoForceCloseCallback))
}
VideoAllow(E) {
this.packetWorker.send(this.tcPkt_VideoAllow(E.handle))
}
switchFullscreen(E) {
return this.fullscreen = void 0 == E ? !this.fullscreen : E, this.fullscreen
}
takeSnapshot() {
return !0
}
tcPkt_Connect(E) {
var T = this.packetWorker.wsCreatePacket("join", E);
return T.useragent = this.app.useragent, T.token = this.tc_token, T.room = this.roomname, T.nick = this.nickname, T
}
tcPkt_Pong() {
var E = this.packetWorker.wsCreatePacket("pong");
return E
}
tcPkt_GetICE(E) {
var T = this.packetWorker.wsCreatePacket("getice", E);
return T
}
tcPkt_Trickle(E, T) {
var B = this.packetWorker.wsCreatePacket("trickle");
return B.handle = E, B.candidate = T, B
}
tcPkt_SDP(E, T, B, R) {
var I = this.packetWorker.wsCreatePacket("sdp", R);
return I.type = E, I.sdp = T, I.handle = B, I
}
tcPkt_Subscribe(E, T) {
var B = this.packetWorker.wsCreatePacket("subscribe", T);
return B.handle = E, B
}
tcPkt_Msg(E, T) {
var B = this.packetWorker.wsCreatePacket("msg", T);
return B.text = this.tcPktPrepareText(E), B
}
tcPkt_Msg_Private(E, T, B) {
var R = this.packetWorker.wsCreatePacket("pvtmsg", B);
return R.text = this.tcPktPrepareText(E), R.handle = T, R
}
tcPkt_Kick(E, T) {
var B = this.packetWorker.wsCreatePacket("kick", T);
return B.handle = E, B
}
tcPkt_Ban(E, T) {
var B = this.packetWorker.wsCreatePacket("ban", T);
return B.handle = E, B
}
tcPkt_Unban(E, T) {
var B = this.packetWorker.wsCreatePacket("unban", T);
return B.id = E, B
}
tcPkt_Banlist(E) {
var T = this.packetWorker.wsCreatePacket("banlist", E);
return T
}
tcPkt_VideoForceClose(E, T) {
var B = this.packetWorker.wsCreatePacket("stream_moder_close", T);
return B.handle = E, B
}
tcPkt_VideoAllow(E) {
var T = this.packetWorker.wsCreatePacket("stream_moder_allow");
return T.handle = E, T
}
tcPkt_Youtube(E, T, B) {
var R = this.packetWorker.wsCreatePacket(E, B);
return R.item = {
id: T.id,
duration: T.duration,
offset: T.offset
}, void 0 !== T.title && (R.item.title = T.title), !0 === T.seekByUser && (R.item.seek = !0), R.item.playlist = T.playlist, R
}
tcPkt_YoutubePlaylist(E) {
var T = this.packetWorker.wsCreatePacket("yut_playlist", E);
return T
}
tcPkt_YoutubePlaylistMode(E, T, B) {
var R = this.packetWorker.wsCreatePacket("yut_playlist_mode", B);
return R.mode = {
random: E,
repeat: T
}, R
}
tcPkt_YoutubePlaylistAdd(E, T) {
var B = this.packetWorker.wsCreatePacket("yut_playlist_add", T);
return B.item = {
id: E.id,
duration: E.duration,
title: E.title,
image: E.imgurl
}, B
}
tcPkt_YoutubePlaylistRemove(E, T) {
var B = this.packetWorker.wsCreatePacket("yut_playlist_remove", T);
return B.item = {
id: E.id,
duration: E.duration,
title: E.title,
image: E.imgurl
}, B
}
tcPkt_YoutubePlaylistClear(E) {
var T = this.packetWorker.wsCreatePacket("yut_playlist_clear", E);
return T
}
tcPkt_Abuse(E, T) {
var B = this.packetWorker.wsCreatePacket("abuse", T);
return B.handle = E, B
}
tcPkt_ConnectCaptcha(E, T) {
var B = this.packetWorker.wsCreatePacket("captcha", T);
return B.token = E, B
}
tcPkt_ConnectPassword(E, T) {
var B = this.packetWorker.wsCreatePacket("password", T);
return B.password = E, B
}
tcPkt_NickChange(E, T) {
var B = this.packetWorker.wsCreatePacket("nick", T);
return B.nick = E, B
}
tcPkt_StreamClose(E, T) {
var B = this.packetWorker.wsCreatePacket("stream_close", T);
return B.handle = E, B
}
tcPktPrepareText(E) {
return E
}
tcPkt_UserParse(E) {
let T = new TinychatApp.DAL.UserEntity;
return T.path = E.handle || 0, T.nickname = E.nick || "", T.username = E.username || "", T.subscriptionType = E.subscription || 0, T.avatarUrl = E.avatar || "", T.giftpoints = E.giftpoints || 0, T.achivementUrl = E.achievement_url || "", T.isLurker = E.lurker || !1, T.isOwner = E.owner || !1, T.isOperator = E.mod || !1, T.isFeatured = E.featured || !1, T
}
tcPkt_RoomSettingsParse(E) {
let T = new TinychatApp.DAL.RoomSettingsEntity;
T.type = E.type || "", T.name = E.name || "", T.topic = E.topic || "", T.subtype = E.subscription || 0, T.giftpoints = E.giftpoints || 0, T.pushtotalk = "boolean" == typeof E.pushtotalk ? E.pushtotalk : E.pushtotalk || !1;
let B = E.recent_gifts,
R = [];
return Array.isArray(B) && Object.keys(B).forEach(I => {
let A = new TinychatApp.DAL.GiftEntity;
A.giftUrl = B[I], R.push(A)
}), T.recent_gifts = R, T.biography = E.biography || "", T.location = E.location || "", T.website = E.website || "", T.avatar = E.avatar || "", T
}
tcPkt_MsgParse(E) {
var T = new TinychatApp.DAL.ChatLogItemEntity;
T.message_text = E.text || "";
let B = E.handle || 0;
return T.user = this.userlist.get(B), T
}
tcPkt_GiftParse(E) {
var T = new TinychatApp.DAL.GiftEntity;
let B = E.gift,
R = B.anon;
if (T.giftComment = B.comment, T.giftExt = B.extensions, T.giftName = B.name, T.giftStore = B.store_url, T.giftUrl = B.url, !R) {
let A = E.from;
T.fromUsername = A.name, T.fromUrl = A.url
} else T.fromUsername = "", T.fromUrl = "";
let I = E.to;
return T.toUsername = I.name, T.toUrl = I.url, T
}
tcPkt_BanlistItemParse(E) {
var T = new TinychatApp.DAL.BanlistItemEntity;
return T.id = E.id || "", T.username = E.username || "", T.nickname = E.nick || "", T.reason = E.reason || "", T.moderator = E.moderator || "", T
}
tcPkt_TcCallbackCheck(E, T) {
return !(E.tc !== T) || (console.error("Unexpected pkt: " + JSON.stringify(E)), console.error("Protocol Callback error:" + T + " ~ " + E.tc), !1)
}
_stopRemoteMediaConnection(E) {
this.mediaConnections.remote[E] !== void 0 && (this.mediaConnections.remote[E].Close(), delete this.mediaConnections.remote[E])
}
onPing() {
this.packetWorker.send(this.tcPkt_Pong())
}
onRoomUserlist(E) {
var T = E.users,
B = [];
for (var R in T) {
let I = T[R],
A = this.tcPkt_UserParse(I);
A.handle == this.self_handle && (A.isSelf = !0), B.push(A)
}
this.userlist.start(B)
}
onRoomUserJoin(E) {
var T = this.tcPkt_UserParse(E);
T.handle == this.self_handle && (T.isSelf = !0), this.userlist.joined(T)
}
onRoomSettings(E) {
if (this.tcPkt_TcCallbackCheck(E, "room_settings")) {
var T = this.tcPkt_RoomSettingsParse(E.room);
this.updateRoomSettings(T)
}
}
onRoomUserQuit(E) {
let T = E.handle;
this._stopRemoteMediaConnection(T), this.userlist.quited(T)
}
onRoomPublish(E) {
let T = E.handle;
if (this.userlist.updateBroadcasting(T, !0), T === this.self_handle) return void this.videolist.PublishedVideoSelf();
let B = this.tcPkt_Subscribe(T, this.onRemoteConnectionReadyCallback);
this.packetWorker.send(B)
}
onRoomPublishReconnect(E) {
if (E !== this.self_handle) {
let T = this.userlist.get(E);
if (null !== T && (T.isBroadcasting || T.needToUpprove)) {
let B = this.tcPkt_Subscribe(E, this.onRemoteConnectionReadyCallback);
this.packetWorker.send(B)
}
}
}
onRoomUnPublish(E) {
let T = E.handle;
this._stopRemoteMediaConnection(T), this.userlist.updateBroadcasting(T, !1)
}
onStreamConnected(E) {
!this.tcPkt_TcCallbackCheck(E, "stream_connected")
}
onPendingModeration(E) {
let T = E.handle;
if (T === this.self_handle) return void this.videolist.PendingModerationVideoSelf();
const B = this.userlist.get(T);
B.needToUpprove = !0;
var R = this.tcPkt_Subscribe(T, this.onRemoteConnectionReadyCallback);
this.packetWorker.send(R)
}
onWaitingSlot(E) {
let T = E.handle;
T === this.self_handle && this.videolist.WaitingSlotVideoSelf()
}
onStreamClosed(E) {
if (this.tcPkt_TcCallbackCheck(E, "stream_closed")) {
let T = E.publish,
B = E.handle;
this.self_handle == B ? (this._selfMediaStreamStop(B, "Broadcast closed due server request"), void 0 !== E.reason && null !== E.reason && this._selfShowReason(E.reason)) : (this._stopRemoteMediaConnection(B), this.onRoomPublishReconnect(B))
}
}
onStreamModerAllow(E) {
if (this.tcPkt_TcCallbackCheck(E, "stream_moder_allow")) {
let T = E.handle,
B = E.allowed_by;
this._stopRemoteMediaConnection(T);
let R = this.userlist.get(T),
I = this.userlist.get(B);
R.needToUpprove = !1, null !== I && this.app.showToast(`[${R.nickname}]'s broadcast allowed by [${I.nickname}]`)
}
}
_selfMediaStreamStop(E, T) {
if (null != this.mediaConnections.local) {
if (null != this.mediaStream && this.mediaStream.active && this.mediaLastState !== y.MEDIA_STOPING) {
this.mediaStream.stop(), null != this.mediaStreamOrigin && this.mediaStreamOrigin.stop();
let R = TinychatApp.BLL.BroadcastProgressEvent,
I = new R(R.MEDIA_RTC_FAILED);
I.error = new Error(T), this.EventBus.broadcast(R.ID, I)
}
this.mediaConnections.local.Close(), this.mediaConnections.local = null
}
null != this.mediaStream && (this.mediaStream.stop(), this.mediaStream = null, this.streamReset()), this.videolist.RemoveVideoSelf(E);
let B = new y(y.MEDIA_STOPED);
this.EventBus.broadcast(y.ID, B)
}
_selfShowReason(E) {
this.app.Notify(E.text)
}
onMediaSuccessCallback(E) {
this.mediaStream = this.mediaLastConstraints.video ? this.prepareStream(E) : E;
var T = this.tcPkt_GetICE(this.onPublisherConnectionReadyCallback);
this.packetWorker.send(T), console.log("Broadcast: Media OK ...");
let B = new y(y.MEDIA_OK);
this.EventBus.broadcast(y.ID, B)
}
applyFilter(E) {
this.mediaStreamFilter = E
}
prepareStream(E) {
function B() {
if (null != R.mediaStreamCanvas) {
I.clearRect(0, 0, R.mediaStreamCanvas.width, R.mediaStreamCanvas.height);
let W = R.mediaStreamVideo.videoHeight,
D = R.mediaStreamVideo.videoWidth;
R.mediaStreamCanvas.width = D, R.mediaStreamCanvas.height = W, window.TinychatApp.BLL.VideoFilters.getFilter(R.mediaStreamFilter).apply(I, D, W), I.drawImage(R.mediaStreamVideo, 0, 0, D, W, 0, 0, R.mediaStreamCanvas.width, R.mediaStreamCanvas.height), requestAnimationFrame(B)
}
}
this.mediaStreamOrigin = E, this.mediaStreamVideo = document.createElement("video"), this.mediaStreamVideo.autoplay = !0, this.mediaStreamVideo.muted = !0, this.mediaStreamCanvas = document.createElement("canvas");
let R = this,
I = this.mediaStreamCanvas.getContext("2d");
this.mediaStreamVideo.oncanplay = function() {
requestAnimationFrame(B)
}, this.mediaStreamVideo.srcObject = this.mediaStreamOrigin;
let A = this.mediaStreamCanvas.captureStream(15);
return A.addTrack(this.mediaStreamOrigin.getAudioTracks()[0]), A
}
onMediaFailedCallback(E) {
console.warn("Broadcast: Media Failed ..."), this.mediaStream = null, this.videolist.RemoveVideoSelf(this.self_handle);
var T = E.message;
if ("" == E.message) switch (E.name) {
case "NotFoundError":
case "DevicesNotFoundError":
T = "Please setup your webcam first.";
break;
case "SourceUnavailableError":
T = "Your webcam is busy.";
break;
case "PermissionDeniedError":
case "SecurityError":
case "NotAllowedError":
T = "CAMERA/MICROPHONE access permission denied!";
break;
case "PermissionDismissedError":
T = "Tinychat is required to access CAMERA/MICROPHONE to have media broadcast!";
break;
default:
T = "Failed to start broadcast... Please check your webcam!";
} else switch (E.name) {
case "OverconstrainedError":
T = "Failed to start broadcast... Please check your webcam!";
}
let B = new y(y.MEDIA_FAILED);
B.error = new Error(T), this.EventBus.broadcast(y.ID, B)
}
onBanCallback(E) {
if (this.tcPkt_TcCallbackCheck(E, "ban")) {
let T = E.success;
if (!0 === T);
else {
E.reason;
console.error(E)
}
}
}
onUnbanCallback(E) {
if (this.tcPkt_TcCallbackCheck(E, "unban")) {
let T = E.success;
if (!0 === T) {
E.id
} else {
E.reason;
console.error(E)
}
}
}
onBanlistCallback(E) {
if (this.tcPkt_TcCallbackCheck(E, "banlist")) {
let T = E.success,
B = E.items;
if (!0 === T && Array.isArray(B))
for (var R in this.banlist = [], B) {
let I = this.tcPkt_BanlistItemParse(B[R]);
this.banlist.push(I)
} else {
E.reason;
console.error(E)
}
}
}
onVideoForceCloseCallback(E) {
if (this.tcPkt_TcCallbackCheck(E, "stream_moder_close")) {
let T = E.success;
if (!0 === T) {
const B = E.handle,
R = this.userlist.get(B);
null === R ? this.app.showToast("There is no such user to close video") : this.app.showToast("[" + R.nickname + "] video was closed")
} else {
const B = E.error;
this.app.showToastWarn(B.text)
}
}
}
onRoomConnectCallback(E) {
if ("joined" === E.tc) {
var T = this.tcPkt_UserParse(E.self),
B = this.tcPkt_RoomSettingsParse(E.room);
this.updateSelfUser(T), this.updateRoomSettings(B), T.isLurker ? console.warn("Chatroom.Connected: nickname: " + T.nickname + " - IsLurker!") : console.log("Chatroom.Connected: nickname: " + T.nickname), this.reconnect_wait = 0;
let R = new C;
if (this.EventBus.broadcast(C.ID, R), "" == this.nickname) {
let I = new P("", ModalDialogChangeNickname.MODE_GUEST);
this.EventBus.broadcast(P.ID, I)
}
} else if ("password" === E.tc) {
let R = new l;
this.EventBus.broadcast(l.ID, R)
} else if ("captcha" === E.tc) {
let R = E.key,
I = new d(R);
this.EventBus.broadcast(d.ID, I)
} else "closed" === E.tc ? this.onClosed(E) : this.tcPkt_TcCallbackCheck(E, null)
}
onPublisherConnectionReadyCallback(E) {
if (this.tcPkt_TcCallbackCheck(E, "iceservers"))
if (!0 == E.success) {
let T = E.servers,
R = this.self_handle,
I = new TinychatApp.BLL.MediaConnection(this.videolist, R, !0, T);
I.AddStream(this.mediaStream), this.mediaConnections.local = I, console.log("Broadcast: Media.ICE.SDP ...");
let A = new y(y.MEDIA_ICE);
this.EventBus.broadcast(y.ID, A), I.Connect()
} else {
console.error(E);
try {
let T = "Broadcast closed due server request (ICE)";
this._selfMediaStreamStop(this.self_handle, T);
let B = TinychatApp.BLL.BroadcastProgressEvent,
R = new B(B.MEDIA_RTC_FAILED);
R.error = new Error(T), this.EventBus.broadcast(B.ID, R)
} catch (T) {
console.error(T)
}
}
}
onRemoteConnectionReadyCallback(E) {
if (this.tcPkt_TcCallbackCheck(E, "sdp") && !0 === E.success && "offer" === E.type) {
let B = E.servers,
R = E.sdp,
I = E.handle,
A = new TinychatApp.BLL.MediaConnection(this.videolist, I, !1, B, R);
this.mediaConnections.remote[I] = A, A.Connect()
}
}
onSendMessagePublicCallback(E) {
if (this.tcPkt_TcCallbackCheck(E, "msg")) {
var T = this.tcPkt_MsgParse(E);
this._userlist.isIgnored(T.user) || this.chatlog.public_add(T)
}
}
onSendMessagePrivateCallback(E) {
if (this.tcPkt_TcCallbackCheck(E, "pvtmsg")) {
var T = this.tcPkt_MsgParse(E);
let B = TinychatApp.DAL.ChatLogItemEntity;
T.type = B.PRIVATE, T.chatname = T.user.handle, this._userlist.isIgnored(T.user) || this.chatlog.private_add(T)
}
}
onSystemMessage(E) {
if (this.tcPkt_TcCallbackCheck(E, "sysmsg")) {
let T = E.handle || 0;
if (0 < T) {
let I = this.userlist.get(T);
null == I && (T = 0)
}
let B = 0 < T ? T : TinychatApp.BLL.Chatlog.PUBLIC,
R = E.text || "";
this.chatlog.system_add(B, R)
}
}
onGiftMessage(E) {
if (this.tcPkt_TcCallbackCheck(E, "gift")) {
let T = this.tcPkt_GiftParse(E),
R = new TinychatApp.DAL.ChatLogItemEntity;
R.chatname = TinychatApp.BLL.Chatlog.PUBLIC, R.user = null, R.message_text = "[" + (T.fromUsername.isEmpty() ? "Anonymous" : T.fromUsername) + "] sent gift '" + T.giftName + "' to [" + T.toUsername + "]\n >" + T.giftComment + "", R.giftUrl = T.giftUrl, this.chatlog.gift_add(R)
}
}
onClosed(E) {
if (this.tcPkt_TcCallbackCheck(E, "closed")) {
let T = E.error;
this.closedLastReasonCode = T, console.warn("Chatroom.ConnectionClosed: " + this.closedLastReasonCode)
}
}
onNicknameChanged(E) {
if (this.tcPkt_TcCallbackCheck(E, "nick")) {
let T = E.handle,
B = E.nick;
if (T != this.self_handle) this.userlist.updateNickname(T, B);
else if (!0 === E.success) {
let R = this.selfUser();
R.nickname = B, this.updateSelfUser(R), this.userlist.updateNickname(T, B)
} else console.warn(E), this.app.showToastWarn("Nickname was not changed for some reason...")
}
}
onYoutube(E) {
if (!this.app.settings.isYoutube()) return void console.log("YouTube cmds blocked by chat settings...");
var T = "";
let B = E.tc;
if ("yut_play" === B) T = L.YT_PLAY;
else if ("yut_pause" === B) T = L.YT_PAUSE;
else if ("yut_stop" === B) T = L.YT_STOP;
else return void this.tcPkt_TcCallbackCheck(E, "-");
let R = new L(T);
if (R.cmd = T, void 0 != E.item) {
let I = E.item;
R.id = I.id, R.duration = I.duration, R.offset = parseFloat(I.offset), R.playlist = I.playlist
} else R.id = E.id, R.duration = E.duration, R.offset = parseFloat(E.offset);
R.handle = parseInt(E.handle), R.server = !0, R.success = void 0 == E.success || E.success, R.reason = void 0 == E.reason ? "" : E.reason, isNaN(R.offset) && (R.offset = 0), isNaN(R.handle) && (R.handle = -1), R.success ? this.EventBus.broadcast(L.ID, R) : this.app.showToastWarn("Youtube command has failed, due: " + R.reason)
}
onYoutubePlaylist(E) {
if (this.tcPkt_TcCallbackCheck(E, "yut_playlist")) {
let T = TinychatApp.DAL.YoutubeItem,
B = E.success,
R = E.reason;
if (!0 === B) {
let A = [],
W = E.items;
if (Array.isArray(W))
for (var I in W) {
let D = W[I],
M = new T;
M.id = D.id, M.duration = D.duration, M.title = D.title, M.imgurl = D.image, A.push(M)
}
if (void 0 != E.mode) {
let D = E.mode;
this.youtubelist_random = D.random, this.youtubelist_repeat = D.repeat
}
this.youtubelist = A
} else this.app.showToastWarn("Youtube Playlist load has failed, due: " + R)
}
}
sendPushForUnreadPrivateMessage() {
var T = "username=" + encodeURIComponent(this.enterroomresult.selfuser.username),
B = new XMLHttpRequest;
B.open("POST", "/pushnotification/privatemessage", !0), B.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), B.send(T)
}
}
const a = "RoomSettingsEvent_" + Math.Guid.newGuid();
class o {
static get ID() {
return a
}
constructor(E) {
return this.roomSettings = E, this
}
}
const n = "RoomConnectEvent_" + Math.Guid.newGuid();
class r {
static get ID() {
return n
}
constructor(E) {
return this.attempts = E, this
}
}
const s = "RoomConnectCaptcha_" + Math.Guid.newGuid();
class d {
static get ID() {
return s
}
constructor(E) {
return this.key = E, this
}
}
const c = "RoomConnectPassword_" + Math.Guid.newGuid();
class l {
static get ID() {
return c
}
constructor() {
return this
}
}
const m = "RoomConnectStandby_" + Math.Guid.newGuid();
class u {
static get ID() {
return m
}
constructor(E, T) {
return this.tries = E, this.waitms = T, this
}
}
const k = "RoomConnectFatal_" + Math.Guid.newGuid();
class p {
static get ID() {
return k
}
constructor() {
return this
}
}
const h = "RoomConnected_" + Math.Guid.newGuid();
class C {
static get ID() {
return h
}
constructor() {
return this
}
}
const f = "RoomReconnected_" + Math.Guid.newGuid();
class _ {
static get ID() {
return f
}
constructor() {
return this
}
}
const g = "RoomQuitEvent_" + Math.Guid.newGuid();
class v {
static get ID() {
return g
}
constructor(E, T) {
return this.reasonCode = E, this.chatroom = T, this
}
static get WS() {
return -3
}
static ConvertReason(E) {
let T = "";
switch (E) {
case 0:
T = "There is no internet connection...";
break;
case 1:
T = "Opss, chatroom has no free slots for users";
break;
case 2:
T = "Chatroom has been closed by administrator";
break;
case 3:
T = "This room does not allow guests to join, please sign in";
break;
case 4:
T = "You has been banned from chatroom by Moderator";
break;
case 5:
T = "Wrong password";
break;
case 6:
T = "Single connection is allowed for chatroom";
break;
case 7:
T = "An error occurred while connecting to the server...";
break;
case 8:
T = "An error occurred while connecting to the server...";
break;
case 9:
T = "An error occurred while connecting to the server...";
break;
case 10:
T = "An error occurred while connecting to the server...";
break;
case 11:
T = "An error occurred while connecting to the server...";
break;
case 12:
T = "You has been kicked from chatroom by Moderator";
break;
default:
T = "There is no internet connection...";
}
return T
}
static ConvertAction(E) {
let T = "";
switch (E) {
case 3:
T = "SIGN IN";
break;
default:
T = "RETRY";
}
return T
}
}
const b = "RoomNicknameChangeEvent_" + Math.Guid.newGuid();
class P {
static get ID() {
return b
}
constructor(E, T) {
return this.nickname = E, this.type = T, this
}
}
const S = "BroadcastProgressEvent_" + Math.Guid.newGuid();
class y {
static get ID() {
return S
}
static get MEDIA_START() {
return "media_start"
}
static get MEDIA_OK() {
return "media_ok"
}
static get MEDIA_ICE() {
return "media_ice"
}
static get MEDIA_STARTED_SUCCESS() {
return "media_started_success"
}
static get MEDIA_FAILED() {
return "media_failed"
}
static get MEDIA_RTC_FAILED() {
return "media_rtc_failed"
}
static get MEDIA_STOPING() {
return "media_stoping"
}
static get MEDIA_STOPED() {
return "media_stoped"
}
constructor(E) {
return this.stage = E, this.error = "", this
}
}
const w = "YoutubeEvent_" + Math.Guid.newGuid();
class L {
static get ID() {
return w
}
static get YT_PLAY() {
return "yut_play"
}
static get YT_STOP() {
return "yut_stop"
}
static get YT_PAUSE() {
return "yut_pause"
}
constructor(E) {
return this.handle = -1, this.cmd = E, this.id = "", this.offset = 0, this.duration = void 0, this.playlist = void 0, this.seekByUser = void 0, this.success = !0, this.reason = "", this.server = void 0, this
}
}
window.TinychatApp.BLL.ChatRoom = t, window.TinychatApp.BLL.RoomSettingsEvent = o, window.TinychatApp.BLL.RoomConnectEvent = r, window.TinychatApp.BLL.RoomConnectCaptcha = d, window.TinychatApp.BLL.RoomConnectPassword = l, window.TinychatApp.BLL.RoomConnectStandby = u, window.TinychatApp.BLL.RoomConnectFatal = p, window.TinychatApp.BLL.RoomConnected = C, window.TinychatApp.BLL.RoomReconnected = _, window.TinychatApp.BLL.RoomQuitEvent = v, window.TinychatApp.BLL.RoomNicknameChangeEvent = P, window.TinychatApp.BLL.BroadcastProgressEvent = y, window.TinychatApp.BLL.YoutubeEvent = L
})();
</script>
<script>
(function() {
'use strict';
class a {
static get getAll() {
return [{
name: 'No Filter',
css: 'nofilter',
filter: '',
background: '',
mixBlendMode: '',
apply: function() {}
}, {
name: '1977',
css: '_1977',
filter: 'contrast(1.1) brightness(1.1) saturate(1.3)',
background: 'rgba(243,106,188,.3)',
mixBlendMode: 'screen',
apply: function(b, c, d) {
b.filter = this.filter, b.fillStyle = this.background, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Aden',
css: 'aden',
filter: 'hue-rotate(-20deg) contrast(.9) saturate(.85) brightness(1.2)',
background: 'linear-gradient(to right,rgba(66,10,14,.2),transparent)',
mixBlendMode: 'darken',
apply: function(b, c, d) {
b.filter = this.filter;
let e = b.createLinearGradient(0, 0, c, d);
e.addColorStop(0, 'rgba(66, 10, 14, .2)'), e.addColorStop(1, 'rgba(0, 0, 0, .0)'), b.fillStyle = e, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Brannan',
css: 'brannan',
filter: 'sepia(.5) contrast(1.4)',
background: 'rgba(161,44,199,.31)',
mixBlendMode: 'lighten',
apply: function(b, c, d) {
b.filter = this.filter, b.fillStyle = this.background, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Brooklyn',
css: 'brooklyn',
filter: 'contrast(.9) brightness(1.1)',
background: 'radial-gradient(circle, rgba(168,223,193,.4) 70%, #c4b7c8)',
mixBlendMode: 'overlay',
apply: function(b, c, d) {
b.filter = this.filter;
let e = b.createRadialGradient(c / 2, d / 2, 0, c / 2, d / 2, 0.7 * c);
e.addColorStop(0, 'rgba(168,223,193,.4)'), e.addColorStop(1, '#c4b7c8'), b.fillStyle = e, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Clarendon',
css: 'clarendon',
filter: 'contrast(1.2) saturate(1.35)',
background: 'rgba(127,187,227,.2)',
mixBlendMode: 'overlay',
apply: function(b, c, d) {
b.filter = this.filter, b.fillStyle = this.background, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Earlybird',
css: 'earlybird',
filter: 'contrast(.9) sepia(.2)',
background: 'radial-gradient(circle,#d0ba8e 20%,#360309 85%,#1d0210 100%)',
mixBlendMode: 'overlay',
apply: function(b, c, d) {
b.filter = this.filter;
let e = b.createRadialGradient(c / 2, d / 2, 0.2 * (c / 2), c / 2, d / 2, 0.85 * (c / 2));
e.addColorStop(0, 'rgba(208, 186, 142, .5)'), e.addColorStop(1, 'rgba(54, 3, 9, .5)'), b.fillStyle = e, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Gingham',
css: 'gingham',
filter: 'brightness(1.05) hue-rotate(-10deg)',
background: 'rgba(230, 230, 250, .3)',
mixBlendMode: 'soft-light',
apply: function(b, c, d) {
b.filter = this.filter, b.fillStyle = this.background, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Hudson',
css: 'hudson',
filter: 'brightness(1.2) contrast(.9) saturate(1.1)',
background: 'radial-gradient(circle,#a6b1ff 50%,#342134)',
mixBlendMode: 'multiply',
apply: function(b, c, d) {
b.filter = this.filter;
let e = b.createRadialGradient(c / 2, d / 2, 0.5 * (c / 2), c / 2, d / 2, c / 2);
e.addColorStop(0, 'rgba(166, 177, 255, .5)'), e.addColorStop(1, 'rgba(52, 33, 52, .5)'), b.fillStyle = e, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Inkwell',
css: 'inkwell',
filter: 'sepia(.3) contrast(1.1) brightness(1.1) grayscale(1)',
background: '',
mixBlendMode: '',
apply: function(b) {
b.filter = this.filter
}
}, {
name: 'Lo-Fi',
css: 'lofi',
filter: 'saturate(1.1) contrast(1.5)',
background: 'radial-gradient(circle,transparent 70%,#222 150%)',
mixBlendMode: 'multiply',
apply: function(b, c, d) {
b.filter = this.filter;
let e = b.createRadialGradient(c / 2, d / 2, 0.7 * (c / 2), c / 2, d / 2, 1.5 * (c / 2));
e.addColorStop(0, 'rgba(0, 0, 0, 0)'), e.addColorStop(1, 'rgb(34, 34, 34)'), b.fillStyle = e, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}, {
name: 'Maven',
css: 'maven',
filter: 'sepia(.25) brightness(.95) contrast(.95) saturate(1.5)',
background: 'rgba(3, 230, 26, .2)',
mixBlendMode: 'hue',
apply: function(b, c, d) {
b.filter = this.filter, b.fillStyle = this.background, b.fillRect(0, 0, c, d), b.globalCompositeOperation = this.mixBlendMode
}
}]
}
static getFilter(b) {
return a.getAll.find(c => c.name === b)
}
}
window.TinychatApp.BLL.VideoFilters = a
})();
</script>
<script type="text/javascript" charset="utf-8">
(function(m) {
if ("object" == typeof exports && "undefined" != typeof module) module.exports = m();
else if ("function" == typeof define && define.amd) define([], m);
else {
var h;
h = "undefined" == typeof window ? "undefined" == typeof global ? "undefined" == typeof self ? this : self : global : window, h.adapter = m()
}
})(function() {
return function y(C, b, T) {
function P(k, E) {
if (!b[k]) {
if (!C[k]) {
var R = "function" == typeof require && require;
if (!E && R) return R(k, !0);
if (S) return S(k, !0);
var L = new Error("Cannot find module '" + k + "'");
throw L.code = "MODULE_NOT_FOUND", L
}
var M = b[k] = {
exports: {}
};
C[k][0].call(M.exports, function(D) {
var w = C[k][1][D];
return P(w ? w : D)
}, M, M.exports, y, C, b, T)
}
return b[k].exports
}
for (var S = "function" == typeof require && require, x = 0; x < T.length; x++) P(T[x]);
return P
}({
1: [function(y, C) {
"use strict";
var T = {};
T.generateIdentifier = function() {
return Math.random().toString(36).substr(2, 10)
}, T.localCName = T.generateIdentifier(), T.splitLines = function(P) {
return P.trim().split("\n").map(function(S) {
return S.trim()
})
}, T.splitSections = function(P) {
var S = P.split("\nm=");
return S.map(function(x, k) {
return (0 < k ? "m=" + x : x).trim() + "\r\n"
})
}, T.matchPrefix = function(P, S) {
return T.splitLines(P).filter(function(x) {
return 0 === x.indexOf(S)
})
}, T.parseCandidate = function(P) {
var S = 0 === P.indexOf("a=candidate:") ? P.substring(12).split(" ") : P.substring(10).split(" ");
for (var x = {
foundation: S[0],
component: S[1],
protocol: S[2].toLowerCase(),
priority: parseInt(S[3], 10),
ip: S[4],
port: parseInt(S[5], 10),
type: S[7]
}, k = 8; k < S.length; k += 2) switch (S[k]) {
case "raddr":
x.relatedAddress = S[k + 1];
break;
case "rport":
x.relatedPort = parseInt(S[k + 1], 10);
break;
case "tcptype":
x.tcpType = S[k + 1];
break;
default:
}
return x
}, T.writeCandidate = function(P) {
var S = [P.foundation, P.component, P.protocol.toUpperCase(), P.priority, P.ip, P.port],
x = P.type;
return S.push("typ"), S.push(x), "host" !== x && P.relatedAddress && P.relatedPort && (S.push("raddr"), S.push(P.relatedAddress), S.push("rport"), S.push(P.relatedPort)), P.tcpType && "tcp" === P.protocol.toLowerCase() && (S.push("tcptype"), S.push(P.tcpType)), "candidate:" + S.join(" ")
}, T.parseRtpMap = function(P) {
var S = P.substr(9).split(" "),
x = {
payloadType: parseInt(S.shift(), 10)
};
return S = S[0].split("/"), x.name = S[0], x.clockRate = parseInt(S[1], 10), x.numChannels = 3 === S.length ? parseInt(S[2], 10) : 1, x
}, T.writeRtpMap = function(P) {
var S = P.payloadType;
return void 0 !== P.preferredPayloadType && (S = P.preferredPayloadType), "a=rtpmap:" + S + " " + P.name + "/" + P.clockRate + (1 === P.numChannels ? "" : "/" + P.numChannels) + "\r\n"
}, T.parseExtmap = function(P) {
var S = P.substr(9).split(" ");
return {
id: parseInt(S[0], 10),
uri: S[1]
}
}, T.writeExtmap = function(P) {
return "a=extmap:" + (P.id || P.preferredId) + " " + P.uri + "\r\n"
}, T.parseFmtp = function(P) {
for (var x, S = {}, k = P.substr(P.indexOf(" ") + 1).split(";"), E = 0; E < k.length; E++) x = k[E].trim().split("="), S[x[0].trim()] = x[1];
return S
}, T.writeFmtp = function(P) {
var S = "",
x = P.payloadType;
if (void 0 !== P.preferredPayloadType && (x = P.preferredPayloadType), P.parameters && Object.keys(P.parameters).length) {
var k = [];
Object.keys(P.parameters).forEach(function(E) {
k.push(E + "=" + P.parameters[E])
}), S += "a=fmtp:" + x + " " + k.join(";") + "\r\n"
}
return S
}, T.parseRtcpFb = function(P) {
var S = P.substr(P.indexOf(" ") + 1).split(" ");
return {
type: S.shift(),
parameter: S.join(" ")
}
}, T.writeRtcpFb = function(P) {
var S = "",
x = P.payloadType;
return void 0 !== P.preferredPayloadType && (x = P.preferredPayloadType), P.rtcpFeedback && P.rtcpFeedback.length && P.rtcpFeedback.forEach(function(k) {
S += "a=rtcp-fb:" + x + " " + k.type + (k.parameter && k.parameter.length ? " " + k.parameter : "") + "\r\n"
}), S
}, T.parseSsrcMedia = function(P) {
var S = P.indexOf(" "),
x = {
ssrc: parseInt(P.substr(7, S - 7), 10)
},
k = P.indexOf(":", S);
return -1 < k ? (x.attribute = P.substr(S + 1, k - S - 1), x.value = P.substr(k + 1)) : x.attribute = P.substr(S + 1), x
}, T.getDtlsParameters = function(P, S) {
var x = T.splitLines(P);
x = x.concat(T.splitLines(S));
var k = x.filter(function(R) {
return 0 === R.indexOf("a=fingerprint:")
})[0].substr(14),
E = {
role: "auto",
fingerprints: [{
algorithm: k.split(" ")[0].toLowerCase(),
value: k.split(" ")[1]
}]
};
return E
}, T.writeDtlsParameters = function(P, S) {
var x = "a=setup:" + S + "\r\n";
return P.fingerprints.forEach(function(k) {
x += "a=fingerprint:" + k.algorithm + " " + k.value + "\r\n"
}), x
}, T.getIceParameters = function(P, S) {
var x = T.splitLines(P);
x = x.concat(T.splitLines(S));
var k = {
usernameFragment: x.filter(function(E) {
return 0 === E.indexOf("a=ice-ufrag:")
})[0].substr(12),
password: x.filter(function(E) {
return 0 === E.indexOf("a=ice-pwd:")
})[0].substr(10)
};
return k
}, T.writeIceParameters = function(P) {
return "a=ice-ufrag:" + P.usernameFragment + "\r\na=ice-pwd:" + P.password + "\r\n"
}, T.parseRtpParameters = function(P) {
for (var S = {
codecs: [],
headerExtensions: [],
fecMechanisms: [],
rtcp: []
}, x = T.splitLines(P), k = x[0].split(" "), E = 3; E < k.length; E++) {
var R = k[E],
L = T.matchPrefix(P, "a=rtpmap:" + R + " ")[0];
if (L) {
var M = T.parseRtpMap(L),
D = T.matchPrefix(P, "a=fmtp:" + R + " ");
switch (M.parameters = D.length ? T.parseFmtp(D[0]) : {}, M.rtcpFeedback = T.matchPrefix(P, "a=rtcp-fb:" + R + " ").map(T.parseRtcpFb), S.codecs.push(M), M.name.toUpperCase()) {
case "RED":
case "ULPFEC":
S.fecMechanisms.push(M.name.toUpperCase());
break;
default:
}
}
}
return T.matchPrefix(P, "a=extmap:").forEach(function(w) {
S.headerExtensions.push(T.parseExtmap(w))
}), S
}, T.writeRtpDescription = function(P, S) {
var x = "";
x += "m=" + P + " ", x += 0 < S.codecs.length ? "9" : "0", x += " UDP/TLS/RTP/SAVPF ", x += S.codecs.map(function(E) {
return void 0 === E.preferredPayloadType ? E.payloadType : E.preferredPayloadType
}).join(" ") + "\r\n", x += "c=IN IP4 0.0.0.0\r\n", x += "a=rtcp:9 IN IP4 0.0.0.0\r\n", S.codecs.forEach(function(E) {
x += T.writeRtpMap(E), x += T.writeFmtp(E), x += T.writeRtcpFb(E)
});
var k = 0;
return S.codecs.forEach(function(E) {
E.maxptime > k && (k = E.maxptime)
}), 0 < k && (x += "a=maxptime:" + k + "\r\n"), x += "a=rtcp-mux\r\n", S.headerExtensions.forEach(function(E) {
x += T.writeExtmap(E)
}), x
}, T.parseRtpEncodingParameters = function(P) {
var M, S = [],
x = T.parseRtpParameters(P),
k = -1 !== x.fecMechanisms.indexOf("RED"),
E = -1 !== x.fecMechanisms.indexOf("ULPFEC"),
R = T.matchPrefix(P, "a=ssrc:").map(function(_) {
return T.parseSsrcMedia(_)
}).filter(function(_) {
return "cname" === _.attribute
}),
L = 0 < R.length && R[0].ssrc,
D = T.matchPrefix(P, "a=ssrc-group:FID").map(function(_) {
var O = _.split(" ");
return O.shift(), O.map(function(I) {
return parseInt(I, 10)
})
});
0 < D.length && 1 < D[0].length && D[0][0] === L && (M = D[0][1]), x.codecs.forEach(function(_) {
if ("RTX" === _.name.toUpperCase() && _.parameters.apt) {
var O = {
ssrc: L,
codecPayloadType: parseInt(_.parameters.apt, 10),
rtx: {
ssrc: M
}
};
S.push(O), k && (O = JSON.parse(JSON.stringify(O)), O.fec = {
ssrc: M,
mechanism: E ? "red+ulpfec" : "red"
}, S.push(O))
}
}), 0 === S.length && L && S.push({
ssrc: L
});
var w = T.matchPrefix(P, "b=");
return w.length && (0 === w[0].indexOf("b=TIAS:") ? w = parseInt(w[0].substr(7), 10) : 0 === w[0].indexOf("b=AS:") && (w = parseInt(w[0].substr(5), 10)), S.forEach(function(_) {
_.maxBitrate = w
})), S
}, T.parseRtcpParameters = function(P) {
var S = {},
k = T.matchPrefix(P, "a=ssrc:").map(function(L) {
return T.parseSsrcMedia(L)
}).filter(function(L) {
return "cname" === L.attribute
})[0];
k && (S.cname = k.value, S.ssrc = k.ssrc);
var E = T.matchPrefix(P, "a=rtcp-rsize");
S.reducedSize = 0 < E.length, S.compound = 0 === E.length;
var R = T.matchPrefix(P, "a=rtcp-mux");
return S.mux = 0 < R.length, S
}, T.parseMsid = function(P) {
var S, x = T.matchPrefix(P, "a=msid:");
if (1 === x.length) return S = x[0].substr(7).split(" "), {
stream: S[0],
track: S[1]
};
var k = T.matchPrefix(P, "a=ssrc:").map(function(E) {
return T.parseSsrcMedia(E)
}).filter(function(E) {
return "msid" === E.attribute
});
if (0 < k.length) return S = k[0].value.split(" "), {
stream: S[0],
track: S[1]
}
}, T.writeSessionBoilerplate = function() {
return "v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"
}, T.writeMediaSection = function(P, S, x, k) {
var E = T.writeRtpDescription(P.kind, S);
if (E += T.writeIceParameters(P.iceGatherer.getLocalParameters()), E += T.writeDtlsParameters(P.dtlsTransport.getLocalParameters(), "offer" === x ? "actpass" : "active"), E += "a=mid:" + P.mid + "\r\n", E += P.rtpSender && P.rtpReceiver ? "a=sendrecv\r\n" : P.rtpSender ? "a=sendonly\r\n" : P.rtpReceiver ? "a=recvonly\r\n" : "a=inactive\r\n", P.rtpSender) {
var R = "msid:" + k.id + " " + P.rtpSender.track.id + "\r\n";
E += "a=" + R, E += "a=ssrc:" + P.sendEncodingParameters[0].ssrc + " " + R, P.sendEncodingParameters[0].rtx && (E += "a=ssrc:" + P.sendEncodingParameters[0].rtx.ssrc + " " + R, E += "a=ssrc-group:FID " + P.sendEncodingParameters[0].ssrc + " " + P.sendEncodingParameters[0].rtx.ssrc + "\r\n")
}
return E += "a=ssrc:" + P.sendEncodingParameters[0].ssrc + " cname:" + T.localCName + "\r\n", P.rtpSender && P.sendEncodingParameters[0].rtx && (E += "a=ssrc:" + P.sendEncodingParameters[0].rtx.ssrc + " cname:" + T.localCName + "\r\n"), E
}, T.getDirection = function(P, S) {
for (var x = T.splitLines(P), k = 0; k < x.length; k++) switch (x[k]) {
case "a=sendrecv":
case "a=sendonly":
case "a=recvonly":
case "a=inactive":
return x[k].substr(2);
default:
}
return S ? T.getDirection(S) : "sendrecv"
}, T.getKind = function(P) {
var S = T.splitLines(P),
x = S[0].split(" ");
return x[0].substr(2)
}, T.isRejected = function(P) {
return "0" === P.split(" ", 2)[1]
}, C.exports = T
}, {}],
2: [function(y, C) {
"use strict";
(function() {
var T = y("./utils"),
P = T.log,
S = T.browserDetails;
C.exports.browserDetails = S, C.exports.extractVersion = T.extractVersion, C.exports.disableLog = T.disableLog;
var x = y("./chrome/chrome_shim") || null,
k = y("./edge/edge_shim") || null,
E = y("./firefox/firefox_shim") || null,
R = y("./safari/safari_shim") || null;
switch (S.browser) {
case "chrome":
if (!x || !x.shimPeerConnection) return void P("Chrome shim is not included in this adapter release.");
P("adapter.js shimming chrome."), C.exports.browserShim = x, x.shimGetUserMedia(), x.shimMediaStream(), T.shimCreateObjectURL(), x.shimSourceObject(), x.shimPeerConnection(), x.shimOnTrack(), x.shimGetSendersWithDtmf();
break;
case "firefox":
if (!E || !E.shimPeerConnection) return void P("Firefox shim is not included in this adapter release.");
P("adapter.js shimming firefox."), C.exports.browserShim = E, E.shimGetUserMedia(), T.shimCreateObjectURL(), E.shimSourceObject(), E.shimPeerConnection(), E.shimOnTrack();
break;
case "edge":
if (!k || !k.shimPeerConnection) return void P("MS edge shim is not included in this adapter release.");
P("adapter.js shimming edge."), C.exports.browserShim = k, k.shimGetUserMedia(), T.shimCreateObjectURL(), k.shimPeerConnection(), k.shimReplaceTrack();
break;
case "safari":
if (!R) return void P("Safari shim is not included in this adapter release.");
P("adapter.js shimming safari."), C.exports.browserShim = R, R.shimOnAddStream(), R.shimGetUserMedia();
break;
default:
P("Unsupported browser!");
}
})()
}, {
"./chrome/chrome_shim": 3,
"./edge/edge_shim": 5,
"./firefox/firefox_shim": 7,
"./safari/safari_shim": 9,
"./utils": 10
}],
3: [function(y, C) {
"use strict";
var T = y("../utils.js").log,
P = y("../utils.js").browserDetails,
S = {
shimMediaStream: function() {
window.MediaStream = window.MediaStream || window.webkitMediaStream
},
shimOnTrack: function() {
"object" == typeof window && window.RTCPeerConnection && !("ontrack" in window.RTCPeerConnection.prototype) && Object.defineProperty(window.RTCPeerConnection.prototype, "ontrack", {
get: function() {
return this._ontrack
},
set: function(x) {
var k = this;
this._ontrack && (this.removeEventListener("track", this._ontrack), this.removeEventListener("addstream", this._ontrackpoly)), this.addEventListener("track", this._ontrack = x), this.addEventListener("addstream", this._ontrackpoly = function(E) {
E.stream.addEventListener("addtrack", function(R) {
var L = new Event("track");
L.track = R.track, L.receiver = {
track: R.track
}, L.streams = [E.stream], k.dispatchEvent(L)
}), E.stream.getTracks().forEach(function(R) {
var L = new Event("track");
L.track = R, L.receiver = {
track: R
}, L.streams = [E.stream], this.dispatchEvent(L)
}.bind(this))
}.bind(this))
}
})
},
shimGetSendersWithDtmf: function() {
if ("object" == typeof window && window.RTCPeerConnection && !("getSenders" in RTCPeerConnection.prototype) && "createDTMFSender" in RTCPeerConnection.prototype) {
RTCPeerConnection.prototype.getSenders = function() {
return this._senders
};
var x = RTCPeerConnection.prototype.addStream,
k = RTCPeerConnection.prototype.removeStream;
RTCPeerConnection.prototype.addStream = function(E) {
var R = this;
R._senders = R._senders || [], x.apply(R, [E]), E.getTracks().forEach(function(L) {
R._senders.push({
track: L,
get dtmf() {
return void 0 === this._dtmf && ("audio" === L.kind ? this._dtmf = R.createDTMFSender(L) : this._dtmf = null), this._dtmf
}
})
})
}, RTCPeerConnection.prototype.removeStream = function(E) {
var R = this;
R._senders = R._senders || [], k.apply(R, [E]), E.getTracks().forEach(function(L) {
var M = R._senders.find(function(D) {
return D.track === L
});
M && R._senders.splice(R._senders.indexOf(M), 1)
})
}
}
},
shimSourceObject: function() {
"object" == typeof window && window.HTMLMediaElement && !("srcObject" in window.HTMLMediaElement.prototype) && Object.defineProperty(window.HTMLMediaElement.prototype, "srcObject", {
get: function() {
return this._srcObject
},
set: function(x) {
var k = this;
return this._srcObject = x, this.src && URL.revokeObjectURL(this.src), x ? void(this.src = URL.createObjectURL(x), x.addEventListener("addtrack", function() {
k.src && URL.revokeObjectURL(k.src), k.src = URL.createObjectURL(x)
}), x.addEventListener("removetrack", function() {
k.src && URL.revokeObjectURL(k.src), k.src = URL.createObjectURL(x)
})) : (this.src = "", void 0)
}
})
},
shimPeerConnection: function() {
if (!window.RTCPeerConnection) window.RTCPeerConnection = function(R, L) {
return T("PeerConnection"), R && R.iceTransportPolicy && (R.iceTransports = R.iceTransportPolicy), new webkitRTCPeerConnection(R, L)
}, window.RTCPeerConnection.prototype = webkitRTCPeerConnection.prototype, webkitRTCPeerConnection.generateCertificate && Object.defineProperty(window.RTCPeerConnection, "generateCertificate", {
get: function() {
return webkitRTCPeerConnection.generateCertificate
}
});
else {
var x = RTCPeerConnection;
window.RTCPeerConnection = function(R, L) {
if (R && R.iceServers) {
for (var w, M = [], D = 0; D < R.iceServers.length; D++) w = R.iceServers[D], !w.hasOwnProperty("urls") && w.hasOwnProperty("url") ? (console.warn("RTCIceServer.url is deprecated! Use urls instead."), w = JSON.parse(JSON.stringify(w)), w.urls = w.url, M.push(w)) : M.push(R.iceServers[D]);
R.iceServers = M
}
return new x(R, L)
}, window.RTCPeerConnection.prototype = x.prototype, Object.defineProperty(window.RTCPeerConnection, "generateCertificate", {
get: function() {
return x.generateCertificate
}
})
}
var k = RTCPeerConnection.prototype.getStats;
RTCPeerConnection.prototype.getStats = function(R, L, M) {
var D = this,
w = arguments;
if (0 < arguments.length && "function" == typeof R) return k.apply(this, arguments);
if (0 === k.length && (0 === arguments.length || "function" != typeof arguments[0])) return k.apply(this, []);
var _ = function(U) {
var G = {},
A = U.result();
return A.forEach(function(F) {
var N = {
id: F.id,
timestamp: F.timestamp,
type: {
localcandidate: "local-candidate",
remotecandidate: "remote-candidate"
}[F.type] || F.type
};
F.names().forEach(function(B) {
N[B] = F.stat(B)
}), G[N.id] = N
}), G
},
O = function(U) {
return new Map(Object.keys(U).map(function(G) {
return [G, U[G]]
}))
};
if (2 <= arguments.length) {
var I = function(U) {
w[1](O(_(U)))
};
return k.apply(this, [I, arguments[0]])
}
return new Promise(function(U, G) {
k.apply(D, [function(A) {
U(O(_(A)))
}, G])
}).then(L, M)
}, 51 > P.version && ["setLocalDescription", "setRemoteDescription", "addIceCandidate"].forEach(function(R) {
var L = RTCPeerConnection.prototype[R];
RTCPeerConnection.prototype[R] = function() {
var M = arguments,
D = this,
w = new Promise(function(_, O) {
L.apply(D, [M[0], _, O])
});
return 2 > M.length ? w : w.then(function() {
M[1].apply(null, [])
}, function(_) {
3 <= M.length && M[2].apply(null, [_])
})
}
}), 52 > P.version && ["createOffer", "createAnswer"].forEach(function(R) {
var L = RTCPeerConnection.prototype[R];
RTCPeerConnection.prototype[R] = function() {
var M = this;
if (1 > arguments.length || 1 === arguments.length && "object" == typeof arguments[0]) {
var D = 1 === arguments.length ? arguments[0] : void 0;
return new Promise(function(w, _) {
L.apply(M, [w, _, D])
})
}
return L.apply(this, arguments)
}
}), ["setLocalDescription", "setRemoteDescription", "addIceCandidate"].forEach(function(R) {
var L = RTCPeerConnection.prototype[R];
RTCPeerConnection.prototype[R] = function() {
return arguments[0] = new("addIceCandidate" === R ? RTCIceCandidate : RTCSessionDescription)(arguments[0]), L.apply(this, arguments)
}
});
var E = RTCPeerConnection.prototype.addIceCandidate;
RTCPeerConnection.prototype.addIceCandidate = function() {
return arguments[0] ? E.apply(this, arguments) : (arguments[1] && arguments[1].apply(null), Promise.resolve())
}
}
};
C.exports = {
shimMediaStream: S.shimMediaStream,
shimOnTrack: S.shimOnTrack,
shimGetSendersWithDtmf: S.shimGetSendersWithDtmf,
shimSourceObject: S.shimSourceObject,
shimPeerConnection: S.shimPeerConnection,
shimGetUserMedia: y("./getusermedia")
}
}, {
"../utils.js": 10,
"./getusermedia": 4
}],
4: [function(y, C) {
"use strict";
var T = y("../utils.js").log,
P = y("../utils.js").browserDetails;
C.exports = function() {
var S = function(M) {
if ("object" != typeof M || M.mandatory || M.optional) return M;
var D = {};
return Object.keys(M).forEach(function(w) {
if ("require" !== w && "advanced" !== w && "mediaSource" !== w) {
var _ = "object" == typeof M[w] ? M[w] : {
ideal: M[w]
};
void 0 !== _.exact && "number" == typeof _.exact && (_.min = _.max = _.exact);
var O = function(U, G) {
return U ? U + G.charAt(0).toUpperCase() + G.slice(1) : "deviceId" === G ? "sourceId" : G
};
if (void 0 !== _.ideal) {
D.optional = D.optional || [];
var I = {};
"number" == typeof _.ideal ? (I[O("min", w)] = _.ideal, D.optional.push(I), I = {}, I[O("max", w)] = _.ideal, D.optional.push(I)) : (I[O("", w)] = _.ideal, D.optional.push(I))
}
void 0 !== _.exact && "number" != typeof _.exact ? (D.mandatory = D.mandatory || {}, D.mandatory[O("", w)] = _.exact) : ["min", "max"].forEach(function(U) {
void 0 !== _[U] && (D.mandatory = D.mandatory || {}, D.mandatory[O(U, w)] = _[U])
})
}
}), M.advanced && (D.optional = (D.optional || []).concat(M.advanced)), D
},
x = function(M, D) {
if (M = JSON.parse(JSON.stringify(M)), M && M.audio && (M.audio = S(M.audio)), M && "object" == typeof M.video) {
var w = M.video.facingMode;
w = w && ("object" == typeof w ? w : {
ideal: w
});
var _ = 61 > P.version;
if (w && ("user" === w.exact || "environment" === w.exact || "user" === w.ideal || "environment" === w.ideal) && !(navigator.mediaDevices.getSupportedConstraints && navigator.mediaDevices.getSupportedConstraints().facingMode && !_)) {
delete M.video.facingMode;
var O;
if ("environment" === w.exact || "environment" === w.ideal ? O = "back" : ("user" === w.exact || "user" === w.ideal) && (O = "front"), O) return navigator.mediaDevices.enumerateDevices().then(function(I) {
I = I.filter(function(G) {
return "videoinput" === G.kind
});
var U = I.find(function(G) {
return -1 !== G.label.toLowerCase().indexOf(O)
});
return U && (M.video.deviceId = w.exact ? {
exact: U.deviceId
} : {
ideal: U.deviceId
}), M.video = S(M.video), T("chrome: " + JSON.stringify(M)), D(M)
})
}
M.video = S(M.video)
}
return T("chrome: " + JSON.stringify(M)), D(M)
},
k = function(M) {
return {
name: {
PermissionDeniedError: "NotAllowedError",
ConstraintNotSatisfiedError: "OverconstrainedError"
}[M.name] || M.name,
message: M.message,
constraint: M.constraintName,
toString: function() {
return this.name + (this.message && ": ") + this.message
}
}
};
navigator.getUserMedia = function(M, D, w) {
x(M, function(_) {
navigator.webkitGetUserMedia(_, D, function(O) {
w(k(O))
})
})
};
var R = function(M) {
return new Promise(function(D, w) {
navigator.getUserMedia(M, D, w)
})
};
if (navigator.mediaDevices || (navigator.mediaDevices = {
getUserMedia: R,
enumerateDevices: function() {
return new Promise(function(M) {
var D = {
audio: "audioinput",
video: "videoinput"
};
return MediaStreamTrack.getSources(function(w) {
M(w.map(function(_) {
return {
label: _.label,
kind: D[_.kind],
deviceId: _.id,
groupId: ""
}
}))
})
})
},
getSupportedConstraints: function() {
return {
deviceId: !0,
echoCancellation: !0,
facingMode: !0,
frameRate: !0,
height: !0,
width: !0
}
}
}), !navigator.mediaDevices.getUserMedia) navigator.mediaDevices.getUserMedia = function(M) {
return R(M)
};
else {
var L = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);
navigator.mediaDevices.getUserMedia = function(M) {
return x(M, function(D) {
return L(D).then(function(w) {
if (D.audio && !w.getAudioTracks().length || D.video && !w.getVideoTracks().length) throw w.getTracks().forEach(function(_) {
_.stop()
}), new DOMException("", "NotFoundError");
return w
}, function(w) {
return Promise.reject(k(w))
})
})
}
}
"undefined" == typeof navigator.mediaDevices.addEventListener && (navigator.mediaDevices.addEventListener = function() {
T("Dummy mediaDevices.addEventListener called.")
}), "undefined" == typeof navigator.mediaDevices.removeEventListener && (navigator.mediaDevices.removeEventListener = function() {
T("Dummy mediaDevices.removeEventListener called.")
})
}
}, {
"../utils.js": 10
}],
5: [function(y, C) {
"use strict";
function T(E) {
var R = E.filter(function(M) {
return "audio" === M.kind
}),
L = E.filter(function(M) {
return "video" === M.kind
});
for (E = []; R.length || L.length;) R.length && E.push(R.shift()), L.length && E.push(L.shift());
return E
}
function P(E) {
var R = !1;
return E = JSON.parse(JSON.stringify(E)), E.filter(function(L) {
if (L && (L.urls || L.url)) {
var M = L.urls || L.url;
L.url && !L.urls && console.warn("RTCIceServer.url is deprecated! Use urls instead.");
var D = "string" == typeof M;
return D && (M = [M]), M = M.filter(function(w) {
var _ = 0 === w.indexOf("turn:") && -1 !== w.indexOf("transport=udp") && -1 === w.indexOf("turn:[") && !R;
return _ ? (R = !0, !0) : 0 === w.indexOf("stun:") && 14393 <= x.version
}), delete L.url, L.urls = D ? M[0] : M, !!M.length
}
return !1
})
}
var S = y("sdp"),
x = y("../utils").browserDetails,
k = {
shimPeerConnection: function() {
if (window.RTCIceGatherer && (window.RTCIceCandidate || (window.RTCIceCandidate = function(R) {
return R
}), window.RTCSessionDescription || (window.RTCSessionDescription = function(R) {
return R
}), 15025 > x.version)) {
var E = Object.getOwnPropertyDescriptor(MediaStreamTrack.prototype, "enabled");
Object.defineProperty(MediaStreamTrack.prototype, "enabled", {
set: function(R) {
E.set.call(this, R);
var L = new Event("enabled");
L.enabled = R, this.dispatchEvent(L)
}
})
}
window.RTCPeerConnection = function(R) {
var L = this,
M = document.createDocumentFragment();
if (["addEventListener", "removeEventListener", "dispatchEvent"].forEach(function(D) {
L[D] = M[D].bind(M)
}), this.onicecandidate = null, this.onaddstream = null, this.ontrack = null, this.onremovestream = null, this.onsignalingstatechange = null, this.oniceconnectionstatechange = null, this.onicegatheringstatechange = null, this.onnegotiationneeded = null, this.ondatachannel = null, this.canTrickleIceCandidates = null, this.localStreams = [], this.remoteStreams = [], this.getLocalStreams = function() {
return L.localStreams
}, this.getRemoteStreams = function() {
return L.remoteStreams
}, this.localDescription = new RTCSessionDescription({
type: "",
sdp: ""
}), this.remoteDescription = new RTCSessionDescription({
type: "",
sdp: ""
}), this.signalingState = "stable", this.iceConnectionState = "new", this.iceGatheringState = "new", this.iceOptions = {
gatherPolicy: "all",
iceServers: []
}, R && R.iceTransportPolicy) switch (R.iceTransportPolicy) {
case "all":
case "relay":
this.iceOptions.gatherPolicy = R.iceTransportPolicy;
break;
default:
}
this.usingBundle = R && "max-bundle" === R.bundlePolicy, R && R.iceServers && (this.iceOptions.iceServers = P(R.iceServers)), this._config = R || {}, this.transceivers = [], this._localIceCandidatesBuffer = []
}, window.RTCPeerConnection.prototype._emitGatheringStateChange = function() {
var R = new Event("icegatheringstatechange");
this.dispatchEvent(R), null !== this.onicegatheringstatechange && this.onicegatheringstatechange(R)
}, window.RTCPeerConnection.prototype._emitBufferedCandidates = function() {
var R = this,
L = S.splitSections(R.localDescription.sdp);
this._localIceCandidatesBuffer.forEach(function(M) {
var D = !M.candidate || 0 === Object.keys(M.candidate).length;
if (D)
for (var w = 1; w < L.length; w++) - 1 === L[w].indexOf("\r\na=end-of-candidates\r\n") && (L[w] += "a=end-of-candidates\r\n");
else L[M.candidate.sdpMLineIndex + 1] += "a=" + M.candidate.candidate + "\r\n";
if (R.localDescription.sdp = L.join(""), R.dispatchEvent(M), null !== R.onicecandidate && R.onicecandidate(M), !M.candidate && "complete" !== R.iceGatheringState) {
var _ = R.transceivers.every(function(O) {
return O.iceGatherer && "completed" === O.iceGatherer.state
});
_ && "complete" !== R.iceGatheringStateChange && (R.iceGatheringState = "complete", R._emitGatheringStateChange())
}
}), this._localIceCandidatesBuffer = []
}, window.RTCPeerConnection.prototype.getConfiguration = function() {
return this._config
}, window.RTCPeerConnection.prototype.addStream = function(R) {
if (15025 <= x.version) this.localStreams.push(R);
else {
var L = R.clone();
R.getTracks().forEach(function(M, D) {
var w = L.getTracks()[D];
M.addEventListener("enabled", function(_) {
w.enabled = _.enabled
})
}), this.localStreams.push(L)
}
this._maybeFireNegotiationNeeded()
}, window.RTCPeerConnection.prototype.removeStream = function(R) {
var L = this.localStreams.indexOf(R); - 1 < L && (this.localStreams.splice(L, 1), this._maybeFireNegotiationNeeded())
}, window.RTCPeerConnection.prototype.getSenders = function() {
return this.transceivers.filter(function(R) {
return !!R.rtpSender
}).map(function(R) {
return R.rtpSender
})
}, window.RTCPeerConnection.prototype.getReceivers = function() {
return this.transceivers.filter(function(R) {
return !!R.rtpReceiver
}).map(function(R) {
return R.rtpReceiver
})
}, window.RTCPeerConnection.prototype._getCommonCapabilities = function(R, L) {
var M = {
codecs: [],
headerExtensions: [],
fecMechanisms: []
},
D = function(_, O) {
_ = parseInt(_, 10);
for (var I = 0; I < O.length; I++)
if (O[I].payloadType === _ || O[I].preferredPayloadType === _) return O[I]
},
w = function(_, O, I, U) {
var G = D(_.parameters.apt, I),
A = D(O.parameters.apt, U);
return G && A && G.name.toLowerCase() === A.name.toLowerCase()
};
return R.codecs.forEach(function(_) {
for (var I, O = 0; O < L.codecs.length; O++)
if (I = L.codecs[O], _.name.toLowerCase() === I.name.toLowerCase() && _.clockRate === I.clockRate) {
if ("rtx" === _.name.toLowerCase() && _.parameters && I.parameters.apt && !w(_, I, R.codecs, L.codecs)) continue;
I = JSON.parse(JSON.stringify(I)), I.numChannels = Math.min(_.numChannels, I.numChannels), M.codecs.push(I), I.rtcpFeedback = I.rtcpFeedback.filter(function(U) {
for (var G = 0; G < _.rtcpFeedback.length; G++)
if (_.rtcpFeedback[G].type === U.type && _.rtcpFeedback[G].parameter === U.parameter) return !0;
return !1
});
break
}
}), R.headerExtensions.forEach(function(_) {
for (var I, O = 0; O < L.headerExtensions.length; O++)
if (I = L.headerExtensions[O], _.uri === I.uri) {
M.headerExtensions.push(I);
break
}
}), M
}, window.RTCPeerConnection.prototype._createIceAndDtlsTransports = function(R, L) {
var M = this,
D = new RTCIceGatherer(M.iceOptions),
w = new RTCIceTransport(D);
D.onlocalcandidate = function(O) {
var I = new Event("icecandidate");
I.candidate = {
sdpMid: R,
sdpMLineIndex: L
};
var U = O.candidate,
G = !U || 0 === Object.keys(U).length;
G ? void 0 === D.state && (D.state = "completed") : (U.component = "RTCP" === w.component ? 2 : 1, I.candidate.candidate = S.writeCandidate(U));
var A = S.splitSections(M.localDescription.sdp);
A[I.candidate.sdpMLineIndex + 1] += G ? "a=end-of-candidates\r\n" : "a=" + I.candidate.candidate + "\r\n", M.localDescription.sdp = A.join("");
var F = M._pendingOffer ? M._pendingOffer : M.transceivers,
N = F.every(function(B) {
return B.iceGatherer && "completed" === B.iceGatherer.state
});
switch (M.iceGatheringState) {
case "new":
G || M._localIceCandidatesBuffer.push(I), G && N && M._localIceCandidatesBuffer.push(new Event("icecandidate"));
break;
case "gathering":
M._emitBufferedCandidates(), G || (M.dispatchEvent(I), null !== M.onicecandidate && M.onicecandidate(I)), N && (M.dispatchEvent(new Event("icecandidate")), null !== M.onicecandidate && M.onicecandidate(new Event("icecandidate")), M.iceGatheringState = "complete", M._emitGatheringStateChange());
break;
case "complete":
break;
default:
}
}, w.onicestatechange = function() {
M._updateConnectionState()
};
var _ = new RTCDtlsTransport(w);
return _.ondtlsstatechange = function() {
M._updateConnectionState()
}, _.onerror = function() {
_.state = "failed", M._updateConnectionState()
}, {
iceGatherer: D,
iceTransport: w,
dtlsTransport: _
}
}, window.RTCPeerConnection.prototype._disposeIceAndDtlsTransports = function(R) {
var L = this.transceivers[R].iceGatherer;
L && (delete L.onlocalcandidate, delete this.transceivers[R].iceGatherer);
var M = this.transceivers[R].iceTransport;
M && (delete M.onicestatechange, delete this.transceivers[R].iceTransport);
var D = this.transceivers[R].dtlsTransport;
D && (delete D.ondtlssttatechange, delete D.onerror, delete this.transceivers[R].dtlsTransport)
}, window.RTCPeerConnection.prototype._transceive = function(R, L, M) {
var D = this._getCommonCapabilities(R.localCapabilities, R.remoteCapabilities);
L && R.rtpSender && (D.encodings = R.sendEncodingParameters, D.rtcp = {
cname: S.localCName,
compound: R.rtcpParameters.compound
}, R.recvEncodingParameters.length && (D.rtcp.ssrc = R.recvEncodingParameters[0].ssrc), R.rtpSender.send(D)), M && R.rtpReceiver && ("video" === R.kind && R.recvEncodingParameters && 15019 > x.version && R.recvEncodingParameters.forEach(function(w) {
delete w.rtx
}), D.encodings = R.recvEncodingParameters, D.rtcp = {
cname: R.rtcpParameters.cname,
compound: R.rtcpParameters.compound
}, R.sendEncodingParameters.length && (D.rtcp.ssrc = R.sendEncodingParameters[0].ssrc), R.rtpReceiver.receive(D))
}, window.RTCPeerConnection.prototype.setLocalDescription = function(R) {
var M, D, L = this;
if ("offer" === R.type) this._pendingOffer && (M = S.splitSections(R.sdp), D = M.shift(), M.forEach(function(U, G) {
var A = S.parseRtpParameters(U);
L._pendingOffer[G].localCapabilities = A
}), this.transceivers = this._pendingOffer, delete this._pendingOffer);
else if ("answer" === R.type) {
M = S.splitSections(L.remoteDescription.sdp), D = M.shift();
var w = 0 < S.matchPrefix(D, "a=ice-lite").length;
M.forEach(function(U, G) {
var A = L.transceivers[G],
F = A.iceGatherer,
N = A.iceTransport,
B = A.dtlsTransport,
V = A.localCapabilities,
H = A.remoteCapabilities,
z = "0" === U.split("\n", 1)[0].split(" ", 2)[1];
if (!z && !A.isDatachannel) {
var q = S.getIceParameters(U, D),
W = S.getDtlsParameters(U, D);
w && (W.role = "server"), L.usingBundle && 0 !== G || (N.start(F, q, w ? "controlling" : "controlled"), B.start(W));
var K = L._getCommonCapabilities(V, H);
L._transceive(A, 0 < K.codecs.length, !1)
}
})
}
switch (this.localDescription = {
type: R.type,
sdp: R.sdp
}, R.type) {
case "offer":
this._updateSignalingState("have-local-offer");
break;
case "answer":
this._updateSignalingState("stable");
break;
default:
throw new TypeError("unsupported type \"" + R.type + "\"");
}
var _ = 1 < arguments.length && "function" == typeof arguments[1];
if (_) {
var O = arguments[1];
window.setTimeout(function() {
O(), "new" === L.iceGatheringState && (L.iceGatheringState = "gathering", L._emitGatheringStateChange()), L._emitBufferedCandidates()
}, 0)
}
var I = Promise.resolve();
return I.then(function() {
_ || ("new" === L.iceGatheringState && (L.iceGatheringState = "gathering", L._emitGatheringStateChange()), window.setTimeout(L._emitBufferedCandidates.bind(L), 500))
}), I
}, window.RTCPeerConnection.prototype.setRemoteDescription = function(R) {
var L = this,
M = {},
D = [],
w = S.splitSections(R.sdp),
_ = w.shift(),
O = 0 < S.matchPrefix(_, "a=ice-lite").length,
I = 0 < S.matchPrefix(_, "a=group:BUNDLE ").length,
U = S.matchPrefix(_, "a=ice-options:")[0];
switch (this.canTrickleIceCandidates = !!U && 0 <= U.substr(14).split(" ").indexOf("trickle"), w.forEach(function(G, A) {
var F = S.splitLines(G),
N = F[0].substr(2).split(" "),
B = N[0],
V = "0" === N[1],
H = S.getDirection(G, _),
z = S.parseMsid(G),
q = S.matchPrefix(G, "a=mid:");
if (q = q.length ? q[0].substr(6) : S.generateIdentifier(), "application" === B && "DTLS/SCTP" === N[2]) return void(L.transceivers[A] = {
mid: q,
isDatachannel: !0
});
var W, K, X, Q, J, Y, Z, $, ee, re, ne, ie, ae = S.parseRtpParameters(G);
V || (ne = S.getIceParameters(G, _), ie = S.getDtlsParameters(G, _), ie.role = "client"), $ = S.parseRtpEncodingParameters(G);
var se = S.parseRtcpParameters(G),
oe = 0 < S.matchPrefix(G, "a=end-of-candidates", _).length,
de = S.matchPrefix(G, "a=candidate:").map(function(le) {
return S.parseCandidate(le)
}).filter(function(le) {
return "1" === le.component
});
if ("offer" === R.type && !V) {
var ce = I && 0 < A ? {
iceGatherer: L.transceivers[0].iceGatherer,
iceTransport: L.transceivers[0].iceTransport,
dtlsTransport: L.transceivers[0].dtlsTransport
} : L._createIceAndDtlsTransports(q, A);
if (oe && (!I || 0 === A) && ce.iceTransport.setRemoteCandidates(de), ee = RTCRtpReceiver.getCapabilities(B), 15019 > x.version && (ee.codecs = ee.codecs.filter(function(le) {
return "rtx" !== le.name
})), Z = [{
ssrc: 1001 * (2 * A + 2)
}], ("sendrecv" === H || "sendonly" === H) && (Y = new RTCRtpReceiver(ce.dtlsTransport, B), re = Y.track, z ? (!M[z.stream] && (M[z.stream] = new MediaStream, Object.defineProperty(M[z.stream], "id", {
get: function() {
return z.stream
}
})), Object.defineProperty(re, "id", {
get: function() {
return z.track
}
}), M[z.stream].addTrack(re), D.push([re, Y, M[z.stream]])) : (!M.default && (M.default = new MediaStream), M.default.addTrack(re), D.push([re, Y, M.default]))), 0 < L.localStreams.length && L.localStreams[0].getTracks().length >= A) {
var pe;
"audio" === B ? pe = L.localStreams[0].getAudioTracks()[0] : "video" === B && (pe = L.localStreams[0].getVideoTracks()[0]), pe && (15019 <= x.version && "video" === B && (Z[0].rtx = {
ssrc: 1001 * (2 * A + 2) + 1
}), J = new RTCRtpSender(pe, ce.dtlsTransport))
}
L.transceivers[A] = {
iceGatherer: ce.iceGatherer,
iceTransport: ce.iceTransport,
dtlsTransport: ce.dtlsTransport,
localCapabilities: ee,
remoteCapabilities: ae,
rtpSender: J,
rtpReceiver: Y,
kind: B,
mid: q,
rtcpParameters: se,
sendEncodingParameters: Z,
recvEncodingParameters: $
}, L._transceive(L.transceivers[A], !1, "sendrecv" === H || "sendonly" === H)
} else "answer" !== R.type || V || (I && 0 < A && (L._disposeIceAndDtlsTransports(A), L.transceivers[A].iceGatherer = L.transceivers[0].iceGatherer, L.transceivers[A].iceTransport = L.transceivers[0].iceTransport, L.transceivers[A].dtlsTransport = L.transceivers[0].dtlsTransport), W = L.transceivers[A], K = W.iceGatherer, X = W.iceTransport, Q = W.dtlsTransport, J = W.rtpSender, Y = W.rtpReceiver, Z = W.sendEncodingParameters, ee = W.localCapabilities, L.transceivers[A].recvEncodingParameters = $, L.transceivers[A].remoteCapabilities = ae, L.transceivers[A].rtcpParameters = se, (O || oe) && de.length && X.setRemoteCandidates(de), I && 0 !== A || (X.start(K, ne, "controlling"), Q.start(ie)), L._transceive(W, "sendrecv" === H || "recvonly" === H, "sendrecv" === H || "sendonly" === H), Y && ("sendrecv" === H || "sendonly" === H) ? (re = Y.track, D.push([re, Y]), z ? (!M[z.stream] && (M[z.stream] = new MediaStream), M[z.stream].addTrack(re)) : (!M.default && (M.default = new MediaStream), M.default.addTrack(re))) : delete W.rtpReceiver)
}), this.usingBundle = I, this.remoteDescription = {
type: R.type,
sdp: R.sdp
}, R.type) {
case "offer":
this._updateSignalingState("have-remote-offer");
break;
case "answer":
this._updateSignalingState("stable");
break;
default:
throw new TypeError("unsupported type \"" + R.type + "\"");
}
return Object.keys(M).forEach(function(G) {
var A = M[G];
if (A.getTracks().length) {
L.remoteStreams.push(A);
var F = new Event("addstream");
F.stream = A, L.dispatchEvent(F), null !== L.onaddstream && window.setTimeout(function() {
L.onaddstream(F)
}, 0), D.forEach(function(N) {
var B = N[0],
V = N[1];
if (A.id === N[2].id) {
var H = new Event("track");
H.track = B, H.receiver = V, H.streams = [A], L.dispatchEvent(H), null !== L.ontrack && window.setTimeout(function() {
L.ontrack(H)
}, 0)
}
})
}
}), 1 < arguments.length && "function" == typeof arguments[1] && window.setTimeout(arguments[1], 0), Promise.resolve()
}, window.RTCPeerConnection.prototype.close = function() {
this.transceivers.forEach(function(R) {
R.iceTransport && R.iceTransport.stop(), R.dtlsTransport && R.dtlsTransport.stop(), R.rtpSender && R.rtpSender.stop(), R.rtpReceiver && R.rtpReceiver.stop()
}), this._updateSignalingState("closed")
}, window.RTCPeerConnection.prototype._updateSignalingState = function(R) {
this.signalingState = R;
var L = new Event("signalingstatechange");
this.dispatchEvent(L), null !== this.onsignalingstatechange && this.onsignalingstatechange(L)
}, window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded = function() {
var R = new Event("negotiationneeded");
this.dispatchEvent(R), null !== this.onnegotiationneeded && this.onnegotiationneeded(R)
}, window.RTCPeerConnection.prototype._updateConnectionState = function() {
var L, R = this,
M = {
new: 0,
closed: 0,
connecting: 0,
checking: 0,
connected: 0,
completed: 0,
failed: 0
};
if (this.transceivers.forEach(function(w) {
M[w.iceTransport.state]++, M[w.dtlsTransport.state]++
}), M.connected += M.completed, L = "new", 0 < M.failed ? L = "failed" : 0 < M.connecting || 0 < M.checking ? L = "connecting" : 0 < M.disconnected ? L = "disconnected" : 0 < M.new ? L = "new" : (0 < M.connected || 0 < M.completed) && (L = "connected"), L !== R.iceConnectionState) {
R.iceConnectionState = L;
var D = new Event("iceconnectionstatechange");
this.dispatchEvent(D), null !== this.oniceconnectionstatechange && this.oniceconnectionstatechange(D)
}
}, window.RTCPeerConnection.prototype.createOffer = function() {
var R = this;
if (this._pendingOffer) throw new Error("createOffer called while there is a pending offer.");
var L;
1 === arguments.length && "function" != typeof arguments[0] ? L = arguments[0] : 3 === arguments.length && (L = arguments[2]);
var M = [],
D = 0,
w = 0;
if (this.localStreams.length && (D = this.localStreams.reduce(function(U, G) {
return U + G.getAudioTracks().length
}, 0), w = this.localStreams.reduce(function(U, G) {
return U + G.getVideoTracks().length
}, 0)), L) {
if (L.mandatory || L.optional) throw new TypeError("Legacy mandatory/optional constraints not supported.");
void 0 !== L.offerToReceiveAudio && (D = L.offerToReceiveAudio), void 0 !== L.offerToReceiveVideo && (w = L.offerToReceiveVideo)
}
for (this.localStreams.forEach(function(U) {
U.getTracks().forEach(function(G) {
M.push({
kind: G.kind,
track: G,
stream: U,
wantReceive: "audio" === G.kind ? 0 < D : 0 < w
}), "audio" === G.kind ? D-- : "video" === G.kind && w--
})
}); 0 < D || 0 < w;) 0 < D && (M.push({
kind: "audio",
wantReceive: !0
}), D--), 0 < w && (M.push({
kind: "video",
wantReceive: !0
}), w--);
M = T(M);
var _ = S.writeSessionBoilerplate(),
O = [];
M.forEach(function(U, G) {
var A = U.track,
F = U.kind,
N = S.generateIdentifier(),
B = R.usingBundle && 0 < G ? {
iceGatherer: O[0].iceGatherer,
iceTransport: O[0].iceTransport,
dtlsTransport: O[0].dtlsTransport
} : R._createIceAndDtlsTransports(N, G),
V = RTCRtpSender.getCapabilities(F);
15019 > x.version && (V.codecs = V.codecs.filter(function(W) {
return "rtx" !== W.name
})), V.codecs.forEach(function(W) {
"H264" === W.name && void 0 === W.parameters["level-asymmetry-allowed"] && (W.parameters["level-asymmetry-allowed"] = "1")
});
var H, z, q = [{
ssrc: 1001 * (2 * G + 1)
}];
A && (15019 <= x.version && "video" === F && (q[0].rtx = {
ssrc: 1001 * (2 * G + 1) + 1
}), H = new RTCRtpSender(A, B.dtlsTransport)), U.wantReceive && (z = new RTCRtpReceiver(B.dtlsTransport, F)), O[G] = {
iceGatherer: B.iceGatherer,
iceTransport: B.iceTransport,
dtlsTransport: B.dtlsTransport,
localCapabilities: V,
remoteCapabilities: null,
rtpSender: H,
rtpReceiver: z,
kind: F,
mid: N,
sendEncodingParameters: q,
recvEncodingParameters: null
}
}), "max-compat" !== this._config.bundlePolicy && (_ += "a=group:BUNDLE " + O.map(function(U) {
return U.mid
}).join(" ") + "\r\n"), _ += "a=ice-options:trickle\r\n", M.forEach(function(U, G) {
var A = O[G];
_ += S.writeMediaSection(A, A.localCapabilities, "offer", U.stream), _ += "a=rtcp-rsize\r\n"
}), this._pendingOffer = O;
var I = new RTCSessionDescription({
type: "offer",
sdp: _
});
return arguments.length && "function" == typeof arguments[0] && window.setTimeout(arguments[0], 0, I), Promise.resolve(I)
}, window.RTCPeerConnection.prototype.createAnswer = function() {
var R = this,
L = S.writeSessionBoilerplate();
this.usingBundle && (L += "a=group:BUNDLE " + this.transceivers.map(function(D) {
return D.mid
}).join(" ") + "\r\n"), this.transceivers.forEach(function(D) {
if (D.isDatachannel) return void(L += "m=application 0 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=mid:" + D.mid + "\r\n");
var w = R._getCommonCapabilities(D.localCapabilities, D.remoteCapabilities),
_ = w.codecs.filter(function(O) {
return "rtx" === O.name.toLowerCase()
}).length;
!_ && D.sendEncodingParameters[0].rtx && delete D.sendEncodingParameters[0].rtx, L += S.writeMediaSection(D, w, "answer", R.localStreams[0]), D.rtcpParameters && D.rtcpParameters.reducedSize && (L += "a=rtcp-rsize\r\n")
});
var M = new RTCSessionDescription({
type: "answer",
sdp: L
});
return arguments.length && "function" == typeof arguments[0] && window.setTimeout(arguments[0], 0, M), Promise.resolve(M)
}, window.RTCPeerConnection.prototype.addIceCandidate = function(R) {
if (!R) {
for (var L = 0; L < this.transceivers.length; L++)
if (this.transceivers[L].iceTransport.addRemoteCandidate({}), this.usingBundle) return Promise.resolve();
} else {
var M = R.sdpMLineIndex;
if (R.sdpMid)
for (var D = 0; D < this.transceivers.length; D++)
if (this.transceivers[D].mid === R.sdpMid) {
M = D;
break
}
var w = this.transceivers[M];
if (w) {
var _ = 0 < Object.keys(R.candidate).length ? S.parseCandidate(R.candidate) : {};
if ("tcp" === _.protocol && (0 === _.port || 9 === _.port)) return Promise.resolve();
if ("1" !== _.component) return Promise.resolve();
w.iceTransport.addRemoteCandidate(_);
var O = S.splitSections(this.remoteDescription.sdp);
O[M + 1] += (_.type ? R.candidate.trim() : "a=end-of-candidates") + "\r\n", this.remoteDescription.sdp = O.join("")
}
}
return 1 < arguments.length && "function" == typeof arguments[1] && window.setTimeout(arguments[1], 0), Promise.resolve()
}, window.RTCPeerConnection.prototype.getStats = function() {
var R = [];
this.transceivers.forEach(function(D) {
["rtpSender", "rtpReceiver", "iceGatherer", "iceTransport", "dtlsTransport"].forEach(function(w) {
D[w] && R.push(D[w].getStats())
})
});
var L = 1 < arguments.length && "function" == typeof arguments[1] && arguments[1],
M = function(D) {
return {
inboundrtp: "inbound-rtp",
outboundrtp: "outbound-rtp",
candidatepair: "candidate-pair",
localcandidate: "local-candidate",
remotecandidate: "remote-candidate"
}[D.type] || D.type
};
return new Promise(function(D) {
var w = new Map;
Promise.all(R).then(function(_) {
_.forEach(function(O) {
Object.keys(O).forEach(function(I) {
O[I].type = M(O[I]), w.set(I, O[I])
})
}), L && window.setTimeout(L, 0, w), D(w)
})
})
}
},
shimReplaceTrack: function() {
window.RTCRtpSender && !("replaceTrack" in RTCRtpSender.prototype) && (RTCRtpSender.prototype.replaceTrack = RTCRtpSender.prototype.setTrack)
}
};
C.exports = {
shimPeerConnection: k.shimPeerConnection,
shimGetUserMedia: y("./getusermedia"),
shimReplaceTrack: k.shimReplaceTrack
}
}, {
"../utils": 10,
"./getusermedia": 6,
sdp: 1
}],
6: [function(y, C) {
"use strict";
C.exports = function() {
var T = function(S) {
return {
name: {
PermissionDeniedError: "NotAllowedError"
}[S.name] || S.name,
message: S.message,
constraint: S.constraint,
toString: function() {
return this.name
}
}
},
P = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);
navigator.mediaDevices.getUserMedia = function(S) {
return P(S).catch(function(x) {
return Promise.reject(T(x))
})
}
}
}, {}],
7: [function(y, C) {
"use strict";
var T = y("../utils").browserDetails,
P = {
shimOnTrack: function() {
"object" == typeof window && window.RTCPeerConnection && !("ontrack" in window.RTCPeerConnection.prototype) && Object.defineProperty(window.RTCPeerConnection.prototype, "ontrack", {
get: function() {
return this._ontrack
},
set: function(S) {
this._ontrack && (this.removeEventListener("track", this._ontrack), this.removeEventListener("addstream", this._ontrackpoly)), this.addEventListener("track", this._ontrack = S), this.addEventListener("addstream", this._ontrackpoly = function(x) {
x.stream.getTracks().forEach(function(k) {
var E = new Event("track");
E.track = k, E.receiver = {
track: k
}, E.streams = [x.stream], this.dispatchEvent(E)
}.bind(this))
}.bind(this))
}
})
},
shimSourceObject: function() {
"object" == typeof window && window.HTMLMediaElement && !("srcObject" in window.HTMLMediaElement.prototype) && Object.defineProperty(window.HTMLMediaElement.prototype, "srcObject", {
get: function() {
return this.mozSrcObject
},
set: function(S) {
this.mozSrcObject = S
}
})
},
shimPeerConnection: function() {
if ("object" == typeof window && (window.RTCPeerConnection || window.mozRTCPeerConnection)) {
window.RTCPeerConnection || (window.RTCPeerConnection = function(R, L) {
if (38 > T.version && R && R.iceServers) {
for (var w, M = [], D = 0; D < R.iceServers.length; D++)
if (w = R.iceServers[D], w.hasOwnProperty("urls"))
for (var O, _ = 0; _ < w.urls.length; _++) O = {
url: w.urls[_]
}, 0 === w.urls[_].indexOf("turn") && (O.username = w.username, O.credential = w.credential), M.push(O);
else M.push(R.iceServers[D]);
R.iceServers = M
}
return new mozRTCPeerConnection(R, L)
}, window.RTCPeerConnection.prototype = mozRTCPeerConnection.prototype, mozRTCPeerConnection.generateCertificate && Object.defineProperty(window.RTCPeerConnection, "generateCertificate", {
get: function() {
return mozRTCPeerConnection.generateCertificate
}
}), window.RTCSessionDescription = mozRTCSessionDescription, window.RTCIceCandidate = mozRTCIceCandidate), ["setLocalDescription", "setRemoteDescription", "addIceCandidate"].forEach(function(R) {
var L = RTCPeerConnection.prototype[R];
RTCPeerConnection.prototype[R] = function() {
return arguments[0] = new("addIceCandidate" === R ? RTCIceCandidate : RTCSessionDescription)(arguments[0]), L.apply(this, arguments)
}
});
var S = RTCPeerConnection.prototype.addIceCandidate;
RTCPeerConnection.prototype.addIceCandidate = function() {
return arguments[0] ? S.apply(this, arguments) : (arguments[1] && arguments[1].apply(null), Promise.resolve())
};
var x = function(R) {
var L = new Map;
return Object.keys(R).forEach(function(M) {
L.set(M, R[M]), L[M] = R[M]
}), L
},
k = {
inboundrtp: "inbound-rtp",
outboundrtp: "outbound-rtp",
candidatepair: "candidate-pair",
localcandidate: "local-candidate",
remotecandidate: "remote-candidate"
},
E = RTCPeerConnection.prototype.getStats;
RTCPeerConnection.prototype.getStats = function(R, L, M) {
return E.apply(this, [R || null]).then(function(D) {
if (48 > T.version && (D = x(D)), 53 > T.version && !L) try {
D.forEach(function(w) {
w.type = k[w.type] || w.type
})
} catch (w) {
if ("TypeError" !== w.name) throw w;
D.forEach(function(_, O) {
D.set(O, Object.assign({}, _, {
type: k[_.type] || _.type
}))
})
}
return D
}).then(L, M)
}
}
}
};
C.exports = {
shimOnTrack: P.shimOnTrack,
shimSourceObject: P.shimSourceObject,
shimPeerConnection: P.shimPeerConnection,
shimGetUserMedia: y("./getusermedia")
}
}, {
"../utils": 10,
"./getusermedia": 8
}],
8: [function(y, C) {
"use strict";
var T = y("../utils").log,
P = y("../utils").browserDetails;
C.exports = function() {
var S = function(L) {
return {
name: {
NotSupportedError: "TypeError",
SecurityError: "NotAllowedError",
PermissionDeniedError: "NotAllowedError"
}[L.name] || L.name,
message: {
"The operation is insecure.": "The request is not allowed by the user agent or the platform in the current context."
}[L.message] || L.message,
constraint: L.constraint,
toString: function() {
return this.name + (this.message && ": ") + this.message
}
}
},
x = function(L, M, D) {
var w = function(_) {
if ("object" != typeof _ || _.require) return _;
var O = [];
return Object.keys(_).forEach(function(I) {
if ("require" !== I && "advanced" !== I && "mediaSource" !== I) {
var U = _[I] = "object" == typeof _[I] ? _[I] : {
ideal: _[I]
};
if ((void 0 !== U.min || void 0 !== U.max || void 0 !== U.exact) && O.push(I), void 0 !== U.exact && ("number" == typeof U.exact ? U.min = U.max = U.exact : _[I] = U.exact, delete U.exact), void 0 !== U.ideal) {
_.advanced = _.advanced || [];
var G = {};
G[I] = "number" == typeof U.ideal ? {
min: U.ideal,
max: U.ideal
} : U.ideal, _.advanced.push(G), delete U.ideal, Object.keys(U).length || delete _[I]
}
}
}), O.length && (_.require = O), _
};
return L = JSON.parse(JSON.stringify(L)), 38 > P.version && (T("spec: " + JSON.stringify(L)), L.audio && (L.audio = w(L.audio)), L.video && (L.video = w(L.video)), T("ff37: " + JSON.stringify(L))), navigator.mozGetUserMedia(L, M, function(_) {
D(S(_))
})
};
if (navigator.mediaDevices || (navigator.mediaDevices = {
getUserMedia: function(L) {
return new Promise(function(M, D) {
x(L, M, D)
})
},
addEventListener: function() {},
removeEventListener: function() {}
}), navigator.mediaDevices.enumerateDevices = navigator.mediaDevices.enumerateDevices || function() {
return new Promise(function(L) {
L([{
kind: "audioinput",
deviceId: "default",
label: "",
groupId: ""
}, {
kind: "videoinput",
deviceId: "default",
label: "",
groupId: ""
}])
})
}, 41 > P.version) {
var E = navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);
navigator.mediaDevices.enumerateDevices = function() {
return E().then(void 0, function(L) {
if ("NotFoundError" === L.name) return [];
throw L
})
}
}
if (49 > P.version) {
var R = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);
navigator.mediaDevices.getUserMedia = function(L) {
return R(L).then(function(M) {
if (L.audio && !M.getAudioTracks().length || L.video && !M.getVideoTracks().length) throw M.getTracks().forEach(function(D) {
D.stop()
}), new DOMException("The object can not be found here.", "NotFoundError");
return M
}, function(M) {
return Promise.reject(S(M))
})
}
}
navigator.getUserMedia = function(L, M, D) {
return 44 > P.version ? x(L, M, D) : void(console.warn("navigator.getUserMedia has been replaced by navigator.mediaDevices.getUserMedia"), navigator.mediaDevices.getUserMedia(L).then(M, D))
}
}
}, {
"../utils": 10
}],
9: [function(y, C) {
"use strict";
var T = {
shimOnAddStream: function() {
"object" == typeof window && window.RTCPeerConnection && !("onaddstream" in window.RTCPeerConnection.prototype) && Object.defineProperty(window.RTCPeerConnection.prototype, "onaddstream", {
get: function() {
return this._onaddstream
},
set: function(P) {
this._onaddstream && (this.removeEventListener("addstream", this._onaddstream), this.removeEventListener("track", this._onaddstreampoly)), this.addEventListener("addstream", this._onaddstream = P), this.addEventListener("track", this._onaddstreampoly = function(S) {
var x = S.streams[0];
if (this._streams || (this._streams = []), !(0 <= this._streams.indexOf(x))) {
this._streams.push(x);
var k = new Event("addstream");
k.stream = S.streams[0], this.dispatchEvent(k)
}
}.bind(this))
}
})
},
shimGetUserMedia: function() {
navigator.getUserMedia || (navigator.webkitGetUserMedia ? navigator.getUserMedia = navigator.webkitGetUserMedia.bind(navigator) : navigator.mediaDevices && navigator.mediaDevices.getUserMedia && (navigator.getUserMedia = function(P, S, x) {
navigator.mediaDevices.getUserMedia(P).then(S, x)
}.bind(navigator)))
}
};
C.exports = {
shimOnAddStream: T.shimOnAddStream,
shimGetUserMedia: T.shimGetUserMedia
}
}, {}],
10: [function(y, C) {
"use strict";
var T = !0,
P = {
disableLog: function(S) {
return "boolean" == typeof S ? (T = S, S ? "adapter.js logging disabled" : "adapter.js logging enabled") : new Error("Argument type: " + typeof S + ". Please use a boolean.")
},
log: function() {
if ("object" == typeof window) {
if (T) return;
"undefined" != typeof console && "function" == typeof console.log && console.log.apply(console, arguments)
}
},
extractVersion: function(S, x, k) {
var E = S.match(x);
return E && E.length >= k && parseInt(E[k], 10)
},
detectBrowser: function() {
var S = {
browser: null,
version: null
};
if ("undefined" == typeof window || !window.navigator) return S.browser = "Not a browser.", S;
if (navigator.mozGetUserMedia) S.browser = "firefox", S.version = this.extractVersion(navigator.userAgent, /Firefox\/(\d+)\./, 1);
else if (navigator.webkitGetUserMedia) {
if (window.webkitRTCPeerConnection) S.browser = "chrome", S.version = this.extractVersion(navigator.userAgent, /Chrom(e|ium)\/(\d+)\./, 2);
else if (navigator.userAgent.match(/Version\/(\d+).(\d+)/)) S.browser = "safari", S.version = this.extractVersion(navigator.userAgent, /AppleWebKit\/(\d+)\./, 1);
else return S.browser = "Unsupported webkit-based browser with GUM support but no WebRTC support.", S;
} else if (navigator.mediaDevices && navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) S.browser = "edge", S.version = this.extractVersion(navigator.userAgent, /Edge\/(\d+).(\d+)$/, 2);
else if (navigator.mediaDevices && navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) S.browser = "safari", S.version = this.extractVersion(navigator.userAgent, /AppleWebKit\/(\d+)\./, 1);
else return S.browser = "Not a supported browser.", S;
return S
},
shimCreateObjectURL: function() {
if ("object" == typeof window && window.HTMLMediaElement && "srcObject" in window.HTMLMediaElement.prototype) {
var S = URL.createObjectURL.bind(URL),
x = URL.revokeObjectURL.bind(URL),
k = new Map,
E = 0;
URL.createObjectURL = function(M) {
if ("getTracks" in M) {
var D = "polyblob:" + ++E;
return k.set(D, M), console.log("URL.createObjectURL(stream) is deprecated! Use elem.srcObject = stream instead!"), D
}
return S(M)
}, URL.revokeObjectURL = function(M) {
x(M), k.delete(M)
};
var R = Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype, "src");
Object.defineProperty(window.HTMLMediaElement.prototype, "src", {
get: function() {
return R.get.apply(this)
},
set: function(M) {
return this.srcObject = k.get(M) || null, R.set.apply(this, [M])
}
});
var L = HTMLMediaElement.prototype.setAttribute;
HTMLMediaElement.prototype.setAttribute = function() {
return 2 === arguments.length && "src" === ("" + arguments[0]).toLowerCase() && (this.srcObject = k.get(arguments[1]) || null), L.apply(this, arguments)
}
}
}
};
C.exports = {
log: P.log,
disableLog: P.disableLog,
browserDetails: P.detectBrowser(),
extractVersion: P.extractVersion,
shimCreateObjectURL: P.shimCreateObjectURL,
detectBrowser: P.detectBrowser.bind(P)
}
}, {}]
}, {}, [2])(2)
});
</script>
<script>
(function() {
"use strict";
class a {
constructor(b, c, d, f, g) {
this.videolist = b, this.chatroom = b.chatroom, this.app = b.chatroom.app, this.EventBus = b.chatroom.app.EventBus, this.handle = c, this.outgoing = d, this.sdp = g, this.mediaStream = null, this.iceStateLast = "", this.iceConnectedCount = 0;
let j = this;
this.rtc = new RTCPeerConnection({
rtcpMuxPolicy: "require",
bundlePolicy: "max-bundle",
iceServers: [{
urls: f
}]
}, {}), this.rtc.onicecandidate = function(k) {
j.onICE_Candidate(k)
}, this.rtc.oniceconnectionstatechange = function(k) {
j.onICE_ConnectionStateChange(k)
}, this.rtc.onaddstream = function(k) {
j.onAddStream(k)
}, this.rtc.onremovestream = k => {
j.onRemoveStream(k)
}
}
get ingoing() {
return !this.outgoing
}
Connect() {
this.outgoing ? this._sendOfferPublisher() : this._sendOfferRemote()
}
Close() {
if (null != this.rtc) {
let b = this.rtc;
this.rtc = null, null != this.mediaStream && (this.mediaStream.active && "closed" !== b.signalingState && "function" == typeof b.removeStream && b.removeStream(this.mediaStream), this.mediaStream.stop(), this.mediaStream = null), "closed" !== b.signalingState && b.close(), console.log("MediaConnection.SignalingState: " + b.signalingState + " ->>> Close")
}
}
AddStream(b) {
this.rtc.addStream(b), this.mediaStream = b
}
onICE_Candidate(b) {
if (console.log(b.candidate), null != b.candidate && "object" == typeof b.candidate && "string" == typeof b.candidate.candidate) {
var c = this.chatroom.tcPkt_Trickle(this.handle, b.candidate.candidate);
this.chatroom.packetWorker.send(c)
}
}
onICE_ConnectionStateChange(b) {
console.log(b);
let c = TinychatApp.BLL.BroadcastProgressEvent,
d = b.target;
if (null != d) {
switch (d.iceConnectionState) {
case "starting":
break;
case "checking":
break;
case "completed":
break;
case "connected":
if (this.outgoing && 0 === this.iceConnectedCount) {
console.log("Broadcast: Started Successfully"), this.videolist.AddVideoSelf(this.handle, this.mediaStream);
let f = new c(c.MEDIA_STARTED_SUCCESS);
this.EventBus.broadcast(c.ID, f)
}
this.iceConnectedCount += 1;
break;
case "disconnected":
break;
case "failed":
console.error(b);
case "closed":
if (this.outgoing) {
this.videolist.RemoveVideoSelf(this.handle);
let f = new c(c.MEDIA_STOPED);
this.EventBus.broadcast(c.ID, f)
} else this.videolist.RemoveVideoRemote(this.handle);
}
this.iceStateLast = d.iceConnectionState
}
}
onAddStream(b) {
return this.outgoing ? void console.log("Broadcast: LocalMedia.Added (" + this.handle + ")!!!") : void(console.log("Broadcast: RemoteMedia.Added (" + this.handle + ")!!!"), this.videolist.AddVideoRemote(this.handle, b.stream))
}
onRemoveStream() {
return this.outgoing ? void console.log("Broadcast: LocalMedia.Removed (" + this.handle + ")!!!") : void(console.log("Broadcast: RemoteMedia.Removed (" + this.handle + ")!!!"), this.videolist.RemoveVideoRemote(this.handle, event.stream))
}
_sendOfferPublisher() {
let b = this;
this.rtc.createOffer({
offerToReceiveAudio: !1,
offerToReceiveVideo: !1
}).then(function(d) {
b.rtc.setLocalDescription(d), console.log({
sdp: d.sdp
});
var f = b.chatroom.tcPkt_SDP(d.type, d.sdp, 0, function(g) {
b._onOfferPublisher(g)
});
b.chatroom.packetWorker.send(f)
}, function(d) {
console.error(d);
let f = TinychatApp.BLL.BroadcastProgressEvent,
g = new f(f.MEDIA_RTC_FAILED);
g.error = d, this.EventBus.broadcast(f.ID, g)
})
}
_onOfferPublisher(b) {
if (this.chatroom.tcPkt_TcCallbackCheck(b, "sdp"))
if (!0 === b.success) console.log({
sdp: b.sdp
}), this.rtc.setRemoteDescription(new RTCSessionDescription({
type: b.type,
sdp: b.sdp
}));
else {
if (void 0 !== b.reason && null !== b.reason)
if (16 === b.reason.code) {
let c = b.timeout.timeToReadable();
60 < b.timeout ? this.app.showToastWarn(`${b.reason.text}, you can try to broadcast again in ${c}`, 4e3) : this.app.showToast(`${b.reason.text}, you can try to broadcast again in ${c}`, 4e3)
} else 18 === b.reason.code && this.app.showToast(b.reason.text, 3e3);
this.rtc.close()
}
}
_sendOfferRemote() {
let b = this;
this.rtc.setRemoteDescription(new RTCSessionDescription({
type: "offer",
sdp: this.sdp
})).then(function() {
return b.rtc.remoteDescription
}).then(function() {
b.rtc.createAnswer().then(function(c) {
return b.rtc.setLocalDescription(c)
}).then(function() {
let c = b.rtc.localDescription.type,
d = b.rtc.localDescription.sdp,
f = b.handle;
var g = b.chatroom.tcPkt_SDP(c, d, f, function() {});
b.chatroom.packetWorker.send(g)
}).catch(function(c) {
console.error(c)
})
}).catch(function(c) {
console.error(c)
})
}
_onOfferRemote(b) {
this.chatroom.tcPkt_TcCallbackCheck(b, "sdp") && (!0 !== b.success && this.Close(), console.log("Broadcast: RemoteMedia.SDP ..."))
}
}
window.TinychatApp.BLL.MediaConnection = a
})();
</script>
<script>
(function() {
'use strict';
let a = null;
class c {
constructor(m, n, o) {
this.debug = o, o && (window.DEBUG = o), this.EventBus = new EventBus, this._version = new l(2, 0, 0, 24, o), window.rootDir = this._version.rootDir(), this.defaultChatroom = null, console.log('App.useragent - ' + this.useragent), this.tc_token = m, this.loginState = null, this.LoginInfo(n), this.showShareHandler = null, this.showMediaFiltersHandler = null, this.showMediaSettingsHandler = null, this.showSettingsHandler = null, this.showUpgradeHandler = null, this.showNotificationHandler = null, this.showUserProfile = null, this.showBanlistHandler = null, this.showYoutubeHandler = null, this.showMobileAppHandler = null
}
static getInstance(m, n, o) {
return null == a && (a = new c(m, n, o)), a
}
static get RegExp_Nickname() {
return /\w+/ig
}
static get url() {
return 'https://tinychat.com'
}
static url_avatar(m) {
var m = m == void 0 ? 'guest' : m;
return 'https://upload.tinychat.com' + '/pic/' + encodeURI(m)
}
static url_api_v1_0() {
return c.url + '/api/v1.0'
}
static url_api_login_info() {
return this.url_api_v1_0() + '/user/info'
}
static url_api_room_token(m) {
return this.url_api_v1_0() + '/room/token/' + encodeURI(m)
}
static url_api_settings_switchclient(m) {
return '/settings/version/' + encodeURI(m)
}
static url_api_userprofile(m) {
var m = m == void 0 ? 'guest' : m;
return this.url_api_v1_0() + '/user/profile?username=' + encodeURI(m)
}
static url_api_follow() {
return this.url + '/user/follow'
}
get version() {
return this._version
}
get useragent() {
return this._version.userAgent()
}
get settings() {
return TinychatApp.BLL.SettingsFeature.getInstance(this.EventBus)
}
get _tracker() {
return TinychatApp.BLL.Tracker.getInstance()
}
get _router() {
return TinychatApp.BLL.Router.getInstance()
}
get _api() {
return WebAPI.getInstance()
}
get _cookie() {
return CookieUtils
}
isDebug() {
return this.debug
}
GetChatroom(m) {
if (this.isDebug() && console.warn('App.isDebug'), void 0 == m) throw new Exception('Roomname is empty');
let n = this.settings.getSettings();
return this.defaultChatroom = new TinychatApp.BLL.ChatRoom(this, this.tc_token, m, n.nickname), this.defaultChatroom
}
GiveAGift(m) {
'string' == typeof m && 0 < m.length ? this._router.GiveAGift(m) : this._router.GiveAGift()
}
LiveDirectory() {
this._router.LiveDirectory()
}
EarnCoins() {
this._router.EarnCoins()
}
UpgradeSub() {
this._router.UpgradeSub()
}
SwitchClientVersion() {
let m = this;
this._api.wsj({
src: m.url_api_settings_switchclient('old')
}).then(o => {
console.log(o), window.location.reload()
}).catch(o => {
console.error(o), m.showToastWarn('Some unknown server error occurred')
})
}
PromoteRoom() {
this._router.PromoteRoom()
}
Login() {
this._router.Login()
}
Register() {
this._router.Register()
}
Logout() {
this._router.Logout()
}
Share() {
Object.isFunc(this.showShareHandler) && this.showShareHandler()
}
Banlist() {
Object.isFunc(this.showBanlistHandler) && this.showBanlistHandler()
}
Youtube() {
Object.isFunc(this.showYoutubeHandler) && this.showYoutubeHandler()
}
MediaFilters() {
Object.isFunc(this.showMediaFiltersHandler) && this.showMediaFiltersHandler()
}
MediaSettings(m) {
Object.isFunc(this.showMediaSettingsHandler) && this.showMediaSettingsHandler(m)
}
Settings() {
Object.isFunc(this.showSettingsHandler) && this.showSettingsHandler()
}
Upgrade(m) {
Object.isFunc(this.showUpgradeHandler) && this.showUpgradeHandler(m)
}
Notify(m, n) {
Object.isFunc(this.showNotificationHandler) && this.showNotificationHandler(m, n)
}
MoblileApp(m) {
Object.isFunc(this.showMobileAppHandler) && this.showMobileAppHandler(m)
}
DevNews() {
this._router.DevNews()
}
WebSettings() {
this._router.WebSettings()
}
GoGooglePlay() {
this._router.GooglePlay()
}
GoAppStore() {
this._router.AppStore()
}
UserProfile(m) {
Object.isFunc(this.showUserProfile) && this.showUserProfile(m)
}
LoginInfo(m) {
var n = this;
if ('object' == typeof m) {
let o = m,
p = new TinychatApp.DAL.LoginUserInfoEntity,
q = new TinychatApp.DAL.LoginResultEntity;
return q.loggedIn = o.loggedIn, q.loginName = o.username, q.userInfo = p, void this.OnLoginInfo(q)
}
this._api.wsj({
src: c.url_api_login_info()
}).then(function(o) {
let p = new TinychatApp.DAL.LoginResultEntity;
if (p.errorcode = o.result, p.errormsg = o.message, 'success' == o.result) {
var q = new TinychatApp.DAL.LoginUserInfoEntity;
p.usersuggestion = o.username, p.userInfo = q, n.OnLoginInfo(p)
}
let s = n._parseLoginCookies();
p.loggedIn = null != s, p.loginName = null == s ? '' : s.login_name;
let t = n.loginState,
u = new g(t, p);
n.EventBus.broadcast(g.ID, u)
}).catch(function(o) {
console.error(o)
})
}
OnLoginInfo(m) {
this.loginState = m == void 0 ? null : m
}
LoginState() {
return this.loginState
}
IsLoggedIn() {
return null != this.loginState && this.loginState.loggedIn
}
LoginName() {
return null == this.loginState ? null : this.loginState.loginName
}
IsFree() {
return !(null != this.loginState) || !(null != this.loginState.userInfo) || 0 === this.loginState.userInfo.stype
}
GetAvatarUrl(m) {
return c.url_avatar(m)
}
Follow(m, n, o) {
return this._api.wsj({
src: c.url_api_follow(),
params: {
event: 1,
favourite: m
}
}, !0).then(function(p) {
Object.isFunc(n) && n(p)
}).catch(function(p) {
console.error(p), Object.isFunc(o) && o(p)
})
}
GetProfile(m, n, o) {
return this._api.wsj({
src: c.url_api_userprofile(m)
}).then(function(p) {
if ('success' != p.result) return !1;
let q = new TinychatApp.DAL.UserProfileEntity;
q.username = p.username, q.biography = p.biography, q.gender = p.gender, q.age = p.age, q.location = p.location, q.role = p.role, q.stype = p.stype, q.avatarUrl = p.avatarUrl, q.achieveUrl = p.achieveUrl, q.percentToNextAchieve = p.percentToNextAchieve, q.giftpoints = p.giftpoints;
let s = p.virtualgifts,
t = [];
Array.isArray(s) && Object.keys(s).forEach(u => {
let v = new TinychatApp.DAL.GiftEntity,
w = s[u];
v.giftUrl = w.imageSource, v.giftName = w.name, t.push(v)
}), q.gifts = t, Object.isFunc(n) && n(q)
}).catch(function(p) {
console.error(p), Object.isFunc(o) && o(p)
})
}
IsValidNickname(m) {
if ('string' != typeof m) return !1;
if (1 > m.length) return !1;
var n = c.RegExp_Nickname.exec(m);
return null == n || n.input.length != n[0].length ? !1 : !0
}
IsValidRoomname(m) {
return this.IsValidNickname(m)
}
ReconnectDefaultChatroom() {
this.defaultChatroom ? this.defaultChatroom.Reconnect() : window.location.reload()
}
showToastLurker() {
let m = this,
n = Toast.TYPE.WARN,
s = new j(n, 'You\'re in view-only mode. Reconnect and solve captcha...', 4e3, () => {
m.ReconnectDefaultChatroom()
}, 'Solve Captcha');
this.EventBus.broadcast(j.ID, s)
}
showToastWarn(m, n = 2e3) {
let o = Toast.TYPE.WARN,
q = new j(o, m, n, null);
this.EventBus.broadcast(j.ID, q)
}
showToast(m, n = 2e3) {
let q = new j('', m, n, null);
this.EventBus.broadcast(j.ID, q)
}
_readLoginState() {
let m = this._parseLoginCookies(),
n = new TinychatApp.DAL.LoginResultEntity;
return n.loggedIn = null != m, n.loginName = null == m ? '' : m.login_name, n
}
_parseLoginCookies() {
try {
let m = this._cookie.getCookie('pass'),
n = this._cookie.getCookie('user'),
o = this._cookie.getCookie('hash'),
p = new k;
if (p.login_hash = o, p.login_passhash = m, p.login_name = n, void 0 != p.login_hash && 'string' == typeof p.login_hash && void 0 != p.login_passhash && 'string' == typeof p.login_passhash && void 0 != p.login_name && 'string' == typeof p.login_name) return p
} catch (m) {}
return null
}
}
const d = 'LoginStateChangedEvent_' + Math.Guid.newGuid();
class g {
static get ID() {
return d
}
constructor(m, n) {
return this.beforeState = m, this.loginState = n, this
}
}
const h = 'ToastEvent_' + Math.Guid.newGuid();
class j {
static get ID() {
return h
}
constructor(m, n, o, p, q) {
return this.type = m, this.text = n, this.wait = o, this.ok_handler = p, this.ok_text = q, this
}
}
class k {
constructor() {
this.login_hash = '', this.login_passhash = '', this.login_name = ''
}
}
class l {
constructor(m, n, o, p, q) {
this.app_name = 'Tinychat', this.major = m, this.minor = n, this.patch = o, this.build = p, this.debug = q != void 0 && q
}
toString() {
return this.shortTitle()
}
userAgent() {
return this.format('{0}-client-webrtc-{3}-{1}-{2}').toLowerCase()
}
shortTitle() {
return this.format('v{1} ({2})')
}
title() {
return this.format('{0} for WebRTC v{1} ({2})')
}
rootDir() {
return this.format('/webrtc/{1}-{2}')
}
format(m) {
m = m == void 0 ? '{0} for WebRTC v{1} ({2}-{3})' : m;
let o = this.major + '.' + this.minor + '.' + this.patch + (this.debug ? '~d' : ''),
p = this.getBrowser() + '_' + navigator.platform,
q = this.build;
return m.format(this.app_name, o, q, p)
}
getBrowser() {
try {
var n, o = n.width
} catch (q) {
var p = q.toString();
return -1 === p.search('not an object') ? -1 === p.search('Cannot read') ? -1 === p.search('e is undefined') ? -1 === p.search('Unable to get property \'width\' of undefined or null reference') ? -1 === p.search('cannot convert e into object') ? void 0 : 'opera' : document.documentMode || !window.StyleMedia ? 'IE' : 'edge' : 'firefox' : 'chrome' : 'safari'
}
}
}
c.BLL = window.TinychatApp.BLL, c.DAL = window.TinychatApp.DAL, c.BLL.LoginStateChangedEvent = g, c.BLL.ToastEvent = j, window.TinychatApp = c
})();
</script>
<script>
(function() {
'use strict';
var a = window.TinychatApp || {};
a.UI = {}, window.TinychatApp = a
})();
</script>
<script>
(function() {
"use strict";
const a = "UISideMenuToggle_" + Math.Guid.newGuid();
class b {
static get ID() {
return a
}
constructor() {
return this
}
}
const c = "UIChatlogWiderToggle_" + Math.Guid.newGuid();
class d {
static get ID() {
return c
}
constructor() {
return this
}
}
window.TinychatApp.UI.UISideMenuToggle = b, window.TinychatApp.UI.UIChatlogWiderToggle = d
})();
</script>
<dom-module id="client-toast" assetpath="../../styles/"><template><style>#toast{position:fixed;display:flex;flex-direction:row;justify-content:center;height:80px;min-height:80px;width:100%;top:-80px;left:0;padding:0 30px;box-sizing:border-box;font-size:0;background-color:rgba(0, 0, 0, .8);text-align:center;z-index:6;transition:top .2s;}#toast.show{top:0;}#toast.error{background-color:#e53951;}#toast.accept{background-color:#38cd57;}#toast.warning{background-color:#f29e1f;}#toast-text{display:inline-block;font-size:16px;font-weight:600;color:#fff;vertical-align:middle;}#toast-text:before,
#toast-buttons:before{content:'';display:inline-block;height:100%;width:0;vertical-align:middle;}#toast-text > span{display:inline-block;max-height:66px;line-height:22px;white-space:normal;vertical-align:middle;overflow:hidden;cursor:default;}#toast-buttons{white-space:nowrap;}#toast-buttons > *{display:inline-block;vertical-align:middle;}#toast-buttons > *:focus{outline:none;}#button-close{margin-left:4px;padding:10px;border:none;background:none;cursor:pointer;}#button-close > svg > path{transition:.2s;}#button-close:hover > svg > path{opacity:.8;}#button-close:active > svg > path{opacity:1;}#button-custom{margin-left:26px;padding:0 24px;border:1px solid #fff;font-size:12px;font-weight:700;color:#fff;line-height:30px;background:transparent;cursor:pointer;transition:background-color .2s,
color .2s;}#button-custom:hover{background-color:rgba(0, 0, 0, .8);}#toast.error #button-custom:hover{background-color:#fff;color:#e53951;}#toast.accept #button-custom:hover{background-color:#fff;color:#38cd57;}#toast.warning #button-custom:hover{background-color:#fff;color:#f29e1f;}</style></template></dom-module>
<dom-module id="tinychat-toast" assetpath="../ui/"><template strip-whitespace=""><style include="client-toast"></style><div id="toast"><div id="toast-text"><span>[[text]]</span></div><div id="toast-buttons"><button id="button-close" on-click="close"><svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#fff" fill-rule="evenodd" opacity=".5"></path></svg></button><dom-if if="[[ok_shown]]"><template strip-whitespace=""><button id="button-custom" on-click="onOK">[[ok_text]]</button></template></dom-if>
</div>
</div>
</template>
<script>
class Toast extends Polymer.Element {
static get is() {
return 'tinychat-toast'
}
static get properties() {
return {
type: String,
text: String,
wait: Number,
ok_handler: Object,
ok_text: {
type: String,
value: 'RETRY'
},
ok_shown: {
type: Boolean,
computed: 'ok_shown_func(ok_handler)'
}
}
}
static get TYPE() {
return {
INFO: '',
ERR: 'error',
CON: 'accept',
WARN: 'warning'
}
}
constructor() {
super()
}
get animationWait() {
return 250
}
connectedCallback() {
super.connectedCallback(), setTimeout(() => {
this.$.toast.classList.add('show')
}, 0), this.type.isEmpty() || this.$.toast.classList.add(this.type), 0 < this.wait && setTimeout(this.close.bind(this), this.wait)
}
disconnectedCallback() {
super.disconnectedCallback()
}
destroy() {
this.remove()
}
close() {
this.$.toast.classList.remove('show'), setTimeout(this.destroy.bind(this), this.animationWait)
}
onOK(a) {
Object.isFunc(this.ok_handler) && (this.ok_handler(), this.close(a))
}
ok_shown_func(a) {
return Object.isFunc(a)
}
}
customElements.define(Toast.is, Toast);
</script>
</dom-module>
<dom-module id="client-modal" assetpath="../../styles/"><template><style>#modal-window{position:fixed;height:100%;min-height:100%;width:100%;top:0;left:-100%;font-size:0;text-align:center;background-color:rgba(0, 0, 0, .8);overflow-y:scroll;white-space:nowrap;opacity:0;z-index:10;transition:opacity .2s;}#modal-window.modal-show{left:0;opacity:1;}#modal-window:before{content:"";display:inline-block;height:100%;width:0;vertical-align:middle;}#modal-content{position:relative;display:inline-block;width:100%;margin:50px auto;font-size:0;white-space:normal;vertical-align:middle;}#modal-content > *{display:none;}#modal-content > *:last-child{display:block;}</style></template></dom-module>
<dom-module id="tinychat-modal" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal"></style><div id="modal-window"><div id="modal-content"><slot></slot></div></div></template>
<script>
class Modal extends Polymer.Element {
static get is() {
return "tinychat-modal"
}
static get properties() {
return {
dialogs: {
type: Object,
value: {}
},
onkeydownHandler: Object,
onclickHandler: Object
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback(), this.onkeydownHandler = this.onkeydown.bind(this), this.onclickHandler = this.onclick.bind(this), document.addEventListener("keydown", this.onkeydownHandler), document.addEventListener("click", this.onclickHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener("keydown", this.onkeydownHandler), document.removeEventListener("click", this.onclickHandler)
}
onkeydown(a) {
a = a || window.event, 27 != a.keyCode && "Escape" != a.key && "Esc" != a.key
}
onclick() {}
isopen(a) {
let b = this.dialogs[a];
return !0 === b
}
open(a) {
let b = 0 >= Object.keys(this.dialogs).length;
this.dialogs[a] = !0, b && (document.body.classList.add("modal-show"), this.$["modal-window"].classList.add("modal-show"))
}
close(a, b) {
delete this.dialogs[a];
let c = 0 >= Object.keys(this.dialogs).length;
c && (document.body.classList.remove("modal-show"), this.$["modal-window"].classList.remove("modal-show")), this.removeChild(b)
}
}
customElements.define(Modal.is, Modal);
</script>
</dom-module>
<dom-module id="client-modal-loader" assetpath="../../styles/"><template><style>#modal-content-loading-eye{position:relative;height:160px;width:160px;margin:30px auto 0;font-size:0;white-space:nowrap;}#modal-content-loading-eye > svg{position:absolute;top:0;left:0;}#modal-content-loading-eye:before{content:"";display:inline-block;height:100%;width:0;vertical-align:middle;}#modal-content-loading-eyeball{position:relative;display:inline-block;height:114px;width:114px;margin-left:-10px;border-radius:100%;background-color:#fff;vertical-align:middle;transform-origin:67px 57px;animation:eye-rotation 1.2s linear 0s infinite;}@keyframes eye-rotation{0%{transform:rotate(0deg);}50%{transform:rotate(180deg);}100%{transform:rotate(360deg);}}#modal-content-loading-eyeball-pupil{position:absolute;height:58px;width:58px;top:27px;left:27px;margin-left:-14px;border-radius:100%;background-color:#000;animation:pupil-rotation 1.2s linear 0s infinite;}#modal-content-loading-eyeball-pupil:before{content:"";position:absolute;display:block;height:16px;width:16px;top:3px;left:3px;border-radius:100%;background-color:#fff;}@keyframes pupil-rotation{0%{transform:rotate(0deg);}50%{transform:rotate(-180deg);}100%{transform:rotate(-360deg);}}#modal-content-loading > span{display:block;padding-top:15px;font-size:20px;color:#fff;line-height:24px;text-align:center;}</style></template></dom-module>
<dom-module id="tinychat-loader" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-loader"></style><div id="modal-content-loading"><div id="modal-content-loading-eye"><svg width="162" height="162" viewBox="0 0 160 160" xmlns="http://www.w3.org/2000/svg"><path d="M157.975 152.5c-3.58-1.548-7.125-3.724-10.262-7.042-3.436-3.633-5.717-8.774-7.172-13.197C152.656 118.243 160 99.985 160 80c0-44.183-35.818-80-80-80C35.816 0 0 35.817 0 80s35.817 80 80 80c13.394 0 26.007-3.308 37.1-9.127 10.444 8.146 29.617 9.903 40.28 7.795 3.184-.63 3.566-4.882.595-6.167" fill="#04caff" fill-rule="evenodd"></path></svg><div id="modal-content-loading-eyeball"><div id="modal-content-loading-eyeball-pupil"></div></div></div><span>Connecting...</span></div></template>
<script>
class ModalLoader extends Polymer.Element {
static get is() {
return 'tinychat-loader'
}
static get properties() {
return {}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback()
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalLoader.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalLoader.is, this)
}
}
customElements.define(ModalLoader.is, ModalLoader);
</script>
</dom-module>
<dom-module id="client-modal-profile" assetpath="../../styles/"><template><style>.on-white-scroll,
.on-gray-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar,
.on-gray-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-gray-scroll::-webkit-scrollbar-track{background-color:#2d373a;}.on-white-scroll::-webkit-scrollbar-thumb,
.on-gray-scroll::-webkit-scrollbar-thumb{border-radius:6px/8px;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;background-color:rgba(0, 0, 0, .2);}.on-gray-scroll::-webkit-scrollbar-thumb{border:5px solid #2d373a;background-color:#5a6366;}.on-white-scroll::-webkit-scrollbar-thumb:hover,
.on-gray-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}.on-gray-scroll::-webkit-scrollbar-thumb:hover{background-color:#6f7b80;}#modal-content-profile{position:relative;width:100%;max-width:400px;height:610px;margin:0 auto;border-radius:4px;text-align:center;overflow:hidden;}#modal-content-profile:after{content:'';position:absolute;display:block;height:45px;bottom:0;left:20px;right:20px;border-radius:0 0 4px 4px;background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );pointer-events:none;}#modal-content-profile *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{fill:#fff;opacity:.6;transition:.2s;}#close-button:hover > path{fill:#fff;opacity:.8;}#close-button:active > path{fill:#fff;opacity:1;}#modal-content-profile-preview{height:225px;padding-top:40px;box-sizing:border-box;background-color:#969fa2;}#modal-content-profile.gold > #modal-content-profile-preview{background-color:#ffbe00;}#modal-content-profile.extreme > #modal-content-profile-preview{background-color:#ad6ed1;}#modal-content-profile.pro > #modal-content-profile-preview{background-color:#2ecb4e;}#profile-status{position:relative;display:inline-block;height:116px;width:116px;}#profile-status:before{content:'';position:absolute;display:block;height:100%;width:100%;border:4px solid rgba(0, 0, 0, .1);box-sizing:border-box;border-radius:100%;}#profile-status > svg{transform:rotate(180deg);}#profile-status > svg > circle{fill:transparent;stroke:#fff;stroke-width:4px;stroke-linecap:round;transition:stroke .5s,
stroke-dasharray 3s;}#profile-status > svg > circle[stroke-dasharray="0, 352"]{stroke:transparent;}#profile-status-avatar{position:absolute;height:100px;width:100px;top:8px;left:8px;border-radius:100%;overflow:hidden;}#profile-status-avatar > img{position:absolute;height:100%;left:-25px;opacity:0;visibility:hidden;}#profile-status-avatar > img.show{opacity:1;visibility:visible;}#profile-status-level{position:absolute;height:30px;width:30px;top:43px;left:-12px;padding:6px;border-radius:100%;box-sizing:border-box;background-color:#fff;opacity:0;visibility:hidden;transition:.2s;}#profile-status-level.show{opacity:1;visibility:visible;}#profile-status-level > img{height:18px;width:18px;}#profile-nickname{position:relative;display:flex;flex-direction:row;align-items:stretch;justify-content:center;margin:7px 0 29px;padding:0 30px;box-sizing:border-box;font-size:24px;font-weight:300;color:#fff;line-height:33px;white-space:nowrap;}#profile-nickname > span{position:relative;display:inline-block;max-width:100%;padding-right:15px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;}#profile-nickname > button{position:relative;display:inline-block;height:20px;top:8px;padding:0 8px;border-radius:2px;border:none;font-size:12px;font-weight:800;color:#41b7ef;background-color:#fff;text-transform:uppercase;line-height:20px;cursor:pointer;}#profile-nickname > button > svg{display:none;}#profile-nickname > button.pencil > svg{display:inline-block;margin-left:8px;}#profile-nickname > button > svg > path{fill:#41b7ef;}#modal-content-profile.gold #profile-nickname > button{color:#ffbe00;}#modal-content-profile.gold #profile-nickname > button > svg > path{fill:#ffbe00;}#modal-content-profile.extreme #profile-nickname > button{color:#ad6ed1;}#modal-content-profile.extreme #profile-nickname > button > svg > path{fill:#ad6ed1;}#modal-content-profile.pro #profile-nickname > button{color:#2ecb4e;}#modal-content-profile.pro #profile-nickname > button > svg > path{fill:#2ecb4e;}#modal-content-profile-info{position:relative;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;height:385px;background-color:#fff;}#profile-info{padding:20px 60px 10px;box-sizing:border-box;font-size:0;color:#fff;background-color:#b5bcbe;}#modal-content-profile.gold #profile-info{background-color:#ffd24c;}#modal-content-profile.extreme #profile-info{background-color:#c699df;}#modal-content-profile.pro #profile-info{background-color:#6cdb83;}#profile-info > div{max-width:100%;margin-bottom:10px;font-size:12px;font-weight:600;line-height:17px;}#profile-info > div + div{display:inline-block;max-height:17px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}#profile-info > div + div[title=""]{display:none;}#profile-info ~ *{padding-right:30px;padding-left:30px;}#modal-content-profile-info > h2{margin:0;padding-top:30px;padding-bottom:10px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;}#profile-gifts-text{padding-bottom:10px;font-size:12px;font-weight:600;color:#a0a0a0;line-height:17px;}#profile-gifts-coins{height:30px;padding-bottom:10px;font-size:18px;font-weight:700;color:#61686b;line-height:30px;}#profile-gifts-coins > *{display:inline-block;vertical-align:middle;}#profile-gifts-coins > span{margin:0 15px 0 4px;}#profile-gifts-coins > button{height:100%;padding:0 15px;border:1px solid #3cafe1;border-radius:30px;box-sizing:border-box;font-size:12px;color:#3cafe1;background-color:#fff;cursor:pointer;transition:.2s;}#profile-gifts-coins > button:hover{background-color:#d6f2ff;}#profile-gifts-coins > button:active{background-color:#c7e8f8;}#profile-gifts{padding-top:10px;padding-right:15px;padding-bottom:15px;font-size:0;}#profile-gifts > div{display:inline-block;width:33.33%;padding-bottom:30px;vertical-align:top;}#profile-gifts > div > *{display:inline-block;height:80px;width:80px;cursor:pointer;}#profile-gifts > div:first-child > a{border:1px solid #41b7ef;border-radius:100%;box-sizing:border-box;background-color:#fff;line-height:78px;transition:.2s;}#profile-gifts > div:first-child > a:hover{background-color:#d6f2ff;}#profile-gifts > div:first-child > a:active{background-color:#c7e8f8;}#profile-gifts > div:first-child > a > svg{vertical-align:middle;}#profile-gifts > div:first-child > a > svg > path{fill:#41b7ef;}#profile-gifts > div:first-child:only-child > a{border-color:transparent;background-color:#41b7ef;}#profile-gifts > div:first-child:only-child > a:hover{background-color:#54ccf3;}#profile-gifts > div:first-child:only-child > a:active{background-color:#38a8de;}#profile-gifts > div:first-child:only-child > a > svg > path{fill:#fff;}#profile-gifts > div > a > img{height:100%;width:100%;opacity:0;visibility:hidden;transition:.2s;}#profile-gifts > div > a > img.show{opacity:1;visibility:visible;}.waiting{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:inherit;background-color:#fff;opacity:0;visibility:hidden;transition:.2s;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}#modal-content-profile.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}#modal-content-profile.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}</style></template></dom-module>
<dom-module id="tinychat-profile" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-profile"></style><div id="modal-content-profile" class$="[[convertSubType(userprofile, isLoading)]]"><svg id="close-button" on-click="close" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><div id="modal-content-profile-preview"><div id="profile-status"><svg height="116px" width="116px"><circle cx="58" cy="58" r="56" stroke-dasharray="0, 352"></circle></svg><div id="profile-status-avatar"><img src="[[userprofile.avatarUrl]]" class$="[[convertShow(userprofile)]]" title$="[[userprofile.percentToNextAchieve]]"></div><div id="profile-status-level"><img src="[[userprofile.achieveUrl]]" class$="[[convertShow(userprofile)]]"></div></div><div id="profile-nickname"><span title="[[userprofile.username]]">[[userprofile.username]]</span> <button class$="[[convertUpgrade(userprofile)]]" on-click="onUpgrade"><span>[[convertUpgradeText(userprofile)]]</span> <svg width="10" height="10" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M0 7.915v2.083h2.083l6.144-6.143-2.083-2.083L0 7.915zm9.838-5.67c.216-.218.216-.568 0-.784l-1.3-1.3c-.217-.216-.567-.216-.784 0L6.738 1.178 8.82 3.26 9.84 2.244z" fill-rule="evenodd"></path></svg></button></div></div><div id="modal-content-profile-info"><div id="profile-info"><div>[[convertInfo(userprofile)]]</div><div title="[[userprofile.biography]]">[[userprofile.biography]]</div></div><h2>Virtual Gifts</h2><dom-if if="[[convertIsShownNoGifts(userprofile.gifts)]]"><template><div id="profile-gifts-text">[[userprofile.username]] has no Virtual Gifts.<br>Be the first!</div></template></dom-if>
<div id="profile-gifts-coins"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#f9d046" fill-rule="evenodd"></circle><path d="M14.873 14.53c.186.082.162.347-.037.387-.666.13-1.865.022-2.517-.487-.695.363-1.483.57-2.32.57-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.25-.46 2.39-1.216 3.266.09.277.233.598.448.825.196.208.418.344.64.44zM13.57 10c0-1.972-1.598-3.57-3.57-3.57-1.972 0-3.57 1.598-3.57 3.57 0 1.972 1.598 3.57 3.57 3.57 1.972 0 3.57-1.598 3.57-3.57zM10 8.163c1.014 0 1.837.823 1.837 1.837s-.823 1.837-1.837 1.837S8.163 11.014 8.163 10c0-.335.09-.648.248-.918.08.18.26.306.468.306.28 0 .51-.23.51-.51 0-.21-.126-.388-.306-.467.27-.156.583-.247.918-.247z" fill="#f5b822" fill-rule="evenodd"></path></svg> <span>[[userprofile.giftpoints]]</span> <button on-click="earncoinsTap">Earn Coins</button></div>
<div id="profile-gifts" class="on-white-scroll">
<div><a href="#" on-click="giveagiftTap"><svg width="32" height="31" viewBox="0 0 32 31" xmlns="http://www.w3.org/2000/svg"><path d="M19 5.167c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5h-4.167L19 9.333V5.167zm-3 .166v5.334h5.334c2.945 0 5.333-2.388 5.333-5.334C26.667 2.388 24.28 0 21.333 0 18.388 0 16 2.388 16 5.333zM13 5.167c0-1.38-1.12-2.5-2.5-2.5S8 3.787 8 5.167s1.12 2.5 2.5 2.5h4.167L13 9.333V5.167zm3 .166v5.334h-5.334c-2.945 0-5.333-2.388-5.333-5.334C5.333 2.388 7.72 0 10.667 0 13.612 0 16 2.388 16 5.333z" fill-rule="nonzero"></path><path d="M0 11.006C0 9.898.89 9 2.002 9h27.996C31.104 9 32 9.887 32 11.006V16H0v-4.994zM2 18h28v10.997C30 30.103 29.1 31 28.01 31H3.99C2.893 31 2 30.106 2 28.997V18z" fill-rule="evenodd"></path></svg></a></div>
<dom-repeat items="[[userprofile.gifts]]"><template strip-whitespace=""><div><a href="#" on-click="tapOnGift"><img src="[[item.giftUrl]]" class$="[[convertShow(userprofile)]]"></a></div></template></dom-repeat>
</div>
</div>
<div class="waiting">
<div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div>
</div>
</div>
</template>
<script>
class ModalProfile extends Polymer.Element {
static get is() {
return 'tinychat-profile'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
username: String,
userprofile: {
type: Object,
value: null
},
isLoading: {
type: Boolean,
value: !1
},
isError: {
type: Boolean,
value: !1
},
modaloptions: {
type: Object,
value: {
closable: !0,
escape: !0
}
},
onkeydownHandler: Object
}
}
constructor(a) {
super(), this.username = a
}
get app() {
return this.chatroom.app
}
connectedCallback() {
super.connectedCallback();
this;
this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
chatroomAssigned() {
let b = this,
c = this.app.EventBus;
b.isError = !1, b.isLoading = !0;
let d = this.$['profile-status-avatar'];
this.app.GetProfile(this.username, i => {
b.userprofile = i, b.isLoading = !1, d && d.setAttribute('stroke-dasharray', Math.ceil(352 * i.percentToNextAchieve / 100) + ', 352')
}, () => {
b.isError = !0, b.isLoading = !1
})
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalProfile.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalProfile.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalProfile.is) && this.parentNode.close(ModalProfile.is, this)
}
giveagiftTap() {
this.app.GiveAGift(this.userprofile.username)
}
earncoinsTap() {
this.app.EarnCoins()
}
tapOnGift() {}
onUpgrade() {
this.app.UpgradeSub()
}
convertIsShownNoGifts(a) {
return !(Array.isArray(a) && 0 < a.length)
}
convertSubType(a, b) {
var c = TinychatApp.BLL.User.getCssClass(a);
return b && (c += ' wait'), c
}
convertShow(a) {
var b = '';
return a instanceof TinychatApp.DAL.UserProfileEntity && (b = 'show'), b
}
convertGender(a) {
if ('F' == a) return 'Female';
return 'M' == a ? 'Male' : ''
}
convertLoc(a) {
return 'string' == typeof a ? a.toUpperCase() : a
}
convertUpgrade(a) {
if (!(a instanceof TinychatApp.DAL.UserProfileEntity)) return '';
var b = '';
return a.handle !== this.chatroom.self_handle || TinychatApp.BLL.User.isSubHighest(a.stype) || (b = 'pencil'), b
}
convertUpgradeText(a) {
if (!(a instanceof TinychatApp.DAL.UserProfileEntity)) return ' ';
var b = TinychatApp.BLL.User.getCssClass(a);
return '' == b && (b = 'upgrade'), b
}
convertInfo(a) {
if (!(a instanceof TinychatApp.DAL.UserProfileEntity)) return '';
let b = [],
c = this.convertGender(a.gender),
d = this.convertLoc(a.location);
return 0 < a.age && b.push(a.age), c.isEmpty() || b.push(c), d.isEmpty() || b.push(d), b.join(' \u2022 ')
}
}
customElements.define(ModalProfile.is, ModalProfile);
</script>
</dom-module>
<dom-module id="client-modal-reconnect" assetpath="../../styles/"><template><style>#modal-content-reconnect{width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-reconnect > *:focus{outline:none;}#modal-content-reconnect > h1{margin:0;padding-bottom:9px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-reconnect > span{display:block;padding-bottom:8px;font-size:12px;font-weight:400;color:#262626;line-height:16px;}#modal-content-reconnect > input[type="submit"]{height:40px;width:100%;margin-top:24px;border:none;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#41b7ef;cursor:pointer;transition:.2s;}#modal-content-reconnect > input[type="submit"]:hover{background-color:#54ccf3;}#modal-content-reconnect > input[type="submit"]:active{background-color:#38a8dd;}</style></template></dom-module>
<dom-module id="tinychat-reconnect" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-reconnect"></style><form id="modal-content-reconnect" on-submit="onOK"><dom-if if="[[convertReasonShown()]]"><template strip-whitespace=""><h1>[[lastReason]]</h1></template></dom-if>
<dom-if if="[[!convertReasonShown()]]"><template strip-whitespace=""><h1>Connection lost</h1></template></dom-if><span id="reconnect-text">Connection to the room was interrupted. Retrying to connect in [[waits]]...</span> <input type="submit" value$="[[actionText]]"></form>
</template>
<script>
class ModalReconnect extends Polymer.Element {
static get is() {
return 'tinychat-reconnect'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
tries: Number,
waitms: Number,
timems: Number,
timerid: Number,
waits: {
type: String,
computed: 'format(waitms, timems)'
},
lastReason: {
type: String,
computed: 'convertReason(chatroom)'
},
actionText: {
type: String,
computed: 'convertAction(chatroom)'
}
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback()
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalReconnect.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalReconnect.is, this), this.stop()
}
format(a, b) {
return void 0 == b && (b = 0), new String(Math.floor((a - b) / 1e3))
}
onOK(a) {
return a.preventDefault(), 3 === this.chatroom.closedLastReasonCode ? this.chatroom.app.Login() : this.retry(), !1
}
retry() {
this.stop(), this.chatroom.Reconnect()
}
start() {
let a = this,
b = 1e3;
this.timems = 0, this.timerid = setInterval(() => {
a.timems += b, a.timems + b >= a.waitms && a.stop()
}, b)
}
stop() {
clearInterval(this.timerid), this.timerid = 0
}
chatroomAssigned(a) {
let b = this,
c = this.chatroom.app.EventBus;
a.reconnect_timer ? (this.$['reconnect-text'].style.display = '', this.start()) : this.$['reconnect-text'].style.display = 'none'
}
convertReasonShown() {
return 0 < this.chatroom.closedLastReasonCode
}
convertReason(a) {
return TinychatApp.BLL.RoomQuitEvent.ConvertReason(a.closedLastReasonCode)
}
convertAction(a) {
return TinychatApp.BLL.RoomQuitEvent.ConvertAction(a.closedLastReasonCode)
}
}
customElements.define(ModalReconnect.is, ModalReconnect);
</script>
</dom-module>
<dom-module id="client-modal-permissions" assetpath="../../styles/"><template><style>#modal-content-permissions{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 30px 44px;border-radius:4px;box-sizing:border-box;background-color:#fff;text-align:center;}#modal-content-permissions > h2{margin:0;padding-bottom:10px;font-size:24px;font-weight:300;color:#363636;line-height:32px;}#modal-content-permissions > span{display:block;padding-bottom:10px;font-size:12px;color:#262626;line-height:16px;}#modal-content-permissions > .waiting{position:relative;height:40px;margin-top:15px;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite;-webkit-animation:waiting 1s ease-in-out 0s infinite;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}</style></template></dom-module>
<dom-module id="tinychat-permissions" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-permissions"></style><div id="modal-content-permissions"><h2>We need some permissions</h2><span>There are the dialog of the browser window. Please grant access.</span><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></template>
<script>
class ModalPermissions extends Polymer.Element {
static get is() {
return 'tinychat-permissions'
}
static get properties() {
return {
modaloptions: {
type: Object,
value: {}
}
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
connectedCallback() {
super.connectedCallback()
}
disconnectedCallback() {
super.disconnectedCallback()
}
chatroomAssigned() {
let b = this,
c = this.app.EventBus
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalPermissions.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalPermissions.is, this)
}
}
customElements.define(ModalPermissions.is, ModalPermissions);
</script>
</dom-module>
<dom-module id="client-modal-banlist" assetpath="../../styles/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-banlist{position:relative;width:100%;max-width:400px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-banlist *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-banlist > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#banlist-wrapper{position:relative;min-height:40px;max-height:360px;transition:.2s;}#banlist-wrapper:after{content:'';position:absolute;display:block;height:40px;bottom:0;left:0;right:15px;background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );pointer-events:none;}#banlist-wrapper.wait{max-height:40px;}#banlist-wrapper > .waiting{position:absolute;width:auto;top:0;bottom:0;left:0;right:0;background-color:#fff;z-index:1;opacity:0;visibility:hidden;transition:.2s;}#banlist-wrapper.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}#banlist-wrapper.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}#banlist-wrapper > ul > li:first-child{height:0;overflow:hidden;transition:.2s;}#banlist-wrapper > ul > li:only-of-type{height:40px;padding:0 0 0 15px;text-align:center;}#banlist-wrapper > ul{position:relative;max-height:inherit;width:100%;margin:0;padding:0 0 40px 0;box-sizing:border-box;text-align:left;}#banlist-wrapper > ul > li{position:relative;display:inline-block;height:40px;width:100%;padding:0 40px 0 20px;box-sizing:border-box;overflow:hidden;transition:background-color .2s,
height .5s;}#banlist-wrapper > ul > li.hidden{height:0;}#banlist-wrapper > ul > li + li:hover{background-color:#fde3e7;}#banlist-wrapper > ul > li > span{display:inline-block;height:40px;width:100%;font-size:14px;color:#414141;line-height:40px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;}#banlist-wrapper > ul > li > button{position:absolute;display:block;height:40px;width:40px;margin:0;padding:0;border:0;top:0;right:0;background-color:transparent;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCgk8cGF0aCBkPSJNNiA0LjVMMS41IDAgMCAxLjUgNC41IDYgMCAxMC41IDEuNSAxMiA2IDcuNWw0LjUgNC41IDEuNS0xLjVMNy41IDYgMTIgMS41IDEwLjUgMCIgZmlsbD0iI2U1Mzk1MSIgZmlsbC1ydWxlPSJldmVub2RkIi8+DQo8L3N2Zz4=");background-repeat:no-repeat;background-position:center center;cursor:pointer;opacity:0;visibility:hidden;transition:.2s;}#banlist-wrapper > ul > li:hover > button{opacity:1;visibility:visible;}</style></template></dom-module>
<dom-module id="tinychat-banlist" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-banlist"></style><div id="modal-content-banlist"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Banlist</h1><div id="banlist-wrapper"><ul class="on-white-scroll"><li><span>Ban List is empty</span></li><dom-repeat items="{{_items}}"><template strip-whitespace=""><li class$="[[convertLiClass(item)]]"><span>[[item.nickname]]</span> <button on-click="onDelete"></button></li></template></dom-repeat>
</ul>
<div class="waiting">
<div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div>
</div>
</div>
</div>
</template>
<script>
class ModalDialogBanlist extends Polymer.Element {
static get is() {
return 'tinychat-banlist'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
_items: {
type: Array,
value: []
},
onkeydownHandler: Object
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
get settings() {
return this.app.settings
}
connectedCallback() {
super.connectedCallback(), this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
chatroomAssigned() {
let b = this,
c = this.chatroom.app.EventBus;
b.$['banlist-wrapper'].classList.add('wait'), this.chatroom.Banlist(d => {
b.$['banlist-wrapper'].classList.remove('wait'), b.set('_items', Array.from(d))
})
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogBanlist.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogBanlist.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogBanlist.is) && this.close(a)
}
onDelete(a) {
let b = this,
c = this._items.indexOf(a.model.item),
d = Object.assign({}, a.model.item);
d.isDeleting = !0, b._items[c] = d, b.notifyPath('_items.' + c), this.chatroom.Unban(a.model.item), setTimeout(() => {
let f = this._items.indexOf(a.model.item);
b.splice('_items', f, 1)
}, 500)
}
convertLiClass(a) {
var b = '';
return a.isDeleting && (b += ' hidden'), b
}
}
customElements.define(ModalDialogBanlist.is, ModalDialogBanlist);
</script>
</dom-module>
<dom-module id="client-modal-changenickname" assetpath="../../styles/"><template><style>#modal-content-changenickname{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-changenickname > *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-changenickname.error > label{opacity:0;visibility:hidden;}#modal-content-changenickname.error > #error-text{opacity:1;visibility:visible;overflow:visible;}#modal-content-changenickname.error > input[type="text"]{border-color:#e53951;color:#e53951;}#modal-content-changenickname > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-changenickname > label{display:block;padding-bottom:4px;font-size:12px;font-weight:600;color:#414141;text-transform:uppercase;opacity:1;visibility:visible;transition:.2s;}#modal-content-changenickname > #error-text{position:relative;display:block;height:0;top:-21px;font-size:12px;font-weight:600;color:#e53951;opacity:0;visibility:hidden;overflow:hidden;transition:.2s;}#modal-content-changenickname > input[type="text"]{height:40px;width:100%;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;font-family:inherit;font-size:16px;font-weight:600;color:#414141;text-align:center;line-height:38px;letter-spacing:.5px;transition:.2s;}#modal-content-changenickname > input[type="submit"]{height:40px;width:100%;margin-top:24px;border:none;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#41b7ef;text-transform:uppercase;cursor:pointer;transition:.2s;}#modal-content-changenickname > input[type="submit"]:hover{background-color:#54ccf3;}#modal-content-changenickname > input[type="submit"]:active{background-color:#38a8dd;}</style></template></dom-module>
<dom-module id="tinychat-changenickname" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-changenickname"></style><form id="modal-content-changenickname" on-submit="onOK"><svg id="close-button" on-click="close" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>[[title]]</h1><label>YOUR NICKNAME</label><span id="error-text">[[error]]</span> <input id="nickname" type="text" on-click="onInput" placeholder="nickname" maxlength="32" value="{{nickname}}"> <input type="submit" value="[[positiveBtn]]"></form></template>
<script>
class ModalDialogChangeNickname extends Polymer.Element {
static get is() {
return 'tinychat-changenickname'
}
static get MODE_CHANGE() {
return 0
}
static get MODE_INUSE() {
return 1
}
static get MODE_SETTINGS() {
return 2
}
static get MODE_GUEST() {
return 3
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
nickname: String,
mode: {
type: Number,
observer: 'modeAssigned'
},
positiveBtn: {
type: String,
value: 'OK'
},
title: {
type: String,
value: 'Please enter nickname'
},
error: {
type: String,
value: ''
},
ok: Object,
notvalid: Object,
inuse: Object,
onkeydownHandler: Object
}
}
constructor(a) {
super(), this.mode = a
}
connectedCallback() {
super.connectedCallback();
this;
this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler), this.$.nickname.focus()
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
chatroomAssigned() {
let b = this,
c = this.chatroom.app.EventBus
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogChangeNickname.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogChangeNickname.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogChangeNickname.is) && this.parentNode.close(ModalDialogChangeNickname.is, this)
}
onInput() {
this.$['modal-content-changenickname'].classList.remove('error')
}
onOK(a) {
return (a.preventDefault(), Object.isFunc(this.notvalid) && this.notvalid(this.$.nickname.value)) ? (this.error = 'Invalid nickname (use _, A-Z and 0-9)', this.$['modal-content-changenickname'].classList.add('error'), !1) : Object.isFunc(this.inuse) && this.inuse(this.$.nickname.value) ? (this.error = 'Sorry, your nickname is already exist', this.$['modal-content-changenickname'].classList.add('error'), !1) : (Object.isFunc(this.ok) && this.ok(this.$.nickname.value), !1)
}
modeAssigned(a) {
let b = 'Enter Nickname',
c = 'Change Nickname',
g = 'Join Room';
a === ModalDialogChangeNickname.MODE_CHANGE ? (this.title = c, this.positiveBtn = 'Change') : a === ModalDialogChangeNickname.MODE_INUSE ? (this.title = b, this.positiveBtn = g, this.error = 'Your current nickname in use', this.$['modal-content-changenickname'].classList.add('error')) : a === ModalDialogChangeNickname.MODE_GUEST ? (this.title = b, this.positiveBtn = g) : a === ModalDialogChangeNickname.MODE_SETTINGS ? (this.title = this.nickname.isEmpty() ? b : c, this.positiveBtn = 'Save') : console.error('unknown mode')
}
}
customElements.define(ModalDialogChangeNickname.is, ModalDialogChangeNickname);
</script>
</dom-module>
<dom-module id="client-modal-notification" assetpath="../../styles/"><template><style>#modal-content-notification{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-notification > h1{margin:0;padding-bottom:10px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-notification > label{display:block;font-size:12px;line-height:1.33;text-align:center;color:#262626;transition:.2s;}#modal-content-notification > button{height:40px;width:100%;margin-top:32px;border:none;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#41b7ef;cursor:pointer;transition:.2s;}#modal-content-notification > button:hover{background-color:#54ccf3;}#modal-content-notification > button:active{background-color:#38a8dd;}#modal-content-notification *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;z-index:1;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}</style></template></dom-module>
<dom-module id="tinychat-notification" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-notification"></style><div id="modal-content-notification"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>[[title]]</h1><label>[[message]]</label><button on-click="close">[[btnMessage]]</button></div></template>
<script>
class ModalDialogNotification extends Polymer.Element {
static get is() {
return 'tinychat-notification'
}
static get properties() {
return {
title: {
type: String,
value: 'Your video was rejected by moderator'
},
message: {
type: String,
value: 'You can try to broadcast again in 1 minute'
},
btnMessage: {
type: String,
value: 'OK'
},
onkeydownHandler: Object
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
get settings() {
return this.app.settings
}
connectedCallback() {
super.connectedCallback(), this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogNotification.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogNotification.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogNotification.is) && this.cancel(a)
}
cancel() {
this.close()
}
}
customElements.define(ModalDialogNotification.is, ModalDialogNotification);
</script>
</dom-module>
<dom-module id="client-modal-password" assetpath="../../styles/"><template><style>#modal-content-password{width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-password.error > label{opacity:0;visibility:hidden;}#modal-content-password.error > #error-text{opacity:1;visibility:visible;overflow:visible;}#modal-content-password.error > input[type="password"]{border-color:#e53951;color:#e53951;}#modal-content-password > *:focus{outline:none;}#modal-content-password > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-password > label{display:block;padding-bottom:4px;font-size:12px;font-weight:600;color:#414141;text-transform:uppercase;opacity:1;visibility:visible;transition:.2s;}#modal-content-password > #error-text{position:relative;display:block;height:0;top:-21px;font-size:12px;font-weight:600;color:#e53951;opacity:0;visibility:hidden;overflow:hidden;transition:.2s;}#modal-content-password > input[type="password"]{height:40px;width:100%;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;font-family:inherit;font-size:16px;font-weight:600;color:#414141;text-align:center;line-height:38px;letter-spacing:.5px;transition:.2s;}#modal-content-password > input[type="submit"]{height:40px;width:100%;margin-top:24px;border:none;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#41b7ef;cursor:pointer;transition:.2s;}#modal-content-password > input[type="submit"]:hover{background-color:#54ccf3;}#modal-content-password > input[type="submit"]:active{background-color:#38a8dd;}</style></template></dom-module>
<dom-module id="tinychat-password" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-password"></style><form id="modal-content-password" on-submit="onOK"><h1>[[title]]</h1><label>[[label]]</label><span id="error-text">[[error]]</span> <input id="password" type="password" placeholder="password" maxlength="255" on-click="onInput"> <input type="submit" value="[[submit]]"></form></template>
<script>
class ModalDialogPassword extends Polymer.Element {
static get is() {
return 'tinychat-password'
}
static get MODE_ROOM() {
return 0
}
static get MODE_BROADCAST() {
return 1
}
static get properties() {
return {
mode: {
type: Number,
observer: 'modeAssigned'
},
title: {
type: String,
value: 'The room is password protected'
},
label: {
type: String,
value: 'CHATROOM PASSWORD'
},
submit: {
type: String,
value: 'CONNECT'
},
error: {
type: String,
value: 'Sorry, the password you entered was incorrect'
},
ok: Object,
onkeydownHandler: Object
}
}
constructor(a) {
super(), this.mode = a == void 0 ? ModalDialogPassword.MODE_ROOM : a
}
connectedCallback() {
super.connectedCallback(), this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler), this.$.password.focus()
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
modeAssigned(a) {
switch (a) {
case ModalDialogPassword.MODE_ROOM:
this.title = 'The room is password protected', this.label = 'CHATROOM PASSWORD', this.submit = 'CONNECT';
break;
case ModalDialogPassword.MODE_BROADCAST:
this.title = 'The broadcast is password protected', this.label = 'BROADCAST PASSWORD', this.submit = 'BROADCAST';
break;
default:
console.warn('unknown mode');
}
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogPassword.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogPassword.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogPassword.is) && Object.isFunc(this.ok) && this.ok('')
}
onInput() {
this.$['modal-content-password'].classList.remove('error')
}
onOK(a) {
return a.preventDefault(), Object.isFunc(this.ok) && this.ok(this.$.password.value), !1
}
}
customElements.define(ModalDialogPassword.is, ModalDialogPassword);
</script>
</dom-module>
<dom-module id="client-modal-media-filters" assetpath="../../styles/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-filters{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 0 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-filters *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-filters > h1{margin:0;padding:0 70px 40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#filters-preview{position:relative;padding:0 70px;border-bottom:1px solid rgba(0, 0, 0, .1);transition:.2s;}#filters-video{position:relative;width:100%;padding-bottom:40px;text-align:left;}#filters-video > div{width:100%;font-size:14px;color:#414141;line-height:40px;text-align:center;cursor:default;overflow:hidden;transition:.2s;}#filters-video > div > .video{position:relative;width:100%;font-size:0;overflow:hidden;}.video > div > video,
.video > div > canvas{position:relative;width:100%;border-radius:4px;}#filters-wrapper{padding-top:30px;border-bottom:1px solid rgba(0, 0, 0, .1);}#filters-wrapper > div{height:230px;}#filters-content{width:420px;margin:0 auto;font-size:0;text-align:left;}#filters-content > .filter{display:inline-block;width:120px;margin:0 10px 20px;text-align:center;vertical-align:top;}#filters-content > .filter > span{display:inline-block;padding-top:6px;font-size:12px;color:#333;line-height:16px;cursor:default;}#filters-content > .filter > div{position:relative;cursor:pointer;}#filters-content > .filter > div img{border-radius:4px;width:100%;}#filters-content .filter > div > div:before,
#filters-content .filter > div > div:after{border-radius:4px;}.filter > .active:before{content:'';position:absolute;height:100%;width:100%;top:0;left:0;border:4px solid #fff;border-radius:4px;box-sizing:border-box;z-index:2;}.filter > .active:after{content:'';position:absolute;height:100%;width:100%;top:0;left:0;border:2px solid #41b7ef;border-radius:4px;box-sizing:border-box;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iNTMiIHZpZXdCb3g9IjAgMCA1MyA1MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CgkJPHBhdGggZD0iTTIgNi4wMDJBMy45OTggMy45OTggMCAwIDEgNi4wMDIgMkg1M0wyIDUzVjYuMDAyeiIgZmlsbD0iI2ZmZiIvPgoJCTxwYXRoIGQ9Ik0wIDMuOTk0QTMuOTk1IDMuOTk1IDAgMCAxIDMuOTk0IDBINTJMMCA1MlYzLjk5NHoiIGZpbGw9IiM0MWI3ZWYiLz4KCQk8cGF0aCBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iNCIgZD0iTTkgMTVsNiA1IDctOSIvPgoJPC9nPgo8L3N2Zz4=");background-repeat:no-repeat;background-position:-2px -2px;z-index:3;}#filter-button-wrapper{padding:40px 70px 0;}#filter-button-wrapper > button{display:block;height:40px;width:100%;border:1px solid transparent;box-sizing:border-box;font-family:'Open Sans', sans-serif;font-weight:700;font-size:12px;color:#fff;background-color:#41b7ef;line-height:38px;letter-spacing:1px;text-align:center;text-transform:uppercase;cursor:pointer;transition:.2s;}#filter-button-wrapper > button:hover{background-color:#54ccf3;}#filter-button-wrapper > button:active{background-color:#38a8de;}#modal-content-filters.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.waiting > .waiting-content > span:nth-child(5){animation-delay:.6s;-webkit-animation-delay:.6s;}#modal-content-filters.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 470px){.on-white-scroll::-webkit-scrollbar{position:absolute;height:15px;width:auto;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-thumb{border-radius:8px/6px;}#modal-content-filters{padding-bottom:20px;}#modal-content-filters > h1{padding-bottom:20px;}#filters-preview,
#filter-button-wrapper{padding-left:20px;padding-right:20px;}#filters-video{padding-bottom:0;}#filters-wrapper{padding-top:20px;}#filters-wrapper > div{height:150px;padding-left:10px;overflow-x:scroll;overflow-y:hidden;}#filters-content{white-space:nowrap;}#filters-content:after{content:'';display:inline-block;height:100%;width:10px;}}.aden{position:relative;-webkit-filter:hue-rotate(-20deg) contrast(.9) saturate(.85) brightness(1.2);filter:hue-rotate(-20deg) contrast(.9) saturate(.85) brightness(1.2);}.aden:after,
.aden:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.aden img{width:100%;z-index:1;}.aden:before{z-index:2;}.aden:after{z-index:3;}.aden:after{background:-webkit-linear-gradient(left, rgba(66, 10, 14, .2), transparent);background:linear-gradient(to right, rgba(66, 10, 14, .2), transparent);mix-blend-mode:darken;}.gingham:after,
.perpetua:after,
.reyes:after{mix-blend-mode:soft-light;}.inkwell{position:relative;-webkit-filter:sepia(.3) contrast(1.1) brightness(1.1) grayscale(1);filter:sepia(.3) contrast(1.1) brightness(1.1) grayscale(1);}.inkwell:after,
.inkwell:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.inkwell img{width:100%;z-index:1;}.inkwell:before{z-index:2;}.inkwell:after{z-index:3;}.perpetua{position:relative;}.perpetua:after,
.perpetua:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.perpetua img{width:100%;z-index:1;}.perpetua:before{z-index:2;}.perpetua:after{z-index:3;}.perpetua:after{background:-webkit-linear-gradient(top, #005b9a, #e6c13d);background:linear-gradient(to bottom, #005b9a, #e6c13d);opacity:.5;}.reyes{position:relative;-webkit-filter:sepia(.22) brightness(1.1) contrast(.85) saturate(.75);filter:sepia(.22) brightness(1.1) contrast(.85) saturate(.75);}.reyes:after,
.reyes:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.reyes img{width:100%;z-index:1;}.reyes:before{z-index:2;}.reyes:after{z-index:3;}.reyes:after{background:#efcdad;opacity:.5;}.gingham{position:relative;-webkit-filter:brightness(1.05) hue-rotate(-10deg);filter:brightness(1.05) hue-rotate(-10deg);}.gingham:after,
.gingham:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.gingham img{width:100%;z-index:1;}.gingham:before{z-index:2;}.gingham:after{z-index:3;}.gingham:after{background:rgb(230, 230, 250);}.toaster{position:relative;-webkit-filter:contrast(1.5) brightness(.9);filter:contrast(1.5) brightness(.9);}.toaster:after,
.toaster:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.toaster img{width:100%;z-index:1;}.toaster:before{z-index:2;}.toaster:after{z-index:3;}.toaster:after{background:-webkit-radial-gradient(circle, #804e0f, #3b003b);background:radial-gradient(circle, #804e0f, #3b003b);mix-blend-mode:screen;}.walden{position:relative;-webkit-filter:brightness(1.1) hue-rotate(-10deg) sepia(.3) saturate(1.6);filter:brightness(1.1) hue-rotate(-10deg) sepia(.3) saturate(1.6);}.walden:after,
.walden:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.walden img{width:100%;z-index:1;}.walden:before{z-index:2;}.walden:after{z-index:3;}.walden:after{background:#04c;mix-blend-mode:screen;opacity:.3;}.hudson{position:relative;-webkit-filter:brightness(1.2) contrast(.9) saturate(1.1);filter:brightness(1.2) contrast(.9) saturate(1.1);}.hudson:after,
.hudson:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.hudson img{width:100%;z-index:1;}.hudson:before{z-index:2;}.hudson:after{z-index:3;}.hudson:after{background:-webkit-radial-gradient(circle, #a6b1ff 50%, #342134);background:radial-gradient(circle, rgb(166, 177, 255) 50%, rgb(52, 33, 52));mix-blend-mode:multiply;opacity:.5;}.earlybird{position:relative;-webkit-filter:contrast(.9) sepia(.2);filter:contrast(.9) sepia(.2);}.earlybird:after,
.earlybird:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.earlybird img{width:100%;z-index:1;}.earlybird:before{z-index:2;}.earlybird:after{z-index:3;}.earlybird:after{background:-webkit-radial-gradient(circle, #d0ba8e 20%, #360309 85%, #1d0210 100%);background:radial-gradient(circle, rgb(208, 186, 142) 20%, rgb(54, 3, 9) 85%, #1d0210 100%);mix-blend-mode:overlay;}.mayfair{position:relative;-webkit-filter:contrast(1.1) saturate(1.1);filter:contrast(1.1) saturate(1.1);}.mayfair:after,
.mayfair:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.mayfair img{width:100%;z-index:1;}.mayfair:before{z-index:2;}.mayfair:after{z-index:3;}.mayfair:after{background:-webkit-radial-gradient(40% 40%, circle, rgba(255, 255, 255, .8), rgba(255, 200, 200, .6), #111 60%);background:radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .8), rgba(255, 200, 200, .6), #111 60%);mix-blend-mode:overlay;opacity:.4;}.lofi{position:relative;-webkit-filter:saturate(1.1) contrast(1.5);filter:saturate(1.1) contrast(1.5);}.lofi:after,
.lofi:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.lofi img{width:100%;z-index:1;}.lofi:before{z-index:2;}.lofi:after{z-index:3;}.lofi:after{background:-webkit-radial-gradient(circle, transparent 70%, #222 150%);background:radial-gradient(circle, transparent 70%, #222 150%);mix-blend-mode:multiply;}._1977{position:relative;-webkit-filter:contrast(1.1) brightness(1.1) saturate(1.3);filter:contrast(1.1) brightness(1.1) saturate(1.3);}._1977:after,
._1977:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}._1977 img{width:100%;z-index:1;}._1977:before{z-index:2;}._1977:after{z-index:3;background:rgba(243, 106, 188, .3);mix-blend-mode:screen;}.brooklyn{position:relative;-webkit-filter:contrast(.9) brightness(1.1);filter:contrast(.9) brightness(1.1);}.brooklyn:after,
.brooklyn:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.brooklyn img{width:100%;z-index:1;}.brooklyn:before{z-index:2;}.brooklyn:after{z-index:3;}.brooklyn:after{background:-webkit-radial-gradient(circle, rgba(168, 223, 193, .4) 70%, #c4b7c8);background:radial-gradient(circle, rgba(168, 223, 193, .4) 70%, #c4b7c8);mix-blend-mode:overlay;}.xpro2{position:relative;-webkit-filter:sepia(.3);filter:sepia(.3);}.xpro2:after,
.xpro2:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.xpro2 img{width:100%;z-index:1;}.xpro2:before{z-index:2;}.xpro2:after{z-index:3;}.xpro2:after{background:-webkit-radial-gradient(circle, #e6e7e0 40%, rgba(43, 42, 161, .6) 110%);background:radial-gradient(circle, #e6e7e0 40%, rgba(43, 42, 161, .6) 110%);mix-blend-mode:color-burn;}.nashville{position:relative;-webkit-filter:sepia(.2) contrast(1.2) brightness(1.05) saturate(1.2);filter:sepia(.2) contrast(1.2) brightness(1.05) saturate(1.2);}.nashville:after,
.nashville:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.nashville img{width:100%;z-index:1;}.nashville:before{z-index:2;}.nashville:after{z-index:3;}.nashville:after{background:rgba(0, 70, 150, .4);mix-blend-mode:lighten;}.nashville:before{background:rgba(247, 176, 153, .56);mix-blend-mode:darken;}.lark{position:relative;-webkit-filter:contrast(.9);filter:contrast(.9);}.lark:after,
.lark:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.lark img{width:100%;z-index:1;}.lark:before{z-index:2;}.lark:after{z-index:3;}.lark:after{background:rgba(242, 242, 242, .8);mix-blend-mode:darken;}.lark:before{background:#22253f;mix-blend-mode:color-dodge;}.moon{position:relative;-webkit-filter:grayscale(1) contrast(1.1) brightness(1.1);filter:grayscale(1) contrast(1.1) brightness(1.1);}.moon:after,
.moon:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.moon img{width:100%;z-index:1;}.moon:before{z-index:2;}.moon:after{z-index:3;}.moon:before{background:#a0a0a0;mix-blend-mode:soft-light;}.moon:after{background:#383838;mix-blend-mode:lighten;}.clarendon{position:relative;-webkit-filter:contrast(1.2) saturate(1.35);filter:contrast(1.2) saturate(1.35);}.clarendon:after,
.clarendon:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.clarendon img{width:100%;z-index:1;}.clarendon:before{z-index:2;background:rgba(127, 187, 227, .2);mix-blend-mode:overlay;}.clarendon:after{z-index:3;}.willow{position:relative;-webkit-filter:grayscale(.5) contrast(.95) brightness(.9);filter:grayscale(.5) contrast(.95) brightness(.9);}.willow:after,
.willow:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.willow img{width:100%;z-index:1;}.willow:before{z-index:2;}.willow:after{z-index:3;}.willow:before{background-color:radial-gradient(40%, circle, #d4a9af 55%, #000 150%);mix-blend-mode:overlay;}.willow:after{background-color:#d8cdcb;mix-blend-mode:color;}.rise{position:relative;-webkit-filter:brightness(1.05) sepia(.2) contrast(.9) saturate(.9);filter:brightness(1.05) sepia(.2) contrast(.9) saturate(.9);}.rise:after,
.rise:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.rise img{width:100%;z-index:1;}.rise:before{z-index:2;}.rise:after{z-index:3;}.rise:after{background:-webkit-radial-gradient(circle, rgba(232, 197, 152, .8), transparent 90%);background:radial-gradient(circle, rgba(232, 197, 152, .8), transparent 90%);mix-blend-mode:overlay;opacity:.6;}.rise:before{background:-webkit-radial-gradient(circle, rgba(236, 205, 169, .15) 55%, rgba(50, 30, 7, .4));background:radial-gradient(circle, rgba(236, 205, 169, .15) 55%, rgba(50, 30, 7, .4));mix-blend-mode:multiply;}.slumber{position:relative;-webkit-filter:saturate(.66) brightness(1.05);filter:saturate(.66) brightness(1.05);}.slumber:after,
.slumber:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.slumber img{width:100%;z-index:1;}.slumber:before{z-index:2;}.slumber:after{z-index:3;}.slumber:after{background:rgba(125, 105, 24, .5);mix-blend-mode:soft-light;}.slumber:before{background:rgba(69, 41, 12, .4);mix-blend-mode:lighten;}.brannan{position:relative;-webkit-filter:sepia(.5) contrast(1.4);filter:sepia(.5) contrast(1.4);}.brannan:after,
.brannan:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.brannan img{width:100%;z-index:1;}.brannan:before{z-index:2;}.brannan:after{z-index:3;}.brannan:after{background-color:rgba(161, 44, 199, .31);mix-blend-mode:lighten;}.valencia{position:relative;-webkit-filter:contrast(1.08) brightness(1.08) sepia(.08);filter:contrast(1.08) brightness(1.08) sepia(.08);}.valencia:after,
.valencia:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.valencia img{width:100%;z-index:1;}.valencia:before{z-index:2;}.valencia:after{z-index:3;}.valencia:after{background:#3a0339;mix-blend-mode:exclusion;opacity:.5;}.kelvin{position:relative;}.kelvin:after,
.kelvin:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;}.kelvin img{width:100%;z-index:1;}.kelvin:before{z-index:2;}.kelvin:after{z-index:3;}.kelvin:after{background:#b77d21;mix-blend-mode:overlay;}.kelvin:before{background:#382c34;mix-blend-mode:color-dodge;}.maven{position:relative;-webkit-filter:sepia(.25) brightness(.95) contrast(.95) saturate(1.5);filter:sepia(.25) brightness(.95) contrast(.95) saturate(1.5);}.maven:after,
.maven:before{position:absolute;content:'';height:100%;top:0;left:0;pointer-events:none;width:100%;display:block;}.maven img{width:100%;z-index:1;}.maven:before{z-index:2;}.maven:after{z-index:3;background:rgba(3, 230, 26, .2);mix-blend-mode:hue;}.stinson{position:relative;-webkit-filter:contrast(.75) saturate(.85) brightness(1.15);filter:contrast(.75) saturate(.85) brightness(1.15);}.stinson img{width:100%;z-index:1;}.stinson:before{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;z-index:2;}.stinson:after{content:'';display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;z-index:3;}.stinson:before{background:rgba(240, 149, 128, .2);mix-blend-mode:soft-light;}</style></template></dom-module>
<dom-module id="tinychat-media-filters" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-media-filters"></style><div id="modal-content-filters"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Filters gallery</h1><div id="filters-preview"><div id="filters-video"><div><div class="video"><div><canvas id="canvas"></canvas></div></div></div></div></div><div id="filters-wrapper"><div class="on-white-scroll"><div id="filters-content"><dom-repeat items="[[filters]]"><template strip-whitespace=""><div class="filter"><div class$="[[getActive(filter, item.name)]]"><div class$="[[item.css]]"><img on-click="onSelect" data-filter$="[[item.name]]" src="[[preview]]"></div></div><span>[[item.name]]</span></div></template></dom-repeat>
</div>
</div>
</div>
<div id="filter-button-wrapper"><button on-click="onSave">APPLY FILTER</button></div>
<div class="waiting">
<div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div>
</div>
</div>
</template>
<script>
class ModalDialogMediaFilters extends Polymer.Element {
static get is() {
return 'tinychat-media-filters'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
filter: {
type: String,
value: ''
},
filters: Array,
calcStyle: {
type: String,
computed: ''
},
video: Object,
canvas: Object,
preview: String,
onkeydownHandler: Object
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
get settings() {
return this.app.settings
}
connectedCallback() {
super.connectedCallback(), this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
chatroomAssigned(a) {
this.canvas = this.$.canvas, this.filter = a.mediaStreamFilter, this.filters = window.TinychatApp.BLL.VideoFilters.getAll, this.prepareStream(a.mediaStreamOrigin)
}
prepareStream(a) {
function c() {
f.clearRect(0, 0, d.canvas.width, d.canvas.height);
let h = d.video.videoHeight,
i = d.video.videoWidth;
d.canvas.width = i, d.canvas.height = h, d.preview === void 0 && (f.drawImage(d.video, 0, 0, i, h, 0, 0, d.canvas.width, d.canvas.height), d.preview = d.canvas.toDataURL('image/png')), window.TinychatApp.BLL.VideoFilters.getFilter(d.filter).apply(f, i, h), f.drawImage(d.video, 0, 0, i, h, 0, 0, d.canvas.width, d.canvas.height)
}
this.video = document.createElement('video'), this.video.autoplay = !0, this.video.muted = !0;
let d = this,
f = this.canvas.getContext('2d');
this.video.srcObject = a, this.video.oncanplay = function() {
g(c, 15)
};
let g = function(h, i) {
let j = new Date().getTime();
i = i || 60;
let k = 1e3 / i;
return function l() {
requestAnimationFrame(l);
let n = new Date().getTime(),
o = n - j;
o > k && (j = n - o % k, h())
}(0)
}
}
onSelect(a) {
this.filter = a.target.dataset.filter
}
onSave() {
let a = this.chatroom.selfUser();
a.canUseFilters ? (this.chatroom.applyFilter(this.filter), this.close()) : (this.close(), this.app.Upgrade('You need at least Extreme subscription to use Video Filters!'))
}
getActive(a, b) {
return a === b ? 'active' : ''
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogMediaFilters.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogMediaFilters.is, this), this.$.video != void 0 && this.$.video.pause()
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogMediaFilters.is) && this.close(a)
}
}
customElements.define(ModalDialogMediaFilters.is, ModalDialogMediaFilters);
</script>
</dom-module>
<dom-module id="client-modal-media-settings" assetpath="../../styles/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-media{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-media *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-media > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#media-wrapper{position:relative;transition:.2s;}#media-videos{position:relative;width:calc(100% + 20px);left:-10px;padding-bottom:40px;text-align:left;}#media-videos > div:first-child{height:0;overflow:hidden;transition:.2s;}#media-videos > div:only-of-type{height:40px;width:100%;padding:0 10px;box-sizing:border-box;font-size:14px;color:#414141;line-height:40px;text-align:center;cursor:default;}#media-videos > div + div{position:relative;display:inline-block;width:50%;padding:0 10px 10px;box-sizing:border-box;vertical-align:top;}#media-videos > div > .video{position:relative;width:100%;font-size:0;overflow:hidden;cursor:pointer;}.video > div{position:relative;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA0OCA2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik0xNCAxMy45OTR2MjAuMDEyQzE0IDM5LjUyMyAxOC40NzggNDQgMjQgNDRjNS41MTUgMCAxMC00LjQ4IDEwLTkuOTk0VjEzLjk5NEMzNCA4LjQ3NyAyOS41MjIgNCAyNCA0Yy01LjUxNSAwLTEwIDQuNDgtMTAgOS45OTR6TTI2IDU3LjkydjQuMDgyQTEuOTk0IDEuOTk0IDAgMCAxIDI0IDY0Yy0xLjEwNSAwLTItLjg4Ny0yLTEuOTk4VjU3LjkyQzkuNjk4IDU2LjkyOCAwIDQ2Ljg2IDAgMzQuNTg2YTIgMiAwIDAgMSA0IDBDNCA0NS4yODMgMTIuOTUgNTQgMjQgNTRjMTEuMDYgMCAyMC04LjcwMyAyMC0xOS40MTRhMiAyIDAgMCAxIDQgMGMwIDEyLjI4Ni05LjY5IDIyLjM0NC0yMiAyMy4zMzR6TTEwIDEzLjk5NEMxMCA2LjI3IDE2LjI3NyAwIDI0IDBjNy43MyAwIDE0IDYuMjY3IDE0IDEzLjk5NHYyMC4wMTJDMzggNDEuNzMgMzEuNzIzIDQ4IDI0IDQ4Yy03LjczIDAtMTQtNi4yNjctMTQtMTMuOTk0VjEzLjk5NHoiIGZpbGw9IiNmZmYiLz4KPC9zdmc+");background-repeat:no-repeat;background-position:center;background-color:#c4d4dc;overflow:hidden;}.video > div:before{content:'';display:block;width:100%;padding-bottom:75%;}.video:after{content:'';position:absolute;display:block;top:-5px;bottom:-5px;left:-5px;right:-5px;border:5px solid #fff;border-radius:9px;box-sizing:border-box;pointer-events:none;}.video > div > video{position:absolute;height:100%;top:0;left:0;}.video > div.ratio-16-9 > video{left:-16.66%;}.video > div.ratio-8-5 > video{left:-10%;}.video > div.ratio-3-2 > video{left:-6.25%;}.video + span{display:inline-block;height:16px;width:100%;padding-top:6px;font-size:12px;color:#262626;line-height:16px;text-align:center;cursor:default;}.video.active:before{content:'';position:absolute;height:100%;width:100%;top:0;left:0;border:2px solid #41b7ef;border-radius:4px;box-sizing:border-box;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iNTMiIHZpZXdCb3g9IjAgMCA1MyA1MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CgkJPHBhdGggZD0iTTIgNi4wMDJBMy45OTggMy45OTggMCAwIDEgNi4wMDIgMkg1M0wyIDUzVjYuMDAyeiIgZmlsbD0iI2ZmZiIvPgoJCTxwYXRoIGQ9Ik0wIDMuOTk0QTMuOTk1IDMuOTk1IDAgMCAxIDMuOTk0IDBINTJMMCA1MlYzLjk5NHoiIGZpbGw9IiM0MWI3ZWYiLz4KCQk8cGF0aCBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iNCIgZD0iTTkgMTVsNiA1IDctOSIvPgoJPC9nPgo8L3N2Zz4=");background-repeat:no-repeat;background-position:-2px -2px;z-index:1;}.video.active:after{border-width:9px;}#media-audios{position:relative;width:100%;max-width:400px;margin:0 auto;padding-right:40px;box-sizing:border-box;}#media-audios-combobox{position:relative;height:40px;width:100%;padding:8px 50px 8px 25px;border:1px solid #c5d5dc;box-sizing:border-box;cursor:pointer;transition:.2s;}#media-audios-combobox:after{content:'';position:absolute;display:block;height:0;width:0;top:50%;right:18px;margin-top:-3px;border-width:6px 5px 0;border-style:solid;border-color:#c4d4dc transparent;transition:.2s;}#media-audios-combobox-list{position:absolute;top:40px;left:0;right:40px;border-width:0 1px 1px;border-style:solid;border-color:#c5d5dc;box-sizing:border-box;font-size:14px;color:#414141;text-align:left;background-color:#fff;cursor:pointer;visibility:hidden;z-index:2;transition:.2s;}#media-audios-combobox:focus{border-color:#41b7ef;}#media-audios-combobox:focus:after{transform:rotate(180deg);-webkit-transform:rotate(180deg);}#media-audios-combobox:focus + #media-audios-combobox-list{visibility:visible;}#media-audios-combobox-list > div{position:relative;height:40px;width:100%;padding:8px 50px 8px 35px;box-sizing:border-box;white-space:nowrap;overflow:hidden;opacity:0;visibility:hidden;transition:.2s;}#media-audios-combobox:focus + #media-audios-combobox-list > div{opacity:1;visibility:visible;}#media-audios-combobox-list > div:first-child{display:none;}#media-audios-combobox-list > div:only-of-type{position:absolute;display:block;top:-40px;left:0;line-height:24px;}#media-audios-combobox-list > div.active{position:absolute;top:-40px;left:0;opacity:1;visibility:visible;pointer-events:none;}#media-audios-combobox-list > div:hover{background-color:#e0f5ff;}#media-audios-combobox-list > div > div{position:absolute;height:24px;width:3px;top:8px;left:25px;background-color:#333;}#media-audios-combobox-list > div > div:before{content:'';position:absolute;display:block;width:100%;bottom:0;left:0;background-color:#74d60c;transition:.1s;}#media-audios-combobox-list > div > div[data-mic-level=""]:before,
#media-audios-combobox-list > div > div[data-mic-level="0"]:before{top:100%;}#media-audios-combobox-list > div > div[data-mic-level="1"]:before{top:90%;}#media-audios-combobox-list > div > div[data-mic-level="2"]:before{top:80%;}#media-audios-combobox-list > div > div[data-mic-level="3"]:before{top:70%;}#media-audios-combobox-list > div > div[data-mic-level="4"]:before{top:60%;}#media-audios-combobox-list > div > div[data-mic-level="5"]:before{top:50%;}#media-audios-combobox-list > div > div[data-mic-level="6"]:before{top:40%;}#media-audios-combobox-list > div > div[data-mic-level="7"]:before{top:30%;}#media-audios-combobox-list > div > div[data-mic-level="8"]:before{top:20%;}#media-audios-combobox-list > div > div[data-mic-level="9"]:before{top:10%;}#media-audios-combobox-list > div > div[data-mic-level="10"]:before{top:0;}#media-audios-combobox-list > div > span{display:inline-block;width:100%;line-height:24px;overflow:hidden;}#media-audios > button{position:absolute;height:40px;width:30px;top:0;right:0;padding:0;border:none;background-color:transparent;cursor:pointer;line-height:40px;text-align:center;}#media-audios > button > svg{position:relative;top:3px;}#media-audios > button > svg > rect{opacity:0;visibility:hidden;transition:.2s;}#media-audios > button.muted > svg > rect{opacity:1;visibility:visible;}#media-ptt{padding-top:25px;text-align:center;}#media-ptt > input{display:none;}#media-ptt > label{position:relative;display:inline-block;height:16px;cursor:pointer;}#media-ptt > label > span{position:relative;display:inline-block;top:-3px;font-size:12px;font-weight:600;color:#414141;}#media-ptt > label:before{content:'';position:absolute;display:block;height:10px;width:10px;top:3px;right:3px;border-radius:100%;background-color:#fff;z-index:1;transition:.2s;}#media-ptt > label:after{content:'';position:relative;display:inline-block;height:16px;width:30px;margin-left:24px;border-radius:8px;background-color:#c2c9cb;transition:.2s;}#media-ptt > input:checked + label:before{right:17px;}#media-ptt > input:checked + label:after{background-color:#41b7ef;}#media-wrapper > button{display:block;height:40px;width:100%;margin-top:40px;border:1px solid transparent;box-sizing:border-box;font-size:12px;font-weight:700;color:#fff;background-color:#41b7ef;line-height:38px;text-align:center;text-transform:uppercase;cursor:pointer;transition:.2s;}#media-wrapper > button:hover{background-color:#54ccf3;}#media-wrapper > button:active{background-color:#38a8de;}#media-wrapper > .waiting{position:absolute;width:auto;top:0;bottom:0;left:0;right:0;background-color:#fff;z-index:1;opacity:0;visibility:hidden;transition:.2s;}#media-wrapper.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.waiting > .waiting-content > span:nth-child(5){animation-delay:.6s;-webkit-animation-delay:.6s;}#media-wrapper.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}</style></template></dom-module>
<dom-module id="tinychat-media-settings" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-media-settings"></style><div id="modal-content-media"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Media Devices</h1><div id="media-wrapper"><div id="media-videos"><div>Video List is empty</div><dom-repeat items="[[video_items]]"><template strip-whitespace=""><div><div on-click="onVideoSelect" class$="[[convertVideoClass(videoSelectedDeviceId, item)]]"><div class="ratio-4-3"><video autoplay="" loop="" src="[[item.mediasrc]]">Your browser does not support the video tag...</video></div></div><span>[[item.label]]</span></div></template></dom-repeat>
</div>
<div id="media-audios">
<div id="media-audios-combobox" tabindex="0"></div>
<div id="media-audios-combobox-list">
<div>Audio List is empty</div>
<dom-repeat items="[[audio_items]]"><template strip-whitespace=""><div on-click="onAudioSelect" class$="[[convertClassActive('', item.active)]]"><div data-mic-level="4"></div><span>[[item.label]]</span></div></template></dom-repeat>
</div><button id="btn-mute-mic" on-click="onMuteMic"><svg width="24" height="30" viewBox="0 0 24 30" xmlns="http://www.w3.org/2000/svg"><path d="M7 6.997v8.006a5 5 0 0 0 10 0V6.997a5 5 0 0 0-10 0zm6 19.963v2.03a1 1 0 1 1-2 0v-2.03c-6.15-.496-11-5.53-11-11.667a1 1 0 1 1 2 0C2 20.643 6.475 25 12 25c5.53 0 10-4.352 10-9.707a1 1 0 1 1 2 0c0 6.143-4.845 11.172-11 11.667zM5 6.997a7 7 0 1 1 14 0v8.006a7 7 0 1 1-14 0V6.997z" fill="#41b7ef"></path><rect transform="rotate(-45 11.9 13.9)" width="31" height="2" rx="1" fill="#fff" fill-rule="evenodd" x="-2" y="14.5"></rect><rect transform="rotate(-45 11.9 13.9)" width="31" height="2" rx="1" fill="#41b7ef" fill-rule="evenodd" x="-3" y="13"></rect></svg></button></div>
<div id="media-ptt"><input id="input-ptt" type="checkbox" on-change="echoChange"><label for="input-ptt"><span>ACOUSTIC ECHO CANCELLATION</span></label></div><button on-click="onSave">CLOSE</button>
<div class="waiting">
<div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div>
</div>
</div>
</div>
</template>
<script>
class ModalDialogMediaSettings extends Polymer.Element {
static get is() {
return 'tinychat-media-settings'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
audio_items: {
type: Array,
value: []
},
video_items: {
type: Array,
value: []
},
audio_selected: {
type: Object,
value: null
},
video_selected: {
type: Object,
value: null
},
videoSelectedDeviceId: {
type: String,
value: ''
},
enableAcousticEchoCancelation: {
type: String,
notify: !0
},
onkeydownHandler: Object,
onClose: Object
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
get settings() {
return this.app.settings
}
connectedCallback() {
super.connectedCallback();
let b = this.settings.getSettings();
this.setProperties({
enableAcousticEchoCancelation: b.enableAcousticEchoCancelation
}), this.$['input-ptt'].checked = this.enableAcousticEchoCancelation, this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
chatroomAssigned() {
let c = this,
d = this.chatroom.app.EventBus,
f = c.$['media-wrapper'];
f.classList.add('wait'), this.mediadevices((h, j) => {
h || c.app.showToastWarn(j.message), f.classList.remove('wait')
});
let g = this.settings.getSettings();
null !== g.video && (this.videoSelectedDeviceId = g.video.deviceId)
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogMediaSettings.is)
}
close() {
for (var b in this.parentNode instanceof Modal && this.parentNode.close(ModalDialogMediaSettings.is, this), this.video_items) {
let d = this.video_items[b];
if (d.mediasrc && '' != d.mediasrc) try {
URL.revokeObjectURL(d.mediasrc), d.mediasrc = '', this.notifyPath('video_items.' + b + '.mediasrc'), null != d.mediastream && d.mediastream.stop()
} catch (f) {
console.error(f)
}
}
let c = this.settings.getSettings();
null !== c.video && Object.isFunc(this.onClose) && this.onClose()
}
onkeydown(b) {
b = b || window.event, (27 == b.keyCode || 'Escape' == b.key || 'Esc' == b.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogMediaSettings.is) && this.close(b)
}
onMuteMic() {
let c = this.$['btn-mute-mic'];
c.classList.toggle('muted')
}
onSave() {
this.close()
}
echoChange(b) {
this.settings.switchAcousticEchoCancelation(this._str2bool(b))
}
onVideoSelect(b) {
this.video_selected = b.model.item, this.video_selected.active = !0, this.videoSelectedDeviceId = this.video_selected.deviceId;
let c = this.video_items.indexOf(this.video_selected);
this.notifyPath('video_items.' + c + '.active');
let d = this.settings.getSettings();
d.video = b.model.item, this.settings.saveSettings(d)
}
onAudioSelect(b) {
for (var c in this.audio_items) {
let g = this.audio_items[c],
h = g.active;
g.active = !1, h && this.notifyPath('audio_items.' + c + '.active')
}
this.audio_selected = b.model.item, this.audio_selected.active = !0;
let d = this.audio_items.indexOf(this.audio_selected);
this.notifyPath('audio_items.' + d + '.active');
let f = this.settings.getSettings();
f.audio = b.model.item, this.settings.saveSettings(f)
}
convertVideoClass(b, c) {
let d = 'video',
f = this.settings.getSettings();
return d += b === c.deviceId ? ' active' : '', d
}
convertClassActive(b, c) {
let d = b,
f = this.settings.getSettings();
return null != f.video && (d += c ? ' active' : ''), d
}
mediadevices(b) {
let c = this;
if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) b(!1, new Error('Browser does not support Media Devices'));
else {
let d = c.settings.getSettings(),
f = {
deviceId: this.chatroom.id__miconly,
groupId: '',
label: 'Microphone only',
mediasrc: '',
active: !1
};
c.video_items = [f], c.audio_items = [], c.video_selected = null != d.video && f.deviceId == d.video.deviceId ? f : d.video, c.audio_selected = d.audio, navigator.mediaDevices.enumerateDevices().then(g => {
for (let h in g) {
let j = g[h];
if (j.active = !1, 'videoinput' === j.kind) {
j.mediasrc = 'https://tinychat.com/images/blank.png', (null == c.video_selected || c.video_selected.deviceId == j.deviceId || c.video_selected.deviceId == f.deviceId) && (c.video_selected = null == c.video_selected ? j : c.video_selected, c.video_selected.active = !0, c.video_selected.deviceId == j.deviceId && (j.active = !0));
let k = c.video_items.indexOf(f);
c.video_items.splice(k, 0, j);
let l = {
video: {
deviceId: {
exact: j.deviceId
},
width: 320,
height: 240,
frameRate: {
ideal: 15,
max: 30
}
}
};
console.log(l), navigator.mediaDevices.getUserMedia(l).then(m => {
try {
j.mediastream = m, j.mediasrc = URL.createObjectURL(m), c.notifyPath('video_items.' + k + '.mediasrc')
} catch (n) {
console.warn('MediaStream URL Object failed.', n)
}
}).catch(m => {
console.error(m)
})
}
'audioinput' === j.kind && (c.audio_items.push(j), (null == c.audio_selected || c.audio_selected.deviceId == j.deviceId) && (c.audio_selected = j, c.audio_selected.active = !0))
}
1 >= c.audio_items.length && 1 >= c.video_items.length ? b(!1, new Error('No Media Devices has found')) : (c.video_items = Array.from(c.video_items), c.audio_items = Array.from(c.audio_items), console.log(c.video_items), console.log(c.video_selected), console.log(c.audio_items), console.log(c.audio_selected)), b(!0)
}).catch(g => {
console.log(g)
})
}
}
_str2bool(b) {
let c = b.path ? b.path[0] : (b.composedPath && b.composedPath())[0];
return c.checked
}
}
customElements.define(ModalDialogMediaSettings.is, ModalDialogMediaSettings);
</script>
</dom-module>
<dom-module id="client-modal-mobile" assetpath="../../styles/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}#modal-content-mobile{position:relative;width:100%;max-width:400px;margin:0 auto;padding:150px 80px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;background-repeat:no-repeat;background-position:center 62px;}#modal-content-mobile.ios{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAABNCAMAAADU1xmCAAAC+lBMVEUAAAAMc7R2LA+5pxBQqTcOtOLWHmIGo+XcI2eduxyObg7UHV+LbAwDqei+yBelkQ92QgnYIGPVHmCduRfZIGS8yBfSHVsEs+8EhMpkqC0Gnd+IoR8EnN6JshwFer5SpjS0oRByMAoGru0EltqBsB/UIGPZIGDFzhdxNwkEyv////+4F0rAGE8ICw/EGVG0F0nIGlS8F0x8ESZ6GB+nFEF4IBl7KhQDqOPLG1eiEz6rFUMSGiSuFUUDr+kDn90xpFrPHFoNEhp/NRBzJRUDoNOGJlA+p06xFkfm3xvV2BkdKDmbETiDDyrHtRKtmA+jiA0DnssEf8N7KlQDptsDnL8PbqwpOlGIvSjP1Ri/rRECAwUAAAACkc9mNF+sxRi/zhcCmNcIeboUaacro2TSHFxwL1mPIk1Urz5otTR1ESacwB7b2hrEzxc3pFJyFiDJ0hi4yhaBQwsDgrYdX5orU4oioXZLQHBdOGVMrEQiMEPs4hzg3RrWxBQCh8sClMgNnqN9uiyjwxtvHBuegA2QawuEUAoCktQKn7AbZKEWno8an4Y3ToIeoH4mom1ztzAXIS6zxxfPvROzoA+ojw6beQwCisYCkb8GlrU+SHxFpkFcsjqTwCPczRaR5/9s4P881v/8/PwhW5RUPGtFq0uqGkm3sxKWcQsLlKkToZglV5BFRXXUHV9krS+/uROkphCinw+KWwny8vIChr3HwBQGjrKZHEiTDzKvqRGdlA6MZQqx7/8GxfekHUucH0xzsCiNuB/QyBV3Nwgvg60PlaAVZJ4uT4TYH2LWHl+WIU3k1BeQegwOwesev8I0t6gTmZdRX3dehGCjGEYYIjCvshKViA/2/f/j+f/S9f+g6/9x4f9Y2//Mzc0DeLBPSlGvGUqgHEmmrRGBsyGCYQwOsMWdnZ42cpQ5OjqYpRDExso3i71NtYlgsGcmm8iusbZHc6E+kY11RXNhXlBvqUgoKSp6cimMoRwZncs0s3lnJivW2t/O0NS9vb05TWdwjkD3RA2eAAAAKXRSTlMA/v7+/v2VJiYmJurd25WVlfr16dHNyZubm1hY0dHJycnJioqKWFhYWC+PjMYAAAgISURBVFjDldgDtFRRFAbgm23bbrJt27Zt237Ztutl42W+7Jdtu7X69z668+5U05/WCl//PvvcmSnLlrixIoTIT8mZs2rVqsWKFatUqVK1atVGjhw5cODAlStHjxkzrnv38eObFixYsH379iVmIcETxYlneUioWAwxBo05YFIDBm0caU21Bix48LVr18YJExhL6rTs1cCNNhpjRtu3L7l7sQj5cwopMAYN4Wo86XjWBNYLGmP37iUIY8dgcMjSGGszZjiPjbUls3qhGjDS9kcLY7ACBZRVoGrVAgUKuGErxJz2YyMMc7ZsOZur7d+/v43m4hcwYUpgAwhDSDvLx+Y2aK9eEht0D1ibwTEElqxRI7vVqFgjYAOQ6dPJWrHi0KGzZx3VerHWqtWECcDmtBncoEFEnnPEiEYjGukAq1epHmN2Dac2RmqMLdHYoJqoNnhwg4kTadbY9UYgIGHi24h69WCBEtgWiUHT1UrYtUHQqBo0Kte/f38A4AiSFmubtiDAWAMmNuqsVnNOmzbAOnVqiMcJGgJRZtqAadOm2bAVIx9wRq4cB0xqjIlqBmuXyopduXLl/ipwOJuQLqRVCrE7jcmp0yubeqo2WGDtIloJK5swNI2kTV2QaiHSOLL79BfSdDVgrBHWMYYVpDFFg5sqw+JMz++0OKe/mBVAk1jDdh07drSCIAwy2rgxS7e6dMnpZIy3xFRjDBqwWqWt6tXBMQmU4VvIAPtxeZj3i8CkpjBoTaoDFGR1/g5Y1TT/ypnZYgVmzlqkNaFAtEdP+bdpqZpZAWNtrVFIkyb4ikg50PEvmD/v2q5r8+YvCMS5VyOsr9W1a1d4CLOHEbcxb+y6nFbl8q4bbpzUBCa0ReAA4kvXw10JK5bGZP4VZkyuzLefHTDW2lG1tm379rVWrVqEdMVXkS62Ea+mdeaqbeAXclDCSCtlreq2ClmkcthcjesLnRay8Lp50moO5kGN1o0DUsTMOc/hqMwzs9ruGrBS1tgjR7qZNLFjXnDvG3QS1wMYaTPHUmBCPXIkpx4z7d+ihz39ZKLaAbA+1kxEi6P0Ahb+VVu4QJe726ldu1paW70amiI/q9/kvk3fmz+e+rpvVp/cp7sNO0qtTx+rx+oeqznkqYXOt/d4+LguUufxQ3tfde92f3pykTRgrHGE6af+xiv2YgGwOB9u2q6xvnNP1l+UG8WkiymSVIPecJ/TVUfG9cr87A016pP1d9fpbj17QpPiKfk7dtks5HEdFwecabdL3WBoFzdrDYFI5mrV/rI+M1/qltel80Gf3WX1mz9BW7YZ1420+vXrQ+OMVddDF3gY4JvW953LVVjF9VD/2gJ1R55AW3cA3VhDIMJ85Njo47qux3nZysspXDjAsdUX60nbDA5ac0SKfoEfKl9cDJyZsHwu+NAPvoEfr+dSm0s7rQKNYtOuqT9wExpjbCEXLvjoPVxT2ob1rIGDVqVKcylKzaz0h9Z8fMqI+DzVSzXa9mXLNqPcCWgy0BzdngqNmgHqjZQp893ZDRq6QTthFUck+NpxbnWU5gNMxHlurFG3udBEWHPuVGoXCKtB8XfulM9tndBatGihQH/nfVPdtPbKed/QjbV+0I630F5z57PwATdEaLKah2eBNIzajzUKgSBDOJ7Tmy5ohTGp0H5+cz6nO6BtR7dJpO1FwHGeOV9DXrkwKncj7KmH15AdGzZsx6iTuNuePXs16O/h9e3mB2gXfEjz/+bp9W0HT1p+0iSh7bmz587erZTinl97A2jU3v6vPL72XtqxY8P2YLXLl6dy1tKlSwkU3rM/vS88/f6n9wV37fZS5d3ZuvXtf79n/QqkIUsp58+De/m/76cnSZvM2iRoGRGA0JDcb718rzfVoFWYDI7LWekQgCXzLV2a7Xzu3M/+73PIyZOXLk2pUCFYballzpyZuJIl8+XJkydbthan/ucz0kdoFStWqKC7pc9svHzg3v7H57dzw4adHFpxyhTSauPgJlkZ0iPCA4d6r73+bPnm/s5hJ6dWrCi18qRlgMdcOtTLky9btmdefe5FPrKGcuLgwFmZMmUg0JxetvMvvflMzt3uD1sutMmCg8Ye18Nu8+XJl+c82nmTU+gGTY0KzsqVS3LwUA9nh2Ffe8e92bnTlCPPKpQLgWe4PLTZU15x50w5cKQVggctEw0r29G98/NG232ONCrHXDArXDPp8S5Mu9z1X/6BePnZ/i+QjzwqcfCsmM3AycPjWZmDlrtcfb/dzjZ+AUWL+oewTzsVnGiX2Aq5ppny5GZxT0qiXe6y5bK0Xu1n/4Mh/AK+FkWCBn33JoTWqBy3qxDJSnns2BrF6XuXjzTmWrf+GuD/iOIf8HUIQhhSpEiRd+/OIR9xcjg6bof/2IvKGnOBNsEcpwMCicLdcuQognTuPHz4xo3Dli9fDo3qWZYV8ii3Y405c3KaA4YwRslh13BJZLtI0EJHYY7Kqb1m5L1KLguDrJFHGHPQFCeHDWtxuaPm6LgcOIzKGjgEWlZwWbNzYEGjQGOO6p1ENUp0wUFDOzMrL4I49rJmhWbnCEOggcMLXXi2MGu4o0fXqFnN85pNlNsGjpJVRGvgzLA7d4bHnJo7xpy6dKKb5oSnNcTMKoa9bzBw0XU5swetgdOevVzQoAcR8uwYryIKON4DNLeDUxxAWzuyJActslRMvZBR3UbNKEdlDRxiK1c0O+4whbTIKOZMipAxw8k98BqMxpyZFRrCXJLIqW3Cbxc+x4gzPh9bAAAAAElFTkSuQmCC");}#modal-content-mobile.android{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAYAAABxLuKEAAAAAXNSR0IArs4c6QAAC4VJREFUeAHVXA1wVcUVPvvyn5A/YEQo0grVBFCoJLEzbaFEMegAFS3MNJQiHRhoS0eETqeKwAjDKM6UIpSO/BS0nWntQIq0UKtBJ8iP04EERZsQBCm/gpJAIP+/t993kxffS+57b/cmLwln5ubet/fsOWe/u/fs2bN7o6QHKbrQSpcWyYTKNEtJGs7DcaRYlvQTJYm2KZZUKiVVuK7AcVZZckoipFQsKWrIVKU2Tw/8UeHUMbDUSrxZKU+gUZMBRDbOg7ukT8kVAFUAEN9JTpQ3y9JVZZfkBakcFmBijlmPtFgyF2BMBxjxQfS7v6WkBiDt8Sh5vT5L7XcvyLmmx7nYvPQFy/JEH7NmRB21Pmy2JN8SmRU2UGgeAKcO6oo6Zh2nbtpgbrlzjW7pMbHHrYebm2QjDB3lrKZnStGYkohIebpunHqvqxq7BEz8cWtIY7Osg/P8UVcN6c76cN5/i1KytCZTXXEr1zUw6LqPt4i8hi6d6lZ5WOspuYH36qcNWeofbvQYv5MZhVYU3un1cK57+iwoRAIPjDbSVtpsCo5Rj+l/2kq6VWEDkm2qqFf5lRQkpcj06/eoW7p2aAOT8Ik1qKFO/g1/8oCu8L7EB7/zYXSsPFZ9v/pCxy4tYNpAOQxQvqkjNBjPYHTq7CSRcYhu0mJFRuBIjhBJxEGqbBa5ieOzOpFTOI7XiBTgOV9pbL3flb8A5wzA+Z4OOCGB4etTWSEHutJThkaL/HiASC6O0XHumlZcK/JGuchfcFxqcCeDtdhzElNkYqjXKigwdFonLHkHjizbjSkE4VlMAmb2F4kIqklfOgI62XVdZC0GYoLliuBzxiqZXJSpAvbDoObSo6OnPGOqfECkyEtDReYOtJ+QaXUtftglr5eJPHdJpLxJq4ofE3rOK41Zaolfoc+PgMDYcQqHZEN6AlHN5m+I9Ac4PUHXAcrPzom8ecNcG+ZZ0wPFOY7AxBdagxssKTaJU+g71w0TWTTI3MDuqPEHjDW/uiACv61PCAKjlYx2ipAdA7xGS35nAkocpOy5p/dAIRJ8ILSBtmgTgkC7rQ4VOvUYTgibmuRdB17HIhry9r0i32lNMzny9GThB8jQPPqpSC3mK7oUGSmTOk48/fDltJ2zZF2BfH12jug7oNBuPiDaRNt0iW3umLLw6zHMaWB+sUtX4Cu96FNC2Uif88yFUFxf3YcjnglHnOct8esxGAGXeW+EOnP06S1HG8o23qdttFGXOra9vccwHclsmI4gxikl9/fckKxjkxMPh/JRn+jHOQhCc7xp0vZogzlaJ+FOZQzeuhqnVFdXy759++TIkSNSXFws5eXl0tLSIgMGDJD09HSZMGGCTJkyRZKSMLFySbSRti44pyegDQM7f2z3GGbzKyrlKobokInr+xDmHx/tPqK9du2arF69Wnbs2CE1NZghBqG4uDiZM2eOLF++XIYORQtdECPkccUi/9WZPiDBnpIod3L1wfYxbUscIUGhXZz7IJx2TampqZKQkBASFCqora2VLVu22D1o+/btrnTS1t/oLtqgY9hYQFOr88W6j45WzpJnYELYFYpE0LB27VqZNGmSthi+dvPnz5fFixdLc7NRbGvr4CSWtmtRGxY2MPZimEYtpg66a5acm5urodGfZePGjbJ06VL/Qo1ftJm265AXC4+9bKq5Qsh8SndRSkqKK1EEx81rpW07sCAmnra15JBGDkHmzTTJVFZWFrDrFxQUhNQZiIGv1MWLFwPddiyn7WyDFmF9na8SF9dD0kQXo+aqVatk5cqVnWQfPnxYtm3b1qlct4A+Z82aNbrs7XwGbUhTSEbtxJA2s712gIt1d4k8fWeAmw7FVVVVMmjQIHv0ycnJEfqU5ORkYU/ZunWr1NfXO9TSL+JQfvXqVaM4Z+NVpCY0OhpGsl0M8EbomJOGrmhCDN68cUp+fr7w6E7iUE4ds2bN0hZr0IbhfJWSdSQPj9Hh+oqHEW246eDBg0YqDNqQ4sFrpJVJSYkwssEO881qmHOXlpYaVdJtAzFhj9ECxrvuo2sJ5z7hJlMdBm2wgQmL/ZwQ3s7EHlOp0wCuEJoQZ8nhJlMd2m3AHkAPhiYtYCoMgWHqINxkqkO3DdjCVs0ec1OnAWcNw47x48friO0Sj6kO7TYoKScwn+lYd0onn+EjaOrUqRIbixX7MBFlU4cJGbThrMfeR6shnbsOTIhR7uzZs02qGPFSNnWYkG4b4F7OsMec0hF+4JYOlz/PihUrJD5eK//lXzHEL8qkbFPidhIdQtLvlAcLMEU6zJexL6DE8HUaNmyYrF+/Xke8EQ9lUrYJ0fbPA+5t8JfkiZAPPA0Z6iSKMb0KTdyfYkoLFiyQRYsWmVYLyE9ZlGlKBrZ/Wf+AOs1XiTlcreQIN+0gk25MGzZs6BZwCAplmRJtpu1apOQg+WxguDdfp9LFBpE8bNoxpYiICNm0aZNs3rzZlc+hT2FdyqAsU6LNtF2HAMhu8tnAJPezf2h5EO5k4pKEG1q4cKGUlJTIvHnzJCYm9HSdPORlHdZ1Q7SVNmtSXVKi7CNv+0IIElZ/hZBcHQF/vFvkKeyW6gpVVFTI3r175dChQ3Ly5El7wY3yGOaPHDlSGLxNmzZN3OaGvbb9Cbuu5v/P+yvEWcnfm7LUDHK1AxNTaOU0t+i9UgOR3uISbSrTXH2YbjS1LtGW4axJE5seVO+Tt9XH4KI+U+UDpRM6AqjoF+d0OHuXhzbqgoIB6GMvKLS6HRj+UBHyIs86lIc9b5u/1OHsHR7aRht1CcC87MvrB8yycZIHBsY1WrTkgsh+rSmolrhuY8qHTbRNl/CmfFSfIW/48vsB84JSLShY7MsQ7LoJHn/GGZH/VAXj6tl7tGUmbKJtuoRI91mlMGv0IT9gWM79IUBwpw9P0MsaJOomY7bVF3oObaAttEmblOTVZ6hOcVwnYCgwMlqWYrziV6xaREN+cFpkSy/6HOqmDUagYE9RbLQ4zlccgan9lrrssWSeFiptTOy6vzyP7wXQjSswavUUURd1UrfJ60P7PB75edVY5fg4HYFhpYYH1W444t/z2oQ4EnB7158RWIWbqIO6TEYfr01o23p8xx1wIybcSWAaXWxFf1qDL2It+X5grsB3xmD18rkhIk+m4ukE1RRYRsc7nBDuBvgvfS7ysdYkpqMEO6o99N0seeiAUgH7dkhzUwut5KoWeR/2jO2sQq/k69i04/0sJ91wqderoRQgMHXAWfJ5zQmht26ns5K3EPpP6VTuUxASGPLy2wJsLeeHXMN96rq6vAsgZSdiX1xC64dcXDZNwdTCu8JVCUdOv8HENT/kKqoWOYB1DN3ZsaZRTVExcnftWHUpEL8WMKzcBs7bAGdMIGG3Uzkc72/hY34dyGZtYCig7bX6J16rCYEE3kbltdgOOBLfEJx3sjngqOTEfCNT3bw3QR5xM1o5yevlsrimZnnVsrDrzoEcCx34OhVFH7WebFGyA3uDkzvdvI0KMFq+iG8Inu9oslGP8a3MOCcqWu5DhJznW367XWP4X4aPS14O+vWJ20bFFFmTsblhAxxzmlsZfaDee5FKFtRlqbO0xXWP8W0IJ2HPZ8oodMtc+B/Eoj1L0HkSDfkJzt+Gb/jIpfaHMaUoxr952cDvzF37mEDK6cxiC+VRhCNPoQc9Dr7wLGArYZj3FjY3v1qXIfu9aYOJlhV5pEjmYpvuEoyeowLZGawcoBR3OzC+Cu3h3ZIfoiwHIGXjfIfvfeNrZe/MeBeZk3/Fx8qem2MUJgfOxAcUdUwmoBdNB8c06B/hzNm5FHXOhhUYX5U0NKZQRmNwzIDSNDi9NDSQxibjySbCiSdihIvAGfGu3MK9L8B7GbzIsNhP8OiyTClhMs1Xru51vxPWHY0Nkolvskah4cOg82uo2w/y+Z+LGqG7GtdXoPMM4pud/wfuqsJIQLSA9AAAAABJRU5ErkJggg==");}#modal-content-mobile *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-mobile > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#modal-content-mobile > button{height:36px;width:108px;padding:0;border:none;border-radius:4px;font-size:0;background:none;background-size:cover;background-repeat:no-repeat;cursor:pointer;}#modal-content-mobile.ios > button{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAAkCAMAAABbsy/+AAAA81BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8UFBTQ0NAEBAT9/f2RkZEYGBgRERGJiYlqamo0NDQNDQ1VVVUKCgr8/PzExMSfn59BQUEnJycHBwdvb29aWlowMDAaGhrr6+u/v7+Dg4MlJSUdHR339/fv7++wsLCtra2lpaWjo6OUlJRlZWVRUVFMTExHR0cgICDd3d3Dw8O1tbWZmZmMjIyGhoaAgIB3d3dEREQsLCzo6OjV1dXLy8u4uLg8PDw5OTn5+fnx8fHZ2dnS0tKpqamcnJxzc3Pk5OTg4OBeXl4+Pj7z8/OysrJ8fHyIiIjGxsbY2NjO0k3oAAAABnRSTlPjjQ8A1NMV7Ym9AAADlUlEQVRIx9WXaXMSQRCGCerbe8LusrCw3PcVjnAFCAQihCAx6v//NfYsGtkS1FgW6vNh6Jnt4qnumtmaDbwKXgRwBgIXwVeB4BucidfBwAXOxkUggLNxThfw92XpQcg37xzEBaVjQjAWOS0XR4n8smykRu3D+eLuFs9cZyJ5CKoTAFcSvqcJvP1VWYqo51sYPGlI7aBhWIvvZfnaGNXw+pZl9oe+KHxy39cx0PoKMC5r6OYd2x32Ez+V3VDZnzTL3GBR3zWgp2J4n2CZHpmhGimuWPaUvKx7OS0H2dB9W/wB8CANUpvrduVnMiU697tMWZMXmDXSmVxb9mT6VfsG1TTesux+YLQAdDGZ83yU8mQcJQ2tYVz+QJZ5qmttBeZwXtl82yIfIkgNcP0RBXm4l3VWwxUqTm3Esl0uL6oZOfPWV9k878nMXL51WvauREy2S97PAl8IKVAkuBaghySeceQFbhGQAKuggCmGxMyyAdgdjmwbNj85JWurdMgIfxa/bOVzafDxh2UTn+vOwgGS7uIk0mJiv1SW8sl8J01XKYkT2DWV6FF/oazpk/lOiKFuYziBRsP0bgN0cskXyCI+WRcH5GaamgGQkVCIiyKKIpAguJlCYEXoQ8cCFNNbDxVRSADubdw6KkuTj4PzKEWHY6+Pcs4hWnLU7a2JSk0wPTUC5h0x7zB+IDUaBrS7pNrAblpaluPHZCj7d0j8oMGmkr0CMFPniduumsaNWinEt9EEgMmUYi3ASlG4YBUf5YztkIGB+rAxpWzFtT5ulWOye/KhPtvmW36o6kCMeLikMORoSBTzBEbXHqmq4JaugZFoiLSUEaYmYFBc1zdkHpNN/LKpiz2haOnhoUwGy0oAOlSDnPXy+18SKtTcy2rUAbAtIywUDfJoHZNx6iFNeIgKGoaRVHMsiyqASQ3IdwDiXOKeBGs9WV84lLsuy9LgIV5k3KMyaXrgyj0v90TPcBWVEBNdcniQqQ2saQwgzX6DRSZposUNIMWDJ2vz0um3/uKRLcupKrb+8zG1lp43SU2urPx+Js67vCxXZKqCmWZjK1pZsMvRXBoV6tVLn6S9DHWS673aCRkSdefShWTUB6Fva+ExmEw4hVjJdKpJl2XZhVM1FDBjbV03bACmUytAaa6rGwtohTNgIvdrrfV7tyuWQSBk+HX+B9nIwZ5h/7tn/8cl9Xf41y77gfN+MgVf40y8CZ71M/czY4yqO2nIrfwAAAAASUVORK5CYII=");}#modal-content-mobile.android > button{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAAkCAYAAABsbd/MAAAAAXNSR0IArs4c6QAADIhJREFUaAXtWwl0TtcW3v//RyJmMVOzmhoxV4mhXWKooSgWbbWlpfV45sh6r8qzTFXEuOhrlRY1xlRqjOLV7CUp9RBjkZraBAkpErHf/nbcm/v/f4onZP15zV7r5J577r7nnP+cs/f+9t43RKmUXy6hUmKk3JfC2cUj1gB7cUHKFCn5pJDtQWWPXP3RkE0euwJHZGaNHfJnvJSOHjvN7IkZK1BMKt6QMIhcaaM1++rRKxCDDYOexDWbPH8FGBsFgPHMycvLi6pWrUrJycl04sQJHa9UqVJUoEABc2y0V6lSxbxH5fTp03T37l1tK1iwIDkcDrLb7VSkSBGTLz4+nn755RfzHhXwVq5cmc6fP09XrlzRZ8WKFaOUlBSKjY3V+0qVKtG5c+fo3r17ep9V/jxzRPjCCy/w4cOHee7cubxy5Upes2aNjrlgwQLeunUrf/7551pkkfX6ww8/8KFDh7ReokQJc379+/fnUaNGcYcOHfRZYmIiz58/nz/88EOTRxad33nnHY6IiOCpU6fy7t27eeTIkfo8NDSUf/75Zy5UqJDeR0dHc/HixZ3exfseXp79BLEBbdq0MRcib968WseG9e3bl8uVK6fFZrNp+wcffMCTJk0y+Y0FNDbMuBep4jx58jjxYTNEojh//vzaLhLJR48e5Tp16jA2bO/evRweHs5oz4ob5iU//plT+fLlSSSGunbtSgMGDCCRGmratKmO+8Ybb1BgYKDWe/fubaq/J51UyZIl6dq1awQ1CYIKPHXqFGEOoHnz5ul4EydO1Pus9seeGRNevXo1ffTRR7R27Vpq37495ciRQ20Rxp45cya9/fbbWgxblZE5HT9+XF9/6623CHazWbNmVLduXRIpN7vt168fvfzyy+Ymmg+yQCVTNiwkJEQN/Y4dO2jjxo2E0w2QcPbsWRo6dCjt2rVLS+HChXXJfv31V4qJQdDFma5evUoXL140G3/88UeVILNBKgAQr776KrVt25bEbtLw4cP1kPz222904cIFwvXOnTvUuXNnOnjwoIIg6/ueXs80lOjpC5FV5ucmYd6OHOTlyBTTllXWyKPm6bYzPer3JnqlLsVFbKd125YSM8BWNnnKCiCWONo6mfoVGtKeOrWpRoXSVKtbOyp6JZFOXzxrZfm/qcPWvf/++4pYo6KiMoxQM2Nh3CTMZreRw8dOu9iPWiRcoyKz+9I/IjtQ+PR5tDf6UIbn5Ofnp4hQfC8Sv0sh/u3btxXFiVNNCQkJGR7jcTpAxASgY8WKFbRz586nPm6TJk00ogMA9TTJzYbZHbJhEhN2eNtpe67CVHLvHUoMLEpBa/5O00PHU/VSZZ94fMD39evX0759+2jIkCE0ePBg6tatGy1atEhhP/wla8jpiQd6jBfhn8XFxanKx4F52iTRF3r++eefdrfkLmGiJL1EwtR2Sagx3LsotdoVS3mDbGTvWpGGdZpAySsP05iJX9IlcVAfl+AXjR8/nmrXrq0LZX3v+++/pz59+lCuXLkUdlufZdedV8B9wx6oRASs+D5r3Co8RxEK2htH1V5JIe+8RL59atKiHqEUPX8fDR+7gH5/EJx17jrtDgHeWbNm0YgRI9w2y+CCj+ZKuXPnVn8JJzUpKUl9uMjISCc28HTp0oUQyAXPhg0bCPbISnCgGzRoQM8995zpsCMSsmnTJiub1hFYljAavfjii+qvQWUiAO1KnTp1onXr1un84JjDR1y8eLFeXXlx36JFCzOis2fPHpLwmJoE2FBEX1zBXa1atShnzpy0f/9+p+4eohJTbZmXqEZI3A7fwnT0gDcVEMc0b4775OvnRQ3/1piizs2gd+sF6OBOPVtu8OMQPZdAr6X14VUs8PLly+nAgQMkAV9CBEMCuSTxQPPFl156iZYtW6Yq1uDBYkyePNnkQURjzpw56iAjPIVFbdSokfZ7/z4yS2kkMU5CVOb69es0evRodcKPHDmi0ZI0rtTa9OnTSYLYml3YsmWLHhbMDwvtSkuWLNGw3LZt29ReIgRnbFKrVq2oZcuWrq+QBK7JdX4GE3C7WQa2H8pNNuzkJt/t5Mbrd3DgOinfbufAtdu5kZTB61ZxxI2v+KeUBRyd9BXfWjmWeU4IR43pyUEB5cx+rH1K+EkOEDOi8db2P6qLRLIYa5ZNc+IfM2aM9iN2T/uSqAXXr1/fiWfsWJmPkMQtWSInLJLENWrUMHmQLbh586YZHMZzkSJ9LlqAp02bZvL6+/uzSC1jXNe5IlMgUujULlLEYp+17ZtvvmGJkeo4X3/9tRMfAs8IUGM9JKbKYtednlerVs3sx3VcNwmz5aQHoCMVfEC6vHwcihwhbZEOP1pwoBD5XEuiMt+ep9wJNyX5xFS7ZhEKD+1Km6d2oSrl/GScNELsEISg7+MQgAjAh0TTndjlh+t9r169FKwglPUwnqCgIMqXL5/mz4yOwsLCSCL86QKC7t270+XLl6l58+Ya42zXrh2VKVNGJdx437gixAWUaSWoOckWkBFiwzOo3p49e5psPj4+GksFeoSpQIwTecEKFSqYPJKVUBNiNlgq7jYsp003SA6pyp1xJUlKw6YR2en368mUb8hW8mkknxkU9yXKJc0ovkyV/QtS8eK56cS5NEBiBGQh+seOHbMMn1pF5N5Ah0guGpPHj8cPNgixRywoIvIVK1bUZvCIxBgsdObMGbUj4Ll06ZK2I+CMuCLoxo0bdOvWLTe7BBcDahtqFnZw0KBBbnZFO3jEHyREixYt6sQFmzhs2DBVmwYiLVu2rMkze/ZsQkA6ODhYDxPsHVB0euQmYXbZMMB6SJZ51brcyzUgPpZGLQojvphI8RtP0P3kWyphcbbbNGTODqrabj79a3+M01irVq1SG4JJACRYCRNHG7LR8MPgnyFLDMJJdyX8YGSmH8Vz8uRJ07dD8Lljx44kKo4GDhxIb775pm6ctW8cTLwD/0mSnE+0WegPm2VktHGPA4CMxHvvvadB6ddff51QjPmDBzZOkrLk6+tLknxVO4vMfHrktmE2ERhsjG5WzlR1mKoW7dTg6hX6y5ebKCnBTsnsTXcTbRQfdpomhR2kim3n0vSvIuUUpbiNgwj7hAkTVL3A5/L29jZ5MHGgNUkyahtOP4AEclqSyHQCM1AhkJwZM2bQ0qVLFRy48kBKoHrBA0IODkUSmAQAAWAAXzA9ksy3qrPPPvvMadz0eDEXqDIrVa9eXYGK1VmuWbOmjmfdIKjM0qXTvnvCIQTYgesD1Ih5PIycDF7w8GB+7dgBfu3ofm4vpd0RKT/t4/HLl3FUi2A+3LQfH2/Wi880785b/tqWy5RIzR7LAE79uN4jmyxpFZb0Bws0ZwkLscBt8x1BTnLImSXtoW0wxgAV+KxAvsVgsSUsqJHBZ/QtuS7l+eKLL1hOtvIAQMhpNnkMXrwvp1Y/PZDF0udycFgWi8UWsUg4i63lhQsX6jwAHsSxZ1FlDDBh9GNcJf3DcrC4devWLBpCAYhAcBYEqrwG6BB3gyUgwIJWGeOKpOsYYhoYoMboTzQNi2ugz4y29K5u6ZWQUcF0+t1uAinRV+orzSLPUr25p8iRdJt87Lfp94BYGrRtK0VFX03l+R/+CgJSlYSTBxUANQQVgg9lJH2vUmDAWQAGw/DDz0EuDVcrPYqncePGqopg5+CrIcON8BfsJuA7fCgQ2hCBAUEtAvpDLcE/RN7NlRCVgYoFRK9Xr57OX74v0ew2eOHKyHclmtcTlKqqDnMFUIGWgQpEv1YfDz4mIiR472Fk7rIwcciEEO4aE8FdpHQ+/2/+58LlvLnpLN4WOJn39R7GbRpWcuLHO55apkyZot9vGN93YJ6A+AJGWNBihuYNqXmavxsSjg+GHtWnG0q0C9KDDRO9QC2/O0cF5ieRd9kkWnJjhTh7EU9sjGUimUpAmkBmQKZWpAk79vHHH6tkZOqE/mAw2Fwg3k8++YTGjRv3B1xpzW4bZlOUaKdWi8XH2pxCkaWX0JSVW9MFE2ndeG4NKhH+kZWQMUDIKSOEBX4aBBDVo0cPQuRk8+bNj+zSzYaNmBdCle80pdjI1TQmbDHF30z9iPORPXkgAz78QYgJqBP2Dwg0ICBAQz6ffvppltEW1qXFhjl9qu3vX5ri4+Ip5nLm5KWsk3kWdflQlBo2bKgRD8BtAAs4z1mU9FPtCzL5NKcgi/6SP8m0Y+A4Z0yZ/0lWykN+5gqoRPxn324pNTxkUtnTSH8F/iPNgQ75A1SxWAriRWWkSIpSIr3Z5AkrAL/sopQvpbwrJeG/tfq9c6N4GygAAAAASUVORK5CYII=");}</style></template></dom-module>
<dom-module id="tinychat-mobile" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-mobile"></style><div id="modal-content-mobile" class$="[[mobileClass]]"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Download our app</h1><button on-click="openStore"></button></div></template>
<script>
class ModalDialogMobile extends Polymer.Element {
static get is() {
return "tinychat-mobile"
}
static get properties() {
return {
app: {
type: Object
},
mobileClass: {
type: String
},
onkeydownHandler: Object,
onClose: Object
}
}
constructor() {
super(), this.mobileClass = isMobile.apple.device ? "ios" : "android"
}
get settings() {
return this.app.settings
}
connectedCallback() {
super.connectedCallback(), this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener("keydown", this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener("keydown", this.onkeydownHandler)
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogMobile.is)
}
close() {
this.parentNode instanceof Modal && (this.parentNode.close(ModalDialogMobile.is, this), Object.isFunc(this.onClose) && this.onClose())
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || "Escape" == a.key || "Esc" == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogMobile.is) && this.close(a)
}
openStore() {
isMobile.apple.device ? this.app.GoAppStore() : this.app.GoGooglePlay()
}
}
customElements.define(ModalDialogMobile.is, ModalDialogMobile);
</script>
</dom-module>
<dom-module id="client-modal-settings" assetpath="../../styles/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}#modal-content-settings{position:relative;width:100%;max-width:400px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-settings *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-settings > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;cursor:default;}#modal-content-settings > div{position:relative;width:100%;padding:0 40px 25px 0;box-sizing:border-box;text-align:left;}#modal-content-settings > div > label{display:inline-block;max-width:100%;font-size:12px;font-weight:600;color:#414141;line-height:16px;white-space:nowrap;text-transform:uppercase;text-overflow:ellipsis;overflow:hidden;cursor:pointer;}#modal-content-settings > div > label:before{content:'';position:absolute;display:block;height:16px;width:30px;top:0;right:0;border-radius:8px;background-color:#c2c9cb;transition:.2s;}#modal-content-settings > div > input:checked + label:before{background-color:#41b7ef;}#modal-content-settings > div > label:after{content:'';position:absolute;display:block;height:10px;width:10px;top:3px;right:3px;border-radius:100%;background-color:#fff;transition:.2s;}#modal-content-settings > div > input:checked + label:after{right:17px;}#modal-content-settings > div > input{display:none;}#modal-content-settings > #buttons{display:flex;flex-direction:row;align-items:stretch;width:100%;white-space:nowrap;}#modal-content-settings > #buttons > *:first-child{margin-right:20px;}#buttons > button{display:block;height:40px;width:100%;border:1px solid #41b7ef;box-sizing:border-box;font-size:12px;font-weight:700;color:#41b7ef;background-color:#fff;line-height:38px;text-align:center;text-transform:uppercase;cursor:pointer;transition:.2s;}#buttons > button:hover{background-color:#d6f2ff;}#buttons > button:active{background-color:#c7e8f8;}#buttons > button + button{border-color:transparent;color:#fff;background-color:#41b7ef;}#buttons > button + button:hover{background-color:#54ccf3;}#buttons > button + button:active{background-color:#38a8de;}#modal-content-settings > .modal-content-settings-info{padding:40px 0 0;text-align:center;}#modal-content-settings > .modal-content-settings-info + .modal-content-settings-info{padding-top:24px;}.modal-content-settings-info > button{display:inline-block;margin:0;padding:0;border:0;font-size:12px;font-weight:600;color:#3cafe1;background:none;line-height:16px;cursor:pointer;}.modal-content-settings-info > button:hover{text-decoration:underline;}.modal-content-settings-info > span{font-size:12px;color:#262626;line-height:16px;cursor:default;}</style></template></dom-module>
<dom-module id="tinychat-settings" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-settings"></style><form id="modal-content-settings" on-submit="onOK"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Settings</h1><div><input id="input-checkbox-2" type="checkbox" name="play_youtube_videos" on-change="youtubeChange"><label for="input-checkbox-2">PLAY YOUTUBE VIDEOS</label></div><div><input id="input-checkbox-3" type="checkbox" name="receive_private_message" on-change="privateChange"><label for="input-checkbox-3">RECEIVE PRIVATE MESSAGE</label></div><div><input id="input-checkbox-sounds" type="checkbox" name="play_sounds" on-change="soundChange"><label for="input-checkbox-sounds">NOTIFICATION SOUNDS</label></div><span id="buttons"><button id="button-cancel" on-click="cancel">CANCEL</button> <button id="button-save" on-click="save">SAVE</button></span><div class="modal-content-settings-info"><button on-click="onWebsettings">Chatroom Privacy Settings</button></div><div class="modal-content-settings-info"><button on-click="onDevnews">Development News</button></div><div class="modal-content-settings-info"><span>[[version]]</span></div></form></template>
<script>
class ModalDialogSettings extends Polymer.Element {
static get is() {
return 'tinychat-settings'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
enablePMs: {
type: String,
notify: !0
},
enableYoutube: {
type: String,
notify: !0
},
enableSound: {
type: String,
notify: !0
},
с onfirmBans: {
type: Boolean,
notify: !0
},
rememberVolume: {
type: String,
notify: !0
},
enableAcousticEchoCancelation: {
type: String,
notify: !0
},
version: {
type: String,
value: 'v.1.0.0'
},
settings_before: Object,
onkeydownHandler: Object
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
get settings() {
return this.app.settings
}
connectedCallback() {
super.connectedCallback();
let a = this.settings.getSettings();
this.setProperties({
settings_before: a,
enablePMs: a.enablePMs,
enableYoutube: a.enableYoutube,
enableSound: a.enableSound,
с onfirmBans: a.с onfirmBans,
rememberVolume: a.rememberVolume,
enableAcousticEchoCancelation: a.enableAcousticEchoCancelation
}), this.$['input-checkbox-2'].checked = this.enableYoutube, this.$['input-checkbox-3'].checked = this.enablePMs, this.$['input-checkbox-sounds'].checked = this.enableSound, this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
chatroomAssigned() {
let b = this,
c = this.chatroom.app.EventBus;
this.version = this.app.version.title()
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogSettings.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogSettings.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogSettings.is) && this.cancel(a)
}
onOK(a) {
return a.preventDefault(), !1
}
onDevnews(a) {
return a.preventDefault(), this.app.DevNews(), !1
}
onWebsettings(a) {
return a.preventDefault(), this.app.WebSettings(), !1
}
cancel() {
this.settings.saveSettings(this.settings_before), this.close()
}
save() {
this.close()
}
bansChange(a) {
this.settings.switchConfirmBan(this._str2bool(a))
}
youtubeChange(a) {
this.settings.switchYoutube(this._str2bool(a))
}
privateChange(a) {
this.settings.switchPrivatemessaging(this._str2bool(a))
}
soundChange(a) {
this.settings.switchSound(this._str2bool(a))
}
echoChange(a) {
this.settings.switchAcousticEchoCancelation(this._str2bool(a))
}
volumeChange(a) {
this.settings.switchRememberVolume(this._str2bool(a))
}
_str2bool(a) {
let b = a.path ? a.path[0] : (a.composedPath && a.composedPath())[0];
return b.checked
}
}
customElements.define(ModalDialogSettings.is, ModalDialogSettings);
</script>
</dom-module>
<dom-module id="client-modal-upgrade" assetpath="../../styles/"><template><style>*{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}#modal-content-upgrade{position:relative;width:100%;max-width:540px;margin:0 auto;padding:0 0 60px;border-radius:10px 10px 4px 4px;box-sizing:border-box;background-color:#fff;text-align:center;}#modal-content-upgrade *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;z-index:1;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-upgrade > h1{position:relative;margin:0;padding:50px;border-radius:4px 4px 0 0;box-sizing:border-box;font-size:24px;font-weight:400;color:#fff;line-height:33px;background-color:#2f373a;cursor:default;overflow:hidden;}#modal-content-upgrade > h1 > span{position:relative;}#pro-1,
#pro-2,
#pro-3,
#pro-4,
#extreme-1,
#extreme-2,
#extreme-3,
#gold-1,
#gold-2,
#gold-3,
#button-pro-1,
#button-pro-2,
#button-extreme-1,
#button-gold-1{position:absolute;display:block;border-radius:100%;}#pro-1,
#pro-2,
#pro-3,
#pro-4,
#button-pro-1,
#button-pro-2{background-color:#2ecb4e;}#extreme-1,
#extreme-2,
#extreme-3,
#button-extreme-1{background-color:#ad6bce;}#gold-1,
#gold-2,
#gold-3,
#button-gold-1{background-color:#efa701;}#pro-1{height:180px;width:180px;top:-40%;left:-25%;}#pro-2{height:16px;width:16px;top:70%;left:28%;}#pro-3{height:200px;width:200px;top:70%;left:40%;}#pro-4{height:90px;width:90px;top:-7%;left:76%;}#extreme-1{height:90px;width:90px;top:77%;left:6%;}#extreme-2{height:65px;width:65px;top:10%;left:20%;}#extreme-3{height:40px;width:40px;top:-11%;left:97%;}#gold-1{height:35px;width:35px;top:-6%;left:12%;}#gold-2{height:20px;width:20px;top:10%;left:44%;}#gold-3{height:180px;width:180px;top:65%;left:83%;}#modal-content-upgrade-content{position:relative;width:100%;padding:40px 70px 0;box-sizing:border-box;}#modal-content-upgrade-content > div{max-width:300px;margin:0 auto 24px;font-size:12px;color:#262626;line-height:16px;}#modal-content-upgrade-content > button{position:relative;display:block;height:40px;width:100%;padding:0 30px;border:none;box-sizing:border-box;font-family:'Open Sans';font-size:12px;font-weight:600;letter-spacing:1px;color:#fff;background-color:#2f373a;cursor:pointer;overflow:hidden;}#modal-content-upgrade-content > button > span{position:relative;}#button-pro-1{height:60px;width:60px;top:54%;left:5%;}#button-pro-2{height:37px;width:37px;top:-35%;left:83%;}#button-extreme-1{height:16px;width:16px;top:24%;left:69%;}#button-gold-1{height:100px;width:100px;top:-200%;left:15%;}</style></template></dom-module>
<dom-module id="tinychat-upgrade" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-upgrade"></style><div id="modal-content-upgrade"><svg id="close-button" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" on-click="close"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1><div id="pro-1"></div><div id="pro-2"></div><div id="pro-3"></div><div id="pro-4"></div><div id="extreme-1"></div><div id="extreme-2"></div><div id="extreme-3"></div><div id="gold-1"></div><div id="gold-2"></div><div id="gold-3"></div><span>Upgrade your Tinychat membership</span></h1><div id="modal-content-upgrade-content"><div>[[msg]]</div><button on-click="upgrade"><div id="button-pro-1"></div><div id="button-pro-2"></div><div id="button-extreme-1"></div><div id="button-gold-1"></div><span>UPGRADE NOW</span></button></div></div></template>
<script>
class ModalDialogUpgrade extends Polymer.Element {
static get is() {
return 'tinychat-upgrade'
}
static get properties() {
return {
onkeydownHandler: Object,
msg: {
type: String,
value: 'Get high quality video, fullscreen, premium membership badges and more!'
}
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
get settings() {
return this.app.settings
}
connectedCallback() {
super.connectedCallback(), this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogUpgrade.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogUpgrade.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogUpgrade.is) && this.cancel(a)
}
cancel() {
this.close()
}
upgrade() {
this.app.UpgradeSub()
}
}
customElements.define(ModalDialogUpgrade.is, ModalDialogUpgrade);
</script>
</dom-module>
<dom-module id="client-modal-youtube" assetpath="../../styles/"><template><style>#modal-content-youtube-lists{user-select:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#modal-content-youtube{position:relative;width:100%;max-width:800px;margin:0 auto;box-sizing:border-box;border-radius:4px;background-color:#fff;overflow:hidden;}*:focus{outline:none;}#input-playlist,
#input-playlist-label-wrapper{display:none;}#modal-content-youtube-form{position:relative;padding:50px 70px 38px;border-bottom:1px solid rgba(0, 0, 0, .1);}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-youtube > form > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-youtube-search{position:relative;}#modal-content-youtube-search > svg{position:absolute;display:block;bottom:12px;left:12px;}#input-search{height:40px;width:100%;padding:0 40px;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;font-family:inherit;font-size:14px;font-weight:400;color:#414141;text-align:center;line-height:38px;letter-spacing:.5px;transition:.2s;}#input-search:hover,
#input-search:active{border-color:#41b7ef;}#input-search[disabled]{border-color:#c5d5dc;color:#c5d5dc;background-color:#f6f6f6;}#modal-content-youtube-lists{position:relative;display:flex;flex-direction:row;height:420px;width:100%;}#modal-content-youtube-popular-wrapper{position:relative;height:100%;width:100%;}#modal-content-youtube-popular-wrapper:after{content:'';position:absolute;height:40px;bottom:0;left:10px;right:15px;background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );pointer-events:none;}#modal-content-youtube-popular{height:100%;width:100%;padding-bottom:30px;padding-left:60px;text-align:left;}#modal-content-youtube-popular-header{display:block;height:62px;padding-top:30px;padding-right:5px;box-sizing:border-box;font-size:16px;font-weight:700;text-align:center;cursor:default;}#modal-content-youtube-popular-empty{display:none;padding:20px 5px 20px 0;font-size:14px;text-align:center;cursor:default;}#modal-content-youtube-popular-empty:only-of-type{display:block;}.modal-content-youtube-popular-item{display:inline-block;width:120px;padding:10px;}.modal-content-youtube-popular-item-video{position:relative;height:68px;width:100%;}.modal-content-youtube-popular-item-video > img{height:100%;width:100%;border-radius:4px;}.modal-content-youtube-popular-item-video-play{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:4px;background-color:rgba(0, 0, 0, .7);opacity:0;visibility:hidden;transition:.2s;}.modal-content-youtube-popular-item-video-play > svg{position:absolute;top:50%;left:50%;margin:-14px 0 0 -14px;cursor:pointer;opacity:.8;transition:.2s;}.modal-content-youtube-popular-item-video-play > svg:hover{opacity:1;}.modal-content-youtube-popular-item-video > svg{position:absolute;bottom:6px;right:6px;cursor:pointer;opacity:0;visibility:hidden;transition:.2s;}.modal-content-youtube-popular-item-video:hover > .modal-content-youtube-popular-item-video-play{opacity:1;visibility:visible;}.modal-content-youtube-popular-item-video:hover > svg{opacity:.8;visibility:visible;}.modal-content-youtube-popular-item-video:hover > svg:hover{opacity:1;}.modal-content-youtube-popular-item-text{position:relative;width:100%;height:32px;padding-top:6px;text-align:center;cursor:default;overflow:hidden;}.modal-content-youtube-popular-item-text:after{content:'';position:absolute;display:block;height:16px;width:30px;bottom:0;right:0;background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,1) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 );}.modal-content-youtube-popular-item-text > span{font-size:12px;color:#262626;line-height:16px;cursor:default;}#modal-content-youtube-playlist{position:relative;display:flex;flex-direction:column;height:100%;width:300px;min-width:300px;border-radius:0 0 4px 0;background-color:#f6f6f6;overflow:hidden;transition:top .8s;}#modal-content-youtube-playlist:after{content:'';position:absolute;height:40px;bottom:0;left:0;right:15px;background:-moz-linear-gradient(top, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);background:-webkit-linear-gradient(top, rgba(246,246,246,0) 0%,rgba(246,246,246,1) 100%);background:linear-gradient(to bottom, rgba(246,246,246,0) 0%,rgba(246,246,246,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00f6f6f6', endColorstr='#f6f6f6',GradientType=0 );pointer-events:none;}#modal-content-youtube-playlist-header{height:62px;min-height:62px;width:100%;font-size:0;background-color:#f6f6f6;}#modal-content-youtube-playlist-header > button{position:absolute;height:30px;width:30px;top:16px;left:33.33%;margin-left:-15px;padding:0;border:none;background:none;line-height:30px;text-align:center;cursor:pointer;}#modal-content-youtube-playlist-header > button + button{left:66.66%;}#modal-content-youtube-playlist-header > button > svg{vertical-align:middle;}#modal-content-youtube-playlist-header > button > svg > path{transition:.2s;}#modal-content-youtube-playlist-header > button:hover > svg > path{fill:#cddde4;}#modal-content-youtube-playlist-header > button.active > svg > path{fill:#41b7ef;}#modal-content-youtube-playlist-items{position:relative;height:100%;padding-bottom:22px;}#modal-content-youtube-playlist-empty{display:none;padding:20px 0 20px 15px;font-size:14px;text-align:center;cursor:default;}#modal-content-youtube-playlist-empty:only-of-type{display:block;}#modal-content-youtube-playlist-items.on-white-scroll{padding-left:0;}#modal-content-youtube-playlist-items.on-white-scroll::-webkit-scrollbar-track{background-color:#f6f6f6;}#modal-content-youtube-playlist-items.on-white-scroll::-webkit-scrollbar-thumb{border-color:#f6f6f6;}.modal-content-youtube-playlist-item{position:relative;height:65px;width:100%;margin-bottom:2px;padding:8px 35px 9px 104px;box-sizing:border-box;line-height:48px;text-align:left;transition:.2s;}.modal-content-youtube-playlist-item:hover{background-color:#fff;}.modal-content-youtube-playlist-item-video{position:absolute;height:45px;width:80px;top:10px;left:16px;}.modal-content-youtube-playlist-item-video > img{height:100%;width:100%;border-radius:4px;}.modal-content-youtube-playlist-item-video-play{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:4px;background-color:rgba(0, 0, 0, .7);opacity:0;visibility:hidden;transition:.2s;}.modal-content-youtube-playlist-item-video:hover > .modal-content-youtube-playlist-item-video-play{opacity:1;visibility:visible;}.modal-content-youtube-playlist-item-video-play > svg{position:absolute;top:50%;left:50%;margin:-8px 0 0 -8px;cursor:pointer;opacity:.8;transition:.2s;}.modal-content-youtube-playlist-item-video-play > svg:hover{opacity:1;}.modal-content-youtube-playlist-item-text{display:inline-block;max-height:100%;font-size:12px;color:#262626;line-height:16px;text-align:left;vertical-align:middle;overflow:hidden;cursor:default;}.modal-content-youtube-playlist-item-close{position:absolute;height:100%;width:120px;top:0;right:5px;background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,1) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 );font-size:0;opacity:0;visibility:hidden;transition:.2s;}.modal-content-youtube-playlist-item:hover > .modal-content-youtube-playlist-item-close{opacity:1;visibility:visible;}.modal-content-youtube-playlist-item-close > button{position:absolute;height:20px;width:20px;top:50%;right:23px;margin:-10px 0 0 0;padding:4px;border:none;box-sizing:border-box;background-color:transparent;line-height:20px;text-align:center;cursor:pointer;}.modal-content-youtube-playlist-item-close > button > svg{vertical-align:top;}#modal-content-youtube-popular-wrapper > .waiting,
#modal-content-youtube-playlist > .waiting{position:absolute;width:auto;top:0;bottom:0;left:0;right:0;border-radius:0 0 0 4px;background-color:#fff;opacity:0;visibility:hidden;transition:.2s;}#modal-content-youtube-playlist > .waiting{border-radius:0 0 4px 0;background-color:#f6f6f6;}#modal-content-youtube-popular-wrapper.wait > .waiting,
#modal-content-youtube-playlist.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}#modal-content-youtube-playlist > .waiting > .waiting-content > span{border-color:#cacece;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}#modal-content-youtube-popular-wrapper.wait > .waiting > .waiting-content > span,
#modal-content-youtube-playlist.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 815px){#modal-content-youtube-popular-header,
#modal-content-youtube-popular-empty{padding-right:0;}#modal-content-youtube-popular{padding-left:15px;text-align:center;}}@media screen and (max-width: 630px){#modal-content-youtube-form{padding-right:25px;padding-left:25px;}#modal-content-youtube-lists{display:block;padding-bottom:40px;box-sizing:border-box;}#input-playlist-label-wrapper{position:absolute;display:block;height:40px;width:100%;left:0;background-color:#fff;z-index:1;}#input-playlist-label-wrapper > label{position:absolute;height:20px;width:20px;top:10px;left:50%;margin-left:-10px;cursor:pointer;}#input-playlist-label-wrapper > label:before,
#input-playlist-label-wrapper > label:after{content:'';position:absolute;display:block;height:3px;width:100%;top:2px;left:0;border-radius:3px;background-color:#04caff;transform-origin:50% 50%;transition:top .4s ease .4s,
transform .4s ease 0s;}#input-playlist-label-wrapper > label:after{top:16px;}#input-playlist:checked + #input-playlist-label-wrapper > label:before,
#input-playlist:checked + #input-playlist-label-wrapper > label:after{top:9px;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:top .4s ease 0s,
transform .4s ease .4s;}#input-playlist:checked + #input-playlist-label-wrapper > label:after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg);}#input-playlist-label-wrapper > label > span{position:absolute;display:block;height:3px;width:100%;top:9px;left:0;border-radius:3px;background-color:#04caff;transition:opacity 0s ease .4s;}#input-playlist:checked + #input-playlist-label-wrapper > label > span{opacity:0;}#modal-content-youtube-playlist{position:absolute;height:380px;width:100%;top:380px;}#input-playlist:checked ~ #modal-content-youtube-playlist{top:0;}}</style></template></dom-module>
<dom-module id="tinychat-youtube" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-youtube"></style><div id="modal-content-youtube"><form id="modal-content-youtube-form" on-submit="onSearch"><svg id="close-button" on-click="close" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>YouTube Video Selection</h1><div id="modal-content-youtube-search"><svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M12.108 10.75l3.61 3.61a.957.957 0 0 1 0 1.357.963.963 0 0 1-1.357.002l-3.61-3.61a6.723 6.723 0 1 1 1.358-1.36zm-5.385.776a4.802 4.802 0 1 0 0-9.605 4.802 4.802 0 0 0 0 9.606z" fill="#c4d4dc" fill-rule="evenodd"></path></svg> <input id="input-search" type="text" placeholder="Search for videos or enter a YouTube URL" maxlength="150" value="" on-click="onInput"></div></form><div id="modal-content-youtube-lists"><div id="modal-content-youtube-popular-wrapper" class=""><div id="modal-content-youtube-popular" class="on-white-scroll"><span id="modal-content-youtube-popular-header">[[title_results]]</span><div id="modal-content-youtube-popular-empty">List is empty</div><dom-repeat items="[[_queryresult]]"><template strip-whitespace=""><div class="modal-content-youtube-popular-item"><div class="modal-content-youtube-popular-item-video"><img src="[[item.imgurl]]" alt="img"><div class="modal-content-youtube-popular-item-video-play"><svg on-click="onPlayItem" width="28" height="28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M0 2.67C0 .398 1.608-.62 3.586.394l22.93 11.766c1.98 1.016 1.978 2.664 0 3.68L3.586 27.606c-1.98 1.015-3.586 0-3.586-2.28V2.67z" fill="#fff" fill-rule="evenodd"></path></svg></div><svg on-click="onAdd2Playlist" width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M10 8V5H8v3H5v2h3v3h2v-3h3V8h-3zM9 18A9 9 0 1 1 9 0a9 9 0 0 1 0 18z" fill="#fff" fill-rule="evenodd"></path></svg></div><div class="modal-content-youtube-popular-item-text"><span title="[[item.title]]">[[item.title]]</span></div></div></template></dom-repeat>
</div>
<div class="waiting">
<div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div>
</div>
</div><input id="input-playlist" type="checkbox">
<div id="input-playlist-label-wrapper"><label for="input-playlist"><span></span></label></div>
<div id="modal-content-youtube-playlist" class="">
<div id="modal-content-youtube-playlist-header"><button id="btnRandom" on-click="onRandomToggle"><svg width="26" height="24" viewBox="0 0 26 24" xmlns="http://www.w3.org/2000/svg"><path d="M25.61 18.846c.233.203.39.49.39.823 0 .332-.154.618-.385.82l-3.188 3.193a1.078 1.078 0 0 1-1.53-.008 1.104 1.104 0 0 1 .008-1.55l1.384-1.388c-3.867-.273-7.564-4.037-11.146-7.692-3.402-3.477-6.923-7.07-10.05-7.07a1.09 1.09 0 0 1-1.08-1.097 1.09 1.09 0 0 1 1.08-1.096c4.03 0 7.87 3.924 11.588 7.72 3.223 3.29 6.548 6.682 9.546 7.036l-1.323-1.324a1.102 1.102 0 0 1-.01-1.55 1.07 1.07 0 0 1 1.53-.008l3.186 3.19zm-11.734-7.8c-.275 0-.55-.105-.76-.316a1.105 1.105 0 0 1-.01-1.55c3.328-3.406 6.186-5.702 9.197-5.906l-1.397-1.4a1.102 1.102 0 0 1-.01-1.548 1.072 1.072 0 0 1 1.53-.01l3.186 3.19c.23.203.387.49.387.824 0 .333-.155.62-.388.822l-3.186 3.193a1.075 1.075 0 0 1-1.53-.008 1.103 1.103 0 0 1 .006-1.55L22.2 5.49c-2.42.312-5.05 2.67-7.553 5.23-.21.22-.49.327-.77.327zM8.45 13.47a1.073 1.073 0 0 1 1.53.014 1.105 1.105 0 0 1-.014 1.55c-2.58 2.562-5.653 5.184-8.884 5.184A1.09 1.09 0 0 1 0 19.12a1.09 1.09 0 0 1 1.082-1.095c2.453 0 5.1-2.303 7.37-4.557z" fill="#c4d4dc"></path></svg></button> <button id="btnCycle" on-click="onCycleToggle"><svg width="28" height="22" viewBox="0 0 28 22" xmlns="http://www.w3.org/2000/svg"><path d="M7.908.008c.385.044.714.313.854.696.14.383.066.816-.19 1.124L6.935 3.872h16.917C26.324 3.872 28 6.037 28 8.268v6.595c.005.397-.19.766-.514.965-.323.2-.723.2-1.046 0-.323-.2-.52-.568-.514-.965V8.268c0-1.142-.692-2.198-2.074-2.198H6.935l1.637 2.027c.242.3.314.715.19 1.087a1.06 1.06 0 0 1-.797.714 1.01 1.01 0 0 1-.98-.376L3.872 5.675a1.15 1.15 0 0 1 0-1.425L6.983.403A1.01 1.01 0 0 1 7.91.008zM1.15 6.053c.534.062.935.547.923 1.116v6.594c0 1.143.692 2.2 2.074 2.2h16.917l-1.637-2.045c-.284-.34-.34-.832-.143-1.235a1.025 1.025 0 0 1 1.034-.587c.273.03.523.17.697.395l3.11 3.847c.33.41.33 1.015 0 1.426l-3.11 3.847a1 1 0 0 1-1.464.126 1.15 1.15 0 0 1-.123-1.553l1.637-2.026H4.148C1.676 18.16 0 15.997 0 13.765V7.17c-.006-.316.116-.62.337-.834a1 1 0 0 1 .814-.282z" fill="#c4d4dc"></path></svg></button></div>
<div id="modal-content-youtube-playlist-items" class="on-white-scroll">
<div id="modal-content-youtube-playlist-empty">List is empty</div>
<dom-repeat items="[[_playlist]]"><template strip-whitespace=""><div class="modal-content-youtube-playlist-item"><div class="modal-content-youtube-playlist-item-video"><img src="[[item.imgurl]]" alt="img"><div class="modal-content-youtube-playlist-item-video-play"><svg on-click="onPlayItem4Playlist" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M0 1.526c0-1.3.92-1.882 2.05-1.3l13.102 6.722c1.13.58 1.13 1.523 0 2.103L2.05 15.776c-1.133.58-2.05 0-2.05-1.302V1.526z" fill="#fff" fill-rule="evenodd"></path></svg></div></div><div class="modal-content-youtube-playlist-item-text" title="[[item.title]]">[[item.title]]</div><div class="modal-content-youtube-playlist-item-close"><button on-click="onRemove4Playlist"><svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0z" fill="#e53951" fill-rule="evenodd"></path></svg></button></div></div></template></dom-repeat>
</div>
<div class="waiting">
<div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div>
</div>
</div>
</div>
</div>
</template>
<script>
class ModalDialogYoutube extends Polymer.Element {
static get is() {
return 'tinychat-youtube'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
_queryresult: {
type: Array,
value: []
},
_playlist: {
type: Array,
value: []
},
title_results: {
type: Array,
value: 'Most Popular Today'
},
israndom: {
type: Boolean,
value: !1,
observer: 'israndomObserver'
},
iscycle: {
type: Boolean,
value: !1,
observer: 'iscycleObserver'
},
onkeydownHandler: Object
}
}
constructor() {
super()
}
get _yt_api_key() {
return 'AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg'
}
get _api() {
return WebAPI.getInstance()
}
get app() {
return this.chatroom.app
}
get settings() {
return this.app.settings
}
connectedCallback() {
super.connectedCallback(), this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
chatroomAssigned(a) {
let b = this,
c = this.chatroom.app.EventBus,
d = this.$['modal-content-youtube-playlist'];
d.classList.add('wait'), a.YoutubePlaylistLoad(() => {
b._playlist = Array.from(b.chatroom.youtubelist), b.israndom = b.chatroom.youtubelist_random, b.iscycle = b.chatroom.youtubelist_repeat, d.classList.remove('wait')
}), this.onSearch(new Event('most-popular'))
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogYoutube.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogYoutube.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogYoutube.is) && this.close(a)
}
onSearch(a) {
a.preventDefault();
let b = this,
c = TinychatApp.DAL.YoutubeItem,
d = this.$['modal-content-youtube-popular-wrapper'],
f = this.$['input-search'],
g = f.value;
d.classList.add('wait'), f.classList.remove('error');
var h = document.createAttribute('disabled');
f.setAttributeNode(h);
let j = {
key: this._yt_api_key,
maxResults: 50
};
var k = '';
return g.isEmpty() ? (k = 'https://www.googleapis.com/youtube/v3/videos', j.chart = 'mostPopular', j.part = 'snippet,contentDetails,status', j.fields = 'items(id,snippet(title,thumbnails(medium)),contentDetails(duration),status(embeddable))') : (k = 'https://www.googleapis.com/youtube/v3/search', j.q = g, j.type = 'video', j.part = 'snippet'), this._api.wsj({
method: 'GET',
params: j,
src: k
}).then(l => {
let m = l.items,
n = [];
for (var o in m) {
let p = m[o],
q = p.snippet,
s = new c;
s.id = p.id, 'object' == typeof p.id && (s.id = p.id.videoId), s.title = q.title, s.imgurl = q.thumbnails.medium.url;
let t = p.contentDetails;
void 0 != t && (s.duration = b.YTDurationToSeconds(t.duration));
let u = p.status;
(void 0 == u || !0 === u.embeddable) && n.push(s)
}
b._queryresult = n, d.classList.remove('wait'), f.removeAttribute('disabled'), b.title_results = g.isEmpty() ? 'Most Popular Today' : 'Results for \'' + g + '\''
}).catch(l => {
d.classList.remove('wait'), f.removeAttribute('disabled'), f.classList.add('error'), console.error(l)
}), !1
}
onInput() {
let b = this,
c = this.$['input-search'];
c.classList.remove('error')
}
onPlayItem(a) {
let b = this,
c = TinychatApp.BLL.YoutubeEvent,
d = new c(c.YT_PLAY);
d.id = a.model.item.id, d.handle = this.chatroom.self_handle, d.title = a.model.item.title, d.duration == void 0 ? b._get_duration_item(d, f => {
this.chatroom.Youtube(f), setTimeout(() => {
b.close()
}, 150)
}) : (this.chatroom.Youtube(d), setTimeout(() => {
b.close()
}, 150))
}
onPlayItem4Playlist(a) {
let b = this,
c = TinychatApp.BLL.YoutubeEvent,
d = new c(c.YT_PLAY);
d.id = a.model.item.id, d.handle = this.chatroom.self_handle, d.playlist = !0, d.title = a.model.item.title, d.duration == void 0 ? b._get_duration_item(d, f => {
this.chatroom.Youtube(f), setTimeout(() => {
b.close()
}, 150)
}) : (this.chatroom.Youtube(d), setTimeout(() => {
b.close()
}, 150))
}
onAdd2Playlist(a) {
let b = this,
c = this.$['input-search'],
d = this._find_playlist_item(a.model.item);
if (-1 == d) {
let f = a.model.item,
g = h => {
b.chatroom.youtubelist.push(h), b._playlist = Array.from(b.chatroom.youtubelist)
};
f.duration == void 0 ? b._get_duration_item(f, h => {
g(h), b.chatroom.YoutubePlaylistAdd(h, () => {})
}) : (g(f), b.chatroom.YoutubePlaylistAdd(f, () => {}))
}
}
onClearPlaylist() {
let b = this,
c = this.$['modal-content-youtube-playlist'];
c.classList.add('wait'), this.chatroom.YoutubePlaylistClear(() => {
b.chatroom.youtubelist = [], b._playlist = Array.from(b.chatroom.youtubelist), c.classList.remove('wait')
})
}
_find_playlist_item(a) {
for (var b in this._playlist)
if (a.id == this._playlist[b].id) {
return this._playlist.indexOf(this._playlist[b])
}
return -1
}
_get_duration_item(a, b) {
let c = this.$['input-search'],
d = this,
g = {
id: a.id,
key: this._yt_api_key,
part: 'snippet,contentDetails,status',
fields: 'items(id,snippet(title,thumbnails(medium)),contentDetails(duration),status(embeddable))'
};
this._api.wsj({
method: 'GET',
params: g,
src: 'https://www.googleapis.com/youtube/v3/videos'
}).then(h => {
let j = h.items,
k = j[0],
l = k.contentDetails;
l != void 0 && (a.duration = d.YTDurationToSeconds(l.duration)), b(a)
}).catch(h => {
c.classList.add('error'), console.error(h)
})
}
onRemove4Playlist(a) {
let b = this._find_playlist_item(a.model.item);
if (0 <= b) {
let c = this._playlist.splice(b, 1);
this._playlist = Array.from(this._playlist), this.chatroom.youtubelist = this._playlist, this.chatroom.YoutubePlaylistRemove(c[0], () => {})
}
}
onRandomToggle() {
this.chatroom.youtubelist_random = !this.chatroom.youtubelist_random, this.israndom = this.chatroom.youtubelist_random, this.chatroom.YoutubePlaylistMode(this.israndom, this.iscycle, () => {})
}
onCycleToggle() {
this.chatroom.youtubelist_repeat = !this.chatroom.youtubelist_repeat, this.iscycle = this.chatroom.youtubelist_repeat, this.chatroom.YoutubePlaylistMode(this.israndom, this.iscycle, () => {})
}
israndomObserver(a) {
a ? this.$.btnRandom.classList.add('active') : this.$.btnRandom.classList.remove('active')
}
iscycleObserver(a) {
a ? this.$.btnCycle.classList.add('active') : this.$.btnCycle.classList.remove('active')
}
YTDurationToSeconds(a) {
var b = /^PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?$/,
c = 0,
d = 0,
f = 0,
g;
if (b.test(a)) {
var h = b.exec(a);
h[1] && (c = +h[1]), h[2] && (d = +h[2]), h[3] && (f = +h[3]), g = 3600 * c + 60 * d + f
}
return g
}
convertLiClass(a) {
var b = '';
return a.isDeleting && (b += ' hidden'), b
}
}
customElements.define(ModalDialogYoutube.is, ModalDialogYoutube);
</script>
</dom-module>
<dom-module id="client-modal-roomshare" assetpath="../../styles/"><template><style>#modal-content-roomshare{position:relative;width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#fff;}#modal-content-roomshare > *:focus,
#share > *:focus{outline:none;}#close-button{position:absolute;top:8px;right:8px;padding:10px;cursor:pointer;}#close-button > path{transition:.2s;}#close-button:hover > path{fill:#41b7ef;}#close-button:active > path{fill:#38a8dd;}#modal-content-roomshare > h1{margin:0;padding-bottom:40px;box-sizing:border-box;font-size:24px;font-weight:300;color:#363636;line-height:33px;text-align:center;}#modal-content-roomshare > #share > input[type="text"]{height:40px;width:100%;margin-right:10px;padding:0 13px;border:1px solid #c5d5dc;box-sizing:border-box;background-color:#fff;font-family:inherit;font-size:16px;font-weight:600;color:#414141;line-height:38px;letter-spacing:.5px;transition:.2s;}#modal-content-roomshare > #share{display:flex;flex-direction:row;align-items:stretch;width:100%;}#button-twitter,
#button-facebook,
#button-copy-link{display:block;height:40px;width:100%;border:1px solid transparent;box-sizing:border-box;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;line-height:38px;text-align:center;text-transform:uppercase;cursor:pointer;transition:.2s;}#button-copy-link{width:auto;padding:0 16px;border-color:#41b7ef;color:#41b7ef;background-color:#fff;white-space:nowrap;}#button-copy-link:hover{color:#fff;background-color:#41b7ef;}#button-twitter,
#button-facebook{margin-top:24px;}#button-twitter{border-color:#00a2f4;background-color:#00a2f4;}#button-twitter:hover{background-color:#fff;color:#00a2f4;}#button-facebook{border-color:#3f69b4;background-color:#3f69b4;}#button-facebook:hover{background-color:#fff;color:#3f69b4;}@media screen and (max-width: 600px){#modal-content-roomshare{padding-right:30px;padding-left:30px;}#modal-content-roomshare > #share{display:block;}#modal-content-roomshare > #share > input[type="text"]{margin-right:0;}#button-copy-link{width:100%;margin-top:10px;}}</style></template></dom-module>
<dom-module id="tinychat-roomshare" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-roomshare"></style><form id="modal-content-roomshare" on-submit="onOK"><svg id="close-button" on-click="close" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4.5L1.5 0 0 1.5 4.5 6 0 10.5 1.5 12 6 7.5l4.5 4.5 1.5-1.5L7.5 6 12 1.5 10.5 0" fill="#c4d4dc" fill-rule="evenodd"></path></svg><h1>Invite your friends to this chatroom</h1><div id="share"><input id="input-link" type="text" autocomplete="off" readonly="" value="[[roomshare_url]]"> <button id="button-copy-link" on-click="copy">COPY LINK</button></div></form></template>
<script>
class ModalDialogRoomShare extends Polymer.Element {
static get is() {
return 'tinychat-roomshare'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
roomshare_url: String,
onkeydownHandler: Object
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
connectedCallback() {
super.connectedCallback();
this;
this.onkeydownHandler = this.onkeydown.bind(this), document.addEventListener('keydown', this.onkeydownHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.removeEventListener('keydown', this.onkeydownHandler)
}
chatroomAssigned() {
let b = this,
c = this.chatroom.app.EventBus;
b.set('roomshare_url', this.chatroom.url);
let d = b.$['input-link'];
setTimeout(() => {
b._setTextCursor(d, d.value.length)
}, 0)
}
_setTextCursor(a, b) {
var a = 'string' == typeof a || a instanceof String ? document.getElementById(a) : a;
if (!a) return !1;
if (a.setSelectionRange) return a.focus(), a.setSelectionRange(b, b), !0;
if (a.createTextRange) {
a.focus();
var c = a.createTextRange();
return c.collapse(!0), c.moveStart('character', b), c.moveEnd('character', 0), c.select(), !0
}
return !1
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalDialogRoomShare.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalDialogRoomShare.is, this)
}
onkeydown(a) {
a = a || window.event, (27 == a.keyCode || 'Escape' == a.key || 'Esc' == a.key) && this.parentNode instanceof Modal && this.parentNode.isopen(ModalDialogRoomShare.is) && this.close()
}
onOK(a) {
return a.preventDefault(), !1
}
copy() {
let b = this.$['input-link'];
try {
b.select();
var c = document.execCommand('copy');
c ? this.app.showToast('Chatroom URL has been copied to clipboard.') : this.app.showToastWarn('Oops, unable to copy')
} catch (d) {
this.app.showToastWarn('Oops, unable to copy')
}
this.close()
}
facebook() {
this.app.showToastWarn('share via facebook is not impl.'), this.close()
}
twitter() {
this.app.showToastWarn('share via twitter is not impl.'), this.close()
}
}
customElements.define(ModalDialogRoomShare.is, ModalDialogRoomShare);
</script>
</dom-module>
<dom-module id="client-modal-fatalerror" assetpath="../../styles/"><template><style>#modal-content-fatalerror{width:100%;max-width:540px;margin:0 auto;padding:50px 70px 60px;box-sizing:border-box;border-radius:4px;background-color:#e53951;}#modal-content-fatalerror > *:focus{outline:none;}#modal-content-fatalerror > h1{margin:0;padding-bottom:9px;box-sizing:border-box;font-size:24px;font-weight:300;color:#fff;line-height:33px;text-align:center;}#modal-content-fatalerror > h1:before{content:'';position:relative;display:inline-block;height:24px;width:24px;top:5px;margin-right:10px;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxjaXJjbGUgZmlsbD0iI2ZmZiIgY3g9IjEyIiBjeT0iMTIiIHI9IjEyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KICAgIDxwYXRoIGZpbGw9IiNlNTM5NTEiIGQ9Ik0xMiAxMC41ODZsLTIuODI4LTIuODMtMS40MTUgMS40MTZMMTAuNTg3IDEybC0yLjgzIDIuODI4IDEuNDE1IDEuNDE1TDEyIDEzLjQxM2wyLjgyOCAyLjgzIDEuNDE1LTEuNDE1TDEzLjQxMyAxMmwyLjgzLTIuODI4LTEuNDE1LTEuNDE1IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+");background-repeat:no-repeat;vertical-align:top;}#modal-content-fatalerror > span{display:block;padding-bottom:8px;font-size:12px;font-weight:400;color:#fff;line-height:16px;}#modal-content-fatalerror > input[type="submit"]{height:40px;width:100%;margin-top:24px;border:1px solid #fff;box-sizing:border-box;font-family:inherit;font-size:12px;font-weight:700;color:#fff;letter-spacing:1px;background-color:#e53951;cursor:pointer;transition:.2s;}#modal-content-fatalerror > input[type="submit"]:hover,
#modal-content-fatalerror > input[type="submit"]:active{color:#e53951;background-color:#fff;}</style></template></dom-module>
<dom-module id="tinychat-fatalerror" assetpath="../ui/"><template strip-whitespace=""><style include="client-modal-fatalerror"></style><form id="modal-content-fatalerror" on-submit="onOK"><h1>Fatal error</h1><span>[[textError()]]</span> <input type="submit" value="RELOAD"></form></template>
<script>
class ModalFatalError extends Polymer.Element {
static get is() {
return "tinychat-fatalerror"
}
static get properties() {
return {
error: Object
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback()
}
open() {
this.parentNode instanceof Modal && this.parentNode.open(ModalFatalError.is)
}
close() {
this.parentNode instanceof Modal && this.parentNode.close(ModalFatalError.is, this)
}
textError() {
return this.error instanceof Error, "Something went wrong, please reload the page."
}
onOK(a) {
return a.preventDefault(), location.reload(!0), !1
}
}
customElements.define(ModalFatalError.is, ModalFatalError);
</script>
</dom-module>
<dom-module id="client-sidemenu" assetpath="../../styles/"><template><style>#sidemenu-content{overflow-x:hidden;overflow-y:scroll;}#sidemenu-content::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}#sidemenu-content::-webkit-scrollbar-track{background-color:#2d373a;}#sidemenu-content::-webkit-scrollbar-thumb{border:5px solid #2d373a;border-radius:6px/8px;background-color:#5a6366;}#sidemenu-content::-webkit-scrollbar-thumb:hover{background-color:#6f7b80;}#sidemenu *{user-select:none;-webkit-user-select:none;-moz-user-select:none;}#sidemenu *:focus{outline:none;}#sidemenu{position:fixed;height:100%;min-width:270px;max-width:270px;top:0;left:82px;padding-bottom:80px;box-sizing:border-box;font-family:'Open Sans', sans-serif;background-color:#2d373a;z-index:2;transition:left .8s;}#sidemenu-wider{position:absolute;display:block;height:40px;width:16px;top:50%;right:-8px;margin-top:-20px;border-radius:16px;font-size:0;background-color:#e9eaea;cursor:pointer;transition:.8s;}#sidemenu.wider > #sidemenu-wider{right:-16px;border-radius:0 16px 16px 0;}#sidemenu-wider:before{content:'';position:absolute;display:block;height:0;width:0;top:50%;left:50%;margin:-4px 0 0 -2px;border-width:4px 4px 4px 0;border-style:solid;border-color:transparent #bcc2c2;transition:.8s;}#sidemenu.wider > #sidemenu-wider:before{transform:rotate(180deg);-webkit-transform:rotate(180deg);}#sidemenu.wider{left:-188px;}#sidemenu-content{height:100%;padding-top:20px;box-sizing:border-box;}#close-users{display:none;padding:0 0 6px 21px;box-sizing:border-box;text-align:center;}#close-users > label{display:inline-block;height:20px;width:20px;padding:5px;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGQ9Ik03LjgzNyAxMEwuNDUzIDE3LjM4NGMtLjYwNy42MDctLjYgMS41NjgtLjAwMyAyLjE2Ni42MDIuNiAxLjU2OC41OTYgMi4xNjYtLjAwM0wxMCAxMi4xNjNsNy4zODQgNy4zODRjLjYwNy42MDcgMS41NjguNiAyLjE2Ni4wMDMuNi0uNjAyLjU5Ni0xLjU2OC0uMDAzLTIuMTY2TDEyLjE2MyAxMGw3LjM4NC03LjM4NGMuNjA3LS42MDcuNi0xLjU2OC4wMDMtMi4xNjYtLjYwMi0uNi0xLjU2OC0uNTk2LTIuMTY2LjAwM0wxMCA3LjgzNyAyLjYxNi40NTNDMi4wMS0uMTU0IDEuMDQ4LS4xNDcuNDUuNDVjLS42LjYwMi0uNTk2IDEuNTY4LjAwMyAyLjE2Nkw3LjgzNyAxMHoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4=");background-repeat:no-repeat;background-position:center center;cursor:pointer;}#top-buttons-wrapper{width:100%;padding-left:20px;padding-right:15px;box-sizing:border-box;}#live-directory{display:inline-block;height:40px;width:100%;border-radius:40px;font-size:16px;font-weight:bold;color:#fff;background-color:#04caff;line-height:40px;text-align:center;text-decoration:none;cursor:pointer;transition:.2s;}#live-directory:before{content:"";position:relative;display:inline-block;height:10px;width:10px;top:-1px;left:0;margin-right:4px;border-width:0 0 2px 2px;border-style:solid;border-color:#fff;box-sizing:border-box;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:.2s;}#live-directory:hover{background-color:#54ccf3;}#live-directory:active{background-color:#38a8de;}#live-directory:hover:before{left:-4px;}#upgrade{display:inline-block;height:40px;width:100%;margin-top:10px;border-radius:40px;font-size:16px;font-weight:bold;color:#fff;background-color:#efa701;line-height:40px;text-align:center;text-decoration:none;cursor:pointer;transition:.2s;}#upgrade:hover{background-color:#ffb701;}#upgrade:active{background-color:#cf8701;}#user-info{position:absolute;height:80px;width:100%;bottom:0;left:0;padding:20px 30px 20px 20px;border-top:1px solid rgba(0, 0, 0, .1);box-sizing:border-box;background-color:#2d373a;}#user-info > div,
#user-info > a{overflow:hidden;white-space:nowrap;}#user-info > div{line-height:20px;}#user-info > div:before{content:attr(title);font-size:14px;font-weight:700;color:#fff;}#user-info > a{display:inline-block;margin-top:6px;text-decoration:none;}#user-info > a{font-size:14px;font-weight:600;color:#3cafe1;}#user-info > a:hover{color:#3cafe1;text-decoration:underline;}#user-info > button,
#user-info > div:not([title]),
#user-info > div[title=""],
#user-info > div:not([title]) + a,
#user-info > div[title=""] + a{display:none;}#user-info > div:not([title]) ~ button,
#user-info > div[title=""] ~ button{display:block;}#user-info > button{height:40px;width:100%;padding:0;border:none;border-radius:40px;font-size:16px;font-weight:700;color:#fff;background-color:#04caff;text-align:center;line-height:40px;cursor:pointer;transition:.2s;}#user-info > button:hover{background-color:#54ccf3;}#user-info > button:active{background-color:#38a8de;}@media screen and (max-width: 1000px){#sidemenu{left:-188px;}#sidemenu.show{left:0;}#sidemenu-wider{opacity:0;visibility:hidden;}#close-users{display:block;}#top-buttons-wrapper{display:none;}}@media screen and (max-width: 600px){#sidemenu,
#sidemenu.wider{height:calc(100% - 44px);width:100%;min-width:100%;max-width:100%;left:0;top:-100%;margin-top:44px;padding-bottom:20px;z-index:3;transition:top .5s;}#sidemenu.show{top:0;}}#sidemenu.full-screen{left:-188px;}#sidemenu.full-screen.show{left:0;}#sidemenu.full-screen > #close-users{display:block;}#sidemenu.full-screen > #top-buttons-wrapper{display:none;}</style></template></dom-module>
<dom-module id="tc-video-moderation-style" assetpath="../ui/tc-video-moderation/"><template><style>#moderatorlist *{outline:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;}#moderatorlist{position:relative;max-height:70px;padding-left:31px;font-size:0;overflow:hidden;transition:.2s;}#moderatorlist:after{content:attr(data-videos-count);position:absolute;display:block;height:20px;width:20px;top:32px;right:0;border-radius:100%;font-size:10px;font-weight:800;color:#2e373a;line-height:20px;text-align:center;background-color:#7b868a;}#moderatorlist.hidden #header,
#moderatorlist.hidden .list-item,
#moderatorlist > .list-item.hidden{height:0;opacity:0;visibility:hidden;}#moderatorlist.show[data-videos-count=""],
#moderatorlist.show[data-videos-count="0"]{max-height:0px;}#moderatorlist.show[data-videos-count="1"],
#moderatorlist.show[data-videos-count="2"]{max-height:155px;}#moderatorlist.show[data-videos-count="3"],
#moderatorlist.show[data-videos-count="4"]{max-height:240px;}#moderatorlist.show[data-videos-count="5"],
#moderatorlist.show[data-videos-count="6"]{max-height:325px;}#moderatorlist.show[data-videos-count="7"],
#moderatorlist.show[data-videos-count="8"]{max-height:410px;}#moderatorlist.show[data-videos-count="9"],
#moderatorlist.show[data-videos-count="10"]{max-height:495px;}#moderatorlist.show[data-videos-count="11"],
#moderatorlist.show[data-videos-count="12"]{max-height:580px;}#moderatorlist > #header{position:relative;height:70px;padding-left:5px;top:33px;font-size:14px;font-weight:600;color:#7b868a;text-transform:uppercase;cursor:default;animation:show-header .5s ease 0s 1;-webkit-animation:show-header .5s ease 0s 1;}@keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}@-webkit-keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}#moderatorlist > #header > span > button{position:relative;height:20px;width:20px;top:-1px;right:0;padding:0;border:none;background-color:#2d373a;line-height:20px;text-align:center;cursor:pointer;}#moderatorlist > #header > span > button > svg{display:inline-block;transform:rotate(180deg);transition:.2s;}#moderatorlist.show > #header > span > button > svg{transform:rotate(0deg);}#moderatorlist > #header > span > button:hover > svg > path{fill:#fff;transition:.2s;}#moderatorlist[data-videos-count=""] > #moderatorlist-empty-item,
#moderatorlist[data-videos-count="0"] > #moderatorlist-empty-item{height:30px;width:100%;padding-left:5px;font-size:14px;color:#7b868a;}.video{position:relative;display:inline-block;width:50%;padding:5px;box-sizing:border-box;font-size:0;overflow:hidden;}.video > div{position:relative;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA0OCA2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGw9IiM1YTYzNjYiIGQ9Ik0xNCAxMy45OTR2MjAuMDEyQzE0IDM5LjUyMyAxOC40NzggNDQgMjQgNDRjNS41MTUgMCAxMC00LjQ4IDEwLTkuOTk0VjEzLjk5NEMzNCA4LjQ3NyAyOS41MjIgNCAyNCA0Yy01LjUxNSAwLTEwIDQuNDgtMTAgOS45OTR6TTI2IDU3LjkydjQuMDgyQTEuOTk0IDEuOTk0IDAgMCAxIDI0IDY0Yy0xLjEwNSAwLTItLjg4Ny0yLTEuOTk4VjU3LjkyQzkuNjk4IDU2LjkyOCAwIDQ2Ljg2IDAgMzQuNTg2YTIgMiAwIDAgMSA0IDBDNCA0NS4yODMgMTIuOTUgNTQgMjQgNTRjMTEuMDYgMCAyMC04LjcwMyAyMC0xOS40MTRhMiAyIDAgMCAxIDQgMGMwIDEyLjI4Ni05LjY5IDIyLjM0NC0yMiAyMy4zMzR6TTEwIDEzLjk5NEMxMCA2LjI3IDE2LjI3NyAwIDI0IDBjNy43MyAwIDE0IDYuMjY3IDE0IDEzLjk5NHYyMC4wMTJDMzggNDEuNzMgMzEuNzIzIDQ4IDI0IDQ4Yy03LjczIDAtMTQtNi4yNjctMTQtMTMuOTk0VjEzLjk5NHoiLz4KPC9zdmc+");background-repeat:no-repeat;background-position:center;background-color:#2a2c2c;overflow:hidden;}.video:after{content:'';position:absolute;display:block;height:100%;width:100%;top:0;left:0;border:5px solid #2d373a;border-radius:10px;box-sizing:border-box;pointer-events:none;}.video > div > div{position:relative;width:100%;}.video > div > tinychat-videoitem,
.video > div > video{position:absolute;height:100%;top:0;left:0;}.video > div.ratio-16-9 > tinychat-videoitem,
.video > div.ratio-16-9 > video{left:-16.66%;}.video > div.ratio-8-5 > tinychat-videoitem,
.video > div.ratio-8-5 > video{left:-10%;}.video > div.ratio-3-2 > tinychat-videoitem,
.video > div.ratio-3-2 > video{left:-6.25%;}.video > div > .overlay{position:absolute;height:100%;width:100%;top:0;left:0;background-color:rgba(0, 0, 0, .7);opacity:0;visibility:hidden;transition:.2s;}.video:hover > div > .overlay{opacity:1;visibility:visible;}.overlay-content{position:absolute;height:38px;width:68px;top:50%;left:50%;margin:-19px 0 0 -34px;}.overlay-content > button{padding:0;border:none;border-radius:100%;background-color:transparent;text-align:center;cursor:pointer;transition:.2s;}.overlay-content > .button-decline{height:22px;width:22px;margin:8px 8px 0 0;border:1px solid #04caff;box-sizing:border-box;line-height:20px;}.overlay-content > .button-decline:hover{border-color:#54ccf3;}.overlay-content > .button-decline:active{border-color:#38a8de;}.button-decline > svg > path{transition:.2s;}.button-decline:hover > svg > path{fill:#54ccf3;}.button-decline:active > svg > path{fill:#38a8de;}.overlay-content > .button-apply{height:38px;width:38px;background-color:#04caff;line-height:40px;}.overlay-content > .button-apply:hover{background-color:#54ccf3;}.overlay-content > .button-apply:active{background-color:#38a8de;}.video:hover > div > .nickname{visibility:hidden;}.video > div > .nickname{position:absolute;display:block;height:15px;left:5px;right:5px;bottom:0;font-size:10px;font-weight:600;color:#fff;text-align:center;text-shadow:0 0 6px rgba(0, 0, 0, .8);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;}.video > div > .nickname > img{position:relative;display:inline-block;height:10px;width:10px;top:1px;opacity:1;visibility:visible;transition:.2s;}.video > div > .nickname > img[src=""]{width:0;margin-right:0;overflow:hidden;opacity:0;visibility:hidden;}.video > div > .waiting{position:absolute;height:100%;width:100%;top:0;left:0;background-color:#202628;opacity:0;visibility:hidden;transition:.2s;}.video > div.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.video > div.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}</style></template></dom-module>
<dom-module id="tc-video-preview-style" assetpath="../ui/tc-video-preview/"><template><style>*:focus{outline:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}.video{position:relative;width:100%;padding:0;box-sizing:border-box;font-size:0;overflow:hidden;}.video > div{position:relative;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA0OCA2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGw9IiM1YTYzNjYiIGQ9Ik0xNCAxMy45OTR2MjAuMDEyQzE0IDM5LjUyMyAxOC40NzggNDQgMjQgNDRjNS41MTUgMCAxMC00LjQ4IDEwLTkuOTk0VjEzLjk5NEMzNCA4LjQ3NyAyOS41MjIgNCAyNCA0Yy01LjUxNSAwLTEwIDQuNDgtMTAgOS45OTR6TTI2IDU3LjkydjQuMDgyQTEuOTk0IDEuOTk0IDAgMCAxIDI0IDY0Yy0xLjEwNSAwLTItLjg4Ny0yLTEuOTk4VjU3LjkyQzkuNjk4IDU2LjkyOCAwIDQ2Ljg2IDAgMzQuNTg2YTIgMiAwIDAgMSA0IDBDNCA0NS4yODMgMTIuOTUgNTQgMjQgNTRjMTEuMDYgMCAyMC04LjcwMyAyMC0xOS40MTRhMiAyIDAgMCAxIDQgMGMwIDEyLjI4Ni05LjY5IDIyLjM0NC0yMiAyMy4zMzR6TTEwIDEzLjk5NEMxMCA2LjI3IDE2LjI3NyAwIDI0IDBjNy43MyAwIDE0IDYuMjY3IDE0IDEzLjk5NHYyMC4wMTJDMzggNDEuNzMgMzEuNzIzIDQ4IDI0IDQ4Yy03LjczIDAtMTQtNi4yNjctMTQtMTMuOTk0VjEzLjk5NHoiLz4KPC9zdmc+");background-repeat:no-repeat;background-position:center;background-color:#2a2c2c;background-size:30%;overflow:hidden;}video{width:100%;}.video > div:before{content:'';display:block;width:100%;padding-bottom:75%;}.video:hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video:after{}.video:hover > div.pro:after,
.video:hover > div.extreme:after,
.video:hover > div.gold:after{top:-24px;right:-24px;transition:.2s ease .2s;}.video > div > div{position:relative;width:100%;}.video > div > video,
.video > div > iframe{position:absolute;height:100%;top:0;left:0;}.video > div > iframe{width:100%;}.video > div.ratio-16-9 > video,
.video > div.ratio-16-9 > iframe{left:-16.66%;}.video > div.ratio-8-5 > video,
.video > div.ratio-8-5 > iframe{left:-10%;}.video > div.ratio-3-2 > video,
.video > div.ratio-3-2 > iframe{left:-6.25%;}.video > div > .overlay{position:absolute;height:100%;width:100%;top:0;left:0;box-shadow:inset 0 0 0 0 rgba(0, 0, 0, .5);transition:.2s;}.video:hover > div > .overlay{box-shadow:inset 0 0 100px 0 rgba(0, 0, 0, .5);}.icon-visibility,
.icon-resize,
.icon-report,
.icon-close{position:absolute;height:22px;width:22px;top:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-visibility{left:-22px;}.icon-resize{left:50%;margin-left:-11px;}.icon-report,
.icon-close{right:-22px;}.icon-visibility:hover,
.icon-resize:hover,
.icon-report:hover,
.icon-close:hover{opacity:1;}.video:hover > div > .overlay > .icon-visibility,
.video:hover > div > .overlay > .icon-resize,
.video:hover > div > .overlay > .icon-report,
.video:hover > div > .overlay > .icon-close{top:12px;transition:top .2s ease .2s,
left .2s ease .2s,
right .2s ease .2s,
opacity .2s;}.video:hover > div > .overlay > .icon-visibility{left:14px;}.video:hover > div > .overlay > .icon-report,
.video:hover > div > .overlay > .icon-close{right:14px;}.icon-visibility > svg,
.icon-resize > svg,
.icon-report > svg,
.icon-close > svg{position:absolute;}.video.not-visible > div > .overlay > .icon-visibility > svg,
.icon-visibility > svg{top:4px;left:1px;opacity:0;visibility:hidden;transition:.2s;}.video.not-visible > div > .overlay > .icon-visibility > svg:first-child,
.icon-visibility > svg + svg{opacity:1;visibility:visible;}.video.not-visible > div > iframe{visibility:hidden;}.icon-resize > svg{top:3px;left:3px;}.icon-resize > svg > path{transition:.2s;}.video.large > div > .overlay > .icon-resize > svg > path + path{opacity:0;visibility:hidden;}.icon-report > svg{top:3px;left:3px;}.icon-close > svg{top:4px;left:4px;}.icon-context{position:absolute;height:22px;width:22px;bottom:-22px;right:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-context:hover{opacity:1;}.video:hover > div > .overlay > .icon-context{bottom:7px;right:16px;transition:bottom .2s ease .2s,
right .2s ease .2s,
opacity .2s;}.icon-context > svg{position:absolute;top:9px;left:1px;}.video-context{position:absolute;display:flex;flex-direction:column;align-content:center;top:0;bottom:0;left:0;right:0;padding-top:10px;padding-bottom:10px;border-radius:4px;border:1px solid rgba(0, 0, 0, .06);box-sizing:border-box;font-size:0;color:#535353;text-align:left;line-height:1;background-color:rgba(0, 0, 0, .7);box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);z-index:1;opacity:0;visibility:hidden;transition:.2s;}.video-context::-webkit-scrollbar-track{background-color:transparent;}.video-context::-webkit-scrollbar-thumb{border:5px solid transparent;border-radius:6px/8px;background-color:rgba(255, 255, 255, .1);background-clip:content-box;}.video-context::-webkit-scrollbar-thumb:hover{background-color:rgba(255, 255, 255, .2);}.video:hover > div > .overlay > .icon-context:focus + .video-context{opacity:1;visibility:visible;}.video-context-content{margin:0 auto;}.video-context-content > div{text-align:center;}.video-context-content > div + div{padding-top:5px;}.video-context-content > div > button{display:block;width:100%;padding:0 20px;border:none;border-radius:4px;box-sizing:border-box;font-size:13px;font-weight:600;color:#fff;background-color:transparent;line-height:26px;cursor:pointer;transition:.2s;}.video-context-content > div > button:hover{color:#fff;background-color:#04caff;}.icon-volume{position:absolute;height:22px;left:-22px;bottom:-22px;opacity:.9;transition:.2s;}.icon-volume:hover{opacity:1;}.video:hover > div > .overlay > .icon-volume{left:16px;bottom:16px;transition:bottom .2s ease .2s,
left .2s ease .2s,
opacity .2s;}#icon-state > button{position:relative;height:22px;width:22px;padding:0;border:none;background-color:transparent;cursor:pointer;}#icon-state > button > svg{position:absolute;display:block;top:2px;left:2px;}#icon-state > button > svg + svg{top:1px;left:2px;transition:.2s;}#icon-state > button > svg{opacity:1;visibility:visible;}#icon-state > button > svg + svg{opacity:0;visibility:hidden;}.video > div > .waiting{position:absolute;height:100%;width:100%;top:0;left:0;background-color:#202628;opacity:0;visibility:hidden;transition:.2s;}.video > div.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.video > div.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}.video > div > svg{position:absolute;top:5px;left:5px;filter:drop-shadow(0 0 4px #04caff);-webkit-filter:drop-shadow(0 0 4px #04caff);opacity:0;transition:.2s;}#videos-content > #videos > .video:hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video > div > svg > circle{fill:#fff;fill-rule:evenodd;stroke:#fff;stroke-width:0;transition:.2s;}.video > div > svg[data-mic-level="1"]{opacity:.5;}.video > div > svg[data-mic-level="2"]{opacity:.8;}.video > div > svg[data-mic-level="3"],
.video > div > svg[data-mic-level="4"],
.video > div > svg[data-mic-level="5"],
.video > div > svg[data-mic-level="6"],
.video > div > svg[data-mic-level="7"],
.video > div > svg[data-mic-level="8"],
.video > div > svg[data-mic-level="9"],
.video > div > svg[data-mic-level="10"]{opacity:1;}.video > div > svg[data-mic-level="4"] > circle{stroke-width:1;}.video > div > svg[data-mic-level="5"] > circle{stroke-width:2;}.video > div > svg[data-mic-level="6"] > circle{stroke-width:3;}.video > div > svg[data-mic-level="7"] > circle{stroke-width:4;}.video > div > svg[data-mic-level="8"] > circle{stroke-width:5;}.video > div > svg[data-mic-level="9"] > circle{stroke-width:6;}.video > div > svg[data-mic-level="10"] > circle{stroke-width:7;}.video > div > .nickname{position:absolute;display:block;height:15px;left:10px;right:10px;bottom:12px;margin-bottom:-7px;font-size:12px;font-weight:600;color:#fff;text-align:center;text-shadow:0 0 6px rgba(0, 0, 0, .8);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;transition:.2s;}.video > div > .nickname > img{position:relative;display:inline-block;height:10px;width:10px;top:2px;margin-right:6px;opacity:1;visibility:visible;transition:.2s;}.video > div > .nickname > img[src=""]{width:0;margin-right:0;overflow:hidden;opacity:0;visibility:hidden;}.video:hover > div > .nickname{bottom:50%;transition:.2s ease .2s;}.video > div.gold:after,
.video > div.extreme:after,
.video > div.pro:after{content:'';position:absolute;display:block;height:24px;width:24px;top:10px;right:10px;background-repeat:no-repeat;transition:.2s;}.video > div.gold:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+Cgk8Y2lyY2xlIGZpbGw9IiNmZmM2MmMiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPgoJPHBhdGggaWQ9ImJhZGdlLWdvbGQiIGQ9Ik0xNiAxMi41NzZ2LTEuMDE4aC0zLjU5NnYxLjUxaDEuMjZsLS4wMTIuMTA4Yy0uMDcuNjIyLS42MyAxLjAzNC0xLjQyIDEuMDM0LTEuMDY1IDAtMS43NTgtLjg0LTEuNzU4LTIuMjUgMC0xLjM3Ny42MDctMi4xNyAxLjYzOC0yLjE3LjY5OCAwIDEuMjQyLjM3IDEuNDAzLjkzN2gyLjM4OEMxNS43MiA5LjE0IDE0LjE3MyA4IDEyLjEgOCA5LjU1MiA4IDggOS40NTcgOCAxMS45OTIgOCAxNC41NiA5LjU1MiAxNiAxMi4xNzUgMTZjMi40IDAgMy44MjUtMS4zMDcgMy44MjUtMy40MjR6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiLz4KPC9zdmc+");}.video > div.extreme:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjYWQ2YmNlIiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtZXh0cmVtZSIgZD0iTTE0IDE2SDlWOGg1djEuNzM1aC0yLjcyNXYxLjI1OGgyLjUyM3YxLjczNWgtMi41MjN2MS41MUgxNHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWV4dHJlbWUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4NCgk8dXNlIGZpbGw9IiNmZmYiIHhsaW5rOmhyZWY9IiNiYWRnZS1leHRyZW1lIi8+DQo8L3N2Zz4=");}.video > div.pro:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjMzhjZDU3IiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtcHJvIiBkPSJNMTUgMTAuNTQ0YzAgLjg5NC0uMjcyIDEuNTg1LS44MTcgMi4wNzItLjU0NS40ODctMS4zMi43My0yLjMyMi43M2gtLjYyNlYxNkg5VjhoMi44NmMxLjA0NiAwIDEuODMuMjIgMi4zNTQuNjYyLjUyNC40NDIuNzg2IDEuMDcuNzg2IDEuODgyem0tMy43NjYgMS4wNGguNDA3Yy4zMzYgMCAuNjAzLS4wOS44LS4yNzMuMi0uMTgyLjI5OC0uNDM0LjI5OC0uNzU1IDAtLjU0LS4zMS0uODEtLjkyNy0uODFoLS41NzZ2MS44NHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIvPg0KPC9zdmc+");}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 600px){#videos{top:12px;right:13px;bottom:12px;left:13px;}.video{padding:2px;}.video:after{border-width:2px;border-radius:4px;}}.video.full-screen:after{border-color:#101314;}</style></template></dom-module>
<dom-module id="tc-video-preview" assetpath="../ui/tc-video-preview/"><template strip-whitespace=""><style include="tc-video-preview-style"></style><div class$="[[videoItemStyle]]"><div class$="[[convertVideoClass(item, item.progress)]]"><video id="video" autoplay="" volume="[[volume]]" data-video-id$="[[item.handle]]" on-playing="onPlaying">Your browser does not support the video tag...</video><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div></div></div></template>
<script>
class ChatroomVideoPreview extends Polymer.Element {
static get is() {
return 'tc-video-preview'
}
static get properties() {
return {
item: {
type: Object,
observer: 'itemAssigned'
},
volume: {
type: Number,
value: 0
},
videoItemStyle: {
type: String,
computed: '_videoItemStyleCompute(item.large, item.muted, item.hidden, isFullScreen)'
}
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback()
}
disconnectedCallback() {
super.disconnectedCallback()
}
itemAssigned(a) {
if (null !== a) {
let b = this.$.video;
b.srcObject = a.mediastream, b.muted = !0, this.internalVolume = a.volume
}
}
_videoItemStyleCompute(a, b, c, d) {
var f = 'video';
return f += a ? ' large' : '', f += b ? ' muted' : '', f += c ? ' not-visible' : '', f += d ? ' full-screen' : '', f
}
convertVideoClass(a, b) {
var c = 'ratio-4-3';
return c += b ? ' wait' : '', c
}
onPlaying(a) {
this.dispatchEvent(new CustomEvent('video-playing', a))
}
}
customElements.define(ChatroomVideoPreview.is, ChatroomVideoPreview);
</script>
</dom-module>
<dom-module id="tc-video-moderation" assetpath="../ui/tc-video-moderation/"><template strip-whitespace=""><style include="tc-video-moderation-style"></style><div id="moderatorlist" class$="[[_computeClass(isExpanded)]]" data-videos-count$="[[itemsCount]]"><div id="header"><span>BROADCAST QUEUE <button on-click="onModeratorsShow"><svg width="14" height="8" viewBox="0 0 14 8" xmlns="http://www.w3.org/2000/svg"><path d="M12.205 7.694c.41.408 1.076.408 1.487 0a1.04 1.04 0 0 0 0-1.478L7.744.306a1.056 1.056 0 0 0-1.488 0L.308 6.216a1.04 1.04 0 0 0 0 1.478c.41.408 1.076.408 1.487 0L7 2.522l5.205 5.172z" fill="#7b868a"></path></svg></button></span></div><div id="moderatorlist-empty-item"><span>No videos yet</span></div><dom-repeat items="[[_items]]"><template strip-whitespace=""><div class="video"><div class="ratio-16-9"><tc-video-preview item="[[item]]" on-video-playing="videoPlaying"></tc-video-preview><div class="overlay"><div class="overlay-content"><button class="button-decline" on-click="onClose"><svg width="8" height="8" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg"><path d="M4 2.543L1.758.3A1.03 1.03 0 0 0 .302 1.757l2.242 2.24L.302 6.24a1.03 1.03 0 1 0 1.456 1.455L4 5.455l2.242 2.24A1.03 1.03 0 0 0 7.698 6.24L5.456 3.998l2.242-2.24A1.03 1.03 0 1 0 6.242.3L4 2.543z" fill="#04caff"></path></svg></button> <button class="button-apply" on-click="onAllow"><svg width="12" height="10" viewBox="0 0 12 10" xmlns="http://www.w3.org/2000/svg"><path d="M1.78 3.375a1 1 0 1 0-1.56 1.25l4 5A1 1 0 0 0 5.8 9.6l6-8A1 1 0 1 0 10.2.4L4.975 7.367 1.78 3.375z" fill="#fff"></path></svg></button></div></div><div class="waiting"><div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div></div><span class="nickname" title="[[item.nickname]]">[[item.nickname]]</span></div></div></template></dom-repeat>
</div>
</template>
<script>
class VideoModeration extends Polymer.Element {
static get is() {
return 'tc-video-moderation'
}
static get properties() {
return {
videolist: {
type: Object,
observer: 'videolistAssigned'
},
_items: {
type: Array,
value: [],
notify: !0
},
itemsCount: {
type: Number,
value: 0
},
isExpanded: {
type: Boolean,
value: !0
}
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback()
}
onModeratorsShow() {
this.isExpanded = !this.isExpanded
}
_computeClass(a) {
let b = '';
return a && (b += ' show'), b
}
videolistAssigned() {
let b = this.videolist.chatroom,
c = this,
d = b.app.EventBus;
d.subscribe(TinychatApp.BLL.VideolistEvent.ID, f => {
f.action === TinychatApp.BLL.VideolistAction.AddModeration ? (f.videolistitem.progress = !0, c.splice('_items', f.index, 0, f.videolistitem), this.itemsCount++, this.notifyPath('_items')) : f.action === TinychatApp.BLL.VideolistAction.RemoveModeration ? (c.splice('_items', f.index, 1), this.itemsCount--, this.notifyPath('_items')) : f.action === TinychatApp.BLL.VideolistAction.UpdateModeration
})
}
videoPlaying(a) {
try {
let b = a.model.item,
c = this._items.indexOf(b);
b.progress = !1, this.notifyPath('_items.' + c + '.progress')
} catch (b) {
console.error(b)
}
}
onClose(a) {
let b = a.model.item.userentity;
this.videolist.chatroom.VideoForceClose(b)
}
onAllow(a) {
let b = a.model.item.userentity;
this.videolist.chatroom.VideoAllow(b)
}
}
customElements.define(VideoModeration.is, VideoModeration);
</script>
</dom-module>
<dom-module id="tinychat-sidemenu" assetpath="../ui/"><template strip-whitespace=""><style include="client-sidemenu"></style><div id="sidemenu"><dom-if if="[[showCollapseAllow]]"><template strip-whitespace=""><div id="sidemenu-wider" on-click="onCollapse"></div></template></dom-if>
<div id="sidemenu-content">
<div id="close-users" on-click="onClose"><label for="input-users" class="switcher"></label></div>
<div id="top-buttons-wrapper"><a id="live-directory" href="#live-directory" on-click="livedirectoryTap">Live Directory</a> <a id="upgrade" href="#subscription" on-click="upgrade">Upgrade</a></div>
<tc-video-moderation videolist="[[chatroom.videolist]]"></tc-video-moderation>
<tinychat-chatlist chatlog="[[chatlog]]"></tinychat-chatlist>
<tinychat-userlist userlist="[[userlist]]"></tinychat-userlist>
</div>
<div id="user-info">
<div title="[[roomname]]"></div><a href="[[roomnamehref]]" target="_blank">tinychat.com/[[roomname]]</a> <button on-click="login">Sign In</button></div>
</div>
</template>
<script>
const UI = window.TinychatApp.UI;
class ChatroomSideMenu extends Polymer.Element {
static get is() {
return 'tinychat-sidemenu'
}
static get properties() {
return {
userlist: {
type: Object,
observer: 'userlistAssigned'
},
chatlog: {
type: Object,
observer: 'chatlogAssigned'
},
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
roomname: {
type: String
},
roomnamehref: {
type: String,
computed: '_roomnamehrefCompute(roomname)'
},
showCollapseAllow: {
type: Boolean,
value: !1
},
onFullscreenHandler: Object,
onWindowClickHandler: Object
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback(), this.onFullscreenHandler = this.onFullscreen.bind(this), window.fullscreenManager.addEventListener(this.onFullscreenHandler, !1), this.onWindowClickHandler = this.onWindowClick.bind(this), window.addEventListener('click', this.onWindowClickHandler, !1);
let a = this;
document.addEventListener('side-menu-change', function(b) {
b.detail.slideout ? a.slideout() : a.slidein()
})
}
disconnectedCallback() {
super.disconnectedCallback(), window.fullscreenManager.removeEventListener(this.onFullscreenHandler, !1), window.removeEventListener('click', this.onWindowClickHandler)
}
_roomnamecompute(a) {
let b = '',
c = a.selfUser();
return null !== c && (b = c.username), b
}
_roomnamehrefCompute(a) {
return `${window.TinychatApp.url}/${a}`
}
chatlogAssigned() {}
userlistAssigned() {}
chatroomAssigned(a) {
let b = a.app.EventBus;
b.subscribe(TinychatApp.BLL.RoomConnected.ID, () => {
this.roomname = this._roomnamecompute(this.chatroom), this.showCollapseAllow = this.chatroom.selfUser().hasSubscriptions
})
}
get app() {
return this.userlist.chatroom.app
}
slideout() {
this.$.sidemenu.classList.add('show')
}
slidein() {
this.$.sidemenu.classList.remove('show')
}
login() {
this.app.Login()
}
onClose() {
this.slidein(), document.dispatchEvent(new CustomEvent('side-menu-changed', {
bubbles: !0,
detail: {
slideout: !1
}
}))
}
onCollapse(a) {
a.target.parentNode.classList.toggle('wider');
let b = new UI.UISideMenuToggle;
this.chatroom.app.EventBus.broadcast(UI.UISideMenuToggle.ID, b)
}
onWindowClick() {}
onFullscreen() {
let b = window.fullscreenManager.status();
b ? (this.$.sidemenu.classList.add('full-screen'), this.showCollapseAllow = !1) : (this.$.sidemenu.classList.remove('full-screen'), this.showCollapseAllow = this.chatroom.selfUser().hasSubscriptions)
}
livedirectoryTap() {
this.userlist.chatroom.gotoLiveDirectory()
}
upgrade() {
this.app.UpgradeSub()
}
}
customElements.define(ChatroomSideMenu.is, ChatroomSideMenu);
</script>
</dom-module>
<dom-module id="client-title" assetpath="../../styles/"><template><style>#room-header *{user-select:none;-webkit-user-select:none;-moz-user-select:none;}#room-header{display:flex;flex-direction:row;align-items:stretch;min-height:140px;max-height:140px;border-bottom:1px solid rgba(0, 0, 0, .1);box-sizing:border-box;background-color:#f6f6f6;text-align:left;}#room-header-mobile-button{display:none;}#room-header-avatar{position:relative;height:100px;min-width:100px;max-width:100px;margin:20px 0 0 30px;border-radius:100%;overflow:hidden;}#room-header-avatar > img{position:absolute;height:100%;top:0;left:-25px;}#room-header-info{width:100%;padding:24px 0 0 20px;box-sizing:border-box;}#room-header-info > h1{position:relative;display:inline-block;width:100%;max-width:180px;margin:0 5px 0 0;padding:0 20px 0 0;font-size:16px;font-weight:700;color:#363636;white-space:nowrap;line-height:normal;overflow:hidden;cursor:default;}#room-header-info > h1:after{content:"";position:absolute;display:block;height:100%;width:20px;top:0;right:0;background:-moz-linear-gradient(left, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);background:-webkit-linear-gradient(left, rgba(246,246,246,0) 0%,rgba(246,246,246,1) 100%);background:linear-gradient(to right, rgba(246,246,246,0) 0%,rgba(246,246,246,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00f6f6f6', endColorstr='#f6f6f6',GradientType=1 );}#room-header-info > span{display:inline-block;margin-left:10px;box-sizing:border-box;font-size:0;text-align:center;cursor:pointer;}#room-header-info-text{position:relative;height:32px;padding-top:6px;font-size:11px;line-height:16px;overflow:hidden;cursor:default;}#room-header-info-text:after{content:"";position:absolute;display:block;height:16px;width:60px;bottom:0;right:0;background:-moz-linear-gradient(left, rgba(246,246,246,0) 0%, rgba(246,246,246,1) 100%);background:-webkit-linear-gradient(left, rgba(246,246,246,0) 0%,rgba(246,246,246,1) 100%);background:linear-gradient(to right, rgba(246,246,246,0) 0%,rgba(246,246,246,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00f6f6f6', endColorstr='#f6f6f6',GradientType=1 );}#room-header-info-details{padding-top:3px;font-size:16px;white-space:nowrap;cursor:default;}#room-header-info-details > span:after{content:"";position:relative;display:inline-block;height:23px;width:1px;top:7px;margin:0 14px;background-color:#e9e9e9;}#room-header-info-details > a{color:#3cafe1;cursor:pointer;}#room-header-info-details > a:hover{text-decoration:underline;}#room-header-gifts{display:flex;flex-direction:row;align-items:stretch;padding:30px 20px;box-sizing:border-box;}#room-header-gifts-items{padding:0 11px;border-radius:12px;background-color:#fff;font-size:0;text-align:center;white-space:nowrap;}#room-header-gifts-items > a{display:inline-block;height:60px;width:60px;margin:10px 5px;}#room-header-gifts-items > a > img{height:100%;width:100%;}#room-header-gifts-buttons{display:inline-block;padding-left:10px;box-sizing:border-box;font-size:0;white-space:nowrap;}#room-header-gifts-buttons > a{display:none;height:35px;width:120px;border-radius:35px;border:1px solid transparent;box-sizing:border-box;font-size:12px;font-weight:700;color:#fff;background-color:#41b7ef;line-height:35px;text-align:center;text-decoration:none;cursor:pointer;transition:.2s;}#room-header-gifts-buttons > #give-gift{display:block;}#room-header-gifts-buttons > #give-gift:hover{background-color:#54ccf3;}#room-header-gifts-buttons > #give-gift:active{background-color:#38a8de;}#room-header-gifts-buttons > #upgrade{display:none;margin-right:6px;background-color:#efa701;}#room-header-gifts-buttons > #upgrade:hover{background-color:#ffb701;}#room-header-gifts-buttons > #upgrade:active{background-color:#cf8701;}#room-header-gifts-buttons > #get-coins{display:inline-block;width:100%;margin-top:10px;border-color:#41b7ef;color:#41b7ef;background-color:#fff;transition:.2s;}#room-header-gifts-buttons > #get-coins:hover{background-color:#d6f2ff;}#room-header-gifts-buttons > #get-coins:active{background-color:#c7e8f8;}@media screen and (max-width: 1180px){#room-header{min-height:100px;max-height:100px;}#room-header-avatar{height:60px;min-width:60px;max-width:60px;margin:20px 0 0 16px;}#room-header-avatar > img{left:-15px;}#room-header-info{position:relative;padding:22px 60px 0 14px;}#room-header-info > span{position:absolute;top:10px;right:25px;margin:0;}#room-header-info > span + span{top:40px;right:24px;}#room-header-info > span + span + span{top:70px;right:23px;}#room-header-info-text{padding-top:4px;}#room-header-info-details{display:none;}#room-header-gifts{padding:14px 20px;border-left:1px solid rgba(0, 0, 0, .1);}#room-header-gifts-items{padding:0;border-radius:0;background-color:transparent;}#room-header-gifts-items > a{height:72px;width:72px;margin:0 -11px 0 0;padding:11px;border-radius:100%;box-sizing:border-box;background-color:#fff;box-shadow:0 0 6px 0 rgba(0, 0, 0, .1);}#room-header-gifts-buttons{padding-left:21px;}#room-header-gifts-buttons > a{height:30px;line-height:30px;}#room-header-gifts-buttons > a + a,
#room-header-gifts-buttons > a + a:hover{height:30px;margin-top:12px;line-height:30px;}}@media screen and (max-width: 1000px){#room-header-gifts-buttons > #give-gift{width:210px;}#room-header-gifts-buttons > #upgrade,
#room-header-gifts-buttons > #get-coins{display:inline-block;width:102px;}}@media screen and (max-width: 800px){#room-header-info{padding-right:15px;}#room-header-info > h1{display:block;}#room-header-info > span{position:static;margin-top:12px;vertical-align:middle;}#room-header-info > span + span{margin-left:20px;}#room-header-info-text,
#room-header-info-details{display:none;}#room-header-gifts{padding:16px 15px;background-color:#fff;}#room-header-gifts-items > a{height:60px;width:60px;margin:5px;padding:0;box-shadow:none;}#room-header-gifts-items > a + a{display:none;}#room-header-gifts-buttons{padding-top:1px;padding-left:15px;}#room-header-gifts-buttons > #give-gift{width:190px;}#room-header-gifts-buttons > #upgrade,
#room-header-gifts-buttons > #get-coins{display:inline-block;width:92px;}}@media screen and (max-width: 740px){#room-header-info{padding-right:40px;}#room-header-info > span{margin-right:-10px;}}@media screen and (max-width: 600px){#room-header{position:absolute;display:block;height:54px;min-height:inherit;max-height:inherit;width:100%;max-width:100%;min-width:100%;overflow:hidden;z-index:1;transition:height .2s;}#room-header.show{height:146px;}#room-header-mobile-button{position:absolute;display:block;height:26px;width:26px;top:15px;right:15px;cursor:pointer;}#room-header-mobile-button > span,
#room-header-mobile-button:before,
#room-header-mobile-button:after{content:'';position:absolute;display:block;height:6px;width:6px;top:10px;left:0;border-radius:100%;background-color:#41b7ef;pointer-events:none;transform:rotate(45deg);transition:background-color .2s,
height .3s,
width .3s,
top .3s,
left .3s,
opacity .3s,
border-radius .3s;}#room-header-mobile-button > span{left:10px;}#room-header-mobile-button:after{left:20px;transform:rotate(-45deg);}#room-header-mobile-button:hover > span,
#room-header-mobile-button:hover:before,
#room-header-mobile-button:hover:after{background-color:#54ccf3;}#room-header-mobile-button:hover > span,
#room-header-mobile-button:hover:before,
#room-header-mobile-button:hover:after{background-color:#38a8de;}#room-header.show #room-header-mobile-button:before,
#room-header.show #room-header-mobile-button:after{height:2px;width:16px;top:12px;left:5px;border-radius:1px;}#room-header.show #room-header-mobile-button > span{opacity:0;}#room-header-avatar{display:inline-block;height:24px;min-width:24px;max-width:24px;margin:15px 0 0 15px;}#room-header-avatar > img{left:-6px;}#room-header-info{position:absolute;height:100%;width:auto;top:0;left:39px;right:150px;padding-top:54px;}#room-header-info > h1{position:absolute;height:16px;width:calc(100% + 70px);max-width:inherit;top:20px;left:14px;right:20px;margin:0;padding:0;}#room-header-info > span{top:65px;}#room-header-info > span + span{top:103px;}#room-header-info-text,
#room-header-info-details{position:relative;width:calc(100% + 38px);left:-38px;}#room-header-info-text{padding-top:8px;}#room-header-info-details{display:block;font-size:13px;overflow:hidden;}#room-header-gifts{position:absolute;width:150px;top:54px;right:0;padding-top:6px;background-color:transparent;}#room-header-gifts-items{display:none;}#room-header-gifts-buttons{padding-left:0;}#room-header-gifts-buttons > #give-gift,
#room-header-gifts-buttons > #get-coins{width:120px;}#room-header-gifts-buttons > #upgrade{display:none;}}</style></template></dom-module>
<dom-module id="tinychat-title" assetpath="../ui/"><template strip-whitespace=""><style include="client-title"></style><div id="room-header"><div id="room-header-mobile-button" on-click="onHeaderMobile"><span></span></div><div id="room-header-avatar"><img src="[[avatar]]"></div><div id="room-header-info"><h1>[[title]]</h1><span on-click="shareTap" title="Share room"><svg width="16" height="22" viewBox="0 0 16 22" xmlns="http://www.w3.org/2000/svg"><path fill="#53b6ef" fill-rule="evenodd" d="M9 2.57v10.475H7V2.57L4.682 4.733 3.318 3.268 5.986.782c1.12-1.043 2.91-1.042 4.028 0l2.668 2.486-1.364 1.464L9 2.572zM2 20h12V7.994C14 8 11 8 11 8V6h2.995C15.102 6 16 6.895 16 7.994v12.012c0 1.1-.895 1.994-1.994 1.994H1.994C.894 22 0 21.105 0 20.006V7.994C0 6.894.894 6 2.005 6H5v2H2.005C2.002 8 2 20 2 20z"></path></svg> </span><span on-click="settingsTap" title="Settings"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="#53b6ef" fill-rule="evenodd" d="M12.028 1.632l.002.017-.002-.018zm7.15 4.97l-.012.01.013-.01zM12.03 18.347c0-.006 0-.01.002-.017l-.002.017zm-2.04.02v-.016.018zM2.96 12.84c.007.007.013.016.018.025l-.017-.026zm1.203-.337c.342-.227.51-.64.425-1.04l-.05-.232c-.082-.39-.125-.81-.125-1.23 0-.42.043-.84.126-1.23l.048-.233c.085-.4-.083-.813-.425-1.04l-1.328-.882c.162.11.223.35.102.546l1.246-2.02 1.212.533c.368.162.797.088 1.09-.188l.17-.162c.625-.53 1.39-.95 2.238-1.21l.228-.07c.385-.122.658-.46.697-.86l.146-1.513c-.024.197-.186.33-.355.33h2.778c-.16 0-.332-.147-.356-.35l.147 1.534c.04.4.313.737.696.858l.22.07c.856.26 1.62.68 2.283 1.244l.134.13c.293.275.722.35 1.09.187l1.21-.534 1.247 2.02c-.11-.178-.054-.435.11-.55l-1.336.887c-.34.227-.51.64-.424 1.04l.05.232c.082.39.125.81.125 1.23 0 .42-.042.84-.125 1.23l-.05.233c-.084.4.085.813.426 1.04l1.33.882c-.163-.11-.224-.35-.103-.546l-1.246 2.02-1.21-.533c-.368-.162-.797-.088-1.09.188l-.172.162c-.624.53-1.39.95-2.237 1.21l-.227.07c-.383.122-.657.46-.696.86l-.145 1.513c.023-.197.185-.33.354-.33H9.633c.16 0 .332.147.356.35l-.15-1.534c-.037-.4-.31-.737-.694-.858l-.22-.07c-.856-.26-1.62-.68-2.283-1.244l-.134-.13c-.294-.275-.723-.35-1.09-.187l-1.212.534-1.23-1.995c.077.148.013.416-.156.53l1.34-.892zm-2.87 1.437l1.367 2.22c.437.708 1.316.984 2.087.65l.904-.4c.7.54 1.453.954 2.263 1.25l.085.88c.063.84.78 1.46 1.635 1.46h2.753c.834 0 1.57-.623 1.636-1.48l.083-.86c.82-.298 1.58-.718 2.266-1.248l.898.395c.775.337 1.654.06 2.09-.645l1.402-2.274c.458-.742.22-1.68-.482-2.16l-.786-.523c.06-.394.09-.8.09-1.205 0-.406-.03-.81-.09-1.205l.773-.513c.734-.462.958-1.42.494-2.17l-1.4-2.273c-.438-.708-1.317-.984-2.088-.65l-.904.4c-.698-.54-1.452-.954-2.263-1.25l-.084-.88C13.958.62 13.24 0 12.387 0H9.608c-.833 0-1.57.623-1.636 1.48l-.083.86c-.82.298-1.582.718-2.266 1.248l-.898-.395c-.775-.337-1.654-.06-2.09.645L1.234 6.112c-.458.742-.22 1.68.482 2.16l.787.523c-.06.394-.09.8-.09 1.205 0 .406.03.81.09 1.205l-.766.508c-.765.49-.97 1.48-.444 2.227z"></path><circle fill="#53b6ef" fill-rule="evenodd" cx="11" cy="10" r="2"></circle></svg> </span><span on-click="followTap" title="Follow"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" fill-rule="evenodd" stroke="#53b6ef" stroke-width="2" cx="10" cy="10" r="9"></circle><path fill="#53b6ef" fill-rule="evenodd" d="M9 9V7a1 1 0 1 1 2 0v2h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H7a1 1 0 0 1 0-2h2z"></path></svg></span><div id="room-header-info-text">[[biography]]</div><div id="room-header-info-details"><span>[[location]]</span><a href="[[website]]" target="_blank">[[website]]</a></div></div><div id="room-header-gifts"><dom-if if="[[recent_gifts_show]]"><template strip-whitespace=""><div id="room-header-gifts-items"><dom-repeat items="[[recent_gifts]]"><template strip-whitespace=""><a href="#"><img src="[[item.giftUrl]]"></a></template></dom-repeat>
</div>
</template>
</dom-if>
<div id="room-header-gifts-buttons"><a id="give-gift" href="#giveagift" on-click="giveagiftTap">Give a Gift</a> <a id="upgrade" href="#subscription" on-click="upgrade">Upgrade</a> <a id="get-coins" href="#getcoins" on-click="getcoinsTap">Get Coins</a></div>
</div>
</div>
</template>
<script>
class ChatroomTitle extends Polymer.Element {
static get is() {
return 'tinychat-title'
}
static get properties() {
return {
chatroom: {
type: Object,
observer: 'chatroomAssigned'
},
title: String,
biography: String,
location: String,
website: String,
avatar: String,
recent_gifts: Object,
recent_gifts_show: {
type: Boolean,
computed: 'convertGiftShown(recent_gifts)'
},
onFullscreenHandler: Object
}
}
constructor() {
super()
}
get app() {
return this.chatroom.app
}
connectedCallback() {
super.connectedCallback(), this.onFullscreenHandler = this.onFullscreen.bind(this), window.fullscreenManager.addEventListener(this.onFullscreenHandler, !1)
}
disconnectedCallback() {
super.disconnectedCallback(), window.fullscreenManager.removeEventListener(this.onFullscreenHandler, !1)
}
chatroomAssigned() {
let b = this,
c = this.chatroom.app.EventBus;
c.subscribe(TinychatApp.BLL.RoomSettingsEvent.ID, function(d) {
let f = d.roomSettings;
b.setProperties({
title: f.name,
biography: f.biography,
location: f.location,
website: f.website,
avatar: f.avatar,
recent_gifts: f.recent_gifts
})
})
}
convertGiftShown(a) {
return !!Array.isArray(a) && 0 < a.length
}
onHeaderMobile() {
this.$['room-header'].classList.toggle('show')
}
onFullscreen() {
let b = window.fullscreenManager.status();
this.setAttribute('style', b ? 'display:none;' : '')
}
shareTap() {
this.app.Share()
}
settingsTap() {
this.app.Settings()
}
followTap() {
return this.chatroom.isLurker() ? void this.app.showToastLurker() : void this.chatroom.userlist.follow({
isInsta: 0 > this.chatroom.roomSettings.type.indexOf('default'),
username: this.chatroom.roomname,
nickname: this.chatroom.roomname
})
}
giveagiftTap() {
this.app.GiveAGift(this.chatroom.selfUser().username)
}
getcoinsTap() {
this.app.EarnCoins()
}
upgrade() {
this.app.UpgradeSub()
}
}
customElements.define(ChatroomTitle.is, ChatroomTitle);
</script>
</dom-module>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
<dom-module id="client-chatlog" assetpath="../../styles/"><template><style>.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}:host,
#chat-wrapper{position:relative;height:100%;}#chat-wider{position:absolute;display:block;height:40px;width:16px;top:50%;left:-8px;margin-top:-20px;border-radius:16px;font-size:0;background-color:#e9eaea;cursor:pointer;z-index:1;}#chat-wider:before{content:'';position:absolute;display:block;height:0;width:0;top:50%;left:50%;margin:-4px 0 0 -2px;border-width:4px 4px 4px 0;border-style:solid;border-color:transparent #bcc2c2;transition:.8s;}#chat-wider.active:before{transform:rotate(180deg);-webkit-transform:rotate(180deg);}#chat-wrapper{min-width:350px;border-left:1px solid rgba(0, 0, 0, .1);box-sizing:border-box;background-color:#fff;transition:.8s;}#chat-wider.active + #chat-wrapper{min-width:500px;}#chatlog-button{display:none;}#chat-position{position:absolute;display:flex;flex-direction:column;align-items:stretch;top:20px;left:20px;right:20px;bottom:19px;}#chat-instant{position:relative;height:0;min-height:0;width:100%;padding-left:106px;box-sizing:border-box;background-color:#fff;overflow:hidden;}#chat-instant.show{height:50px;min-height:50px;}#chat-instant > .nickname{white-space:nowrap;font-size:16px;font-weight:700;color:#000;line-height:44px;overflow:hidden;text-overflow:ellipsis;cursor:default;}#chat-instant-button{position:absolute;display:block;height:40px;width:40px;top:2px;left:0;border-radius:4px;background-color:transparent;cursor:pointer;transition:.2s;}#chat-instant-button:before{content:"";position:relative;display:inline-block;height:14px;width:14px;top:13px;left:18px;margin-right:4px;border-width:0 0 2px 2px;border-style:solid;border-color:#53b6ef;box-sizing:border-box;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:.2s;}#chat-instant-button:hover:before{border-color:#54ccf3;}#chat-instant-button:active:before{border-color:#38a8dd;}#chat-position > #chat-instant > a{position:absolute;height:40px;width:40px;top:2px;left:60px;}#chat-instant:after{content:'';position:absolute;display:block;height:10px;left:0;right:15px;bottom:-10px;background:-moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);background:linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=0 );z-index:1;}#chat{position:relative;height:100%;min-height:120px;padding-left:0;}#chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%;}#chat-content > .message{position:relative;left:0;margin-bottom:10px;animation:show-message .2s ease 0s 1;-webkit-animation:show-message .2s ease 0s 1;}@keyframes show-message{0%{left:100%;}100%{left:0;}}@-webkit-keyframes show-message{0%{left:100%;}100%{left:0;}}#chat-content > .message.common{min-height:50px;padding:10px 10px 0 50px;box-sizing:border-box;font-size:0;text-align:left;}#chat-content > .message.system{padding:8px 10px;border-radius:4px;box-sizing:border-box;background-color:#f6f6f6;cursor:default;}#chat-content > .message.gift{min-height:50px;padding:10px 10px 0 50px;box-sizing:border-box;font-size:0;text-align:left;}#chat-instant > a:first-child,
#chat-content > .message > a:first-child{position:absolute;height:40px;width:40px;top:10px;left:0;}#chat-instant > a > .avatar,
#chat-content > .message > a > .avatar{height:100%;width:100%;top:0;left:0;border-radius:100%;overflow:hidden;}#chat-instant > a > .avatar > img,
#chat-content > .message > a > .avatar > img{position:relative;height:100%;left:-7px;}#chat-instant > a > .status-icon,
#chat-content > .message > a > .status-icon{position:absolute;height:10px;width:10px;top:26px;left:-2px;padding:3px;border-radius:100%;background-color:#fff;}#chat-instant > a > .status-icon[src=""],
#chat-instant > a > .avatar > img[src=""],
#chat-content > .message > a > .status-icon[src=""],
#chat-content > .message > a > .avatar > img[src=""]{opacity:0;visibility:hidden;}#chat-content > .message > .nickname{display:inline-block;font-size:14px;font-weight:600;color:#000;line-height:20px;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:.2s;}#chat-content > .message > .nickname:hover{opacity:.5;}#chat-instant > .nickname[data-status="gold"],
#chat-wrapper.full-screen #chat-instant > .nickname[data-status="gold"],
#chat-content > .message > .nickname[data-status="gold"],
#chat-wrapper.full-screen #chat-content > .message > .nickname[data-status="gold"]{color:#ffbe00;}#chat-instant > .nickname[data-status="extreme"],
#chat-wrapper.full-screen #chat-instant > .nickname[data-status="extreme"],
#chat-content > .message > .nickname[data-status="extreme"],
#chat-wrapper.full-screen #chat-content > .message > .nickname[data-status="extreme"]{color:#ad6ed1;}#chat-instant > .nickname[data-status="pro"],
#chat-wrapper.full-screen #chat-instant > .nickname[data-status="pro"],
#chat-content > .message > .nickname[data-status="pro"],
#chat-wrapper.full-screen #chat-content > .message > .nickname[data-status="pro"]{color:#31ea5d;}#chat-content > .message > .content{font-size:14px;color:#2e373a;white-space:pre-line;word-wrap:break-word;}#chat-content > .message.system > .content{font-size:12px;font-weight:600;color:#8f999c;}#chat-content > .message.gift > .content{padding-bottom:12px;font-size:12px;font-weight:600;color:#8f999c;cursor:default;}#chat-content > .message.gift > .gift-image{display:block;height:100px;width:100px;}#chat-content > .message.gift > .gift-image > img{height:100%;width:100%;}#input{position:relative;display:block;padding-top:10px;}#input:before{content:'';position:absolute;display:block;height:10px;left:0;right:15px;top:-10px;background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );}#input:after{content:"";position:absolute;display:block;top:10px;left:0;right:0;bottom:0;border:2px solid #cbcfcf;border-radius:12px;box-sizing:border-box;pointer-events:none;}#input-unread{position:absolute;display:inline-block;height:24px;top:-30px;right:-200px;padding:0 15px;border-radius:12px;background-color:#41b7ef;font-size:12px;color:#fff;line-height:24px;white-space:nowrap;opacity:.8;cursor:pointer;transition:.2s;}#input-unread:before{content:attr(data-messages);display:inline-block;}#input-unread:after{content:"";position:absolute;display:inline-block;height:0;width:0;left:19px;bottom:-5px;border-width:5px 5px 0 5px;border-style:solid;border-color:#41b7ef transparent transparent;}#input #input-unread.show{right:0;opacity:1;}#input > textarea{position:relative;display:block;min-height:50px;height:50px;max-height:140px;width:100%;padding:12px 20px;border:none;border-radius:12px;box-sizing:border-box;font-family:"Open Sans", sans-serif;font-size:16px;line-height:22px;vertical-align:top;white-space:pre-line;outline:none;resize:none;}#input > .waiting{position:absolute;width:auto;top:10px;bottom:0;left:0;right:0;border-radius:12px;background-color:#e9eaea;z-index:1;opacity:0;visibility:hidden;transition:.2s;}#input.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #cacece;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}#input.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 1200px){#chat-wider{opacity:0;visibility:hidden;}:host,
#chat-wrapper{position:relative;height:auto;}#chat-wrapper{min-height:270px;max-height:350px;border-top:1px solid rgba(0, 0, 0, .1);}#chat-position{top:20px;left:30px;right:30px;}#input > textarea{max-height:50px;}}@media screen and (max-width: 600px){:host,
#chat-wrapper,
#chat-wider + #chat-wrapper,
#chat-wider.active + #chat-wrapper{position:relative;min-width:320px;}#chat-wrapper{border-top:1px solid #e6e6e6;}#chat-position{left:15px;right:15px;bottom:15px;}#chat-content > .message{margin-bottom:10px;}#chat-content > .message.common{min-height:30px;padding:0 10px 0 32px;}#chat-content > .message.system{padding:5px 10px;}#chat-content > .message.gift{min-height:50px;padding:0 10px 0 32px;}#chat-content > .message > a:first-child{height:24px;width:24px;top:0;}#chat-content > .message > a > .status-icon{top:14px;left:-4px;}#chat-content > .message > a > .avatar > img{left:-4px;}#chat-content > .message > .nickname,
#chat-content > .message > .content{font-size:12px;}}#chat-wrapper.full-screen{background-color:#202628;border-color:#202628;color:#fff;}#chat-wrapper.full-screen #chat-instant,
#chat-wrapper.full-screen #chat-instant > a > .status-icon,
#chat-wrapper.full-screen #chat-content > .message > a > .status-icon{background-color:#202628;}#chat-wrapper.full-screen #input:before{background:-moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(32,38,40,1) 100%);background:-webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(32,38,40,1) 100%);background:linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(32,38,40,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#202628',GradientType=0 );}#chat-wrapper.full-screen .on-white-scroll::-webkit-scrollbar-track{background-color:#202628;}#chat-wrapper.full-screen .on-white-scroll::-webkit-scrollbar-thumb{border-color:#202628;background-color:#5a6366;}#chat-wrapper.full-screen .on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:#70797c;}#chat-wrapper.full-screen #chat-content > .message > .nickname{color:#7b868a;}#chat-wrapper.full-screen #chat-content > .message > .content{color:#fff;}#chat-wrapper.full-screen #input > textarea{background-color:#202628;color:#fff;}#chat-wrapper.full-screen #input > .waiting{top:12px;bottom:2px;left:2px;right:2px;background-color:#202628;}#chat-wrapper.full-screen .waiting > .waiting-content > span,
#chat-wrapper.full-screen #input:after{border-color:#5a6366;}#chat-wrapper.full-screen #chat-content > .message.system{background-color:#5a6366;}#chat-wrapper.full-screen #chatlog-button{position:absolute;display:block;height:54px;width:54px;top:8px;right:10px;border-radius:100%;background-color:#101314;line-height:54px;text-align:center;z-index:1;cursor:pointer;}#chat-wrapper.full-screen #chat-instant.show + #chatlog-button{top:58px;}#chat-wrapper.full-screen #chatlog-button > svg{vertical-align:middle;}#chat-wrapper.full-screen #chatlog-button > svg + svg{display:none;}#chat-wrapper.full-screen.show,
#chat-wider.active + #chat-wrapper.full-screen.show{height:100%;width:0;min-width:0;}#chat-wrapper.full-screen.show #chatlog-button{height:54px;width:64px;right:auto;left:-65px;border-radius:27px 0 0 27px;background-color:#202628;}#chat-wrapper.full-screen.show #chatlog-button > svg{display:none;}#chat-wrapper.full-screen.show #chatlog-button > svg + svg{display:inline-block;}#chat-wrapper.full-screen.show #chat-instant{padding:0;}#chat-wrapper.full-screen.show > #chat-position{left:0;}#chat-wrapper.full-screen #chat-instant > .nickname{color:#fff;}#chat-wrapper.full-screen.show #chat-instant,
#chat-wrapper.full-screen.show #chat,
#chat-wrapper.full-screen.show #input{display:none;}@media screen and (max-width: 1200px){#chat-wrapper.full-screen.show{height:0;min-height:0;width:100%;}#input-switch-chatlog:checked + #chat-wrapper.full-screen > #chat-position{top:0;}#input-switch-chatlog:checked + #chat-wrapper.full-screen #chatlog-button{height:54px;width:54px;top:-54px;left:-1px;border-radius:100% 100% 0 0;}}@media screen and (max-width: 600px){#chat-wrapper.full-screen{display:none;}}</style></template></dom-module>
<dom-module id="tc-message-html-style" assetpath="../ui/tc-utils/"><template><style>.message{font-size:14px;color:#2e373a;white-space:pre-line;word-wrap:break-word;}.message.system{font-size:12px;font-weight:600;color:#8f999c;}.message.gift{padding-bottom:12px;font-size:12px;font-weight:600;color:#8f999c;cursor:default;}.full-screen.message{color:#fff;}a{color:#4682b4;}@media screen and (max-width: 600px){.message{font-size:12px;}}</style></template></dom-module>
<dom-module id="tc-message-html" assetpath="../ui/tc-utils/"><template strip-whitespace=""><style include="tc-message-html-style"></style><span id="html" class$="[[classType]]">{{html}}</span></template>
<script>
class TcMessageHtml extends Polymer.Element {
static get is() {
return 'tc-message-html'
}
static get properties() {
return {
classType: {
type: String,
value: ''
},
html: {
type: String,
value: 'html'
},
onFullscreenHandler: Object
}
}
constructor() {
super()
}
ready() {
super.ready(), Polymer.RenderStatus.afterNextRender(this, function() {
this.$.html.innerHTML = Autolinker.link(this.html.replace(/<\/?[^>]+(>|$)/g, ''))
})
}
connectedCallback() {
super.connectedCallback(), this.onFullscreenHandler = this.onFullscreen.bind(this), window.fullscreenManager.addEventListener(this.onFullscreenHandler, !1)
}
disconnectedCallback() {
super.disconnectedCallback(), window.fullscreenManager.removeEventListener(this.onFullscreenHandler, !1)
}
onFullscreen() {
let b = window.fullscreenManager.status();
b ? this.$.html.classList.add('full-screen') : this.$.html.classList.remove('full-screen')
}
}
customElements.define(TcMessageHtml.is, TcMessageHtml);
</script>
</dom-module>
<dom-module id="tinychat-chatlog" assetpath="../ui/"><template strip-whitespace=""><style include="client-chatlog"></style><div id="chat-wider" on-click="onWider"></div><div id="chat-wrapper"><div id="chat-position"><div id="chat-instant" class$="[[_getClass(_selected)]]"><span id="chat-instant-button" on-click="back2Public"></span> <a href="#"><div class="avatar"><dom-if if="[[showAvatarImg(_selected)]]"><template strip-whitespace=""><img src="[[_selected.avatarUrl]]"></template></dom-if>
</div>
<dom-if if="[[showAchiveImg(_selected)]]"><template strip-whitespace=""><img class="status-icon" src="[[_selected.achivementUrl]]"></template></dom-if>
</a>
<div class="nickname" data-status$="[[convertSubType(_selected)]]" title="[[_selected.nickname]]">[[_selected.nickname]]
<dom-if if="[[_selected.isOffline]]"><template strip-whitespace=""><span style="font-weight:bold;">(offline)</span></template></dom-if>
</div>
</div>
<div id="chatlog-button" on-click="onChatlogShow"><svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M9 7.464L1.85.314A1.09 1.09 0 0 0 .322.322a1.08 1.08 0 0 0-.006 1.53L7.466 9l-7.15 7.15a1.09 1.09 0 0 0 .005 1.53 1.08 1.08 0 0 0 1.53.005L9 10.535l7.15 7.15a1.09 1.09 0 0 0 1.53-.006 1.08 1.08 0 0 0 .005-1.53L10.535 9l7.15-7.15A1.09 1.09 0 0 0 17.68.322a1.08 1.08 0 0 0-1.53-.006L9 7.466z" fill="#53b6ef" fill-rule="evenodd"></path></svg> <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2.767 0C1.92 0 1.1.4.58 1.07a2.71 2.71 0 0 0-.496 2.343l1.678 7.49c.086.403.264.772.51 1.086a2.74 2.74 0 0 0-.514 1.103L.075 20.62a2.713 2.713 0 0 0 .505 2.31A2.795 2.795 0 0 0 2.767 24c.427 0 .855-.102 1.24-.294l18.47-9.204a2.78 2.78 0 0 0 .03-4.943L4.007.294A2.787 2.787 0 0 0 2.768 0m0 2c.114 0 .23.026.345.083l18.472 9.25a.78.78 0 0 1 0 1.38L3.112 21.916a.767.767 0 0 1-.345.083c-.464 0-.87-.428-.744-.928l1.69-7.56a.782.782 0 0 1 .666-.6l9.446-.734c.13-.01.197-.113.2-.22a.238.238 0 0 0-.2-.247l-9.447-.666a.732.732 0 0 1-.667-.578l-1.69-7.538c-.125-.5.28-.928.744-.928" fill="#53b6ef" fill-rule="evenodd"></path></svg></div>
<div id="chat" class="on-white-scroll" on-scroll="onScroll">
<div id="chat-content">
<dom-repeat items="[[_items]]"><template strip-whitespace=""><div class$="[[_getClassType(item.type)]]"><dom-if if="[[showNick(item)]]"><template strip-whitespace=""><a href="#"><div class="avatar"><img src="[[item.user.avatarUrl]]"></div><dom-if if="[[showAchiveImg(item.user)]]"><template strip-whitespace=""><img class="status-icon" src="[[item.user.achivementUrl]]"></template></dom-if>
</a><a href="#" class="nickname" data-status$="[[convertSubType(item.user)]]">[[item.user.nickname]]</a></template>
</dom-if>
<div class="content">
<tc-message-html class-type="[[_getClassType(item.type, isFullScreen)]]" html="[[item.message_text]]"></tc-message-html>
</div>
<dom-if if="[[showGift(item.type)]]"><template strip-whitespace=""><a class="gift-image" href="#"><img src="[[item.giftUrl]]"></a></template></dom-if>
</div>
</template>
</dom-repeat>
</div>
</div>
<form id="input" on-submit="onOK" class$="[[sendProgressClass]]"><span id="input-unread" class$="[[_getClassUnreaded(_unreaded,_selected)]]" data-messages$="[[_getCountUnreaded(_unreaded,_selected)]]" on-click="unreadedClick">Unread messages</span><textarea id="textarea" class="on-white-scroll" form="input" wrap="off" placeholder="Type a message" maxlength$="[[textareaMaxLen]]" on-click="onInput" on-keyup="onInputKeyup" on-keydown="onInputKeydown"></textarea>
<div class="waiting">
<div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div>
</div>
</form>
</div>
</div>
</template>
<script>
class ChatroomChatlog extends Polymer.Element {
static get is() {
return 'tinychat-chatlog'
}
static get properties() {
return {
chatlog: {
type: Object,
observer: 'chatlogAssigned'
},
_items: Array,
_selected: {
type: Object,
notify: !0
},
textareaHeight: Number,
textareaMaxLen: Number,
scrolled: Boolean,
_unreaded: {
type: Object,
value: {}
},
_scrollPos: {
type: Object,
value: {}
},
sendProgress: {
type: Boolean,
value: !1
},
sendProgressClass: {
type: String,
computed: 'convertSendClass(sendProgress)'
},
onFullscreenHandler: Object,
isFullScreen: Boolean
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback(), this.onFullscreenHandler = this.onFullscreen.bind(this), window.fullscreenManager.addEventListener(this.onFullscreenHandler, !1)
}
disconnectedCallback() {
super.disconnectedCallback(), window.fullscreenManager.removeEventListener(this.onFullscreenHandler, !1)
}
get app() {
return this.chatlog.chatroom.app
}
get chatroom() {
return this.chatlog.chatroom
}
get userlist() {
return this.chatlog.chatroom.userlist
}
chatlogAssigned(a) {
let b = this,
c = this.chatlog.chatroom.app.EventBus,
d = TinychatApp.DAL.UserEntity,
f = TinychatApp.DAL.ChatLogItemEntity,
g = TinychatApp.BLL.Chatlog;
b.textareaHeight = this.$.textarea.clientHeight, b.setProperties({
_selected: g.PUBLIC,
_items: Array.from(this.chatlog.getitems(g.PUBLIC)),
textareaMaxLen: g.MAX_INPUT_LEN
}), c.subscribe(TinychatApp.BLL.RoomConnected.ID, () => {
b.sendProgress = !1
}), c.subscribe(TinychatApp.BLL.RoomReconnected.ID, () => {
let i = TinychatApp.BLL.Chatlog.PUBLIC;
b.chatlog.system_add(i, 'You were reconnected the room'), b.sendProgress = !1
}), c.subscribe(TinychatApp.BLL.ChatlogItemAddedEvent.ID, h => {
a.isequal(b._selected, h.chatentity.chatname) && (b.scrollChatCheck(b.$.chat, b.$['chat-content']), setTimeout(() => {
b.splice('_items', h.index, 0, Object.assign(new f, h.chatentity)), setTimeout(() => {
b.scrollChatToBottom(b.$.chat, b.$['chat-content'])
}, 1)
}, 1))
}), c.subscribe(TinychatApp.BLL.ChatlogItemRemovedEvent.ID, h => {
a.isequal(b._selected, h.chatentity.chatname) && b.splice('_items', h.index, 1)
}), c.subscribe(TinychatApp.BLL.ChatlogItemSentEvent.ID, () => {
b.sendProgress = !1
}), c.subscribe(TinychatApp.BLL.ChatlistSelectedEvent.ID, function(h) {
b.setProperties({
_selected: h.userentity,
_items: Array.from(h.chatitems)
}), setTimeout(() => {
b.scrollChatToBottom(b.$.chat, b.$['chat-content'], !0)
}, 1), b.cleanTextarea(b.$.textarea), h.userentity instanceof d && setTimeout(() => {
b.$.textarea.focus()
}, 1)
}), c.subscribe(TinychatApp.BLL.ChatlistUpdateEvent.ID, function(h) {
if (b._selected instanceof d && h.toUserEntity.handle === b._selected.handle) {
let i = Object.assign(new d, h.toUserEntity);
b.set('_selected', i), b.notifyPath('_items')
}
}), c.subscribe(TinychatApp.BLL.ChatlistRemoveEvent.ID, function() {})
}
onFullscreen() {
if (this.isFullScreen = window.fullscreenManager.status(), this.isFullScreen) this.$['chat-wrapper'].classList.add('full-screen');
else {
this.$['chat-wrapper'].classList.remove('full-screen');
let b = this._selected instanceof TinychatApp.DAL.UserEntity ? this._selected.handle : this._selected,
c = this._unreaded[b];
c = void 0 == c ? 0 : c, c || this.scrollChatToBottom(this.$.chat, this.$['chat-content'], !0)
}
}
onWider(a) {
a.target.classList.toggle('active');
let b = new UI.UIChatlogWiderToggle;
this.chatroom.app.EventBus.broadcast(UI.UIChatlogWiderToggle.ID, b)
}
onChatlogShow() {
this.$['chat-wrapper'].classList.toggle('show');
let b = new TinychatApp.BLL.ChatlistUIUpdateEvent;
this.chatlog.chatroom.app.EventBus.broadcast(TinychatApp.BLL.ChatlistUIUpdateEvent.ID, b)
}
onInput() {}
onInputKeyup(a) {
let b = a.path ? a.path[0] : (a.composedPath && a.composedPath())[0],
c = b.form;
setTimeout(() => {
b.scrollHeight > b.clientHeight && (b.style.height = b.scrollHeight + 'px')
}, 0);
let d = 13 == a.which || 13 == a.keyCode;
return d && (a.shiftKey || a.altKey || a.ctrlKey) ? void(a.altKey && (b.value += '\n', a.preventDefault())) : void(!d || this.sendProgress || c.dispatchEvent(new Event('submit', {
view: c,
bubbles: !1,
cancelable: !0
})))
}
onInputKeydown(a) {
let b = 13 == a.which || 13 == a.keyCode;
b && !(a.shiftKey || a.altKey || a.ctrlKey) && a.preventDefault()
}
onOK(a) {
a.preventDefault();
let b = a.target,
c = b.textarea,
d = c.value.trim();
return '' == d ? c.value = d : (this.cleanTextarea(c), this.sendmessage(d)), !1
}
cleanTextarea(a) {
a.value = '', a.style.height = ''
}
sendmessage(a) {
return this.chatroom.isLurker() ? (this.chatlog.system_add(this._selected, 'You\'re in view-only mode, please reconnect and solve captcha.'), void this.app.showToastLurker()) : void(!this.sendProgress && (this.sendProgress = this.chatlog.SendMessage(this._selected, a)))
}
back2Public() {
this.chatlog.selectPublic(), this.sendProgress = !1
}
_getClass(a) {
var b = '';
return a instanceof TinychatApp.DAL.UserEntity && (b = 'show'), b
}
_getClassUnreaded(a, b) {
let c = b instanceof TinychatApp.DAL.UserEntity ? b.handle : b;
var d = a[c];
return d = void 0 == d ? 0 : d, 0 < d ? 'show' : ''
}
_getCountUnreaded(a, b) {
let c = this._selected instanceof TinychatApp.DAL.UserEntity ? b.handle : b;
var d = a[c];
return void 0 == d ? 0 : (setTimeout(() => {
a[c] && this.chatlog.chatroom.sendPushForUnreadPrivateMessage()
}, 3e4), d)
}
_clearUnreadCurrent() {
let a = this._selected instanceof TinychatApp.DAL.UserEntity ? this._selected.handle : this._selected;
var b = this._unreaded[a];
void 0 == b || (delete this._unreaded[a], this.set('_unreaded', Object.assign({}, this._unreaded)))
}
_incUnreadCurrent() {
let a = this._selected instanceof TinychatApp.DAL.UserEntity ? this._selected.handle : this._selected;
var b = this._unreaded[a];
b == void 0 && (b = 0), ++b, this._unreaded[a] = b, this.set('_unreaded', Object.assign({}, this._unreaded))
}
_getClassType(a, b) {
let c = TinychatApp.DAL.ChatLogItemEntity;
var d = 'message';
return a === c.PUBLIC ? d += ' common' : a === c.PRIVATE ? d += ' common' : a === c.SYSTEM ? d += ' system' : a === c.GIFT ? d += ' gift' : void 0, b && (d += ' full-screen'), d
}
showNick(a) {
let b = a.type,
c = TinychatApp.DAL.ChatLogItemEntity;
var d = !1;
return b === c.PUBLIC ? d = !0 : b === c.PRIVATE ? d = !0 : b === c.GIFT ? d = null != a.user : void 0, d
}
showAvatarImg(a) {
return !!(a instanceof TinychatApp.DAL.UserEntity) && '' !== a.avatarUrl
}
showAchiveImg(a) {
return !!(a instanceof TinychatApp.DAL.UserEntity) && 0 < a.giftpoints && '' !== a.achivementUrl
}
showGift(a) {
let b = TinychatApp.DAL.ChatLogItemEntity;
var c = !1;
return a === b.GIFT ? c = !0 : void 0, c
}
convertSendClass(a) {
return a ? 'wait' : ''
}
convertSubType(a) {
let b = TinychatApp.BLL.User;
return a instanceof TinychatApp.DAL.UserEntity ? b.getCssClass(a) : ''
}
unreadedClick(a) {
a.stopPropagation();
let b = this;
this._clearUnreadCurrent(), b.scrollChatToBottom(b.$.chat, b.$['chat-content'], !0)
}
onScroll(a) {
let b = a.path ? a.path[0] : (a.composedPath && a.composedPath())[0],
c = b.childNodes[0],
d = b.scrollTop + b.clientHeight + 1 > c.clientHeight;
d && this._clearUnreadCurrent()
}
scrollChatCheck(a, b) {
let c = a.scrollTop + a.clientHeight + 1 > b.clientHeight;
this.scrolled = !c
}
scrollChatToBottom(a, b, c) {
let d = this,
f = b.clientHeight - a.clientHeight,
g = 0 < f && (!0 === c || !d.scrolled);
g ? this.smoothScrollTo(a, f, void 0, () => {
d._clearUnreadCurrent()
}) : 0 != f && d._incUnreadCurrent()
}
smoothScrollTo(a, b, c) {
if (('string' == typeof b || 'number' == typeof b) && (b *= 1, b === +b && 0 == b % 1)) {
var d = 200,
f = a.scrollTop,
g = b - f,
h = 0,
j = function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(l) {
window.setTimeout(l, 1e3 / 60)
}
}(),
k = function() {
g != b - f && (f = a.scrollTop, g = b - f, h = 0), h += 20, a.scrollTop = Math.inOutQuintic(h, f, g, d), h < d ? j(k) : c && Object.isFunc(c) && c()
};
k()
}
}
}
customElements.define(ChatroomChatlog.is, ChatroomChatlog);
</script>
</dom-module>
<dom-module id="client-chatlist" assetpath="../../styles/"><template><style>#chatlist *{user-select:none;-webkit-user-select:none;-moz-user-select:none;}#chatlist{font-size:0;}#chatlist.hidden #header,
#chatlist.hidden .list-item,
#chatlist > .list-item.hidden{height:0;opacity:0;visibility:hidden;}#chatlist > div{display:block;height:33px;overflow:hidden;opacity:1;visibility:visible;transition:.5s;animation:show-item .5s ease 0s 1;-webkit-animation:show-item .5s ease 0s 1;}@keyframes show-item{0%{height:0;opacity:0;visibility:visible;}100%{height:33px;opacity:1;visibility:visible;}}@-webkit-keyframes show-item{0%{height:0;opacity:0;visibility:visible;}100%{height:33px;opacity:1;visibility:visible;}}#chatlist > #header + .list-item{height:0;}#chatlist > #header ~ .list-item:not(.hidden):nth-child(2):last-of-type{height:33px;cursor:default;}#chatlist > div > span{position:relative;display:inline-block;height:30px;width:100%;padding-left:36px;border-radius:0 30px 30px 0;box-sizing:border-box;font-size:14px;color:#7b868a;line-height:30px;text-align:left;white-space:nowrap;overflow:hidden;transition:.2s;}#chatlist > #header{position:relative;height:70px;top:33px;font-weight:600;text-transform:uppercase;cursor:default;animation:show-header .5s ease 0s 1;-webkit-animation:show-header .5s ease 0s 1;}@keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}@-webkit-keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}#chatlist > #header ~ .list-item > span.active{background-color:#202628;cursor:default;}.list-item ~ span:not(.active)[data-status=""]:hover{color:#fff;}.list-item > span[data-status="gold"]{color:#ffbe00;}.list-item > span[data-status="extreme"]{color:#ad6ed1;}.list-item > span[data-status="pro"]{color:#31ea5d;}.list-item > span[data-status="gold"]:before,
.list-item > span[data-status="extreme"]:before,
.list-item > span[data-status="pro"]:before{content:'';position:absolute;display:inline-block;height:12px;width:12px;top:9px;left:0;background-repeat:no-repeat;}.list-item > span[data-status="gold"]:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjZWZhNzAxIi8+DQoJPHBhdGggaWQ9InN0YXR1cy1nb2xkIiBkPSJNNS45NSA1LjY1NmgyLjQ2NHYzLjA3OGMtLjY3LjIzLTEuNDA1LjM0NC0yLjIwNy4zNDQtLjg4IDAtMS41Ni0uMjU1LTIuMDQtLjc2NXMtLjcyMi0xLjI0LS43MjItMi4xODRjMC0uOTIzLjI2My0xLjY0Ljc5LTIuMTUzLjUyNS0uNTEzIDEuMjYyLS43NyAyLjIxLS43Ny4zNiAwIC43LjAzNCAxLjAxOC4xMDIuMzIuMDY2LjU5Ny4xNTIuODM0LjI1NmwtLjQ4OCAxLjIxYy0uNDEzLS4yMDItLjg2NS0uMzAzLTEuMzU3LS4zMDMtLjQ1IDAtLjguMTQ2LTEuMDQ1LjQ0LS4yNDYuMjkyLS4zNy43MS0uMzcgMS4yNTUgMCAuNTM0LjExMi45NC4zMzUgMS4yMi4yMjMuMjguNTQ0LjQyLjk2My40Mi4yMyAwIC40NC0uMDIyLjYzMy0uMDY2di0uODk0SDUuOTVWNS42NTZ6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCgk8dXNlIGZpbGw9IiMwMDAiIHhsaW5rOmhyZWY9IiNzdGF0dXMtZ29sZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI3N0YXR1cy1nb2xkIi8+DQo8L3N2Zz4=");}.list-item > span[data-status="extreme"]:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjYWQ2YmNlIi8+DQoJPHBhdGggaWQ9InN0YXR1cy1leHRyZW1lIiBkPSJNNy44MTMgOWgtMy4zOVYzLjI5aDMuMzl2MS4yMzdINS45NjV2LjloMS43MXYxLjIzN2gtMS43MXYxLjA3OGgxLjg0OHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI3N0YXR1cy1leHRyZW1lIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsLW9wYWNpdHk9Ii4yIi8+DQoJPHVzZSBmaWxsPSIjZmZmIiB4bGluazpocmVmPSIjc3RhdHVzLWV4dHJlbWUiLz4NCjwvc3ZnPg==");}.list-item > span[data-status="pro"]:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjMzhjZDU3Ii8+DQoJPHBhdGggaWQ9InN0YXR1cy1wcm8iIGQ9Ik04LjIzNCA1LjEwNWMwIC42MzgtLjE4OCAxLjEzLS41NjQgMS40OC0uMzc2LjM0Ny0uOTEuNTItMS42MDQuNTJoLS40MzNWOUg0LjA5VjMuMjloMS45NzZjLjcyMiAwIDEuMjYzLjE1NyAxLjYyNS40NzIuMzYzLjMxNS41NDQuNzYzLjU0NCAxLjM0M3ptLTIuNi43NDNoLjI4Yy4yMzIgMCAuNDE2LS4wNjUuNTUzLS4xOTYuMTM3LS4xMy4yMDUtLjMxLjIwNS0uNTQgMC0uMzg0LS4yMTQtLjU3Ny0uNjQtLjU3N2gtLjR2MS4zMTN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCgk8dXNlIGZpbGw9IiMwMDAiIHhsaW5rOmhyZWY9IiNzdGF0dXMtcHJvIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsLW9wYWNpdHk9Ii4yIi8+DQoJPHVzZSBmaWxsPSIjZmZmIiB4bGluazpocmVmPSIjc3RhdHVzLXBybyIvPg0KPC9zdmc+");}.list-item > span > img{position:absolute;display:inline-block;height:10px;width:10px;top:10px;left:20px;opacity:1;visibility:visible;transition:.2s;}.list-item > span > img[src=""]{opacity:0;visibility:hidden;}.list-item + .list-item > span:hover{background-color:#272f31;cursor:pointer;}.list-item > span > span{position:absolute;display:inline-block;height:100%;top:0;right:0;padding:0 5px 0 10px;background-color:#2d373a;font-size:0;box-shadow:0 0 3px 3px #2d373a;transition:.2s;}.list-item > span:hover > span{background-color:#272f31;box-shadow:0 0 3px 3px #272f31;}.list-item > span.active > span{background-color:#202628;box-shadow:0 0 3px 3px #202628;}.list-item > span > span[data-messages]:before{content:attr(data-messages);position:relative;display:inline-block;height:20px;min-width:20px;top:3px;padding:0 5px;border-radius:10px;box-sizing:border-box;font-size:10px;font-weight:800;color:#fff;background-color:#38cd57;line-height:20px;text-align:center;}.list-item > span > span[data-messages=""]:before,
.list-item > span > span[data-messages="0"]:before{display:none;}.list-item > span > span > .send-gift{content:'';position:relative;display:inline-block;height:14px;width:0;top:6px;padding:0;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC4zMTMgMi4yNmMwLS42MDQuNDktMS4wOTMgMS4wOTMtMS4wOTMuNjA0IDAgMS4wOTQuNDkgMS4wOTQgMS4wOTMgMCAuNjA0LS40OSAxLjA5NC0xLjA5NCAxLjA5NEg3LjU4M2wuNzMuNzNWMi4yNnpNNyAyLjMzM3YyLjMzNGgyLjMzM2MxLjI5IDAgMi4zMzQtMS4wNDUgMi4zMzQtMi4zMzRDMTEuNjY3IDEuMDQ1IDEwLjYyMiAwIDkuMzMzIDAgOC4wNDUgMCA3IDEuMDQ1IDcgMi4zMzN6TTUuNjg4IDIuMjZjMC0uNjA0LS40OS0xLjA5My0xLjA5NC0xLjA5My0uNjA0IDAtMS4wOTQuNDktMS4wOTQgMS4wOTMgMCAuNjA0LjQ5IDEuMDk0IDEuMDk0IDEuMDk0aDEuODIzbC0uNzMuNzNWMi4yNnpNNyAyLjMzM3YyLjMzNEg0LjY2N2MtMS4yOSAwLTIuMzM0LTEuMDQ1LTIuMzM0LTIuMzM0QzIuMzMzIDEuMDQ1IDMuMzc4IDAgNC42NjcgMCA1Ljk1NSAwIDcgMS4wNDUgNyAyLjMzM3oiIGZpbGw9IiMwNGNhZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGQ9Ik0wIDQuMmgxNFY3SDB6TS45MzMgOC40aDEyLjEzM1YxNEguOTMzeiIgZmlsbD0iIzA0Y2FmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");background-repeat:no-repeat;opacity:0;visibility:hidden;cursor:pointer;transition:.2s;}.list-item > span:hover > span[data-gift="1"] > .send-gift{width:14px;margin:0 3px 0 5px;opacity:1;visibility:visible;}.list-item > span > span > .close-instant{content:'';position:relative;display:inline-block;height:12px;width:0;top:7px;padding:2px 0;opacity:0;visibility:hidden;cursor:pointer;transition:.2s;}.list-item > span > span > .close-instant > path{transition:.2s;}.list-item > span > span > .close-instant:hover > path{fill:#768488;}.list-item > span > span > .close-instant:active > path{fill:#454d50;}.list-item > span:hover > span > .close-instant{width:12px;padding:2px 2px 2px 6px;opacity:1;visibility:visible;}.list-item > span:hover > span[data-gift="1"] > .close-instant{padding:2px;}</style></template></dom-module>
<dom-module id="tinychat-chatlist" assetpath="../ui/"><template strip-whitespace=""><style include="client-chatlist"></style><div id="chatlist"><div id="header"><span>Direct messages</span></div><div class="list-item"><span>No chats yet</span></div><dom-repeat items="[[_items]]"><template strip-whitespace=""><div class$="[[convertClass(item)]]" on-click="selectChat"><span class$="[[convertActive(item, _selected)]]" data-chat-id$="[[item.handle]]" data-status$="[[convertSubType(item)]]"><img src$="[[item.achivementUrl]]"> [[item.nickname]]<dom-if if="[[item.isOffline]]"><template strip-whitespace="">(offline)</template></dom-if><span data-messages$="[[convertMessages(item, _unreaded)]]" data-cam$="[[convertBool(item.isBroadcasting)]]" data-moderator$="[[convertBool(item.isOperator)]]" data-gift$="[[convertBool(item.isUsername)]]"><span class="send-gift" on-click="sendgiftTap"></span> <svg class="close-instant" on-click="closeChat" width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M6 4L2 0 0 2l4 4-4 4 2 2 4-4 4 4 2-2-4-4 4-4-2-2" fill="#5a6366" fill-rule="evenodd"></path></svg></span>
</span>
</div>
</template>
</dom-repeat>
</div>
</template>
<script>
class ChatroomChatlist extends Polymer.Element {
static get is() {
return 'tinychat-chatlist'
}
static get properties() {
return {
chatlog: {
type: Object,
observer: 'chatlogAssigned'
},
_items: {
type: Array,
value: [],
notify: !0
},
_selected: {
type: Object,
value: null
},
_unreaded: {
type: Object,
value: {}
}
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback()
}
chatlogAssigned() {
let b = this,
c = this.chatlog.chatroom.app.EventBus,
d = TinychatApp.DAL.UserEntity;
c.subscribe(TinychatApp.BLL.ChatlistAddEvent.ID, function(f) {
let g = b._items.length;
b.splice('_items', f.index, 0, Object.assign(new d, f.userentity)), g != b._items.length && (0 == g || 0 == b._items.length) && b.notifyPath('_items');
let h = f.userentity.handle;
b._unreaded[h] = 0, b._updateUnreaded(h), b.notifyPath('_unreaded.' + h)
}), c.subscribe(TinychatApp.BLL.ChatlistRemoveEvent.ID, function(f) {
var g = b._items.find(h => {
return h.handle === f.userentity.handle
});
g.isDeleting = !0, b._items[f.index] = Object.assign(new d, g), b.notifyPath('_items.' + f.index), setTimeout(() => {
let h = b._items.length;
b.splice('_items', f.index, 1), h != b._items.length && (0 == h || 0 == b._items.length) && b.notifyPath('_items')
}, 500)
}), c.subscribe(TinychatApp.BLL.ChatlistUpdateEvent.ID, function(f) {
let g = TinychatApp.DAL.UserEntity;
f.fromIndex == f.toIndex ? b.splice('_items', f.fromIndex, 1, Object.assign(new g, f.toUserEntity)) : (f.fromUserEntity.isDeleting = !0, b.notifyPath('_items.' + f.fromIndex, f.fromUserEntity), setTimeout(() => {
b.splice('_items', f.fromIndex, 1), b.splice('_items', f.toIndex, 0, Object.assign(new g, f.toUserEntity))
}, 500))
}), c.subscribe(TinychatApp.BLL.ChatlistSelectedEvent.ID, function(f) {
b.set('_selected', f.userentity), f.userentity instanceof d ? Object.keys(b._items).forEach(h => {
let j = b._items[h];
if (j.handle == f.userentity.handle) return b.notifyPath('_items'), !0
}) : b._selected === TinychatApp.BLL.Chatlog.PUBLIC && b.notifyPath('_items');
let g = f.userentity.handle;
b._unreaded[g] = 0, b._updateUnreaded(g)
}), c.subscribe(TinychatApp.BLL.ChatlogItemAddedEvent.ID, function(f) {
if (!b.chatlog.isequal(b._selected, f.chatname)) {
var g = b._unreaded[f.chatname];
g == void 0 && (g = 0), ++g, b._unreaded[f.chatname] = g, b._updateUnreaded(f.chatname)
}
})
}
_updateUnreaded(a) {
let b = TinychatApp.DAL.UserEntity,
c = this;
for (var d in c._items) {
let f = c._items[d];
if (f.handle == a) {
let g = c._items.indexOf(f);
c._items[g] = Object.assign(new b, f), c.notifyPath('_items.' + g);
break
}
}
}
isShown() {
let b = Array.isArray(this._items) && 0 < this._items.length;
return b
}
convertClass(a) {
var b = 'list-item';
return a.isDeleting && (b += ' hidden'), b
}
convertActive(a, b) {
let c = TinychatApp.DAL.UserEntity;
return b instanceof c && a instanceof c && b.handle === a.handle ? 'active' : ''
}
convertSubType(a) {
return TinychatApp.BLL.User.getCssClass(a)
}
convertMessages(a, b) {
let c = a.handle,
d = b[c];
return setTimeout(() => {
d && this.chatlog.chatroom.sendPushForUnreadPrivateMessage()
}, 3e4), d
}
convertBool(a) {
return a ? '1' : '0'
}
selectChat(a) {
let b = a.path ? a.path[0] : (a.composedPath && a.composedPath())[0],
c = 0 < parseInt(b.getAttribute('data-chat-id'));
c && this.chatlog.selectChat(a.model.item)
}
closeChat(a) {
this.chatlog.closeChat(a.model.item), a.stopPropagation()
}
sendgiftTap(a) {
a.preventDefault(), this.chatlog.chatroom.gotoGift(a.model.item)
}
}
customElements.define(ChatroomChatlist.is, ChatroomChatlist);
</script>
</dom-module>
<dom-module id="client-userlist" assetpath="../../styles/"><template><style>#userlist *{outline:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;}#userlist{padding-bottom:20px;font-size:0;}#userlist.hidden #header,
#userlist.hidden .list-item,
.list-item.hidden{height:0;opacity:0;visibility:hidden;}#userlist > div{height:33px;overflow:hidden;opacity:1;visibility:visible;transition:.5s;animation:show-item .5s ease 0s 1;-webkit-animation:show-item .5s ease 0s 1;}@keyframes show-item{0%{height:0;opacity:0;visibility:visible;}100%{height:33px;opacity:1;visibility:visible;}}@-webkit-keyframes show-item{0%{height:0;opacity:0;visibility:visible;}100%{height:33px;opacity:1;visibility:visible;}}#userlist > div > span{position:relative;display:inline-block;height:30px;width:100%;padding-left:36px;border-radius:0 30px 30px 0;box-sizing:border-box;font-size:14px;color:#7b868a;line-height:30px;text-align:left;white-space:nowrap;overflow:hidden;transition:.2s;}#userlist > #header{position:relative;height:70px;top:33px;font-weight:600;text-transform:uppercase;cursor:default;animation:show-header .5s ease 0s 1;-webkit-animation:show-header .5s ease 0s 1;}@keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}@-webkit-keyframes show-header{0%{height:0;opacity:0;visibility:visible;}100%{height:70px;opacity:1;visibility:visible;}}#button-banlist{position:absolute;display:block;height:24px;top:3px;right:0;padding:0 15px;border:none;border-radius:24px;font-size:12px;font-weight:700;color:#04caff;background-color:#202628;text-transform:none;cursor:pointer;opacity:1;visibility:visible;transition:.2s;}#button-banlist:hover{color:#fff;background-color:#04caff;}#button-banlist:active{color:#fff;background-color:#38a8de;}#button-banlist.hidden{opacity:0;visibility:hidden;}.list-item > span[data-status=""]:hover{color:#fff;}.list-item > span[data-status="gold"]{color:#ffbe00;}.list-item > span[data-status="extreme"]{color:#ad6ed1;}.list-item > span[data-status="pro"]{color:#31ea5d;}.list-item > span[data-status="gold"]:before,
.list-item > span[data-status="extreme"]:before,
.list-item > span[data-status="pro"]:before{content:"";position:absolute;display:inline-block;height:12px;width:12px;top:9px;left:0;background-repeat:no-repeat;}.list-item > span[data-status="gold"]:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjZWZhNzAxIi8+DQoJPHBhdGggaWQ9InN0YXR1cy1nb2xkIiBkPSJNNS45NSA1LjY1NmgyLjQ2NHYzLjA3OGMtLjY3LjIzLTEuNDA1LjM0NC0yLjIwNy4zNDQtLjg4IDAtMS41Ni0uMjU1LTIuMDQtLjc2NXMtLjcyMi0xLjI0LS43MjItMi4xODRjMC0uOTIzLjI2My0xLjY0Ljc5LTIuMTUzLjUyNS0uNTEzIDEuMjYyLS43NyAyLjIxLS43Ny4zNiAwIC43LjAzNCAxLjAxOC4xMDIuMzIuMDY2LjU5Ny4xNTIuODM0LjI1NmwtLjQ4OCAxLjIxYy0uNDEzLS4yMDItLjg2NS0uMzAzLTEuMzU3LS4zMDMtLjQ1IDAtLjguMTQ2LTEuMDQ1LjQ0LS4yNDYuMjkyLS4zNy43MS0uMzcgMS4yNTUgMCAuNTM0LjExMi45NC4zMzUgMS4yMi4yMjMuMjguNTQ0LjQyLjk2My40Mi4yMyAwIC40NC0uMDIyLjYzMy0uMDY2di0uODk0SDUuOTVWNS42NTZ6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCgk8dXNlIGZpbGw9IiMwMDAiIHhsaW5rOmhyZWY9IiNzdGF0dXMtZ29sZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI3N0YXR1cy1nb2xkIi8+DQo8L3N2Zz4=");}.list-item > span[data-status="extreme"]:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjYWQ2YmNlIi8+DQoJPHBhdGggaWQ9InN0YXR1cy1leHRyZW1lIiBkPSJNNy44MTMgOWgtMy4zOVYzLjI5aDMuMzl2MS4yMzdINS45NjV2LjloMS43MXYxLjIzN2gtMS43MXYxLjA3OGgxLjg0OHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI3N0YXR1cy1leHRyZW1lIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsLW9wYWNpdHk9Ii4yIi8+DQoJPHVzZSBmaWxsPSIjZmZmIiB4bGluazpocmVmPSIjc3RhdHVzLWV4dHJlbWUiLz4NCjwvc3ZnPg==");}.list-item > span[data-status="pro"]:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPHBhdGggZD0iTTAgMGg4LjAwNEMxMC4yMSAwIDEyIDEuNzk3IDEyIDMuOTk2djQuMDA4QzEyIDEwLjIxIDEwLjIwMyAxMiA4LjAwNCAxMkgwVjB6IiBmaWxsPSIjMzhjZDU3Ii8+DQoJPHBhdGggaWQ9InN0YXR1cy1wcm8iIGQ9Ik04LjIzNCA1LjEwNWMwIC42MzgtLjE4OCAxLjEzLS41NjQgMS40OC0uMzc2LjM0Ny0uOTEuNTItMS42MDQuNTJoLS40MzNWOUg0LjA5VjMuMjloMS45NzZjLjcyMiAwIDEuMjYzLjE1NyAxLjYyNS40NzIuMzYzLjMxNS41NDQuNzYzLjU0NCAxLjM0M3ptLTIuNi43NDNoLjI4Yy4yMzIgMCAuNDE2LS4wNjUuNTUzLS4xOTYuMTM3LS4xMy4yMDUtLjMxLjIwNS0uNTQgMC0uMzg0LS4yMTQtLjU3Ny0uNjQtLjU3N2gtLjR2MS4zMTN6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCgk8dXNlIGZpbGw9IiMwMDAiIHhsaW5rOmhyZWY9IiNzdGF0dXMtcHJvIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEpIiBmaWxsLW9wYWNpdHk9Ii4yIi8+DQoJPHVzZSBmaWxsPSIjZmZmIiB4bGluazpocmVmPSIjc3RhdHVzLXBybyIvPg0KPC9zdmc+");}.list-item > span:hover{background-color:#272f31;cursor:pointer;}.list-item > span > img{position:absolute;display:inline-block;height:10px;width:10px;top:10px;left:20px;opacity:1;visibility:visible;transition:.2s;}.list-item > span > img[src=""]{opacity:0;visibility:hidden;}.list-item > span > .nickname{position:relative;display:inline-block;pointer-events:none;}.list-item > span[data-ignore="ignore"] > .nickname:before{content:'';position:absolute;display:block;height:2px;left:-1px;right:-1px;top:50%;border-top:1px solid #7b868a;background-color:#2e373a;transition:.2s;}.list-item > span[data-ignore="ignore"]:hover > .nickname:before{background-color:#272f31;}.list-item > span > span{position:absolute;display:inline-block;height:100%;min-width:0;top:0;right:0;padding:0 10px;background-color:#2d373a;box-shadow:0 0 3px 3px #2d373a;transition:.2s;}.list-item > span:hover > span{background-color:#272f31;box-shadow:0 0 3px 3px #272f31;}.list-item > span:hover > span[data-gift="1"]{min-width:16px;}.list-item > span:hover > span[data-cam="1"][data-gift="1"]{padding-right:30px;}.list-item > span > span[data-moderator="1"],
.list-item > span:hover > span[data-moderator="1"]{min-width:33px;}.list-item > span > span[data-moderator="1"]:before{content:"";position:relative;display:inline-block;height:10px;width:11px;margin-right:8px;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTEiIGhlaWdodD0iMTAiIHZpZXdCb3g9IjAgMCAxMSAxMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA5LjhoMi42NlY0LjJsMi40OTIgMy44MDhoLjA1NmwyLjUwNi0zLjgzNlY5LjhoMi43MDJWMGgtMi44N0w1LjIwOCAzLjc5NCAyLjg3IDBIMCIgZmlsbD0iIzVhNjM2NiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");background-repeat:no-repeat;vertical-align:middle;}.list-item > span > span[data-cam="1"]:after{content:"";position:relative;display:inline-block;height:11px;width:14px;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTEiIHZpZXdCb3g9IjAgMCAxNCAxMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQgMi43Nzd2NC41YzAgLjgxLS42MjggMS0xIC43NSAwIDAtMS42NjctMS44MzYtMi0yLjI1LS4zMzMtLjQxNC0uNjI3LS44NDcgMC0xLjVzMi0yLjI1IDItMi4yNWMuMzctLjI1IDEtLjA2IDEgLjc1ek0zIC4wMjdsNCAxYzEuMDktLjE3NSAyIDEuMDMgMiAydjNjMCAxLjgtLjkwOCAzLjAyOC0yIDNsLTQgMWMtMS42MDUuMjc0LTMtMS4wOTYtMy0zdi00YzAtMS44MzcgMS40LTMuMjQgMy0zeiIgZmlsbD0iIzVhNjM2NiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");background-repeat:no-repeat;vertical-align:middle;}.list-item > span > span > .send-gift{position:absolute;display:inline-block;height:14px;width:0;top:8px;right:0;padding:0;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC4zMTMgMi4yNmMwLS42MDQuNDktMS4wOTMgMS4wOTMtMS4wOTMuNjA0IDAgMS4wOTQuNDkgMS4wOTQgMS4wOTMgMCAuNjA0LS40OSAxLjA5NC0xLjA5NCAxLjA5NEg3LjU4M2wuNzMuNzNWMi4yNnpNNyAyLjMzM3YyLjMzNGgyLjMzM2MxLjI5IDAgMi4zMzQtMS4wNDUgMi4zMzQtMi4zMzRDMTEuNjY3IDEuMDQ1IDEwLjYyMiAwIDkuMzMzIDAgOC4wNDUgMCA3IDEuMDQ1IDcgMi4zMzN6TTUuNjg4IDIuMjZjMC0uNjA0LS40OS0xLjA5My0xLjA5NC0xLjA5My0uNjA0IDAtMS4wOTQuNDktMS4wOTQgMS4wOTMgMCAuNjA0LjQ5IDEuMDk0IDEuMDk0IDEuMDk0aDEuODIzbC0uNzMuNzNWMi4yNnpNNyAyLjMzM3YyLjMzNEg0LjY2N2MtMS4yOSAwLTIuMzM0LTEuMDQ1LTIuMzM0LTIuMzM0QzIuMzMzIDEuMDQ1IDMuMzc4IDAgNC42NjcgMCA1Ljk1NSAwIDcgMS4wNDUgNyAyLjMzM3oiIGZpbGw9IiMwNGNhZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGQ9Ik0wIDQuMmgxNFY3SDB6TS45MzMgOC40aDEyLjEzM1YxNEguOTMzeiIgZmlsbD0iIzA0Y2FmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");background-repeat:no-repeat;opacity:0;visibility:hidden;cursor:pointer;transition:.2s;}.list-item > span:hover > span[data-gift="1"] > .send-gift{width:14px;margin:0 8px 0 5px;opacity:1;visibility:visible;}#contextmenu{position:absolute;top:0;left:36px;}</style></template></dom-module>
<dom-module id="tinychat-userlist" assetpath="../ui/"><template strip-whitespace=""><style include="client-userlist"></style><div id="userlist"><div id="header"><span>Room users <button id="button-banlist" class="hidden" on-click="onBanlist">Ban list</button></span></div><dom-repeat items="[[_items]]"><template strip-whitespace=""><div class$="[[convertClass(item)]]"><span class="js-user-list-item" data-user-id$="[[item.handle]]" data-status$="[[convertSubType(item)]]" data-ignore$="[[convertIsIgnored(item)]]"><img src$="[[item.achivementUrl]]"><div class="nickname">[[item.nickname]]</div><span data-cam$="[[convertBool(item.isBroadcasting)]]" data-moderator$="[[convertBool(item.isOperator)]]" data-gift$="[[convertBool(item.isUsername)]]"><span class="send-gift" on-click="sendgiftTap"></span></span></span></div></template></dom-repeat>
<tinychat-user-contextmenu id="contextmenu" userlist="[[userlist]]"></tinychat-user-contextmenu>
</div>
</template>
<script>
class ChatroomUserlist extends Polymer.Element {
static get is() {
return 'tinychat-userlist'
}
static get properties() {
return {
userlist: {
type: Object,
observer: 'userlistAssigned'
},
_items: Array,
showContextMenuOnContextHandler: Object,
showContextMenuOnClickHandler: Object
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback(), this.showContextMenuOnContextHandler = this.showContextMenuOnContext.bind(this), this.showContextMenuOnClickHandler = this.showContextMenuOnClick.bind(this), document.body.addEventListener('contextmenu', this.showContextMenuOnContextHandler), window.addEventListener('click', this.showContextMenuOnClickHandler)
}
disconnectedCallback() {
super.disconnectedCallback(), document.body.removeEventListener('contextmenu', this.showContextMenuOnContextHandler), window.removeEventListener('click', this.showContextMenuOnClickHandler)
}
get chatroom() {
return this.userlist.chatroom
}
get app() {
return this.userlist.chatroom.app
}
userlistAssigned() {
let b = this,
c = this.app.EventBus,
d = TinychatApp.DAL.UserEntity;
c.subscribe(TinychatApp.BLL.RoomConnected.ID, function() {
b.chatroom.isOperator() && b.$['button-banlist'].classList.remove('hidden')
}), c.subscribe(TinychatApp.BLL.UserlistUpdateallEvent.ID, function(f) {
b.set('_items', Array.from(f.users))
}), c.subscribe(TinychatApp.BLL.UserlistAddUserEvent.ID, function(f) {
let g = b._shiftIndex(b._items, f.index);
b.splice('_items', g, 0, Object.assign(new d, f.userentity))
}), c.subscribe(TinychatApp.BLL.UserlistRemoveUserEvent.ID, function(f) {
let g = b._shiftIndex(b._items, f.index),
h = Object.assign(new d, f.userentity);
h.isDeleting = !0, b.notifyPath('_items.' + g, h), setTimeout(() => {
let j = b._shiftIndex(b._items, f.index);
b.splice('_items', j, 1)
}, 500)
}), c.subscribe(TinychatApp.BLL.UserlistUpdateUserEvent.ID, function(f) {
if (f.fromIndex == f.toIndex) {
let g = b._shiftIndex(b._items, f.fromIndex);
b.splice('_items', g, 1, Object.assign(new d, f.toUserEntity))
} else {
let g = b._shiftIndex(b._items, f.fromIndex),
h = Object.assign(new d, f.fromUserEntity);
h.isDeleting = !0, b.notifyPath('_items.' + g, h), setTimeout(() => {
let j = b._shiftIndex(b._items, f.fromIndex),
k = Object.assign(new d, f.toUserEntity),
l = b._shiftIndex(b._items, f.toIndex);
b.splice('_items', j, 1), b.splice('_items', l, 0, k)
}, 500)
}
}), c.subscribe(TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, function(f) {
let g = -1;
if (Object.keys(b._items).forEach(h => {
let j = b._items[h];
if (j.handle === f.userentity.handle) return g = h, !0
}), -1 < g) {
let h = Object.assign(new d, f.userentity);
b.notifyPath('_items.' + g, h)
}
})
}
_shiftIndex(a, b) {
for (var c = b, d = 0; d < b; d++) a[d].isDeleting && (c += 1);
return c
}
convertClass(a) {
var b = 'list-item';
return a.isDeleting && (b += ' hidden'), b
}
convertSubType(a) {
return TinychatApp.BLL.User.getCssClass(a)
}
convertIsIgnored(a) {
return this.userlist.isIgnored(a) ? 'ignore' : ''
}
convertBool(a) {
return a ? '1' : '0'
}
onBanlist() {
this.app.Banlist()
}
sendgiftTap(a) {
this.userlist.chatroom.gotoGift(a.model.item)
}
showContextMenuOnContext(a) {
this.showContextMenu(a) && a.preventDefault()
}
showContextMenuOnClick(a) {
this.showContextMenu(a, !0) && a.preventDefault()
}
showContextMenu(a, b) {
if (void 0 != this.userlist) {
this.$.contextmenu.hide();
var c = !1;
let d = a.path ? a.path[0] : (a.composedPath && a.composedPath())[0];
var f = parseInt(d.getAttribute('data-user-id'));
let g = parseInt(d.getAttribute('data-chat-id'));
!0 !== b && g && (f = g);
let h = this.userlist.get(f);
if (null != h && (this.$.contextmenu.chatlist = f == g, this.$.contextmenu.user = h, c = !0), c) {
let j = this;
setTimeout(() => {
j.$.contextmenu.show(a)
}, 0)
}
return c
}
}
}
customElements.define(ChatroomUserlist.is, ChatroomUserlist);
</script>
</dom-module>
<dom-module id="tc-volume-control-style" assetpath="../ui/tc-volume-control/"><template><style>*:focus{outline:none;}.icon-volume > button{position:relative;height:22px;width:22px;padding:0;border:none;background-color:transparent;cursor:pointer;}.icon-volume > button > svg{position:absolute;display:block;top:2px;left:4px;transition:.2s;}.icon-volume > button > svg + svg{left:3px;}.icon-volume.muted > button > svg + svg,
.icon-volume > button > svg{opacity:1;visibility:visible;}.icon-volume.muted > button > svg:first-child,
.icon-volume > button > svg + svg{opacity:0;visibility:hidden;}.icon-volume > .seek-wrapper{position:absolute;width:58px;top:6px;left:22px;}#seek-duration{position:absolute;height:22px;left:90px;bottom:0;font-size:12px;font-weight:600;color:#fff;line-height:22px;white-space:nowrap;cursor:default;}.seek-wrapper{height:10px;width:100%;padding:3px 5px;box-sizing:border-box;cursor:pointer;}.seek{position:relative;height:100%;width:100%;border-radius:4px;background-color:#fff;}.seek-text{position:absolute;height:20px;width:70px;top:-24px;margin-left:-35px;line-height:20px;text-align:center;opacity:0;transition:opacity .2s;}.seek-wrapper:hover > .seek > .seek-text{opacity:1;}.seek-text > span{display:inline-block;height:100%;padding:0 10px;border-radius:11px;font-size:12px;font-weight:600;color:#fff;background-color:rgba(0, 0, 0, .5);line-height:20px;}.seek-level{position:absolute;height:100%;top:0;left:0;border-radius:4px;background-color:#41b7ef;}.seek-level > div{position:absolute;display:block;height:4px;width:4px;top:0;right:-2px;border-radius:100%;background-color:#41b7ef;box-shadow:0 0 0 2px #41b7ef;transition:.2s;}.seek-wrapper:hover > .seek > .seek-level > div{box-shadow:0 0 0 3px #41b7ef;}</style></template></dom-module>
<dom-module id="tc-volume-control" assetpath="../ui/tc-volume-control/"><template strip-whitespace=""><style include="tc-volume-control-style"></style><div class$="[[iconClass]]"><button on-click="onMute"><svg width="14" height="18" viewBox="0 0 14 18" xmlns="http://www.w3.org/2000/svg"><path d="M11.148 15.86c.47.298.852.08.852-.455V2.6c0-.55-.376-.758-.852-.458L5.684 5.588H3.007C2.45 5.588 2 6.036 2 6.595v4.813c0 .556.452 1.007 1.007 1.007h2.677l5.464 3.446zm-8.14-1.44A3.01 3.01 0 0 1 0 11.41V6.595a3.008 3.008 0 0 1 3.007-3.013h2.1L10.085.444C11.88-.688 14 .458 14 2.6v12.806c0 2.123-2.123 3.285-3.916 2.154l-4.976-3.138h-2.1z" fill="#fff"></path></svg> <svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M1.72 13.365A3.005 3.005 0 0 1 1 11.408V6.595a3.008 3.008 0 0 1 3.007-3.013h2.1L11.085.444C12.88-.688 15 .458 15 2.6v2.47l1.464-.915a1.003 1.003 0 1 1 1.063 1.702l-15.99 9.99a1.003 1.003 0 1 1-1.064-1.702l1.248-.78zM13 6.318v-3.72c0-.548-.376-.756-.852-.456L6.684 5.588H4.007C3.45 5.588 3 6.036 3 6.595v4.813c0 .363.192.68.48.858L13 6.318zM15 9.5v5.905c0 2.123-2.123 3.285-3.916 2.154l-4.47-2.82L8.5 13.56l3.648 2.3c.47.298.852.08.852-.455V10.75l2-1.25z" fill="#fff"></path></svg></button><div id="videos-header-volume" class="seek-wrapper"><div class="seek" on-mouseleave="volTickTouchEnd" on-mousemove="volTickMouseMove" on-touchmove="volTickTouchMove" on-click="volTickClick" on-wheel="volWheel"><div id="videos-header-volume-level" class="seek-level" style$="width: [[vol]]%"><div on-mousedown="volTickMouseDown" on-touchstart="volTickTouchStart" on-touchend="volTickTouchEnd"></div></div></div></div></div></template>
<script>
class VolumeControl extends Polymer.Element {
static get is() {
return 'tc-volume-control'
}
static get properties() {
return {
volTickCaptured: {
type: Boolean,
value: !1
},
volume: {
type: Number,
value: 100,
observer: '_volTickSetVolumeObserver'
},
muted: {
type: Boolean,
value: !1
},
iconClass: {
type: String,
computed: '_computeIconClass(volume)'
},
volumeBefore: {
type: Number,
value: 100
},
vol: {
type: Number,
value: 100,
notify: !0
}
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback()
}
disconnectedCallback() {
super.disconnectedCallback()
}
_computeIconClass(a) {
let b = 'icon-volume';
return 0 === a && (b += ' muted'), b
}
onMute() {
this._volMuteToggle()
}
volTickTouchStart(a) {
this.volTickCaptured || (a.preventDefault(), this.volTickCaptured = !0)
}
volTickTouchEnd(a) {
this.volTickCaptured && (a.preventDefault(), this.volTickCaptured = !1)
}
volTickMouseDown(a) {
this.volTickCaptured || (a.preventDefault(), this.volTickCaptured = !0)
}
volTickMouseMove(a) {
if (this.volTickCaptured) {
a.preventDefault !== void 0 && a.preventDefault();
let b = a.target,
c = b.getBoundingClientRect(),
d = Math.round(100 * (a.clientX - c.left) / c.width);
100 < d && (d = 100), 0 > d && (d = 0), this.volume = d
}
}
volTickTouchMove(a) {
if (1 === a.touches.length) {
a.preventDefault();
let b = a.touches[0];
this.volTickMouseMove(b)
}
}
volTickClick(a) {
a.preventDefault();
let b = a.target,
c = b.getBoundingClientRect(),
d = Math.round(100 * (a.clientX - c.left) / c.width);
this.volume = d
}
volWheel(a) {
a.preventDefault();
let b = -1 < navigator.userAgent.toLowerCase().indexOf('firefox') ? -100 : -10,
c = a.target,
d = c.getBoundingClientRect();
var f = this.volume + Math.round(a.deltaY * b / d.width);
100 < f && (f = 100), 0 > f && (f = 0), this.volume = f
}
_volTickSetVolumeObserver(a, b) {
let c = Math.round(a);
100 < c && (c = 100), 0 > c && (c = 0);
let d = Math.round(b);
100 < d && (d = 100), 0 > d && (d = 0), this.vol = c;
let f = null;
0 >= d && 0 < c ? f = !1 : 0 < d && 0 >= c && (f = !0), null != f && f !== this.mute && this._volMuteToggle(f, !1)
}
_volMuteToggle(a, b) {
let c = this.muted;
a !== c && (this.muted = !this.muted, void 0 !== b || (this.muted ? (this.volumeBefore = this.volume, this.volume = 0) : this.volume = this.volumeBefore))
}
}
customElements.define(VolumeControl.is, VolumeControl);
</script>
</dom-module>
<dom-module id="tc-video-item-style" assetpath="../ui/tc-video-item/"><template><style>*:focus{outline:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}.video{position:relative;width:100%;padding:5px;box-sizing:border-box;font-size:0;overflow:hidden;}.video > div{position:relative;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA0OCA2NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGw9IiM1YTYzNjYiIGQ9Ik0xNCAxMy45OTR2MjAuMDEyQzE0IDM5LjUyMyAxOC40NzggNDQgMjQgNDRjNS41MTUgMCAxMC00LjQ4IDEwLTkuOTk0VjEzLjk5NEMzNCA4LjQ3NyAyOS41MjIgNCAyNCA0Yy01LjUxNSAwLTEwIDQuNDgtMTAgOS45OTR6TTI2IDU3LjkydjQuMDgyQTEuOTk0IDEuOTk0IDAgMCAxIDI0IDY0Yy0xLjEwNSAwLTItLjg4Ny0yLTEuOTk4VjU3LjkyQzkuNjk4IDU2LjkyOCAwIDQ2Ljg2IDAgMzQuNTg2YTIgMiAwIDAgMSA0IDBDNCA0NS4yODMgMTIuOTUgNTQgMjQgNTRjMTEuMDYgMCAyMC04LjcwMyAyMC0xOS40MTRhMiAyIDAgMCAxIDQgMGMwIDEyLjI4Ni05LjY5IDIyLjM0NC0yMiAyMy4zMzR6TTEwIDEzLjk5NEMxMCA2LjI3IDE2LjI3NyAwIDI0IDBjNy43MyAwIDE0IDYuMjY3IDE0IDEzLjk5NHYyMC4wMTJDMzggNDEuNzMgMzEuNzIzIDQ4IDI0IDQ4Yy03LjczIDAtMTQtNi4yNjctMTQtMTMuOTk0VjEzLjk5NHoiLz4KPC9zdmc+");background-repeat:no-repeat;background-position:center;background-color:#2a2c2c;overflow:hidden;}video{width:100%;}.video > div:before{content:'';display:block;width:100%;padding-bottom:75%;}.video:after{content:'';position:absolute;display:block;height:100%;width:100%;top:0;left:0;border:5px solid #fff;border-radius:10px;box-sizing:border-box;pointer-events:none;}.video:hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video:after{}.video:hover > div.pro:after,
.video:hover > div.extreme:after,
.video:hover > div.gold:after{top:-24px;right:-24px;transition:.2s ease .2s;}.video > div > div{position:relative;width:100%;}.video > div > video,
.video > div > iframe{position:absolute;height:100%;top:0;left:0;}.video > div > iframe{width:100%;}.video > div.ratio-16-9 > video,
.video > div.ratio-16-9 > iframe{left:-16.66%;}.video > div.ratio-8-5 > video,
.video > div.ratio-8-5 > iframe{left:-10%;}.video > div.ratio-3-2 > video,
.video > div.ratio-3-2 > iframe{left:-6.25%;}.video > div > .overlay{position:absolute;height:100%;width:100%;top:0;left:0;box-shadow:inset 0 0 0 0 rgba(0, 0, 0, .5);transition:.2s;}.video:hover > div > .overlay{box-shadow:inset 0 0 100px 0 rgba(0, 0, 0, .5);}.icon-visibility,
.icon-resize,
.icon-report,
.icon-filter,
.icon-close{position:absolute;height:22px;width:22px;top:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-visibility{left:-22px;}.icon-resize{left:50%;margin-left:-11px;}.icon-report,
.icon-close{right:-22px;}.icon-filter{width:26px;right:-26px;}.icon-visibility:hover,
.icon-resize:hover,
.icon-report:hover,
.icon-filter:hover,
.icon-close:hover{opacity:1;}.video:hover > div > .overlay > .icon-visibility,
.video:hover > div > .overlay > .icon-resize,
.video:hover > div > .overlay > .icon-report,
.video:hover > div > .overlay > .icon-filter,
.video:hover > div > .overlay > .icon-close{top:12px;transition:top .2s ease .2s,
left .2s ease .2s,
right .2s ease .2s,
opacity .2s;}.video:hover > div > .overlay > .icon-visibility{left:14px;}.video:hover > div > .overlay > .icon-report,
.video:hover > div > .overlay > .icon-close{right:14px;}.video:hover > div > .overlay > .icon-filter{right:12px;}.icon-visibility > svg,
.icon-resize > svg,
.icon-report > svg,
.icon-filter > svg,
.icon-close > svg{position:absolute;}.video.not-visible > div > .overlay > .icon-visibility > svg,
.icon-visibility > svg{top:4px;left:1px;opacity:0;visibility:hidden;transition:.2s;}.video.not-visible > div > .overlay > .icon-visibility > svg:first-child,
.icon-visibility > svg + svg{opacity:1;visibility:visible;}.video.not-visible > div > iframe{visibility:hidden;}.icon-resize > svg{top:3px;left:3px;}.icon-resize > svg > path{transition:.2s;}.video.large > div > .overlay > .icon-resize > svg > path + path{opacity:0;visibility:hidden;}.icon-report > svg{top:3px;left:3px;}.icon-filter > svg{top:1px;left:0;}.icon-close > svg{top:4px;left:4px;}.icon-context{position:absolute;height:22px;width:22px;bottom:-22px;right:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-context:hover{opacity:1;}.video:hover > div > .overlay > .icon-context{bottom:7px;right:16px;transition:bottom .2s ease .2s,
right .2s ease .2s,
opacity .2s;}.icon-context > svg{position:absolute;top:9px;left:1px;}.video-context{position:absolute;display:flex;flex-direction:column;align-content:center;top:0;bottom:0;left:0;right:0;padding-top:10px;padding-bottom:10px;border-radius:4px;border:1px solid rgba(0, 0, 0, .06);box-sizing:border-box;font-size:0;color:#535353;text-align:left;line-height:1;background-color:rgba(0, 0, 0, .7);box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);z-index:1;opacity:0;visibility:hidden;transition:.2s;}.video-context::-webkit-scrollbar-track{background-color:transparent;}.video-context::-webkit-scrollbar-thumb{border:5px solid transparent;border-radius:6px/8px;background-color:rgba(255, 255, 255, .1);background-clip:content-box;}.video-context::-webkit-scrollbar-thumb:hover{background-color:rgba(255, 255, 255, .2);}.video:hover > div > .overlay > .icon-context:focus + .video-context{opacity:1;visibility:visible;}.video-context-content{margin:0 auto;}.video-context-content > div{text-align:center;}.video-context-content > div + div{padding-top:5px;}.video-context-content > div > button{display:block;width:100%;padding:0 20px;border:none;border-radius:4px;box-sizing:border-box;font-size:13px;font-weight:600;color:#fff;background-color:transparent;line-height:26px;cursor:pointer;transition:.2s;}.video-context-content > div > button:hover{color:#fff;background-color:#04caff;}.icon-volume{position:absolute;height:22px;left:-22px;bottom:-22px;opacity:.9;transition:.2s;}.icon-volume:hover{opacity:1;}.video:hover > div > .overlay > .icon-volume{left:16px;bottom:16px;transition:bottom .2s ease .2s,
left .2s ease .2s,
opacity .2s;}#icon-state > button{position:relative;height:22px;width:22px;padding:0;border:none;background-color:transparent;cursor:pointer;}#icon-state > button > svg{position:absolute;display:block;top:2px;left:2px;}#icon-state > button > svg + svg{top:1px;left:2px;transition:.2s;}#icon-state > button > svg{opacity:1;visibility:visible;}#icon-state > button > svg + svg{opacity:0;visibility:hidden;}.video > div > .waiting{position:absolute;height:100%;width:100%;top:0;left:0;background-color:#202628;opacity:0;visibility:hidden;transition:.2s;}.video > div.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.video > div.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}.video > div > svg{position:absolute;top:5px;left:5px;filter:drop-shadow(0 0 4px #04caff);-webkit-filter:drop-shadow(0 0 4px #04caff);opacity:0;transition:.2s;}#videos-content > #videos > .video:hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video > div > svg > circle{fill:#fff;fill-rule:evenodd;stroke:#fff;stroke-width:0;transition:.2s;}.video > div > svg[data-mic-level="1"]{opacity:.5;}.video > div > svg[data-mic-level="2"]{opacity:.8;}.video > div > svg[data-mic-level="3"],
.video > div > svg[data-mic-level="4"],
.video > div > svg[data-mic-level="5"],
.video > div > svg[data-mic-level="6"],
.video > div > svg[data-mic-level="7"],
.video > div > svg[data-mic-level="8"],
.video > div > svg[data-mic-level="9"],
.video > div > svg[data-mic-level="10"]{opacity:1;}.video > div > svg[data-mic-level="4"] > circle{stroke-width:1;}.video > div > svg[data-mic-level="5"] > circle{stroke-width:2;}.video > div > svg[data-mic-level="6"] > circle{stroke-width:3;}.video > div > svg[data-mic-level="7"] > circle{stroke-width:4;}.video > div > svg[data-mic-level="8"] > circle{stroke-width:5;}.video > div > svg[data-mic-level="9"] > circle{stroke-width:6;}.video > div > svg[data-mic-level="10"] > circle{stroke-width:7;}.video > div > .nickname{position:absolute;display:block;height:15px;left:10px;right:10px;bottom:12px;margin-bottom:-7px;font-size:12px;font-weight:600;color:#fff;text-align:center;text-shadow:0 0 6px rgba(0, 0, 0, .8);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;transition:.2s;}.video > div > .nickname > img{position:relative;display:inline-block;height:10px;width:10px;top:2px;margin-right:6px;opacity:1;visibility:visible;transition:.2s;}.video > div > .nickname > img[src=""]{width:0;margin-right:0;overflow:hidden;opacity:0;visibility:hidden;}.video:hover > div > .nickname{bottom:50%;transition:.2s ease .2s;}.video > div.gold:after,
.video > div.extreme:after,
.video > div.pro:after{content:'';position:absolute;display:block;height:24px;width:24px;top:10px;right:10px;background-repeat:no-repeat;transition:.2s;}.video > div.gold:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+Cgk8Y2lyY2xlIGZpbGw9IiNmZmM2MmMiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPgoJPHBhdGggaWQ9ImJhZGdlLWdvbGQiIGQ9Ik0xNiAxMi41NzZ2LTEuMDE4aC0zLjU5NnYxLjUxaDEuMjZsLS4wMTIuMTA4Yy0uMDcuNjIyLS42MyAxLjAzNC0xLjQyIDEuMDM0LTEuMDY1IDAtMS43NTgtLjg0LTEuNzU4LTIuMjUgMC0xLjM3Ny42MDctMi4xNyAxLjYzOC0yLjE3LjY5OCAwIDEuMjQyLjM3IDEuNDAzLjkzN2gyLjM4OEMxNS43MiA5LjE0IDE0LjE3MyA4IDEyLjEgOCA5LjU1MiA4IDggOS40NTcgOCAxMS45OTIgOCAxNC41NiA5LjU1MiAxNiAxMi4xNzUgMTZjMi40IDAgMy44MjUtMS4zMDcgMy44MjUtMy40MjR6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiLz4KPC9zdmc+");}.video > div.extreme:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjYWQ2YmNlIiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtZXh0cmVtZSIgZD0iTTE0IDE2SDlWOGg1djEuNzM1aC0yLjcyNXYxLjI1OGgyLjUyM3YxLjczNWgtMi41MjN2MS41MUgxNHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWV4dHJlbWUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4NCgk8dXNlIGZpbGw9IiNmZmYiIHhsaW5rOmhyZWY9IiNiYWRnZS1leHRyZW1lIi8+DQo8L3N2Zz4=");}.video > div.pro:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjMzhjZDU3IiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtcHJvIiBkPSJNMTUgMTAuNTQ0YzAgLjg5NC0uMjcyIDEuNTg1LS44MTcgMi4wNzItLjU0NS40ODctMS4zMi43My0yLjMyMi43M2gtLjYyNlYxNkg5VjhoMi44NmMxLjA0NiAwIDEuODMuMjIgMi4zNTQuNjYyLjUyNC40NDIuNzg2IDEuMDcuNzg2IDEuODgyem0tMy43NjYgMS4wNGguNDA3Yy4zMzYgMCAuNjAzLS4wOS44LS4yNzMuMi0uMTgyLjI5OC0uNDM0LjI5OC0uNzU1IDAtLjU0LS4zMS0uODEtLjkyNy0uODFoLS41NzZ2MS44NHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIvPg0KPC9zdmc+");}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 600px){#videos{top:12px;right:13px;bottom:12px;left:13px;}.video{padding:2px;}.video:after{border-width:2px;border-radius:4px;}}.video.full-screen:after{border-color:#101314;}</style></template></dom-module>
<dom-module id="tc-video-item" assetpath="../ui/tc-video-item/"><template strip-whitespace=""><style include="tc-video-item-style"></style><div class$="[[videoItemStyle]]" on-click="onVideoTap" on-change="recalcVideosPosition"><div class$="[[convertVideoClass(item, item.progress)]]"><video id="video" autoplay="" volume="[[volume]]" data-video-id$="[[item.handle]]" on-playing="onPlaying">Your browser does not support the video tag...</video><div class="overlay"><button on-click="onHide" class="icon-visibility"><svg width="20" height="14" viewBox="0 0 20 14" xmlns="http://www.w3.org/2000/svg"><path d="M10 14C3.285 14 .52 8.65.52 8.65c-.657-.9-.68-2.417-.128-3.362C.392 5.288 2.452 0 10 0c7.545 0 9.594 5.27 9.594 5.27.6.94.51 2.465-.108 3.37 0 0-2.774 5.36-9.487 5.36zm0-2c2.423 0 4.374-.814 5.942-2.185a9.2 9.2 0 0 0 1.386-1.51c.212-.293.338-.5.38-.583l.057-.108.07-.1c.19-.282.217-.94.07-1.17L17.8 6.18l-.072-.184a3.74 3.74 0 0 0-.268-.485 6.67 6.67 0 0 0-1.178-1.393C14.827 2.8 12.798 2 10 2s-4.83.803-6.29 2.125c-.495.45-.887.928-1.182 1.4-.163.26-.25.436-.27.49L2.2 6.16l-.08.137c-.17.29-.15.946.018 1.176l.09.123.07.136c.042.08.168.29.378.58A9.167 9.167 0 0 0 4.06 9.82C5.624 11.187 7.573 12 9.997 12zm0-3a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" fill="#fff" fill-rule="evenodd"></path></svg> <svg width="20" height="14" viewBox="0 0 20 14" xmlns="http://www.w3.org/2000/svg"><path d="M3.63 12.024C1.474 10.5.52 8.65.52 8.65c-.657-.9-.68-2.417-.128-3.362C.392 5.288 2.452 0 10 0c1.94 0 3.52.35 4.79.867l.594-.592a.945.945 0 0 1 1.34.006.953.953 0 0 1 .004 1.34L4.616 13.724a.945.945 0 0 1-1.34-.006.953.953 0 0 1-.004-1.34l.357-.356zm9.598-9.594c-.942-.28-2.013-.43-3.23-.43-2.797 0-4.83.803-6.288 2.125-.496.45-.888.928-1.183 1.4-.163.26-.25.436-.27.49L2.2 6.16l-.08.137c-.17.29-.15.946.017 1.176l.09.123.07.136c.042.08.168.29.378.58A9.167 9.167 0 0 0 4.058 9.82c.32.28.656.535 1.01.766l8.16-8.156zm-6.08 11.222l1.713-1.714c.368.04.747.062 1.14.062 2.423 0 4.374-.814 5.942-2.185a9.2 9.2 0 0 0 1.386-1.51c.212-.293.338-.5.38-.583l.057-.108.07-.1c.19-.282.217-.94.07-1.17L17.8 6.18l-.072-.184a3.74 3.74 0 0 0-.268-.485 6.577 6.577 0 0 0-.972-1.2l1.415-1.414c1.244 1.225 1.69 2.374 1.69 2.374.6.94.512 2.465-.107 3.37 0 0-2.774 5.36-9.487 5.36-1.046 0-1.995-.13-2.853-.348z" fill="#fff" fill-rule="evenodd"></path></svg></button> <button on-click="onVideoResize" class="icon-resize"><svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M14.37 12.95l3.335 3.336a1.003 1.003 0 1 1-1.42 1.42L12.95 14.37a8.028 8.028 0 1 1 1.42-1.42zm-6.342 1.1a6.02 6.02 0 1 0 0-12.042 6.02 6.02 0 0 0 0 12.042zM6.012 9.032a.996.996 0 0 1-.994-1.004c0-.554.452-1.003.994-1.003h4.033c.55 0 .994.445.994 1.003 0 .555-.454 1.004-.995 1.004H6.012z" fill="#fff" fill-rule="evenodd"></path><path d="M0 .99C0 .445.444 0 1 0a1 1 0 0 1 1 .99v4.02C2 5.555 1.556 6 1 6a1 1 0 0 1-1-.99V.99z" transform="translate(7 5)" fill="#fff" fill-rule="evenodd"></path></svg></button><dom-if if="[[item.abuseAllow]]"><template strip-whitespace=""><button on-click="onAbuse" class="icon-report"><svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M.025.776A.997.997 0 0 1 1.038 0H14.52c1.142 0 1.753.835 1.36 1.877l-.658 1.746c-.39 1.036-.393 2.712 0 3.754l.658 1.746C16.27 10.16 15.66 11 14.52 11H2v4c0 .552-.444 1-1 1-.552 0-1-.445-1-1V.995C0 .92.01.845.025.775zM2.075 9h11.553l-.354-.94c-.56-1.48-.558-3.64 0-5.12l.354-.94H2.074v7z" fill="#fff" fill-rule="evenodd"></path></svg></button></template></dom-if>
<dom-if if="[[item.filtersAllow]]"><template strip-whitespace=""><button on-click="onFilters" class="icon-filter"><svg width="26" height="20" viewBox="0 0 26 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.6 10.4L18 12l-6.4 1.6L10 20l-1.6-6.4L2 12l6.4-1.6L10 4l1.6 6.4zM22 5l4 1-4 1-1 4-1-4-4-1 4-1 1-4 1 4zM3.6 2.4L6 3l-2.4.6L3 6l-.6-2.4L0 3l2.4-.6L3 0l.6 2.4z" fill="#fff" fill-rule="evenodd"></path></svg></button></template></dom-if><button class="icon-context"><svg width="20" height="4" viewBox="0 0 20 4" xmlns="http://www.w3.org/2000/svg"><circle r="2" cx="2" cy="2" fill="#fff" fill-rule="evenodd"></circle><circle r="2" cx="10" cy="2" fill="#fff" fill-rule="evenodd"></circle><circle r="2" cx="18" cy="2" fill="#fff" fill-rule="evenodd"></circle></svg></button>
<div class="video-context on-white-scroll" onmouseleave="this.previousElementSibling.blur();">
<div class="video-context-content">
<dom-if if="[[item.videoForceCloseAllow]]"><template strip-whitespace=""><div><button on-click="onVideoForceClose">Close Video</button></div></template></dom-if>
<dom-if if="[[item.ignoreAllow]]"><template strip-whitespace=""><div><button on-click="onIgnore">Ignore</button></div></template></dom-if>
<dom-if if="[[item.unignoreAllow]]"><template strip-whitespace=""><div><button on-click="onUnignore">Unignore</button></div></template></dom-if>
<dom-if if="[[item.followAllow]]"><template strip-whitespace=""><div><button on-click="onFollow">Follow</button></div></template></dom-if>
<dom-if if="[[item.openprivateAllow]]"><template strip-whitespace=""><div><button on-click="onPrivateMessage">Private Message</button></div></template></dom-if>
<dom-if if="[[item.profileAllow]]"><template strip-whitespace=""><div><button on-click="onProfile">Profile</button></div></template></dom-if>
<dom-if if="[[item.banAllow]]"><template strip-whitespace=""><div><button on-click="onBan">Ban</button></div></template></dom-if>
<dom-if if="[[item.kickAllow]]"><template strip-whitespace=""><div><button on-click="onKick">Kick</button></div></template></dom-if>
<dom-if if="[[item.abuseAllow]]"><template strip-whitespace=""><div><button on-click="onAbuse">Report (Abuse)</button></div></template></dom-if>
<dom-if if="[[item.giveagiftAllow]]"><template strip-whitespace=""><div><button on-click="onSendGift">Send Gift</button></div></template></dom-if>
<dom-if if="[[item.upgradeAllow]]"><template strip-whitespace=""><div><button on-click="onUpgrade">Upgrade</button></div></template></dom-if>
</div>
</div>
<dom-if if="[[item.volumeControlAllow]]"><template strip-whitespace=""><div class="icon-volume"><tc-volume-control vol="{{internalVolume}}"></tc-volume-control></div></template></dom-if>
</div>
<div class="waiting">
<div class="waiting-content"><span></span><span></span><span></span><span></span><span></span></div>
</div><svg width="20" height="20" viewBox="0 0 24 24" data-mic-level$="[[item.audiolevel]]" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="3"></circle><circle cx="12" cy="12" r="3"></circle></svg> <span class="nickname" title="[[item.nickname]]"><img src$="[[item.achivementUrl]]"> [[item.nickname]]</span></div>
</div>
</template>
<script>
class ChatroomVideoItem extends Polymer.Element {
static get is() {
return 'tc-video-item'
}
static get properties() {
return {
item: {
type: Object,
observer: 'itemAssigned'
},
chatroom: {
type: Object
},
app: {
type: Object
},
videolist: {
type: Object
},
externalVolume: {
type: Number,
value: 100
},
internalVolume: {
type: Number,
value: 100
},
volume: {
type: Number,
computed: '_volumeCompute(internalVolume, externalVolume)'
},
isFullScreen: {
type: Boolean,
value: !1
},
onFullscreenHandler: Object,
videoItemStyle: {
type: String,
computed: '_videoItemStyleCompute(item.large, item.muted, item.hidden, isFullScreen)'
}
}
}
constructor() {
super()
}
connectedCallback() {
super.connectedCallback(), this.onFullscreenHandler = this.onFullscreen.bind(this), window.fullscreenManager.addEventListener(this.onFullscreenHandler, !1)
}
disconnectedCallback() {
super.disconnectedCallback(), window.fullscreenManager.removeEventListener(this.onFullscreenHandler, !1)
}
itemAssigned(a) {
let b = this.$.video;
b.srcObject = a.mediastream, b.muted = a.muted, this.internalVolume = a.volume
}
_volumeCompute(a, b) {
let c = 100;
return void 0 === a && void 0 !== b ? c = b : void 0 !== a && void 0 === b ? c = a : void 0 != a && void 0 != b && (c = b < a ? b : a), this.item.volume !== c && (this.item.volume = c, this.notifyPath('item.volume')), c / 100
}
_videoItemStyleCompute(a, b, c, d) {
let f = 'video';
return f += a ? ' large' : '', f += b ? ' muted' : '', f += c ? ' not-visible' : '', f += d ? ' full-screen' : '', f
}
convertVideoClass(a, b) {
var c = 'ratio-4-3';
let d = TinychatApp.BLL.User.getCssClass(a.userentity);
return c += '' === d ? '' : ` ${d}`, c += b ? ' wait' : '', c
}
onPlaying(a) {
this.dispatchEvent(new CustomEvent('video-playing', a))
}
onMute() {
this.videolist.toggleMuteVW(this.item)
}
onVideoTap() {}
onHide() {
this.videolist.toggleHiddenVW(this.item)
}
onVideoResize() {
if (!this.chatroom.selfUser().hasSubscriptions) this.app.Upgrade();
else {
if (null != this.ytplayer) return void this.app.showToast('Larger video windows are disabled due Youtube is playing');
this.videolist.toggleSizeVW(this.item), this.notifyPath('item.large')
}
}
onBan() {
return this.chatroom.isLurker() ? void this.app.showToastLurker() : void this.chatroom.userlist.ban(this.item.userentity)
}
onKick() {
return this.chatroom.isLurker() ? void this.app.showToastLurker() : void this.chatroom.userlist.kick(this.item.userentity)
}
onAbuse() {
return this.chatroom.isLurker() ? void this.app.showToastLurker() : void this.chatroom.Abuse(this.item.userentity)
}
onFilters() {
this.app.MediaFilters()
}
onFullscreen() {
this.isFullScreen = window.fullscreenManager.status()
}
onVideoForceClose() {
this.chatroom.userlist.videoForceClose(this.item.userentity)
}
onIgnore() {
this.chatroom.userlist.ignore(this.item.userentity)
}
onUnignore() {
this.chatroom.userlist.unignore(this.item.userentity)
}
onFollow() {
return this.chatroom.isLurker() ? void this.app.showToastLurker() : void this.chatroom.userlist.follow(this.item.userentity)
}
onUnfollow() {
return this.chatroom.isLurker() ? void this.app.showToastLurker() : void this.chatroom.userlist.unfollow(this.item.userentity)
}
onPrivateMessage() {
this.chatroom.chatlog.openprivate(this.item.userentity)
}
onProfile() {
let b = this.item.userentity;
b.isUsername ? this.app.UserProfile(b.username) : this.app.showToast('[' + b.nickname + '] is anonymous, therefore has no profile')
}
onSendGift() {
let b = this.item.userentity;
b.isUsername ? this.app.GiveAGift(b.username) : this.app.showToast('[' + b.nickname + '] is anonymous, virtual gifts for registered users only.')
}
onUpgrade() {
this.app.UpgradeSub()
}
onFeatured() {
this.videolist.toggleFeatured(this.item)
}
}
customElements.define(ChatroomVideoItem.is, ChatroomVideoItem);
</script>
</dom-module>
<dom-module id="client-videolist" assetpath="../../styles/"><template><style>#videolist *{user-select:none;-webkit-user-select:none;-moz-user-select:none;}*:focus{outline:none;}.on-white-scroll{padding-left:16px;box-sizing:border-box;overflow-x:hidden;overflow-y:scroll;}.on-white-scroll::-webkit-scrollbar{position:absolute;width:15px;cursor:pointer;}.on-white-scroll::-webkit-scrollbar-track{background-color:#fff;}.on-white-scroll::-webkit-scrollbar-thumb{border:5px solid #fff;border-radius:6px/8px;background-color:rgba(0, 0, 0, .2);}.on-white-scroll::-webkit-scrollbar-thumb:hover{background-color:rgba(0, 0, 0, .4);}#ytplayer{pointer-events:none;}:host,
#videolist{position:relative;display:flex;flex-direction:column;align-items:stretch;height:100%;min-height:250px;width:100%;background-color:#fff;}#lurker{height:0;min-height:0;padding:0 20px;box-sizing:border-box;font-size:14px;font-weight:600;color:#fff;line-height:40px;background-color:#f29e20;text-align:center;white-space:nowrap;overflow:hidden;cursor:default;transition:.2s;}#lurker > *{vertical-align:middle;}#lurker > span{display:inline-block;margin:0 14px 0 10px;line-height:24px;}#lurker > button{display:inline-block;height:24px;padding:0 18px;border:1px solid #fff;font-size:12px;font-weight:700;color:#fff;line-height:24px;background-color:transparent;text-transform:uppercase;cursor:pointer;transition:.2s;}#lurker > button:hover{color:#f29e20;background-color:#fff;}#videolist.lurker > #lurker{height:40px;min-height:40px;}#videos-header{height:50px;min-height:50px;width:100%;top:0;left:0;font-size:0;background-color:#fff;z-index:1;transition:.2s;}#videolist.hide-header > #videos-header{height:0;min-height:0;}#videos-header{display:flex;flex-direction:row;align-items:stretch;}#videos-header > span.hidden{display:none;}#videos-header > span{display:inline-block;height:100%;width:100%;background-color:inherit;text-align:center;line-height:50px;}#videos-header > span > svg{display:inline-block;vertical-align:middle;cursor:pointer;}#videos-header > span > svg *{pointer-events:none;}#videos-header-sound{position:relative;}#videos-header-sound > svg > path ~ path{display:none;}#videos-header-sound > svg{position:relative;padding:7px 10px;z-index:1;}#videos-header-sound > svg.muted > path ~ path{display:block;}#videos-header-mic > svg{position:relative;padding:5px 10px;z-index:1;}#videos-header-mic > svg > rect{opacity:0;visibility:hidden;transition:.2s;}#videos-header-mic.muted > svg > rect{opacity:1;visibility:visible;}.videos-header-volume{position:absolute;height:128px;width:4px;top:2px;left:50%;margin-left:-24px;border-width:50px 22px 22px;border-style:solid;border-color:#fff;border-radius:24px;box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);opacity:0;visibility:hidden;transition:.2s;}#videos-header > span > svg:hover + .videos-header-volume,
#videos-header > span > .videos-header-volume:hover{opacity:1;visibility:visible;}.videos-header-volume:before{content:'';position:absolute;display:block;height:100%;width:100%;top:0;left:0;border-radius:2px;background-color:#e9eaea;}.videos-header-volume-level{position:absolute;display:block;width:100%;bottom:0;left:0;border-radius:2px;background-color:#41b7ef;}.videos-header-volume-level > div{position:absolute;display:block;height:12px;width:12px;top:-6px;left:-4px;border-radius:100%;background-color:#41b7ef;cursor:pointer;box-shadow:0 0 0 0 #41b7ef;transition:.2s;}.videos-header-volume-level > div:hover{box-shadow:0 0 0 3px #41b7ef;}#videos-header-snapshot > svg{padding:8px 7px 9px;}#videos-header-fullscreen > svg{padding:10px 8px;}#videos-header-fullscreen > svg + svg{display:none;}@media screen and (max-width: 600px){.videos-header-volume{top:auto;bottom:1px;margin-left:-23px;border-width:21px 21px 40px;box-shadow:0 0 4px 0 rgba(0, 0, 0, .09);}#videos-header-mic > .videos-header-volume{bottom:11px;margin-left:-17px;}#videolist.full-screen > #videos-header > span{background-color:#202628;}}#videos-content{position:relative;height:100%;width:100%;}#videos{position:absolute;display:flex;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;top:20px;right:25px;bottom:20px;left:25px;box-sizing:border-box;font-size:0;}.videos-items{display:flex;height:100%;width:100%;top:0;left:0;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;box-sizing:border-box;}.videos-items.hidden{display:none;}#videos.row > .videos-items{width:50%;}#videos.row > .videos-items + .videos-items{left:50%;}#videos.column{flex-direction:column;}#videos.column > .videos-items{height:50%;}#videos.row.featured-2 > .videos-items{width:65%;}#videos.row.featured-2 > .videos-items + .videos-items{width:35%;}#videos.column.featured-2 > .videos-items{height:70%;}#videos.column.featured-2 > .videos-items + .videos-items{height:30%;}#videos.row.featured-3 > .videos-items{width:70%;}#videos.row.featured-3 > .videos-items + .videos-items{width:30%;}#videos.column.featured-3 > .videos-items{height:70%;}#videos.column.featured-3 > .videos-items + .videos-items{height:30%;}#youtube.video.hidden{display:none;}.video{position:relative;width:100%;padding:5px;box-sizing:border-box;font-size:0;overflow:hidden;}.video > div{position:relative;overflow:hidden;}#youtube.video > div:before{content:'';display:block;width:100%;padding-bottom:75%;}.video:after{content:'';position:absolute;display:block;height:100%;width:100%;top:0;left:0;border:5px solid #fff;border-radius:10px;box-sizing:border-box;pointer-events:none;}.video > div > div{position:relative;width:100%;}.video > div > video,
.video > div > tinychat-videoitem,
.video > div > iframe{position:absolute;height:100%;top:0;left:0;}.video > div > iframe{width:100%;}.video > div.ratio-16-9 > video,
.video > div.ratio-16-9 > tinychat-videoitem,
.video > div.ratio-16-9 > iframe{left:-16.66%;}.video > div.ratio-8-5 > video,
.video > div.ratio-8-5 > tinychat-videoitem,
.video > div.ratio-8-5 > iframe{left:-10%;}.video > div.ratio-3-2 > video,
.video > div.ratio-3-2 > tinychat-videoitem,
.video > div.ratio-3-2 > iframe{left:-6.25%;}#youtube.video > div > .overlay,
.video > div > .overlay{position:absolute;height:100%;width:100%;top:0;left:0;box-shadow:inset 0 0 0 0 rgba(0, 0, 0, .5);transition:.2s;}.video:hover > div > .overlay{box-shadow:inset 0 0 100px 0 rgba(0, 0, 0, .5);}#youtube-overlay{position:absolute;height:100%;width:100%;top:0;left:0;opacity:.5;}#youtube.video > div > .overlay > #youtube-overlay:before,
#youtube.video > div > .overlay > #youtube-overlay:after{content:'';position:absolute;display:block;height:0;width:100%;top:0;left:0;background:-moz-linear-gradient(top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);background:-webkit-linear-gradient(top, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%);background:linear-gradient(to bottom, rgba(0,0,0,1) 0%,rgba(0,0,0,0) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#00000000',GradientType=0 );transition:.2s;}#youtube.video > div > .overlay > #youtube-overlay:after{top:auto;bottom:0;background:-moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);background:-webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%);background:linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 );}#youtube.video:hover > div > .overlay > #youtube-overlay:before,
#youtube.video:hover > div > .overlay > #youtube-overlay:after{height:100px;}.icon-visibility,
.icon-resize,
.icon-report,
.icon-close{position:absolute;height:22px;width:22px;top:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-visibility{left:-22px;}.icon-resize{left:50%;margin-left:-11px;}.icon-report,
.icon-close{right:-22px;}.icon-visibility:hover,
.icon-resize:hover,
.icon-report:hover,
.icon-close:hover{opacity:1;}.video:hover > div > .overlay > .icon-visibility,
.video:hover > div > .overlay > .icon-resize,
.video:hover > div > .overlay > .icon-report,
.video:hover > div > .overlay > .icon-close{top:12px;transition:top .2s ease .2s,
left .2s ease .2s,
right .2s ease .2s,
opacity .2s;}.video:hover > div > .overlay > .icon-visibility{left:14px;}.video:hover > div > .overlay > .icon-report,
.video:hover > div > .overlay > .icon-close{right:14px;}.icon-visibility > svg,
.icon-resize > svg,
.icon-report > svg,
.icon-close > svg{position:absolute;}.video.not-visible > div > .overlay > .icon-visibility > svg,
.icon-visibility > svg{top:4px;left:1px;opacity:0;visibility:hidden;transition:.2s;}.video.not-visible > div > .overlay > .icon-visibility > svg:first-child,
.icon-visibility > svg + svg{opacity:1;visibility:visible;}.video.not-visible > div > iframe{visibility:hidden;}.icon-resize > svg{top:3px;left:3px;}.icon-resize > svg > path{transition:.2s;}.icon-report > svg{top:3px;left:3px;}.icon-close > svg{top:4px;left:4px;}.icon-context{position:absolute;height:22px;width:22px;bottom:-22px;right:-22px;padding:0;border:none;background-color:transparent;cursor:pointer;opacity:.9;transition:.2s;}.icon-context:hover{opacity:1;}.video:hover > div > .overlay > .icon-context{bottom:7px;right:16px;transition:bottom .2s ease .2s,
right .2s ease .2s,
opacity .2s;}.icon-context > svg{position:absolute;top:9px;left:1px;}.video-context{position:absolute;display:flex;flex-direction:column;align-content:center;justify-content:center;top:0;bottom:0;left:0;right:0;padding-top:10px;padding-bottom:10px;border-radius:4px;border:1px solid rgba(0, 0, 0, .06);box-sizing:border-box;font-size:0;color:#535353;text-align:left;line-height:1;background-color:rgba(0, 0, 0, .7);box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);z-index:1;opacity:0;visibility:hidden;transition:.2s;}.video-context::-webkit-scrollbar-track{background-color:transparent;}.video-context::-webkit-scrollbar-thumb{border:5px solid transparent;border-radius:6px/8px;background-color:rgba(255, 255, 255, .1);background-clip:content-box;}.video-context::-webkit-scrollbar-thumb:hover{background-color:rgba(255, 255, 255, .2);}.video:hover > div > .overlay > .icon-context:focus + .video-context{opacity:1;visibility:visible;}.video-context-content{margin:0 auto;}.video-context-content > div{text-align:center;}.video-context-content > div + div{padding-top:5px;}.video-context-content > div > button{display:block;width:100%;padding:0 20px;border:none;border-radius:4px;box-sizing:border-box;font-size:13px;font-weight:600;color:#fff;background-color:transparent;line-height:26px;cursor:pointer;transition:.2s;}.video-context-content > div > button:hover{color:#fff;background-color:#04caff;}#icon-state{position:absolute;height:22px;left:-22px;bottom:-22px;opacity:.9;transition:.2s;}.video:hover > div > .overlay > #icon-state{left:16px;bottom:16px;transition:bottom .2s ease .2s,
left .2s ease .2s,
opacity .2s;}.icon-volume{position:absolute;height:22px;left:-22px;bottom:-22px;opacity:.9;transition:.2s;}#youtube .icon-volume{left:48px;}.icon-volume:hover{opacity:1;}.video:hover > div > .overlay > .icon-volume{left:16px;bottom:16px;transition:bottom .2s ease .2s,
left .2s ease .2s,
opacity .2s;}#youtube.video:hover > div > .overlay > .icon-volume{left:48px;}.icon-volume > button{position:relative;height:22px;width:22px;padding:0;border:none;background-color:transparent;cursor:pointer;}.icon-volume > button > svg{position:absolute;display:block;top:2px;left:4px;transition:.2s;}.icon-volume > button > svg + svg{left:3px;}.video.muted > div > .overlay > .icon-volume > button > svg + svg,
.icon-volume > button > svg{opacity:1;visibility:visible;}.video.muted > div > .overlay > .icon-volume > button > svg:first-child,
.icon-volume > button > svg + svg{opacity:0;visibility:hidden;}.icon-volume > .seek-wrapper{position:absolute;width:58px;top:6px;left:22px;}#icon-seek{position:absolute;height:22px;left:12px;right:12px;bottom:-22px;opacity:.9;transition:.2s;}.video:hover > div > .overlay > #icon-seek{bottom:38px;transition:bottom .2s ease .2s;}#icon-seek:hover{opacity:1;}#icon-state > button{position:relative;height:22px;width:22px;padding:0;border:none;background-color:transparent;cursor:pointer;}#icon-state > button > svg{position:absolute;display:block;top:2px;left:2px;}#icon-state > button > svg + svg{top:1px;left:2px;transition:.2s;}#youtube.pause #icon-state > button > svg + svg,
#icon-state > button > svg{opacity:1;visibility:visible;}#youtube.pause #icon-state > button > svg:first-child,
#icon-state > button > svg + svg{opacity:0;visibility:hidden;}#icon-seek > .seek-wrapper{position:absolute;width:auto;top:6px;left:0;right:0;}#seek-duration{position:absolute;height:22px;left:90px;bottom:0;font-size:12px;font-weight:600;color:#fff;line-height:22px;white-space:nowrap;cursor:default;}.seek-wrapper{height:10px;width:100%;padding:3px 5px;box-sizing:border-box;cursor:pointer;}.seek{position:relative;height:100%;width:100%;border-radius:4px;background-color:#fff;}.seek-text{position:absolute;height:20px;width:70px;top:-24px;margin-left:-35px;line-height:20px;text-align:center;opacity:0;transition:opacity .2s;}.seek-wrapper:hover > .seek > .seek-text{opacity:1;}.seek-text > span{display:inline-block;height:100%;padding:0 10px;border-radius:11px;font-size:12px;font-weight:600;color:#fff;background-color:rgba(0, 0, 0, .5);line-height:20px;}.seek-level{position:absolute;height:100%;top:0;left:0;border-radius:4px;background-color:#41b7ef;}.seek-level > div{position:absolute;display:block;height:4px;width:4px;top:0;right:-2px;border-radius:100%;background-color:#41b7ef;box-shadow:0 0 0 2px #41b7ef;transition:.2s;}.seek-wrapper:hover > .seek > .seek-level > div{box-shadow:0 0 0 3px #41b7ef;}.video > div > .waiting{position:absolute;height:100%;width:100%;top:0;left:0;background-color:#202628;opacity:0;visibility:hidden;transition:.2s;}.video > div.wait > .waiting{opacity:1;visibility:visible;}.waiting > .waiting-content{position:absolute;height:0;width:80%;top:50%;left:10%;}.waiting > .waiting-content > span{position:absolute;display:inline-block;height:0;width:0;top:-4px;left:0;border:4px solid #04caff;border-radius:100%;opacity:0;animation:waiting 1s ease-in-out 0s infinite paused;-webkit-animation:waiting 1s ease-in-out 0s infinite paused;}.waiting > .waiting-content > span:nth-child(2){animation-delay:.15s;-webkit-animation-delay:.15s;}.waiting > .waiting-content > span:nth-child(3){animation-delay:.3s;-webkit-animation-delay:.3s;}.waiting > .waiting-content > span:nth-child(4){animation-delay:.45s;-webkit-animation-delay:.45s;}.video > div.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}.video > div > svg{position:absolute;top:5px;left:5px;filter:drop-shadow(0 0 4px #04caff);-webkit-filter:drop-shadow(0 0 4px #04caff);opacity:0;transition:.2s;}#videos-content > #videos > .video:hover > div > svg{top:-24px;left:-24px;transition:.2s ease .2s;}.video > div > svg > circle{fill:#fff;fill-rule:evenodd;stroke:#fff;stroke-width:0;transition:.2s;}.video > div > svg[data-mic-level="1"]{opacity:.5;}.video > div > svg[data-mic-level="2"]{opacity:.8;}.video > div > svg[data-mic-level="3"],
.video > div > svg[data-mic-level="4"],
.video > div > svg[data-mic-level="5"],
.video > div > svg[data-mic-level="6"],
.video > div > svg[data-mic-level="7"],
.video > div > svg[data-mic-level="8"],
.video > div > svg[data-mic-level="9"],
.video > div > svg[data-mic-level="10"]{opacity:1;}.video > div > svg[data-mic-level="4"] > circle{stroke-width:1;}.video > div > svg[data-mic-level="5"] > circle{stroke-width:2;}.video > div > svg[data-mic-level="6"] > circle{stroke-width:3;}.video > div > svg[data-mic-level="7"] > circle{stroke-width:4;}.video > div > svg[data-mic-level="8"] > circle{stroke-width:5;}.video > div > svg[data-mic-level="9"] > circle{stroke-width:6;}.video > div > svg[data-mic-level="10"] > circle{stroke-width:7;}.video > div > .nickname{position:absolute;display:block;height:15px;left:10px;right:10px;bottom:12px;margin-bottom:-7px;font-size:12px;font-weight:600;color:#fff;text-align:center;text-shadow:0 0 6px rgba(0, 0, 0, .8);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;transition:.2s;}.video > div > .nickname > img{position:relative;display:inline-block;height:10px;width:10px;top:2px;margin-right:6px;opacity:1;visibility:visible;transition:.2s;}.video > div > .nickname > img[src=""]{width:0;margin-right:0;overflow:hidden;opacity:0;visibility:hidden;}.video:hover > div > .nickname{bottom:50%;transition:.2s ease .2s;}.video > div.gold:after,
.video > div.extreme:after,
.video > div.pro:after{content:'';position:absolute;display:block;height:24px;width:24px;top:10px;right:10px;background-repeat:no-repeat;transition:.2s;}.video > div.gold:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+Cgk8Y2lyY2xlIGZpbGw9IiNmZmM2MmMiIGN4PSIxMiIgY3k9IjEyIiByPSIxMiIvPgoJPHBhdGggaWQ9ImJhZGdlLWdvbGQiIGQ9Ik0xNiAxMi41NzZ2LTEuMDE4aC0zLjU5NnYxLjUxaDEuMjZsLS4wMTIuMTA4Yy0uMDcuNjIyLS42MyAxLjAzNC0xLjQyIDEuMDM0LTEuMDY1IDAtMS43NTgtLjg0LTEuNzU4LTIuMjUgMC0xLjM3Ny42MDctMi4xNyAxLjYzOC0yLjE3LjY5OCAwIDEuMjQyLjM3IDEuNDAzLjkzN2gyLjM4OEMxNS43MiA5LjE0IDE0LjE3MyA4IDEyLjEgOCA5LjU1MiA4IDggOS40NTcgOCAxMS45OTIgOCAxNC41NiA5LjU1MiAxNiAxMi4xNzUgMTZjMi40IDAgMy44MjUtMS4zMDcgMy44MjUtMy40MjR6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLWdvbGQiLz4KPC9zdmc+");}.video > div.extreme:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjYWQ2YmNlIiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtZXh0cmVtZSIgZD0iTTE0IDE2SDlWOGg1djEuNzM1aC0yLjcyNXYxLjI1OGgyLjUyM3YxLjczNWgtMi41MjN2MS41MUgxNHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLWV4dHJlbWUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMSkiIGZpbGwtb3BhY2l0eT0iLjIiLz4NCgk8dXNlIGZpbGw9IiNmZmYiIHhsaW5rOmhyZWY9IiNiYWRnZS1leHRyZW1lIi8+DQo8L3N2Zz4=");}.video > div.pro:after{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQoJPGNpcmNsZSBmaWxsPSIjMzhjZDU3IiBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiLz4NCgk8cGF0aCBpZD0iYmFkZ2UtcHJvIiBkPSJNMTUgMTAuNTQ0YzAgLjg5NC0uMjcyIDEuNTg1LS44MTcgMi4wNzItLjU0NS40ODctMS4zMi43My0yLjMyMi43M2gtLjYyNlYxNkg5VjhoMi44NmMxLjA0NiAwIDEuODMuMjIgMi4zNTQuNjYyLjUyNC40NDIuNzg2IDEuMDcuNzg2IDEuODgyem0tMy43NjYgMS4wNGguNDA3Yy4zMzYgMCAuNjAzLS4wOS44LS4yNzMuMi0uMTgyLjI5OC0uNDM0LjI5OC0uNzU1IDAtLjU0LS4zMS0uODEtLjkyNy0uODFoLS41NzZ2MS44NHoiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KCTx1c2UgZmlsbD0iIzAwMCIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxKSIgZmlsbC1vcGFjaXR5PSIuMiIvPg0KCTx1c2UgZmlsbD0iI2ZmZiIgeGxpbms6aHJlZj0iI2JhZGdlLXBybyIvPg0KPC9zdmc+");}#videos-content > #videos > .video:hover > div:after{top:-24px;right:-24px;transition:.2s ease .2s;}#videos-footer{display:flex;flex-direction:row;align-items:stretch;height:70px;min-height:70px;width:100%;bottom:0;left:0;padding:0 30px 20px;box-sizing:border-box;font-size:0;}#videos-footer-youtube,
#videos-footer-soundcloud{height:100%;width:72px;min-width:72px;margin-right:10px;border-radius:11px;text-align:center;line-height:50px;cursor:pointer;overflow:hidden;transition:.2s;}#videos-footer-youtube.hidden,
#videos-footer-soundcloud.hidden{width:0;min-width:0;margin-right:0;}#videos-footer-youtube{background-color:#e62d27;}#videos-footer-youtube:hover{background-color:#fd4039;}#videos-footer-youtube:active{background-color:#cf2721;}#videos-footer-soundcloud{background-color:#ff5500;}#videos-footer-soundcloud:hover{background-color:#ff6b20;}#videos-footer-soundcloud:active{background-color:#e04a00;}#videos-footer-youtube > svg,
#videos-footer-soundcloud > svg{vertical-align:middle;}#videos-footer-broadcast-wrapper{position:relative;display:flex;flex-direction:row;align-items:stretch;width:100%;}#videos-footer-broadcast{position:relative;display:block;height:50px;width:100%;padding-left:64px;border-radius:11px 0 0 11px;box-sizing:border-box;background-color:#38cd57;font-size:16px;font-weight:700;color:#fff;text-align:center;line-height:50px;cursor:pointer;transition:.2s;}#videos-footer-broadcast:hover{background-color:#13a832;}#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast{padding:0;border-radius:11px;}#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-submenu-button,
#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-submenu{display:none;}#videos-footer-broadcast-wrapper > .video{position:absolute;display:none;width:63px;top:0;left:0;}#videos-footer-broadcast-wrapper.moderation > .video{display:block;}#videos-footer-broadcast-wrapper.moderation > #videos-footer-broadcast{padding-left:64px;}#videos-footer-broadcast-wrapper > .video:after{border-color:#2d373a;}#videos-footer-broadcast-wrapper > .waiting{position:absolute;top:0;bottom:0;left:0;right:0;border-radius:11px;background-color:#38cd57;opacity:0;visibility:hidden;transition:.2s;}#videos-footer-broadcast-wrapper.show-ptt > .waiting{right:138px;}#videos-footer-broadcast-wrapper.active > .waiting{background-color:#2d373a;}#videos-footer-broadcast-wrapper.wait > .waiting{opacity:1;visibility:visible;}#videos-footer-broadcast-wrapper > .waiting > .waiting-content > span{border-color:#fff;}#videos-footer-broadcast-wrapper.wait > .waiting > .waiting-content > span{animation-play-state:running;-webkit-animation-play-state:running;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button{position:relative;display:block;height:100%;width:64px;min-width:64px;border-radius:0 11px 11px 0;box-sizing:border-box;background-color:#38cd57;cursor:pointer;transition:.2s;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:before{content:'';position:absolute;display:block;height:0;width:0;top:22px;right:27px;border-width:0 5px 6px;border-style:solid;border-color:#fff transparent;opacity:1;visibility:visible;transition:.2s;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:hover,
#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:focus{background-color:#13a832;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:focus:before{opacity:0;visibility:hidden;}#videos-footer-broadcast-wrapper.active > #videos-footer-broadcast,
#videos-footer-broadcast-wrapper.active > #videos-footer-submenu-button,
#videos-footer-broadcast-wrapper.active > #videos-footer-submenu-button:focus{background-color:#2d373a;}#videos-footer-push-to-talk{height:100%;width:0;min-width:0;margin-left:0;border-radius:11px;line-height:50px;text-align:center;background-color:#38cd57;cursor:pointer;opacity:0;overflow:hidden;transition:.2s;}#videos-footer-push-to-talk:hover{background-color:#13a832;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-push-to-talk{width:128px;min-width:128px;margin-left:10px;opacity:1;overflow:visible;}#videos-footer-broadcast-wrapper.active-ptt > #videos-footer-push-to-talk{background-color:#2d373a;}#videos-footer-push-to-talk > svg{vertical-align:middle;pointer-events:none;}#videos-footer-submenu{position:absolute;width:250px;bottom:29px;right:16px;padding:7px;border-radius:4px;background-color:#fff;font-size:14px;color:#000;box-shadow:0 1px 4px 0 rgba(0, 0, 0, .09);opacity:0;visibility:hidden;z-index:2;transition:.2s;}#videos-footer-submenu:before,
#videos-footer-submenu:after{content:'';position:absolute;display:block;height:0;width:0;right:9px;bottom:-8px;border-width:7px 7px 0 7px;border-style:solid;border-color:rgba(0, 0, 0, .06) transparent;}#videos-footer-submenu:after{bottom:-7px;border-color:#fff transparent;}#videos-footer-submenu-button:focus + #videos-footer-submenu{opacity:1;visibility:visible;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-submenu{right:154px;}#videos-footer-submenu > *{position:relative;display:block;height:40px;padding:0 15px;border-radius:4px;box-sizing:border-box;font-size:13px;color:#000;line-height:40px;cursor:pointer;text-align:center;transition:.2s;}#videos-footer-submenu > div{padding:0;height:auto;}#videos-footer-submenu > span:hover{background-color:#04caff;color:#fff;}#videos-footer-submenu > span + span{margin-top:5px;}#submenu-icons{display:none;flex-direction:row;align-items:stretch;}#submenu-icons > div{width:100%;margin-top:5px;border-radius:4px;transition:.2s;}#submenu-icons > div:not(.hidden) + div{margin-left:10px;}#submenu-icons > div.submenu-icon > svg{line-height:40px;vertical-align:middle;}#submenu-icons > div.submenu-icon > svg > path{transition:.2s;}#submenu-icons > div.submenu-icon:hover > svg > path{fill:#fff;}#submenu-icons > div.submenu-icon.soundcloud:hover{background-color:#f50;}#submenu-icons > div.submenu-icon.youtube:hover{background-color:#cc181e;}#submenu-icons > div.submenu-icon.soundcloud.hidden,
#submenu-icons > div.submenu-icon.youtube.hidden{display:none;}@keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@-webkit-keyframes waiting{0%{left:0;opacity:0;}50%{opacity:1;}100%{left:100%;opacity:0;}}@media screen and (max-width: 600px){:host,
#videolist{min-height:285px;}#videos-header{position:absolute;height:50px;width:50%;top:auto;bottom:0;padding:0 2px 10px 15px;box-sizing:border-box;}#videos-header > span{background-color:#f6f6f6;line-height:40px;}#videos-footer-broadcast,
#videos-header > span:first-child{border-radius:8px 0 0 8px;}#videos-footer-submenu-button,
#videos-header > span:last-child{border-radius:0 8px 8px 0;}#videos-footer{position:relative;height:50px;min-height:50px;width:50%;left:50%;padding:0 15px 10px 2px;}#videolist.hide-header > #videos-footer{width:100%;left:0;padding:0 15px 10px;}#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast,
#videos-footer-broadcast-wrapper > .waiting,
#videos-footer-push-to-talk,
#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast{border-radius:8px;}#videos-footer-broadcast-wrapper.moderation > #videos-footer-broadcast{padding-left:65px;}#videos-footer-broadcast-wrapper > .video{width:50px;padding:3px;}#videos-footer-broadcast-wrapper > .video:after{border-width:3px;border-radius:8px;}#videos-footer-broadcast,
#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast{height:40px;padding-left:14px;line-height:40px;text-align:left;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}#videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast{padding-right:14px;}#videos-footer-youtube,
#videos-footer-soundcloud{display:none;}#submenu-icons{display:flex;}#videos{top:12px;right:13px;bottom:12px;left:13px;}.video{padding:2px;}.video:after{border-width:2px;border-radius:4px;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button{width:48px;min-width:48px;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button:before{top:17px;right:18px;}#videos-footer-broadcast-wrapper.show-ptt > .waiting{right:58px;}#videos-footer-submenu{right:8px;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-submenu{right:66px;}#videos-footer-push-to-talk{line-height:40px;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-push-to-talk{width:48px;min-width:48px;}#videos-footer-push-to-talk > svg{height:30px;}}#videolist.full-screen,
#videolist.full-screen > #videos-header,
#videolist.full-screen .videos-header-volume:before{background-color:#101314;}#videolist.full-screen #videos-header-sound > svg.muted > path:nth-child(2){fill:#101314;}#videolist.full-screen #videos-header-fullscreen > svg{display:none;}#videolist.full-screen #videos-header-fullscreen > svg + svg{display:inline-block;}#videolist.full-screen .video:after{border-color:#101314;}#videolist.full-screen .videos-header-volume{border-color:#202628;}#videolist.full-screen #videos-footer-submenu{background-color:#202628;}#videolist.full-screen #videos-footer-submenu:after{border-color:#202628 transparent;}#videolist.full-screen #videos-footer-submenu > span{color:#fff;}</style></template></dom-module>
<dom-module id="tinychat-videolist" assetpath="../ui/"><template strip-whitespace=""><style include="client-videolist"></style><div id="videolist"><div id="lurker"><svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><circle cx="9" cy="9" r="9" fill="#fff" fill-rule="evenodd"></circle><path d="M8 4h2v7H8zM8 12h2v2H8z"
@rinath
Copy link

rinath commented Oct 8, 2022

is that omegle like chatroom for multiple people? whats the website?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment