if (typeof PingVpConfig == 'undefined') { 
var PingVpTracker=null,PingVpProtocol=("https:"==document.location.protocol?"https:":"http:"),PingVpConfig={"videoScriptsUri":"https:\/\/www.pingvp.com\/p\/","postersUri":"https:\/\/www.pingvp.com\/public\/posters\/","videosUri":"https:\/\/elsevier.pingvp.com\/","playerUri":"https:\/\/www.pingvp.com\/public\/webplayers\/4-1r0\/","imagesUri":"https:\/\/www.pingvp.com\/public\/playerimages\/","eventLogUri":"https:\/\/www.pingvp.com\/a.php","uaList":[{"weight":1,"regex":"iPhone","player":2},{"weight":2,"regex":"MSIE 6","player":1},{"weight":2,"regex":"MSIE 7","player":1},{"weight":2,"regex":"MSIE 8","player":1},{"weight":2,"regex":"MSIE 9","player":1},{"weight":3,"regex":"","player":2}],"brandingLogoSrc":"","brandingEndcardBg16x9":"","brandingEndcardBg1x1":"","brandingEndcardBg9x16":"","brandingEndcardColor":"","brandingEndcardFontSize":"","brandingEndcardBtnColor":"","brandingEndcardBtnBgColor":"","brandingEndcardBtnFontSize":"","brandingEndcardBtnHoverColor":"","brandingEndcardBtnHoverBgColor":"","brandingEndcardFont":""};
/*!
 *
 * __________.__             ____   ______________
 * \______   \__| ____    ___\   \ /   /\______   \
 *  |     ___/  |/    \  / ___\   Y   /  |     ___/
 *  |    |   |  |   |  \/ /_/  >     /   |    |
 *  |____|   |__|___|  /\___  / \___/    |____|
 *                   \//_____/
 *
 * PingVP Player http://www.pingvp.com/
 * Copyright (c) 2013-2022 PingVP. All rights reserved.
 *
 */
// ***
if (typeof $ != "undefined") {
    var jQuery = $;
}
if (typeof jQuery == "undefined") {
    /*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
    !(function (e, t) {
        "use strict";
        "object" == typeof module && "object" == typeof module.exports
            ? (module.exports = e.document
                  ? t(e, !0)
                  : function (e) {
                        if (!e.document) throw new Error("jQuery requires a window with a document");
                        return t(e);
                    })
            : t(e);
    })("undefined" != typeof window ? window : this, function (C, e) {
        "use strict";
        var t = [],
            r = Object.getPrototypeOf,
            s = t.slice,
            g = t.flat
                ? function (e) {
                      return t.flat.call(e);
                  }
                : function (e) {
                      return t.concat.apply([], e);
                  },
            u = t.push,
            i = t.indexOf,
            n = {},
            o = n.toString,
            v = n.hasOwnProperty,
            a = v.toString,
            l = a.call(Object),
            y = {},
            m = function (e) {
                return "function" == typeof e && "number" != typeof e.nodeType && "function" != typeof e.item;
            },
            x = function (e) {
                return null != e && e === e.window;
            },
            E = C.document,
            c = { type: !0, src: !0, nonce: !0, noModule: !0 };
        function b(e, t, n) {
            var r,
                i,
                o = (n = n || E).createElement("script");
            if (((o.text = e), t)) for (r in c) (i = t[r] || (t.getAttribute && t.getAttribute(r))) && o.setAttribute(r, i);
            n.head.appendChild(o).parentNode.removeChild(o);
        }
        function w(e) {
            return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? n[o.call(e)] || "object" : typeof e;
        }
        var f = "3.6.0",
            S = function (e, t) {
                return new S.fn.init(e, t);
            };
        function p(e) {
            var t = !!e && "length" in e && e.length,
                n = w(e);
            return !m(e) && !x(e) && ("array" === n || 0 === t || ("number" == typeof t && 0 < t && t - 1 in e));
        }
        (S.fn = S.prototype = {
            jquery: f,
            constructor: S,
            length: 0,
            toArray: function () {
                return s.call(this);
            },
            get: function (e) {
                return null == e ? s.call(this) : e < 0 ? this[e + this.length] : this[e];
            },
            pushStack: function (e) {
                var t = S.merge(this.constructor(), e);
                return (t.prevObject = this), t;
            },
            each: function (e) {
                return S.each(this, e);
            },
            map: function (n) {
                return this.pushStack(
                    S.map(this, function (e, t) {
                        return n.call(e, t, e);
                    })
                );
            },
            slice: function () {
                return this.pushStack(s.apply(this, arguments));
            },
            first: function () {
                return this.eq(0);
            },
            last: function () {
                return this.eq(-1);
            },
            even: function () {
                return this.pushStack(
                    S.grep(this, function (e, t) {
                        return (t + 1) % 2;
                    })
                );
            },
            odd: function () {
                return this.pushStack(
                    S.grep(this, function (e, t) {
                        return t % 2;
                    })
                );
            },
            eq: function (e) {
                var t = this.length,
                    n = +e + (e < 0 ? t : 0);
                return this.pushStack(0 <= n && n < t ? [this[n]] : []);
            },
            end: function () {
                return this.prevObject || this.constructor();
            },
            push: u,
            sort: t.sort,
            splice: t.splice,
        }),
            (S.extend = S.fn.extend = function () {
                var e,
                    t,
                    n,
                    r,
                    i,
                    o,
                    a = arguments[0] || {},
                    s = 1,
                    u = arguments.length,
                    l = !1;
                for ("boolean" == typeof a && ((l = a), (a = arguments[s] || {}), s++), "object" == typeof a || m(a) || (a = {}), s === u && ((a = this), s--); s < u; s++)
                    if (null != (e = arguments[s]))
                        for (t in e)
                            (r = e[t]),
                                "__proto__" !== t &&
                                    a !== r &&
                                    (l && r && (S.isPlainObject(r) || (i = Array.isArray(r)))
                                        ? ((n = a[t]), (o = i && !Array.isArray(n) ? [] : i || S.isPlainObject(n) ? n : {}), (i = !1), (a[t] = S.extend(l, o, r)))
                                        : void 0 !== r && (a[t] = r));
                return a;
            }),
            S.extend({
                expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""),
                isReady: !0,
                error: function (e) {
                    throw new Error(e);
                },
                noop: function () {},
                isPlainObject: function (e) {
                    var t, n;
                    return !(!e || "[object Object]" !== o.call(e)) && (!(t = r(e)) || ("function" == typeof (n = v.call(t, "constructor") && t.constructor) && a.call(n) === l));
                },
                isEmptyObject: function (e) {
                    var t;
                    for (t in e) return !1;
                    return !0;
                },
                globalEval: function (e, t, n) {
                    b(e, { nonce: t && t.nonce }, n);
                },
                each: function (e, t) {
                    var n,
                        r = 0;
                    if (p(e)) {
                        for (n = e.length; r < n; r++) if (!1 === t.call(e[r], r, e[r])) break;
                    } else for (r in e) if (!1 === t.call(e[r], r, e[r])) break;
                    return e;
                },
                makeArray: function (e, t) {
                    var n = t || [];
                    return null != e && (p(Object(e)) ? S.merge(n, "string" == typeof e ? [e] : e) : u.call(n, e)), n;
                },
                inArray: function (e, t, n) {
                    return null == t ? -1 : i.call(t, e, n);
                },
                merge: function (e, t) {
                    for (var n = +t.length, r = 0, i = e.length; r < n; r++) e[i++] = t[r];
                    return (e.length = i), e;
                },
                grep: function (e, t, n) {
                    for (var r = [], i = 0, o = e.length, a = !n; i < o; i++) !t(e[i], i) !== a && r.push(e[i]);
                    return r;
                },
                map: function (e, t, n) {
                    var r,
                        i,
                        o = 0,
                        a = [];
                    if (p(e)) for (r = e.length; o < r; o++) null != (i = t(e[o], o, n)) && a.push(i);
                    else for (o in e) null != (i = t(e[o], o, n)) && a.push(i);
                    return g(a);
                },
                guid: 1,
                support: y,
            }),
            "function" == typeof Symbol && (S.fn[Symbol.iterator] = t[Symbol.iterator]),
            S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (e, t) {
                n["[object " + t + "]"] = t.toLowerCase();
            });
        var d = (function (n) {
            var e,
                d,
                b,
                o,
                i,
                h,
                f,
                g,
                w,
                u,
                l,
                T,
                C,
                a,
                E,
                v,
                s,
                c,
                y,
                S = "sizzle" + 1 * new Date(),
                p = n.document,
                k = 0,
                r = 0,
                m = ue(),
                x = ue(),
                A = ue(),
                N = ue(),
                j = function (e, t) {
                    return e === t && (l = !0), 0;
                },
                D = {}.hasOwnProperty,
                t = [],
                q = t.pop,
                L = t.push,
                H = t.push,
                O = t.slice,
                P = function (e, t) {
                    for (var n = 0, r = e.length; n < r; n++) if (e[n] === t) return n;
                    return -1;
                },
                R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
                M = "[\\x20\\t\\r\\n\\f]",
                I = "(?:\\\\[\\da-fA-F]{1,6}" + M + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
                W = "\\[" + M + "*(" + I + ")(?:" + M + "*([*^$|!~]?=)" + M + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + I + "))|)" + M + "*\\]",
                F = ":(" + I + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + W + ")*)|.*)\\)|)",
                B = new RegExp(M + "+", "g"),
                $ = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"),
                _ = new RegExp("^" + M + "*," + M + "*"),
                z = new RegExp("^" + M + "*([>+~]|" + M + ")" + M + "*"),
                U = new RegExp(M + "|>"),
                X = new RegExp(F),
                V = new RegExp("^" + I + "$"),
                G = {
                    ID: new RegExp("^#(" + I + ")"),
                    CLASS: new RegExp("^\\.(" + I + ")"),
                    TAG: new RegExp("^(" + I + "|[*])"),
                    ATTR: new RegExp("^" + W),
                    PSEUDO: new RegExp("^" + F),
                    CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"),
                    bool: new RegExp("^(?:" + R + ")$", "i"),
                    needsContext: new RegExp("^" + M + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + M + "*((?:-\\d)?\\d*)" + M + "*\\)|)(?=[^-]|$)", "i"),
                },
                Y = /HTML$/i,
                Q = /^(?:input|select|textarea|button)$/i,
                J = /^h\d$/i,
                K = /^[^{]+\{\s*\[native \w/,
                Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
                ee = /[+~]/,
                te = new RegExp("\\\\[\\da-fA-F]{1,6}" + M + "?|\\\\([^\\r\\n\\f])", "g"),
                ne = function (e, t) {
                    var n = "0x" + e.slice(1) - 65536;
                    return t || (n < 0 ? String.fromCharCode(n + 65536) : String.fromCharCode((n >> 10) | 55296, (1023 & n) | 56320));
                },
                re = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
                ie = function (e, t) {
                    return t ? ("\0" === e ? "\ufffd" : e.slice(0, -1) + "\\" + e.charCodeAt(e.length - 1).toString(16) + " ") : "\\" + e;
                },
                oe = function () {
                    T();
                },
                ae = be(
                    function (e) {
                        return !0 === e.disabled && "fieldset" === e.nodeName.toLowerCase();
                    },
                    { dir: "parentNode", next: "legend" }
                );
            try {
                H.apply((t = O.call(p.childNodes)), p.childNodes), t[p.childNodes.length].nodeType;
            } catch (e) {
                H = {
                    apply: t.length
                        ? function (e, t) {
                              L.apply(e, O.call(t));
                          }
                        : function (e, t) {
                              var n = e.length,
                                  r = 0;
                              while ((e[n++] = t[r++]));
                              e.length = n - 1;
                          },
                };
            }
            function se(t, e, n, r) {
                var i,
                    o,
                    a,
                    s,
                    u,
                    l,
                    c,
                    f = e && e.ownerDocument,
                    p = e ? e.nodeType : 9;
                if (((n = n || []), "string" != typeof t || !t || (1 !== p && 9 !== p && 11 !== p))) return n;
                if (!r && (T(e), (e = e || C), E)) {
                    if (11 !== p && (u = Z.exec(t)))
                        if ((i = u[1])) {
                            if (9 === p) {
                                if (!(a = e.getElementById(i))) return n;
                                if (a.id === i) return n.push(a), n;
                            } else if (f && (a = f.getElementById(i)) && y(e, a) && a.id === i) return n.push(a), n;
                        } else {
                            if (u[2]) return H.apply(n, e.getElementsByTagName(t)), n;
                            if ((i = u[3]) && d.getElementsByClassName && e.getElementsByClassName) return H.apply(n, e.getElementsByClassName(i)), n;
                        }
                    if (d.qsa && !N[t + " "] && (!v || !v.test(t)) && (1 !== p || "object" !== e.nodeName.toLowerCase())) {
                        if (((c = t), (f = e), 1 === p && (U.test(t) || z.test(t)))) {
                            ((f = (ee.test(t) && ye(e.parentNode)) || e) === e && d.scope) || ((s = e.getAttribute("id")) ? (s = s.replace(re, ie)) : e.setAttribute("id", (s = S))), (o = (l = h(t)).length);
                            while (o--) l[o] = (s ? "#" + s : ":scope") + " " + xe(l[o]);
                            c = l.join(",");
                        }
                        try {
                            return H.apply(n, f.querySelectorAll(c)), n;
                        } catch (e) {
                            N(t, !0);
                        } finally {
                            s === S && e.removeAttribute("id");
                        }
                    }
                }
                return g(t.replace($, "$1"), e, n, r);
            }
            function ue() {
                var r = [];
                return function e(t, n) {
                    return r.push(t + " ") > b.cacheLength && delete e[r.shift()], (e[t + " "] = n);
                };
            }
            function le(e) {
                return (e[S] = !0), e;
            }
            function ce(e) {
                var t = C.createElement("fieldset");
                try {
                    return !!e(t);
                } catch (e) {
                    return !1;
                } finally {
                    t.parentNode && t.parentNode.removeChild(t), (t = null);
                }
            }
            function fe(e, t) {
                var n = e.split("|"),
                    r = n.length;
                while (r--) b.attrHandle[n[r]] = t;
            }
            function pe(e, t) {
                var n = t && e,
                    r = n && 1 === e.nodeType && 1 === t.nodeType && e.sourceIndex - t.sourceIndex;
                if (r) return r;
                if (n) while ((n = n.nextSibling)) if (n === t) return -1;
                return e ? 1 : -1;
            }
            function de(t) {
                return function (e) {
                    return "input" === e.nodeName.toLowerCase() && e.type === t;
                };
            }
            function he(n) {
                return function (e) {
                    var t = e.nodeName.toLowerCase();
                    return ("input" === t || "button" === t) && e.type === n;
                };
            }
            function ge(t) {
                return function (e) {
                    return "form" in e
                        ? e.parentNode && !1 === e.disabled
                            ? "label" in e
                                ? "label" in e.parentNode
                                    ? e.parentNode.disabled === t
                                    : e.disabled === t
                                : e.isDisabled === t || (e.isDisabled !== !t && ae(e) === t)
                            : e.disabled === t
                        : "label" in e && e.disabled === t;
                };
            }
            function ve(a) {
                return le(function (o) {
                    return (
                        (o = +o),
                        le(function (e, t) {
                            var n,
                                r = a([], e.length, o),
                                i = r.length;
                            while (i--) e[(n = r[i])] && (e[n] = !(t[n] = e[n]));
                        })
                    );
                });
            }
            function ye(e) {
                return e && "undefined" != typeof e.getElementsByTagName && e;
            }
            for (e in ((d = se.support = {}),
            (i = se.isXML = function (e) {
                var t = e && e.namespaceURI,
                    n = e && (e.ownerDocument || e).documentElement;
                return !Y.test(t || (n && n.nodeName) || "HTML");
            }),
            (T = se.setDocument = function (e) {
                var t,
                    n,
                    r = e ? e.ownerDocument || e : p;
                return (
                    r != C &&
                        9 === r.nodeType &&
                        r.documentElement &&
                        ((a = (C = r).documentElement),
                        (E = !i(C)),
                        p != C && (n = C.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", oe, !1) : n.attachEvent && n.attachEvent("onunload", oe)),
                        (d.scope = ce(function (e) {
                            return a.appendChild(e).appendChild(C.createElement("div")), "undefined" != typeof e.querySelectorAll && !e.querySelectorAll(":scope fieldset div").length;
                        })),
                        (d.attributes = ce(function (e) {
                            return (e.className = "i"), !e.getAttribute("className");
                        })),
                        (d.getElementsByTagName = ce(function (e) {
                            return e.appendChild(C.createComment("")), !e.getElementsByTagName("*").length;
                        })),
                        (d.getElementsByClassName = K.test(C.getElementsByClassName)),
                        (d.getById = ce(function (e) {
                            return (a.appendChild(e).id = S), !C.getElementsByName || !C.getElementsByName(S).length;
                        })),
                        d.getById
                            ? ((b.filter.ID = function (e) {
                                  var t = e.replace(te, ne);
                                  return function (e) {
                                      return e.getAttribute("id") === t;
                                  };
                              }),
                              (b.find.ID = function (e, t) {
                                  if ("undefined" != typeof t.getElementById && E) {
                                      var n = t.getElementById(e);
                                      return n ? [n] : [];
                                  }
                              }))
                            : ((b.filter.ID = function (e) {
                                  var n = e.replace(te, ne);
                                  return function (e) {
                                      var t = "undefined" != typeof e.getAttributeNode && e.getAttributeNode("id");
                                      return t && t.value === n;
                                  };
                              }),
                              (b.find.ID = function (e, t) {
                                  if ("undefined" != typeof t.getElementById && E) {
                                      var n,
                                          r,
                                          i,
                                          o = t.getElementById(e);
                                      if (o) {
                                          if ((n = o.getAttributeNode("id")) && n.value === e) return [o];
                                          (i = t.getElementsByName(e)), (r = 0);
                                          while ((o = i[r++])) if ((n = o.getAttributeNode("id")) && n.value === e) return [o];
                                      }
                                      return [];
                                  }
                              })),
                        (b.find.TAG = d.getElementsByTagName
                            ? function (e, t) {
                                  return "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName(e) : d.qsa ? t.querySelectorAll(e) : void 0;
                              }
                            : function (e, t) {
                                  var n,
                                      r = [],
                                      i = 0,
                                      o = t.getElementsByTagName(e);
                                  if ("*" === e) {
                                      while ((n = o[i++])) 1 === n.nodeType && r.push(n);
                                      return r;
                                  }
                                  return o;
                              }),
                        (b.find.CLASS =
                            d.getElementsByClassName &&
                            function (e, t) {
                                if ("undefined" != typeof t.getElementsByClassName && E) return t.getElementsByClassName(e);
                            }),
                        (s = []),
                        (v = []),
                        (d.qsa = K.test(C.querySelectorAll)) &&
                            (ce(function (e) {
                                var t;
                                (a.appendChild(e).innerHTML = "<a id='" + S + "'></a><select id='" + S + "-\r\\' msallowcapture=''><option selected=''></option></select>"),
                                    e.querySelectorAll("[msallowcapture^='']").length && v.push("[*^$]=" + M + "*(?:''|\"\")"),
                                    e.querySelectorAll("[selected]").length || v.push("\\[" + M + "*(?:value|" + R + ")"),
                                    e.querySelectorAll("[id~=" + S + "-]").length || v.push("~="),
                                    (t = C.createElement("input")).setAttribute("name", ""),
                                    e.appendChild(t),
                                    e.querySelectorAll("[name='']").length || v.push("\\[" + M + "*name" + M + "*=" + M + "*(?:''|\"\")"),
                                    e.querySelectorAll(":checked").length || v.push(":checked"),
                                    e.querySelectorAll("a#" + S + "+*").length || v.push(".#.+[+~]"),
                                    e.querySelectorAll("\\\f"),
                                    v.push("[\\r\\n\\f]");
                            }),
                            ce(function (e) {
                                e.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";
                                var t = C.createElement("input");
                                t.setAttribute("type", "hidden"),
                                    e.appendChild(t).setAttribute("name", "D"),
                                    e.querySelectorAll("[name=d]").length && v.push("name" + M + "*[*^$|!~]?="),
                                    2 !== e.querySelectorAll(":enabled").length && v.push(":enabled", ":disabled"),
                                    (a.appendChild(e).disabled = !0),
                                    2 !== e.querySelectorAll(":disabled").length && v.push(":enabled", ":disabled"),
                                    e.querySelectorAll("*,:x"),
                                    v.push(",.*:");
                            })),
                        (d.matchesSelector = K.test((c = a.matches || a.webkitMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.msMatchesSelector))) &&
                            ce(function (e) {
                                (d.disconnectedMatch = c.call(e, "*")), c.call(e, "[s!='']:x"), s.push("!=", F);
                            }),
                        (v = v.length && new RegExp(v.join("|"))),
                        (s = s.length && new RegExp(s.join("|"))),
                        (t = K.test(a.compareDocumentPosition)),
                        (y =
                            t || K.test(a.contains)
                                ? function (e, t) {
                                      var n = 9 === e.nodeType ? e.documentElement : e,
                                          r = t && t.parentNode;
                                      return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r)));
                                  }
                                : function (e, t) {
                                      if (t) while ((t = t.parentNode)) if (t === e) return !0;
                                      return !1;
                                  }),
                        (j = t
                            ? function (e, t) {
                                  if (e === t) return (l = !0), 0;
                                  var n = !e.compareDocumentPosition - !t.compareDocumentPosition;
                                  return (
                                      n ||
                                      (1 & (n = (e.ownerDocument || e) == (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || (!d.sortDetached && t.compareDocumentPosition(e) === n)
                                          ? e == C || (e.ownerDocument == p && y(p, e))
                                              ? -1
                                              : t == C || (t.ownerDocument == p && y(p, t))
                                              ? 1
                                              : u
                                              ? P(u, e) - P(u, t)
                                              : 0
                                          : 4 & n
                                          ? -1
                                          : 1)
                                  );
                              }
                            : function (e, t) {
                                  if (e === t) return (l = !0), 0;
                                  var n,
                                      r = 0,
                                      i = e.parentNode,
                                      o = t.parentNode,
                                      a = [e],
                                      s = [t];
                                  if (!i || !o) return e == C ? -1 : t == C ? 1 : i ? -1 : o ? 1 : u ? P(u, e) - P(u, t) : 0;
                                  if (i === o) return pe(e, t);
                                  n = e;
                                  while ((n = n.parentNode)) a.unshift(n);
                                  n = t;
                                  while ((n = n.parentNode)) s.unshift(n);
                                  while (a[r] === s[r]) r++;
                                  return r ? pe(a[r], s[r]) : a[r] == p ? -1 : s[r] == p ? 1 : 0;
                              })),
                    C
                );
            }),
            (se.matches = function (e, t) {
                return se(e, null, null, t);
            }),
            (se.matchesSelector = function (e, t) {
                if ((T(e), d.matchesSelector && E && !N[t + " "] && (!s || !s.test(t)) && (!v || !v.test(t))))
                    try {
                        var n = c.call(e, t);
                        if (n || d.disconnectedMatch || (e.document && 11 !== e.document.nodeType)) return n;
                    } catch (e) {
                        N(t, !0);
                    }
                return 0 < se(t, C, null, [e]).length;
            }),
            (se.contains = function (e, t) {
                return (e.ownerDocument || e) != C && T(e), y(e, t);
            }),
            (se.attr = function (e, t) {
                (e.ownerDocument || e) != C && T(e);
                var n = b.attrHandle[t.toLowerCase()],
                    r = n && D.call(b.attrHandle, t.toLowerCase()) ? n(e, t, !E) : void 0;
                return void 0 !== r ? r : d.attributes || !E ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null;
            }),
            (se.escape = function (e) {
                return (e + "").replace(re, ie);
            }),
            (se.error = function (e) {
                throw new Error("Syntax error, unrecognized expression: " + e);
            }),
            (se.uniqueSort = function (e) {
                var t,
                    n = [],
                    r = 0,
                    i = 0;
                if (((l = !d.detectDuplicates), (u = !d.sortStable && e.slice(0)), e.sort(j), l)) {
                    while ((t = e[i++])) t === e[i] && (r = n.push(i));
                    while (r--) e.splice(n[r], 1);
                }
                return (u = null), e;
            }),
            (o = se.getText = function (e) {
                var t,
                    n = "",
                    r = 0,
                    i = e.nodeType;
                if (i) {
                    if (1 === i || 9 === i || 11 === i) {
                        if ("string" == typeof e.textContent) return e.textContent;
                        for (e = e.firstChild; e; e = e.nextSibling) n += o(e);
                    } else if (3 === i || 4 === i) return e.nodeValue;
                } else while ((t = e[r++])) n += o(t);
                return n;
            }),
            ((b = se.selectors = {
                cacheLength: 50,
                createPseudo: le,
                match: G,
                attrHandle: {},
                find: {},
                relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } },
                preFilter: {
                    ATTR: function (e) {
                        return (e[1] = e[1].replace(te, ne)), (e[3] = (e[3] || e[4] || e[5] || "").replace(te, ne)), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4);
                    },
                    CHILD: function (e) {
                        return (
                            (e[1] = e[1].toLowerCase()),
                            "nth" === e[1].slice(0, 3) ? (e[3] || se.error(e[0]), (e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3]))), (e[5] = +(e[7] + e[8] || "odd" === e[3]))) : e[3] && se.error(e[0]),
                            e
                        );
                    },
                    PSEUDO: function (e) {
                        var t,
                            n = !e[6] && e[2];
                        return G.CHILD.test(e[0])
                            ? null
                            : (e[3] ? (e[2] = e[4] || e[5] || "") : n && X.test(n) && (t = h(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && ((e[0] = e[0].slice(0, t)), (e[2] = n.slice(0, t))), e.slice(0, 3));
                    },
                },
                filter: {
                    TAG: function (e) {
                        var t = e.replace(te, ne).toLowerCase();
                        return "*" === e
                            ? function () {
                                  return !0;
                              }
                            : function (e) {
                                  return e.nodeName && e.nodeName.toLowerCase() === t;
                              };
                    },
                    CLASS: function (e) {
                        var t = m[e + " "];
                        return (
                            t ||
                            ((t = new RegExp("(^|" + M + ")" + e + "(" + M + "|$)")) &&
                                m(e, function (e) {
                                    return t.test(("string" == typeof e.className && e.className) || ("undefined" != typeof e.getAttribute && e.getAttribute("class")) || "");
                                }))
                        );
                    },
                    ATTR: function (n, r, i) {
                        return function (e) {
                            var t = se.attr(e, n);
                            return null == t
                                ? "!=" === r
                                : !r ||
                                      ((t += ""),
                                      "=" === r
                                          ? t === i
                                          : "!=" === r
                                          ? t !== i
                                          : "^=" === r
                                          ? i && 0 === t.indexOf(i)
                                          : "*=" === r
                                          ? i && -1 < t.indexOf(i)
                                          : "$=" === r
                                          ? i && t.slice(-i.length) === i
                                          : "~=" === r
                                          ? -1 < (" " + t.replace(B, " ") + " ").indexOf(i)
                                          : "|=" === r && (t === i || t.slice(0, i.length + 1) === i + "-"));
                        };
                    },
                    CHILD: function (h, e, t, g, v) {
                        var y = "nth" !== h.slice(0, 3),
                            m = "last" !== h.slice(-4),
                            x = "of-type" === e;
                        return 1 === g && 0 === v
                            ? function (e) {
                                  return !!e.parentNode;
                              }
                            : function (e, t, n) {
                                  var r,
                                      i,
                                      o,
                                      a,
                                      s,
                                      u,
                                      l = y !== m ? "nextSibling" : "previousSibling",
                                      c = e.parentNode,
                                      f = x && e.nodeName.toLowerCase(),
                                      p = !n && !x,
                                      d = !1;
                                  if (c) {
                                      if (y) {
                                          while (l) {
                                              a = e;
                                              while ((a = a[l])) if (x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) return !1;
                                              u = l = "only" === h && !u && "nextSibling";
                                          }
                                          return !0;
                                      }
                                      if (((u = [m ? c.firstChild : c.lastChild]), m && p)) {
                                          (d = (s = (r = (i = (o = (a = c)[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === k && r[1]) && r[2]), (a = s && c.childNodes[s]);
                                          while ((a = (++s && a && a[l]) || (d = s = 0) || u.pop()))
                                              if (1 === a.nodeType && ++d && a === e) {
                                                  i[h] = [k, s, d];
                                                  break;
                                              }
                                      } else if ((p && (d = s = (r = (i = (o = (a = e)[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === k && r[1]), !1 === d))
                                          while ((a = (++s && a && a[l]) || (d = s = 0) || u.pop()))
                                              if ((x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) && ++d && (p && ((i = (o = a[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] = [k, d]), a === e)) break;
                                      return (d -= v) === g || (d % g == 0 && 0 <= d / g);
                                  }
                              };
                    },
                    PSEUDO: function (e, o) {
                        var t,
                            a = b.pseudos[e] || b.setFilters[e.toLowerCase()] || se.error("unsupported pseudo: " + e);
                        return a[S]
                            ? a(o)
                            : 1 < a.length
                            ? ((t = [e, e, "", o]),
                              b.setFilters.hasOwnProperty(e.toLowerCase())
                                  ? le(function (e, t) {
                                        var n,
                                            r = a(e, o),
                                            i = r.length;
                                        while (i--) e[(n = P(e, r[i]))] = !(t[n] = r[i]);
                                    })
                                  : function (e) {
                                        return a(e, 0, t);
                                    })
                            : a;
                    },
                },
                pseudos: {
                    not: le(function (e) {
                        var r = [],
                            i = [],
                            s = f(e.replace($, "$1"));
                        return s[S]
                            ? le(function (e, t, n, r) {
                                  var i,
                                      o = s(e, null, r, []),
                                      a = e.length;
                                  while (a--) (i = o[a]) && (e[a] = !(t[a] = i));
                              })
                            : function (e, t, n) {
                                  return (r[0] = e), s(r, null, n, i), (r[0] = null), !i.pop();
                              };
                    }),
                    has: le(function (t) {
                        return function (e) {
                            return 0 < se(t, e).length;
                        };
                    }),
                    contains: le(function (t) {
                        return (
                            (t = t.replace(te, ne)),
                            function (e) {
                                return -1 < (e.textContent || o(e)).indexOf(t);
                            }
                        );
                    }),
                    lang: le(function (n) {
                        return (
                            V.test(n || "") || se.error("unsupported lang: " + n),
                            (n = n.replace(te, ne).toLowerCase()),
                            function (e) {
                                var t;
                                do {
                                    if ((t = E ? e.lang : e.getAttribute("xml:lang") || e.getAttribute("lang"))) return (t = t.toLowerCase()) === n || 0 === t.indexOf(n + "-");
                                } while ((e = e.parentNode) && 1 === e.nodeType);
                                return !1;
                            }
                        );
                    }),
                    target: function (e) {
                        var t = n.location && n.location.hash;
                        return t && t.slice(1) === e.id;
                    },
                    root: function (e) {
                        return e === a;
                    },
                    focus: function (e) {
                        return e === C.activeElement && (!C.hasFocus || C.hasFocus()) && !!(e.type || e.href || ~e.tabIndex);
                    },
                    enabled: ge(!1),
                    disabled: ge(!0),
                    checked: function (e) {
                        var t = e.nodeName.toLowerCase();
                        return ("input" === t && !!e.checked) || ("option" === t && !!e.selected);
                    },
                    selected: function (e) {
                        return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected;
                    },
                    empty: function (e) {
                        for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeType < 6) return !1;
                        return !0;
                    },
                    parent: function (e) {
                        return !b.pseudos.empty(e);
                    },
                    header: function (e) {
                        return J.test(e.nodeName);
                    },
                    input: function (e) {
                        return Q.test(e.nodeName);
                    },
                    button: function (e) {
                        var t = e.nodeName.toLowerCase();
                        return ("input" === t && "button" === e.type) || "button" === t;
                    },
                    text: function (e) {
                        var t;
                        return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase());
                    },
                    first: ve(function () {
                        return [0];
                    }),
                    last: ve(function (e, t) {
                        return [t - 1];
                    }),
                    eq: ve(function (e, t, n) {
                        return [n < 0 ? n + t : n];
                    }),
                    even: ve(function (e, t) {
                        for (var n = 0; n < t; n += 2) e.push(n);
                        return e;
                    }),
                    odd: ve(function (e, t) {
                        for (var n = 1; n < t; n += 2) e.push(n);
                        return e;
                    }),
                    lt: ve(function (e, t, n) {
                        for (var r = n < 0 ? n + t : t < n ? t : n; 0 <= --r; ) e.push(r);
                        return e;
                    }),
                    gt: ve(function (e, t, n) {
                        for (var r = n < 0 ? n + t : n; ++r < t; ) e.push(r);
                        return e;
                    }),
                },
            }).pseudos.nth = b.pseudos.eq),
            { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }))
                b.pseudos[e] = de(e);
            for (e in { submit: !0, reset: !0 }) b.pseudos[e] = he(e);
            function me() {}
            function xe(e) {
                for (var t = 0, n = e.length, r = ""; t < n; t++) r += e[t].value;
                return r;
            }
            function be(s, e, t) {
                var u = e.dir,
                    l = e.next,
                    c = l || u,
                    f = t && "parentNode" === c,
                    p = r++;
                return e.first
                    ? function (e, t, n) {
                          while ((e = e[u])) if (1 === e.nodeType || f) return s(e, t, n);
                          return !1;
                      }
                    : function (e, t, n) {
                          var r,
                              i,
                              o,
                              a = [k, p];
                          if (n) {
                              while ((e = e[u])) if ((1 === e.nodeType || f) && s(e, t, n)) return !0;
                          } else
                              while ((e = e[u]))
                                  if (1 === e.nodeType || f)
                                      if (((i = (o = e[S] || (e[S] = {}))[e.uniqueID] || (o[e.uniqueID] = {})), l && l === e.nodeName.toLowerCase())) e = e[u] || e;
                                      else {
                                          if ((r = i[c]) && r[0] === k && r[1] === p) return (a[2] = r[2]);
                                          if (((i[c] = a)[2] = s(e, t, n))) return !0;
                                      }
                          return !1;
                      };
            }
            function we(i) {
                return 1 < i.length
                    ? function (e, t, n) {
                          var r = i.length;
                          while (r--) if (!i[r](e, t, n)) return !1;
                          return !0;
                      }
                    : i[0];
            }
            function Te(e, t, n, r, i) {
                for (var o, a = [], s = 0, u = e.length, l = null != t; s < u; s++) (o = e[s]) && ((n && !n(o, r, i)) || (a.push(o), l && t.push(s)));
                return a;
            }
            function Ce(d, h, g, v, y, e) {
                return (
                    v && !v[S] && (v = Ce(v)),
                    y && !y[S] && (y = Ce(y, e)),
                    le(function (e, t, n, r) {
                        var i,
                            o,
                            a,
                            s = [],
                            u = [],
                            l = t.length,
                            c =
                                e ||
                                (function (e, t, n) {
                                    for (var r = 0, i = t.length; r < i; r++) se(e, t[r], n);
                                    return n;
                                })(h || "*", n.nodeType ? [n] : n, []),
                            f = !d || (!e && h) ? c : Te(c, s, d, n, r),
                            p = g ? (y || (e ? d : l || v) ? [] : t) : f;
                        if ((g && g(f, p, n, r), v)) {
                            (i = Te(p, u)), v(i, [], n, r), (o = i.length);
                            while (o--) (a = i[o]) && (p[u[o]] = !(f[u[o]] = a));
                        }
                        if (e) {
                            if (y || d) {
                                if (y) {
                                    (i = []), (o = p.length);
                                    while (o--) (a = p[o]) && i.push((f[o] = a));
                                    y(null, (p = []), i, r);
                                }
                                o = p.length;
                                while (o--) (a = p[o]) && -1 < (i = y ? P(e, a) : s[o]) && (e[i] = !(t[i] = a));
                            }
                        } else (p = Te(p === t ? p.splice(l, p.length) : p)), y ? y(null, t, p, r) : H.apply(t, p);
                    })
                );
            }
            function Ee(e) {
                for (
                    var i,
                        t,
                        n,
                        r = e.length,
                        o = b.relative[e[0].type],
                        a = o || b.relative[" "],
                        s = o ? 1 : 0,
                        u = be(
                            function (e) {
                                return e === i;
                            },
                            a,
                            !0
                        ),
                        l = be(
                            function (e) {
                                return -1 < P(i, e);
                            },
                            a,
                            !0
                        ),
                        c = [
                            function (e, t, n) {
                                var r = (!o && (n || t !== w)) || ((i = t).nodeType ? u(e, t, n) : l(e, t, n));
                                return (i = null), r;
                            },
                        ];
                    s < r;
                    s++
                )
                    if ((t = b.relative[e[s].type])) c = [be(we(c), t)];
                    else {
                        if ((t = b.filter[e[s].type].apply(null, e[s].matches))[S]) {
                            for (n = ++s; n < r; n++) if (b.relative[e[n].type]) break;
                            return Ce(1 < s && we(c), 1 < s && xe(e.slice(0, s - 1).concat({ value: " " === e[s - 2].type ? "*" : "" })).replace($, "$1"), t, s < n && Ee(e.slice(s, n)), n < r && Ee((e = e.slice(n))), n < r && xe(e));
                        }
                        c.push(t);
                    }
                return we(c);
            }
            return (
                (me.prototype = b.filters = b.pseudos),
                (b.setFilters = new me()),
                (h = se.tokenize = function (e, t) {
                    var n,
                        r,
                        i,
                        o,
                        a,
                        s,
                        u,
                        l = x[e + " "];
                    if (l) return t ? 0 : l.slice(0);
                    (a = e), (s = []), (u = b.preFilter);
                    while (a) {
                        for (o in ((n && !(r = _.exec(a))) || (r && (a = a.slice(r[0].length) || a), s.push((i = []))),
                        (n = !1),
                        (r = z.exec(a)) && ((n = r.shift()), i.push({ value: n, type: r[0].replace($, " ") }), (a = a.slice(n.length))),
                        b.filter))
                            !(r = G[o].exec(a)) || (u[o] && !(r = u[o](r))) || ((n = r.shift()), i.push({ value: n, type: o, matches: r }), (a = a.slice(n.length)));
                        if (!n) break;
                    }
                    return t ? a.length : a ? se.error(e) : x(e, s).slice(0);
                }),
                (f = se.compile = function (e, t) {
                    var n,
                        v,
                        y,
                        m,
                        x,
                        r,
                        i = [],
                        o = [],
                        a = A[e + " "];
                    if (!a) {
                        t || (t = h(e)), (n = t.length);
                        while (n--) (a = Ee(t[n]))[S] ? i.push(a) : o.push(a);
                        (a = A(
                            e,
                            ((v = o),
                            (m = 0 < (y = i).length),
                            (x = 0 < v.length),
                            (r = function (e, t, n, r, i) {
                                var o,
                                    a,
                                    s,
                                    u = 0,
                                    l = "0",
                                    c = e && [],
                                    f = [],
                                    p = w,
                                    d = e || (x && b.find.TAG("*", i)),
                                    h = (k += null == p ? 1 : Math.random() || 0.1),
                                    g = d.length;
                                for (i && (w = t == C || t || i); l !== g && null != (o = d[l]); l++) {
                                    if (x && o) {
                                        (a = 0), t || o.ownerDocument == C || (T(o), (n = !E));
                                        while ((s = v[a++]))
                                            if (s(o, t || C, n)) {
                                                r.push(o);
                                                break;
                                            }
                                        i && (k = h);
                                    }
                                    m && ((o = !s && o) && u--, e && c.push(o));
                                }
                                if (((u += l), m && l !== u)) {
                                    a = 0;
                                    while ((s = y[a++])) s(c, f, t, n);
                                    if (e) {
                                        if (0 < u) while (l--) c[l] || f[l] || (f[l] = q.call(r));
                                        f = Te(f);
                                    }
                                    H.apply(r, f), i && !e && 0 < f.length && 1 < u + y.length && se.uniqueSort(r);
                                }
                                return i && ((k = h), (w = p)), c;
                            }),
                            m ? le(r) : r)
                        )).selector = e;
                    }
                    return a;
                }),
                (g = se.select = function (e, t, n, r) {
                    var i,
                        o,
                        a,
                        s,
                        u,
                        l = "function" == typeof e && e,
                        c = !r && h((e = l.selector || e));
                    if (((n = n || []), 1 === c.length)) {
                        if (2 < (o = c[0] = c[0].slice(0)).length && "ID" === (a = o[0]).type && 9 === t.nodeType && E && b.relative[o[1].type]) {
                            if (!(t = (b.find.ID(a.matches[0].replace(te, ne), t) || [])[0])) return n;
                            l && (t = t.parentNode), (e = e.slice(o.shift().value.length));
                        }
                        i = G.needsContext.test(e) ? 0 : o.length;
                        while (i--) {
                            if (((a = o[i]), b.relative[(s = a.type)])) break;
                            if ((u = b.find[s]) && (r = u(a.matches[0].replace(te, ne), (ee.test(o[0].type) && ye(t.parentNode)) || t))) {
                                if ((o.splice(i, 1), !(e = r.length && xe(o)))) return H.apply(n, r), n;
                                break;
                            }
                        }
                    }
                    return (l || f(e, c))(r, t, !E, n, !t || (ee.test(e) && ye(t.parentNode)) || t), n;
                }),
                (d.sortStable = S.split("").sort(j).join("") === S),
                (d.detectDuplicates = !!l),
                T(),
                (d.sortDetached = ce(function (e) {
                    return 1 & e.compareDocumentPosition(C.createElement("fieldset"));
                })),
                ce(function (e) {
                    return (e.innerHTML = "<a href='#'></a>"), "#" === e.firstChild.getAttribute("href");
                }) ||
                    fe("type|href|height|width", function (e, t, n) {
                        if (!n) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2);
                    }),
                (d.attributes &&
                    ce(function (e) {
                        return (e.innerHTML = "<input/>"), e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value");
                    })) ||
                    fe("value", function (e, t, n) {
                        if (!n && "input" === e.nodeName.toLowerCase()) return e.defaultValue;
                    }),
                ce(function (e) {
                    return null == e.getAttribute("disabled");
                }) ||
                    fe(R, function (e, t, n) {
                        var r;
                        if (!n) return !0 === e[t] ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null;
                    }),
                se
            );
        })(C);
        (S.find = d), (S.expr = d.selectors), (S.expr[":"] = S.expr.pseudos), (S.uniqueSort = S.unique = d.uniqueSort), (S.text = d.getText), (S.isXMLDoc = d.isXML), (S.contains = d.contains), (S.escapeSelector = d.escape);
        var h = function (e, t, n) {
                var r = [],
                    i = void 0 !== n;
                while ((e = e[t]) && 9 !== e.nodeType)
                    if (1 === e.nodeType) {
                        if (i && S(e).is(n)) break;
                        r.push(e);
                    }
                return r;
            },
            T = function (e, t) {
                for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
                return n;
            },
            k = S.expr.match.needsContext;
        function A(e, t) {
            return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase();
        }
        var N = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
        function j(e, n, r) {
            return m(n)
                ? S.grep(e, function (e, t) {
                      return !!n.call(e, t, e) !== r;
                  })
                : n.nodeType
                ? S.grep(e, function (e) {
                      return (e === n) !== r;
                  })
                : "string" != typeof n
                ? S.grep(e, function (e) {
                      return -1 < i.call(n, e) !== r;
                  })
                : S.filter(n, e, r);
        }
        (S.filter = function (e, t, n) {
            var r = t[0];
            return (
                n && (e = ":not(" + e + ")"),
                1 === t.length && 1 === r.nodeType
                    ? S.find.matchesSelector(r, e)
                        ? [r]
                        : []
                    : S.find.matches(
                          e,
                          S.grep(t, function (e) {
                              return 1 === e.nodeType;
                          })
                      )
            );
        }),
            S.fn.extend({
                find: function (e) {
                    var t,
                        n,
                        r = this.length,
                        i = this;
                    if ("string" != typeof e)
                        return this.pushStack(
                            S(e).filter(function () {
                                for (t = 0; t < r; t++) if (S.contains(i[t], this)) return !0;
                            })
                        );
                    for (n = this.pushStack([]), t = 0; t < r; t++) S.find(e, i[t], n);
                    return 1 < r ? S.uniqueSort(n) : n;
                },
                filter: function (e) {
                    return this.pushStack(j(this, e || [], !1));
                },
                not: function (e) {
                    return this.pushStack(j(this, e || [], !0));
                },
                is: function (e) {
                    return !!j(this, "string" == typeof e && k.test(e) ? S(e) : e || [], !1).length;
                },
            });
        var D,
            q = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;
        ((S.fn.init = function (e, t, n) {
            var r, i;
            if (!e) return this;
            if (((n = n || D), "string" == typeof e)) {
                if (!(r = "<" === e[0] && ">" === e[e.length - 1] && 3 <= e.length ? [null, e, null] : q.exec(e)) || (!r[1] && t)) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e);
                if (r[1]) {
                    if (((t = t instanceof S ? t[0] : t), S.merge(this, S.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : E, !0)), N.test(r[1]) && S.isPlainObject(t))) for (r in t) m(this[r]) ? this[r](t[r]) : this.attr(r, t[r]);
                    return this;
                }
                return (i = E.getElementById(r[2])) && ((this[0] = i), (this.length = 1)), this;
            }
            return e.nodeType ? ((this[0] = e), (this.length = 1), this) : m(e) ? (void 0 !== n.ready ? n.ready(e) : e(S)) : S.makeArray(e, this);
        }).prototype = S.fn),
            (D = S(E));
        var L = /^(?:parents|prev(?:Until|All))/,
            H = { children: !0, contents: !0, next: !0, prev: !0 };
        function O(e, t) {
            while ((e = e[t]) && 1 !== e.nodeType);
            return e;
        }
        S.fn.extend({
            has: function (e) {
                var t = S(e, this),
                    n = t.length;
                return this.filter(function () {
                    for (var e = 0; e < n; e++) if (S.contains(this, t[e])) return !0;
                });
            },
            closest: function (e, t) {
                var n,
                    r = 0,
                    i = this.length,
                    o = [],
                    a = "string" != typeof e && S(e);
                if (!k.test(e))
                    for (; r < i; r++)
                        for (n = this[r]; n && n !== t; n = n.parentNode)
                            if (n.nodeType < 11 && (a ? -1 < a.index(n) : 1 === n.nodeType && S.find.matchesSelector(n, e))) {
                                o.push(n);
                                break;
                            }
                return this.pushStack(1 < o.length ? S.uniqueSort(o) : o);
            },
            index: function (e) {
                return e ? ("string" == typeof e ? i.call(S(e), this[0]) : i.call(this, e.jquery ? e[0] : e)) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
            },
            add: function (e, t) {
                return this.pushStack(S.uniqueSort(S.merge(this.get(), S(e, t))));
            },
            addBack: function (e) {
                return this.add(null == e ? this.prevObject : this.prevObject.filter(e));
            },
        }),
            S.each(
                {
                    parent: function (e) {
                        var t = e.parentNode;
                        return t && 11 !== t.nodeType ? t : null;
                    },
                    parents: function (e) {
                        return h(e, "parentNode");
                    },
                    parentsUntil: function (e, t, n) {
                        return h(e, "parentNode", n);
                    },
                    next: function (e) {
                        return O(e, "nextSibling");
                    },
                    prev: function (e) {
                        return O(e, "previousSibling");
                    },
                    nextAll: function (e) {
                        return h(e, "nextSibling");
                    },
                    prevAll: function (e) {
                        return h(e, "previousSibling");
                    },
                    nextUntil: function (e, t, n) {
                        return h(e, "nextSibling", n);
                    },
                    prevUntil: function (e, t, n) {
                        return h(e, "previousSibling", n);
                    },
                    siblings: function (e) {
                        return T((e.parentNode || {}).firstChild, e);
                    },
                    children: function (e) {
                        return T(e.firstChild);
                    },
                    contents: function (e) {
                        return null != e.contentDocument && r(e.contentDocument) ? e.contentDocument : (A(e, "template") && (e = e.content || e), S.merge([], e.childNodes));
                    },
                },
                function (r, i) {
                    S.fn[r] = function (e, t) {
                        var n = S.map(this, i, e);
                        return "Until" !== r.slice(-5) && (t = e), t && "string" == typeof t && (n = S.filter(t, n)), 1 < this.length && (H[r] || S.uniqueSort(n), L.test(r) && n.reverse()), this.pushStack(n);
                    };
                }
            );
        var P = /[^\x20\t\r\n\f]+/g;
        function R(e) {
            return e;
        }
        function M(e) {
            throw e;
        }
        function I(e, t, n, r) {
            var i;
            try {
                e && m((i = e.promise)) ? i.call(e).done(t).fail(n) : e && m((i = e.then)) ? i.call(e, t, n) : t.apply(void 0, [e].slice(r));
            } catch (e) {
                n.apply(void 0, [e]);
            }
        }
        (S.Callbacks = function (r) {
            var e, n;
            r =
                "string" == typeof r
                    ? ((e = r),
                      (n = {}),
                      S.each(e.match(P) || [], function (e, t) {
                          n[t] = !0;
                      }),
                      n)
                    : S.extend({}, r);
            var i,
                t,
                o,
                a,
                s = [],
                u = [],
                l = -1,
                c = function () {
                    for (a = a || r.once, o = i = !0; u.length; l = -1) {
                        t = u.shift();
                        while (++l < s.length) !1 === s[l].apply(t[0], t[1]) && r.stopOnFalse && ((l = s.length), (t = !1));
                    }
                    r.memory || (t = !1), (i = !1), a && (s = t ? [] : "");
                },
                f = {
                    add: function () {
                        return (
                            s &&
                                (t && !i && ((l = s.length - 1), u.push(t)),
                                (function n(e) {
                                    S.each(e, function (e, t) {
                                        m(t) ? (r.unique && f.has(t)) || s.push(t) : t && t.length && "string" !== w(t) && n(t);
                                    });
                                })(arguments),
                                t && !i && c()),
                            this
                        );
                    },
                    remove: function () {
                        return (
                            S.each(arguments, function (e, t) {
                                var n;
                                while (-1 < (n = S.inArray(t, s, n))) s.splice(n, 1), n <= l && l--;
                            }),
                            this
                        );
                    },
                    has: function (e) {
                        return e ? -1 < S.inArray(e, s) : 0 < s.length;
                    },
                    empty: function () {
                        return s && (s = []), this;
                    },
                    disable: function () {
                        return (a = u = []), (s = t = ""), this;
                    },
                    disabled: function () {
                        return !s;
                    },
                    lock: function () {
                        return (a = u = []), t || i || (s = t = ""), this;
                    },
                    locked: function () {
                        return !!a;
                    },
                    fireWith: function (e, t) {
                        return a || ((t = [e, (t = t || []).slice ? t.slice() : t]), u.push(t), i || c()), this;
                    },
                    fire: function () {
                        return f.fireWith(this, arguments), this;
                    },
                    fired: function () {
                        return !!o;
                    },
                };
            return f;
        }),
            S.extend({
                Deferred: function (e) {
                    var o = [
                            ["notify", "progress", S.Callbacks("memory"), S.Callbacks("memory"), 2],
                            ["resolve", "done", S.Callbacks("once memory"), S.Callbacks("once memory"), 0, "resolved"],
                            ["reject", "fail", S.Callbacks("once memory"), S.Callbacks("once memory"), 1, "rejected"],
                        ],
                        i = "pending",
                        a = {
                            state: function () {
                                return i;
                            },
                            always: function () {
                                return s.done(arguments).fail(arguments), this;
                            },
                            catch: function (e) {
                                return a.then(null, e);
                            },
                            pipe: function () {
                                var i = arguments;
                                return S.Deferred(function (r) {
                                    S.each(o, function (e, t) {
                                        var n = m(i[t[4]]) && i[t[4]];
                                        s[t[1]](function () {
                                            var e = n && n.apply(this, arguments);
                                            e && m(e.promise) ? e.promise().progress(r.notify).done(r.resolve).fail(r.reject) : r[t[0] + "With"](this, n ? [e] : arguments);
                                        });
                                    }),
                                        (i = null);
                                }).promise();
                            },
                            then: function (t, n, r) {
                                var u = 0;
                                function l(i, o, a, s) {
                                    return function () {
                                        var n = this,
                                            r = arguments,
                                            e = function () {
                                                var e, t;
                                                if (!(i < u)) {
                                                    if ((e = a.apply(n, r)) === o.promise()) throw new TypeError("Thenable self-resolution");
                                                    (t = e && ("object" == typeof e || "function" == typeof e) && e.then),
                                                        m(t)
                                                            ? s
                                                                ? t.call(e, l(u, o, R, s), l(u, o, M, s))
                                                                : (u++, t.call(e, l(u, o, R, s), l(u, o, M, s), l(u, o, R, o.notifyWith)))
                                                            : (a !== R && ((n = void 0), (r = [e])), (s || o.resolveWith)(n, r));
                                                }
                                            },
                                            t = s
                                                ? e
                                                : function () {
                                                      try {
                                                          e();
                                                      } catch (e) {
                                                          S.Deferred.exceptionHook && S.Deferred.exceptionHook(e, t.stackTrace), u <= i + 1 && (a !== M && ((n = void 0), (r = [e])), o.rejectWith(n, r));
                                                      }
                                                  };
                                        i ? t() : (S.Deferred.getStackHook && (t.stackTrace = S.Deferred.getStackHook()), C.setTimeout(t));
                                    };
                                }
                                return S.Deferred(function (e) {
                                    o[0][3].add(l(0, e, m(r) ? r : R, e.notifyWith)), o[1][3].add(l(0, e, m(t) ? t : R)), o[2][3].add(l(0, e, m(n) ? n : M));
                                }).promise();
                            },
                            promise: function (e) {
                                return null != e ? S.extend(e, a) : a;
                            },
                        },
                        s = {};
                    return (
                        S.each(o, function (e, t) {
                            var n = t[2],
                                r = t[5];
                            (a[t[1]] = n.add),
                                r &&
                                    n.add(
                                        function () {
                                            i = r;
                                        },
                                        o[3 - e][2].disable,
                                        o[3 - e][3].disable,
                                        o[0][2].lock,
                                        o[0][3].lock
                                    ),
                                n.add(t[3].fire),
                                (s[t[0]] = function () {
                                    return s[t[0] + "With"](this === s ? void 0 : this, arguments), this;
                                }),
                                (s[t[0] + "With"] = n.fireWith);
                        }),
                        a.promise(s),
                        e && e.call(s, s),
                        s
                    );
                },
                when: function (e) {
                    var n = arguments.length,
                        t = n,
                        r = Array(t),
                        i = s.call(arguments),
                        o = S.Deferred(),
                        a = function (t) {
                            return function (e) {
                                (r[t] = this), (i[t] = 1 < arguments.length ? s.call(arguments) : e), --n || o.resolveWith(r, i);
                            };
                        };
                    if (n <= 1 && (I(e, o.done(a(t)).resolve, o.reject, !n), "pending" === o.state() || m(i[t] && i[t].then))) return o.then();
                    while (t--) I(i[t], a(t), o.reject);
                    return o.promise();
                },
            });
        var W = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
        (S.Deferred.exceptionHook = function (e, t) {
            C.console && C.console.warn && e && W.test(e.name) && C.console.warn("jQuery.Deferred exception: " + e.message, e.stack, t);
        }),
            (S.readyException = function (e) {
                C.setTimeout(function () {
                    throw e;
                });
            });
        var F = S.Deferred();
        function B() {
            E.removeEventListener("DOMContentLoaded", B), C.removeEventListener("load", B), S.ready();
        }
        (S.fn.ready = function (e) {
            return (
                F.then(e)["catch"](function (e) {
                    S.readyException(e);
                }),
                this
            );
        }),
            S.extend({
                isReady: !1,
                readyWait: 1,
                ready: function (e) {
                    (!0 === e ? --S.readyWait : S.isReady) || ((S.isReady = !0) !== e && 0 < --S.readyWait) || F.resolveWith(E, [S]);
                },
            }),
            (S.ready.then = F.then),
            "complete" === E.readyState || ("loading" !== E.readyState && !E.documentElement.doScroll) ? C.setTimeout(S.ready) : (E.addEventListener("DOMContentLoaded", B), C.addEventListener("load", B));
        var $ = function (e, t, n, r, i, o, a) {
                var s = 0,
                    u = e.length,
                    l = null == n;
                if ("object" === w(n)) for (s in ((i = !0), n)) $(e, t, s, n[s], !0, o, a);
                else if (
                    void 0 !== r &&
                    ((i = !0),
                    m(r) || (a = !0),
                    l &&
                        (a
                            ? (t.call(e, r), (t = null))
                            : ((l = t),
                              (t = function (e, t, n) {
                                  return l.call(S(e), n);
                              }))),
                    t)
                )
                    for (; s < u; s++) t(e[s], n, a ? r : r.call(e[s], s, t(e[s], n)));
                return i ? e : l ? t.call(e) : u ? t(e[0], n) : o;
            },
            _ = /^-ms-/,
            z = /-([a-z])/g;
        function U(e, t) {
            return t.toUpperCase();
        }
        function X(e) {
            return e.replace(_, "ms-").replace(z, U);
        }
        var V = function (e) {
            return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType;
        };
        function G() {
            this.expando = S.expando + G.uid++;
        }
        (G.uid = 1),
            (G.prototype = {
                cache: function (e) {
                    var t = e[this.expando];
                    return t || ((t = {}), V(e) && (e.nodeType ? (e[this.expando] = t) : Object.defineProperty(e, this.expando, { value: t, configurable: !0 }))), t;
                },
                set: function (e, t, n) {
                    var r,
                        i = this.cache(e);
                    if ("string" == typeof t) i[X(t)] = n;
                    else for (r in t) i[X(r)] = t[r];
                    return i;
                },
                get: function (e, t) {
                    return void 0 === t ? this.cache(e) : e[this.expando] && e[this.expando][X(t)];
                },
                access: function (e, t, n) {
                    return void 0 === t || (t && "string" == typeof t && void 0 === n) ? this.get(e, t) : (this.set(e, t, n), void 0 !== n ? n : t);
                },
                remove: function (e, t) {
                    var n,
                        r = e[this.expando];
                    if (void 0 !== r) {
                        if (void 0 !== t) {
                            n = (t = Array.isArray(t) ? t.map(X) : (t = X(t)) in r ? [t] : t.match(P) || []).length;
                            while (n--) delete r[t[n]];
                        }
                        (void 0 === t || S.isEmptyObject(r)) && (e.nodeType ? (e[this.expando] = void 0) : delete e[this.expando]);
                    }
                },
                hasData: function (e) {
                    var t = e[this.expando];
                    return void 0 !== t && !S.isEmptyObject(t);
                },
            });
        var Y = new G(),
            Q = new G(),
            J = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
            K = /[A-Z]/g;
        function Z(e, t, n) {
            var r, i;
            if (void 0 === n && 1 === e.nodeType)
                if (((r = "data-" + t.replace(K, "-$&").toLowerCase()), "string" == typeof (n = e.getAttribute(r)))) {
                    try {
                        n = "true" === (i = n) || ("false" !== i && ("null" === i ? null : i === +i + "" ? +i : J.test(i) ? JSON.parse(i) : i));
                    } catch (e) {}
                    Q.set(e, t, n);
                } else n = void 0;
            return n;
        }
        S.extend({
            hasData: function (e) {
                return Q.hasData(e) || Y.hasData(e);
            },
            data: function (e, t, n) {
                return Q.access(e, t, n);
            },
            removeData: function (e, t) {
                Q.remove(e, t);
            },
            _data: function (e, t, n) {
                return Y.access(e, t, n);
            },
            _removeData: function (e, t) {
                Y.remove(e, t);
            },
        }),
            S.fn.extend({
                data: function (n, e) {
                    var t,
                        r,
                        i,
                        o = this[0],
                        a = o && o.attributes;
                    if (void 0 === n) {
                        if (this.length && ((i = Q.get(o)), 1 === o.nodeType && !Y.get(o, "hasDataAttrs"))) {
                            t = a.length;
                            while (t--) a[t] && 0 === (r = a[t].name).indexOf("data-") && ((r = X(r.slice(5))), Z(o, r, i[r]));
                            Y.set(o, "hasDataAttrs", !0);
                        }
                        return i;
                    }
                    return "object" == typeof n
                        ? this.each(function () {
                              Q.set(this, n);
                          })
                        : $(
                              this,
                              function (e) {
                                  var t;
                                  if (o && void 0 === e) return void 0 !== (t = Q.get(o, n)) ? t : void 0 !== (t = Z(o, n)) ? t : void 0;
                                  this.each(function () {
                                      Q.set(this, n, e);
                                  });
                              },
                              null,
                              e,
                              1 < arguments.length,
                              null,
                              !0
                          );
                },
                removeData: function (e) {
                    return this.each(function () {
                        Q.remove(this, e);
                    });
                },
            }),
            S.extend({
                queue: function (e, t, n) {
                    var r;
                    if (e) return (t = (t || "fx") + "queue"), (r = Y.get(e, t)), n && (!r || Array.isArray(n) ? (r = Y.access(e, t, S.makeArray(n))) : r.push(n)), r || [];
                },
                dequeue: function (e, t) {
                    t = t || "fx";
                    var n = S.queue(e, t),
                        r = n.length,
                        i = n.shift(),
                        o = S._queueHooks(e, t);
                    "inprogress" === i && ((i = n.shift()), r--),
                        i &&
                            ("fx" === t && n.unshift("inprogress"),
                            delete o.stop,
                            i.call(
                                e,
                                function () {
                                    S.dequeue(e, t);
                                },
                                o
                            )),
                        !r && o && o.empty.fire();
                },
                _queueHooks: function (e, t) {
                    var n = t + "queueHooks";
                    return (
                        Y.get(e, n) ||
                        Y.access(e, n, {
                            empty: S.Callbacks("once memory").add(function () {
                                Y.remove(e, [t + "queue", n]);
                            }),
                        })
                    );
                },
            }),
            S.fn.extend({
                queue: function (t, n) {
                    var e = 2;
                    return (
                        "string" != typeof t && ((n = t), (t = "fx"), e--),
                        arguments.length < e
                            ? S.queue(this[0], t)
                            : void 0 === n
                            ? this
                            : this.each(function () {
                                  var e = S.queue(this, t, n);
                                  S._queueHooks(this, t), "fx" === t && "inprogress" !== e[0] && S.dequeue(this, t);
                              })
                    );
                },
                dequeue: function (e) {
                    return this.each(function () {
                        S.dequeue(this, e);
                    });
                },
                clearQueue: function (e) {
                    return this.queue(e || "fx", []);
                },
                promise: function (e, t) {
                    var n,
                        r = 1,
                        i = S.Deferred(),
                        o = this,
                        a = this.length,
                        s = function () {
                            --r || i.resolveWith(o, [o]);
                        };
                    "string" != typeof e && ((t = e), (e = void 0)), (e = e || "fx");
                    while (a--) (n = Y.get(o[a], e + "queueHooks")) && n.empty && (r++, n.empty.add(s));
                    return s(), i.promise(t);
                },
            });
        var ee = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
            te = new RegExp("^(?:([+-])=|)(" + ee + ")([a-z%]*)$", "i"),
            ne = ["Top", "Right", "Bottom", "Left"],
            re = E.documentElement,
            ie = function (e) {
                return S.contains(e.ownerDocument, e);
            },
            oe = { composed: !0 };
        re.getRootNode &&
            (ie = function (e) {
                return S.contains(e.ownerDocument, e) || e.getRootNode(oe) === e.ownerDocument;
            });
        var ae = function (e, t) {
            return "none" === (e = t || e).style.display || ("" === e.style.display && ie(e) && "none" === S.css(e, "display"));
        };
        function se(e, t, n, r) {
            var i,
                o,
                a = 20,
                s = r
                    ? function () {
                          return r.cur();
                      }
                    : function () {
                          return S.css(e, t, "");
                      },
                u = s(),
                l = (n && n[3]) || (S.cssNumber[t] ? "" : "px"),
                c = e.nodeType && (S.cssNumber[t] || ("px" !== l && +u)) && te.exec(S.css(e, t));
            if (c && c[3] !== l) {
                (u /= 2), (l = l || c[3]), (c = +u || 1);
                while (a--) S.style(e, t, c + l), (1 - o) * (1 - (o = s() / u || 0.5)) <= 0 && (a = 0), (c /= o);
                (c *= 2), S.style(e, t, c + l), (n = n || []);
            }
            return n && ((c = +c || +u || 0), (i = n[1] ? c + (n[1] + 1) * n[2] : +n[2]), r && ((r.unit = l), (r.start = c), (r.end = i))), i;
        }
        var ue = {};
        function le(e, t) {
            for (var n, r, i, o, a, s, u, l = [], c = 0, f = e.length; c < f; c++)
                (r = e[c]).style &&
                    ((n = r.style.display),
                    t
                        ? ("none" === n && ((l[c] = Y.get(r, "display") || null), l[c] || (r.style.display = "")),
                          "" === r.style.display &&
                              ae(r) &&
                              (l[c] =
                                  ((u = a = o = void 0),
                                  (a = (i = r).ownerDocument),
                                  (s = i.nodeName),
                                  (u = ue[s]) || ((o = a.body.appendChild(a.createElement(s))), (u = S.css(o, "display")), o.parentNode.removeChild(o), "none" === u && (u = "block"), (ue[s] = u)))))
                        : "none" !== n && ((l[c] = "none"), Y.set(r, "display", n)));
            for (c = 0; c < f; c++) null != l[c] && (e[c].style.display = l[c]);
            return e;
        }
        S.fn.extend({
            show: function () {
                return le(this, !0);
            },
            hide: function () {
                return le(this);
            },
            toggle: function (e) {
                return "boolean" == typeof e
                    ? e
                        ? this.show()
                        : this.hide()
                    : this.each(function () {
                          ae(this) ? S(this).show() : S(this).hide();
                      });
            },
        });
        var ce,
            fe,
            pe = /^(?:checkbox|radio)$/i,
            de = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i,
            he = /^$|^module$|\/(?:java|ecma)script/i;
        (ce = E.createDocumentFragment().appendChild(E.createElement("div"))),
            (fe = E.createElement("input")).setAttribute("type", "radio"),
            fe.setAttribute("checked", "checked"),
            fe.setAttribute("name", "t"),
            ce.appendChild(fe),
            (y.checkClone = ce.cloneNode(!0).cloneNode(!0).lastChild.checked),
            (ce.innerHTML = "<textarea>x</textarea>"),
            (y.noCloneChecked = !!ce.cloneNode(!0).lastChild.defaultValue),
            (ce.innerHTML = "<option></option>"),
            (y.option = !!ce.lastChild);
        var ge = { thead: [1, "<table>", "</table>"], col: [2, "<table><colgroup>", "</colgroup></table>"], tr: [2, "<table><tbody>", "</tbody></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: [0, "", ""] };
        function ve(e, t) {
            var n;
            return (n = "undefined" != typeof e.getElementsByTagName ? e.getElementsByTagName(t || "*") : "undefined" != typeof e.querySelectorAll ? e.querySelectorAll(t || "*") : []), void 0 === t || (t && A(e, t)) ? S.merge([e], n) : n;
        }
        function ye(e, t) {
            for (var n = 0, r = e.length; n < r; n++) Y.set(e[n], "globalEval", !t || Y.get(t[n], "globalEval"));
        }
        (ge.tbody = ge.tfoot = ge.colgroup = ge.caption = ge.thead), (ge.th = ge.td), y.option || (ge.optgroup = ge.option = [1, "<select multiple='multiple'>", "</select>"]);
        var me = /<|&#?\w+;/;
        function xe(e, t, n, r, i) {
            for (var o, a, s, u, l, c, f = t.createDocumentFragment(), p = [], d = 0, h = e.length; d < h; d++)
                if ((o = e[d]) || 0 === o)
                    if ("object" === w(o)) S.merge(p, o.nodeType ? [o] : o);
                    else if (me.test(o)) {
                        (a = a || f.appendChild(t.createElement("div"))), (s = (de.exec(o) || ["", ""])[1].toLowerCase()), (u = ge[s] || ge._default), (a.innerHTML = u[1] + S.htmlPrefilter(o) + u[2]), (c = u[0]);
                        while (c--) a = a.lastChild;
                        S.merge(p, a.childNodes), ((a = f.firstChild).textContent = "");
                    } else p.push(t.createTextNode(o));
            (f.textContent = ""), (d = 0);
            while ((o = p[d++]))
                if (r && -1 < S.inArray(o, r)) i && i.push(o);
                else if (((l = ie(o)), (a = ve(f.appendChild(o), "script")), l && ye(a), n)) {
                    c = 0;
                    while ((o = a[c++])) he.test(o.type || "") && n.push(o);
                }
            return f;
        }
        var be = /^([^.]*)(?:\.(.+)|)/;
        function we() {
            return !0;
        }
        function Te() {
            return !1;
        }
        function Ce(e, t) {
            return (
                (e ===
                    (function () {
                        try {
                            return E.activeElement;
                        } catch (e) {}
                    })()) ==
                ("focus" === t)
            );
        }
        function Ee(e, t, n, r, i, o) {
            var a, s;
            if ("object" == typeof t) {
                for (s in ("string" != typeof n && ((r = r || n), (n = void 0)), t)) Ee(e, s, n, r, t[s], o);
                return e;
            }
            if ((null == r && null == i ? ((i = n), (r = n = void 0)) : null == i && ("string" == typeof n ? ((i = r), (r = void 0)) : ((i = r), (r = n), (n = void 0))), !1 === i)) i = Te;
            else if (!i) return e;
            return (
                1 === o &&
                    ((a = i),
                    ((i = function (e) {
                        return S().off(e), a.apply(this, arguments);
                    }).guid = a.guid || (a.guid = S.guid++))),
                e.each(function () {
                    S.event.add(this, t, i, r, n);
                })
            );
        }
        function Se(e, i, o) {
            o
                ? (Y.set(e, i, !1),
                  S.event.add(e, i, {
                      namespace: !1,
                      handler: function (e) {
                          var t,
                              n,
                              r = Y.get(this, i);
                          if (1 & e.isTrigger && this[i]) {
                              if (r.length) (S.event.special[i] || {}).delegateType && e.stopPropagation();
                              else if (((r = s.call(arguments)), Y.set(this, i, r), (t = o(this, i)), this[i](), r !== (n = Y.get(this, i)) || t ? Y.set(this, i, !1) : (n = {}), r !== n))
                                  return e.stopImmediatePropagation(), e.preventDefault(), n && n.value;
                          } else r.length && (Y.set(this, i, { value: S.event.trigger(S.extend(r[0], S.Event.prototype), r.slice(1), this) }), e.stopImmediatePropagation());
                      },
                  }))
                : void 0 === Y.get(e, i) && S.event.add(e, i, we);
        }
        (S.event = {
            global: {},
            add: function (t, e, n, r, i) {
                var o,
                    a,
                    s,
                    u,
                    l,
                    c,
                    f,
                    p,
                    d,
                    h,
                    g,
                    v = Y.get(t);
                if (V(t)) {
                    n.handler && ((n = (o = n).handler), (i = o.selector)),
                        i && S.find.matchesSelector(re, i),
                        n.guid || (n.guid = S.guid++),
                        (u = v.events) || (u = v.events = Object.create(null)),
                        (a = v.handle) ||
                            (a = v.handle = function (e) {
                                return "undefined" != typeof S && S.event.triggered !== e.type ? S.event.dispatch.apply(t, arguments) : void 0;
                            }),
                        (l = (e = (e || "").match(P) || [""]).length);
                    while (l--)
                        (d = g = (s = be.exec(e[l]) || [])[1]),
                            (h = (s[2] || "").split(".").sort()),
                            d &&
                                ((f = S.event.special[d] || {}),
                                (d = (i ? f.delegateType : f.bindType) || d),
                                (f = S.event.special[d] || {}),
                                (c = S.extend({ type: d, origType: g, data: r, handler: n, guid: n.guid, selector: i, needsContext: i && S.expr.match.needsContext.test(i), namespace: h.join(".") }, o)),
                                (p = u[d]) || (((p = u[d] = []).delegateCount = 0), (f.setup && !1 !== f.setup.call(t, r, h, a)) || (t.addEventListener && t.addEventListener(d, a))),
                                f.add && (f.add.call(t, c), c.handler.guid || (c.handler.guid = n.guid)),
                                i ? p.splice(p.delegateCount++, 0, c) : p.push(c),
                                (S.event.global[d] = !0));
                }
            },
            remove: function (e, t, n, r, i) {
                var o,
                    a,
                    s,
                    u,
                    l,
                    c,
                    f,
                    p,
                    d,
                    h,
                    g,
                    v = Y.hasData(e) && Y.get(e);
                if (v && (u = v.events)) {
                    l = (t = (t || "").match(P) || [""]).length;
                    while (l--)
                        if (((d = g = (s = be.exec(t[l]) || [])[1]), (h = (s[2] || "").split(".").sort()), d)) {
                            (f = S.event.special[d] || {}), (p = u[(d = (r ? f.delegateType : f.bindType) || d)] || []), (s = s[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)")), (a = o = p.length);
                            while (o--)
                                (c = p[o]),
                                    (!i && g !== c.origType) ||
                                        (n && n.guid !== c.guid) ||
                                        (s && !s.test(c.namespace)) ||
                                        (r && r !== c.selector && ("**" !== r || !c.selector)) ||
                                        (p.splice(o, 1), c.selector && p.delegateCount--, f.remove && f.remove.call(e, c));
                            a && !p.length && ((f.teardown && !1 !== f.teardown.call(e, h, v.handle)) || S.removeEvent(e, d, v.handle), delete u[d]);
                        } else for (d in u) S.event.remove(e, d + t[l], n, r, !0);
                    S.isEmptyObject(u) && Y.remove(e, "handle events");
                }
            },
            dispatch: function (e) {
                var t,
                    n,
                    r,
                    i,
                    o,
                    a,
                    s = new Array(arguments.length),
                    u = S.event.fix(e),
                    l = (Y.get(this, "events") || Object.create(null))[u.type] || [],
                    c = S.event.special[u.type] || {};
                for (s[0] = u, t = 1; t < arguments.length; t++) s[t] = arguments[t];
                if (((u.delegateTarget = this), !c.preDispatch || !1 !== c.preDispatch.call(this, u))) {
                    (a = S.event.handlers.call(this, u, l)), (t = 0);
                    while ((i = a[t++]) && !u.isPropagationStopped()) {
                        (u.currentTarget = i.elem), (n = 0);
                        while ((o = i.handlers[n++]) && !u.isImmediatePropagationStopped())
                            (u.rnamespace && !1 !== o.namespace && !u.rnamespace.test(o.namespace)) ||
                                ((u.handleObj = o), (u.data = o.data), void 0 !== (r = ((S.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, s)) && !1 === (u.result = r) && (u.preventDefault(), u.stopPropagation()));
                    }
                    return c.postDispatch && c.postDispatch.call(this, u), u.result;
                }
            },
            handlers: function (e, t) {
                var n,
                    r,
                    i,
                    o,
                    a,
                    s = [],
                    u = t.delegateCount,
                    l = e.target;
                if (u && l.nodeType && !("click" === e.type && 1 <= e.button))
                    for (; l !== this; l = l.parentNode || this)
                        if (1 === l.nodeType && ("click" !== e.type || !0 !== l.disabled)) {
                            for (o = [], a = {}, n = 0; n < u; n++) void 0 === a[(i = (r = t[n]).selector + " ")] && (a[i] = r.needsContext ? -1 < S(i, this).index(l) : S.find(i, this, null, [l]).length), a[i] && o.push(r);
                            o.length && s.push({ elem: l, handlers: o });
                        }
                return (l = this), u < t.length && s.push({ elem: l, handlers: t.slice(u) }), s;
            },
            addProp: function (t, e) {
                Object.defineProperty(S.Event.prototype, t, {
                    enumerable: !0,
                    configurable: !0,
                    get: m(e)
                        ? function () {
                              if (this.originalEvent) return e(this.originalEvent);
                          }
                        : function () {
                              if (this.originalEvent) return this.originalEvent[t];
                          },
                    set: function (e) {
                        Object.defineProperty(this, t, { enumerable: !0, configurable: !0, writable: !0, value: e });
                    },
                });
            },
            fix: function (e) {
                return e[S.expando] ? e : new S.Event(e);
            },
            special: {
                load: { noBubble: !0 },
                click: {
                    setup: function (e) {
                        var t = this || e;
                        return pe.test(t.type) && t.click && A(t, "input") && Se(t, "click", we), !1;
                    },
                    trigger: function (e) {
                        var t = this || e;
                        return pe.test(t.type) && t.click && A(t, "input") && Se(t, "click"), !0;
                    },
                    _default: function (e) {
                        var t = e.target;
                        return (pe.test(t.type) && t.click && A(t, "input") && Y.get(t, "click")) || A(t, "a");
                    },
                },
                beforeunload: {
                    postDispatch: function (e) {
                        void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result);
                    },
                },
            },
        }),
            (S.removeEvent = function (e, t, n) {
                e.removeEventListener && e.removeEventListener(t, n);
            }),
            (S.Event = function (e, t) {
                if (!(this instanceof S.Event)) return new S.Event(e, t);
                e && e.type
                    ? ((this.originalEvent = e),
                      (this.type = e.type),
                      (this.isDefaultPrevented = e.defaultPrevented || (void 0 === e.defaultPrevented && !1 === e.returnValue) ? we : Te),
                      (this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target),
                      (this.currentTarget = e.currentTarget),
                      (this.relatedTarget = e.relatedTarget))
                    : (this.type = e),
                    t && S.extend(this, t),
                    (this.timeStamp = (e && e.timeStamp) || Date.now()),
                    (this[S.expando] = !0);
            }),
            (S.Event.prototype = {
                constructor: S.Event,
                isDefaultPrevented: Te,
                isPropagationStopped: Te,
                isImmediatePropagationStopped: Te,
                isSimulated: !1,
                preventDefault: function () {
                    var e = this.originalEvent;
                    (this.isDefaultPrevented = we), e && !this.isSimulated && e.preventDefault();
                },
                stopPropagation: function () {
                    var e = this.originalEvent;
                    (this.isPropagationStopped = we), e && !this.isSimulated && e.stopPropagation();
                },
                stopImmediatePropagation: function () {
                    var e = this.originalEvent;
                    (this.isImmediatePropagationStopped = we), e && !this.isSimulated && e.stopImmediatePropagation(), this.stopPropagation();
                },
            }),
            S.each(
                {
                    altKey: !0,
                    bubbles: !0,
                    cancelable: !0,
                    changedTouches: !0,
                    ctrlKey: !0,
                    detail: !0,
                    eventPhase: !0,
                    metaKey: !0,
                    pageX: !0,
                    pageY: !0,
                    shiftKey: !0,
                    view: !0,
                    char: !0,
                    code: !0,
                    charCode: !0,
                    key: !0,
                    keyCode: !0,
                    button: !0,
                    buttons: !0,
                    clientX: !0,
                    clientY: !0,
                    offsetX: !0,
                    offsetY: !0,
                    pointerId: !0,
                    pointerType: !0,
                    screenX: !0,
                    screenY: !0,
                    targetTouches: !0,
                    toElement: !0,
                    touches: !0,
                    which: !0,
                },
                S.event.addProp
            ),
            S.each({ focus: "focusin", blur: "focusout" }, function (e, t) {
                S.event.special[e] = {
                    setup: function () {
                        return Se(this, e, Ce), !1;
                    },
                    trigger: function () {
                        return Se(this, e), !0;
                    },
                    _default: function () {
                        return !0;
                    },
                    delegateType: t,
                };
            }),
            S.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function (e, i) {
                S.event.special[e] = {
                    delegateType: i,
                    bindType: i,
                    handle: function (e) {
                        var t,
                            n = e.relatedTarget,
                            r = e.handleObj;
                        return (n && (n === this || S.contains(this, n))) || ((e.type = r.origType), (t = r.handler.apply(this, arguments)), (e.type = i)), t;
                    },
                };
            }),
            S.fn.extend({
                on: function (e, t, n, r) {
                    return Ee(this, e, t, n, r);
                },
                one: function (e, t, n, r) {
                    return Ee(this, e, t, n, r, 1);
                },
                off: function (e, t, n) {
                    var r, i;
                    if (e && e.preventDefault && e.handleObj) return (r = e.handleObj), S(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this;
                    if ("object" == typeof e) {
                        for (i in e) this.off(i, t, e[i]);
                        return this;
                    }
                    return (
                        (!1 !== t && "function" != typeof t) || ((n = t), (t = void 0)),
                        !1 === n && (n = Te),
                        this.each(function () {
                            S.event.remove(this, e, n, t);
                        })
                    );
                },
            });
        var ke = /<script|<style|<link/i,
            Ae = /checked\s*(?:[^=]|=\s*.checked.)/i,
            Ne = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
        function je(e, t) {
            return (A(e, "table") && A(11 !== t.nodeType ? t : t.firstChild, "tr") && S(e).children("tbody")[0]) || e;
        }
        function De(e) {
            return (e.type = (null !== e.getAttribute("type")) + "/" + e.type), e;
        }
        function qe(e) {
            return "true/" === (e.type || "").slice(0, 5) ? (e.type = e.type.slice(5)) : e.removeAttribute("type"), e;
        }
        function Le(e, t) {
            var n, r, i, o, a, s;
            if (1 === t.nodeType) {
                if (Y.hasData(e) && (s = Y.get(e).events)) for (i in (Y.remove(t, "handle events"), s)) for (n = 0, r = s[i].length; n < r; n++) S.event.add(t, i, s[i][n]);
                Q.hasData(e) && ((o = Q.access(e)), (a = S.extend({}, o)), Q.set(t, a));
            }
        }
        function He(n, r, i, o) {
            r = g(r);
            var e,
                t,
                a,
                s,
                u,
                l,
                c = 0,
                f = n.length,
                p = f - 1,
                d = r[0],
                h = m(d);
            if (h || (1 < f && "string" == typeof d && !y.checkClone && Ae.test(d)))
                return n.each(function (e) {
                    var t = n.eq(e);
                    h && (r[0] = d.call(this, e, t.html())), He(t, r, i, o);
                });
            if (f && ((t = (e = xe(r, n[0].ownerDocument, !1, n, o)).firstChild), 1 === e.childNodes.length && (e = t), t || o)) {
                for (s = (a = S.map(ve(e, "script"), De)).length; c < f; c++) (u = e), c !== p && ((u = S.clone(u, !0, !0)), s && S.merge(a, ve(u, "script"))), i.call(n[c], u, c);
                if (s)
                    for (l = a[a.length - 1].ownerDocument, S.map(a, qe), c = 0; c < s; c++)
                        (u = a[c]),
                            he.test(u.type || "") &&
                                !Y.access(u, "globalEval") &&
                                S.contains(l, u) &&
                                (u.src && "module" !== (u.type || "").toLowerCase() ? S._evalUrl && !u.noModule && S._evalUrl(u.src, { nonce: u.nonce || u.getAttribute("nonce") }, l) : b(u.textContent.replace(Ne, ""), u, l));
            }
            return n;
        }
        function Oe(e, t, n) {
            for (var r, i = t ? S.filter(t, e) : e, o = 0; null != (r = i[o]); o++) n || 1 !== r.nodeType || S.cleanData(ve(r)), r.parentNode && (n && ie(r) && ye(ve(r, "script")), r.parentNode.removeChild(r));
            return e;
        }
        S.extend({
            htmlPrefilter: function (e) {
                return e;
            },
            clone: function (e, t, n) {
                var r,
                    i,
                    o,
                    a,
                    s,
                    u,
                    l,
                    c = e.cloneNode(!0),
                    f = ie(e);
                if (!(y.noCloneChecked || (1 !== e.nodeType && 11 !== e.nodeType) || S.isXMLDoc(e)))
                    for (a = ve(c), r = 0, i = (o = ve(e)).length; r < i; r++)
                        (s = o[r]), (u = a[r]), void 0, "input" === (l = u.nodeName.toLowerCase()) && pe.test(s.type) ? (u.checked = s.checked) : ("input" !== l && "textarea" !== l) || (u.defaultValue = s.defaultValue);
                if (t)
                    if (n) for (o = o || ve(e), a = a || ve(c), r = 0, i = o.length; r < i; r++) Le(o[r], a[r]);
                    else Le(e, c);
                return 0 < (a = ve(c, "script")).length && ye(a, !f && ve(e, "script")), c;
            },
            cleanData: function (e) {
                for (var t, n, r, i = S.event.special, o = 0; void 0 !== (n = e[o]); o++)
                    if (V(n)) {
                        if ((t = n[Y.expando])) {
                            if (t.events) for (r in t.events) i[r] ? S.event.remove(n, r) : S.removeEvent(n, r, t.handle);
                            n[Y.expando] = void 0;
                        }
                        n[Q.expando] && (n[Q.expando] = void 0);
                    }
            },
        }),
            S.fn.extend({
                detach: function (e) {
                    return Oe(this, e, !0);
                },
                remove: function (e) {
                    return Oe(this, e);
                },
                text: function (e) {
                    return $(
                        this,
                        function (e) {
                            return void 0 === e
                                ? S.text(this)
                                : this.empty().each(function () {
                                      (1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType) || (this.textContent = e);
                                  });
                        },
                        null,
                        e,
                        arguments.length
                    );
                },
                append: function () {
                    return He(this, arguments, function (e) {
                        (1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType) || je(this, e).appendChild(e);
                    });
                },
                prepend: function () {
                    return He(this, arguments, function (e) {
                        if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
                            var t = je(this, e);
                            t.insertBefore(e, t.firstChild);
                        }
                    });
                },
                before: function () {
                    return He(this, arguments, function (e) {
                        this.parentNode && this.parentNode.insertBefore(e, this);
                    });
                },
                after: function () {
                    return He(this, arguments, function (e) {
                        this.parentNode && this.parentNode.insertBefore(e, this.nextSibling);
                    });
                },
                empty: function () {
                    for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (S.cleanData(ve(e, !1)), (e.textContent = ""));
                    return this;
                },
                clone: function (e, t) {
                    return (
                        (e = null != e && e),
                        (t = null == t ? e : t),
                        this.map(function () {
                            return S.clone(this, e, t);
                        })
                    );
                },
                html: function (e) {
                    return $(
                        this,
                        function (e) {
                            var t = this[0] || {},
                                n = 0,
                                r = this.length;
                            if (void 0 === e && 1 === t.nodeType) return t.innerHTML;
                            if ("string" == typeof e && !ke.test(e) && !ge[(de.exec(e) || ["", ""])[1].toLowerCase()]) {
                                e = S.htmlPrefilter(e);
                                try {
                                    for (; n < r; n++) 1 === (t = this[n] || {}).nodeType && (S.cleanData(ve(t, !1)), (t.innerHTML = e));
                                    t = 0;
                                } catch (e) {}
                            }
                            t && this.empty().append(e);
                        },
                        null,
                        e,
                        arguments.length
                    );
                },
                replaceWith: function () {
                    var n = [];
                    return He(
                        this,
                        arguments,
                        function (e) {
                            var t = this.parentNode;
                            S.inArray(this, n) < 0 && (S.cleanData(ve(this)), t && t.replaceChild(e, this));
                        },
                        n
                    );
                },
            }),
            S.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, a) {
                S.fn[e] = function (e) {
                    for (var t, n = [], r = S(e), i = r.length - 1, o = 0; o <= i; o++) (t = o === i ? this : this.clone(!0)), S(r[o])[a](t), u.apply(n, t.get());
                    return this.pushStack(n);
                };
            });
        var Pe = new RegExp("^(" + ee + ")(?!px)[a-z%]+$", "i"),
            Re = function (e) {
                var t = e.ownerDocument.defaultView;
                return (t && t.opener) || (t = C), t.getComputedStyle(e);
            },
            Me = function (e, t, n) {
                var r,
                    i,
                    o = {};
                for (i in t) (o[i] = e.style[i]), (e.style[i] = t[i]);
                for (i in ((r = n.call(e)), t)) e.style[i] = o[i];
                return r;
            },
            Ie = new RegExp(ne.join("|"), "i");
        function We(e, t, n) {
            var r,
                i,
                o,
                a,
                s = e.style;
            return (
                (n = n || Re(e)) &&
                    ("" !== (a = n.getPropertyValue(t) || n[t]) || ie(e) || (a = S.style(e, t)),
                    !y.pixelBoxStyles() && Pe.test(a) && Ie.test(t) && ((r = s.width), (i = s.minWidth), (o = s.maxWidth), (s.minWidth = s.maxWidth = s.width = a), (a = n.width), (s.width = r), (s.minWidth = i), (s.maxWidth = o))),
                void 0 !== a ? a + "" : a
            );
        }
        function Fe(e, t) {
            return {
                get: function () {
                    if (!e()) return (this.get = t).apply(this, arguments);
                    delete this.get;
                },
            };
        }
        !(function () {
            function e() {
                if (l) {
                    (u.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0"),
                        (l.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%"),
                        re.appendChild(u).appendChild(l);
                    var e = C.getComputedStyle(l);
                    (n = "1%" !== e.top),
                        (s = 12 === t(e.marginLeft)),
                        (l.style.right = "60%"),
                        (o = 36 === t(e.right)),
                        (r = 36 === t(e.width)),
                        (l.style.position = "absolute"),
                        (i = 12 === t(l.offsetWidth / 3)),
                        re.removeChild(u),
                        (l = null);
                }
            }
            function t(e) {
                return Math.round(parseFloat(e));
            }
            var n,
                r,
                i,
                o,
                a,
                s,
                u = E.createElement("div"),
                l = E.createElement("div");
            l.style &&
                ((l.style.backgroundClip = "content-box"),
                (l.cloneNode(!0).style.backgroundClip = ""),
                (y.clearCloneStyle = "content-box" === l.style.backgroundClip),
                S.extend(y, {
                    boxSizingReliable: function () {
                        return e(), r;
                    },
                    pixelBoxStyles: function () {
                        return e(), o;
                    },
                    pixelPosition: function () {
                        return e(), n;
                    },
                    reliableMarginLeft: function () {
                        return e(), s;
                    },
                    scrollboxSize: function () {
                        return e(), i;
                    },
                    reliableTrDimensions: function () {
                        var e, t, n, r;
                        return (
                            null == a &&
                                ((e = E.createElement("table")),
                                (t = E.createElement("tr")),
                                (n = E.createElement("div")),
                                (e.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"),
                                (t.style.cssText = "border:1px solid"),
                                (t.style.height = "1px"),
                                (n.style.height = "9px"),
                                (n.style.display = "block"),
                                re.appendChild(e).appendChild(t).appendChild(n),
                                (r = C.getComputedStyle(t)),
                                (a = parseInt(r.height, 10) + parseInt(r.borderTopWidth, 10) + parseInt(r.borderBottomWidth, 10) === t.offsetHeight),
                                re.removeChild(e)),
                            a
                        );
                    },
                }));
        })();
        var Be = ["Webkit", "Moz", "ms"],
            $e = E.createElement("div").style,
            _e = {};
        function ze(e) {
            var t = S.cssProps[e] || _e[e];
            return (
                t ||
                (e in $e
                    ? e
                    : (_e[e] =
                          (function (e) {
                              var t = e[0].toUpperCase() + e.slice(1),
                                  n = Be.length;
                              while (n--) if ((e = Be[n] + t) in $e) return e;
                          })(e) || e))
            );
        }
        var Ue = /^(none|table(?!-c[ea]).+)/,
            Xe = /^--/,
            Ve = { position: "absolute", visibility: "hidden", display: "block" },
            Ge = { letterSpacing: "0", fontWeight: "400" };
        function Ye(e, t, n) {
            var r = te.exec(t);
            return r ? Math.max(0, r[2] - (n || 0)) + (r[3] || "px") : t;
        }
        function Qe(e, t, n, r, i, o) {
            var a = "width" === t ? 1 : 0,
                s = 0,
                u = 0;
            if (n === (r ? "border" : "content")) return 0;
            for (; a < 4; a += 2)
                "margin" === n && (u += S.css(e, n + ne[a], !0, i)),
                    r
                        ? ("content" === n && (u -= S.css(e, "padding" + ne[a], !0, i)), "margin" !== n && (u -= S.css(e, "border" + ne[a] + "Width", !0, i)))
                        : ((u += S.css(e, "padding" + ne[a], !0, i)), "padding" !== n ? (u += S.css(e, "border" + ne[a] + "Width", !0, i)) : (s += S.css(e, "border" + ne[a] + "Width", !0, i)));
            return !r && 0 <= o && (u += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - o - u - s - 0.5)) || 0), u;
        }
        function Je(e, t, n) {
            var r = Re(e),
                i = (!y.boxSizingReliable() || n) && "border-box" === S.css(e, "boxSizing", !1, r),
                o = i,
                a = We(e, t, r),
                s = "offset" + t[0].toUpperCase() + t.slice(1);
            if (Pe.test(a)) {
                if (!n) return a;
                a = "auto";
            }
            return (
                ((!y.boxSizingReliable() && i) || (!y.reliableTrDimensions() && A(e, "tr")) || "auto" === a || (!parseFloat(a) && "inline" === S.css(e, "display", !1, r))) &&
                    e.getClientRects().length &&
                    ((i = "border-box" === S.css(e, "boxSizing", !1, r)), (o = s in e) && (a = e[s])),
                (a = parseFloat(a) || 0) + Qe(e, t, n || (i ? "border" : "content"), o, r, a) + "px"
            );
        }
        function Ke(e, t, n, r, i) {
            return new Ke.prototype.init(e, t, n, r, i);
        }
        S.extend({
            cssHooks: {
                opacity: {
                    get: function (e, t) {
                        if (t) {
                            var n = We(e, "opacity");
                            return "" === n ? "1" : n;
                        }
                    },
                },
            },
            cssNumber: {
                animationIterationCount: !0,
                columnCount: !0,
                fillOpacity: !0,
                flexGrow: !0,
                flexShrink: !0,
                fontWeight: !0,
                gridArea: !0,
                gridColumn: !0,
                gridColumnEnd: !0,
                gridColumnStart: !0,
                gridRow: !0,
                gridRowEnd: !0,
                gridRowStart: !0,
                lineHeight: !0,
                opacity: !0,
                order: !0,
                orphans: !0,
                widows: !0,
                zIndex: !0,
                zoom: !0,
            },
            cssProps: {},
            style: function (e, t, n, r) {
                if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
                    var i,
                        o,
                        a,
                        s = X(t),
                        u = Xe.test(t),
                        l = e.style;
                    if ((u || (t = ze(s)), (a = S.cssHooks[t] || S.cssHooks[s]), void 0 === n)) return a && "get" in a && void 0 !== (i = a.get(e, !1, r)) ? i : l[t];
                    "string" === (o = typeof n) && (i = te.exec(n)) && i[1] && ((n = se(e, t, i)), (o = "number")),
                        null != n &&
                            n == n &&
                            ("number" !== o || u || (n += (i && i[3]) || (S.cssNumber[s] ? "" : "px")),
                            y.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (l[t] = "inherit"),
                            (a && "set" in a && void 0 === (n = a.set(e, n, r))) || (u ? l.setProperty(t, n) : (l[t] = n)));
                }
            },
            css: function (e, t, n, r) {
                var i,
                    o,
                    a,
                    s = X(t);
                return (
                    Xe.test(t) || (t = ze(s)),
                    (a = S.cssHooks[t] || S.cssHooks[s]) && "get" in a && (i = a.get(e, !0, n)),
                    void 0 === i && (i = We(e, t, r)),
                    "normal" === i && t in Ge && (i = Ge[t]),
                    "" === n || n ? ((o = parseFloat(i)), !0 === n || isFinite(o) ? o || 0 : i) : i
                );
            },
        }),
            S.each(["height", "width"], function (e, u) {
                S.cssHooks[u] = {
                    get: function (e, t, n) {
                        if (t)
                            return !Ue.test(S.css(e, "display")) || (e.getClientRects().length && e.getBoundingClientRect().width)
                                ? Je(e, u, n)
                                : Me(e, Ve, function () {
                                      return Je(e, u, n);
                                  });
                    },
                    set: function (e, t, n) {
                        var r,
                            i = Re(e),
                            o = !y.scrollboxSize() && "absolute" === i.position,
                            a = (o || n) && "border-box" === S.css(e, "boxSizing", !1, i),
                            s = n ? Qe(e, u, n, a, i) : 0;
                        return (
                            a && o && (s -= Math.ceil(e["offset" + u[0].toUpperCase() + u.slice(1)] - parseFloat(i[u]) - Qe(e, u, "border", !1, i) - 0.5)),
                            s && (r = te.exec(t)) && "px" !== (r[3] || "px") && ((e.style[u] = t), (t = S.css(e, u))),
                            Ye(0, t, s)
                        );
                    },
                };
            }),
            (S.cssHooks.marginLeft = Fe(y.reliableMarginLeft, function (e, t) {
                if (t)
                    return (
                        (parseFloat(We(e, "marginLeft")) ||
                            e.getBoundingClientRect().left -
                                Me(e, { marginLeft: 0 }, function () {
                                    return e.getBoundingClientRect().left;
                                })) + "px"
                    );
            })),
            S.each({ margin: "", padding: "", border: "Width" }, function (i, o) {
                (S.cssHooks[i + o] = {
                    expand: function (e) {
                        for (var t = 0, n = {}, r = "string" == typeof e ? e.split(" ") : [e]; t < 4; t++) n[i + ne[t] + o] = r[t] || r[t - 2] || r[0];
                        return n;
                    },
                }),
                    "margin" !== i && (S.cssHooks[i + o].set = Ye);
            }),
            S.fn.extend({
                css: function (e, t) {
                    return $(
                        this,
                        function (e, t, n) {
                            var r,
                                i,
                                o = {},
                                a = 0;
                            if (Array.isArray(t)) {
                                for (r = Re(e), i = t.length; a < i; a++) o[t[a]] = S.css(e, t[a], !1, r);
                                return o;
                            }
                            return void 0 !== n ? S.style(e, t, n) : S.css(e, t);
                        },
                        e,
                        t,
                        1 < arguments.length
                    );
                },
            }),
            (((S.Tween = Ke).prototype = {
                constructor: Ke,
                init: function (e, t, n, r, i, o) {
                    (this.elem = e), (this.prop = n), (this.easing = i || S.easing._default), (this.options = t), (this.start = this.now = this.cur()), (this.end = r), (this.unit = o || (S.cssNumber[n] ? "" : "px"));
                },
                cur: function () {
                    var e = Ke.propHooks[this.prop];
                    return e && e.get ? e.get(this) : Ke.propHooks._default.get(this);
                },
                run: function (e) {
                    var t,
                        n = Ke.propHooks[this.prop];
                    return (
                        this.options.duration ? (this.pos = t = S.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration)) : (this.pos = t = e),
                        (this.now = (this.end - this.start) * t + this.start),
                        this.options.step && this.options.step.call(this.elem, this.now, this),
                        n && n.set ? n.set(this) : Ke.propHooks._default.set(this),
                        this
                    );
                },
            }).init.prototype = Ke.prototype),
            ((Ke.propHooks = {
                _default: {
                    get: function (e) {
                        var t;
                        return 1 !== e.elem.nodeType || (null != e.elem[e.prop] && null == e.elem.style[e.prop]) ? e.elem[e.prop] : (t = S.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0;
                    },
                    set: function (e) {
                        S.fx.step[e.prop] ? S.fx.step[e.prop](e) : 1 !== e.elem.nodeType || (!S.cssHooks[e.prop] && null == e.elem.style[ze(e.prop)]) ? (e.elem[e.prop] = e.now) : S.style(e.elem, e.prop, e.now + e.unit);
                    },
                },
            }).scrollTop = Ke.propHooks.scrollLeft = {
                set: function (e) {
                    e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now);
                },
            }),
            (S.easing = {
                linear: function (e) {
                    return e;
                },
                swing: function (e) {
                    return 0.5 - Math.cos(e * Math.PI) / 2;
                },
                _default: "swing",
            }),
            (S.fx = Ke.prototype.init),
            (S.fx.step = {});
        var Ze,
            et,
            tt,
            nt,
            rt = /^(?:toggle|show|hide)$/,
            it = /queueHooks$/;
        function ot() {
            et && (!1 === E.hidden && C.requestAnimationFrame ? C.requestAnimationFrame(ot) : C.setTimeout(ot, S.fx.interval), S.fx.tick());
        }
        function at() {
            return (
                C.setTimeout(function () {
                    Ze = void 0;
                }),
                (Ze = Date.now())
            );
        }
        function st(e, t) {
            var n,
                r = 0,
                i = { height: e };
            for (t = t ? 1 : 0; r < 4; r += 2 - t) i["margin" + (n = ne[r])] = i["padding" + n] = e;
            return t && (i.opacity = i.width = e), i;
        }
        function ut(e, t, n) {
            for (var r, i = (lt.tweeners[t] || []).concat(lt.tweeners["*"]), o = 0, a = i.length; o < a; o++) if ((r = i[o].call(n, t, e))) return r;
        }
        function lt(o, e, t) {
            var n,
                a,
                r = 0,
                i = lt.prefilters.length,
                s = S.Deferred().always(function () {
                    delete u.elem;
                }),
                u = function () {
                    if (a) return !1;
                    for (var e = Ze || at(), t = Math.max(0, l.startTime + l.duration - e), n = 1 - (t / l.duration || 0), r = 0, i = l.tweens.length; r < i; r++) l.tweens[r].run(n);
                    return s.notifyWith(o, [l, n, t]), n < 1 && i ? t : (i || s.notifyWith(o, [l, 1, 0]), s.resolveWith(o, [l]), !1);
                },
                l = s.promise({
                    elem: o,
                    props: S.extend({}, e),
                    opts: S.extend(!0, { specialEasing: {}, easing: S.easing._default }, t),
                    originalProperties: e,
                    originalOptions: t,
                    startTime: Ze || at(),
                    duration: t.duration,
                    tweens: [],
                    createTween: function (e, t) {
                        var n = S.Tween(o, l.opts, e, t, l.opts.specialEasing[e] || l.opts.easing);
                        return l.tweens.push(n), n;
                    },
                    stop: function (e) {
                        var t = 0,
                            n = e ? l.tweens.length : 0;
                        if (a) return this;
                        for (a = !0; t < n; t++) l.tweens[t].run(1);
                        return e ? (s.notifyWith(o, [l, 1, 0]), s.resolveWith(o, [l, e])) : s.rejectWith(o, [l, e]), this;
                    },
                }),
                c = l.props;
            for (
                !(function (e, t) {
                    var n, r, i, o, a;
                    for (n in e)
                        if (((i = t[(r = X(n))]), (o = e[n]), Array.isArray(o) && ((i = o[1]), (o = e[n] = o[0])), n !== r && ((e[r] = o), delete e[n]), (a = S.cssHooks[r]) && ("expand" in a)))
                            for (n in ((o = a.expand(o)), delete e[r], o)) (n in e) || ((e[n] = o[n]), (t[n] = i));
                        else t[r] = i;
                })(c, l.opts.specialEasing);
                r < i;
                r++
            )
                if ((n = lt.prefilters[r].call(l, o, c, l.opts))) return m(n.stop) && (S._queueHooks(l.elem, l.opts.queue).stop = n.stop.bind(n)), n;
            return (
                S.map(c, ut, l),
                m(l.opts.start) && l.opts.start.call(o, l),
                l.progress(l.opts.progress).done(l.opts.done, l.opts.complete).fail(l.opts.fail).always(l.opts.always),
                S.fx.timer(S.extend(u, { elem: o, anim: l, queue: l.opts.queue })),
                l
            );
        }
        (S.Animation = S.extend(lt, {
            tweeners: {
                "*": [
                    function (e, t) {
                        var n = this.createTween(e, t);
                        return se(n.elem, e, te.exec(t), n), n;
                    },
                ],
            },
            tweener: function (e, t) {
                m(e) ? ((t = e), (e = ["*"])) : (e = e.match(P));
                for (var n, r = 0, i = e.length; r < i; r++) (n = e[r]), (lt.tweeners[n] = lt.tweeners[n] || []), lt.tweeners[n].unshift(t);
            },
            prefilters: [
                function (e, t, n) {
                    var r,
                        i,
                        o,
                        a,
                        s,
                        u,
                        l,
                        c,
                        f = "width" in t || "height" in t,
                        p = this,
                        d = {},
                        h = e.style,
                        g = e.nodeType && ae(e),
                        v = Y.get(e, "fxshow");
                    for (r in (n.queue ||
                        (null == (a = S._queueHooks(e, "fx")).unqueued &&
                            ((a.unqueued = 0),
                            (s = a.empty.fire),
                            (a.empty.fire = function () {
                                a.unqueued || s();
                            })),
                        a.unqueued++,
                        p.always(function () {
                            p.always(function () {
                                a.unqueued--, S.queue(e, "fx").length || a.empty.fire();
                            });
                        })),
                    t))
                        if (((i = t[r]), rt.test(i))) {
                            if ((delete t[r], (o = o || "toggle" === i), i === (g ? "hide" : "show"))) {
                                if ("show" !== i || !v || void 0 === v[r]) continue;
                                g = !0;
                            }
                            d[r] = (v && v[r]) || S.style(e, r);
                        }
                    if ((u = !S.isEmptyObject(t)) || !S.isEmptyObject(d))
                        for (r in (f &&
                            1 === e.nodeType &&
                            ((n.overflow = [h.overflow, h.overflowX, h.overflowY]),
                            null == (l = v && v.display) && (l = Y.get(e, "display")),
                            "none" === (c = S.css(e, "display")) && (l ? (c = l) : (le([e], !0), (l = e.style.display || l), (c = S.css(e, "display")), le([e]))),
                            ("inline" === c || ("inline-block" === c && null != l)) &&
                                "none" === S.css(e, "float") &&
                                (u ||
                                    (p.done(function () {
                                        h.display = l;
                                    }),
                                    null == l && ((c = h.display), (l = "none" === c ? "" : c))),
                                (h.display = "inline-block"))),
                        n.overflow &&
                            ((h.overflow = "hidden"),
                            p.always(function () {
                                (h.overflow = n.overflow[0]), (h.overflowX = n.overflow[1]), (h.overflowY = n.overflow[2]);
                            })),
                        (u = !1),
                        d))
                            u ||
                                (v ? "hidden" in v && (g = v.hidden) : (v = Y.access(e, "fxshow", { display: l })),
                                o && (v.hidden = !g),
                                g && le([e], !0),
                                p.done(function () {
                                    for (r in (g || le([e]), Y.remove(e, "fxshow"), d)) S.style(e, r, d[r]);
                                })),
                                (u = ut(g ? v[r] : 0, r, p)),
                                r in v || ((v[r] = u.start), g && ((u.end = u.start), (u.start = 0)));
                },
            ],
            prefilter: function (e, t) {
                t ? lt.prefilters.unshift(e) : lt.prefilters.push(e);
            },
        })),
            (S.speed = function (e, t, n) {
                var r = e && "object" == typeof e ? S.extend({}, e) : { complete: n || (!n && t) || (m(e) && e), duration: e, easing: (n && t) || (t && !m(t) && t) };
                return (
                    S.fx.off ? (r.duration = 0) : "number" != typeof r.duration && (r.duration in S.fx.speeds ? (r.duration = S.fx.speeds[r.duration]) : (r.duration = S.fx.speeds._default)),
                    (null != r.queue && !0 !== r.queue) || (r.queue = "fx"),
                    (r.old = r.complete),
                    (r.complete = function () {
                        m(r.old) && r.old.call(this), r.queue && S.dequeue(this, r.queue);
                    }),
                    r
                );
            }),
            S.fn.extend({
                fadeTo: function (e, t, n, r) {
                    return this.filter(ae).css("opacity", 0).show().end().animate({ opacity: t }, e, n, r);
                },
                animate: function (t, e, n, r) {
                    var i = S.isEmptyObject(t),
                        o = S.speed(e, n, r),
                        a = function () {
                            var e = lt(this, S.extend({}, t), o);
                            (i || Y.get(this, "finish")) && e.stop(!0);
                        };
                    return (a.finish = a), i || !1 === o.queue ? this.each(a) : this.queue(o.queue, a);
                },
                stop: function (i, e, o) {
                    var a = function (e) {
                        var t = e.stop;
                        delete e.stop, t(o);
                    };
                    return (
                        "string" != typeof i && ((o = e), (e = i), (i = void 0)),
                        e && this.queue(i || "fx", []),
                        this.each(function () {
                            var e = !0,
                                t = null != i && i + "queueHooks",
                                n = S.timers,
                                r = Y.get(this);
                            if (t) r[t] && r[t].stop && a(r[t]);
                            else for (t in r) r[t] && r[t].stop && it.test(t) && a(r[t]);
                            for (t = n.length; t--; ) n[t].elem !== this || (null != i && n[t].queue !== i) || (n[t].anim.stop(o), (e = !1), n.splice(t, 1));
                            (!e && o) || S.dequeue(this, i);
                        })
                    );
                },
                finish: function (a) {
                    return (
                        !1 !== a && (a = a || "fx"),
                        this.each(function () {
                            var e,
                                t = Y.get(this),
                                n = t[a + "queue"],
                                r = t[a + "queueHooks"],
                                i = S.timers,
                                o = n ? n.length : 0;
                            for (t.finish = !0, S.queue(this, a, []), r && r.stop && r.stop.call(this, !0), e = i.length; e--; ) i[e].elem === this && i[e].queue === a && (i[e].anim.stop(!0), i.splice(e, 1));
                            for (e = 0; e < o; e++) n[e] && n[e].finish && n[e].finish.call(this);
                            delete t.finish;
                        })
                    );
                },
            }),
            S.each(["toggle", "show", "hide"], function (e, r) {
                var i = S.fn[r];
                S.fn[r] = function (e, t, n) {
                    return null == e || "boolean" == typeof e ? i.apply(this, arguments) : this.animate(st(r, !0), e, t, n);
                };
            }),
            S.each({ slideDown: st("show"), slideUp: st("hide"), slideToggle: st("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (e, r) {
                S.fn[e] = function (e, t, n) {
                    return this.animate(r, e, t, n);
                };
            }),
            (S.timers = []),
            (S.fx.tick = function () {
                var e,
                    t = 0,
                    n = S.timers;
                for (Ze = Date.now(); t < n.length; t++) (e = n[t])() || n[t] !== e || n.splice(t--, 1);
                n.length || S.fx.stop(), (Ze = void 0);
            }),
            (S.fx.timer = function (e) {
                S.timers.push(e), S.fx.start();
            }),
            (S.fx.interval = 13),
            (S.fx.start = function () {
                et || ((et = !0), ot());
            }),
            (S.fx.stop = function () {
                et = null;
            }),
            (S.fx.speeds = { slow: 600, fast: 200, _default: 400 }),
            (S.fn.delay = function (r, e) {
                return (
                    (r = (S.fx && S.fx.speeds[r]) || r),
                    (e = e || "fx"),
                    this.queue(e, function (e, t) {
                        var n = C.setTimeout(e, r);
                        t.stop = function () {
                            C.clearTimeout(n);
                        };
                    })
                );
            }),
            (tt = E.createElement("input")),
            (nt = E.createElement("select").appendChild(E.createElement("option"))),
            (tt.type = "checkbox"),
            (y.checkOn = "" !== tt.value),
            (y.optSelected = nt.selected),
            ((tt = E.createElement("input")).value = "t"),
            (tt.type = "radio"),
            (y.radioValue = "t" === tt.value);
        var ct,
            ft = S.expr.attrHandle;
        S.fn.extend({
            attr: function (e, t) {
                return $(this, S.attr, e, t, 1 < arguments.length);
            },
            removeAttr: function (e) {
                return this.each(function () {
                    S.removeAttr(this, e);
                });
            },
        }),
            S.extend({
                attr: function (e, t, n) {
                    var r,
                        i,
                        o = e.nodeType;
                    if (3 !== o && 8 !== o && 2 !== o)
                        return "undefined" == typeof e.getAttribute
                            ? S.prop(e, t, n)
                            : ((1 === o && S.isXMLDoc(e)) || (i = S.attrHooks[t.toLowerCase()] || (S.expr.match.bool.test(t) ? ct : void 0)),
                              void 0 !== n
                                  ? null === n
                                      ? void S.removeAttr(e, t)
                                      : i && "set" in i && void 0 !== (r = i.set(e, n, t))
                                      ? r
                                      : (e.setAttribute(t, n + ""), n)
                                  : i && "get" in i && null !== (r = i.get(e, t))
                                  ? r
                                  : null == (r = S.find.attr(e, t))
                                  ? void 0
                                  : r);
                },
                attrHooks: {
                    type: {
                        set: function (e, t) {
                            if (!y.radioValue && "radio" === t && A(e, "input")) {
                                var n = e.value;
                                return e.setAttribute("type", t), n && (e.value = n), t;
                            }
                        },
                    },
                },
                removeAttr: function (e, t) {
                    var n,
                        r = 0,
                        i = t && t.match(P);
                    if (i && 1 === e.nodeType) while ((n = i[r++])) e.removeAttribute(n);
                },
            }),
            (ct = {
                set: function (e, t, n) {
                    return !1 === t ? S.removeAttr(e, n) : e.setAttribute(n, n), n;
                },
            }),
            S.each(S.expr.match.bool.source.match(/\w+/g), function (e, t) {
                var a = ft[t] || S.find.attr;
                ft[t] = function (e, t, n) {
                    var r,
                        i,
                        o = t.toLowerCase();
                    return n || ((i = ft[o]), (ft[o] = r), (r = null != a(e, t, n) ? o : null), (ft[o] = i)), r;
                };
            });
        var pt = /^(?:input|select|textarea|button)$/i,
            dt = /^(?:a|area)$/i;
        function ht(e) {
            return (e.match(P) || []).join(" ");
        }
        function gt(e) {
            return (e.getAttribute && e.getAttribute("class")) || "";
        }
        function vt(e) {
            return Array.isArray(e) ? e : ("string" == typeof e && e.match(P)) || [];
        }
        S.fn.extend({
            prop: function (e, t) {
                return $(this, S.prop, e, t, 1 < arguments.length);
            },
            removeProp: function (e) {
                return this.each(function () {
                    delete this[S.propFix[e] || e];
                });
            },
        }),
            S.extend({
                prop: function (e, t, n) {
                    var r,
                        i,
                        o = e.nodeType;
                    if (3 !== o && 8 !== o && 2 !== o)
                        return (
                            (1 === o && S.isXMLDoc(e)) || ((t = S.propFix[t] || t), (i = S.propHooks[t])),
                            void 0 !== n ? (i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : (e[t] = n)) : i && "get" in i && null !== (r = i.get(e, t)) ? r : e[t]
                        );
                },
                propHooks: {
                    tabIndex: {
                        get: function (e) {
                            var t = S.find.attr(e, "tabindex");
                            return t ? parseInt(t, 10) : pt.test(e.nodeName) || (dt.test(e.nodeName) && e.href) ? 0 : -1;
                        },
                    },
                },
                propFix: { for: "htmlFor", class: "className" },
            }),
            y.optSelected ||
                (S.propHooks.selected = {
                    get: function (e) {
                        var t = e.parentNode;
                        return t && t.parentNode && t.parentNode.selectedIndex, null;
                    },
                    set: function (e) {
                        var t = e.parentNode;
                        t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex);
                    },
                }),
            S.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
                S.propFix[this.toLowerCase()] = this;
            }),
            S.fn.extend({
                addClass: function (t) {
                    var e,
                        n,
                        r,
                        i,
                        o,
                        a,
                        s,
                        u = 0;
                    if (m(t))
                        return this.each(function (e) {
                            S(this).addClass(t.call(this, e, gt(this)));
                        });
                    if ((e = vt(t)).length)
                        while ((n = this[u++]))
                            if (((i = gt(n)), (r = 1 === n.nodeType && " " + ht(i) + " "))) {
                                a = 0;
                                while ((o = e[a++])) r.indexOf(" " + o + " ") < 0 && (r += o + " ");
                                i !== (s = ht(r)) && n.setAttribute("class", s);
                            }
                    return this;
                },
                removeClass: function (t) {
                    var e,
                        n,
                        r,
                        i,
                        o,
                        a,
                        s,
                        u = 0;
                    if (m(t))
                        return this.each(function (e) {
                            S(this).removeClass(t.call(this, e, gt(this)));
                        });
                    if (!arguments.length) return this.attr("class", "");
                    if ((e = vt(t)).length)
                        while ((n = this[u++]))
                            if (((i = gt(n)), (r = 1 === n.nodeType && " " + ht(i) + " "))) {
                                a = 0;
                                while ((o = e[a++])) while (-1 < r.indexOf(" " + o + " ")) r = r.replace(" " + o + " ", " ");
                                i !== (s = ht(r)) && n.setAttribute("class", s);
                            }
                    return this;
                },
                toggleClass: function (i, t) {
                    var o = typeof i,
                        a = "string" === o || Array.isArray(i);
                    return "boolean" == typeof t && a
                        ? t
                            ? this.addClass(i)
                            : this.removeClass(i)
                        : m(i)
                        ? this.each(function (e) {
                              S(this).toggleClass(i.call(this, e, gt(this), t), t);
                          })
                        : this.each(function () {
                              var e, t, n, r;
                              if (a) {
                                  (t = 0), (n = S(this)), (r = vt(i));
                                  while ((e = r[t++])) n.hasClass(e) ? n.removeClass(e) : n.addClass(e);
                              } else (void 0 !== i && "boolean" !== o) || ((e = gt(this)) && Y.set(this, "__className__", e), this.setAttribute && this.setAttribute("class", e || !1 === i ? "" : Y.get(this, "__className__") || ""));
                          });
                },
                hasClass: function (e) {
                    var t,
                        n,
                        r = 0;
                    t = " " + e + " ";
                    while ((n = this[r++])) if (1 === n.nodeType && -1 < (" " + ht(gt(n)) + " ").indexOf(t)) return !0;
                    return !1;
                },
            });
        var yt = /\r/g;
        S.fn.extend({
            val: function (n) {
                var r,
                    e,
                    i,
                    t = this[0];
                return arguments.length
                    ? ((i = m(n)),
                      this.each(function (e) {
                          var t;
                          1 === this.nodeType &&
                              (null == (t = i ? n.call(this, e, S(this).val()) : n)
                                  ? (t = "")
                                  : "number" == typeof t
                                  ? (t += "")
                                  : Array.isArray(t) &&
                                    (t = S.map(t, function (e) {
                                        return null == e ? "" : e + "";
                                    })),
                              ((r = S.valHooks[this.type] || S.valHooks[this.nodeName.toLowerCase()]) && "set" in r && void 0 !== r.set(this, t, "value")) || (this.value = t));
                      }))
                    : t
                    ? (r = S.valHooks[t.type] || S.valHooks[t.nodeName.toLowerCase()]) && "get" in r && void 0 !== (e = r.get(t, "value"))
                        ? e
                        : "string" == typeof (e = t.value)
                        ? e.replace(yt, "")
                        : null == e
                        ? ""
                        : e
                    : void 0;
            },
        }),
            S.extend({
                valHooks: {
                    option: {
                        get: function (e) {
                            var t = S.find.attr(e, "value");
                            return null != t ? t : ht(S.text(e));
                        },
                    },
                    select: {
                        get: function (e) {
                            var t,
                                n,
                                r,
                                i = e.options,
                                o = e.selectedIndex,
                                a = "select-one" === e.type,
                                s = a ? null : [],
                                u = a ? o + 1 : i.length;
                            for (r = o < 0 ? u : a ? o : 0; r < u; r++)
                                if (((n = i[r]).selected || r === o) && !n.disabled && (!n.parentNode.disabled || !A(n.parentNode, "optgroup"))) {
                                    if (((t = S(n).val()), a)) return t;
                                    s.push(t);
                                }
                            return s;
                        },
                        set: function (e, t) {
                            var n,
                                r,
                                i = e.options,
                                o = S.makeArray(t),
                                a = i.length;
                            while (a--) ((r = i[a]).selected = -1 < S.inArray(S.valHooks.option.get(r), o)) && (n = !0);
                            return n || (e.selectedIndex = -1), o;
                        },
                    },
                },
            }),
            S.each(["radio", "checkbox"], function () {
                (S.valHooks[this] = {
                    set: function (e, t) {
                        if (Array.isArray(t)) return (e.checked = -1 < S.inArray(S(e).val(), t));
                    },
                }),
                    y.checkOn ||
                        (S.valHooks[this].get = function (e) {
                            return null === e.getAttribute("value") ? "on" : e.value;
                        });
            }),
            (y.focusin = "onfocusin" in C);
        var mt = /^(?:focusinfocus|focusoutblur)$/,
            xt = function (e) {
                e.stopPropagation();
            };
        S.extend(S.event, {
            trigger: function (e, t, n, r) {
                var i,
                    o,
                    a,
                    s,
                    u,
                    l,
                    c,
                    f,
                    p = [n || E],
                    d = v.call(e, "type") ? e.type : e,
                    h = v.call(e, "namespace") ? e.namespace.split(".") : [];
                if (
                    ((o = f = a = n = n || E),
                    3 !== n.nodeType &&
                        8 !== n.nodeType &&
                        !mt.test(d + S.event.triggered) &&
                        (-1 < d.indexOf(".") && ((d = (h = d.split(".")).shift()), h.sort()),
                        (u = d.indexOf(":") < 0 && "on" + d),
                        ((e = e[S.expando] ? e : new S.Event(d, "object" == typeof e && e)).isTrigger = r ? 2 : 3),
                        (e.namespace = h.join(".")),
                        (e.rnamespace = e.namespace ? new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)") : null),
                        (e.result = void 0),
                        e.target || (e.target = n),
                        (t = null == t ? [e] : S.makeArray(t, [e])),
                        (c = S.event.special[d] || {}),
                        r || !c.trigger || !1 !== c.trigger.apply(n, t)))
                ) {
                    if (!r && !c.noBubble && !x(n)) {
                        for (s = c.delegateType || d, mt.test(s + d) || (o = o.parentNode); o; o = o.parentNode) p.push(o), (a = o);
                        a === (n.ownerDocument || E) && p.push(a.defaultView || a.parentWindow || C);
                    }
                    i = 0;
                    while ((o = p[i++]) && !e.isPropagationStopped())
                        (f = o),
                            (e.type = 1 < i ? s : c.bindType || d),
                            (l = (Y.get(o, "events") || Object.create(null))[e.type] && Y.get(o, "handle")) && l.apply(o, t),
                            (l = u && o[u]) && l.apply && V(o) && ((e.result = l.apply(o, t)), !1 === e.result && e.preventDefault());
                    return (
                        (e.type = d),
                        r ||
                            e.isDefaultPrevented() ||
                            (c._default && !1 !== c._default.apply(p.pop(), t)) ||
                            !V(n) ||
                            (u &&
                                m(n[d]) &&
                                !x(n) &&
                                ((a = n[u]) && (n[u] = null),
                                (S.event.triggered = d),
                                e.isPropagationStopped() && f.addEventListener(d, xt),
                                n[d](),
                                e.isPropagationStopped() && f.removeEventListener(d, xt),
                                (S.event.triggered = void 0),
                                a && (n[u] = a))),
                        e.result
                    );
                }
            },
            simulate: function (e, t, n) {
                var r = S.extend(new S.Event(), n, { type: e, isSimulated: !0 });
                S.event.trigger(r, null, t);
            },
        }),
            S.fn.extend({
                trigger: function (e, t) {
                    return this.each(function () {
                        S.event.trigger(e, t, this);
                    });
                },
                triggerHandler: function (e, t) {
                    var n = this[0];
                    if (n) return S.event.trigger(e, t, n, !0);
                },
            }),
            y.focusin ||
                S.each({ focus: "focusin", blur: "focusout" }, function (n, r) {
                    var i = function (e) {
                        S.event.simulate(r, e.target, S.event.fix(e));
                    };
                    S.event.special[r] = {
                        setup: function () {
                            var e = this.ownerDocument || this.document || this,
                                t = Y.access(e, r);
                            t || e.addEventListener(n, i, !0), Y.access(e, r, (t || 0) + 1);
                        },
                        teardown: function () {
                            var e = this.ownerDocument || this.document || this,
                                t = Y.access(e, r) - 1;
                            t ? Y.access(e, r, t) : (e.removeEventListener(n, i, !0), Y.remove(e, r));
                        },
                    };
                });
        var bt = C.location,
            wt = { guid: Date.now() },
            Tt = /\?/;
        S.parseXML = function (e) {
            var t, n;
            if (!e || "string" != typeof e) return null;
            try {
                t = new C.DOMParser().parseFromString(e, "text/xml");
            } catch (e) {}
            return (
                (n = t && t.getElementsByTagName("parsererror")[0]),
                (t && !n) ||
                    S.error(
                        "Invalid XML: " +
                            (n
                                ? S.map(n.childNodes, function (e) {
                                      return e.textContent;
                                  }).join("\n")
                                : e)
                    ),
                t
            );
        };
        var Ct = /\[\]$/,
            Et = /\r?\n/g,
            St = /^(?:submit|button|image|reset|file)$/i,
            kt = /^(?:input|select|textarea|keygen)/i;
        function At(n, e, r, i) {
            var t;
            if (Array.isArray(e))
                S.each(e, function (e, t) {
                    r || Ct.test(n) ? i(n, t) : At(n + "[" + ("object" == typeof t && null != t ? e : "") + "]", t, r, i);
                });
            else if (r || "object" !== w(e)) i(n, e);
            else for (t in e) At(n + "[" + t + "]", e[t], r, i);
        }
        (S.param = function (e, t) {
            var n,
                r = [],
                i = function (e, t) {
                    var n = m(t) ? t() : t;
                    r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(null == n ? "" : n);
                };
            if (null == e) return "";
            if (Array.isArray(e) || (e.jquery && !S.isPlainObject(e)))
                S.each(e, function () {
                    i(this.name, this.value);
                });
            else for (n in e) At(n, e[n], t, i);
            return r.join("&");
        }),
            S.fn.extend({
                serialize: function () {
                    return S.param(this.serializeArray());
                },
                serializeArray: function () {
                    return this.map(function () {
                        var e = S.prop(this, "elements");
                        return e ? S.makeArray(e) : this;
                    })
                        .filter(function () {
                            var e = this.type;
                            return this.name && !S(this).is(":disabled") && kt.test(this.nodeName) && !St.test(e) && (this.checked || !pe.test(e));
                        })
                        .map(function (e, t) {
                            var n = S(this).val();
                            return null == n
                                ? null
                                : Array.isArray(n)
                                ? S.map(n, function (e) {
                                      return { name: t.name, value: e.replace(Et, "\r\n") };
                                  })
                                : { name: t.name, value: n.replace(Et, "\r\n") };
                        })
                        .get();
                },
            });
        var Nt = /%20/g,
            jt = /#.*$/,
            Dt = /([?&])_=[^&]*/,
            qt = /^(.*?):[ \t]*([^\r\n]*)$/gm,
            Lt = /^(?:GET|HEAD)$/,
            Ht = /^\/\//,
            Ot = {},
            Pt = {},
            Rt = "*/".concat("*"),
            Mt = E.createElement("a");
        function It(o) {
            return function (e, t) {
                "string" != typeof e && ((t = e), (e = "*"));
                var n,
                    r = 0,
                    i = e.toLowerCase().match(P) || [];
                if (m(t)) while ((n = i[r++])) "+" === n[0] ? ((n = n.slice(1) || "*"), (o[n] = o[n] || []).unshift(t)) : (o[n] = o[n] || []).push(t);
            };
        }
        function Wt(t, i, o, a) {
            var s = {},
                u = t === Pt;
            function l(e) {
                var r;
                return (
                    (s[e] = !0),
                    S.each(t[e] || [], function (e, t) {
                        var n = t(i, o, a);
                        return "string" != typeof n || u || s[n] ? (u ? !(r = n) : void 0) : (i.dataTypes.unshift(n), l(n), !1);
                    }),
                    r
                );
            }
            return l(i.dataTypes[0]) || (!s["*"] && l("*"));
        }
        function Ft(e, t) {
            var n,
                r,
                i = S.ajaxSettings.flatOptions || {};
            for (n in t) void 0 !== t[n] && ((i[n] ? e : r || (r = {}))[n] = t[n]);
            return r && S.extend(!0, e, r), e;
        }
        (Mt.href = bt.href),
            S.extend({
                active: 0,
                lastModified: {},
                etag: {},
                ajaxSettings: {
                    url: bt.href,
                    type: "GET",
                    isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),
                    global: !0,
                    processData: !0,
                    async: !0,
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    accepts: { "*": Rt, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" },
                    contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ },
                    responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" },
                    converters: { "* text": String, "text html": !0, "text json": JSON.parse, "text xml": S.parseXML },
                    flatOptions: { url: !0, context: !0 },
                },
                ajaxSetup: function (e, t) {
                    return t ? Ft(Ft(e, S.ajaxSettings), t) : Ft(S.ajaxSettings, e);
                },
                ajaxPrefilter: It(Ot),
                ajaxTransport: It(Pt),
                ajax: function (e, t) {
                    "object" == typeof e && ((t = e), (e = void 0)), (t = t || {});
                    var c,
                        f,
                        p,
                        n,
                        d,
                        r,
                        h,
                        g,
                        i,
                        o,
                        v = S.ajaxSetup({}, t),
                        y = v.context || v,
                        m = v.context && (y.nodeType || y.jquery) ? S(y) : S.event,
                        x = S.Deferred(),
                        b = S.Callbacks("once memory"),
                        w = v.statusCode || {},
                        a = {},
                        s = {},
                        u = "canceled",
                        T = {
                            readyState: 0,
                            getResponseHeader: function (e) {
                                var t;
                                if (h) {
                                    if (!n) {
                                        n = {};
                                        while ((t = qt.exec(p))) n[t[1].toLowerCase() + " "] = (n[t[1].toLowerCase() + " "] || []).concat(t[2]);
                                    }
                                    t = n[e.toLowerCase() + " "];
                                }
                                return null == t ? null : t.join(", ");
                            },
                            getAllResponseHeaders: function () {
                                return h ? p : null;
                            },
                            setRequestHeader: function (e, t) {
                                return null == h && ((e = s[e.toLowerCase()] = s[e.toLowerCase()] || e), (a[e] = t)), this;
                            },
                            overrideMimeType: function (e) {
                                return null == h && (v.mimeType = e), this;
                            },
                            statusCode: function (e) {
                                var t;
                                if (e)
                                    if (h) T.always(e[T.status]);
                                    else for (t in e) w[t] = [w[t], e[t]];
                                return this;
                            },
                            abort: function (e) {
                                var t = e || u;
                                return c && c.abort(t), l(0, t), this;
                            },
                        };
                    if (
                        (x.promise(T),
                        (v.url = ((e || v.url || bt.href) + "").replace(Ht, bt.protocol + "//")),
                        (v.type = t.method || t.type || v.method || v.type),
                        (v.dataTypes = (v.dataType || "*").toLowerCase().match(P) || [""]),
                        null == v.crossDomain)
                    ) {
                        r = E.createElement("a");
                        try {
                            (r.href = v.url), (r.href = r.href), (v.crossDomain = Mt.protocol + "//" + Mt.host != r.protocol + "//" + r.host);
                        } catch (e) {
                            v.crossDomain = !0;
                        }
                    }
                    if ((v.data && v.processData && "string" != typeof v.data && (v.data = S.param(v.data, v.traditional)), Wt(Ot, v, t, T), h)) return T;
                    for (i in ((g = S.event && v.global) && 0 == S.active++ && S.event.trigger("ajaxStart"),
                    (v.type = v.type.toUpperCase()),
                    (v.hasContent = !Lt.test(v.type)),
                    (f = v.url.replace(jt, "")),
                    v.hasContent
                        ? v.data && v.processData && 0 === (v.contentType || "").indexOf("application/x-www-form-urlencoded") && (v.data = v.data.replace(Nt, "+"))
                        : ((o = v.url.slice(f.length)),
                          v.data && (v.processData || "string" == typeof v.data) && ((f += (Tt.test(f) ? "&" : "?") + v.data), delete v.data),
                          !1 === v.cache && ((f = f.replace(Dt, "$1")), (o = (Tt.test(f) ? "&" : "?") + "_=" + wt.guid++ + o)),
                          (v.url = f + o)),
                    v.ifModified && (S.lastModified[f] && T.setRequestHeader("If-Modified-Since", S.lastModified[f]), S.etag[f] && T.setRequestHeader("If-None-Match", S.etag[f])),
                    ((v.data && v.hasContent && !1 !== v.contentType) || t.contentType) && T.setRequestHeader("Content-Type", v.contentType),
                    T.setRequestHeader("Accept", v.dataTypes[0] && v.accepts[v.dataTypes[0]] ? v.accepts[v.dataTypes[0]] + ("*" !== v.dataTypes[0] ? ", " + Rt + "; q=0.01" : "") : v.accepts["*"]),
                    v.headers))
                        T.setRequestHeader(i, v.headers[i]);
                    if (v.beforeSend && (!1 === v.beforeSend.call(y, T, v) || h)) return T.abort();
                    if (((u = "abort"), b.add(v.complete), T.done(v.success), T.fail(v.error), (c = Wt(Pt, v, t, T)))) {
                        if (((T.readyState = 1), g && m.trigger("ajaxSend", [T, v]), h)) return T;
                        v.async &&
                            0 < v.timeout &&
                            (d = C.setTimeout(function () {
                                T.abort("timeout");
                            }, v.timeout));
                        try {
                            (h = !1), c.send(a, l);
                        } catch (e) {
                            if (h) throw e;
                            l(-1, e);
                        }
                    } else l(-1, "No Transport");
                    function l(e, t, n, r) {
                        var i,
                            o,
                            a,
                            s,
                            u,
                            l = t;
                        h ||
                            ((h = !0),
                            d && C.clearTimeout(d),
                            (c = void 0),
                            (p = r || ""),
                            (T.readyState = 0 < e ? 4 : 0),
                            (i = (200 <= e && e < 300) || 304 === e),
                            n &&
                                (s = (function (e, t, n) {
                                    var r,
                                        i,
                                        o,
                                        a,
                                        s = e.contents,
                                        u = e.dataTypes;
                                    while ("*" === u[0]) u.shift(), void 0 === r && (r = e.mimeType || t.getResponseHeader("Content-Type"));
                                    if (r)
                                        for (i in s)
                                            if (s[i] && s[i].test(r)) {
                                                u.unshift(i);
                                                break;
                                            }
                                    if (u[0] in n) o = u[0];
                                    else {
                                        for (i in n) {
                                            if (!u[0] || e.converters[i + " " + u[0]]) {
                                                o = i;
                                                break;
                                            }
                                            a || (a = i);
                                        }
                                        o = o || a;
                                    }
                                    if (o) return o !== u[0] && u.unshift(o), n[o];
                                })(v, T, n)),
                            !i && -1 < S.inArray("script", v.dataTypes) && S.inArray("json", v.dataTypes) < 0 && (v.converters["text script"] = function () {}),
                            (s = (function (e, t, n, r) {
                                var i,
                                    o,
                                    a,
                                    s,
                                    u,
                                    l = {},
                                    c = e.dataTypes.slice();
                                if (c[1]) for (a in e.converters) l[a.toLowerCase()] = e.converters[a];
                                o = c.shift();
                                while (o)
                                    if ((e.responseFields[o] && (n[e.responseFields[o]] = t), !u && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), (u = o), (o = c.shift())))
                                        if ("*" === o) o = u;
                                        else if ("*" !== u && u !== o) {
                                            if (!(a = l[u + " " + o] || l["* " + o]))
                                                for (i in l)
                                                    if ((s = i.split(" "))[1] === o && (a = l[u + " " + s[0]] || l["* " + s[0]])) {
                                                        !0 === a ? (a = l[i]) : !0 !== l[i] && ((o = s[0]), c.unshift(s[1]));
                                                        break;
                                                    }
                                            if (!0 !== a)
                                                if (a && e["throws"]) t = a(t);
                                                else
                                                    try {
                                                        t = a(t);
                                                    } catch (e) {
                                                        return { state: "parsererror", error: a ? e : "No conversion from " + u + " to " + o };
                                                    }
                                        }
                                return { state: "success", data: t };
                            })(v, s, T, i)),
                            i
                                ? (v.ifModified && ((u = T.getResponseHeader("Last-Modified")) && (S.lastModified[f] = u), (u = T.getResponseHeader("etag")) && (S.etag[f] = u)),
                                  204 === e || "HEAD" === v.type ? (l = "nocontent") : 304 === e ? (l = "notmodified") : ((l = s.state), (o = s.data), (i = !(a = s.error))))
                                : ((a = l), (!e && l) || ((l = "error"), e < 0 && (e = 0))),
                            (T.status = e),
                            (T.statusText = (t || l) + ""),
                            i ? x.resolveWith(y, [o, l, T]) : x.rejectWith(y, [T, l, a]),
                            T.statusCode(w),
                            (w = void 0),
                            g && m.trigger(i ? "ajaxSuccess" : "ajaxError", [T, v, i ? o : a]),
                            b.fireWith(y, [T, l]),
                            g && (m.trigger("ajaxComplete", [T, v]), --S.active || S.event.trigger("ajaxStop")));
                    }
                    return T;
                },
                getJSON: function (e, t, n) {
                    return S.get(e, t, n, "json");
                },
                getScript: function (e, t) {
                    return S.get(e, void 0, t, "script");
                },
            }),
            S.each(["get", "post"], function (e, i) {
                S[i] = function (e, t, n, r) {
                    return m(t) && ((r = r || n), (n = t), (t = void 0)), S.ajax(S.extend({ url: e, type: i, dataType: r, data: t, success: n }, S.isPlainObject(e) && e));
                };
            }),
            S.ajaxPrefilter(function (e) {
                var t;
                for (t in e.headers) "content-type" === t.toLowerCase() && (e.contentType = e.headers[t] || "");
            }),
            (S._evalUrl = function (e, t, n) {
                return S.ajax({
                    url: e,
                    type: "GET",
                    dataType: "script",
                    cache: !0,
                    async: !1,
                    global: !1,
                    converters: { "text script": function () {} },
                    dataFilter: function (e) {
                        S.globalEval(e, t, n);
                    },
                });
            }),
            S.fn.extend({
                wrapAll: function (e) {
                    var t;
                    return (
                        this[0] &&
                            (m(e) && (e = e.call(this[0])),
                            (t = S(e, this[0].ownerDocument).eq(0).clone(!0)),
                            this[0].parentNode && t.insertBefore(this[0]),
                            t
                                .map(function () {
                                    var e = this;
                                    while (e.firstElementChild) e = e.firstElementChild;
                                    return e;
                                })
                                .append(this)),
                        this
                    );
                },
                wrapInner: function (n) {
                    return m(n)
                        ? this.each(function (e) {
                              S(this).wrapInner(n.call(this, e));
                          })
                        : this.each(function () {
                              var e = S(this),
                                  t = e.contents();
                              t.length ? t.wrapAll(n) : e.append(n);
                          });
                },
                wrap: function (t) {
                    var n = m(t);
                    return this.each(function (e) {
                        S(this).wrapAll(n ? t.call(this, e) : t);
                    });
                },
                unwrap: function (e) {
                    return (
                        this.parent(e)
                            .not("body")
                            .each(function () {
                                S(this).replaceWith(this.childNodes);
                            }),
                        this
                    );
                },
            }),
            (S.expr.pseudos.hidden = function (e) {
                return !S.expr.pseudos.visible(e);
            }),
            (S.expr.pseudos.visible = function (e) {
                return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length);
            }),
            (S.ajaxSettings.xhr = function () {
                try {
                    return new C.XMLHttpRequest();
                } catch (e) {}
            });
        var Bt = { 0: 200, 1223: 204 },
            $t = S.ajaxSettings.xhr();
        (y.cors = !!$t && "withCredentials" in $t),
            (y.ajax = $t = !!$t),
            S.ajaxTransport(function (i) {
                var o, a;
                if (y.cors || ($t && !i.crossDomain))
                    return {
                        send: function (e, t) {
                            var n,
                                r = i.xhr();
                            if ((r.open(i.type, i.url, i.async, i.username, i.password), i.xhrFields)) for (n in i.xhrFields) r[n] = i.xhrFields[n];
                            for (n in (i.mimeType && r.overrideMimeType && r.overrideMimeType(i.mimeType), i.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"), e)) r.setRequestHeader(n, e[n]);
                            (o = function (e) {
                                return function () {
                                    o &&
                                        ((o = a = r.onload = r.onerror = r.onabort = r.ontimeout = r.onreadystatechange = null),
                                        "abort" === e
                                            ? r.abort()
                                            : "error" === e
                                            ? "number" != typeof r.status
                                                ? t(0, "error")
                                                : t(r.status, r.statusText)
                                            : t(
                                                  Bt[r.status] || r.status,
                                                  r.statusText,
                                                  "text" !== (r.responseType || "text") || "string" != typeof r.responseText ? { binary: r.response } : { text: r.responseText },
                                                  r.getAllResponseHeaders()
                                              ));
                                };
                            }),
                                (r.onload = o()),
                                (a = r.onerror = r.ontimeout = o("error")),
                                void 0 !== r.onabort
                                    ? (r.onabort = a)
                                    : (r.onreadystatechange = function () {
                                          4 === r.readyState &&
                                              C.setTimeout(function () {
                                                  o && a();
                                              });
                                      }),
                                (o = o("abort"));
                            try {
                                r.send((i.hasContent && i.data) || null);
                            } catch (e) {
                                if (o) throw e;
                            }
                        },
                        abort: function () {
                            o && o();
                        },
                    };
            }),
            S.ajaxPrefilter(function (e) {
                e.crossDomain && (e.contents.script = !1);
            }),
            S.ajaxSetup({
                accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" },
                contents: { script: /\b(?:java|ecma)script\b/ },
                converters: {
                    "text script": function (e) {
                        return S.globalEval(e), e;
                    },
                },
            }),
            S.ajaxPrefilter("script", function (e) {
                void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET");
            }),
            S.ajaxTransport("script", function (n) {
                var r, i;
                if (n.crossDomain || n.scriptAttrs)
                    return {
                        send: function (e, t) {
                            (r = S("<script>")
                                .attr(n.scriptAttrs || {})
                                .prop({ charset: n.scriptCharset, src: n.url })
                                .on(
                                    "load error",
                                    (i = function (e) {
                                        r.remove(), (i = null), e && t("error" === e.type ? 404 : 200, e.type);
                                    })
                                )),
                                E.head.appendChild(r[0]);
                        },
                        abort: function () {
                            i && i();
                        },
                    };
            });
        var _t,
            zt = [],
            Ut = /(=)\?(?=&|$)|\?\?/;
        S.ajaxSetup({
            jsonp: "callback",
            jsonpCallback: function () {
                var e = zt.pop() || S.expando + "_" + wt.guid++;
                return (this[e] = !0), e;
            },
        }),
            S.ajaxPrefilter("json jsonp", function (e, t, n) {
                var r,
                    i,
                    o,
                    a = !1 !== e.jsonp && (Ut.test(e.url) ? "url" : "string" == typeof e.data && 0 === (e.contentType || "").indexOf("application/x-www-form-urlencoded") && Ut.test(e.data) && "data");
                if (a || "jsonp" === e.dataTypes[0])
                    return (
                        (r = e.jsonpCallback = m(e.jsonpCallback) ? e.jsonpCallback() : e.jsonpCallback),
                        a ? (e[a] = e[a].replace(Ut, "$1" + r)) : !1 !== e.jsonp && (e.url += (Tt.test(e.url) ? "&" : "?") + e.jsonp + "=" + r),
                        (e.converters["script json"] = function () {
                            return o || S.error(r + " was not called"), o[0];
                        }),
                        (e.dataTypes[0] = "json"),
                        (i = C[r]),
                        (C[r] = function () {
                            o = arguments;
                        }),
                        n.always(function () {
                            void 0 === i ? S(C).removeProp(r) : (C[r] = i), e[r] && ((e.jsonpCallback = t.jsonpCallback), zt.push(r)), o && m(i) && i(o[0]), (o = i = void 0);
                        }),
                        "script"
                    );
            }),
            (y.createHTMLDocument = (((_t = E.implementation.createHTMLDocument("").body).innerHTML = "<form></form><form></form>"), 2 === _t.childNodes.length)),
            (S.parseHTML = function (e, t, n) {
                return "string" != typeof e
                    ? []
                    : ("boolean" == typeof t && ((n = t), (t = !1)),
                      t || (y.createHTMLDocument ? (((r = (t = E.implementation.createHTMLDocument("")).createElement("base")).href = E.location.href), t.head.appendChild(r)) : (t = E)),
                      (o = !n && []),
                      (i = N.exec(e)) ? [t.createElement(i[1])] : ((i = xe([e], t, o)), o && o.length && S(o).remove(), S.merge([], i.childNodes)));
                var r, i, o;
            }),
            (S.fn.load = function (e, t, n) {
                var r,
                    i,
                    o,
                    a = this,
                    s = e.indexOf(" ");
                return (
                    -1 < s && ((r = ht(e.slice(s))), (e = e.slice(0, s))),
                    m(t) ? ((n = t), (t = void 0)) : t && "object" == typeof t && (i = "POST"),
                    0 < a.length &&
                        S.ajax({ url: e, type: i || "GET", dataType: "html", data: t })
                            .done(function (e) {
                                (o = arguments), a.html(r ? S("<div>").append(S.parseHTML(e)).find(r) : e);
                            })
                            .always(
                                n &&
                                    function (e, t) {
                                        a.each(function () {
                                            n.apply(this, o || [e.responseText, t, e]);
                                        });
                                    }
                            ),
                    this
                );
            }),
            (S.expr.pseudos.animated = function (t) {
                return S.grep(S.timers, function (e) {
                    return t === e.elem;
                }).length;
            }),
            (S.offset = {
                setOffset: function (e, t, n) {
                    var r,
                        i,
                        o,
                        a,
                        s,
                        u,
                        l = S.css(e, "position"),
                        c = S(e),
                        f = {};
                    "static" === l && (e.style.position = "relative"),
                        (s = c.offset()),
                        (o = S.css(e, "top")),
                        (u = S.css(e, "left")),
                        ("absolute" === l || "fixed" === l) && -1 < (o + u).indexOf("auto") ? ((a = (r = c.position()).top), (i = r.left)) : ((a = parseFloat(o) || 0), (i = parseFloat(u) || 0)),
                        m(t) && (t = t.call(e, n, S.extend({}, s))),
                        null != t.top && (f.top = t.top - s.top + a),
                        null != t.left && (f.left = t.left - s.left + i),
                        "using" in t ? t.using.call(e, f) : c.css(f);
                },
            }),
            S.fn.extend({
                offset: function (t) {
                    if (arguments.length)
                        return void 0 === t
                            ? this
                            : this.each(function (e) {
                                  S.offset.setOffset(this, t, e);
                              });
                    var e,
                        n,
                        r = this[0];
                    return r ? (r.getClientRects().length ? ((e = r.getBoundingClientRect()), (n = r.ownerDocument.defaultView), { top: e.top + n.pageYOffset, left: e.left + n.pageXOffset }) : { top: 0, left: 0 }) : void 0;
                },
                position: function () {
                    if (this[0]) {
                        var e,
                            t,
                            n,
                            r = this[0],
                            i = { top: 0, left: 0 };
                        if ("fixed" === S.css(r, "position")) t = r.getBoundingClientRect();
                        else {
                            (t = this.offset()), (n = r.ownerDocument), (e = r.offsetParent || n.documentElement);
                            while (e && (e === n.body || e === n.documentElement) && "static" === S.css(e, "position")) e = e.parentNode;
                            e && e !== r && 1 === e.nodeType && (((i = S(e).offset()).top += S.css(e, "borderTopWidth", !0)), (i.left += S.css(e, "borderLeftWidth", !0)));
                        }
                        return { top: t.top - i.top - S.css(r, "marginTop", !0), left: t.left - i.left - S.css(r, "marginLeft", !0) };
                    }
                },
                offsetParent: function () {
                    return this.map(function () {
                        var e = this.offsetParent;
                        while (e && "static" === S.css(e, "position")) e = e.offsetParent;
                        return e || re;
                    });
                },
            }),
            S.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (t, i) {
                var o = "pageYOffset" === i;
                S.fn[t] = function (e) {
                    return $(
                        this,
                        function (e, t, n) {
                            var r;
                            if ((x(e) ? (r = e) : 9 === e.nodeType && (r = e.defaultView), void 0 === n)) return r ? r[i] : e[t];
                            r ? r.scrollTo(o ? r.pageXOffset : n, o ? n : r.pageYOffset) : (e[t] = n);
                        },
                        t,
                        e,
                        arguments.length
                    );
                };
            }),
            S.each(["top", "left"], function (e, n) {
                S.cssHooks[n] = Fe(y.pixelPosition, function (e, t) {
                    if (t) return (t = We(e, n)), Pe.test(t) ? S(e).position()[n] + "px" : t;
                });
            }),
            S.each({ Height: "height", Width: "width" }, function (a, s) {
                S.each({ padding: "inner" + a, content: s, "": "outer" + a }, function (r, o) {
                    S.fn[o] = function (e, t) {
                        var n = arguments.length && (r || "boolean" != typeof e),
                            i = r || (!0 === e || !0 === t ? "margin" : "border");
                        return $(
                            this,
                            function (e, t, n) {
                                var r;
                                return x(e)
                                    ? 0 === o.indexOf("outer")
                                        ? e["inner" + a]
                                        : e.document.documentElement["client" + a]
                                    : 9 === e.nodeType
                                    ? ((r = e.documentElement), Math.max(e.body["scroll" + a], r["scroll" + a], e.body["offset" + a], r["offset" + a], r["client" + a]))
                                    : void 0 === n
                                    ? S.css(e, t, i)
                                    : S.style(e, t, n, i);
                            },
                            s,
                            n ? e : void 0,
                            n
                        );
                    };
                });
            }),
            S.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (e, t) {
                S.fn[t] = function (e) {
                    return this.on(t, e);
                };
            }),
            S.fn.extend({
                bind: function (e, t, n) {
                    return this.on(e, null, t, n);
                },
                unbind: function (e, t) {
                    return this.off(e, null, t);
                },
                delegate: function (e, t, n, r) {
                    return this.on(t, e, n, r);
                },
                undelegate: function (e, t, n) {
                    return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n);
                },
                hover: function (e, t) {
                    return this.mouseenter(e).mouseleave(t || e);
                },
            }),
            S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function (e, n) {
                S.fn[n] = function (e, t) {
                    return 0 < arguments.length ? this.on(n, null, e, t) : this.trigger(n);
                };
            });
        var Xt = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
        (S.proxy = function (e, t) {
            var n, r, i;
            if (("string" == typeof t && ((n = e[t]), (t = e), (e = n)), m(e)))
                return (
                    (r = s.call(arguments, 2)),
                    ((i = function () {
                        return e.apply(t || this, r.concat(s.call(arguments)));
                    }).guid = e.guid = e.guid || S.guid++),
                    i
                );
        }),
            (S.holdReady = function (e) {
                e ? S.readyWait++ : S.ready(!0);
            }),
            (S.isArray = Array.isArray),
            (S.parseJSON = JSON.parse),
            (S.nodeName = A),
            (S.isFunction = m),
            (S.isWindow = x),
            (S.camelCase = X),
            (S.type = w),
            (S.now = Date.now),
            (S.isNumeric = function (e) {
                var t = S.type(e);
                return ("number" === t || "string" === t) && !isNaN(e - parseFloat(e));
            }),
            (S.trim = function (e) {
                return null == e ? "" : (e + "").replace(Xt, "");
            }),
            "function" == typeof define &&
                define.amd &&
                define("jquery", [], function () {
                    return S;
                });
        var Vt = C.jQuery,
            Gt = C.$;
        return (
            (S.noConflict = function (e) {
                return C.$ === S && (C.$ = Gt), e && C.jQuery === S && (C.jQuery = Vt), S;
            }),
            "undefined" == typeof e && (C.jQuery = C.$ = S),
            S
        );
    });
}
// ***
(function ($hx_exports, $global) {
    $hx_exports.pingvp = $hx_exports.pingvp || {};
    $hx_exports.haxe = $hx_exports.haxe || {};
    $hx_exports.haxe["remoting"] = $hx_exports.haxe["remoting"] || {};
    var $hxClasses = {},
        $estr = function () {
            return js_Boot.__string_rec(this, "");
        };
    function $extend(from, fields) {
        function Inherit() {}
        Inherit.prototype = from;
        var proto = new Inherit();
        for (var name in fields) {
            proto[name] = fields[name];
        }
        if (fields.toString !== Object.prototype.toString) {
            proto.toString = fields.toString;
        }
        return proto;
    }
    var EReg = function (r, opt) {
        this.r = new RegExp(r, opt.split("u").join(""));
    };
    $hxClasses.EReg = EReg;
    EReg.__name__ = ["EReg"];
    EReg.prototype = {
        match: function (s) {
            if (this.r.global) {
                this.r.lastIndex = 0;
            }
            this.r.m = this.r.exec(s);
            this.r.s = s;
            return this.r.m != null;
        },
        __class__: EReg,
    };
    var HxOverrides = function () {};
    $hxClasses.HxOverrides = HxOverrides;
    HxOverrides.__name__ = ["HxOverrides"];
    HxOverrides.strDate = function (s) {
        var _g = s.length;
        switch (_g) {
            case 8:
                var k = s.split(":");
                var d = new Date();
                d.setTime(0);
                d.setUTCHours(k[0]);
                d.setUTCMinutes(k[1]);
                d.setUTCSeconds(k[2]);
                return d;
            case 10:
                var k1 = s.split("-");
                return new Date(k1[0], k1[1] - 1, k1[2], 0, 0, 0);
            case 19:
                var k2 = s.split(" ");
                var y = k2[0].split("-");
                var t = k2[1].split(":");
                return new Date(y[0], y[1] - 1, y[2], t[0], t[1], t[2]);
            default:
                throw new js__$Boot_HaxeError("Invalid date format : " + s);
        }
    };
    HxOverrides.cca = function (s, index) {
        var x = s.charCodeAt(index);
        if (x != x) {
            return undefined;
        }
        return x;
    };
    HxOverrides.substr = function (s, pos, len) {
        if (len == null) {
            len = s.length;
        } else {
            if (len < 0) {
                if (pos == 0) {
                    len = s.length + len;
                } else {
                    return "";
                }
            }
        }
        return s.substr(pos, len);
    };
    HxOverrides.remove = function (a, obj) {
        var i = a.indexOf(obj);
        if (i == -1) {
            return false;
        }
        a.splice(i, 1);
        return true;
    };
    HxOverrides.iter = function (a) {
        return {
            cur: 0,
            arr: a,
            hasNext: function () {
                return this.cur < this.arr.length;
            },
            next: function () {
                return this.arr[this.cur++];
            },
        };
    };
    var List = function () {
        this.length = 0;
    };
    $hxClasses.List = List;
    List.__name__ = ["List"];
    List.prototype = {
        add: function (item) {
            var x = new _$List_ListNode(item, null);
            if (this.h == null) {
                this.h = x;
            } else {
                this.q.next = x;
            }
            this.q = x;
            this.length++;
        },
        __class__: List,
    };
    var _$List_ListNode = function (item, next) {
        this.item = item;
        this.next = next;
    };
    $hxClasses["_List.ListNode"] = _$List_ListNode;
    _$List_ListNode.__name__ = ["_List", "ListNode"];
    _$List_ListNode.prototype = { __class__: _$List_ListNode };
    var Main = function () {};
    $hxClasses.Main = Main;
    Main.__name__ = ["Main"];
    Main.main = function () {
        window.pingVpLoader = Main.main;
        Main._each = new pingvp_PingVpEach();
    };
    Math.__name__ = ["Math"];
    var Reflect = function () {};
    $hxClasses.Reflect = Reflect;
    Reflect.__name__ = ["Reflect"];
    Reflect.field = function (o, field) {
        try {
            return o[field];
        } catch (e) {
            return null;
        }
    };
    Reflect.fields = function (o) {
        var a = [];
        if (o != null) {
            var hasOwnProperty = Object.prototype.hasOwnProperty;
            for (var f in o) {
                if (f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o, f)) {
                    a.push(f);
                }
            }
        }
        return a;
    };
    Reflect.isFunction = function (f) {
        if (typeof f == "function") {
            return !(f.__name__ || f.__ename__);
        } else {
            return false;
        }
    };
    Reflect.compare = function (a, b) {
        if (a == b) {
            return 0;
        } else {
            if (a > b) {
                return 1;
            } else {
                return -1;
            }
        }
    };
    Reflect.deleteField = function (o, field) {
        if (!Object.prototype.hasOwnProperty.call(o, field)) {
            return false;
        }
        delete o[field];
        return true;
    };
    var Std = function () {};
    $hxClasses.Std = Std;
    Std.__name__ = ["Std"];
    Std.string = function (s) {
        return js_Boot.__string_rec(s, "");
    };
    Std.parseInt = function (x) {
        var v = parseInt(x, 10);
        if (v == 0 && (HxOverrides.cca(x, 1) == 120 || HxOverrides.cca(x, 1) == 88)) {
            v = parseInt(x);
        }
        if (isNaN(v)) {
            return null;
        }
        return v;
    };
    var StringBuf = function () {
        this.b = "";
    };
    $hxClasses.StringBuf = StringBuf;
    StringBuf.__name__ = ["StringBuf"];
    StringBuf.prototype = { __class__: StringBuf };
    var StringTools = function () {};
    $hxClasses.StringTools = StringTools;
    StringTools.__name__ = ["StringTools"];
    StringTools.htmlEscape = function (s, quotes) {
        s = s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
        if (quotes) {
            return s.split('"').join("&quot;").split("'").join("&#039;");
        } else {
            return s;
        }
    };
    StringTools.isSpace = function (s, pos) {
        var c = HxOverrides.cca(s, pos);
        if (!(c > 8 && c < 14)) {
            return c == 32;
        } else {
            return true;
        }
    };
    StringTools.ltrim = function (s) {
        var l = s.length;
        var r = 0;
        while (r < l && StringTools.isSpace(s, r)) {
            ++r;
        }
        if (r > 0) {
            return HxOverrides.substr(s, r, l - r);
        } else {
            return s;
        }
    };
    StringTools.rtrim = function (s) {
        var l = s.length;
        var r = 0;
        while (r < l && StringTools.isSpace(s, l - r - 1)) {
            ++r;
        }
        if (r > 0) {
            return HxOverrides.substr(s, 0, l - r);
        } else {
            return s;
        }
    };
    StringTools.trim = function (s) {
        return StringTools.ltrim(StringTools.rtrim(s));
    };
    StringTools.replace = function (s, sub, by) {
        return s.split(sub).join(by);
    };
    var ValueType = ($hxClasses.ValueType = { __ename__: ["ValueType"], __constructs__: ["TNull", "TInt", "TFloat", "TBool", "TObject", "TFunction", "TClass", "TEnum", "TUnknown"] });
    ValueType.TNull = ["TNull", 0];
    ValueType.TNull.toString = $estr;
    ValueType.TNull.__enum__ = ValueType;
    ValueType.TInt = ["TInt", 1];
    ValueType.TInt.toString = $estr;
    ValueType.TInt.__enum__ = ValueType;
    ValueType.TFloat = ["TFloat", 2];
    ValueType.TFloat.toString = $estr;
    ValueType.TFloat.__enum__ = ValueType;
    ValueType.TBool = ["TBool", 3];
    ValueType.TBool.toString = $estr;
    ValueType.TBool.__enum__ = ValueType;
    ValueType.TObject = ["TObject", 4];
    ValueType.TObject.toString = $estr;
    ValueType.TObject.__enum__ = ValueType;
    ValueType.TFunction = ["TFunction", 5];
    ValueType.TFunction.toString = $estr;
    ValueType.TFunction.__enum__ = ValueType;
    ValueType.TClass = function (c) {
        var $x = ["TClass", 6, c];
        $x.__enum__ = ValueType;
        $x.toString = $estr;
        return $x;
    };
    ValueType.TEnum = function (e) {
        var $x = ["TEnum", 7, e];
        $x.__enum__ = ValueType;
        $x.toString = $estr;
        return $x;
    };
    ValueType.TUnknown = ["TUnknown", 8];
    ValueType.TUnknown.toString = $estr;
    ValueType.TUnknown.__enum__ = ValueType;
    var Type = function () {};
    $hxClasses.Type = Type;
    Type.__name__ = ["Type"];
    Type.getClassName = function (c) {
        var a = c.__name__;
        if (a == null) {
            return null;
        }
        return a.join(".");
    };
    Type.getEnumName = function (e) {
        var a = e.__ename__;
        return a.join(".");
    };
    Type.resolveClass = function (name) {
        var cl = $hxClasses[name];
        if (cl == null || !cl.__name__) {
            return null;
        }
        return cl;
    };
    Type.resolveEnum = function (name) {
        var e = $hxClasses[name];
        if (e == null || !e.__ename__) {
            return null;
        }
        return e;
    };
    Type.createEmptyInstance = function (cl) {
        function empty() {}
        empty.prototype = cl.prototype;
        return new empty();
    };
    Type.createEnum = function (e, constr, params) {
        var f = Reflect.field(e, constr);
        if (f == null) {
            throw new js__$Boot_HaxeError("No such constructor " + constr);
        }
        if (Reflect.isFunction(f)) {
            if (params == null) {
                throw new js__$Boot_HaxeError("Constructor " + constr + " need parameters");
            }
            return f.apply(e, params);
        }
        if (params != null && params.length != 0) {
            throw new js__$Boot_HaxeError("Constructor " + constr + " does not need parameters");
        }
        return f;
    };
    Type["typeof"] = function (v) {
        var _g = typeof v;
        switch (_g) {
            case "boolean":
                return ValueType.TBool;
            case "function":
                if (v.__name__ || v.__ename__) {
                    return ValueType.TObject;
                }
                return ValueType.TFunction;
            case "number":
                if (Math.ceil(v) == v % 2147483648) {
                    return ValueType.TInt;
                }
                return ValueType.TFloat;
            case "object":
                if (v == null) {
                    return ValueType.TNull;
                }
                var e = v.__enum__;
                if (e != null) {
                    return ValueType.TEnum(e);
                }
                var c = js_Boot.getClass(v);
                if (c != null) {
                    return ValueType.TClass(c);
                }
                return ValueType.TObject;
            case "string":
                return ValueType.TClass(String);
            case "undefined":
                return ValueType.TNull;
            default:
                return ValueType.TUnknown;
        }
    };
    var haxe_IMap = function () {};
    $hxClasses["haxe.IMap"] = haxe_IMap;
    haxe_IMap.__name__ = ["haxe", "IMap"];
    var haxe_Serializer = function () {
        this.buf = new StringBuf();
        this.cache = [];
        this.useCache = haxe_Serializer.USE_CACHE;
        this.useEnumIndex = haxe_Serializer.USE_ENUM_INDEX;
        this.shash = new haxe_ds_StringMap();
        this.scount = 0;
    };
    $hxClasses["haxe.Serializer"] = haxe_Serializer;
    haxe_Serializer.__name__ = ["haxe", "Serializer"];
    haxe_Serializer.prototype = {
        toString: function () {
            return this.buf.b;
        },
        serializeString: function (s) {
            var _this = this.shash;
            var x = __map_reserved[s] != null ? _this.getReserved(s) : _this.h[s];
            if (x != null) {
                this.buf.b += "R";
                this.buf.b += x == null ? "null" : "" + x;
                return;
            }
            var _this1 = this.shash;
            var value = this.scount++;
            if (__map_reserved[s] != null) {
                _this1.setReserved(s, value);
            } else {
                _this1.h[s] = value;
            }
            this.buf.b += "y";
            s = encodeURIComponent(s);
            this.buf.b += Std.string(s.length);
            this.buf.b += ":";
            this.buf.b += s == null ? "null" : "" + s;
        },
        serializeRef: function (v) {
            var vt = typeof v;
            var _g1 = 0;
            var _g = this.cache.length;
            while (_g1 < _g) {
                var i = _g1++;
                var ci = this.cache[i];
                if (typeof ci == vt && ci == v) {
                    this.buf.b += "r";
                    this.buf.b += i == null ? "null" : "" + i;
                    return true;
                }
            }
            this.cache.push(v);
            return false;
        },
        serializeFields: function (v) {
            var _g = 0;
            var _g1 = Reflect.fields(v);
            while (_g < _g1.length) {
                var f = _g1[_g];
                ++_g;
                this.serializeString(f);
                this.serialize(Reflect.field(v, f));
            }
            this.buf.b += "g";
        },
        serialize: function (v) {
            var _g = Type["typeof"](v);
            switch (_g[1]) {
                case 0:
                    this.buf.b += "n";
                    break;
                case 1:
                    var v1 = v;
                    if (v1 == 0) {
                        this.buf.b += "z";
                        return;
                    }
                    this.buf.b += "i";
                    this.buf.b += v1 == null ? "null" : "" + v1;
                    break;
                case 2:
                    var v2 = v;
                    if (isNaN(v2)) {
                        this.buf.b += "k";
                    } else {
                        if (!isFinite(v2)) {
                            this.buf.b += v2 < 0 ? "m" : "p";
                        } else {
                            this.buf.b += "d";
                            this.buf.b += v2 == null ? "null" : "" + v2;
                        }
                    }
                    break;
                case 3:
                    this.buf.b += v ? "t" : "f";
                    break;
                case 4:
                    if (js_Boot.__instanceof(v, Class)) {
                        var className = Type.getClassName(v);
                        this.buf.b += "A";
                        this.serializeString(className);
                    } else {
                        if (js_Boot.__instanceof(v, Enum)) {
                            this.buf.b += "B";
                            this.serializeString(Type.getEnumName(v));
                        } else {
                            if (this.useCache && this.serializeRef(v)) {
                                return;
                            }
                            this.buf.b += "o";
                            this.serializeFields(v);
                        }
                    }
                    break;
                case 5:
                    throw new js__$Boot_HaxeError("Cannot serialize function");
                    break;
                case 6:
                    var c = _g[2];
                    if (c == String) {
                        this.serializeString(v);
                        return;
                    }
                    if (this.useCache && this.serializeRef(v)) {
                        return;
                    }
                    switch (c) {
                        case Array:
                            var ucount = 0;
                            this.buf.b += "a";
                            var l = v.length;
                            var _g1 = 0;
                            var _g2 = l;
                            while (_g1 < _g2) {
                                var i = _g1++;
                                if (v[i] == null) {
                                    ++ucount;
                                } else {
                                    if (ucount > 0) {
                                        if (ucount == 1) {
                                            this.buf.b += "n";
                                        } else {
                                            this.buf.b += "u";
                                            this.buf.b += ucount == null ? "null" : "" + ucount;
                                        }
                                        ucount = 0;
                                    }
                                    this.serialize(v[i]);
                                }
                            }
                            if (ucount > 0) {
                                if (ucount == 1) {
                                    this.buf.b += "n";
                                } else {
                                    this.buf.b += "u";
                                    this.buf.b += ucount == null ? "null" : "" + ucount;
                                }
                            }
                            this.buf.b += "h";
                            break;
                        case Date:
                            var d = v;
                            this.buf.b += "v";
                            this.buf.b += Std.string(d.getTime());
                            break;
                        case List:
                            this.buf.b += "l";
                            var v3 = v;
                            var _g_head = v3.h;
                            while (_g_head != null) {
                                var val = _g_head.item;
                                _g_head = _g_head.next;
                                var i1 = val;
                                this.serialize(i1);
                            }
                            this.buf.b += "h";
                            break;
                        case haxe_ds_IntMap:
                            this.buf.b += "q";
                            var v4 = v;
                            var k = v4.keys();
                            while (k.hasNext()) {
                                var k1 = k.next();
                                this.buf.b += ":";
                                this.buf.b += k1 == null ? "null" : "" + k1;
                                this.serialize(v4.h[k1]);
                            }
                            this.buf.b += "h";
                            break;
                        case haxe_ds_ObjectMap:
                            this.buf.b += "M";
                            var v5 = v;
                            var k2 = v5.keys();
                            while (k2.hasNext()) {
                                var k3 = k2.next();
                                var id = Reflect.field(k3, "__id__");
                                Reflect.deleteField(k3, "__id__");
                                this.serialize(k3);
                                k3.__id__ = id;
                                this.serialize(v5.h[k3.__id__]);
                            }
                            this.buf.b += "h";
                            break;
                        case haxe_ds_StringMap:
                            this.buf.b += "b";
                            var v6 = v;
                            var k4 = v6.keys();
                            while (k4.hasNext()) {
                                var k5 = k4.next();
                                this.serializeString(k5);
                                this.serialize(__map_reserved[k5] != null ? v6.getReserved(k5) : v6.h[k5]);
                            }
                            this.buf.b += "h";
                            break;
                        case haxe_io_Bytes:
                            var v7 = v;
                            this.buf.b += "s";
                            this.buf.b += Std.string(Math.ceil((v7.length * 8) / 6));
                            this.buf.b += ":";
                            var i2 = 0;
                            var max = v7.length - 2;
                            var b64 = haxe_Serializer.BASE64_CODES;
                            if (b64 == null) {
                                var length = haxe_Serializer.BASE64.length;
                                var this1 = new Array(length);
                                b64 = this1;
                                var _g11 = 0;
                                var _g3 = haxe_Serializer.BASE64.length;
                                while (_g11 < _g3) {
                                    var i3 = _g11++;
                                    b64[i3] = HxOverrides.cca(haxe_Serializer.BASE64, i3);
                                }
                                haxe_Serializer.BASE64_CODES = b64;
                            }
                            while (i2 < max) {
                                var b1 = v7.b[i2++];
                                var b2 = v7.b[i2++];
                                var b3 = v7.b[i2++];
                                this.buf.b += String.fromCharCode(b64[b1 >> 2]);
                                this.buf.b += String.fromCharCode(b64[((b1 << 4) | (b2 >> 4)) & 63]);
                                this.buf.b += String.fromCharCode(b64[((b2 << 2) | (b3 >> 6)) & 63]);
                                this.buf.b += String.fromCharCode(b64[b3 & 63]);
                            }
                            if (i2 == max) {
                                var b11 = v7.b[i2++];
                                var b21 = v7.b[i2++];
                                this.buf.b += String.fromCharCode(b64[b11 >> 2]);
                                this.buf.b += String.fromCharCode(b64[((b11 << 4) | (b21 >> 4)) & 63]);
                                this.buf.b += String.fromCharCode(b64[(b21 << 2) & 63]);
                            } else {
                                if (i2 == max + 1) {
                                    var b12 = v7.b[i2++];
                                    this.buf.b += String.fromCharCode(b64[b12 >> 2]);
                                    this.buf.b += String.fromCharCode(b64[(b12 << 4) & 63]);
                                }
                            }
                            break;
                        default:
                            if (this.useCache) {
                                this.cache.pop();
                            }
                            if (v.hxSerialize != null) {
                                this.buf.b += "C";
                                this.serializeString(Type.getClassName(c));
                                if (this.useCache) {
                                    this.cache.push(v);
                                }
                                v.hxSerialize(this);
                                this.buf.b += "g";
                            } else {
                                this.buf.b += "c";
                                this.serializeString(Type.getClassName(c));
                                if (this.useCache) {
                                    this.cache.push(v);
                                }
                                this.serializeFields(v);
                            }
                    }
                    break;
                case 7:
                    var e = _g[2];
                    if (this.useCache) {
                        if (this.serializeRef(v)) {
                            return;
                        }
                        this.cache.pop();
                    }
                    this.buf.b += Std.string(this.useEnumIndex ? "j" : "w");
                    this.serializeString(Type.getEnumName(e));
                    if (this.useEnumIndex) {
                        this.buf.b += ":";
                        this.buf.b += Std.string(v[1]);
                    } else {
                        this.serializeString(v[0]);
                    }
                    this.buf.b += ":";
                    var l1 = v.length;
                    this.buf.b += Std.string(l1 - 2);
                    var _g12 = 2;
                    var _g4 = l1;
                    while (_g12 < _g4) {
                        var i4 = _g12++;
                        this.serialize(v[i4]);
                    }
                    if (this.useCache) {
                        this.cache.push(v);
                    }
                    break;
                default:
                    throw new js__$Boot_HaxeError("Cannot serialize " + Std.string(v));
            }
        },
        serializeException: function (e) {
            this.buf.b += "x";
            this.serialize(e);
        },
        __class__: haxe_Serializer,
    };
    var haxe_Timer = function (time_ms) {
        var me = this;
        this.id = setInterval(function () {
            me.run();
        }, time_ms);
    };
    $hxClasses["haxe.Timer"] = haxe_Timer;
    haxe_Timer.__name__ = ["haxe", "Timer"];
    haxe_Timer.delay = function (f, time_ms) {
        var t = new haxe_Timer(time_ms);
        t.run = function () {
            t.stop();
            f();
        };
        return t;
    };
    haxe_Timer.prototype = {
        stop: function () {
            if (this.id == null) {
                return;
            }
            clearInterval(this.id);
            this.id = null;
        },
        run: function () {},
        __class__: haxe_Timer,
    };
    var haxe__$Unserializer_DefaultResolver = function () {};
    $hxClasses["haxe._Unserializer.DefaultResolver"] = haxe__$Unserializer_DefaultResolver;
    haxe__$Unserializer_DefaultResolver.__name__ = ["haxe", "_Unserializer", "DefaultResolver"];
    haxe__$Unserializer_DefaultResolver.prototype = {
        resolveClass: function (name) {
            return Type.resolveClass(name);
        },
        resolveEnum: function (name) {
            return Type.resolveEnum(name);
        },
        __class__: haxe__$Unserializer_DefaultResolver,
    };
    var haxe_Unserializer = function (buf) {
        this.buf = buf;
        this.length = buf.length;
        this.pos = 0;
        this.scache = [];
        this.cache = [];
        var r = haxe_Unserializer.DEFAULT_RESOLVER;
        if (r == null) {
            r = new haxe__$Unserializer_DefaultResolver();
            haxe_Unserializer.DEFAULT_RESOLVER = r;
        }
        this.resolver = r;
    };
    $hxClasses["haxe.Unserializer"] = haxe_Unserializer;
    haxe_Unserializer.__name__ = ["haxe", "Unserializer"];
    haxe_Unserializer.initCodes = function () {
        var codes = [];
        var _g1 = 0;
        var _g = haxe_Unserializer.BASE64.length;
        while (_g1 < _g) {
            var i = _g1++;
            codes[haxe_Unserializer.BASE64.charCodeAt(i)] = i;
        }
        return codes;
    };
    haxe_Unserializer.prototype = {
        readDigits: function () {
            var k = 0;
            var s = false;
            var fpos = this.pos;
            while (true) {
                var c = this.buf.charCodeAt(this.pos);
                if (c != c) {
                    break;
                }
                if (c == 45) {
                    if (this.pos != fpos) {
                        break;
                    }
                    s = true;
                    this.pos++;
                    continue;
                }
                if (c < 48 || c > 57) {
                    break;
                }
                k = k * 10 + (c - 48);
                this.pos++;
            }
            if (s) {
                k *= -1;
            }
            return k;
        },
        readFloat: function () {
            var p1 = this.pos;
            while (true) {
                var c = this.buf.charCodeAt(this.pos);
                if (c != c) {
                    break;
                }
                if ((c >= 43 && c < 58) || c == 101 || c == 69) {
                    this.pos++;
                } else {
                    break;
                }
            }
            return parseFloat(HxOverrides.substr(this.buf, p1, this.pos - p1));
        },
        unserializeObject: function (o) {
            while (true) {
                if (this.pos >= this.length) {
                    throw new js__$Boot_HaxeError("Invalid object");
                }
                if (this.buf.charCodeAt(this.pos) == 103) {
                    break;
                }
                var k = this.unserialize();
                if (typeof k != "string") {
                    throw new js__$Boot_HaxeError("Invalid object key");
                }
                var v = this.unserialize();
                o[k] = v;
            }
            this.pos++;
        },
        unserializeEnum: function (edecl, tag) {
            if (this.buf.charCodeAt(this.pos++) != 58) {
                throw new js__$Boot_HaxeError("Invalid enum format");
            }
            var nargs = this.readDigits();
            if (nargs == 0) {
                return Type.createEnum(edecl, tag);
            }
            var args = [];
            while (nargs-- > 0) {
                args.push(this.unserialize());
            }
            return Type.createEnum(edecl, tag, args);
        },
        unserialize: function () {
            var _g = this.buf.charCodeAt(this.pos++);
            switch (_g) {
                case 65:
                    var name = this.unserialize();
                    var cl = this.resolver.resolveClass(name);
                    if (cl == null) {
                        throw new js__$Boot_HaxeError("Class not found " + name);
                    }
                    return cl;
                case 66:
                    var name1 = this.unserialize();
                    var e = this.resolver.resolveEnum(name1);
                    if (e == null) {
                        throw new js__$Boot_HaxeError("Enum not found " + name1);
                    }
                    return e;
                case 67:
                    var name2 = this.unserialize();
                    var cl1 = this.resolver.resolveClass(name2);
                    if (cl1 == null) {
                        throw new js__$Boot_HaxeError("Class not found " + name2);
                    }
                    var o = Type.createEmptyInstance(cl1);
                    this.cache.push(o);
                    o.hxUnserialize(this);
                    if (this.buf.charCodeAt(this.pos++) != 103) {
                        throw new js__$Boot_HaxeError("Invalid custom data");
                    }
                    return o;
                case 77:
                    var h = new haxe_ds_ObjectMap();
                    this.cache.push(h);
                    var buf = this.buf;
                    while (this.buf.charCodeAt(this.pos) != 104) {
                        var s = this.unserialize();
                        h.set(s, this.unserialize());
                    }
                    this.pos++;
                    return h;
                case 82:
                    var n = this.readDigits();
                    if (n < 0 || n >= this.scache.length) {
                        throw new js__$Boot_HaxeError("Invalid string reference");
                    }
                    return this.scache[n];
                case 97:
                    var buf1 = this.buf;
                    var a = [];
                    this.cache.push(a);
                    while (true) {
                        var c = this.buf.charCodeAt(this.pos);
                        if (c == 104) {
                            this.pos++;
                            break;
                        }
                        if (c == 117) {
                            this.pos++;
                            var n1 = this.readDigits();
                            a[a.length + n1 - 1] = null;
                        } else {
                            a.push(this.unserialize());
                        }
                    }
                    return a;
                case 98:
                    var h1 = new haxe_ds_StringMap();
                    this.cache.push(h1);
                    var buf2 = this.buf;
                    while (this.buf.charCodeAt(this.pos) != 104) {
                        var s1 = this.unserialize();
                        var value = this.unserialize();
                        if (__map_reserved[s1] != null) {
                            h1.setReserved(s1, value);
                        } else {
                            h1.h[s1] = value;
                        }
                    }
                    this.pos++;
                    return h1;
                case 99:
                    var name3 = this.unserialize();
                    var cl2 = this.resolver.resolveClass(name3);
                    if (cl2 == null) {
                        throw new js__$Boot_HaxeError("Class not found " + name3);
                    }
                    var o1 = Type.createEmptyInstance(cl2);
                    this.cache.push(o1);
                    this.unserializeObject(o1);
                    return o1;
                case 100:
                    return this.readFloat();
                case 102:
                    return false;
                case 105:
                    return this.readDigits();
                case 106:
                    var name4 = this.unserialize();
                    var edecl = this.resolver.resolveEnum(name4);
                    if (edecl == null) {
                        throw new js__$Boot_HaxeError("Enum not found " + name4);
                    }
                    this.pos++;
                    var index = this.readDigits();
                    var tag = edecl.__constructs__.slice()[index];
                    if (tag == null) {
                        throw new js__$Boot_HaxeError("Unknown enum index " + name4 + "@" + index);
                    }
                    var e1 = this.unserializeEnum(edecl, tag);
                    this.cache.push(e1);
                    return e1;
                case 107:
                    return NaN;
                case 108:
                    var l = new List();
                    this.cache.push(l);
                    var buf3 = this.buf;
                    while (this.buf.charCodeAt(this.pos) != 104) {
                        l.add(this.unserialize());
                    }
                    this.pos++;
                    return l;
                case 109:
                    return -Infinity;
                case 110:
                    return null;
                case 111:
                    var o2 = {};
                    this.cache.push(o2);
                    this.unserializeObject(o2);
                    return o2;
                case 112:
                    return Infinity;
                case 113:
                    var h2 = new haxe_ds_IntMap();
                    this.cache.push(h2);
                    var buf4 = this.buf;
                    var c1 = this.buf.charCodeAt(this.pos++);
                    while (c1 == 58) {
                        var i = this.readDigits();
                        var value1 = this.unserialize();
                        h2.h[i] = value1;
                        c1 = this.buf.charCodeAt(this.pos++);
                    }
                    if (c1 != 104) {
                        throw new js__$Boot_HaxeError("Invalid IntMap format");
                    }
                    return h2;
                case 114:
                    var n2 = this.readDigits();
                    if (n2 < 0 || n2 >= this.cache.length) {
                        throw new js__$Boot_HaxeError("Invalid reference");
                    }
                    return this.cache[n2];
                case 115:
                    var len = this.readDigits();
                    var buf5 = this.buf;
                    if (this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) {
                        throw new js__$Boot_HaxeError("Invalid bytes length");
                    }
                    var codes = haxe_Unserializer.CODES;
                    if (codes == null) {
                        codes = haxe_Unserializer.initCodes();
                        haxe_Unserializer.CODES = codes;
                    }
                    var i1 = this.pos;
                    var rest = len & 3;
                    var size = (len >> 2) * 3 + (rest >= 2 ? rest - 1 : 0);
                    var max = i1 + (len - rest);
                    var bytes = new haxe_io_Bytes(new ArrayBuffer(size));
                    var bpos = 0;
                    while (i1 < max) {
                        var c11 = codes[buf5.charCodeAt(i1++)];
                        var c2 = codes[buf5.charCodeAt(i1++)];
                        bytes.b[bpos++] = ((c11 << 2) | (c2 >> 4)) & 255;
                        var c3 = codes[buf5.charCodeAt(i1++)];
                        bytes.b[bpos++] = ((c2 << 4) | (c3 >> 2)) & 255;
                        var c4 = codes[buf5.charCodeAt(i1++)];
                        bytes.b[bpos++] = ((c3 << 6) | c4) & 255;
                    }
                    if (rest >= 2) {
                        var c12 = codes[buf5.charCodeAt(i1++)];
                        var c21 = codes[buf5.charCodeAt(i1++)];
                        bytes.b[bpos++] = ((c12 << 2) | (c21 >> 4)) & 255;
                        if (rest == 3) {
                            var c31 = codes[buf5.charCodeAt(i1++)];
                            bytes.b[bpos++] = ((c21 << 4) | (c31 >> 2)) & 255;
                        }
                    }
                    this.pos += len;
                    this.cache.push(bytes);
                    return bytes;
                case 116:
                    return true;
                case 118:
                    var d;
                    if (
                        this.buf.charCodeAt(this.pos) >= 48 &&
                        this.buf.charCodeAt(this.pos) <= 57 &&
                        this.buf.charCodeAt(this.pos + 1) >= 48 &&
                        this.buf.charCodeAt(this.pos + 1) <= 57 &&
                        this.buf.charCodeAt(this.pos + 2) >= 48 &&
                        this.buf.charCodeAt(this.pos + 2) <= 57 &&
                        this.buf.charCodeAt(this.pos + 3) >= 48 &&
                        this.buf.charCodeAt(this.pos + 3) <= 57 &&
                        this.buf.charCodeAt(this.pos + 4) == 45
                    ) {
                        d = HxOverrides.strDate(HxOverrides.substr(this.buf, this.pos, 19));
                        this.pos += 19;
                    } else {
                        var t = this.readFloat();
                        d = new Date(t);
                    }
                    this.cache.push(d);
                    return d;
                case 119:
                    var name5 = this.unserialize();
                    var edecl1 = this.resolver.resolveEnum(name5);
                    if (edecl1 == null) {
                        throw new js__$Boot_HaxeError("Enum not found " + name5);
                    }
                    var e2 = this.unserializeEnum(edecl1, this.unserialize());
                    this.cache.push(e2);
                    return e2;
                case 120:
                    throw js__$Boot_HaxeError.wrap(this.unserialize());
                    break;
                case 121:
                    var len1 = this.readDigits();
                    if (this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len1) {
                        throw new js__$Boot_HaxeError("Invalid string length");
                    }
                    var s2 = HxOverrides.substr(this.buf, this.pos, len1);
                    this.pos += len1;
                    s2 = decodeURIComponent(s2.split("+").join(" "));
                    this.scache.push(s2);
                    return s2;
                case 122:
                    return 0;
                default:
            }
            this.pos--;
            throw new js__$Boot_HaxeError("Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos);
        },
        __class__: haxe_Unserializer,
    };
    var haxe_ds_IntMap = function () {
        this.h = {};
    };
    $hxClasses["haxe.ds.IntMap"] = haxe_ds_IntMap;
    haxe_ds_IntMap.__name__ = ["haxe", "ds", "IntMap"];
    haxe_ds_IntMap.__interfaces__ = [haxe_IMap];
    haxe_ds_IntMap.prototype = {
        keys: function () {
            var a = [];
            for (var key in this.h) {
                if (this.h.hasOwnProperty(key)) {
                    a.push(key | 0);
                }
            }
            return HxOverrides.iter(a);
        },
        __class__: haxe_ds_IntMap,
    };
    var haxe_ds_ObjectMap = function () {
        this.h = { __keys__: {} };
    };
    $hxClasses["haxe.ds.ObjectMap"] = haxe_ds_ObjectMap;
    haxe_ds_ObjectMap.__name__ = ["haxe", "ds", "ObjectMap"];
    haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap];
    haxe_ds_ObjectMap.assignId = function (obj) {
        return (obj.__id__ = ++haxe_ds_ObjectMap.count);
    };
    haxe_ds_ObjectMap.getId = function (obj) {
        return obj.__id__;
    };
    haxe_ds_ObjectMap.prototype = {
        set: function (key, value) {
            var id = key.__id__ || (key.__id__ = ++haxe_ds_ObjectMap.count);
            this.h[id] = value;
            this.h.__keys__[id] = key;
        },
        keys: function () {
            var a = [];
            for (var key in this.h.__keys__) {
                if (this.h.hasOwnProperty(key)) {
                    a.push(this.h.__keys__[key]);
                }
            }
            return HxOverrides.iter(a);
        },
        __class__: haxe_ds_ObjectMap,
    };
    var haxe_ds_StringMap = function () {
        this.h = {};
    };
    $hxClasses["haxe.ds.StringMap"] = haxe_ds_StringMap;
    haxe_ds_StringMap.__name__ = ["haxe", "ds", "StringMap"];
    haxe_ds_StringMap.__interfaces__ = [haxe_IMap];
    haxe_ds_StringMap.prototype = {
        setReserved: function (key, value) {
            if (this.rh == null) {
                this.rh = {};
            }
            this.rh["$" + key] = value;
        },
        getReserved: function (key) {
            if (this.rh == null) {
                return null;
            } else {
                return this.rh["$" + key];
            }
        },
        keys: function () {
            return HxOverrides.iter(this.arrayKeys());
        },
        arrayKeys: function () {
            var out = [];
            for (var key in this.h) {
                if (this.h.hasOwnProperty(key)) {
                    out.push(key);
                }
            }
            if (this.rh != null) {
                for (var key in this.rh) {
                    if (key.charCodeAt(0) == 36) {
                        out.push(key.substr(1));
                    }
                }
            }
            return out;
        },
        __class__: haxe_ds_StringMap,
    };
    var haxe_io_Bytes = function (data) {
        this.length = data.byteLength;
        this.b = new Uint8Array(data);
        this.b.bufferValue = data;
        data.hxBytes = this;
        data.bytes = this.b;
    };
    $hxClasses["haxe.io.Bytes"] = haxe_io_Bytes;
    haxe_io_Bytes.__name__ = ["haxe", "io", "Bytes"];
    haxe_io_Bytes.alloc = function (length) {
        return new haxe_io_Bytes(new ArrayBuffer(length));
    };
    haxe_io_Bytes.ofString = function (s) {
        var a = [];
        var i = 0;
        while (i < s.length) {
            var c = s.charCodeAt(i++);
            if (55296 <= c && c <= 56319) {
                c = ((c - 55232) << 10) | (s.charCodeAt(i++) & 1023);
            }
            if (c <= 127) {
                a.push(c);
            } else {
                if (c <= 2047) {
                    a.push(192 | (c >> 6));
                    a.push(128 | (c & 63));
                } else {
                    if (c <= 65535) {
                        a.push(224 | (c >> 12));
                        a.push(128 | ((c >> 6) & 63));
                        a.push(128 | (c & 63));
                    } else {
                        a.push(240 | (c >> 18));
                        a.push(128 | ((c >> 12) & 63));
                        a.push(128 | ((c >> 6) & 63));
                        a.push(128 | (c & 63));
                    }
                }
            }
        }
        return new haxe_io_Bytes(new Uint8Array(a).buffer);
    };
    haxe_io_Bytes.ofData = function (b) {
        var hb = b.hxBytes;
        if (hb != null) {
            return hb;
        }
        return new haxe_io_Bytes(b);
    };
    haxe_io_Bytes.fastGet = function (b, pos) {
        return b.bytes[pos];
    };
    haxe_io_Bytes.prototype = { __class__: haxe_io_Bytes };
    var haxe_remoting_Connection = function () {};
    $hxClasses["haxe.remoting.Connection"] = haxe_remoting_Connection;
    haxe_remoting_Connection.__name__ = ["haxe", "remoting", "Connection"];
    var haxe_remoting_Context = function () {};
    $hxClasses["haxe.remoting.Context"] = haxe_remoting_Context;
    haxe_remoting_Context.__name__ = ["haxe", "remoting", "Context"];
    haxe_remoting_Context.prototype = {
        call: function (path, params) {
            if (path.length < 2) {
                throw new js__$Boot_HaxeError("Invalid path '" + path.join(".") + "'");
            }
            var _this = this.objects;
            var key = path[0];
            var inf = __map_reserved[key] != null ? _this.getReserved(key) : _this.h[key];
            if (inf == null) {
                throw new js__$Boot_HaxeError("No such object " + path[0]);
            }
            var o = inf.obj;
            var m = Reflect.field(o, path[1]);
            if (path.length > 2) {
                if (!inf.rec) {
                    throw new js__$Boot_HaxeError("Can't access " + path.join("."));
                }
                var _g1 = 2;
                var _g = path.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    o = m;
                    m = Reflect.field(o, path[i]);
                }
            }
            if (!Reflect.isFunction(m)) {
                throw new js__$Boot_HaxeError("No such method " + path.join("."));
            }
            return m.apply(o, params);
        },
        __class__: haxe_remoting_Context,
    };
    var haxe_remoting_ExternalConnection = ($hx_exports.haxe["remoting"]["ExternalConnection"] = function () {});
    $hxClasses["haxe.remoting.ExternalConnection"] = haxe_remoting_ExternalConnection;
    haxe_remoting_ExternalConnection.__name__ = ["haxe", "remoting", "ExternalConnection"];
    haxe_remoting_ExternalConnection.__interfaces__ = [haxe_remoting_Connection];
    haxe_remoting_ExternalConnection.doCall = function (name, path, params) {
        try {
            var _this = haxe_remoting_ExternalConnection.connections;
            var cnx = __map_reserved[name] != null ? _this.getReserved(name) : _this.h[name];
            if (cnx == null) {
                throw new js__$Boot_HaxeError("Unknown connection : " + name);
            }
            if (cnx.__data.ctx == null) {
                throw new js__$Boot_HaxeError("No context shared for the connection " + name);
            }
            var params1 = new haxe_Unserializer(params).unserialize();
            var ret = cnx.__data.ctx.call(path.split("."), params1);
            var s = new haxe_Serializer();
            s.serialize(ret);
            return s.toString() + "#";
        } catch (e) {
            if (e instanceof js__$Boot_HaxeError) {
                e = e.val;
            }
            var s1 = new haxe_Serializer();
            s1.serializeException(e);
            return s1.toString();
        }
    };
    haxe_remoting_ExternalConnection.prototype = { __class__: haxe_remoting_ExternalConnection };
    var js__$Boot_HaxeError = function (val) {
        Error.call(this);
        this.val = val;
        this.message = String(val);
        if (Error.captureStackTrace) {
            Error.captureStackTrace(this, js__$Boot_HaxeError);
        }
    };
    $hxClasses["js._Boot.HaxeError"] = js__$Boot_HaxeError;
    js__$Boot_HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
    js__$Boot_HaxeError.wrap = function (val) {
        if (val instanceof Error) {
            return val;
        } else {
            return new js__$Boot_HaxeError(val);
        }
    };
    js__$Boot_HaxeError.__super__ = Error;
    js__$Boot_HaxeError.prototype = $extend(Error.prototype, { __class__: js__$Boot_HaxeError });
    var js_Boot = function () {};
    $hxClasses["js.Boot"] = js_Boot;
    js_Boot.__name__ = ["js", "Boot"];
    js_Boot.getClass = function (o) {
        if (o instanceof Array && o.__enum__ == null) {
            return Array;
        } else {
            var cl = o.__class__;
            if (cl != null) {
                return cl;
            }
            var name = js_Boot.__nativeClassName(o);
            if (name != null) {
                return js_Boot.__resolveNativeClass(name);
            }
            return null;
        }
    };
    js_Boot.__string_rec = function (o, s) {
        if (o == null) {
            return "null";
        }
        if (s.length >= 5) {
            return "<...>";
        }
        var t = typeof o;
        if (t == "function" && (o.__name__ || o.__ename__)) {
            t = "object";
        }
        switch (t) {
            case "function":
                return "<function>";
            case "object":
                if (o instanceof Array) {
                    if (o.__enum__) {
                        if (o.length == 2) {
                            return o[0];
                        }
                        var str = o[0] + "(";
                        s += "\t";
                        var _g1 = 2;
                        var _g = o.length;
                        while (_g1 < _g) {
                            var i = _g1++;
                            if (i != 2) {
                                str += "," + js_Boot.__string_rec(o[i], s);
                            } else {
                                str += js_Boot.__string_rec(o[i], s);
                            }
                        }
                        return str + ")";
                    }
                    var l = o.length;
                    var i1;
                    var str1 = "[";
                    s += "\t";
                    var _g11 = 0;
                    var _g2 = l;
                    while (_g11 < _g2) {
                        var i2 = _g11++;
                        str1 += (i2 > 0 ? "," : "") + js_Boot.__string_rec(o[i2], s);
                    }
                    str1 += "]";
                    return str1;
                }
                var tostr;
                try {
                    tostr = o.toString;
                } catch (e) {
                    return "???";
                }
                if (tostr != null && tostr != Object.toString && typeof tostr == "function") {
                    var s2 = o.toString();
                    if (s2 != "[object Object]") {
                        return s2;
                    }
                }
                var k = null;
                var str2 = "{\n";
                s += "\t";
                var hasp = o.hasOwnProperty != null;
                for (var k in o) {
                    if (hasp && !o.hasOwnProperty(k)) {
                        continue;
                    }
                    if (k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
                        continue;
                    }
                    if (str2.length != 2) {
                        str2 += ", \n";
                    }
                    str2 += s + k + " : " + js_Boot.__string_rec(o[k], s);
                }
                s = s.substring(1);
                str2 += "\n" + s + "}";
                return str2;
            case "string":
                return o;
            default:
                return String(o);
        }
    };
    js_Boot.__interfLoop = function (cc, cl) {
        if (cc == null) {
            return false;
        }
        if (cc == cl) {
            return true;
        }
        var intf = cc.__interfaces__;
        if (intf != null) {
            var _g1 = 0;
            var _g = intf.length;
            while (_g1 < _g) {
                var i = _g1++;
                var i1 = intf[i];
                if (i1 == cl || js_Boot.__interfLoop(i1, cl)) {
                    return true;
                }
            }
        }
        return js_Boot.__interfLoop(cc.__super__, cl);
    };
    js_Boot.__instanceof = function (o, cl) {
        if (cl == null) {
            return false;
        }
        switch (cl) {
            case Array:
                if (o instanceof Array) {
                    return o.__enum__ == null;
                } else {
                    return false;
                }
                break;
            case Bool:
                return typeof o == "boolean";
            case Dynamic:
                return true;
            case Float:
                return typeof o == "number";
            case Int:
                if (typeof o == "number") {
                    return (o | 0) === o;
                } else {
                    return false;
                }
                break;
            case String:
                return typeof o == "string";
            default:
                if (o != null) {
                    if (typeof cl == "function") {
                        if (o instanceof cl) {
                            return true;
                        }
                        if (js_Boot.__interfLoop(js_Boot.getClass(o), cl)) {
                            return true;
                        }
                    } else {
                        if (typeof cl == "object" && js_Boot.__isNativeObj(cl)) {
                            if (o instanceof cl) {
                                return true;
                            }
                        }
                    }
                } else {
                    return false;
                }
                if (cl == Class ? o.__name__ != null : false) {
                    return true;
                }
                if (cl == Enum ? o.__ename__ != null : false) {
                    return true;
                }
                return o.__enum__ == cl;
        }
    };
    js_Boot.__nativeClassName = function (o) {
        var name = js_Boot.__toStr.call(o).slice(8, -1);
        if (name == "Object" || name == "Function" || name == "Math" || name == "JSON") {
            return null;
        }
        return name;
    };
    js_Boot.__isNativeObj = function (o) {
        return js_Boot.__nativeClassName(o) != null;
    };
    js_Boot.__resolveNativeClass = function (name) {
        return $global[name];
    };
    var js_html_compat_ArrayBuffer = function (a) {
        if (a instanceof Array && a.__enum__ == null) {
            this.a = a;
            this.byteLength = a.length;
        } else {
            var len = a;
            this.a = [];
            var _g1 = 0;
            var _g = len;
            while (_g1 < _g) {
                var i = _g1++;
                this.a[i] = 0;
            }
            this.byteLength = len;
        }
    };
    $hxClasses["js.html.compat.ArrayBuffer"] = js_html_compat_ArrayBuffer;
    js_html_compat_ArrayBuffer.__name__ = ["js", "html", "compat", "ArrayBuffer"];
    js_html_compat_ArrayBuffer.sliceImpl = function (begin, end) {
        var u = new Uint8Array(this, begin, end == null ? null : end - begin);
        var result = new ArrayBuffer(u.byteLength);
        var resultArray = new Uint8Array(result);
        resultArray.set(u);
        return result;
    };
    js_html_compat_ArrayBuffer.prototype = {
        slice: function (begin, end) {
            return new js_html_compat_ArrayBuffer(this.a.slice(begin, end));
        },
        __class__: js_html_compat_ArrayBuffer,
    };
    var js_html_compat_Uint8Array = function () {};
    $hxClasses["js.html.compat.Uint8Array"] = js_html_compat_Uint8Array;
    js_html_compat_Uint8Array.__name__ = ["js", "html", "compat", "Uint8Array"];
    js_html_compat_Uint8Array._new = function (arg1, offset, length) {
        var arr;
        if (typeof arg1 == "number") {
            arr = [];
            var _g1 = 0;
            var _g = arg1;
            while (_g1 < _g) {
                var i = _g1++;
                arr[i] = 0;
            }
            arr.byteLength = arr.length;
            arr.byteOffset = 0;
            arr.buffer = new js_html_compat_ArrayBuffer(arr);
        } else {
            if (js_Boot.__instanceof(arg1, js_html_compat_ArrayBuffer)) {
                var buffer = arg1;
                if (offset == null) {
                    offset = 0;
                }
                if (length == null) {
                    length = buffer.byteLength - offset;
                }
                if (offset == 0) {
                    arr = buffer.a;
                } else {
                    arr = buffer.a.slice(offset, offset + length);
                }
                arr.byteLength = arr.length;
                arr.byteOffset = offset;
                arr.buffer = buffer;
            } else {
                if (arg1 instanceof Array && arg1.__enum__ == null) {
                    arr = arg1.slice();
                    arr.byteLength = arr.length;
                    arr.byteOffset = 0;
                    arr.buffer = new js_html_compat_ArrayBuffer(arr);
                } else {
                    throw new js__$Boot_HaxeError("TODO " + Std.string(arg1));
                }
            }
        }
        arr.subarray = js_html_compat_Uint8Array._subarray;
        arr.set = js_html_compat_Uint8Array._set;
        return arr;
    };
    js_html_compat_Uint8Array._set = function (arg, offset) {
        if (js_Boot.__instanceof(arg.buffer, js_html_compat_ArrayBuffer)) {
            var a = arg;
            if (arg.byteLength + offset > this.byteLength) {
                throw new js__$Boot_HaxeError("set() outside of range");
            }
            var _g1 = 0;
            var _g = arg.byteLength;
            while (_g1 < _g) {
                var i = _g1++;
                this[i + offset] = a[i];
            }
        } else {
            if (arg instanceof Array && arg.__enum__ == null) {
                var a1 = arg;
                if (a1.length + offset > this.byteLength) {
                    throw new js__$Boot_HaxeError("set() outside of range");
                }
                var _g11 = 0;
                var _g2 = a1.length;
                while (_g11 < _g2) {
                    var i1 = _g11++;
                    this[i1 + offset] = a1[i1];
                }
            } else {
                throw new js__$Boot_HaxeError("TODO");
            }
        }
    };
    js_html_compat_Uint8Array._subarray = function (start, end) {
        var a = js_html_compat_Uint8Array._new(this.slice(start, end));
        a.byteOffset = start;
        return a;
    };
    var pingvp_FamesPerSecond = function () {
        this._delta = 0;
        this._last = new Date().getTime();
    };
    $hxClasses["pingvp.FamesPerSecond"] = pingvp_FamesPerSecond;
    pingvp_FamesPerSecond.__name__ = ["pingvp", "FamesPerSecond"];
    pingvp_FamesPerSecond.prototype = {
        tick: function () {
            var now = new Date().getTime();
            this._delta = (now - this._last) / 1000;
            this._last = now;
            return this._delta;
        },
        fps: function () {
            return Math.floor(1 / this._delta);
        },
        __class__: pingvp_FamesPerSecond,
    };
    var pingvp_InlineFrame = function (node, videoOid, embedUri) {
        this.iFrame = window.document.createElement("iframe");
        this.iFrame.id = "pingVpInlineFrame-" + videoOid;
        this.iFrame.frameBorder = "0";
        this.iFrame.allowFullscreen = true;
        this.iFrame.width = "100%";
        this.iFrame.height = "100%";
        this.iFrame.src = embedUri;
        var fc = node.firstChild;
        while (fc != null) {
            node.removeChild(fc);
            fc = node.firstChild;
        }
        node.appendChild(this.iFrame);
    };
    $hxClasses["pingvp.InlineFrame"] = pingvp_InlineFrame;
    pingvp_InlineFrame.__name__ = ["pingvp", "InlineFrame"];
    pingvp_InlineFrame.prototype = {
        isNotFramed: function () {
            return window.self == window.top;
        },
        resize: function (width, height) {
            this.iFrame.style.width = width + "px";
            this.iFrame.style.height = height + "px";
        },
        cleanUp: function () {
            this.iFrame.remove();
            this.iFrame = null;
        },
        __class__: pingvp_InlineFrame,
    };
    var pingvp_PingVpArrowKeys = function (videoOid) {
        var _gthis = this;
        $("body").keydown(function (e) {
            if (_gthis._onArrowKey != null) {
                _gthis._onArrowKey(e);
            }
        });
    };
    $hxClasses["pingvp.PingVpArrowKeys"] = pingvp_PingVpArrowKeys;
    pingvp_PingVpArrowKeys.__name__ = ["pingvp", "PingVpArrowKeys"];
    pingvp_PingVpArrowKeys.prototype = {
        boundOnArrowKeys: function (onArrowKey) {
            this._onArrowKey = onArrowKey;
        },
        __class__: pingvp_PingVpArrowKeys,
    };
    var pingvp_PingVpBLockRating = function (videoOid, blockOid, block, args, funOnClick) {
        this._block = block;
        this._funOnClick = funOnClick;
        this._rated = false;
        this._likeX = args.likeX != null ? args.likeX : 0;
        this._likeY = args.likeY != null ? args.likeY : 0;
        this._likeWidth = args.likeWidth != null ? args.likeWidth : 50;
        this._likeHeight = args.likeHeight != null ? args.likeHeight : 50;
        this._dislikeX = args.dislikeX != null ? args.dislikeX : 0;
        this._dislikeY = args.dislikeY != null ? args.dislikeY : 0;
        this._dislikeWidth = args.dislikeWidth != null ? args.dislikeWidth : 50;
        this._dislikeHeight = args.dislikeHeight != null ? args.dislikeHeight : 50;
        this._bgImage = args.bgImage != null ? pingvp_PingVpConfigRead.get().imagesUri + args.bgImage : "";
        this._likeImage = args.likeImage != null ? pingvp_PingVpConfigRead.get().imagesUri + args.likeImage : "";
        this._dislikeImage = args.dislikeImage != null ? pingvp_PingVpConfigRead.get().imagesUri + args.dislikeImage : "";
        if ($("#pingVpBlockLike-" + videoOid + "-" + blockOid).length != 0) {
            $("#pingVpBlockLike-" + videoOid + "-" + blockOid).remove();
        }
        if ($("#pingVpBlockDislike-" + videoOid + "-" + blockOid).length != 0) {
            $("#pingVpBlockDislike-" + videoOid + "-" + blockOid).remove();
        }
        block.css("backgroundImage", "url(" + this._bgImage + ")");
        block.css("backgroundSize", "100% 100%");
        block.css("cursor", "default");
        block.append('<div id="pingVpBlockLike-' + videoOid + "-" + blockOid + '" class="pingVpBlockLike pingVpReset"></div>');
        block.append('<div id="pingVpBlockDislike-' + videoOid + "-" + blockOid + '" class="pingVpBlockDislike pingVpReset"></div>');
        this._likeButton = $("#pingVpBlockLike-" + videoOid + "-" + blockOid);
        this._dislikeButton = $("#pingVpBlockDislike-" + videoOid + "-" + blockOid);
        this._likeButton.css("left", this._likeX + "px");
        this._likeButton.css("top", this._likeY + "px");
        this._likeButton.css("width", this._likeWidth + "px");
        this._likeButton.css("height", this._likeHeight + "px");
        this._dislikeButton.css("left", this._dislikeX + "ps");
        this._dislikeButton.css("top", this._dislikeY + "ps");
        this._dislikeButton.css("width", this._dislikeWidth + "px");
        this._dislikeButton.css("height", this._dislikeHeight + "px");
        this._likeButton.css("backgroundImage", "url(" + this._likeImage + ")");
        this._dislikeButton.css("backgroundImage", "url(" + this._dislikeImage + ")");
        this._likeButton.css("cursor", "pointer");
        this._dislikeButton.css("cursor", "pointer");
        this._likeButton.click($bind(this, this.onLikeClick));
        this._dislikeButton.click($bind(this, this.onDislikeClick));
    };
    $hxClasses["pingvp.PingVpBLockRating"] = pingvp_PingVpBLockRating;
    pingvp_PingVpBLockRating.__name__ = ["pingvp", "PingVpBLockRating"];
    pingvp_PingVpBLockRating.prototype = {
        update: function (scale) {
            if (this._rated) {
                this._block.css("display", "none");
                return;
            }
            this._likeButton.css("left", this._likeX * scale + "px");
            this._likeButton.css("top", this._likeY * scale + "px");
            this._likeButton.css("width", this._likeWidth * scale + "px");
            this._likeButton.css("height", this._likeHeight * scale + "px");
            this._dislikeButton.css("left", this._dislikeX * scale + "px");
            this._dislikeButton.css("top", this._dislikeY * scale + "px");
            this._dislikeButton.css("width", this._dislikeWidth * scale + "px");
            this._dislikeButton.css("height", this._dislikeHeight * scale + "px");
        },
        onLikeClick: function (e) {
            this._block.css("display", "none");
            this._rated = true;
            if (this._funOnClick == null) {
                return;
            }
            this._funOnClick(true);
        },
        onDislikeClick: function (e) {
            this._block.css("display", "none");
            this._rated = true;
            if (this._funOnClick == null) {
                return;
            }
            this._funOnClick(false);
        },
        __class__: pingvp_PingVpBLockRating,
    };
    var pingvp_PingVpBlock = function (videoScriptName, name, videoOid, blockOid, debug, videoPosLeft, videoPosTop, x, y, width, height, start, duration, action, args, scriptWidth, scriptHeight, onClick, playerType, funOnCtaClose, theme) {
        var _gthis = this;
        this._name = name;
        this._videoOid = videoOid;
        this._blockOid = blockOid;
        this._width = width;
        this._height = height;
        this._scriptWidth = scriptWidth;
        this._scriptHeight = scriptHeight;
        this._x = x;
        this._y = y;
        this._fontSize = args.fontSize;
        this._onClick = onClick;
        this._action = action;
        this._args = args;
        this._start = start;
        this._duration = duration;
        this._theme = theme;
        if (playerType == "html5") {
            if (args.html5StartCorrection != null) {
                this._start += args.html5StartCorrection;
            }
            if (args.html5DurationCorrection != null) {
                this._duration += args.html5DurationCorrection;
            }
        } else {
            if (playerType == "canvas") {
                if (args.canvasStartCorrection != null) {
                    this._start += args.canvasStartCorrection;
                }
                if (args.canvasDurationCorrection != null) {
                    this._duration += args.canvasDurationCorrection;
                }
            }
        }
        $("#pingVpOverlay-" + videoOid).append('<div id="pingVpBlock-' + videoOid + "-" + blockOid + '" class="pingVpBlock pingVpReset"></div>');
        this._block = $("#pingVpBlock-" + videoOid + "-" + blockOid);
        this._block.css("display", "none");
        var r_r = new RegExp("[^a-zA-Z0-9-]", "g".split("u").join(""));
        var blockNameSafe = name.replace(r_r, "-");
        var videoScriptNameSafe = videoScriptName.replace(r_r, "-");
        this._block.addClass("pingVpBlockName-" + blockNameSafe);
        this._block.addClass("pingVpBlockName-" + videoScriptNameSafe + "-" + blockNameSafe);
        if (debug) {
            this._block.css("backgroundColor", "rgba(214, 49, 49, 0.45)");
        }
        if (this._args.opacity != null) {
            this._block.css("opacity", this._args.opacity);
        }
        switch (action) {
            case "image":
                this._preloadedImage = new pingvp_PreloadedImage(pingvp_PingVpConfigRead.get().imagesUri + args.image, args.hover != null && args.hover == true);
                $(this._block).append(this._preloadedImage.getDivElement());
                if (this._args.opacity != null) {
                    this._preloadedImage.opacity(this._args.opacity);
                }
                if (args.url == null && args.video == null) {
                    this._block.css("cursor", "default");
                } else {
                    this._block.css("cursor", "pointer");
                }
                var tmp = args.hover != null && args.hover == true;
                break;
            case "link":
                this._block.attr("tabindex", "0");
                this._block.css("cursor", "pointer");
                break;
            case "load":
                this._block.attr("tabindex", "0");
                this._block.css("cursor", "pointer");
                break;
            case "rating":
                this._rating = new pingvp_PingVpBLockRating(videoOid, blockOid, this._block, this._args, $bind(this, this.onRatingClick));
                this._block.css("cursor", "default");
                break;
            case "text":
                this._block.html('<div class="pingVpBlockText pingVpReset">' + Std.string(args.text) + "</div>");
                this._blockText = $("#pingVpBlock-" + videoOid + "-" + blockOid + " .pingVpBlockText");
                if (this._args.opacity != null) {
                    this._blockText.css("opacity", this._args.opacity);
                }
                this._blockText.css("height", height + "px");
                this._blockText.css("fontSize", Std.string(args.fontSize) + "%");
                if (args.textAlign != null) {
                    this._block.css("textAlign", args.textAlign);
                }
                if (args.fontWeight != null && args.fontWeight == "bold") {
                    $("#pingVpBlock-" + videoOid + "-" + blockOid + " .pingVpBlockText").css("fontWeight", "bold !important");
                }
                if (args.url == null && args.video == null) {
                    this._block.css("cursor", "default");
                } else {
                    this._block.css("cursor", "pointer");
                }
                break;
            default:
                this._block.css("cursor", "pointer");
        }
        if (action == "cta" || this._args.cta == true) {
            this._block.css("cursor", "pointer");
            this._block.attr("tabindex", "0");
            if (this._blockText != null) {
                this._blockText.css("cursor", "pointer");
            }
            var styleClose = this._theme.getFull(this._theme.getByKey("svgset"), "cross.svg", theme.getByKey("defaultcolor"));
            var styleCloseHover = this._theme.getFull(this._theme.getByKey("svgset"), "cross.svg", theme.getByKey("hovercolor"));
            $("#pingVpOverlay-" + videoOid).append('<div id="pingVpBlock-' + videoOid + "-" + blockOid + '-ctaOpen" class="pingVpBlock pingVpReset "><div class="pingVpBlockCta pingVpReset"></div></div>');
            this._blockCtaOpen = $("#pingVpBlock-" + videoOid + "-" + blockOid + "-ctaOpen");
            this._blockCtaInner = $("#pingVpBlock-" + videoOid + "-" + blockOid + "-ctaOpen .pingVpBlockCta");
            this._blockCtaOpen.css("display", "none");
            this._blockCtaOpen.addClass("pingVpBlockName-" + blockNameSafe + "-ctaOpen");
            this._blockCtaOpen.addClass("pingVpBlockName-" + videoScriptNameSafe + "-" + blockNameSafe + "-ctaOpen");
            if (this._args.ctaContentType == "html" && this._args.ctaContent != "") {
                this._blockCtaInner.html(this._args.ctaContent);
            } else {
                if (this._args.ctaContentType == "iframe" && this._args.ctaContent != "") {
                    this._blockCtaInner.append('<iframe src="' + Std.string(this._args.ctaContent) + '" class="pingVpIframeCta" frameborder="0" allowfullscreen></iframe>');
                }
            }
            if (args.ctaCloseBtn == null || args.ctaCloseBtn == true) {
                if (this._blockCtaInner.find("[data-cta='close']").length == 0) {
                    this._blockCtaOpen.append('<div class="pingVpCtaClose" data-cta="close"><img class="closeCtaIcon" src="' + styleClose + '"></img></div>');
                    this._blockCtaCrossIcon = $(".pingVpCtaClose[data-cta='close']");
                    this._blockCtaCrossIcon.hover(
                        function (e) {
                            _gthis._blockCtaCrossIcon.children("img").attr("src", styleCloseHover);
                        },
                        function (e1) {
                            _gthis._blockCtaCrossIcon.children("img").attr("src", styleClose);
                        }
                    );
                }
            }
            if (this._blockCtaOpen.find("[data-cta='close']").length == 1) {
                this._blockCtaCloseBtn = this._blockCtaOpen.find('[data-cta="close"]');
                this._blockCtaCloseBtn.attr("tabindex", "0");
                this._blockCtaCloseBtn.css("cursor", "pointer");
                this._blockCtaCloseBtn.click(function (e2) {
                    _gthis._focus = $(":focus");
                    _gthis._blockCtaOpen.hide();
                    if (_gthis._args.ctaContentType == "iframe" && _gthis._args.ctaContent != "") {
                        _gthis._blockIframeElem = _gthis._blockCtaOpen.find("iframe.pingVpIframeCta");
                        _gthis._blockIframeElem.attr("src", _gthis._blockIframeElem.attr("src"));
                    }
                    if (_gthis._blockCtaCloseBtn.is(_gthis._focus)) {
                        _gthis._block.focus();
                    }
                    if (args.ctaOnClose != null && args.ctaOnClose == "pause") {
                        funOnCtaClose(false, false, true);
                    } else {
                        if (args.ctaOnClose != null && args.ctaOnClose == "play") {
                            funOnCtaClose(false, true, true);
                        } else {
                            funOnCtaClose(false, true, false);
                        }
                    }
                });
            }
        }
        if (action != "rating") {
            this._block.on("click", null, function (e3) {
                if (args.hover != null && args.hover == true) {
                    _gthis._block.css("backgroundPosition", "100% top");
                }
                _gthis._onClick(_gthis._videoOid, _gthis._blockOid, _gthis._name, _gthis._action, _gthis._args);
            });
        }
        if (args.follow != null) {
            this._followPath = new pingvp_PingVpFollowPath(x, y, args.follow);
        } else {
            this._followPath = null;
            this._cssAnimation = null;
        }
        if (this._blockText != null && args.textColor != null) {
            this._blockText.css("color", "#" + Std.string(args.textColor));
        }
        if (this._blockText != null && args.textShadowX != null && args.textShadowY != null && args.textShadowBlur != null && args.textShadowColor != null) {
            this._blockText.css("textShadow", Std.string(args.textShadowX) + "px " + Std.string(args.textShadowY) + "px " + Std.string(args.textShadowBlur) + "px #" + Std.string(args.textShadowColor));
        }
        if (this._blockText != null && args.fontName != null) {
            var r_r1 = new RegExp("[^a-zA-Z0-9]", "g".split("u").join(""));
            var fontName = args.fontName.replace(r_r1, "-");
            this._blockText.addClass("pingVpFont-" + fontName);
        }
        this._counter = 0;
        if (args.angle != 0) {
            this._block.css("-webkit-transform", "rotate(" + Std.string(args.angle) + "deg)");
            this._block.css("-moz-transform", "rotate(" + Std.string(args.angle) + "deg)");
            this._block.css("-ms-transform", "rotate(" + Std.string(args.angle) + "deg)");
            this._block.css("-o-transform", "rotate(" + Std.string(args.angle) + "deg)");
            this._block.css("transform", "rotate(" + Std.string(args.angle) + "deg)");
        }
        if (args.fadeIn != null) {
            this._fadeIn = args.fadeIn;
        } else {
            this._fadeIn = 0;
        }
        if (args.fadeOut != null) {
            this._fadeOut = args.fadeOut;
        } else {
            this._fadeOut = 0;
        }
        this._cssFadeIn = new pingvp_PingVpCssFadeIn(this._block, this._fadeIn);
        this._cssFadeOut = new pingvp_PingVpCssFadeOut(this._block, this._fadeOut);
        this._block.css("display", "none");
    };
    $hxClasses["pingvp.PingVpBlock"] = pingvp_PingVpBlock;
    pingvp_PingVpBlock.__name__ = ["pingvp", "PingVpBlock"];
    pingvp_PingVpBlock.prototype = {
        update: function (frameNo, time, videoPosLeft, videoPosTop, videoWidth, videoHeight, containerWidth, containerHeight, marginBottom) {
            videoWidth = this._scriptWidth;
            videoHeight = this._scriptHeight;
            if (this._args.startFrame != null && this._args.stopFrame != null) {
                if (frameNo < this._args.startFrame || frameNo > this._args.stopFrame) {
                    this._block.css("display", "none");
                    return;
                }
            } else {
                if (this._args.start != null && this._args.duration != null) {
                    if (time * 1000 < this._start * 1000 || time * 1000 > (this._start + this._duration) * 1000) {
                        this._block.css("display", "none");
                        if (this._cssFadeIn != null) {
                            this._cssFadeIn.reset();
                        }
                        if (this._cssFadeOut != null) {
                            this._cssFadeOut.reset();
                        }
                        return;
                    }
                }
            }
            if (this._cssFadeIn != null) {
                this._cssFadeIn.fade();
            }
            if (this._cssFadeOut != null) {
                this._cssFadeOut.fade(time, this._start + this._duration);
            }
            if (this._followPath != null) {
                this._followPath.update(time - this._start);
                this._x = this._followPath.getX();
                this._y = this._followPath.getY();
            }
            var scaleX = containerWidth / videoWidth;
            var scaleY = (containerHeight - marginBottom) / videoHeight;
            var centerX = containerWidth / 2;
            var centerY = (containerHeight - marginBottom) / 2;
            var scale = scaleX;
            if (scaleY < scaleX) {
                scale = scaleY;
            }
            var startX = centerX - (videoWidth * scale) / 2;
            var startY = centerY - (videoHeight * scale) / 2;
            var blockWidth = (this._width * videoWidth) / this._scriptWidth;
            var blockHeight = (this._height * videoHeight) / this._scriptHeight;
            var widthPercent = (scale * blockWidth * 100) / containerWidth;
            var heightPercent = (scale * blockHeight * 100) / containerHeight;
            var blockX = (this._x * videoWidth) / this._scriptWidth;
            var blockY = (this._y * videoHeight) / this._scriptHeight;
            var leftPercent = ((startX + scale * blockX) * 100) / containerWidth;
            var topPercent = ((startY + scale * blockY) * 100) / containerHeight;
            this._block.css("display", "block");
            this._block.css("width", widthPercent + "%");
            this._block.css("height", heightPercent + "%");
            $("#pingVpBlock-" + this._videoOid + "-" + this._blockOid + " .pingVpBlockText").css("fontSize", scale * this._fontSize + "%");
            this._block.css("left", leftPercent + "%");
            this._block.css("top", topPercent + "%");
            if (this._args.textShadowX != null && this._args.textShadowY != null && this._args.textShadowBlur != null && this._args.textShadowColor != null) {
                this._block.css("textShadow", scale * this._args.textShadowX + "px " + scale * this._args.textShadowY + "px " + scale * this._args.textShadowBlur + "px #" + Std.string(this._args.textShadowColor));
            }
            if (this._action == "text") {
                $("#pingVpBlock-" + this._videoOid + "-" + this._blockOid + " .pingVpBlockText").css("height", this._height * scale + "px");
            }
            if (this._action == "rating" && this._rating != null) {
                this._rating.update(scale);
            }
            if (this._action == "cta" || this._args.cta == true) {
                var ctaBlockWidth = (this._args.ctaWidth * videoWidth) / this._scriptWidth;
                var ctaBlockHeight = (this._args.ctaHeight * videoHeight) / this._scriptHeight;
                var ctaWidthPercent = (scale * ctaBlockWidth * 100) / containerWidth;
                var ctaHeightPercent = (scale * ctaBlockHeight * 100) / containerHeight;
                var ctaBlockX = (this._args.ctaX * videoWidth) / this._scriptWidth;
                var ctaBlockY = (this._args.ctaY * videoHeight) / this._scriptHeight;
                var ctaLeftPercent = ((startX + scale * ctaBlockX) * 100) / containerWidth;
                var ctaTopPercent = ((startY + scale * ctaBlockY) * 100) / containerHeight;
                this._blockCtaOpen.css("width", ctaWidthPercent + "%");
                this._blockCtaOpen.css("height", ctaHeightPercent + "%");
                this._blockCtaOpen.css("left", ctaLeftPercent + "%");
                this._blockCtaOpen.css("top", ctaTopPercent + "%");
            }
        },
        zIndex: function (index) {},
        remove: function () {
            this._block.unbind();
            this._block.remove();
        },
        get: function () {
            return this._block;
        },
        onRatingClick: function (like) {
            this._onClick(this._videoOid, this._blockOid, this._name, this._action, this._args, like);
        },
        __class__: pingvp_PingVpBlock,
    };
    var pingvp_PingVpBlocksAll = function (videoOid, debug, scriptWidth, scriptHeight, onClick, funOnPause, funOnSeek, funOnCtaClose, theme) {
        this._videoOid = videoOid;
        this._blockSerial = 1;
        this._debug = debug;
        this._scriptWidth = scriptWidth;
        this._scriptHeight = scriptHeight;
        this._onClick = onClick;
        this._blocks = [];
        this._funOnPause = funOnPause;
        this._funOnSeek = funOnSeek;
        this._funOnCtaClose = funOnCtaClose;
        this._theme = theme;
        this._otherCommands = [];
    };
    $hxClasses["pingvp.PingVpBlocksAll"] = pingvp_PingVpBlocksAll;
    pingvp_PingVpBlocksAll.__name__ = ["pingvp", "PingVpBlocksAll"];
    pingvp_PingVpBlocksAll.prototype = {
        getBlocks: function () {
            return this._blocks;
        },
        addBlock: function (videoScriptName, name, videoPosLeft, videoPosTop, x, y, width, height, start, duration, action, args, playerType) {
            var block = new pingvp_PingVpBlock(
                videoScriptName,
                name,
                this._videoOid,
                this._blockSerial++,
                this._debug,
                videoPosLeft,
                videoPosTop,
                x,
                y,
                width,
                height,
                start,
                duration,
                action,
                args,
                this._scriptWidth,
                this._scriptHeight,
                this._onClick,
                playerType,
                this._funOnCtaClose,
                this._theme
            );
            this._blocks.push(block);
        },
        executeScript: function (videoScriptName, videoPosLeft, videoPosTop, blockScript, syncTime, durationCorrection, playerType) {
            var keysSorted = [];
            var _g = 0;
            var _g1 = Reflect.fields(blockScript);
            while (_g < _g1.length) {
                var n = _g1[_g];
                ++_g;
                keysSorted.push(n);
            }
            keysSorted.sort(function (a, b) {
                return Reflect.compare(a, b);
            });
            keysSorted.reverse();
            var _g2 = 0;
            while (_g2 < keysSorted.length) {
                var n1 = keysSorted[_g2];
                ++_g2;
                var command = Reflect.field(blockScript, n1);
                var _g11 = command.command;
                switch (_g11) {
                    case "pause":
                        this._otherCommands.push(new pingvp_commons_Command(n1, command.position, command, this._funOnPause));
                        break;
                    case "rectangle":
                        this.addBlock(
                            videoScriptName,
                            n1,
                            videoPosLeft,
                            videoPosTop,
                            command.x,
                            command.y,
                            command.width,
                            command.height,
                            command.start + syncTime,
                            command.duration + durationCorrection,
                            command.action,
                            command,
                            playerType
                        );
                        break;
                    case "seek":
                        this._otherCommands.push(new pingvp_commons_Command(n1, command.position, command, this._funOnSeek));
                        break;
                }
            }
        },
        render: function (frameNo, time, videoPosLeft, videoPosTop, videoWidth, videoHeight, containerWidth, containerHeight, paddingBottom) {
            var _g = 0;
            var _g1 = this._blocks;
            while (_g < _g1.length) {
                var block = _g1[_g];
                ++_g;
                block.update(frameNo, time, videoPosLeft, videoPosTop, videoWidth, videoHeight, containerWidth, containerHeight, paddingBottom);
            }
            var _g2 = 0;
            var _g11 = this._otherCommands;
            while (_g2 < _g11.length) {
                var otherCommands = _g11[_g2];
                ++_g2;
                otherCommands.update(time);
            }
        },
        __class__: pingvp_PingVpBlocksAll,
    };
    var pingvp_PingVpBrandedStudio = function (videoOid, videoScript, videoScriptName, overlay, container, videoName, controlsBelowVideo, hasPlaybarVisible) {
        this._container = container;
        this._videoOid = videoOid;
        this._videoScriptName = videoScriptName;
        this._videoName = videoName;
        this._videoScript = videoScript;
        this._scriptWidth = this._videoScript.getFragmentVideoWidth(this._videoName);
        this._scriptHeight = this._videoScript.getFragmentVideoHeight(this._videoName);
        this._logoBool = false;
        this._endcardBool = false;
        this._mobileCheck = false;
        if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
            this._mobileCheck = true;
        }
        if ($("#pingVpBrandedStudio-" + videoOid).length != 0) {
            $("#pingVpBrandedStudio-" + videoOid).remove();
        }
        if (this._videoScript.getBrandedstudioHelper()) {
            this._logoCheck = this._videoScript.getBrandedstudioCheckHelper("logo");
            this._endcardCheck = this._videoScript.getBrandedstudioCheckHelper("endcard");
            if (this._logoCheck || this._endcardCheck) {
                $("#pingVpOverlay-" + videoOid).append('<div id="pingVpBrandedStudio-' + videoOid + '" class="pingVpBrandedStudio pingVpReset"></div>');
                this._brandedStudioBlock = $("#pingVpBrandedStudio-" + videoOid);
                if (this._mobileCheck) {
                    this._brandedStudioBlock.addClass("pingVpBrandedStudioMobile");
                }
            }
            if (this._logoCheck) {
                this._logoBool = true;
                this._logoSrc = this._videoScript.getBrandedstudioLogoHelper("file");
                this._logoPosition = this._videoScript.getBrandedstudioLogoHelper("position");
                $(this._brandedStudioBlock).append('<div id="pingVpBrandedStudioLogoWrapper-' + videoOid + '" class="pingVpBrandedStudioLogoWrapper pingVpReset"></div>');
                this._logoWrapper = this._brandedStudioBlock.children("#pingVpBrandedStudioLogoWrapper-" + videoOid);
                $(this._logoWrapper).append('<img src="' + this._logoSrc + '" class="pingVpBrandedStudioLogoStyle pingVpReset"></div>');
                this._logo = this._logoWrapper.children("img");
                if (this._logoPosition == "top_right") {
                    this._logoWrapper.css("top", "10px");
                    this._logoWrapper.css("right", "10px");
                    this._logo.css("top", "0");
                    this._logo.css("right", "0");
                } else {
                    if (this._logoPosition == "bottom_left") {
                        this._logoWrapper.css("left", "10px");
                        this._logoWrapper.addClass("pingVpBrandedStudioLogoBottom-" + videoOid);
                        this._logo.css("bottom", "0");
                        this._logo.css("left", "0");
                    } else {
                        if (this._logoPosition == "bottom_right") {
                            this._logoWrapper.css("right", "10px");
                            this._logoWrapper.addClass("pingVpBrandedStudioLogoBottom-" + videoOid);
                            this._logo.css("bottom", "0");
                            this._logo.css("right", "0");
                        } else {
                            this._logoWrapper.css("top", "10px");
                            this._logoWrapper.css("left", "10px");
                            this._logo.css("top", "0");
                            this._logo.css("left", "0");
                        }
                    }
                }
                if (!controlsBelowVideo) {
                    $(".pingVpBrandedStudioLogoBottom-" + this._videoOid).addClass("pingVpLogoExtraSpacing");
                }
                if (hasPlaybarVisible) {
                    $(".pingVpBrandedStudioLogoBottom-" + this._videoOid).addClass("pingVpControlBarVisible");
                }
                this.resize(false);
            }
            if (this._endcardCheck) {
                this._endcardBool = true;
                this._endcardStart = 0;
                this._endcardBg = this._videoScript.getBrandedstudioEndcardHelper("background");
                this._endcardPosition = this._videoScript.getBrandedstudioEndcardHelper("position");
            }
        }
    };
    $hxClasses["pingvp.PingVpBrandedStudio"] = pingvp_PingVpBrandedStudio;
    pingvp_PingVpBrandedStudio.__name__ = ["pingvp", "PingVpBrandedStudio"];
    pingvp_PingVpBrandedStudio.prototype = {
        resize: function (isFullScreen) {
            if (this._logoBool) {
                if (this._mobileCheck) {
                    if (!pingvp_PingVpDevice.isLandscape() && isFullScreen) {
                        var videoWidth = this._scriptWidth;
                        var videoHeight = this._scriptHeight;
                        var containerWidth = this._container.getWidth();
                        var containerHeight = this._container.getHeight();
                        var scaleX = containerWidth / videoWidth;
                        var scaleY = containerHeight / videoHeight;
                        var centerX = containerWidth / 2;
                        var centerY = containerHeight / 2;
                        var scale = scaleX;
                        if (scaleY < scaleX) {
                            scale = scaleY;
                        }
                        var startX = centerX - (videoWidth * scale) / 2;
                        var startY = centerY - (videoHeight * scale) / 2;
                        var scaledWidth = videoWidth * scale;
                        var scaledHeight = videoHeight * scale;
                        this._brandedStudioBlock.css("left", startX + "px");
                        this._brandedStudioBlock.css("top", startY + "px");
                        this._brandedStudioBlock.css("width", scaledWidth + "px");
                        this._brandedStudioBlock.css("height", scaledHeight + "px");
                    } else {
                        this._brandedStudioBlock.css("left", "0");
                        this._brandedStudioBlock.css("top", "0");
                        this._brandedStudioBlock.css("width", "100%");
                        this._brandedStudioBlock.css("height", "100%");
                    }
                } else {
                    this._brandedStudioBlock.css("left", "0");
                    this._brandedStudioBlock.css("top", "0");
                    this._brandedStudioBlock.css("width", "100%");
                    this._brandedStudioBlock.css("height", "100%");
                }
                this._overlay = $("#pingVpOverlay-" + this._videoOid);
                var definer = 960;
                var definerW = 640;
                var currentWidth = this._overlay.outerWidth();
                var percentW = 0.2;
                percentW = currentWidth * percentW;
                this._logoWrapper.css("width", percentW + "px");
                this._logoWrapper.css("height", "auto");
                this._brandedStudioBlock.css("display", "block");
            }
        },
        update: function () {
            // console.log("check...");
        },
        setEndcardStart: function (videoTag) {
            // console.log("--- duration ---");
            // console.log(videoTag.getDuration());
            var tmp = this._endcardBool;
        },
        __class__: pingvp_PingVpBrandedStudio,
    };
    var pingvp_PingVpCalculations = function () {};
    $hxClasses["pingvp.PingVpCalculations"] = pingvp_PingVpCalculations;
    pingvp_PingVpCalculations.__name__ = ["pingvp", "PingVpCalculations"];
    pingvp_PingVpCalculations.prototype = {
        trim: function (number, precision) {
            var num = number;
            num *= Math.pow(10, precision);
            num = Math.round(num) / Math.pow(10, precision);
            return num;
        },
        __class__: pingvp_PingVpCalculations,
    };
    var pingvp_PingVpCanvasFrame = function (baseUrl, frame, funBufferCheck) {
        var _gthis = this;
        this._image = new Image();
        this._frame = frame + 1;
        this._ready = false;
        this._funBufferCheck = funBufferCheck;
        var frameString = "";
        frameString += this.numberHelper(this._frame, 7);
        frameString += this.numberHelper(this._frame, 6);
        frameString += this.numberHelper(this._frame, 5);
        frameString += this.numberHelper(this._frame, 4);
        frameString += this.numberHelper(this._frame, 3);
        frameString += this.numberHelper(this._frame, 2);
        frameString += this.numberHelper(this._frame, 1);
        frameString += this.numberHelper(this._frame, 0);
        this._image.addEventListener(
            "load",
            function (e) {
                _gthis._ready = true;
                if (_gthis._funBufferCheck != null) {
                    _gthis._funBufferCheck();
                }
            },
            false
        );
        this._image.addEventListener(
            "error",
            function (e1) {
                _gthis._ready = false;
            },
            false
        );
        this._image.src = baseUrl + "chunk_" + frameString + ".jpg";
    };
    $hxClasses["pingvp.PingVpCanvasFrame"] = pingvp_PingVpCanvasFrame;
    pingvp_PingVpCanvasFrame.__name__ = ["pingvp", "PingVpCanvasFrame"];
    pingvp_PingVpCanvasFrame.prototype = {
        numberHelper: function (number, pos) {
            return Std.string(Math.floor(number / Math.pow(10, pos)) % 10);
        },
        getFrameImage: function () {
            return this._image;
        },
        getFrameNo: function () {
            return this._frame - 1;
        },
        getReady: function () {
            return this._ready;
        },
        __class__: pingvp_PingVpCanvasFrame,
    };
    var pingvp_PingVpPlayerBase = function (debug, videoOid, node, container, text, videoScript, controlsBelowVideo, controlsDisabled, tempStartFragment, analytics, events, autoStart, inOverlayPlay, inlinePlay, call) {
        var _gthis = this;
        this._debug = debug;
        this._videoOid = videoOid;
        this._container = container;
        this._text = text;
        this._controlsBelowVideo = controlsBelowVideo;
        this._controlsDisabled = controlsDisabled;
        this._node = node;
        this._videoScript = videoScript;
        this._loop = true;
        this._inlinePlay = inlinePlay;
        this._inOverlayPlay = inOverlayPlay;
        this._call = call;
        this._events = events;
        this._percent0 = this._percent10 = this._percent20 = this._percent30 = this._percent40 = this._percent50 = this._percent60 = this._percent70 = this._percent80 = this._percent90 = this._percent100 = true;
        this._replayEvent = false;
        this._displayHtmlOverview = false;
        this._hasWebSocket = false;
        this._mobileCheck = false;
        if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
            this._mobileCheck = true;
        }
        this._checkDeviceFunctions = !pingvp_PingVpDevice.isIphone() && !pingvp_PingVpDevice.isIpad() && !pingvp_PingVpDevice.isAndroid();
        this.sendWebSiteStatistics();
        this._videoTitle = this._videoScript.script().getHeaderTitle();
        this._tempStartFragment = tempStartFragment;
        this._videoName = this._tempStartFragment;
        this._playerUri = pingvp_PingVpConfigRead.get().playerUri;
        this._videosUri = pingvp_PingVpConfigRead.get().videosUri;
        this._postersUri = pingvp_PingVpConfigRead.get().postersUri != null ? pingvp_PingVpConfigRead.get().postersUri : pingvp_PingVpConfigRead.get().videosUri;
        new pingvp_PingVpStyle(this._playerUri + "styles/pingvp.min.css", "pingVpPlayerStyle");
        this._videoPath = new pingvp_PingVpPath();
        this._fullScreen = new pingvp_gui_fullscreen_FullScreen(this._videoOid);
        this._lastFragmentUuid = "";
        this._startFragment = new pingvp_PingVpPathPair(videoScript.name(), this._tempStartFragment);
        this._tempTheme = this._videoScript.script().getHeaderTheme();
        this._theme = new pingvp_PingVpTheme(this._videoScript.script().getShowPlay(), this._controlsBelowVideo, this._tempTheme);
        this._theme.set("defaultcolor", this._videoScript.script().getHeaderDefaultColor());
        this._theme.set("hovercolor", this._videoScript.script().getHeaderHoverColor());
        this._headerThemeBase = this._playerUri + "themes/" + this._tempTheme + "/";
        this._headerPoster = this._postersUri + this._videoScript.script().getHeaderPoster();
        this._contextMenu = new pingvp_PingVpContextMenu(this._videoOid);
        this._pingVpClick = new pingvp_PingVpClick(this._videoOid, this._videoScript.name(), $bind(this, this.onPingVpClickPlay), $bind(this, this.onPingVpClickPause));
        this._playLoop = this._videoScript.script().getFragmentLoop(this._videoScript.script().getHeaderStart());
        this._autoStart = autoStart;
        this._statsOverview = $('.pingVpStatsOverview[data-video="' + this._videoScript.script().getVideoName() + '"]');
        if (this._statsOverview.length > 0) {
            if (this._statsOverview.find("tbody").length == 0) {
                this._statsOverview.append(
                    '<h2 class="pingVpReset pingVpHeaderTable">' +
                        this._text.get("statsTableHeaderAll") +
                        '<span class="pingVpReset">' +
                        this._text.get("statsTableHeaderAllEmpty") +
                        '</span></h2><table class="pingVpReset pingVpStatsSuccesTable pingVpTable"><thead class="pingVpReset"><tr class="pingVpReset"><th class="pingVpReset">' +
                        this._text.get("statsTableTh1") +
                        '</th><th class="pingVpReset">' +
                        this._text.get("statsTableTh2") +
                        '</th></thead><tbody class="pingVpReset"></tbody></table>'
                );
                this._statsOverviewTable = this._statsOverview.find("tbody");
                this._statsOverview.find(".pingVpHeaderTable span").on("click", null, function (e) {
                    _gthis._statsOverviewTable.html("");
                });
            } else {
                this._statsOverviewTable = this._statsOverview.find("tbody");
            }
            this._displayHtmlOverview = true;
        }
        this.setVisibilityHook();
    };
    $hxClasses["pingvp.PingVpPlayerBase"] = pingvp_PingVpPlayerBase;
    pingvp_PingVpPlayerBase.__name__ = ["pingvp", "PingVpPlayerBase"];
    pingvp_PingVpPlayerBase.prototype = {
        loadFragment: function (fragment, changeQuality) {},
        getPlayPercent: function () {
            return 0;
        },
        getPlayDuration: function () {
            return 1;
        },
        onPlayButton: function (ableToRepeat) {},
        onPauseButton: function () {},
        onTimeSliderClick: function () {},
        onTimeSliderArrows: function (action) {},
        on5secBackClick: function () {},
        onResize: function (e) {},
        onShare: function () {},
        onPingVpClickPlay: function () {},
        onPingVpClickPause: function () {},
        checkIsPlaying: function () {
            return true;
        },
        sendWebSiteStatistics: function () {
            var title = this._videoScript.script().getHeaderTitle();
        },
        getEmbedUrl: function () {
            var url = window.location.href;
            return this.stripUrlParams(url);
        },
        getRefererUrl: function () {
            var url = window.document.referrer;
            if (url == null || url.length == 0) {
                return "";
            }
            return this.stripUrlParams(url);
        },
        stripUrlParams: function (url) {
            var arr = url.split("?");
            return arr[0];
        },
        onStartButton: function () {
            var _gthis = this;
            this.event("Start button");
            this._lastFragmentUuid = this._videoScript.script().getFragmentVideoUuid(this._videoName);
            this._videoPath.clear();
            this._videoScript.select(
                this._startFragment._scriptName,
                function () {
                    _gthis.loadFragment(_gthis._startFragment._videoName, false);
                },
                function () {}
            );
        },
        onBackButton: function () {
            var _gthis = this;
            this.event("Back button");
            this._lastFragmentUuid = this._videoScript.script().getFragmentVideoUuid(this._videoName);
            var pair = this._videoPath.back(this._startFragment);
            this._videoScript.select(
                pair._scriptName,
                function () {
                    _gthis.loadFragment(pair._videoName, false);
                },
                function () {}
            );
        },
        onRepeatButton: function () {
            this.event("Repeat button");
            this._lastFragmentUuid = this._videoScript.script().getFragmentVideoUuid(this._videoName);
            this.loadFragment(this._videoName, false);
        },
        onReportButton: function () {
            this.event("Report button");
            var reportUrl = "https://pingvp.com/controlpanel/report_a_problem.php";
            this._lastFragmentUuid = this._videoScript.script().getFragmentVideoUuid(this._videoName);
            var _errorFormElement = window.document.createElement("form");
            _errorFormElement.action = reportUrl;
            _errorFormElement.target = "errorPingVP";
            _errorFormElement.method = "post";
            var _g = new haxe_ds_StringMap();
            var value = this._videoScript.script().getVideoName();
            if (__map_reserved.video_name != null) {
                _g.setReserved("video_name", value);
            } else {
                _g.h.video_name = value;
            }
            var value1 = this._videoScript.script().getHeaderUuid();
            if (__map_reserved.video_uuid != null) {
                _g.setReserved("video_uuid", value1);
            } else {
                _g.h.video_uuid = value1;
            }
            var value2 = this._videoName;
            if (__map_reserved.clip_name != null) {
                _g.setReserved("clip_name", value2);
            } else {
                _g.h.clip_name = value2;
            }
            var value3 = this._lastFragmentUuid;
            if (__map_reserved.clip_uuid != null) {
                _g.setReserved("clip_uuid", value3);
            } else {
                _g.h.clip_uuid = value3;
            }
            var inputs = _g;
            var input = inputs.keys();
            while (input.hasNext()) {
                var input1 = input.next();
                var _errorInputElement = window.document.createElement("input");
                _errorInputElement.type = "hidden";
                _errorInputElement.name = input1;
                _errorInputElement.value = __map_reserved[input1] != null ? inputs.getReserved(input1) : inputs.h[input1];
                _errorFormElement.appendChild(_errorInputElement);
            }
            window.document.body.appendChild(_errorFormElement);
            this.event("Report button (" + reportUrl + ")");
            window.open(reportUrl, "errorPingVP");
            _errorFormElement.submit();
            window.document.body.removeChild(_errorFormElement);
        },
        onBrandButton: function () {
            var brandUrl = this._videoScript.script().getHeaderBrandUrl("https://www.pingvp.com/");
            this.event("Brand button (" + brandUrl + ")");
            window.open(brandUrl, "_blank");
        },
        onFullScreenButton: function () {
            this.event("Enter full screen");
            if (this._fullScreen.support()) {
                this._fullScreen.zIndex(this._videoOid, this._blocks, "2000");
                this._fullScreen.request();
                this._controlBar.setFullScreen();
            } else {
                if (this._fullScreen.isNotFramed()) {
                    this._fullScreen.setContainerAbsolute(this._videoOid);
                    this._fullScreen.zIndex(this._videoOid, this._blocks, "2000");
                    this._containerOldWidth = this._fullScreen.getContainerWidth(this._videoOid);
                    this._containerOldHeight = this._fullScreen.getContainerHeight(this._videoOid);
                    this._fullScreen.setContainerWidth(this._videoOid, "100%");
                    this._fullScreen.setContainerHeight(this._videoOid, "100%");
                    this._controlBar.setFullScreen();
                }
            }
            $("#pingVpVideoContainer-" + this._videoOid).addClass("pingVpVideoFullScreen");
        },
        onWindowedButton: function () {
            this.event("Leave full screen");
            if (this._fullScreen.support()) {
                this._fullScreen.zIndex(this._videoOid, this._blocks, "auto");
                this._fullScreen.cancel();
                this._controlBar.setWindowed();
            } else {
                if (this._fullScreen.isNotFramed()) {
                    this._fullScreen.setContainerWidth(this._videoOid, this._containerOldWidth + "px");
                    this._fullScreen.setContainerHeight(this._videoOid, this._containerOldHeight + "px");
                    this._fullScreen.setContainerRelative(this._videoOid);
                    this._fullScreen.zIndex(this._videoOid, this._blocks, "auto");
                    this._controlBar.setWindowed();
                }
            }
            $("#pingVpVideoContainer-" + this._videoOid).removeClass("pingVpVideoFullScreen");
        },
        onBeginBuffering: function () {
            if (this._playLoop != null && this._playLoop.isLooping()) {
                return;
            }
            this._progress.enable();
        },
        onEndBuffering: function () {
            this._progress.disable();
            if (this._call != null) {
                this._call(this._videoName);
            }
        },
        onSettingsButton: function () {
            this._settings.showSettingsMenu();
            this._controlBar.setSettings(this._settings.checkSettingsMenu());
        },
        onShareButton: function () {
            this._shareOverlay.showShareOverlay();
            this.onPauseButton();
        },
        onSubtitlesButton: function () {
            this._subtitlesOverlay.showSubtitlesMenu();
            this._controlBar.setSubtitles(this._subtitlesOverlay.checkSubtitlesMenu());
        },
        setSettingsButton: function (action) {
            this._controlBar.setSettings(action);
        },
        setSubtitlesButton: function (action) {
            this._controlBar.setSubtitles(action);
        },
        checkHideEnable: function (value) {
            if (value == false) {
                this._controlBar.hideEnable(false);
            } else {
                var checkMobilePause = true;
                if (this._mobileCheck) {
                    if (!this.checkIsPlaying()) {
                        checkMobilePause = false;
                    } else {
                        checkMobilePause = true;
                    }
                }
                var checkSettingsMenu = this._settings != null ? !this._settings.checkSettingsMenu() : true;
                var checkSubtitlesMenu = this._subtitlesOverlay != null ? !this._subtitlesOverlay.checkSubtitlesMenu() : true;
                var checkShareOverlay = this._shareOverlay != null ? !this._shareOverlay.isShown() : true;
                this._controlBar.hideEnable((!this._controlsBelowVideo || this._controlBar.isFullScreen()) && checkSettingsMenu && checkSubtitlesMenu && checkShareOverlay && checkMobilePause);
            }
        },
        checkHoverActive: function (value) {
            if (value == false) {
                this._controlBar.setActiveHover(false);
            } else {
                var checkSettingsMenu = this._settings != null ? !this._settings.checkSettingsMenu() : true;
                var checkSubtitlesMenu = this._subtitlesOverlay != null ? !this._subtitlesOverlay.checkSubtitlesMenu() : true;
                this._controlBar.setActiveHover(checkSettingsMenu && checkSubtitlesMenu);
            }
        },
        createCommonControls: function (enableQuality, lastSubtitle, lastFullscreen, lastHq, isHtmlPlayer, onLqButton, onHqButton) {
            var subs = this._videoScript.script().getFragmentSubtitles(this._videoName);
            this._enableSpeed = false;
            if (isHtmlPlayer) {
                this._enableSpeed = true;
                var speed = this._node.attr("data-speed");
                this._enableSpeed = this._videoScript.script().getHeaderSpeed() != null ? this._videoScript.script().getHeaderSpeed() == true : this._enableSpeed;
                this._enableSpeed = speed != null ? StringTools.trim(speed) != "false" : this._enableSpeed;
            }
            this._enableShare = false;
            if (isHtmlPlayer) {
                this._enableShare = true;
                var share = this._node.attr("data-share");
                this._enableShare = this._videoScript.script().getHeaderShare() != null ? this._videoScript.script().getHeaderShare() == true : this._enableShare;
                this._enableShare = share != null ? StringTools.trim(share) != "false" : this._enableShare;
            }
            this._controlBar = new pingvp_PingVpControlBar(
                this._videoOid,
                this._debug,
                this._controlsDisabled,
                this._overlay,
                this._videoScript.script(),
                true,
                enableQuality,
                subs != null && subs.length > 0,
                this._enableSpeed,
                this._enableShare,
                this._controlsBelowVideo,
                this._theme,
                this._inOverlayPlay && !this._inlinePlay,
                isHtmlPlayer,
                this._text,
                this._videoName,
                this._container
            );
            this._controlBar.setWindowed();
            this._controlBar.setPlayHandler($bind(this, this.onPlayButton));
            this._controlBar.setPauseHandler($bind(this, this.onPauseButton));
            this._controlBar.setFullScreenHandler($bind(this, this.onFullScreenButton));
            this._controlBar.setWindowedHandler($bind(this, this.onWindowedButton));
            this._controlBar.setTimeSliderHandler($bind(this, this.onTimeSliderClick));
            this._controlBar.setTimeSliderArrowsHandler($bind(this, this.onTimeSliderArrows));
            this._controlBar.set5secBackButtonHandler($bind(this, this.on5secBackClick));
            var f = (($_ = this._contextMenu), $bind($_, $_.menuOpen));
            var a1 = this._controlBar;
            var tmp = function (e) {
                f(a1, e);
            };
            this._container.get().on("contextmenu", null, tmp);
            var isFullscreen = lastFullscreen != null ? lastFullscreen : this._controlBar.isFullScreen();
            var controlsBelowHeight = this._controlsBelowVideo && !isFullscreen ? 40 : 0;
            this._progress = new pingvp_PingVpProgress(this._videoOid, this._overlay, this._container, this._theme, controlsBelowHeight);
            this._brandedStudio = new pingvp_PingVpBrandedStudio(
                this._videoOid,
                this._videoScript.script(),
                this._videoScript.name(),
                this._overlay,
                this._container,
                this._videoName,
                this._controlsBelowVideo,
                this._controlsBelowVideo && !this._controlBar.isFullScreen()
            );
            this._subtitles = new pingvp_PingVpSubtitlesOverlay(
                this._videoOid,
                this._videoScript.script(),
                this._videoScript.name(),
                this._overlay,
                this._container,
                subs,
                this._text,
                this._controlsBelowVideo,
                this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0,
                this._theme,
                this._controlBar,
                $bind(this, this.event)
            );
            this._speed = new pingvp_PingVpSpeedOverlay(this._videoOid, this._videoScript.name(), this._overlay, this._container, this._text, this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0, $bind(this, this.event));
            this._settings = new pingvp_PingVpSettingsMenuOverlay(
                this._videoOid,
                this._videoScript.name(),
                this._overlay,
                this._container,
                this._theme,
                this._text,
                this._controlsBelowVideo,
                this._controlBar,
                $bind(this, this.checkHideEnable),
                $bind(this, this.checkHoverActive),
                $bind(this, this.setSettingsButton),
                enableQuality,
                lastHq,
                onLqButton,
                onHqButton,
                subs,
                this._subtitles,
                lastSubtitle,
                this._enableSpeed,
                this._speed,
                this._enableShare,
                this._messages,
                $bind(this, this.event)
            );
            this._subtitlesOverlay = new pingvp_PingVpSubtitlesMenuOverlay(
                this._videoOid,
                this._videoScript.name(),
                this._overlay,
                this._container,
                this._theme,
                this._text,
                this._controlsBelowVideo,
                this._controlBar,
                $bind(this, this.checkHideEnable),
                $bind(this, this.checkHoverActive),
                $bind(this, this.setSubtitlesButton),
                subs,
                this._subtitles,
                lastSubtitle,
                this._enableShare,
                $bind(this, this.event)
            );
            this._shareOverlay = new pingvp_PingVpShareOverlay(
                this._videoOid,
                this._theme,
                this._text,
                this._container,
                controlsBelowHeight,
                this._enableShare,
                $bind(this, this.checkHideEnable),
                this._videoTitle,
                this._headerPoster,
                $bind(this, this.event)
            );
            if (this._settings.checkMenuActive()) {
                this._settings.setSubtitlesMenuHandler(this._subtitlesOverlay);
                this._settings.setSubtitlesMenuSubsHandler((($_ = this._subtitlesOverlay), $bind($_, $_.setSubsMenuSelected)));
                this._settings.setShareMenuHandler((($_ = this._shareOverlay), $bind($_, $_.manualShowShareOverlay)), $bind(this, this.onPauseButton));
                this._controlBar.setSettingsHandler($bind(this, this.onSettingsButton), this._settings);
                this._controlBar.setSettings(false);
            }
            if (this._subtitlesOverlay.checkMenuActive()) {
                this._subtitlesOverlay.setSettingsMenuHandler(this._settings);
                this._subtitlesOverlay.setSettingsMenuSubsHandler((($_ = this._settings), $bind($_, $_.setSubsMenuSelected)));
                this._controlBar.setSubtitlesHandler($bind(this, this.onSubtitlesButton), this._subtitlesOverlay);
                this._controlBar.setSubtitles(false);
            }
            if (this._shareOverlay.checkMenuActive()) {
                this._controlBar.setShareHandler($bind(this, this.onShareButton), this._shareOverlay);
            }
        },
        bindOnResize: function (first) {
            var _gthis = this;
            this.onResize(null);
            if (first) {
                $(window).resize(function (e) {
                    _gthis.onResize(e);
                });
                $(window).on("orientationchange", null, function (e1) {
                    _gthis.onResize(e1);
                });
            }
        },
        event: function (action) {
            if (this._events == null) {
                return;
            }
            if (this._displayHtmlOverview) {
                this._statsOverviewTable.prepend('<tr class="pingVpReset"><td class="pingVpReset">' + this._videoScript.script().getFragmentVideoTitle(this._videoName) + '</td><td class="pingVpReset">' + action + "</td></tr>");
            }
            var percent = this.getPlayPercent();
            this._events.update(this._videoScript.script().getHeaderUuid(), this._videoScript.script().getHeaderTitle(), this._videoScript.name());
            this._events.pushAction(this._videoScript.script().getFragmentVideoUuid(this._videoName), this._videoScript.script().getFragmentVideoTitle(this._videoName), action, percent, this._lastFragmentUuid);
        },
        wsevent: function (action) {
            if (this._events == null) {
                return;
            }
            var script = this._videoScript.script();
            var percent = this.getPlayPercent();
            this._events.pushActionWs(script.getHeaderUuid(), script.getHeaderTitle(), script.getFragmentVideoUuid(this._videoName), script.getFragmentVideoTitle(this._videoName), action, percent);
        },
        percentEventLog: function () {
            this._percent = this.getPlayPercent();
            if (this._hasWebSocket) {
                this.wsevent((this._percent | 0) + "%");
            } else {
                if (this.getPlayDuration() > 0) {
                    if (this._percent >= 100) {
                        if (this._percent100) {
                            this.event("100%");
                            this._percent100 = false;
                        }
                        this._percent0 = this._percent10 = this._percent20 = this._percent30 = this._percent40 = this._percent50 = this._percent60 = this._percent70 = this._percent80 = this._percent90 = true;
                    } else {
                        if (this._percent >= 90) {
                            if (this._percent90) {
                                this.event("90%");
                                this._percent90 = false;
                            }
                            this._percent0 = this._percent10 = this._percent20 = this._percent30 = this._percent40 = this._percent50 = this._percent60 = this._percent70 = this._percent80 = this._percent100 = true;
                        } else {
                            if (this._percent >= 80) {
                                if (this._percent80) {
                                    this.event("80%");
                                    this._percent80 = false;
                                }
                                this._percent0 = this._percent10 = this._percent20 = this._percent30 = this._percent40 = this._percent50 = this._percent60 = this._percent70 = this._percent90 = this._percent100 = true;
                            } else {
                                if (this._percent >= 70) {
                                    if (this._percent70) {
                                        this.event("70%");
                                        this._percent70 = false;
                                    }
                                    this._percent0 = this._percent10 = this._percent20 = this._percent30 = this._percent40 = this._percent50 = this._percent60 = this._percent80 = this._percent90 = this._percent100 = true;
                                } else {
                                    if (this._percent >= 60) {
                                        if (this._percent60) {
                                            this.event("60%");
                                            this._percent60 = false;
                                        }
                                        this._percent0 = this._percent10 = this._percent20 = this._percent30 = this._percent40 = this._percent50 = this._percent70 = this._percent80 = this._percent90 = this._percent100 = true;
                                    } else {
                                        if (this._percent >= 50) {
                                            if (this._percent50) {
                                                this.event("50%");
                                                this._percent50 = false;
                                            }
                                            this._percent0 = this._percent10 = this._percent20 = this._percent30 = this._percent40 = this._percent60 = this._percent70 = this._percent80 = this._percent90 = this._percent100 = true;
                                        } else {
                                            if (this._percent >= 40) {
                                                if (this._percent40) {
                                                    this.event("40%");
                                                    this._percent40 = false;
                                                }
                                                this._percent0 = this._percent10 = this._percent20 = this._percent30 = this._percent50 = this._percent60 = this._percent70 = this._percent80 = this._percent90 = this._percent100 = true;
                                            } else {
                                                if (this._percent >= 30) {
                                                    if (this._percent30) {
                                                        this.event("30%");
                                                        this._percent30 = false;
                                                    }
                                                    this._percent0 = this._percent10 = this._percent20 = this._percent40 = this._percent50 = this._percent60 = this._percent70 = this._percent80 = this._percent90 = this._percent100 = true;
                                                } else {
                                                    if (this._percent >= 20) {
                                                        if (this._percent20) {
                                                            this.event("20%");
                                                            this._percent20 = false;
                                                        }
                                                        this._percent0 = this._percent10 = this._percent30 = this._percent40 = this._percent50 = this._percent60 = this._percent70 = this._percent80 = this._percent90 = this._percent100 = true;
                                                    } else {
                                                        if (this._percent >= 10) {
                                                            if (this._percent10) {
                                                                this.event("10%");
                                                                this._percent10 = false;
                                                            }
                                                            this._percent0 = this._percent20 = this._percent30 = this._percent40 = this._percent50 = this._percent60 = this._percent70 = this._percent80 = this._percent90 = this._percent100 = true;
                                                        } else {
                                                            if (this._percent0) {
                                                                this.event("0%");
                                                                this._percent0 = false;
                                                            }
                                                            this._percent10 = this._percent20 = this._percent30 = this._percent40 = this._percent50 = this._percent60 = this._percent70 = this._percent80 = this._percent90 = this._percent100 = true;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        isVideoPlaying: function () {
            return this.checkIsPlaying();
        },
        onVisibilityChanged: function () {
            if (this.isPageHidden() && this.isVideoPlaying()) {
                this.onPauseButton();
            }
        },
        isPageHidden: function () {
            if (this._attrHidden != null) {
                var hidden = Reflect.field(window.document, this._attrHidden);
                if (hidden != null) {
                    return hidden;
                } else {
                    return false;
                }
            }
            return false;
        },
        setVisibilityHook: function () {
            var hidden = null;
            var visibilityChange = null;
            if (Reflect.field(window.document, "hidden") != null) {
                hidden = "hidden";
                visibilityChange = "visibilitychange";
            } else {
                if (Reflect.field(window.document, "mozHidden") != null) {
                    hidden = "mozHidden";
                    visibilityChange = "mozvisibilitychange";
                } else {
                    if (Reflect.field(window.document, "webkitHidden") != null) {
                        hidden = "webkitHidden";
                        visibilityChange = "webkitvisibilitychange";
                    }
                }
            }
            if (hidden != null) {
                this._attrHidden = hidden;
                window.document.addEventListener(visibilityChange, $bind(this, this.onVisibilityChanged), false);
            }
        },
        videoEndCallback: function () {
            if (this._videoEndCallback != null && this._videoEndCallback.length > 0) {
                var code = this._videoEndCallback + "(" + this._videoOid + ',"' + this._videoScript.name() + '");';
                try {
                    eval(code);
                } catch (msg) {
                    if (msg instanceof js__$Boot_HaxeError) {
                        msg = msg.val;
                    }
                    if (js_Boot.__instanceof(msg, String)) {
                    } else {
                        throw msg;
                    }
                }
            }
        },
        __class__: pingvp_PingVpPlayerBase,
    };
    var pingvp_PingVpCanvasPlayer = function (
        debug,
        videoOid,
        node,
        container,
        text,
        videoScript,
        controlsBelowVideo,
        controlsDisabled,
        tempStartFragment,
        analytics,
        events,
        autoStart,
        inOverlayPlay,
        inlinePlay,
        call,
        pingVpFunctions,
        spacebar,
        keys,
        keysControlbar,
        keysSettingsMenu,
        keysSettingsMenuClose,
        keysSubtitlesMenu,
        keysSubtitlesMenuClose,
        keysShareMenu,
        keysShareMenuClose
    ) {
        pingvp_PingVpPlayerBase.call(this, debug, videoOid, node, container, text, videoScript, controlsBelowVideo, controlsDisabled, tempStartFragment, analytics, events, autoStart, inOverlayPlay, inlinePlay, call);
        pingVpFunctions.setResize($bind(this, this.onResize));
        this._focusActive = false;
        this._logProcentEvents = false;
        this._isPlaying = false;
        this._fullScreen.setFullScreenEventHandler($bind(this, this.onFullScreenEvent));
        this._fullScreen.setWindowedEventHandler($bind(this, this.onWindowedEvent));
        this._videoScriptSub = videoScript.script();
        this.defaultColor = this._videoScriptSub.getHeaderDefaultColor();
        this.hoverColor = this._videoScriptSub.getHeaderHoverColor();
        if (this._autoStart) {
            this.loadFragment(this._startFragment._videoName, true);
        } else {
            this.loadFragmentPause(this._startFragment._videoName, true);
        }
    };
    $hxClasses["pingvp.PingVpCanvasPlayer"] = pingvp_PingVpCanvasPlayer;
    pingvp_PingVpCanvasPlayer.__name__ = ["pingvp", "PingVpCanvasPlayer"];
    pingvp_PingVpCanvasPlayer.__super__ = pingvp_PingVpPlayerBase;
    pingvp_PingVpCanvasPlayer.prototype = $extend(pingvp_PingVpPlayerBase.prototype, {
        loadFragment: function (videoName, first) {
            this.loadFragmentPause(videoName, first);
            if (first && this._autoStart && !this._inlinePlay && !this._inOverlayPlay) {
                this._messages.showImmediatelyMessage("PlayerAutostartMute");
                this._audio.muted(true);
                if (this._checkDeviceFunctions) {
                    this._controlBar.setMute();
                }
                if (this._subtitles.hasSubs() && this._subtitles.getSelected() == 0) {
                    this._subtitles.onSubSelect(1);
                    this._settings.setSubsMenuSelected(1);
                }
            } else {
                this._audio.play();
            }
            this._isPlaying = true;
            this._controlBar.setPlay();
        },
        loadFragmentPause: function (videoName, first) {
            this._videoEndCallback = this._videoScript.script().getFragmentVideoEndCallback(videoName);
            this._playLoop = this._videoScript.script().getFragmentLoop(videoName);
            this._frameNum = 1;
            this._videoName = videoName;
            this._numberFramesPerChunk = this._videoScript.script().getFragmentHeaderNumberFramesPerChunk(this._videoName, 16);
            this._framePerSec = this._videoScript.script().getFragmentHeaderCanvasFramesPerSec(this._videoName, 16);
            this._audioVideoSync = this._videoScript.script().getFragmentHeaderCanvasAudioVideoSync(this._videoName, -0.1);
            this._bufferSize = this._videoScript.script().getFragmentHeaderCanvasBufferSize(this._videoName, 48);
            var playerWidth = this._container.getWidth();
            var playerHeight = this._container.getHeight();
            this._videoOriginalWidth = this._videoScript.script().getFragmentVideoWidth(videoName);
            this._videoOriginalHeight = this._videoScript.script().getFragmentVideoHeight(videoName);
            this._videoCanvasWidth = this._videoScript.script().getFragmentCanvasVideoWidth(videoName);
            this._videoCanvasHeight = this._videoScript.script().getFragmentCanvasVideoHeight(videoName);
            this._video = new pingvp_PingVpCanvasVideo(
                this._videoOid,
                playerWidth,
                playerHeight,
                this._videoCanvasWidth,
                this._videoCanvasHeight,
                this._videoOriginalWidth,
                this._videoOriginalHeight,
                this._numberFramesPerChunk,
                $bind(this, this.onBufferEmpty)
            );
            var canvasVideo = this._videoScript.script().getFragmentHeaderCanvasVideo(videoName);
            if (this._audio != null) {
                this._audio.cleanup();
            }
            this._audio = new pingvp_canvasplayer_CanvasAudio(
                this._videoOid,
                this._videosUri + canvasVideo + "/",
                $bind(this, this.onLoadedMetaData),
                $bind(this, this.onBeginBuffering),
                $bind(this, this.onEndBuffering),
                $bind(this, this.onVideoEnd)
            );
            this._percent0 = true;
            this._percent20 = true;
            this._percent50 = true;
            this._percent80 = true;
            this._buffer = new pingvp_canvasplayer_CanvasBuffer(this._bufferSize, this._videosUri + canvasVideo + "/", $bind(this, this.onBufferCheck));
            this._overlay = new pingvp_PingVpOverlay(this._videoOid, this._container, this._inOverlayPlay, this.defaultColor, this.hoverColor, this._controlsBelowVideo);
            this._overlay.onScreenClick($bind(this, this.onScreenClick));
            if (this._inOverlayPlay) {
                this._overlay.setCloseButton($bind(this, this.cleanup));
            }
            this._blocks = new pingvp_PingVpBlocksAll(
                this._videoOid,
                this._debug,
                this._videoOriginalWidth,
                this._videoOriginalHeight,
                $bind(this, this.onBlockClick),
                $bind(this, this.onPauseCommand),
                $bind(this, this.onSeekCommand),
                $bind(this, this.onCtaAction),
                this._theme
            );
            this._blocks.executeScript(
                this._videoScript.name(),
                this._video.getPosLeft(),
                this._video.getPosTop(),
                this._videoScript.script().getFragmentCommands(this._videoName),
                this._videoScript.script().getFragmentHeaderCanvasSync(this._videoName),
                this._videoScript.script().getFragmentHeaderCanvasDurationCorrection(this._videoName),
                "canvas"
            );
            this._messages = new pingvp_PingVpMessages(this._videoOid, this._theme, playerWidth, playerHeight, this._controlsBelowVideo ? 50 : 0);
            this._messages.setMessage("PlayerActionPlay", "play_button", "center_center", true);
            this._messages.setMessage("PlayerActionPause", "pause_button", "center_center", true);
            this._messages.setMessage("PlayerAutostartMute", "sound_on", "right", true);
            this._messages.onClickClose("PlayerAutostartMute", $bind(this, this.onUnmuteButton), true);
            this._focusActive = this._overlay.getActive();
            var lastFullScreen = false;
            if (this._controlBar != null) {
                lastFullScreen = this._controlBar.isFullScreen();
            }
            if (first && !this._autoStart) {
                if (this._videoScript.script().getHeaderHelper("posterRatio", "") != "fixed") {
                    this._poster = new pingvp_PingVpPoster(this._videoOid, this._overlay, this._headerPoster, "play_button", this._controlsBelowVideo, this._theme);
                    this._poster.setClickHandler($bind(this, this.onPosterClick));
                } else {
                    var posterWidth = this._videoScript.script().getHeaderFloatHelper("posterWidth", 16);
                    var posterHeight = this._videoScript.script().getHeaderFloatHelper("posterHeight", 9);
                    this._posterRatio = new pingvp_PingVpPosterRatio(
                        this._node,
                        this._videoOid,
                        this._container,
                        this._overlay,
                        this._headerPoster,
                        "play_button",
                        this._controlsBelowVideo,
                        this._controlsBelowVideo && !lastFullScreen ? 40 : 0,
                        posterWidth,
                        posterHeight,
                        this._theme
                    );
                    this._posterRatio.setClickHandler($bind(this, this.onPosterClick));
                }
            }
            this._contextMenu.setupContextMenus(this._container, this._theme);
            this._contextMenu.addOption("pingVpOptionStart-" + this._videoOid, this._text.get("contextbarStart"), null, $bind(this, this.onStartButton));
            this._contextMenu.addOption("pingVpOptionBack-" + this._videoOid, this._text.get("contextbarBack"), null, $bind(this, this.onBackButton));
            this._contextMenu.addOption("pingVpOptionReplay-" + this._videoOid, this._text.get("contextbarRepeat"), null, $bind(this, this.onRepeatButton));
            this._contextMenu.addHr();
            this._contextMenu.addOption("pingVpOptionReport-" + this._videoOid, this._text.get("contextbarReport"), null, $bind(this, this.onReportButton));
            this._contextMenu.addOption("pingVpOptionBrand-" + this._videoOid, this._text.get("contextbarBrand"), null, $bind(this, this.onBrandButton));
            if (this._subtitles != null) {
                this._lastSubtitle = this._subtitles.getSelected();
            } else {
                this._lastSubtitle = -1;
            }
            this.createCommonControls(false, this._lastSubtitle, null, true, false, false, false);
            this._controlBar.setPause();
            this._controlBar.hideEnable(false);
            this._controlBar.setVolumeSliderHandler($bind(this, this.onVolumeSliderClick));
            this._controlBar.setVolumeSliderArrowsHandler($bind(this, this.onVolumeSliderArrows));
            this._controlBar.setVolumeSlider(this._audio.getVolume());
            this._controlBar.setMuteHandler($bind(this, this.onMuteButton));
            this._controlBar.setUnmuteHandler($bind(this, this.onUnmuteButton));
            this._overlay.setFullScreenCloseHandler(this._controlBar, $bind(this, this.onWindowedButton));
            if (lastFullScreen) {
                this._controlBar.setFullScreen();
            }
            if (this._renderInterval != null) {
                this._renderInterval.stop();
            }
            this._renderInterval = new pingvp_PingVpInterval($bind(this, this.onRenderer), 100, 100, 20);
            this._renderInterval.start();
            this.bindOnResize(first);
            this._pingVpClick.onPingVpClickPlay($bind(this, this.onPlayButton));
            this._pingVpClick.onPingVpClickPause($bind(this, this.onPauseButton));
            this._overlay.setActive(this._focusActive);
        },
        onPosterClick: function () {
            this.event("Poster click");
            this.event("Load video");
            if (!this._autoStart) {
                if (this._videoScript.script().getHeaderHelper("posterRatio", "") != "fixed") {
                    this._poster.removePoster();
                } else {
                    this._posterRatio.removePoster();
                }
            }
            this._audio.play();
            this._controlBar.setPlay();
            this._isPlaying = true;
            this._logProcentEvents = true;
        },
        play: function (ableToRepeat) {
            if (this._replayEvent) {
                if (ableToRepeat || ableToRepeat == null) {
                    this._audio.play();
                    this._controlBar.setPlay();
                    this._isPlaying = true;
                    this.event("Replay");
                    this._replayEvent = false;
                }
            } else {
                this._audio.play();
                this._controlBar.setPlay();
                this._isPlaying = true;
                this.event("Play");
            }
            if (!this._logProcentEvents) {
                this.event("Load video");
            }
            this._logProcentEvents = true;
        },
        onBuffering: function () {
            var framesTotal = Math.floor(this._audio.getDuration() * this._framePerSec);
            this._buffer.buffering(Math.floor(this._frameNum / this._numberFramesPerChunk), Math.floor(framesTotal / this._numberFramesPerChunk));
        },
        onRenderer: function () {
            if (!this._loop) {
                return;
            }
            this.onBuffering();
            var duration = this._audio.getDuration();
            var currentTime = this._audio.getCurrentTime() + this._audioVideoSync;
            var framesTotal = Math.floor(duration * this._framePerSec);
            if (currentTime < 0) {
                currentTime = 0;
            }
            if (currentTime > duration - 1) {
                currentTime = duration - 1;
            }
            if (this._playLoop != null) {
                if (currentTime >= this._playLoop.start()) {
                    currentTime = this._playLoop.seek();
                    this._playLoop.setLooping(true);
                    this._audio.setCurrentTime(currentTime);
                }
            }
            this._controlBar.setTimeSlider(this._audio.getCurrentTime(), this._audio.getDuration());
            this._controlBar.setTime(this._audio.getCurrentTime(), this._audio.getDuration());
            if (this._subtitles != null) {
                this._subtitles.setTime(this._audio.getCurrentTime());
            }
            this._blocks.render(
                this._audio.getFrame(25),
                this._audio.getCurrentTime(),
                0,
                0,
                this._videoOriginalWidth,
                this._videoOriginalHeight,
                this._container.getWidth(),
                this._container.getHeight(),
                this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0
            );
            this._frameNum = Math.floor(currentTime * this._framePerSec);
            this._video.renderFrame(this._container, this._buffer, this._frameNum, framesTotal, this._framePerSec, this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            if (this._logProcentEvents) {
                this.percentEventLog();
            }
        },
        onLoadedMetaData: function () {
            this._controlBar.setTimeSlider(this._audio.getCurrentTime(), this._audio.getDuration());
            this._controlBar.setTime(this._audio.getCurrentTime(), this._audio.getDuration());
            this._progress.disable();
        },
        onPlayButton: function (ableToRepeat) {
            this._shareOverlay.hideShareOverlay();
            if (!this._autoStart) {
                if (this._videoScript.script().getHeaderHelper("posterRatio", "") != "fixed") {
                    this._poster.removePoster();
                } else {
                    this._posterRatio.removePoster();
                }
            }
            this._isPlaying = true;
            this.play(ableToRepeat);
        },
        onPauseButton: function () {
            this._isPlaying = false;
            this._audio.pause();
            this._controlBar.setPause();
            this.event("Pause");
        },
        onCtaAction: function (getAction, playerAction) {
            if (getAction) {
                this.onPlayButton(false);
            } else {
                this.onPauseButton();
            }
        },
        onScreenClick: function () {
            if (!this._contextMenu.isShown() && !this._settings.checkSettingsMenu()) {
                if (this._controlBar.isPlaying()) {
                    this._messages.hideImmediatelyMessage("PlayerActionPlay");
                    this.onPauseButton();
                    this._messages.showIconMessage("PlayerActionPause", 600);
                } else {
                    if (!this._replayEvent) {
                        this._messages.hideImmediatelyMessage("PlayerActionPause");
                        this.onPlayButton(false);
                        this._messages.showIconMessage("PlayerActionPlay", 600);
                    } else {
                        if (this._audio.getCurrentTime() != this._audio.getDuration()) {
                            this._messages.hideImmediatelyMessage("PlayerActionPause");
                            this.onPlayButton(true);
                            this._messages.showIconMessage("PlayerActionPlay", 600);
                        }
                    }
                }
            }
        },
        getPlayDuration: function () {
            return this._audio.getDuration();
        },
        onTimeSliderClick: function () {
            this.event("Seek to " + (this._controlBar.getTimeSliderPercent() | 0) + "%");
            if (!this._autoStart) {
                if (this._videoScript.script().getHeaderHelper("posterRatio", "") != "fixed") {
                    this._poster.removePoster();
                } else {
                    this._posterRatio.removePoster();
                }
            }
            this._audio.setCurrentTime(this._controlBar.getTimeSlider(this._audio.getDuration()));
            this._controlBar.setTime(this._audio.getCurrentTime(), this._audio.getDuration());
        },
        onTimeSliderArrows: function (action) {
            this._controlBar.setTimeSliderArrows(this._audio.getCurrentTime(), this._audio.getDuration(), action, false);
            this.event("Seek to " + (this._controlBar.getTimeSliderPercent() | 0) + "%");
            if (!this._autoStart) {
                if (this._videoScript.script().getHeaderHelper("posterRatio", "") != "fixed") {
                    this._poster.removePoster();
                } else {
                    this._posterRatio.removePoster();
                }
            }
            this._audio.setCurrentTime(this._controlBar.getTimeSlider(this._audio.getDuration()));
            this._controlBar.setTime(this._audio.getCurrentTime(), this._audio.getDuration());
        },
        onVolumeSliderClick: function () {
            var getVolumeSlider = this._controlBar.getVolumeSlider();
            this.event("Volume change to " + getVolumeSlider);
            var isMuted = this._controlBar.isMute();
            this._audio.setVolume(getVolumeSlider);
            if (isMuted && getVolumeSlider != 0) {
                this._audio.muted(false);
                this._controlBar.setUnmute();
            } else {
                if (!isMuted && getVolumeSlider == 0) {
                    this._audio.muted(true);
                    this._controlBar.setMute();
                }
            }
        },
        onVolumeSliderArrows: function (action) {
            var getVolumeSlider = this._controlBar.getVolumeSlider();
            var getVolumeSliderOrig = getVolumeSlider;
            var getVolumeSliderInt = 0;
            var getVolumeSliderStr = "";
            if (getVolumeSlider != 0 && getVolumeSlider != 1) {
                getVolumeSliderStr = HxOverrides.substr(getVolumeSlider == null ? "null" : "" + getVolumeSlider, 2, 1);
                getVolumeSliderInt = Std.parseInt(getVolumeSliderStr);
                if (action == 39) {
                    getVolumeSliderInt += 2;
                } else {
                    getVolumeSliderInt -= 2;
                }
                if (getVolumeSliderInt == 10) {
                    getVolumeSlider = 1;
                } else {
                    getVolumeSlider = parseFloat("0." + getVolumeSliderInt);
                }
            } else {
                if (getVolumeSlider == 1) {
                    if (action == 39) {
                        getVolumeSlider = getVolumeSlider;
                    } else {
                        getVolumeSlider = 0.8;
                    }
                } else {
                    if (action == 39) {
                        getVolumeSlider = 0.2;
                    } else {
                        getVolumeSlider = getVolumeSlider;
                    }
                }
            }
            if (getVolumeSlider > 1) {
                getVolumeSlider = 1;
            }
            if (getVolumeSlider < 0) {
                getVolumeSlider = 0;
            }
            if (getVolumeSliderOrig != getVolumeSlider) {
                this.event("Volume change to " + getVolumeSlider);
            }
            var isMuted = this._controlBar.isMute();
            this._controlBar.setVolumeSlider(getVolumeSlider);
            this._audio.setVolume(getVolumeSlider);
            if (isMuted && getVolumeSlider != 0) {
                this._audio.muted(false);
                this._controlBar.setUnmute();
            } else {
                if (!isMuted && getVolumeSlider == 0) {
                    this._audio.muted(true);
                    this._controlBar.setMute();
                }
            }
        },
        onMuteButton: function () {
            this.event("Audio muted");
            this._audio.muted(true);
            this._controlBar.setMute();
        },
        onUnmuteButton: function () {
            this.event("Audio unmuted");
            if (this._messages.isShown("PlayerAutostartMute")) {
                this._messages.hideImmediatelyMessage("PlayerAutostartMute");
            }
            this._audio.muted(false);
            if (this._checkDeviceFunctions) {
                var getVolumeSlider = this._controlBar.getVolumeSlider();
                this._controlBar.setUnmute();
                if (getVolumeSlider == 0) {
                    this._controlBar.setVolumeSlider(0.2);
                    this._audio.setVolume(0.2);
                }
            }
        },
        onVideoEnd: function () {
            var _gthis = this;
            this._isPlaying = false;
            this._controlBar.setPause();
            this.event("End Video");
            this._replayEvent = true;
            this.videoEndCallback();
            if (this._videoScript.script().getFragmentOnEndRepeat(this._videoName)) {
                this.event("End repeat");
                this._audio.setCurrentTime(0);
                this._audio.play();
                this._controlBar.setPlay();
            } else {
                var onEndVideoLoad = this._videoScript.script().getFragmentOnEndVideoLoad(this._videoName);
                if (onEndVideoLoad != "") {
                    this.event("End load");
                    this._lastFragmentUuid = this._videoScript.script().getFragmentVideoUuid(this._videoName);
                    var onEndVideoLoad1 = this._videoScript.script().getFragmentOnEndVideoLoad(this._videoName);
                    var onEndVideoScript = this._videoScript.script().getFragmentOnEndVideoScript(this._videoName);
                    var lastVideoScriptName = this._videoScript.name();
                    var videoScriptName = onEndVideoScript != "" ? onEndVideoScript : lastVideoScriptName;
                    this._videoScript.select(
                        videoScriptName,
                        function () {
                            _gthis._videoPath.add(lastVideoScriptName, _gthis._videoName);
                            _gthis.loadFragment(onEndVideoLoad1, false);
                        },
                        function () {}
                    );
                }
            }
        },
        onBlockClick: function (videoOid, blockOid, name, action, args, like) {
            switch (action) {
                case "back":
                    this.onBackButton();
                    break;
                case "cta":
                    this.ctaHelper(videoOid, blockOid, args, name);
                    break;
                case "image":
                    this.loadHelper(args, name);
                    this.linkHelper(args, name, "Image link");
                    this.ctaHelper(videoOid, blockOid, args, name);
                    break;
                case "link":
                    this.linkHelper(args, name, "Link");
                    break;
                case "load":
                    this.loadHelper(args, name);
                    break;
                case "play":
                    this._audio.play();
                    this._controlBar.setPlay();
                    break;
                case "rating":
                    this.event("Rating " + (like ? "like" : "dislike"));
                    break;
                case "repeat":
                    this.onRepeatButton();
                    break;
                case "seek":
                    if (args.position != null) {
                        this.event("Seek button (" + name + ")");
                        this._audio.setCurrentTime(args.position);
                        this._controlBar.setTime(this._audio.getCurrentTime(), this._audio.getDuration());
                        this._audio.play();
                        this._controlBar.setPlay();
                    }
                    break;
                case "start":
                    this.onStartButton();
                    break;
                case "text":
                    this.linkHelper(args, name, "Text link");
                    this.ctaHelper(videoOid, blockOid, args, name);
                    break;
            }
        },
        onPauseCommand: function (command) {
            this._isPlaying = false;
            this._audio.pause();
            this._controlBar.setPause();
            this.event("Pause command");
        },
        onSeekCommand: function (command) {
            if (command.seekTo == null) {
                return;
            }
            this._audio.setCurrentTime(command.seekTo);
            this.event("Seek command");
        },
        getPlayPercent: function () {
            if (this._audio == null || isNaN(this._audio.getDuration())) {
                return 0;
            }
            return (this._audio.getCurrentTime() * 100) / this._audio.getDuration();
        },
        onResize: function (e) {
            if (!this._loop) {
                return;
            }
            var playerWidth = this._container.getWidth();
            var playerHeight = this._container.getHeight();
            this._controlBar.rezize();
            this._controlBar.hideEnable(!(this._controlsBelowVideo && !this._controlBar.isFullScreen()));
            if (this._posterRatio != null) {
                this._posterRatio.resize(this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            }
            if (this._video != null) {
                var duration = this._audio.getDuration();
                var framesTotal = Math.floor(duration * this._framePerSec);
                this._video.renderFrame(this._container, this._buffer, this._frameNum, framesTotal, this._framePerSec, this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            }
            if (this._settings != null && this._settings.checkMenuActive()) {
                this._settings.resize();
            }
            if (this._subtitles != null) {
                this._subtitles.resize();
            }
            if (this._messages != null) {
                this._messages.resize(playerWidth, playerHeight, this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            }
        },
        onBufferEmpty: function () {
            this._audio.pause();
            this._controlBar.setPause();
            if (!pingvp_PingVpDevice.isIpad() && !this._replayEvent) {
                this._progress.enable();
            } else {
                this._progress.disable();
            }
        },
        onBufferCheck: function () {
            if (this._buffer.bufferCheck(Math.floor(this._frameNum / this._numberFramesPerChunk))) {
                this._progress.disable();
                if (this._isPlaying) {
                    this._audio.play();
                    this._controlBar.setPlay();
                }
            }
        },
        cleanup: function () {
            this._audio.pause();
            this._loop = false;
            if (this._bufferTimer != null) {
                this._bufferTimer.stop();
            }
            this._bufferTimer = null;
            if (this._renderTimer != null) {
                this._renderTimer.stop();
            }
            this._renderTimer = null;
            this._container.get().html("");
            this._audio.cleanup();
            this._audio = null;
        },
        linkHelper: function (args, name, statsName) {
            if (args.url != null) {
                var target = "_top";
                if (args.target != null) {
                    if (args.target == "blank") {
                        target = "_blank";
                    } else {
                        if (args.target == "top") {
                            target = "_top";
                        } else {
                            target = args.target;
                        }
                    }
                }
                if (target == "_top") {
                    this.event(statsName + ' "' + name + '"');
                    this._isPlaying = false;
                    this._audio.pause();
                    this._progress.enable();
                    this._controlBar.setPause();
                    haxe_Timer.delay(function () {
                        window.open(args.url, target);
                    }, 1500);
                } else {
                    this.event(statsName + ' "' + name + '" (new tab)');
                    window.open(args.url, target);
                }
                return true;
            }
            return false;
        },
        loadHelper: function (args, name) {
            var _gthis = this;
            if (args.video != null) {
                this.event('Load "' + name + '"');
                this._replayEvent = false;
                this._lastFragmentUuid = this._videoScript.script().getFragmentVideoUuid(this._videoName);
                if (args.videoScriptName != null) {
                    var _videoScriptName = this._videoScript.name();
                    this._videoScript.select(
                        args.videoScriptName,
                        function () {
                            _gthis._videoPath.add(_videoScriptName, _gthis._videoName);
                            _gthis.loadFragment(args.video, false);
                        },
                        function () {}
                    );
                    return true;
                }
                this._videoPath.add(this._videoScript.name(), this._videoName);
                this.loadFragment(args.video, false);
                return true;
            }
            return false;
        },
        ctaHelper: function (videoOid, blockOid, args, name) {
            this.event('CtaClick "' + name + '"');
            var _jqyCtaBlock = $("#pingVpBlock-" + videoOid + "-" + blockOid + "-ctaOpen");
            if (args.ctaToggle == true) {
                if (_jqyCtaBlock.css("display") == "none") {
                    _jqyCtaBlock.show();
                    if (args.ctaOnOpen != null && args.ctaOnOpen == "pause") {
                        this.onCtaAction(false, false);
                    } else {
                        if (args.ctaOnOpen != null && args.ctaOnOpen == "play") {
                            this.onCtaAction(true, false);
                        }
                    }
                } else {
                    _jqyCtaBlock.hide();
                    if (args.ctaOnClose != null && args.ctaOnClose == "pause") {
                        this.onCtaAction(false, false);
                    } else {
                        if (args.ctaOnClose != null && args.ctaOnClose == "play") {
                            this.onCtaAction(true, false);
                        }
                    }
                }
            } else {
                _jqyCtaBlock.show();
                if (args.ctaOnOpen != null && args.ctaOnOpen == "pause") {
                    this.onCtaAction(false, false);
                } else {
                    if (args.ctaOnOpen != null && args.ctaOnOpen == "play") {
                        this.onCtaAction(true, false);
                    }
                }
            }
        },
        onFullScreenEvent: function () {
            if (!this._controlBar.isFullScreen()) {
                this.event("Enter full screen");
            }
            if (this._fullScreen != null && this._fullScreen.isFullWindowSelected()) {
                this._fullScreen.setChild(this._container.get().get(0));
                if (this._controlBar.isPlaying()) {
                    this._audio.play();
                }
            }
            this.onResize(null);
        },
        onWindowedEvent: function () {
            if (this._controlBar.isFullScreen()) {
                this.event("Leave full screen");
            }
            this._controlBar.setWindowed();
            if (this._fullScreen != null && this._fullScreen.isFullWindowSelected()) {
                this._fullScreen.removeChild();
                this._container.reset();
                if (this._controlBar.isPlaying()) {
                    this._audio.play();
                }
            }
            this.onResize(null);
        },
        __class__: pingvp_PingVpCanvasPlayer,
    });
    var pingvp_PingVpCanvasVideo = function (videoOid, containerWidth, containerHeight, frameWidth, frameHeight, videoWidth, videoHeight, numberFramesPerChunk, funBufferEmpty) {
        this._frameWidth = frameWidth;
        this._frameHeight = frameHeight;
        this._videoWidth = videoWidth;
        this._videoHeight = videoHeight;
        this._numFramesInChunk = numberFramesPerChunk;
        this._lastSequence = -1;
        this._lastFrame = 0;
        this._lastFrameImage = null;
        this._funBufferEmpty = funBufferEmpty;
        $("#pingVpVideoContainer-" + videoOid).html('<canvas id="pingVpCanvas-' + videoOid + '" class="pingVpCanvas pingVpReset"></canvas>');
        this._canvas = window.document.getElementById("pingVpCanvas-" + videoOid);
        $(this._canvas).css("backgroundColor", "#000000");
        this._context = this._canvas.getContext("2d");
        this._context.scale(1, 1);
    };
    $hxClasses["pingvp.PingVpCanvasVideo"] = pingvp_PingVpCanvasVideo;
    pingvp_PingVpCanvasVideo.__name__ = ["pingvp", "PingVpCanvasVideo"];
    pingvp_PingVpCanvasVideo.prototype = {
        setOnClick: function (onClick) {
            $(this._canvas).click(onClick);
        },
        renderFrame: function (container, buffer, frame, framesTotal, framePerSec, paddingBelow) {
            var currentSequence = (frame / this._numFramesInChunk) | 0;
            var sequenceImage = null;
            if (frame < framesTotal) {
                sequenceImage = buffer.getSequenceImage(currentSequence);
            }
            if (sequenceImage != null) {
                this._lastFrameImage = sequenceImage;
                this._lastSequence = currentSequence;
                this._lastFrame = frame;
            } else {
                sequenceImage = this._lastFrameImage;
                currentSequence = this._lastSequence;
                frame = this._lastFrame;
                if (this._funBufferEmpty != null) {
                    this._funBufferEmpty();
                }
            }
            var playableWidth = container.getWidth();
            var playableHeight = container.getHeight() - paddingBelow;
            $(this._canvas).width(playableWidth);
            $(this._canvas).height(playableHeight);
            this._canvas.width = playableWidth;
            this._canvas.height = playableHeight;
            var renderWidth;
            var renderHeight;
            if (playableWidth > (playableHeight * this._videoWidth) / this._videoHeight) {
                renderWidth = (playableHeight * this._videoWidth) / this._videoHeight;
                renderHeight = playableHeight;
            } else {
                renderWidth = playableWidth;
                renderHeight = (playableWidth * this._videoHeight) / this._videoWidth;
            }
            var x = ((playableWidth - renderWidth) / 2) | 0;
            var y = ((playableHeight - renderHeight) / 2) | 0;
            if (this._context != null && sequenceImage != null) {
                this._context.drawImage(sequenceImage, (frame % this._numFramesInChunk) * this._frameWidth, 0, this._frameWidth, this._frameHeight, x, y, (renderWidth + 1) | 0, (renderHeight + 1) | 0);
            }
        },
        getPosLeft: function () {
            return $(this._canvas).position().left;
        },
        getPosTop: function () {
            return $(this._canvas).position().top;
        },
        getWidth: function () {
            return $(this._canvas).width();
        },
        getHeight: function () {
            return $(this._canvas).height();
        },
        __class__: pingvp_PingVpCanvasVideo,
    };
    var pingvp_PingVpClick = function (videoOid, videoScriptName, onPingVpClickPlay, onPingVpClickPause) {
        var _gthis = this;
        this._onPingVpClickPlay = onPingVpClickPlay;
        this._onPingVpClickPause = onPingVpClickPause;
        this._html = $("html");
        this._html.on("click", ".pingVpPlay[data-video='" + videoScriptName + "']", function (e) {
            e.preventDefault();
            _gthis._onPingVpClickPlay(true);
        });
        this._html.on("click", ".pingVpPause[data-video='" + videoScriptName + "']", function (e1) {
            e1.preventDefault();
            _gthis._onPingVpClickPause();
        });
    };
    $hxClasses["pingvp.PingVpClick"] = pingvp_PingVpClick;
    pingvp_PingVpClick.__name__ = ["pingvp", "PingVpClick"];
    pingvp_PingVpClick.prototype = {
        onPingVpClickPlay: function (onPingVpClickPlay) {
            this._onPingVpClickPlay = onPingVpClickPlay;
        },
        onPingVpClickPause: function (onPingVpClickPause) {
            this._onPingVpClickPause = onPingVpClickPause;
        },
        __class__: pingvp_PingVpClick,
    };
    var pingvp_PingVpConfigRead = function () {};
    $hxClasses["pingvp.PingVpConfigRead"] = pingvp_PingVpConfigRead;
    pingvp_PingVpConfigRead.__name__ = ["pingvp", "PingVpConfigRead"];
    pingvp_PingVpConfigRead.get = function () {
        return PingVpConfig;
    };
    var pingvp_PingVpContextMenu = function (videoOid) {
        this._videoOid = videoOid;
        this._open = false;
        this._options = [];
    };
    $hxClasses["pingvp.PingVpContextMenu"] = pingvp_PingVpContextMenu;
    pingvp_PingVpContextMenu.__name__ = ["pingvp", "PingVpContextMenu"];
    pingvp_PingVpContextMenu.prototype = {
        setupContextMenus: function (container, theme) {
            this._theme = theme;
            this._container = container;
            if ($("#pingVpContextMenu-" + this._videoOid).length == 0) {
                $(window.document.body).append('<div class="pingVpContextMenu pingVpContextNonFullScreen pingVpReset" id="pingVpContextMenu-' + this._videoOid + '"><div>');
            }
            if ($("#pingVpContextMenuFs-" + this._videoOid).length == 0) {
                $(this._container.get()).append('<div class="pingVpContextMenu pingVpContextIsFullScreen pingVpReset" id="pingVpContextMenuFs-' + this._videoOid + '"><div>');
            }
            this._menu = $("#pingVpContextMenu-" + this._videoOid + "");
            this._menu.css("background-color", "#" + theme.getByKey("menubackcolor")).css("color", "#" + theme.getByKey("menucolor"));
            this._menu.css("display", "none");
            this._menu.css("position", "absolute");
            this._menu.css("zIndex", "2147483647");
            this._menuFS = $("#pingVpContextMenuFs-" + this._videoOid + "");
            this._menuFS.css("background-color", "#" + theme.getByKey("menubackcolor")).css("color", "#" + theme.getByKey("menucolor"));
            this._menuFS.css("display", "none");
            this._menuFS.css("position", "absolute");
            this._menuFS.css("zIndex", "2147483647");
            $(window.document.body).click($bind(this, this.onBodyClickClose));
        },
        addOption: function (id, label, bg, fun) {
            if ($("#" + StringTools.htmlEscape(id)).length == 0) {
                this._menu.append('<div class="pingVpContextOption pingVpReset pingVp-' + StringTools.htmlEscape(id) + '" id="' + StringTools.htmlEscape(id) + '">' + StringTools.htmlEscape(label) + "</div>");
                var option = $("#" + StringTools.htmlEscape(id));
                if (bg != null) {
                    option.css("backgroundImage", "url(" + StringTools.htmlEscape(bg) + ")");
                    option.addClass("pingVpContextIcon");
                }
                var f = $bind(this, this.onOptionClick);
                var a1 = fun;
                option.click(function (e) {
                    f(a1, e);
                });
                this._options.push(option);
            }
            if ($("#pingVpFs-" + StringTools.htmlEscape(id)).length == 0) {
                this._menuFS.append('<div class="pingVpContextOption pingVpReset pingVp-' + StringTools.htmlEscape(id) + '" id="pingVpFs-' + StringTools.htmlEscape(id) + '">' + StringTools.htmlEscape(label) + "</div>");
                var optionFs = $("#pingVpFs-" + StringTools.htmlEscape(id));
                if (bg != null) {
                    optionFs.css("backgroundImage", "url(" + StringTools.htmlEscape(bg) + ")");
                    optionFs.addClass("pingVpContextIcon");
                }
                var f1 = $bind(this, this.onOptionClick);
                var a11 = fun;
                optionFs.click(function (e1) {
                    f1(a11, e1);
                });
            }
        },
        addHr: function () {
            if ($("#pingVpContextHrMenu").length == 0) {
                this._menu.append('<hr id="pingVpContextHrMenu">');
            }
            if ($("#pingVpContextHrMenuFS").length == 0) {
                this._menuFS.append('<hr id="pingVpContextHrMenuFS">');
            }
        },
        menuOpen: function (fullscreen, e) {
            if ($(e.target).closest("#pingVpControlBarTime-" + this._videoOid).length == 0 && $(e.target).closest(".pingVpControlToggleSvg").length == 0) {
                if (fullscreen.isFullScreen()) {
                    this._currentlySelected = this._menuFS;
                    this._currentlySelectedRev = this._menu;
                } else {
                    this._currentlySelected = this._menu;
                    this._currentlySelectedRev = this._menuFS;
                }
                this._currentlySelectedRev.css("display", "none");
                this._currentlySelected.css("display", "block");
                if (fullscreen.isFullScreen()) {
                    this._currentlySelected.css("left", e.pageX);
                    this._currentlySelected.css("top", e.pageY - $(this._container.get()).offset().top);
                } else {
                    this._currentlySelected.css("left", e.pageX);
                    this._currentlySelected.css("top", e.pageY);
                }
            } else {
                this.onBodyClickClose(null);
            }
            e.preventDefault();
        },
        onOptionClick: function (fun, e) {
            if (fun != null) {
                fun();
            }
            this._menu.css("display", "none");
            this._menuFS.css("display", "none");
        },
        onBodyClickClose: function (e) {
            this._menu.css("display", "none");
            this._menuFS.css("display", "none");
        },
        isShown: function () {
            if (this._menu.css("display") == "none") {
                return this._menuFS.css("display") != "none";
            } else {
                return true;
            }
        },
        __class__: pingvp_PingVpContextMenu,
    };
    var pingvp_PingVpControlBar = function (
        videoOid,
        debug,
        disabled,
        overlay,
        videoScript,
        enableFullScreen,
        enableQuality,
        enableCc,
        enableSpeed,
        enableShare,
        controlsBelowVideo,
        theme,
        inOverlay,
        isHtmlPlayer,
        text,
        videoName,
        container
    ) {
        var _gthis = this;
        this._pingVpElement = $(".PingVP");
        this._debug = debug;
        this._disabled = disabled;
        this._hideEnable = false;
        this._hideEnableLast = false;
        this._jqyVolumeSliderHover = false;
        this._videoOid = videoOid;
        this._enableFullScreen = enableFullScreen;
        this._videoScript = videoScript;
        this._enableQuality = enableQuality;
        this._enableCc = enableCc;
        this._enableSpeed = enableSpeed;
        this._enableShare = enableShare;
        this._controlsBelowVideo = controlsBelowVideo;
        this._theme = theme;
        this._inOverlay = inOverlay;
        this._isHtmlPlayer = isHtmlPlayer;
        this._text = text;
        this._justUsedFocus = false;
        this._overlay = $("#pingVpOverlay-" + this._videoOid);
        this._scriptWidth = this._videoScript.getFragmentVideoWidth(videoName);
        this._scriptHeight = this._videoScript.getFragmentVideoHeight(videoName);
        this._container = container;
        this._mobileCheck = false;
        if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
            this._mobileCheck = true;
        }
        this._generalLeftOffset = 0;
        this._generalRightOffset = 0;
        this._controlBarElement = window.document.createElement("div");
        this._controlBarElement.id = "pingVpControlBar-" + videoOid;
        var mobileClass = this._mobileCheck ? "pingVpControlOverlay" : "";
        var controlBackground = this._mobileCheck ? "" : "PingVpControlBarBackground";
        if (this._controlsBelowVideo == false) {
            this._controlBarElement.className = "pingVpControlBar " + mobileClass + " pingVpReset pingVpControlBarHovering " + controlBackground;
        } else {
            this._controlBarElement.className = "pingVpControlBar " + mobileClass + " pingVpReset pingVpControlBarSticky";
        }
        if (this._disabled) {
            this._controlBarElement.style.display = "none";
        }
        if (!this._mobileCheck) {
            this._controlBarChildTime = window.document.createElement("div");
            this._controlBarChildTime.id = "pingVpControlBarTime-" + videoOid;
            this._controlBarChildTime.className = "pingVpControlBarChildTime";
            this._controlBarElement.appendChild(this._controlBarChildTime);
        }
        this._controlBarChildOther = window.document.createElement("div");
        this._controlBarChildOther.id = "pingVpControlBarOther-" + videoOid;
        this._controlBarChildOther.className = "pingVpControlBarChildOther";
        this._controlBarLeftSide = window.document.createElement("div");
        this._controlBarLeftSide.id = "pingVpControlLeftSide-" + videoOid;
        this._controlBarLeftSide.className = "pingVpControlLeftSide";
        this._controlBarRightSide = window.document.createElement("div");
        this._controlBarRightSide.id = "pingVpControlRightSide-" + videoOid;
        this._controlBarRightSide.className = "pingVpControlRightSide";
        this._controlBarChildOther.appendChild(this._controlBarLeftSide);
        this._controlBarChildOther.appendChild(this._controlBarRightSide);
        this._controlBarElement.appendChild(this._controlBarChildOther);
        if (this._mobileCheck) {
            this._controlBarChildTime = window.document.createElement("div");
            this._controlBarChildTime.id = "pingVpControlBarTime-" + videoOid;
            this._controlBarChildTime.className = "pingVpControlBarChildTime";
            this._controlBarElement.appendChild(this._controlBarChildTime);
        }
        this._controlBarCollect = window.document.createElement("div");
        this._controlBarCollect.id = "pingVpControlCollected-" + videoOid;
        var mobileCollectedClass = this._mobileCheck ? "pingVpCollectMobile" : "";
        if (this._controlsBelowVideo == true) {
            this._controlBarCollect.className = "pingVpCollectBar " + mobileCollectedClass;
        } else {
            this._controlBarCollect.className = "pingVpCollectBar pingVpCollectBarFloat " + mobileCollectedClass;
        }
        if (this._mobileCheck) {
            this._controlBarOverlayMobile = window.document.createElement("div");
            this._controlBarOverlayMobile.id = "pingVpControlOverlayMobile-" + videoOid;
            this._controlBarOverlayMobile.className = "pingVpControlOverlayMobile";
            this._controlBarTopBar = window.document.createElement("div");
            this._controlBarTopBar.id = "pingVpControlBarTop-" + videoOid;
            this._controlBarTopBar.className = "pingVpControlBarTop";
            this._controlBarLeftTopSide = window.document.createElement("div");
            this._controlBarLeftTopSide.id = "pingVpControlLeftTopSide-" + videoOid;
            this._controlBarLeftTopSide.className = "pingVpControlLeftTopSide";
            this._controlBarTopBar.appendChild(this._controlBarLeftTopSide);
            this._controlBarRightTopSide = window.document.createElement("div");
            this._controlBarRightTopSide.id = "pingVpControlRightTopSide-" + videoOid;
            this._controlBarRightTopSide.className = "pingVpControlRightTopSide";
            this._controlBarTopBar.appendChild(this._controlBarRightTopSide);
            this._controlBarOverlayMobile.appendChild(this._controlBarTopBar);
            this._controlBarCenter = window.document.createElement("div");
            this._controlBarCenter.id = "pingVpControlBarCenter-" + videoOid;
            this._controlBarCenter.className = "pingVpControlBarCenter";
            this._controlBarCenterHorizontal = window.document.createElement("div");
            this._controlBarCenterHorizontal.id = "pingVpControlBarCenterHorizontal-" + videoOid;
            this._controlBarCenterHorizontal.className = "pingVpControlBarCenterHorizontal";
            this._controlBarCenter.appendChild(this._controlBarCenterHorizontal);
            this._controlBarOverlayMobile.appendChild(this._controlBarCenter);
            this._controlBarOverlayMobile.appendChild(this._controlBarElement);
            this._controlBarCollect.appendChild(this._controlBarOverlayMobile);
        } else {
            this._controlBarCollect.appendChild(this._controlBarElement);
        }
        overlay.get().append(this._controlBarCollect);
        if (this._controlsBelowVideo == true) {
            this._setBackgroundColorBar = $("#pingVpControlBarOther-" + videoOid);
            this._setBackgroundColorBar.css("background-color", "#" + theme.getByKey("controlbarcolor"));
        }
        var defaultColor = videoScript.getHeaderDefaultColor();
        if (defaultColor == null || defaultColor == "") {
            defaultColor = theme.getByKey("defaultcolor");
        }
        if (this._controlsBelowVideo != true) {
            defaultColor = theme.getSetDefaultColor();
        }
        var hoverColor = videoScript.getHeaderHoverColor();
        if (hoverColor == null || hoverColor == "") {
            hoverColor = theme.getByKey("hovercolor");
        }
        if (this._controlsBelowVideo != true) {
            hoverColor = theme.getSetHoverColor();
        }
        var width = this._controlBarElement.clientWidth;
        var width2 = $("#pingVpOverlayPlayContainer-" + videoOid).width();
        var marginClass = "";
        var minMarginClass = "";
        var displayClass = "";
        var paddingClass = "";
        if (width2 < width) {
            width = width2;
        }
        if (paddingClass != "") {
            $(this._controlBarChildOther).addClass(paddingClass);
        }
        if (this._mobileCheck) {
            this._5secBackButton = new pingvp_PingVpControlToggleSvg(
                "pingVpControl5sBack",
                videoOid,
                "5sback_icon",
                "5sback_icon",
                defaultColor,
                hoverColor,
                theme,
                false,
                false,
                "pingVpControlBarCenterHorizontal",
                marginClass + " pingVpControlPlayMobile",
                "pingVpLargeCenterSvg",
                this._controlsBelowVideo
            );
            this._5secBackButton.setOnHandler($bind(this, this.on5secBackButtonClick));
            this._5secBackButton.setOffHandler($bind(this, this.on5secBackButtonClick));
        }
        this._playButtonOffset = 0;
        if (!this._mobileCheck) {
            var playColor = videoScript.getHeaderDefaultColor();
            if (playColor == null || playColor == "") {
                playColor = theme.getByKey("defaultcolor");
            }
            this._playButton = new pingvp_PingVpControlToggleSvg("pingVpControlPlay", videoOid, "pause_button", "play_button", playColor, hoverColor, theme, false, false, "left", marginClass, "", this._controlsBelowVideo);
            this._playButton.setOnHandler($bind(this, this.onPlay));
            this._playButton.setOffHandler($bind(this, this.onPause));
            this._playButton.setHoverHandler(this._text.get("controlPlayLabelOn"), this._text.get("controlPlayLabelOff"), true, this._playButtonOffset);
        } else {
            this._playButton = new pingvp_PingVpControlToggleSvg(
                "pingVpControlPlay",
                videoOid,
                "pause_button",
                "play_button",
                defaultColor,
                hoverColor,
                theme,
                false,
                false,
                "pingVpControlBarCenterHorizontal",
                marginClass + " pingVpControlPlayMobile",
                "pingVpLargeCenterSvg",
                this._controlsBelowVideo
            );
            this._playButton.setOnHandler($bind(this, this.onPlay));
            this._playButton.setOffHandler($bind(this, this.onPause));
        }
        var timeColor = videoScript.getHeaderTimeColor();
        if (timeColor == null || timeColor == "") {
            timeColor = theme.getByKey("timecolor");
        }
        if (this._controlsBelowVideo != true) {
            timeColor = "fff";
        }
        this._timeText = new pingvp_PingVpControlTime(videoOid, timeColor, this._debug, displayClass);
        this._timeSlider = new pingvp_PingVpControlSliderSvg("pingVpTimeSlider", videoOid, overlay, this.setTimeSliderWidth(), "slider", "button", theme, this._controlsBelowVideo, "");
        this._timeSlider.setClickHandler($bind(this, this.onTimeSliderClick));
        this._timeSlider.setArrowHandler($bind(this, this.onTimeSliderArrows));
        var getTimeTextWidth = $("#pingVpControlPos-" + this._videoOid);
        if (!this._mobileCheck) {
            this._5secBackButtonOffset = 40 + getTimeTextWidth.outerWidth();
            this._5secBackButton = new pingvp_PingVpControlToggleSvg("pingVpControl5sBack", videoOid, "5sback_icon", "5sback_icon", defaultColor, hoverColor, theme, false, false, "left", marginClass, "", this._controlsBelowVideo);
            this._5secBackButton.setOnHandler($bind(this, this.on5secBackButtonClick));
            this._5secBackButton.setOffHandler($bind(this, this.on5secBackButtonClick));
            if (!this._mobileCheck) {
                this._5secBackButton.setHoverHandler(this._text.get("control5SecBackLabel"), this._text.get("control5SecBackLabel"), false, this._5secBackButtonOffset);
            }
        }
        if (this._isHtmlPlayer) {
            var mutePosition = this._mobileCheck ? "right" : "left";
            this._muteButtonOffset = 80 + getTimeTextWidth.outerWidth();
            this._muteButton = new pingvp_PingVpControlToggleSvg("pingVpControlMute", videoOid, "sound_on", "sound_off", defaultColor, hoverColor, theme, false, false, mutePosition, minMarginClass, "", this._controlsBelowVideo);
            this._muteButton.setOnHandler($bind(this, this.onUnmute));
            this._muteButton.setOffHandler($bind(this, this.onMute));
            if (!this._mobileCheck) {
                this._muteButton.setHoverHandler(this._text.get("muteLabel"), this._text.get("muteLabel"), false, this._muteButtonOffset);
            }
            this._jqyMuteButton = $("#pingVpControlMute-" + videoOid);
        }
        if (!this._mobileCheck && this._isHtmlPlayer) {
            this._volumeSlider = new pingvp_PingVpControlSliderSvg("pingVpVolumeSlider", videoOid, overlay, 80, "slider", "button", theme, this._controlsBelowVideo, marginClass);
            this._volumeSlider.setClickHandler($bind(this, this.onVolumeSliderClick));
            this._volumeSlider.setArrowHandler($bind(this, this.onVolumeSliderArrows));
            this._jqyVolumeSlider = $("#pingVpVolumeSlider-" + videoOid);
            this._jqyVolumeSliderOverlay = $("#pingVpVolumeSliderOverlay-" + videoOid);
            this._jqyMuteButton.hover(
                function (e) {
                    if (_gthis._jqyVolumeSlider != null) {
                        if (_gthis._jqyVolumeSliderTimer != null) {
                            _gthis._jqyVolumeSliderTimer.stop();
                        }
                        _gthis._jqyVolumeSlider.stop().animate({ width: "show" });
                        _gthis._jqyVolumeSliderHover = true;
                    }
                },
                function (e1) {
                    if (_gthis._jqyVolumeSlider != null) {
                        _gthis._jqyVolumeSlider.stop().animate({ width: "hide" });
                    }
                    _gthis._jqyVolumeSliderHover = false;
                }
            );
            this._jqyMuteButton.focus(function (e2) {
                if (_gthis._jqyVolumeSlider != null) {
                    if (_gthis._jqyVolumeSliderTimer != null) {
                        _gthis._jqyVolumeSliderTimer.stop();
                    }
                    _gthis._jqyVolumeSlider.stop().animate({ width: "show" });
                    _gthis._jqyVolumeSliderHover = true;
                }
            });
            this._jqyMuteButton.blur(function (e3) {
                if (_gthis._jqyVolumeSlider != null) {
                    _gthis._jqyVolumeSlider.stop().animate({ width: "hide" });
                }
                _gthis._jqyVolumeSliderHover = false;
            });
            this._jqyVolumeSlider.hover(
                function (e4) {
                    if (_gthis._jqyVolumeSlider != null) {
                        if (_gthis._jqyVolumeSliderTimer != null) {
                            _gthis._jqyVolumeSliderTimer.stop();
                        }
                        _gthis._jqyVolumeSlider.stop().animate({ width: "show" });
                        _gthis._jqyVolumeSliderHover = true;
                    }
                },
                function (e5) {
                    if (_gthis._jqyVolumeSlider != null) {
                        _gthis._jqyVolumeSlider.stop().animate({ width: "hide" });
                    }
                    _gthis._jqyVolumeSliderHover = false;
                }
            );
            this._jqyVolumeSliderOverlay.focus(function (e6) {
                if (_gthis._jqyVolumeSlider != null) {
                    if (_gthis._jqyVolumeSliderTimer != null) {
                        _gthis._jqyVolumeSliderTimer.stop();
                    }
                    _gthis._jqyVolumeSlider.stop().animate({ width: "show" });
                    _gthis._jqyVolumeSliderHover = true;
                }
            });
            this._jqyVolumeSliderOverlay.blur(function (e7) {
                if (_gthis._jqyVolumeSlider != null) {
                    _gthis._jqyVolumeSlider.stop().animate({ width: "hide" });
                }
                _gthis._jqyVolumeSliderHover = false;
            });
        }
        if (enableCc) {
            var subtitlesPosition = this._mobileCheck ? "pingVpControlRightTopSide" : "right";
            this._subtitlesButtonOffset = enableShare ? 40 : 0;
            this._subtitlesButtonOffset = enableQuality || enableCc || enableSpeed || enableShare ? this._subtitlesButtonOffset + 40 : this._subtitlesButtonOffset;
            this._subtitlesButtonOffset = enableFullScreen ? this._subtitlesButtonOffset + 40 : this._subtitlesButtonOffset;
            this._subtitlesButton = new pingvp_PingVpControlToggleSvg(
                "pingVpControlSubtitles",
                videoOid,
                "subtitles",
                "subtitles",
                defaultColor,
                hoverColor,
                theme,
                false,
                false,
                subtitlesPosition,
                minMarginClass,
                "",
                this._controlsBelowVideo
            );
            this._subtitlesButton.setOnIcon("subtitles_on");
            this._subtitlesButton.setOnHandler($bind(this, this.onSubtitles));
            this._subtitlesButton.setOffHandler($bind(this, this.onSubtitles));
            if (!this._mobileCheck) {
                this._subtitlesButton.setHoverHandler(this._text.get("subtitlesLabel"), this._text.get("subtitlesLabel"), false, this._subtitlesButtonOffset);
            }
        }
        if (enableShare) {
            var sharePosition = this._mobileCheck ? "pingVpControlLeftTopSide" : "right";
            this._shareButtonOffset = enableQuality || enableCc || enableSpeed || enableShare ? 40 : 0;
            this._shareButtonOffset = enableFullScreen ? this._shareButtonOffset + 40 : this._shareButtonOffset;
            this._shareButton = new pingvp_PingVpControlToggleSvg("pingVpControlShare", videoOid, "share", "share", defaultColor, hoverColor, theme, false, false, sharePosition, minMarginClass, "", this._controlsBelowVideo);
            this._shareButton.setOnHandler($bind(this, this.onShare));
            this._shareButton.setOffHandler($bind(this, this.onShare));
            if (!this._mobileCheck) {
                this._shareButton.setHoverHandler(this._text.get("shareLabel"), this._text.get("shareLabel"), false, this._shareButtonOffset);
            }
        }
        if (enableQuality || enableCc || enableSpeed || enableShare) {
            var settingsPosition = this._mobileCheck ? "pingVpControlRightTopSide" : "right";
            this._settingsButtonOffset = enableFullScreen ? 40 : 0;
            this._settingsButton = new pingvp_PingVpControlToggleSvg("pingVpControlSettings", videoOid, "setting", "setting", defaultColor, hoverColor, theme, false, false, settingsPosition, minMarginClass, "", this._controlsBelowVideo);
            this._settingsButton.setOnHandler($bind(this, this.onSettings));
            this._settingsButton.setOffHandler($bind(this, this.onSettings));
            if (!this._mobileCheck) {
                this._settingsButton.setHoverHandler(this._text.get("settingsLabel"), this._text.get("settingsLabel"), false, this._settingsButtonOffset);
            }
        }
        if (enableFullScreen) {
            this._fullScreenButtonOffset = 0;
            this._fullScreenButton = new pingvp_PingVpControlToggleSvg(
                "pingVpControlFullScreen",
                videoOid,
                "small_screen",
                "full_screen",
                defaultColor,
                hoverColor,
                theme,
                false,
                false,
                "right",
                minMarginClass,
                "",
                this._controlsBelowVideo
            );
            this._fullScreenButton.setOnHandler($bind(this, this.onFullScreen));
            this._fullScreenButton.setOffHandler($bind(this, this.onWindowed));
            if (!this._mobileCheck) {
                this._fullScreenButton.setHoverHandler(this._text.get("fullscreenLabel"), this._text.get("smallscreenLabel"), true, this._fullScreenButtonOffset);
            }
        }
        this._controlBarLeftSideJQ = $("#pingVpControlLeftSide-" + videoOid);
        this._controlBarRightSideJQ = $("#pingVpControlRightSide-" + videoOid);
        if (this._mobileCheck) {
            this._selectedShowElement = this._controlBarOverlayMobile;
            this._selectedShowJQuery = $("#pingVpControlOverlayMobile-" + this._videoOid);
        } else {
            this._selectedShowElement = this._controlBarElement;
            this._selectedShowJQuery = $("#pingVpControlBar-" + this._videoOid);
        }
        var tmp = this._mobileCheck;
        $("#pingVpOverlay-" + videoOid).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onShow));
        if (!this._mobileCheck) {
            $("#pingVpOverlay-" + videoOid).mousemove($bind(this, this.onShow));
        }
        $("#pingVpControlBarCenterHorizontal-" + videoOid).append('<div id="pingVpCenter5SecAndPlay-' + videoOid + '" class="pingVpControlPlayMobile pingVpControlCenteredOffset"></div>');
        $("body").on("keyup click contextmenu", null, $bind(this, this.onShowTab));
        this._selectedShowJQuery.css("opacity", 0);
        this._buttonsEnable = true;
        this._focus = $(":focus");
        this._pingVpElement = $(".pingVpWebplayerSelector,#pingVpOverlayPlayContainer-" + this._videoOid + ",.PingVP");

        if ((this._focus.hasClass("pingVpOverlayPlayButton") || this._focus.hasClass("pingVpOverlayPlay")) && this._pingVpElement.hasClass("pingVpIsTabbing")) {
            this._pingVpElement.find('[tabindex="0"]:visible, .pingVpControlBar [tabindex="0"]').first().focus();
            this._focus = $(":focus");
            if (
                this._focus.parents(".pingVpControlBar").length != 0 ||
                this._focus.parents(".pingVpSettingsMenu").length != 0 ||
                this._focus.parents(".pingVpSubtitlesMenu").length != 0 ||
                this._focus.parents(".pingVpShareOverlay").length != 0
            ) {
                if (!this._disabled) {
                    this._selectedShowJQuery.stop(null, false, false);
                    this._selectedShowJQuery.css("opacity", 1);
                    $("#pingVpControlCollected-" + this._videoOid + " .pingVpSubtitles").addClass("pingVpControlBarVisible");
                    $(".pingVpBrandedStudioLogoBottom-" + this._videoOid).addClass("pingVpControlBarVisible");
                    $("#pingVpControlCollected-" + this._videoOid).addClass("pingVpCollectedVisible");
                    this._buttonsEnable = true;
                    this._isFadding = false;
                }
            }
        }
    };
    $hxClasses["pingvp.PingVpControlBar"] = pingvp_PingVpControlBar;
    pingvp_PingVpControlBar.__name__ = ["pingvp", "PingVpControlBar"];
    pingvp_PingVpControlBar.prototype = {
        showTimeSliderKeys: function () {
            this.onShow(null);
        },
        showVolumeSliderKeys: function () {
            var _gthis = this;
            this.onShow(null);
            if (this._jqyVolumeSlider != null && !this._jqyVolumeSliderHover) {
                if (this._jqyVolumeSliderTimer != null) {
                    this._jqyVolumeSliderTimer.stop();
                }
                this._jqyVolumeSlider.stop().animate({ width: "show" });
                this._jqyVolumeSliderTimer = haxe_Timer.delay(function () {
                    _gthis._jqyVolumeSlider.stop().animate({ width: "hide" });
                }, 1500);
            }
        },
        onPlay: function () {
            if (this._playCall != null && this._buttonsEnable) {
                this._playCall();
            }
        },
        onPause: function () {
            if (this._pauseCall != null && this._buttonsEnable) {
                this._pauseCall();
            }
        },
        onFullScreen: function () {
            if (this._fullScreenCall != null && this._buttonsEnable) {
                this._fullScreenCall();
            }
        },
        onWindowed: function () {
            if (this._windowedCall != null && this._buttonsEnable) {
                this._windowedCall();
            }
        },
        onMute: function () {
            if (this._muteCall != null && this._buttonsEnable) {
                this._muteCall();
            }
        },
        onUnmute: function () {
            if (this._unmuteCall != null && this._buttonsEnable) {
                this._unmuteCall();
            }
        },
        onSettings: function () {
            if (this._settingsCall != null && this._buttonsEnable) {
                this._settingsCall();
            }
        },
        onShare: function () {
            if (this._shareCall != null && this._buttonsEnable) {
                this._shareCall();
            }
        },
        onSubtitles: function () {
            if (this._subtitlesCall != null && this._buttonsEnable) {
                this._subtitlesCall();
            }
        },
        onTimeSliderClick: function () {
            if (this._timeSliderCall != null && this._buttonsEnable) {
                this._timeSliderCall();
            }
        },
        onTimeSliderArrows: function (action) {
            if (this._timeSliderCallArrows != null && this._buttonsEnable) {
                this._timeSliderCallArrows(action);
            }
        },
        on5secBackButtonClick: function () {
            if (this._5secBackButtonCall != null && this._buttonsEnable) {
                this._5secBackButtonCall();
            }
        },
        onVolumeSliderClick: function () {
            if (this._volumeSliderCall != null && this._buttonsEnable) {
                this._volumeSliderCall();
            }
        },
        onVolumeSliderArrows: function (action) {
            if (this._volumeSliderCallArrows != null && this._buttonsEnable && !this._justUsedFocus) {
                this._volumeSliderCallArrows(action);
            }
        },
        setPlayHandler: function (call) {
            this._playCall = call;
        },
        setPauseHandler: function (call) {
            this._pauseCall = call;
        },
        setFullScreenHandler: function (call) {
            this._fullScreenCall = call;
        },
        setWindowedHandler: function (call) {
            this._windowedCall = call;
        },
        setMuteHandler: function (call) {
            this._muteCall = call;
        },
        setUnmuteHandler: function (call) {
            this._unmuteCall = call;
        },
        setSettingsHandler: function (call, settings) {
            this._settingsCall = call;
            this._settings = settings;
        },
        setShareHandler: function (call, share) {
            this._shareCall = call;
            this._share = share;
        },
        setSubtitlesHandler: function (call, subtitles) {
            this._subtitlesCall = call;
            this._subtitles = subtitles;
        },
        setTimeSliderHandler: function (call) {
            this._timeSliderCall = call;
        },
        setTimeSliderArrowsHandler: function (call) {
            this._timeSliderCallArrows = call;
        },
        set5secBackButtonHandler: function (call) {
            this._5secBackButtonCall = call;
        },
        setVolumeSliderHandler: function (call) {
            this._volumeSliderCall = call;
        },
        setVolumeSliderArrowsHandler: function (call) {
            this._volumeSliderCallArrows = call;
        },
        setSubsOnIcon: function (icon) {
            if (this._subtitlesButton != null) {
                this._subtitlesButton.setOnIcon(icon);
            }
        },
        setPlay: function () {
            if (this._playButton != null) {
                this._playButton.setOn();
            }
        },
        setPause: function () {
            if (this._playButton != null) {
                this._playButton.setOff();
            }
        },
        setPauseIcon: function () {
            if (this._playButton != null) {
                this._playButton.setOffIcon("pause_button");
            }
        },
        setReplay: function () {
            if (this._playButton != null) {
                this._playButton.setTempOffIcon("replay");
            }
        },
        isPlaying: function () {
            return this._playButton.isOn();
        },
        setFullScreen: function () {
            if (this._enableFullScreen) {
                this._fullScreenButton.setOn();
            }
        },
        setWindowed: function () {
            if (this._enableFullScreen) {
                this._fullScreenButton.setOff();
            }
        },
        isFullScreen: function () {
            if (!this._enableFullScreen) {
                return false;
            }
            return this._fullScreenButton.isOn();
        },
        setMute: function () {
            this._muteButton.setOff();
        },
        setUnmute: function () {
            this._muteButton.setOn();
        },
        isMute: function () {
            if (this._muteButton != null) {
                return !this._muteButton.isOn();
            } else {
                return false;
            }
        },
        setSettings: function (enable) {
            if (enable) {
                this._settingsButton.setOn();
                this._settingsButton.setRotateOn();
            } else {
                this._settingsButton.setOff();
                this._settingsButton.setRotateOff();
            }
        },
        setSubtitles: function (enable) {
            if (this._subtitlesButton != null) {
                if (enable) {
                    this._subtitlesButton.setOn();
                } else {
                    this._subtitlesButton.setOff();
                }
            }
        },
        onShow: function (e) {
            var _gthis = this;
            if (this._disabled) {
                return;
            }
            if (this._mobileCheck) {
                this._checkClick = $(e.target);
                if (
                    this._hideEnable &&
                    this._buttonsEnable &&
                    (this._checkClick.hasClass("pingVpCollectMobile") || this._checkClick.parents(".pingVpCollectMobile").length != 0) &&
                    !this._checkClick.hasClass("pingVpControlToggleSvg") &&
                    this._checkClick.parents(".pingVpControlToggleSvg").length == 0 &&
                    !this._checkClick.hasClass("pingVpControlSlider") &&
                    this._checkClick.parents(".pingVpControlSlider").length == 0 &&
                    !this._checkClick.hasClass("pingVpBlock") &&
                    this._checkClick.parents(".pingVpBlock").length == 0
                ) {
                    this._selectedShowJQuery.stop(null, false, false);
                    this._selectedShowJQuery.css("opacity", 0);
                    $("#pingVpControlCollected-" + this._videoOid + " .pingVpSubtitles").removeClass("pingVpControlBarVisible");
                    $(".pingVpBrandedStudioLogoBottom-" + this._videoOid).removeClass("pingVpControlBarVisible");
                    $("#pingVpControlCollected-" + this._videoOid).removeClass("pingVpCollectedVisible");
                    this._buttonsEnable = false;
                    this._isFadding = false;
                } else {
                    this._selectedShowJQuery.stop(null, false, false);
                    this._selectedShowJQuery.css("opacity", 1);
                    $("#pingVpControlCollected-" + this._videoOid + " .pingVpSubtitles").addClass("pingVpControlBarVisible");
                    $(".pingVpBrandedStudioLogoBottom-" + this._videoOid).addClass("pingVpControlBarVisible");
                    $("#pingVpControlCollected-" + this._videoOid).addClass("pingVpCollectedVisible");
                    this._buttonsEnable = true;
                    this._isFadding = false;
                    this._focus = $(":focus");
                    if (
                        this._hideEnable &&
                        ((this._focus.parents(".pingVpControlBar").length == 0 &&
                            (this._focus.parents(".pingVpSettingsMenu").length == 0 || this._focus.parents(".pingVpSubtitlesMenu").length == 0 || this._focus.parents(".pingVpShareOverlay").length == 0)) ||
                            !this._pingVpElement.hasClass("pingVpIsTabbing"))
                    ) {
                        this._isFadding = true;
                        this._selectedShowJQuery.stop(null, true, false).animate({ opacity: 0 }, 2000, null, function () {
                            _gthis._buttonsEnable = false;
                            $("#pingVpControlCollected-" + _gthis._videoOid + " .pingVpSubtitles").removeClass("pingVpControlBarVisible");
                            $(".pingVpBrandedStudioLogoBottom-" + _gthis._videoOid).removeClass("pingVpControlBarVisible");
                            $("#pingVpControlCollected-" + _gthis._videoOid).removeClass("pingVpCollectedVisible");
                        });
                    }
                }
            } else {
                this._selectedShowJQuery.stop(null, false, false);
                this._selectedShowJQuery.css("opacity", 1);
                $("#pingVpControlCollected-" + this._videoOid + " .pingVpSubtitles").addClass("pingVpControlBarVisible");
                $(".pingVpBrandedStudioLogoBottom-" + this._videoOid).addClass("pingVpControlBarVisible");
                $("#pingVpControlCollected-" + this._videoOid).addClass("pingVpCollectedVisible");
                this._buttonsEnable = true;
                this._isFadding = false;
                this._focus = $(":focus");
                if (
                    this._hideEnable &&
                    ((this._focus.parents(".pingVpControlBar").length == 0 &&
                        (this._focus.parents(".pingVpSettingsMenu").length == 0 || this._focus.parents(".pingVpSubtitlesMenu").length == 0 || this._focus.parents(".pingVpShareOverlay").length == 0)) ||
                        !this._pingVpElement.hasClass("pingVpIsTabbing"))
                ) {
                    this._isFadding = true;
                    this._selectedShowJQuery.stop(null, true, false).animate({ opacity: 0 }, 2000, null, function () {
                        _gthis._buttonsEnable = false;
                        $("#pingVpControlCollected-" + _gthis._videoOid + " .pingVpSubtitles").removeClass("pingVpControlBarVisible");
                        $(".pingVpBrandedStudioLogoBottom-" + _gthis._videoOid).removeClass("pingVpControlBarVisible");
                        $("#pingVpControlCollected-" + _gthis._videoOid).addClass("pingVpCollectedVisible");
                    });
                }
            }
        },
        onShowTab: function (e) {
            var _gthis = this;
            if (e.which == 9 || e.which == 1 || e.which == 3) {
                this._focus = $(":focus");
                if (this._hideEnable) {
                    if (
                        (this._focus.parents(".pingVpControlBar").length != 0 ||
                            this._focus.parents(".pingVpSettingsMenu").length != 0 ||
                            this._focus.parents(".pingVpSubtitlesMenu").length != 0 ||
                            this._focus.parents(".pingVpShareOverlay").length != 0) &&
                        this._pingVpElement.hasClass("pingVpIsTabbing")
                    ) {
                        this.onShow(e);
                    } else {
                        if (this._buttonsEnable && !this._isFadding) {
                            this._isFadding = true;
                            this._selectedShowJQuery.stop(null, true, false).animate({ opacity: 0 }, 2000, null, function () {
                                _gthis._buttonsEnable = false;
                                $("#pingVpControlCollected-" + _gthis._videoOid + " .pingVpSubtitles").removeClass("pingVpControlBarVisible");
                                $(".pingVpBrandedStudioLogoBottom-" + _gthis._videoOid).removeClass("pingVpControlBarVisible");
                                $("#pingVpControlCollected-" + _gthis._videoOid).removeClass("pingVpCollectedVisible");
                            });
                        }
                    }
                }
            }
        },
        checkLeftAndRightKeys: function (e) {
            this._focus = $(":focus");
            this._justUsedFocus = false;
            if (
                e.which == 37 &&
                this._focus.parents(".pingVpControlBarChildOther").length != 0 &&
                (!this._jqyVolumeSliderOverlay.is(this._focus) || (this._jqyVolumeSliderOverlay.is(this._focus) && this._volumeSlider.getPercent() == 0)) &&
                this._pingVpElement.hasClass("pingVpIsTabbing")
            ) {
                e.preventDefault();
                if (this._controlBarRightSideJQ.find('[tabindex="0"]').first()["is"](this._focus)) {
                    this._controlBarLeftSideJQ.find('[tabindex="0"]:visible').last().focus();
                } else {
                    if (this._jqyVolumeSliderOverlay.is(this._focus)) {
                        this._jqyMuteButton.focus();
                    } else {
                        this._focus.prevAll('[tabindex="0"]').first().focus();
                    }
                }
            }
            if (
                e.which == 39 &&
                this._focus.parents(".pingVpControlBarChildOther").length != 0 &&
                (!this._jqyVolumeSliderOverlay.is(this._focus) || (this._jqyVolumeSliderOverlay.is(this._focus) && this._volumeSlider.getPercent() == 100)) &&
                this._pingVpElement.hasClass("pingVpIsTabbing")
            ) {
                e.preventDefault();
                if (this._controlBarLeftSideJQ.find('[tabindex="0"]').last()["is"](this._focus)) {
                    if (this._controlBarRightSideJQ.find('[tabindex="0"]:visible').first()["is"](this._jqyVolumeSlider.find(".pingVpSvgObjectOverlay"))) {
                        this._justUsedFocus = true;
                        this._controlBarRightSideJQ.find('[tabindex="0"]:visible').first().focus();
                    } else {
                        this._controlBarRightSideJQ.find('[tabindex="0"]:visible').first().focus();
                    }
                } else {
                    if (this._jqyMuteButton.is(this._focus)) {
                        this._justUsedFocus = true;
                        this._jqyVolumeSliderOverlay.focus();
                    } else {
                        this._focus
                            .nextAll("#pingVpControlBarOther-" + this._videoOid + ' [tabindex="0"]')
                            .first()
                            .focus();
                    }
                }
            }
        },
        hideEnable: function (value) {
            var _gthis = this;
            if (this._disabled) {
                return;
            }
            this._hideEnable = value;
            if (this._hideEnableLast != this._hideEnable) {
                this._focus = $(":focus");
                if (
                    this._hideEnable &&
                    ((this._focus.parents(".pingVpControlBar").length == 0 &&
                        this._focus.parents(".pingVpSettingsMenu").length == 0 &&
                        this._focus.parents(".pingVpSubtitlesMenu").length == 0 &&
                        this._focus.parents(".pingVpShareOverlay").length == 0 &&
                        !this._focus.hasClass(".pingVpShareOverlay")) ||
                        !this._pingVpElement.hasClass("pingVpIsTabbing"))
                ) {
                    this._selectedShowJQuery.stop(null, true, false).animate({ opacity: 0 }, 2000, null, function () {
                        _gthis._buttonsEnable = false;
                        $("#pingVpControlCollected-" + _gthis._videoOid + " .pingVpSubtitles").removeClass("pingVpControlBarVisible");
                        $(".pingVpBrandedStudioLogoBottom-" + _gthis._videoOid).removeClass("pingVpControlBarVisible");
                        $("#pingVpControlCollected-" + _gthis._videoOid).removeClass("pingVpCollectedVisible");
                    });
                } else {
                    this._buttonsEnable = true;
                    this._selectedShowJQuery.stop(null, false, false);
                    this._selectedShowJQuery.css("opacity", 1);
                    $("#pingVpControlCollected-" + this._videoOid + " .pingVpSubtitles").addClass("pingVpControlBarVisible");
                    $(".pingVpBrandedStudioLogoBottom-" + this._videoOid).addClass("pingVpControlBarVisible");
                    $("#pingVpControlCollected-" + this._videoOid).addClass("pingVpCollectedVisible");
                }
            }
            if (!this._hideEnable) {
                this._buttonsEnable = true;
                this._selectedShowJQuery.stop(null, true, false);
                this._selectedShowJQuery.css("opacity", 1);
            }
            this._hideEnableLast = this._hideEnable;
        },
        onClickHide: function (e) {},
        setTimeSliderArrows: function (currentTime, duration, action, round) {
            var newCurrentTime = action == 39 ? currentTime + 5 : currentTime - 5;
            var percent = Math.round(((newCurrentTime * 100) / duration) * 100);
            percent /= 100;
            if (percent > 100) {
                percent = 100;
            }
            if (percent < 0) {
                percent = 0;
            }
            this._timeSlider.setPercent(percent);
        },
        setTimeSlider: function (currentTime, duration) {
            var percent = (currentTime * 100) / duration;
            if (percent > 100) {
                percent = 100;
            }
            if (percent < 0) {
                percent = 0;
            }
            this._timeSlider.setPercent(percent);
        },
        setBuffered: function (buffered, duration) {
            var percent = (buffered * 100) / duration;
            if (percent > 100) {
                percent = 100;
            }
            if (percent < 0) {
                percent = 0;
            }
            this._timeSlider.setBufferedPercent(percent);
        },
        getTimeSlider: function (duration) {
            var percent = this._timeSlider.getPercent();
            return (percent * duration) / 100;
        },
        getTimeSliderPercent: function () {
            return this._timeSlider.getPercent();
        },
        setVolumeSlider: function (volume) {
            if (this._volumeSlider == null) {
                return;
            }
            var step = (volume * 5) | 0;
            var percent = (step * 100) / 5;
            if (percent > 100) {
                percent = 100;
            }
            if (percent < 0) {
                percent = 0;
            }
            this._volumeSlider.setPercent(percent);
            if (percent > 0) {
                if (percent > 79) {
                    this._muteButton.setOnIcon("sound_high");
                } else {
                    if (percent > 24) {
                        this._muteButton.setOnIcon("sound_on");
                    } else {
                        this._muteButton.setOnIcon("sound_low");
                    }
                }
            }
        },
        getVolumeSlider: function () {
            var percent = this._volumeSlider.getPercent();
            var step = ((percent * 5) / 100 + 0.5) | 0;
            var volume = step / 5;
            if (volume > 1) {
                volume = 1;
            }
            this.setVolumeSlider(volume);
            return volume;
        },
        rezize: function () {
            this._timeSlider.setWidth(this.setTimeSliderWidth());
            var _jqyVolumeSliderTemp = $("#pingVpVolumeSlider-" + this._videoOid);
            var maxWidth = this._overlay.outerWidth();
            var combinedWidth = maxWidth - (this._controlBarLeftSideJQ.outerWidth() + this._controlBarRightSideJQ.outerWidth() + 20);
            if (combinedWidth < 90 && _jqyVolumeSliderTemp.css("display") != "block") {
                this._jqyVolumeSlider = null;
            } else {
                this._jqyVolumeSlider = $("#pingVpVolumeSlider-" + this._videoOid);
            }
            if (!this._mobileCheck) {
                var getTimeTextWidth = $("#pingVpControlPos-" + this._videoOid);
                this._5secBackButtonOffset = getTimeTextWidth.outerWidth() + 40;
                this._muteButtonOffset = getTimeTextWidth.outerWidth() + 80;
                if (this._playButton != null) {
                    this._playButton.resizeLabel(this._playButtonOffset);
                }
                if (this._5secBackButton != null) {
                    this._5secBackButton.resizeLabel(this._5secBackButtonOffset);
                }
                if (this._muteButton != null) {
                    this._muteButton.resizeLabel(this._muteButtonOffset);
                }
                if (this._enableCc && this._subtitlesButton != null) {
                    this._subtitlesButton.resizeLabel(this._subtitlesButtonOffset);
                }
                if (this._enableShare && this._shareButton != null) {
                    this._shareButton.resizeLabel(this._shareButtonOffset);
                }
                if ((this._enableQuality || this._enableCc || this._enableSpeed || this._enableShare) && this._settingsButton != null) {
                    this._settingsButton.resizeLabel(this._settingsButtonOffset);
                }
                if (this._enableFullScreen && this._fullScreenButton != null) {
                    this._fullScreenButton.resizeLabel(this._fullScreenButtonOffset);
                }
            } else {
                if (!pingvp_PingVpDevice.isLandscape() && this.isFullScreen()) {
                    var videoWidth = this._scriptWidth;
                    var videoHeight = this._scriptHeight;
                    var containerWidth = this._container.getWidth();
                    var containerHeight = this._container.getHeight();
                    var scaleX = containerWidth / videoWidth;
                    var scaleY = containerHeight / videoHeight;
                    var centerX = containerWidth / 2;
                    var centerY = containerHeight / 2;
                    var scale = scaleX;
                    if (scaleY < scaleX) {
                        scale = scaleY;
                    }
                    var startX = centerX - (videoWidth * scale) / 2;
                    var startY = centerY - (videoHeight * scale) / 2;
                    var scaledWidth = videoWidth * scale;
                    var scaledHeight = videoHeight * scale;
                    $("#pingVpControlCollected-" + this._videoOid).css("left", startX + "px");
                    $("#pingVpControlCollected-" + this._videoOid).css("top", startY + "px");
                    $("#pingVpControlCollected-" + this._videoOid).css("width", scaledWidth + "px");
                    $("#pingVpControlCollected-" + this._videoOid).css("height", scaledHeight + "px");
                } else {
                    $("#pingVpControlCollected-" + this._videoOid).css("left", "0");
                    $("#pingVpControlCollected-" + this._videoOid).css("top", "0");
                    $("#pingVpControlCollected-" + this._videoOid).css("width", "100%");
                    $("#pingVpControlCollected-" + this._videoOid).css("height", "100%");
                }
            }
        },
        setActiveHover: function (status) {
            if (this._playButton != null) {
                this._playButton.setActiveHover(status);
            }
            if (this._5secBackButton != null) {
                this._5secBackButton.setActiveHover(status);
            }
            if (this._muteButton != null) {
                this._muteButton.setActiveHover(status);
            }
            if (this._subtitlesButton != null) {
                this._subtitlesButton.setActiveHover(status);
            }
            if (this._shareButton != null) {
                this._shareButton.setActiveHover(status);
            }
            if (this._settingsButton != null) {
                this._settingsButton.setActiveHover(status);
            }
            if (this._fullScreenButton != null) {
                this._fullScreenButton.setActiveHover(status);
            }
        },
        setTime: function (currentTime, duration) {
            this._timeText.set(currentTime, duration);
        },
        setTimeSliderWidth: function () {
            var width = $("#pingVpControlBar-" + this._videoOid + " .pingVpControlBarChildTime").width();
            var timeSliderWidth = 0;
            timeSliderWidth = width;
            return timeSliderWidth;
        },
        __class__: pingvp_PingVpControlBar,
    };
    var pingvp_PingVpControlSliderSvg = function (className, videoOid, _overlay, width, image, buttonImage, theme, controlsBelowVideo, extraClass) {
        var _gthis = this;
        this._className = className;
        this._videoOid = videoOid;
        this._width = width;
        this._image = image;
        this._theme = theme;
        this._isIE = pingvp_PingVpDevice.isMSIE();
        this._mobileCheck = false;
        if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
            this._mobileCheck = true;
        }
        if (className == "pingVpVolumeSlider") {
            this._foregroundColor = controlsBelowVideo ? theme.getByKey("sliderfg") : "fff";
        } else {
            this._foregroundColor = theme.getByKey("sliderfg");
            if (this._mobileCheck) {
                this._foregroundColor = "fff";
            }
        }
        this._backgroundImage = theme.getSlider(theme.getByKey("svgset"), this._image + ".svg", theme.getByKey("sliderbg"));
        this._bufferImage = theme.getSlider(theme.getByKey("svgset"), this._image + ".svg", theme.getByKey("sliderbuffer"));
        this._foregroundImage = theme.getSlider(theme.getByKey("svgset"), this._image + ".svg", this._foregroundColor);
        if (className == "pingVpVolumeSlider") {
            this._buttonImage = theme.getButton(theme.getByKey("svgset"), buttonImage + ".svg", this._foregroundColor);
        } else {
            this._buttonImage = theme.getButton(theme.getByKey("svgset"), buttonImage + ".svg", theme.getByKey("sliderbutton"));
        }
        this._bufferedPercent = 100;
        this._start = 0;
        this._isDragging = false;
        if (this._className == "pingVpTimeSlider") {
            this.controlBar = $("#pingVpControlBar-" + videoOid + " .pingVpControlBarChildTime");
        } else {
            this.controlBar = $("#pingVpControlBar-" + videoOid + " .pingVpControlBarChildOther .pingVpControlLeftSide");
        }
        var _beforeTagImg = this._isIE ? '<object tabindex="-1" data="' : '<img tabindex="-1" src="';
        var _afterTagImg = this._isIE ? '"></object>' : '"/>';
        if (this._className == "pingVpTimeSlider") {
            var slideWidth = controlsBelowVideo ? "100%" : "calc(100% - 20px)";
            this.controlBar.append(
                '<div id="' +
                    className +
                    "-" +
                    videoOid +
                    '" class="pingVpControlSlider ' +
                    className +
                    '" style="width: ' +
                    width +
                    'px;"><div id="' +
                    className +
                    "Bg-" +
                    videoOid +
                    '" class="pingVpSvgSlider" style="width: ' +
                    slideWidth +
                    ';">' +
                    _beforeTagImg +
                    this._backgroundImage +
                    _afterTagImg +
                    '</div><div id="' +
                    className +
                    "Buffered-" +
                    videoOid +
                    '" class="pingVpSvgSlider" style="width: ' +
                    slideWidth +
                    ';">' +
                    _beforeTagImg +
                    this._bufferImage +
                    _afterTagImg +
                    '</div><div id="' +
                    className +
                    "Fg-" +
                    videoOid +
                    '" class="pingVpSvgSlider" style="width: 0px;">' +
                    _beforeTagImg +
                    this._foregroundImage +
                    _afterTagImg +
                    '</div><div id="' +
                    className +
                    "Bol-" +
                    videoOid +
                    '" class="' +
                    className +
                    'Bol" style="background-image: url(' +
                    this._buttonImage +
                    ');"></div><div id="' +
                    className +
                    "Overlay-" +
                    videoOid +
                    '" tabindex="0" class="pingVpSvgSlider pingVpSvgObjectOverlay pingVpSvgObjectOverlayTimeSlider" style="width: ' +
                    slideWidth +
                    ';"></div></div>'
            );
        } else {
            this.controlBar.append(
                '<div id="' +
                    className +
                    "-" +
                    videoOid +
                    '" class="pingVpControlSlider ' +
                    className +
                    " " +
                    extraClass +
                    '" style="width: ' +
                    width +
                    'px;"><div id="' +
                    className +
                    "Bg-" +
                    videoOid +
                    '" class="pingVpSvgSlider" style="width: calc(100% - 10px);">' +
                    _beforeTagImg +
                    this._backgroundImage +
                    _afterTagImg +
                    '</div><div id="' +
                    className +
                    "Fg-" +
                    videoOid +
                    '" class="pingVpSvgSlider pingVpVolumeSliderFg" style="width: 0px;">' +
                    _beforeTagImg +
                    this._foregroundImage +
                    _afterTagImg +
                    '</div><div id="' +
                    className +
                    "Overlay-" +
                    videoOid +
                    '" class="pingVpSvgSlider pingVpSvgObjectOverlay" tabindex="0" style="width: calc(100% - 10px)"></div><div id="' +
                    className +
                    "Bol-" +
                    videoOid +
                    '" class="' +
                    className +
                    'Bol" style="background-image: url(' +
                    this._buttonImage +
                    ');"></div></div>'
            );
        }
        this._slider = $("#" + className + "-" + videoOid);
        this._bg = $("#" + className + "Bg-" + videoOid);
        this._buffered = $("#" + className + "Buffered-" + videoOid);
        this._fg = $("#" + className + "Fg-" + videoOid);
        this._objectOverlay = $("#" + className + "Overlay-" + videoOid);
        this._bol = $("#" + className + "Bol-" + videoOid);
        this._bol.css("backgroundImage", "url(" + this._buttonImage + ")");
        this._bol.css("position", "absolute");
        this._bol.css("width", "16px");
        this._bol.css("height", "16px");
        this._bol.css("backgroundSize", "100% 100%");
        this._bol.css("backgroundRepeat", "no-repeat");
        if (this._className == "pingVpTimeSlider") {
            this._bol.css("backgroundPosition", "-40px -40px");
        } else {
            this._bol.css("backgroundPosition", "0px 0px");
        }
        this._bol.css("marginTop", "0");
        this._bol.css("zIndex", "100");
        this._bol.css("display", "block");
        this._bol.css("margin-left", "-5px");
        if (className == "pingVpVolumeSlider") {
            this._bol.css("margin-top", "-7px");
        }
        $("#" + className + "-" + videoOid).mouseover($bind(this, this.onMouseOver));
        $("#" + className + "-" + videoOid).mouseout($bind(this, this.onMouseOut));
        if (this._className == "pingVpTimeSlider") {
            this._slider.mouseenter(function (e) {
                _gthis._bol.css("backgroundPosition", "0px 0px");
            });
            this._slider.mouseleave(function (e1) {
                _gthis._bol.css("backgroundPosition", "-40px -40px");
            });
        }
        this._slider.mousedown(function (e2) {
            _gthis._isDragging = true;
        });
        $("body").mousemove(function (e3) {
            if (_gthis._isDragging) {
                _gthis.onClick(e3);
            }
        });
        $("body").mouseup(function (e4) {
            if (_gthis._isDragging) {
                _gthis._isDragging = false;
                _gthis.onClick(e4);
            }
        });
        if (this._className == "pingVpTimeSlider") {
            $("body").keydown($bind(this, this.arrowKeys));
        } else {
            $("body").keydown($bind(this, this.arrowKeysSound));
        }
    };
    $hxClasses["pingvp.PingVpControlSliderSvg"] = pingvp_PingVpControlSliderSvg;
    pingvp_PingVpControlSliderSvg.__name__ = ["pingvp", "PingVpControlSliderSvg"];
    pingvp_PingVpControlSliderSvg.prototype = {
        setPercent: function (percent) {
            if (this._isDragging) {
                return;
            }
            this._percent = percent;
            var size = (this._percent * (this._width - this._start)) / 100 + this._start;
            this._fg.css("width", size + "px");
            var tempWidth = this._width - 6;
            var tempSize = (this._percent * (tempWidth - this._start)) / 100 + this._start;
            this._bol.css("marginLeft", tempSize - 5 + "px");
        },
        setBufferedPercent: function (percent) {
            this._bufferedPercent = percent;
            var size = (this._bufferedPercent * (this._width - this._start)) / 100 + this._start;
            this._buffered.css("width", size + "px");
        },
        onClick: function (e) {
            var posX = $("#" + this._className + "-" + this._videoOid).offset().left;
            posX += this._start;
            var pageX = 0;
            if (e.type == "touchstart") {
                var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
                pageX = touch.pageX;
            } else {
                pageX = e.pageX;
            }
            var posRelX = pageX - posX;
            if (posRelX < 0) {
                posRelX = 0;
            }
            this._percent = (posRelX * 100) / (this._width - this._start);
            if (this._percent > 100) {
                this._percent = 100;
            }
            var size = (this._percent * (this._width - this._start)) / 100 + this._start;
            this._fg.css("width", size + "px");
            var tempWidth = this._width - 6;
            var tempSize = (this._percent * (tempWidth - this._start)) / 100 + this._start;
            this._bol.css("marginLeft", tempSize - 5 + "px");
            if (!this._isDragging && this._call != null) {
                this._call();
            }
        },
        setClickHandler: function (call) {
            this._call = call;
        },
        setArrowHandler: function (call) {
            this._callArrow = call;
        },
        getPercentPrevious: function () {
            return this._percentPrevious;
        },
        getPercent: function () {
            return this._percent;
        },
        setWidth: function (width) {
            this._width = width;
            $("#" + this._className + "-" + this._videoOid).css("width", width + "px");
            var size = (this._bufferedPercent * (this._width - this._start)) / 100 + this._start;
            this._buffered.css("width", size + "px");
            size = (this._percent * (width - this._start)) / 100 + this._start;
            this._fg.css("width", size + "px");
            var tempWidth = width - 6;
            var tempSize = (this._percent * (tempWidth - this._start)) / 100 + this._start;
            this._bol.css("marginLeft", tempSize - 5 + "px");
        },
        onMouseOver: function (e) {},
        onMouseOut: function (e) {
            this._bg.css("backgroundImage", "url(" + this._backgroundImage + ")");
            this._buffered.css("backgroundImage", "url(" + this._bufferImage + ")");
            this._fg.css("backgroundImage", "url(" + this._foregroundImage + ")");
        },
        arrowKeys: function (e) {
            if (this._objectOverlay.is(":focus") && (e.which == 37 || e.which == 39)) {
                if (this._callArrow != null) {
                    this._callArrow(e.which);
                }
            }
        },
        arrowKeysSound: function (e) {
            if (this._objectOverlay.is(":focus") && (e.which == 37 || e.which == 39)) {
                e.preventDefault();
                if (this._callArrow != null) {
                    this._callArrow(e.which);
                }
            }
        },
        __class__: pingvp_PingVpControlSliderSvg,
    };
    var pingvp_PingVpControlTime = function (videoOid, textColor, debug, extraClass) {
        this._videoOid = videoOid;
        this._debug = debug;
        this._elapsed = 0;
        if (this._debug) {
            this._fps = new pingvp_FamesPerSecond();
        }
        $("#pingVpControlBar-" + videoOid + " .pingVpControlBarChildOther .pingVpControlLeftSide").append(
            '<div id="pingVpControlPos-' + videoOid + '" class="pingVpControlPos ' + extraClass + '" style="color: #' + textColor + ';">0:00 / 0:00</div>'
        );
        this._posJq = $("#pingVpControlPos-" + this._videoOid);
        this._posJq.css("fontSize", "12px");
    };
    $hxClasses["pingvp.PingVpControlTime"] = pingvp_PingVpControlTime;
    pingvp_PingVpControlTime.__name__ = ["pingvp", "PingVpControlTime"];
    pingvp_PingVpControlTime.prototype = {
        set: function (currentTime, duration) {
            if (this._debug) {
                this._elapsed += this._fps.tick();
            }
            if (this._elapsed < 1) {
                if (!isNaN(duration)) {
                    this._posJq.html(
                        Math.floor(currentTime / 60) + ":" + (currentTime % 60 < 10 ? "0" : "") + Math.floor(currentTime % 60) + " / " + Math.floor(duration / 60) + ":" + (duration % 60 < 10 ? "0" : "") + Math.floor(duration % 60)
                    );
                }
            } else {
                this._elapsed = 0;
            }
        },
        __class__: pingvp_PingVpControlTime,
    };
    var pingvp_PingVpControlToggleSvg = function (className, videoOid, selectIconOn, selectIconOff, defaultColor, hoverColor, theme, iconHoverChange, colorChange, positionBar, extraClass, extraSvgClass, controlsBelowVideo) {
        var _gthis = this;
        this._className = className;
        this._videoOid = videoOid;
        this._theme = theme;
        this._position = positionBar;
        this._controlsBelowVideo = controlsBelowVideo;
        this._overlay = $("#pingVpOverlay-" + this._videoOid);
        this._hasLabel = false;
        this._hasTempOnIcon = false;
        this._hasTempOffIcon = false;
        this._originalIconOn = selectIconOn;
        this._originalIconOff = selectIconOff;
        this._iconHoverChange = iconHoverChange;
        this._colorChange = colorChange;
        this._defaultColor = defaultColor;
        if (this._defaultColor == null || this._defaultColor == "") {
            this._defaultColor = theme.getByKey("defaultcolor");
        }
        this._hoverColor = hoverColor;
        if (this._hoverColor == null || this._hoverColor == "") {
            this._hoverColor = theme.getByKey("hovercolor");
        }
        this._isOn = true;
        this._combineIcons = "";
        this._selectIconOnNormal = theme.getIcon(theme.getByKey("svgset"), selectIconOn + ".svg", this._defaultColor);
        this._selectIconOnHover = theme.getIcon(theme.getByKey("svgset"), selectIconOn + ".svg", this._hoverColor);
        this._combineIcons += '<img class="pingVpResetSvg pingVpSvgOn ' + extraSvgClass + '" src="' + this._selectIconOnNormal + '"/>';
        this._combineIcons += '<img class="pingVpResetSvg pingVpSvgOnHover ' + extraSvgClass + ' pingVpHideIcon" src="' + this._selectIconOnHover + '"/>';
        if (selectIconOn != selectIconOff) {
            this._selectIconOffNormal = theme.getIcon(theme.getByKey("svgset"), selectIconOff + ".svg", this._defaultColor);
            this._selectIconOffHover = theme.getIcon(theme.getByKey("svgset"), selectIconOff + ".svg", this._hoverColor);
            this._combineIcons += '<img class="pingVpResetSvg pingVpSvgOff ' + extraSvgClass + ' pingVpHideIcon" src="' + this._selectIconOffNormal + '"/>';
            this._combineIcons += '<img class="pingVpResetSvg pingVpSvgOffHover ' + extraSvgClass + ' pingVpHideIcon" src="' + this._selectIconOffHover + '"/>';
        }
        this._positionBar = positionBar;
        if (positionBar == "left") {
            this._positionBar = "pingVpControlLeftSide";
        }
        if (positionBar == "center") {
            this._positionBar = "pingVpControlBarCenter";
        }
        if (positionBar == "right") {
            this._positionBar = "pingVpControlRightSide";
        }
        $("#" + this._positionBar + "-" + videoOid).append('<div tabindex="0" id="' + className + "-" + videoOid + '" class="pingVpControlToggleSvg ' + className + " " + extraClass + '">' + this._combineIcons + "</div>");
        this._iconElementOn = "img.pingVpSvgOn";
        this._iconElementOnHover = "img.pingVpSvgOnHover";
        this._iconElementOff = "img.pingVpSvgOn";
        this._iconElementOffHover = "img.pingVpSvgOnHover";
        if (selectIconOn != selectIconOff) {
            this._iconElementOff = "img.pingVpSvgOff";
            this._iconElementOffHover = "img.pingVpSvgOffHover";
        }
        if (className == "pingVpControlSubtitles") {
            $("#" + className + "-" + videoOid).append('<div id="pingVpSubsActiveStripe-' + videoOid + '" class="pingVpReset pingVpSubsActiveStripe"></div>');
            this._setStripe = $("#pingVpSubsActiveStripe-" + videoOid);
            if (this._controlsBelowVideo) {
                this._setStripe.css("background-color", "#" + this._defaultColor);
            } else {
                this._setStripe.css("background-color", "#fff");
            }
        }
        this._setButton = $("#" + className + "-" + videoOid);
        this._setButton.hover(
            function (e) {
                _gthis._setButton.find("img").addClass("pingVpHideIcon");
                if (_gthis._isOn) {
                    if (_gthis._iconHoverChange) {
                        _gthis._setButton.find(_gthis._iconElementOffHover).removeClass("pingVpHideIcon");
                    } else {
                        _gthis._setButton.find(_gthis._iconElementOnHover).removeClass("pingVpHideIcon");
                    }
                } else {
                    if (_gthis._iconHoverChange) {
                        if (_gthis._colorChange) {
                            _gthis._setButton.find(_gthis._iconElementOn).removeClass("pingVpHideIcon");
                        } else {
                            _gthis._setButton.find(_gthis._iconElementOnHover).removeClass("pingVpHideIcon");
                        }
                    } else {
                        if (_gthis._colorChange) {
                            _gthis._setButton.find(_gthis._iconElementOff).removeClass("pingVpHideIcon");
                        } else {
                            _gthis._setButton.find(_gthis._iconElementOffHover).removeClass("pingVpHideIcon");
                        }
                    }
                }
            },
            function (e1) {
                _gthis._setButton.find("img").addClass("pingVpHideIcon");
                if (_gthis._isOn) {
                    _gthis._setButton.find(_gthis._iconElementOn).removeClass("pingVpHideIcon");
                } else {
                    if (_gthis._colorChange) {
                        _gthis._setButton.find(_gthis._iconElementOffHover).removeClass("pingVpHideIcon");
                    } else {
                        _gthis._setButton.find(_gthis._iconElementOff).removeClass("pingVpHideIcon");
                    }
                }
            }
        );
        this._setButton.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onClick));
    };
    $hxClasses["pingvp.PingVpControlToggleSvg"] = pingvp_PingVpControlToggleSvg;
    pingvp_PingVpControlToggleSvg.__name__ = ["pingvp", "PingVpControlToggleSvg"];
    pingvp_PingVpControlToggleSvg.prototype = {
        onClick: function (e) {
            if (this._onCall != null && !this._isOn) {
                this._onCall();
            } else {
                if (this._offCall != null && this._isOn) {
                    this._offCall();
                }
            }
        },
        setOnHandler: function (call) {
            this._onCall = call;
        },
        setOffHandler: function (call) {
            this._offCall = call;
        },
        setHoverHandler: function (textOn, textOff, changeLabelStatus, labelOffset) {
            var _gthis = this;
            if (!pingvp_PingVpDevice.isTouchEventDevice()) {
                this._activeHover = true;
                this._hasLabel = true;
                this._labelOnText = textOn;
                this._labelOffText = textOff;
                this._labelOffset = labelOffset;
                this._changeLabelStatus = changeLabelStatus;
                this._overlay.append('<div id="' + this._className + "-label-" + this._videoOid + '" class="pingVpReset pingVpHoverLabel"></div>');
                this._setHoverLabel = $("#" + this._className + "-label-" + this._videoOid);
                var currLabelText = !this._isOn ? textOn : textOff;
                this._setHoverLabel.text(currLabelText);
                this._setHoverLabel.css("background-color", "#" + this._theme.getByKey("menubackcolor")).css("color", "#" + this._theme.getByKey("menucolor"));
                this._setHoverLabel.css("display", "none");
                this._setHoverLabel.css("position", "absolute");
                this._setHoverLabel.css("zIndex", "2147483647");
                this.resizeLabel(labelOffset);
                this._setButton.hover(
                    function (e) {
                        if (_gthis._activeHover) {
                            _gthis._setHoverLabel.css("display", "block");
                        }
                    },
                    function (e1) {
                        _gthis._setHoverLabel.css("display", "none");
                    }
                );
            }
        },
        setActiveHover: function (status) {
            this._activeHover = status;
            if (this._hasLabel) {
                if (status == false) {
                    this._setHoverLabel.css("display", "none");
                }
            }
        },
        resizeLabel: function (labelOffset) {
            if (this._hasLabel) {
                var definer = 960;
                var definerW = 640;
                var currentWidth = this._overlay.outerWidth();
                var percent = 100;
                var percentW = 0.25;
                if (currentWidth > definer) {
                    percent -= (definer - currentWidth) / 32;
                } else {
                    if (currentWidth < definer) {
                        percent += (currentWidth - definer) / 32;
                    }
                }
                this._setHoverLabel.css("font-size", percent + "%");
                var bottomPos = this._controlsBelowVideo ? 57 : 69;
                this._setHoverLabel.css("bottom", bottomPos + "px");
                var cssPosition = this._position == "left" ? "left" : "right";
                var labelWidth = this._setHoverLabel.outerWidth();
                var defaultMin = this._controlsBelowVideo ? 5 : 10;
                var paddingCorrection = this._controlsBelowVideo ? 5 : 0;
                var maxWidth = (labelOffset + paddingCorrection) * 2 + 40;
                if (labelWidth < maxWidth) {
                    var calcOffset = (maxWidth - labelWidth) / 2 + defaultMin;
                    this._setHoverLabel.css(cssPosition, calcOffset + "px");
                } else {
                    this._setHoverLabel.css(cssPosition, defaultMin + "px");
                }
            }
        },
        setOn: function () {
            this._isOn = true;
            if (this._hasTempOnIcon) {
                this.onlySetOnIcon(this._originalIconOn);
            }
            if (this._hasTempOffIcon) {
                this.onlySetOffIcon(this._originalIconOff);
            }
            this._setButton.find("img").addClass("pingVpHideIcon");
            this._setButton.find(this._iconElementOn).removeClass("pingVpHideIcon");
            if (this._hasLabel && this._changeLabelStatus) {
                this._setHoverLabel.text(this._labelOffText);
                this.resizeLabel(this._labelOffset);
            }
        },
        setRotateOn: function () {
            this._setButton.find("img").addClass("pingVpRotate30");
        },
        setOff: function () {
            this._isOn = false;
            if (this._hasTempOnIcon) {
                this.onlySetOnIcon(this._originalIconOn);
            }
            if (this._hasTempOffIcon) {
                this.onlySetOffIcon(this._originalIconOff);
            }
            this._setButton.find("img").addClass("pingVpHideIcon");
            if (this._colorChange) {
                this._setButton.find(this._iconElementOffHover).removeClass("pingVpHideIcon");
            } else {
                this._setButton.find(this._iconElementOff).removeClass("pingVpHideIcon");
            }
            if (this._hasLabel && this._changeLabelStatus) {
                this._setHoverLabel.text(this._labelOnText);
                this.resizeLabel(this._labelOffset);
            }
        },
        setRotateOff: function () {
            this._setButton.find("img").removeClass("pingVpRotate30");
        },
        onlySetOnIcon: function (selectIconOn) {
            this._selectIconOnNormal = this._theme.getIcon(this._theme.getByKey("svgset"), selectIconOn + ".svg", this._defaultColor);
            this._selectIconOnHover = this._theme.getIcon(this._theme.getByKey("svgset"), selectIconOn + ".svg", this._hoverColor);
            this._setButton.find("img.pingVpSvgOn").attr("src", this._selectIconOnNormal);
            this._setButton.find("img.pingVpSvgOnHover").attr("src", this._selectIconOnHover);
        },
        setOnIcon: function (selectIconOn) {
            this._selectIconOnNormal = this._theme.getIcon(this._theme.getByKey("svgset"), selectIconOn + ".svg", this._defaultColor);
            this._selectIconOnHover = this._theme.getIcon(this._theme.getByKey("svgset"), selectIconOn + ".svg", this._hoverColor);
            this._setButton.find("img.pingVpSvgOn").attr("src", this._selectIconOnNormal);
            this._setButton.find("img.pingVpSvgOnHover").attr("src", this._selectIconOnHover);
        },
        onlySetOffIcon: function (selectIconOff) {
            this._selectIconOffNormal = this._theme.getIcon(this._theme.getByKey("svgset"), selectIconOff + ".svg", this._defaultColor);
            this._selectIconOffHover = this._theme.getIcon(this._theme.getByKey("svgset"), selectIconOff + ".svg", this._hoverColor);
            this._setButton.find("img.pingVpSvgOff").attr("src", this._selectIconOffNormal);
            this._setButton.find("img.pingVpSvgOffHover").attr("src", this._selectIconOffHover);
        },
        setOffIcon: function (selectIconOff) {
            this._selectIconOffNormal = this._theme.getIcon(this._theme.getByKey("svgset"), selectIconOff + ".svg", this._defaultColor);
            this._selectIconOffHover = this._theme.getIcon(this._theme.getByKey("svgset"), selectIconOff + ".svg", this._hoverColor);
            this._setButton.find("img.pingVpSvgOff").attr("src", this._selectIconOffNormal);
            this._setButton.find("img.pingVpSvgOffHover").attr("src", this._selectIconOffHover);
        },
        setTempOffIcon: function (selectTempIcon) {
            this._hasTempOffIcon = true;
            this._selectIconOffNormal = this._theme.getIcon(this._theme.getByKey("svgset"), selectTempIcon + ".svg", this._defaultColor);
            this._selectIconOffHover = this._theme.getIcon(this._theme.getByKey("svgset"), selectTempIcon + ".svg", this._hoverColor);
            this._setButton.find("img.pingVpSvgOff").attr("src", this._selectIconOffNormal);
            this._setButton.find("img.pingVpSvgOffHover").attr("src", this._selectIconOffHover);
        },
        isOn: function () {
            return this._isOn;
        },
        __class__: pingvp_PingVpControlToggleSvg,
    };
    var pingvp_PingVpCssAnimation = function (block, id, path, duration) {
        this._block = block;
        this._id = id;
        this._path = path;
        this._duration = duration;
        this._elapsedTime = 0;
        var style = document.createElement("style");
        style.innerHTML = "@-webkit-keyframes " + id + " { }";
        document.head.appendChild(style);
        block.on("animationiteration webkitAnimationIteration mozAnimationIteration MSAnimationIteration oAnimationIteration", null, $bind(this, this.aminationEvent));
    };
    $hxClasses["pingvp.PingVpCssAnimation"] = pingvp_PingVpCssAnimation;
    pingvp_PingVpCssAnimation.__name__ = ["pingvp", "PingVpCssAnimation"];
    pingvp_PingVpCssAnimation.prototype = {
        update: function (start, videoWidth, videoHeight, scriptWidth, scriptHeight, containerWidth, containerHeight, width, height, marginBottom) {
            var _gthis = this;
            var newArray = this.convertArrayHelper(this._path, start, videoWidth, videoHeight, scriptWidth, scriptHeight, containerWidth, containerHeight, width, height, marginBottom);
            var keyframes = this.findKeyframesRuleHelper(this._id);
            var i = 0;
            while (i < newArray.length) {
                var sec = newArray[i];
                var x = newArray[i + 1];
                var y = newArray[i + 2];
                var percent = (sec * 100) / this._duration;
                if (keyframes.findRule(percent + "%") != null) {
                    keyframes.deleteRule(percent + "%");
                }
                keyframes.insertRule(percent + "% {left: " + x + "%; top: " + y + "%;} ");
                i += 3;
            }
            this._elapsedTime = 0;
            this._block.css("-webkit-animation-duration", this._duration + "s");
            this._block.css("-webkit-animation-timing-function", "linear");
            this._block.css("-webkit-animation-name", "none");
            haxe_Timer.delay(function () {
                _gthis._block.css("-webkit-animation-name", _gthis._id);
            }, 2);
        },
        convertArrayHelper: function (path, start, videoWidth, videoHeight, scriptWidth, scriptHeight, containerWidth, containerHeight, width, height, marginBottom) {
            var ret = [];
            var scaleX = containerWidth / videoWidth;
            var scaleY = (containerHeight - marginBottom) / videoHeight;
            var centerX = containerWidth / 2;
            var centerY = (containerHeight - marginBottom) / 2;
            var scale = scaleX;
            if (scaleY < scaleX) {
                scale = scaleY;
            }
            var startX = centerX - (videoWidth * scale) / 2;
            var startY = centerY - (videoHeight * scale) / 2;
            var i = 0;
            while (i < path.length) {
                var sec = path[i];
                var x = path[i + 1];
                var y = path[i + 2];
                if (sec < start) {
                    continue;
                }
                var blockX = (x * videoWidth) / scriptWidth;
                var blockY = (y * videoHeight) / scriptHeight;
                var leftPercent = ((startX + scale * blockX) * 100) / containerWidth;
                var topPercent = ((startY + scale * blockY) * 100) / containerHeight;
                ret.push(sec);
                ret.push(leftPercent);
                ret.push(topPercent);
                i += 3;
            }
            return ret;
        },
        findKeyframesRuleHelper: function (rule) {
            var ss = document.styleSheets;
            for (var i = 0; i < ss.length; ++i) {
                for (var j = 0; j < ss[i].cssRules.length; ++j) {
                    if (ss[i].cssRules[j].type == window.CSSRule.WEBKIT_KEYFRAMES_RULE && ss[i].cssRules[j].name == rule) {
                        return ss[i].cssRules[j];
                    }
                }
            }
            return null;
        },
        aminationEvent: function (e) {
            this._elapsedTime = e.originalEvent.elapsedTime;
        },
        getElapsedTime: function () {
            return this._elapsedTime;
        },
        __class__: pingvp_PingVpCssAnimation,
    };
    var pingvp_PingVpCssFadeIn = function (block, sec) {
        this._block = block;
        this._sec = sec;
        this._once = true;
        this._block.css("opacity", "0");
    };
    $hxClasses["pingvp.PingVpCssFadeIn"] = pingvp_PingVpCssFadeIn;
    pingvp_PingVpCssFadeIn.__name__ = ["pingvp", "PingVpCssFadeIn"];
    pingvp_PingVpCssFadeIn.prototype = {
        fade: function () {
            if (!this._once) {
                return;
            }
            this._once = false;
            this._block.css("opacity", "1");
            this._block.css("-webkit-animation", "pingvpfadein " + this._sec + "s");
            this._block.css("-moz-animation", "pingvpfadein " + this._sec + "s");
            this._block.css("-ms-animation", "pingvpfadein " + this._sec + "s");
            this._block.css("-o-animation", "pingvpfadein " + this._sec + "s");
            this._block.css("animation", "pingvpfadein " + this._sec + "s");
        },
        reset: function () {
            if (this._once) {
                return;
            }
            this._once = true;
            this._block.css("-webkit-animation", "none");
            this._block.css("-moz-animation", "none");
            this._block.css("-ms-animation", "none");
            this._block.css("-o-animation", "none");
            this._block.css("animation", "none");
        },
        __class__: pingvp_PingVpCssFadeIn,
    };
    var pingvp_PingVpCssFadeOut = function (block, sec) {
        this._block = block;
        this._sec = sec;
        this._once = true;
    };
    $hxClasses["pingvp.PingVpCssFadeOut"] = pingvp_PingVpCssFadeOut;
    pingvp_PingVpCssFadeOut.__name__ = ["pingvp", "PingVpCssFadeOut"];
    pingvp_PingVpCssFadeOut.prototype = {
        fade: function (time, end) {
            if (time < end - this._sec) {
                return;
            }
            if (!this._once) {
                return;
            }
            this._once = false;
            this._block.css("opacity", "0");
            this._block.css("-webkit-animation", "pingvpfadeout " + this._sec + "s");
            this._block.css("-moz-animation", "pingvpfadeout " + this._sec + "s");
            this._block.css("-ms-animation", "pingvpfadeout " + this._sec + "s");
            this._block.css("-o-animation", "pingvpfadeout " + this._sec + "s");
            this._block.css("animation", "pingvpfadeout " + this._sec + "s");
        },
        reset: function () {
            if (this._once) {
                return;
            }
            this._once = true;
            this._block.css("-webkit-animation", "none");
            this._block.css("-moz-animation", "none");
            this._block.css("-ms-animation", "none");
            this._block.css("-o-animation", "none");
            this._block.css("animation", "none");
        },
        __class__: pingvp_PingVpCssFadeOut,
    };
    var pingvp_PingVpDebug = function (traceEnable) {
        this._traceEnable = traceEnable;
    };
    $hxClasses["pingvp.PingVpDebug"] = pingvp_PingVpDebug;
    pingvp_PingVpDebug.__name__ = ["pingvp", "PingVpDebug"];
    pingvp_PingVpDebug.prototype = {
        log: function (message) {
            if (!this._traceEnable) {
                return;
            }
            console.log(message);
        },
        isOn: function () {
            return this._traceEnable;
        },
        __class__: pingvp_PingVpDebug,
    };
    var pingvp_PingVpDevice = function () {};
    $hxClasses["pingvp.PingVpDevice"] = pingvp_PingVpDevice;
    pingvp_PingVpDevice.__name__ = ["pingvp", "PingVpDevice"];
    pingvp_PingVpDevice.isIpad = function () {
        return navigator.userAgent.indexOf("iPad") != -1;
    };
    pingvp_PingVpDevice.isIphone = function () {
        return navigator.userAgent.indexOf("iPhone") != -1;
    };
    pingvp_PingVpDevice.isIpod = function () {
        return navigator.userAgent.indexOf("iPod") != -1;
    };
    pingvp_PingVpDevice.isAndroid = function () {
        return navigator.userAgent.indexOf("Android") != -1;
    };
    pingvp_PingVpDevice.isBlackBerry = function () {
        return navigator.userAgent.indexOf("BlackBerry") != -1;
    };
    pingvp_PingVpDevice.isWindowsPhone = function () {
        return navigator.userAgent.indexOf("Windows Phone") != -1;
    };
    pingvp_PingVpDevice.isSymbian = function () {
        return navigator.userAgent.indexOf("Symbian") != -1;
    };
    pingvp_PingVpDevice.isMSIE = function () {
        var msie = navigator.userAgent.indexOf("MSIE ") != -1;
        var trident = navigator.userAgent.indexOf("Trident/") != -1;
        var edge = navigator.userAgent.indexOf("Edge/") != -1;
        if (!(msie || trident)) {
            return edge;
        } else {
            return true;
        }
    };
    pingvp_PingVpDevice.isTouchEventDevice = function () {
        return false;
    };
    pingvp_PingVpDevice.isAllTouchDevices = function () {
        if (!(pingvp_PingVpDevice.isAndroid() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isIphone())) {
            return pingvp_PingVpDevice.isIpod();
        } else {
            return true;
        }
    };
    pingvp_PingVpDevice.isAllMobileDevices = function () {
        if (!(pingvp_PingVpDevice.isAndroid() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isIphone())) {
            return pingvp_PingVpDevice.isIpod();
        } else {
            return true;
        }
    };
    pingvp_PingVpDevice.isSafariDevice = function () {
        return navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Chrome") == -1;
    };
    pingvp_PingVpDevice.isChromeBrowser = function () {
        return navigator.userAgent.search("Chrome") >= 0;
    };
    pingvp_PingVpDevice.isAndroidNativeBrowser = function () {
        var navU = navigator.userAgent;
        var isAndroidMobile = navU.indexOf("Android") > -1 && navU.indexOf("Mozilla/5.0") > -1 && navU.indexOf("AppleWebKit") > -1;
        var regExAppleWebKit = new RegExp(/AppleWebKit\/([\d.]+)/);
        var resultAppleWebKitRegEx = regExAppleWebKit.exec(navU);
        var appleWebKitVersion = resultAppleWebKitRegEx === null ? null : parseFloat(regExAppleWebKit.exec(navU)[1]);
        var regExChrome = new RegExp(/Chrome\/([\d.]+)/);
        var resultChromeRegEx = regExChrome.exec(navU);
        var chromeVersion = resultChromeRegEx === null ? null : parseFloat(regExChrome.exec(navU)[1]);
        return (isAndroidMobile && appleWebKitVersion !== null && appleWebKitVersion < 537) || (chromeVersion !== null && chromeVersion < 37);
    };
    pingvp_PingVpDevice.isLandscape = function () {
        return window.innerWidth > window.innerHeight;
    };
    var pingvp_PingVpEach = function () {
        this.pingVpFunctions = new pingvp_PingVpExternFunctions();
        window.pingVpFunctions = this.pingVpFunctions;
        window.pingvp.loaded = false;
        this._selectors = [];
        $($bind(this, this.onPageLoaded));
    };
    $hxClasses["pingvp.PingVpEach"] = pingvp_PingVpEach;
    pingvp_PingVpEach.__name__ = ["pingvp", "PingVpEach"];
    pingvp_PingVpEach.prototype = {
        onPageLoaded: function () {
            $("div.PingVP").each($bind(this, this.onNodeFound));
            window.pingvp.loaded = true;
            if (typeof pingvpCallback == "function") {
                pingvpCallback();
            }
        },
        onNodeFound: function (i, node) {
            var jqNode = $(node);
            if (jqNode.find(".pingVpOverlayPlayContainer").length != 0) {
                return;
            }
            var dataVideo = jqNode.data("video");
            if (dataVideo == null) {
                dataVideo = "";
            }
            var dataHash = jqNode.data("hash");
            if (dataHash == null) {
                dataHash = "";
            }
            var dataDebug = false;
            if (jqNode.data("debug") != null) {
                dataDebug = jqNode.data("debug");
            }
            var dataLanguage = jqNode.data("language");
            if (dataLanguage == null) {
                dataLanguage = "English";
            }
            var startFragment = jqNode.data("startfragment");
            if (startFragment == null) {
                startFragment = "";
            }
            var dataSelect = jqNode.data("select");
            if (dataSelect == null) {
                dataSelect = "Flash";
            }
            var dataControlsBelow = false;
            if (jqNode.data("controls") != null) {
                dataControlsBelow = jqNode.data("controls") == "below";
            }
            var dataControlsDisabled = false;
            if (jqNode.data("controls") != null) {
                dataControlsDisabled = jqNode.data("controls") == "disable";
            }
            var dataIsFramed = false;
            if (jqNode.data("isframed") != null) {
                dataIsFramed = jqNode.data("isframed");
            }
            var dataAutoStart = false;
            if (jqNode.data("autostart") != null) {
                dataAutoStart = jqNode.data("autostart");
            }
            var dataAutoHeight = true;
            if (jqNode.data("autoheight") != null) {
                dataAutoHeight = jqNode.data("autoheight");
            }
            var dataOverlayPlay = false;
            if (jqNode.data("overlayplay") != null) {
                dataOverlayPlay = jqNode.data("overlayplay");
            }
            var dataInlinePlay = false;
            if (jqNode.data("inlineplay") != null) {
                dataInlinePlay = jqNode.data("inlineplay");
            }
            this._selectors.push(
                new pingvp_PingVpLoader(
                    pingvp_PingVpEach._oid++,
                    jqNode,
                    dataVideo,
                    dataHash,
                    dataDebug,
                    dataLanguage,
                    startFragment,
                    dataSelect,
                    dataControlsBelow,
                    dataControlsDisabled,
                    dataIsFramed,
                    dataAutoStart,
                    dataAutoHeight,
                    dataOverlayPlay,
                    dataInlinePlay,
                    this.pingVpFunctions
                )
            );
        },
        __class__: pingvp_PingVpEach,
    };
    var pingvp_PingVpEventItem = function (fragmentUuid, fragmentTitle, action, percent, lastFragmentUuid) {
        this._deleteMe = false;
        this._age = 0;
        this._readyToSend = true;
        this._fragmentUuid = fragmentUuid;
        this._fragmentTitle = fragmentTitle;
        this._action = action;
        this._percent = percent;
        this._lastFragmentUuid = lastFragmentUuid;
    };
    $hxClasses["pingvp.PingVpEventItem"] = pingvp_PingVpEventItem;
    pingvp_PingVpEventItem.__name__ = ["pingvp", "PingVpEventItem"];
    pingvp_PingVpEventItem.prototype = {
        getAge: function () {
            return this._age;
        },
        agePlusOne: function () {
            this._age++;
        },
        getFragmentUuid: function () {
            return this._fragmentUuid;
        },
        getFragmentTitle: function () {
            return this._fragmentTitle;
        },
        getAction: function () {
            return this._action;
        },
        getPercent: function () {
            return this._percent;
        },
        getLastFragmentUuid: function () {
            return this._lastFragmentUuid;
        },
        readyToSend: function () {
            return this._readyToSend;
        },
        deleteMe: function () {
            return this._deleteMe;
        },
        sending: function () {
            this._readyToSend = false;
            this._age++;
        },
        sendFailure: function () {
            this._readyToSend = true;
        },
        sendSuccess: function () {
            this._deleteMe = true;
        },
        __class__: pingvp_PingVpEventItem,
    };
    var pingvp_PingVpEventQueue = function (debug) {
        this._debug = debug;
        this._queue = [];
    };
    $hxClasses["pingvp.PingVpEventQueue"] = pingvp_PingVpEventQueue;
    pingvp_PingVpEventQueue.__name__ = ["pingvp", "PingVpEventQueue"];
    pingvp_PingVpEventQueue.getUniqueValues = function (array) {
        var l = [];
        var _g = 0;
        while (_g < array.length) {
            var v = array[_g];
            ++_g;
            if (l.indexOf(v) == -1) {
                l.push(v);
            }
        }
        return l;
    };
    pingvp_PingVpEventQueue.prototype = {
        add: function (fragmentUuid, fragmentTitle, action, percent, lastFragmentUuid) {
            var _gthis = this;
            this._currentItem = new pingvp_PingVpEventItem(fragmentUuid, fragmentTitle, action, percent, lastFragmentUuid);
            var array = pingvp_PingVpEventQueue.getUniqueValues(this._queue);
            var array1 = array.filter(function (v) {
                if (!(v.getAction() != _gthis._currentItem.getAction() || v.getPercent() != _gthis._currentItem.getPercent() || v.getFragmentUuid() != _gthis._currentItem.getFragmentUuid())) {
                    return v.readyToSend() != _gthis._currentItem.readyToSend();
                } else {
                    return true;
                }
            });
            this._queue = array1;
            this._queue.push(this._currentItem);
        },
        prepareSendList: function () {
            var sendList = [];
            var _g = 0;
            var _g1 = this._queue;
            while (_g < _g1.length) {
                var o = _g1[_g];
                ++_g;
                if (o.readyToSend() && o.getAge() < 3) {
                    sendList.push(o);
                    break;
                }
            }
            return sendList;
        },
        cleanOne: function () {
            var _g = 0;
            var _g1 = this._queue;
            while (_g < _g1.length) {
                var o = _g1[_g];
                ++_g;
                if (o.deleteMe() || o.getAge() >= 3) {
                    HxOverrides.remove(this._queue, o);
                    return true;
                }
            }
            return false;
        },
        clean: function () {
            while (this.cleanOne()) {
                continue;
            }
        },
        print: function () {
            var out = "Queue: ";
            var _g = 0;
            var _g1 = this._queue;
            while (_g < _g1.length) {
                var o = _g1[_g];
                ++_g;
                out = out + o.getAction() + "; ";
            }
        },
        full: function () {
            return this._queue.length > 50;
        },
        __class__: pingvp_PingVpEventQueue,
    };
    var pingvp_PingVpEventSender = function (playerOid, debug, logUrl, success, failure, productionUuid, productionTitle, scriptName, text) {
        this._playerOid = playerOid;
        this._debug = debug;
        this._logUrl = logUrl;
        this._productionUuid = productionUuid;
        this._productionTitle = productionTitle;
        this._scriptName = scriptName;
        this._success = success;
        this._failure = failure;
        this._text = text;
        this._displayHtmlTable = false;
        if (this._debug.isOn()) {
            var warningText = this._logUrl == "" ? " <small>(" + this._text.get("statsWarningText") + ")" : "";
            this._statsTable = $('.pingVpStatsTable[data-video="' + this._scriptName + '"]');
            if (this._statsTable.length > 0) {
                this._displayHtmlTable = true;
                this._statsTable.append(
                    '<h2 class="pingVpReset pingVpHeaderTable">' +
                        this._text.get("statsTableHeaderSucces") +
                        warningText +
                        '</h2><table class="pingVpReset pingVpStatsSuccesTable pingVpTable"><thead class="pingVpReset"><tr class="pingVpReset"><th class="pingVpReset">' +
                        this._text.get("statsTableTh1") +
                        '</th><th class="pingVpReset">' +
                        this._text.get("statsTableTh2") +
                        '</th><th class="pingVpReset">' +
                        this._text.get("statsTableTh3") +
                        '</th></tr></thead><tbody class="pingVpReset"></tbody></table>'
                );
                this._statsTable.append(
                    '<h2 class="pingVpReset pingVpHeaderTable">' +
                        this._text.get("statsTableHeaderError") +
                        '</h2><table class="pingVpReset pingVpStatsFailedTable pingVpTable"><thead class="pingVpReset"><tr class="pingVpReset"><th class="pingVpReset">' +
                        this._text.get("statsTableTh1") +
                        '</th><th class="pingVpReset">' +
                        this._text.get("statsTableTh2") +
                        '</th><th class="pingVpReset">' +
                        this._text.get("statsTableTh3") +
                        '</th></tr></thead><tbody class="pingVpReset"></tbody></table>'
                );
                this._statsTableSuccesBody = $('.pingVpStatsTable[data-video="' + this._scriptName + '"] .pingVpStatsSuccesTable tbody');
                this._statsTableFailedBody = $('.pingVpStatsTable[data-video="' + this._scriptName + '"] .pingVpStatsFailedTable tbody');
            }
        }
    };
    $hxClasses["pingvp.PingVpEventSender"] = pingvp_PingVpEventSender;
    pingvp_PingVpEventSender.__name__ = ["pingvp", "PingVpEventSender"];
    pingvp_PingVpEventSender.prototype = {
        update: function (productionUuid, productionTitle, scriptName) {
            this._productionUuid = productionUuid;
            this._productionTitle = productionTitle;
            this._scriptName = scriptName;
        },
        sendList: function (actionList) {
            if (actionList.length <= 0) {
                return false;
            }
            actionList[0].sending();
            var vars = "";
            var s = this._productionTitle;
            vars = vars + "1=" + encodeURIComponent(s);
            var s1 = this._productionUuid;
            vars = vars + "&2=" + encodeURIComponent(s1);
            var s2 = window.screen.width;
            vars = vars + "&3=" + encodeURIComponent(s2);
            var s3 = window.screen.height;
            vars = vars + "&4=" + encodeURIComponent(s3);
            var s4 = actionList[0].getFragmentTitle();
            vars = vars + "&5=" + encodeURIComponent(s4);
            var s5 = actionList[0].getFragmentUuid();
            vars = vars + "&6=" + encodeURIComponent(s5);
            var s6 = actionList[0].getAction();
            vars = vars + "&7=" + encodeURIComponent(s6);
            var s7 = Std.string(actionList[0].getPercent());
            var i = s7.indexOf(".");
            var s8 = HxOverrides.substr(s7, 0, i + 3);
            vars = vars + "&8=" + encodeURIComponent(s8);
            var s9 = actionList[0].getLastFragmentUuid();
            vars = vars + "&11=" + encodeURIComponent(s9);
            vars = vars + "&12=" + this.getEmbedUrl();
            if (this._logUrl != "") {
                var f = $bind(this, this.onRetrieveResult);
                var a1 = actionList;
                var tmp = function (a2) {
                    f(a1, a2);
                };
                var f1 = $bind(this, this.onFailure);
                var a11 = actionList;
                var tmp1 = function () {
                    f1(a11);
                };
                $.ajax({ type: "GET", url: this._logUrl + "?" + vars, async: true, contentType: "application/json", dataType: "jsonp", success: tmp, error: tmp1 });
            } else {
                this.onSuccess(actionList);
            }
            return true;
        },
        getEmbedUrl: function () {
            var url = window.location.href;
            return this.stripUrlParams(url);
        },
        stripUrlParams: function (url) {
            var arr = url.split("?");
            return arr[0];
        },
        onRetrieveResult: function (actionList, data) {
            if (Reflect.field(data, "result") != "success") {
                this.onFailure(actionList);
            } else {
                this.onSuccess(actionList);
            }
        },
        onSuccess: function (actionList) {
            var _g = 0;
            while (_g < actionList.length) {
                var o = actionList[_g];
                ++_g;
                o.sendSuccess();
                if (this._displayHtmlTable) {
                    if (o.getFragmentTitle() != "") {
                        var tmp = this._statsTableSuccesBody;
                        var tmp1 = 'tr[data-fragment="' + StringTools.htmlEscape(o.getFragmentTitle()) + '"][data-uuid="' + o.getFragmentUuid() + '"][data-action="';
                        var s = o.getAction();
                        this._statsTableCheck = tmp.find(tmp1 + encodeURIComponent(s) + '"]');
                        if (this._statsTableCheck.length > 0) {
                            var currentCount = Std.parseInt(this._statsTableCheck.find("td.pingVpTableCountingTd").text());
                            this._statsTableCheck.find("td.pingVpTableCountingTd").text(currentCount + 1);
                        } else {
                            var tmp2 = this._statsTableSuccesBody;
                            var tmp3 = '<tr class="pingVpReset" data-fragment="' + StringTools.htmlEscape(o.getFragmentTitle()) + '" data-uuid="' + o.getFragmentUuid() + '" data-action="';
                            var s1 = o.getAction();
                            tmp2.append(
                                tmp3 +
                                    encodeURIComponent(s1) +
                                    '"><td class="pingVpReset">' +
                                    StringTools.htmlEscape(o.getFragmentTitle()) +
                                    '</td><td class="pingVpReset">' +
                                    o.getAction() +
                                    '</td><td class="pingVpTableCountingTd pingVpReset">1</td></tr>'
                            );
                        }
                    }
                }
            }
            this._success();
        },
        onFailure: function (actionList) {
            var _g = 0;
            while (_g < actionList.length) {
                var o = actionList[_g];
                ++_g;
                o.sendFailure();
                if (this._displayHtmlTable) {
                    if (o.getFragmentTitle() != "") {
                        var tmp = this._statsTableFailedBody;
                        var tmp1 = 'tr[data-fragment="' + StringTools.htmlEscape(o.getFragmentTitle()) + '"][data-uuid="' + o.getFragmentUuid() + '"][data-action="';
                        var s = o.getAction();
                        this._statsTableCheck = tmp.find(tmp1 + encodeURIComponent(s) + '"]');
                        if (this._statsTableCheck.length > 0) {
                            var currentCount = Std.parseInt(this._statsTableCheck.find("td.pingVpTableCountingTd").text());
                            this._statsTableCheck.find("td.pingVpTableCountingTd").text(currentCount + 1);
                        } else {
                            var tmp2 = this._statsTableFailedBody;
                            var tmp3 = '<tr class="pingVpReset" data-fragment="' + StringTools.htmlEscape(o.getFragmentTitle()) + '" data-uuid="' + o.getFragmentUuid() + '" data-action="';
                            var s1 = o.getAction();
                            tmp2.append(
                                tmp3 +
                                    encodeURIComponent(s1) +
                                    '"><td class="pingVpReset">' +
                                    StringTools.htmlEscape(o.getFragmentTitle()) +
                                    '</td><td class="pingVpReset">' +
                                    o.getAction() +
                                    '</td><td class="pingVpTableCountingTd pingVpReset">1</td><tr>'
                            );
                        }
                    }
                }
            }
            this._failure();
        },
        __class__: pingvp_PingVpEventSender,
    };
    var pingvp_PingVpEvents = function (playerOid, debug, logUrl, productionUuid, productionTitle, scriptName, text) {
        this._debug = debug;
        this._failedTimes = 0;
        this._sender = new pingvp_PingVpEventSender(playerOid, this._debug, logUrl, $bind(this, this.onSuccess), $bind(this, this.onFailure), productionUuid, productionTitle, scriptName, text);
        this._wssender = new pingvp_PingVpWebSocketSender(playerOid);
        this._queue = new pingvp_PingVpEventQueue(this._debug);
        this._interval = new haxe_Timer(200);
        this._interval.run = $bind(this, this.queueInterval);
    };
    $hxClasses["pingvp.PingVpEvents"] = pingvp_PingVpEvents;
    pingvp_PingVpEvents.__name__ = ["pingvp", "PingVpEvents"];
    pingvp_PingVpEvents.prototype = {
        update: function (productionUuid, productionTitle, scriptName) {
            this._sender.update(productionUuid, productionTitle, scriptName);
        },
        pushAction: function (fragmentUuid, fragmentTitle, action, percent, lastFragmentUuid) {
            if (this._queue.full()) {
                this._debug.log("Error: Event queue is full!!! - event skipped: " + action);
                return false;
            }
            if (this._failedTimes > 20) {
                this._debug.log("Error: Too many event queue send failures (>20), queue stoped!!!");
                this._interval.stop();
                return false;
            }
            this._queue.add(fragmentUuid, fragmentTitle, action, percent, lastFragmentUuid);
            return true;
        },
        sendQueueNow: function () {
            this.queueInterval();
        },
        queueInterval: function () {
            var sendList = this._queue.prepareSendList();
            if (sendList.length > 0) {
                this._sender.sendList(sendList);
            }
            this._queue.clean();
            this._queue.print();
        },
        onSuccess: function () {
            this._failedTimes = 0;
        },
        onFailure: function () {
            this._failedTimes++;
        },
        stopQueue: function () {
            haxe_Timer.delay($bind(this, this.stopQueueDelay), 5000);
        },
        stopQueueDelay: function () {
            this._interval.stop();
        },
        pushActionWs: function (productionUuid, productionTitle, fragmentUuid, fragmentTitle, action, percent) {
            this._wssender.update(productionUuid, productionTitle, fragmentUuid, fragmentTitle, percent | 0, action);
        },
        __class__: pingvp_PingVpEvents,
    };
    var pingvp_PingVpExternFunctions = function () {
        this._callResize = [];
    };
    $hxClasses["pingvp.PingVpExternFunctions"] = pingvp_PingVpExternFunctions;
    pingvp_PingVpExternFunctions.__name__ = ["pingvp", "PingVpExternFunctions"];
    pingvp_PingVpExternFunctions.prototype = {
        setResize: function (call) {
            this._callResize.push(call);
        },
        resize: function () {
            if (this._callResize.length > 0) {
                var _g = 0;
                var _g1 = this._callResize;
                while (_g < _g1.length) {
                    var call = _g1[_g];
                    ++_g;
                    call(null);
                }
            }
        },
        __class__: pingvp_PingVpExternFunctions,
    };
    var pingvp_PingVpFailure = function (node, message) {
        node.html('<div class="pingVpFailure"><div>' + message + "</div></div>");
    };
    $hxClasses["pingvp.PingVpFailure"] = pingvp_PingVpFailure;
    pingvp_PingVpFailure.__name__ = ["pingvp", "PingVpFailure"];
    pingvp_PingVpFailure.prototype = { __class__: pingvp_PingVpFailure };
    var pingvp_PingVpFallBackImage = function (videoOid, node, fallBackImageUrl, videoWidth, videoHeight) {
        this._videoOid = videoOid;
        this._node = node;
        this._videoWidth = videoWidth;
        this._videoHeight = videoHeight;
        var videoContainer = $("#pingVpVideoContainer-" + videoOid);
        videoContainer.html('<img id="pingVpFallBackImage-' + videoOid + '" class="pingVpFallBackImage" src="' + fallBackImageUrl + '" alt="">');
        this._fallBackImage = $("#pingVpFallBackImage-" + videoOid);
        this._node.css("background-color", "transparent");
        videoContainer.css("background-color", "transparent");
        this._fallBackImage.css("background-color", "transparent");
        this.onRezise(null);
        $(window).resize($bind(this, this.onRezise));
        var f = $bind(this, this.onRezise);
        haxe_Timer.delay(function () {
            f(null);
        }, 200);
    };
    $hxClasses["pingvp.PingVpFallBackImage"] = pingvp_PingVpFallBackImage;
    pingvp_PingVpFallBackImage.__name__ = ["pingvp", "PingVpFallBackImage"];
    pingvp_PingVpFallBackImage.prototype = {
        onRezise: function (e) {
            var containerWidth = this._node.width();
            var containerHeight = this._node.height();
            var containerCenterX = containerWidth / 2;
            var containerCenterY = containerHeight / 2;
            var videoHalfWidth = this._videoWidth / 2;
            var videoHalfHeigth = this._videoHeight / 2;
            var scaleX = containerWidth / this._videoWidth;
            var scaleY = containerHeight / this._videoHeight;
            var scale = scaleX;
            if (scaleX > scaleY) {
                scale = scaleY;
            }
            this._fallBackImage.css("left", containerCenterX - videoHalfWidth * scale + "px");
            this._fallBackImage.css("top", containerCenterY - videoHalfHeigth * scale + "px");
            this._fallBackImage.css("width", this._videoWidth * scale + "px");
            this._fallBackImage.css("height", this._videoHeight * scale + "px");
        },
        __class__: pingvp_PingVpFallBackImage,
    };
    var pingvp_PingVpFocus = function (videoOid, node) {
        this._node = node;
        this._videoOid = videoOid;
        this._pingVpElement = $(".pingVpWebplayerSelector,#pingVpOverlayPlayContainer-" + this._videoOid + ",.PingVP");
        $("body").mousedown($bind(this, this.removeTab));
        $("body").click($bind(this, this.removeTab2));
        $("body").keydown($bind(this, this.triggerTab));
        $("body").keydown($bind(this, this.triggerClick));
        $("body").on("click keydown keyup mousemove contextmenu", null, $bind(this, this.checkElement));
        if (pingvp_PingVpDevice.isChromeBrowser()) {
            this._pingVpElement.addClass("pingVpBrowserChrome");
        }
    };
    $hxClasses["pingvp.PingVpFocus"] = pingvp_PingVpFocus;
    pingvp_PingVpFocus.__name__ = ["pingvp", "PingVpFocus"];
    pingvp_PingVpFocus.prototype = {
        triggerTab: function (e) {
            if (e.which == 9) {
                this._pingVpElement.addClass("pingVpIsTabbing");
            }
        },
        checkElement: function (e) {
            this._focus = $(":focus");
            if (this._focus.hasClass("pingVpSvgObjectOverlayTimeSlider")) {
                $("#pingVpTimeSlider-" + this._videoOid).addClass("pingVpControlSliderHasFocus");
            } else {
                $("#pingVpTimeSlider-" + this._videoOid).removeClass("pingVpControlSliderHasFocus");
            }
        },
        removeTab: function (e) {
            if (this._pingVpElement.hasClass("pingVpTriggerClick")) {
                this._pingVpElement.removeClass("pingVpTriggerClick");
            } else {
                this._pingVpElement.removeClass("pingVpIsTabbing");
            }
        },
        removeTab2: function (e) {
            if (this._pingVpElement.hasClass("pingVpTriggerClick")) {
                this._pingVpElement.removeClass("pingVpTriggerClick");
            } else {
                this._pingVpElement.removeClass("pingVpIsTabbing");
            }
            $("#pingVpTimeSlider-" + this._videoOid).removeClass("pingVpControlSliderHasFocus");
        },
        triggerClick: function (e) {
            if (e.which == 13) {
                this._focus = $(":focus");
                if (this._focus.parents(".PingVP").length != 0 || this._focus.parents("#pingVpOverlayPlayContainer-" + this._videoOid).length != 0 || this._focus.parents(".pingVpWebplayerSelector").length != 0) {
                    this._pingVpElement.addClass("pingVpTriggerClick");
                    if (!this._focus.hasClass("pingVpSvgSlider")) {
                        this._focus.trigger("click");
                    }
                }
            }
        },
        __class__: pingvp_PingVpFocus,
    };
    var pingvp_PingVpFollowPath = function (startX, startY, path) {
        this._path = path;
        this._startX = startX;
        this._startY = startY;
        this._x = startX;
        this._y = startY;
    };
    $hxClasses["pingvp.PingVpFollowPath"] = pingvp_PingVpFollowPath;
    pingvp_PingVpFollowPath.__name__ = ["pingvp", "PingVpFollowPath"];
    pingvp_PingVpFollowPath.prototype = {
        update: function (seconds) {
            var beginX = this._startX;
            var beginY = this._startY;
            var endX = 0;
            var endY = 0;
            var beginLastSec = 0;
            var endLastSec = 99999;
            var i = 0;
            while (i < this._path.length) {
                var s = this._path[i];
                if (s < seconds) {
                    if (s > beginLastSec) {
                        beginX = this._path[i + 1];
                        beginY = this._path[i + 2];
                        beginLastSec = s;
                    }
                }
                if (s > seconds) {
                    if (s < endLastSec) {
                        endX = this._path[i + 1];
                        endY = this._path[i + 2];
                        endLastSec = s;
                    }
                }
                i += 3;
            }
            var xas = endX - beginX;
            var yos = endY - beginY;
            var totalTime = endLastSec - beginLastSec;
            var currentTime = seconds - beginLastSec;
            this._x = beginX + (xas * currentTime) / totalTime;
            this._y = beginY + (yos * currentTime) / totalTime;
        },
        getX: function () {
            return this._x;
        },
        getY: function () {
            return this._y;
        },
        __class__: pingvp_PingVpFollowPath,
    };
    var pingvp_PingVpInterval = function (call, time, loopTimes, multiplier) {
        this._call = call;
        this._time = time;
        this._multiplier = multiplier;
        this._loopTimes = loopTimes;
        this._vsyncTimer = new pingvp_VsyncTimer();
        this._timed = 0;
    };
    $hxClasses["pingvp.PingVpInterval"] = pingvp_PingVpInterval;
    pingvp_PingVpInterval.__name__ = ["pingvp", "PingVpInterval"];
    pingvp_PingVpInterval.prototype = {
        start: function () {
            if (this._vsyncTimer.isSupported()) {
                this._vsyncTimer.start(this._call);
            } else {
                // console.log("Does use timer");
                this._timer = new haxe_Timer(10);
                this._timer.run = $bind(this, this.onInterval);
                haxe_Timer.delay($bind(this, this.onInterval), 0);
            }
        },
        stop: function () {
            if (this._vsyncTimer.isSupported()) {
                this._vsyncTimer.stop();
            } else {
                if (this._timer != null) {
                    this._timer.stop();
                }
            }
        },
        onInterval: function () {
            if (!this._vsyncTimer.isSupported()) {
                var i = 0;
                while (i < this._loopTimes) {
                    haxe_Timer.delay(this._call, i * this._multiplier);
                    ++i;
                }
            }
        },
        __class__: pingvp_PingVpInterval,
    };
    var pingvp_PingVpLanguage = function (language) {
        language = this.checkLanguage(language);
        if (language == "en") {
            this._text = {
                generalError: "Video loading failed",
                unsuportedDevice: "Device not supported, watch this interactive video on iPad, Mac, Android tablet/smartphone or Windows PC.",
                subtitlesNone: "None",
                share: "Share",
                shareReturn: "&lt; Return to video",
                copy: "Copy URL",
                copiedToClip: "Copied to clipboard.",
                pressCtrlC: "Press CTRL+C to copy",
                emailSubject: "Check out this video",
                emailBody1: "Hi,\n\nI would like to share this video: ",
                emailBody2: "\n\nKind regards,",
                contextbarStart: "Go to start",
                contextbarBack: "Go one step back",
                contextbarRepeat: "Repeat video",
                contextbarReport: "Report a problem",
                contextbarBrand: "Ping Video Player (PingVP)",
                settingsHeadQuality: "Quality",
                settingsQualityHDFull: "High Definition (HD)",
                settingsQualityHD: "HD",
                settingsQualitySDFull: "Standard Definition (SD)",
                settingsQualitySD: "SD",
                settingsHeadSubs: "Subtitles/CC",
                settingsHeadSpeed: "Playback speed",
                settingsHeadShare: "Share",
                settingsShareLink: "Copy url",
                linkIsCopiedSucces: "Link copied",
                linkIsCopiedFailed: "Copying failed",
                settingsShareFacebook: "Share on Facebook",
                settingsShareTwitter: "Share on Twitter",
                settingsBackToHead: "Back to settings",
                settingsMenuTitle: "SETTINGS",
                settingsQualityTitle: "QUALITY",
                settingsSubtitlesTitle: "SUBTITLES/CC",
                settingsSpeedTitle: "PLAYBACK SPEED",
                playerIsPlayed: "Play",
                playerIsPaused: "Paused",
                playerIsMuted: "Unmute",
                statsTableHeaderAll: "All statistics",
                statsTableHeaderAllEmpty: "Clean",
                statsTableHeaderSucces: "Success statistics",
                statsTableHeaderError: "Failed statistics",
                statsWarningText: "Stats url empty, all stats will result succesfull",
                statsTableTh1: "Clipname",
                statsTableTh2: "Action",
                statsTableTh3: "Amount",
                controlPlayLabelOn: "Play",
                controlPlayLabelOff: "Pause",
                control5SecBackLabel: "5 Sec. back",
                muteLabel: "Volume",
                subtitlesLabel: "Subtitles",
                shareLabel: "Share",
                settingsLabel: "Settings",
                smallscreenLabel: "Close Fullscreen",
                fullscreenLabel: "Fullscreen",
                shareModalTitle: "Share video",
                shareCopyButton: "Copy url",
                shareEmailSubject: "I'd like to share a link with you",
            };
        } else {
            this._text = {
                generalError: "Fout bij het laden van de video",
                unsuportedDevice: "Uw apparaat wordt nog niet ondersteund, bekijk deze interactieve video op iPad, Mac, Android tablet/smartphone of Windows PC.",
                subtitlesNone: "Geen",
                share: "Delen",
                shareReturn: "&lt; Terug naar de video",
                copy: "Kopieer URL",
                copiedToClip: "Gekopieerd naar het klembord.",
                pressCtrlC: "Druk op CTRL-C om te kopieren",
                emailSubject: "Ik wil deze video graag met je delen",
                emailBody1: "Hoi,\n\nIk wil deze video graag met je delen: ",
                emailBody2: "\n\nGroeten,",
                contextbarStart: "Ga naar start",
                contextbarBack: "Ga een stap terug",
                contextbarRepeat: "Herhaal video",
                contextbarReport: "Meld een probleem",
                contextbarBrand: "Ping Video Player (PingVP)",
                settingsHeadQuality: "Kwaliteit",
                settingsQualityHDFull: "High Definition (HD)",
                settingsQualityHD: "HD",
                settingsQualitySDFull: "Standard Definition (SD)",
                settingsQualitySD: "SD",
                settingsHeadSubs: "Ondertiteling/CC",
                settingsHeadSpeed: "Snelheid",
                settingsHeadShare: "Delen",
                settingsShareLink: "Url kopieren",
                linkIsCopiedSucces: "Link gekopiëerd",
                linkIsCopiedFailed: "Kopieren mislukt",
                settingsShareFacebook: "Delen op Facebook",
                settingsShareTwitter: "Delen op Twitter",
                settingsBackToHead: "Terug naar instellingen",
                settingsMenuTitle: "INSTELLINGEN",
                settingsQualityTitle: "KWALITEIT",
                settingsSubtitlesTitle: "ONDERTITELING",
                settingsSpeedTitle: "AFSPEELSNELHEID",
                playerIsPlayed: "Afspelen",
                playerIsPaused: "Gepauzeerd",
                playerIsMuted: "Zet geluid aan",
                statsTableHeaderAll: "Alle statistieken",
                statsTableHeaderAllEmpty: "Vernieuwen",
                statsTableHeaderSucces: "Succesvolle statistieken",
                statsTableHeaderError: "Mislukte statistieken",
                statsWarningText: "statistieken url is leeg, alles zal succesvol zijn",
                statsTableTh1: "Clipnaam",
                statsTableTh2: "Actie",
                statsTableTh3: "Aantal",
                controlPlayLabelOn: "Afspelen",
                controlPlayLabelOff: "Pauzeren",
                control5SecBackLabel: "5 Sec. terug",
                muteLabel: "Volume",
                subtitlesLabel: "Ondertiteling",
                shareLabel: "Delen",
                settingsLabel: "Instellingen",
                smallscreenLabel: "Sluit fullscreen",
                fullscreenLabel: "Fullscreen",
                shareModalTitle: "Video delen",
                shareCopyButton: "Kopieer url",
                shareEmailSubject: "Ik zou graag deze link met je delen",
            };
        }
    };
    $hxClasses["pingvp.PingVpLanguage"] = pingvp_PingVpLanguage;
    pingvp_PingVpLanguage.__name__ = ["pingvp", "PingVpLanguage"];
    pingvp_PingVpLanguage.prototype = {
        get: function (key) {
            return Reflect.field(this._text, key);
        },
        checkLanguage: function (language) {
            if (language.toLowerCase() == "english" || language.toLowerCase() == "en" || language.toLowerCase() == "engels") {
                return "en";
            } else {
                return "nl";
            }
        },
        __class__: pingvp_PingVpLanguage,
    };
    var pingvp_PingVpLoader = function (videoOid, node, scriptName, hash, debug, language, startFragment, select, controlsBelowVideo, controlsDisable, isFramed, autoStart, autoHeight, inOverlayPlay, inlinePlay, pingVpFunctions) {
        var _gthis = this;
        this._language = language;
        this._startFragment = startFragment;
        this._videoOid = videoOid;
        this._node = node;
        this._debug = debug;
        this._select = select;
        this._controlsBelowVideo = controlsBelowVideo;
        if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
            this._controlsBelowVideo = false;
        }
        this._controlsDisable = controlsDisable;
        this._isFramed = isFramed;
        this._autoStart = autoStart;
        this._autoHeight = autoHeight;
        this._inOverlayPlay = inOverlayPlay;
        this._inlinePlay = inlinePlay;
        this._playerUri = pingvp_PingVpConfigRead.get().playerUri;
        this._videoScriptsUri = pingvp_PingVpConfigRead.get().videoScriptsUri;
        this._videosUri = pingvp_PingVpConfigRead.get().videosUri;
        this._imagesUri = pingvp_PingVpConfigRead.get().imagesUri;
        this._postersUri = pingvp_PingVpConfigRead.get().postersUri != null ? pingvp_PingVpConfigRead.get().postersUri : pingvp_PingVpConfigRead.get().videosUri;
        this._eventLogUri = pingvp_PingVpConfigRead.get().eventLogUri;
        this._scriptName = scriptName;
        this._hash = hash;
        this._responsiveWidth = 16;
        this._responsiveHeight = 9;
        this._posterRemove = false;
        this._displayHtmlOverview = false;
        this._pingVpFunctions = pingVpFunctions;
        this._pingVpFunctions.setResize($bind(this, this.onResize));
        this._spacebar = new pingvp_PingVpSpacebar(this._videoOid, this._node);
        this._keys = new pingvp_PingVpArrowKeys(this._videoOid);
        this._keysControlbar = new pingvp_PingVpArrowKeys(this._videoOid);
        this._keysSettingsMenu = new pingvp_PingVpArrowKeys(this._videoOid);
        this._keysSettingsMenuClose = new pingvp_PingVpArrowKeys(this._videoOid);
        this._keysSubtitlesMenu = new pingvp_PingVpArrowKeys(this._videoOid);
        this._keysSubtitlesMenuClose = new pingvp_PingVpArrowKeys(this._videoOid);
        this._keysShareMenu = new pingvp_PingVpArrowKeys(this._videoOid);
        this._keysShareMenuClose = new pingvp_PingVpArrowKeys(this._videoOid);
        this._text = new pingvp_PingVpLanguage(language);
        this._statsOverview = $('.pingVpStatsOverview[data-video="' + this._scriptName + '"]');
        if (this._statsOverview.length > 0) {
            if (this._statsOverview.find("tbody").length == 0) {
                this._statsOverview.append(
                    '<h2 class="pingVpReset pingVpHeaderTable">' +
                        this._text.get("statsTableHeaderAll") +
                        '<span class="pingVpReset">' +
                        this._text.get("statsTableHeaderAllEmpty") +
                        '</span></h2><table class="pingVpReset pingVpStatsSuccesTable pingVpTable"><thead class="pingVpReset"><tr class="pingVpReset"><th class="pingVpReset">' +
                        this._text.get("statsTableTh1") +
                        '</th><th class="pingVpReset">' +
                        this._text.get("statsTableTh2") +
                        '</th></thead><tbody class="pingVpReset"></tbody></table>'
                );
                this._statsOverviewTable = this._statsOverview.find("tbody");
                this._statsOverview.find(".pingVpHeaderTable span").on("click", null, function (e) {
                    _gthis._statsOverviewTable.html("");
                });
            } else {
                this._statsOverviewTable = this._statsOverview.find("tbody");
            }
            this._displayHtmlOverview = true;
        }
        this._videoScript = new pingvp_PingVpVideoScriptSelect(this._videoOid, this._videoScriptsUri, this._hash);
        this._videoScript.select(this._scriptName, $bind(this, this.onSuccess), $bind(this, this.onFailed));
    };
    $hxClasses["pingvp.PingVpLoader"] = pingvp_PingVpLoader;
    pingvp_PingVpLoader.__name__ = ["pingvp", "PingVpLoader"];
    pingvp_PingVpLoader.prototype = {
        onSuccess: function () {
            var _gthis = this;
            this._debug = this._videoScript.script().checktHeader("debug") ? this._videoScript.script().getHeaderDebug() : this._debug;
            this._select = this._videoScript.script().checktHeader("select") ? this._videoScript.script().getHeaderSelect() : this._select;
            this._controlsBelowVideo = this._videoScript.script().checktHeader("controls") ? this._videoScript.script().getHeaderControlsBelow() : this._controlsBelowVideo;
            if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
                this._controlsBelowVideo = false;
            }
            this._controlsDisable = this._videoScript.script().checktHeader("controls") ? this._videoScript.script().getHeaderControlsDisable() : this._controlsDisable;
            this._autoStart = this._videoScript.script().checktHeader("autoStart") ? this._videoScript.script().getHeaderAutoStart() : this._autoStart;
            if (this._startFragment == "" || this._videoScript.script().checkFragment(this._startFragment) == false) {
                this._startFragment = this._videoScript.script().getHeaderStart();
            }
            this._autoHeight = this._videoScript.script().checktHeader("autoHeight") ? this._videoScript.script().getHeaderAutoHeight() : this._autoHeight;
            this._inOverlayPlay = this._videoScript.script().checktHeader("overlayPlay") ? this._videoScript.script().getHeaderOverlayPlay() : this._inOverlayPlay;
            this._inlinePlay = this._videoScript.script().checktHeader("inlinePlay") ? this._videoScript.script().getHeaderInlinePlay() : this._inlinePlay;
            if (this._isFramed) {
                this._inOverlayPlay = false;
            }
            this._events = new pingvp_PingVpEvents(
                this._videoOid,
                new pingvp_PingVpDebug(this._debug),
                this._eventLogUri,
                this._videoScript.script().getHeaderUuid(),
                this._videoScript.script().getHeaderTitle(),
                this._videoScript.name(),
                this._text
            );
            this.event("Video script loaded", this._videoScript.script().getHeaderStart());
            this._responsiveWidth = this._videoScript.script().getHeaderFloatHelper("responsiveWidth", 16);
            this._responsiveHeight = this._videoScript.script().getHeaderFloatHelper("responsiveHeight", 9);
            this.onResize(null);
            $(window).on("orientationchange resize", null, function (e) {
                _gthis.onResize(e);
            });
            this._theme = new pingvp_PingVpTheme(this._videoScript.script().getShowPlay(), this._controlsBelowVideo, this._videoScript.script().getHeaderTheme());
            this._theme.set("defaultcolor", this._videoScript.script().getHeaderDefaultColor());
            this._theme.set("hovercolor", this._videoScript.script().getHeaderHoverColor());
            if (this._inlinePlay) {
                this._inOverlayPlay = false;
                this._autoStart = true;
                new pingvp_PingVpStyle(this._playerUri + "styles/pingvp.min.css", "pingVpPlayerStyle");
                this._container = new pingvp_PingVpVideoContainer(this._videoOid, this._node, this._controlsBelowVideo, false, this._videoScript.script());
                this._focus = new pingvp_PingVpFocus(this._videoOid, this._node);
                var posterWidth = this._videoScript.script().getHeaderFloatHelper("posterWidth", 16);
                var posterHeight = this._videoScript.script().getHeaderFloatHelper("posterHeight", 9);
                var headerPoster = this._postersUri + this._videoScript.script().getHeaderPoster();
                var headerThemeBase = this._playerUri + "themes/" + this._videoScript.script().getHeaderTheme() + "/";
                this._overlayPlayPoster = new pingvp_PingVpOverlayPlayPoster(this._videoOid, this._node, this._container, headerPoster, "play_button", this._controlsBelowVideo ? 40 : 0, posterWidth, posterHeight, this._theme);
                this._overlayPlayPoster.setClickHandler($bind(this, this.onInlinePlayPosterClick));
                this.onResize(null);
                this._pingVpClick = new pingvp_PingVpClick(this._videoOid, this._videoScript.name(), $bind(this, this.onInlinePlayPosterClick), $bind(this, this.onPingVpClickPause));
            } else {
                if (this._inOverlayPlay) {
                    new pingvp_PingVpStyle(this._playerUri + "styles/pingvp.min.css", "pingVpPlayerStyle");
                    this._container = new pingvp_PingVpVideoContainer(this._videoOid, $("body"), this._controlsBelowVideo, true, this._videoScript.script());
                    this._container.hide();
                    this._focus = new pingvp_PingVpFocus(this._videoOid, this._node);
                    var posterWidth1 = this._videoScript.script().getHeaderFloatHelper("posterWidth", 16);
                    var posterHeight1 = this._videoScript.script().getHeaderFloatHelper("posterHeight", 9);
                    var headerPoster1 = this._postersUri + this._videoScript.script().getHeaderPoster();
                    var headerThemeBase1 = this._playerUri + "themes/" + this._videoScript.script().getHeaderTheme() + "/";
                    this._overlayPlayPoster = new pingvp_PingVpOverlayPlayPoster(this._videoOid, this._node, this._container, headerPoster1, "play_button", this._controlsBelowVideo ? 40 : 0, posterWidth1, posterHeight1, this._theme);
                    this._overlayPlayPoster.setClickHandler($bind(this, this.onOverlayPlayPosterClick));
                    this.onResize(null);
                    this._pingVpClick = new pingvp_PingVpClick(this._videoOid, this._videoScript.name(), $bind(this, this.onOverlayPlayPosterClick), $bind(this, this.onPingVpClickPause));
                } else {
                    this._container = new pingvp_PingVpVideoContainer(this._videoOid, this._node, this._controlsBelowVideo, false, this._videoScript.script());
                    this._focus = new pingvp_PingVpFocus(this._videoOid, this._node);
                    this.onResize(null);
                    this.load();
                }
            }
        },
        onPingVpClickPlay: function () {},
        onPingVpClickPause: function () {},
        newOnPingVpClickPlay: function () {
            this.event("Inline play poster click", this._videoScript.script().getHeaderStart());
            this._container.setResponsiveSize(this._responsiveWidth, this._responsiveHeight);
            this._container.show();
            this._overlayPlayPoster.removePoster();
            this.load();
        },
        onVideoBuffered: function (videoName) {
            this._overlayPlayPoster.removePoster();
        },
        onInlinePlayPosterClick: function () {
            this.event("Inline play poster click", this._videoScript.script().getHeaderStart());
            this._container.setResponsiveSize(this._responsiveWidth, this._responsiveHeight);
            this._container.show();
            this.load($bind(this, this.onVideoBuffered));
            this._pingVpClick.onPingVpClickPlay($bind(this, this.onPingVpClickPlay));
        },
        onOverlayPlayPosterClick: function () {
            var _gthis = this;
            this.event("Overlay play poster click", this._videoScript.script().getHeaderStart());
            this._videoScript.select(
                this._scriptName,
                function () {
                    _gthis._container.setResponsiveSize(_gthis._responsiveWidth, _gthis._responsiveHeight);
                    _gthis._container.enableOverlayPlay($bind(_gthis, _gthis.onOverlayPlayReturn));
                    _gthis._container.show();
                    _gthis.load();
                },
                function () {}
            );
        },
        onOverlayPlayReturn: function () {
            this.event("Overlay play return", this._videoScript.script().getHeaderStart());
            this._container.hide();
            if (this._player != null) {
                this._player.cleanup();
                this._player = null;
            }
            if (this._canvasPlayer != null) {
                this._canvasPlayer.cleanup();
                this._canvasPlayer = null;
            }
            if (this._fallbackPlayer != null) {
                this._fallbackPlayer.cleanUp();
                this._fallbackPlayer = null;
            }
            if (this._inlineFrame != null) {
                this._inlineFrame.cleanUp();
                this._inlineFrame = null;
            }
        },
        load: function (call) {
            if (this._videoScript.script().checktHeader("responseCode")) {
                var responseCode = this._videoScript.script().getHeaderFloatHelper("responseCode", 0);
                if (responseCode == 101) {
                    var responseImage = this._imagesUri + this._videoScript.script().getHeaderHelper("responseImage", "");
                    var fallbackImageWidth = this._videoScript.script().getHeaderFloatHelper("fallbackImageWidth", 16);
                    var fallbackImageHeight = this._videoScript.script().getHeaderFloatHelper("fallbackImageHeight", 9);
                    new pingvp_PingVpFallBackImage(this._videoOid, this._node, responseImage, fallbackImageWidth, fallbackImageHeight);
                    return;
                }
            }
            if (!this._isFramed && this._select == "iframe") {
                this.loadInlineFrame();
                return;
            }
            var disabledList = [];
            if (!this._videoScript.script().getHeaderBoolHelper("canvasEnabled")) {
                disabledList.push(3);
            }
            if (pingvp_PingVpUserAgentSelect.select(disabledList)) {
                var _g = pingvp_PingVpUserAgentSelect.player;
                switch (_g) {
                    case 1:
                        this.loadSelectPlayer(call);
                        return;
                    case 2:
                        this.loadHtml5(call);
                        return;
                    case 3:
                        this.loadCanvas(call);
                        return;
                    case 4:
                        if (!this.loadFallbackPlayer()) {
                            new pingvp_PingVpStyle(this._playerUri + "styles/pingvp.min.css", "pingVpPlayerStyle");
                            this.fallbackImg();
                        }
                        return;
                }
            }
            if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpod() || pingvp_PingVpDevice.isBlackBerry() || pingvp_PingVpDevice.isWindowsPhone() || pingvp_PingVpDevice.isSymbian()) {
                if (!this.loadFallbackPlayer()) {
                    new pingvp_PingVpStyle(this._playerUri + "styles/pingvp.min.css", "pingVpPlayerStyle");
                    this.fallbackImg();
                }
                return;
            }
            if (this._videoScript.script().getHeaderBoolHelper("canvasEnabled") && (pingvp_PingVpDevice.isIphone() || this._select == "canvas")) {
                this.loadCanvas();
                return;
            }
            if (pingvp_PingVpDevice.isIpad()) {
                if (!!document.createElement("video").canPlayType) {
                    this.loadHtml5(call);
                }
                return;
            }
            this.loadSelectPlayer(call);
        },
        loadSelectPlayer: function (call) {
            this.loadHtml5(call);
        },
        loadHtml5: function (call) {
            if (!!document.createElement("video").canPlayType) {
                this.event("HTML5 selected", this._videoScript.script().getHeaderStart());
                this._player = new pingvp_PingVpPlayer(
                    this._debug,
                    this._videoOid,
                    this._node,
                    this._container,
                    this._text,
                    this._videoScript,
                    this._controlsBelowVideo,
                    this._controlsDisable,
                    this._startFragment,
                    null,
                    this._events,
                    this._autoStart,
                    this._inOverlayPlay,
                    this._inlinePlay,
                    call,
                    this._pingVpFunctions,
                    this._spacebar,
                    this._keys,
                    this._keysControlbar,
                    this._keysSettingsMenu,
                    this._keysSettingsMenuClose,
                    this._keysSubtitlesMenu,
                    this._keysSubtitlesMenuClose,
                    this._keysShareMenu,
                    this._keysShareMenuClose
                );
            } else {
                new pingvp_PingVpStyle(this._playerUri + "styles/pingvp.min.css", "pingVpPlayerStyle");
                this.fallbackImg();
            }
        },
        loadCanvas: function (call) {
            this.event("Canvas selected", this._videoScript.script().getHeaderStart());
            this._canvasPlayer = new pingvp_PingVpCanvasPlayer(
                this._debug,
                this._videoOid,
                this._node,
                this._container,
                this._text,
                this._videoScript,
                this._controlsBelowVideo,
                this._controlsDisable,
                this._startFragment,
                null,
                this._events,
                this._autoStart,
                this._inOverlayPlay,
                this._inlinePlay,
                call,
                this._pingVpFunctions,
                this._spacebar,
                this._keys,
                this._keysControlbar,
                this._keysSettingsMenu,
                this._keysSettingsMenuClose,
                this._keysSubtitlesMenu,
                this._keysSubtitlesMenuClose,
                this._keysShareMenu,
                this._keysShareMenuClose
            );
        },
        loadInlineFrame: function () {
            this.event("Iframe selected", this._videoScript.script().getHeaderStart());
            var tmp = this._container.get().get(0);
            var tmp1 = this._videoOid;
            var s = this._scriptName;
            var tmp2 = this._playerUri + "embed.php?video=" + encodeURIComponent(s) + "&debug=";
            var s1 = this._language;
            var tmp3 = tmp2 + (this._debug ? "true" : "false") + "&language=" + encodeURIComponent(s1) + "&select=";
            var s2 = this._select;
            var tmp4 = tmp3 + encodeURIComponent(s2) + "&controls=";
            var s3 = this._startFragment;
            this._inlineFrame = new pingvp_InlineFrame(tmp, tmp1, tmp4 + (this._controlsBelowVideo ? "below" : "fade") + "&startfragment=" + encodeURIComponent(s3));
        },
        loadFallbackPlayer: function () {
            if (!this._videoScript.script().checktHeader("fallbackPoster") && this._videoScript.script().getHeaderFallbackPoster() != "") {
                return false;
            }
            var poster = this._videosUri + this._videoScript.script().getHeaderFallbackPoster();
            this.event("Fallback player selected", this._videoScript.script().getHeaderStart());
            var UrlMp4 = "";
            if (this._videoScript.script().checktHeader("fallbackVideoMp4") && this._videoScript.script().getHeaderFallbackMp4() != "") {
                UrlMp4 = this._videosUri + this._videoScript.script().getHeaderFallbackMp4();
            }
            var UrlWebm = "";
            if (this._videoScript.script().checktHeader("fallbackVideoWebm") && this._videoScript.script().getHeaderFallbackWebm() != "") {
                UrlWebm = this._videosUri + this._videoScript.script().getHeaderFallbackWebm();
            }
            var UrlOgg = "";
            if (this._videoScript.script().checktHeader("fallbackVideoOgv") && this._videoScript.script().getHeaderFallbackOgv() != "") {
                UrlOgg = this._videosUri + this._videoScript.script().getHeaderFallbackOgv();
            }
            var UrlFallbackImg = "";
            if (this._videoScript.script().checktHeader("fallbackImage") && this._videoScript.script().getHeaderFallbackImage() != "") {
                UrlFallbackImg = this._videosUri + this._videoScript.script().getHeaderFallbackImage();
            }
            this._fallbackPlayer = new pingvp_fallbackplayer_FallbackVideo(this._container.get().get(0), this._videoOid, poster, UrlMp4, UrlWebm, UrlOgg, UrlFallbackImg);
            return true;
        },
        onFailed: function () {
            this.onResize(null);
            $(window).resize($bind(this, this.onResize));
            $(window).on("orientationchange", null, $bind(this, this.onResize));
            new pingvp_PingVpStyle(this._playerUri + "styles/pingvp.min.css", "pingVpPlayerStyle");
            new pingvp_PingVpFailure(this._node, this._text.get("generalError"));
        },
        event: function (action, videoName) {
            if (this._events == null) {
                return;
            }
            if (this._displayHtmlOverview) {
                this._statsOverviewTable.prepend('<tr class="pingVpReset"><td class="pingVpReset">' + this._videoScript.script().getFragmentVideoTitle(videoName) + '</td><td class="pingVpReset">' + action + "</td></tr>");
            }
            this._events.pushAction(this._videoScript.script().getFragmentVideoUuid(videoName), this._videoScript.script().getFragmentVideoTitle(videoName), action, -1, "");
        },
        onResize: function (e) {
            if (this._autoHeight) {
                var width = this._node.width();
                var height = (width * this._responsiveHeight) / this._responsiveWidth;
                var nodeHeight = height + (this._controlsBelowVideo ? 40 : 0);
                this._node.height(nodeHeight);
            }
            if ((this._inlinePlay || this._inOverlayPlay) && this._overlayPlayPoster != null) {
                this._overlayPlayPoster.resize(this._controlsBelowVideo ? 40 : 0);
            }
            if (this._container != null) {
                this._container.resize();
            }
            if (this._fallbackPlayer != null) {
                this._fallbackPlayer.resize(this._container.get().width(), this._container.get().height());
            }
            if (this._inlineFrame != null) {
                this._inlineFrame.resize(this._container.get().width(), this._container.get().height());
            }
        },
        fallbackImg: function () {
            if (this._videoScript.script().checktHeader("fallbackImage")) {
                var UrlFallbackImg = this._imagesUri + this._videoScript.script().getHeaderFallbackImage();
                var fallbackImageWidth = this._videoScript.script().getHeaderFloatHelper("fallbackImageWidth", 16);
                var fallbackImageHeight = this._videoScript.script().getHeaderFloatHelper("fallbackImageHeight", 9);
                new pingvp_PingVpFallBackImage(this._videoOid, this._node, UrlFallbackImg, fallbackImageWidth, fallbackImageHeight);
            } else {
                new pingvp_PingVpFailure(this._node, this._text.get("unsuportedDevice"));
            }
        },
        __class__: pingvp_PingVpLoader,
    };
    var pingvp_PingVpLoop = function (loop) {
        this._loop = loop;
    };
    $hxClasses["pingvp.PingVpLoop"] = pingvp_PingVpLoop;
    pingvp_PingVpLoop.__name__ = ["pingvp", "PingVpLoop"];
    pingvp_PingVpLoop.prototype = {
        start: function () {
            return this.getFloatField("position");
        },
        seek: function () {
            return this.getFloatField("seekTo");
        },
        action: function () {
            return this.getStringField("command");
        },
        getStringField: function (field) {
            if (this._loop == null) {
                return null;
            }
            var value = Reflect.field(this._loop, field);
            if (value == null) {
                return null;
            }
            return Std.string(value);
        },
        getFloatField: function (field) {
            if (this._loop == null) {
                return null;
            }
            var ret = Reflect.field(this._loop, field);
            return ret;
        },
        isLooping: function () {
            return this._looping;
        },
        setLooping: function (value) {
            return (this._looping = value);
        },
        __class__: pingvp_PingVpLoop,
    };
    var pingvp_PingVpMessages = function (videoOid, theme, width, height, pixels) {
        this._videoOid = videoOid;
        this._theme = theme;
        this._overlay = $("#pingVpOverlay-" + this._videoOid);
        this._overlay.append(
            '<div id="pingVpMessageOverlay-' +
                videoOid +
                '" class="pingVpMessageOverlay"><div id="pingVpMessage-' +
                videoOid +
                '-left" class="pingVpMessage pingVpMessagePositionLeft"></div><div id="pingVpMessage-' +
                videoOid +
                '-center" class="pingVpMessage pingVpMessagePositionCenter"></div><div id="pingVpMessage-' +
                videoOid +
                '-right" class="pingVpMessage pingVpMessagePositionRight"></div></div>'
        );
        this._messageOverlay = $("#pingVpMessageOverlay-" + this._videoOid);
        this._messageOverlay.css("width", width);
        this._messageOverlay.css("height", height - pixels);
        this._messageLeft = $("#pingVpMessage-" + this._videoOid + "-left");
        this._messageCenter = $("#pingVpMessage-" + this._videoOid + "-center");
        this._messageRight = $("#pingVpMessage-" + this._videoOid + "-right");
    };
    $hxClasses["pingvp.PingVpMessages"] = pingvp_PingVpMessages;
    pingvp_PingVpMessages.__name__ = ["pingvp", "PingVpMessages"];
    pingvp_PingVpMessages.prototype = {
        instantMessage: function (messageName, messageText, messageDuration, messagePosition) {
            var _gthis = this;
            if ($("#pingVpMessage-" + messageName + "-" + this._videoOid).length == 0) {
                if (messagePosition == "left") {
                    this._selectedPosition = this._messageLeft;
                } else {
                    if (messagePosition == "right") {
                        this._selectedPosition = this._messageRight;
                    } else {
                        if (messagePosition == "center_center") {
                            this._selectedPosition = this._messageCenter;
                        } else {
                            this._selectedPosition = this._messageCenter;
                        }
                    }
                }
                this._selectedPosition.append('<div id="pingVpMessage-' + messageName + "-" + this._videoOid + '" class="pingVpMessageBlock"><div class="pingVpMessageText">' + messageText + "</div>");
                this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid);
                this._selectedElement
                    .find(".pingVpMessageText")
                    .css("background-color", "#" + this._theme.getByKey("menucolor"))
                    .css("color", "#" + this._theme.getByKey("defaultcolor"));
                this._selectedElement
                    .stop()
                    .css("display", "block")
                    .animate({ opacity: 1 }, 600, null, function () {
                        if (messageDuration != 0) {
                            haxe_Timer.delay(function () {
                                _gthis._selectedAfterTimer = $("#pingVpMessage-" + messageName + "-" + _gthis._videoOid);
                                _gthis._selectedAfterTimer.stop().animate({ opacity: 0 }, 600, null, function () {
                                    _gthis._selectedAfterTimer.css("display", "none");
                                });
                            }, messageDuration);
                        }
                    });
            }
        },
        setMessage: function (messageName, content, messagePosition, isIcon) {
            if ($("#pingVpMessage-" + messageName + "-" + this._videoOid).length == 0) {
                if (messagePosition == "left") {
                    this._selectedPosition = this._messageLeft;
                } else {
                    if (messagePosition == "right") {
                        this._selectedPosition = this._messageRight;
                    } else {
                        if (messagePosition == "center_center") {
                            this._selectedPosition = this._messageCenter;
                        } else {
                            this._selectedPosition = this._messageCenter;
                        }
                    }
                }
                if (isIcon != null && isIcon) {
                    this._centerClass = "";
                    if (messagePosition == "center_center") {
                        this._centerClass = "pingVpMessageCenterCenter";
                    }
                    this._content = this._theme.getIcon(this._theme.getByKey("svgset"), content + ".svg", this._theme.getByKey("defaultcolor"));
                    this._selectedPosition.append(
                        '<div id="pingVpMessage-' +
                            messageName +
                            "-" +
                            this._videoOid +
                            '" class="pingVpMessageBlock"><div class="pingVpMessageText pingVpMessageIcon ' +
                            this._centerClass +
                            '"><img class="pingVpResetSvg" src="' +
                            this._content +
                            '"/></div>'
                    );
                } else {
                    this._content = content;
                    this._selectedPosition.append('<div id="pingVpMessage-' + messageName + "-" + this._videoOid + '" class="pingVpMessageBlock"><div class="pingVpMessageText">' + this._content + "</div>");
                }
                this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid);
                this._selectedElement.css("opacity", 0.7);
                this._selectedElement
                    .find(".pingVpMessageText")
                    .css("background-color", "#" + this._theme.getByKey("menucolor"))
                    .css("color", "#" + this._theme.getByKey("defaultcolor"));
                this._selectedElement.hide();
            }
        },
        onClickClose: function (messageName, call, hideOnClick) {
            var _gthis = this;
            this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid + " .pingVpMessageText");
            this._selectedElement.addClass("pingVpMessageBlockClickable");
            this._selectedElement.attr("tabindex", "0");
            this._selectedElement.on("click", null, function (e) {
                if (call != null) {
                    call();
                }
                if (hideOnClick) {
                    _gthis.hideImmediatelyMessage(messageName);
                }
            });
        },
        showMessage: function (messageName, messageDuration) {
            var _gthis = this;
            this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid);
            this._selectedElement
                .stop()
                .css("display", "block")
                .animate({ opacity: 1 }, 600, null, function () {
                    if (messageDuration != 0) {
                        haxe_Timer.delay(function () {
                            _gthis._selectedAfterTimer = $("#pingVpMessage-" + messageName + "-" + _gthis._videoOid);
                            _gthis._selectedAfterTimer.stop().animate({ opacity: 0 }, 600, null, function () {
                                _gthis._selectedAfterTimer.css("display", "none");
                            });
                        }, messageDuration);
                    } else {
                        _gthis._selectedAfterTimer = $("#pingVpMessage-" + messageName + "-" + _gthis._videoOid);
                        _gthis._selectedAfterTimer.stop().animate({ opacity: 0 }, 600, null, function () {
                            _gthis._selectedAfterTimer.css("display", "none");
                        });
                    }
                });
        },
        showIconMessage: function (messageName, messageDuration) {
            var _gthis = this;
            this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid);
            this._selectedElement
                .stop()
                .css("display", "block")
                .css("opacity", 0.7)
                .addClass("pingVpMessageIconGrow")
                .animate({ opacity: 0 }, 600, null, function () {
                    _gthis._selectedElement.css("display", "none").css("opacity", 0.7).removeClass("pingVpMessageIconGrow");
                });
        },
        showImmediatelyMessage: function (messageName) {
            this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid);
            this._selectedElement.stop().css("display", "block").css("opacity", 1);
        },
        hideMessage: function (messageName) {
            var _gthis = this;
            this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid);
            this._selectedElement.stop().animate({ opacity: 0 }, 600, null, function () {
                _gthis._selectedElement.css("display", "none");
            });
        },
        hideImmediatelyMessage: function (messageName) {
            this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid);
            this._selectedElement.stop().css("display", "none").css("opacity", 0);
        },
        resize: function (width, height, pixels) {
            var percent = (100 * this._overlay.outerWidth()) / 640;
            this._messageOverlay.css("font-size", percent + "%");
            this._messageOverlay.css("width", width);
            this._messageOverlay.css("height", height - pixels);
        },
        isShown: function (messageName) {
            this._selectedElement = $("#pingVpMessage-" + messageName + "-" + this._videoOid);
            if (this._selectedElement.css("display") == "none") {
                return false;
            } else {
                return true;
            }
        },
        __class__: pingvp_PingVpMessages,
    };
    var pingvp_PingVpOverlay = function (videoOid, container, enableOverlay, defaultColor, hoverColor, controlsBelowVideo) {
        var _gthis = this;
        this._isActive = false;
        container.get().append('<div id="pingVpOverlay-' + videoOid + '" class="pingVpOverlay pingVpReset"></div>');
        this._videoOid = videoOid;
        this._container = container;
        this._overlay = $("#pingVpOverlay-" + videoOid);
        this._overlay.hide();
        this._checkDiv = $("#pingVpOverlayPlayContainer-" + videoOid);
        this._body = $("body");
        this._body.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onNonActive));
        this._body.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onActiveHover));
        this._overlay.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onActive));
        this._defaultColor = defaultColor;
        if (this._defaultColor == null || this._defaultColor == "") {
            this._defaultColor = "fff";
        }
        this._hoverColor = hoverColor;
        if (this._hoverColor == null || this._hoverColor == "") {
            this._hoverColor = "c6c6c6";
        }
        this._controlsBelowVideo = controlsBelowVideo;
        if (enableOverlay == true) {
            this._overlay.append(
                '<div id="pingVpCloseOverlayButton-' +
                    videoOid +
                    '" tabindex="0" class="pingVpCloseOverlayButton"><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 600 600" style="enable-background:new 0 0 600 600;" xml:space="preserve"><polygon class="pingVpCloseIcon" points="521.5,111.7 520.4,110.3 381.7,110.3 300.6,212.5 219.5,110.3 78.5,110.3 230.1,301.4 80.7,489.8 221.7,489.8 300.6,390.3 379.4,489.8 520.4,489.8 371,301.4 520.4,113.1 " fill="#' +
                    this._defaultColor +
                    '"/></svg></div>'
            );
            this._closeOverlayButton = $("#pingVpCloseOverlayButton-" + videoOid);
            if (this._closeOverlayButton.find("polygon").length != 0) {
                this._svgTag = "polygon";
            } else {
                if (this._closeOverlayButton.find("path").length != 0) {
                    this._svgTag = "path";
                } else {
                    this._svgTag = "";
                }
            }
            this._closeOverlayButton.css("display", "none");
            this._closeOverlayButton.css("opacity", 0);
            this._overlay.mousemove($bind(this, this.onShow));
            this._overlayPlayBgJq = $("#pingVpOverlayPlayBg-" + videoOid);
            this._overlayPlayContainer = $("#pingVpOverlayPlayContainer-" + videoOid);
            this._closeOverlayButton.click($bind(this, this.onDisable));
            this._closeOverlayButton.hover(
                function (e) {
                    _gthis._closeOverlayButton.find(_gthis._svgTag + ".pingVpCloseIcon").attr("fill", "#" + _gthis._hoverColor);
                },
                function (e1) {
                    _gthis._closeOverlayButton.find(_gthis._svgTag + ".pingVpCloseIcon").attr("fill", "#" + _gthis._defaultColor);
                }
            );
        }
    };
    $hxClasses["pingvp.PingVpOverlay"] = pingvp_PingVpOverlay;
    pingvp_PingVpOverlay.__name__ = ["pingvp", "PingVpOverlay"];
    pingvp_PingVpOverlay.prototype = {
        get: function () {
            return this._overlay;
        },
        getActive: function () {
            return this._isActive;
        },
        setActive: function (isActive) {
            if (isActive) {
                this._checkDiv.addClass("pingVpActive-" + this._videoOid);
            } else {
                this._checkDiv.removeClass("pingVpActive-" + this._videoOid);
            }
            this._isActive = isActive;
        },
        setCloseButton: function (funCleanUp) {
            this._funCleanUp = funCleanUp;
            this._closeOverlayButton.click($bind(this, this.onDisable));
        },
        onActive: function (e) {
            this._checkDiv.addClass("pingVpActive-" + this._videoOid);
            this._isActive = true;
            var _currentClicked = $(e.target);
            if (
                _currentClicked.parents(".pingVpMessageText").length == 0 &&
                (_currentClicked.parents(".pingVpBlock").length == 0 || (_currentClicked.parents(".pingVpBlock").length != 0 && _currentClicked.parents(".pingVpBlock").hasClass("pingVpBlockName-text"))) &&
                !_currentClicked.hasClass("pingVpPosterPlayButton") &&
                !_currentClicked.hasClass("pingVpPoster") &&
                !_currentClicked.hasClass("pingVpMessageBlockClickable") &&
                !_currentClicked.hasClass("pingVpShareOverlay") &&
                _currentClicked.parents(".pingVpSettingsMenu").length == 0 &&
                _currentClicked.parents(".pingVpSubtitlesMenu").length == 0 &&
                _currentClicked.parents(".pingVpShareOverlay").length == 0 &&
                _currentClicked.parents(".pingVpControlBar").length == 0 &&
                (!_currentClicked.hasClass("pingVpBlock") || (_currentClicked.hasClass("pingVpBlock") && _currentClicked.hasClass("pingVpBlockName-text"))) &&
                _currentClicked.parents(".pingVpCloseOverlayButton").length == 0 &&
                !_currentClicked.hasClass("pingVpCloseOverlayButton")
            ) {
                if (this._onScreenClick != null) {
                    this._onScreenClick();
                }
            }
        },
        onActiveHover: function (e) {
            this._checkClick = $(e.target);
            if (this._checkClick.attr("id") == "pingVpOverlayPlay-" + this._videoOid || this._checkClick.attr("id") == "pingVpOverlayPlayButton-" + this._videoOid) {
                this._checkDiv.addClass("pingVpActive-" + this._videoOid);
                this._isActive = true;
            }
        },
        onNonActive: function (e) {
            this._checkClick = $(e.target);
            if (
                this._checkClick.attr("id") != "pingVpVideoContainer-" + this._videoOid &&
                this._checkClick.attr("id") != "pingVpPosterPlayButton-" + this._videoOid &&
                this._checkClick.attr("id") != "pingVpOverlayPlayButton-" + this._videoOid &&
                this._checkClick.attr("id") != "pingVpOverlayPlay-" + this._videoOid &&
                this._checkClick.attr("id") != "pingVpPoster-" + this._videoOid &&
                this._checkClick.parents("#pingVpVideoContainer-" + this._videoOid).length == 0 &&
                this._checkClick.parents("#pingVpOverlay-" + this._videoOid).length == 0
            ) {
                this._checkDiv.removeClass("pingVpActive-" + this._videoOid);
                this._isActive = false;
            }
        },
        onDisable: function (e) {
            if (this._onFullScreenClose != null && this._controlBar.isFullScreen()) {
                this._onFullScreenClose();
            }
            this._overlayPlayBgJq.css("display", "none");
            this._overlayPlayContainer.css("top", "0");
            this._overlayPlayContainer.css("left", "0");
            this._overlayPlayContainer.css("width", "100%");
            this._overlayPlayContainer.css("height", "100%");
            this._overlayPlayContainer.css("position", "relative");
            this._overlayPlayContainer.css("zIndex", "auto");
            this._container.setOverlayPlayEnable(false);
            this._overlayPlayBgJq.css("zIndex", "auto");
            if (this._funCleanUp != null) {
                this._funCleanUp();
            }
        },
        onShow: function (e) {
            var _gthis = this;
            this._closeOverlayButton.stop(null, false, false);
            this._closeOverlayButton.css("display", "block");
            this._closeOverlayButton.css("opacity", 1);
            if (!this._controlsBelowVideo) {
                this._closeOverlayButton.animate({ opacity: 0 }, 2000, null, function () {
                    _gthis._closeOverlayButton.css("display", "none");
                });
            }
        },
        onScreenClick: function (call) {
            this._onScreenClick = call;
        },
        setFullScreenCloseHandler: function (controlBar, call) {
            this._controlBar = controlBar;
            this._onFullScreenClose = call;
        },
        __class__: pingvp_PingVpOverlay,
    };
    var pingvp_PingVpOverlayPlayPoster = function (videoOid, node, container, posterImage, posterPlayImage, controlsBelowHeight, posterWidth, posterHeight, theme) {
        var _gthis = this;
        this._videoOid = videoOid;
        this._node = node;
        this._container = container;
        this._posterWidth = posterWidth;
        this._posterHeight = posterHeight;
        this._controlsBelowHeight = controlsBelowHeight;
        if ($("#pingVpOverlayPlayButton-" + videoOid).length != 0) {
            $("#pingVpOverlayPlayButton-" + videoOid).remove();
        }
        if ($("#pingVpOverlayPlay-" + videoOid).length != 0) {
            $("#pingVpOverlayPlay-" + videoOid).remove();
        }
        this._theme = theme;
        this._tabIndexOverlay = this._theme.showPlay() ? "" : 'tabindex="0"';
        this._tabIndexButton = this._theme.showPlay() ? 'tabindex="0"' : "";
        this._node.append('<img id="pingVpOverlayPlay-' + videoOid + '" ' + this._tabIndexOverlay + ' class="pingVpOverlayPlay" src="' + posterImage + '" alt="" />');
        this._posterImg = $("#pingVpOverlayPlay-" + videoOid);
        this._posterPlayImage = theme.getIcon(theme.getByKey("svgset"), posterPlayImage + ".svg", theme.getByKey("defaultcolor"));
        this._posterPlayImageHover = theme.getIcon(theme.getByKey("svgset"), posterPlayImage + ".svg", theme.getByKey("hovercolor"));
        if (this._theme.showPlay()) {
            this._node.append('<img id="pingVpOverlayPlayButton-' + videoOid + '" ' + this._tabIndexButton + ' class="pingVpOverlayPlayButton" src="' + this._posterPlayImage + '"/>');
            this._node.hover(
                function (e) {
                    _gthis._node.children("img#pingVpOverlayPlayButton-" + videoOid).attr("src", _gthis._posterPlayImageHover);
                },
                function (e1) {
                    _gthis._node.children("img#pingVpOverlayPlayButton-" + videoOid).attr("src", _gthis._posterPlayImage);
                }
            );
            this._buttonDiv = $("#pingVpOverlayPlayButton-" + videoOid);
            this._buttonDiv.on("click", null, $bind(this, this.onClick));
        }
        this._posterImg.on("click", null, $bind(this, this.onClick));
        this.resize(this._controlsBelowHeight);
    };
    $hxClasses["pingvp.PingVpOverlayPlayPoster"] = pingvp_PingVpOverlayPlayPoster;
    pingvp_PingVpOverlayPlayPoster.__name__ = ["pingvp", "PingVpOverlayPlayPoster"];
    pingvp_PingVpOverlayPlayPoster.prototype = {
        onClick: function (e) {
            if (this._call != null) {
                this._call();
            }
        },
        setClickHandler: function (call) {
            this._call = call;
        },
        resize: function (controlsBelowHeight) {
            this._controlsBelowHeight = controlsBelowHeight;
            var containerWidth = this._node.width();
            var containerHeight = this._node.height();
            containerHeight -= this._controlsBelowHeight;
            var containerCenterX = containerWidth / 2;
            var containerCenterY = containerHeight / 2;
            var posterHalfWidth = this._posterWidth / 2;
            var posterHalfHeigth = this._posterHeight / 2;
            var scaleX = containerWidth / this._posterWidth;
            var scaleY = containerHeight / this._posterHeight;
            var scale = scaleX;
            if (scaleX > scaleY) {
                scale = scaleY;
            }
            this._posterImg.css("left", containerCenterX - posterHalfWidth * scale + "px");
            this._posterImg.css("top", containerCenterY - posterHalfHeigth * scale + "px");
            this._posterImg.css("width", this._posterWidth * scale + "px");
            this._posterImg.css("height", this._posterHeight * scale + "px");
            var buttonTop = containerHeight / 2;
            if (this._theme.showPlay()) {
                this._buttonDiv.css("top", buttonTop + "px");
            }
        },
        removePoster: function () {
            if (this._theme.showPlay()) {
                this._buttonDiv.remove();
            }
            this._posterImg.remove();
        },
        __class__: pingvp_PingVpOverlayPlayPoster,
    };
    var pingvp_PingVpPath = function () {
        this.path = [];
    };
    $hxClasses["pingvp.PingVpPath"] = pingvp_PingVpPath;
    pingvp_PingVpPath.__name__ = ["pingvp", "PingVpPath"];
    pingvp_PingVpPath.prototype = {
        add: function (scriptName, videoName) {
            this.path.push(new pingvp_PingVpPathPair(scriptName, videoName));
        },
        back: function (start) {
            if (this.path.length == 0) {
                return start;
            }
            return this.path.pop();
        },
        clear: function () {
            this.path = [];
        },
        trace: function () {
            var max = this.path.length;
            var i = 0;
            while (i < max) {
                ++i;
            }
        },
        __class__: pingvp_PingVpPath,
    };
    var pingvp_PingVpPathPair = function (scriptName, videoName) {
        this._scriptName = scriptName;
        this._videoName = videoName;
    };
    $hxClasses["pingvp.PingVpPathPair"] = pingvp_PingVpPathPair;
    pingvp_PingVpPathPair.__name__ = ["pingvp", "PingVpPathPair"];
    pingvp_PingVpPathPair.prototype = { __class__: pingvp_PingVpPathPair };
    var pingvp_PingVpPlayer = function (
        debug,
        videoOid,
        node,
        container,
        text,
        videoScript,
        controlsBelowVideo,
        controlsDisabled,
        tempStartFragment,
        analytics,
        events,
        autoStart,
        inOverlayPlay,
        inlinePlay,
        call,
        pingVpFunctions,
        spacebar,
        keys,
        keysControlbar,
        keysSettingsMenu,
        keysSettingsMenuClose,
        keysSubtitlesMenu,
        keysSubtitlesMenuClose,
        keysShareMenu,
        keysShareMenuClose
    ) {
        pingvp_PingVpPlayerBase.call(this, debug, videoOid, node, container, text, videoScript, controlsBelowVideo, controlsDisabled, tempStartFragment, analytics, events, autoStart, inOverlayPlay, inlinePlay, call);
        pingVpFunctions.setResize($bind(this, this.onResize));
        this._focusActive = false;
        this._videoScriptSub = videoScript.script();
        this.defaultColor = this._videoScriptSub.getHeaderDefaultColor();
        this.hoverColor = this._videoScriptSub.getHeaderHoverColor();
        this._enableOverlay = inOverlayPlay;
        this._spacebar = spacebar;
        this._keysControlbar = keysControlbar;
        this._keysSettingsMenu = keysSettingsMenu;
        this._keysSettingsMenuClose = keysSettingsMenuClose;
        this._keysSubtitlesMenu = keysSubtitlesMenu;
        this._keysSubtitlesMenuClose = keysSubtitlesMenuClose;
        this._keysShareMenu = keysShareMenu;
        this._keysShareMenuClose = keysShareMenuClose;
        this._keys = keys;
        if (this._videoScript.script().getFragmentVideoMp4Lq(this._videoName) != "") {
            this._videoMp4Lq = this._videosUri + this._videoScript.script().getFragmentVideoMp4Lq(this._videoName);
        } else {
            this._videoMp4Lq = "";
        }
        if (this._videoScript.script().getFragmentVideoWebmLq(this._videoName) != "") {
            this._videoWebmLq = this._videosUri + this._videoScript.script().getFragmentVideoWebmLq(this._videoName);
        } else {
            this._videoWebmLq = "";
        }
        if (this._videoScript.script().getFragmentVideoOgvLq(this._videoName) != "") {
            this._videoOgvLq = this._videosUri + this._videoScript.script().getFragmentVideoOgvLq(this._videoName);
        } else {
            this._videoOgvLq = "";
        }
        if (this._videoScript.script().getFragmentVideoMp4Hq(this._videoName) != "") {
            this._videoMp4Hq = this._videosUri + this._videoScript.script().getFragmentVideoMp4Hq(this._videoName);
        } else {
            this._videoMp4Hq = "";
        }
        if (this._videoScript.script().getFragmentVideoWebmHq(this._videoName) != "") {
            this._videoWebmHq = this._videosUri + this._videoScript.script().getFragmentVideoWebmHq(this._videoName);
        } else {
            this._videoWebmHq = "";
        }
        if (this._videoScript.script().getFragmentVideoOgvHq(this._videoName) != "") {
            this._videoOgvHq = this._videosUri + this._videoScript.script().getFragmentVideoOgvHq(this._videoName);
        } else {
            this._videoOgvHq = "";
        }
        this._videoOriginalWidth = this._videoScript.script().getFragmentVideoWidth(this._videoName);
        this._videoOriginalHeight = this._videoScript.script().getFragmentVideoHeight(this._videoName);
        if (this._interval != null) {
            this._interval.stop();
        }
        this._interval = new pingvp_PingVpInterval($bind(this, this.onPlaying), 100, 100, 20);
        this.firstRun();
    };
    $hxClasses["pingvp.PingVpPlayer"] = pingvp_PingVpPlayer;
    pingvp_PingVpPlayer.__name__ = ["pingvp", "PingVpPlayer"];
    pingvp_PingVpPlayer.__super__ = pingvp_PingVpPlayerBase;
    pingvp_PingVpPlayer.prototype = $extend(pingvp_PingVpPlayerBase.prototype, {
        cleanup: function () {
            this._loop = false;
            this._interval.stop();
            if (this._fullScreen != null) {
                this._fullScreen.claenUp();
                this._fullScreen = null;
            }
            if (this._videoTag != null) {
                this._videoTag.pause();
                this._videoTag.cleanUp();
                this._videoTag = null;
            }
        },
        firstRun: function () {
            this.resetPlayer(false);
            this.loadPlayer(!this._autoStart);
            this._fullScreen.setFullScreenEventHandler($bind(this, this.onFullScreenEvent));
            this._fullScreen.setWindowedEventHandler($bind(this, this.onWindowedEvent));
            this.bindOnResize(true);
            this._videoTag.load();
            if (pingvp_PingVpDevice.isIpad()) {
                this._videoTag.setCurrentTimeDelay(0.1);
            }
            if (this._brandedStudio != null) {
                this._brandedStudio.setEndcardStart(this._videoTag);
            }
            if (this._autoStart) {
                this.event("Load video");
                if (!this._inlinePlay && !this._enableOverlay) {
                    this._messages.showImmediatelyMessage("PlayerAutostartMute");
                    this._videoTag.muted(true);
                    this._controlBar.setMute();
                    if (this._subtitles.hasSubs() && this._subtitles.getSelected() == 0) {
                        this._subtitles.onSubSelect(1);
                        this._settings.setSubsMenuSelected(1);
                    }
                }
                this._videoTag.play();
                this._controlBar.setPlay();
                this.onPlaying();
                this._interval.start();
            }
            this.onResize(null);
        },
        onPosterClick: function () {
            this.event("Poster click");
            this.event("Load video");
            this._videoTag.play();
            this._controlBar.setPlay();
            this._interval.start();
            this.checkHideEnable(true);
        },
        loadFragment: function (fragment, changeQuality) {
            this._focusActive = this._overlay.getActive();
            if (!this._videoScript.script().checkFragment(fragment)) {
                return;
            }
            this._playLoop = this._videoScript.script().getFragmentLoop(fragment);
            this._interval.stop();
            this.resetPlayer(changeQuality);
            this._videoName = fragment;
            this._videoMp4Lq = this._videosUri + this._videoScript.script().getFragmentVideoMp4Lq(this._videoName);
            this._videoWebmLq = this._videosUri + this._videoScript.script().getFragmentVideoWebmLq(this._videoName);
            this._videoOgvLq = this._videosUri + this._videoScript.script().getFragmentVideoOgvLq(this._videoName);
            this._videoMp4Hq = this._videosUri + this._videoScript.script().getFragmentVideoMp4Hq(this._videoName);
            this._videoWebmHq = this._videosUri + this._videoScript.script().getFragmentVideoWebmHq(this._videoName);
            this._videoOgvHq = this._videosUri + this._videoScript.script().getFragmentVideoOgvHq(this._videoName);
            this._videoOriginalWidth = this._videoScript.script().getFragmentVideoWidth(this._videoName);
            this._videoOriginalHeight = this._videoScript.script().getFragmentVideoHeight(this._videoName);
            this.wasShownBefore = this._messages.isShown("PlayerAutostartMute");
            this.loadPlayer(false);
            this._percent0 = true;
            this._percent20 = true;
            this._percent50 = true;
            this._percent80 = true;
            if (!changeQuality) {
                this.event("Load video");
            } else {
                this.event("Quality change to " + (this._lastHq ? "high" : "low"));
            }
            if (this._lastTime != 0) {
                this._videoTag.setCurrentTimeDelay(this._lastTime);
            } else {
                if (pingvp_PingVpDevice.isIpad()) {
                    this._videoTag.setCurrentTimeDelay(0.1);
                }
            }
            this._videoTag.play();
            this.onPlaying();
            this._controlBar.setPlay();
            this._interval.start();
            this.onResize(null);
            this._overlay.setActive(this._focusActive);
        },
        loadPlayer: function (loadPoster) {
            this._videoEndCallback = this._videoScript.script().getFragmentVideoEndCallback(this._videoName);
            if (this._lastHq) {
                this._videoTag = new pingvp_html5player_VideoTag(
                    this._videoOid,
                    this._container.get().get(0),
                    this._videoMp4Hq,
                    this._videoWebmHq,
                    this._videoOgvHq,
                    $bind(this, this.onBeginBuffering),
                    $bind(this, this.onEndBuffering),
                    null,
                    this._autoStart
                );
            } else {
                this._videoTag = new pingvp_html5player_VideoTag(
                    this._videoOid,
                    this._container.get().get(0),
                    this._videoMp4Lq,
                    this._videoWebmLq,
                    this._videoOgvLq,
                    $bind(this, this.onBeginBuffering),
                    $bind(this, this.onEndBuffering),
                    null,
                    this._autoStart
                );
            }
            this._videoTag.paddingBottom(this._container, this._container.getWidth(), this._container.getHeight(), this._controlsBelowVideo ? 40 : 0);
            this._videoTag.setPlayHandler($bind(this, this.onVideoPlay));
            this._videoTag.setPauseHandler($bind(this, this.onVideoPause));
            this._videoTag.setEndHandler($bind(this, this.onVideoEnd));
            this._videoTag.setLoadedMetaData($bind(this, this.onLoadedMetaData));
            this._overlay = new pingvp_PingVpOverlay(this._videoOid, this._container, this._enableOverlay, this.defaultColor, this.hoverColor, this._controlsBelowVideo);
            this._overlay.onScreenClick($bind(this, this.onScreenClick));
            if (this._enableOverlay) {
                this._overlay.setCloseButton($bind(this, this.cleanup));
            }
            this._blocks = new pingvp_PingVpBlocksAll(
                this._videoOid,
                this._debug,
                this._videoOriginalWidth,
                this._videoOriginalHeight,
                $bind(this, this.onBlockClick),
                $bind(this, this.onPauseCommand),
                $bind(this, this.onSeekCommand),
                $bind(this, this.onCtaAction),
                this._theme
            );
            this._blocks.executeScript(
                this._videoScript.name(),
                this._videoTag.getPosLeft(),
                this._videoTag.getPosTop(),
                this._videoScript.script().getFragmentCommands(this._videoName),
                this._videoScript.script().getFragmentHeaderHtml5Sync(this._videoName),
                this._videoScript.script().getFragmentHeaderHtml5DurationCorrection(this._videoName),
                "html5"
            );
            this._messages = new pingvp_PingVpMessages(this._videoOid, this._theme, this._container.getWidth(), this._container.getHeight(), this._controlsBelowVideo ? 50 : 0);
            this._messages.setMessage("PlayerActionPlay", "play_button_center", "center_center", true);
            this._messages.setMessage("PlayerActionPause", "pause_button_center", "center_center", true);
            this._messages.setMessage("PlayerAutostartMute", "sound_on", "right", true);
            this._messages.onClickClose("PlayerAutostartMute", $bind(this, this.onUnmuteButton), true);
            if (this.wasShownBefore != null && this.wasShownBefore) {
                this._messages.showImmediatelyMessage("PlayerAutostartMute");
            }
            if (loadPoster) {
                if (this._videoScript.script().getHeaderPosterRatio() != "fixed") {
                    this._poster = new pingvp_PingVpPoster(this._videoOid, this._overlay, this._headerPoster, "play_button", this._controlsBelowVideo, this._theme);
                    this._poster.setClickHandler($bind(this, this.onPosterClick));
                } else {
                    var posterWidth = this._videoScript.script().getHeaderFloatHelper("posterWidth", 16);
                    var posterHeight = this._videoScript.script().getHeaderFloatHelper("posterHeight", 9);
                    this._posterRatio = new pingvp_PingVpPosterRatio(
                        this._node,
                        this._videoOid,
                        this._container,
                        this._overlay,
                        this._headerPoster,
                        "play_button",
                        this._controlsBelowVideo,
                        this._controlsBelowVideo && !this._lastFullScreen ? 40 : 0,
                        posterWidth,
                        posterHeight,
                        this._theme
                    );
                    this._posterRatio.setClickHandler($bind(this, this.onPosterClick));
                }
            }
            this._contextMenu.setupContextMenus(this._container, this._theme);
            this._contextMenu.addOption("pingVpOptionStart-" + this._videoOid, this._text.get("contextbarStart"), null, $bind(this, this.onStartButton));
            this._contextMenu.addOption("pingVpOptionBack-" + this._videoOid, this._text.get("contextbarBack"), null, $bind(this, this.onBackButton));
            this._contextMenu.addOption("pingVpOptionReplay-" + this._videoOid, this._text.get("contextbarRepeat"), null, $bind(this, this.onRepeatButton));
            this._contextMenu.addHr();
            this._contextMenu.addOption("pingVpOptionReport-" + this._videoOid, this._text.get("contextbarReport"), null, $bind(this, this.onReportButton));
            this._contextMenu.addOption("pingVpOptionBrand-" + this._videoOid, this._text.get("contextbarBrand"), null, $bind(this, this.onBrandButton));
            this.createCommonControls(true, this._lastSubtitle, this._lastFullScreen, this._lastHq, true, $bind(this, this.onLqButton), $bind(this, this.onHqButton));
            this._controlBar.setPause();
            this._controlBar.setMuteHandler($bind(this, this.onMuteButton));
            this._controlBar.setUnmuteHandler($bind(this, this.onUnmuteButton));
            this._controlBar.setVolumeSliderHandler($bind(this, this.onVolumeSliderClick));
            this._controlBar.setVolumeSliderArrowsHandler($bind(this, this.onVolumeSliderArrows));
            this._overlay.setFullScreenCloseHandler(this._controlBar, $bind(this, this.onWindowedButton));
            if (this._lastMute) {
                this._videoTag.muted(true);
                this._controlBar.setMute();
            }
            if (!pingvp_PingVpDevice.isIphone() && !pingvp_PingVpDevice.isIpad() && !pingvp_PingVpDevice.isAndroid()) {
                if (this._lastVolume != 1) {
                    this._videoTag.setVolume(this._lastVolume);
                }
            }
            if (this._lastFullScreen) {
                this._controlBar.setFullScreen();
            }
            if (!pingvp_PingVpDevice.isIphone() && !pingvp_PingVpDevice.isIpad() && !pingvp_PingVpDevice.isAndroid()) {
                this._controlBar.setVolumeSlider(this._videoTag.getVolume());
            }
            if (!pingvp_PingVpDevice.isIphone() && pingvp_PingVpDevice.isIpad()) {
                this._progress.disable();
            }
            this._spacebar.onSpaceBarPress($bind(this, this.onSpaceBar));
            this._keys.boundOnArrowKeys($bind(this, this.onKeys));
            this._keysControlbar.boundOnArrowKeys(this._controlBar.checkLeftAndRightKeys);
            this._keysSettingsMenu.boundOnArrowKeys((($_ = this._settings), $bind($_, $_.checkUpAndDownKeys)));
            this._keysSettingsMenuClose.boundOnArrowKeys((($_ = this._settings), $bind($_, $_.checkCloseKeys)));
            this._keysSubtitlesMenu.boundOnArrowKeys((($_ = this._subtitlesOverlay), $bind($_, $_.checkUpAndDownKeys)));
            this._keysSubtitlesMenuClose.boundOnArrowKeys((($_ = this._subtitlesOverlay), $bind($_, $_.checkCloseKeys)));
            this._keysShareMenu.boundOnArrowKeys((($_ = this._shareOverlay), $bind($_, $_.checkUpAndDownKeys)));
            this._keysShareMenuClose.boundOnArrowKeys((($_ = this._shareOverlay), $bind($_, $_.checkCloseKeys)));
            this._pingVpClick.onPingVpClickPlay($bind(this, this.onPlayButton));
            this._pingVpClick.onPingVpClickPause($bind(this, this.onPauseButton));
        },
        resetPlayer: function (changeQuality) {
            if (changeQuality && this._controlBar != null) {
                this._lastTime = this._videoTag.getCurrentTime();
            } else {
                this._lastTime = 0;
            }
            if (this._subtitles != null) {
                this._lastSubtitle = this._subtitles.getSelected();
            } else {
                this._lastSubtitle = -1;
            }
            if (this._controlBar != null) {
                if (this._lastHq == null) {
                    if (!this._videoScript.script().checktHeader("videoQuality")) {
                        this._lastHq = pingvp_PingVpConfigRead.get().videoQuality != "LQ";
                    } else {
                        this._lastHq = this._videoScript.script().getHeaderVideoQuality() != "LQ";
                    }
                } else {
                    if (changeQuality) {
                        this._lastHq = this._lastHq ? false : true;
                    }
                }
                if (!pingvp_PingVpDevice.isIphone() && !pingvp_PingVpDevice.isIpad() && !pingvp_PingVpDevice.isAndroid()) {
                    this._lastMute = this._controlBar.isMute();
                    this._lastVolume = this._controlBar.getVolumeSlider();
                }
                this._lastFullScreen = this._controlBar.isFullScreen();
                this.checkHideEnable(false);
            } else {
                if (!this._videoScript.script().checktHeader("videoQuality")) {
                    this._lastHq = pingvp_PingVpConfigRead.get().videoQuality != "LQ";
                } else {
                    this._lastHq = this._videoScript.script().getHeaderVideoQuality() != "LQ";
                }
                if (!pingvp_PingVpDevice.isIphone() && !pingvp_PingVpDevice.isIpad() && !pingvp_PingVpDevice.isAndroid()) {
                    this._lastMute = false;
                    this._lastVolume = 1;
                }
                this._lastFullScreen = false;
            }
            if (this._videoTag != null) {
                this._videoTag.pause();
                this._videoTag.cleanUp();
                this._videoTag = null;
            }
        },
        onPlayButton: function (ableToRepeat) {
            this._shareOverlay.hideShareOverlay();
            this._interval.start();
            if (!this._autoStart) {
                if (this._videoScript.script().getHeaderHelper("posterRatio", "") != "fixed") {
                    this._poster.removePoster();
                } else {
                    this._posterRatio.removePoster();
                }
            }
            if (this._replayEvent) {
                if (ableToRepeat || ableToRepeat == null) {
                    this._videoTag.play();
                    this._controlBar.setPauseIcon();
                    this._controlBar.setPlay();
                    this.onPlaying();
                    if (this._mobileCheck) {
                        this.checkHideEnable(true);
                    }
                    this.event("Replay");
                    this._replayEvent = false;
                }
            } else {
                this._videoTag.play();
                this._controlBar.setPlay();
                this.onPlaying();
                if (this._mobileCheck) {
                    this.checkHideEnable(true);
                }
                this.event("Play");
            }
        },
        onPauseButton: function () {
            this._videoTag.pause();
            this._controlBar.setPause();
            this.onPlaying();
            if (this._mobileCheck) {
                this.checkHideEnable(false);
            }
            this.event("Pause");
        },
        onCtaAction: function (getAction, playerAction) {
            if (playerAction) {
                if (getAction) {
                    this.onPlayButton(false);
                } else {
                    this.onPauseButton();
                }
            }
        },
        onSpaceBar: function () {
            if (this._videoTag.isPlaying()) {
                this._messages.hideImmediatelyMessage("PlayerActionPlay");
                this.onPauseButton();
                this._messages.showIconMessage("PlayerActionPause", 0);
            } else {
                this._messages.hideImmediatelyMessage("PlayerActionPause");
                this.onPlayButton(true);
                this._messages.showIconMessage("PlayerActionPlay", 0);
            }
        },
        onKeys: function (e) {
            var _pingVpElement = $(".pingVpWebplayerSelector,#pingVpOverlayPlayContainer-" + this._videoOid + ",.PingVP");
            var _containerElement = $("#pingVpOverlayPlayContainer-" + this._videoOid);
            var _focus = $(":focus");
            if (
                _containerElement.hasClass("pingVpActive-" + this._videoOid) ||
                (_focus.parents(".PingVP").length != 0 && _focus.parents(".PingVP")[0] == this._node[0]) ||
                (_focus.parents(".pingVpOverlayPlayContainer").length != 0 && _focus.parents(".pingVpOverlayPlayContainer")[0] == this._node[0]) ||
                (_focus.parents(".pingVpWebplayerSelector").length != 0 && _focus.parents(".pingVpWebplayerSelector")[0] == this._node[0])
            ) {
                if (e.which == 37 || e.which == 39) {
                    if (_focus.parents(".pingVpControlBar").length == 0 || (_focus.parents(".pingVpControlBar").length != 0 && !_pingVpElement.hasClass("pingVpIsTabbing") && !_focus.hasClass("pingVpSvgSlider"))) {
                        e.preventDefault();
                        this._controlBar.showTimeSliderKeys();
                        this.onTimeSliderArrows(e.which | 0);
                    }
                }
                if (e.which == 38 || e.which == 40) {
                    if (_focus.parents(".pingVpSettingsMenu").length == 0 && _focus.parents(".pingVpSubtitlesMenu").length == 0) {
                        e.preventDefault();
                        this._controlBar.showVolumeSliderKeys();
                        this.onVolumeSliderArrows(e.which | 0);
                    }
                }
            }
        },
        onScreenClick: function () {
            if (!this._contextMenu.isShown() && !this._settings.checkSettingsMenu() && !this._subtitlesOverlay.checkSubtitlesMenu()) {
                if (this._videoTag.isPlaying()) {
                    if (!this._mobileCheck) {
                        this._messages.hideImmediatelyMessage("PlayerActionPlay");
                        this.onPauseButton();
                        this._messages.showIconMessage("PlayerActionPause", 0);
                    }
                } else {
                    if (!this._replayEvent) {
                        if (!this._mobileCheck) {
                            this._messages.hideImmediatelyMessage("PlayerActionPause");
                            this.onPlayButton(false);
                            this._messages.showIconMessage("PlayerActionPlay", 0);
                        }
                    } else {
                        if (this._videoTag.getCurrentTime() != this._videoTag.getDuration()) {
                            if (!this._mobileCheck) {
                                this._messages.hideImmediatelyMessage("PlayerActionPause");
                                this.onPlayButton(true);
                                this._messages.showIconMessage("PlayerActionPlay", 0);
                            }
                        }
                    }
                }
            }
        },
        onFullScreenEvent: function () {
            if (!this._controlBar.isFullScreen()) {
                this.event("Enter full screen");
            }
            if (this._fullScreen != null && this._fullScreen.isFullWindowSelected()) {
                this._fullScreen.setChild(this._container.get().get(0));
                if (this._videoTag.isPlaying()) {
                    this._videoTag.play();
                }
            }
            this.onResize(null);
        },
        onWindowedEvent: function () {
            if (this._controlBar.isFullScreen()) {
                this.event("Leave full screen");
            }
            this._controlBar.setWindowed();
            if (this._fullScreen != null && this._fullScreen.isFullWindowSelected()) {
                this._fullScreen.removeChild();
                this._container.reset();
                if (this._videoTag.isPlaying()) {
                    this._videoTag.play();
                }
            }
            this.onResize(null);
        },
        onMuteButton: function () {
            this.event("Audio muted");
            this._videoTag.muted(true);
            this._controlBar.setMute();
        },
        onUnmuteButton: function () {
            this.event("Audio unmuted");
            if (this._messages.isShown("PlayerAutostartMute")) {
                this._messages.hideImmediatelyMessage("PlayerAutostartMute");
            }
            this._videoTag.muted(false);
            if (this._checkDeviceFunctions) {
                var getVolumeSlider = this._controlBar.getVolumeSlider();
                this._controlBar.setUnmute();
                if (getVolumeSlider == 0) {
                    this._controlBar.setVolumeSlider(0.2);
                    this._videoTag.setVolume(0.2);
                }
            } else {
                this._controlBar.setUnmute();
                this._controlBar.setVolumeSlider(1);
                this._videoTag.setVolume(1);
            }
        },
        onLqButton: function () {
            this.loadFragment(this._videoName, true);
        },
        onHqButton: function () {
            this.loadFragment(this._videoName, true);
        },
        onVideoPlay: function () {
            this._controlBar.setPlay();
            this.onPlaying();
        },
        onVideoPause: function () {
            this._controlBar.setPause();
            this.onPlaying();
        },
        onVideoEnd: function () {
            var _gthis = this;
            this._controlBar.setReplay();
            this.onPlaying();
            this.event("End video");
            this._replayEvent = true;
            this.videoEndCallback();
            if (this._videoScript.script().getFragmentOnEndRepeat(this._videoName)) {
                this.event("End repeat");
                this._videoTag.setCurrentTime(0);
                this._videoTag.play();
                this._controlBar.setPlay();
            } else {
                var onEndVideoLoad = this._videoScript.script().getFragmentOnEndVideoLoad(this._videoName);
                if (onEndVideoLoad != "") {
                    this.event("End load");
                    this._lastFragmentUuid = this._videoScript.script().getFragmentVideoUuid(this._videoName);
                    var onEndVideoLoad1 = this._videoScript.script().getFragmentOnEndVideoLoad(this._videoName);
                    var onEndVideoScript = this._videoScript.script().getFragmentOnEndVideoScript(this._videoName);
                    var lastVideoScriptName = this._videoScript.name();
                    var videoScriptName = onEndVideoScript != "" ? onEndVideoScript : lastVideoScriptName;
                    this._videoScript.select(
                        videoScriptName,
                        function () {
                            _gthis._videoPath.add(lastVideoScriptName, _gthis._videoName);
                            _gthis.loadFragment(onEndVideoLoad1, false);
                        },
                        function () {}
                    );
                }
            }
        },
        onPlaying: function () {
            if (!this._loop) {
                return;
            }
            if (this._videoTag.supportBuffered()) {
                if (this._videoTag.getBuffered() + 0.5 < this._videoTag.getCurrentTime()) {
                    this._controlBar.setBuffered(this._videoTag.getCurrentTime(), this._videoTag.getDuration());
                } else {
                    this._controlBar.setBuffered(this._videoTag.getBuffered() + 0.5, this._videoTag.getDuration());
                }
            }
            if (this._playLoop != null) {
                if (this._videoTag.getCurrentTime() >= this._playLoop.start()) {
                    this._playLoop.setLooping(true);
                    this._videoTag.setCurrentTime(this._playLoop.seek());
                }
            }
            if (this._subtitles != null) {
                this._subtitles.setTime(this._videoTag.getCurrentTime());
            }
            this._controlBar.setTimeSlider(this._videoTag.getCurrentTime(), this._videoTag.getDuration());
            this._controlBar.setTime(this._videoTag.getCurrentTime(), this._videoTag.getDuration());
            this._controlBar.rezize();
            this._videoTag.paddingBottom(this._container, this._container.getWidth(), this._container.getHeight(), this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            this._blocks.render(
                this._videoTag.getFrame(25),
                this._videoTag.getCurrentTime(),
                0,
                0,
                this._videoTag.getWidth(),
                this._videoTag.getHeight(),
                $("#pingVpVideoContainer-" + this._videoOid).width(),
                $("#pingVpVideoContainer-" + this._videoOid).height(),
                this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0
            );
            if (this._brandedStudio != null) {
                this._brandedStudio.update();
            }
            this.percentEventLog();
        },
        getPlayDuration: function () {
            return this._videoTag.getDuration();
        },
        onTimeSliderClick: function () {
            this.event("Seek to " + (this._controlBar.getTimeSliderPercent() | 0) + " % ");
            if (!this._autoStart) {
                if (this._videoScript.script().getHeaderHelper("posterRatio", "") != "fixed") {
                    this._poster.removePoster();
                } else {
                    this._posterRatio.removePoster();
                }
            }
            this._videoTag.setCurrentTime(this._controlBar.getTimeSlider(this._videoTag.getDuration()));
            this._controlBar.setTime(this._videoTag.getCurrentTime(), this._videoTag.getDuration());
        },
        onTimeSliderArrows: function (action) {
            this._controlBar.setTimeSliderArrows(this._videoTag.getCurrentTime(), this._videoTag.getDuration(), action, true);
            this.event("Seek to " + (this._controlBar.getTimeSliderPercent() | 0) + " % ");
            if (!this._autoStart) {
                if (this._videoScript.script().getHeaderHelper("posterRatio", "") != "fixed") {
                    this._poster.removePoster();
                } else {
                    this._posterRatio.removePoster();
                }
            }
            this._videoTag.setCurrentTime(this._controlBar.getTimeSlider(this._videoTag.getDuration()));
            this._controlBar.setTime(this._videoTag.getCurrentTime(), this._videoTag.getDuration());
        },
        on5secBackClick: function () {
            var currentTime = this._videoTag.getCurrentTime();
            if (currentTime != 0) {
                var newTime = currentTime - 5;
                if (newTime < 0) {
                    newTime = 0;
                }
                this.event("back by 5 seconds (" + newTime + ")");
                this._videoTag.setCurrentTime(newTime);
                this._controlBar.setTime(this._videoTag.getCurrentTime(), this._videoTag.getDuration());
            }
        },
        onVolumeSliderClick: function () {
            var getVolumeSlider = this._controlBar.getVolumeSlider();
            this.event("Volume change to " + getVolumeSlider);
            if (this._messages.isShown("PlayerAutostartMute")) {
                this._messages.hideImmediatelyMessage("PlayerAutostartMute");
            }
            var isMuted = this._controlBar.isMute();
            this._videoTag.setVolume(getVolumeSlider);
            if (isMuted && getVolumeSlider != 0) {
                this._videoTag.muted(false);
                this._controlBar.setUnmute();
            } else {
                if (!isMuted && getVolumeSlider == 0) {
                    this._videoTag.muted(true);
                    this._controlBar.setMute();
                }
            }
        },
        onVolumeSliderArrows: function (action) {
            var getVolumeSlider = this._controlBar.getVolumeSlider();
            var getVolumeSliderOrig = getVolumeSlider;
            var getVolumeSliderInt = 0;
            var getVolumeSliderStr = "";
            if (this._messages.isShown("PlayerAutostartMute")) {
                this._messages.hideImmediatelyMessage("PlayerAutostartMute");
            }
            if (getVolumeSlider != 0 && getVolumeSlider != 1) {
                getVolumeSliderStr = HxOverrides.substr(getVolumeSlider == null ? "null" : "" + getVolumeSlider, 2, 1);
                getVolumeSliderInt = Std.parseInt(getVolumeSliderStr);
                if (action == 39 || action == 38) {
                    getVolumeSliderInt += 2;
                } else {
                    getVolumeSliderInt -= 2;
                }
                if (getVolumeSliderInt == 10) {
                    getVolumeSlider = 1;
                } else {
                    getVolumeSlider = parseFloat("0." + getVolumeSliderInt);
                }
            } else {
                if (getVolumeSlider == 1) {
                    if (action == 39 || action == 38) {
                        getVolumeSlider = getVolumeSlider;
                    } else {
                        getVolumeSlider = 0.8;
                    }
                } else {
                    if (action == 39 || action == 38) {
                        getVolumeSlider = 0.2;
                    } else {
                        getVolumeSlider = getVolumeSlider;
                    }
                }
            }
            if (getVolumeSlider > 1) {
                getVolumeSlider = 1;
            }
            if (getVolumeSlider < 0) {
                getVolumeSlider = 0;
            }
            if (getVolumeSliderOrig != getVolumeSlider) {
                this.event("Volume change to " + getVolumeSlider);
            }
            var isMuted = this._controlBar.isMute();
            this._controlBar.setVolumeSlider(getVolumeSlider);
            this._videoTag.setVolume(getVolumeSlider);
            if (isMuted && getVolumeSlider != 0) {
                this._videoTag.muted(false);
                this._controlBar.setUnmute();
            } else {
                if (!isMuted && getVolumeSlider == 0) {
                    this._videoTag.muted(true);
                    this._controlBar.setMute();
                }
            }
        },
        onResize: function (e) {
            if (!this._loop) {
                return;
            }
            this._controlBar.rezize();
            this._videoTag.paddingBottom(this._container, this._container.getWidth(), this._container.getHeight(), this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            this.checkHideEnable(true);
            this._blocks.render(
                this._videoTag.getFrame(25),
                this._videoTag.getCurrentTime(),
                0,
                0,
                this._videoTag.getWidth(),
                this._videoTag.getHeight(),
                $("#pingVpVideoContainer-" + this._videoOid).width(),
                $("#pingVpVideoContainer-" + this._videoOid).height(),
                this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0
            );
            if (this._brandedStudio != null) {
                this._brandedStudio.update();
            }
            if (this._posterRatio != null) {
                this._posterRatio.resize(this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            }
            this._progress.resize(this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            if (this._settings != null && this._settings.checkMenuActive()) {
                this._settings.resize();
            }
            if (this._subtitlesOverlay != null && this._subtitlesOverlay.checkMenuActive()) {
                this._subtitlesOverlay.resize();
            }
            if (this._subtitles != null) {
                this._subtitles.resize();
            }
            if (this._messages != null) {
                this._messages.resize(this._container.getWidth(), this._container.getHeight(), this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            }
            if (this._shareOverlay != null && this._shareOverlay.checkMenuActive()) {
                this._shareOverlay.resize(this._controlsBelowVideo && !this._controlBar.isFullScreen() ? 40 : 0);
            }
            if (this._brandedStudio != null) {
                this._brandedStudio.resize(this._controlBar.isFullScreen());
            }
        },
        onBlockClick: function (videoOid, blockOid, name, action, args, like) {
            switch (action) {
                case "back":
                    this.onBackButton();
                    break;
                case "cta":
                    this.ctaHelper(videoOid, blockOid, args, name);
                    break;
                case "image":
                    this.loadHelper(args, name);
                    this.linkHelper(args, name, "Image link");
                    this.ctaHelper(videoOid, blockOid, args, name);
                    break;
                case "link":
                    this.linkHelper(args, name, "Link");
                    break;
                case "load":
                    this.loadHelper(args, name);
                    break;
                case "play":
                    this._videoTag.play();
                    this._controlBar.setPlay();
                    this.onPlaying();
                    break;
                case "rating":
                    this.event("Rating " + (like ? "like" : "dislike"));
                    break;
                case "repeat":
                    this.onRepeatButton();
                    break;
                case "seek":
                    if (args.position != null) {
                        this.event("Seek button(" + name + ")");
                        this._videoTag.setCurrentTime(args.position);
                        this._controlBar.setTime(this._videoTag.getCurrentTime(), this._videoTag.getDuration());
                        this._videoTag.play();
                        this._controlBar.setPlay();
                    }
                    break;
                case "start":
                    this.onStartButton();
                    break;
                case "text":
                    this.linkHelper(args, name, "Text link");
                    this.ctaHelper(videoOid, blockOid, args, name);
                    break;
            }
        },
        onPauseCommand: function (command) {
            this._videoTag.pause();
            this._controlBar.setPause();
            this.event("Pause command");
        },
        onSeekCommand: function (command) {
            if (command.seekTo == null) {
                return;
            }
            this._videoTag.setCurrentTime(command.seekTo);
            this.event("Seek command");
        },
        onLoadedMetaData: function () {
            this._progress.disable();
        },
        getPlayPercent: function () {
            if (this._videoTag == null || isNaN(this._videoTag.getDuration())) {
                return 0;
            }
            return (this._videoTag.getCurrentTime() * 100) / this._videoTag.getDuration();
        },
        linkHelper: function (args, name, statsName) {
            if (args.url != null) {
                var target = "_top";
                if (args.target != null) {
                    if (args.target == "blank") {
                        target = "_blank";
                    } else {
                        if (args.target == "top") {
                            target = "_top";
                        } else {
                            target = args.target;
                        }
                    }
                }
                if (target == "_top") {
                    this.event(statsName + ' "' + name + '"');
                    this._videoTag.pause();
                    this._progress.enable();
                    haxe_Timer.delay(function () {
                        window.open(args.url, target);
                    }, 1500);
                } else {
                    this.event(statsName + ' "' + name + '" (new tab)');
                    window.open(args.url, target);
                }
                return true;
            }
            return false;
        },
        loadHelper: function (args, name) {
            var _gthis = this;
            if (args.video != null) {
                this.event('Load "' + name + '"');
                this._lastFragmentUuid = this._videoScript.script().getFragmentVideoUuid(this._videoName);
                if (args.videoScriptName != null) {
                    var videoScriptName = this._videoScript.name();
                    this._videoScript.select(
                        args.videoScriptName,
                        function () {
                            _gthis._videoPath.add(videoScriptName, _gthis._videoName);
                            _gthis.loadFragment(args.video, false);
                        },
                        function () {}
                    );
                    return true;
                }
                this._videoPath.add(this._videoScript.name(), this._videoName);
                this.loadFragment(args.video, false);
                return true;
            }
            return false;
        },
        ctaHelper: function (videoOid, blockOid, args, name) {
            this.event('CtaClick "' + name + '"');
            var _jqyCtaBlock = $("#pingVpBlock-" + videoOid + "-" + blockOid + "-ctaOpen");
            if (args.ctaToggle == true) {
                if (_jqyCtaBlock.css("display") == "none") {
                    _jqyCtaBlock.show();
                    if (args.ctaOnOpen != null && args.ctaOnOpen == "pause") {
                        this.onCtaAction(false, false);
                    } else {
                        if (args.ctaOnOpen != null && args.ctaOnOpen == "play") {
                            this.onCtaAction(true, false);
                        }
                    }
                } else {
                    _jqyCtaBlock.hide();
                    if (args.ctaOnClose != null && args.ctaOnClose == "pause") {
                        this.onCtaAction(false, false);
                    } else {
                        if (args.ctaOnClose != null && args.ctaOnClose == "play") {
                            this.onCtaAction(true, false);
                        }
                    }
                }
            } else {
                _jqyCtaBlock.show();
                if (args.ctaOnOpen != null && args.ctaOnOpen == "pause") {
                    this.onCtaAction(false, false);
                } else {
                    if (args.ctaOnOpen != null && args.ctaOnOpen == "play") {
                        this.onCtaAction(true, false);
                    }
                }
            }
        },
        checkIsPlaying: function () {
            return this._videoTag.isPlaying();
        },
        __class__: pingvp_PingVpPlayer,
    });
    var pingvp_PingVpPoster = function (videoOid, overlay, posterImage, posterPlayImage, controlsBelowVideo, theme) {
        var _gthis = this;
        this._controlsBelowVideo = controlsBelowVideo;
        this._tabIndexOverlay = theme.showPlay() ? "" : 'tabindex="0"';
        this._tabIndexButton = theme.showPlay() ? 'tabindex="0"' : "";
        this._mobileCheck = false;
        if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
            this._mobileCheck = true;
        }
        var defaultColor = theme.getByKey("defaultcolor");
        if (this._mobileCheck) {
            defaultColor = theme.getSetDefaultColor();
        }
        var hoverColor = theme.getByKey("hovercolor");
        if (this._mobileCheck) {
            hoverColor = theme.getSetHoverColor();
        }
        overlay.get().append('<div id="pingVpPoster-' + videoOid + '" ' + this._tabIndexOverlay + ' class="pingVpPoster" style="background-image:url(' + posterImage + ');"></div>');
        this._poster = $("#pingVpPoster-" + videoOid);
        if (pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpod()) {
            var orientation = window.orientation;
            if (orientation == 90 || orientation == -90) {
                this._poster.css("backgroundSize", "auto 100%");
            } else {
                this._poster.css("backgroundSize", "100% auto");
            }
        }
        this._posterPlayImage = theme.getIcon(theme.getByKey("svgset"), posterPlayImage + ".svg", defaultColor);
        this._posterPlayImageHover = theme.getIcon(theme.getByKey("svgset"), posterPlayImage + ".svg", hoverColor);
        if (theme.showPlay()) {
            this._poster.html('<img id="pingVpPosterPlayButton-' + videoOid + '" ' + this._tabIndexButton + ' class="pingVpPosterPlayButton" src="' + posterPlayImage + '"/>');
            this._poster.hover(
                function (e) {
                    _gthis._poster.children("img").attr("src", _gthis._posterPlayImageHover);
                },
                function (e1) {
                    _gthis._poster.children("img").attr("src", _gthis._posterPlayImage);
                }
            );
        }
        this._poster.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onClick));
    };
    $hxClasses["pingvp.PingVpPoster"] = pingvp_PingVpPoster;
    pingvp_PingVpPoster.__name__ = ["pingvp", "PingVpPoster"];
    pingvp_PingVpPoster.prototype = {
        onClick: function (e) {
            if (this._call != null) {
                this.removePoster();
                this._call();
            }
        },
        setClickHandler: function (call) {
            this._call = call;
        },
        removePoster: function () {
            this._poster.remove();
        },
        __class__: pingvp_PingVpPoster,
    };
    var pingvp_PingVpPosterRatio = function (node, videoOid, container, overlay, posterImage, posterPlayImage, controlsBelowVideo, controlsBelowHeight, posterWidth, posterHeight, theme) {
        var _gthis = this;
        this._node = node;
        this._videoOid = videoOid;
        this._container = container;
        this._posterWidth = posterWidth;
        this._posterHeight = posterHeight;
        this._controlsBelowHeight = controlsBelowHeight;
        this._controlsBelowVideo = controlsBelowVideo;
        this._mobileCheck = false;
        if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
            this._mobileCheck = true;
        }
        var defaultColor = theme.getByKey("defaultcolor");
        if (this._controlsBelowVideo != true && this._mobileCheck) {
            defaultColor = theme.getSetDefaultColor();
        }
        var hoverColor = theme.getByKey("hovercolor");
        if (this._controlsBelowVideo != true && this._mobileCheck) {
            hoverColor = theme.getSetHoverColor();
        }
        if ($("#pingVpPosterPlayButton-" + videoOid).length != 0) {
            $("#pingVpPosterPlayButton-" + videoOid).remove();
        }
        if ($("#pingVpPoster-" + videoOid).length != 0) {
            $("#pingVpPoster-" + videoOid).remove();
        }
        this._posterPlayImage = theme.getIcon(theme.getByKey("svgset"), posterPlayImage + ".svg", defaultColor);
        this._posterPlayImageHover = theme.getIcon(theme.getByKey("svgset"), posterPlayImage + ".svg", hoverColor);
        this._tabIndexOverlay = theme.showPlay() ? "" : 'tabindex="0"';
        this._tabIndexButton = theme.showPlay() ? 'tabindex="0"' : "";
        overlay.get().append('<div id="pingVpPoster-' + videoOid + '" class="pingVpPoster" ' + this._tabIndexOverlay + ' style="background-image:url(' + posterImage + ');"></div>');
        this._posterDiv = $("#pingVpPoster-" + videoOid);
        if (theme.showPlay()) {
            this._posterDiv.html('<img id="pingVpPosterPlayButton-' + videoOid + '" class="pingVpPosterPlayButton" ' + this._tabIndexButton + ' src="' + this._posterPlayImage + '"/>');
            this._posterDiv.hover(
                function (e) {
                    _gthis._posterDiv.children("img").attr("src", _gthis._posterPlayImageHover);
                },
                function (e1) {
                    _gthis._posterDiv.children("img").attr("src", _gthis._posterPlayImage);
                }
            );
        }
        this._buttonDiv = $("#pingVpPosterPlayButton-" + videoOid);
        $("#pingVpPoster-" + videoOid).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onClick));
        this.resize(this._controlsBelowHeight);
    };
    $hxClasses["pingvp.PingVpPosterRatio"] = pingvp_PingVpPosterRatio;
    pingvp_PingVpPosterRatio.__name__ = ["pingvp", "PingVpPosterRatio"];
    pingvp_PingVpPosterRatio.prototype = {
        onClick: function (e) {
            if (this._call != null) {
                this._call();
            }
            this.removePoster();
        },
        setClickHandler: function (call) {
            this._call = call;
        },
        resize: function (controlsBelowHeight) {
            this._controlsBelowHeight = controlsBelowHeight;
            var containerWidth = this._container.getWidth();
            var containerHeight = this._container.getHeight();
            containerHeight -= this._controlsBelowHeight;
            var containerCenterX = containerWidth / 2;
            var containerCenterY = containerHeight / 2;
            var posterHalfWidth = this._posterWidth / 2;
            var posterHalfHeigth = this._posterHeight / 2;
            var scaleX = containerWidth / this._posterWidth;
            var scaleY = containerHeight / this._posterHeight;
            var scale = scaleX;
            if (scaleX > scaleY) {
                scale = scaleY;
            }
            this._posterDiv.css("left", containerCenterX - posterHalfWidth * scale + "px");
            this._posterDiv.css("top", containerCenterY - posterHalfHeigth * scale + "px");
            this._posterDiv.css("width", this._posterWidth * scale + "px");
            this._posterDiv.css("height", this._posterHeight * scale + "px");
        },
        removePoster: function () {
            this._focus = $(":focus");
            this._pingVpElement = $(".pingVpWebplayerSelector,#pingVpOverlayPlayContainer-" + this._videoOid + ",.PingVP");
            this._posterDiv.remove();
            if ((this._focus.hasClass("pingVpPoster") || this._focus.hasClass("pingVpPosterPlayButton")) && this._pingVpElement.hasClass("pingVpIsTabbing")) {
                this._node.find('[tabindex="0"]:visible, .pingVpControlBar [tabindex="0"]').first().focus();
            }
        },
        __class__: pingvp_PingVpPosterRatio,
    };
    var pingvp_PingVpProgress = function (videoOid, overlay, container, theme, controlsBelowHeight) {
        this._container = container;
        this._loaderIcon = theme.getIcon(theme.getByKey("svgset"), "progress.svg", theme.getByKey("defaultcolor"));
        if ($("#pingVpProgress-" + videoOid).length != 0) {
            $("#pingVpProgress-" + videoOid).remove();
        }
        overlay.get().append('<div id="pingVpProgress-' + videoOid + '" class="pingVpProgress"><img class="pingVpResetSvg pingVpFullSvg" src=' + this._loaderIcon + "></div>");
        this._progress = $("#pingVpProgress-" + videoOid);
        this.resize(controlsBelowHeight);
    };
    $hxClasses["pingvp.PingVpProgress"] = pingvp_PingVpProgress;
    pingvp_PingVpProgress.__name__ = ["pingvp", "PingVpProgress"];
    pingvp_PingVpProgress.prototype = {
        resize: function (controlsBelowHeight) {
            this._progress.css("marginTop", -(controlsBelowHeight / 2 + 50) + "px");
        },
        disable: function () {
            this._progress.css("display", "none");
        },
        enable: function () {
            this._progress.css("display", "block");
        },
        __class__: pingvp_PingVpProgress,
    };
    var pingvp_PingVpSeo = function (seo) {
        this._seo = seo;
    };
    $hxClasses["pingvp.PingVpSeo"] = pingvp_PingVpSeo;
    pingvp_PingVpSeo.__name__ = ["pingvp", "PingVpSeo"];
    pingvp_PingVpSeo.prototype = {
        name: function () {
            return this.getStringField("name");
        },
        description: function () {
            return this.getStringField("description");
        },
        transcript: function () {
            return this.getStringField("transcript");
        },
        keywords: function () {
            return this.getStringField("keywords");
        },
        duration: function () {
            return this.getStringField("duration");
        },
        thumbnailURL: function () {
            return this.getStringField("thumbnailURL");
        },
        contentURL: function () {
            return this.getStringField("contentURL");
        },
        embedURL: function () {
            return this.getStringField("embedURL");
        },
        uploadDate: function () {
            return this.getStringField("uploadDate");
        },
        expires: function () {
            return this.getStringField("expires");
        },
        height: function () {
            return this.getStringField("height");
        },
        width: function () {
            return this.getStringField("width");
        },
        getStringField: function (field) {
            if (this._seo == null) {
                return null;
            }
            var value = Reflect.field(this._seo, field);
            if (value == null) {
                return null;
            }
            return Std.string(value);
        },
        __class__: pingvp_PingVpSeo,
    };
    var pingvp_PingVpSettingsMenu = function (
        videoOid,
        theme,
        text,
        controlsBelow,
        controlBar,
        controlBarOnShow,
        checkHideEnable,
        enableQuality,
        isHq,
        onLqButton,
        onHqButton,
        subs,
        subtitles,
        lastSubtitle,
        enableSpeed,
        speed,
        enableShare,
        messages,
        mobileCheck,
        event
    ) {
        this._videoOid = videoOid;
        this._isSub = false;
        this._setOverlay = $("#pingVpOverlay-" + videoOid);
        this._setButton = $("#pingVpControlSettings-" + videoOid);
        this._container = $("#pingVpOverlayPlayContainer-" + videoOid);
        this._lowQualityCall = onLqButton;
        this._highQualityCall = onHqButton;
        this._controlsBelow = controlsBelow;
        this._controlBarOnShow = controlBarOnShow;
        this._checkHideEnable = checkHideEnable;
        this._controlBar = controlBar;
        this._subtitles = subtitles;
        this._speed = speed;
        this._messages = messages;
        this._menuIsActive = false;
        this._event = event;
        this._mobileCheck = mobileCheck;
        if (enableQuality || (subs != null && subs.length > 0) || enableSpeed || enableShare) {
            this._menuIsActive = true;
            var items = "";
            var itemsSubs = "";
            if (this._mobileCheck) {
                items += '<div id="pingVpSettingsMobileOverlay-' + videoOid + '" class="pingVpSettingsMobileOverlay">';
            }
            items += '<ul id="pingVpSettingsMenu-' + videoOid + '" class="pingVpSettingsMenu">';
            items += '<div class="pingVpSettingsHeadMenu" id="pingVpSettingsHeadMenu-' + videoOid + '">';
            if (this._mobileCheck) {
                this._closeModalIcon = theme.getIcon(theme.getByKey("svgset"), "cross.svg", "fff");
                items += '<div tabindex="0" id="pingVpSettingsModalCloseHead-' + videoOid + '" class="pingVpSettingsModalClose"><img class="pingVpReset pingVpCloseModalSvg" src="' + this._closeModalIcon + '"/></div>';
            }
            items += '<li class="pingVpSettingsMenuTitle pingVpSettingsMenuTitle-' + videoOid + '">' + text.get("settingsMenuTitle") + "</li><hr>";
            if (enableQuality) {
                this._isHq = isHq;
                var displayQuality = isHq ? "(" + text.get("settingsQualityHD") + ")" : "(" + text.get("settingsQualitySD") + ")";
                items +=
                    '<li class="pingVpSettingsMenuItem" id="pingVpSettingsMenuItemQuality-' +
                    videoOid +
                    '" tabindex="-1">' +
                    text.get("settingsHeadQuality") +
                    ' <span class="pingVpSettingsDisplayQuality">' +
                    displayQuality +
                    "</span></li>";
                itemsSubs += '<div class="pingVpSettingsSubMenu" id="pingVpSettingsSubMenuQuality-' + videoOid + '">';
                if (this._mobileCheck) {
                    itemsSubs += '<div tabindex="0" id="pingVpSettingsModalCloseQuality-' + videoOid + '" class="pingVpSettingsModalClose"><img class="pingVpReset pingVpCloseModalSvg" src="' + this._closeModalIcon + '"/></div>';
                }
                itemsSubs +=
                    '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuReturn-' +
                    videoOid +
                    '" tabindex="-1">' +
                    text.get("settingsQualityTitle") +
                    '</li><hr><li class="pingVpSettingsMenuItem pingVpSettingsSubMenuQualityItem-' +
                    this._videoOid +
                    '" tabindex="-1" data-quality="Hq">' +
                    text.get("settingsQualityHDFull") +
                    '</li><li class="pingVpSettingsMenuItem pingVpSettingsSubMenuQualityItem-' +
                    this._videoOid +
                    '" tabindex="-1" data-quality="Lq">' +
                    text.get("settingsQualitySDFull") +
                    "</li></div>";
            }
            var subi = 0;
            this._selectedSubs = -1;
            if (subs != null && subs.length > 0) {
                items += '<li class="pingVpSettingsMenuItem" id="pingVpSettingsMenuItemSubs-' + videoOid + '" tabindex="-1">' + text.get("settingsHeadSubs") + ' <span class="pingVpSettingsDisplaySubs"></span></li>';
                itemsSubs += '<div class="pingVpSettingsSubMenu" id="pingVpSettingsSubMenuSubs-' + videoOid + '">';
                if (this._mobileCheck) {
                    itemsSubs += '<div tabindex="0" id="pingVpSettingsModalCloseSubtitles-' + videoOid + '" class="pingVpSettingsModalClose"><img class="pingVpReset pingVpCloseModalSvg" src="' + this._closeModalIcon + '"/></div>';
                }
                itemsSubs += '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuReturn-' + videoOid + '" tabindex="-1">' + text.get("settingsSubtitlesTitle") + "</li><hr>";
                var _g = 0;
                while (_g < subs.length) {
                    var sub = subs[_g];
                    ++_g;
                    ++subi;
                    itemsSubs +=
                        '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuSubsItem-' +
                        this._videoOid +
                        '" tabindex="-1" id="pingVpSettingsSubMenuSubsItem-' +
                        videoOid +
                        "-" +
                        subi +
                        '">' +
                        StringTools.htmlEscape(sub.name(), false) +
                        "</li>";
                }
                itemsSubs += '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuSubsItem-' + this._videoOid + '" tabindex="-1" id="pingVpSettingsSubMenuSubsItem-' + videoOid + "-" + 0 + '">' + text.get("subtitlesNone") + "</li>";
                itemsSubs += "</div>";
            }
            var speedi = 0;
            this._selectedSpeed = -1;
            if (enableSpeed) {
                items += '<li class="pingVpSettingsMenuItem" id="pingVpSettingsMenuItemSpeed-' + videoOid + '" tabindex="-1">' + text.get("settingsHeadSpeed") + ' <span class="pingVpSettingsDisplaySpeed"></span></li>';
                itemsSubs += '<div class="pingVpSettingsSubMenu" id="pingVpSettingsSubMenuSpeed-' + videoOid + '">';
                if (this._mobileCheck) {
                    itemsSubs += '<div tabindex="0" id="pingVpSettingsModalCloseSpeed-' + videoOid + '" class="pingVpSettingsModalClose"><img class="pingVpReset pingVpCloseModalSvg" src="' + this._closeModalIcon + '"/></div>';
                }
                itemsSubs += '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuReturn-' + videoOid + '" tabindex="-1">' + text.get("settingsSpeedTitle") + "</li><hr>";
                ++speedi;
                itemsSubs += '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuSpeedItem-' + this._videoOid + '" tabindex="-1" id="pingVpSpeedMenuItem-' + videoOid + "-" + speedi + '">x0.5</li>';
                itemsSubs += '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuSpeedItem-' + this._videoOid + '" tabindex="-1" id="pingVpSpeedMenuItem-' + videoOid + "-" + 0 + '">x1</li>';
                ++speedi;
                itemsSubs += '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuSpeedItem-' + this._videoOid + '" tabindex="-1" id="pingVpSpeedMenuItem-' + videoOid + "-" + speedi + '">x1.5</li>';
                ++speedi;
                itemsSubs += '<li class="pingVpSettingsMenuItem pingVpSettingsSubMenuSpeedItem-' + this._videoOid + '" tabindex="-1" id="pingVpSpeedMenuItem-' + videoOid + "-" + speedi + '">x2</li>';
                itemsSubs += "</div>";
            }
            if (enableShare) {
                items += '<li class="pingVpSettingsMenuItem" id="pingVpSettingsMenuItemShare-' + videoOid + '" tabindex="-1">' + text.get("settingsHeadShare") + "</li>";
            }
            items += "</div>";
            items += itemsSubs;
            items += "</ul>";
            if (this._mobileCheck) {
                items += "</div>";
            }
            this._setOverlay.append(items);
            this._setMenu = $("#pingVpSettingsMenu-" + videoOid);
            this._setHeadMenu = $("#pingVpSettingsHeadMenu-" + videoOid);
            this._setMenu.css("background-color", "#" + theme.getByKey("menubackcolor")).css("color", "#" + theme.getByKey("menucolor"));
            this._setMenu.css("text-shadow", "0 0 2px #" + theme.getByKey("menubackcolor"));
            $("body").on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.checkFocus));
            if (this._mobileCheck) {
                this._setSettingsOverlay = $("#pingVpSettingsMobileOverlay-" + videoOid);
                this._closeModal = $("#pingVpSettingsModalCloseHead-" + this._videoOid);
                this._closeModal.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.hide));
                this._closeModal = $("#pingVpSettingsModalCloseQuality-" + this._videoOid);
                this._closeModal.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.hide));
                this._closeModal = $("#pingVpSettingsModalCloseSubtitles-" + this._videoOid);
                this._closeModal.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.hide));
                this._closeModal = $("#pingVpSettingsModalCloseSpeed-" + this._videoOid);
                this._closeModal.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.hide));
            }
            $(".pingVpSettingsSubMenuReturn-" + videoOid).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.closeSub));
            if (enableQuality) {
                this.setQualitySelected();
                var f = $bind(this, this.openSub);
                $("#pingVpSettingsMenuItemQuality-" + videoOid).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, function (e) {
                    f("quality", e);
                });
                $(".pingVpSettingsSubMenuQualityItem-" + videoOid).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.setQuality));
            }
            if (subs != null && subs.length > 0) {
                this.setSubsSelected(lastSubtitle);
                var f1 = $bind(this, this.openSub);
                $("#pingVpSettingsMenuItemSubs-" + videoOid).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, function (e1) {
                    f1("subs", e1);
                });
                while (true) {
                    $("#pingVpSettingsSubMenuSubsItem-" + this._videoOid + "-" + subi).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, subi, $bind(this, this.setSubs));
                    if (!(subi-- > 0)) {
                        break;
                    }
                }
            }
            if (enableSpeed) {
                this.setSpeedSelected(this._selectedSpeed);
                var f2 = $bind(this, this.openSub);
                $("#pingVpSettingsMenuItemSpeed-" + videoOid).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, function (e2) {
                    f2("speed", e2);
                });
                while (true) {
                    $("#pingVpSpeedMenuItem-" + this._videoOid + "-" + speedi).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, speedi, $bind(this, this.setSpeed));
                    if (!(speedi-- > 0)) {
                        break;
                    }
                }
            }
            if (enableShare) {
                $("#pingVpSettingsMenuItemShare-" + videoOid).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onShareMenuClick));
            }
            if (!this._mobileCheck) {
                var locationBottom = controlsBelow ? 57 : 69;
                this._setMenu.css("bottom", locationBottom + "px");
                if (controlsBelow) {
                    this._setMenu.css("right", "7px");
                }
                this.hide();
            }
        }
    };
    $hxClasses["pingvp.PingVpSettingsMenu"] = pingvp_PingVpSettingsMenu;
    pingvp_PingVpSettingsMenu.__name__ = ["pingvp", "PingVpSettingsMenu"];
    pingvp_PingVpSettingsMenu.prototype = {
        setButtonHandler: function (call) {
            this._buttonCall = call;
        },
        getActive: function () {
            return this._menuIsActive;
        },
        show: function () {
            this._isOn = true;
            this._controlBarOnShow(false);
            this._checkHideEnable(false);
            var _currentSubMenu = this.getJQuerySub();
            _currentSubMenu.stop().hide();
            if (this._isSub) {
                this._isSub = false;
                this._currentSub = "";
            }
            if (this._mobileCheck) {
                this._setSettingsOverlay.stop().css("display", "flex");
            } else {
                this._setMenu.stop().removeClass("pingVpShowCode").show();
                this.setHeight();
            }
            this._focus = $(":focus");
            if (this._focus.hasClass("pingVpControlSettings")) {
                this.setHtmlFocus("head");
            }
        },
        hide: function () {
            this._isOn = false;
            this._focus = $(":focus");
            if (this._mobileCheck) {
                this._setSettingsOverlay.stop().hide();
            } else {
                this._setMenu.stop().hide();
            }
            if (this._focus.parents(".pingVpSettingsMenu").length != 0) {
                this.resetHtmlFocus();
                this._setButton.focus();
            }
            this._controlBarOnShow(true);
            this._checkHideEnable(true);
            if (this._isSub) {
                var _currentSubMenu = this.getJQuerySub();
                var _currentHeadMenu = this.getJQueryHead();
                this._isSub = false;
                this._currentSub = "";
                if (this._mobileCheck) {
                    _currentSubMenu.stop().hide();
                    this._setHeadMenu.stop().show();
                } else {
                    this._setMenu.stop().removeClass("pingVpShowCode");
                    _currentSubMenu.stop().hide();
                }
            }
            if (this._buttonCall != null) {
                this._buttonCall(false);
            }
        },
        checkClose: function (e) {
            this._focus = $(":focus");
            if (this._isOn && e.which == 27 && (this._container.hasClass("pingVpActive-" + this._videoOid) || this._focus.parents(".pingVpSettingsMenu").length != 0)) {
                e.preventDefault();
                this.hide();
            }
        },
        checkFocus: function (e) {
            if ($(e.target).closest("#pingVpSettingsMenu-" + this._videoOid).length == 0 && this._isOn && $(e.target).closest("#pingVpControlSettings-" + this._videoOid).length == 0) {
                this.hide();
            }
        },
        openSub: function (type, e) {
            var _gthis = this;
            e.stopPropagation();
            if (!this._isSub) {
                this._isSub = true;
                this._currentSub = type;
                if (type == "quality" || type == "subs" || type == "speed" || type == "share") {
                    var _currentSubMenu = this.getJQuerySub();
                    if (this._mobileCheck) {
                        this._setHeadMenu.stop().hide();
                        _currentSubMenu.stop().show();
                        this._focus = $(":focus");
                        if (this._focus.parents(".pingVpSettingsMenu").length != 0) {
                            this.setHtmlFocus("sub");
                        }
                    } else {
                        _currentSubMenu.stop().show(0, null, function () {
                            _gthis._setMenu
                                .stop()
                                .addClass("pingVpShowCode")
                                .animate({ height: _currentSubMenu.outerHeight() }, 200, null, function () {
                                    _gthis._focus = $(":focus");
                                    if (_gthis._focus.parents(".pingVpSettingsMenu").length != 0) {
                                        _gthis.setHtmlFocus("sub");
                                    }
                                });
                        });
                    }
                } else {
                    this._isSub = false;
                    this._currentSub = "";
                }
            }
        },
        closeSub: function (e) {
            var _gthis = this;
            e.stopPropagation();
            var _currentSubMenu = this.getJQuerySub();
            var _currentHeadMenu = this.getJQueryHead();
            this._isSub = false;
            this._focus = $(":focus");
            if (this._mobileCheck) {
                _currentSubMenu.stop().hide();
                this._setHeadMenu.stop().show();
                this._currentSub = "";
                if (this._focus.parents(".pingVpSettingsMenu").length != 0) {
                    this.setHtmlFocus("head");
                }
            } else {
                this._setMenu
                    .stop()
                    .removeClass("pingVpShowCode")
                    .animate({ height: _currentHeadMenu.outerHeight() }, 200, null, function () {
                        _currentSubMenu.stop().hide();
                        _gthis._currentSub = "";
                        if (_gthis._focus.parents(".pingVpSettingsMenu").length != 0) {
                            _gthis.setHtmlFocus("head");
                        }
                    });
            }
        },
        closeSubManually: function () {
            var _gthis = this;
            var _currentSubMenu = this.getJQuerySub();
            var _currentHeadMenu = this.getJQueryHead();
            this._isSub = false;
            this._focus = $(":focus");
            if (this._mobileCheck) {
                _currentSubMenu.stop().hide();
                this._setHeadMenu.stop().show();
                this._currentSub = "";
                if (this._focus.parents(".pingVpSettingsMenu").length != 0) {
                    this.setHtmlFocus("head");
                }
            } else {
                this._setMenu
                    .stop()
                    .removeClass("pingVpShowCode")
                    .animate({ height: _currentHeadMenu.outerHeight() }, 200, null, function () {
                        _currentSubMenu.stop().hide();
                        _gthis._currentSub = "";
                        if (_gthis._focus.parents(".pingVpSettingsMenu").length != 0) {
                            _gthis.setHtmlFocus("head");
                        }
                    });
            }
        },
        isShown: function () {
            return this._isOn;
        },
        isSub: function () {
            return this._isSub;
        },
        getJQueryHead: function () {
            return $("#pingVpSettingsHeadMenu-" + this._videoOid);
        },
        getJQuerySub: function () {
            if (this._currentSub == "quality") {
                return $("#pingVpSettingsSubMenuQuality-" + this._videoOid);
            } else {
                if (this._currentSub == "subs") {
                    return $("#pingVpSettingsSubMenuSubs-" + this._videoOid);
                } else {
                    if (this._currentSub == "speed") {
                        return $("#pingVpSettingsSubMenuSpeed-" + this._videoOid);
                    } else {
                        return $("#pingVpSettingsSubMenuShare-" + this._videoOid);
                    }
                }
            }
        },
        setHeight: function () {
            if (this.isSub()) {
                var _currentSubMenu = this.getJQuerySub();
                var newHeight = _currentSubMenu.outerHeight();
                this._setMenu.css("height", newHeight + "px");
            } else {
                var newHeight1 = $("#pingVpSettingsHeadMenu-" + this._videoOid).outerHeight();
                this._setMenu.css("height", newHeight1 + "px");
            }
        },
        setHtmlFocus: function (element) {
            this._setMenu.find('[tabindex="0"]').attr("tabindex", "-1");
            var allowFocus = element == "head" ? this.getJQueryHead() : this.getJQuerySub();
            allowFocus.find('[tabindex="-1"]').attr("tabindex", "0");
            allowFocus.find('[tabindex="0"]').first().focus();
        },
        resetHtmlFocus: function () {
            this._setMenu.find('[tabindex="0"]').attr("tabindex", "-1");
        },
        checkDownAndUpKeys: function (e) {
            this._focus = $(":focus");
            if (e.which == 38 && this._focus.parents(".pingVpSettingsMenu").length != 0) {
                e.preventDefault();
                this._focus.prevAll('.pingVpSettingsMenuItem[tabindex="0"]').first().focus();
            }
            if (e.which == 40 && this._focus.parents(".pingVpSettingsMenu").length != 0) {
                e.preventDefault();
                this._focus.nextAll('.pingVpSettingsMenuItem[tabindex="0"]').first().focus();
            }
        },
        setQualitySelected: function () {
            $(".pingVpSettingsSubMenuQualityItem-" + this._videoOid + ".pingVpSettingsSelected").removeClass("pingVpSettingsSelected");
            var dataQualitySelected = this._isHq ? "Hq" : "Lq";
            $(".pingVpSettingsSubMenuQualityItem-" + this._videoOid + '[data-quality="' + dataQualitySelected + '"]').addClass("pingVpSettingsSelected");
        },
        setQuality: function (e) {
            var selectedQuality = $(e.target).attr("data-quality");
            if (selectedQuality == "Hq" && !this._isHq) {
                this._isHq = true;
                this._highQualityCall();
                this.hide();
                this.setQualitySelected();
            } else {
                if (selectedQuality == "Lq" && this._isHq) {
                    this._isHq = false;
                    this._lowQualityCall();
                    this.hide();
                    this.setQualitySelected();
                } else {
                    this.hide();
                }
            }
        },
        setSubsSelected: function (selected) {
            if (selected == -1) {
                selected = this._subtitles.getDefault();
            }
            if (this._selectedSubs != selected) {
                this._subtitles.onSubSelect(selected);
                this._selectedSubs = selected;
                if (this._subtitlesMenuCurrentSubsCall != null) {
                    this._subtitlesMenuCurrentSubsCall(selected);
                }
                if (this._selectedSubs == 0) {
                    $("#pingVpSettingsMenuItemSubs-" + this._videoOid + " .pingVpSettingsDisplaySubs").text("");
                } else {
                    var sub = this._subtitles.getSelectedSub();
                    var textSub = Std.string(sub.name());
                    $("#pingVpSettingsMenuItemSubs-" + this._videoOid + " .pingVpSettingsDisplaySubs").text("(" + HxOverrides.substr(textSub, 0, 3) + ")");
                }
                $(".pingVpSettingsSubMenuSubsItem-" + this._videoOid + ".pingVpSettingsSelected").removeClass("pingVpSettingsSelected");
                $("#pingVpSettingsSubMenuSubsItem-" + this._videoOid + "-" + selected).addClass("pingVpSettingsSelected");
            }
        },
        setSubs: function (e) {
            var currentSelectedSubs = this._selectedSubs;
            this.closeSubManually();
            this.setSubsSelected(e.data);
            if (currentSelectedSubs != this._selectedSubs) {
                if (this._selectedSubs == 0) {
                    this._event("Subtitle turned off");
                } else {
                    var sub = this._subtitles.getSelectedSub();
                    this._event('Subtitle selected "' + sub.name() + '"');
                }
            }
        },
        setSubtitlesMenuSubsHandler: function (call) {
            this._subtitlesMenuCurrentSubsCall = call;
        },
        setSubtitlesMenuHandler: function (call) {
            this._subtitlesMenuCall = call;
        },
        setSpeedSelected: function (selected) {
            if (selected == -1) {
                selected = this._speed.getDefault();
            }
            if (this._selectedSpeed != selected) {
                this._speed.onSubSelect(selected);
                var updateActiveText = this._speed.getSelectedText();
                $("#pingVpSettingsMenuItemSpeed-" + this._videoOid + " .pingVpSettingsDisplaySpeed").text("(" + updateActiveText + ")");
                $(".pingVpSettingsSubMenuSpeedItem-" + this._videoOid + ".pingVpSettingsSelected").removeClass("pingVpSettingsSelected");
                $("#pingVpSpeedMenuItem-" + this._videoOid + "-" + selected).addClass("pingVpSettingsSelected");
                this._selectedSpeed = selected;
            }
        },
        setSpeed: function (e) {
            this.closeSubManually();
            var currentSelectedSpeed = this._selectedSpeed;
            this.setSpeedSelected(e.data);
            if (currentSelectedSpeed != this._selectedSpeed) {
                this._event('Speed changed "' + this._speed.getSelectedText() + '"');
            }
        },
        onShareMenuClick: function () {
            if (this._shareMenuClickCall != null) {
                this._shareMenuClickCall();
                this._pauseVideoClickCall();
                this.hide();
            }
        },
        onCopy: function () {
            this._event("Share - Copy url");
            var urlToCopy = this._share;
            function fallbackCopyTextToClipboard(o) {
                var e = document.createElement("textarea");
                (e.value = o), document.body.appendChild(e), e.focus(), e.select();
                document.execCommand("copy");
                document.body.removeChild(e);
            }
            function copyTextToClipboard(o) {
                navigator.clipboard ? navigator.clipboard.writeText(o) : fallbackCopyTextToClipboard(o);
            }
            copyTextToClipboard(urlToCopy);
            this._messages.showMessage("ItemCopiedSucces", 600);
        },
        onShareFacebook: function (e) {
            this._event("Share - Facebook");
            var s = this._share;
            var url = "https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(s);
            window.open(url, "newwindow");
        },
        onShareTwitter: function (e) {
            this._event("Share - Twitter");
            var s = this._share;
            var url = "https://www.twitter.com/share?url=" + encodeURIComponent(s);
            window.open(url, "newwindow");
        },
        setShareMenuHandler: function (shareCall, pauseCall) {
            this._shareMenuClickCall = shareCall;
            this._pauseVideoClickCall = pauseCall;
        },
        __class__: pingvp_PingVpSettingsMenu,
    };
    var pingvp_PingVpSettingsMenuOverlay = function (
        videoOid,
        videoName,
        overlay,
        container,
        theme,
        text,
        controlsBelow,
        controlBar,
        controlBarOnShow,
        checkHideEnable,
        setSettingsButton,
        enableQuality,
        isHq,
        onLqButton,
        onHqButton,
        subs,
        subtitles,
        lastSubtitle,
        enableSpeed,
        speed,
        enableShare,
        messages,
        event
    ) {
        this._container = container;
        this._videoOid = videoOid;
        this._videoName = videoName;
        this._controlBar = controlBar;
        this._mobileCheck = false;
        this._settings = null;
        if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
            this._mobileCheck = true;
        }
        this._settingsMenu = new pingvp_PingVpSettingsMenu(
            videoOid,
            theme,
            text,
            controlsBelow,
            controlBar,
            controlBarOnShow,
            checkHideEnable,
            enableQuality,
            isHq,
            onLqButton,
            onHqButton,
            subs,
            subtitles,
            lastSubtitle,
            enableSpeed,
            speed,
            enableShare,
            messages,
            this._mobileCheck,
            event
        );
        this._settingsMenu.setButtonHandler(setSettingsButton);
        if (this._mobileCheck) {
            this._settings = $("#pingVpSettingsMobileOverlay-" + videoOid);
        } else {
            this._settings = $("#pingVpSettingsMenu-" + videoOid);
        }
        if (this._settingsMenu.getActive()) {
            this.resize();
        }
    };
    $hxClasses["pingvp.PingVpSettingsMenuOverlay"] = pingvp_PingVpSettingsMenuOverlay;
    pingvp_PingVpSettingsMenuOverlay.__name__ = ["pingvp", "PingVpSettingsMenuOverlay"];
    pingvp_PingVpSettingsMenuOverlay.prototype = {
        showSettingsMenu: function () {
            if (this._settingsMenu.isShown()) {
                this._settingsMenu.hide();
            } else {
                this._settingsMenu.show();
            }
        },
        resize: function () {
            this._overlay = $("#pingVpOverlay-" + this._videoOid);
            var definer = 960;
            var definerW = 640;
            var currentWidth = this._overlay.outerWidth();
            var percent = 100;
            var percentW = 0.25;
            if (currentWidth > definer) {
                percent -= (definer - currentWidth) / 32;
            } else {
                if (currentWidth < definer) {
                    percent += (currentWidth - definer) / 32;
                }
            }
            this._settings.css("font-size", percent + "%");
            if (this._mobileCheck) {
                var width = this._container.getWidth();
                var height = this._container.getHeight();
                this._settings.css("width", width);
                this._settings.css("height", height);
            } else {
                if (currentWidth > definerW) {
                    percentW -= (currentWidth - definerW) / 220 / 100;
                }
                percentW = currentWidth * percentW;
                this._settings.css("min-width", percentW + "px");
                this._settingsMenu.setHeight();
            }
        },
        checkSettingsMenu: function () {
            return this._settingsMenu.isShown();
        },
        checkMenuActive: function () {
            return this._settingsMenu.getActive();
        },
        checkUpAndDownKeys: function (e) {
            this._settingsMenu.checkDownAndUpKeys(e);
        },
        checkCloseKeys: function (e) {
            this._settingsMenu.checkClose(e);
        },
        setSubsMenuSelected: function (selected) {
            this._settingsMenu.setSubsSelected(selected);
        },
        setSubtitlesMenuHandler: function (call) {
            this._settingsMenu.setSubtitlesMenuHandler(call);
        },
        setSubtitlesMenuSubsHandler: function (call) {
            this._settingsMenu.setSubtitlesMenuSubsHandler(call);
        },
        setShareMenuHandler: function (shareCall, pauseCall) {
            this._settingsMenu.setShareMenuHandler(shareCall, pauseCall);
        },
        __class__: pingvp_PingVpSettingsMenuOverlay,
    };
    var pingvp_PingVpShareOverlay = function (videoOid, theme, text, container, hoverFix, enableShare, controlBarOnShow, videoTitle, postersUri, event) {
        this._videoOid = videoOid;
        this._container = container;
        this._theme = theme;
        this._enableShare = enableShare;
        this._controlBarOnShow = controlBarOnShow;
        this._videoTitle = videoTitle;
        this._postersUri = postersUri;
        this._text = text;
        this._event = event;
        this._overlayIsActive = false;
        this._isOn = false;
        if (this._enableShare) {
            this._share = window.location.href;
            this._isMobile = false;
            if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
                this._isMobile = true;
            }
            var mobileModalClass = "";
            var mobileOverlayClass = "";
            if (this._isMobile) {
                mobileModalClass = "pingVpShareModalMobile";
                mobileOverlayClass = "pingVpShareOverlayMobile";
            }
            this._overlayIsActive = true;
            this._overlay = $("#pingVpOverlay-" + this._videoOid);
            this._overlay.append('<div id="pingVpShareOverlay-' + videoOid + '" class="pingVpShareOverlay ' + mobileOverlayClass + '"><div id="pingVpShareModal-' + videoOid + '" class="pingVpShareModal ' + mobileModalClass + '"></div>');
            this._shareOverlay = $("#pingVpShareOverlay-" + this._videoOid);
            this._shareModal = $("#pingVpShareModal-" + this._videoOid);
            this._shareModal.append('<span class="pingVpReset pingVpShareModalTitle">' + text.get("shareModalTitle") + "</span>");
            this._shareModal.append('<div id="pingVpShareModalWrapper-' + videoOid + '" class="pingVpShareModalWrapper"><div id="pingVpShareModalIcons-' + videoOid + '" class="pingVpShareModalIcons"></div></div>');
            this._iconsRowScroller = $("#pingVpShareModalWrapper-" + videoOid);
            this._iconsWrapper = $("#pingVpShareModalIcons-" + videoOid);
            this._iconLinkedIn = theme.getIcon(theme.getByKey("svgset"), "linkedin.svg", "");
            this._iconsWrapper.append(
                '<div tabindex="0" id="pingVpShareLinkedIn-' +
                    videoOid +
                    '" class="pingVpShareModalIcon"><img class="pingVpReset pingVpShareModalIconSvg" src="' +
                    this._iconLinkedIn +
                    '"/><span class="pingVpReset pingVpShareModalIconText">LinkedIn</span></div>'
            );
            this._shareLinkedIn = $("#pingVpShareLinkedIn-" + videoOid);
            this._iconTwitter = theme.getIcon(theme.getByKey("svgset"), "twitter.svg", "");
            this._iconsWrapper.append(
                '<div tabindex="0" id="pingVpShareTwitter-' +
                    videoOid +
                    '" class="pingVpShareModalIcon"><img class="pingVpReset pingVpShareModalIconSvg" src="' +
                    this._iconTwitter +
                    '"/><span class="pingVpReset pingVpShareModalIconText">Twitter</span></div>'
            );
            this._shareTwitter = $("#pingVpShareTwitter-" + videoOid);
            this._iconFacebook = theme.getIcon(theme.getByKey("svgset"), "facebook.svg", "");
            this._iconsWrapper.append(
                '<div tabindex="0" id="pingVpShareFacebook-' +
                    videoOid +
                    '" class="pingVpShareModalIcon"><img class="pingVpReset pingVpShareModalIconSvg" src="' +
                    this._iconFacebook +
                    '"/><span class="pingVpReset pingVpShareModalIconText">Facebook</span></div>'
            );
            this._shareFacebook = $("#pingVpShareFacebook-" + videoOid);
            this._iconPinterest = theme.getIcon(theme.getByKey("svgset"), "pinterest.svg", "");
            this._iconsWrapper.append(
                '<div tabindex="0" id="pingVpSharePinterest-' +
                    videoOid +
                    '" class="pingVpShareModalIcon"><img class="pingVpReset pingVpShareModalIconSvg" src="' +
                    this._iconPinterest +
                    '"/><span class="pingVpReset pingVpShareModalIconText">Pinterest</span></div>'
            );
            this._sharePinterest = $("#pingVpSharePinterest-" + videoOid);
            this._iconEmail = theme.getIcon(theme.getByKey("svgset"), "email.svg", "");
            this._iconsWrapper.append(
                '<div tabindex="0" id="pingVpShareEmail-' +
                    videoOid +
                    '" class="pingVpShareModalIcon"><img class="pingVpReset pingVpShareModalIconSvg" src="' +
                    this._iconEmail +
                    '"/><span class="pingVpReset pingVpShareModalIconText">Email</span></div>'
            );
            this._shareEmail = $("#pingVpShareEmail-" + videoOid);
            if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
                this._iconArrowLeft = theme.getIcon(theme.getByKey("svgset"), "arrow_left.svg", "fff");
                this._iconsRowScroller.append('<div id="pingVpShareIconsArrowLeft-' + videoOid + '" class="pingVpShareIconsArrowLeft"><img class="pingVpReset pingVpShareModalArrowIconSvg" src="' + this._iconArrowLeft + '"/></div>');
                this._iconLeftArrow = $("#pingVpShareIconsArrowLeft-" + videoOid);
                this._iconArrowRight = theme.getIcon(theme.getByKey("svgset"), "arrow_right.svg", "fff");
                this._iconsRowScroller.append('<div id="pingVpShareIconsArrowRight-' + videoOid + '" class="pingVpShareIconsArrowRight"><img class="pingVpReset pingVpShareModalArrowIconSvg" src="' + this._iconArrowRight + '"/></div>');
                this._iconRightArrow = $("#pingVpShareIconsArrowRight-" + videoOid);
            }
            this._shareModal.append('<div id="pingVpShareCopyWrapper-' + videoOid + '" class="pingVpShareCopyWrapper"></div>');
            this._copyWrapper = $("#pingVpShareCopyWrapper-" + videoOid);
            if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
                this._copyWrapper.append('<div id="pingVpShareCopyInputGroup-' + videoOid + '" class="pingVpShareCopyInputGroup"></div>');
                this._copyMobileInputGroup = $("#pingVpShareCopyInputGroup-" + videoOid);
                this._copyMobileInputGroup.append('<input tabindex="0" id="pingVpShareCopyMobileInput-' + videoOid + '" class="pingVpShareCopyMobileInput" value="' + this._share + '"/>');
                this._shareUrlInput = $("#pingVpShareCopyMobileInput-" + videoOid);
                this._iconCopyMobile = theme.getIcon(theme.getByKey("svgset"), "copy.svg", "fff");
                this._copyMobileInputGroup.append(
                    '<button tabindex="0" id="pingVpShareCopyMobileButton-' + videoOid + '" class="pingVpShareCopyMobileButton"><img class="pingVpReset pingVpShareModalArrowIconSvg" src="' + this._iconCopyMobile + '"/></button>'
                );
                this._shareUrlButton = $("#pingVpShareCopyMobileButton-" + videoOid);
            } else {
                this._copyWrapper.append('<input tabindex="0" id="pingVpShareCopyInput-' + videoOid + '" class="pingVpShareCopyInput" value="' + this._share + '"/>');
                this._shareUrlInput = $("#pingVpShareCopyInput-" + videoOid);
                this._copyWrapper.append('<button tabindex="0" id="pingVpShareCopyButton-' + videoOid + '" class="pingVpShareCopyButton">' + text.get("shareCopyButton") + "</button>");
                this._shareUrlButton = $("#pingVpShareCopyButton-" + videoOid);
            }
            this._closeModalIcon = theme.getIcon(theme.getByKey("svgset"), "cross.svg", "fff");
            this._shareModal.append('<div tabindex="0" id="pingVpShareModalClose-' + videoOid + '" class="pingVpShareModalClose"><img class="pingVpReset pingVpCloseModalSvg" src="' + this._closeModalIcon + '"/></div>');
            this._setButton = $("#pingVpControlShare-" + videoOid);
            this._containerJquery = $("#pingVpOverlayPlayContainer-" + videoOid);
            this._closeModal = $("#pingVpShareModalClose-" + this._videoOid);
            this._closeModal.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.hideShareOverlay));
            this._subtitlesWrapper = $("#pingVpSubtitles-" + this._videoOid);
            this._timeSlider = $("#pingVpTimeSlider-" + this._videoOid);
            this._shareOverlay.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onOverlayClick));
            this._shareLinkedIn.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onShareLinkedIn));
            this._shareTwitter.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onShareTwitter));
            this._shareFacebook.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onShareFacebook));
            this._sharePinterest.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onSharePinterest));
            this._shareEmail.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onShareEmail));
            if (this._iconLeftArrow != null) {
                this._iconLeftArrow.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onLeftArrow));
            }
            if (this._iconRightArrow != null) {
                this._iconRightArrow.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onRightArrow));
            }
            this._shareUrlButton.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.onCopy));
            this.resize(hoverFix);
        }
    };
    $hxClasses["pingvp.PingVpShareOverlay"] = pingvp_PingVpShareOverlay;
    pingvp_PingVpShareOverlay.__name__ = ["pingvp", "PingVpShareOverlay"];
    pingvp_PingVpShareOverlay.prototype = {
        showShareOverlay: function () {
            if (this.isShown()) {
                this._controlBarOnShow(true);
                if (!this._isMobile) {
                    this._subtitlesWrapper.show();
                    this._timeSlider.show();
                }
                this._shareOverlay.hide();
                this.resetHtmlFocus();
                this._isOn = false;
            } else {
                this._controlBarOnShow(false);
                if (!this._isMobile) {
                    this._subtitlesWrapper.hide();
                    this._timeSlider.hide();
                }
                this._shareOverlay.css("display", "flex");
                this.setHtmlFocus();
                this._isOn = true;
            }
        },
        hideShareOverlay: function () {
            if (this.isShown()) {
                this._isOn = false;
                if (!this._isMobile) {
                    this._subtitlesWrapper.show();
                    this._timeSlider.show();
                }
                this._shareOverlay.hide();
                this._focus = $(":focus");
                if (this._focus.parents(".pingVpShareOverlay").length != 0) {
                    this._setButton.focus();
                }
                this.resetHtmlFocus();
                this._controlBarOnShow(true);
            }
        },
        manualShowShareOverlay: function () {
            if (!this.isShown()) {
                this._isOn = true;
                if (!this._isMobile) {
                    this._subtitlesWrapper.hide();
                    this._timeSlider.hide();
                }
                this._shareOverlay.css("display", "flex");
                this.setHtmlFocus();
                this._controlBarOnShow(false);
            }
        },
        setHtmlFocus: function () {
            this._shareModal.find('[tabindex="-1"]').attr("tabindex", "0");
            this._shareModal.find('[tabindex="0"]').first().focus();
        },
        resetHtmlFocus: function () {
            this._shareModal.find('[tabindex="0"]').attr("tabindex", "-1");
        },
        checkCloseKeys: function (e) {
            this._focus = $(":focus");
            if (this._isOn && e.which == 27 && (this._containerJquery.hasClass("pingVpActive-" + this._videoOid) || this._focus.parents(".pingVpShareOverlay").length != 0)) {
                e.preventDefault();
                this.hideShareOverlay();
            }
        },
        checkUpAndDownKeys: function (e) {},
        resize: function (hoverFix) {
            this._overlay = $("#pingVpOverlay-" + this._videoOid);
            var definer = 960;
            var definerW = 640;
            var currentWidth = this._overlay.outerWidth();
            var percent = 100;
            var percentW = 0.25;
            if (currentWidth > definer) {
                percent -= (definer - currentWidth) / 32;
            } else {
                if (currentWidth < definer) {
                    percent += (currentWidth - definer) / 32;
                }
            }
            this._shareOverlay.css("font-size", percent + "%");
            var width = this._container.getWidth();
            var height = this._container.getHeight();
            this._shareOverlay.css("width", width);
            this._shareOverlay.css("height", height - hoverFix);
        },
        checkMenuActive: function () {
            return this._overlayIsActive;
        },
        isShown: function () {
            return this._isOn;
        },
        onOverlayClick: function (e) {
            var _currentClicked = $(e.target);
            if (_currentClicked.parents(".pingVpShareModal").length == 0 && _currentClicked.hasClass("pingVpShareOverlay") && this._isOn) {
                this.hideShareOverlay();
            }
        },
        onShareLinkedIn: function (e) {
            this._event("Share - LinkedIn");
            var s = this._share;
            var url = "https://www.linkedin.com/sharing/share-offsite/?url=" + encodeURIComponent(s);
            window.open(url, "newwindow");
        },
        onShareTwitter: function (e) {
            this._event("Share - Twitter");
            var s = this._share;
            var url = "https://www.twitter.com/share?url=" + encodeURIComponent(s);
            window.open(url, "newwindow");
        },
        onShareFacebook: function (e) {
            this._event("Share - Facebook");
            var s = this._share;
            var url = "https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(s);
            window.open(url, "newwindow");
        },
        onSharePinterest: function (e) {
            this._event("Share - Pinterest");
            var s = this._share;
            var url = "https://www.pinterest.com/pin/create/button/?url=" + encodeURIComponent(s) + "&description=";
            var s1 = this._videoTitle;
            var url1 = url + encodeURIComponent(s1) + "&is_video=true&media=";
            var s2 = this._postersUri;
            var url2 = url1 + encodeURIComponent(s2);
            window.open(url2, "newwindow");
        },
        onShareEmail: function (e) {
            this._event("Share - Email");
            var s = this._text.get("shareEmailSubject");
            var url = "mailto:?subject=" + encodeURIComponent(s) + "&body=";
            var s1 = this._share;
            var url1 = url + encodeURIComponent(s1);
            window.open(url1, "newwindow");
            
        },
        onCopy: function () {
            this._event("Share - Copy url");
            var urlToCopy = this._shareUrlInput.attr("value");
            function fallbackCopyTextToClipboard(o) {
                var e = document.createElement("textarea");
                (e.value = o), document.body.appendChild(e), e.focus(), e.select();
                document.execCommand("copy");
                document.body.removeChild(e);
            }
            function copyTextToClipboard(o) {
                navigator.clipboard ? navigator.clipboard.writeText(o) : fallbackCopyTextToClipboard(o);
            }
            copyTextToClipboard(urlToCopy);
        },
        onLeftArrow: function (e) {
            var scrollWidth = this._iconsWrapper.outerWidth();
            var currentScroll = this._iconsWrapper.scrollLeft();
            this._iconsWrapper.stop().animate({ scrollLeft: currentScroll - scrollWidth }, 800);
        },
        onRightArrow: function (e) {
            var scrollWidth = this._iconsWrapper.outerWidth();
            var currentScroll = this._iconsWrapper.scrollLeft();
            this._iconsWrapper.stop().animate({ scrollLeft: currentScroll + scrollWidth }, 800);
        },
        __class__: pingvp_PingVpShareOverlay,
    };
    var pingvp_PingVpSpacebar = function (videoOid, node) {
        var _gthis = this;
        this._node = node;
        $("body").keydown(function (e) {
            _gthis._container = $("#pingVpOverlayPlayContainer-" + videoOid);
            _gthis._focus = $(":focus");
            if (
                e.which == 32 &&
                (_gthis._container.hasClass("pingVpActive-" + videoOid) ||
                    (_gthis._focus.parents(".PingVP").length != 0 && _gthis._focus.parents(".PingVP")[0] == _gthis._node[0]) ||
                    (_gthis._focus.parents(".pingVpOverlayPlayContainer").length != 0 && _gthis._focus.parents(".pingVpOverlayPlayContainer")[0] == _gthis._node[0]) ||
                    (_gthis._focus.parents(".pingVpWebplayerSelector").length != 0 && _gthis._focus.parents(".pingVpWebplayerSelector")[0] == _gthis._node[0]))
            ) {
                e.preventDefault();
            }
        });
        $("body").keyup(function (e1) {
            _gthis._container = $("#pingVpOverlayPlayContainer-" + videoOid);
            _gthis._focus = $(":focus");
            if (
                e1.which == 32 &&
                (_gthis._container.hasClass("pingVpActive-" + videoOid) ||
                    (_gthis._focus.parents(".PingVP").length != 0 && _gthis._focus.parents(".PingVP")[0] == _gthis._node[0]) ||
                    (_gthis._focus.parents(".pingVpOverlayPlayContainer").length != 0 && _gthis._focus.parents(".pingVpOverlayPlayContainer")[0] == _gthis._node[0]) ||
                    (_gthis._focus.parents(".pingVpWebplayerSelector").length != 0 && _gthis._focus.parents(".pingVpWebplayerSelector")[0] == _gthis._node[0]))
            ) {
                e1.preventDefault();
                if (_gthis._onSpaceBar != null) {
                    _gthis._onSpaceBar();
                }
            }
        });
    };
    $hxClasses["pingvp.PingVpSpacebar"] = pingvp_PingVpSpacebar;
    pingvp_PingVpSpacebar.__name__ = ["pingvp", "PingVpSpacebar"];
    pingvp_PingVpSpacebar.prototype = {
        onSpaceBarPress: function (onSpaceBar) {
            this._onSpaceBar = onSpaceBar;
        },
        __class__: pingvp_PingVpSpacebar,
    };
    var pingvp_PingVpSpeedOverlay = function (videoOid, videoName, overlay, container, text, controlsBelowHeight, event) {
        this._container = container;
        this._videoOid = videoOid;
        this._videoName = videoName;
        this._selected = -1;
        this._event = event;
    };
    $hxClasses["pingvp.PingVpSpeedOverlay"] = pingvp_PingVpSpeedOverlay;
    pingvp_PingVpSpeedOverlay.__name__ = ["pingvp", "PingVpSpeedOverlay"];
    pingvp_PingVpSpeedOverlay.prototype = {
        loadSelected: function () {
            var selected = 0;
            this.onSubSelect(selected);
        },
        getDefault: function () {
            var selected = 0;
            var i = 1;
            return selected;
        },
        setSpeedMenuHandler: function (call) {
            this._menuCall = call;
        },
        onSubSelect: function (selected) {
            if (this._menuCall != null) {
                this._menuCall(selected);
            }
            this._selected = selected;
            this._video = window.document.getElementById("pingVpVideo-" + this._videoOid);
            if (this._selected == 1) {
                this._video.playbackRate = 0.5;
                this._video.defaultPlaybackRate = 0.5;
            } else {
                if (this._selected == 0) {
                    this._video.playbackRate = 1;
                    this._video.defaultPlaybackRate = 1;
                } else {
                    if (this._selected == 2) {
                        this._video.playbackRate = 1.5;
                        this._video.defaultPlaybackRate = 1.5;
                    } else {
                        if (this._selected == 3) {
                            this._video.playbackRate = 2;
                            this._video.defaultPlaybackRate = 2;
                        } else {
                            this._video.playbackRate = 1;
                            this._video.defaultPlaybackRate = 1;
                        }
                    }
                }
            }
        },
        getSelected: function () {
            return this._selected;
        },
        getSelectedText: function () {
            if (this._selected == 1) {
                return "x0.5";
            } else {
                if (this._selected == 0) {
                    return "x1";
                } else {
                    if (this._selected == 2) {
                        return "x1.5";
                    } else {
                        if (this._selected == 3) {
                            return "x2";
                        } else {
                            return "x1";
                        }
                    }
                }
            }
        },
        __class__: pingvp_PingVpSpeedOverlay,
    };
    var pingvp_PingVpStyle = function (styleUrl, id) {
        if ($("link[href='" + styleUrl + "']").length == 0) {
            $('<link rel="stylesheet" type="text/css" href="' + styleUrl + '" />').appendTo("head");
        }
    };
    $hxClasses["pingvp.PingVpStyle"] = pingvp_PingVpStyle;
    pingvp_PingVpStyle.__name__ = ["pingvp", "PingVpStyle"];
    pingvp_PingVpStyle.prototype = { __class__: pingvp_PingVpStyle };
    var pingvp_PingVpSubtitle = function (subtitle) {
        this._subtitle = subtitle;
    };
    $hxClasses["pingvp.PingVpSubtitle"] = pingvp_PingVpSubtitle;
    pingvp_PingVpSubtitle.__name__ = ["pingvp", "PingVpSubtitle"];
    pingvp_PingVpSubtitle.prototype = {
        name: function () {
            return this.getStringField("name");
        },
        lang: function () {
            return this.getStringField("lang");
        },
        file: function () {
            return this.getStringField("file");
        },
        format: function () {
            return this.getStringField("format");
        },
        default_: function () {
            return this.getBoolField("default");
        },
        getStringField: function (field) {
            if (this._subtitle == null) {
                return null;
            }
            var value = Reflect.field(this._subtitle, field);
            if (value == null) {
                return null;
            }
            return Std.string(value);
        },
        getBoolField: function (field) {
            if (this._subtitle == null) {
                return null;
            }
            var ret = Reflect.field(this._subtitle, field);
            return ret;
        },
        __class__: pingvp_PingVpSubtitle,
    };
    var pingvp_PingVpSubtitlesMenu = function (videoOid, theme, text, controlsBelow, controlBar, controlBarOnShow, checkHideEnable, subs, subtitles, lastSubtitle, enableShare, mobileCheck, event) {
        this._videoOid = videoOid;
        this._isSub = false;
        this._setOverlay = $("#pingVpOverlay-" + videoOid);
        this._setButton = $("#pingVpControlSubtitles-" + videoOid);
        this._container = $("#pingVpOverlayPlayContainer-" + videoOid);
        this._controlsBelow = controlsBelow;
        this._controlBarOnShow = controlBarOnShow;
        this._checkHideEnable = checkHideEnable;
        this._controlBar = controlBar;
        this._subtitles = subtitles;
        this._menuIsActive = true;
        this._event = event;
        this._shareIsActive = enableShare;
        this._mobileCheck = mobileCheck;
        var items = "";
        if (this._mobileCheck) {
            items += '<div id="pingVpSubtitlesMobileOverlay-' + videoOid + '" class="pingVpSubtitlesMobileOverlay">';
        }
        items += '<ul id="pingVpSubtitlesMenu-' + videoOid + '" class="pingVpSubtitlesMenu">';
        items += '<div class="pingVpSubtitlesHeadMenu" id="pingVpSubtitlesHeadMenu-' + videoOid + '">';
        if (this._mobileCheck) {
            this._closeModalIcon = theme.getIcon(theme.getByKey("svgset"), "cross.svg", "fff");
            items += '<div tabindex="0" id="pingVpSubtitlesModalClose-' + videoOid + '" class="pingVpSubtitlesModalClose"><img class="pingVpReset pingVpCloseModalSvg" src="' + this._closeModalIcon + '"/></div>';
        }
        items += '<li class="pingVpSubtitlesMenuTitle pingVpSubtitlesMenuTitle-' + videoOid + '">' + text.get("settingsSubtitlesTitle") + "</li><hr>";
        var subi = 0;
        this._selectedSubs = -1;
        var _g = 0;
        while (_g < subs.length) {
            var sub = subs[_g];
            ++_g;
            ++subi;
            items += '<li class="pingVpSubtitlesMenuItem pingVpSubtitlesMenuItem-' + this._videoOid + '" tabindex="-1" id="pingVpSubtitlesMenuItem-' + videoOid + "-" + subi + '">' + StringTools.htmlEscape(sub.name(), false) + "</li>";
        }
        items += '<li class="pingVpSubtitlesMenuItem pingVpSubtitlesMenuItem-' + this._videoOid + '" tabindex="-1" id="pingVpSubtitlesMenuItem-' + videoOid + "-" + 0 + '">' + text.get("subtitlesNone") + "</li>";
        items += "</div>";
        items += "</ul>";
        if (this._mobileCheck) {
            items += "</div>";
        }
        this._setOverlay.append(items);
        this._setMenu = $("#pingVpSubtitlesMenu-" + videoOid);
        this._setMenu.css("background-color", "#" + theme.getByKey("menubackcolor")).css("color", "#" + theme.getByKey("menucolor"));
        this._setMenu.css("text-shadow", "0 0 2px #" + theme.getByKey("menubackcolor"));
        $("body").on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.checkFocus));
        if (this._mobileCheck) {
            this._setSubtitlesOverlay = $("#pingVpSubtitlesMobileOverlay-" + videoOid);
            this._closeModal = $("#pingVpSubtitlesModalClose-" + this._videoOid);
            this._closeModal.on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, $bind(this, this.hide));
        }
        this.setSubsSelected(lastSubtitle);
        while (true) {
            $("#pingVpSubtitlesMenuItem-" + this._videoOid + "-" + subi).on(pingvp_PingVpDevice.isTouchEventDevice() ? "touchstart" : "click", null, subi, $bind(this, this.setSubs));
            if (!(subi-- > 0)) {
                break;
            }
        }
        if (!this._mobileCheck) {
            var locationBottom = controlsBelow ? 57 : 69;
            this._setMenu.css("bottom", locationBottom + "px");
            this.hide();
        }
    };
    $hxClasses["pingvp.PingVpSubtitlesMenu"] = pingvp_PingVpSubtitlesMenu;
    pingvp_PingVpSubtitlesMenu.__name__ = ["pingvp", "PingVpSubtitlesMenu"];
    pingvp_PingVpSubtitlesMenu.prototype = {
        setButtonHandler: function (call) {
            this._buttonCall = call;
        },
        getActive: function () {
            return this._menuIsActive;
        },
        show: function () {
            if (!this._mobileCheck) {
                this.setRight();
            }
            this._isOn = true;
            this._controlBarOnShow(false);
            this._checkHideEnable(false);
            if (this._mobileCheck) {
                this._setSubtitlesOverlay.stop().css("display", "flex");
            } else {
                this._setMenu.stop().show();
            }
            this.setHeight();
            this._focus = $(":focus");
            if (this._focus.hasClass("pingVpControlSubtitles")) {
                this.setHtmlFocus("head");
            }
        },
        hide: function () {
            this._isOn = false;
            this._focus = $(":focus");
            if (this._mobileCheck) {
                this._setSubtitlesOverlay.stop().hide();
            } else {
                this._setMenu.stop().hide();
            }
            if (this._focus.parents(".pingVpSubtitlesMenu").length != 0) {
                this.resetHtmlFocus();
                this._setButton.focus();
            }
            this._controlBarOnShow(true);
            this._checkHideEnable(true);
            if (this._buttonCall != null) {
                this._buttonCall(false);
            }
        },
        checkClose: function (e) {
            this._focus = $(":focus");
            if (this._isOn && e.which == 27 && (this._container.hasClass("pingVpActive-" + this._videoOid) || this._focus.parents(".pingVpSubtitlesMenu").length != 0)) {
                e.preventDefault();
                this.hide();
            }
        },
        checkFocus: function (e) {
            if ($(e.target).closest("#pingVpSubtitlesMenu-" + this._videoOid).length == 0 && this._isOn && $(e.target).closest("#pingVpControlSubtitles-" + this._videoOid).length == 0) {
                this.hide();
            }
        },
        isShown: function () {
            return this._isOn;
        },
        isSub: function () {
            return this._isSub;
        },
        getJQueryHead: function () {
            return $("#pingVpSubtitlesMenu-" + this._videoOid);
        },
        setRight: function () {
            var currWidth = this._setMenu.width();
            var defaultMin = this._controlsBelow ? 7 : 10;
            var shareWidth = this._shareIsActive ? 40 : 0;
            var maxWidth = (80 + shareWidth) * 2 + 40;
            if (currWidth < maxWidth) {
                var calcRight = (maxWidth - currWidth) / 2 + defaultMin;
                this._setMenu.css("right", calcRight + "px");
            } else {
                this._setMenu.css("right", defaultMin + "px");
            }
        },
        setHeight: function () {
            var newHeight = $("#pingVpSubtitlesHeadMenu-" + this._videoOid).outerHeight();
            this._setMenu.css("height", newHeight + "px");
        },
        setHtmlFocus: function (element) {
            this._setMenu.find('[tabindex="0"]').attr("tabindex", "-1");
            var allowFocus = this.getJQueryHead();
            allowFocus.find('[tabindex="-1"]').attr("tabindex", "0");
            allowFocus.find('[tabindex="0"]').first().focus();
        },
        resetHtmlFocus: function () {
            this._setMenu.find('[tabindex="0"]').attr("tabindex", "-1");
        },
        checkDownAndUpKeys: function (e) {
            this._focus = $(":focus");
            if (e.which == 38 && this._focus.parents(".pingVpSubtitlesMenu").length != 0) {
                e.preventDefault();
                this._focus.prevAll('.pingVpSubtitlesMenuItem[tabindex="0"]').first().focus();
            }
            if (e.which == 40 && this._focus.parents(".pingVpSubtitlesMenu").length != 0) {
                e.preventDefault();
                this._focus.nextAll('.pingVpSubtitlesMenuItem[tabindex="0"]').first().focus();
            }
        },
        setSubsSelected: function (selected) {
            if (selected == -1) {
                selected = this._subtitles.getDefault();
            }
            if (this._selectedSubs != selected) {
                this._subtitles.onSubSelect(selected);
                this._selectedSubs = selected;
                if (this._settingsMenuCurrentSubsCall != null) {
                    this._settingsMenuCurrentSubsCall(selected);
                }
                $(".pingVpSubtitlesMenuItem-" + this._videoOid + ".pingVpSettingsSelected").removeClass("pingVpSettingsSelected");
                $("#pingVpSubtitlesMenuItem-" + this._videoOid + "-" + selected).addClass("pingVpSettingsSelected");
            }
        },
        setSubs: function (e) {
            var currentSelectedSubs = this._selectedSubs;
            this.hide();
            this.setSubsSelected(e.data);
            if (currentSelectedSubs != this._selectedSubs) {
                if (this._selectedSubs == 0) {
                    this._event("Subtitle turned off");
                } else {
                    var sub = this._subtitles.getSelectedSub();
                    this._event('Subtitle selected "' + sub.name() + '"');
                }
            }
        },
        setSettingsMenuSubsHandler: function (call) {
            this._settingsMenuCurrentSubsCall = call;
        },
        setSettingsMenuHandler: function (call) {
            this._settingsMenuCall = call;
        },
        __class__: pingvp_PingVpSubtitlesMenu,
    };
    var pingvp_PingVpSubtitlesMenuOverlay = function (
        videoOid,
        videoName,
        overlay,
        container,
        theme,
        text,
        controlsBelow,
        controlBar,
        controlBarOnShow,
        checkHideEnable,
        setSubtitlesButton,
        subs,
        subtitles,
        lastSubtitle,
        enableShare,
        event
    ) {
        this._container = container;
        this._videoOid = videoOid;
        this._videoName = videoName;
        this._mobileCheck = false;
        this._subtitlesMenuElement = null;
        if (subs != null && subs.length > 0) {
            if (pingvp_PingVpDevice.isIphone() || pingvp_PingVpDevice.isIpad() || pingvp_PingVpDevice.isAndroid()) {
                this._mobileCheck = true;
            }
            this._subtitlesMenu = new pingvp_PingVpSubtitlesMenu(videoOid, theme, text, controlsBelow, controlBar, controlBarOnShow, checkHideEnable, subs, subtitles, lastSubtitle, enableShare, this._mobileCheck, event);
            this._subtitlesMenu.setButtonHandler(setSubtitlesButton);
            if (this._mobileCheck) {
                this._subtitlesMenuElement = $("#pingVpSubtitlesMobileOverlay-" + videoOid);
            } else {
                this._subtitlesMenuElement = $("#pingVpSubtitlesMenu-" + videoOid);
            }
            if (this._subtitlesMenu.getActive()) {
                this.resize();
            }
        }
    };
    $hxClasses["pingvp.PingVpSubtitlesMenuOverlay"] = pingvp_PingVpSubtitlesMenuOverlay;
    pingvp_PingVpSubtitlesMenuOverlay.__name__ = ["pingvp", "PingVpSubtitlesMenuOverlay"];
    pingvp_PingVpSubtitlesMenuOverlay.prototype = {
        showSubtitlesMenu: function () {
            if (this._subtitlesMenu.isShown()) {
                this._subtitlesMenu.hide();
            } else {
                this._subtitlesMenu.show();
            }
        },
        resize: function () {
            this._overlay = $("#pingVpOverlay-" + this._videoOid);
            var definer = 960;
            var definerW = 640;
            var currentWidth = this._overlay.outerWidth();
            var percent = 100;
            var percentW = 0.25;
            if (currentWidth > definer) {
                percent -= (definer - currentWidth) / 32;
            } else {
                if (currentWidth < definer) {
                    percent += (currentWidth - definer) / 32;
                }
            }
            this._subtitlesMenuElement.css("font-size", percent + "%");
            if (this._mobileCheck) {
                var width = this._container.getWidth();
                var height = this._container.getHeight();
                this._subtitlesMenuElement.css("width", width);
                this._subtitlesMenuElement.css("height", height);
            } else {
                if (currentWidth > definerW) {
                    percentW -= (currentWidth - definerW) / 220 / 100;
                }
                percentW = currentWidth * percentW;
                this._subtitlesMenuElement.css("min-width", percentW + "px");
                this._subtitlesMenu.setRight();
                this._subtitlesMenu.setHeight();
            }
        },
        checkSubtitlesMenu: function () {
            if (this._subtitlesMenu != null) {
                return this._subtitlesMenu.isShown();
            } else {
                return false;
            }
        },
        checkMenuActive: function () {
            if (this._subtitlesMenu != null) {
                return this._subtitlesMenu.getActive();
            } else {
                return false;
            }
        },
        checkUpAndDownKeys: function (e) {
            this._subtitlesMenu.checkDownAndUpKeys(e);
        },
        checkCloseKeys: function (e) {
            this._subtitlesMenu.checkClose(e);
        },
        setSubsMenuSelected: function (selected) {
            this._subtitlesMenu.setSubsSelected(selected);
        },
        setSettingsMenuHandler: function (call) {
            this._subtitlesMenu.setSettingsMenuHandler(call);
        },
        setSettingsMenuSubsHandler: function (call) {
            this._subtitlesMenu.setSettingsMenuSubsHandler(call);
        },
        __class__: pingvp_PingVpSubtitlesMenuOverlay,
    };
    var pingvp_PingVpSubtitlesOverlay = function (videoOid, videoScript, videoScriptName, overlay, container, subs, text, controlsBelow, controlsBelowHeight, theme, controlBar, event) {
        this._container = container;
        this._subs = subs;
        this._videoOid = videoOid;
        this._videoName = videoScriptName;
        this._subtitlesBg = videoScript.getHeaderSubtitlesBg();
        this._lastText = null;
        this._selected = -1;
        this._theme = theme;
        this._controlBar = controlBar;
        this._textBgColor = theme.getByKey("subtitlesbg");
        this._event = event;
        if ($("#pingVpSubtitles-" + videoOid).length != 0) {
            $("#pingVpSubtitles-" + videoOid).remove();
        }
        if (this._subtitlesBg == null || this._subtitlesBg == "" || this._subtitlesBg == "false") {
            $("#pingVpControlCollected-" + videoOid).prepend('<div id="pingVpSubtitles-' + videoOid + '" class="pingVpSubtitles pingVpSubtitlesBgColorUnset"></div>');
        } else {
            $("#pingVpControlCollected-" + videoOid).prepend('<div id="pingVpSubtitles-' + videoOid + '" class="pingVpSubtitles pingVpSubtitlesBgColorSet"></div>');
        }
        if (controlsBelow) {
            $("#pingVpControlCollected-" + this._videoOid + " .pingVpSubtitles").addClass("pingVpControlBarVisible");
            $("#pingVpControlCollected-" + this._videoOid).addClass("pingVpCollectedVisible");
        }
        this._subtitles = $("#pingVpSubtitles-" + videoOid);
        this.resize();
    };
    $hxClasses["pingvp.PingVpSubtitlesOverlay"] = pingvp_PingVpSubtitlesOverlay;
    pingvp_PingVpSubtitlesOverlay.__name__ = ["pingvp", "PingVpSubtitlesOverlay"];
    pingvp_PingVpSubtitlesOverlay.prototype = {
        getDefault: function () {
            var selected = 0;
            this._controlBar.setSubsOnIcon("subtitles");
            var i = 1;
            var _g = 0;
            var _g1 = this._subs;
            while (_g < _g1.length) {
                var sub = _g1[_g];
                ++_g;
                if (sub.default_()) {
                    selected = i;
                    break;
                }
                ++i;
            }
            return selected;
        },
        onSubSelect: function (selected) {
            if (this._menuCall != null) {
                this._menuCall(selected);
            }
            if (selected == 0) {
                this._controlBar.setSubsOnIcon("subtitles");
            } else {
                this._controlBar.setSubsOnIcon("subtitles_on");
            }
            this._cues = [];
            this._subtitles.html("");
            this._selected = selected;
            if (selected <= 0 || selected > this._subs.length) {
                return;
            }
            this.sub = this._subs[selected - 1];
            this.load(this.sub);
        },
        setTime: function (currentTime) {
            var timeMs = currentTime * 1000;
            var text = null;
            if (this._cues != null) {
                var _g = 0;
                var _g1 = this._cues;
                while (_g < _g1.length) {
                    var cue = _g1[_g];
                    ++_g;
                    if (timeMs >= cue.start && timeMs <= cue.end) {
                        if (text != null) {
                            text = '<div style="background-color:#' + this._textBgColor + ';">' + Std.string(cue.text) + "</div><br/><br/>" + text + "</div>";
                        } else {
                            text = '<div style="background-color:#' + this._textBgColor + ';">' + Std.string(cue.text) + "</div>";
                        }
                    }
                }
            }
            if (this._lastText != text) {
                this._lastText = text;
                if (text != null) {
                    this._subtitles.html(text);
                } else {
                    this._subtitles.empty();
                }
            }
        },
        load: function (sub) {
            var name = sub.name();
            var uri = Std.string(pingvp_PingVpConfigRead.get().playerUri) + "../../webplayer_tools/webvttp.php?name=";
            var s = sub.file();
            var uri1 = uri + encodeURIComponent(s) + "&videoname=";
            var s1 = this._videoName;
            var uri2 = uri1 + encodeURIComponent(s1);
            this.loadJsonp(name, uri2);
        },
        loadJsonp: function (name, uri) {
            var _gthis = this;
            $.ajax({
                type: "GET",
                url: uri,
                contentType: "application/json",
                dataType: "jsonp",
                success: function (data) {
                    _gthis._cues = data.cues;
                },
                error: {},
            });
        },
        resize: function () {
            this._overlay = $("#pingVpOverlay-" + this._videoOid);
            var definer = 640;
            var percent = 100;
            var currentWidth = this._overlay.outerWidth();
            if (currentWidth > definer) {
                percent *= currentWidth / definer;
            }
            this._subtitles.css("font-size", percent + "%");
        },
        disable: function () {
            this._subtitles.css("display", "none");
        },
        enable: function () {
            this._subtitles.css("display", "block");
        },
        hasSubs: function () {
            if (this._subs != null) {
                return this._subs.length > 0;
            } else {
                return false;
            }
        },
        getSelected: function () {
            return this._selected;
        },
        getSelectedSub: function () {
            return this.sub;
        },
        __class__: pingvp_PingVpSubtitlesOverlay,
    };
    var pingvp_PingVpTheme = function (showPlay, controlsBelow, theme) {
        if (showPlay == null) {
            if (theme.indexOf("_playless") != -1) {
                showPlay = false;
            }
        }
        if (theme.indexOf("_playless") != -1) {
            theme = StringTools.replace(theme, "_playless", "");
        }
        this._controlsBelowVideo = controlsBelow;
        if (this._controlsBelowVideo) {
            switch (theme) {
                case "abnamro":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "00857A",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "f3c000",
                        sliderbutton: "00857A",
                        subtitlesbg: "676767",
                        defaultcolor: "00857A",
                        hovercolor: "5a5a5a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "vattenfall":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "050135",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "050135",
                        sliderbutton: "050135",
                        subtitlesbg: "676767",
                        defaultcolor: "050135",
                        hovercolor: "5a5a5a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "achmea":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "5b5b5b",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "0070b6",
                        sliderbutton: "00609c",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "00609c",
                        hovercolor: "5b5b5b",
                        menubackcolor: "00609ce6",
                        menucolor: "fff",
                    };
                    break;
                case "alphabet":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "005ca9",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "005ca9",
                        sliderbutton: "ef7d00",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "005ca9",
                        hovercolor: "ef7d00",
                        menubackcolor: "ffffffe6",
                        menucolor: "005ca9",
                    };
                    break;
                case "base":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "416267",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "416267",
                        sliderbutton: "1c1c1c",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "416267",
                        hovercolor: "98acb3",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "boip":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "f0efef",
                        timecolor: "3c3c3c",
                        sliderbg: "b6b6b6",
                        sliderbuffer: "b6b6b6",
                        sliderfg: "3c3c3c",
                        sliderbutton: "000",
                        subtitlesbg: "f0efef",
                        defaultcolor: "3c3c3c",
                        hovercolor: "b6b6b6",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "brunel":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "353F49",
                        timecolor: "F2E400",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "F2E400",
                        sliderbutton: "353F49",
                        subtitlesbg: "676767",
                        defaultcolor: "F2E400",
                        hovercolor: "FFFFFF",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "F2E400",
                    };
                    break;
                case "cbs":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "759dcf",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "759dcf",
                        sliderbutton: "1d3e73",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "759dcf",
                        hovercolor: "1d3e73",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "elsevier":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "ff8200",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "ff8200",
                        sliderbutton: "53565a",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "ff8200",
                        hovercolor: "53565a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "eurofiber":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "007681",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "007681",
                        sliderbutton: "963821",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "007681",
                        hovercolor: "963821",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "fnv":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "009cde",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "009cde",
                        sliderbutton: "7fba25",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "009cde",
                        hovercolor: "7fba25",
                        menubackcolor: "ffffffe6",
                        menucolor: "9a8f87",
                    };
                    break;
                case "kpn":
                    this._values = {
                        theme: "kpn",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "008000",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "008000",
                        sliderbutton: "fff",
                        subtitlesbg: "242424",
                        defaultcolor: "008000",
                        hovercolor: "676767",
                        menubackcolor: "676767e6",
                        menucolor: "fff",
                    };
                    break;
                case "lotto":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "000000",
                        sliderbg: "ced6da",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "000000",
                        sliderbutton: "7f7f7f",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "000000",
                        hovercolor: "7f7f7f",
                        menubackcolor: "7f7f7fe6",
                        menucolor: "000000",
                    };
                    break;
                case "nhlstenden":
                    this._values = {
                        theme: "kpn",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "00294B",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "00294B",
                        sliderbutton: "fff",
                        subtitlesbg: "242424",
                        defaultcolor: "00294B",
                        hovercolor: "676767",
                        menubackcolor: "fff",
                        menucolor: "00294B",
                    };
                    break;
                case "onlinenl":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "5c2d91",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "5c2d91",
                        sliderbutton: "a7a9ac",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "5c2d91",
                        hovercolor: "a7a9ac",
                        menubackcolor: "ffffffe6",
                        menucolor: "fff",
                    };
                    break;
                case "phenc":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "38beee",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "38beee",
                        sliderbutton: "123864",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "38beee",
                        hovercolor: "123864",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "robeco":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "00a2bd",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "00a2bd",
                        sliderbutton: "5a5a5a",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "00a2bd",
                        hovercolor: "5a5a5a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "sensara":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "e5244b",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "e5244b",
                        sliderbutton: "9d0833",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "e5244b",
                        hovercolor: "9d0833",
                        menubackcolor: "ffffffe6",
                        menucolor: "9d0833",
                    };
                    break;
                case "simyo":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "ff8000",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "ff8000",
                        sliderbutton: "ffb160",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "ff8000",
                        hovercolor: "ffb160",
                        menubackcolor: "ffffffe6",
                        menucolor: "4f4f4f",
                    };
                    break;
                case "staatsloterij":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "ff8400",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "ff8400",
                        sliderbutton: "ee5f00",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "ff8400",
                        hovercolor: "ee5f00",
                        menubackcolor: "ffffffe6",
                        menucolor: "ee5f00",
                    };
                    break;
                case "telfort":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "2c3687",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "2c3687",
                        sliderbutton: "5a5a5a",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "2c3687",
                        hovercolor: "5a5a5a",
                        menubackcolor: "ffffffe6",
                        menucolor: "5a5a5a",
                    };
                    break;
                case "tmobile":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "7c7c7c",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "7c7c7c",
                        sliderbutton: "e20074",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "7c7c7c",
                        hovercolor: "3bc3f2",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "xmas":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "d00f0d",
                        timecolor: "fff",
                        sliderbg: "b5bdc1",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "fff",
                        sliderbutton: "c13939",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "fff",
                        hovercolor: "b5bdc1",
                        menubackcolor: "d00f0de6",
                        menucolor: "fff",
                    };
                    break;
                case "youfone":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "38155a",
                        timecolor: "fff",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "99bf0f",
                        sliderbutton: "751a5b",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "fff",
                        hovercolor: "98acb3",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "yousee":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "003c28",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "3cb84d",
                        sliderbutton: "003c28",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "003c28",
                        hovercolor: "3cb84d",
                        menubackcolor: "ffffffe6",
                        menucolor: "003c28",
                    };
                    break;
                case "zz":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "5b5b5b",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "95c300",
                        sliderbutton: "00609c",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "00609c",
                        hovercolor: "5b5b5b",
                        menubackcolor: "00609ce6",
                        menucolor: "fff",
                    };
                    break;
                default:
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "050135",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "050135",
                        sliderbutton: "050135",
                        subtitlesbg: "676767",
                        defaultcolor: "050135",
                        hovercolor: "5a5a5a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
            }
        } else {
            switch (theme) {
                case "vattenfall":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "050135",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "050135",
                        sliderbutton: "050135",
                        subtitlesbg: "676767",
                        defaultcolor: "050135",
                        hovercolor: "5a5a5a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "achmea":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "fff",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "fff",
                        sliderbutton: "fff",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "fff",
                        hovercolor: "b5bdc1",
                        menubackcolor: "00609ce6",
                        menucolor: "fff",
                    };
                    break;
                case "alphabet":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "005ca9",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "005ca9",
                        sliderbutton: "ef7d00",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "005ca9",
                        hovercolor: "ef7d00",
                        menubackcolor: "ffffffe6",
                        menucolor: "005ca9",
                    };
                    break;
                case "base":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "416267",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "416267",
                        sliderbutton: "1c1c1c",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "416267",
                        hovercolor: "98acb3",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "boip":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "f0efef",
                        timecolor: "3c3c3c",
                        sliderbg: "b6b6b6",
                        sliderbuffer: "b6b6b6",
                        sliderfg: "3c3c3c",
                        sliderbutton: "000",
                        subtitlesbg: "f0efef",
                        defaultcolor: "3c3c3c",
                        hovercolor: "b6b6b6",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "brunel":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "353F49",
                        timecolor: "F2E400",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "F2E400",
                        sliderbutton: "353F49",
                        subtitlesbg: "676767",
                        defaultcolor: "F2E400",
                        hovercolor: "FFFFFF",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "F2E400",
                    };
                    break;
                case "cbs":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "759dcf",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "759dcf",
                        sliderbutton: "1d3e73",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "759dcf",
                        hovercolor: "1d3e73",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "elsevier":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "ff8200",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "ff8200",
                        sliderbutton: "53565a",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "ff8200",
                        hovercolor: "53565a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "eurofiber":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "007681",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "007681",
                        sliderbutton: "963821",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "007681",
                        hovercolor: "963821",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "fnv":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "009cde",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "009cde",
                        sliderbutton: "7fba25",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "009cde",
                        hovercolor: "7fba25",
                        menubackcolor: "ffffffe6",
                        menucolor: "9a8f87",
                    };
                    break;
                case "kpn":
                    this._values = {
                        theme: "kpn",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "008000",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "008000",
                        sliderbutton: "fff",
                        subtitlesbg: "242424",
                        defaultcolor: "008000",
                        hovercolor: "676767",
                        menubackcolor: "676767e6",
                        menucolor: "fff",
                    };
                    break;
                case "lotto":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "000000",
                        sliderbg: "ced6da",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "000000",
                        sliderbutton: "7f7f7f",
                        subtitlesbg: "ffffffe6",
                        defaultcolor: "000000",
                        hovercolor: "7f7f7f",
                        menubackcolor: "7f7f7fe6",
                        menucolor: "000000",
                    };
                    break;
                case "nhlstenden":
                    this._values = {
                        theme: "kpn",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "00294B",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "00294B",
                        sliderbutton: "fff",
                        subtitlesbg: "242424",
                        defaultcolor: "00294B",
                        hovercolor: "676767",
                        menubackcolor: "fff",
                        menucolor: "00294B",
                    };
                    break;
                case "onlinenl":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "5c2d91",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "5c2d91",
                        sliderbutton: "a7a9ac",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "5c2d91",
                        hovercolor: "a7a9ac",
                        menubackcolor: "ffffffe6",
                        menucolor: "fff",
                    };
                    break;
                case "phenc":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "38beee",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "38beee",
                        sliderbutton: "123864",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "38beee",
                        hovercolor: "123864",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "robeco":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "00a2bd",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "00a2bd",
                        sliderbutton: "5a5a5a",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "00a2bd",
                        hovercolor: "5a5a5a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "sensara":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "e5244b",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "e5244b",
                        sliderbutton: "9d0833",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "e5244b",
                        hovercolor: "9d0833",
                        menubackcolor: "ffffffe6",
                        menucolor: "9d0833",
                    };
                    break;
                case "simyo":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "ff8000",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "ff8000",
                        sliderbutton: "ffb160",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "ff8000",
                        hovercolor: "ffb160",
                        menubackcolor: "ffffffe6",
                        menucolor: "4f4f4f",
                    };
                    break;
                case "staatsloterij":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "ff8400",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "ff8400",
                        sliderbutton: "ee5f00",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "ff8400",
                        hovercolor: "ee5f00",
                        menubackcolor: "ffffffe6",
                        menucolor: "ee5f00",
                    };
                    break;
                case "telfort":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "2c3687",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "2c3687",
                        sliderbutton: "5a5a5a",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "2c3687",
                        hovercolor: "5a5a5a",
                        menubackcolor: "ffffffe6",
                        menucolor: "5a5a5a",
                    };
                    break;
                case "tmobile":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "7c7c7c",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "7c7c7c",
                        sliderbutton: "e20074",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "7c7c7c",
                        hovercolor: "3bc3f2",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "xmas":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "d00f0d",
                        timecolor: "fff",
                        sliderbg: "b5bdc1",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "fff",
                        sliderbutton: "c13939",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "fff",
                        hovercolor: "b5bdc1",
                        menubackcolor: "d00f0de6",
                        menucolor: "fff",
                    };
                    break;
                case "youfone":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "38155a",
                        timecolor: "fff",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "99bf0f",
                        sliderbutton: "751a5b",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "fff",
                        hovercolor: "98acb3",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
                    break;
                case "yousee":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "003c28",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "3cb84d",
                        sliderbutton: "003c28",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "003c28",
                        hovercolor: "3cb84d",
                        menubackcolor: "ffffffe6",
                        menucolor: "003c28",
                    };
                    break;
                case "zz":
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "fff",
                        sliderbg: "9a8f87",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "95c300",
                        sliderbutton: "fff",
                        subtitlesbg: "8e8279cc",
                        defaultcolor: "fff",
                        hovercolor: "b5bdc1",
                        menubackcolor: "00609ce6",
                        menucolor: "fff",
                    };
                    break;
                default:
                    this._values = {
                        theme: "default",
                        svgset: "default",
                        controlbarcolor: "fff",
                        timecolor: "050135",
                        sliderbg: "8c8c8c",
                        sliderbuffer: "b5bdc1",
                        sliderfg: "050135",
                        sliderbutton: "050135",
                        subtitlesbg: "676767",
                        defaultcolor: "050135",
                        hovercolor: "5a5a5a",
                        menubackcolor: "1c1c1ce6",
                        menucolor: "fff",
                    };
            }
        }
        if (showPlay == null) {
            this._showPlay = true;
        } else {
            this._showPlay = showPlay;
        }
    };
    $hxClasses["pingvp.PingVpTheme"] = pingvp_PingVpTheme;
    pingvp_PingVpTheme.__name__ = ["pingvp", "PingVpTheme"];
    pingvp_PingVpTheme.prototype = {
        set: function (key, value) {
            if (value != null && value != "") {
                this._values[key] = value;
            }
        },
        getByKey: function (key) {
            return Reflect.field(this._values, key);
        },
        showPlay: function () {
            return this._showPlay;
        },
        getIcon: function (theme, icon, color) {
            var uri = Std.string(pingvp_PingVpConfigRead.get().playerUri) + "../../webplayer_tools/icons.php?set=" + theme + "&icon=" + icon + "&size=icons";
            if (color != null) {
                uri = uri + "&color=" + color;
            }
            return uri;
        },
        getSlider: function (theme, icon, color) {
            var uri = Std.string(pingvp_PingVpConfigRead.get().playerUri) + "../../webplayer_tools/icons.php?set=" + theme + "&icon=" + icon + "&size=slider";
            if (color != null) {
                uri = uri + "&color=" + color;
            }
            return uri;
        },
        getButton: function (theme, icon, color) {
            var uri = Std.string(pingvp_PingVpConfigRead.get().playerUri) + "../../webplayer_tools/icons.php?set=" + theme + "&icon=" + icon + "&size=button";
            if (color != null) {
                uri = uri + "&color=" + color;
            }
            return uri;
        },
        getFull: function (theme, icon, color) {
            var uri = Std.string(pingvp_PingVpConfigRead.get().playerUri) + "../../webplayer_tools/icons.php?set=" + theme + "&icon=" + icon + "&size=full";
            if (color != null) {
                uri = uri + "&color=" + color;
            }
            return uri;
        },
        getShare: function (theme, icon, color) {
            var uri = Std.string(pingvp_PingVpConfigRead.get().playerUri) + "../../webplayer_tools/icons.php?set=" + theme + "&icon=" + icon + "&size=share";
            if (color != null) {
                uri = uri + "&color=" + color;
            }
            return uri;
        },
        getSetDefaultColor: function () {
            return "fff";
        },
        getSetHoverColor: function () {
            return "676767";
        },
        __class__: pingvp_PingVpTheme,
    };
    var pingvp_PingVpTimeline = function (getCurrentTime) {};
    $hxClasses["pingvp.PingVpTimeline"] = pingvp_PingVpTimeline;
    pingvp_PingVpTimeline.__name__ = ["pingvp", "PingVpTimeline"];
    pingvp_PingVpTimeline.prototype = { add: function (block, start, styles) {}, addTo: function (block, start, time, styles) {}, update: function (time) {}, __class__: pingvp_PingVpTimeline };
    var pingvp_PingVpUserAgentSelect = function () {};
    $hxClasses["pingvp.PingVpUserAgentSelect"] = pingvp_PingVpUserAgentSelect;
    pingvp_PingVpUserAgentSelect.__name__ = ["pingvp", "PingVpUserAgentSelect"];
    pingvp_PingVpUserAgentSelect.select = function (disableList) {
        var config = pingvp_PingVpConfigRead.get();
        if (config == null) {
            pingvp_PingVpUserAgentSelect.player = 0;
            return false;
        }
        if (config.uaList == null) {
            pingvp_PingVpUserAgentSelect.player = 0;
            return false;
        }
        var keysSorted = [];
        var _g = 0;
        var _g1 = Reflect.fields(config.uaList);
        while (_g < _g1.length) {
            var n = _g1[_g];
            ++_g;
            keysSorted.push(n);
        }
        keysSorted.sort(function (a, b) {
            var ai = Reflect.field(config.uaList, a);
            var bi = Reflect.field(config.uaList, b);
            return (ai.weight | 0) - (bi.weight | 0);
        });
        var _g2 = 0;
        while (_g2 < keysSorted.length) {
            var n1 = keysSorted[_g2];
            ++_g2;
            var i = Reflect.field(config.uaList, n1);
            if (i.regex != null && i.player != null) {
                if (disableList.indexOf(i.player) != -1) {
                    continue;
                }
                var r = new EReg(i.regex, "i");
                if (r.match(window.navigator.userAgent)) {
                    pingvp_PingVpUserAgentSelect.player = i.player;
                    return true;
                }
            }
        }
        return false;
    };
    var pingvp_PingVpVideoContainer = function (videoOid, node, controlsBelowVideo, isOverlayPlay, videoScript) {
        this._videoOid = videoOid;
        this._node = node;
        this._controlsBelowVideo = controlsBelowVideo;
        this._isOverlayPlay = isOverlayPlay;
        if (this._isOverlayPlay) {
            this._overlayPlayBgDiv = window.document.createElement("div");
            this._overlayPlayBgDiv.id = "pingVpOverlayPlayBg-" + this._videoOid;
            this._overlayPlayBgDiv.className += " pingVpOverlayPlayBg";
            this._overlayPlayBgDiv.className += " pingVpReset";
            this._overlayPlayBgDiv.style.display = "none";
            window.document.body.insertBefore(this._overlayPlayBgDiv, window.document.body.firstChild);
            this._overlayPlayBgJq = $(this._overlayPlayBgDiv);
        }
        this._node.prepend('<div id="pingVpOverlayPlayContainer-' + this._videoOid + '" class="pingVpOverlayPlayContainer pingVpReset"><div id="pingVpVideoContainer-' + videoOid + '" class="pingVpVideoContainer pingVpReset"></div></div>');
        var seo = videoScript.getSeo();
        if (seo != null) {
            this.addSeoTags(this._node, seo, videoScript);
        }
        this._videoContainer = $("#pingVpVideoContainer-" + this._videoOid);
        this._overlayPlayContainer = $("#pingVpOverlayPlayContainer-" + this._videoOid);
        this._videoContainer.css("width", "100%");
        this._videoContainer.css("height", "100%");
        this._overlayPlayContainer.css("width", "100%");
        this._overlayPlayContainer.css("height", "100%");
    };
    $hxClasses["pingvp.PingVpVideoContainer"] = pingvp_PingVpVideoContainer;
    pingvp_PingVpVideoContainer.__name__ = ["pingvp", "PingVpVideoContainer"];
    pingvp_PingVpVideoContainer.prototype = {
        addSeoTags: function (_node, seo, videoScript) {
            _node.attr("itemprop", "video");
            _node.attr("itemscope", "");
            _node.attr("itemtype", "http://schema.org/VideoObject");
            var name = seo.name();
            var description = seo.description();
            var transcript = seo.transcript();
            var keywords = seo.keywords();
            var thumbnailURL = seo.thumbnailURL();
            var contentURL = seo.contentURL();
            var embedURL = seo.embedURL();
            var uploadDate = seo.uploadDate();
            var duration = seo.duration();
            var expires = seo.expires();
            var height = seo.height();
            var width = seo.width();
            if (name == null) {
                name = videoScript.getHeaderTitle();
            }
            if (thumbnailURL == null) {
                thumbnailURL = videoScript.getHeaderPoster();
            }
            if (contentURL == null) {
                var start = videoScript.getHeaderStart();
                contentURL = videoScript.getFragmentVideoMp4Hq(start);
                if (contentURL == null) {
                    contentURL = videoScript.getFragmentVideoMp4Lq(start);
                }
            }
            var videosUri = pingvp_PingVpConfigRead.get().videosUri;
            var deductEmbed = false;
            if (height != null) {
                _node.prepend('<meta itemprop="height" content="' + height + '" />');
            }
            if (width != null) {
                _node.prepend('<meta itemprop="width" content="' + width + '" />');
            }
            if (expires != null) {
                _node.prepend('<meta itemprop="expires" content="' + expires + '" />');
            }
            if (duration != null) {
                _node.prepend('<meta itemprop="duration" content="' + duration + '" />');
            }
            if (uploadDate != null) {
                _node.prepend('<meta itemprop="uploadDate" content="' + uploadDate + '" />');
            }
            if (deductEmbed) {
                var debug = false;
                var language = "English";
                var select = "Flash";
                var scriptName = "01_kpn_compleet_base_5euro";
                var playerUri = pingvp_PingVpConfigRead.get().playerUri;
                var embedUrl =
                    playerUri +
                    "embed.php?video=" +
                    encodeURIComponent(scriptName) +
                    "&debug=" +
                    (debug ? "true" : "false") +
                    "&language=" +
                    encodeURIComponent(language) +
                    "&select=" +
                    encodeURIComponent(select) +
                    "&controls=" +
                    (this._controlsBelowVideo ? "below" : "fade");
                _node.prepend('<meta itemprop="embedURL" content="' + embedUrl + '" />');
            } else {
                if (embedURL != null) {
                    _node.prepend('<meta itemprop="embedURL" content="' + embedURL + '" />');
                }
            }
            if (contentURL != null) {
                _node.prepend('<meta itemprop="contentURL" content="' + videosUri + contentURL + '" />');
            }
            if (thumbnailURL != null) {
                _node.prepend('<meta itemprop="thumbnailURL" content="' + thumbnailURL + '" />');
            }
            if (keywords != null) {
                _node.prepend('<meta itemprop="keywords" content="' + keywords + '" />');
            }
            if (transcript != null) {
                _node.prepend('<meta itemprop="transcript" content="' + transcript + '" />');
            }
            if (description != null) {
                if (videoScript.getHeaderDescription()) {
                    _node.attr("alt", description);
                }
                _node.prepend('<meta itemprop="description" content="' + description + '" />');
            }
            if (name != null) {
                _node.prepend('<meta itemprop="name" content="' + name + '" />');
            }
        },
        setResponsiveSize: function (responsiveWidth, responsiveHeight) {
            this._responsiveWidth = responsiveWidth;
            this._responsiveHeight = responsiveHeight;
        },
        hide: function () {
            this._overlayPlayContainer.css("display", "none");
        },
        show: function () {
            this._overlayPlayContainer.css("display", "block");
        },
        enableOverlayPlay: function (funOverlayPlayReturn) {
            if (!this._isOverlayPlay) {
                return;
            }
            if (this._overlayPlayEnable) {
                return;
            }
            this._overlayPlayBgJq.off();
            this._funOverlayPlayReturn = funOverlayPlayReturn;
            this._overlayPlayEnable = true;
            this._overlayPlayContainer.css("position", "fixed");
            this._overlayPlayBgJq.click($bind(this, this.onDisable));
            this._overlayPlayContainer.css("zIndex", "90001");
            this._overlayPlayBgJq.css("display", "block");
            this._overlayPlayBgJq.css("zIndex", "90000");
            this._overlayPlayBgJq.css("position", "absolute");
            this._overlayPlayBgJq.css("backgroundColor", "#000");
            this._overlayPlayBgJq.css("opacity", "0.4");
            this.resize();
        },
        onDisable: function (e) {
            if (!this._isOverlayPlay) {
                return;
            }
            this._overlayPlayBgJq.css("display", "none");
            this._overlayPlayContainer.css("top", "0");
            this._overlayPlayContainer.css("left", "0");
            this._overlayPlayContainer.css("width", "100%");
            this._overlayPlayContainer.css("height", "100%");
            this._overlayPlayContainer.css("position", "relative");
            this._overlayPlayContainer.css("zIndex", "auto");
            this._overlayPlayBgJq.css("zIndex", "auto");
            this._overlayPlayEnable = false;
            if (this._funOverlayPlayReturn != null) {
                this._funOverlayPlayReturn();
            }
        },
        setOverlayPlayEnable: function (newX) {
            this._overlayPlayEnable = newX;
        },
        getWidth: function () {
            return this._videoContainer.width();
        },
        getHeight: function () {
            return this._videoContainer.height();
        },
        get: function () {
            return this._videoContainer;
        },
        getVideoContainer: function () {
            return this._videoContainer;
        },
        reset: function () {
            this._overlayPlayContainer.append(this._videoContainer);
        },
        resize: function () {
            if (this._isOverlayPlay && this._overlayPlayEnable) {
                var controlsHeight = this._controlsBelowVideo ? 40 : 0;
                var docWidth = $(window.document).width();
                var docHeight = $(window.document).height();
                var windowWidth = $(window).width();
                var windowHeight = $(window).height();
                var padding = 30;
                var playerWidth = 0;
                var playerHeight = 0;
                if (windowHeight - padding - padding - controlsHeight < ((windowWidth - padding - padding) * this._responsiveHeight) / this._responsiveWidth) {
                    playerHeight = windowHeight - padding - padding;
                    playerWidth = (playerHeight * this._responsiveWidth) / this._responsiveHeight;
                    playerHeight += controlsHeight;
                } else {
                    playerWidth = windowWidth - padding - padding;
                    playerHeight = (playerWidth * this._responsiveHeight) / this._responsiveWidth + controlsHeight;
                }
                this._overlayPlayContainer.css("top", (windowHeight - playerHeight) / 2 + "px");
                this._overlayPlayContainer.css("left", (windowWidth - playerWidth) / 2 + "px");
                this._overlayPlayContainer.css("width", ((playerWidth + 0.5) | 0) + "px");
                this._overlayPlayContainer.css("height", ((playerHeight + 0.5) | 0) + "px");
                this._overlayPlayBgJq.css("width", docWidth + "px");
                this._overlayPlayBgJq.css("height", docHeight + "px");
            }
        },
        __class__: pingvp_PingVpVideoContainer,
    };
    var pingvp_PingVpVideoScript = function (videoOid, videoScript, successCall, failedCall) {
        this._videoScript = videoScript;
        this._successCall = successCall;
        this._failedCall = failedCall;
        this._videoOid = videoOid;
    };
    $hxClasses["pingvp.PingVpVideoScript"] = pingvp_PingVpVideoScript;
    pingvp_PingVpVideoScript.__name__ = ["pingvp", "PingVpVideoScript"];
    pingvp_PingVpVideoScript.prototype = {
        jsonObject: function () {
            return this._data;
        },
        setJsonObject: function (data) {
            this._data = data;
        },
        load: function () {
            $.ajax({ type: "GET", url: this._videoScript, contentType: "application/json", dataType: "jsonp", success: $bind(this, this.onJsonRetrieve), error: $bind(this, this.onFailure) });
        },
        onJsonRetrieve: function (data) {
            this._data = data;
            this._successCall(data);
        },
        onFailure: function (e) {
            this._failedCall();
        },
        getLinkedVideoScriptList: function () {
            var linkedVideoScriptList = [];
            if (this._data == null) {
                return [];
            }
            var _g = 0;
            var _g1 = Reflect.fields(this._data);
            while (_g < _g1.length) {
                var fragmentKey = _g1[_g];
                ++_g;
                if (fragmentKey == "header") {
                    continue;
                }
                if (fragmentKey == "branded_studio") {
                    continue;
                }
                var fragmentValue = Reflect.field(this._data, fragmentKey);
                if (fragmentValue == null) {
                    return [];
                }
                if (fragmentValue.commands == null) {
                    return [];
                }
                var _g2 = 0;
                var _g3 = Reflect.fields(fragmentValue.commands);
                while (_g2 < _g3.length) {
                    var commandKey = _g3[_g2];
                    ++_g2;
                    var commandValue = Reflect.field(fragmentValue.commands, commandKey);
                    if (commandValue.videoScriptName != null) {
                        linkedVideoScriptList.push(commandValue.videoScriptName);
                    }
                }
            }
            return linkedVideoScriptList;
        },
        getHeaderBrandName: function (defaultValue) {
            return this.getHeaderHelper("brandName", defaultValue);
        },
        getHeaderBrandUrl: function (defaultValue) {
            return this.getHeaderHelper("brandUrl", defaultValue);
        },
        getVideoName: function () {
            return this.getFragmentSuccessHelper("_videoScriptName");
        },
        getHeaderUuid: function () {
            return this.getHeaderHelper("uuid", "");
        },
        getHeaderTitle: function () {
            return this.getHeaderHelper("title", "");
        },
        getHeaderStart: function () {
            return this.getHeaderHelper("start", "");
        },
        getHeaderPoster: function () {
            return this.getHeaderHelper("poster", "");
        },
        getHeaderPosterRatio: function () {
            return this.getHeaderHelper("posterRatio", "");
        },
        getHeaderSpeed: function () {
            return this.getHeaderBoolHelper("speed");
        },
        getHeaderShare: function () {
            return this.getHeaderBoolHelper("share");
        },
        getHeaderTheme: function () {
            return this.getHeaderHelper("theme", "");
        },
        getShowPlay: function () {
            return this.getHeaderBoolHelper("showPlay");
        },
        getHeaderTimeColor: function () {
            return this.getHeaderHelper("timeColor", "");
        },
        getHeaderSubtitlesBg: function () {
            return this.getHeaderHelper("subtitlesBg", "");
        },
        getHeaderDefaultColor: function () {
            return this.getHeaderHelper("defaultColor", "");
        },
        getHeaderHoverColor: function () {
            return this.getHeaderHelper("hoverColor", "");
        },
        getHeaderAnalytics: function () {
            return this.getHeaderHelper("analytics", "");
        },
        getHeaderFallbackPoster: function () {
            return this.getHeaderHelper("fallbackPoster", "");
        },
        getHeaderSelect: function () {
            return this.getHeaderHelper("select", "");
        },
        getHeaderDebug: function () {
            return this.getHeaderBoolHelper("debug");
        },
        getHeaderControlsBelow: function () {
            return this.getHeaderHelper("controls", "") == "below";
        },
        getHeaderControlsDisable: function () {
            return this.getHeaderHelper("controls", "") == "disable";
        },
        getHeaderAutoStart: function () {
            return this.getHeaderBoolHelper("autoStart");
        },
        getHeaderAutoHeight: function () {
            return this.getHeaderBoolHelper("autoHeight");
        },
        getHeaderOverlayPlay: function () {
            return this.getHeaderBoolHelper("overlayPlay");
        },
        getHeaderInlinePlay: function () {
            return this.getHeaderBoolHelper("inlinePlay");
        },
        getHeaderVideoQuality: function () {
            return this.getHeaderHelper("videoQuality", "HQ");
        },
        getHeaderDescription: function () {
            return this.getHeaderBoolHelper("description");
        },
        checktHeader: function (header) {
            if (this._data == null) {
                return false;
            }
            if (this._data.header == null) {
                return false;
            }
            return Reflect.field(this._data.header, header) != null;
        },
        getHeaderFallbackImage: function () {
            return this.getHeaderHelper("fallbackImage", "");
        },
        getHeaderFallbackMp4: function () {
            return this.getHeaderHelper("fallbackVideoMp4", "");
        },
        getHeaderFallbackWebm: function () {
            return this.getHeaderHelper("fallbackVideoWebm", "");
        },
        getHeaderFallbackOgv: function () {
            return this.getHeaderHelper("fallbackVideoOgv", "");
        },
        checkFragment: function (fragment) {
            if (this._data == null) {
                return false;
            }
            return Reflect.field(this._data, fragment) != null;
        },
        getFragmentOnEndRepeat: function (fragment) {
            return this.getFragmentHeaderBoolHelper(fragment, "endRepeat", false);
        },
        getFragmentOnEndVideoLoad: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "endVideoLoad");
        },
        getFragmentOnEndVideoScript: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "endVideoScript");
        },
        getFragmentVideoTitle: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "title");
        },
        getFragmentVideoUuid: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "uuid");
        },
        getFragmentVideoMp4Lq: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "mp4Lq");
        },
        getFragmentVideoWebmLq: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "webmLq");
        },
        getFragmentVideoOgvLq: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "ogvLq");
        },
        getFragmentVideoMp4Hq: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "mp4Hq");
        },
        getFragmentVideoWebmHq: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "webmHq");
        },
        getFragmentVideoOgvHq: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "ogvHq");
        },
        getFragmentVideoWidth: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "width", 640);
        },
        getFragmentVideoHeight: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "height", 360);
        },
        getFragmentCanvasVideoWidth: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "canvasVideoWidth", 640);
        },
        getFragmentCanvasVideoHeight: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "canvasVideoHeight", 360);
        },
        getFragmentHeaderCanvasFramesPerSec: function (fragment, defaultValue) {
            return this.getFragmentHeaderFloatHelper(fragment, "canvasFramesPerSec", defaultValue) | 0;
        },
        getFragmentHeaderCanvasAudioVideoSync: function (fragment, defaultValue) {
            return this.getFragmentHeaderFloatHelper(fragment, "canvasAudioVideoSync", defaultValue) | 0;
        },
        getFragmentHeaderCanvasBufferSize: function (fragment, defaultValue) {
            return this.getFragmentHeaderFloatHelper(fragment, "canvasBufferSize", defaultValue) | 0;
        },
        getFragmentHeaderCanvasVideo: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "canvasVideo");
        },
        getFragmentHeaderFlashSync: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "flashSync", 0);
        },
        getFragmentHeaderHtml5Sync: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "html5Sync", 0);
        },
        getFragmentHeaderCanvasSync: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "canvasSync", 0);
        },
        getFragmentHeaderHtml5DurationCorrection: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "html5DurationCorrection", 0);
        },
        getFragmentHeaderCanvasDurationCorrection: function (fragment) {
            return this.getFragmentHeaderFloatHelper(fragment, "canvasDurationCorrection", 0);
        },
        getFragmentHeaderNumberFramesPerChunk: function (fragment, defaultValue) {
            return this.getFragmentHeaderIntHelper(fragment, "numberFramesPerChunk", defaultValue);
        },
        getFragmentCommands: function (fragment) {
            if (this._data == null) {
                return "";
            }
            return Reflect.field(this._data, fragment).commands;
        },
        getFragmentSubtitles: function (fragment) {
            var result = [];
            if (this._data == null) {
                return result;
            }
            var arr = Reflect.field(this._data, fragment).subtitles;
            if (arr == null) {
                return result;
            }
            if (!(arr instanceof Array && arr.__enum__ == null)) {
                return result;
            }
            var array = arr;
            var _g = 0;
            while (_g < array.length) {
                var sub = array[_g];
                ++_g;
                result.push(new pingvp_PingVpSubtitle(sub));
            }
            return result;
        },
        getFragmentLoop: function (fragment) {
            if (this._data == null) {
                return null;
            }
            var obj = Reflect.field(this._data, fragment).loop;
            if (obj == null) {
                return null;
            }
            return new pingvp_PingVpLoop(obj);
        },
        getFragmentVideoEndCallback: function (fragment) {
            return this.getFragmentHeaderHelper(fragment, "videoEndCallback");
        },
        getHeaderHelper: function (header, defaultValue) {
            if (this._data == null) {
                return defaultValue;
            }
            if (this._data.header == null) {
                return defaultValue;
            }
            var ret = Reflect.field(this._data.header, header);
            if (ret == null) {
                return defaultValue;
            }
            if (ret == null) {
                return "null";
            } else {
                return "" + ret;
            }
        },
        getHeaderFloatHelper: function (header, defaultValue) {
            if (this._data == null) {
                return defaultValue;
            }
            if (this._data.header == null) {
                return defaultValue;
            }
            var ret = Reflect.field(this._data.header, header);
            if (ret == null) {
                return defaultValue;
            }
            return ret;
        },
        getHeaderBoolHelper: function (header) {
            if (this._data == null) {
                return null;
            }
            if (this._data.header == null) {
                return null;
            }
            var ret = Reflect.field(this._data.header, header);
            if (ret == null) {
                return null;
            }
            return ret;
        },
        getBrandedstudioHelper: function () {
            if (this._data == null) {
                return null;
            }
            if (this._data.branded_studio == null) {
                return null;
            }
            return this._data.branded_studio != null;
        },
        getBrandedstudioCheckHelper: function (key) {
            if (this._data == null) {
                return null;
            }
            if (this._data.branded_studio == null) {
                return null;
            }
            var ret = Reflect.field(this._data.branded_studio, key);
            if (ret == null) {
                return null;
            }
            return ret != null;
        },
        getBrandedstudioLogoHelper: function (key) {
            if (this._data == null) {
                return null;
            }
            if (this._data.branded_studio.logo == null) {
                return null;
            }
            var ret = Reflect.field(this._data.branded_studio.logo, key);
            if (ret == null) {
                return null;
            }
            if (ret == null) {
                return "null";
            } else {
                return "" + ret;
            }
        },
        getBrandedstudioEndcardHelper: function (key) {
            if (this._data == null) {
                return null;
            }
            if (this._data.branded_studio.endcard == null) {
                return null;
            }
            var ret = Reflect.field(this._data.branded_studio.endcard, key);
            if (ret == null) {
                return null;
            }
            if (ret == null) {
                return "null";
            } else {
                return "" + ret;
            }
        },
        getFragmentHeaderHelper: function (fragment, header) {
            if (this._data == null) {
                return "";
            }
            if (fragment == "header") {
                return "";
            }
            var frag = Reflect.field(this._data, fragment);
            if (frag == null) {
                return "";
            }
            if (frag.video == null) {
                return "";
            }
            var ret = Reflect.field(frag.video, header);
            if (ret == null) {
                return "";
            }
            if (ret == null) {
                return "null";
            } else {
                return "" + ret;
            }
        },
        getFragmentHeaderFloatHelper: function (fragment, header, defaultValue) {
            if (this._data == null) {
                return defaultValue;
            }
            if (fragment == "header") {
                return defaultValue;
            }
            var frag = Reflect.field(this._data, fragment);
            if (frag == null) {
                return defaultValue;
            }
            if (frag.video == null) {
                return defaultValue;
            }
            var ret = Reflect.field(frag.video, header);
            if (ret == null) {
                return defaultValue;
            }
            return ret;
        },
        getFragmentSuccessHelper: function (header) {
            if (this._successCall == null) {
                return "";
            }
            var scope = Reflect.field(this._successCall, "scope");
            if (scope == null) {
                return "";
            }
            var ret = Reflect.field(scope, header);
            if (ret == null) {
                return "";
            }
            if (ret == null) {
                return "null";
            } else {
                return "" + ret;
            }
        },
        getFragmentHeaderIntHelper: function (fragment, header, defaultValue) {
            if (this._data == null) {
                return defaultValue;
            }
            if (fragment == "header") {
                return defaultValue;
            }
            var value = Reflect.field(this._data, fragment);
            if (value == null) {
                return defaultValue;
            }
            if (value.video == null) {
                return defaultValue;
            }
            var ret = Reflect.field(value.video, header);
            if (ret == null) {
                return defaultValue;
            }
            return ret;
        },
        getFragmentHeaderBoolHelper: function (fragment, header, defaultValue) {
            if (this._data == null) {
                return defaultValue;
            }
            if (fragment == "header") {
                return defaultValue;
            }
            var value = Reflect.field(this._data, fragment);
            if (value == null) {
                return defaultValue;
            }
            if (value.video == null) {
                return defaultValue;
            }
            var ret = Reflect.field(value.video, header);
            if (ret == null) {
                return defaultValue;
            }
            return ret;
        },
        getSeo: function () {
            if (this._data == null) {
                return null;
            }
            if (this._data.seo == null) {
                return null;
            }
            return new pingvp_PingVpSeo(this._data.seo);
        },
        __class__: pingvp_PingVpVideoScript,
    };
    var pingvp_PingVpVideoScriptSelect = function (videoOid, videoScritpUri, hash) {
        this._hash = hash;
        this._videoOid = videoOid;
        pingvp_PingVpVideoScriptsCollection.init(videoScritpUri);
    };
    $hxClasses["pingvp.PingVpVideoScriptSelect"] = pingvp_PingVpVideoScriptSelect;
    pingvp_PingVpVideoScriptSelect.__name__ = ["pingvp", "PingVpVideoScriptSelect"];
    pingvp_PingVpVideoScriptSelect.prototype = {
        select: function (videoScriptName, funOnSuccess, funOnFailure) {
            this._videoScriptName = videoScriptName;
            this._funOnSuccess = funOnSuccess;
            pingvp_PingVpVideoScriptsCollection.select(this._videoOid, this._videoScriptName, this._hash, $bind(this, this.onSuccess), funOnFailure);
        },
        script: function () {
            return pingvp_PingVpVideoScriptsCollection.script(this._videoScriptName, this._hash);
        },
        name: function () {
            return this._videoScriptName;
        },
        onSuccess: function (data) {
            if (this.script()._data == null) {
                this.script().setJsonObject(data);
            }
            if (pingvp_PingVpDevice.isAllMobileDevices()) {
                var videoScript = this.script();
                var videoScriptNameList = videoScript.getLinkedVideoScriptList();
                var _g = 0;
                while (_g < videoScriptNameList.length) {
                    var videoScriptName = videoScriptNameList[_g];
                    ++_g;
                    pingvp_PingVpVideoScriptsCollection.select(
                        this._videoOid,
                        videoScriptName,
                        this._hash,
                        function () {},
                        function () {}
                    );
                }
            }
            if (this._funOnSuccess != null) {
                this._funOnSuccess();
            }
        },
        __class__: pingvp_PingVpVideoScriptSelect,
    };
    var pingvp_PingVpVideoScriptsCollection = ($hx_exports.pingvp["PingVpVideoScriptsCollection"] = function () {});
    $hxClasses["pingvp.PingVpVideoScriptsCollection"] = pingvp_PingVpVideoScriptsCollection;
    pingvp_PingVpVideoScriptsCollection.__name__ = ["pingvp", "PingVpVideoScriptsCollection"];
    pingvp_PingVpVideoScriptsCollection.init = function (videoScriptsUri) {
        pingvp_PingVpVideoScriptsCollection._videoScriptsUri = videoScriptsUri;
    };
    pingvp_PingVpVideoScriptsCollection.select = function (videoOid, name, hash, successCall, failedCall) {
        var videoScriptAdrress = pingvp_PingVpVideoScriptsCollection._videoScriptsUri + "jsonp.php?name=" + encodeURIComponent(name) + "&hash=" + encodeURIComponent(hash);
        var mapId = name + "::" + hash;
        var this1 = pingvp_PingVpVideoScriptsCollection._scripts;
        var v = new pingvp_PingVpVideoScript(videoOid, videoScriptAdrress, successCall, failedCall);
        var _this = this1;
        if (__map_reserved[mapId] != null) {
            _this.setReserved(mapId, v);
        } else {
            _this.h[mapId] = v;
        }
        var _this1 = pingvp_PingVpVideoScriptsCollection._scripts;
        (__map_reserved[mapId] != null ? _this1.getReserved(mapId) : _this1.h[mapId]).load();
    };
    pingvp_PingVpVideoScriptsCollection.script = function (name, hash) {
        var mapId = name + "::" + hash;
        var _this = pingvp_PingVpVideoScriptsCollection._scripts;
        if (__map_reserved[mapId] != null) {
            return _this.getReserved(mapId);
        } else {
            return _this.h[mapId];
        }
    };
    pingvp_PingVpVideoScriptsCollection.jsonObject = function (name, hash) {
        var mapId = name + "::" + hash;
        var _this = pingvp_PingVpVideoScriptsCollection._scripts;
        if ((__map_reserved[mapId] != null ? _this.getReserved(mapId) : _this.h[mapId]) == null) {
            return null;
        }
        var _this1 = pingvp_PingVpVideoScriptsCollection._scripts;
        return (__map_reserved[mapId] != null ? _this1.getReserved(mapId) : _this1.h[mapId]).jsonObject();
    };
    var pingvp_PingVpWebSocketSender = function (playerOid) {
        this._playerOid = playerOid;
        this._events = [];
        this._errorsCount = 0;
        this._logEnabled = true;
        this.reset();
    };
    $hxClasses["pingvp.PingVpWebSocketSender"] = pingvp_PingVpWebSocketSender;
    pingvp_PingVpWebSocketSender.__name__ = ["pingvp", "PingVpWebSocketSender"];
    pingvp_PingVpWebSocketSender.prototype = {
        reset: function () {
            this._productionUuid = null;
            this._productionTitle = null;
            this._fragmentUuid = null;
            this._fragmentTitle = null;
            this._percent = -1;
        },
        update: function (productionUuid, productionTitle, fragmentUuid, fragmentTitle, percent, action) {
            var info = {};
            var hasData = false;
            if (this._productionUuid != productionUuid) {
                this._productionUuid = productionUuid;
                info.pid = productionUuid;
            }
            if (this._productionTitle != productionTitle) {
                this._productionTitle = productionTitle;
                info.ptitle = productionTitle;
            }
            if (this._fragmentUuid != fragmentUuid) {
                this._fragmentUuid = fragmentUuid;
                info.fid = fragmentUuid;
            }
            if (this._fragmentTitle != fragmentTitle) {
                this._fragmentTitle = fragmentTitle;
                info.ftitle = fragmentTitle;
            }
            if (this._percent != percent) {
                this._percent = percent;
                info.pct = percent;
            }
            if (this._screenWidth != window.screen.width) {
                this._screenWidth = window.screen.width;
                info.sw = window.screen.width;
            }
            if (this._screenHeight != window.screen.height) {
                this._screenHeight = window.screen.height;
                info.sh = window.screen.height;
            }
            if (JSON.stringify(info).length <= 2) {
                return;
            }
            info.act = action;
            this.pushEvent(JSON.stringify(info));
        },
        pushEvent: function (json) {
            if (json.length <= 2) {
                return;
            }
            this._events.push(json);
            this.sendEvents();
        },
        sendEvents: function () {
            if (this._webSocket == null) {
                var delay = this._errorsCount * 2 * 1000;
                if (delay == 0) {
                    this.createConnection();
                } else {
                    haxe_Timer.delay($bind(this, this.createConnection), delay);
                }
                return;
            }
            while (this._events.length > 0) {
                this._webSocket.send(this._events.pop());
            }
        },
        createConnection: function () {
            var _gthis = this;
            var hostname = window.location.hostname;
            var ws = new WebSocket("ws://" + hostname + ":9090");
            ws.onopen = function () {
                if (_gthis._logEnabled) {
                    window.console.log("CONNECT");
                }
                _gthis._webSocket = ws;
                _gthis._errorsCount = 0;
                _gthis.sendEvents();
            };
            ws.onmessage = function (e) {};
            ws.onclose = function () {
                if (_gthis._logEnabled) {
                    window.console.log("DISCONNECT");
                }
                _gthis._webSocket = null;
                _gthis._errorsCount++;
                _gthis.reset();
            };
            ws.onerror = function () {
                if (_gthis._logEnabled) {
                    window.console.log("FAILURE");
                }
                ws.close();
                _gthis._webSocket = null;
                _gthis._errorsCount++;
                _gthis.reset();
            };
        },
        __class__: pingvp_PingVpWebSocketSender,
    };
    var pingvp_PreloadedImage = function (imageUrl, hover) {
        this._hover = hover;
        this._image = window.document.createElement("img");
        this._imageContainer = window.document.createElement("div");
        this._image.style.position = "absolute";
        this._image.src = imageUrl;
        if (hover) {
            this._imageContainer.style.width = "300%";
            this._image.onmouseover = $bind(this, this.hoverIn);
            this._image.onmouseleave = $bind(this, this.hoverOut);
            this._image.onclick = $bind(this, this.onClick);
        } else {
            this._imageContainer.style.width = "100%";
        }
        this._image.style.width = "100%";
        this._image.style.height = "100%";
        this._imageContainer.style.height = "100%";
        this._image.onload = $bind(this, this.onImageLoad);
        this._imageContainer.style.position = "absolute";
        this._imageContainer.appendChild(this._image);
    };
    $hxClasses["pingvp.PreloadedImage"] = pingvp_PreloadedImage;
    pingvp_PreloadedImage.__name__ = ["pingvp", "PreloadedImage"];
    pingvp_PreloadedImage.prototype = {
        opacity: function (value) {
            this._image.style.opacity = value + "";
        },
        hoverIn: function (e) {
            this._imageContainer.style.left = "-100%";
        },
        hoverOut: function (e) {
            this._imageContainer.style.left = 0 + "px";
        },
        onClick: function (e) {
            this._imageContainer.style.left = "-200%";
        },
        onImageLoad: function () {},
        getDivElement: function () {
            return this._imageContainer;
        },
        __class__: pingvp_PreloadedImage,
    };
    var pingvp_VsyncTimer = function () {};
    $hxClasses["pingvp.VsyncTimer"] = pingvp_VsyncTimer;
    pingvp_VsyncTimer.__name__ = ["pingvp", "VsyncTimer"];
    pingvp_VsyncTimer.prototype = {
        start: function (call) {
            this._call = call;
            this._loop = true;
            if (window.requestAnimationFrame) {
                this._requestAnimationFrame = window.requestAnimationFrame;
            } else {
                if (window.webkitRequestAnimationFrame) {
                    this._requestAnimationFrame = window.webkitRequestAnimationFrame;
                } else {
                    if (window.mozRequestAnimationFrame) {
                        this._requestAnimationFrame = window.mozRequestAnimationFrame;
                    } else {
                        return;
                    }
                }
            }
            var temp = this._requestAnimationFrame;
            temp($bind(this, this.render));
        },
        isSupported: function () {
            if (!(window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame)) {
                return false;
            }
            return true;
        },
        render: function () {
            if (this._loop) {
                var temp = this._requestAnimationFrame;
                temp($bind(this, this.render));
                this._call();
            }
        },
        stop: function () {
            this._loop = false;
        },
        __class__: pingvp_VsyncTimer,
    };
    var pingvp_Webplayer = ($hx_exports.pingvp["Webplayer"] = function (elementId, width, height, video, hash, language, controlsBelow, autoStart, autoHeight, overlayPlay, inlinePlay, debug, startFragment) {
        if (startFragment == null) {
            startFragment = "";
        }
        if (debug == null) {
            debug = false;
        }
        if (inlinePlay == null) {
            inlinePlay = false;
        }
        if (overlayPlay == null) {
            overlayPlay = false;
        }
        if (autoHeight == null) {
            autoHeight = true;
        }
        if (autoStart == null) {
            autoStart = false;
        }
        if (controlsBelow == null) {
            controlsBelow = false;
        }
        if (language == null) {
            language = "English";
        }
        if (hash == null) {
            hash = "";
        }
        if (video == null) {
            video = "";
        }
        if (height == null) {
            height = 0;
        }
        if (width == null) {
            width = 0;
        }
        pingvp_Webplayer._playerSerial++;
        this.pingVpFunctions = window.pingVpFunctions;
        var elementJq = $("#" + elementId);
        elementJq.empty();
        elementJq.addClass("pingVpWebplayerSelector");
        if (elementJq.css("position") != "relative" || elementJq.css("position") != "absolute") {
            elementJq.css("position", "relative");
        }
        if (width != 0) {
            elementJq.width(width);
        }
        if (height != 0) {
            elementJq.height(height);
        }
        this._loader = new pingvp_PingVpLoader(
            pingvp_Webplayer._playerSerial,
            elementJq,
            video,
            hash,
            debug,
            language,
            startFragment,
            "flash",
            controlsBelow,
            false,
            false,
            autoStart,
            autoHeight,
            overlayPlay,
            inlinePlay,
            this.pingVpFunctions
        );
    });
    $hxClasses["pingvp.Webplayer"] = pingvp_Webplayer;
    pingvp_Webplayer.__name__ = ["pingvp", "Webplayer"];
    pingvp_Webplayer.prototype = { __class__: pingvp_Webplayer };
    var pingvp_canvasplayer_CanvasAudio = function (videoOid, baseUrl, funLoadedMetaData, funOnBeginBuffering, funOnEndBuffering, funOnEnd) {
        this._audioElement = window.document.createElement("audio");
        this._audioElement.id = "pingVpAudio-" + videoOid;
        this._audioElement.preload = "auto";
        this._audioElement.src = baseUrl + "audio.mp3";
        this._funLoadedMetaData = funLoadedMetaData;
        this._funOnBeginBuffering = funOnBeginBuffering;
        this._funOnEndBuffering = funOnEndBuffering;
        this._funOnEnd = funOnEnd;
        this._audioElement.addEventListener("loadedmetadata ", $bind(this, this.onLoadedMetaData), false);
        this._audioElement.addEventListener("waiting", $bind(this, this.onBeginBuffering), false);
        this._audioElement.addEventListener("playing", $bind(this, this.onEndBuffering), false);
        this._audioElement.addEventListener("ended", $bind(this, this.onEnd), false);
        if (pingvp_PingVpDevice.isIpad()) {
            var f = $bind(this, this.onLoadedMetaData);
            haxe_Timer.delay(function () {
                f(null);
            }, 1000);
        }
    };
    $hxClasses["pingvp.canvasplayer.CanvasAudio"] = pingvp_canvasplayer_CanvasAudio;
    pingvp_canvasplayer_CanvasAudio.__name__ = ["pingvp", "canvasplayer", "CanvasAudio"];
    pingvp_canvasplayer_CanvasAudio.prototype = {
        cleanup: function () {
            this._audioElement.pause();
            this._audioElement = null;
        },
        play: function () {
            this._audioElement.play();
        },
        pause: function () {
            this._audioElement.pause();
        },
        setCurrentTime: function (time) {
            this._audioElement.currentTime = time;
        },
        getFrame: function (fps) {
            return Math.floor(this._audioElement.currentTime.toFixed(5) * fps) + 1;
        },
        getCurrentTime: function () {
            if (this._audioElement.currentTime == null) {
                return 0;
            } else {
                return this._audioElement.currentTime;
            }
        },
        setVolume: function (volume) {
            this._audioElement.volume = volume;
        },
        getVolume: function () {
            return this._audioElement.volume;
        },
        muted: function (value) {
            this._audioElement.muted = value;
        },
        getDuration: function () {
            if (this._audioElement.duration == null) {
                return 0;
            } else {
                return this._audioElement.duration;
            }
        },
        onLoadedMetaData: function (e) {
            if (this._funLoadedMetaData == null) {
                return;
            }
            this._funLoadedMetaData();
        },
        onEnd: function (e) {
            if (this._funOnEnd == null) {
                return;
            }
            this._funOnEnd();
        },
        onBeginBuffering: function (e) {
            if (this._funOnBeginBuffering == null) {
                return;
            }
            this._funOnBeginBuffering();
        },
        onEndBuffering: function (e) {
            if (this._funOnEndBuffering == null) {
                return;
            }
            this._funOnEndBuffering();
        },
        __class__: pingvp_canvasplayer_CanvasAudio,
    };
    var pingvp_canvasplayer_CanvasBuffer = function (size, videoBaseUri, funBufferCheck) {
        this.bufferSize = size;
        this.arraySize = size * 2;
        this.lastBuffredFrame = 0;
        this.baseUri = videoBaseUri;
        this.buffer = [];
        this._funBufferCheck = funBufferCheck;
    };
    $hxClasses["pingvp.canvasplayer.CanvasBuffer"] = pingvp_canvasplayer_CanvasBuffer;
    pingvp_canvasplayer_CanvasBuffer.__name__ = ["pingvp", "canvasplayer", "CanvasBuffer"];
    pingvp_canvasplayer_CanvasBuffer.prototype = {
        buffering: function (currentFrame, totalFrames) {
            var i = this.lastBuffredFrame;
            var tmp = this.lastBuffredFrame < currentFrame;
            if (currentFrame < this.lastBuffredFrame - this.bufferSize) {
                i = currentFrame;
            }
            if (currentFrame > this.lastBuffredFrame) {
                i = currentFrame;
            }
            while (i < currentFrame + this.bufferSize && i < totalFrames) {
                this.buffer[i % this.arraySize] = new pingvp_PingVpCanvasFrame(this.baseUri, i, this._funBufferCheck);
                ++i;
            }
            this.lastBuffredFrame = i;
        },
        getSequenceImage: function (frame) {
            if (this.buffer[frame % this.arraySize] == null) {
                return null;
            }
            if (this.buffer[frame % this.arraySize].getFrameNo() != frame) {
                this.buffer[frame % this.arraySize] = new pingvp_PingVpCanvasFrame(this.baseUri, frame, this._funBufferCheck);
                this.lastBuffredFrame = frame + 1;
            }
            if (!this.buffer[frame % this.arraySize].getReady()) {
                return null;
            }
            return this.buffer[frame % this.arraySize].getFrameImage();
        },
        bufferCheck: function (frame) {
            var i = 0;
            while (i < this.bufferSize) {
                if (!(this.buffer[(frame + i) % this.arraySize] != null && this.buffer[(frame + i) % this.arraySize].getReady())) {
                    return false;
                }
                ++i;
            }
            return true;
        },
        __class__: pingvp_canvasplayer_CanvasBuffer,
    };
    var pingvp_commons_Command = function (name, time, command, call) {
        this._name = name;
        this._time = time;
        this._command = command;
        this._call = call;
        this._once = true;
    };
    $hxClasses["pingvp.commons.Command"] = pingvp_commons_Command;
    pingvp_commons_Command.__name__ = ["pingvp", "commons", "Command"];
    pingvp_commons_Command.prototype = {
        update: function (currendTime) {
            if (currendTime >= this._time && currendTime < this._time + 0.5) {
                if (this._once) {
                    this._call(this._command);
                    this._once = false;
                }
            } else {
                this._once = true;
            }
        },
        __class__: pingvp_commons_Command,
    };
    var pingvp_fallbackplayer_FallbackVideo = function (node, videoOid, poster, videoMp4, videoWebm, videoOgg, fallbackImg) {
        this._videoElement = window.document.createElement("video");
        this._videoElement.id = "pingVpFallbackVideo-" + videoOid;
        this._videoElement.className += " pingVpFallbackVideo";
        this._videoElement.className += " pingVpReset";
        this._videoElement.controls = true;
        this._videoElement.poster = poster;
        this._videoElement.preload = "auto";
        this._videoMp4 = window.document.createElement("source");
        this._videoMp4.className += " pingVpReset";
        this._videoMp4.src = videoMp4;
        this._videoMp4Type = window.document.createElement("source");
        this._videoMp4Type.className += " pingVpReset";
        this._videoMp4Type.type = "video/mp4";
        this._videoMp4Type.src = videoMp4;
        this._videoWebmType = window.document.createElement("source");
        this._videoWebmType.className += " pingVpReset";
        this._videoWebmType.type = "video/webm";
        this._videoWebmType.src = videoWebm;
        this._videoOgvType = window.document.createElement("source");
        this._videoOgvType.className += " pingVpReset";
        this._videoOgvType.type = "video/ogg";
        this._videoOgvType.src = videoOgg;
        this._fallbackImage = window.document.createElement("img");
        this._fallbackImage.className += " pingVpReset";
        this._fallbackImage.style.width = "100%";
        this._fallbackImage.style.height = "100%";
        this._fallbackImage.alt = "";
        this._fallbackImage.src = fallbackImg;
        this._videoElement.appendChild(this._videoMp4);
        this._videoElement.appendChild(this._videoMp4Type);
        this._videoElement.appendChild(this._videoWebmType);
        this._videoElement.appendChild(this._videoOgvType);
        this._videoElement.appendChild(this._fallbackImage);
        this._videoElement.disablePictureInPicture = true;
        var fc = node.firstChild;
        while (fc != null) {
            node.removeChild(fc);
            fc = node.firstChild;
        }
        node.appendChild(this._videoElement);
    };
    $hxClasses["pingvp.fallbackplayer.FallbackVideo"] = pingvp_fallbackplayer_FallbackVideo;
    pingvp_fallbackplayer_FallbackVideo.__name__ = ["pingvp", "fallbackplayer", "FallbackVideo"];
    pingvp_fallbackplayer_FallbackVideo.prototype = {
        resize: function (width, height) {
            this._videoElement.style.width = width + "px";
            this._videoElement.style.height = height + "px";
        },
        cleanUp: function () {
            this._videoElement.removeChild(this._fallbackImage);
            this._videoElement.removeChild(this._videoOgvType);
            this._videoElement.removeChild(this._videoWebmType);
            this._videoElement.removeChild(this._videoMp4Type);
            this._videoElement.removeChild(this._videoMp4);
            this._videoElement.remove();
            this._fallbackImage = null;
            this._videoOgvType = null;
            this._videoWebmType = null;
            this._videoMp4Type = null;
            this._videoMp4 = null;
            this._videoElement = null;
        },
        __class__: pingvp_fallbackplayer_FallbackVideo,
    };
    var pingvp_gui_fullscreen_FullScreen = function (videoOid) {
        this._fullScreenApi = new pingvp_gui_fullscreen_PingVpFullScreenApi(videoOid);
        this._fullWindow = new pingvp_gui_fullscreen_FullWindow(videoOid);
        this._supportFullScreenApi = !pingvp_PingVpDevice.isAndroidNativeBrowser() && this._fullScreenApi.support();
    };
    $hxClasses["pingvp.gui.fullscreen.FullScreen"] = pingvp_gui_fullscreen_FullScreen;
    pingvp_gui_fullscreen_FullScreen.__name__ = ["pingvp", "gui", "fullscreen", "FullScreen"];
    pingvp_gui_fullscreen_FullScreen.prototype = {
        claenUp: function () {
            this._fullWindow.claenUp();
            this._fullWindow = null;
        },
        setFullScreenEventHandler: function (call) {
            this._fullScreenApi.setFullScreenEventHandler(call);
            this._fullWindow.setOnFullWindow(call);
        },
        setWindowedEventHandler: function (call) {
            this._fullScreenApi.setWindowedEventHandler(call);
            this._fullWindow.setOnWindowed(call);
        },
        support: function () {
            return true;
        },
        isFullWindowSelected: function () {
            return !this._supportFullScreenApi;
        },
        request: function () {
            console.log('Called Request Fullscreen');
            if (this._supportFullScreenApi) {
                return this._fullScreenApi.request();
            }
            this._fullWindow.request();
            return true;
        },
        cancel: function () {
            if (this._supportFullScreenApi) {
                this._fullScreenApi.cancel();
            }
            this._fullWindow.cancel();
        },
        setChild: function (child) {
            if (!this._supportFullScreenApi) {
                this._fullWindow.set(child);
            }
        },
        removeChild: function () {
            if (!this._supportFullScreenApi) {
                this._fullWindow.removeAll();
            }
        },
        zIndex: function (videoOid, blocksAll, z) {
            if (this._supportFullScreenApi) {
                this._fullScreenApi.zIndex(videoOid, blocksAll, z);
                return;
            }
        },
        isNotFramed: function () {
            return window.self == window.top;
        },
        setContainerAbsolute: function (videoOid) {
            if (this._supportFullScreenApi) {
                this._fullScreenApi.setContainerAbsolute(videoOid);
                return;
            }
        },
        setContainerRelative: function (videoOid) {
            if (this._supportFullScreenApi) {
                this._fullScreenApi.setContainerRelative(videoOid);
                return;
            }
        },
        getContainerWidth: function (videoOid) {
            if (this._supportFullScreenApi) {
                return this._fullScreenApi.getContainerWidth(videoOid);
            }
            return window.innerWidth;
        },
        getContainerHeight: function (videoOid) {
            if (this._supportFullScreenApi) {
                return this._fullScreenApi.getContainerHeight(videoOid);
            }
            return window.innerHeight;
        },
        setContainerWidth: function (videoOid, width) {
            if (this._supportFullScreenApi) {
                this._fullScreenApi.setContainerWidth(videoOid, width);
                return;
            }
        },
        setContainerHeight: function (videoOid, height) {
            if (this._supportFullScreenApi) {
                this._fullScreenApi.setContainerHeight(videoOid, height);
                return;
            }
        },
        getVars: function (key) {
            var qs = document.location.search;
            qs = qs.split("+").join(" ");
            var params = {},
                tokens,
                re = /[?&]?([^=]+)=([^&]*)/g;
            while ((tokens = re.exec(qs))) {
                params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
            }
            return params[key];
        },
        __class__: pingvp_gui_fullscreen_FullScreen,
    };
    var pingvp_gui_fullscreen_FullWindow = function (videoOid) {
        this._fullWindowContainer = window.document.createElement("div");
        this._fullWindowContainer.id = "pingVpFullWindowContainer-" + videoOid;
        this._fullWindowContainer.className += " pingVpFullWindowContainer";
        this._fullWindowContainer.className += " pingVpReset";
        this._fullWindowContainer.style.display = "none";
        this._fullWindowContainer.style.position = "fixed";
        this._fullWindowContainer.style.top = "0px";
        this._fullWindowContainer.style.right = "0px";
        this._fullWindowContainer.style.bottom = "0px";
        this._fullWindowContainer.style.left = "0px";
        this._fullWindowContainer.style.width = "100%";
        this._fullWindowContainer.style.height = "100%";
        this._fullWindowContainer.style.backgroundColor = "#000000";
        this._fullWindowContainer.style.zIndex = "2147483646";
        window.document.body.insertBefore(this._fullWindowContainer, window.document.body.firstChild);
    };
    $hxClasses["pingvp.gui.fullscreen.FullWindow"] = pingvp_gui_fullscreen_FullWindow;
    pingvp_gui_fullscreen_FullWindow.__name__ = ["pingvp", "gui", "fullscreen", "FullWindow"];
    pingvp_gui_fullscreen_FullWindow.prototype = {
        claenUp: function () {
            this._fullWindowContainer.parentElement.removeChild(this._fullWindowContainer);
            this._fullWindowContainer = null;
        },
        setOnFullWindow: function (call) {
            this._funOnFullWindow = call;
        },
        setOnWindowed: function (call) {
            this._funOnWindowed = call;
        },
        request: function () {
            this._fullWindowContainer.style.display = "block";
            if (this._funOnFullWindow != null) {
                haxe_Timer.delay(this._funOnFullWindow, 0);
            }
        },
        cancel: function () {
            this._fullWindowContainer.style.display = "none";
            if (this._funOnWindowed != null) {
                haxe_Timer.delay(this._funOnWindowed, 0);
            }
        },
        set: function (child) {
            var node = this._fullWindowContainer;
            var fc = node.firstChild;
            while (fc != null) {
                node.removeChild(fc);
                fc = node.firstChild;
            }
            this._fullWindowContainer.appendChild(child);
        },
        removeAll: function () {
            var node = this._fullWindowContainer;
            var fc = node.firstChild;
            while (fc != null) {
                node.removeChild(fc);
                fc = node.firstChild;
            }
        },
        __class__: pingvp_gui_fullscreen_FullWindow,
    };
    var pingvp_gui_fullscreen_PingVpFullScreenApi = function (videoOid) {
        this._videoOid = videoOid;
        this._isFullScreen = false;
        var element = document.getElementById("pingVpVideoContainer-" + this._videoOid);
        var parent = this;
        element.addEventListener(
            this.fullScreenEventName(),
            function (e) {
                if (parent._isFullScreen) {
                    parent.onWindowed();
                } else {
                    parent.onFullScreen();
                }
                parent._isFullScreen = !parent._isFullScreen;
            },
            false
        );
    };
    $hxClasses["pingvp.gui.fullscreen.PingVpFullScreenApi"] = pingvp_gui_fullscreen_PingVpFullScreenApi;
    pingvp_gui_fullscreen_PingVpFullScreenApi.__name__ = ["pingvp", "gui", "fullscreen", "PingVpFullScreenApi"];
    pingvp_gui_fullscreen_PingVpFullScreenApi.prototype = {
        onFullScreen: function () {
            if (this._fullScreenCall != null) {
                this._fullScreenCall();
            }
        },
        onWindowed: function () {
            if (this._windowedCall != null) {
                this._windowedCall();
            }
        },
        setFullScreenEventHandler: function (call) {
            this._fullScreenCall = call;
        },
        setWindowedEventHandler: function (call) {
            this._windowedCall = call;
        },
        fullScreenEventName: function () {
            if (typeof document.mozCancelFullScreen != "undefined") {
                return "mozfullscreenchange";
            } else {
                if (typeof document.webkitCancelFullScreen != "undefined") {
                    return "webkitfullscreenchange";
                } else {
                    if (typeof document.oCancelFullScreen != "undefined") {
                        return "ofullscreenchange";
                    } else {
                        if (typeof document.msExitFullscreen != "undefined") {
                            return "msfullscreenchange";
                        } else {
                            if (typeof document.khtmlCancelFullScreen != "undefined") {
                                return "khtmlfullscreenchange";
                            } else {
                                return "fullscreenchange";
                            }
                        }
                    }
                }
            }
        },
        support: function () {
            return !(
                typeof document.cancelFullScreen == "undefined" &&
                typeof document.webkitCancelFullScreen == "undefined" &&
                typeof document.mozCancelFullScreen == "undefined" &&
                typeof document.oCancelFullScreen == "undefined" &&
                typeof document.msExitFullscreen == "undefined" &&
                typeof document.khtmlCancelFullScreen == "undefined"
            );
        },
        request: function () {
            var element = document.getElementById("pingVpVideoContainer-" + this._videoOid);
            if (typeof document.cancelFullScreen != "undefined") {
                element.requestFullScreen();
            } else {
                if (typeof document.webkitCancelFullScreen != "undefined") {
                    element.webkitRequestFullScreen();
                } else {
                    if (typeof document.mozCancelFullScreen != "undefined") {
                        element.mozRequestFullScreen();
                    } else {
                        if (typeof document.oCancelFullScreen != "undefined") {
                            element.oRequestFullScreen();
                        } else {
                            if (typeof document.msExitFullscreen != "undefined") {
                                element.msRequestFullscreen();
                            } else {
                                if (typeof document.khtmlCancelFullScreen != "undefined") {
                                    element.khtmlRequestFullScreen();
                                } else {
                                    console.log('returns false');
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
            return true;
        },
        cancel: function () {
            if (typeof document.cancelFullScreen != "undefined") {
                document.cancelFullScreen();
            } else {
                if (typeof document.webkitCancelFullScreen != "undefined") {
                    document.webkitCancelFullScreen();
                } else {
                    if (typeof document.mozCancelFullScreen != "undefined") {
                        document.mozCancelFullScreen();
                    } else {
                        if (typeof document.oCancelFullScreen != "undefined") {
                            document.oCancelFullScreen();
                        } else {
                            if (typeof document.msExitFullscreen != "undefined") {
                                document.msExitFullscreen();
                            } else {
                                if (typeof document.khtmlCancelFullScreen != "undefined") {
                                    document.khtmlCancelFullScreen();
                                } else {
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
            return true;
        },
        zIndex: function (videoOid, blocksAll, z) {
            var blocks = blocksAll.getBlocks();
            var i;
            if (z == "auto") {
                this.resetZIndexHelper("#pingVpVideoContainer-" + videoOid);
                this.resetZIndexHelper("#pingVpVideo-" + videoOid);
                this.resetZIndexHelper("#pingVpOverlay-" + videoOid);
                i = 0;
                while (i < blocks.length) {
                    blocks[i].zIndex("auto");
                    ++i;
                }
                this.resetZIndexHelper("#pingVpControlBar-" + videoOid);
                this.resetZIndexHelper("#pingVpControlShare-" + videoOid);
                this.resetZIndexHelper("#pingVpSubtitles-" + videoOid);
                this.resetZIndexHelper("#pingVpSubtitlesMenu-" + videoOid);
                this.resetZIndexHelper("#pingVpSettingsMenu-" + videoOid);
                this.resetZIndexHelper("#pingVpControlOverlayMobile-" + videoOid);
            } else {
                var zIndex = Std.parseInt(z);
                if (zIndex != null) {
                    this.setZIndexHelper("#pingVpVideoContainer-" + videoOid, zIndex);
                    this.setZIndexHelper("#pingVpVideo-" + videoOid, zIndex + 1);
                    this.setZIndexHelper("#pingVpOverlay-" + videoOid, zIndex + 2);
                    i = 0;
                    while (i < blocks.length) {
                        blocks[i].zIndex(Std.string(zIndex + i + 3));
                        ++i;
                    }
                    this.setZIndexHelper("#pingVpControlBar-" + videoOid, zIndex + i + 4);
                    this.setZIndexHelper("#pingVpControlShare-" + videoOid, zIndex + i + 5);
                    this.setZIndexHelper("#pingVpSubtitles-" + videoOid, zIndex + i + 7);
                    this.setZIndexHelper("#pingVpSubtitlesMenu-" + videoOid, zIndex + i + 8);
                    this.setZIndexHelper("#pingVpSettingsMenu-" + videoOid, zIndex + i + 9);
                    this.setZIndexHelper("#pingVpControlOverlayMobile-" + videoOid, zIndex + i + 10);
                }
            }
        },
        resetZIndexHelper: function (elementName) {
            var jqElement = $(elementName);
            jqElement.css("zIndex", "auto");
        },
        setZIndexHelper: function (elementName, index) {
            var jqElement = $(elementName);
            jqElement.css("zIndex", index);
        },
        getVars: function (key) {
            var qs = document.location.search;
            qs = qs.split("+").join(" ");
            var params = {},
                tokens,
                re = /[?&]?([^=]+)=([^&]*)/g;
            while ((tokens = re.exec(qs))) {
                params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
            }
            return params[key];
        },
        isNotFramed: function () {
            var notFramed = window.self === window.top;
            return notFramed;
        },
        setContainerAbsolute: function (videoOid) {
            $("#pingVpVideoContainer-" + videoOid)
                .parent()
                .css("position", "fixed");
            $("body").parent().css("overflow", "hidden");
        },
        setContainerRelative: function (videoOid) {
            $("#pingVpVideoContainer-" + videoOid)
                .parent()
                .css("position", "relative");
            $("body").parent().css("overflow", "visible");
        },
        getContainerWidth: function (videoOid) {
            return (
                $("#pingVpVideoContainer-" + videoOid)
                    .parent()
                    .width() | 0
            );
        },
        getContainerHeight: function (videoOid) {
            return (
                $("#pingVpVideoContainer-" + videoOid)
                    .parent()
                    .height() | 0
            );
        },
        setContainerWidth: function (videoOid, width) {
            $("#pingVpVideoContainer-" + videoOid)
                .parent()
                .css("width", width);
        },
        setContainerHeight: function (videoOid, height) {
            $("#pingVpVideoContainer-" + videoOid)
                .parent()
                .css("height", height);
        },
        __class__: pingvp_gui_fullscreen_PingVpFullScreenApi,
    };
    var pingvp_html5player_VideoTag = function (videoOid, node, videoMp4, videoWebm, videoOgv, funOnBeginBuffering, funOnEndBuffering, funOnPlay, autoStart) {
        this._videoOid = videoOid;
        this._funOnBeginBuffering = funOnBeginBuffering;
        this._funOnEndBuffering = funOnEndBuffering;
        this._funOnPlay = funOnPlay;
        this._autoStart = autoStart;
        this._videoElement = window.document.createElement("video");
        this._videoElement.id = "pingVpVideo-" + videoOid;
        this._videoElement.className += " pingVpVideo";
        this._videoElement.className += " pingVpReset";
        this._videoElement.setAttribute("playsinline", "");
        var tmp = this._autoStart;
        this._videoElement.setAttribute("disablePictureInPicture", "true");
        this._videoElement.disablePictureInPicture = true;
        this._videoElement.style.width = "100%";
        this._videoElement.style.height = "100%";
        this._videoElement.preload = "auto";
        if (videoMp4 != "" && videoMp4 != null) {
            this._videoMp4 = window.document.createElement("source");
            this._videoMp4.className += " pingVpReset";
            this._videoMp4.src = videoMp4;
            this._videoMp4Type = window.document.createElement("source");
            this._videoMp4Type.className += " pingVpReset";
            this._videoMp4Type.type = "video/mp4";
            this._videoMp4Type.src = videoMp4;
            this._videoElement.appendChild(this._videoMp4);
            this._videoElement.appendChild(this._videoMp4Type);
        }
        this._videoElement.onpause = $bind(this, this.onPause);
        this._videoElement.onended = $bind(this, this.onEnd);
        this._videoElement.onplay = $bind(this, this.onPlay);
        this._videoElement.onloadedmetadata = $bind(this, this.onLoadedMetaData);
        this._videoElement.onwaiting = $bind(this, this.onBeginBuffering);
        this._videoElement.onplaying = $bind(this, this.onEndBuffering);
        this._videoElement.ontimeupdate = $bind(this, this.onEndBuffering);
        var fc = node.firstChild;
        while (fc != null) {
            node.removeChild(fc);
            fc = node.firstChild;
        }
        node.appendChild(this._videoElement);
    };
    $hxClasses["pingvp.html5player.VideoTag"] = pingvp_html5player_VideoTag;
    pingvp_html5player_VideoTag.__name__ = ["pingvp", "html5player", "VideoTag"];
    pingvp_html5player_VideoTag.prototype = {
        cleanUp: function () {
            if (this._videoOgvType != null) {
                this._videoElement.removeChild(this._videoOgvType);
                this._videoOgvType = null;
            }
            if (this._videoWebmType != null) {
                this._videoElement.removeChild(this._videoWebmType);
                this._videoWebmType = null;
            }
            if (this._videoMp4Type != null) {
                this._videoElement.removeChild(this._videoMp4Type);
                this._videoMp4Type = null;
            }
            if (this._videoMp4 != null) {
                this._videoElement.removeChild(this._videoMp4);
                this._videoMp4 = null;
            }
            if (this._videoElement != null) {
                this._videoElement.pause();
                this._videoElement.parentElement.removeChild(this._videoElement);
                this._videoElement = null;
            }
        },
        onPlaySuccess: function () {},
        onPlayFailed: function () {},
        play: function () {
            var promise = null;
            promise = this._videoElement.play();
            if (promise !== undefined) {
                function successFunction() {}
                function failureFunction(err) {}
                promise.then(successFunction, failureFunction);
            }
            if (this._funOnPlay != null) {
                this._funOnPlay();
            }
        },
        pause: function () {
            this._videoElement.pause();
        },
        getDuration: function () {
            return this._videoElement.duration;
        },
        getFrame: function (fps) {
            return Math.floor(this._videoElement.currentTime * fps) + 1;
        },
        getCurrentTime: function () {
            return this._videoElement.currentTime;
        },
        supportBuffered: function () {
            return this._videoElement.buffered != null;
        },
        getBuffered: function () {
            var last = 0;
            var length = this._videoElement.buffered.length;
            var _g1 = 0;
            var _g = length;
            while (_g1 < _g) {
                var i = _g1++;
                var rangeEnd = this._videoElement.buffered.end(i);
                if (last < rangeEnd) {
                    last = rangeEnd;
                }
            }
            return last;
        },
        setCurrentTime: function (time) {
            var calculation = new pingvp_PingVpCalculations();
            time = calculation.trim(time, 6);
            this._videoElement.currentTime = time;
            var tmp = this.getCurrentTime() != time;
        },
        setCurrentTimeDelay: function (time) {
            var _gthis = this;
            this._videoElement.addEventListener(
                "loadeddata",
                function () {
                    _gthis._videoElement.currentTime = time;
                },
                false
            );
        },
        onPause: function (e) {
            if (this._pauseCall != null) {
                this._pauseCall();
            }
        },
        setPauseHandler: function (call) {
            this._pauseCall = call;
        },
        onEnd: function (e) {
            if (this._endCall != null) {
                this._endCall();
            }
        },
        setEndHandler: function (call) {
            this._endCall = call;
        },
        onPlay: function (e) {
            if (this._playCall != null) {
                this._playCall();
            }
        },
        setPlayHandler: function (call) {
            this._playCall = call;
        },
        onLoadedMetaData: function (e) {
            if (this._loadedMetaDataCall != null) {
                this._loadedMetaDataCall();
            }
        },
        setLoadedMetaData: function (call) {
            this._loadedMetaDataCall = call;
        },
        muted: function (value) {
            this._videoElement.muted = value;
        },
        setVolume: function (volume) {
            this._videoElement.volume = volume;
        },
        getVolume: function () {
            return this._videoElement.volume;
        },
        getPosLeft: function () {
            return this._videoElement.offsetLeft;
        },
        getPosTop: function () {
            return this._videoElement.offsetTop;
        },
        getWidth: function () {
            return this._videoElement.videoWidth;
        },
        getHeight: function () {
            return this._videoElement.videoHeight;
        },
        load: function () {
            this._videoElement.load();
        },
        paddingBottom: function (container, width, height, pixels) {
            this._videoElement.style.marginBottom = pixels + "px";
            this._videoElement.style.bottom = pixels + "px";
            var lHeight = height - pixels;
            this._videoElement.style.width = ((width + 0.5) | 0) + "px";
            this._videoElement.style.height = ((lHeight + 0.5) | 0) + "px";
        },
        onBeginBuffering: function () {
            if (this._funOnBeginBuffering == null) {
                return;
            }
            this._funOnBeginBuffering();
        },
        onEndBuffering: function () {
            if (this._funOnEndBuffering == null) {
                return;
            }
            this._funOnEndBuffering();
        },
        setOnTimeUpdate: function (fun) {
            this._videoElement.addEventListener(
                "timeupdate",
                function (e) {
                    fun();
                },
                false
            );
        },
        isPlaying: function () {
            if (this._videoElement != null) {
                return !this._videoElement.paused;
            } else {
                return false;
            }
        },
        __class__: pingvp_html5player_VideoTag,
    };
    var $_,
        $fid = 0;
    function $bind(o, m) {
        if (m == null) {
            return null;
        }
        if (m.__id__ == null) {
            m.__id__ = $fid++;
        }
        var f;
        if (o.hx__closures__ == null) {
            o.hx__closures__ = {};
        } else {
            f = o.hx__closures__[m.__id__];
        }
        if (f == null) {
            f = function () {
                return f.method.apply(f.scope, arguments);
            };
            f.scope = o;
            f.method = m;
            o.hx__closures__[m.__id__] = f;
        }
        return f;
    }
    $hxClasses.Math = Math;
    String.prototype.__class__ = $hxClasses.String = String;
    String.__name__ = ["String"];
    $hxClasses.Array = Array;
    Array.__name__ = ["Array"];
    Date.prototype.__class__ = $hxClasses.Date = Date;
    Date.__name__ = ["Date"];
    var Int = ($hxClasses.Int = { __name__: ["Int"] });
    var Dynamic = ($hxClasses.Dynamic = { __name__: ["Dynamic"] });
    var Float = ($hxClasses.Float = Number);
    Float.__name__ = ["Float"];
    var Bool = ($hxClasses.Bool = Boolean);
    Bool.__ename__ = ["Bool"];
    var Class = ($hxClasses.Class = { __name__: ["Class"] });
    var Enum = {};
    var __map_reserved = {};
    var ArrayBuffer = $global.ArrayBuffer || js_html_compat_ArrayBuffer;
    if (ArrayBuffer.prototype.slice == null) {
        ArrayBuffer.prototype.slice = js_html_compat_ArrayBuffer.sliceImpl;
    }
    var Uint8Array = $global.Uint8Array || js_html_compat_Uint8Array._new;
    haxe_Serializer.USE_CACHE = false;
    haxe_Serializer.USE_ENUM_INDEX = false;
    haxe_Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
    haxe_Unserializer.DEFAULT_RESOLVER = new haxe__$Unserializer_DefaultResolver();
    haxe_Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
    haxe_ds_ObjectMap.count = 0;
    haxe_remoting_ExternalConnection.connections = new haxe_ds_StringMap();
    js_Boot.__toStr = {}.toString;
    js_html_compat_Uint8Array.BYTES_PER_ELEMENT = 1;
    pingvp_PingVpEach._oid = 1;
    pingvp_PingVpUserAgentSelect.player = 0;
    pingvp_PingVpUserAgentSelect.NONE = 0;
    pingvp_PingVpUserAgentSelect.FLASH = 1;
    pingvp_PingVpUserAgentSelect.HTML5 = 2;
    pingvp_PingVpUserAgentSelect.CANVAS = 3;
    pingvp_PingVpUserAgentSelect.FALLBACK = 4;
    pingvp_PingVpVideoScriptsCollection._scripts = new haxe_ds_StringMap();
    pingvp_Webplayer._playerSerial = 1000;
    Main.main();
})(
    typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this,
    typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
); // ***

 } 
