aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/service/pages
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/monlib/service/pages
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/monlib/service/pages')
-rw-r--r--library/cpp/monlib/service/pages/diag_mon_page.cpp9
-rw-r--r--library/cpp/monlib/service/pages/diag_mon_page.h16
-rw-r--r--library/cpp/monlib/service/pages/html_mon_page.cpp60
-rw-r--r--library/cpp/monlib/service/pages/html_mon_page.h25
-rw-r--r--library/cpp/monlib/service/pages/index_mon_page.cpp151
-rw-r--r--library/cpp/monlib/service/pages/index_mon_page.h38
-rw-r--r--library/cpp/monlib/service/pages/mon_page.cpp36
-rw-r--r--library/cpp/monlib/service/pages/mon_page.h66
-rw-r--r--library/cpp/monlib/service/pages/pre_mon_page.cpp18
-rw-r--r--library/cpp/monlib/service/pages/pre_mon_page.h27
-rw-r--r--library/cpp/monlib/service/pages/registry_mon_page.cpp46
-rw-r--r--library/cpp/monlib/service/pages/registry_mon_page.h32
-rw-r--r--library/cpp/monlib/service/pages/resource_mon_page.cpp49
-rw-r--r--library/cpp/monlib/service/pages/resource_mon_page.h43
-rw-r--r--library/cpp/monlib/service/pages/tablesorter/css_mon_page.h13
-rw-r--r--library/cpp/monlib/service/pages/tablesorter/js_mon_page.h13
-rw-r--r--library/cpp/monlib/service/pages/tablesorter/resources/jquery.tablesorter.css2
-rw-r--r--library/cpp/monlib/service/pages/tablesorter/resources/jquery.tablesorter.js3
-rw-r--r--library/cpp/monlib/service/pages/tablesorter/ya.make14
-rw-r--r--library/cpp/monlib/service/pages/templates.cpp35
-rw-r--r--library/cpp/monlib/service/pages/templates.h268
-rw-r--r--library/cpp/monlib/service/pages/version_mon_page.cpp16
-rw-r--r--library/cpp/monlib/service/pages/version_mon_page.h15
-rw-r--r--library/cpp/monlib/service/pages/ya.make31
24 files changed, 1026 insertions, 0 deletions
diff --git a/library/cpp/monlib/service/pages/diag_mon_page.cpp b/library/cpp/monlib/service/pages/diag_mon_page.cpp
new file mode 100644
index 0000000000..2493ff4fba
--- /dev/null
+++ b/library/cpp/monlib/service/pages/diag_mon_page.cpp
@@ -0,0 +1,9 @@
+#include "diag_mon_page.h"
+
+using namespace NMonitoring;
+
+void TDiagMonPage::OutputText(IOutputStream& out, NMonitoring::IMonHttpRequest& request) {
+ out << "uri: " << request.GetUri() << "\n";
+ out << "path: " << request.GetPath() << "\n";
+ out << "path info: " << request.GetPathInfo() << "\n";
+}
diff --git a/library/cpp/monlib/service/pages/diag_mon_page.h b/library/cpp/monlib/service/pages/diag_mon_page.h
new file mode 100644
index 0000000000..761194d4ec
--- /dev/null
+++ b/library/cpp/monlib/service/pages/diag_mon_page.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#include "pre_mon_page.h"
+
+namespace NMonitoring {
+ // internal diagnostics page
+ struct TDiagMonPage: public TPreMonPage {
+ TDiagMonPage()
+ : TPreMonPage("diag", "Diagnostics Page")
+ {
+ }
+
+ void OutputText(IOutputStream& out, NMonitoring::IMonHttpRequest&) override;
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/html_mon_page.cpp b/library/cpp/monlib/service/pages/html_mon_page.cpp
new file mode 100644
index 0000000000..eb4eb3b66c
--- /dev/null
+++ b/library/cpp/monlib/service/pages/html_mon_page.cpp
@@ -0,0 +1,60 @@
+#include "html_mon_page.h"
+
+#include <library/cpp/monlib/service/pages/templates.h>
+
+using namespace NMonitoring;
+
+void THtmlMonPage::Output(NMonitoring::IMonHttpRequest& request) {
+ IOutputStream& out = request.Output();
+
+ out << HTTPOKHTML;
+ HTML(out) {
+ out << "<!DOCTYPE html>\n";
+ HTML_TAG() {
+ HEAD() {
+ if (!!Title) {
+ out << "<title>" << Title << "</title>\n";
+ }
+ out << "<link rel='stylesheet' href='https://yastatic.net/bootstrap/3.3.1/css/bootstrap.min.css'>\n";
+ out << "<script language='javascript' type='text/javascript' src='https://yastatic.net/jquery/2.1.3/jquery.min.js'></script>\n";
+ out << "<script language='javascript' type='text/javascript' src='https://yastatic.net/bootstrap/3.3.1/js/bootstrap.min.js'></script>\n";
+
+ if (OutputTableSorterJsCss) {
+ out << "<link rel='stylesheet' href='/jquery.tablesorter.css'>\n";
+ out << "<script language='javascript' type='text/javascript' src='/jquery.tablesorter.js'></script>\n";
+ }
+
+ out << "<style type=\"text/css\">\n";
+ out << ".table-nonfluid { width: auto; }\n";
+ out << ".narrow-line50 {line-height: 50%}\n";
+ out << ".narrow-line60 {line-height: 60%}\n";
+ out << ".narrow-line70 {line-height: 70%}\n";
+ out << ".narrow-line80 {line-height: 80%}\n";
+ out << ".narrow-line90 {line-height: 90%}\n";
+ out << "</style>\n";
+ }
+ BODY() {
+ OutputNavBar(out);
+
+ DIV_CLASS("container") {
+ if (!!Title) {
+ out << "<h2>" << Title << "</h2>";
+ }
+ OutputContent(request);
+ }
+ }
+ }
+ }
+}
+
+void THtmlMonPage::NotFound(NMonitoring::IMonHttpRequest& request) const {
+ IOutputStream& out = request.Output();
+ out << HTTPNOTFOUND;
+ out.Flush();
+}
+
+void THtmlMonPage::NoContent(NMonitoring::IMonHttpRequest& request) const {
+ IOutputStream& out = request.Output();
+ out << HTTPNOCONTENT;
+ out.Flush();
+}
diff --git a/library/cpp/monlib/service/pages/html_mon_page.h b/library/cpp/monlib/service/pages/html_mon_page.h
new file mode 100644
index 0000000000..e87c53b62b
--- /dev/null
+++ b/library/cpp/monlib/service/pages/html_mon_page.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "mon_page.h"
+
+namespace NMonitoring {
+ struct THtmlMonPage: public IMonPage {
+ THtmlMonPage(const TString& path,
+ const TString& title = TString(),
+ bool outputTableSorterJsCss = false)
+ : IMonPage(path, title)
+ , OutputTableSorterJsCss(outputTableSorterJsCss)
+ {
+ }
+
+ void Output(NMonitoring::IMonHttpRequest& request) override;
+
+ void NotFound(NMonitoring::IMonHttpRequest& request) const;
+ void NoContent(NMonitoring::IMonHttpRequest& request) const;
+
+ virtual void OutputContent(NMonitoring::IMonHttpRequest& request) = 0;
+
+ bool OutputTableSorterJsCss;
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/index_mon_page.cpp b/library/cpp/monlib/service/pages/index_mon_page.cpp
new file mode 100644
index 0000000000..83ff8b529a
--- /dev/null
+++ b/library/cpp/monlib/service/pages/index_mon_page.cpp
@@ -0,0 +1,151 @@
+#include "index_mon_page.h"
+
+#include <util/generic/cast.h>
+#include <util/string/ascii.h>
+
+using namespace NMonitoring;
+
+void TIndexMonPage::OutputIndexPage(IMonHttpRequest& request) {
+ request.Output() << HTTPOKHTML;
+ request.Output() << "<html>\n";
+ OutputHead(request.Output());
+ OutputBody(request);
+ request.Output() << "</html>\n";
+}
+
+void TIndexMonPage::Output(IMonHttpRequest& request) {
+ TStringBuf pathInfo = request.GetPathInfo();
+ if (pathInfo.empty() || pathInfo == TStringBuf("/")) {
+ OutputIndexPage(request);
+ return;
+ }
+
+ Y_VERIFY(pathInfo.StartsWith('/'));
+
+ TMonPagePtr found;
+ // analogous to CGI PATH_INFO
+ {
+ TGuard<TMutex> g(Mtx);
+ TStringBuf pathTmp = request.GetPathInfo();
+ for (;;) {
+ TPagesByPath::iterator i = PagesByPath.find(pathTmp);
+ if (i != PagesByPath.end()) {
+ found = i->second;
+ pathInfo = request.GetPathInfo().substr(pathTmp.size());
+ Y_VERIFY(pathInfo.empty() || pathInfo.StartsWith('/'));
+ break;
+ }
+ size_t slash = pathTmp.find_last_of('/');
+ Y_VERIFY(slash != TString::npos);
+ pathTmp = pathTmp.substr(0, slash);
+ if (!pathTmp) {
+ break;
+ }
+ }
+ }
+ if (found) {
+ THolder<IMonHttpRequest> child(request.MakeChild(found.Get(), TString{pathInfo}));
+ found->Output(*child);
+ } else {
+ request.Output() << HTTPNOTFOUND;
+ }
+}
+
+void TIndexMonPage::OutputIndex(IOutputStream& out, bool pathEndsWithSlash) {
+ TGuard<TMutex> g(Mtx);
+ for (auto& Page : Pages) {
+ IMonPage* page = Page.Get();
+ if (page->IsInIndex()) {
+ TString pathToDir = "";
+ if (!pathEndsWithSlash) {
+ pathToDir = this->GetPath() + "/";
+ }
+ out << "<a href='" << pathToDir << page->GetPath() << "'>" << page->GetTitle() << "</a><br/>\n";
+ }
+ }
+}
+
+void TIndexMonPage::Register(TMonPagePtr page) {
+ TGuard<TMutex> g(Mtx);
+ auto insres = PagesByPath.insert(std::make_pair("/" + page->GetPath(), page));
+ if (insres.second) {
+ // new unique page just inserted, update Pages
+ Pages.push_back(page);
+ } else {
+ // a page with the given path is already present, replace it with the new page
+
+ // find old page, sorry for O(n)
+ auto it = std::find(Pages.begin(), Pages.end(), insres.first->second);
+ *it = page;
+ // this already present, replace it
+ insres.first->second = page;
+ }
+ page->Parent = this;
+}
+
+TIndexMonPage* TIndexMonPage::RegisterIndexPage(const TString& path, const TString& title) {
+ TGuard<TMutex> g(Mtx);
+ TIndexMonPage* page = VerifyDynamicCast<TIndexMonPage*>(FindPage(path));
+ if (page) {
+ return page;
+ }
+ page = new TIndexMonPage(path, title);
+ Register(page);
+ return VerifyDynamicCast<TIndexMonPage*>(page);
+}
+
+IMonPage* TIndexMonPage::FindPage(const TString& relativePath) {
+ TGuard<TMutex> g(Mtx);
+
+ Y_VERIFY(!relativePath.StartsWith('/'));
+ TPagesByPath::iterator i = PagesByPath.find("/" + relativePath);
+ if (i == PagesByPath.end()) {
+ return nullptr;
+ } else {
+ return i->second.Get();
+ }
+}
+
+TIndexMonPage* TIndexMonPage::FindIndexPage(const TString& relativePath) {
+ return VerifyDynamicCast<TIndexMonPage*>(FindPage(relativePath));
+}
+
+void TIndexMonPage::OutputCommonJsCss(IOutputStream& out) {
+ out << "<link rel='stylesheet' href='https://yastatic.net/bootstrap/3.3.1/css/bootstrap.min.css'>\n";
+ out << "<script language='javascript' type='text/javascript' src='https://yastatic.net/jquery/2.1.3/jquery.min.js'></script>\n";
+ out << "<script language='javascript' type='text/javascript' src='https://yastatic.net/bootstrap/3.3.1/js/bootstrap.min.js'></script>\n";
+}
+
+void TIndexMonPage::OutputHead(IOutputStream& out) {
+ out << "<head>\n";
+ OutputCommonJsCss(out);
+ out << "<title>" << Title << "</title>\n";
+ out << "</head>\n";
+}
+
+void TIndexMonPage::OutputBody(IMonHttpRequest& req) {
+ auto& out = req.Output();
+ out << "<body>\n";
+
+ // part of common navbar
+ OutputNavBar(out);
+
+ out << "<div class='container'>\n"
+ << "<h2>" << Title << "</h2>\n";
+ OutputIndex(out, req.GetPathInfo().EndsWith('/'));
+ out << "<div>\n"
+ << "</body>\n";
+}
+
+void TIndexMonPage::SortPages() {
+ TGuard<TMutex> g(Mtx);
+ std::sort(Pages.begin(), Pages.end(), [](const TMonPagePtr& a, const TMonPagePtr& b) {
+ return AsciiCompareIgnoreCase(a->GetTitle(), b->GetTitle()) < 0;
+ });
+}
+
+void TIndexMonPage::ClearPages() {
+ TGuard<TMutex> g(Mtx);
+ Pages.clear();
+ PagesByPath.clear();
+}
diff --git a/library/cpp/monlib/service/pages/index_mon_page.h b/library/cpp/monlib/service/pages/index_mon_page.h
new file mode 100644
index 0000000000..bf514a3105
--- /dev/null
+++ b/library/cpp/monlib/service/pages/index_mon_page.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "mon_page.h"
+
+namespace NMonitoring {
+ struct TIndexMonPage: public IMonPage {
+ TMutex Mtx;
+ typedef TVector<TMonPagePtr> TPages;
+ TPages Pages;
+ typedef THashMap<TString, TMonPagePtr> TPagesByPath;
+ TPagesByPath PagesByPath;
+
+ TIndexMonPage(const TString& path, const TString& title)
+ : IMonPage(path, title)
+ {
+ }
+
+ ~TIndexMonPage() override {
+ }
+
+ void Output(IMonHttpRequest& request) override;
+ void OutputIndexPage(IMonHttpRequest& request);
+ virtual void OutputIndex(IOutputStream& out, bool pathEndsWithSlash);
+ virtual void OutputCommonJsCss(IOutputStream& out);
+ void OutputHead(IOutputStream& out);
+ void OutputBody(IMonHttpRequest& out);
+
+ void Register(TMonPagePtr page);
+ TIndexMonPage* RegisterIndexPage(const TString& path, const TString& title);
+
+ IMonPage* FindPage(const TString& relativePath);
+ TIndexMonPage* FindIndexPage(const TString& relativePath);
+
+ void SortPages();
+ void ClearPages();
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/mon_page.cpp b/library/cpp/monlib/service/pages/mon_page.cpp
new file mode 100644
index 0000000000..72033b1699
--- /dev/null
+++ b/library/cpp/monlib/service/pages/mon_page.cpp
@@ -0,0 +1,36 @@
+#include "mon_page.h"
+
+using namespace NMonitoring;
+
+IMonPage::IMonPage(const TString& path, const TString& title)
+ : Path(path)
+ , Title(title)
+{
+ Y_VERIFY(!Path.StartsWith('/'));
+ Y_VERIFY(!Path.EndsWith('/'));
+}
+
+void IMonPage::OutputNavBar(IOutputStream& out) {
+ TVector<const IMonPage*> parents;
+ for (const IMonPage* p = this; p; p = p->Parent) {
+ parents.push_back(p);
+ }
+ std::reverse(parents.begin(), parents.end());
+
+ out << "<ol class='breadcrumb'>\n";
+
+ TString absolutePath;
+ for (size_t i = 0; i < parents.size(); ++i) {
+ const TString& title = parents[i]->GetTitle();
+ if (i == parents.size() - 1) {
+ out << "<li>" << title << "</li>\n";
+ } else {
+ if (!absolutePath.EndsWith('/')) {
+ absolutePath += '/';
+ }
+ absolutePath += parents[i]->GetPath();
+ out << "<li class='active'><a href='" << absolutePath << "'>" << title << "</a></li>\n";
+ }
+ }
+ out << "</ol>\n";
+}
diff --git a/library/cpp/monlib/service/pages/mon_page.h b/library/cpp/monlib/service/pages/mon_page.h
new file mode 100644
index 0000000000..e396612bb0
--- /dev/null
+++ b/library/cpp/monlib/service/pages/mon_page.h
@@ -0,0 +1,66 @@
+#pragma once
+
+#include <library/cpp/monlib/service/service.h>
+#include <library/cpp/monlib/service/mon_service_http_request.h>
+
+#include <util/generic/string.h>
+#include <util/generic/ptr.h>
+
+namespace NMonitoring {
+ static const char HTTPOKTEXT[] = "HTTP/1.1 200 Ok\r\nContent-Type: text/plain\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKBIN[] = "HTTP/1.1 200 Ok\r\nContent-Type: application/octet-stream\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKHTML[] = "HTTP/1.1 200 Ok\r\nContent-Type: text/html\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKJSON[] = "HTTP/1.1 200 Ok\r\nContent-Type: application/json\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKSPACK[] = "HTTP/1.1 200 Ok\r\nContent-Type: application/x-solomon-spack\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKPROMETHEUS[] = "HTTP/1.1 200 Ok\r\nContent-Type: text/plain\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKJAVASCRIPT[] = "HTTP/1.1 200 Ok\r\nContent-Type: text/javascript\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKCSS[] = "HTTP/1.1 200 Ok\r\nContent-Type: text/css\r\nConnection: Close\r\n\r\n";
+ static const char HTTPNOCONTENT[] = "HTTP/1.1 204 No content\r\nConnection: Close\r\n\r\n";
+ static const char HTTPNOTFOUND[] = "HTTP/1.1 404 Invalid URI\r\nConnection: Close\r\n\r\nInvalid URL\r\n";
+ static const char HTTPUNAUTHORIZED[] = "HTTP/1.1 401 Unauthorized\r\nConnection: Close\r\n\r\nUnauthorized\r\n";
+ static const char HTTPFORBIDDEN[] = "HTTP/1.1 403 Forbidden\r\nConnection: Close\r\n\r\nForbidden\r\n";
+
+ // Fonts
+ static const char HTTPOKFONTEOT[] = "HTTP/1.1 200 Ok\r\nContent-Type: application/vnd.ms-fontobject\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKFONTTTF[] = "HTTP/1.1 200 Ok\r\nContent-Type: application/x-font-ttf\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKFONTWOFF[] = "HTTP/1.1 200 Ok\r\nContent-Type: application/font-woff\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKFONTWOFF2[] = "HTTP/1.1 200 Ok\r\nContent-Type: application/font-woff2\r\nConnection: Close\r\n\r\n";
+
+ // Images
+ static const char HTTPOKPNG[] = "HTTP/1.1 200 Ok\r\nContent-Type: image/png\r\nConnection: Close\r\n\r\n";
+ static const char HTTPOKSVG[] = "HTTP/1.1 200 Ok\r\nContent-Type: image/svg+xml\r\nConnection: Close\r\n\r\n";
+
+ class IMonPage;
+
+ using TMonPagePtr = TIntrusivePtr<IMonPage>;
+
+ class IMonPage: public TAtomicRefCount<IMonPage> {
+ public:
+ const TString Path;
+ const TString Title;
+ const IMonPage* Parent = nullptr;
+
+ public:
+ IMonPage(const TString& path, const TString& title = TString());
+
+ virtual ~IMonPage() {
+ }
+
+ void OutputNavBar(IOutputStream& out);
+
+ virtual const TString& GetPath() const {
+ return Path;
+ }
+
+ virtual const TString& GetTitle() const {
+ return Title;
+ }
+
+ bool IsInIndex() const {
+ return !Title.empty();
+ }
+
+ virtual void Output(IMonHttpRequest& request) = 0;
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/pre_mon_page.cpp b/library/cpp/monlib/service/pages/pre_mon_page.cpp
new file mode 100644
index 0000000000..fc03a19b80
--- /dev/null
+++ b/library/cpp/monlib/service/pages/pre_mon_page.cpp
@@ -0,0 +1,18 @@
+#include "pre_mon_page.h"
+
+using namespace NMonitoring;
+
+void TPreMonPage::OutputContent(NMonitoring::IMonHttpRequest& request) {
+ auto& out = request.Output();
+ if (PreTag) {
+ BeforePre(request);
+ out << "<pre>\n";
+ OutputText(out, request);
+ out << "</pre>\n";
+ } else {
+ OutputText(out, request);
+ }
+}
+
+void TPreMonPage::BeforePre(NMonitoring::IMonHttpRequest&) {
+}
diff --git a/library/cpp/monlib/service/pages/pre_mon_page.h b/library/cpp/monlib/service/pages/pre_mon_page.h
new file mode 100644
index 0000000000..c9a923d39a
--- /dev/null
+++ b/library/cpp/monlib/service/pages/pre_mon_page.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "html_mon_page.h"
+
+namespace NMonitoring {
+ struct TPreMonPage: public THtmlMonPage {
+ TPreMonPage(const TString& path,
+ const TString& title = TString(),
+ bool preTag = true,
+ bool outputTableSorterJsCss = false)
+ : THtmlMonPage(path, title, outputTableSorterJsCss)
+ , PreTag(preTag)
+ {
+ }
+
+ void OutputContent(NMonitoring::IMonHttpRequest& request) override;
+
+ // hook to customize output
+ virtual void BeforePre(NMonitoring::IMonHttpRequest& request);
+
+ // put your text here
+ virtual void OutputText(IOutputStream& out, NMonitoring::IMonHttpRequest&) = 0;
+
+ const bool PreTag;
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/registry_mon_page.cpp b/library/cpp/monlib/service/pages/registry_mon_page.cpp
new file mode 100644
index 0000000000..c59e50f622
--- /dev/null
+++ b/library/cpp/monlib/service/pages/registry_mon_page.cpp
@@ -0,0 +1,46 @@
+#include "registry_mon_page.h"
+
+#include <library/cpp/monlib/encode/text/text.h>
+#include <library/cpp/monlib/encode/json/json.h>
+#include <library/cpp/monlib/encode/prometheus/prometheus.h>
+#include <library/cpp/monlib/encode/spack/spack_v1.h>
+#include <library/cpp/monlib/service/format.h>
+
+namespace NMonitoring {
+ void TMetricRegistryPage::Output(NMonitoring::IMonHttpRequest& request) {
+ const auto formatStr = TStringBuf{request.GetPathInfo()}.RNextTok('/');
+ auto& out = request.Output();
+
+ if (!formatStr.empty()) {
+ IMetricEncoderPtr encoder;
+ TString resp;
+
+ if (formatStr == TStringBuf("json")) {
+ resp = HTTPOKJSON;
+ encoder = NMonitoring::EncoderJson(&out);
+ } else if (formatStr == TStringBuf("spack")) {
+ resp = HTTPOKSPACK;
+ const auto compression = ParseCompression(request);
+ encoder = NMonitoring::EncoderSpackV1(&out, ETimePrecision::SECONDS, compression);
+ } else if (formatStr == TStringBuf("prometheus")) {
+ resp = HTTPOKPROMETHEUS;
+ encoder = NMonitoring::EncoderPrometheus(&out);
+ } else {
+ ythrow yexception() << "unsupported metric encoding format: " << formatStr;
+ }
+
+ out.Write(resp);
+ RegistryRawPtr_->Accept(TInstant::Zero(), encoder.Get());
+
+ encoder->Close();
+ } else {
+ THtmlMonPage::Output(request);
+ }
+ }
+
+ void TMetricRegistryPage::OutputText(IOutputStream& out, NMonitoring::IMonHttpRequest&) {
+ IMetricEncoderPtr encoder = NMonitoring::EncoderText(&out);
+ RegistryRawPtr_->Accept(TInstant::Zero(), encoder.Get());
+ }
+
+}
diff --git a/library/cpp/monlib/service/pages/registry_mon_page.h b/library/cpp/monlib/service/pages/registry_mon_page.h
new file mode 100644
index 0000000000..2d26d3319c
--- /dev/null
+++ b/library/cpp/monlib/service/pages/registry_mon_page.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include "pre_mon_page.h"
+
+#include <library/cpp/monlib/metrics/metric_registry.h>
+
+namespace NMonitoring {
+ // For now this class can only enumerate all metrics without any grouping or serve JSON/Spack/Prometheus
+ class TMetricRegistryPage: public TPreMonPage {
+ public:
+ TMetricRegistryPage(const TString& path, const TString& title, TAtomicSharedPtr<IMetricSupplier> registry)
+ : TPreMonPage(path, title)
+ , Registry_(registry)
+ , RegistryRawPtr_(Registry_.Get())
+ {
+ }
+
+ TMetricRegistryPage(const TString& path, const TString& title, IMetricSupplier* registry)
+ : TPreMonPage(path, title)
+ , RegistryRawPtr_(registry)
+ {
+ }
+
+ void Output(NMonitoring::IMonHttpRequest& request) override;
+ void OutputText(IOutputStream& out, NMonitoring::IMonHttpRequest&) override;
+
+ private:
+ TAtomicSharedPtr<IMetricSupplier> Registry_;
+ IMetricSupplier* RegistryRawPtr_;
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/resource_mon_page.cpp b/library/cpp/monlib/service/pages/resource_mon_page.cpp
new file mode 100644
index 0000000000..ec4ac6a1a7
--- /dev/null
+++ b/library/cpp/monlib/service/pages/resource_mon_page.cpp
@@ -0,0 +1,49 @@
+#include "resource_mon_page.h"
+
+using namespace NMonitoring;
+
+void TResourceMonPage::Output(NMonitoring::IMonHttpRequest& request) {
+ IOutputStream& out = request.Output();
+ switch (ResourceType) {
+ case TEXT:
+ out << HTTPOKTEXT;
+ break;
+ case JSON:
+ out << HTTPOKJSON;
+ break;
+ case CSS:
+ out << HTTPOKCSS;
+ break;
+ case JAVASCRIPT:
+ out << HTTPOKJAVASCRIPT;
+ break;
+ case FONT_EOT:
+ out << HTTPOKFONTEOT;
+ break;
+ case FONT_TTF:
+ out << HTTPOKFONTTTF;
+ break;
+ case FONT_WOFF:
+ out << HTTPOKFONTWOFF;
+ break;
+ case FONT_WOFF2:
+ out << HTTPOKFONTWOFF2;
+ break;
+ case PNG:
+ out << HTTPOKPNG;
+ break;
+ case SVG:
+ out << HTTPOKSVG;
+ break;
+ default:
+ out << HTTPOKBIN;
+ break;
+ }
+ out << NResource::Find(ResourceName);
+}
+
+void TResourceMonPage::NotFound(NMonitoring::IMonHttpRequest& request) const {
+ IOutputStream& out = request.Output();
+ out << HTTPNOTFOUND;
+ out.Flush();
+}
diff --git a/library/cpp/monlib/service/pages/resource_mon_page.h b/library/cpp/monlib/service/pages/resource_mon_page.h
new file mode 100644
index 0000000000..f6ab67200e
--- /dev/null
+++ b/library/cpp/monlib/service/pages/resource_mon_page.h
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "mon_page.h"
+
+#include <library/cpp/resource/resource.h>
+
+namespace NMonitoring {
+ struct TResourceMonPage: public IMonPage {
+ public:
+ enum EResourceType {
+ BINARY,
+ TEXT,
+ JSON,
+ CSS,
+ JAVASCRIPT,
+
+ FONT_EOT,
+ FONT_TTF,
+ FONT_WOFF,
+ FONT_WOFF2,
+
+ PNG,
+ SVG
+ };
+
+ TResourceMonPage(const TString& path, const TString& resourceName,
+ const EResourceType& resourceType = BINARY)
+ : IMonPage(path, "")
+ , ResourceName(resourceName)
+ , ResourceType(resourceType)
+ {
+ }
+
+ void Output(NMonitoring::IMonHttpRequest& request) override;
+
+ void NotFound(NMonitoring::IMonHttpRequest& request) const;
+
+ private:
+ TString ResourceName;
+ EResourceType ResourceType;
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/tablesorter/css_mon_page.h b/library/cpp/monlib/service/pages/tablesorter/css_mon_page.h
new file mode 100644
index 0000000000..c2c8330089
--- /dev/null
+++ b/library/cpp/monlib/service/pages/tablesorter/css_mon_page.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <library/cpp/monlib/service/pages/resource_mon_page.h>
+
+namespace NMonitoring {
+ struct TTablesorterCssMonPage: public TResourceMonPage {
+ TTablesorterCssMonPage()
+ : TResourceMonPage("jquery.tablesorter.css", "jquery.tablesorter.css", CSS)
+ {
+ }
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/tablesorter/js_mon_page.h b/library/cpp/monlib/service/pages/tablesorter/js_mon_page.h
new file mode 100644
index 0000000000..f8a1d8254e
--- /dev/null
+++ b/library/cpp/monlib/service/pages/tablesorter/js_mon_page.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <library/cpp/monlib/service/pages/resource_mon_page.h>
+
+namespace NMonitoring {
+ struct TTablesorterJsMonPage: public TResourceMonPage {
+ TTablesorterJsMonPage()
+ : TResourceMonPage("jquery.tablesorter.js", "jquery.tablesorter.js", JAVASCRIPT)
+ {
+ }
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/tablesorter/resources/jquery.tablesorter.css b/library/cpp/monlib/service/pages/tablesorter/resources/jquery.tablesorter.css
new file mode 100644
index 0000000000..1e57adfeb3
--- /dev/null
+++ b/library/cpp/monlib/service/pages/tablesorter/resources/jquery.tablesorter.css
@@ -0,0 +1,2 @@
+/* theme.bootstrap.css v2.22.3 */ .tablesorter-bootstrap{width:100%}.tablesorter-bootstrap tfoot td,.tablesorter-bootstrap tfoot th,.tablesorter-bootstrap thead td,.tablesorter-bootstrap thead th{font:14px/20px Arial,Sans-serif;font-weight:700;padding:4px;margin:0 0 18px;background-color:#eee}.tablesorter-bootstrap .tablesorter-header{cursor:pointer}.tablesorter-bootstrap .tablesorter-header-inner{position:relative;padding:4px 18px 4px 4px}.tablesorter-bootstrap .tablesorter-header i.tablesorter-icon{font-size:11px;position:absolute;right:2px;top:50%;margin-top:-7px;width:14px;height:14px;background-repeat:no-repeat;line-height:14px;display:inline-block}.tablesorter-bootstrap .bootstrap-icon-unsorted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAMAAADOvxanAAAAVFBMVEUAAABCQkJZWVkZGRnJyckgICAZGRkZGRn8/PweHh4dHR0aGhoaGhpUVFQbGxvQ0NDc3NxMTExSUlIbGxvr6+s4ODhKSkogICAtLS00NDQzMzMnJydSEPrQAAAAGHRSTlMA1ssZRLgdAQbDyisqsZo8QdXUq0r9xPepSRwiAAAAX0lEQVQI13XHSQKAIAwEwQAKxn13Ev7/T2Pu9qmarJKPXIicI4PH4hxaKNrhm2S8bJK5h4YzKHrzJNtK6yYT/TdXzpS5zuYg4MSQYF6i4IHExdw1UVRi05HPrrvT53a+qyMFC9t04gcAAAAASUVORK5CYII=)}.tablesorter-bootstrap .icon-white.bootstrap-icon-unsorted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOBAMAAAALT/umAAAAKlBMVEUAAAD///////////////////////////////////////////////////+Gu8ovAAAADXRSTlMA4EXKBtQqvR0+sxmalc142gAAAFdJREFUCNdjYGDoamAAAjZbMxCVfvd6AgMDd+3du9UMDKx3hWSvMjBwXZww8RYDGuC53NB8h4GB8a617UUGBs7Yu3cjGRhYVO9eVQFKOskKOQApFmUgBwBZ+xXRTttNdAAAAABJRU5ErkJggg==)}.tablesorter-bootstrap>tbody>tr.odd>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.odd:hover~tr.tablesorter-hasChildRow.odd~.tablesorter-childRow.odd>td{background-color:#f9f9f9}.tablesorter-bootstrap>tbody>tr.even:hover>td,.tablesorter-bootstrap>tbody>tr.hover>td,.tablesorter-bootstrap>tbody>tr.odd:hover>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.even:hover~.tablesorter-childRow.even>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.odd:hover~.tablesorter-childRow.odd>td{background-color:#f5f5f5}.caption,.tablesorter-bootstrap>tbody>tr.even>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.even:hover~tr.tablesorter-hasChildRow.even~.tablesorter-childRow.even>td{background-color:#fff}.tablesorter-bootstrap .tablesorter-processing{background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=);background-position:center center!important;background-repeat:no-repeat!important}.tablesorter-bootstrap .tablesorter-filter-row input.tablesorter-filter,.tablesorter-bootstrap .tablesorter-filter-row select.tablesorter-filter{width:98%;margin:0;padding:4px 6px;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row .tablesorter-filter.disabled{background-color:#eee;color:#555;cursor:not-allowed;border:1px solid #ccc;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.075) inset;box-sizing:border-box;transition:height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row{background-color:#efefef}.tablesorter-bootstrap .tablesorter-filter-row td{background-color:#efefef;line-height:normal;text-align:center;padding:4px 6px;vertical-align:middle;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0}.tablesorter-bootstrap .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter .filtered{display:none}.tablesorter-bootstrap .tablesorter-pager select{padding:4px 6px}.tablesorter-bootstrap .tablesorter-pager .pagedisplay{border:0}.tablesorter-bootstrap tfoot i{font-size:11px}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99}
+/* colored table cells */ .table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5!important}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8!important;color:#468847!important}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6!important;color:#356635!important}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede!important;color:#b94a48!important}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc!important;color:#953b39!important}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3!important;color:#c09853!important}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc!important;color:#a47e3c!important}
diff --git a/library/cpp/monlib/service/pages/tablesorter/resources/jquery.tablesorter.js b/library/cpp/monlib/service/pages/tablesorter/resources/jquery.tablesorter.js
new file mode 100644
index 0000000000..3001b4b833
--- /dev/null
+++ b/library/cpp/monlib/service/pages/tablesorter/resources/jquery.tablesorter.js
@@ -0,0 +1,3 @@
+/* jquery.tablesorter.js v2.22.3 */ !function(e){"use strict";e.extend({tablesorter:new function(){function t(){var e=arguments[0],t=arguments.length>1?Array.prototype.slice.call(arguments):e;"undefined"!=typeof console&&"undefined"!=typeof console.log?console[/error/i.test(e)?"error":/warn/i.test(e)?"warn":"log"](t):alert(t)}function r(e,r){t(e+" ("+((new Date).getTime()-r.getTime())+"ms)")}function s(e){for(var t in e)return!1;return!0}function a(r,s,a,n){for(var o,i,d=v.parsers.length,c=!1,l="",p=!0;""===l&&p;)a++,s[a]?(c=s[a].cells[n],l=v.getElementText(r,c,n),i=e(c),r.debug&&t("Checking if value was empty on row "+a+", column: "+n+': "'+l+'"')):p=!1;for(;--d>=0;)if(o=v.parsers[d],o&&"text"!==o.id&&o.is&&o.is(l,r.table,c,i))return o;return v.getParserById("text")}function n(e,s){var n,o,i,d,c,l,p,u,g,f,h,m,b=e.table,y=0,w="";if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),h="undefined"==typeof s?e.$tbodies:s,m=h.length,0===m)return e.debug?t("Warning: *Empty table!* Not building a parser cache"):"";for(e.debug&&(f=new Date,t("Detecting parsers for each column")),o={extractors:[],parsers:[]};m>y;){if(n=h[y].rows,n.length)for(i=e.columns,d=0;i>d;d++)c=e.$headerIndexed[d],l=v.getColumnData(b,e.headers,d),g=v.getParserById(v.getData(c,l,"extractor")),u=v.getParserById(v.getData(c,l,"sorter")),p="false"===v.getData(c,l,"parser"),e.empties[d]=(v.getData(c,l,"empty")||e.emptyTo||(e.emptyToBottom?"bottom":"top")).toLowerCase(),e.strings[d]=(v.getData(c,l,"string")||e.stringTo||"max").toLowerCase(),p&&(u=v.getParserById("no-parser")),g||(g=!1),u||(u=a(e,n,-1,d)),e.debug&&(w+="column:"+d+"; extractor:"+g.id+"; parser:"+u.id+"; string:"+e.strings[d]+"; empty: "+e.empties[d]+"\n"),o.parsers[d]=u,o.extractors[d]=g;y+=o.parsers.length?m:1}e.debug&&(t(w?w:"No parsers detected"),r("Completed detecting parsers",f)),e.parsers=o.parsers,e.extractors=o.extractors}function o(s,a){var n,o,i,d,c,l,p,u,g,f,h,m,b,y,w=s.config,x=w.parsers;if(w.$tbodies=w.$table.children("tbody:not(."+w.cssInfoBlock+")"),p="undefined"==typeof a?w.$tbodies:a,w.cache={},w.totalRows=0,!x)return w.debug?t("Warning: *Empty table!* Not building a cache"):"";for(w.debug&&(f=new Date),w.showProcessing&&v.isProcessing(s,!0),l=0;l<p.length;l++){for(y=[],n=w.cache[l]={normalized:[]},h=p[l]&&p[l].rows.length||0,d=0;h>d;++d)if(m={child:[],raw:[]},u=e(p[l].rows[d]),g=[],u.hasClass(w.cssChildRow)&&0!==d)for(o=n.normalized.length-1,b=n.normalized[o][w.columns],b.$row=b.$row.add(u),u.prev().hasClass(w.cssChildRow)||u.prev().addClass(v.css.cssHasChild),i=u.children("th, td"),o=b.child.length,b.child[o]=[],c=0;c<w.columns;c++)b.child[o][c]=v.getParsedText(w,i[c],c);else{for(m.$row=u,m.order=d,c=0;c<w.columns;++c)"undefined"!=typeof x[c]?(o=v.getElementText(w,u[0].cells[c],c),m.raw.push(o),i=v.getParsedText(w,u[0].cells[c],c,o),g.push(i),"numeric"===(x[c].type||"").toLowerCase()&&(y[c]=Math.max(Math.abs(i)||0,y[c]||0))):w.debug&&t("No parser found for cell:",u[0].cells[c],"does it have a header?");g[w.columns]=m,n.normalized.push(g)}n.colMax=y,w.totalRows+=n.normalized.length}w.showProcessing&&v.isProcessing(s),w.debug&&r("Building cache for "+h+" rows",f)}function i(e,t){var a,n,o,i,d,c,l,p=e.config,u=p.widgetOptions,g=p.$tbodies,f=[],h=p.cache;if(s(h))return p.appender?p.appender(e,f):e.isUpdating?p.$table.trigger("updateComplete",e):"";for(p.debug&&(l=new Date),c=0;c<g.length;c++)if(o=g.eq(c),o.length){for(i=v.processTbody(e,o,!0),a=h[c].normalized,n=a.length,d=0;n>d;d++)f.push(a[d][p.columns].$row),p.appender&&(!p.pager||p.pager.removeRows&&u.pager_removeRows||p.pager.ajax)||i.append(a[d][p.columns].$row);v.processTbody(e,i,!1)}p.appender&&p.appender(e,f),p.debug&&r("Rebuilt table",l),t||p.appender||v.applyWidget(e),e.isUpdating&&p.$table.trigger("updateComplete",e)}function d(e){return/^d/i.test(e)||1===e}function c(s){var a,n,o,i,c,l,u,g,f=s.config;for(f.headerList=[],f.headerContent=[],f.debug&&(u=new Date),f.columns=v.computeColumnIndex(f.$table.children("thead, tfoot").children("tr")),i=f.cssIcon?'<i class="'+(f.cssIcon===v.css.icon?v.css.icon:f.cssIcon+" "+v.css.icon)+'"></i>':"",f.$headers=e(e.map(e(s).find(f.selectorHeaders),function(t,r){return n=e(t),n.parent().hasClass(f.cssIgnoreRow)?void 0:(a=v.getColumnData(s,f.headers,r,!0),f.headerContent[r]=n.html(),""===f.headerTemplate||n.find("."+v.css.headerIn).length||(c=f.headerTemplate.replace(/\{content\}/g,n.html()).replace(/\{icon\}/g,n.find("."+v.css.icon).length?"":i),f.onRenderTemplate&&(o=f.onRenderTemplate.apply(n,[r,c]),o&&"string"==typeof o&&(c=o)),n.html('<div class="'+v.css.headerIn+'">'+c+"</div>")),f.onRenderHeader&&f.onRenderHeader.apply(n,[r,f,f.$table]),t.column=parseInt(n.attr("data-column"),10),t.order=d(v.getData(n,a,"sortInitialOrder")||f.sortInitialOrder)?[1,0,2]:[0,1,2],t.count=-1,t.lockedOrder=!1,l=v.getData(n,a,"lockedOrder")||!1,"undefined"!=typeof l&&l!==!1&&(t.order=t.lockedOrder=d(l)?[1,1,1]:[0,0,0]),n.addClass(v.css.header+" "+f.cssHeader),f.headerList[r]=t,n.parent().addClass(v.css.headerRow+" "+f.cssHeaderRow).attr("role","row"),f.tabIndex&&n.attr("tabindex",0),t)})),f.$headerIndexed=[],g=0;g<f.columns;g++)n=f.$headers.filter('[data-column="'+g+'"]'),f.$headerIndexed[g]=n.not(".sorter-false").length?n.not(".sorter-false").filter(":last"):n.filter(":last");e(s).find(f.selectorHeaders).attr({scope:"col",role:"columnheader"}),p(s),f.debug&&(r("Built headers:",u),t(f.$headers))}function l(e,t,r){var s=e.config;s.$table.find(s.selectorRemove).remove(),n(s),o(e),y(s,t,r)}function p(e){var t,r,s,a,n=e.config,o=n.$headers.length;for(t=0;o>t;t++)s=n.$headers.eq(t),a=v.getColumnData(e,n.headers,t,!0),r="false"===v.getData(s,a,"sorter")||"false"===v.getData(s,a,"parser"),s[0].sortDisabled=r,s[r?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+r),e.id&&(r?s.removeAttr("aria-controls"):s.attr("aria-controls",e.id))}function u(t){var r,s,a,n,o,i,d,c,l=t.config,p=l.sortList,u=p.length,g=v.css.sortNone+" "+l.cssNone,f=[v.css.sortAsc+" "+l.cssAsc,v.css.sortDesc+" "+l.cssDesc],h=[l.cssIconAsc,l.cssIconDesc,l.cssIconNone],m=["ascending","descending"],b=e(t).find("tfoot tr").children().add(e(l.namespace+"_extra_headers")).removeClass(f.join(" "));for(l.$headers.removeClass(f.join(" ")).addClass(g).attr("aria-sort","none").find("."+v.css.icon).removeClass(h.join(" ")).addClass(h[2]),a=0;u>a;a++)if(2!==p[a][1]&&(r=l.$headers.not(".sorter-false").filter('[data-column="'+p[a][0]+'"]'+(1===u?":last":"")),r.length)){for(n=0;n<r.length;n++)r[n].sortDisabled||r.eq(n).removeClass(g).addClass(f[p[a][1]]).attr("aria-sort",m[p[a][1]]).find("."+v.css.icon).removeClass(h[2]).addClass(h[p[a][1]]);b.length&&b.filter('[data-column="'+p[a][0]+'"]').removeClass(g).addClass(f[p[a][1]])}for(u=l.$headers.length,o=l.$headers.not(".sorter-false"),a=0;u>a;a++)i=o.eq(a),i.length&&(s=o[a],d=s.order[(s.count+1)%(l.sortReset?3:2)],c=e.trim(i.text())+": "+v.language[i.hasClass(v.css.sortAsc)?"sortAsc":i.hasClass(v.css.sortDesc)?"sortDesc":"sortNone"]+v.language[0===d?"nextAsc":1===d?"nextDesc":"nextNone"],i.attr("aria-label",c))}function g(t,r){var s,a,n,o,i,d,c,l,p=t.config,u=r||p.sortList,g=u.length;for(p.sortList=[],i=0;g>i;i++)if(l=u[i],s=parseInt(l[0],10),s<p.columns&&p.$headerIndexed[s]){switch(o=p.$headerIndexed[s][0],a=(""+l[1]).match(/^(1|d|s|o|n)/),a=a?a[0]:""){case"1":case"d":a=1;break;case"s":a=d||0;break;case"o":c=o.order[(d||0)%(p.sortReset?3:2)],a=0===c?1:1===c?0:2;break;case"n":o.count=o.count+1,a=o.order[o.count%(p.sortReset?3:2)];break;default:a=0}d=0===i?a:d,n=[s,parseInt(a,10)||0],p.sortList.push(n),a=e.inArray(n[1],o.order),o.count=a>=0?a:n[1]%(p.sortReset?3:2)}}function f(e,t){return e&&e[t]?e[t].type||"":""}function h(t,r,s){if(t.isUpdating)return setTimeout(function(){h(t,r,s)},50);var a,n,o,d,c,l,p,g=t.config,f=!s[g.sortMultiSortKey],b=g.$table,y=g.$headers.length;if(b.trigger("sortStart",t),r.count=s[g.sortResetKey]?2:(r.count+1)%(g.sortReset?3:2),g.sortRestart)for(n=r,o=0;y>o;o++)p=g.$headers.eq(o),p[0]===n||!f&&p.is("."+v.css.sortDesc+",."+v.css.sortAsc)||(p[0].count=-1);if(n=parseInt(e(r).attr("data-column"),10),f){if(g.sortList=[],null!==g.sortForce)for(a=g.sortForce,d=0;d<a.length;d++)a[d][0]!==n&&g.sortList.push(a[d]);if(c=r.order[r.count],2>c&&(g.sortList.push([n,c]),r.colSpan>1))for(d=1;d<r.colSpan;d++)g.sortList.push([n+d,c])}else{if(g.sortAppend&&g.sortList.length>1)for(d=0;d<g.sortAppend.length;d++)l=v.isValueInArray(g.sortAppend[d][0],g.sortList),l>=0&&g.sortList.splice(l,1);if(v.isValueInArray(n,g.sortList)>=0)for(d=0;d<g.sortList.length;d++)l=g.sortList[d],c=g.$headerIndexed[l[0]][0],l[0]===n&&(l[1]=c.order[r.count],2===l[1]&&(g.sortList.splice(d,1),c.count=-1));else if(c=r.order[r.count],2>c&&(g.sortList.push([n,c]),r.colSpan>1))for(d=1;d<r.colSpan;d++)g.sortList.push([n+d,c])}if(null!==g.sortAppend)for(a=g.sortAppend,d=0;d<a.length;d++)a[d][0]!==n&&g.sortList.push(a[d]);b.trigger("sortBegin",t),setTimeout(function(){u(t),m(t),i(t),b.trigger("sortEnd",t)},1)}function m(e){var t,a,n,o,i,d,c,l,p,u,g,h=0,m=e.config,b=m.textSorter||"",y=m.sortList,w=y.length,x=m.$tbodies.length;if(!m.serverSideSorting&&!s(m.cache)){for(m.debug&&(i=new Date),a=0;x>a;a++)d=m.cache[a].colMax,c=m.cache[a].normalized,c.sort(function(r,s){for(t=0;w>t;t++){if(o=y[t][0],l=y[t][1],h=0===l,m.sortStable&&r[o]===s[o]&&1===w)return r[m.columns].order-s[m.columns].order;if(n=/n/i.test(f(m.parsers,o)),n&&m.strings[o]?(n="boolean"==typeof m.string[m.strings[o]]?(h?1:-1)*(m.string[m.strings[o]]?-1:1):m.strings[o]?m.string[m.strings[o]]||0:0,p=m.numberSorter?m.numberSorter(r[o],s[o],h,d[o],e):v["sortNumeric"+(h?"Asc":"Desc")](r[o],s[o],n,d[o],o,e)):(u=h?r:s,g=h?s:r,p="function"==typeof b?b(u[o],g[o],h,o,e):"object"==typeof b&&b.hasOwnProperty(o)?b[o](u[o],g[o],h,o,e):v["sortNatural"+(h?"Asc":"Desc")](r[o],s[o],o,e,m)),p)return p}return r[m.columns].order-s[m.columns].order});m.debug&&r("Sorting on "+y.toString()+" and dir "+l+" time",i)}}function b(t,r){t.table.isUpdating&&t.$table.trigger("updateComplete",t.table),e.isFunction(r)&&r(t.table)}function y(t,r,s){var a=e.isArray(r)?r:t.sortList,n="undefined"==typeof r?t.resort:r;n===!1||t.serverSideSorting||t.table.isProcessing?(b(t,s),v.applyWidget(t.table,!1)):a.length?t.$table.trigger("sorton",[a,function(){b(t,s)},!0]):t.$table.trigger("sortReset",[function(){b(t,s),v.applyWidget(t.table,!1)}])}function w(t){var r=t.config,a=r.$table,d="sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(r.namespace+" ");a.unbind(d.replace(/\s+/g," ")).bind("sortReset"+r.namespace,function(s,a){s.stopPropagation(),r.sortList=[],u(t),m(t),i(t),e.isFunction(a)&&a(t)}).bind("updateAll"+r.namespace,function(e,s,a){e.stopPropagation(),t.isUpdating=!0,v.refreshWidgets(t,!0,!0),c(t),v.bindEvents(t,r.$headers,!0),w(t),l(t,s,a)}).bind("update"+r.namespace+" updateRows"+r.namespace,function(e,r,s){e.stopPropagation(),t.isUpdating=!0,p(t),l(t,r,s)}).bind("updateCell"+r.namespace,function(s,n,o,i){s.stopPropagation(),t.isUpdating=!0,a.find(r.selectorRemove).remove();var d,c,l,p,u=r.$tbodies,g=e(n),f=u.index(e.fn.closest?g.closest("tbody"):g.parents("tbody").filter(":first")),h=r.cache[f],m=e.fn.closest?g.closest("tr"):g.parents("tr").filter(":first");n=g[0],u.length&&f>=0&&(c=u.eq(f).find("tr").index(m),p=h.normalized[c],l=g.index(),d=v.getParsedText(r,n,l),p[l]=d,p[r.columns].$row=m,"numeric"===(r.parsers[l].type||"").toLowerCase()&&(h.colMax[l]=Math.max(Math.abs(d)||0,h.colMax[l]||0)),d="undefined"!==o?o:r.resort,d!==!1?y(r,d,i):(e.isFunction(i)&&i(t),r.$table.trigger("updateComplete",r.table)))}).bind("addRows"+r.namespace,function(a,o,i,d){if(a.stopPropagation(),t.isUpdating=!0,s(r.cache))p(t),l(t,i,d);else{o=e(o).attr("role","row");var c,u,g,f,h,m=o.filter("tr").length,b=r.$tbodies.index(o.parents("tbody").filter(":first"));for(r.parsers&&r.parsers.length||n(r),c=0;m>c;c++){for(g=o[c].cells.length,h=[],f={child:[],$row:o.eq(c),order:r.cache[b].normalized.length},u=0;g>u;u++)h[u]=v.getParsedText(r,o[c].cells[u],u),"numeric"===(r.parsers[u].type||"").toLowerCase()&&(r.cache[b].colMax[u]=Math.max(Math.abs(h[u])||0,r.cache[b].colMax[u]||0));h.push(f),r.cache[b].normalized.push(h)}y(r,i,d)}}).bind("updateComplete"+r.namespace,function(){t.isUpdating=!1}).bind("sorton"+r.namespace,function(r,n,d,c){var l=t.config;r.stopPropagation(),a.trigger("sortStart",this),g(t,n),u(t),l.delayInit&&s(l.cache)&&o(t),a.trigger("sortBegin",this),m(t),i(t,c),a.trigger("sortEnd",this),v.applyWidget(t),e.isFunction(d)&&d(t)}).bind("appendCache"+r.namespace,function(r,s,a){r.stopPropagation(),i(t,a),e.isFunction(s)&&s(t)}).bind("updateCache"+r.namespace,function(s,a,i){r.parsers&&r.parsers.length||n(r,i),o(t,i),e.isFunction(a)&&a(t)}).bind("applyWidgetId"+r.namespace,function(e,s){e.stopPropagation(),v.getWidgetById(s).format(t,r,r.widgetOptions)}).bind("applyWidgets"+r.namespace,function(e,r){e.stopPropagation(),v.applyWidget(t,r)}).bind("refreshWidgets"+r.namespace,function(e,r,s){e.stopPropagation(),v.refreshWidgets(t,r,s)}).bind("destroy"+r.namespace,function(e,r,s){e.stopPropagation(),v.destroy(t,r,s)}).bind("resetToLoadState"+r.namespace,function(){v.removeWidget(t,!0,!1),r=e.extend(!0,v.defaults,r.originalSettings),t.hasInitialized=!1,v.setup(t,r)})}var v=this;v.version="2.22.3",v.parsers=[],v.widgets=[],v.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,widgetClass:"widget-{name}",initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},v.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},v.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},v.instanceMethods={},v.log=t,v.benchmark=r,v.getElementText=function(t,r,s){if(!r)return"";var a,n=t.textExtraction||"",o=r.jquery?r:e(r);return e.trim("string"==typeof n?"basic"===n&&"undefined"!=typeof(a=o.attr(t.textAttribute))?a:r.textContent||o.text():"function"==typeof n?n(o[0],t.table,s):"function"==typeof(a=v.getColumnData(t.table,n,s))?a(o[0],t.table,s):o[0].textContent||o.text())},v.getParsedText=function(e,t,r,s){"undefined"==typeof s&&(s=v.getElementText(e,t,r));var a=""+s,n=e.parsers[r],o=e.extractors[r];return n&&(o&&"function"==typeof o.format&&(s=o.format(s,e.table,t,r)),a="no-parser"===n.id?"":n.format(""+s,e.table,t,r),e.ignoreCase&&"string"==typeof a&&(a=a.toLowerCase())),a},v.construct=function(t){return this.each(function(){var r=this,s=e.extend(!0,{},v.defaults,t,v.instanceMethods);s.originalSettings=t,!r.hasInitialized&&v.buildTable&&"TABLE"!==this.nodeName?v.buildTable(r,s):v.setup(r,s)})},v.setup=function(r,s){if(!r||!r.tHead||0===r.tBodies.length||r.hasInitialized===!0)return s.debug?t("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var a="",i=e(r),d=e.metadata;r.hasInitialized=!1,r.isProcessing=!0,r.config=s,e.data(r,"tablesorter",s),s.debug&&e.data(r,"startoveralltimer",new Date),s.supportsDataObject=function(e){return e[0]=parseInt(e[0],10),e[0]>1||1===e[0]&&parseInt(e[1],10)>=4}(e.fn.jquery.split(".")),s.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},s.emptyTo=s.emptyTo.toLowerCase(),s.stringTo=s.stringTo.toLowerCase(),/tablesorter\-/.test(i.attr("class"))||(a=""!==s.theme?" tablesorter-"+s.theme:""),s.table=r,s.$table=i.addClass(v.css.table+" "+s.tableClass+a).attr("role","grid"),s.$headers=i.find(s.selectorHeaders),s.namespace=s.namespace?"."+s.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2),s.$table.children().children("tr").attr("role","row"),s.$tbodies=i.children("tbody:not(."+s.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),s.$table.children("caption").length&&(a=s.$table.children("caption")[0],a.id||(a.id=s.namespace.slice(1)+"caption"),s.$table.attr("aria-labelledby",a.id)),s.widgetInit={},s.textExtraction=s.$table.attr("data-text-extraction")||s.textExtraction||"basic",c(r),v.fixColumnWidth(r),v.applyWidgetOptions(r,s),n(s),s.totalRows=0,s.delayInit||o(r),v.bindEvents(r,s.$headers,!0),w(r),s.supportsDataObject&&"undefined"!=typeof i.data().sortlist?s.sortList=i.data().sortlist:d&&i.metadata()&&i.metadata().sortlist&&(s.sortList=i.metadata().sortlist),v.applyWidget(r,!0),s.sortList.length>0?i.trigger("sorton",[s.sortList,{},!s.initWidgets,!0]):(u(r),s.initWidgets&&v.applyWidget(r,!1)),s.showProcessing&&i.unbind("sortBegin"+s.namespace+" sortEnd"+s.namespace).bind("sortBegin"+s.namespace+" sortEnd"+s.namespace,function(e){clearTimeout(s.processTimer),v.isProcessing(r),"sortBegin"===e.type&&(s.processTimer=setTimeout(function(){v.isProcessing(r,!0)},500))}),r.hasInitialized=!0,r.isProcessing=!1,s.debug&&v.benchmark("Overall initialization time",e.data(r,"startoveralltimer")),i.trigger("tablesorter-initialized",r),"function"==typeof s.initialized&&s.initialized(r)},v.fixColumnWidth=function(t){t=e(t)[0];var r,s,a,n,o,i=t.config,d=i.$table.children("colgroup");if(d.length&&d.hasClass(v.css.colgroup)&&d.remove(),i.widthFixed&&0===i.$table.children("colgroup").length){for(d=e('<colgroup class="'+v.css.colgroup+'">'),r=i.$table.width(),a=i.$tbodies.find("tr:first").children(":visible"),n=a.length,o=0;n>o;o++)s=parseInt(a.eq(o).width()/r*1e3,10)/10+"%",d.append(e("<col>").css("width",s));i.$table.prepend(d)}},v.getColumnData=function(t,r,s,a,n){if("undefined"!=typeof r&&null!==r){t=e(t)[0];var o,i,d=t.config,c=n||d.$headers,l=d.$headerIndexed&&d.$headerIndexed[s]||c.filter('[data-column="'+s+'"]:last');if(r[s])return a?r[s]:r[c.index(l)];for(i in r)if("string"==typeof i&&(o=l.filter(i).add(l.find(i)),o.length))return r[i]}},v.computeColumnIndex=function(t){var r,s,a,n,o,i,d,c,l,p,u,g,f=[],h=[],m={};for(r=0;r<t.length;r++)for(d=t[r].cells,s=0;s<d.length;s++){for(i=d[s],o=e(i),c=i.parentNode.rowIndex,l=c+"-"+o.index(),p=i.rowSpan||1,u=i.colSpan||1,"undefined"==typeof f[c]&&(f[c]=[]),a=0;a<f[c].length+1;a++)if("undefined"==typeof f[c][a]){g=a;break}for(m[l]=g,o.attr({"data-column":g}),a=c;c+p>a;a++)for("undefined"==typeof f[a]&&(f[a]=[]),h=f[a],n=g;g+u>n;n++)h[n]="x"}return h.length},v.isProcessing=function(t,r,s){t=e(t);var a=t[0].config,n=s||t.find("."+v.css.header);r?("undefined"!=typeof s&&a.sortList.length>0&&(n=n.filter(function(){return this.sortDisabled?!1:v.isValueInArray(parseFloat(e(this).attr("data-column")),a.sortList)>=0})),t.add(n).addClass(v.css.processing+" "+a.cssProcessing)):t.add(n).removeClass(v.css.processing+" "+a.cssProcessing)},v.processTbody=function(t,r,s){t=e(t)[0];var a;return s?(t.isProcessing=!0,r.before('<span class="tablesorter-savemyplace"/>'),a=e.fn.detach?r.detach():r.remove()):(a=e(t).find("span.tablesorter-savemyplace"),r.insertAfter(a),a.remove(),void(t.isProcessing=!1))},v.clearTableBody=function(t){e(t)[0].config.$tbodies.children().detach()},v.bindEvents=function(t,r,a){t=e(t)[0];var n,i=null,d=t.config;a!==!0&&(r.addClass(d.namespace.slice(1)+"_extra_headers"),n=e.fn.closest?r.closest("table")[0]:r.parents("table")[0],n&&"TABLE"===n.nodeName&&n!==t&&e(n).addClass(d.namespace.slice(1)+"_extra_table")),n=(d.pointerDown+" "+d.pointerUp+" "+d.pointerClick+" sort keyup ").replace(/\s+/g," ").split(" ").join(d.namespace+" "),r.find(d.selectorSort).add(r.filter(d.selectorSort)).unbind(n).bind(n,function(a,n){var c,l,p=e(a.target),u=" "+a.type+" ";if(!(1!==(a.which||a.button)&&!u.match(" "+d.pointerClick+" | sort | keyup ")||" keyup "===u&&13!==a.which||u.match(" "+d.pointerClick+" ")&&"undefined"!=typeof a.which||u.match(" "+d.pointerUp+" ")&&i!==a.target&&n!==!0)){if(u.match(" "+d.pointerDown+" "))return i=a.target,l=p.jquery.split("."),void("1"===l[0]&&l[1]<4&&a.preventDefault());if(i=null,/(input|select|button|textarea)/i.test(a.target.nodeName)||p.hasClass(d.cssNoSort)||p.parents("."+d.cssNoSort).length>0||p.parents("button").length>0)return!d.cancelSelection;d.delayInit&&s(d.cache)&&o(t),c=e.fn.closest?e(this).closest("th, td")[0]:/TH|TD/.test(this.nodeName)?this:e(this).parents("th, td")[0],c=d.$headers[r.index(c)],c.sortDisabled||h(t,c,a)}}),d.cancelSelection&&r.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},v.restoreHeaders=function(t){var r,s,a=e(t)[0].config,n=a.$table.find(a.selectorHeaders),o=n.length;for(r=0;o>r;r++)s=n.eq(r),s.find("."+v.css.headerIn).length&&s.html(a.headerContent[r])},v.destroy=function(t,r,s){if(t=e(t)[0],t.hasInitialized){v.removeWidget(t,!0,!1);var a,n=e(t),o=t.config,i=n.find("thead:first"),d=i.find("tr."+v.css.headerRow).removeClass(v.css.headerRow+" "+o.cssHeaderRow),c=n.find("tfoot:first > tr").children("th, td");r===!1&&e.inArray("uitheme",o.widgets)>=0&&(n.trigger("applyWidgetId",["uitheme"]),n.trigger("applyWidgetId",["zebra"])),i.find("tr").not(d).remove(),a="sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache "+"applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(o.namespace+" "),n.removeData("tablesorter").unbind(a.replace(/\s+/g," ")),o.$headers.add(c).removeClass([v.css.header,o.cssHeader,o.cssAsc,o.cssDesc,v.css.sortAsc,v.css.sortDesc,v.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),d.find(o.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(o.namespace+" ").replace(/\s+/g," ")),v.restoreHeaders(t),n.toggleClass(v.css.table+" "+o.tableClass+" tablesorter-"+o.theme,r===!1),t.hasInitialized=!1,delete t.config.cache,"function"==typeof s&&s(t)}},v.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},v.sortNatural=function(e,t){if(e===t)return 0;var r,s,a,n,o,i,d,c,l=v.regex;if(l.hex.test(t)){if(s=parseInt(e.match(l.hex),16),n=parseInt(t.match(l.hex),16),n>s)return-1;if(s>n)return 1}for(r=e.replace(l.chunk,"\\0$1\\0").replace(l.chunks,"").split("\\0"),a=t.replace(l.chunk,"\\0$1\\0").replace(l.chunks,"").split("\\0"),c=Math.max(r.length,a.length),d=0;c>d;d++){if(o=isNaN(r[d])?r[d]||0:parseFloat(r[d])||0,i=isNaN(a[d])?a[d]||0:parseFloat(a[d])||0,isNaN(o)!==isNaN(i))return isNaN(o)?1:-1;if(typeof o!=typeof i&&(o+="",i+=""),i>o)return-1;if(o>i)return 1}return 0},v.sortNaturalAsc=function(e,t,r,s,a){if(e===t)return 0;var n=a.string[a.empties[r]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:-n||-1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:n||1:v.sortNatural(e,t)},v.sortNaturalDesc=function(e,t,r,s,a){if(e===t)return 0;var n=a.string[a.empties[r]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:n||1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:-n||-1:v.sortNatural(t,e)},v.sortText=function(e,t){return e>t?1:t>e?-1:0},v.getTextValue=function(e,t,r){if(r){var s,a=e?e.length:0,n=r+t;for(s=0;a>s;s++)n+=e.charCodeAt(s);return t*n}return 0},v.sortNumericAsc=function(e,t,r,s,a,n){if(e===t)return 0;var o=n.config,i=o.string[o.empties[a]||o.emptyTo];return""===e&&0!==i?"boolean"==typeof i?i?-1:1:-i||-1:""===t&&0!==i?"boolean"==typeof i?i?1:-1:i||1:(isNaN(e)&&(e=v.getTextValue(e,r,s)),isNaN(t)&&(t=v.getTextValue(t,r,s)),e-t)},v.sortNumericDesc=function(e,t,r,s,a,n){if(e===t)return 0;var o=n.config,i=o.string[o.empties[a]||o.emptyTo];return""===e&&0!==i?"boolean"==typeof i?i?-1:1:i||1:""===t&&0!==i?"boolean"==typeof i?i?1:-1:-i||-1:(isNaN(e)&&(e=v.getTextValue(e,r,s)),isNaN(t)&&(t=v.getTextValue(t,r,s)),t-e)},v.sortNumeric=function(e,t){return e-t},v.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},v.replaceAccents=function(e){var t,r="[",s=v.characterEquivalents;if(!v.characterRegex){v.characterRegexArray={};for(t in s)"string"==typeof t&&(r+=s[t],v.characterRegexArray[t]=new RegExp("["+s[t]+"]","g"));v.characterRegex=new RegExp(r+"]")}if(v.characterRegex.test(e))for(t in s)"string"==typeof t&&(e=e.replace(v.characterRegexArray[t],t));return e},v.isValueInArray=function(e,t){var r,s=t.length;for(r=0;s>r;r++)if(t[r][0]===e)return r;return-1},v.addParser=function(e){var t,r=v.parsers.length,s=!0;for(t=0;r>t;t++)v.parsers[t].id.toLowerCase()===e.id.toLowerCase()&&(s=!1);s&&v.parsers.push(e)},v.addInstanceMethods=function(t){e.extend(v.instanceMethods,t)},v.getParserById=function(e){if("false"==e)return!1;var t,r=v.parsers.length;for(t=0;r>t;t++)if(v.parsers[t].id.toLowerCase()===e.toString().toLowerCase())return v.parsers[t];return!1},v.addWidget=function(e){v.widgets.push(e)},v.hasWidget=function(t,r){return t=e(t),t.length&&t[0].config&&t[0].config.widgetInit[r]||!1},v.getWidgetById=function(e){var t,r,s=v.widgets.length;for(t=0;s>t;t++)if(r=v.widgets[t],r&&r.hasOwnProperty("id")&&r.id.toLowerCase()===e.toLowerCase())return r},v.applyWidgetOptions=function(t,r){var s,a,n=r.widgets.length,o=r.widgetOptions;if(n)for(s=0;n>s;s++)a=v.getWidgetById(r.widgets[s]),a&&"options"in a&&(o=t.config.widgetOptions=e.extend(!0,{},a.options,o))},v.applyWidget=function(t,s,a){t=e(t)[0];var n,o,i,d,c,l,p,u=t.config,g=u.widgetOptions,f=" "+u.table.className+" ",h=[];if(s===!1||!t.hasInitialized||!t.isApplyingWidgets&&!t.isUpdating){if(u.debug&&(d=new Date),p=new RegExp("\\s"+u.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),f.match(p)&&(l=f.match(p)))for(o=l.length,n=0;o>n;n++)u.widgets.push(l[n].replace(p,"$1"));if(u.widgets.length){for(t.isApplyingWidgets=!0,u.widgets=e.grep(u.widgets,function(t,r){return e.inArray(t,u.widgets)===r}),i=u.widgets||[],o=i.length,n=0;o>n;n++)p=v.getWidgetById(i[n]),p&&p.id&&(p.priority||(p.priority=10),h[n]=p);for(h.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),o=h.length,n=0;o>n;n++)h[n]&&((s||!u.widgetInit[h[n].id])&&(u.widgetInit[h[n].id]=!0,t.hasInitialized&&v.applyWidgetOptions(t,u),"init"in h[n]&&(u.debug&&(c=new Date),h[n].init(t,h[n],u,g),u.debug&&v.benchmark("Initializing "+h[n].id+" widget",c))),!s&&"format"in h[n]&&(u.debug&&(c=new Date),h[n].format(t,u,g,!1),u.debug&&v.benchmark((s?"Initializing ":"Applying ")+h[n].id+" widget",c)));s||"function"!=typeof a||a(t)}setTimeout(function(){t.isApplyingWidgets=!1,e.data(t,"lastWidgetApplication",new Date)},0),u.debug&&(l=u.widgets.length,r("Completed "+(s===!0?"initializing ":"applying ")+l+" widget"+(1!==l?"s":""),d))}},v.removeWidget=function(r,s,a){r=e(r)[0];var n,o,i,d,c=r.config;if(s===!0)for(s=[],d=v.widgets.length,i=0;d>i;i++)o=v.widgets[i],o&&o.id&&s.push(o.id);else s=(e.isArray(s)?s.join(","):s||"").toLowerCase().split(/[\s,]+/);for(d=s.length,n=0;d>n;n++)o=v.getWidgetById(s[n]),i=e.inArray(s[n],c.widgets),o&&"remove"in o&&(c.debug&&i>=0&&t('Removing "'+s[n]+'" widget'),o.remove(r,c,c.widgetOptions,a),c.widgetInit[s[n]]=!1),i>=0&&a!==!0&&c.widgets.splice(i,1)},v.refreshWidgets=function(t,r,s){t=e(t)[0];var a,n=t.config,o=n.widgets,i=v.widgets,d=i.length,c=[],l=function(t){e(t).trigger("refreshComplete")};for(a=0;d>a;a++)i[a]&&i[a].id&&(r||e.inArray(i[a].id,o)<0)&&c.push(i[a].id);v.removeWidget(t,c.join(","),!0),s!==!0?(v.applyWidget(t,r||!1,l),r&&v.applyWidget(t,!1,l)):l(t)},v.getColumnText=function(t,r,a){t=e(t)[0];var n,o,i,d,c,l,p,u,g,f,h="function"==typeof a,m="all"===r,b={raw:[],parsed:[],$cell:[]},y=t.config;if(!s(y)){for(c=y.$tbodies.length,n=0;c>n;n++)for(i=y.cache[n].normalized,l=i.length,o=0;l>o;o++)f=!0,d=i[o],u=m?d.slice(0,y.columns):d[r],d=d[y.columns],p=m?d.raw:d.raw[r],g=m?d.$row.children():d.$row.children().eq(r),h&&(f=a({tbodyIndex:n,rowIndex:o,parsed:u,raw:p,$row:d.$row,$cell:g})),f!==!1&&(b.parsed.push(u),b.raw.push(p),b.$cell.push(g));return b}},v.getData=function(t,r,s){var a,n,o="",i=e(t);return i.length?(a=e.metadata?i.metadata():!1,n=" "+(i.attr("class")||""),"undefined"!=typeof i.data(s)||"undefined"!=typeof i.data(s.toLowerCase())?o+=i.data(s)||i.data(s.toLowerCase()):a&&"undefined"!=typeof a[s]?o+=a[s]:r&&"undefined"!=typeof r[s]?o+=r[s]:" "!==n&&n.match(" "+s+"-")&&(o=n.match(new RegExp("\\s"+s+"-([\\w-]+)"))[1]||""),e.trim(o)):""},v.formatFloat=function(t,r){if("string"!=typeof t||""===t)return t;var s,a=r&&r.config?r.config.usNumberFormat!==!1:"undefined"!=typeof r?r:!0;return t=a?t.replace(/,/g,""):t.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(t)&&(t=t.replace(/^\s*\(([.\d]+)\)/,"-$1")),s=parseFloat(t),isNaN(s)?e.trim(t):s},v.isDigit=function(e){return isNaN(e)?/^[\-+(]?\d+[)]?$/.test(e.toString().replace(/[,.'"\s]/g,"")):""!==e}}});var t=e.tablesorter;e.fn.extend({tablesorter:t.construct}),t.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),t.addParser({id:"text",is:function(){return!0},format:function(r,s){var a=s.config;return r&&(r=e.trim(a.ignoreCase?r.toLocaleLowerCase():r),r=a.sortLocaleCompare?t.replaceAccents(r):r),r},type:"text"}),t.addParser({id:"digit",is:function(e){return t.isDigit(e)},format:function(r,s){var a=t.formatFloat((r||"").replace(/[^\w,. \-()]/g,""),s);return r&&"number"==typeof a?a:r?e.trim(r&&s.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.addParser({id:"currency",is:function(e){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((e||"").replace(/[+\-,. ]/g,""))},format:function(r,s){var a=t.formatFloat((r||"").replace(/[^\w,. \-()]/g,""),s);return r&&"number"==typeof a?a:r?e.trim(r&&s.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.addParser({id:"url",is:function(e){return/^(https?|ftp|file):\/\//.test(e)},format:function(t){return t?e.trim(t.replace(/(https?|ftp|file):\/\//,"")):t},parsed:!0,type:"text"}),t.addParser({id:"isoDate",is:function(e){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(e)},format:function(e){var t=e?new Date(e.replace(/-/g,"/")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),t.addParser({id:"percent",is:function(e){return/(\d\s*?%|%\s*?\d)/.test(e)&&e.length<15},format:function(e,r){return e?t.formatFloat(e.replace(/%/g,""),r):e},type:"numeric"}),t.addParser({id:"image",is:function(e,t,r,s){return s.find("img").length>0},format:function(t,r,s){return e(s).find("img").attr(r.config.imgAttr||"alt")||t},parsed:!0,type:"text"}),t.addParser({id:"usLongDate",is:function(e){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(e)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(e)},format:function(e){var t=e?new Date(e.replace(/(\S)([AP]M)$/i,"$1 $2")):e;return t instanceof Date&&isFinite(t)?t.getTime():e
+},type:"numeric"}),t.addParser({id:"shortDate",is:function(e){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((e||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(e,r,s,a){if(e){var n,o,i=r.config,d=i.$headerIndexed[a],c=d.length&&d[0].dateFormat||t.getData(d,t.getColumnData(r,i.headers,a),"dateFormat")||i.dateFormat;return o=e.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===c?o=o.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===c?o=o.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===c&&(o=o.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")),n=new Date(o),n instanceof Date&&isFinite(n)?n.getTime():e}return e},type:"numeric"}),t.addParser({id:"time",is:function(e){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(e)},format:function(e){var t=e?new Date("2000/01/01 "+e.replace(/(\S)([AP]M)$/i,"$1 $2")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),t.addParser({id:"metadata",is:function(){return!1},format:function(t,r,s){var a=r.config,n=a.parserMetadataName?a.parserMetadataName:"sortValue";return e(s).metadata()[n]},type:"numeric"}),t.addWidget({id:"zebra",priority:90,format:function(t,r,s){var a,n,o,i,d,c,l,p,u=new RegExp(r.cssChildRow,"i"),g=r.$tbodies.add(e(r.namespace+"_extra_table").children("tbody:not(."+r.cssInfoBlock+")"));for(r.debug&&(d=new Date),c=0;c<g.length;c++)for(o=0,a=g.eq(c).children("tr:visible").not(r.selectorRemove),p=a.length,l=0;p>l;l++)n=a.eq(l),u.test(n[0].className)||o++,i=o%2===0,n.removeClass(s.zebra[i?1:0]).addClass(s.zebra[i?0:1])},remove:function(e,r,s,a){if(!a){var n,o,i=r.$tbodies,d=(s.zebra||["even","odd"]).join(" ");for(n=0;n<i.length;n++)o=t.processTbody(e,i.eq(n),!0),o.children().removeClass(d),t.processTbody(e,o,!1)}}})}(jQuery); /* jquery.tablesorter.widgets.js v2.22.3 */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(e,t,r){"use strict";var i=e.tablesorter||{};i.storage=function(l,a,s,n){l=e(l)[0];var o,c,d,f=!1,u={},h=l.config,p=h&&h.widgetOptions,g=n&&n.useSessionStorage||p&&p.storage_useSessionStorage?"sessionStorage":"localStorage",m=e(l),b=n&&n.id||m.attr(n&&n.group||p&&p.storage_group||"data-table-group")||p&&p.storage_tableId||l.id||e(".tablesorter").index(m),y=n&&n.url||m.attr(n&&n.page||p&&p.storage_page||"data-table-page")||p&&p.storage_fixedUrl||h&&h.fixedUrl||t.location.pathname;if(g in t)try{t[g].setItem("_tmptest","temp"),f=!0,t[g].removeItem("_tmptest")}catch(_){h&&h.debug&&i.log(g+" is not supported in this browser")}return e.parseJSON&&(f?u=e.parseJSON(t[g][a]||"null")||{}:(c=r.cookie.split(/[;\s|=]/),o=e.inArray(a,c)+1,u=0!==o?e.parseJSON(c[o]||"null")||{}:{})),(s||""===s)&&t.JSON&&JSON.hasOwnProperty("stringify")?(u[y]||(u[y]={}),u[y][b]=s,f?t[g][a]=JSON.stringify(u):(d=new Date,d.setTime(d.getTime()+31536e6),r.cookie=a+"="+JSON.stringify(u).replace(/\"/g,'"')+"; expires="+d.toGMTString()+"; path=/"),void 0):u&&u[y]?u[y][b]:""}}(jQuery,window,document),function(e){"use strict";var t=e.tablesorter||{};t.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s",iconSortAsc:"ui-icon-carat-1-n",iconSortDesc:"ui-icon-carat-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(t.css,{wrapper:"tablesorter-wrapper"}),t.addWidget({id:"uitheme",priority:10,format:function(r,i,l){var a,s,n,o,c,d,f,u,h,p,g,m,b=t.themes,y=i.$table.add(e(i.namespace+"_extra_table")),_=i.$headers.add(e(i.namespace+"_extra_headers")),v=i.theme||"jui",w=b[v]||{},x=e.trim([w.sortNone,w.sortDesc,w.sortAsc,w.active].join(" ")),C=e.trim([w.iconSortNone,w.iconSortDesc,w.iconSortAsc].join(" "));for(i.debug&&(o=new Date),y.hasClass("tablesorter-"+v)&&i.theme===i.appliedTheme&&l.uitheme_applied||(l.uitheme_applied=!0,h=b[i.appliedTheme]||{},m=!e.isEmptyObject(h),p=m?[h.sortNone,h.sortDesc,h.sortAsc,h.active].join(" "):"",g=m?[h.iconSortNone,h.iconSortDesc,h.iconSortAsc].join(" "):"",m&&(l.zebra[0]=e.trim(" "+l.zebra[0].replace(" "+h.even,"")),l.zebra[1]=e.trim(" "+l.zebra[1].replace(" "+h.odd,"")),i.$tbodies.children().removeClass([h.even,h.odd].join(" "))),w.even&&(l.zebra[0]+=" "+w.even),w.odd&&(l.zebra[1]+=" "+w.odd),y.children("caption").removeClass(h.caption||"").addClass(w.caption),f=y.removeClass((i.appliedTheme?"tablesorter-"+(i.appliedTheme||""):"")+" "+(h.table||"")).addClass("tablesorter-"+v+" "+(w.table||"")).children("tfoot"),i.appliedTheme=i.theme,f.length&&f.children("tr").removeClass(h.footerRow||"").addClass(w.footerRow).children("th, td").removeClass(h.footerCells||"").addClass(w.footerCells),_.removeClass((m?[h.header,h.hover,p].join(" "):"")||"").addClass(w.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(t){e(this)["mouseenter"===t.type?"addClass":"removeClass"](w.hover||"")}),_.each(function(){var r=e(this);r.find("."+t.css.wrapper).length||r.wrapInner('<div class="'+t.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),i.cssIcon&&_.find("."+t.css.icon).removeClass(m?[h.icons,g].join(" "):"").addClass(w.icons||""),y.hasClass("hasFilters")&&y.children("thead").children("."+t.css.filterRow).removeClass(m?h.filterRow||"":"").addClass(w.filterRow||"")),a=0;a<i.columns;a++)c=i.$headers.add(e(i.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+a+'"]'),d=t.css.icon?c.find("."+t.css.icon):e(),u=_.not(".sorter-false").filter('[data-column="'+a+'"]:last'),u.length&&(c.removeClass(x),d.removeClass(C),u[0].sortDisabled?d.removeClass(w.icons||""):(s=w.sortNone,n=w.iconSortNone,u.hasClass(t.css.sortAsc)?(s=[w.sortAsc,w.active].join(" "),n=w.iconSortAsc):u.hasClass(t.css.sortDesc)&&(s=[w.sortDesc,w.active].join(" "),n=w.iconSortDesc),c.addClass(s),d.addClass(n||"")));i.debug&&t.benchmark("Applying "+v+" theme",o)},remove:function(e,r,i,l){if(i.uitheme_applied){var a=r.$table,s=r.appliedTheme||"jui",n=t.themes[s]||t.themes.jui,o=a.children("thead").children(),c=n.sortNone+" "+n.sortDesc+" "+n.sortAsc,d=n.iconSortNone+" "+n.iconSortDesc+" "+n.iconSortAsc;a.removeClass("tablesorter-"+s+" "+n.table),i.uitheme_applied=!1,l||(a.find(t.css.header).removeClass(n.header),o.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(n.hover+" "+c+" "+n.active).filter("."+t.css.filterRow).removeClass(n.filterRow),o.find("."+t.css.icon).removeClass(n.icons+" "+d))}}})}(jQuery),function(e){"use strict";var t=e.tablesorter||{};t.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(r,i,l){var a,s,n,o,c,d,f,u,h=i.$table,p=i.$tbodies,g=i.sortList,m=g.length,b=l&&l.columns||["primary","secondary","tertiary"],y=b.length-1;for(f=b.join(" "),s=0;s<p.length;s++)a=t.processTbody(r,p.eq(s),!0),n=a.children("tr"),n.each(function(){if(c=e(this),"none"!==this.style.display&&(d=c.children().removeClass(f),g&&g[0]&&(d.eq(g[0][0]).addClass(b[0]),m>1)))for(u=1;m>u;u++)d.eq(g[u][0]).addClass(b[u]||b[y])}),t.processTbody(r,a,!1);if(o=l.columns_thead!==!1?["thead tr"]:[],l.columns_tfoot!==!1&&o.push("tfoot tr"),o.length&&(n=h.find(o.join(",")).children().removeClass(f),m))for(u=0;m>u;u++)n.filter('[data-column="'+g[u][0]+'"]').addClass(b[u]||b[y])},remove:function(r,i,l){var a,s,n=i.$tbodies,o=(l.columns||["primary","secondary","tertiary"]).join(" ");for(i.$headers.removeClass(o),i.$table.children("tfoot").children("tr").children("th, td").removeClass(o),a=0;a<n.length;a++)s=t.processTbody(r,n.eq(a),!0),s.children("tr").each(function(){e(this).children().removeClass(o)}),t.processTbody(r,s,!1)}})}(jQuery),function(e){"use strict";var t=e.tablesorter||{},r=t.css;e.extend(r,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),t.addWidget({id:"filter",priority:50,options:{filter_childRows:!1,filter_childByColumn:!1,filter_columnFilters:!0,filter_columnAnyMatch:!0,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_startsWith:!1,filter_useParsedData:!1,filter_serversideFiltering:!1,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(e,r,i){r.$table.hasClass("hasFilters")||t.filter.init(e,r,i)},remove:function(i,l,a,s){var n,o,c=l.$table,d=l.$tbodies,f="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(l.namespace+"filter ");if(c.removeClass("hasFilters").unbind(f.replace(/\s+/g," ")).find("."+r.filterRow).remove(),!s){for(n=0;n<d.length;n++)o=t.processTbody(i,d.eq(n),!0),o.children().removeClass(a.filter_filteredRow).show(),t.processTbody(i,o,!1);a.filter_reset&&e(document).undelegate(a.filter_reset,"click.tsfilter")}}}),t.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,nondigit:/[^\w,. \-()]/g,operators:/[<>=]/g,query:"(q|query)"},types:{or:function(r,i,l){if(/\|/.test(i.iFilter)||t.filter.regex.orSplit.test(i.filter)){var a,s,n,o,c=e.extend({},i),d=i.index,f=i.parsed[d],u=i.filter.split(t.filter.regex.orSplit),h=i.iFilter.split(t.filter.regex.orSplit),p=u.length;for(a=0;p>a;a++)if(c.nestedFilters=!0,c.filter=""+(t.filter.parseFilter(r,u[a],d,f)||""),c.iFilter=""+(t.filter.parseFilter(r,h[a],d,f)||""),n="("+(t.filter.parseFilter(r,c.filter,d,f)||"")+")",o=new RegExp(i.isMatch?n:"^"+n+"$",r.widgetOptions.filter_ignoreCase?"i":""),s=o.test(c.exact)||t.filter.processTypes(r,c,l))return s;return s||!1}return null},and:function(r,i,l){if(t.filter.regex.andTest.test(i.filter)){var a,s,n,o,c,d=e.extend({},i),f=i.index,u=i.parsed[f],h=i.filter.split(t.filter.regex.andSplit),p=i.iFilter.split(t.filter.regex.andSplit),g=h.length;for(a=0;g>a;a++)d.nestedFilters=!0,d.filter=""+(t.filter.parseFilter(r,h[a],f,u)||""),d.iFilter=""+(t.filter.parseFilter(r,p[a],f,u)||""),o=("("+(t.filter.parseFilter(r,d.filter,f,u)||"")+")").replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"),c=new RegExp(i.isMatch?o:"^"+o+"$",r.widgetOptions.filter_ignoreCase?"i":""),n=c.test(d.exact)||t.filter.processTypes(r,d,l),s=0===a?n:s&&n;return s||!1}return null},regex:function(e,r){if(t.filter.regex.regex.test(r.filter)){var i,l=r.filter_regexCache[r.index]||t.filter.regex.regex.exec(r.filter),a=l instanceof RegExp;try{a||(r.filter_regexCache[r.index]=l=new RegExp(l[1],l[2])),i=l.test(r.exact)}catch(s){i=!1}return i}return null},operators:function(r,i){if(/^[<>]=?/.test(i.iFilter)&&""!==i.iExact){var l,a,s,n=r.table,o=i.index,c=i.parsed[o],d=t.formatFloat(i.iFilter.replace(t.filter.regex.operators,""),n),f=r.parsers[o],u=d;return(c||"numeric"===f.type)&&(s=e.trim(""+i.iFilter.replace(t.filter.regex.operators,"")),a=t.filter.parseFilter(r,s,o,!0),d="number"!=typeof a||""===a||isNaN(a)?d:a),!c&&"numeric"!==f.type||isNaN(d)||"undefined"==typeof i.cache?(s=isNaN(i.iExact)?i.iExact.replace(t.filter.regex.nondigit,""):i.iExact,l=t.formatFloat(s,n)):l=i.cache,/>/.test(i.iFilter)?a=/>=/.test(i.iFilter)?l>=d:l>d:/</.test(i.iFilter)&&(a=/<=/.test(i.iFilter)?d>=l:d>l),a||""!==u||(a=!0),a}return null},notMatch:function(r,i){if(/^\!/.test(i.iFilter)){var l,a=i.iFilter.replace("!",""),s=t.filter.parseFilter(r,a,i.index,i.parsed[i.index])||"";return t.filter.regex.exact.test(s)?(s=s.replace(t.filter.regex.exact,""),""===s?!0:e.trim(s)!==i.iExact):(l=i.iExact.search(e.trim(s)),""===s?!0:!(r.widgetOptions.filter_startsWith?0===l:l>=0))}return null},exact:function(r,i){if(t.filter.regex.exact.test(i.iFilter)){var l=i.iFilter.replace(t.filter.regex.exact,""),a=t.filter.parseFilter(r,l,i.index,i.parsed[i.index])||"";return i.anyMatch?e.inArray(a,i.rowArray)>=0:a==i.iExact}return null},range:function(e,r){if(t.filter.regex.toTest.test(r.iFilter)){var i,l,a,s,n=e.table,o=r.index,c=r.parsed[o],d=r.iFilter.split(t.filter.regex.toSplit);return l=d[0].replace(t.filter.regex.nondigit,"")||"",a=t.formatFloat(t.filter.parseFilter(e,l,o,c),n),l=d[1].replace(t.filter.regex.nondigit,"")||"",s=t.formatFloat(t.filter.parseFilter(e,l,o,c),n),(c||"numeric"===e.parsers[o].type)&&(i=e.parsers[o].format(""+d[0],n,e.$headers.eq(o),o),a=""===i||isNaN(i)?a:i,i=e.parsers[o].format(""+d[1],n,e.$headers.eq(o),o),s=""===i||isNaN(i)?s:i),!c&&"numeric"!==e.parsers[o].type||isNaN(a)||isNaN(s)?(l=isNaN(r.iExact)?r.iExact.replace(t.filter.regex.nondigit,""):r.iExact,i=t.formatFloat(l,n)):i=r.cache,a>s&&(l=a,a=s,s=l),i>=a&&s>=i||""===a||""===s}return null},wild:function(e,r){if(/[\?\*\|]/.test(r.iFilter)){var i=r.index,l=r.parsed[i],a=""+(t.filter.parseFilter(e,r.iFilter,i,l)||"");return!/\?\*/.test(a)&&r.nestedFilters&&(a=r.isMatch?a:"^("+a+")$"),new RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"),e.widgetOptions.filter_ignoreCase?"i":"").test(r.exact)}return null},fuzzy:function(e,r){if(/^~/.test(r.iFilter)){var i,l=0,a=r.iExact.length,s=r.iFilter.slice(1),n=t.filter.parseFilter(e,s,r.index,r.parsed[r.index])||"";for(i=0;a>i;i++)r.iExact[i]===n[l]&&(l+=1);return l===n.length?!0:!1}return null}},init:function(i,l,a){t.language=e.extend(!0,{},{to:"to",or:"or",and:"and"},t.language);var s,n,o,c,d,f,u,h,p,g=t.filter.regex;if(l.$table.addClass("hasFilters"),a.searchTimer=null,a.filter_initTimer=null,a.filter_formatterCount=0,a.filter_formatterInit=[],a.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',a.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',u="\\{"+t.filter.regex.query+"\\}",e.extend(g,{child:new RegExp(l.cssChildRow),filtered:new RegExp(a.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+t.language.or+"|-|"+t.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+t.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+t.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+t.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+t.language.and+"|&&)\\s+)","gi"),orSplit:new RegExp("(?:\\s+(?:"+t.language.or+")\\s+|\\|)","gi"),iQuery:new RegExp(u,"i"),igQuery:new RegExp(u,"ig")}),u=l.$headers.filter(".filter-false, .parser-false").length,a.filter_columnFilters!==!1&&u!==l.$headers.length&&t.filter.buildRow(i,l,a),o="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(l.namespace+"filter "),l.$table.bind(o,function(s,n){return u=a.filter_hideEmpty&&e.isEmptyObject(l.cache)&&!(l.delayInit&&"appendCache"===s.type),l.$table.find("."+r.filterRow).toggleClass(a.filter_filteredRow,u),/(search|filter)/.test(s.type)||(s.stopPropagation(),t.filter.buildDefault(i,!0)),"filterReset"===s.type?(l.$table.find("."+r.filter).add(a.filter_$externalFilters).val(""),t.filter.searching(i,[])):"filterEnd"===s.type?t.filter.buildDefault(i,!0):(n="search"===s.type?n:"updateComplete"===s.type?l.$table.data("lastSearch"):"",/(update|add)/.test(s.type)&&"updateComplete"!==s.type&&(l.lastCombinedFilter=null,l.lastSearch=[]),t.filter.searching(i,n,!0)),!1}),a.filter_reset&&(a.filter_reset instanceof e?a.filter_reset.click(function(){l.$table.trigger("filterReset")}):e(a.filter_reset).length&&e(document).undelegate(a.filter_reset,"click.tsfilter").delegate(a.filter_reset,"click.tsfilter",function(){l.$table.trigger("filterReset")})),a.filter_functions)for(d=0;d<l.columns;d++)if(h=t.getColumnData(i,a.filter_functions,d))if(c=l.$headerIndexed[d].removeClass("filter-select"),p=!(c.hasClass("filter-false")||c.hasClass("parser-false")),s="",h===!0&&p)t.filter.buildSelect(i,d);else if("object"==typeof h&&p){for(n in h)"string"==typeof n&&(s+=""===s?'<option value="">'+(c.data("placeholder")||c.attr("data-placeholder")||a.filter_placeholder.select||"")+"</option>":"",u=n,o=n,n.indexOf(a.filter_selectSourceSeparator)>=0&&(u=n.split(a.filter_selectSourceSeparator),o=u[1],u=u[0]),s+="<option "+(o===u?"":'data-function-name="'+n+'" ')+'value="'+u+'">'+o+"</option>");l.$table.find("thead").find("select."+r.filter+'[data-column="'+d+'"]').append(s),o=a.filter_selectSource,h=e.isFunction(o)?!0:t.getColumnData(i,o,d),h&&t.filter.buildSelect(l.table,d,"",!0,c.hasClass(a.filter_onlyAvail))}t.filter.buildDefault(i,!0),t.filter.bindSearch(i,l.$table.find("."+r.filter),!0),a.filter_external&&t.filter.bindSearch(i,a.filter_external),a.filter_hideFilters&&t.filter.hideFilters(i,l),l.showProcessing&&(o="filterStart filterEnd ".split(" ").join(l.namespace+"filter "),l.$table.unbind(o.replace(/\s+/g," ")).bind(o,function(a,s){c=s?l.$table.find("."+r.header).filter("[data-column]").filter(function(){return""!==s[e(this).data("column")]}):"",t.isProcessing(i,"filterStart"===a.type,s?c:"")})),l.filteredRows=l.totalRows,o="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(l.namespace+"filter "),l.$table.unbind(o.replace(/\s+/g," ")).bind(o,function(){var e=this.config.widgetOptions;f=t.filter.setDefaults(i,l,e)||[],f.length&&(l.delayInit&&""===f.join("")||t.setFilters(i,f,!0)),l.$table.trigger("filterFomatterUpdate"),setTimeout(function(){e.filter_initialized||t.filter.filterInitComplete(l)},100)}),l.pager&&l.pager.initialized&&!a.filter_initialized&&(l.$table.trigger("filterFomatterUpdate"),setTimeout(function(){t.filter.filterInitComplete(l)},100))},formatterUpdated:function(e,t){var r=e.closest("table")[0].config.widgetOptions;r.filter_initialized||(r.filter_formatterInit[t]=1)},filterInitComplete:function(r){var i,l,a=r.widgetOptions,s=0,n=function(){a.filter_initialized=!0,r.$table.trigger("filterInit",r),t.filter.findRows(r.table,r.$table.data("lastSearch")||[])};if(e.isEmptyObject(a.filter_formatter))n();else{for(l=a.filter_formatterInit.length,i=0;l>i;i++)1===a.filter_formatterInit[i]&&s++;clearTimeout(a.filter_initTimer),a.filter_initialized||s!==a.filter_formatterCount?a.filter_initialized||(a.filter_initTimer=setTimeout(function(){n()},500)):n()}},setDefaults:function(r,i,l){var a,s,n,o,c,d=t.getFilters(r)||[];if(l.filter_saveFilters&&t.storage&&(s=t.storage(r,"tablesorter-filters")||[],a=e.isArray(s),a&&""===s.join("")||!a||(d=s)),""===d.join(""))for(c=i.$headers.add(l.filter_$externalFilters).filter("["+l.filter_defaultAttrib+"]"),n=0;n<=i.columns;n++)o=n===i.columns?"all":n,d[n]=c.filter('[data-column="'+o+'"]').attr(l.filter_defaultAttrib)||d[n]||"";return i.$table.data("lastSearch",d),d},parseFilter:function(e,t,r,i){return i?e.parsers[r].format(t,e.table,[],r):t},buildRow:function(i,l,a){var s,n,o,c,d,f,u,h,p=a.filter_cellFilter,g=l.columns,m=e.isArray(p),b='<tr role="row" class="'+r.filterRow+" "+l.cssIgnoreRow+'">';for(n=0;g>n;n++)b+="<td",b+=m?p[n]?' class="'+p[n]+'"':"":""!==p?' class="'+p+'"':"",b+="></td>";for(l.$filters=e(b+="</tr>").appendTo(l.$table.children("thead").eq(0)).find("td"),n=0;g>n;n++)d=!1,o=l.$headerIndexed[n],u=t.getColumnData(i,a.filter_functions,n),c=a.filter_functions&&u&&"function"!=typeof u||o.hasClass("filter-select"),s=t.getColumnData(i,l.headers,n),d="false"===t.getData(o[0],s,"filter")||"false"===t.getData(o[0],s,"parser"),c?b=e("<select>").appendTo(l.$filters.eq(n)):(u=t.getColumnData(i,a.filter_formatter,n),u?(a.filter_formatterCount++,b=u(l.$filters.eq(n),n),b&&0===b.length&&(b=l.$filters.eq(n).children("input")),b&&(0===b.parent().length||b.parent().length&&b.parent()[0]!==l.$filters[n])&&l.$filters.eq(n).append(b)):b=e('<input type="search">').appendTo(l.$filters.eq(n)),b&&(h=o.data("placeholder")||o.attr("data-placeholder")||a.filter_placeholder.search||"",b.attr("placeholder",h))),b&&(f=(e.isArray(a.filter_cssFilter)?"undefined"!=typeof a.filter_cssFilter[n]?a.filter_cssFilter[n]||"":"":a.filter_cssFilter)||"",b.addClass(r.filter+" "+f).attr("data-column",n),d&&(b.attr("placeholder","").addClass(r.filterDisabled)[0].disabled=!0))},bindSearch:function(r,i,l){if(r=e(r)[0],i=e(i),i.length){var a,s=r.config,n=s.widgetOptions,o=s.namespace+"filter",c=n.filter_$externalFilters;l!==!0&&(a=n.filter_anyColumnSelector+","+n.filter_multipleColumnSelector,n.filter_$anyMatch=i.filter(a),n.filter_$externalFilters=c&&c.length?n.filter_$externalFilters.add(i):i,t.setFilters(r,s.$table.data("lastSearch")||[],l===!1)),a="keypress keyup search change ".split(" ").join(o+" "),i.attr("data-lastSearchTime",(new Date).getTime()).unbind(a.replace(/\s+/g," ")).bind("keyup"+o,function(i){if(e(this).attr("data-lastSearchTime",(new Date).getTime()),27===i.which)this.value="";else{if(n.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof n.filter_liveSearch&&this.value.length<n.filter_liveSearch||13!==i.which&&8!==i.which&&(i.which<32||i.which>=37&&i.which<=40)))return}t.filter.searching(r,!0,!0)}).bind("search change keypress ".split(" ").join(o+" "),function(i){var l=e(this).data("column");(13===i.which||"search"===i.type||"change"===i.type&&this.value!==s.lastSearch[l])&&(i.preventDefault(),e(this).attr("data-lastSearchTime",(new Date).getTime()),t.filter.searching(r,!1,!0))})}},searching:function(e,r,i){var l=e.config.widgetOptions;clearTimeout(l.searchTimer),"undefined"==typeof r||r===!0?l.searchTimer=setTimeout(function(){t.filter.checkFilters(e,r,i)},l.filter_liveSearch?l.filter_searchDelay:10):t.filter.checkFilters(e,r,i)},checkFilters:function(i,l,a){var s=i.config,n=s.widgetOptions,o=e.isArray(l),c=o?l:t.getFilters(i,!0),d=(c||[]).join("");return e.isEmptyObject(s.cache)?void(s.delayInit&&s.pager&&s.pager.initialized&&s.$table.trigger("updateCache",[function(){t.filter.checkFilters(i,!1,a)}])):(o&&(t.setFilters(i,c,!1,a!==!0),n.filter_initialized||(s.lastCombinedFilter="")),n.filter_hideFilters&&s.$table.find("."+r.filterRow).trigger(""===d?"mouseleave":"mouseenter"),s.lastCombinedFilter!==d||l===!1?(l===!1&&(s.lastCombinedFilter=null,s.lastSearch=[]),n.filter_initialized&&s.$table.trigger("filterStart",[c]),s.showProcessing?void setTimeout(function(){return t.filter.findRows(i,c,d),!1},30):(t.filter.findRows(i,c,d),!1)):void 0)},hideFilters:function(i,l){var a;l.$table.find("."+r.filterRow).bind("mouseenter mouseleave",function(t){var i=t,s=e(this);clearTimeout(a),a=setTimeout(function(){/enter|over/.test(i.type)?s.removeClass(r.filterRowHide):e(document.activeElement).closest("tr")[0]!==s[0]&&""===l.lastCombinedFilter&&s.addClass(r.filterRowHide)},200)}).find("input, select").bind("focus blur",function(i){var s=i,n=e(this).closest("tr");clearTimeout(a),a=setTimeout(function(){clearTimeout(a),""===t.getFilters(l.$table).join("")&&n.toggleClass(r.filterRowHide,"focus"!==s.type)},200)})},defaultFilter:function(r,i){if(""===r)return r;var l=t.filter.regex.iQuery,a=i.match(t.filter.regex.igQuery).length,s=a>1?e.trim(r).split(/\s/):[e.trim(r)],n=s.length-1,o=0,c=i;for(1>n&&a>1&&(s[1]=s[0]);l.test(c);)c=c.replace(l,s[o++]||""),l.test(c)&&n>o&&""!==(s[o]||"")&&(c=i.replace(l,c));return c},getLatestSearch:function(t){return t?t.sort(function(t,r){return e(r).attr("data-lastSearchTime")-e(t).attr("data-lastSearchTime")}):t||e()},multipleColumns:function(r,i){var l,a,s,n,o,c,d,f,u,h=r.widgetOptions,p=h.filter_initialized||!i.filter(h.filter_anyColumnSelector).length,g=[],m=e.trim(t.filter.getLatestSearch(i).attr("data-column")||"");if(p&&/-/.test(m))for(a=m.match(/(\d+)\s*-\s*(\d+)/g),u=a.length,f=0;u>f;f++){for(s=a[f].split(/\s*-\s*/),n=parseInt(s[0],10)||0,o=parseInt(s[1],10)||r.columns-1,n>o&&(l=n,n=o,o=l),o>=r.columns&&(o=r.columns-1);o>=n;n++)g.push(n);m=m.replace(a[f],"")}if(p&&/,/.test(m))for(c=m.split(/\s*,\s*/),u=c.length,d=0;u>d;d++)""!==c[d]&&(f=parseInt(c[d],10),f<r.columns&&g.push(f));if(!g.length)for(f=0;f<r.columns;f++)g.push(f);return g},processTypes:function(r,i,l){var a,s=null,n=null;for(a in t.filter.types)e.inArray(a,l.excludeMatch)<0&&null===n&&(n=t.filter.types[a](r,i,l),null!==n&&(s=n));return s},processRow:function(r,i,l){var a,s,n,o,c,d,f,u,h=t.filter.regex,p=r.widgetOptions,g=!0;if(i.$cells=i.$row.children(),i.anyMatchFlag){if(a=t.filter.multipleColumns(r,p.filter_$anyMatch),i.anyMatch=!0,i.isMatch=!0,i.rowArray=i.$cells.map(function(l){return e.inArray(l,a)>-1?(i.parsed[l]?u=i.cacheArray[l]:(u=i.rawArray[l],u=e.trim(p.filter_ignoreCase?u.toLowerCase():u),r.sortLocaleCompare&&(u=t.replaceAccents(u))),u):void 0}).get(),i.filter=i.anyMatchFilter,i.iFilter=i.iAnyMatchFilter,i.exact=i.rowArray.join(" "),i.iExact=p.filter_ignoreCase?i.exact.toLowerCase():i.exact,i.cache=i.cacheArray.slice(0,-1).join(" "),l.excludeMatch=l.noAnyMatch,c=t.filter.processTypes(r,i,l),null!==c)g=c;else if(p.filter_startsWith)for(g=!1,a=r.columns;!g&&a>0;)a--,g=g||0===i.rowArray[a].indexOf(i.iFilter);else g=(i.iExact+i.childRowText).indexOf(i.iFilter)>=0;if(i.anyMatch=!1,i.filters.join("")===i.filter)return g}for(a=0;a<r.columns;a++)i.filter=i.filters[a],i.index=a,l.excludeMatch=l.excludeFilter[a],i.filter&&(i.cache=i.cacheArray[a],p.filter_useParsedData||i.parsed[a]?i.exact=i.cache:(n=i.rawArray[a]||"",i.exact=r.sortLocaleCompare?t.replaceAccents(n):n),i.iExact=!h.type.test(typeof i.exact)&&p.filter_ignoreCase?i.exact.toLowerCase():i.exact,i.isMatch=r.$headerIndexed[i.index].hasClass("filter-match"),n=g,f=p.filter_columnFilters?r.$filters.add(r.$externalFilters).filter('[data-column="'+a+'"]').find("select option:selected").attr("data-function-name")||"":"",r.sortLocaleCompare&&(i.filter=t.replaceAccents(i.filter)),o=!0,p.filter_defaultFilter&&h.iQuery.test(l.defaultColFilter[a])&&(i.filter=t.filter.defaultFilter(i.filter,l.defaultColFilter[a]),o=!1),i.iFilter=p.filter_ignoreCase?(i.filter||"").toLowerCase():i.filter,d=l.functions[a],s=r.$headerIndexed[a].hasClass("filter-select"),c=null,(d||s&&o)&&(d===!0||s?c=i.isMatch?i.iExact.search(i.iFilter)>=0:i.filter===i.exact:"function"==typeof d?c=d(i.exact,i.cache,i.filter,a,i.$row,r,i):"function"==typeof d[f||i.filter]&&(u=f||i.filter,c=d[u](i.exact,i.cache,i.filter,a,i.$row,r,i))),null===c?(c=t.filter.processTypes(r,i,l),null!==c?n=c:(u=(i.iExact+i.childRowText).indexOf(t.filter.parseFilter(r,i.iFilter,a,i.parsed[a])),n=!p.filter_startsWith&&u>=0||p.filter_startsWith&&0===u)):n=c,g=n?g:!1);return g},findRows:function(r,i,l){if(r.config.lastCombinedFilter!==l&&r.config.widgetOptions.filter_initialized){var a,s,n,o,c,d,f,u,h,p,g,m,b,y,_,v,w,x,C,z,S,$,F=e.extend([],i),R=t.filter.regex,k=r.config,T=k.widgetOptions,A={anyMatch:!1,filters:i,filter_regexCache:[]},H={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:t.getColumnData(r,T.filter_defaultFilter,k.columns,!0)||""};for(A.parsed=k.$headers.map(function(i){return k.parsers&&k.parsers[i]&&k.parsers[i].parsed||t.getData&&"parsed"===t.getData(k.$headerIndexed[i],t.getColumnData(r,k.headers,i),"filter")||e(this).hasClass("filter-parsed")}).get(),u=0;u<k.columns;u++)H.functions[u]=t.getColumnData(r,T.filter_functions,u),H.defaultColFilter[u]=t.getColumnData(r,T.filter_defaultFilter,u)||"",H.excludeFilter[u]=(t.getColumnData(r,T.filter_excludeFilter,u,!0)||"").split(/\s+/);for(k.debug&&(t.log("Filter: Starting filter widget search",i),b=new Date),k.filteredRows=0,k.totalRows=0,l=(F||[]).join(""),d=0;d<k.$tbodies.length;d++){if(f=t.processTbody(r,k.$tbodies.eq(d),!0),u=k.columns,s=k.cache[d].normalized,o=e(e.map(s,function(e){return e[u].$row.get()})),""===l||T.filter_serversideFiltering)o.removeClass(T.filter_filteredRow).not("."+k.cssChildRow).css("display","");else{if(o=o.not("."+k.cssChildRow),a=o.length,(T.filter_$anyMatch&&T.filter_$anyMatch.length||"undefined"!=typeof i[k.columns])&&(A.anyMatchFlag=!0,A.anyMatchFilter=""+(i[k.columns]||T.filter_$anyMatch&&t.filter.getLatestSearch(T.filter_$anyMatch).val()||""),T.filter_columnAnyMatch)){for(x=A.anyMatchFilter.split(R.andSplit),C=!1,_=0;_<x.length;_++)z=x[_].split(":"),z.length>1&&(S=parseInt(z[0],10)-1,S>=0&&S<k.columns&&(i[S]=z[1],x.splice(_,1),_--,C=!0));C&&(A.anyMatchFilter=x.join(" && "))}if(w=T.filter_searchFiltered,g=k.lastSearch||k.$table.data("lastSearch")||[],w)for(_=0;u+1>_;_++)y=i[_]||"",w||(_=u),w=!(!w||!g.length||0!==y.indexOf(g[_]||"")||R.alreadyFiltered.test(y)||/[=\"\|!]/.test(y)||/(>=?\s*-\d)/.test(y)||/(<=?\s*\d)/.test(y)||""!==y&&k.$filters&&k.$filters.eq(_).find("select").length&&!k.$headerIndexed[_].hasClass("filter-match"));for(v=o.not("."+T.filter_filteredRow).length,w&&0===v&&(w=!1),k.debug&&t.log("Filter: Searching through "+(w&&a>v?v:"all")+" rows"),A.anyMatchFlag&&(k.sortLocaleCompare&&(A.anyMatchFilter=t.replaceAccents(A.anyMatchFilter)),T.filter_defaultFilter&&R.iQuery.test(H.defaultAnyFilter)&&(A.anyMatchFilter=t.filter.defaultFilter(A.anyMatchFilter,H.defaultAnyFilter),w=!1),A.iAnyMatchFilter=T.filter_ignoreCase&&k.ignoreCase?A.anyMatchFilter.toLowerCase():A.anyMatchFilter),c=0;a>c;c++)if($=o[c].className,h=c&&R.child.test($),!(h||w&&R.filtered.test($))){if(A.$row=o.eq(c),A.cacheArray=s[c],n=A.cacheArray[k.columns],A.rawArray=n.raw,A.childRowText="",!T.filter_childByColumn){for($="",p=n.child,_=0;_<p.length;_++)$+=" "+p[_].join("")||"";A.childRowText=T.filter_childRows?T.filter_ignoreCase?$.toLowerCase():$:""}if(m=t.filter.processRow(k,A,H),p=n.$row.filter(":gt( 0 )"),T.filter_childRows&&p.length){if(T.filter_childByColumn)for(_=0;_<p.length;_++)A.$row=p.eq(_),A.cacheArray=n.child[_],A.rawArray=A.cacheArray,m=m||t.filter.processRow(k,A,H);p.toggleClass(T.filter_filteredRow,!m)}n.$row.toggleClass(T.filter_filteredRow,!m)[0].display=m?"":"none"}}k.filteredRows+=o.not("."+T.filter_filteredRow).length,k.totalRows+=o.length,t.processTbody(r,f,!1)}k.lastCombinedFilter=l,k.lastSearch=F,k.$table.data("lastSearch",F),T.filter_saveFilters&&t.storage&&t.storage(r,"tablesorter-filters",F),k.debug&&t.benchmark("Completed filter widget search",b),T.filter_initialized&&k.$table.trigger("filterEnd",k),setTimeout(function(){k.$table.trigger("applyWidgets")},0)}},getOptionSource:function(r,i,l){r=e(r)[0];var a,s,n,o,c=r.config,d=c.widgetOptions,f=[],u=!1,h=d.filter_selectSource,p=c.$table.data("lastSearch")||[],g=e.isFunction(h)?!0:t.getColumnData(r,h,i);if(l&&""!==p[i]&&(l=!1),g===!0)u=h(r,i,l);else{if(g instanceof e||"string"===e.type(g)&&g.indexOf("</option>")>=0)return g;e.isArray(g)?u=g:"object"===e.type(h)&&g&&(u=g(r,i,l))}if(u===!1&&(u=t.filter.getOptions(r,i,l)),u=e.grep(u,function(t,r){return e.inArray(t,u)===r}),c.$headerIndexed[i].hasClass("filter-select-nosort"))return u;for(o=u.length,n=0;o>n;n++)s=u[n],f.push({t:s,p:c.parsers&&c.parsers.length&&c.parsers[i].format(s,r,[],i)||s});for(a=c.textSorter||"",f.sort(function(l,s){var n=l.p.toString(),o=s.p.toString();return e.isFunction(a)?a(n,o,!0,i,r):"object"==typeof a&&a.hasOwnProperty(i)?a[i](n,o,!0,i,r):t.sortNatural?t.sortNatural(n,o):!0}),u=[],o=f.length,n=0;o>n;n++)u.push(f[n].t);return u},getOptions:function(t,r,i){t=e(t)[0];var l,a,s,n,o,c=t.config,d=c.widgetOptions,f=[];for(a=0;a<c.$tbodies.length;a++)for(o=c.cache[a],s=c.cache[a].normalized.length,l=0;s>l;l++)n=o.row?o.row[l]:o.normalized[l][c.columns].$row[0],i&&n.className.match(d.filter_filteredRow)||f.push(d.filter_useParsedData||c.parsers[r].parsed||c.$headerIndexed[r].hasClass("filter-parsed")?""+o.normalized[l][r]:o.normalized[l][c.columns].raw[r]);return f},buildSelect:function(i,l,a,s,n){if(i=e(i)[0],l=parseInt(l,10),i.config.cache&&!e.isEmptyObject(i.config.cache)){var o,c,d,f,u,h,p=i.config,g=p.widgetOptions,m=p.$headerIndexed[l],b='<option value="">'+(m.data("placeholder")||m.attr("data-placeholder")||g.filter_placeholder.select||"")+"</option>",y=p.$table.find("thead").find("select."+r.filter+'[data-column="'+l+'"]').val();if(("undefined"==typeof a||""===a)&&(a=t.filter.getOptionSource(i,l,n)),e.isArray(a)){for(o=0;o<a.length;o++)d=a[o]=(""+a[o]).replace(/\"/g,"&quot;"),c=d,d.indexOf(g.filter_selectSourceSeparator)>=0&&(f=d.split(g.filter_selectSourceSeparator),c=f[0],d=f[1]),b+=""!==a[o]?"<option "+(c===d?"":'data-function-name="'+a[o]+'" ')+'value="'+c+'">'+d+"</option>":"";a=[]}u=(p.$filters?p.$filters:p.$table.children("thead")).find("."+r.filter),g.filter_$externalFilters&&(u=u&&u.length?u.add(g.filter_$externalFilters):g.filter_$externalFilters),h=u.filter('select[data-column="'+l+'"]'),h.length&&(h[s?"html":"append"](b),e.isArray(a)||h.append(a).val(y),h.val(y))}},buildDefault:function(e,r){var i,l,a,s=e.config,n=s.widgetOptions,o=s.columns;for(i=0;o>i;i++)l=s.$headerIndexed[i],a=!(l.hasClass("filter-false")||l.hasClass("parser-false")),(l.hasClass("filter-select")||t.getColumnData(e,n.filter_functions,i)===!0)&&a&&t.filter.buildSelect(e,i,"",r,l.hasClass(n.filter_onlyAvail))}},t.getFilters=function(i,l,a,s){var n,o,c,d,f=!1,u=i?e(i)[0].config:"",h=u?u.widgetOptions:"";if(l!==!0&&h&&!h.filter_columnFilters||e.isArray(a)&&a.join("")===u.lastCombinedFilter)return e(i).data("lastSearch");if(u&&(u.$filters&&(o=u.$filters.find("."+r.filter)),h.filter_$externalFilters&&(o=o&&o.length?o.add(h.filter_$externalFilters):h.filter_$externalFilters),o&&o.length))for(f=a||[],n=0;n<u.columns+1;n++)d=n===u.columns?h.filter_anyColumnSelector+","+h.filter_multipleColumnSelector:'[data-column="'+n+'"]',c=o.filter(d),c.length&&(c=t.filter.getLatestSearch(c),e.isArray(a)?(s&&c.length>1&&(c=c.slice(1)),n===u.columns&&(d=c.filter(h.filter_anyColumnSelector),c=d.length?d:c),c.val(a[n]).trigger("change.tsfilter")):(f[n]=c.val()||"",n===u.columns?c.slice(1).filter('[data-column*="'+c.attr("data-column")+'"]').val(f[n]):c.slice(1).val(f[n])),n===u.columns&&c.length&&(h.filter_$anyMatch=c));
+ return 0===f.length&&(f=!1),f},t.setFilters=function(r,i,l,a){var s=r?e(r)[0].config:"",n=t.getFilters(r,!0,i,a);return s&&l&&(s.lastCombinedFilter=null,s.lastSearch=[],t.filter.searching(s.table,i,a),s.$table.trigger("filterFomatterUpdate")),!!n}}(jQuery),function(e,t){"use strict";var r=e.tablesorter||{};e.extend(r.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),r.addHeaderResizeEvent=function(t,r,i){if(t=e(t)[0],t.config){var l={timer:250},a=e.extend({},l,i),s=t.config,n=s.widgetOptions,o=function(e){var t,r,i,l,a,o,c=s.$headers.length;for(n.resize_flag=!0,r=[],t=0;c>t;t++)i=s.$headers.eq(t),l=i.data("savedSizes")||[0,0],a=i[0].offsetWidth,o=i[0].offsetHeight,(a!==l[0]||o!==l[1])&&(i.data("savedSizes",[a,o]),r.push(i[0]));r.length&&e!==!1&&s.$table.trigger("resize",[r]),n.resize_flag=!1};return o(!1),clearInterval(n.resize_timer),r?(n.resize_flag=!1,!1):void(n.resize_timer=setInterval(function(){n.resize_flag||o()},a.timer))}},r.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(i,l,a){if(!(l.$table.hasClass("hasStickyHeaders")||e.inArray("filter",l.widgets)>=0&&!l.$table.hasClass("hasFilters"))){var s,n,o,c,d=l.$table,f=e(a.stickyHeaders_attachTo),u=l.namespace+"stickyheaders ",h=e(a.stickyHeaders_yScroll||a.stickyHeaders_attachTo||t),p=e(a.stickyHeaders_xScroll||a.stickyHeaders_attachTo||t),g=d.children("thead:first"),m=g.children("tr").not(".sticky-false").children(),b=d.children("tfoot"),y=isNaN(a.stickyHeaders_offset)?e(a.stickyHeaders_offset):"",_=y.length?y.height()||0:parseInt(a.stickyHeaders_offset,10)||0,v=d.parent().closest("."+r.css.table).hasClass("hasStickyHeaders")?d.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],w=v.length?v.height():0,x=a.$sticky=d.clone().addClass("containsStickyHeaders "+r.css.sticky+" "+a.stickyHeaders+" "+l.namespace.slice(1)+"_extra_table").wrap('<div class="'+r.css.stickyWrap+'">'),C=x.parent().addClass(r.css.stickyHide).css({position:f.length?"absolute":"fixed",padding:parseInt(x.parent().parent().css("padding-left"),10),top:_+w,left:0,visibility:"hidden",zIndex:a.stickyHeaders_zIndex||2}),z=x.children("thead:first"),S="",$=0,F=function(e,r){var i,l,a,s,n,o=e.filter(":visible"),c=o.length;for(i=0;c>i;i++)s=r.filter(":visible").eq(i),n=o.eq(i),"border-box"===n.css("box-sizing")?l=n.outerWidth():"collapse"===s.css("border-collapse")?t.getComputedStyle?l=parseFloat(t.getComputedStyle(n[0],null).width):(a=parseFloat(n.css("border-width")),l=n.outerWidth()-parseFloat(n.css("padding-left"))-parseFloat(n.css("padding-right"))-a):l=n.width(),s.css({width:l,"min-width":l,"max-width":l})},R=function(){_=y.length?y.height()||0:parseInt(a.stickyHeaders_offset,10)||0,$=0,C.css({left:f.length?parseInt(f.css("padding-left"),10)||0:d.offset().left-parseInt(d.css("margin-left"),10)-p.scrollLeft()-$,width:d.outerWidth()}),F(d,x),F(m,c)},k=function(t){if(d.is(":visible")){w=v.length?v.offset().top-h.scrollTop()+v.height():0;var i=d.offset(),l=e.isWindow(h[0]),a=e.isWindow(p[0]),s=(f.length?l?h.scrollTop():h.offset().top:h.scrollTop())+_+w,n=d.height()-(C.height()+(b.height()||0)),o=s>i.top&&s<i.top+n?"visible":"hidden",c={visibility:o};f.length&&(c.top=l?s-f.offset().top:f.scrollTop()),a&&(c.left=d.offset().left-parseInt(d.css("margin-left"),10)-p.scrollLeft()-$),v.length&&(c.top=(c.top||0)+_+w),C.removeClass(r.css.stickyVis+" "+r.css.stickyHide).addClass("visible"===o?r.css.stickyVis:r.css.stickyHide).css(c),(o!==S||t)&&(R(),S=o)}};if(f.length&&!f.css("position")&&f.css("position","relative"),x.attr("id")&&(x[0].id+=a.stickyHeaders_cloneId),x.find("thead:gt(0), tr.sticky-false").hide(),x.find("tbody, tfoot").remove(),x.find("caption").toggle(a.stickyHeaders_includeCaption),c=z.children().children(),x.css({height:0,width:0,margin:0}),c.find("."+r.css.resizer).remove(),d.addClass("hasStickyHeaders").bind("pagerComplete"+u,function(){R()}),r.bindEvents(i,z.children().children("."+r.css.header)),d.after(C),l.onRenderHeader)for(o=z.children("tr").children(),n=o.length,s=0;n>s;s++)l.onRenderHeader.apply(o.eq(s),[s,l,x]);p.add(h).unbind("scroll resize ".split(" ").join(u).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(u),function(e){k("resize"===e.type)}),l.$table.unbind("stickyHeadersUpdate"+u).bind("stickyHeadersUpdate"+u,function(){k(!0)}),a.stickyHeaders_addResizeEvent&&r.addHeaderResizeEvent(i),d.hasClass("hasFilters")&&a.filter_columnFilters&&(d.bind("filterEnd"+u,function(){var i=e(document.activeElement).closest("td"),s=i.parent().children().index(i);C.hasClass(r.css.stickyVis)&&a.stickyHeaders_filteredToTop&&(t.scrollTo(0,d.position().top),s>=0&&l.$filters&&l.$filters.eq(s).find("a, select, input").filter(":visible").focus())}),r.filter.bindSearch(d,c.find("."+r.css.filter)),a.filter_hideFilters&&r.filter.hideFilters(x,l)),d.trigger("stickyHeadersInit")}},remove:function(i,l,a){var s=l.namespace+"stickyheaders ";l.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd stickyHeadersUpdate ".split(" ").join(s).replace(/\s+/g," ")).next("."+r.css.stickyWrap).remove(),a.$sticky&&a.$sticky.length&&a.$sticky.remove(),e(t).add(a.stickyHeaders_xScroll).add(a.stickyHeaders_yScroll).add(a.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(s).replace(/\s+/g," ")),r.addHeaderResizeEvent(i,!1)}})}(jQuery,window),function(e,t){"use strict";var r=e.tablesorter||{};e.extend(r.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),e(function(){var t="<style>body."+r.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+r.css.resizableContainer+" { position: relative; height: 1px; }."+r.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px;top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";e(t).appendTo("body")}),r.resizable={init:function(t,i){if(!t.$table.hasClass("hasResizable")){t.$table.addClass("hasResizable");var l,a,s,n,o,c=t.$table,d=c.parent(),f=parseInt(c.css("margin-top"),10),u=i.resizable_={useStorage:r.storage&&i.resizable!==!1,$wrap:d,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===d.css("overflow")||"scroll"===d.css("overflow")||"auto"===d.css("overflow-x")||"scroll"===d.css("overflow-x"),storedSizes:[]};for(r.resizableReset(t.table,!0),u.tableWidth=c.width(),u.fullWidth=Math.abs(d.width()-u.tableWidth)<20,u.useStorage&&u.overflow&&(r.storage(t.table,"tablesorter-table-original-css-width",u.tableWidth),o=r.storage(t.table,"tablesorter-table-resized-width")||"auto",r.resizable.setWidth(c,o,!0)),i.resizable_.storedSizes=n=(u.useStorage?r.storage(t.table,r.css.resizableStorage):[])||[],r.resizable.setWidths(t,i,n),r.resizable.updateStoredSizes(t,i),i.$resizable_container=e('<div class="'+r.css.resizableContainer+'">').css({top:f}).insertBefore(c),s=0;s<t.columns;s++)a=t.$headerIndexed[s],o=r.getColumnData(t.table,t.headers,s),l="false"===r.getData(a,o,"resizable"),l||e('<div class="'+r.css.resizableHandle+'">').appendTo(i.$resizable_container).attr({"data-column":s,unselectable:"on"}).data("header",a).bind("selectstart",!1);c.one("tablesorter-initialized",function(){r.resizable.setHandlePosition(t,i),r.resizable.bindings(this.config,this.config.widgetOptions)})}},updateStoredSizes:function(e,t){var r,i,l=e.columns,a=t.resizable_;for(a.storedSizes=[],r=0;l>r;r++)i=e.$headerIndexed[r],a.storedSizes[r]=i.is(":visible")?i.width():0},setWidth:function(e,t,r){e.css({width:t,"min-width":r?t:"","max-width":r?t:""})},setWidths:function(t,i,l){var a,s,n=i.resizable_,o=e(t.namespace+"_extra_headers"),c=t.$table.children("colgroup").children("col");if(l=l||n.storedSizes||[],l.length){for(a=0;a<t.columns;a++)r.resizable.setWidth(t.$headerIndexed[a],l[a],n.overflow),o.length&&(s=o.eq(a).add(c.eq(a)),r.resizable.setWidth(s,l[a],n.overflow));s=e(t.namespace+"_extra_table"),s.length&&!r.hasWidget(t.table,"scroller")&&r.resizable.setWidth(s,t.$table.outerWidth(),n.overflow)}},setHandlePosition:function(t,i){var l,a=r.hasWidget(t.table,"scroller"),s=t.$table.height(),n=i.$resizable_container.children(),o=Math.floor(n.width()/2);a&&(s=0,t.$table.closest("."+r.css.scrollerWrap).children().each(function(){var t=e(this);s+=t.filter('[style*="height"]').length?t.height():t.children("table").height()})),l=t.$table.position().left,n.each(function(){var r=e(this),a=parseInt(r.attr("data-column"),10),n=t.columns-1,c=r.data("header");c&&(c.is(":visible")?(n>a||a===n&&i.resizable_addLastColumn)&&r.css({display:"inline-block",height:s,left:c.position().left-l+c.outerWidth()-o}):r.hide())})},toggleTextSelection:function(t,i){var l=t.namespace+"tsresize";t.widgetOptions.resizable_.disabled=i,e("body").toggleClass(r.css.resizableNoSelect,i),i?e("body").attr("unselectable","on").bind("selectstart"+l,!1):e("body").removeAttr("unselectable").unbind("selectstart"+l)},bindings:function(i,l){var a=i.namespace+"tsresize";l.$resizable_container.children().bind("mousedown",function(t){var a,s=l.resizable_,n=e(i.namespace+"_extra_headers"),o=e(t.target).data("header");a=parseInt(o.attr("data-column"),10),s.$target=o=o.add(n.filter('[data-column="'+a+'"]')),s.target=a,s.$next=t.shiftKey||l.resizable_targetLast?o.parent().children().not(".resizable-false").filter(":last"):o.nextAll(":not(.resizable-false)").eq(0),a=parseInt(s.$next.attr("data-column"),10),s.$next=s.$next.add(n.filter('[data-column="'+a+'"]')),s.next=a,s.mouseXPosition=t.pageX,r.resizable.updateStoredSizes(i,l),r.resizable.toggleTextSelection(i,!0)}),e(document).bind("mousemove"+a,function(e){var t=l.resizable_;t.disabled&&0!==t.mouseXPosition&&t.$target&&(l.resizable_throttle?(clearTimeout(t.timer),t.timer=setTimeout(function(){r.resizable.mouseMove(i,l,e)},isNaN(l.resizable_throttle)?5:l.resizable_throttle)):r.resizable.mouseMove(i,l,e))}).bind("mouseup"+a,function(){l.resizable_.disabled&&(r.resizable.toggleTextSelection(i,!1),r.resizable.stopResize(i,l),r.resizable.setHandlePosition(i,l))}),e(t).bind("resize"+a+" resizeEnd"+a,function(){r.resizable.setHandlePosition(i,l)}),i.$table.bind("columnUpdate"+a,function(){r.resizable.setHandlePosition(i,l)}).find("thead:first").add(e(i.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+a,function(){var e=0===l.resizable_.storedSizes.length;return r.resizableReset(i.table),r.resizable.setHandlePosition(i,l),l.resizable_.storedSizes=[],e})},mouseMove:function(t,i,l){if(0!==i.resizable_.mouseXPosition&&i.resizable_.$target){var a,s=0,n=i.resizable_,o=n.$next,c=n.storedSizes[n.target],d=l.pageX-n.mouseXPosition;if(n.overflow){if(c+d>0){for(n.storedSizes[n.target]+=d,r.resizable.setWidth(n.$target,n.storedSizes[n.target],!0),a=0;a<t.columns;a++)s+=n.storedSizes[a];r.resizable.setWidth(t.$table.add(e(t.namespace+"_extra_table")),s)}o.length||(n.$wrap[0].scrollLeft=t.$table.width())}else n.fullWidth?(n.storedSizes[n.target]+=d,n.storedSizes[n.next]-=d,r.resizable.setWidths(t,i)):(n.storedSizes[n.target]+=d,r.resizable.setWidths(t,i));n.mouseXPosition=l.pageX,t.$table.trigger("stickyHeadersUpdate")}},stopResize:function(e,t){var i=t.resizable_;r.resizable.updateStoredSizes(e,t),i.useStorage&&(r.storage(e.table,r.css.resizableStorage,i.storedSizes),r.storage(e.table,"tablesorter-table-resized-width",e.$table.width())),i.mouseXPosition=0,i.$target=i.$next=null,e.$table.trigger("stickyHeadersUpdate")}},r.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1,resizable_fullWidth:null},init:function(e,t,i,l){r.resizable.init(i,l)},remove:function(t,i,l,a){if(l.$resizable_container){var s=i.namespace+"tsresize";i.$table.add(e(i.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+s),l.$resizable_container.remove(),r.resizable.toggleTextSelection(i,!1),r.resizableReset(t,a),e(document).unbind("mousemove"+s+" mouseup"+s)}}}),r.resizableReset=function(t,i){e(t).each(function(){var e,l,a=this.config,s=a&&a.widgetOptions,n=s.resizable_;if(t&&a&&a.$headerIndexed.length){for(n.overflow&&n.tableWidth&&(r.resizable.setWidth(a.$table,n.tableWidth,!0),n.useStorage&&r.storage(t,"tablesorter-table-resized-width","auto")),e=0;e<a.columns;e++)l=a.$headerIndexed[e],s.resizable_widths&&s.resizable_widths[e]?r.resizable.setWidth(l,s.resizable_widths[e],n.overflow):l.hasClass("resizable-false")||r.resizable.setWidth(l,"",n.overflow);a.$table.trigger("stickyHeadersUpdate"),r.storage&&!i&&r.storage(this,r.css.resizableStorage,{})}})}}(jQuery,window),function(e){"use strict";var t=e.tablesorter||{};t.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(e,t,r,i){t.format(e,r,i,!0)},format:function(r,i,l,a){var s,n,o=i.$table,c=l.saveSort!==!1,d={sortList:i.sortList};i.debug&&(n=new Date),o.hasClass("hasSaveSort")?c&&r.hasInitialized&&t.storage&&(t.storage(r,"tablesorter-savesort",d),i.debug&&t.benchmark("saveSort widget: Saving last sort: "+i.sortList,n)):(o.addClass("hasSaveSort"),d="",t.storage&&(s=t.storage(r,"tablesorter-savesort"),d=s&&s.hasOwnProperty("sortList")&&e.isArray(s.sortList)?s.sortList:"",i.debug&&t.benchmark('saveSort: Last sort loaded: "'+d+'"',n),o.bind("saveSortReset",function(e){e.stopPropagation(),t.storage(r,"tablesorter-savesort","")})),a&&d&&d.length>0?i.sortList=d:r.hasInitialized&&d&&d.length>0&&o.trigger("sorton",[d]))},remove:function(e,r){r.$table.removeClass("hasSaveSort"),t.storage&&t.storage(e,"tablesorter-savesort","")}})}(jQuery),e.tablesorter}); /* custom */ $(document).ready(function(){$('.table-sortable').tablesorter({theme:'bootstrap',widgets:['uitheme','zebra','filter'],headerTemplate:'{content} {icon}',widthFixed:true,ignoreCase:true,widgetOptions:{filter_columnFilters:true,zebra:['even','odd'],filter_reset:'.reset'}});}); /* jquery.tablesorter.widgets.js */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(e,t,r){"use strict";var i=e.tablesorter||{};i.storage=function(l,a,s,n){l=e(l)[0];var o,c,d,f=!1,u={},h=l.config,p=h&&h.widgetOptions,g=n&&n.useSessionStorage||p&&p.storage_useSessionStorage?"sessionStorage":"localStorage",m=e(l),b=n&&n.id||m.attr(n&&n.group||p&&p.storage_group||"data-table-group")||p&&p.storage_tableId||l.id||e(".tablesorter").index(m),y=n&&n.url||m.attr(n&&n.page||p&&p.storage_page||"data-table-page")||p&&p.storage_fixedUrl||h&&h.fixedUrl||t.location.pathname;if(g in t)try{t[g].setItem("_tmptest","temp"),f=!0,t[g].removeItem("_tmptest")}catch(_){h&&h.debug&&i.log(g+" is not supported in this browser")}return e.parseJSON&&(f?u=e.parseJSON(t[g][a]||"null")||{}:(c=r.cookie.split(/[;\s|=]/),o=e.inArray(a,c)+1,u=0!==o?e.parseJSON(c[o]||"null")||{}:{})),(s||""===s)&&t.JSON&&JSON.hasOwnProperty("stringify")?(u[y]||(u[y]={}),u[y][b]=s,f?t[g][a]=JSON.stringify(u):(d=new Date,d.setTime(d.getTime()+31536e6),r.cookie=a+"="+JSON.stringify(u).replace(/\"/g,'"')+"; expires="+d.toGMTString()+"; path=/"),void 0):u&&u[y]?u[y][b]:""}}(jQuery,window,document),function(e){"use strict";var t=e.tablesorter||{};t.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s",iconSortAsc:"ui-icon-carat-1-n",iconSortDesc:"ui-icon-carat-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(t.css,{wrapper:"tablesorter-wrapper"}),t.addWidget({id:"uitheme",priority:10,format:function(r,i,l){var a,s,n,o,c,d,f,u,h,p,g,m,b=t.themes,y=i.$table.add(e(i.namespace+"_extra_table")),_=i.$headers.add(e(i.namespace+"_extra_headers")),v=i.theme||"jui",w=b[v]||{},x=e.trim([w.sortNone,w.sortDesc,w.sortAsc,w.active].join(" ")),C=e.trim([w.iconSortNone,w.iconSortDesc,w.iconSortAsc].join(" "));for(i.debug&&(o=new Date),y.hasClass("tablesorter-"+v)&&i.theme===i.appliedTheme&&l.uitheme_applied||(l.uitheme_applied=!0,h=b[i.appliedTheme]||{},m=!e.isEmptyObject(h),p=m?[h.sortNone,h.sortDesc,h.sortAsc,h.active].join(" "):"",g=m?[h.iconSortNone,h.iconSortDesc,h.iconSortAsc].join(" "):"",m&&(l.zebra[0]=e.trim(" "+l.zebra[0].replace(" "+h.even,"")),l.zebra[1]=e.trim(" "+l.zebra[1].replace(" "+h.odd,"")),i.$tbodies.children().removeClass([h.even,h.odd].join(" "))),w.even&&(l.zebra[0]+=" "+w.even),w.odd&&(l.zebra[1]+=" "+w.odd),y.children("caption").removeClass(h.caption||"").addClass(w.caption),f=y.removeClass((i.appliedTheme?"tablesorter-"+(i.appliedTheme||""):"")+" "+(h.table||"")).addClass("tablesorter-"+v+" "+(w.table||"")).children("tfoot"),i.appliedTheme=i.theme,f.length&&f.children("tr").removeClass(h.footerRow||"").addClass(w.footerRow).children("th, td").removeClass(h.footerCells||"").addClass(w.footerCells),_.removeClass((m?[h.header,h.hover,p].join(" "):"")||"").addClass(w.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(t){e(this)["mouseenter"===t.type?"addClass":"removeClass"](w.hover||"")}),_.each(function(){var r=e(this);r.find("."+t.css.wrapper).length||r.wrapInner('<div class="'+t.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),i.cssIcon&&_.find("."+t.css.icon).removeClass(m?[h.icons,g].join(" "):"").addClass(w.icons||""),y.hasClass("hasFilters")&&y.children("thead").children("."+t.css.filterRow).removeClass(m?h.filterRow||"":"").addClass(w.filterRow||"")),a=0;a<i.columns;a++)c=i.$headers.add(e(i.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+a+'"]'),d=t.css.icon?c.find("."+t.css.icon):e(),u=_.not(".sorter-false").filter('[data-column="'+a+'"]:last'),u.length&&(c.removeClass(x),d.removeClass(C),u[0].sortDisabled?d.removeClass(w.icons||""):(s=w.sortNone,n=w.iconSortNone,u.hasClass(t.css.sortAsc)?(s=[w.sortAsc,w.active].join(" "),n=w.iconSortAsc):u.hasClass(t.css.sortDesc)&&(s=[w.sortDesc,w.active].join(" "),n=w.iconSortDesc),c.addClass(s),d.addClass(n||"")));i.debug&&t.benchmark("Applying "+v+" theme",o)},remove:function(e,r,i,l){if(i.uitheme_applied){var a=r.$table,s=r.appliedTheme||"jui",n=t.themes[s]||t.themes.jui,o=a.children("thead").children(),c=n.sortNone+" "+n.sortDesc+" "+n.sortAsc,d=n.iconSortNone+" "+n.iconSortDesc+" "+n.iconSortAsc;a.removeClass("tablesorter-"+s+" "+n.table),i.uitheme_applied=!1,l||(a.find(t.css.header).removeClass(n.header),o.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(n.hover+" "+c+" "+n.active).filter("."+t.css.filterRow).removeClass(n.filterRow),o.find("."+t.css.icon).removeClass(n.icons+" "+d))}}})}(jQuery),function(e){"use strict";var t=e.tablesorter||{};t.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(r,i,l){var a,s,n,o,c,d,f,u,h=i.$table,p=i.$tbodies,g=i.sortList,m=g.length,b=l&&l.columns||["primary","secondary","tertiary"],y=b.length-1;for(f=b.join(" "),s=0;s<p.length;s++)a=t.processTbody(r,p.eq(s),!0),n=a.children("tr"),n.each(function(){if(c=e(this),"none"!==this.style.display&&(d=c.children().removeClass(f),g&&g[0]&&(d.eq(g[0][0]).addClass(b[0]),m>1)))for(u=1;m>u;u++)d.eq(g[u][0]).addClass(b[u]||b[y])}),t.processTbody(r,a,!1);if(o=l.columns_thead!==!1?["thead tr"]:[],l.columns_tfoot!==!1&&o.push("tfoot tr"),o.length&&(n=h.find(o.join(",")).children().removeClass(f),m))for(u=0;m>u;u++)n.filter('[data-column="'+g[u][0]+'"]').addClass(b[u]||b[y])},remove:function(r,i,l){var a,s,n=i.$tbodies,o=(l.columns||["primary","secondary","tertiary"]).join(" ");for(i.$headers.removeClass(o),i.$table.children("tfoot").children("tr").children("th, td").removeClass(o),a=0;a<n.length;a++)s=t.processTbody(r,n.eq(a),!0),s.children("tr").each(function(){e(this).children().removeClass(o)}),t.processTbody(r,s,!1)}})}(jQuery),function(e){"use strict";var t=e.tablesorter||{},r=t.css;e.extend(r,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),t.addWidget({id:"filter",priority:50,options:{filter_childRows:!1,filter_childByColumn:!1,filter_columnFilters:!0,filter_columnAnyMatch:!0,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_startsWith:!1,filter_useParsedData:!1,filter_serversideFiltering:!1,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(e,r,i){r.$table.hasClass("hasFilters")||t.filter.init(e,r,i)},remove:function(i,l,a,s){var n,o,c=l.$table,d=l.$tbodies,f="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(l.namespace+"filter ");if(c.removeClass("hasFilters").unbind(f.replace(/\s+/g," ")).find("."+r.filterRow).remove(),!s){for(n=0;n<d.length;n++)o=t.processTbody(i,d.eq(n),!0),o.children().removeClass(a.filter_filteredRow).show(),t.processTbody(i,o,!1);a.filter_reset&&e(document).undelegate(a.filter_reset,"click.tsfilter")}}}),t.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,nondigit:/[^\w,. \-()]/g,operators:/[<>=]/g,query:"(q|query)"},types:{or:function(r,i,l){if(/\|/.test(i.iFilter)||t.filter.regex.orSplit.test(i.filter)){var a,s,n,o,c=e.extend({},i),d=i.index,f=i.parsed[d],u=i.filter.split(t.filter.regex.orSplit),h=i.iFilter.split(t.filter.regex.orSplit),p=u.length;for(a=0;p>a;a++)if(c.nestedFilters=!0,c.filter=""+(t.filter.parseFilter(r,u[a],d,f)||""),c.iFilter=""+(t.filter.parseFilter(r,h[a],d,f)||""),n="("+(t.filter.parseFilter(r,c.filter,d,f)||"")+")",o=new RegExp(i.isMatch?n:"^"+n+"$",r.widgetOptions.filter_ignoreCase?"i":""),s=o.test(c.exact)||t.filter.processTypes(r,c,l))return s;return s||!1}return null},and:function(r,i,l){if(t.filter.regex.andTest.test(i.filter)){var a,s,n,o,c,d=e.extend({},i),f=i.index,u=i.parsed[f],h=i.filter.split(t.filter.regex.andSplit),p=i.iFilter.split(t.filter.regex.andSplit),g=h.length;for(a=0;g>a;a++)d.nestedFilters=!0,d.filter=""+(t.filter.parseFilter(r,h[a],f,u)||""),d.iFilter=""+(t.filter.parseFilter(r,p[a],f,u)||""),o=("("+(t.filter.parseFilter(r,d.filter,f,u)||"")+")").replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"),c=new RegExp(i.isMatch?o:"^"+o+"$",r.widgetOptions.filter_ignoreCase?"i":""),n=c.test(d.exact)||t.filter.processTypes(r,d,l),s=0===a?n:s&&n;return s||!1}return null},regex:function(e,r){if(t.filter.regex.regex.test(r.filter)){var i,l=r.filter_regexCache[r.index]||t.filter.regex.regex.exec(r.filter),a=l instanceof RegExp;try{a||(r.filter_regexCache[r.index]=l=new RegExp(l[1],l[2])),i=l.test(r.exact)}catch(s){i=!1}return i}return null},operators:function(r,i){if(/^[<>]=?/.test(i.iFilter)&&""!==i.iExact){var l,a,s,n=r.table,o=i.index,c=i.parsed[o],d=t.formatFloat(i.iFilter.replace(t.filter.regex.operators,""),n),f=r.parsers[o],u=d;return(c||"numeric"===f.type)&&(s=e.trim(""+i.iFilter.replace(t.filter.regex.operators,"")),a=t.filter.parseFilter(r,s,o,!0),d="number"!=typeof a||""===a||isNaN(a)?d:a),!c&&"numeric"!==f.type||isNaN(d)||"undefined"==typeof i.cache?(s=isNaN(i.iExact)?i.iExact.replace(t.filter.regex.nondigit,""):i.iExact,l=t.formatFloat(s,n)):l=i.cache,/>/.test(i.iFilter)?a=/>=/.test(i.iFilter)?l>=d:l>d:/</.test(i.iFilter)&&(a=/<=/.test(i.iFilter)?d>=l:d>l),a||""!==u||(a=!0),a}return null},notMatch:function(r,i){if(/^\!/.test(i.iFilter)){var l,a=i.iFilter.replace("!",""),s=t.filter.parseFilter(r,a,i.index,i.parsed[i.index])||"";return t.filter.regex.exact.test(s)?(s=s.replace(t.filter.regex.exact,""),""===s?!0:e.trim(s)!==i.iExact):(l=i.iExact.search(e.trim(s)),""===s?!0:!(r.widgetOptions.filter_startsWith?0===l:l>=0))}return null},exact:function(r,i){if(t.filter.regex.exact.test(i.iFilter)){var l=i.iFilter.replace(t.filter.regex.exact,""),a=t.filter.parseFilter(r,l,i.index,i.parsed[i.index])||"";return i.anyMatch?e.inArray(a,i.rowArray)>=0:a==i.iExact}return null},range:function(e,r){if(t.filter.regex.toTest.test(r.iFilter)){var i,l,a,s,n=e.table,o=r.index,c=r.parsed[o],d=r.iFilter.split(t.filter.regex.toSplit);return l=d[0].replace(t.filter.regex.nondigit,"")||"",a=t.formatFloat(t.filter.parseFilter(e,l,o,c),n),l=d[1].replace(t.filter.regex.nondigit,"")||"",s=t.formatFloat(t.filter.parseFilter(e,l,o,c),n),(c||"numeric"===e.parsers[o].type)&&(i=e.parsers[o].format(""+d[0],n,e.$headers.eq(o),o),a=""===i||isNaN(i)?a:i,i=e.parsers[o].format(""+d[1],n,e.$headers.eq(o),o),s=""===i||isNaN(i)?s:i),!c&&"numeric"!==e.parsers[o].type||isNaN(a)||isNaN(s)?(l=isNaN(r.iExact)?r.iExact.replace(t.filter.regex.nondigit,""):r.iExact,i=t.formatFloat(l,n)):i=r.cache,a>s&&(l=a,a=s,s=l),i>=a&&s>=i||""===a||""===s}return null},wild:function(e,r){if(/[\?\*\|]/.test(r.iFilter)){var i=r.index,l=r.parsed[i],a=""+(t.filter.parseFilter(e,r.iFilter,i,l)||"");return!/\?\*/.test(a)&&r.nestedFilters&&(a=r.isMatch?a:"^("+a+")$"),new RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"),e.widgetOptions.filter_ignoreCase?"i":"").test(r.exact)}return null},fuzzy:function(e,r){if(/^~/.test(r.iFilter)){var i,l=0,a=r.iExact.length,s=r.iFilter.slice(1),n=t.filter.parseFilter(e,s,r.index,r.parsed[r.index])||"";for(i=0;a>i;i++)r.iExact[i]===n[l]&&(l+=1);return l===n.length?!0:!1}return null}},init:function(i,l,a){t.language=e.extend(!0,{},{to:"to",or:"or",and:"and"},t.language);var s,n,o,c,d,f,u,h,p,g=t.filter.regex;if(l.$table.addClass("hasFilters"),a.searchTimer=null,a.filter_initTimer=null,a.filter_formatterCount=0,a.filter_formatterInit=[],a.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',a.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',u="\\{"+t.filter.regex.query+"\\}",e.extend(g,{child:new RegExp(l.cssChildRow),filtered:new RegExp(a.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+t.language.or+"|-|"+t.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+t.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+t.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+t.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+t.language.and+"|&&)\\s+)","gi"),orSplit:new RegExp("(?:\\s+(?:"+t.language.or+")\\s+|\\|)","gi"),iQuery:new RegExp(u,"i"),igQuery:new RegExp(u,"ig")}),u=l.$headers.filter(".filter-false, .parser-false").length,a.filter_columnFilters!==!1&&u!==l.$headers.length&&t.filter.buildRow(i,l,a),o="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(l.namespace+"filter "),l.$table.bind(o,function(s,n){return u=a.filter_hideEmpty&&e.isEmptyObject(l.cache)&&!(l.delayInit&&"appendCache"===s.type),l.$table.find("."+r.filterRow).toggleClass(a.filter_filteredRow,u),/(search|filter)/.test(s.type)||(s.stopPropagation(),t.filter.buildDefault(i,!0)),"filterReset"===s.type?(l.$table.find("."+r.filter).add(a.filter_$externalFilters).val(""),t.filter.searching(i,[])):"filterEnd"===s.type?t.filter.buildDefault(i,!0):(n="search"===s.type?n:"updateComplete"===s.type?l.$table.data("lastSearch"):"",/(update|add)/.test(s.type)&&"updateComplete"!==s.type&&(l.lastCombinedFilter=null,l.lastSearch=[]),t.filter.searching(i,n,!0)),!1}),a.filter_reset&&(a.filter_reset instanceof e?a.filter_reset.click(function(){l.$table.trigger("filterReset")}):e(a.filter_reset).length&&e(document).undelegate(a.filter_reset,"click.tsfilter").delegate(a.filter_reset,"click.tsfilter",function(){l.$table.trigger("filterReset")})),a.filter_functions)for(d=0;d<l.columns;d++)if(h=t.getColumnData(i,a.filter_functions,d))if(c=l.$headerIndexed[d].removeClass("filter-select"),p=!(c.hasClass("filter-false")||c.hasClass("parser-false")),s="",h===!0&&p)t.filter.buildSelect(i,d);else if("object"==typeof h&&p){for(n in h)"string"==typeof n&&(s+=""===s?'<option value="">'+(c.data("placeholder")||c.attr("data-placeholder")||a.filter_placeholder.select||"")+"</option>":"",u=n,o=n,n.indexOf(a.filter_selectSourceSeparator)>=0&&(u=n.split(a.filter_selectSourceSeparator),o=u[1],u=u[0]),s+="<option "+(o===u?"":'data-function-name="'+n+'" ')+'value="'+u+'">'+o+"</option>");l.$table.find("thead").find("select."+r.filter+'[data-column="'+d+'"]').append(s),o=a.filter_selectSource,h=e.isFunction(o)?!0:t.getColumnData(i,o,d),h&&t.filter.buildSelect(l.table,d,"",!0,c.hasClass(a.filter_onlyAvail))}t.filter.buildDefault(i,!0),t.filter.bindSearch(i,l.$table.find("."+r.filter),!0),a.filter_external&&t.filter.bindSearch(i,a.filter_external),a.filter_hideFilters&&t.filter.hideFilters(i,l),l.showProcessing&&(o="filterStart filterEnd ".split(" ").join(l.namespace+"filter "),l.$table.unbind(o.replace(/\s+/g," ")).bind(o,function(a,s){c=s?l.$table.find("."+r.header).filter("[data-column]").filter(function(){return""!==s[e(this).data("column")]}):"",t.isProcessing(i,"filterStart"===a.type,s?c:"")})),l.filteredRows=l.totalRows,o="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(l.namespace+"filter "),l.$table.unbind(o.replace(/\s+/g," ")).bind(o,function(){var e=this.config.widgetOptions;f=t.filter.setDefaults(i,l,e)||[],f.length&&(l.delayInit&&""===f.join("")||t.setFilters(i,f,!0)),l.$table.trigger("filterFomatterUpdate"),setTimeout(function(){e.filter_initialized||t.filter.filterInitComplete(l)},100)}),l.pager&&l.pager.initialized&&!a.filter_initialized&&(l.$table.trigger("filterFomatterUpdate"),setTimeout(function(){t.filter.filterInitComplete(l)},100))},formatterUpdated:function(e,t){var r=e.closest("table")[0].config.widgetOptions;r.filter_initialized||(r.filter_formatterInit[t]=1)},filterInitComplete:function(r){var i,l,a=r.widgetOptions,s=0,n=function(){a.filter_initialized=!0,r.$table.trigger("filterInit",r),t.filter.findRows(r.table,r.$table.data("lastSearch")||[])};if(e.isEmptyObject(a.filter_formatter))n();else{for(l=a.filter_formatterInit.length,i=0;l>i;i++)1===a.filter_formatterInit[i]&&s++;clearTimeout(a.filter_initTimer),a.filter_initialized||s!==a.filter_formatterCount?a.filter_initialized||(a.filter_initTimer=setTimeout(function(){n()},500)):n()}},setDefaults:function(r,i,l){var a,s,n,o,c,d=t.getFilters(r)||[];if(l.filter_saveFilters&&t.storage&&(s=t.storage(r,"tablesorter-filters")||[],a=e.isArray(s),a&&""===s.join("")||!a||(d=s)),""===d.join(""))for(c=i.$headers.add(l.filter_$externalFilters).filter("["+l.filter_defaultAttrib+"]"),n=0;n<=i.columns;n++)o=n===i.columns?"all":n,d[n]=c.filter('[data-column="'+o+'"]').attr(l.filter_defaultAttrib)||d[n]||"";return i.$table.data("lastSearch",d),d},parseFilter:function(e,t,r,i){return i?e.parsers[r].format(t,e.table,[],r):t},buildRow:function(i,l,a){var s,n,o,c,d,f,u,h,p=a.filter_cellFilter,g=l.columns,m=e.isArray(p),b='<tr role="row" class="'+r.filterRow+" "+l.cssIgnoreRow+'">';for(n=0;g>n;n++)b+="<td",b+=m?p[n]?' class="'+p[n]+'"':"":""!==p?' class="'+p+'"':"",b+="></td>";for(l.$filters=e(b+="</tr>").appendTo(l.$table.children("thead").eq(0)).find("td"),n=0;g>n;n++)d=!1,o=l.$headerIndexed[n],u=t.getColumnData(i,a.filter_functions,n),c=a.filter_functions&&u&&"function"!=typeof u||o.hasClass("filter-select"),s=t.getColumnData(i,l.headers,n),d="false"===t.getData(o[0],s,"filter")||"false"===t.getData(o[0],s,"parser"),c?b=e("<select>").appendTo(l.$filters.eq(n)):(u=t.getColumnData(i,a.filter_formatter,n),u?(a.filter_formatterCount++,b=u(l.$filters.eq(n),n),b&&0===b.length&&(b=l.$filters.eq(n).children("input")),b&&(0===b.parent().length||b.parent().length&&b.parent()[0]!==l.$filters[n])&&l.$filters.eq(n).append(b)):b=e('<input type="search">').appendTo(l.$filters.eq(n)),b&&(h=o.data("placeholder")||o.attr("data-placeholder")||a.filter_placeholder.search||"",b.attr("placeholder",h))),b&&(f=(e.isArray(a.filter_cssFilter)?"undefined"!=typeof a.filter_cssFilter[n]?a.filter_cssFilter[n]||"":"":a.filter_cssFilter)||"",b.addClass(r.filter+" "+f).attr("data-column",n),d&&(b.attr("placeholder","").addClass(r.filterDisabled)[0].disabled=!0))},bindSearch:function(r,i,l){if(r=e(r)[0],i=e(i),i.length){var a,s=r.config,n=s.widgetOptions,o=s.namespace+"filter",c=n.filter_$externalFilters;l!==!0&&(a=n.filter_anyColumnSelector+","+n.filter_multipleColumnSelector,n.filter_$anyMatch=i.filter(a),n.filter_$externalFilters=c&&c.length?n.filter_$externalFilters.add(i):i,t.setFilters(r,s.$table.data("lastSearch")||[],l===!1)),a="keypress keyup search change ".split(" ").join(o+" "),i.attr("data-lastSearchTime",(new Date).getTime()).unbind(a.replace(/\s+/g," ")).bind("keyup"+o,function(i){if(e(this).attr("data-lastSearchTime",(new Date).getTime()),27===i.which)this.value="";else{if(n.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof n.filter_liveSearch&&this.value.length<n.filter_liveSearch||13!==i.which&&8!==i.which&&(i.which<32||i.which>=37&&i.which<=40)))return}t.filter.searching(r,!0,!0)}).bind("search change keypress ".split(" ").join(o+" "),function(i){var l=e(this).data("column");(13===i.which||"search"===i.type||"change"===i.type&&this.value!==s.lastSearch[l])&&(i.preventDefault(),e(this).attr("data-lastSearchTime",(new Date).getTime()),t.filter.searching(r,!1,!0))})}},searching:function(e,r,i){var l=e.config.widgetOptions;clearTimeout(l.searchTimer),"undefined"==typeof r||r===!0?l.searchTimer=setTimeout(function(){t.filter.checkFilters(e,r,i)},l.filter_liveSearch?l.filter_searchDelay:10):t.filter.checkFilters(e,r,i)},checkFilters:function(i,l,a){var s=i.config,n=s.widgetOptions,o=e.isArray(l),c=o?l:t.getFilters(i,!0),d=(c||[]).join("");return e.isEmptyObject(s.cache)?void(s.delayInit&&s.pager&&s.pager.initialized&&s.$table.trigger("updateCache",[function(){t.filter.checkFilters(i,!1,a)}])):(o&&(t.setFilters(i,c,!1,a!==!0),n.filter_initialized||(s.lastCombinedFilter="")),n.filter_hideFilters&&s.$table.find("."+r.filterRow).trigger(""===d?"mouseleave":"mouseenter"),s.lastCombinedFilter!==d||l===!1?(l===!1&&(s.lastCombinedFilter=null,s.lastSearch=[]),n.filter_initialized&&s.$table.trigger("filterStart",[c]),s.showProcessing?void setTimeout(function(){return t.filter.findRows(i,c,d),!1},30):(t.filter.findRows(i,c,d),!1)):void 0)},hideFilters:function(i,l){var a;l.$table.find("."+r.filterRow).bind("mouseenter mouseleave",function(t){var i=t,s=e(this);clearTimeout(a),a=setTimeout(function(){/enter|over/.test(i.type)?s.removeClass(r.filterRowHide):e(document.activeElement).closest("tr")[0]!==s[0]&&""===l.lastCombinedFilter&&s.addClass(r.filterRowHide)},200)}).find("input, select").bind("focus blur",function(i){var s=i,n=e(this).closest("tr");clearTimeout(a),a=setTimeout(function(){clearTimeout(a),""===t.getFilters(l.$table).join("")&&n.toggleClass(r.filterRowHide,"focus"!==s.type)},200)})},defaultFilter:function(r,i){if(""===r)return r;var l=t.filter.regex.iQuery,a=i.match(t.filter.regex.igQuery).length,s=a>1?e.trim(r).split(/\s/):[e.trim(r)],n=s.length-1,o=0,c=i;for(1>n&&a>1&&(s[1]=s[0]);l.test(c);)c=c.replace(l,s[o++]||""),l.test(c)&&n>o&&""!==(s[o]||"")&&(c=i.replace(l,c));return c},getLatestSearch:function(t){return t?t.sort(function(t,r){return e(r).attr("data-lastSearchTime")-e(t).attr("data-lastSearchTime")}):t||e()},multipleColumns:function(r,i){var l,a,s,n,o,c,d,f,u,h=r.widgetOptions,p=h.filter_initialized||!i.filter(h.filter_anyColumnSelector).length,g=[],m=e.trim(t.filter.getLatestSearch(i).attr("data-column")||"");if(p&&/-/.test(m))for(a=m.match(/(\d+)\s*-\s*(\d+)/g),u=a.length,f=0;u>f;f++){for(s=a[f].split(/\s*-\s*/),n=parseInt(s[0],10)||0,o=parseInt(s[1],10)||r.columns-1,n>o&&(l=n,n=o,o=l),o>=r.columns&&(o=r.columns-1);o>=n;n++)g.push(n);m=m.replace(a[f],"")}if(p&&/,/.test(m))for(c=m.split(/\s*,\s*/),u=c.length,d=0;u>d;d++)""!==c[d]&&(f=parseInt(c[d],10),f<r.columns&&g.push(f));if(!g.length)for(f=0;f<r.columns;f++)g.push(f);return g},processTypes:function(r,i,l){var a,s=null,n=null;for(a in t.filter.types)e.inArray(a,l.excludeMatch)<0&&null===n&&(n=t.filter.types[a](r,i,l),null!==n&&(s=n));return s},processRow:function(r,i,l){var a,s,n,o,c,d,f,u,h=t.filter.regex,p=r.widgetOptions,g=!0;if(i.$cells=i.$row.children(),i.anyMatchFlag){if(a=t.filter.multipleColumns(r,p.filter_$anyMatch),i.anyMatch=!0,i.isMatch=!0,i.rowArray=i.$cells.map(function(l){return e.inArray(l,a)>-1?(i.parsed[l]?u=i.cacheArray[l]:(u=i.rawArray[l],u=e.trim(p.filter_ignoreCase?u.toLowerCase():u),r.sortLocaleCompare&&(u=t.replaceAccents(u))),u):void 0}).get(),i.filter=i.anyMatchFilter,i.iFilter=i.iAnyMatchFilter,i.exact=i.rowArray.join(" "),i.iExact=p.filter_ignoreCase?i.exact.toLowerCase():i.exact,i.cache=i.cacheArray.slice(0,-1).join(" "),l.excludeMatch=l.noAnyMatch,c=t.filter.processTypes(r,i,l),null!==c)g=c;else if(p.filter_startsWith)for(g=!1,a=r.columns;!g&&a>0;)a--,g=g||0===i.rowArray[a].indexOf(i.iFilter);else g=(i.iExact+i.childRowText).indexOf(i.iFilter)>=0;if(i.anyMatch=!1,i.filters.join("")===i.filter)return g}for(a=0;a<r.columns;a++)i.filter=i.filters[a],i.index=a,l.excludeMatch=l.excludeFilter[a],i.filter&&(i.cache=i.cacheArray[a],p.filter_useParsedData||i.parsed[a]?i.exact=i.cache:(n=i.rawArray[a]||"",i.exact=r.sortLocaleCompare?t.replaceAccents(n):n),i.iExact=!h.type.test(typeof i.exact)&&p.filter_ignoreCase?i.exact.toLowerCase():i.exact,i.isMatch=r.$headerIndexed[i.index].hasClass("filter-match"),n=g,f=p.filter_columnFilters?r.$filters.add(r.$externalFilters).filter('[data-column="'+a+'"]').find("select option:selected").attr("data-function-name")||"":"",r.sortLocaleCompare&&(i.filter=t.replaceAccents(i.filter)),o=!0,p.filter_defaultFilter&&h.iQuery.test(l.defaultColFilter[a])&&(i.filter=t.filter.defaultFilter(i.filter,l.defaultColFilter[a]),o=!1),i.iFilter=p.filter_ignoreCase?(i.filter||"").toLowerCase():i.filter,d=l.functions[a],s=r.$headerIndexed[a].hasClass("filter-select"),c=null,(d||s&&o)&&(d===!0||s?c=i.isMatch?i.iExact.search(i.iFilter)>=0:i.filter===i.exact:"function"==typeof d?c=d(i.exact,i.cache,i.filter,a,i.$row,r,i):"function"==typeof d[f||i.filter]&&(u=f||i.filter,c=d[u](i.exact,i.cache,i.filter,a,i.$row,r,i))),null===c?(c=t.filter.processTypes(r,i,l),null!==c?n=c:(u=(i.iExact+i.childRowText).indexOf(t.filter.parseFilter(r,i.iFilter,a,i.parsed[a])),n=!p.filter_startsWith&&u>=0||p.filter_startsWith&&0===u)):n=c,g=n?g:!1);return g},findRows:function(r,i,l){if(r.config.lastCombinedFilter!==l&&r.config.widgetOptions.filter_initialized){var a,s,n,o,c,d,f,u,h,p,g,m,b,y,_,v,w,x,C,z,S,$,F=e.extend([],i),R=t.filter.regex,k=r.config,T=k.widgetOptions,A={anyMatch:!1,filters:i,filter_regexCache:[]},H={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:t.getColumnData(r,T.filter_defaultFilter,k.columns,!0)||""};for(A.parsed=k.$headers.map(function(i){return k.parsers&&k.parsers[i]&&k.parsers[i].parsed||t.getData&&"parsed"===t.getData(k.$headerIndexed[i],t.getColumnData(r,k.headers,i),"filter")||e(this).hasClass("filter-parsed")}).get(),u=0;u<k.columns;u++)H.functions[u]=t.getColumnData(r,T.filter_functions,u),H.defaultColFilter[u]=t.getColumnData(r,T.filter_defaultFilter,u)||"",H.excludeFilter[u]=(t.getColumnData(r,T.filter_excludeFilter,u,!0)||"").split(/\s+/);for(k.debug&&(t.log("Filter: Starting filter widget search",i),b=new Date),k.filteredRows=0,k.totalRows=0,l=(F||[]).join(""),d=0;d<k.$tbodies.length;d++){if(f=t.processTbody(r,k.$tbodies.eq(d),!0),u=k.columns,s=k.cache[d].normalized,o=e(e.map(s,function(e){return e[u].$row.get()})),""===l||T.filter_serversideFiltering)o.removeClass(T.filter_filteredRow).not("."+k.cssChildRow).css("display","");else{if(o=o.not("."+k.cssChildRow),a=o.length,(T.filter_$anyMatch&&T.filter_$anyMatch.length||"undefined"!=typeof i[k.columns])&&(A.anyMatchFlag=!0,A.anyMatchFilter=""+(i[k.columns]||T.filter_$anyMatch&&t.filter.getLatestSearch(T.filter_$anyMatch).val()||""),T.filter_columnAnyMatch)){for(x=A.anyMatchFilter.split(R.andSplit),C=!1,_=0;_<x.length;_++)z=x[_].split(":"),z.length>1&&(S=parseInt(z[0],10)-1,S>=0&&S<k.columns&&(i[S]=z[1],x.splice(_,1),_--,C=!0));C&&(A.anyMatchFilter=x.join(" && "))}if(w=T.filter_searchFiltered,g=k.lastSearch||k.$table.data("lastSearch")||[],w)for(_=0;u+1>_;_++)y=i[_]||"",w||(_=u),w=!(!w||!g.length||0!==y.indexOf(g[_]||"")||R.alreadyFiltered.test(y)||/[=\"\|!]/.test(y)||/(>=?\s*-\d)/.test(y)||/(<=?\s*\d)/.test(y)||""!==y&&k.$filters&&k.$filters.eq(_).find("select").length&&!k.$headerIndexed[_].hasClass("filter-match"));for(v=o.not("."+T.filter_filteredRow).length,w&&0===v&&(w=!1),k.debug&&t.log("Filter: Searching through "+(w&&a>v?v:"all")+" rows"),A.anyMatchFlag&&(k.sortLocaleCompare&&(A.anyMatchFilter=t.replaceAccents(A.anyMatchFilter)),T.filter_defaultFilter&&R.iQuery.test(H.defaultAnyFilter)&&(A.anyMatchFilter=t.filter.defaultFilter(A.anyMatchFilter,H.defaultAnyFilter),w=!1),A.iAnyMatchFilter=T.filter_ignoreCase&&k.ignoreCase?A.anyMatchFilter.toLowerCase():A.anyMatchFilter),c=0;a>c;c++)if($=o[c].className,h=c&&R.child.test($),!(h||w&&R.filtered.test($))){if(A.$row=o.eq(c),A.cacheArray=s[c],n=A.cacheArray[k.columns],A.rawArray=n.raw,A.childRowText="",!T.filter_childByColumn){for($="",p=n.child,_=0;_<p.length;_++)$+=" "+p[_].join("")||"";A.childRowText=T.filter_childRows?T.filter_ignoreCase?$.toLowerCase():$:""}if(m=t.filter.processRow(k,A,H),p=n.$row.filter(":gt( 0 )"),T.filter_childRows&&p.length){if(T.filter_childByColumn)for(_=0;_<p.length;_++)A.$row=p.eq(_),A.cacheArray=n.child[_],A.rawArray=A.cacheArray,m=m||t.filter.processRow(k,A,H);p.toggleClass(T.filter_filteredRow,!m)}n.$row.toggleClass(T.filter_filteredRow,!m)[0].display=m?"":"none"}}k.filteredRows+=o.not("."+T.filter_filteredRow).length,k.totalRows+=o.length,t.processTbody(r,f,!1)}k.lastCombinedFilter=l,k.lastSearch=F,k.$table.data("lastSearch",F),T.filter_saveFilters&&t.storage&&t.storage(r,"tablesorter-filters",F),k.debug&&t.benchmark("Completed filter widget search",b),T.filter_initialized&&k.$table.trigger("filterEnd",k),setTimeout(function(){k.$table.trigger("applyWidgets")},0)}},getOptionSource:function(r,i,l){r=e(r)[0];var a,s,n,o,c=r.config,d=c.widgetOptions,f=[],u=!1,h=d.filter_selectSource,p=c.$table.data("lastSearch")||[],g=e.isFunction(h)?!0:t.getColumnData(r,h,i);if(l&&""!==p[i]&&(l=!1),g===!0)u=h(r,i,l);else{if(g instanceof e||"string"===e.type(g)&&g.indexOf("</option>")>=0)return g;e.isArray(g)?u=g:"object"===e.type(h)&&g&&(u=g(r,i,l))}if(u===!1&&(u=t.filter.getOptions(r,i,l)),u=e.grep(u,function(t,r){return e.inArray(t,u)===r}),c.$headerIndexed[i].hasClass("filter-select-nosort"))return u;for(o=u.length,n=0;o>n;n++)s=u[n],f.push({t:s,p:c.parsers&&c.parsers.length&&c.parsers[i].format(s,r,[],i)||s});for(a=c.textSorter||"",f.sort(function(l,s){var n=l.p.toString(),o=s.p.toString();return e.isFunction(a)?a(n,o,!0,i,r):"object"==typeof a&&a.hasOwnProperty(i)?a[i](n,o,!0,i,r):t.sortNatural?t.sortNatural(n,o):!0}),u=[],o=f.length,n=0;o>n;n++)u.push(f[n].t);return u},getOptions:function(t,r,i){t=e(t)[0];var l,a,s,n,o,c=t.config,d=c.widgetOptions,f=[];for(a=0;a<c.$tbodies.length;a++)for(o=c.cache[a],s=c.cache[a].normalized.length,l=0;s>l;l++)n=o.row?o.row[l]:o.normalized[l][c.columns].$row[0],i&&n.className.match(d.filter_filteredRow)||f.push(d.filter_useParsedData||c.parsers[r].parsed||c.$headerIndexed[r].hasClass("filter-parsed")?""+o.normalized[l][r]:o.normalized[l][c.columns].raw[r]);return f},buildSelect:function(i,l,a,s,n){if(i=e(i)[0],l=parseInt(l,10),i.config.cache&&!e.isEmptyObject(i.config.cache)){var o,c,d,f,u,h,p=i.config,g=p.widgetOptions,m=p.$headerIndexed[l],b='<option value="">'+(m.data("placeholder")||m.attr("data-placeholder")||g.filter_placeholder.select||"")+"</option>",y=p.$table.find("thead").find("select."+r.filter+'[data-column="'+l+'"]').val();if(("undefined"==typeof a||""===a)&&(a=t.filter.getOptionSource(i,l,n)),e.isArray(a)){for(o=0;o<a.length;o++)d=a[o]=(""+a[o]).replace(/\"/g,"&quot;"),c=d,d.indexOf(g.filter_selectSourceSeparator)>=0&&(f=d.split(g.filter_selectSourceSeparator),c=f[0],d=f[1]),b+=""!==a[o]?"<option "+(c===d?"":'data-function-name="'+a[o]+'" ')+'value="'+c+'">'+d+"</option>":"";a=[]}u=(p.$filters?p.$filters:p.$table.children("thead")).find("."+r.filter),g.filter_$externalFilters&&(u=u&&u.length?u.add(g.filter_$externalFilters):g.filter_$externalFilters),h=u.filter('select[data-column="'+l+'"]'),h.length&&(h[s?"html":"append"](b),e.isArray(a)||h.append(a).val(y),h.val(y))}},buildDefault:function(e,r){var i,l,a,s=e.config,n=s.widgetOptions,o=s.columns;for(i=0;o>i;i++)l=s.$headerIndexed[i],a=!(l.hasClass("filter-false")||l.hasClass("parser-false")),(l.hasClass("filter-select")||t.getColumnData(e,n.filter_functions,i)===!0)&&a&&t.filter.buildSelect(e,i,"",r,l.hasClass(n.filter_onlyAvail))}},t.getFilters=function(i,l,a,s){var n,o,c,d,f=!1,u=i?e(i)[0].config:"",h=u?u.widgetOptions:"";if(l!==!0&&h&&!h.filter_columnFilters||e.isArray(a)&&a.join("")===u.lastCombinedFilter)return e(i).data("lastSearch");if(u&&(u.$filters&&(o=u.$filters.find("."+r.filter)),h.filter_$externalFilters&&(o=o&&o.length?o.add(h.filter_$externalFilters):h.filter_$externalFilters),o&&o.length))for(f=a||[],n=0;n<u.columns+1;n++)d=n===u.columns?h.filter_anyColumnSelector+","+h.filter_multipleColumnSelector:'[data-column="'+n+'"]',c=o.filter(d),c.length&&(c=t.filter.getLatestSearch(c),e.isArray(a)?(s&&c.length>1&&(c=c.slice(1)),n===u.columns&&(d=c.filter(h.filter_anyColumnSelector),c=d.length?d:c),c.val(a[n]).trigger("change.tsfilter")):(f[n]=c.val()||"",n===u.columns?c.slice(1).filter('[data-column*="'+c.attr("data-column")+'"]').val(f[n]):c.slice(1).val(f[n])),n===u.columns&&c.length&&(h.filter_$anyMatch=c)); return 0===f.length&&(f=!1),f},t.setFilters=function(r,i,l,a){var s=r?e(r)[0].config:"",n=t.getFilters(r,!0,i,a);return s&&l&&(s.lastCombinedFilter=null,s.lastSearch=[],t.filter.searching(s.table,i,a),s.$table.trigger("filterFomatterUpdate")),!!n}}(jQuery),function(e,t){"use strict";var r=e.tablesorter||{};e.extend(r.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),r.addHeaderResizeEvent=function(t,r,i){if(t=e(t)[0],t.config){var l={timer:250},a=e.extend({},l,i),s=t.config,n=s.widgetOptions,o=function(e){var t,r,i,l,a,o,c=s.$headers.length;for(n.resize_flag=!0,r=[],t=0;c>t;t++)i=s.$headers.eq(t),l=i.data("savedSizes")||[0,0],a=i[0].offsetWidth,o=i[0].offsetHeight,(a!==l[0]||o!==l[1])&&(i.data("savedSizes",[a,o]),r.push(i[0]));r.length&&e!==!1&&s.$table.trigger("resize",[r]),n.resize_flag=!1};return o(!1),clearInterval(n.resize_timer),r?(n.resize_flag=!1,!1):void(n.resize_timer=setInterval(function(){n.resize_flag||o()},a.timer))}},r.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(i,l,a){if(!(l.$table.hasClass("hasStickyHeaders")||e.inArray("filter",l.widgets)>=0&&!l.$table.hasClass("hasFilters"))){var s,n,o,c,d=l.$table,f=e(a.stickyHeaders_attachTo),u=l.namespace+"stickyheaders ",h=e(a.stickyHeaders_yScroll||a.stickyHeaders_attachTo||t),p=e(a.stickyHeaders_xScroll||a.stickyHeaders_attachTo||t),g=d.children("thead:first"),m=g.children("tr").not(".sticky-false").children(),b=d.children("tfoot"),y=isNaN(a.stickyHeaders_offset)?e(a.stickyHeaders_offset):"",_=y.length?y.height()||0:parseInt(a.stickyHeaders_offset,10)||0,v=d.parent().closest("."+r.css.table).hasClass("hasStickyHeaders")?d.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],w=v.length?v.height():0,x=a.$sticky=d.clone().addClass("containsStickyHeaders "+r.css.sticky+" "+a.stickyHeaders+" "+l.namespace.slice(1)+"_extra_table").wrap('<div class="'+r.css.stickyWrap+'">'),C=x.parent().addClass(r.css.stickyHide).css({position:f.length?"absolute":"fixed",padding:parseInt(x.parent().parent().css("padding-left"),10),top:_+w,left:0,visibility:"hidden",zIndex:a.stickyHeaders_zIndex||2}),z=x.children("thead:first"),S="",$=0,F=function(e,r){var i,l,a,s,n,o=e.filter(":visible"),c=o.length;for(i=0;c>i;i++)s=r.filter(":visible").eq(i),n=o.eq(i),"border-box"===n.css("box-sizing")?l=n.outerWidth():"collapse"===s.css("border-collapse")?t.getComputedStyle?l=parseFloat(t.getComputedStyle(n[0],null).width):(a=parseFloat(n.css("border-width")),l=n.outerWidth()-parseFloat(n.css("padding-left"))-parseFloat(n.css("padding-right"))-a):l=n.width(),s.css({width:l,"min-width":l,"max-width":l})},R=function(){_=y.length?y.height()||0:parseInt(a.stickyHeaders_offset,10)||0,$=0,C.css({left:f.length?parseInt(f.css("padding-left"),10)||0:d.offset().left-parseInt(d.css("margin-left"),10)-p.scrollLeft()-$,width:d.outerWidth()}),F(d,x),F(m,c)},k=function(t){if(d.is(":visible")){w=v.length?v.offset().top-h.scrollTop()+v.height():0;var i=d.offset(),l=e.isWindow(h[0]),a=e.isWindow(p[0]),s=(f.length?l?h.scrollTop():h.offset().top:h.scrollTop())+_+w,n=d.height()-(C.height()+(b.height()||0)),o=s>i.top&&s<i.top+n?"visible":"hidden",c={visibility:o};f.length&&(c.top=l?s-f.offset().top:f.scrollTop()),a&&(c.left=d.offset().left-parseInt(d.css("margin-left"),10)-p.scrollLeft()-$),v.length&&(c.top=(c.top||0)+_+w),C.removeClass(r.css.stickyVis+" "+r.css.stickyHide).addClass("visible"===o?r.css.stickyVis:r.css.stickyHide).css(c),(o!==S||t)&&(R(),S=o)}};if(f.length&&!f.css("position")&&f.css("position","relative"),x.attr("id")&&(x[0].id+=a.stickyHeaders_cloneId),x.find("thead:gt(0), tr.sticky-false").hide(),x.find("tbody, tfoot").remove(),x.find("caption").toggle(a.stickyHeaders_includeCaption),c=z.children().children(),x.css({height:0,width:0,margin:0}),c.find("."+r.css.resizer).remove(),d.addClass("hasStickyHeaders").bind("pagerComplete"+u,function(){R()}),r.bindEvents(i,z.children().children("."+r.css.header)),d.after(C),l.onRenderHeader)for(o=z.children("tr").children(),n=o.length,s=0;n>s;s++)l.onRenderHeader.apply(o.eq(s),[s,l,x]);p.add(h).unbind("scroll resize ".split(" ").join(u).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(u),function(e){k("resize"===e.type)}),l.$table.unbind("stickyHeadersUpdate"+u).bind("stickyHeadersUpdate"+u,function(){k(!0)}),a.stickyHeaders_addResizeEvent&&r.addHeaderResizeEvent(i),d.hasClass("hasFilters")&&a.filter_columnFilters&&(d.bind("filterEnd"+u,function(){var i=e(document.activeElement).closest("td"),s=i.parent().children().index(i);C.hasClass(r.css.stickyVis)&&a.stickyHeaders_filteredToTop&&(t.scrollTo(0,d.position().top),s>=0&&l.$filters&&l.$filters.eq(s).find("a, select, input").filter(":visible").focus())}),r.filter.bindSearch(d,c.find("."+r.css.filter)),a.filter_hideFilters&&r.filter.hideFilters(x,l)),d.trigger("stickyHeadersInit")}},remove:function(i,l,a){var s=l.namespace+"stickyheaders ";l.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd stickyHeadersUpdate ".split(" ").join(s).replace(/\s+/g," ")).next("."+r.css.stickyWrap).remove(),a.$sticky&&a.$sticky.length&&a.$sticky.remove(),e(t).add(a.stickyHeaders_xScroll).add(a.stickyHeaders_yScroll).add(a.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(s).replace(/\s+/g," ")),r.addHeaderResizeEvent(i,!1)}})}(jQuery,window),function(e,t){"use strict";var r=e.tablesorter||{};e.extend(r.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),e(function(){var t="<style>body."+r.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+r.css.resizableContainer+" { position: relative; height: 1px; }."+r.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px;top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";e(t).appendTo("body")}),r.resizable={init:function(t,i){if(!t.$table.hasClass("hasResizable")){t.$table.addClass("hasResizable");var l,a,s,n,o,c=t.$table,d=c.parent(),f=parseInt(c.css("margin-top"),10),u=i.resizable_={useStorage:r.storage&&i.resizable!==!1,$wrap:d,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===d.css("overflow")||"scroll"===d.css("overflow")||"auto"===d.css("overflow-x")||"scroll"===d.css("overflow-x"),storedSizes:[]};for(r.resizableReset(t.table,!0),u.tableWidth=c.width(),u.fullWidth=Math.abs(d.width()-u.tableWidth)<20,u.useStorage&&u.overflow&&(r.storage(t.table,"tablesorter-table-original-css-width",u.tableWidth),o=r.storage(t.table,"tablesorter-table-resized-width")||"auto",r.resizable.setWidth(c,o,!0)),i.resizable_.storedSizes=n=(u.useStorage?r.storage(t.table,r.css.resizableStorage):[])||[],r.resizable.setWidths(t,i,n),r.resizable.updateStoredSizes(t,i),i.$resizable_container=e('<div class="'+r.css.resizableContainer+'">').css({top:f}).insertBefore(c),s=0;s<t.columns;s++)a=t.$headerIndexed[s],o=r.getColumnData(t.table,t.headers,s),l="false"===r.getData(a,o,"resizable"),l||e('<div class="'+r.css.resizableHandle+'">').appendTo(i.$resizable_container).attr({"data-column":s,unselectable:"on"}).data("header",a).bind("selectstart",!1);c.one("tablesorter-initialized",function(){r.resizable.setHandlePosition(t,i),r.resizable.bindings(this.config,this.config.widgetOptions)})}},updateStoredSizes:function(e,t){var r,i,l=e.columns,a=t.resizable_;for(a.storedSizes=[],r=0;l>r;r++)i=e.$headerIndexed[r],a.storedSizes[r]=i.is(":visible")?i.width():0},setWidth:function(e,t,r){e.css({width:t,"min-width":r?t:"","max-width":r?t:""})},setWidths:function(t,i,l){var a,s,n=i.resizable_,o=e(t.namespace+"_extra_headers"),c=t.$table.children("colgroup").children("col");if(l=l||n.storedSizes||[],l.length){for(a=0;a<t.columns;a++)r.resizable.setWidth(t.$headerIndexed[a],l[a],n.overflow),o.length&&(s=o.eq(a).add(c.eq(a)),r.resizable.setWidth(s,l[a],n.overflow));s=e(t.namespace+"_extra_table"),s.length&&!r.hasWidget(t.table,"scroller")&&r.resizable.setWidth(s,t.$table.outerWidth(),n.overflow)}},setHandlePosition:function(t,i){var l,a=r.hasWidget(t.table,"scroller"),s=t.$table.height(),n=i.$resizable_container.children(),o=Math.floor(n.width()/2);a&&(s=0,t.$table.closest("."+r.css.scrollerWrap).children().each(function(){var t=e(this);s+=t.filter('[style*="height"]').length?t.height():t.children("table").height()})),l=t.$table.position().left,n.each(function(){var r=e(this),a=parseInt(r.attr("data-column"),10),n=t.columns-1,c=r.data("header");c&&(c.is(":visible")?(n>a||a===n&&i.resizable_addLastColumn)&&r.css({display:"inline-block",height:s,left:c.position().left-l+c.outerWidth()-o}):r.hide())})},toggleTextSelection:function(t,i){var l=t.namespace+"tsresize";t.widgetOptions.resizable_.disabled=i,e("body").toggleClass(r.css.resizableNoSelect,i),i?e("body").attr("unselectable","on").bind("selectstart"+l,!1):e("body").removeAttr("unselectable").unbind("selectstart"+l)},bindings:function(i,l){var a=i.namespace+"tsresize";l.$resizable_container.children().bind("mousedown",function(t){var a,s=l.resizable_,n=e(i.namespace+"_extra_headers"),o=e(t.target).data("header");a=parseInt(o.attr("data-column"),10),s.$target=o=o.add(n.filter('[data-column="'+a+'"]')),s.target=a,s.$next=t.shiftKey||l.resizable_targetLast?o.parent().children().not(".resizable-false").filter(":last"):o.nextAll(":not(.resizable-false)").eq(0),a=parseInt(s.$next.attr("data-column"),10),s.$next=s.$next.add(n.filter('[data-column="'+a+'"]')),s.next=a,s.mouseXPosition=t.pageX,r.resizable.updateStoredSizes(i,l),r.resizable.toggleTextSelection(i,!0)}),e(document).bind("mousemove"+a,function(e){var t=l.resizable_;t.disabled&&0!==t.mouseXPosition&&t.$target&&(l.resizable_throttle?(clearTimeout(t.timer),t.timer=setTimeout(function(){r.resizable.mouseMove(i,l,e)},isNaN(l.resizable_throttle)?5:l.resizable_throttle)):r.resizable.mouseMove(i,l,e))}).bind("mouseup"+a,function(){l.resizable_.disabled&&(r.resizable.toggleTextSelection(i,!1),r.resizable.stopResize(i,l),r.resizable.setHandlePosition(i,l))}),e(t).bind("resize"+a+" resizeEnd"+a,function(){r.resizable.setHandlePosition(i,l)}),i.$table.bind("columnUpdate"+a,function(){r.resizable.setHandlePosition(i,l)}).find("thead:first").add(e(i.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+a,function(){var e=0===l.resizable_.storedSizes.length;return r.resizableReset(i.table),r.resizable.setHandlePosition(i,l),l.resizable_.storedSizes=[],e})},mouseMove:function(t,i,l){if(0!==i.resizable_.mouseXPosition&&i.resizable_.$target){var a,s=0,n=i.resizable_,o=n.$next,c=n.storedSizes[n.target],d=l.pageX-n.mouseXPosition;if(n.overflow){if(c+d>0){for(n.storedSizes[n.target]+=d,r.resizable.setWidth(n.$target,n.storedSizes[n.target],!0),a=0;a<t.columns;a++)s+=n.storedSizes[a];r.resizable.setWidth(t.$table.add(e(t.namespace+"_extra_table")),s)}o.length||(n.$wrap[0].scrollLeft=t.$table.width())}else n.fullWidth?(n.storedSizes[n.target]+=d,n.storedSizes[n.next]-=d,r.resizable.setWidths(t,i)):(n.storedSizes[n.target]+=d,r.resizable.setWidths(t,i));n.mouseXPosition=l.pageX,t.$table.trigger("stickyHeadersUpdate")}},stopResize:function(e,t){var i=t.resizable_;r.resizable.updateStoredSizes(e,t),i.useStorage&&(r.storage(e.table,r.css.resizableStorage,i.storedSizes),r.storage(e.table,"tablesorter-table-resized-width",e.$table.width())),i.mouseXPosition=0,i.$target=i.$next=null,e.$table.trigger("stickyHeadersUpdate")}},r.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1,resizable_fullWidth:null},init:function(e,t,i,l){r.resizable.init(i,l)},remove:function(t,i,l,a){if(l.$resizable_container){var s=i.namespace+"tsresize";i.$table.add(e(i.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+s),l.$resizable_container.remove(),r.resizable.toggleTextSelection(i,!1),r.resizableReset(t,a),e(document).unbind("mousemove"+s+" mouseup"+s)}}}),r.resizableReset=function(t,i){e(t).each(function(){var e,l,a=this.config,s=a&&a.widgetOptions,n=s.resizable_;if(t&&a&&a.$headerIndexed.length){for(n.overflow&&n.tableWidth&&(r.resizable.setWidth(a.$table,n.tableWidth,!0),n.useStorage&&r.storage(t,"tablesorter-table-resized-width","auto")),e=0;e<a.columns;e++)l=a.$headerIndexed[e],s.resizable_widths&&s.resizable_widths[e]?r.resizable.setWidth(l,s.resizable_widths[e],n.overflow):l.hasClass("resizable-false")||r.resizable.setWidth(l,"",n.overflow);a.$table.trigger("stickyHeadersUpdate"),r.storage&&!i&&r.storage(this,r.css.resizableStorage,{})}})}}(jQuery,window),function(e){"use strict";var t=e.tablesorter||{};t.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(e,t,r,i){t.format(e,r,i,!0)},format:function(r,i,l,a){var s,n,o=i.$table,c=l.saveSort!==!1,d={sortList:i.sortList};i.debug&&(n=new Date),o.hasClass("hasSaveSort")?c&&r.hasInitialized&&t.storage&&(t.storage(r,"tablesorter-savesort",d),i.debug&&t.benchmark("saveSort widget: Saving last sort: "+i.sortList,n)):(o.addClass("hasSaveSort"),d="",t.storage&&(s=t.storage(r,"tablesorter-savesort"),d=s&&s.hasOwnProperty("sortList")&&e.isArray(s.sortList)?s.sortList:"",i.debug&&t.benchmark('saveSort: Last sort loaded: "'+d+'"',n),o.bind("saveSortReset",function(e){e.stopPropagation(),t.storage(r,"tablesorter-savesort","")})),a&&d&&d.length>0?i.sortList=d:r.hasInitialized&&d&&d.length>0&&o.trigger("sorton",[d]))},remove:function(e,r){r.$table.removeClass("hasSaveSort"),t.storage&&t.storage(e,"tablesorter-savesort","")}})}(jQuery),e.tablesorter}); /* custom */ $(document).ready(function(){$('.table-sortable').tablesorter({theme:'bootstrap',widgets:['uitheme','zebra','filter','stickyHeaders','saveSort'],headerTemplate:'{content} {icon}',widthFixed:true,ignoreCase:true,widgetOptions:{filter_columnFilters:true,zebra:['even','odd'],filter_reset:'.reset'}});}); \ No newline at end of file
diff --git a/library/cpp/monlib/service/pages/tablesorter/ya.make b/library/cpp/monlib/service/pages/tablesorter/ya.make
new file mode 100644
index 0000000000..b5b6a64da8
--- /dev/null
+++ b/library/cpp/monlib/service/pages/tablesorter/ya.make
@@ -0,0 +1,14 @@
+LIBRARY()
+
+OWNER(blinkov)
+
+RESOURCE(
+ resources/jquery.tablesorter.css jquery.tablesorter.css
+ resources/jquery.tablesorter.js jquery.tablesorter.js
+)
+
+PEERDIR(
+ library/cpp/monlib/dynamic_counters
+)
+
+END()
diff --git a/library/cpp/monlib/service/pages/templates.cpp b/library/cpp/monlib/service/pages/templates.cpp
new file mode 100644
index 0000000000..ece12bea71
--- /dev/null
+++ b/library/cpp/monlib/service/pages/templates.cpp
@@ -0,0 +1,35 @@
+#include "templates.h"
+
+namespace NMonitoring {
+ extern const char HtmlTag[] = "html";
+ extern const char HeadTag[] = "head";
+ extern const char BodyTag[] = "body";
+ extern const char DivTag[] = "div";
+ extern const char TableTag[] = "table";
+ extern const char TableHeadTag[] = "thead";
+ extern const char TableBodyTag[] = "tbody";
+ extern const char TableRTag[] = "tr";
+ extern const char TableDTag[] = "td";
+ extern const char TableHTag[] = "th";
+ extern const char FormTag[] = "form";
+ extern const char LabelTag[] = "label";
+ extern const char SpanTag[] = "span";
+ extern const char CaptionTag[] = "caption";
+ extern const char PreTag[] = "pre";
+ extern const char ParaTag[] = "p";
+ extern const char H1Tag[] = "h1";
+ extern const char H2Tag[] = "h2";
+ extern const char H3Tag[] = "h3";
+ extern const char H4Tag[] = "h4";
+ extern const char H5Tag[] = "h5";
+ extern const char H6Tag[] = "h6";
+ extern const char SmallTag[] = "small";
+ extern const char StrongTag[] = "strong";
+ extern const char ListTag[] = "li";
+ extern const char UListTag[] = "ul";
+ extern const char OListTag[] = "ol";
+ extern const char DListTag[] = "dl";
+ extern const char DTermTag[] = "dt";
+ extern const char DDescTag[] = "dd";
+
+}
diff --git a/library/cpp/monlib/service/pages/templates.h b/library/cpp/monlib/service/pages/templates.h
new file mode 100644
index 0000000000..b4656f059f
--- /dev/null
+++ b/library/cpp/monlib/service/pages/templates.h
@@ -0,0 +1,268 @@
+#pragma once
+
+#include <util/stream/output.h>
+#include <util/system/defaults.h>
+
+#define WITH_SCOPED(var, value) WITH_SCOPED_I(var, value, Y_GENERATE_UNIQUE_ID(WITH_SCOPED_LABEL_))
+
+#define WITH_SCOPED_I(var, value, label) \
+ if (auto var = (value)) { \
+ Y_UNUSED(var); \
+ goto label; \
+ } else \
+ label \
+ :
+
+#define TAG(name) WITH_SCOPED(tmp, NMonitoring::name(__stream))
+#define TAG_CLASS(name, cls) WITH_SCOPED(tmp, NMonitoring::name(__stream, cls))
+#define TAG_CLASS_STYLE(name, cls, style) WITH_SCOPED(tmp, NMonitoring::name(__stream, {{"class", cls}, {"style", style}}))
+#define TAG_CLASS_ID(name, cls, id) WITH_SCOPED(tmp, NMonitoring::name(__stream, cls, "", id))
+#define TAG_CLASS_FOR(name, cls, for0) WITH_SCOPED(tmp, NMonitoring::name(__stream, cls, for0))
+#define TAG_ATTRS(name, ...) WITH_SCOPED(tmp, NMonitoring::name(__stream, ##__VA_ARGS__))
+
+#define HTML(str) WITH_SCOPED(__stream, NMonitoring::TOutputStreamRef(str))
+
+#define HEAD() TAG(THead)
+#define BODY() TAG(TBody)
+#define HTML_TAG() TAG(THtml)
+#define DIV() TAG(TDiv)
+#define DIV_CLASS(cls) TAG_CLASS(TDiv, cls)
+#define DIV_CLASS_ID(cls, id) TAG_CLASS_ID(TDiv, cls, id)
+#define PRE() TAG(TPre)
+#define TABLE() TAG(TTable)
+#define TABLE_CLASS(cls) TAG_CLASS(TTable, cls)
+#define TABLE_SORTABLE() TABLE_CLASS("table-sortable")
+#define TABLE_SORTABLE_CLASS(cls) TABLE_CLASS(cls " table-sortable")
+#define TABLEHEAD() TAG(TTableHead)
+#define TABLEHEAD_CLASS(cls) TAG_CLASS(TTableHead, cls)
+#define TABLEBODY() TAG(TTableBody)
+#define TABLEBODY_CLASS(cls) TAG_CLASS(TTableBody, cls)
+#define TABLER() TAG(TTableR)
+#define TABLER_CLASS(cls) TAG_CLASS(TTableR, cls)
+#define TABLED() TAG(TTableD)
+#define TABLED_CLASS(cls) TAG_CLASS(TTableD, cls)
+#define TABLED_ATTRS(...) TAG_ATTRS(TTableD, ##__VA_ARGS__)
+#define TABLEH() TAG(TTableH)
+#define TABLEH_CLASS(cls) TAG_CLASS(TTableH, cls)
+#define FORM() TAG(TFormC)
+#define FORM_CLASS(cls) TAG_CLASS(TFormC, cls)
+#define LABEL() TAG(TLabelC)
+#define LABEL_CLASS(cls) TAG_CLASS(TLabelC, cls)
+#define LABEL_CLASS_FOR(cls, for0) TAG_CLASS_FOR(TLabelC, cls, for0)
+#define SPAN_CLASS(cls) TAG_CLASS(TSpanC, cls)
+#define SPAN_CLASS_STYLE(cls, style) TAG_CLASS_STYLE(TSpanC, cls, style)
+
+#define PARA() TAG(TPara)
+#define PARA_CLASS(cls) TAG_CLASS(TPara, cls)
+
+#define H1() TAG(TH1)
+#define H1_CLASS(cls) TAG_CLASS(TH1, cls)
+#define H2() TAG(TH2)
+#define H2_CLASS(cls) TAG_CLASS(TH2, cls)
+#define H3() TAG(TH3)
+#define H3_CLASS(cls) TAG_CLASS(TH3, cls)
+#define H4() TAG(TH4)
+#define H4_CLASS(cls) TAG_CLASS(TH4, cls)
+#define H5() TAG(TH5)
+#define H5_CLASS(cls) TAG_CLASS(TH5, cls)
+#define H6() TAG(TH6)
+#define H6_CLASS(cls) TAG_CLASS(TH6, cls)
+
+#define SMALL() TAG(TSMALL)
+#define STRONG() TAG(TSTRONG)
+
+#define LI() TAG(TLIST)
+#define LI_CLASS(cls) TAG_CLASS(TLIST, cls)
+#define UL() TAG(TULIST)
+#define UL_CLASS(cls) TAG_CLASS(TULIST, cls)
+#define OL() TAG(TOLIST)
+#define OL_CLASS(cls) TAG_CLASS(TOLIST, cls)
+
+#define DL() TAG(DLIST)
+#define DL_CLASS(cls) TAG_CLASS(DLIST, cls)
+#define DT() TAG(DTERM)
+#define DT_CLASS(cls) TAG_CLASS(DTERM, cls)
+#define DD() TAG(DDESC)
+#define DD_CLASS(cls) TAG_CLASS(DDESC, cls)
+
+#define CAPTION() TAG(TCaption)
+#define CAPTION_CLASS(cls) CAPTION_CLASS(TCaption, cls)
+
+#define HTML_OUTPUT_PARAM(str, param) str << #param << ": " << param << "<br/>"
+#define HTML_OUTPUT_TIME_PARAM(str, param) str << #param << ": " << ToStringLocalTimeUpToSeconds(param) << "<br/>"
+
+#define COLLAPSED_BUTTON_CONTENT(targetId, buttonText) \
+ WITH_SCOPED(tmp, NMonitoring::TCollapsedButton(__stream, targetId, buttonText))
+
+#define HREF(path) \
+ WITH_SCOPED(tmp, NMonitoring::THref(__stream, path))
+
+namespace NMonitoring {
+ struct THref {
+ THref(IOutputStream& str, TStringBuf path)
+ : Str(str)
+ {
+ Str << "<a href="<< path << '>';
+ }
+
+ ~THref() {
+ Str << "</a>";
+ }
+
+ explicit inline operator bool() const noexcept {
+ return true; // just to work with WITH_SCOPED
+ }
+
+ IOutputStream& Str;
+ };
+
+ template <const char* tag>
+ struct TTag {
+ TTag(IOutputStream& str, TStringBuf cls = "", TStringBuf for0 = "", TStringBuf id = "")
+ : Str(str)
+ {
+ Str << "<" << tag;
+
+ if (!cls.empty()) {
+ Str << " class=\"" << cls << "\"";
+ }
+
+ if (!for0.empty()) {
+ Str << " for=\"" << for0 << "\"";
+ }
+
+ if (!id.empty()) {
+ Str << "id=\"" << id << "\"";
+ }
+ Str << ">";
+ }
+
+ TTag(IOutputStream& str, std::initializer_list<std::pair<TStringBuf, TStringBuf>> attributes)
+ : Str(str)
+ {
+ Str << "<" << tag;
+ for (const std::pair<TStringBuf, TStringBuf>& attr : attributes) {
+ if (!attr.second.empty()) {
+ Str << ' ' << attr.first << "=\"" << attr.second << "\"";
+ }
+ }
+ Str << ">";
+ }
+
+ ~TTag() {
+ try {
+ Str << "</" << tag << ">";
+ } catch (...) {
+ }
+ }
+
+ explicit inline operator bool() const noexcept {
+ return true; // just to work with WITH_SCOPED
+ }
+
+ IOutputStream& Str;
+ };
+
+ // a nice class for creating collapsable regions of html output
+ struct TCollapsedButton {
+ TCollapsedButton(IOutputStream& str, const TString& targetId, const TString& buttonText)
+ : Str(str)
+ {
+ Str << "<button type='button' class='btn' data-toggle='collapse' data-target='#" << targetId << "'>"
+ << buttonText << "</button>";
+ Str << "<div id='" << targetId << "' class='collapse'>";
+ }
+
+ ~TCollapsedButton() {
+ try {
+ Str << "</div>";
+ } catch (...) {
+ }
+ }
+
+ explicit inline operator bool() const noexcept {
+ return true; // just to work with WITH_SCOPED
+ }
+
+ IOutputStream& Str;
+ };
+
+ struct TOutputStreamRef {
+ TOutputStreamRef(IOutputStream& str)
+ : Str(str)
+ {
+ }
+
+ inline operator IOutputStream&() noexcept {
+ return Str;
+ }
+
+ explicit inline operator bool() const noexcept {
+ return true; // just to work with WITH_SCOPED
+ }
+
+ IOutputStream& Str;
+ };
+
+ extern const char HtmlTag[5];
+ extern const char HeadTag[5];
+ extern const char BodyTag[5];
+ extern const char DivTag[4];
+ extern const char TableTag[6];
+ extern const char TableHeadTag[6];
+ extern const char TableBodyTag[6];
+ extern const char TableRTag[3];
+ extern const char TableDTag[3];
+ extern const char TableHTag[3];
+ extern const char FormTag[5];
+ extern const char LabelTag[6];
+ extern const char SpanTag[5];
+ extern const char CaptionTag[8];
+ extern const char PreTag[4];
+ extern const char ParaTag[2];
+ extern const char H1Tag[3];
+ extern const char H2Tag[3];
+ extern const char H3Tag[3];
+ extern const char H4Tag[3];
+ extern const char H5Tag[3];
+ extern const char H6Tag[3];
+ extern const char SmallTag[6];
+ extern const char StrongTag[7];
+ extern const char ListTag[3];
+ extern const char UListTag[3];
+ extern const char OListTag[3];
+ extern const char DListTag[3];
+ extern const char DTermTag[3];
+ extern const char DDescTag[3];
+
+ typedef TTag<HtmlTag> THtml;
+ typedef TTag<HeadTag> THead;
+ typedef TTag<BodyTag> TBody;
+ typedef TTag<DivTag> TDiv;
+ typedef TTag<TableTag> TTable;
+ typedef TTag<TableHeadTag> TTableHead;
+ typedef TTag<TableBodyTag> TTableBody;
+ typedef TTag<TableRTag> TTableR;
+ typedef TTag<TableDTag> TTableD;
+ typedef TTag<TableHTag> TTableH;
+ typedef TTag<FormTag> TFormC;
+ typedef TTag<LabelTag> TLabelC;
+ typedef TTag<SpanTag> TSpanC;
+ typedef TTag<CaptionTag> TCaption;
+ typedef TTag<PreTag> TPre;
+ typedef TTag<ParaTag> TPara;
+ typedef TTag<H1Tag> TH1;
+ typedef TTag<H2Tag> TH2;
+ typedef TTag<H3Tag> TH3;
+ typedef TTag<H4Tag> TH4;
+ typedef TTag<H5Tag> TH5;
+ typedef TTag<H6Tag> TH6;
+ typedef TTag<SmallTag> TSMALL;
+ typedef TTag<StrongTag> TSTRONG;
+ typedef TTag<ListTag> TLIST;
+ typedef TTag<UListTag> TULIST;
+ typedef TTag<OListTag> TOLIST;
+ typedef TTag<DListTag> DLIST;
+ typedef TTag<DTermTag> DTERM;
+ typedef TTag<DDescTag> DDESC;
+}
diff --git a/library/cpp/monlib/service/pages/version_mon_page.cpp b/library/cpp/monlib/service/pages/version_mon_page.cpp
new file mode 100644
index 0000000000..41e29417da
--- /dev/null
+++ b/library/cpp/monlib/service/pages/version_mon_page.cpp
@@ -0,0 +1,16 @@
+#include <library/cpp/svnversion/svnversion.h>
+#include <library/cpp/build_info/build_info.h>
+#include <library/cpp/malloc/api/malloc.h>
+
+#include "version_mon_page.h"
+
+using namespace NMonitoring;
+
+void TVersionMonPage::OutputText(IOutputStream& out, NMonitoring::IMonHttpRequest&) {
+ const char* version = GetProgramSvnVersion();
+ out << version;
+ if (!TString(version).EndsWith("\n"))
+ out << "\n";
+ out << GetBuildInfo() << "\n\n";
+ out << "linked with malloc: " << NMalloc::MallocInfo().Name << "\n";
+}
diff --git a/library/cpp/monlib/service/pages/version_mon_page.h b/library/cpp/monlib/service/pages/version_mon_page.h
new file mode 100644
index 0000000000..f7649947e4
--- /dev/null
+++ b/library/cpp/monlib/service/pages/version_mon_page.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include "pre_mon_page.h"
+
+namespace NMonitoring {
+ struct TVersionMonPage: public TPreMonPage {
+ TVersionMonPage(const TString& path = "ver", const TString& title = "Version")
+ : TPreMonPage(path, title)
+ {
+ }
+
+ void OutputText(IOutputStream& out, NMonitoring::IMonHttpRequest&) override;
+ };
+
+}
diff --git a/library/cpp/monlib/service/pages/ya.make b/library/cpp/monlib/service/pages/ya.make
new file mode 100644
index 0000000000..48d44a0838
--- /dev/null
+++ b/library/cpp/monlib/service/pages/ya.make
@@ -0,0 +1,31 @@
+LIBRARY()
+
+OWNER(g:solomon)
+
+NO_WSHADOW()
+
+SRCS(
+ diag_mon_page.cpp
+ html_mon_page.cpp
+ index_mon_page.cpp
+ mon_page.cpp
+ pre_mon_page.cpp
+ resource_mon_page.cpp
+ templates.cpp
+ version_mon_page.cpp
+ registry_mon_page.cpp
+)
+
+PEERDIR(
+ library/cpp/build_info
+ library/cpp/malloc/api
+ library/cpp/svnversion
+ library/cpp/resource
+ library/cpp/monlib/service
+ library/cpp/monlib/encode/json
+ library/cpp/monlib/encode/text
+ library/cpp/monlib/encode/spack
+ library/cpp/monlib/encode/prometheus
+)
+
+END()